From e3c6d83b081d6315c5c10a041bde3569e907e99d Mon Sep 17 00:00:00 2001 From: Thomas Burgess Date: Mon, 26 Feb 2024 04:06:58 -0600 Subject: [PATCH] Terrain (#7) * Dynamic terrain getting started * infinite dynamic terrain * working without fog * Cleaned up shader loading * done --- build/index.js | 300238 ++++++++++++--- package.json | 2 + .../terrain/terrainFragmentShader.glsl | 26 + .../shaders/terrain/terrainVertexShader.glsl | 15 + .../shaders/tree/treeFragmentShader.glsl | 48 + src/assets/shaders/tree/treeVertexShader.glsl | 50 + src/components/dynamicTerrain.component.ts | 9 + .../locomotive/locomotive.component.ts | 4 +- .../trackBuilder/addButton.component.ts | 6 - src/components/tree.component.ts | 1 + .../babylon.dynamicTerrain_modular.ts | 1918 + src/game.ts | 58 +- src/systems/index.ts | 4 +- .../locomotive/locomotiveGui.system.ts | 8 +- .../terrain/dynamicTerrainInit.system.ts | 205 + src/systems/{ => terrain}/tree/index.ts | 0 src/systems/terrain/tree/treeInit.system.ts | 137 + src/systems/track/trackInit.system.ts | 21 +- .../trackBuilder/addButtonInit.system.ts | 30 - src/systems/trackBuilder/index.ts | 1 - src/systems/tree/treeInit.system.ts | 236 - src/utils/loadShaders.ts | 4 + 22 files changed, 256826 insertions(+), 46195 deletions(-) create mode 100644 src/assets/shaders/terrain/terrainFragmentShader.glsl create mode 100644 src/assets/shaders/terrain/terrainVertexShader.glsl create mode 100644 src/assets/shaders/tree/treeFragmentShader.glsl create mode 100644 src/assets/shaders/tree/treeVertexShader.glsl create mode 100644 src/components/dynamicTerrain.component.ts delete mode 100644 src/components/trackBuilder/addButton.component.ts create mode 100644 src/externals/babylon.dynamicTerrain_modular.ts create mode 100644 src/systems/terrain/dynamicTerrainInit.system.ts rename src/systems/{ => terrain}/tree/index.ts (100%) create mode 100644 src/systems/terrain/tree/treeInit.system.ts delete mode 100644 src/systems/trackBuilder/addButtonInit.system.ts delete mode 100644 src/systems/trackBuilder/index.ts delete mode 100644 src/systems/tree/treeInit.system.ts create mode 100644 src/utils/loadShaders.ts diff --git a/build/index.js b/build/index.js index e6a36f8..1a8401a 100644 --- a/build/index.js +++ b/build/index.js @@ -35,12 +35,12 @@ var __toCommonJS = (from) => { }; var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports); var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { - get: all[name], + for (var name2 in all) + __defProp(target, name2, { + get: all[name2], enumerable: true, configurable: true, - set: (newValue) => all[name] = () => newValue + set: (newValue) => all[name2] = () => newValue }); }; var __legacyDecorateClassTS = function(decorators, target, key, desc) { @@ -309,10 +309,10 @@ function __runInitializers(thisArg, initializers, value) { function __propKey(x) { return typeof x === "symbol" ? x : "".concat(x); } -function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") - name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); +function __setFunctionName(f, name2, prefix) { + if (typeof name2 === "symbol") + name2 = name2.description ? "[".concat(name2.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name2) : name2 }); } function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") @@ -2174,64 +2174,6 @@ var require_lib = __commonJS((exports) => { tslib_1.__exportStar(require_ReactionSystem(), exports); }); -// src/singletons/ecsEngine.ts -var import_tick_knock = __toESM(require_lib(), 1); - -class EcsEngine { - static instance; - static getInstance() { - if (!EcsEngine.instance) { - EcsEngine.instance = new import_tick_knock.Engine; - } - return EcsEngine.instance; - } -} - -// src/startup/systemRegistry.ts -var SystemRegistry = []; - -// src/systems/track/trackInit.system.ts -var import_tick_knock2 = __toESM(require_lib(), 1); - -// src/utils/types.ts -var InitializationStatus; -(function(InitializationStatus2) { - InitializationStatus2[InitializationStatus2["NotInitialized"] = 0] = "NotInitialized"; - InitializationStatus2[InitializationStatus2["Initializing"] = 1] = "Initializing"; - InitializationStatus2[InitializationStatus2["Initialized"] = 2] = "Initialized"; -})(InitializationStatus || (InitializationStatus = {})); - -// src/components/track.component.ts -class TrackComponent { - points; - sections; - initializationStatus = InitializationStatus.NotInitialized; - rotations = []; - constructor(points, sections) { - this.points = points; - this.sections = sections; - } -} - -class Section { - start; - options; - constructor(start, options) { - this.start = start; - this.options = { - lean: 0, - leanTwists: 0, - leanWaves: 0, - leanWaveAngle: 0, - turn: 0, - turnTwists: 0, - turnWaves: 0, - turnWaveAngle: 0, - ...options - }; - } -} - // node_modules/@babylonjs/core/abstractScene.js class AbstractScene { constructor() { @@ -2253,21 +2195,21 @@ class AbstractScene { this._environmentTexture = null; this.postProcesses = []; } - static AddParser(name, parser) { - this._BabylonFileParsers[name] = parser; + static AddParser(name2, parser) { + this._BabylonFileParsers[name2] = parser; } - static GetParser(name) { - if (this._BabylonFileParsers[name]) { - return this._BabylonFileParsers[name]; + static GetParser(name2) { + if (this._BabylonFileParsers[name2]) { + return this._BabylonFileParsers[name2]; } return null; } - static AddIndividualParser(name, parser) { - this._IndividualBabylonFileParsers[name] = parser; + static AddIndividualParser(name2, parser) { + this._IndividualBabylonFileParsers[name2] = parser; } - static GetIndividualParser(name) { - if (this._IndividualBabylonFileParsers[name]) { - return this._IndividualBabylonFileParsers[name]; + static GetIndividualParser(name2) { + if (this._IndividualBabylonFileParsers[name2]) { + return this._IndividualBabylonFileParsers[name2]; } return null; } @@ -2294,8 +2236,11 @@ class AbstractScene { return nodes; } } -AbstractScene._BabylonFileParsers = {}; -AbstractScene._IndividualBabylonFileParsers = {}; +var init_abstractScene = __esm(() => { + AbstractScene._BabylonFileParsers = {}; + AbstractScene._IndividualBabylonFileParsers = {}; +}); + // node_modules/@babylonjs/core/Actions/abstractActionManager.js class AbstractActionManager { constructor() { @@ -2334,7 +2279,10 @@ class AbstractActionManager { return false; } } -AbstractActionManager.Triggers = {}; +var init_abstractActionManager = __esm(() => { + AbstractActionManager.Triggers = {}; +}); + // node_modules/@babylonjs/core/Misc/observable.js class EventState { constructor(mask, skipNextObservers = false, target, currentTarget) { @@ -2560,6 +2508,8 @@ class Observable { return false; } } +var init_observable = __esm(() => { +}); // node_modules/@babylonjs/core/Maths/math.scalar.js class Scalar { @@ -2711,49 +2661,23 @@ class Scalar { return Scalar.HCF(b, r); } } -Scalar.TwoPi = Math.PI * 2; +var init_math_scalar = __esm(() => { + Scalar.TwoPi = Math.PI * 2; +}); // node_modules/@babylonjs/core/Maths/math.constants.js -var ToGammaSpace = 1 / 2.2; -var ToLinearSpace = 2.2; -var PHI = (1 + Math.sqrt(5)) / 2; -var Epsilon = 0.001; +var ToGammaSpace, ToLinearSpace, PHI, Epsilon; +var init_math_constants = __esm(() => { + ToGammaSpace = 1 / 2.2; + ToLinearSpace = 2.2; + PHI = (1 + Math.sqrt(5)) / 2; + Epsilon = 0.001; +}); // node_modules/@babylonjs/core/Misc/arrayTools.js -var _observeArrayfunction = function(object, functionName, callback) { - const oldFunction = object[functionName]; - if (typeof oldFunction !== "function") { - return null; - } - const newFunction = function() { - const previousLength = object.length; - const returnValue = newFunction.previous.apply(object, arguments); - callback(functionName, previousLength); - return returnValue; - }; - oldFunction.next = newFunction; - newFunction.previous = oldFunction; - object[functionName] = newFunction; - return () => { - const previous = newFunction.previous; - if (!previous) { - return; - } - const next = newFunction.next; - if (next) { - previous.next = next; - next.previous = previous; - } else { - previous.next = undefined; - object[functionName] = previous; - } - newFunction.next = undefined; - newFunction.previous = undefined; - }; -}; function _ObserveArray(array, callback) { - const unObserveFunctions = observedArrayFunctions.map((name) => { - return _observeArrayfunction(array, name, callback); + const unObserveFunctions = observedArrayFunctions.map((name2) => { + return _observeArrayfunction(array, name2, callback); }); return () => { unObserveFunctions.forEach((unObserveFunction) => { @@ -2774,7 +2698,41 @@ class ArrayTools { return ArrayTools.BuildArray(size, itemBuilder); } } -var observedArrayFunctions = ["push", "splice", "pop", "shift", "unshift"]; +var _observeArrayfunction, observedArrayFunctions; +var init_arrayTools = __esm(() => { + _observeArrayfunction = function(object, functionName, callback) { + const oldFunction = object[functionName]; + if (typeof oldFunction !== "function") { + return null; + } + const newFunction = function() { + const previousLength = object.length; + const returnValue = newFunction.previous.apply(object, arguments); + callback(functionName, previousLength); + return returnValue; + }; + oldFunction.next = newFunction; + newFunction.previous = oldFunction; + object[functionName] = newFunction; + return () => { + const previous = newFunction.previous; + if (!previous) { + return; + } + const next = newFunction.next; + if (next) { + previous.next = next; + next.previous = previous; + } else { + previous.next = undefined; + object[functionName] = previous; + } + newFunction.next = undefined; + newFunction.previous = undefined; + }; + }; + observedArrayFunctions = ["push", "splice", "pop", "shift", "unshift"]; +}); // node_modules/@babylonjs/core/Misc/typeStore.js function RegisterClass(className, type) { @@ -2783,7 +2741,10 @@ function RegisterClass(className, type) { function GetClass(fqdn) { return _RegisteredTypes[fqdn]; } -var _RegisteredTypes = {}; +var _RegisteredTypes; +var init_typeStore = __esm(() => { + _RegisteredTypes = {}; +}); // node_modules/@babylonjs/core/Engines/performanceConfigurator.js class PerformanceConfigurator { @@ -2806,10 +2767,12 @@ class PerformanceConfigurator { PerformanceConfigurator.MatrixTrackedMatrices = null; } } -PerformanceConfigurator.MatrixUse64Bits = false; -PerformanceConfigurator.MatrixTrackPrecisionChange = true; -PerformanceConfigurator.MatrixCurrentType = Float32Array; -PerformanceConfigurator.MatrixTrackedMatrices = []; +var init_performanceConfigurator = __esm(() => { + PerformanceConfigurator.MatrixUse64Bits = false; + PerformanceConfigurator.MatrixTrackPrecisionChange = true; + PerformanceConfigurator.MatrixCurrentType = Float32Array; + PerformanceConfigurator.MatrixTrackedMatrices = []; +}); // node_modules/@babylonjs/core/Engines/engineStore.js class EngineStore { @@ -2823,17 +2786,16 @@ class EngineStore { return this._LastCreatedScene; } } -EngineStore.Instances = []; -EngineStore.OnEnginesDisposedObservable = new Observable; -EngineStore._LastCreatedScene = null; -EngineStore.UseFallbackTexture = true; -EngineStore.FallbackTexture = ""; +var init_engineStore = __esm(() => { + init_observable(); + EngineStore.Instances = []; + EngineStore.OnEnginesDisposedObservable = new Observable; + EngineStore._LastCreatedScene = null; + EngineStore.UseFallbackTexture = true; + EngineStore.FallbackTexture = ""; +}); // node_modules/@babylonjs/core/Maths/math.vector.js -var _ExtractAsInt = (value) => { - return parseInt(value.toString().replace(/\W/g, "")); -}; - class Vector2 { constructor(x = 0, y = 0) { this.x = x; @@ -3151,7 +3113,6 @@ class Vector2 { return Vector2.Distance(p, proj); } } -Vector2._ZeroReadOnly = Vector2.Zero(); class Vector3 { get x() { @@ -4008,16 +3969,6 @@ class Vector3 { return ref; } } -Vector3._UpReadOnly = Vector3.Up(); -Vector3._DownReadOnly = Vector3.Down(); -Vector3._LeftHandedForwardReadOnly = Vector3.Forward(false); -Vector3._RightHandedForwardReadOnly = Vector3.Forward(true); -Vector3._LeftHandedBackwardReadOnly = Vector3.Backward(false); -Vector3._RightHandedBackwardReadOnly = Vector3.Backward(true); -Vector3._RightReadOnly = Vector3.Right(); -Vector3._LeftReadOnly = Vector3.Left(); -Vector3._ZeroReadOnly = Vector3.Zero(); -Vector3._OneReadOnly = Vector3.One(); class Vector4 { constructor(x = 0, y = 0, z = 0, w = 0) { @@ -4403,7 +4354,6 @@ class Vector4 { return left.dot(right); } } -Vector4._ZeroReadOnly = Vector4.Zero(); class Quaternion { get x() { @@ -6039,48 +5989,53 @@ class Matrix { return result; } } -Matrix._UpdateFlagSeed = 0; -Matrix._IdentityReadOnly = Matrix.Identity(); class MathTmp { } -MathTmp.Vector3 = ArrayTools.BuildTuple(11, Vector3.Zero); -MathTmp.Matrix = ArrayTools.BuildTuple(2, Matrix.Identity); -MathTmp.Quaternion = ArrayTools.BuildTuple(3, Quaternion.Zero); class TmpVectors { } -TmpVectors.Vector2 = ArrayTools.BuildTuple(3, Vector2.Zero); -TmpVectors.Vector3 = ArrayTools.BuildTuple(13, Vector3.Zero); -TmpVectors.Vector4 = ArrayTools.BuildTuple(3, Vector4.Zero); -TmpVectors.Quaternion = ArrayTools.BuildTuple(2, Quaternion.Zero); -TmpVectors.Matrix = ArrayTools.BuildTuple(8, Matrix.Identity); -RegisterClass("BABYLON.Vector2", Vector2); -RegisterClass("BABYLON.Vector3", Vector3); -RegisterClass("BABYLON.Vector4", Vector4); -RegisterClass("BABYLON.Matrix", Matrix); -var mtxConvertNDCToHalfZRange = Matrix.FromValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 1); +var _ExtractAsInt, mtxConvertNDCToHalfZRange; +var init_math_vector = __esm(() => { + init_math_scalar(); + init_math_constants(); + init_arrayTools(); + init_typeStore(); + init_performanceConfigurator(); + init_engineStore(); + _ExtractAsInt = (value) => { + return parseInt(value.toString().replace(/\W/g, "")); + }; + Vector2._ZeroReadOnly = Vector2.Zero(); + Vector3._UpReadOnly = Vector3.Up(); + Vector3._DownReadOnly = Vector3.Down(); + Vector3._LeftHandedForwardReadOnly = Vector3.Forward(false); + Vector3._RightHandedForwardReadOnly = Vector3.Forward(true); + Vector3._LeftHandedBackwardReadOnly = Vector3.Backward(false); + Vector3._RightHandedBackwardReadOnly = Vector3.Backward(true); + Vector3._RightReadOnly = Vector3.Right(); + Vector3._LeftReadOnly = Vector3.Left(); + Vector3._ZeroReadOnly = Vector3.Zero(); + Vector3._OneReadOnly = Vector3.One(); + Vector4._ZeroReadOnly = Vector4.Zero(); + Matrix._UpdateFlagSeed = 0; + Matrix._IdentityReadOnly = Matrix.Identity(); + MathTmp.Vector3 = ArrayTools.BuildTuple(11, Vector3.Zero); + MathTmp.Matrix = ArrayTools.BuildTuple(2, Matrix.Identity); + MathTmp.Quaternion = ArrayTools.BuildTuple(3, Quaternion.Zero); + TmpVectors.Vector2 = ArrayTools.BuildTuple(3, Vector2.Zero); + TmpVectors.Vector3 = ArrayTools.BuildTuple(13, Vector3.Zero); + TmpVectors.Vector4 = ArrayTools.BuildTuple(3, Vector4.Zero); + TmpVectors.Quaternion = ArrayTools.BuildTuple(2, Quaternion.Zero); + TmpVectors.Matrix = ArrayTools.BuildTuple(8, Matrix.Identity); + RegisterClass("BABYLON.Vector2", Vector2); + RegisterClass("BABYLON.Vector3", Vector3); + RegisterClass("BABYLON.Vector4", Vector4); + RegisterClass("BABYLON.Matrix", Matrix); + mtxConvertNDCToHalfZRange = Matrix.FromValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 1); +}); // node_modules/@babylonjs/core/Maths/math.color.js -var colorChannelToLinearSpace = function(color) { - return Math.pow(color, ToLinearSpace); -}; -var colorChannelToLinearSpaceExact = function(color) { - if (color <= 0.04045) { - return 0.0773993808 * color; - } - return Math.pow(0.947867299 * (color + 0.055), 2.4); -}; -var colorChannelToGammaSpace = function(color) { - return Math.pow(color, ToGammaSpace); -}; -var colorChannelToGammaSpaceExact = function(color) { - if (color <= 0.0031308) { - return 12.92 * color; - } - return 1.055 * Math.pow(color, 0.41666) - 0.055; -}; - class Color3 { constructor(r = 0, g = 0, b = 0) { this.r = r; @@ -6395,7 +6350,6 @@ class Color3 { return new Color3(Math.random(), Math.random(), Math.random()); } } -Color3._BlackReadOnly = Color3.Black(); class Color4 { constructor(r = 0, g = 0, b = 0, a = 1) { @@ -6640,10 +6594,36 @@ class Color4 { class TmpColors { } -TmpColors.Color3 = ArrayTools.BuildArray(3, Color3.Black); -TmpColors.Color4 = ArrayTools.BuildArray(3, () => new Color4(0, 0, 0, 0)); -RegisterClass("BABYLON.Color3", Color3); -RegisterClass("BABYLON.Color4", Color4); +var colorChannelToLinearSpace, colorChannelToLinearSpaceExact, colorChannelToGammaSpace, colorChannelToGammaSpaceExact; +var init_math_color = __esm(() => { + init_math_scalar(); + init_math_constants(); + init_arrayTools(); + init_typeStore(); + colorChannelToLinearSpace = function(color) { + return Math.pow(color, ToLinearSpace); + }; + colorChannelToLinearSpaceExact = function(color) { + if (color <= 0.04045) { + return 0.0773993808 * color; + } + return Math.pow(0.947867299 * (color + 0.055), 2.4); + }; + colorChannelToGammaSpace = function(color) { + return Math.pow(color, ToGammaSpace); + }; + colorChannelToGammaSpaceExact = function(color) { + if (color <= 0.0031308) { + return 12.92 * color; + } + return 1.055 * Math.pow(color, 0.41666) - 0.055; + }; + Color3._BlackReadOnly = Color3.Black(); + TmpColors.Color3 = ArrayTools.BuildArray(3, Color3.Black); + TmpColors.Color4 = ArrayTools.BuildArray(3, () => new Color4(0, 0, 0, 0)); + RegisterClass("BABYLON.Color3", Color3); + RegisterClass("BABYLON.Color4", Color4); +}); // node_modules/@babylonjs/core/Actions/action.js class Action { @@ -6740,35 +6720,42 @@ class Action { return serializationObject; } } -Action._SerializeValueAsString = (value) => { - if (typeof value === "number") { - return value.toString(); - } - if (typeof value === "boolean") { - return value ? "true" : "false"; - } - if (value instanceof Vector2) { - return value.x + ", " + value.y; - } - if (value instanceof Vector3) { - return value.x + ", " + value.y + ", " + value.z; - } - if (value instanceof Color3) { - return value.r + ", " + value.g + ", " + value.b; - } - if (value instanceof Color4) { - return value.r + ", " + value.g + ", " + value.b + ", " + value.a; - } - return value; -}; -Action._GetTargetProperty = (target) => { - return { - name: "target", - targetType: target._isMesh ? "MeshProperties" : target._isLight ? "LightProperties" : target._isCamera ? "CameraProperties" : target._isMaterial ? "MaterialProperties" : "SceneProperties", - value: target._isScene ? "Scene" : target.name +var init_action = __esm(() => { + init_observable(); + init_math_vector(); + init_math_color(); + init_typeStore(); + Action._SerializeValueAsString = (value) => { + if (typeof value === "number") { + return value.toString(); + } + if (typeof value === "boolean") { + return value ? "true" : "false"; + } + if (value instanceof Vector2) { + return value.x + ", " + value.y; + } + if (value instanceof Vector3) { + return value.x + ", " + value.y + ", " + value.z; + } + if (value instanceof Color3) { + return value.r + ", " + value.g + ", " + value.b; + } + if (value instanceof Color4) { + return value.r + ", " + value.g + ", " + value.b + ", " + value.a; + } + return value; }; -}; -RegisterClass("BABYLON.Action", Action); + Action._GetTargetProperty = (target) => { + return { + name: "target", + targetType: target._isMesh ? "MeshProperties" : target._isLight ? "LightProperties" : target._isCamera ? "CameraProperties" : target._isMaterial ? "MaterialProperties" : "SceneProperties", + value: target._isScene ? "Scene" : target.name + }; + }; + RegisterClass("BABYLON.Action", Action); +}); + // node_modules/@babylonjs/core/Actions/actionEvent.js class ActionEvent { constructor(source, pointerX, pointerY, meshUnderPointer, sourceEvent, additionalData) { @@ -6793,6 +6780,9 @@ class ActionEvent { return new ActionEvent(prim, pointerPos.x, pointerPos.y, null, evt, additionalData); } } +var init_actionEvent = __esm(() => { +}); + // node_modules/@babylonjs/core/Actions/condition.js class Condition { constructor(actionManager) { @@ -6886,10 +6876,6 @@ class ValueCondition extends Condition { } } } -ValueCondition._IsEqual = 0; -ValueCondition._IsDifferent = 1; -ValueCondition._IsGreater = 2; -ValueCondition._IsLesser = 3; class PredicateCondition extends Condition { constructor(actionManager, predicate) { @@ -6917,9 +6903,17 @@ class StateCondition extends Condition { }); } } -RegisterClass("BABYLON.ValueCondition", ValueCondition); -RegisterClass("BABYLON.PredicateCondition", PredicateCondition); -RegisterClass("BABYLON.StateCondition", StateCondition); +var init_condition = __esm(() => { + init_action(); + init_typeStore(); + ValueCondition._IsEqual = 0; + ValueCondition._IsDifferent = 1; + ValueCondition._IsGreater = 2; + ValueCondition._IsLesser = 3; + RegisterClass("BABYLON.ValueCondition", ValueCondition); + RegisterClass("BABYLON.PredicateCondition", PredicateCondition); + RegisterClass("BABYLON.StateCondition", StateCondition); +}); // node_modules/@babylonjs/core/Misc/logger.js class Logger { @@ -6988,25 +6982,27 @@ class Logger { }); } } -Logger.NoneLogLevel = 0; -Logger.MessageLogLevel = 1; -Logger.WarningLogLevel = 2; -Logger.ErrorLogLevel = 4; -Logger.AllLogLevel = 7; -Logger.MessageLimitReached = "Too many %TYPE%s (%LIMIT%), no more %TYPE%s will be reported for this message."; -Logger._LogCache = ""; -Logger._LogLimitOutputs = {}; -Logger._Levels = [ - {}, - { color: "white", logFunc: console.log, name: "Log" }, - { color: "orange", logFunc: console.warn, name: "Warn" }, - {}, - { color: "red", logFunc: console.error, name: "Error" } -]; -Logger.errorsCount = 0; -Logger.Log = Logger._LogEnabled.bind(Logger, Logger.MessageLogLevel); -Logger.Warn = Logger._LogEnabled.bind(Logger, Logger.WarningLogLevel); -Logger.Error = Logger._LogEnabled.bind(Logger, Logger.ErrorLogLevel); +var init_logger = __esm(() => { + Logger.NoneLogLevel = 0; + Logger.MessageLogLevel = 1; + Logger.WarningLogLevel = 2; + Logger.ErrorLogLevel = 4; + Logger.AllLogLevel = 7; + Logger.MessageLimitReached = "Too many %TYPE%s (%LIMIT%), no more %TYPE%s will be reported for this message."; + Logger._LogCache = ""; + Logger._LogLimitOutputs = {}; + Logger._Levels = [ + {}, + { color: "white", logFunc: console.log, name: "Log" }, + { color: "orange", logFunc: console.warn, name: "Warn" }, + {}, + { color: "red", logFunc: console.error, name: "Error" } + ]; + Logger.errorsCount = 0; + Logger.Log = Logger._LogEnabled.bind(Logger, Logger.MessageLogLevel); + Logger.Warn = Logger._LogEnabled.bind(Logger, Logger.WarningLogLevel); + Logger.Error = Logger._LogEnabled.bind(Logger, Logger.ErrorLogLevel); +}); // node_modules/@babylonjs/core/Actions/directActions.js class SwitchBooleanAction extends Action { @@ -7234,49 +7230,25 @@ class SetParentAction extends Action { }, parent); } } -RegisterClass("BABYLON.SetParentAction", SetParentAction); -RegisterClass("BABYLON.ExecuteCodeAction", ExecuteCodeAction); -RegisterClass("BABYLON.DoNothingAction", DoNothingAction); -RegisterClass("BABYLON.StopAnimationAction", StopAnimationAction); -RegisterClass("BABYLON.PlayAnimationAction", PlayAnimationAction); -RegisterClass("BABYLON.IncrementValueAction", IncrementValueAction); -RegisterClass("BABYLON.SetValueAction", SetValueAction); -RegisterClass("BABYLON.SetStateAction", SetStateAction); -RegisterClass("BABYLON.SetParentAction", SetParentAction); -RegisterClass("BABYLON.SwitchBooleanAction", SwitchBooleanAction); -RegisterClass("BABYLON.CombineAction", CombineAction); +var init_directActions = __esm(() => { + init_logger(); + init_math_vector(); + init_action(); + init_typeStore(); + RegisterClass("BABYLON.SetParentAction", SetParentAction); + RegisterClass("BABYLON.ExecuteCodeAction", ExecuteCodeAction); + RegisterClass("BABYLON.DoNothingAction", DoNothingAction); + RegisterClass("BABYLON.StopAnimationAction", StopAnimationAction); + RegisterClass("BABYLON.PlayAnimationAction", PlayAnimationAction); + RegisterClass("BABYLON.IncrementValueAction", IncrementValueAction); + RegisterClass("BABYLON.SetValueAction", SetValueAction); + RegisterClass("BABYLON.SetStateAction", SetStateAction); + RegisterClass("BABYLON.SetParentAction", SetParentAction); + RegisterClass("BABYLON.SwitchBooleanAction", SwitchBooleanAction); + RegisterClass("BABYLON.CombineAction", CombineAction); +}); // node_modules/@babylonjs/core/Misc/deepCopier.js -var GetAllPropertyNames = function(obj) { - const props = []; - do { - Object.getOwnPropertyNames(obj).forEach(function(prop) { - if (props.indexOf(prop) === -1) { - props.push(prop); - } - }); - } while (obj = Object.getPrototypeOf(obj)); - return props; -}; -var CloneValue = (source, destinationObject, shallowCopyValues) => { - if (!source) { - return null; - } - if (source.getClassName && source.getClassName() === "Mesh") { - return null; - } - if (source.getClassName && (source.getClassName() === "SubMesh" || source.getClassName() === "PhysicsBody")) { - return source.clone(destinationObject); - } else if (source.clone) { - return source.clone(); - } else if (Array.isArray(source)) { - return source.slice(); - } else if (shallowCopyValues && typeof source === "object") { - return Object.assign({}, source); - } - return null; -}; - class DeepCopier { static DeepCopy(source, destination, doNotCopyList, mustCopyList, shallowCopyValues = false) { const properties = GetAllPropertyNames(source); @@ -7325,6 +7297,39 @@ class DeepCopier { } } } +var GetAllPropertyNames, CloneValue; +var init_deepCopier = __esm(() => { + init_logger(); + GetAllPropertyNames = function(obj) { + const props = []; + do { + Object.getOwnPropertyNames(obj).forEach(function(prop) { + if (props.indexOf(prop) === -1) { + props.push(prop); + } + }); + } while (obj = Object.getPrototypeOf(obj)); + return props; + }; + CloneValue = (source, destinationObject, shallowCopyValues) => { + if (!source) { + return null; + } + if (source.getClassName && source.getClassName() === "Mesh") { + return null; + } + if (source.getClassName && (source.getClassName() === "SubMesh" || source.getClassName() === "PhysicsBody")) { + return source.clone(destinationObject); + } else if (source.clone) { + return source.clone(); + } else if (Array.isArray(source)) { + return source.slice(); + } else if (shallowCopyValues && typeof source === "object") { + return Object.assign({}, source); + } + return null; + }; +}); // node_modules/@babylonjs/core/Actions/actionManager.js class ActionManager extends AbstractActionManager { @@ -7482,10 +7487,10 @@ class ActionManager extends AbstractActionManager { const properties = propertyPath.split("."); return properties[properties.length - 1]; } - serialize(name) { + serialize(name2) { const root = { children: new Array, - name, + name: name2, type: 3, properties: new Array }; @@ -7523,11 +7528,11 @@ class ActionManager extends AbstractActionManager { } else { object.actionManager = actionManager; } - const instantiate = (name, params) => { - const internalClassType = GetClass("BABYLON." + name); + const instantiate = (name2, params) => { + const internalClassType = GetClass("BABYLON." + name2); return internalClassType && new internalClassType(...params); }; - const parseParameter = (name, value, target, propertyPath) => { + const parseParameter = (name2, value, target, propertyPath) => { if (propertyPath === null) { const floatValue = parseFloat(value); if (value === "true" || value === "false") { @@ -7587,9 +7592,9 @@ class ActionManager extends AbstractActionManager { } else { for (let i = 0;i < parsedAction.properties.length; i++) { let value = parsedAction.properties[i].value; - const name = parsedAction.properties[i].name; + const name2 = parsedAction.properties[i].name; const targetType = parsedAction.properties[i].targetType; - if (name === "target") { + if (name2 === "target") { if (targetType === "SceneProperties") { value = target = scene; } else if (targetType === "MaterialProperties") { @@ -7597,17 +7602,17 @@ class ActionManager extends AbstractActionManager { } else { value = target = scene.getNodeByName(value); } - } else if (name === "parent") { + } else if (name2 === "parent") { value = scene.getNodeByName(value); - } else if (name === "sound") { + } else if (name2 === "sound") { if (scene.getSoundByName) { value = scene.getSoundByName(value); } - } else if (name !== "propertyPath") { - if (parsedAction.type === 2 && name === "operator") { + } else if (name2 !== "propertyPath") { + if (parsedAction.type === 2 && name2 === "operator") { value = ValueCondition[value]; } else { - value = parseParameter(name, value, target, name === "value" ? propertyPath : null); + value = parseParameter(name2, value, target, name2 === "value" ? propertyPath : null); } } else { propertyPath = value; @@ -7715,23 +7720,36 @@ class ActionManager extends AbstractActionManager { } } } -ActionManager.NothingTrigger = 0; -ActionManager.OnPickTrigger = 1; -ActionManager.OnLeftPickTrigger = 2; -ActionManager.OnRightPickTrigger = 3; -ActionManager.OnCenterPickTrigger = 4; -ActionManager.OnPickDownTrigger = 5; -ActionManager.OnDoublePickTrigger = 6; -ActionManager.OnPickUpTrigger = 7; -ActionManager.OnPickOutTrigger = 16; -ActionManager.OnLongPressTrigger = 8; -ActionManager.OnPointerOverTrigger = 9; -ActionManager.OnPointerOutTrigger = 10; -ActionManager.OnEveryFrameTrigger = 11; -ActionManager.OnIntersectionEnterTrigger = 12; -ActionManager.OnIntersectionExitTrigger = 13; -ActionManager.OnKeyDownTrigger = 14; -ActionManager.OnKeyUpTrigger = 15; +var init_actionManager = __esm(() => { + init_math_vector(); + init_math_color(); + init_condition(); + init_action(); + init_directActions(); + init_engineStore(); + init_logger(); + init_deepCopier(); + init_typeStore(); + init_abstractActionManager(); + ActionManager.NothingTrigger = 0; + ActionManager.OnPickTrigger = 1; + ActionManager.OnLeftPickTrigger = 2; + ActionManager.OnRightPickTrigger = 3; + ActionManager.OnCenterPickTrigger = 4; + ActionManager.OnPickDownTrigger = 5; + ActionManager.OnDoublePickTrigger = 6; + ActionManager.OnPickUpTrigger = 7; + ActionManager.OnPickOutTrigger = 16; + ActionManager.OnLongPressTrigger = 8; + ActionManager.OnPointerOverTrigger = 9; + ActionManager.OnPointerOutTrigger = 10; + ActionManager.OnEveryFrameTrigger = 11; + ActionManager.OnIntersectionEnterTrigger = 12; + ActionManager.OnIntersectionExitTrigger = 13; + ActionManager.OnKeyDownTrigger = 14; + ActionManager.OnKeyUpTrigger = 15; +}); + // node_modules/@babylonjs/core/Actions/directAudioActions.js class PlaySoundAction extends Action { constructor(triggerOptions, sound, condition2) { @@ -7772,8 +7790,13 @@ class StopSoundAction extends Action { }, parent); } } -RegisterClass("BABYLON.PlaySoundAction", PlaySoundAction); -RegisterClass("BABYLON.StopSoundAction", StopSoundAction); +var init_directAudioActions = __esm(() => { + init_action(); + init_typeStore(); + RegisterClass("BABYLON.PlaySoundAction", PlaySoundAction); + RegisterClass("BABYLON.StopSoundAction", StopSoundAction); +}); + // node_modules/@babylonjs/core/Misc/andOrNotEvaluator.js class AndOrNotEvaluator { static Eval(query, evaluateCallback) { @@ -7852,6 +7875,8 @@ class AndOrNotEvaluator { return booleanString; } } +var init_andOrNotEvaluator = __esm(() => { +}); // node_modules/@babylonjs/core/Misc/tags.js class Tags { @@ -7950,92 +7975,24 @@ class Tags { return AndOrNotEvaluator.Eval(tagsQuery, (r) => Tags.HasTags(obj) && obj._tags[r]); } } +var init_tags = __esm(() => { + init_andOrNotEvaluator(); +}); // node_modules/@babylonjs/core/Misc/devTools.js -function _WarnImport(name, warnOnce = false) { - if (warnOnce && warnedMap[name]) { +function _WarnImport(name2, warnOnce = false) { + if (warnOnce && warnedMap[name2]) { return; } - warnedMap[name] = true; - return `${name} needs to be imported before as it contains a side-effect required by your code.`; + warnedMap[name2] = true; + return `${name2} needs to be imported before as it contains a side-effect required by your code.`; } -var warnedMap = {}; +var warnedMap; +var init_devTools = __esm(() => { + warnedMap = {}; +}); // node_modules/@babylonjs/core/Misc/decorators.js -var getDirectStore = function(target) { - const classKey = target.getClassName(); - if (!__decoratorInitialStore[classKey]) { - __decoratorInitialStore[classKey] = {}; - } - return __decoratorInitialStore[classKey]; -}; -var getMergedStore = function(target) { - const classKey = target.getClassName(); - if (__mergedStore[classKey]) { - return __mergedStore[classKey]; - } - __mergedStore[classKey] = {}; - const store = __mergedStore[classKey]; - let currentTarget = target; - let currentKey = classKey; - while (currentKey) { - const initialStore = __decoratorInitialStore[currentKey]; - for (const property in initialStore) { - store[property] = initialStore[property]; - } - let parent; - let done = false; - do { - parent = Object.getPrototypeOf(currentTarget); - if (!parent.getClassName) { - done = true; - break; - } - if (parent.getClassName() !== currentKey) { - break; - } - currentTarget = parent; - } while (parent); - if (done) { - break; - } - currentKey = parent.getClassName(); - currentTarget = parent; - } - return store; -}; -var generateSerializableMember = function(type, sourceName) { - return (target, propertyKey) => { - const classStore = getDirectStore(target); - if (!classStore[propertyKey]) { - classStore[propertyKey] = { type, sourceName }; - } - }; -}; -var generateExpandMember = function(setCallback, targetKey = null) { - return (target, propertyKey) => { - const key = targetKey || "_" + propertyKey; - Object.defineProperty(target, propertyKey, { - get: function() { - return this[key]; - }, - set: function(value) { - if (typeof this.equals === "function") { - if (this.equals(value)) { - return; - } - } - if (this[key] === value) { - return; - } - this[key] = value; - target[setCallback].apply(this); - }, - enumerable: true, - configurable: true - }); - }; -}; function expandToProperty(callback, targetKey = null) { return generateExpandMember(callback, targetKey); } @@ -8094,48 +8051,6 @@ function nativeOverride(target, propertyKey, descriptor, predicate) { return func(...params); }; } -var __decoratorInitialStore = {}; -var __mergedStore = {}; -var _copySource = function(creationFunction, source, instanciate, options = {}) { - const destination = creationFunction(); - if (Tags && Tags.HasTags(source)) { - Tags.AddTagsTo(destination, Tags.GetTags(source, true)); - } - const classStore = getMergedStore(destination); - const textureMap = {}; - for (const property in classStore) { - const propertyDescriptor = classStore[property]; - const sourceProperty = source[property]; - const propertyType = propertyDescriptor.type; - if (sourceProperty !== undefined && sourceProperty !== null && (property !== "uniqueId" || SerializationHelper.AllowLoadingUniqueId)) { - switch (propertyType) { - case 0: - case 6: - case 11: - destination[property] = sourceProperty; - break; - case 1: - if (options.cloneTexturesOnlyOnce && textureMap[sourceProperty.uniqueId]) { - destination[property] = textureMap[sourceProperty.uniqueId]; - } else { - destination[property] = instanciate || sourceProperty.isRenderTarget ? sourceProperty : sourceProperty.clone(); - textureMap[sourceProperty.uniqueId] = destination[property]; - } - break; - case 2: - case 3: - case 4: - case 5: - case 7: - case 10: - case 12: - destination[property] = instanciate ? sourceProperty : sourceProperty.clone(); - break; - } - } - } - return destination; -}; class SerializationHelper { static AppendSerializedAnimations(source, destination) { @@ -8282,34 +8197,159 @@ class SerializationHelper { return _copySource(creationFunction, source, true); } } -SerializationHelper.AllowLoadingUniqueId = false; -SerializationHelper._ImageProcessingConfigurationParser = (sourceProperty) => { - throw _WarnImport("ImageProcessingConfiguration"); -}; -SerializationHelper._FresnelParametersParser = (sourceProperty) => { - throw _WarnImport("FresnelParameters"); -}; -SerializationHelper._ColorCurvesParser = (sourceProperty) => { - throw _WarnImport("ColorCurves"); -}; -SerializationHelper._TextureParser = (sourceProperty, scene, rootUrl) => { - throw _WarnImport("Texture"); -}; -nativeOverride.filter = function(predicate) { - return (target, propertyKey, descriptor) => nativeOverride(target, propertyKey, descriptor, predicate); -}; +var getDirectStore, getMergedStore, generateSerializableMember, generateExpandMember, __decoratorInitialStore, __mergedStore, _copySource; +var init_decorators = __esm(() => { + init_tags(); + init_math_vector(); + init_devTools(); + init_math_color(); + getDirectStore = function(target) { + const classKey = target.getClassName(); + if (!__decoratorInitialStore[classKey]) { + __decoratorInitialStore[classKey] = {}; + } + return __decoratorInitialStore[classKey]; + }; + getMergedStore = function(target) { + const classKey = target.getClassName(); + if (__mergedStore[classKey]) { + return __mergedStore[classKey]; + } + __mergedStore[classKey] = {}; + const store = __mergedStore[classKey]; + let currentTarget = target; + let currentKey = classKey; + while (currentKey) { + const initialStore = __decoratorInitialStore[currentKey]; + for (const property in initialStore) { + store[property] = initialStore[property]; + } + let parent; + let done = false; + do { + parent = Object.getPrototypeOf(currentTarget); + if (!parent.getClassName) { + done = true; + break; + } + if (parent.getClassName() !== currentKey) { + break; + } + currentTarget = parent; + } while (parent); + if (done) { + break; + } + currentKey = parent.getClassName(); + currentTarget = parent; + } + return store; + }; + generateSerializableMember = function(type, sourceName) { + return (target, propertyKey) => { + const classStore = getDirectStore(target); + if (!classStore[propertyKey]) { + classStore[propertyKey] = { type, sourceName }; + } + }; + }; + generateExpandMember = function(setCallback, targetKey = null) { + return (target, propertyKey) => { + const key = targetKey || "_" + propertyKey; + Object.defineProperty(target, propertyKey, { + get: function() { + return this[key]; + }, + set: function(value) { + if (typeof this.equals === "function") { + if (this.equals(value)) { + return; + } + } + if (this[key] === value) { + return; + } + this[key] = value; + target[setCallback].apply(this); + }, + enumerable: true, + configurable: true + }); + }; + }; + __decoratorInitialStore = {}; + __mergedStore = {}; + _copySource = function(creationFunction, source, instanciate, options = {}) { + const destination = creationFunction(); + if (Tags && Tags.HasTags(source)) { + Tags.AddTagsTo(destination, Tags.GetTags(source, true)); + } + const classStore = getMergedStore(destination); + const textureMap = {}; + for (const property in classStore) { + const propertyDescriptor = classStore[property]; + const sourceProperty = source[property]; + const propertyType = propertyDescriptor.type; + if (sourceProperty !== undefined && sourceProperty !== null && (property !== "uniqueId" || SerializationHelper.AllowLoadingUniqueId)) { + switch (propertyType) { + case 0: + case 6: + case 11: + destination[property] = sourceProperty; + break; + case 1: + if (options.cloneTexturesOnlyOnce && textureMap[sourceProperty.uniqueId]) { + destination[property] = textureMap[sourceProperty.uniqueId]; + } else { + destination[property] = instanciate || sourceProperty.isRenderTarget ? sourceProperty : sourceProperty.clone(); + textureMap[sourceProperty.uniqueId] = destination[property]; + } + break; + case 2: + case 3: + case 4: + case 5: + case 7: + case 10: + case 12: + destination[property] = instanciate ? sourceProperty : sourceProperty.clone(); + break; + } + } + } + return destination; + }; + SerializationHelper.AllowLoadingUniqueId = false; + SerializationHelper._ImageProcessingConfigurationParser = (sourceProperty) => { + throw _WarnImport("ImageProcessingConfiguration"); + }; + SerializationHelper._FresnelParametersParser = (sourceProperty) => { + throw _WarnImport("FresnelParameters"); + }; + SerializationHelper._ColorCurvesParser = (sourceProperty) => { + throw _WarnImport("ColorCurves"); + }; + SerializationHelper._TextureParser = (sourceProperty, scene, rootUrl) => { + throw _WarnImport("Texture"); + }; + nativeOverride.filter = function(predicate) { + return (target, propertyKey, descriptor) => nativeOverride(target, propertyKey, descriptor, predicate); + }; +}); // node_modules/@babylonjs/core/Animations/animationKey.js var AnimationKeyInterpolation; -(function(AnimationKeyInterpolation2) { - AnimationKeyInterpolation2[AnimationKeyInterpolation2["NONE"] = 0] = "NONE"; - AnimationKeyInterpolation2[AnimationKeyInterpolation2["STEP"] = 1] = "STEP"; -})(AnimationKeyInterpolation || (AnimationKeyInterpolation = {})); +var init_animationKey = __esm(() => { + (function(AnimationKeyInterpolation2) { + AnimationKeyInterpolation2[AnimationKeyInterpolation2["NONE"] = 0] = "NONE"; + AnimationKeyInterpolation2[AnimationKeyInterpolation2["STEP"] = 1] = "STEP"; + })(AnimationKeyInterpolation || (AnimationKeyInterpolation = {})); +}); // node_modules/@babylonjs/core/Animations/animationRange.js class AnimationRange { - constructor(name, from, to) { - this.name = name; + constructor(name2, from, to) { + this.name = name2; this.from = from; this.to = to; } @@ -8317,6 +8357,8 @@ class AnimationRange { return new AnimationRange(this.name, this.from, this.to); } } +var init_animationRange = __esm(() => { +}); // node_modules/@babylonjs/core/tslib.es6.js function __decorate2(decorators, target, key, desc) { @@ -8329,6 +8371,8 @@ function __decorate2(decorators, target, key, desc) { r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } +var init_tslib_es62 = __esm(() => { +}); // node_modules/@babylonjs/core/node.js class _InternalNodeDataInfo { @@ -8348,12 +8392,12 @@ class Node2 { static AddNodeConstructor(type, constructorFunc) { this._NodeConstructors[type] = constructorFunc; } - static Construct(type, name, scene, options) { + static Construct(type, name2, scene, options) { const constructorFunc = this._NodeConstructors[type]; if (!constructorFunc) { return null; } - return constructorFunc(name, scene, options); + return constructorFunc(name2, scene, options); } set accessibilityTag(value) { this._accessibilityTag = value; @@ -8449,7 +8493,7 @@ class Node2 { get onClonedObservable() { return this._nodeDataStorage._onClonedObservable; } - constructor(name, scene = null) { + constructor(name2, scene = null) { this._isDirty = false; this._nodeDataStorage = new _InternalNodeDataInfo; this.state = ""; @@ -8478,8 +8522,8 @@ class Node2 { this.onDisposeObservable = new Observable; this._onDisposeObserver = null; this._behaviors = new Array; - this.name = name; - this.id = name; + this.name = name2; + this.id = name2; this._scene = scene || EngineStore.LastCreatedScene; this.uniqueId = this._scene.getUniqueId(); this._initCache(); @@ -8518,9 +8562,9 @@ class Node2 { get behaviors() { return this._behaviors; } - getBehaviorByName(name) { + getBehaviorByName(name2) { for (const behavior of this._behaviors) { - if (behavior.name === name) { + if (behavior.name === name2) { return behavior; } } @@ -8672,38 +8716,38 @@ class Node2 { } this._nodeDataStorage._isReady = true; } - getAnimationByName(name) { + getAnimationByName(name2) { for (let i = 0;i < this.animations.length; i++) { const animation = this.animations[i]; - if (animation.name === name) { + if (animation.name === name2) { return animation; } } return null; } - createAnimationRange(name, from, to) { - if (!this._ranges[name]) { - this._ranges[name] = Node2._AnimationRangeFactory(name, from, to); + createAnimationRange(name2, from, to) { + if (!this._ranges[name2]) { + this._ranges[name2] = Node2._AnimationRangeFactory(name2, from, to); for (let i = 0, nAnimations = this.animations.length;i < nAnimations; i++) { if (this.animations[i]) { - this.animations[i].createRange(name, from, to); + this.animations[i].createRange(name2, from, to); } } } } - deleteAnimationRange(name, deleteFrames = true) { + deleteAnimationRange(name2, deleteFrames = true) { for (let i = 0, nAnimations = this.animations.length;i < nAnimations; i++) { if (this.animations[i]) { - this.animations[i].deleteRange(name, deleteFrames); + this.animations[i].deleteRange(name2, deleteFrames); } } - this._ranges[name] = null; + this._ranges[name2] = null; } - getAnimationRange(name) { - return this._ranges[name] || null; + getAnimationRange(name2) { + return this._ranges[name2] || null; } - clone(name, newParent, doNotCloneChildren) { - const result = SerializationHelper.Clone(() => new Node2(name, this.getScene()), this); + clone(name2, newParent, doNotCloneChildren) { + const result = SerializationHelper.Clone(() => new Node2(name2, this.getScene()), this); if (newParent) { result.parent = newParent; } @@ -8711,21 +8755,21 @@ class Node2 { const directDescendants = this.getDescendants(true); for (let index = 0;index < directDescendants.length; index++) { const child = directDescendants[index]; - child.clone(name + "." + child.name, result); + child.clone(name2 + "." + child.name, result); } } return result; } getAnimationRanges() { const animationRanges = []; - let name; - for (name in this._ranges) { - animationRanges.push(this._ranges[name]); + let name2; + for (name2 in this._ranges) { + animationRanges.push(this._ranges[name2]); } return animationRanges; } - beginAnimation(name, loop, speedRatio, onAnimationEnd) { - const range = this.getAnimationRange(name); + beginAnimation(name2, loop, speedRatio, onAnimationEnd) { + const range = this.getAnimationRange(name2); if (!range) { return null; } @@ -8733,13 +8777,13 @@ class Node2 { } serializeAnimationRanges() { const serializationRanges = []; - for (const name in this._ranges) { - const localRange = this._ranges[name]; + for (const name2 in this._ranges) { + const localRange = this._ranges[name2]; if (!localRange) { continue; } const range = {}; - range.name = name; + range.name = name2; range.from = localRange.from; range.to = localRange.to; serializationRanges.push(range); @@ -8822,25 +8866,33 @@ class Node2 { }; } } -Node2._AnimationRangeFactory = (_name, _from, _to) => { - throw _WarnImport("AnimationRange"); -}; -Node2._NodeConstructors = {}; -__decorate2([ - serialize() -], Node2.prototype, "name", undefined); -__decorate2([ - serialize() -], Node2.prototype, "id", undefined); -__decorate2([ - serialize() -], Node2.prototype, "uniqueId", undefined); -__decorate2([ - serialize() -], Node2.prototype, "state", undefined); -__decorate2([ - serialize() -], Node2.prototype, "metadata", undefined); +var init_node = __esm(() => { + init_tslib_es62(); + init_math_vector(); + init_decorators(); + init_observable(); + init_engineStore(); + init_devTools(); + Node2._AnimationRangeFactory = (_name, _from, _to) => { + throw _WarnImport("AnimationRange"); + }; + Node2._NodeConstructors = {}; + __decorate2([ + serialize() + ], Node2.prototype, "name", undefined); + __decorate2([ + serialize() + ], Node2.prototype, "id", undefined); + __decorate2([ + serialize() + ], Node2.prototype, "uniqueId", undefined); + __decorate2([ + serialize() + ], Node2.prototype, "state", undefined); + __decorate2([ + serialize() + ], Node2.prototype, "metadata", undefined); +}); // node_modules/@babylonjs/core/Maths/math.size.js class Size { @@ -8906,16 +8958,10 @@ class Size { return new Size(w, h); } } +var init_math_size = __esm(() => { +}); // node_modules/@babylonjs/core/Misc/webRequest.js -var createXMLHttpRequest = function() { - if (typeof _native !== "undefined" && _native.XMLHttpRequest) { - return new _native.XMLHttpRequest; - } else { - return new XMLHttpRequest; - } -}; - class WebRequest { constructor() { this._xhr = createXMLHttpRequest(); @@ -9001,32 +9047,30 @@ class WebRequest { this._requestURL = url; return this._xhr.open(method, url, true); } - setRequestHeader(name, value) { - this._xhr.setRequestHeader(name, value); + setRequestHeader(name2, value) { + this._xhr.setRequestHeader(name2, value); } - getResponseHeader(name) { - return this._xhr.getResponseHeader(name); + getResponseHeader(name2) { + return this._xhr.getResponseHeader(name2); } } -WebRequest.CustomRequestHeaders = {}; -WebRequest.CustomRequestModifiers = new Array; -WebRequest.SkipRequestModificationForBabylonCDN = true; +var createXMLHttpRequest; +var init_webRequest = __esm(() => { + createXMLHttpRequest = function() { + if (typeof _native !== "undefined" && _native.XMLHttpRequest) { + return new _native.XMLHttpRequest; + } else { + return new XMLHttpRequest; + } + }; + WebRequest.CustomRequestHeaders = {}; + WebRequest.CustomRequestModifiers = new Array; + WebRequest.SkipRequestModificationForBabylonCDN = true; +}); // node_modules/@babylonjs/core/Animations/animation.js -var _staticOffsetValueQuaternion = Object.freeze(new Quaternion(0, 0, 0, 0)); -var _staticOffsetValueVector3 = Object.freeze(Vector3.Zero()); -var _staticOffsetValueVector2 = Object.freeze(Vector2.Zero()); -var _staticOffsetValueSize = Object.freeze(Size.Zero()); -var _staticOffsetValueColor3 = Object.freeze(Color3.Black()); -var _staticOffsetValueColor4 = Object.freeze(new Color4(0, 0, 0, 0)); -var evaluateAnimationState = { - key: 0, - repeatCount: 0, - loopMode: 2 -}; - class Animation { - static _PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction) { + static _PrepareAnimation(name2, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction) { let dataType = undefined; if (!isNaN(parseFloat(from)) && isFinite(from)) { dataType = Animation.ANIMATIONTYPE_FLOAT; @@ -9046,7 +9090,7 @@ class Animation { if (dataType == undefined) { return null; } - const animation = new Animation(name, targetProperty, framePerSecond, dataType, loopMode); + const animation = new Animation(name2, targetProperty, framePerSecond, dataType, loopMode); const keys = [ { frame: 0, value: from }, { frame: totalFrame, value: to } @@ -9062,8 +9106,8 @@ class Animation { animation.setEasingFunction(easingFunction); return animation; } - static CreateAndStartAnimation(name, target, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd, scene) { - const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction); + static CreateAndStartAnimation(name2, target, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd, scene) { + const animation = Animation._PrepareAnimation(name2, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction); if (!animation) { return null; } @@ -9075,16 +9119,16 @@ class Animation { } return scene.beginDirectAnimation(target, [animation], 0, totalFrame, animation.loopMode === 1, 1, onAnimationEnd); } - static CreateAndStartHierarchyAnimation(name, node2, directDescendantsOnly, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) { - const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction); + static CreateAndStartHierarchyAnimation(name2, node2, directDescendantsOnly, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) { + const animation = Animation._PrepareAnimation(name2, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction); if (!animation) { return null; } const scene = node2.getScene(); return scene.beginDirectHierarchyAnimation(node2, directDescendantsOnly, [animation], 0, totalFrame, animation.loopMode === 1, 1, onAnimationEnd); } - static CreateMergeAndStartAnimation(name, node2, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) { - const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction); + static CreateMergeAndStartAnimation(name2, node2, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) { + const animation = Animation._PrepareAnimation(name2, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction); if (!animation) { return null; } @@ -9254,8 +9298,8 @@ class Animation { } return false; } - constructor(name, targetProperty, framePerSecond, dataType, loopMode, enableBlending) { - this.name = name; + constructor(name2, targetProperty, framePerSecond, dataType, loopMode, enableBlending) { + this.name = name2; this.targetProperty = targetProperty; this.framePerSecond = framePerSecond; this.dataType = dataType; @@ -9279,12 +9323,12 @@ class Animation { if (fullDetails) { ret += ", Ranges: {"; let first = true; - for (const name in this._ranges) { + for (const name2 in this._ranges) { if (first) { ret += ", "; first = false; } - ret += name; + ret += name2; } ret += "}"; } @@ -9305,13 +9349,13 @@ class Animation { getEvents() { return this._events; } - createRange(name, from, to) { - if (!this._ranges[name]) { - this._ranges[name] = new AnimationRange(name, from, to); + createRange(name2, from, to) { + if (!this._ranges[name2]) { + this._ranges[name2] = new AnimationRange(name2, from, to); } } - deleteRange(name, deleteFrames = true) { - const range = this._ranges[name]; + deleteRange(name2, deleteFrames = true) { + const range = this._ranges[name2]; if (!range) { return; } @@ -9324,10 +9368,10 @@ class Animation { } } } - this._ranges[name] = null; + this._ranges[name2] = null; } - getRange(name) { - return this._ranges[name]; + getRange(name2) { + return this._ranges[name2]; } getKeys() { return this._keys; @@ -9571,12 +9615,12 @@ class Animation { } if (this._ranges) { clone._ranges = {}; - for (const name in this._ranges) { - const range = this._ranges[name]; + for (const name2 in this._ranges) { + const range = this._ranges[name2]; if (!range) { continue; } - clone._ranges[name] = range.clone(); + clone._ranges[name2] = range.clone(); } } return clone; @@ -9664,13 +9708,13 @@ class Animation { serializationObject.keys.push(key); } serializationObject.ranges = []; - for (const name in this._ranges) { - const source = this._ranges[name]; + for (const name2 in this._ranges) { + const source = this._ranges[name2]; if (!source) { continue; } const range = {}; - range.name = name; + range.name = name2; range.from = source.from; range.to = source.to; serializationObject.ranges.push(range); @@ -9807,7 +9851,7 @@ class Animation { static AppendSerializedAnimations(source, destination) { SerializationHelper.AppendSerializedAnimations(source, destination); } - static ParseFromFileAsync(name, url) { + static ParseFromFileAsync(name2, url) { return new Promise((resolve, reject) => { const request = new WebRequest; request.addEventListener("readystatechange", () => { @@ -9825,8 +9869,8 @@ class Animation { resolve(output); } else { const output = this.Parse(serializationObject); - if (name) { - output.name = name; + if (name2) { + output.name = name2; } resolve(output); } @@ -9871,26 +9915,50 @@ class Animation { }); } } -Animation._UniqueIdGenerator = 0; -Animation.AllowMatricesInterpolation = false; -Animation.AllowMatrixDecomposeForInterpolation = true; -Animation.SnippetUrl = `https://snippet.babylonjs.com`; -Animation.ANIMATIONTYPE_FLOAT = 0; -Animation.ANIMATIONTYPE_VECTOR3 = 1; -Animation.ANIMATIONTYPE_QUATERNION = 2; -Animation.ANIMATIONTYPE_MATRIX = 3; -Animation.ANIMATIONTYPE_COLOR3 = 4; -Animation.ANIMATIONTYPE_COLOR4 = 7; -Animation.ANIMATIONTYPE_VECTOR2 = 5; -Animation.ANIMATIONTYPE_SIZE = 6; -Animation.ANIMATIONLOOPMODE_RELATIVE = 0; -Animation.ANIMATIONLOOPMODE_CYCLE = 1; -Animation.ANIMATIONLOOPMODE_CONSTANT = 2; -Animation.ANIMATIONLOOPMODE_YOYO = 4; -Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT = 5; -Animation.CreateFromSnippetAsync = Animation.ParseFromSnippetAsync; -RegisterClass("BABYLON.Animation", Animation); -Node2._AnimationRangeFactory = (name, from, to) => new AnimationRange(name, from, to); +var _staticOffsetValueQuaternion, _staticOffsetValueVector3, _staticOffsetValueVector2, _staticOffsetValueSize, _staticOffsetValueColor3, _staticOffsetValueColor4, evaluateAnimationState; +var init_animation = __esm(() => { + init_math_vector(); + init_math_color(); + init_math_scalar(); + init_decorators(); + init_typeStore(); + init_animationKey(); + init_animationRange(); + init_node(); + init_math_size(); + init_webRequest(); + _staticOffsetValueQuaternion = Object.freeze(new Quaternion(0, 0, 0, 0)); + _staticOffsetValueVector3 = Object.freeze(Vector3.Zero()); + _staticOffsetValueVector2 = Object.freeze(Vector2.Zero()); + _staticOffsetValueSize = Object.freeze(Size.Zero()); + _staticOffsetValueColor3 = Object.freeze(Color3.Black()); + _staticOffsetValueColor4 = Object.freeze(new Color4(0, 0, 0, 0)); + evaluateAnimationState = { + key: 0, + repeatCount: 0, + loopMode: 2 + }; + Animation._UniqueIdGenerator = 0; + Animation.AllowMatricesInterpolation = false; + Animation.AllowMatrixDecomposeForInterpolation = true; + Animation.SnippetUrl = `https://snippet.babylonjs.com`; + Animation.ANIMATIONTYPE_FLOAT = 0; + Animation.ANIMATIONTYPE_VECTOR3 = 1; + Animation.ANIMATIONTYPE_QUATERNION = 2; + Animation.ANIMATIONTYPE_MATRIX = 3; + Animation.ANIMATIONTYPE_COLOR3 = 4; + Animation.ANIMATIONTYPE_COLOR4 = 7; + Animation.ANIMATIONTYPE_VECTOR2 = 5; + Animation.ANIMATIONTYPE_SIZE = 6; + Animation.ANIMATIONLOOPMODE_RELATIVE = 0; + Animation.ANIMATIONLOOPMODE_CYCLE = 1; + Animation.ANIMATIONLOOPMODE_CONSTANT = 2; + Animation.ANIMATIONLOOPMODE_YOYO = 4; + Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT = 5; + Animation.CreateFromSnippetAsync = Animation.ParseFromSnippetAsync; + RegisterClass("BABYLON.Animation", Animation); + Node2._AnimationRangeFactory = (name2, from, to) => new AnimationRange(name2, from, to); +}); // node_modules/@babylonjs/core/Actions/interpolateValueAction.js class InterpolateValueAction extends Action { @@ -9962,7 +10030,29 @@ class InterpolateValueAction extends Action { }, parent); } } -RegisterClass("BABYLON.InterpolateValueAction", InterpolateValueAction); +var init_interpolateValueAction = __esm(() => { + init_action(); + init_logger(); + init_observable(); + init_math_color(); + init_math_vector(); + init_animation(); + init_typeStore(); + RegisterClass("BABYLON.InterpolateValueAction", InterpolateValueAction); +}); + +// node_modules/@babylonjs/core/Actions/index.js +var init_Actions = __esm(() => { + init_abstractActionManager(); + init_action(); + init_actionEvent(); + init_actionManager(); + init_condition(); + init_directActions(); + init_directAudioActions(); + init_interpolateValueAction(); +}); + // node_modules/@babylonjs/core/Animations/runtimeAnimation.js class RuntimeAnimation { get currentFrame() { @@ -10350,6 +10440,10 @@ class RuntimeAnimation { return returnValue; } } +var init_runtimeAnimation = __esm(() => { + init_math_vector(); + init_animation(); +}); // node_modules/@babylonjs/core/Misc/domManagement.js function IsWindowObjectExist() { @@ -10372,6 +10466,15 @@ function GetDOMTextContent(element) { } return result; } +var DomManagement; +var init_domManagement = __esm(() => { + DomManagement = { + IsWindowObjectExist, + IsNavigatorAvailable, + IsDocumentAvailable, + GetDOMTextContent + }; +}); // node_modules/@babylonjs/core/Misc/precisionDate.js class PrecisionDate { @@ -10382,11 +10485,16 @@ class PrecisionDate { return Date.now(); } } +var init_precisionDate = __esm(() => { + init_domManagement(); +}); // node_modules/@babylonjs/core/Misc/filesInputStore.js class FilesInputStore { } -FilesInputStore.FilesToLoad = {}; +var init_filesInputStore = __esm(() => { + FilesInputStore.FilesToLoad = {}; +}); // node_modules/@babylonjs/core/Misc/retryStrategy.js class RetryStrategy { @@ -10399,23 +10507,12 @@ class RetryStrategy { }; } } +var init_retryStrategy = __esm(() => { +}); // node_modules/@babylonjs/core/Misc/error.js class BaseError extends Error { } -BaseError._setPrototypeOf = Object.setPrototypeOf || ((o, proto) => { - o.__proto__ = proto; - return o; -}); -var ErrorCodes = { - MeshInvalidPositionsError: 0, - UnsupportedTextureError: 1000, - GLTFLoaderUnexpectedMagicError: 2000, - SceneLoaderError: 3000, - LoadFileError: 4000, - RequestFileError: 4001, - ReadFileError: 4002 -}; class RuntimeError extends BaseError { constructor(message, errorCode, innerError) { @@ -10426,58 +10523,99 @@ class RuntimeError extends BaseError { BaseError._setPrototypeOf(this, RuntimeError.prototype); } } +var ErrorCodes; +var init_error = __esm(() => { + BaseError._setPrototypeOf = Object.setPrototypeOf || ((o, proto) => { + o.__proto__ = proto; + return o; + }); + ErrorCodes = { + MeshInvalidPositionsError: 0, + UnsupportedTextureError: 1000, + GLTFLoaderUnexpectedMagicError: 2000, + SceneLoaderError: 3000, + LoadFileError: 4000, + RequestFileError: 4001, + ReadFileError: 4002 + }; +}); // node_modules/@babylonjs/core/Misc/stringTools.js -var Decode = (buffer) => { - if (typeof TextDecoder !== "undefined") { - return new TextDecoder().decode(buffer); - } - let result = ""; - for (let i = 0;i < buffer.byteLength; i++) { - result += String.fromCharCode(buffer[i]); - } - return result; -}; -var EncodeArrayBufferToBase64 = (buffer) => { - const keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - let output = ""; - let chr1, chr2, chr3, enc1, enc2, enc3, enc4; - let i = 0; - const bytes = ArrayBuffer.isView(buffer) ? new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength) : new Uint8Array(buffer); - while (i < bytes.length) { - chr1 = bytes[i++]; - chr2 = i < bytes.length ? bytes[i++] : Number.NaN; - chr3 = i < bytes.length ? bytes[i++] : Number.NaN; - enc1 = chr1 >> 2; - enc2 = (chr1 & 3) << 4 | chr2 >> 4; - enc3 = (chr2 & 15) << 2 | chr3 >> 6; - enc4 = chr3 & 63; - if (isNaN(chr2)) { - enc3 = enc4 = 64; - } else if (isNaN(chr3)) { - enc4 = 64; - } - output += keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4); - } - return output; -}; -var DecodeBase64ToString = (base64Data) => { - return atob(base64Data); -}; -var DecodeBase64ToBinary = (base64Data) => { - const decodedString = DecodeBase64ToString(base64Data); - const bufferLength = decodedString.length; - const bufferView = new Uint8Array(new ArrayBuffer(bufferLength)); - for (let i = 0;i < bufferLength; i++) { - bufferView[i] = decodedString.charCodeAt(i); - } - return bufferView.buffer; -}; +var EndsWith, StartsWith, Decode, EncodeArrayBufferToBase64, DecodeBase64ToString, DecodeBase64ToBinary, PadNumber, StringTools; +var init_stringTools = __esm(() => { + EndsWith = (str, suffix) => { + return str.endsWith(suffix); + }; + StartsWith = (str, suffix) => { + if (!str) { + return false; + } + return str.startsWith(suffix); + }; + Decode = (buffer) => { + if (typeof TextDecoder !== "undefined") { + return new TextDecoder().decode(buffer); + } + let result = ""; + for (let i = 0;i < buffer.byteLength; i++) { + result += String.fromCharCode(buffer[i]); + } + return result; + }; + EncodeArrayBufferToBase64 = (buffer) => { + const keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + let output = ""; + let chr1, chr2, chr3, enc1, enc2, enc3, enc4; + let i = 0; + const bytes = ArrayBuffer.isView(buffer) ? new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength) : new Uint8Array(buffer); + while (i < bytes.length) { + chr1 = bytes[i++]; + chr2 = i < bytes.length ? bytes[i++] : Number.NaN; + chr3 = i < bytes.length ? bytes[i++] : Number.NaN; + enc1 = chr1 >> 2; + enc2 = (chr1 & 3) << 4 | chr2 >> 4; + enc3 = (chr2 & 15) << 2 | chr3 >> 6; + enc4 = chr3 & 63; + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + output += keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4); + } + return output; + }; + DecodeBase64ToString = (base64Data) => { + return atob(base64Data); + }; + DecodeBase64ToBinary = (base64Data) => { + const decodedString = DecodeBase64ToString(base64Data); + const bufferLength = decodedString.length; + const bufferView = new Uint8Array(new ArrayBuffer(bufferLength)); + for (let i = 0;i < bufferLength; i++) { + bufferView[i] = decodedString.charCodeAt(i); + } + return bufferView.buffer; + }; + PadNumber = (num, length) => { + let str = String(num); + while (str.length < length) { + str = "0" + str; + } + return str; + }; + StringTools = { + EndsWith, + StartsWith, + Decode, + EncodeArrayBufferToBase64, + DecodeBase64ToString, + DecodeBase64ToBinary, + PadNumber + }; +}); // node_modules/@babylonjs/core/Engines/Processors/shaderCodeNode.js -var defaultAttributeKeywordName = "attribute"; -var defaultVaryingKeywordName = "varying"; - class ShaderCodeNode { constructor() { this.children = []; @@ -10543,6 +10681,11 @@ class ShaderCodeNode { return result; } } +var defaultAttributeKeywordName, defaultVaryingKeywordName; +var init_shaderCodeNode = __esm(() => { + defaultAttributeKeywordName = "attribute"; + defaultVaryingKeywordName = "varying"; +}); // node_modules/@babylonjs/core/Engines/Processors/shaderCodeCursor.js class ShaderCodeCursor { @@ -10597,6 +10740,8 @@ class ShaderCodeCursor { } } } +var init_shaderCodeCursor = __esm(() => { +}); // node_modules/@babylonjs/core/Engines/Processors/shaderCodeConditionNode.js class ShaderCodeConditionNode extends ShaderCodeNode { @@ -10610,6 +10755,9 @@ class ShaderCodeConditionNode extends ShaderCodeNode { return ""; } } +var init_shaderCodeConditionNode = __esm(() => { + init_shaderCodeNode(); +}); // node_modules/@babylonjs/core/Engines/Processors/shaderCodeTestNode.js class ShaderCodeTestNode extends ShaderCodeNode { @@ -10617,6 +10765,9 @@ class ShaderCodeTestNode extends ShaderCodeNode { return this.testExpression.isTrue(preprocessors); } } +var init_shaderCodeTestNode = __esm(() => { + init_shaderCodeNode(); +}); // node_modules/@babylonjs/core/Engines/Processors/Expressions/shaderDefineExpression.js class ShaderDefineExpression { @@ -10706,22 +10857,24 @@ class ShaderDefineExpression { } } } -ShaderDefineExpression.InfixToPostfixCacheLimitSize = 50000; -ShaderDefineExpression.InfixToPostfixCacheCleanupSize = 25000; -ShaderDefineExpression._InfixToPostfixCache = new Map; -ShaderDefineExpression._OperatorPriority = { - ")": 0, - "(": 1, - "||": 2, - "&&": 3 -}; -ShaderDefineExpression._Stack = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]; +var init_shaderDefineExpression = __esm(() => { + ShaderDefineExpression.InfixToPostfixCacheLimitSize = 50000; + ShaderDefineExpression.InfixToPostfixCacheCleanupSize = 25000; + ShaderDefineExpression._InfixToPostfixCache = new Map; + ShaderDefineExpression._OperatorPriority = { + ")": 0, + "(": 1, + "||": 2, + "&&": 3 + }; + ShaderDefineExpression._Stack = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]; +}); // node_modules/@babylonjs/core/Engines/Processors/Expressions/Operators/shaderDefineIsDefinedOperator.js class ShaderDefineIsDefinedOperator extends ShaderDefineExpression { - constructor(define, not = false) { + constructor(define2, not = false) { super(); - this.define = define; + this.define = define2; this.not = not; } isTrue(preprocessors) { @@ -10732,6 +10885,9 @@ class ShaderDefineIsDefinedOperator extends ShaderDefineExpression { return condition3; } } +var init_shaderDefineIsDefinedOperator = __esm(() => { + init_shaderDefineExpression(); +}); // node_modules/@babylonjs/core/Engines/Processors/Expressions/Operators/shaderDefineOrOperator.js class ShaderDefineOrOperator extends ShaderDefineExpression { @@ -10739,6 +10895,9 @@ class ShaderDefineOrOperator extends ShaderDefineExpression { return this.leftOperand.isTrue(preprocessors) || this.rightOperand.isTrue(preprocessors); } } +var init_shaderDefineOrOperator = __esm(() => { + init_shaderDefineExpression(); +}); // node_modules/@babylonjs/core/Engines/Processors/Expressions/Operators/shaderDefineAndOperator.js class ShaderDefineAndOperator extends ShaderDefineExpression { @@ -10746,12 +10905,15 @@ class ShaderDefineAndOperator extends ShaderDefineExpression { return this.leftOperand.isTrue(preprocessors) && this.rightOperand.isTrue(preprocessors); } } +var init_shaderDefineAndOperator = __esm(() => { + init_shaderDefineExpression(); +}); // node_modules/@babylonjs/core/Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.js class ShaderDefineArithmeticOperator extends ShaderDefineExpression { - constructor(define, operand, testValue) { + constructor(define2, operand, testValue) { super(); - this.define = define; + this.define = define2; this.operand = operand; this.testValue = testValue; } @@ -10786,23 +10948,20 @@ class ShaderDefineArithmeticOperator extends ShaderDefineExpression { return condition3; } } +var init_shaderDefineArithmeticOperator = __esm(() => { + init_shaderDefineExpression(); +}); // node_modules/@babylonjs/core/Materials/shaderLanguage.js var ShaderLanguage; -(function(ShaderLanguage2) { - ShaderLanguage2[ShaderLanguage2["GLSL"] = 0] = "GLSL"; - ShaderLanguage2[ShaderLanguage2["WGSL"] = 1] = "WGSL"; -})(ShaderLanguage || (ShaderLanguage = {})); +var init_shaderLanguage = __esm(() => { + (function(ShaderLanguage2) { + ShaderLanguage2[ShaderLanguage2["GLSL"] = 0] = "GLSL"; + ShaderLanguage2[ShaderLanguage2["WGSL"] = 1] = "WGSL"; + })(ShaderLanguage || (ShaderLanguage = {})); +}); // node_modules/@babylonjs/core/Engines/Processors/shaderProcessor.js -var regexSE = /defined\s*?\((.+?)\)/g; -var regexSERevert = /defined\s*?\[(.+?)\]/g; -var regexShaderInclude = /#include\s?<(.+)>(\((.*)\))*(\[(.*)\])*/g; -var regexShaderDecl = /__decl__/; -var regexLightX = /light\{X\}.(\w*)/g; -var regexX = /\{X\}/g; -var reusableMatches = []; - class ShaderProcessor { static Initialize(options) { if (options.processor && options.processor.initializeShaders) { @@ -10878,9 +11037,9 @@ class ShaderProcessor { if (indexOperator === -1) { return new ShaderDefineIsDefinedOperator(expression); } - const define = expression.substring(0, indexOperator).trim(); + const define2 = expression.substring(0, indexOperator).trim(); const value = expression.substring(indexOperator + operator.length).trim(); - return new ShaderDefineArithmeticOperator(define, operator, value); + return new ShaderDefineArithmeticOperator(define2, operator, value); } static _BuildSubExpression(expression) { expression = expression.replace(regexSE, "defined[$1]"); @@ -11008,8 +11167,8 @@ class ShaderProcessor { var _a; const defines = options.defines; const preprocessors = {}; - for (const define of defines) { - const keyValue = define.replace("#define", "").replace(";", "").trim(); + for (const define2 of defines) { + const keyValue = define2.replace("#define", "").replace(";", "").trim(); const split = keyValue.split(" "); preprocessors[split[0]] = split.length > 1 ? split[1] : ""; } @@ -11151,7 +11310,28 @@ class ShaderProcessor { throw _WarnImport("FileTools"); } } -ShaderProcessor._MoveCursorRegex = /(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/; +var regexSE, regexSERevert, regexShaderInclude, regexShaderDecl, regexLightX, regexX, reusableMatches; +var init_shaderProcessor = __esm(() => { + init_shaderCodeNode(); + init_shaderCodeCursor(); + init_shaderCodeConditionNode(); + init_shaderCodeTestNode(); + init_shaderDefineIsDefinedOperator(); + init_shaderDefineOrOperator(); + init_shaderDefineAndOperator(); + init_shaderDefineExpression(); + init_shaderDefineArithmeticOperator(); + init_devTools(); + init_shaderLanguage(); + regexSE = /defined\s*?\((.+?)\)/g; + regexSERevert = /defined\s*?\[(.+?)\]/g; + regexShaderInclude = /#include\s?<(.+)>(\((.*)\))*(\[(.*)\])*/g; + regexShaderDecl = /__decl__/; + regexLightX = /light\{X\}.(\w*)/g; + regexX = /\{X\}/g; + reusableMatches = []; + ShaderProcessor._MoveCursorRegex = /(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/; +}); // node_modules/@babylonjs/core/Engines/shaderStore.js class ShaderStore { @@ -11165,12 +11345,15 @@ class ShaderStore { return shaderLanguage3 === ShaderLanguage.GLSL ? ShaderStore.IncludesShadersStore : ShaderStore.IncludesShadersStoreWGSL; } } -ShaderStore.ShadersRepository = "src/Shaders/"; -ShaderStore.ShadersStore = {}; -ShaderStore.IncludesShadersStore = {}; -ShaderStore.ShadersRepositoryWGSL = "src/ShadersWGSL/"; -ShaderStore.ShadersStoreWGSL = {}; -ShaderStore.IncludesShadersStoreWGSL = {}; +var init_shaderStore = __esm(() => { + init_shaderLanguage(); + ShaderStore.ShadersRepository = "src/Shaders/"; + ShaderStore.ShadersStore = {}; + ShaderStore.IncludesShadersStore = {}; + ShaderStore.ShadersRepositoryWGSL = "src/ShadersWGSL/"; + ShaderStore.ShadersStoreWGSL = {}; + ShaderStore.IncludesShadersStoreWGSL = {}; +}); // node_modules/@babylonjs/core/Materials/effect.js class Effect { @@ -11383,8 +11566,8 @@ class Effect { getAttributeLocation(index) { return this._attributes[index]; } - getAttributeLocationByName(name) { - return this._attributeLocationByName[name]; + getAttributeLocationByName(name2) { + return this._attributeLocationByName[name2]; } getAttributesCount() { return this._attributes.length; @@ -11539,8 +11722,8 @@ class Effect { this._pipelineContext._fillEffectInformation(this, this._uniformBuffersNames, this._uniformsNames, this._uniforms, this._samplerList, this._samplers, attributesNames, this._attributes); if (attributesNames) { for (let i = 0;i < attributesNames.length; i++) { - const name = attributesNames[i]; - this._attributeLocationByName[name] = this._attributes[i]; + const name2 = attributesNames[i]; + this._attributeLocationByName[name2] = this._attributes[i]; } } engine.bindSamplers(this); @@ -11684,13 +11867,13 @@ class Effect { setTextureFromPostProcessOutput(channel, postProcess) { this._engine.setTextureFromPostProcessOutput(this._samplers[channel], postProcess, channel); } - bindUniformBuffer(buffer, name) { - const bufferName = this._uniformBuffersNames[name]; + bindUniformBuffer(buffer, name2) { + const bufferName = this._uniformBuffersNames[name2]; if (bufferName === undefined || Effect._BaseCache[bufferName] === buffer && this._engine._features.useUBOBindingCache) { return; } Effect._BaseCache[bufferName] = buffer; - this._engine.bindUniformBufferBase(buffer, bufferName, name); + this._engine.bindUniformBufferBase(buffer, bufferName, name2); } bindUniformBlock(blockName, index) { this._engine.bindUniformBlock(this._pipelineContext, blockName, index); @@ -11862,23 +12045,31 @@ class Effect { this._engine._releaseEffect(this); this._isDisposed = true; } - static RegisterShader(name, pixelShader, vertexShader, shaderLanguage4 = ShaderLanguage.GLSL) { + static RegisterShader(name2, pixelShader, vertexShader, shaderLanguage4 = ShaderLanguage.GLSL) { if (pixelShader) { - ShaderStore.GetShadersStore(shaderLanguage4)[`${name}PixelShader`] = pixelShader; + ShaderStore.GetShadersStore(shaderLanguage4)[`${name2}PixelShader`] = pixelShader; } if (vertexShader) { - ShaderStore.GetShadersStore(shaderLanguage4)[`${name}VertexShader`] = vertexShader; + ShaderStore.GetShadersStore(shaderLanguage4)[`${name2}VertexShader`] = vertexShader; } } static ResetCache() { Effect._BaseCache = {}; } } -Effect.LogShaderCodeOnCompilationError = true; -Effect._UniqueIdSeed = 0; -Effect._BaseCache = {}; -Effect.ShadersStore = ShaderStore.ShadersStore; -Effect.IncludesShadersStore = ShaderStore.IncludesShadersStore; +var init_effect = __esm(() => { + init_observable(); + init_domManagement(); + init_logger(); + init_shaderProcessor(); + init_shaderStore(); + init_shaderLanguage(); + Effect.LogShaderCodeOnCompilationError = true; + Effect._UniqueIdSeed = 0; + Effect._BaseCache = {}; + Effect.ShadersStore = ShaderStore.ShadersStore; + Effect.IncludesShadersStore = ShaderStore.IncludesShadersStore; +}); // node_modules/@babylonjs/core/States/depthCullingState.js class DepthCullingState { @@ -12041,6 +12232,8 @@ class DepthCullingState { } } } +var init_depthCullingState = __esm(() => { +}); // node_modules/@babylonjs/core/States/stencilState.js class StencilState { @@ -12106,9 +12299,11 @@ class StencilState { this.enabled = value; } } -StencilState.ALWAYS = 519; -StencilState.KEEP = 7680; -StencilState.REPLACE = 7681; +var init_stencilState = __esm(() => { + StencilState.ALWAYS = 519; + StencilState.KEEP = 7680; + StencilState.REPLACE = 7681; +}); // node_modules/@babylonjs/core/States/alphaCullingState.js class AlphaState { @@ -12207,6 +12402,8 @@ class AlphaState { } } } +var init_alphaCullingState = __esm(() => { +}); // node_modules/@babylonjs/core/Materials/Textures/textureSampler.js class TextureSampler { @@ -12268,27 +12465,10 @@ class TextureSampler { return this._cachedWrapU === other._cachedWrapU && this._cachedWrapV === other._cachedWrapV && this._cachedWrapR === other._cachedWrapR && this._cachedAnisotropicFilteringLevel === other._cachedAnisotropicFilteringLevel && this.samplingMode === other.samplingMode && this._comparisonFunction === other._comparisonFunction && this._useMipMaps === other._useMipMaps; } } +var init_textureSampler = __esm(() => { +}); // node_modules/@babylonjs/core/Materials/Textures/internalTexture.js -var InternalTextureSource; -(function(InternalTextureSource2) { - InternalTextureSource2[InternalTextureSource2["Unknown"] = 0] = "Unknown"; - InternalTextureSource2[InternalTextureSource2["Url"] = 1] = "Url"; - InternalTextureSource2[InternalTextureSource2["Temp"] = 2] = "Temp"; - InternalTextureSource2[InternalTextureSource2["Raw"] = 3] = "Raw"; - InternalTextureSource2[InternalTextureSource2["Dynamic"] = 4] = "Dynamic"; - InternalTextureSource2[InternalTextureSource2["RenderTarget"] = 5] = "RenderTarget"; - InternalTextureSource2[InternalTextureSource2["MultiRenderTarget"] = 6] = "MultiRenderTarget"; - InternalTextureSource2[InternalTextureSource2["Cube"] = 7] = "Cube"; - InternalTextureSource2[InternalTextureSource2["CubeRaw"] = 8] = "CubeRaw"; - InternalTextureSource2[InternalTextureSource2["CubePrefiltered"] = 9] = "CubePrefiltered"; - InternalTextureSource2[InternalTextureSource2["Raw3D"] = 10] = "Raw3D"; - InternalTextureSource2[InternalTextureSource2["Raw2DArray"] = 11] = "Raw2DArray"; - InternalTextureSource2[InternalTextureSource2["DepthStencil"] = 12] = "DepthStencil"; - InternalTextureSource2[InternalTextureSource2["CubeRawRGBD"] = 13] = "CubeRawRGBD"; - InternalTextureSource2[InternalTextureSource2["Depth"] = 14] = "Depth"; -})(InternalTextureSource || (InternalTextureSource = {})); - class InternalTexture extends TextureSampler { get useMipMaps() { return this.generateMipMaps; @@ -12512,7 +12692,29 @@ class InternalTexture extends TextureSampler { } } } -InternalTexture._Counter = 0; +var InternalTextureSource; +var init_internalTexture = __esm(() => { + init_observable(); + init_textureSampler(); + (function(InternalTextureSource2) { + InternalTextureSource2[InternalTextureSource2["Unknown"] = 0] = "Unknown"; + InternalTextureSource2[InternalTextureSource2["Url"] = 1] = "Url"; + InternalTextureSource2[InternalTextureSource2["Temp"] = 2] = "Temp"; + InternalTextureSource2[InternalTextureSource2["Raw"] = 3] = "Raw"; + InternalTextureSource2[InternalTextureSource2["Dynamic"] = 4] = "Dynamic"; + InternalTextureSource2[InternalTextureSource2["RenderTarget"] = 5] = "RenderTarget"; + InternalTextureSource2[InternalTextureSource2["MultiRenderTarget"] = 6] = "MultiRenderTarget"; + InternalTextureSource2[InternalTextureSource2["Cube"] = 7] = "Cube"; + InternalTextureSource2[InternalTextureSource2["CubeRaw"] = 8] = "CubeRaw"; + InternalTextureSource2[InternalTextureSource2["CubePrefiltered"] = 9] = "CubePrefiltered"; + InternalTextureSource2[InternalTextureSource2["Raw3D"] = 10] = "Raw3D"; + InternalTextureSource2[InternalTextureSource2["Raw2DArray"] = 11] = "Raw2DArray"; + InternalTextureSource2[InternalTextureSource2["DepthStencil"] = 12] = "DepthStencil"; + InternalTextureSource2[InternalTextureSource2["CubeRawRGBD"] = 13] = "CubeRawRGBD"; + InternalTextureSource2[InternalTextureSource2["Depth"] = 14] = "Depth"; + })(InternalTextureSource || (InternalTextureSource = {})); + InternalTexture._Counter = 0; +}); // node_modules/@babylonjs/core/Engines/WebGL/webGLShaderProcessors.js class WebGLShaderProcessor { @@ -12527,10 +12729,11 @@ class WebGLShaderProcessor { return code; } } +var init_webGLShaderProcessors = __esm(() => { + init_shaderLanguage(); +}); // node_modules/@babylonjs/core/Engines/WebGL/webGL2ShaderProcessors.js -var varyingRegex = /(flat\s)?\s*varying\s*.*/; - class WebGL2ShaderProcessor { constructor() { this.shaderLanguage = ShaderLanguage.GLSL; @@ -12567,6 +12770,11 @@ class WebGL2ShaderProcessor { return code; } } +var varyingRegex; +var init_webGL2ShaderProcessors = __esm(() => { + init_shaderLanguage(); + varyingRegex = /(flat\s)?\s*varying\s*.*/; +}); // node_modules/@babylonjs/core/Buffers/dataBuffer.js class DataBuffer { @@ -12580,7 +12788,9 @@ class DataBuffer { this.uniqueId = DataBuffer._Counter++; } } -DataBuffer._Counter = 0; +var init_dataBuffer = __esm(() => { + DataBuffer._Counter = 0; +}); // node_modules/@babylonjs/core/Meshes/WebGL/webGLDataBuffer.js class WebGLDataBuffer extends DataBuffer { @@ -12592,6 +12802,9 @@ class WebGLDataBuffer extends DataBuffer { return this._buffer; } } +var init_webGLDataBuffer = __esm(() => { + init_dataBuffer(); +}); // node_modules/@babylonjs/core/Engines/WebGL/webGLPipelineContext.js class WebGLPipelineContext { @@ -12623,8 +12836,8 @@ class WebGLPipelineContext { _fillEffectInformation(effect, uniformBuffersNames, uniformsNames, uniforms, samplerList, samplers, attributesNames, attributes) { const engine = this.engine; if (engine.supportsUniformBuffers) { - for (const name in uniformBuffersNames) { - effect.bindUniformBlock(name, uniformBuffersNames[name]); + for (const name2 in uniformBuffersNames) { + effect.bindUniformBlock(name2, uniformBuffersNames[name2]); } } const effectAvailableUniforms = this.engine.getUniforms(this, uniformsNames); @@ -12640,8 +12853,8 @@ class WebGLPipelineContext { index--; } } - samplerList.forEach((name, index2) => { - samplers[name] = index2; + samplerList.forEach((name2, index2) => { + samplers[name2] = index2; }); for (const attr of engine.getAttributes(this, attributesNames)) { attributes.push(attr); @@ -12942,6 +13155,8 @@ class WebGLPipelineContext { return this.fragmentShader ? this.engine._getShaderSource(this.fragmentShader) : null; } } +var init_webGLPipelineContext = __esm(() => { +}); // node_modules/@babylonjs/core/Engines/WebGL/webGLHardwareTexture.js class WebGLHardwareTexture { @@ -12994,6 +13209,8 @@ class WebGLHardwareTexture { this.reset(); } } +var init_webGLHardwareTexture = __esm(() => { +}); // node_modules/@babylonjs/core/Materials/drawWrapper.js class DrawWrapper { @@ -13026,6 +13243,8 @@ class DrawWrapper { (_a = this.drawContext) === null || _a === undefined || _a.dispose(); } } +var init_drawWrapper = __esm(() => { +}); // node_modules/@babylonjs/core/States/stencilStateComposer.js class StencilStateComposer { @@ -13170,6 +13389,8 @@ class StencilStateComposer { } } } +var init_stencilStateComposer = __esm(() => { +}); // node_modules/@babylonjs/core/Engines/thinEngine.js class BufferPointer { @@ -14592,11 +14813,11 @@ class ThinEngine { this._currentInstanceBuffers.push(instancesBuffer); } } - disableInstanceAttributeByName(name) { + disableInstanceAttributeByName(name2) { if (!this._currentEffect) { return; } - const attributeLocation = this._currentEffect.getAttributeLocationByName(name); + const attributeLocation = this._currentEffect.getAttributeLocationByName(name2); this.disableInstanceAttribute(attributeLocation); } disableInstanceAttribute(attributeLocation) { @@ -14738,16 +14959,16 @@ class ThinEngine { if (globalDefines) { fullDefines += globalDefines; } - const name = vertex + "+" + fragment + "@" + fullDefines; - if (this._compiledEffects[name]) { - const compiledEffect = this._compiledEffects[name]; + const name2 = vertex + "+" + fragment + "@" + fullDefines; + if (this._compiledEffects[name2]) { + const compiledEffect = this._compiledEffects[name2]; if (onCompiled && compiledEffect.isReady()) { onCompiled(compiledEffect); } return compiledEffect; } - const effect2 = new Effect(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, this, defines, fallbacks, onCompiled, onError, indexParameters, name, shaderLanguage7); - this._compiledEffects[name] = effect2; + const effect2 = new Effect(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, this, defines, fallbacks, onCompiled, onError, indexParameters, name2, shaderLanguage7); + this._compiledEffects[name2] = effect2; return effect2; } static _ConcatenateShader(source, defines, shaderVersion = "") { @@ -15911,7 +16132,7 @@ class ThinEngine { } return wasPreviouslyBound; } - _bindTexture(channel, texture, name) { + _bindTexture(channel, texture, name2) { if (channel === undefined) { return; } @@ -15933,7 +16154,7 @@ class ThinEngine { } } } - setTexture(channel, uniform, texture, name) { + setTexture(channel, uniform, texture, name2) { if (channel === undefined) { return; } @@ -15961,7 +16182,7 @@ class ThinEngine { } return this._gl.REPEAT; } - _setTexture(channel, texture, isPartOfTextureArray = false, depthStencilTexture = false, name = "") { + _setTexture(channel, texture, isPartOfTextureArray = false, depthStencilTexture = false, name2 = "") { if (!texture) { if (this._boundTexturesCache[channel] != null) { this._activeChannel = channel; @@ -16037,7 +16258,7 @@ class ThinEngine { } return true; } - setTextureArray(channel, uniform, textures, name) { + setTextureArray(channel, uniform, textures, name2) { if (channel === undefined || !uniform) { return; } @@ -16094,8 +16315,8 @@ class ThinEngine { } } releaseEffects() { - for (const name in this._compiledEffects) { - const webGLPipelineContext2 = this._compiledEffects[name].getPipelineContext(); + for (const name2 in this._compiledEffects) { + const webGLPipelineContext2 = this._compiledEffects[name2].getPipelineContext(); this._deletePipelineContext(webGLPipelineContext2); } this._compiledEffects = {}; @@ -16580,26 +16801,48 @@ class ThinEngine { return IsDocumentAvailable() ? document : null; } } -ThinEngine._TempClearColorUint32 = new Uint32Array(4); -ThinEngine._TempClearColorInt32 = new Int32Array(4); -ThinEngine.ExceptionList = [ - { key: "Chrome/63.0", capture: "63\\.0\\.3239\\.(\\d+)", captureConstraint: 108, targets: ["uniformBuffer"] }, - { key: "Firefox/58", capture: null, captureConstraint: null, targets: ["uniformBuffer"] }, - { key: "Firefox/59", capture: null, captureConstraint: null, targets: ["uniformBuffer"] }, - { key: "Chrome/72.+?Mobile", capture: null, captureConstraint: null, targets: ["vao"] }, - { key: "Chrome/73.+?Mobile", capture: null, captureConstraint: null, targets: ["vao"] }, - { key: "Chrome/74.+?Mobile", capture: null, captureConstraint: null, targets: ["vao"] }, - { key: "Mac OS.+Chrome/71", capture: null, captureConstraint: null, targets: ["vao"] }, - { key: "Mac OS.+Chrome/72", capture: null, captureConstraint: null, targets: ["vao"] }, - { key: "Mac OS.+Chrome", capture: null, captureConstraint: null, targets: ["uniformBuffer"] }, - { key: "Chrome/12\\d\\..+?Mobile", capture: null, captureConstraint: null, targets: ["uniformBuffer"] }, - { key: ".*AppleWebKit.*(15.4).*Safari", capture: null, captureConstraint: null, targets: ["antialias", "maxMSAASamples"] }, - { key: ".*(15.4).*AppleWebKit.*Safari", capture: null, captureConstraint: null, targets: ["antialias", "maxMSAASamples"] } -]; -ThinEngine._TextureLoaders = []; -ThinEngine.CollisionsEpsilon = 0.001; -ThinEngine._IsSupported = null; -ThinEngine._HasMajorPerformanceCaveat = null; +var init_thinEngine = __esm(() => { + init_engineStore(); + init_effect(); + init_devTools(); + init_observable(); + init_depthCullingState(); + init_stencilState(); + init_alphaCullingState(); + init_internalTexture(); + init_logger(); + init_domManagement(); + init_webGLShaderProcessors(); + init_webGL2ShaderProcessors(); + init_webGLDataBuffer(); + init_webGLPipelineContext(); + init_performanceConfigurator(); + init_webGLHardwareTexture(); + init_drawWrapper(); + init_stencilStateComposer(); + init_shaderLanguage(); + init_precisionDate(); + ThinEngine._TempClearColorUint32 = new Uint32Array(4); + ThinEngine._TempClearColorInt32 = new Int32Array(4); + ThinEngine.ExceptionList = [ + { key: "Chrome/63.0", capture: "63\\.0\\.3239\\.(\\d+)", captureConstraint: 108, targets: ["uniformBuffer"] }, + { key: "Firefox/58", capture: null, captureConstraint: null, targets: ["uniformBuffer"] }, + { key: "Firefox/59", capture: null, captureConstraint: null, targets: ["uniformBuffer"] }, + { key: "Chrome/72.+?Mobile", capture: null, captureConstraint: null, targets: ["vao"] }, + { key: "Chrome/73.+?Mobile", capture: null, captureConstraint: null, targets: ["vao"] }, + { key: "Chrome/74.+?Mobile", capture: null, captureConstraint: null, targets: ["vao"] }, + { key: "Mac OS.+Chrome/71", capture: null, captureConstraint: null, targets: ["vao"] }, + { key: "Mac OS.+Chrome/72", capture: null, captureConstraint: null, targets: ["vao"] }, + { key: "Mac OS.+Chrome", capture: null, captureConstraint: null, targets: ["uniformBuffer"] }, + { key: "Chrome/12\\d\\..+?Mobile", capture: null, captureConstraint: null, targets: ["uniformBuffer"] }, + { key: ".*AppleWebKit.*(15.4).*Safari", capture: null, captureConstraint: null, targets: ["antialias", "maxMSAASamples"] }, + { key: ".*(15.4).*AppleWebKit.*Safari", capture: null, captureConstraint: null, targets: ["antialias", "maxMSAASamples"] } + ]; + ThinEngine._TextureLoaders = []; + ThinEngine.CollisionsEpsilon = 0.001; + ThinEngine._IsSupported = null; + ThinEngine._HasMajorPerformanceCaveat = null; +}); // node_modules/@babylonjs/core/Misc/timingTools.js class TimingTools { @@ -16611,12 +16854,14 @@ class TimingTools { } } } +var init_timingTools = __esm(() => { + init_domManagement(); +}); // node_modules/@babylonjs/core/Misc/fileTools.js function DecodeBase64UrlToBinary(uri) { return DecodeBase64ToBinary(uri.split(",")[1]); } -var Base64DataUrlRegEx = new RegExp(/^data:([^,]+\/[^,]+)?;base64,/i); class LoadFileError extends RuntimeError { constructor(message, object) { @@ -16648,461 +16893,476 @@ class ReadFileError extends RuntimeError { BaseError._setPrototypeOf(this, ReadFileError.prototype); } } -var FileToolsOptions = { - DefaultRetryStrategy: RetryStrategy.ExponentialBackoff(), - BaseUrl: "", - CorsBehavior: "anonymous", - PreprocessUrl: (url) => url, - ScriptBaseUrl: "", - ScriptPreprocessUrl: (url) => url -}; -var _CleanUrl = (url) => { - url = url.replace(/#/gm, "%23"); - return url; -}; -var SetCorsBehavior = (url, element) => { - if (url && url.indexOf("data:") === 0) { - return; - } - if (FileToolsOptions.CorsBehavior) { - if (typeof FileToolsOptions.CorsBehavior === "string" || FileToolsOptions.CorsBehavior instanceof String) { - element.crossOrigin = FileToolsOptions.CorsBehavior; - } else { - const result = FileToolsOptions.CorsBehavior(url); - if (result) { - element.crossOrigin = result; - } - } - } -}; -var LoadImage = (input, onLoad, onError, offlineProvider, mimeType = "", imageBitmapOptions) => { - var _a; - let url; - let usingObjectURL = false; - if (input instanceof ArrayBuffer || ArrayBuffer.isView(input)) { - if (typeof Blob !== "undefined" && typeof URL !== "undefined") { - url = URL.createObjectURL(new Blob([input], { type: mimeType })); - usingObjectURL = true; - } else { - url = `data:${mimeType};base64,` + EncodeArrayBufferToBase64(input); - } - } else if (input instanceof Blob) { - url = URL.createObjectURL(input); - usingObjectURL = true; - } else { - url = _CleanUrl(input); - url = FileToolsOptions.PreprocessUrl(input); - } - const engine = EngineStore.LastCreatedEngine; - const onErrorHandler = (exception) => { - if (onError) { - const inputText = url || input.toString(); - onError(`Error while trying to load image: ${inputText.indexOf("http") === 0 || inputText.length <= 128 ? inputText : inputText.slice(0, 128) + "..."}`, exception); - } - }; - if (typeof Image === "undefined" || ((_a = engine === null || engine === undefined ? undefined : engine._features.forceBitmapOverHTMLImageElement) !== null && _a !== undefined ? _a : false)) { - LoadFile(url, (data) => { - engine.createImageBitmap(new Blob([data], { type: mimeType }), Object.assign({ premultiplyAlpha: "none" }, imageBitmapOptions)).then((imgBmp) => { - onLoad(imgBmp); - if (usingObjectURL) { - URL.revokeObjectURL(url); - } - }).catch((reason) => { - if (onError) { - onError("Error while trying to load image: " + input, reason); - } - }); - }, undefined, offlineProvider || undefined, true, (request, exception) => { - onErrorHandler(exception); - }); - return null; - } - const img = new Image; - SetCorsBehavior(url, img); - const handlersList = []; - const loadHandlersList = () => { - handlersList.forEach((handler) => { - handler.target.addEventListener(handler.name, handler.handler); - }); - }; - const unloadHandlersList = () => { - handlersList.forEach((handler) => { - handler.target.removeEventListener(handler.name, handler.handler); - }); - handlersList.length = 0; - }; - const loadHandler = () => { - unloadHandlersList(); - onLoad(img); - if (usingObjectURL && img.src) { - URL.revokeObjectURL(img.src); - } +var Base64DataUrlRegEx, FileToolsOptions, _CleanUrl, SetCorsBehavior, LoadImage, ReadFile, LoadFile, RequestFile, IsFileURL, IsBase64DataUrl, TestBase64DataUrl, DecodeBase64UrlToString, initSideEffects, FileTools, _injectLTSFileTools; +var init_fileTools = __esm(() => { + init_webRequest(); + init_domManagement(); + init_observable(); + init_filesInputStore(); + init_retryStrategy(); + init_error(); + init_stringTools(); + init_shaderProcessor(); + init_thinEngine(); + init_engineStore(); + init_logger(); + init_timingTools(); + Base64DataUrlRegEx = new RegExp(/^data:([^,]+\/[^,]+)?;base64,/i); + FileToolsOptions = { + DefaultRetryStrategy: RetryStrategy.ExponentialBackoff(), + BaseUrl: "", + CorsBehavior: "anonymous", + PreprocessUrl: (url) => url, + ScriptBaseUrl: "", + ScriptPreprocessUrl: (url) => url }; - const errorHandler = (err) => { - unloadHandlersList(); - onErrorHandler(err); - if (usingObjectURL && img.src) { - URL.revokeObjectURL(img.src); - } + _CleanUrl = (url) => { + url = url.replace(/#/gm, "%23"); + return url; }; - const cspHandler = (err) => { - if (err.blockedURI !== img.src) { + SetCorsBehavior = (url, element) => { + if (url && url.indexOf("data:") === 0) { return; } - unloadHandlersList(); - const cspException = new Error(`CSP violation of policy ${err.effectiveDirective} ${err.blockedURI}. Current policy is ${err.originalPolicy}`); - EngineStore.UseFallbackTexture = false; - onErrorHandler(cspException); - if (usingObjectURL && img.src) { - URL.revokeObjectURL(img.src); - } - img.src = ""; - }; - handlersList.push({ target: img, name: "load", handler: loadHandler }); - handlersList.push({ target: img, name: "error", handler: errorHandler }); - handlersList.push({ target: document, name: "securitypolicyviolation", handler: cspHandler }); - loadHandlersList(); - const fromBlob = url.substring(0, 5) === "blob:"; - const fromData = url.substring(0, 5) === "data:"; - const noOfflineSupport = () => { - if (fromBlob || fromData || !WebRequest.IsCustomRequestAvailable) { - img.src = url; - } else { - LoadFile(url, (data, _, contentType) => { - const type = !mimeType && contentType ? contentType : mimeType; - const blob = new Blob([data], { type }); - const url2 = URL.createObjectURL(blob); - usingObjectURL = true; - img.src = url2; - }, undefined, offlineProvider || undefined, true, (_request, exception) => { - onErrorHandler(exception); - }); - } - }; - const loadFromOfflineSupport = () => { - if (offlineProvider) { - offlineProvider.loadImage(url, img); - } - }; - if (!fromBlob && !fromData && offlineProvider && offlineProvider.enableTexturesOffline) { - offlineProvider.open(loadFromOfflineSupport, noOfflineSupport); - } else { - if (url.indexOf("file:") !== -1) { - const textureName = decodeURIComponent(url.substring(5).toLowerCase()); - if (FilesInputStore.FilesToLoad[textureName] && typeof URL !== "undefined") { - try { - let blobURL; - try { - blobURL = URL.createObjectURL(FilesInputStore.FilesToLoad[textureName]); - } catch (ex) { - blobURL = URL.createObjectURL(FilesInputStore.FilesToLoad[textureName]); - } - img.src = blobURL; - usingObjectURL = true; - } catch (e) { - img.src = ""; + if (FileToolsOptions.CorsBehavior) { + if (typeof FileToolsOptions.CorsBehavior === "string" || FileToolsOptions.CorsBehavior instanceof String) { + element.crossOrigin = FileToolsOptions.CorsBehavior; + } else { + const result = FileToolsOptions.CorsBehavior(url); + if (result) { + element.crossOrigin = result; } - return img; } } - noOfflineSupport(); - } - return img; -}; -var ReadFile = (file, onSuccess, onProgress, useArrayBuffer, onError) => { - const reader = new FileReader; - const fileRequest = { - onCompleteObservable: new Observable, - abort: () => reader.abort() }; - reader.onloadend = () => fileRequest.onCompleteObservable.notifyObservers(fileRequest); - if (onError) { - reader.onerror = () => { - onError(new ReadFileError(`Unable to read ${file.name}`, file)); - }; - } - reader.onload = (e) => { - onSuccess(e.target["result"]); - }; - if (onProgress) { - reader.onprogress = onProgress; - } - if (!useArrayBuffer) { - reader.readAsText(file); - } else { - reader.readAsArrayBuffer(file); - } - return fileRequest; -}; -var LoadFile = (fileOrUrl, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError, onOpened) => { - if (fileOrUrl.name) { - return ReadFile(fileOrUrl, onSuccess, onProgress, useArrayBuffer, onError ? (error2) => { - onError(undefined, error2); - } : undefined); - } - const url = fileOrUrl; - if (url.indexOf("file:") !== -1) { - let fileName = decodeURIComponent(url.substring(5).toLowerCase()); - if (fileName.indexOf("./") === 0) { - fileName = fileName.substring(2); - } - const file = FilesInputStore.FilesToLoad[fileName]; - if (file) { - return ReadFile(file, onSuccess, onProgress, useArrayBuffer, onError ? (error2) => onError(undefined, new LoadFileError(error2.message, error2.file)) : undefined); - } - } - const { match, type } = TestBase64DataUrl(url); - if (match) { - const fileRequest = { - onCompleteObservable: new Observable, - abort: () => () => { - } - }; - try { - const data = useArrayBuffer ? DecodeBase64UrlToBinary(url) : DecodeBase64UrlToString(url); - onSuccess(data, undefined, type); - } catch (error2) { - if (onError) { - onError(undefined, error2); + LoadImage = (input, onLoad, onError, offlineProvider, mimeType = "", imageBitmapOptions) => { + var _a; + let url; + let usingObjectURL = false; + if (input instanceof ArrayBuffer || ArrayBuffer.isView(input)) { + if (typeof Blob !== "undefined" && typeof URL !== "undefined") { + url = URL.createObjectURL(new Blob([input], { type: mimeType })); + usingObjectURL = true; } else { - Logger.Error(error2.message || "Failed to parse the Data URL"); + url = `data:${mimeType};base64,` + EncodeArrayBufferToBase64(input); } + } else if (input instanceof Blob) { + url = URL.createObjectURL(input); + usingObjectURL = true; + } else { + url = _CleanUrl(input); + url = FileToolsOptions.PreprocessUrl(input); } - TimingTools.SetImmediate(() => { - fileRequest.onCompleteObservable.notifyObservers(fileRequest); - }); - return fileRequest; - } - return RequestFile(url, (data, request) => { - onSuccess(data, request === null || request === undefined ? undefined : request.responseURL, request === null || request === undefined ? undefined : request.getResponseHeader("content-type")); - }, onProgress, offlineProvider, useArrayBuffer, onError ? (error2) => { - onError(error2.request, new LoadFileError(error2.message, error2.request)); - } : undefined, onOpened); -}; -var RequestFile = (url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError, onOpened) => { - url = _CleanUrl(url); - url = FileToolsOptions.PreprocessUrl(url); - const loadUrl = FileToolsOptions.BaseUrl + url; - let aborted = false; - const fileRequest = { - onCompleteObservable: new Observable, - abort: () => aborted = true - }; - const requestFile = () => { - let request = new WebRequest; - let retryHandle = null; - let onReadyStateChange; - const unbindEvents = () => { - if (!request) { - return; - } - if (onProgress) { - request.removeEventListener("progress", onProgress); - } - if (onReadyStateChange) { - request.removeEventListener("readystatechange", onReadyStateChange); + const engine = EngineStore.LastCreatedEngine; + const onErrorHandler = (exception) => { + if (onError) { + const inputText = url || input.toString(); + onError(`Error while trying to load image: ${inputText.indexOf("http") === 0 || inputText.length <= 128 ? inputText : inputText.slice(0, 128) + "..."}`, exception); } - request.removeEventListener("loadend", onLoadEnd); }; - let onLoadEnd = () => { - unbindEvents(); - fileRequest.onCompleteObservable.notifyObservers(fileRequest); - fileRequest.onCompleteObservable.clear(); - onProgress = undefined; - onReadyStateChange = null; - onLoadEnd = null; - onError = undefined; - onOpened = undefined; - onSuccess = undefined; + if (typeof Image === "undefined" || ((_a = engine === null || engine === undefined ? undefined : engine._features.forceBitmapOverHTMLImageElement) !== null && _a !== undefined ? _a : false)) { + LoadFile(url, (data) => { + engine.createImageBitmap(new Blob([data], { type: mimeType }), Object.assign({ premultiplyAlpha: "none" }, imageBitmapOptions)).then((imgBmp) => { + onLoad(imgBmp); + if (usingObjectURL) { + URL.revokeObjectURL(url); + } + }).catch((reason) => { + if (onError) { + onError("Error while trying to load image: " + input, reason); + } + }); + }, undefined, offlineProvider || undefined, true, (request, exception) => { + onErrorHandler(exception); + }); + return null; + } + const img = new Image; + SetCorsBehavior(url, img); + const handlersList = []; + const loadHandlersList = () => { + handlersList.forEach((handler) => { + handler.target.addEventListener(handler.name, handler.handler); + }); + }; + const unloadHandlersList = () => { + handlersList.forEach((handler) => { + handler.target.removeEventListener(handler.name, handler.handler); + }); + handlersList.length = 0; + }; + const loadHandler = () => { + unloadHandlersList(); + onLoad(img); + if (usingObjectURL && img.src) { + URL.revokeObjectURL(img.src); + } }; - fileRequest.abort = () => { - aborted = true; - if (onLoadEnd) { - onLoadEnd(); + const errorHandler = (err) => { + unloadHandlersList(); + onErrorHandler(err); + if (usingObjectURL && img.src) { + URL.revokeObjectURL(img.src); } - if (request && request.readyState !== (XMLHttpRequest.DONE || 4)) { - request.abort(); + }; + const cspHandler = (err) => { + if (err.blockedURI !== img.src) { + return; } - if (retryHandle !== null) { - clearTimeout(retryHandle); - retryHandle = null; + unloadHandlersList(); + const cspException = new Error(`CSP violation of policy ${err.effectiveDirective} ${err.blockedURI}. Current policy is ${err.originalPolicy}`); + EngineStore.UseFallbackTexture = false; + onErrorHandler(cspException); + if (usingObjectURL && img.src) { + URL.revokeObjectURL(img.src); } - request = null; + img.src = ""; }; - const handleError = (error2) => { - const message = error2.message || "Unknown error"; - if (onError && request) { - onError(new RequestFileError(message, request)); + handlersList.push({ target: img, name: "load", handler: loadHandler }); + handlersList.push({ target: img, name: "error", handler: errorHandler }); + handlersList.push({ target: document, name: "securitypolicyviolation", handler: cspHandler }); + loadHandlersList(); + const fromBlob = url.substring(0, 5) === "blob:"; + const fromData = url.substring(0, 5) === "data:"; + const noOfflineSupport = () => { + if (fromBlob || fromData || !WebRequest.IsCustomRequestAvailable) { + img.src = url; } else { - Logger.Error(message); + LoadFile(url, (data, _, contentType) => { + const type = !mimeType && contentType ? contentType : mimeType; + const blob = new Blob([data], { type }); + const url2 = URL.createObjectURL(blob); + usingObjectURL = true; + img.src = url2; + }, undefined, offlineProvider || undefined, true, (_request, exception) => { + onErrorHandler(exception); + }); } }; - const retryLoop = (retryIndex) => { - if (!request) { - return; + const loadFromOfflineSupport = () => { + if (offlineProvider) { + offlineProvider.loadImage(url, img); } - request.open("GET", loadUrl); - if (onOpened) { - try { - onOpened(request); - } catch (e) { - handleError(e); - return; + }; + if (!fromBlob && !fromData && offlineProvider && offlineProvider.enableTexturesOffline) { + offlineProvider.open(loadFromOfflineSupport, noOfflineSupport); + } else { + if (url.indexOf("file:") !== -1) { + const textureName = decodeURIComponent(url.substring(5).toLowerCase()); + if (FilesInputStore.FilesToLoad[textureName] && typeof URL !== "undefined") { + try { + let blobURL; + try { + blobURL = URL.createObjectURL(FilesInputStore.FilesToLoad[textureName]); + } catch (ex) { + blobURL = URL.createObjectURL(FilesInputStore.FilesToLoad[textureName]); + } + img.src = blobURL; + usingObjectURL = true; + } catch (e) { + img.src = ""; + } + return img; } } - if (useArrayBuffer) { - request.responseType = "arraybuffer"; + noOfflineSupport(); + } + return img; + }; + ReadFile = (file, onSuccess, onProgress, useArrayBuffer, onError) => { + const reader = new FileReader; + const fileRequest = { + onCompleteObservable: new Observable, + abort: () => reader.abort() + }; + reader.onloadend = () => fileRequest.onCompleteObservable.notifyObservers(fileRequest); + if (onError) { + reader.onerror = () => { + onError(new ReadFileError(`Unable to read ${file.name}`, file)); + }; + } + reader.onload = (e) => { + onSuccess(e.target["result"]); + }; + if (onProgress) { + reader.onprogress = onProgress; + } + if (!useArrayBuffer) { + reader.readAsText(file); + } else { + reader.readAsArrayBuffer(file); + } + return fileRequest; + }; + LoadFile = (fileOrUrl, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError, onOpened) => { + if (fileOrUrl.name) { + return ReadFile(fileOrUrl, onSuccess, onProgress, useArrayBuffer, onError ? (error2) => { + onError(undefined, error2); + } : undefined); + } + const url = fileOrUrl; + if (url.indexOf("file:") !== -1) { + let fileName = decodeURIComponent(url.substring(5).toLowerCase()); + if (fileName.indexOf("./") === 0) { + fileName = fileName.substring(2); } - if (onProgress) { - request.addEventListener("progress", onProgress); + const file = FilesInputStore.FilesToLoad[fileName]; + if (file) { + return ReadFile(file, onSuccess, onProgress, useArrayBuffer, onError ? (error2) => onError(undefined, new LoadFileError(error2.message, error2.file)) : undefined); } - if (onLoadEnd) { - request.addEventListener("loadend", onLoadEnd); + } + const { match, type } = TestBase64DataUrl(url); + if (match) { + const fileRequest = { + onCompleteObservable: new Observable, + abort: () => () => { + } + }; + try { + const data = useArrayBuffer ? DecodeBase64UrlToBinary(url) : DecodeBase64UrlToString(url); + onSuccess(data, undefined, type); + } catch (error2) { + if (onError) { + onError(undefined, error2); + } else { + Logger.Error(error2.message || "Failed to parse the Data URL"); + } } - onReadyStateChange = () => { - if (aborted || !request) { + TimingTools.SetImmediate(() => { + fileRequest.onCompleteObservable.notifyObservers(fileRequest); + }); + return fileRequest; + } + return RequestFile(url, (data, request) => { + onSuccess(data, request === null || request === undefined ? undefined : request.responseURL, request === null || request === undefined ? undefined : request.getResponseHeader("content-type")); + }, onProgress, offlineProvider, useArrayBuffer, onError ? (error2) => { + onError(error2.request, new LoadFileError(error2.message, error2.request)); + } : undefined, onOpened); + }; + RequestFile = (url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError, onOpened) => { + url = _CleanUrl(url); + url = FileToolsOptions.PreprocessUrl(url); + const loadUrl = FileToolsOptions.BaseUrl + url; + let aborted = false; + const fileRequest = { + onCompleteObservable: new Observable, + abort: () => aborted = true + }; + const requestFile = () => { + let request = new WebRequest; + let retryHandle = null; + let onReadyStateChange; + const unbindEvents = () => { + if (!request) { + return; + } + if (onProgress) { + request.removeEventListener("progress", onProgress); + } + if (onReadyStateChange) { + request.removeEventListener("readystatechange", onReadyStateChange); + } + request.removeEventListener("loadend", onLoadEnd); + }; + let onLoadEnd = () => { + unbindEvents(); + fileRequest.onCompleteObservable.notifyObservers(fileRequest); + fileRequest.onCompleteObservable.clear(); + onProgress = undefined; + onReadyStateChange = null; + onLoadEnd = null; + onError = undefined; + onOpened = undefined; + onSuccess = undefined; + }; + fileRequest.abort = () => { + aborted = true; + if (onLoadEnd) { + onLoadEnd(); + } + if (request && request.readyState !== (XMLHttpRequest.DONE || 4)) { + request.abort(); + } + if (retryHandle !== null) { + clearTimeout(retryHandle); + retryHandle = null; + } + request = null; + }; + const handleError = (error2) => { + const message = error2.message || "Unknown error"; + if (onError && request) { + onError(new RequestFileError(message, request)); + } else { + Logger.Error(message); + } + }; + const retryLoop = (retryIndex) => { + if (!request) { return; } - if (request.readyState === (XMLHttpRequest.DONE || 4)) { - if (onReadyStateChange) { - request.removeEventListener("readystatechange", onReadyStateChange); + request.open("GET", loadUrl); + if (onOpened) { + try { + onOpened(request); + } catch (e) { + handleError(e); + return; } - if (request.status >= 200 && request.status < 300 || request.status === 0 && (!IsWindowObjectExist() || IsFileURL())) { - try { - if (onSuccess) { - onSuccess(useArrayBuffer ? request.response : request.responseText, request); - } - } catch (e) { - handleError(e); - } + } + if (useArrayBuffer) { + request.responseType = "arraybuffer"; + } + if (onProgress) { + request.addEventListener("progress", onProgress); + } + if (onLoadEnd) { + request.addEventListener("loadend", onLoadEnd); + } + onReadyStateChange = () => { + if (aborted || !request) { return; } - const retryStrategy2 = FileToolsOptions.DefaultRetryStrategy; - if (retryStrategy2) { - const waitTime = retryStrategy2(loadUrl, request, retryIndex); - if (waitTime !== -1) { - unbindEvents(); - request = new WebRequest; - retryHandle = setTimeout(() => retryLoop(retryIndex + 1), waitTime); + if (request.readyState === (XMLHttpRequest.DONE || 4)) { + if (onReadyStateChange) { + request.removeEventListener("readystatechange", onReadyStateChange); + } + if (request.status >= 200 && request.status < 300 || request.status === 0 && (!IsWindowObjectExist() || IsFileURL())) { + try { + if (onSuccess) { + onSuccess(useArrayBuffer ? request.response : request.responseText, request); + } + } catch (e) { + handleError(e); + } return; } + const retryStrategy2 = FileToolsOptions.DefaultRetryStrategy; + if (retryStrategy2) { + const waitTime = retryStrategy2(loadUrl, request, retryIndex); + if (waitTime !== -1) { + unbindEvents(); + request = new WebRequest; + retryHandle = setTimeout(() => retryLoop(retryIndex + 1), waitTime); + return; + } + } + const error2 = new RequestFileError("Error status: " + request.status + " " + request.statusText + " - Unable to load " + loadUrl, request); + if (onError) { + onError(error2); + } } - const error2 = new RequestFileError("Error status: " + request.status + " " + request.statusText + " - Unable to load " + loadUrl, request); + }; + request.addEventListener("readystatechange", onReadyStateChange); + request.send(); + }; + retryLoop(0); + }; + if (offlineProvider && offlineProvider.enableSceneOffline) { + const noOfflineSupport = (request) => { + if (request && request.status > 400) { if (onError) { - onError(error2); + onError(request); } + } else { + requestFile(); } }; - request.addEventListener("readystatechange", onReadyStateChange); - request.send(); - }; - retryLoop(0); - }; - if (offlineProvider && offlineProvider.enableSceneOffline) { - const noOfflineSupport = (request) => { - if (request && request.status > 400) { - if (onError) { - onError(request); + const loadFromOfflineSupport = () => { + if (offlineProvider) { + offlineProvider.loadFile(FileToolsOptions.BaseUrl + url, (data) => { + if (!aborted && onSuccess) { + onSuccess(data); + } + fileRequest.onCompleteObservable.notifyObservers(fileRequest); + }, onProgress ? (event) => { + if (!aborted && onProgress) { + onProgress(event); + } + } : undefined, noOfflineSupport, useArrayBuffer); } - } else { - requestFile(); - } - }; - const loadFromOfflineSupport = () => { - if (offlineProvider) { - offlineProvider.loadFile(FileToolsOptions.BaseUrl + url, (data) => { - if (!aborted && onSuccess) { - onSuccess(data); - } - fileRequest.onCompleteObservable.notifyObservers(fileRequest); - }, onProgress ? (event) => { - if (!aborted && onProgress) { - onProgress(event); - } - } : undefined, noOfflineSupport, useArrayBuffer); - } - }; - offlineProvider.open(loadFromOfflineSupport, noOfflineSupport); - } else { - requestFile(); - } - return fileRequest; -}; -var IsFileURL = () => { - return typeof location !== "undefined" && location.protocol === "file:"; -}; -var IsBase64DataUrl = (uri) => { - return Base64DataUrlRegEx.test(uri); -}; -var TestBase64DataUrl = (uri) => { - const results = Base64DataUrlRegEx.exec(uri); - if (results === null || results.length === 0) { - return { match: false, type: "" }; - } else { - const type = results[0].replace("data:", "").replace("base64,", ""); - return { match: true, type }; - } -}; -var DecodeBase64UrlToString = (uri) => { - return DecodeBase64ToString(uri.split(",")[1]); -}; -var initSideEffects = () => { - ThinEngine._FileToolsLoadImage = LoadImage; - ThinEngine._FileToolsLoadFile = LoadFile; - ShaderProcessor._FileToolsLoadFile = LoadFile; -}; -initSideEffects(); -var FileTools; -var _injectLTSFileTools = (DecodeBase64UrlToBinary2, DecodeBase64UrlToString2, FileToolsOptions2, IsBase64DataUrl2, IsFileURL2, LoadFile2, LoadImage2, ReadFile2, RequestFile2, SetCorsBehavior2) => { - FileTools = { - DecodeBase64UrlToBinary: DecodeBase64UrlToBinary2, - DecodeBase64UrlToString: DecodeBase64UrlToString2, - DefaultRetryStrategy: FileToolsOptions2.DefaultRetryStrategy, - BaseUrl: FileToolsOptions2.BaseUrl, - CorsBehavior: FileToolsOptions2.CorsBehavior, - PreprocessUrl: FileToolsOptions2.PreprocessUrl, - IsBase64DataUrl: IsBase64DataUrl2, - IsFileURL: IsFileURL2, - LoadFile: LoadFile2, - LoadImage: LoadImage2, - ReadFile: ReadFile2, - RequestFile: RequestFile2, - SetCorsBehavior: SetCorsBehavior2 - }; - Object.defineProperty(FileTools, "DefaultRetryStrategy", { - get: function() { - return FileToolsOptions2.DefaultRetryStrategy; - }, - set: function(value) { - FileToolsOptions2.DefaultRetryStrategy = value; - } - }); - Object.defineProperty(FileTools, "BaseUrl", { - get: function() { - return FileToolsOptions2.BaseUrl; - }, - set: function(value) { - FileToolsOptions2.BaseUrl = value; - } - }); - Object.defineProperty(FileTools, "PreprocessUrl", { - get: function() { - return FileToolsOptions2.PreprocessUrl; - }, - set: function(value) { - FileToolsOptions2.PreprocessUrl = value; + }; + offlineProvider.open(loadFromOfflineSupport, noOfflineSupport); + } else { + requestFile(); } - }); - Object.defineProperty(FileTools, "CorsBehavior", { - get: function() { - return FileToolsOptions2.CorsBehavior; - }, - set: function(value) { - FileToolsOptions2.CorsBehavior = value; + return fileRequest; + }; + IsFileURL = () => { + return typeof location !== "undefined" && location.protocol === "file:"; + }; + IsBase64DataUrl = (uri) => { + return Base64DataUrlRegEx.test(uri); + }; + TestBase64DataUrl = (uri) => { + const results = Base64DataUrlRegEx.exec(uri); + if (results === null || results.length === 0) { + return { match: false, type: "" }; + } else { + const type = results[0].replace("data:", "").replace("base64,", ""); + return { match: true, type }; } - }); -}; -_injectLTSFileTools(DecodeBase64UrlToBinary, DecodeBase64UrlToString, FileToolsOptions, IsBase64DataUrl, IsFileURL, LoadFile, LoadImage, ReadFile, RequestFile, SetCorsBehavior); + }; + DecodeBase64UrlToString = (uri) => { + return DecodeBase64ToString(uri.split(",")[1]); + }; + initSideEffects = () => { + ThinEngine._FileToolsLoadImage = LoadImage; + ThinEngine._FileToolsLoadFile = LoadFile; + ShaderProcessor._FileToolsLoadFile = LoadFile; + }; + initSideEffects(); + _injectLTSFileTools = (DecodeBase64UrlToBinary2, DecodeBase64UrlToString2, FileToolsOptions2, IsBase64DataUrl2, IsFileURL2, LoadFile2, LoadImage2, ReadFile2, RequestFile2, SetCorsBehavior2) => { + FileTools = { + DecodeBase64UrlToBinary: DecodeBase64UrlToBinary2, + DecodeBase64UrlToString: DecodeBase64UrlToString2, + DefaultRetryStrategy: FileToolsOptions2.DefaultRetryStrategy, + BaseUrl: FileToolsOptions2.BaseUrl, + CorsBehavior: FileToolsOptions2.CorsBehavior, + PreprocessUrl: FileToolsOptions2.PreprocessUrl, + IsBase64DataUrl: IsBase64DataUrl2, + IsFileURL: IsFileURL2, + LoadFile: LoadFile2, + LoadImage: LoadImage2, + ReadFile: ReadFile2, + RequestFile: RequestFile2, + SetCorsBehavior: SetCorsBehavior2 + }; + Object.defineProperty(FileTools, "DefaultRetryStrategy", { + get: function() { + return FileToolsOptions2.DefaultRetryStrategy; + }, + set: function(value) { + FileToolsOptions2.DefaultRetryStrategy = value; + } + }); + Object.defineProperty(FileTools, "BaseUrl", { + get: function() { + return FileToolsOptions2.BaseUrl; + }, + set: function(value) { + FileToolsOptions2.BaseUrl = value; + } + }); + Object.defineProperty(FileTools, "PreprocessUrl", { + get: function() { + return FileToolsOptions2.PreprocessUrl; + }, + set: function(value) { + FileToolsOptions2.PreprocessUrl = value; + } + }); + Object.defineProperty(FileTools, "CorsBehavior", { + get: function() { + return FileToolsOptions2.CorsBehavior; + }, + set: function(value) { + FileToolsOptions2.CorsBehavior = value; + } + }); + }; + _injectLTSFileTools(DecodeBase64UrlToBinary, DecodeBase64UrlToString, FileToolsOptions, IsBase64DataUrl, IsFileURL, LoadFile, LoadImage, ReadFile, RequestFile, SetCorsBehavior); +}); // node_modules/@babylonjs/core/Misc/instantiationTools.js class InstantiationTools { @@ -17126,7 +17386,11 @@ class InstantiationTools { return fn; } } -InstantiationTools.RegisteredExternalClasses = {}; +var init_instantiationTools = __esm(() => { + init_logger(); + init_typeStore(); + InstantiationTools.RegisteredExternalClasses = {}; +}); // node_modules/@babylonjs/core/Misc/guid.js function RandomGUID() { @@ -17135,8 +17399,21 @@ function RandomGUID() { return v.toString(16); }); } +var GUID; +var init_guid = __esm(() => { + GUID = { + RandomId: RandomGUID + }; +}); // node_modules/@babylonjs/core/Misc/tools.js +function className(name2, module) { + return (target) => { + target["__bjsclassName__"] = name2; + target["__bjsmoduleName__"] = module != null ? module : null; + }; +} + class Tools { static get BaseUrl() { return FileToolsOptions.BaseUrl; @@ -17222,8 +17499,8 @@ class Tools { static Mix(a, b, alpha) { return a * (1 - alpha) + b * alpha; } - static Instantiate(className) { - return InstantiationTools.Instantiate(className); + static Instantiate(className2) { + return InstantiationTools.Instantiate(className2); } static SetImmediate(action7) { TimingTools.SetImmediate(action7); @@ -17652,19 +17929,19 @@ class Tools { return PrecisionDate.Now; } static GetClassName(object, isType = false) { - let name = null; + let name2 = null; if (!isType && object.getClassName) { - name = object.getClassName(); + name2 = object.getClassName(); } else { if (object instanceof Object) { const classObj = isType ? object : Object.getPrototypeOf(object); - name = classObj.constructor["__bjsclassName__"]; + name2 = classObj.constructor["__bjsclassName__"]; } - if (!name) { - name = typeof object; + if (!name2) { + name2 = typeof object; } } - return name; + return name2; } static First(array, predicate) { for (const el of array) { @@ -17675,24 +17952,24 @@ class Tools { return null; } static getFullClassName(object, isType = false) { - let className = null; + let className2 = null; let moduleName = null; if (!isType && object.getClassName) { - className = object.getClassName(); + className2 = object.getClassName(); } else { if (object instanceof Object) { const classObj = isType ? object : Object.getPrototypeOf(object); - className = classObj.constructor["__bjsclassName__"]; + className2 = classObj.constructor["__bjsclassName__"]; moduleName = classObj.constructor["__bjsmoduleName__"]; } - if (!className) { - className = typeof object; + if (!className2) { + className2 = typeof object; } } - if (!className) { + if (!className2) { return null; } - return (moduleName != null ? moduleName + "." : "") + className; + return (moduleName != null ? moduleName + "." : "") + className2; } static DelayAsync(delay) { return new Promise((resolve) => { @@ -17708,28 +17985,6 @@ class Tools { return /^((?!chrome|android).)*safari/i.test(navigator.userAgent); } } -Tools.UseCustomRequestHeaders = false; -Tools.CustomRequestHeaders = WebRequest.CustomRequestHeaders; -Tools.GetDOMTextContent = GetDOMTextContent; -Tools._DefaultCdnUrl = "https://cdn.babylonjs.com"; -Tools.GetAbsoluteUrl = typeof document === "object" ? (url) => { - const a = document.createElement("a"); - a.href = url; - return a.href; -} : typeof URL === "function" && typeof location === "object" ? (url) => new URL(url, location.origin).href : () => { - throw new Error("Unable to get absolute URL. Override BABYLON.Tools.GetAbsoluteUrl to a custom implementation for the current context."); -}; -Tools.NoneLogLevel = Logger.NoneLogLevel; -Tools.MessageLogLevel = Logger.MessageLogLevel; -Tools.WarningLogLevel = Logger.WarningLogLevel; -Tools.ErrorLogLevel = Logger.ErrorLogLevel; -Tools.AllLogLevel = Logger.AllLogLevel; -Tools.IsWindowObjectExist = IsWindowObjectExist; -Tools.PerformanceNoneLogLevel = 0; -Tools.PerformanceUserMarkLogLevel = 1; -Tools.PerformanceConsoleLogLevel = 2; -Tools.StartPerformanceCounter = Tools._StartPerformanceCounterDisabled; -Tools.EndPerformanceCounter = Tools._EndPerformanceCounterDisabled; class AsyncLoop { constructor(iterations, func, successCallback, offset = 0) { @@ -17781,7 +18036,43 @@ class AsyncLoop { }, callback); } } -EngineStore.FallbackTexture = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z"; +var init_tools = __esm(() => { + init_observable(); + init_domManagement(); + init_logger(); + init_deepCopier(); + init_precisionDate(); + init_devTools(); + init_webRequest(); + init_engineStore(); + init_fileTools(); + init_timingTools(); + init_instantiationTools(); + init_guid(); + Tools.UseCustomRequestHeaders = false; + Tools.CustomRequestHeaders = WebRequest.CustomRequestHeaders; + Tools.GetDOMTextContent = GetDOMTextContent; + Tools._DefaultCdnUrl = "https://cdn.babylonjs.com"; + Tools.GetAbsoluteUrl = typeof document === "object" ? (url) => { + const a = document.createElement("a"); + a.href = url; + return a.href; + } : typeof URL === "function" && typeof location === "object" ? (url) => new URL(url, location.origin).href : () => { + throw new Error("Unable to get absolute URL. Override BABYLON.Tools.GetAbsoluteUrl to a custom implementation for the current context."); + }; + Tools.NoneLogLevel = Logger.NoneLogLevel; + Tools.MessageLogLevel = Logger.MessageLogLevel; + Tools.WarningLogLevel = Logger.WarningLogLevel; + Tools.ErrorLogLevel = Logger.ErrorLogLevel; + Tools.AllLogLevel = Logger.AllLogLevel; + Tools.IsWindowObjectExist = IsWindowObjectExist; + Tools.PerformanceNoneLogLevel = 0; + Tools.PerformanceUserMarkLogLevel = 1; + Tools.PerformanceConsoleLogLevel = 2; + Tools.StartPerformanceCounter = Tools._StartPerformanceCounterDisabled; + Tools.EndPerformanceCounter = Tools._EndPerformanceCounterDisabled; + EngineStore.FallbackTexture = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z"; +}); // node_modules/@babylonjs/core/Misc/smartArray.js class SmartArray { @@ -17835,7 +18126,6 @@ class SmartArray { return this.indexOf(value) !== -1; } } -SmartArray._GlobalId = 0; class SmartArrayNoDuplicate extends SmartArray { constructor() { @@ -17873,6 +18163,9 @@ class SmartArrayNoDuplicate extends SmartArray { } } } +var init_smartArray = __esm(() => { + SmartArray._GlobalId = 0; +}); // node_modules/@babylonjs/core/Misc/stringDictionary.js class StringDictionary { @@ -17969,6 +18262,8 @@ class StringDictionary { return null; } } +var init_stringDictionary = __esm(() => { +}); // node_modules/@babylonjs/core/Materials/materialDefines.js class MaterialDefines { @@ -18061,9 +18356,9 @@ class MaterialDefines { this._keys.push(key); } if (this._externalProperties) { - for (const name in this._externalProperties) { - if (this._keys.indexOf(name) === -1) { - this._keys.push(name); + for (const name2 in this._externalProperties) { + if (this._keys.indexOf(name2) === -1) { + this._keys.push(name2); } } } @@ -18129,6 +18424,8 @@ class MaterialDefines { return result; } } +var init_materialDefines = __esm(() => { +}); // node_modules/@babylonjs/core/Materials/colorCurves.js class ColorCurves { @@ -18387,43 +18684,48 @@ class ColorCurves { return SerializationHelper.Parse(() => new ColorCurves, source, null, null); } } -__decorate2([ - serialize() -], ColorCurves.prototype, "_globalHue", undefined); -__decorate2([ - serialize() -], ColorCurves.prototype, "_globalDensity", undefined); -__decorate2([ - serialize() -], ColorCurves.prototype, "_globalSaturation", undefined); -__decorate2([ - serialize() -], ColorCurves.prototype, "_globalExposure", undefined); -__decorate2([ - serialize() -], ColorCurves.prototype, "_highlightsHue", undefined); -__decorate2([ - serialize() -], ColorCurves.prototype, "_highlightsDensity", undefined); -__decorate2([ - serialize() -], ColorCurves.prototype, "_highlightsSaturation", undefined); -__decorate2([ - serialize() -], ColorCurves.prototype, "_highlightsExposure", undefined); -__decorate2([ - serialize() -], ColorCurves.prototype, "_midtonesHue", undefined); -__decorate2([ - serialize() -], ColorCurves.prototype, "_midtonesDensity", undefined); -__decorate2([ - serialize() -], ColorCurves.prototype, "_midtonesSaturation", undefined); -__decorate2([ - serialize() -], ColorCurves.prototype, "_midtonesExposure", undefined); -SerializationHelper._ColorCurvesParser = ColorCurves.Parse; +var init_colorCurves = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_color(); + __decorate2([ + serialize() + ], ColorCurves.prototype, "_globalHue", undefined); + __decorate2([ + serialize() + ], ColorCurves.prototype, "_globalDensity", undefined); + __decorate2([ + serialize() + ], ColorCurves.prototype, "_globalSaturation", undefined); + __decorate2([ + serialize() + ], ColorCurves.prototype, "_globalExposure", undefined); + __decorate2([ + serialize() + ], ColorCurves.prototype, "_highlightsHue", undefined); + __decorate2([ + serialize() + ], ColorCurves.prototype, "_highlightsDensity", undefined); + __decorate2([ + serialize() + ], ColorCurves.prototype, "_highlightsSaturation", undefined); + __decorate2([ + serialize() + ], ColorCurves.prototype, "_highlightsExposure", undefined); + __decorate2([ + serialize() + ], ColorCurves.prototype, "_midtonesHue", undefined); + __decorate2([ + serialize() + ], ColorCurves.prototype, "_midtonesDensity", undefined); + __decorate2([ + serialize() + ], ColorCurves.prototype, "_midtonesSaturation", undefined); + __decorate2([ + serialize() + ], ColorCurves.prototype, "_midtonesExposure", undefined); + SerializationHelper._ColorCurvesParser = ColorCurves.Parse; +}); // node_modules/@babylonjs/core/Materials/imageProcessingConfiguration.js class ImageProcessingConfigurationDefines extends MaterialDefines { @@ -18783,156 +19085,169 @@ class ImageProcessingConfiguration { return this._VIGNETTEMODE_OPAQUE; } } -ImageProcessingConfiguration.TONEMAPPING_STANDARD = 0; -ImageProcessingConfiguration.TONEMAPPING_ACES = 1; -ImageProcessingConfiguration._VIGNETTEMODE_MULTIPLY = 0; -ImageProcessingConfiguration._VIGNETTEMODE_OPAQUE = 1; -__decorate2([ - serializeAsColorCurves() -], ImageProcessingConfiguration.prototype, "colorCurves", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "_colorCurvesEnabled", undefined); -__decorate2([ - serializeAsTexture("colorGradingTexture") -], ImageProcessingConfiguration.prototype, "_colorGradingTexture", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "_colorGradingEnabled", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "_colorGradingWithGreenDepth", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "_colorGradingBGR", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "_exposure", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "_toneMappingEnabled", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "_toneMappingType", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "_contrast", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "vignetteStretch", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "vignetteCenterX", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "vignetteCenterY", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "vignetteWeight", undefined); -__decorate2([ - serializeAsColor4() -], ImageProcessingConfiguration.prototype, "vignetteColor", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "vignetteCameraFov", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "_vignetteBlendMode", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "_vignetteEnabled", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "_ditheringEnabled", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "_ditheringIntensity", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "_skipFinalColorClamp", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "_applyByPostProcess", undefined); -__decorate2([ - serialize() -], ImageProcessingConfiguration.prototype, "_isEnabled", undefined); -SerializationHelper._ImageProcessingConfigurationParser = ImageProcessingConfiguration.Parse; +var init_imageProcessingConfiguration = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_observable(); + init_tools(); + init_math_color(); + init_materialDefines(); + init_colorCurves(); + ImageProcessingConfiguration.TONEMAPPING_STANDARD = 0; + ImageProcessingConfiguration.TONEMAPPING_ACES = 1; + ImageProcessingConfiguration._VIGNETTEMODE_MULTIPLY = 0; + ImageProcessingConfiguration._VIGNETTEMODE_OPAQUE = 1; + __decorate2([ + serializeAsColorCurves() + ], ImageProcessingConfiguration.prototype, "colorCurves", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "_colorCurvesEnabled", undefined); + __decorate2([ + serializeAsTexture("colorGradingTexture") + ], ImageProcessingConfiguration.prototype, "_colorGradingTexture", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "_colorGradingEnabled", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "_colorGradingWithGreenDepth", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "_colorGradingBGR", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "_exposure", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "_toneMappingEnabled", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "_toneMappingType", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "_contrast", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "vignetteStretch", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "vignetteCenterX", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "vignetteCenterY", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "vignetteWeight", undefined); + __decorate2([ + serializeAsColor4() + ], ImageProcessingConfiguration.prototype, "vignetteColor", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "vignetteCameraFov", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "_vignetteBlendMode", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "_vignetteEnabled", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "_ditheringEnabled", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "_ditheringIntensity", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "_skipFinalColorClamp", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "_applyByPostProcess", undefined); + __decorate2([ + serialize() + ], ImageProcessingConfiguration.prototype, "_isEnabled", undefined); + SerializationHelper._ImageProcessingConfigurationParser = ImageProcessingConfiguration.Parse; +}); // node_modules/@babylonjs/core/Engines/Extensions/engine.uniformBuffer.js -ThinEngine.prototype.createUniformBuffer = function(elements, _label) { - const ubo = this._gl.createBuffer(); - if (!ubo) { - throw new Error("Unable to create uniform buffer"); - } - const result = new WebGLDataBuffer(ubo); - this.bindUniformBuffer(result); - if (elements instanceof Float32Array) { - this._gl.bufferData(this._gl.UNIFORM_BUFFER, elements, this._gl.STATIC_DRAW); - } else { - this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(elements), this._gl.STATIC_DRAW); - } - this.bindUniformBuffer(null); - result.references = 1; - return result; -}; -ThinEngine.prototype.createDynamicUniformBuffer = function(elements, _label) { - const ubo = this._gl.createBuffer(); - if (!ubo) { - throw new Error("Unable to create dynamic uniform buffer"); - } - const result = new WebGLDataBuffer(ubo); - this.bindUniformBuffer(result); - if (elements instanceof Float32Array) { - this._gl.bufferData(this._gl.UNIFORM_BUFFER, elements, this._gl.DYNAMIC_DRAW); - } else { - this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(elements), this._gl.DYNAMIC_DRAW); - } - this.bindUniformBuffer(null); - result.references = 1; - return result; -}; -ThinEngine.prototype.updateUniformBuffer = function(uniformBuffer, elements, offset, count) { - this.bindUniformBuffer(uniformBuffer); - if (offset === undefined) { - offset = 0; - } - if (count === undefined) { +var init_engine_uniformBuffer = __esm(() => { + init_thinEngine(); + init_webGLDataBuffer(); + ThinEngine.prototype.createUniformBuffer = function(elements, _label) { + const ubo = this._gl.createBuffer(); + if (!ubo) { + throw new Error("Unable to create uniform buffer"); + } + const result = new WebGLDataBuffer(ubo); + this.bindUniformBuffer(result); if (elements instanceof Float32Array) { - this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, offset, elements); + this._gl.bufferData(this._gl.UNIFORM_BUFFER, elements, this._gl.STATIC_DRAW); } else { - this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, offset, new Float32Array(elements)); + this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(elements), this._gl.STATIC_DRAW); } - } else { + this.bindUniformBuffer(null); + result.references = 1; + return result; + }; + ThinEngine.prototype.createDynamicUniformBuffer = function(elements, _label) { + const ubo = this._gl.createBuffer(); + if (!ubo) { + throw new Error("Unable to create dynamic uniform buffer"); + } + const result = new WebGLDataBuffer(ubo); + this.bindUniformBuffer(result); if (elements instanceof Float32Array) { - this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, elements.subarray(offset, offset + count)); + this._gl.bufferData(this._gl.UNIFORM_BUFFER, elements, this._gl.DYNAMIC_DRAW); } else { - this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, new Float32Array(elements).subarray(offset, offset + count)); + this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(elements), this._gl.DYNAMIC_DRAW); } - } - this.bindUniformBuffer(null); -}; -ThinEngine.prototype.bindUniformBuffer = function(buffer) { - this._gl.bindBuffer(this._gl.UNIFORM_BUFFER, buffer ? buffer.underlyingResource : null); -}; -ThinEngine.prototype.bindUniformBufferBase = function(buffer, location2, name) { - this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER, location2, buffer ? buffer.underlyingResource : null); -}; -ThinEngine.prototype.bindUniformBlock = function(pipelineContext, blockName, index) { - const program = pipelineContext.program; - const uniformLocation = this._gl.getUniformBlockIndex(program, blockName); - if (uniformLocation !== 4294967295) { - this._gl.uniformBlockBinding(program, uniformLocation, index); - } -}; + this.bindUniformBuffer(null); + result.references = 1; + return result; + }; + ThinEngine.prototype.updateUniformBuffer = function(uniformBuffer, elements, offset, count) { + this.bindUniformBuffer(uniformBuffer); + if (offset === undefined) { + offset = 0; + } + if (count === undefined) { + if (elements instanceof Float32Array) { + this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, offset, elements); + } else { + this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, offset, new Float32Array(elements)); + } + } else { + if (elements instanceof Float32Array) { + this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, elements.subarray(offset, offset + count)); + } else { + this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, new Float32Array(elements).subarray(offset, offset + count)); + } + } + this.bindUniformBuffer(null); + }; + ThinEngine.prototype.bindUniformBuffer = function(buffer) { + this._gl.bindBuffer(this._gl.UNIFORM_BUFFER, buffer ? buffer.underlyingResource : null); + }; + ThinEngine.prototype.bindUniformBufferBase = function(buffer, location2, name2) { + this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER, location2, buffer ? buffer.underlyingResource : null); + }; + ThinEngine.prototype.bindUniformBlock = function(pipelineContext, blockName, index) { + const program = pipelineContext.program; + const uniformLocation = this._gl.getUniformBlockIndex(program, blockName); + if (uniformLocation !== 4294967295) { + this._gl.uniformBlockBinding(program, uniformLocation, index); + } + }; +}); // node_modules/@babylonjs/core/Materials/uniformBuffer.js class UniformBuffer { - constructor(engine, data, dynamic, name, forceNoUniformBuffer = false) { + constructor(engine, data, dynamic, name2, forceNoUniformBuffer = false) { this._valueCache = {}; this._engine = engine; this._noUBO = !engine.supportsUniformBuffers || forceNoUniformBuffer; this._dynamic = dynamic; - this._name = name !== null && name !== undefined ? name : "no-name"; + this._name = name2 !== null && name2 !== undefined ? name2 : "no-name"; this._data = data || []; this._uniformLocations = {}; this._uniformSizes = {}; @@ -19031,20 +19346,20 @@ class UniformBuffer { } } } - addUniform(name, size, arraySize = 0) { + addUniform(name2, size, arraySize = 0) { if (this._noUBO) { return; } - if (this._uniformLocations[name] !== undefined) { + if (this._uniformLocations[name2] !== undefined) { return; } let data; if (arraySize > 0) { if (size instanceof Array) { - throw "addUniform should not be use with Array in UBO: " + name; + throw "addUniform should not be use with Array in UBO: " + name2; } this._fillAlignment(4); - this._uniformArraySizes[name] = { strideSize: size, arraySize }; + this._uniformArraySizes[name2] = { strideSize: size, arraySize }; if (size == 16) { size = size * arraySize; } else { @@ -19069,42 +19384,42 @@ class UniformBuffer { } this._fillAlignment(size); } - this._uniformSizes[name] = size; - this._uniformLocations[name] = this._uniformLocationPointer; + this._uniformSizes[name2] = size; + this._uniformLocations[name2] = this._uniformLocationPointer; this._uniformLocationPointer += size; for (let i = 0;i < size; i++) { this._data.push(data[i]); } this._needSync = true; } - addMatrix(name, mat) { - this.addUniform(name, Array.prototype.slice.call(mat.toArray())); + addMatrix(name2, mat) { + this.addUniform(name2, Array.prototype.slice.call(mat.toArray())); } - addFloat2(name, x, y) { + addFloat2(name2, x, y) { const temp = [x, y]; - this.addUniform(name, temp); + this.addUniform(name2, temp); } - addFloat3(name, x, y, z) { + addFloat3(name2, x, y, z) { const temp = [x, y, z]; - this.addUniform(name, temp); + this.addUniform(name2, temp); } - addColor3(name, color) { + addColor3(name2, color) { const temp = [color.r, color.g, color.b]; - this.addUniform(name, temp); + this.addUniform(name2, temp); } - addColor4(name, color, alpha) { + addColor4(name2, color, alpha) { const temp = [color.r, color.g, color.b, alpha]; - this.addUniform(name, temp); + this.addUniform(name2, temp); } - addVector3(name, vector) { + addVector3(name2, vector) { const temp = [vector.x, vector.y, vector.z]; - this.addUniform(name, temp); + this.addUniform(name2, temp); } - addMatrix3x3(name) { - this.addUniform(name, 12); + addMatrix3x3(name2) { + this.addUniform(name2, 12); } - addMatrix2x2(name) { - this.addUniform(name, 8); + addMatrix2x2(name2) { + this.addUniform(name2, 8); } create() { if (this._noUBO) { @@ -19120,8 +19435,8 @@ class UniformBuffer { } _getNames() { const names = []; - for (const name in this._uniformLocations) { - names.push(name); + for (const name2 in this._uniformLocations) { + names.push(name2); } return names.join(","); } @@ -19291,243 +19606,243 @@ class UniformBuffer { } } } - _cacheMatrix(name, matrix) { + _cacheMatrix(name2, matrix) { this._checkNewFrame(); - const cache = this._valueCache[name]; + const cache = this._valueCache[name2]; const flag = matrix.updateFlag; if (cache !== undefined && cache === flag) { return false; } - this._valueCache[name] = flag; + this._valueCache[name2] = flag; return true; } - _updateMatrix3x3ForUniform(name, matrix) { + _updateMatrix3x3ForUniform(name2, matrix) { for (let i = 0;i < 3; i++) { UniformBuffer._TempBuffer[i * 4] = matrix[i * 3]; UniformBuffer._TempBuffer[i * 4 + 1] = matrix[i * 3 + 1]; UniformBuffer._TempBuffer[i * 4 + 2] = matrix[i * 3 + 2]; UniformBuffer._TempBuffer[i * 4 + 3] = 0; } - this.updateUniform(name, UniformBuffer._TempBuffer, 12); + this.updateUniform(name2, UniformBuffer._TempBuffer, 12); } - _updateMatrix3x3ForEffect(name, matrix) { - this._currentEffect.setMatrix3x3(name, matrix); + _updateMatrix3x3ForEffect(name2, matrix) { + this._currentEffect.setMatrix3x3(name2, matrix); } - _updateMatrix2x2ForEffect(name, matrix) { - this._currentEffect.setMatrix2x2(name, matrix); + _updateMatrix2x2ForEffect(name2, matrix) { + this._currentEffect.setMatrix2x2(name2, matrix); } - _updateMatrix2x2ForUniform(name, matrix) { + _updateMatrix2x2ForUniform(name2, matrix) { for (let i = 0;i < 2; i++) { UniformBuffer._TempBuffer[i * 4] = matrix[i * 2]; UniformBuffer._TempBuffer[i * 4 + 1] = matrix[i * 2 + 1]; UniformBuffer._TempBuffer[i * 4 + 2] = 0; UniformBuffer._TempBuffer[i * 4 + 3] = 0; } - this.updateUniform(name, UniformBuffer._TempBuffer, 8); + this.updateUniform(name2, UniformBuffer._TempBuffer, 8); } - _updateFloatForEffect(name, x) { - this._currentEffect.setFloat(name, x); + _updateFloatForEffect(name2, x) { + this._currentEffect.setFloat(name2, x); } - _updateFloatForUniform(name, x) { + _updateFloatForUniform(name2, x) { UniformBuffer._TempBuffer[0] = x; - this.updateUniform(name, UniformBuffer._TempBuffer, 1); + this.updateUniform(name2, UniformBuffer._TempBuffer, 1); } - _updateFloat2ForEffect(name, x, y, suffix = "") { - this._currentEffect.setFloat2(name + suffix, x, y); + _updateFloat2ForEffect(name2, x, y, suffix = "") { + this._currentEffect.setFloat2(name2 + suffix, x, y); } - _updateFloat2ForUniform(name, x, y) { + _updateFloat2ForUniform(name2, x, y) { UniformBuffer._TempBuffer[0] = x; UniformBuffer._TempBuffer[1] = y; - this.updateUniform(name, UniformBuffer._TempBuffer, 2); + this.updateUniform(name2, UniformBuffer._TempBuffer, 2); } - _updateFloat3ForEffect(name, x, y, z, suffix = "") { - this._currentEffect.setFloat3(name + suffix, x, y, z); + _updateFloat3ForEffect(name2, x, y, z, suffix = "") { + this._currentEffect.setFloat3(name2 + suffix, x, y, z); } - _updateFloat3ForUniform(name, x, y, z) { + _updateFloat3ForUniform(name2, x, y, z) { UniformBuffer._TempBuffer[0] = x; UniformBuffer._TempBuffer[1] = y; UniformBuffer._TempBuffer[2] = z; - this.updateUniform(name, UniformBuffer._TempBuffer, 3); + this.updateUniform(name2, UniformBuffer._TempBuffer, 3); } - _updateFloat4ForEffect(name, x, y, z, w, suffix = "") { - this._currentEffect.setFloat4(name + suffix, x, y, z, w); + _updateFloat4ForEffect(name2, x, y, z, w, suffix = "") { + this._currentEffect.setFloat4(name2 + suffix, x, y, z, w); } - _updateFloat4ForUniform(name, x, y, z, w) { + _updateFloat4ForUniform(name2, x, y, z, w) { UniformBuffer._TempBuffer[0] = x; UniformBuffer._TempBuffer[1] = y; UniformBuffer._TempBuffer[2] = z; UniformBuffer._TempBuffer[3] = w; - this.updateUniform(name, UniformBuffer._TempBuffer, 4); + this.updateUniform(name2, UniformBuffer._TempBuffer, 4); } - _updateFloatArrayForEffect(name, array) { - this._currentEffect.setFloatArray(name, array); + _updateFloatArrayForEffect(name2, array) { + this._currentEffect.setFloatArray(name2, array); } - _updateFloatArrayForUniform(name, array) { - this.updateUniformArray(name, array, array.length); + _updateFloatArrayForUniform(name2, array) { + this.updateUniformArray(name2, array, array.length); } - _updateArrayForEffect(name, array) { - this._currentEffect.setArray(name, array); + _updateArrayForEffect(name2, array) { + this._currentEffect.setArray(name2, array); } - _updateArrayForUniform(name, array) { - this.updateUniformArray(name, array, array.length); + _updateArrayForUniform(name2, array) { + this.updateUniformArray(name2, array, array.length); } - _updateIntArrayForEffect(name, array) { - this._currentEffect.setIntArray(name, array); + _updateIntArrayForEffect(name2, array) { + this._currentEffect.setIntArray(name2, array); } - _updateIntArrayForUniform(name, array) { + _updateIntArrayForUniform(name2, array) { UniformBuffer._TempBufferInt32View.set(array); - this.updateUniformArray(name, UniformBuffer._TempBuffer, array.length); + this.updateUniformArray(name2, UniformBuffer._TempBuffer, array.length); } - _updateUIntArrayForEffect(name, array) { - this._currentEffect.setUIntArray(name, array); + _updateUIntArrayForEffect(name2, array) { + this._currentEffect.setUIntArray(name2, array); } - _updateUIntArrayForUniform(name, array) { + _updateUIntArrayForUniform(name2, array) { UniformBuffer._TempBufferUInt32View.set(array); - this.updateUniformArray(name, UniformBuffer._TempBuffer, array.length); + this.updateUniformArray(name2, UniformBuffer._TempBuffer, array.length); } - _updateMatrixForEffect(name, mat) { - this._currentEffect.setMatrix(name, mat); + _updateMatrixForEffect(name2, mat) { + this._currentEffect.setMatrix(name2, mat); } - _updateMatrixForUniform(name, mat) { - if (this._cacheMatrix(name, mat)) { - this.updateUniform(name, mat.toArray(), 16); + _updateMatrixForUniform(name2, mat) { + if (this._cacheMatrix(name2, mat)) { + this.updateUniform(name2, mat.toArray(), 16); } } - _updateMatricesForEffect(name, mat) { - this._currentEffect.setMatrices(name, mat); + _updateMatricesForEffect(name2, mat) { + this._currentEffect.setMatrices(name2, mat); } - _updateMatricesForUniform(name, mat) { - this.updateUniform(name, mat, mat.length); + _updateMatricesForUniform(name2, mat) { + this.updateUniform(name2, mat, mat.length); } - _updateVector3ForEffect(name, vector) { - this._currentEffect.setVector3(name, vector); + _updateVector3ForEffect(name2, vector) { + this._currentEffect.setVector3(name2, vector); } - _updateVector3ForUniform(name, vector) { + _updateVector3ForUniform(name2, vector) { UniformBuffer._TempBuffer[0] = vector.x; UniformBuffer._TempBuffer[1] = vector.y; UniformBuffer._TempBuffer[2] = vector.z; - this.updateUniform(name, UniformBuffer._TempBuffer, 3); + this.updateUniform(name2, UniformBuffer._TempBuffer, 3); } - _updateVector4ForEffect(name, vector) { - this._currentEffect.setVector4(name, vector); + _updateVector4ForEffect(name2, vector) { + this._currentEffect.setVector4(name2, vector); } - _updateVector4ForUniform(name, vector) { + _updateVector4ForUniform(name2, vector) { UniformBuffer._TempBuffer[0] = vector.x; UniformBuffer._TempBuffer[1] = vector.y; UniformBuffer._TempBuffer[2] = vector.z; UniformBuffer._TempBuffer[3] = vector.w; - this.updateUniform(name, UniformBuffer._TempBuffer, 4); + this.updateUniform(name2, UniformBuffer._TempBuffer, 4); } - _updateColor3ForEffect(name, color, suffix = "") { - this._currentEffect.setColor3(name + suffix, color); + _updateColor3ForEffect(name2, color, suffix = "") { + this._currentEffect.setColor3(name2 + suffix, color); } - _updateColor3ForUniform(name, color) { + _updateColor3ForUniform(name2, color) { UniformBuffer._TempBuffer[0] = color.r; UniformBuffer._TempBuffer[1] = color.g; UniformBuffer._TempBuffer[2] = color.b; - this.updateUniform(name, UniformBuffer._TempBuffer, 3); + this.updateUniform(name2, UniformBuffer._TempBuffer, 3); } - _updateColor4ForEffect(name, color, alpha, suffix = "") { - this._currentEffect.setColor4(name + suffix, color, alpha); + _updateColor4ForEffect(name2, color, alpha, suffix = "") { + this._currentEffect.setColor4(name2 + suffix, color, alpha); } - _updateDirectColor4ForEffect(name, color, suffix = "") { - this._currentEffect.setDirectColor4(name + suffix, color); + _updateDirectColor4ForEffect(name2, color, suffix = "") { + this._currentEffect.setDirectColor4(name2 + suffix, color); } - _updateColor4ForUniform(name, color, alpha) { + _updateColor4ForUniform(name2, color, alpha) { UniformBuffer._TempBuffer[0] = color.r; UniformBuffer._TempBuffer[1] = color.g; UniformBuffer._TempBuffer[2] = color.b; UniformBuffer._TempBuffer[3] = alpha; - this.updateUniform(name, UniformBuffer._TempBuffer, 4); + this.updateUniform(name2, UniformBuffer._TempBuffer, 4); } - _updateDirectColor4ForUniform(name, color) { + _updateDirectColor4ForUniform(name2, color) { UniformBuffer._TempBuffer[0] = color.r; UniformBuffer._TempBuffer[1] = color.g; UniformBuffer._TempBuffer[2] = color.b; UniformBuffer._TempBuffer[3] = color.a; - this.updateUniform(name, UniformBuffer._TempBuffer, 4); + this.updateUniform(name2, UniformBuffer._TempBuffer, 4); } - _updateIntForEffect(name, x, suffix = "") { - this._currentEffect.setInt(name + suffix, x); + _updateIntForEffect(name2, x, suffix = "") { + this._currentEffect.setInt(name2 + suffix, x); } - _updateIntForUniform(name, x) { + _updateIntForUniform(name2, x) { UniformBuffer._TempBufferInt32View[0] = x; - this.updateUniform(name, UniformBuffer._TempBuffer, 1); + this.updateUniform(name2, UniformBuffer._TempBuffer, 1); } - _updateInt2ForEffect(name, x, y, suffix = "") { - this._currentEffect.setInt2(name + suffix, x, y); + _updateInt2ForEffect(name2, x, y, suffix = "") { + this._currentEffect.setInt2(name2 + suffix, x, y); } - _updateInt2ForUniform(name, x, y) { + _updateInt2ForUniform(name2, x, y) { UniformBuffer._TempBufferInt32View[0] = x; UniformBuffer._TempBufferInt32View[1] = y; - this.updateUniform(name, UniformBuffer._TempBuffer, 2); + this.updateUniform(name2, UniformBuffer._TempBuffer, 2); } - _updateInt3ForEffect(name, x, y, z, suffix = "") { - this._currentEffect.setInt3(name + suffix, x, y, z); + _updateInt3ForEffect(name2, x, y, z, suffix = "") { + this._currentEffect.setInt3(name2 + suffix, x, y, z); } - _updateInt3ForUniform(name, x, y, z) { + _updateInt3ForUniform(name2, x, y, z) { UniformBuffer._TempBufferInt32View[0] = x; UniformBuffer._TempBufferInt32View[1] = y; UniformBuffer._TempBufferInt32View[2] = z; - this.updateUniform(name, UniformBuffer._TempBuffer, 3); + this.updateUniform(name2, UniformBuffer._TempBuffer, 3); } - _updateInt4ForEffect(name, x, y, z, w, suffix = "") { - this._currentEffect.setInt4(name + suffix, x, y, z, w); + _updateInt4ForEffect(name2, x, y, z, w, suffix = "") { + this._currentEffect.setInt4(name2 + suffix, x, y, z, w); } - _updateInt4ForUniform(name, x, y, z, w) { + _updateInt4ForUniform(name2, x, y, z, w) { UniformBuffer._TempBufferInt32View[0] = x; UniformBuffer._TempBufferInt32View[1] = y; UniformBuffer._TempBufferInt32View[2] = z; UniformBuffer._TempBufferInt32View[3] = w; - this.updateUniform(name, UniformBuffer._TempBuffer, 4); + this.updateUniform(name2, UniformBuffer._TempBuffer, 4); } - _updateUIntForEffect(name, x, suffix = "") { - this._currentEffect.setUInt(name + suffix, x); + _updateUIntForEffect(name2, x, suffix = "") { + this._currentEffect.setUInt(name2 + suffix, x); } - _updateUIntForUniform(name, x) { + _updateUIntForUniform(name2, x) { UniformBuffer._TempBufferUInt32View[0] = x; - this.updateUniform(name, UniformBuffer._TempBuffer, 1); + this.updateUniform(name2, UniformBuffer._TempBuffer, 1); } - _updateUInt2ForEffect(name, x, y, suffix = "") { - this._currentEffect.setUInt2(name + suffix, x, y); + _updateUInt2ForEffect(name2, x, y, suffix = "") { + this._currentEffect.setUInt2(name2 + suffix, x, y); } - _updateUInt2ForUniform(name, x, y) { + _updateUInt2ForUniform(name2, x, y) { UniformBuffer._TempBufferUInt32View[0] = x; UniformBuffer._TempBufferUInt32View[1] = y; - this.updateUniform(name, UniformBuffer._TempBuffer, 2); + this.updateUniform(name2, UniformBuffer._TempBuffer, 2); } - _updateUInt3ForEffect(name, x, y, z, suffix = "") { - this._currentEffect.setUInt3(name + suffix, x, y, z); + _updateUInt3ForEffect(name2, x, y, z, suffix = "") { + this._currentEffect.setUInt3(name2 + suffix, x, y, z); } - _updateUInt3ForUniform(name, x, y, z) { + _updateUInt3ForUniform(name2, x, y, z) { UniformBuffer._TempBufferUInt32View[0] = x; UniformBuffer._TempBufferUInt32View[1] = y; UniformBuffer._TempBufferUInt32View[2] = z; - this.updateUniform(name, UniformBuffer._TempBuffer, 3); + this.updateUniform(name2, UniformBuffer._TempBuffer, 3); } - _updateUInt4ForEffect(name, x, y, z, w, suffix = "") { - this._currentEffect.setUInt4(name + suffix, x, y, z, w); + _updateUInt4ForEffect(name2, x, y, z, w, suffix = "") { + this._currentEffect.setUInt4(name2 + suffix, x, y, z, w); } - _updateUInt4ForUniform(name, x, y, z, w) { + _updateUInt4ForUniform(name2, x, y, z, w) { UniformBuffer._TempBufferUInt32View[0] = x; UniformBuffer._TempBufferUInt32View[1] = y; UniformBuffer._TempBufferUInt32View[2] = z; UniformBuffer._TempBufferUInt32View[3] = w; - this.updateUniform(name, UniformBuffer._TempBuffer, 4); + this.updateUniform(name2, UniformBuffer._TempBuffer, 4); } - setTexture(name, texture) { - this._currentEffect.setTexture(name, texture); + setTexture(name2, texture) { + this._currentEffect.setTexture(name2, texture); } - bindTexture(name, texture) { - this._currentEffect._bindTexture(name, texture); + bindTexture(name2, texture) { + this._currentEffect._bindTexture(name2, texture); } updateUniformDirectly(uniformName, data) { this.updateUniform(uniformName, data, data.length); this.update(); } - bindToEffect(effect2, name) { + bindToEffect(effect2, name2) { this._currentEffect = effect2; - this._currentEffectName = name; + this._currentEffectName = name2; } bindUniformBuffer() { if (!this._noUBO && this._buffer && this._currentEffect) { @@ -19574,11 +19889,16 @@ class UniformBuffer { } } } -UniformBuffer._UpdatedUbosInFrame = {}; -UniformBuffer._MAX_UNIFORM_SIZE = 256; -UniformBuffer._TempBuffer = new Float32Array(UniformBuffer._MAX_UNIFORM_SIZE); -UniformBuffer._TempBufferInt32View = new Int32Array(UniformBuffer._TempBuffer.buffer); -UniformBuffer._TempBufferUInt32View = new Uint32Array(UniformBuffer._TempBuffer.buffer); +var init_uniformBuffer = __esm(() => { + init_logger(); + init_tools(); + init_engine_uniformBuffer(); + UniformBuffer._UpdatedUbosInFrame = {}; + UniformBuffer._MAX_UNIFORM_SIZE = 256; + UniformBuffer._TempBuffer = new Float32Array(UniformBuffer._MAX_UNIFORM_SIZE); + UniformBuffer._TempBufferInt32View = new Int32Array(UniformBuffer._TempBuffer.buffer); + UniformBuffer._TempBufferUInt32View = new Uint32Array(UniformBuffer._TempBuffer.buffer); +}); // node_modules/@babylonjs/core/Buffers/buffer.js class Buffer { @@ -19990,29 +20310,32 @@ class VertexBuffer { return data; } } -VertexBuffer._Counter = 0; -VertexBuffer.BYTE = 5120; -VertexBuffer.UNSIGNED_BYTE = 5121; -VertexBuffer.SHORT = 5122; -VertexBuffer.UNSIGNED_SHORT = 5123; -VertexBuffer.INT = 5124; -VertexBuffer.UNSIGNED_INT = 5125; -VertexBuffer.FLOAT = 5126; -VertexBuffer.PositionKind = "position"; -VertexBuffer.NormalKind = "normal"; -VertexBuffer.TangentKind = "tangent"; -VertexBuffer.UVKind = "uv"; -VertexBuffer.UV2Kind = "uv2"; -VertexBuffer.UV3Kind = "uv3"; -VertexBuffer.UV4Kind = "uv4"; -VertexBuffer.UV5Kind = "uv5"; -VertexBuffer.UV6Kind = "uv6"; -VertexBuffer.ColorKind = "color"; -VertexBuffer.ColorInstanceKind = "instanceColor"; -VertexBuffer.MatricesIndicesKind = "matricesIndices"; -VertexBuffer.MatricesWeightsKind = "matricesWeights"; -VertexBuffer.MatricesIndicesExtraKind = "matricesIndicesExtra"; -VertexBuffer.MatricesWeightsExtraKind = "matricesWeightsExtra"; +var init_buffer = __esm(() => { + init_dataBuffer(); + VertexBuffer._Counter = 0; + VertexBuffer.BYTE = 5120; + VertexBuffer.UNSIGNED_BYTE = 5121; + VertexBuffer.SHORT = 5122; + VertexBuffer.UNSIGNED_SHORT = 5123; + VertexBuffer.INT = 5124; + VertexBuffer.UNSIGNED_INT = 5125; + VertexBuffer.FLOAT = 5126; + VertexBuffer.PositionKind = "position"; + VertexBuffer.NormalKind = "normal"; + VertexBuffer.TangentKind = "tangent"; + VertexBuffer.UVKind = "uv"; + VertexBuffer.UV2Kind = "uv2"; + VertexBuffer.UV3Kind = "uv3"; + VertexBuffer.UV4Kind = "uv4"; + VertexBuffer.UV5Kind = "uv5"; + VertexBuffer.UV6Kind = "uv6"; + VertexBuffer.ColorKind = "color"; + VertexBuffer.ColorInstanceKind = "instanceColor"; + VertexBuffer.MatricesIndicesKind = "matricesIndices"; + VertexBuffer.MatricesWeightsKind = "matricesWeights"; + VertexBuffer.MatricesIndicesExtraKind = "matricesIndicesExtra"; + VertexBuffer.MatricesWeightsExtraKind = "matricesWeightsExtra"; +}); // node_modules/@babylonjs/core/Collisions/pickingInfo.js class PickingInfo { @@ -20111,6 +20434,10 @@ class PickingInfo { return new Vector2(uv0.x + uv1.x + uv2.x, uv0.y + uv1.y + uv2.y); } } +var init_pickingInfo = __esm(() => { + init_math_vector(); + init_buffer(); +}); // node_modules/@babylonjs/core/PostProcesses/postProcessManager.js class PostProcessManager { @@ -20244,6 +20571,9 @@ class PostProcessManager { } } } +var init_postProcessManager = __esm(() => { + init_buffer(); +}); // node_modules/@babylonjs/core/Rendering/renderingGroup.js class RenderingGroup { @@ -20505,7 +20835,11 @@ class RenderingGroup { this._scene.onAfterSpritesRenderingObservable.notifyObservers(this._scene); } } -RenderingGroup._ZeroVector = Vector3.Zero(); +var init_renderingGroup = __esm(() => { + init_smartArray(); + init_math_vector(); + RenderingGroup._ZeroVector = Vector3.Zero(); +}); // node_modules/@babylonjs/core/Rendering/renderingManager.js class RenderingGroupInfo { @@ -20688,75 +21022,16 @@ class RenderingManager { return this._autoClearDepthStencil[index]; } } -RenderingManager.MAX_RENDERINGGROUPS = 4; -RenderingManager.MIN_RENDERINGGROUPS = 0; -RenderingManager.AUTOCLEAR = true; +var init_renderingManager = __esm(() => { + init_renderingGroup(); + RenderingManager.MAX_RENDERINGGROUPS = 4; + RenderingManager.MIN_RENDERINGGROUPS = 0; + RenderingManager.AUTOCLEAR = true; +}); // node_modules/@babylonjs/core/sceneComponent.js class SceneComponentConstants { } -SceneComponentConstants.NAME_EFFECTLAYER = "EffectLayer"; -SceneComponentConstants.NAME_LAYER = "Layer"; -SceneComponentConstants.NAME_LENSFLARESYSTEM = "LensFlareSystem"; -SceneComponentConstants.NAME_BOUNDINGBOXRENDERER = "BoundingBoxRenderer"; -SceneComponentConstants.NAME_PARTICLESYSTEM = "ParticleSystem"; -SceneComponentConstants.NAME_GAMEPAD = "Gamepad"; -SceneComponentConstants.NAME_SIMPLIFICATIONQUEUE = "SimplificationQueue"; -SceneComponentConstants.NAME_GEOMETRYBUFFERRENDERER = "GeometryBufferRenderer"; -SceneComponentConstants.NAME_PREPASSRENDERER = "PrePassRenderer"; -SceneComponentConstants.NAME_DEPTHRENDERER = "DepthRenderer"; -SceneComponentConstants.NAME_DEPTHPEELINGRENDERER = "DepthPeelingRenderer"; -SceneComponentConstants.NAME_POSTPROCESSRENDERPIPELINEMANAGER = "PostProcessRenderPipelineManager"; -SceneComponentConstants.NAME_SPRITE = "Sprite"; -SceneComponentConstants.NAME_SUBSURFACE = "SubSurface"; -SceneComponentConstants.NAME_OUTLINERENDERER = "Outline"; -SceneComponentConstants.NAME_PROCEDURALTEXTURE = "ProceduralTexture"; -SceneComponentConstants.NAME_SHADOWGENERATOR = "ShadowGenerator"; -SceneComponentConstants.NAME_OCTREE = "Octree"; -SceneComponentConstants.NAME_PHYSICSENGINE = "PhysicsEngine"; -SceneComponentConstants.NAME_AUDIO = "Audio"; -SceneComponentConstants.NAME_FLUIDRENDERER = "FluidRenderer"; -SceneComponentConstants.STEP_ISREADYFORMESH_EFFECTLAYER = 0; -SceneComponentConstants.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER = 0; -SceneComponentConstants.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER = 0; -SceneComponentConstants.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER = 0; -SceneComponentConstants.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER = 1; -SceneComponentConstants.STEP_BEFORECAMERADRAW_PREPASS = 0; -SceneComponentConstants.STEP_BEFORECAMERADRAW_EFFECTLAYER = 1; -SceneComponentConstants.STEP_BEFORECAMERADRAW_LAYER = 2; -SceneComponentConstants.STEP_BEFORERENDERTARGETDRAW_PREPASS = 0; -SceneComponentConstants.STEP_BEFORERENDERTARGETDRAW_LAYER = 1; -SceneComponentConstants.STEP_BEFORERENDERINGMESH_PREPASS = 0; -SceneComponentConstants.STEP_BEFORERENDERINGMESH_OUTLINE = 1; -SceneComponentConstants.STEP_AFTERRENDERINGMESH_PREPASS = 0; -SceneComponentConstants.STEP_AFTERRENDERINGMESH_OUTLINE = 1; -SceneComponentConstants.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW = 0; -SceneComponentConstants.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER = 1; -SceneComponentConstants.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE = 0; -SceneComponentConstants.STEP_BEFORECAMERAUPDATE_GAMEPAD = 1; -SceneComponentConstants.STEP_BEFORECLEAR_PROCEDURALTEXTURE = 0; -SceneComponentConstants.STEP_BEFORECLEAR_PREPASS = 1; -SceneComponentConstants.STEP_BEFORERENDERTARGETCLEAR_PREPASS = 0; -SceneComponentConstants.STEP_AFTERRENDERTARGETDRAW_PREPASS = 0; -SceneComponentConstants.STEP_AFTERRENDERTARGETDRAW_LAYER = 1; -SceneComponentConstants.STEP_AFTERCAMERADRAW_PREPASS = 0; -SceneComponentConstants.STEP_AFTERCAMERADRAW_EFFECTLAYER = 1; -SceneComponentConstants.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM = 2; -SceneComponentConstants.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW = 3; -SceneComponentConstants.STEP_AFTERCAMERADRAW_LAYER = 4; -SceneComponentConstants.STEP_AFTERCAMERADRAW_FLUIDRENDERER = 5; -SceneComponentConstants.STEP_AFTERCAMERAPOSTPROCESS_LAYER = 0; -SceneComponentConstants.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER = 0; -SceneComponentConstants.STEP_AFTERRENDER_AUDIO = 0; -SceneComponentConstants.STEP_GATHERRENDERTARGETS_DEPTHRENDERER = 0; -SceneComponentConstants.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER = 1; -SceneComponentConstants.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR = 2; -SceneComponentConstants.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER = 3; -SceneComponentConstants.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER = 0; -SceneComponentConstants.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER = 1; -SceneComponentConstants.STEP_POINTERMOVE_SPRITE = 0; -SceneComponentConstants.STEP_POINTERDOWN_SPRITE = 0; -SceneComponentConstants.STEP_POINTERUP_SPRITE = 0; class Stage extends Array { constructor(items) { @@ -20781,17 +21056,74 @@ class Stage extends Array { this.length = 0; } } +var init_sceneComponent = __esm(() => { + SceneComponentConstants.NAME_EFFECTLAYER = "EffectLayer"; + SceneComponentConstants.NAME_LAYER = "Layer"; + SceneComponentConstants.NAME_LENSFLARESYSTEM = "LensFlareSystem"; + SceneComponentConstants.NAME_BOUNDINGBOXRENDERER = "BoundingBoxRenderer"; + SceneComponentConstants.NAME_PARTICLESYSTEM = "ParticleSystem"; + SceneComponentConstants.NAME_GAMEPAD = "Gamepad"; + SceneComponentConstants.NAME_SIMPLIFICATIONQUEUE = "SimplificationQueue"; + SceneComponentConstants.NAME_GEOMETRYBUFFERRENDERER = "GeometryBufferRenderer"; + SceneComponentConstants.NAME_PREPASSRENDERER = "PrePassRenderer"; + SceneComponentConstants.NAME_DEPTHRENDERER = "DepthRenderer"; + SceneComponentConstants.NAME_DEPTHPEELINGRENDERER = "DepthPeelingRenderer"; + SceneComponentConstants.NAME_POSTPROCESSRENDERPIPELINEMANAGER = "PostProcessRenderPipelineManager"; + SceneComponentConstants.NAME_SPRITE = "Sprite"; + SceneComponentConstants.NAME_SUBSURFACE = "SubSurface"; + SceneComponentConstants.NAME_OUTLINERENDERER = "Outline"; + SceneComponentConstants.NAME_PROCEDURALTEXTURE = "ProceduralTexture"; + SceneComponentConstants.NAME_SHADOWGENERATOR = "ShadowGenerator"; + SceneComponentConstants.NAME_OCTREE = "Octree"; + SceneComponentConstants.NAME_PHYSICSENGINE = "PhysicsEngine"; + SceneComponentConstants.NAME_AUDIO = "Audio"; + SceneComponentConstants.NAME_FLUIDRENDERER = "FluidRenderer"; + SceneComponentConstants.STEP_ISREADYFORMESH_EFFECTLAYER = 0; + SceneComponentConstants.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER = 0; + SceneComponentConstants.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER = 0; + SceneComponentConstants.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER = 0; + SceneComponentConstants.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER = 1; + SceneComponentConstants.STEP_BEFORECAMERADRAW_PREPASS = 0; + SceneComponentConstants.STEP_BEFORECAMERADRAW_EFFECTLAYER = 1; + SceneComponentConstants.STEP_BEFORECAMERADRAW_LAYER = 2; + SceneComponentConstants.STEP_BEFORERENDERTARGETDRAW_PREPASS = 0; + SceneComponentConstants.STEP_BEFORERENDERTARGETDRAW_LAYER = 1; + SceneComponentConstants.STEP_BEFORERENDERINGMESH_PREPASS = 0; + SceneComponentConstants.STEP_BEFORERENDERINGMESH_OUTLINE = 1; + SceneComponentConstants.STEP_AFTERRENDERINGMESH_PREPASS = 0; + SceneComponentConstants.STEP_AFTERRENDERINGMESH_OUTLINE = 1; + SceneComponentConstants.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW = 0; + SceneComponentConstants.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER = 1; + SceneComponentConstants.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE = 0; + SceneComponentConstants.STEP_BEFORECAMERAUPDATE_GAMEPAD = 1; + SceneComponentConstants.STEP_BEFORECLEAR_PROCEDURALTEXTURE = 0; + SceneComponentConstants.STEP_BEFORECLEAR_PREPASS = 1; + SceneComponentConstants.STEP_BEFORERENDERTARGETCLEAR_PREPASS = 0; + SceneComponentConstants.STEP_AFTERRENDERTARGETDRAW_PREPASS = 0; + SceneComponentConstants.STEP_AFTERRENDERTARGETDRAW_LAYER = 1; + SceneComponentConstants.STEP_AFTERCAMERADRAW_PREPASS = 0; + SceneComponentConstants.STEP_AFTERCAMERADRAW_EFFECTLAYER = 1; + SceneComponentConstants.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM = 2; + SceneComponentConstants.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW = 3; + SceneComponentConstants.STEP_AFTERCAMERADRAW_LAYER = 4; + SceneComponentConstants.STEP_AFTERCAMERADRAW_FLUIDRENDERER = 5; + SceneComponentConstants.STEP_AFTERCAMERAPOSTPROCESS_LAYER = 0; + SceneComponentConstants.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER = 0; + SceneComponentConstants.STEP_AFTERRENDER_AUDIO = 0; + SceneComponentConstants.STEP_GATHERRENDERTARGETS_DEPTHRENDERER = 0; + SceneComponentConstants.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER = 1; + SceneComponentConstants.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR = 2; + SceneComponentConstants.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER = 3; + SceneComponentConstants.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER = 0; + SceneComponentConstants.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER = 1; + SceneComponentConstants.STEP_POINTERMOVE_SPRITE = 0; + SceneComponentConstants.STEP_POINTERDOWN_SPRITE = 0; + SceneComponentConstants.STEP_POINTERUP_SPRITE = 0; +}); // node_modules/@babylonjs/core/Events/pointerEvents.js class PointerEventTypes { } -PointerEventTypes.POINTERDOWN = 1; -PointerEventTypes.POINTERUP = 2; -PointerEventTypes.POINTERMOVE = 4; -PointerEventTypes.POINTERWHEEL = 8; -PointerEventTypes.POINTERPICK = 16; -PointerEventTypes.POINTERTAP = 32; -PointerEventTypes.POINTERDOUBLETAP = 64; class PointerInfoBase { constructor(type, event) { @@ -20830,12 +21162,20 @@ class PointerInfo extends PointerInfoBase { } } } +var init_pointerEvents = __esm(() => { + init_math_vector(); + PointerEventTypes.POINTERDOWN = 1; + PointerEventTypes.POINTERUP = 2; + PointerEventTypes.POINTERMOVE = 4; + PointerEventTypes.POINTERWHEEL = 8; + PointerEventTypes.POINTERPICK = 16; + PointerEventTypes.POINTERTAP = 32; + PointerEventTypes.POINTERDOUBLETAP = 64; +}); // node_modules/@babylonjs/core/Events/keyboardEvents.js class KeyboardEventTypes { } -KeyboardEventTypes.KEYDOWN = 1; -KeyboardEventTypes.KEYUP = 2; class KeyboardInfo { constructor(type, event) { @@ -20858,161 +21198,162 @@ class KeyboardInfoPre extends KeyboardInfo { this.skipOnKeyboardObservable = false; } } +var init_keyboardEvents = __esm(() => { + KeyboardEventTypes.KEYDOWN = 1; + KeyboardEventTypes.KEYUP = 2; +}); // node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceEnums.js -var DeviceType; -(function(DeviceType2) { - DeviceType2[DeviceType2["Generic"] = 0] = "Generic"; - DeviceType2[DeviceType2["Keyboard"] = 1] = "Keyboard"; - DeviceType2[DeviceType2["Mouse"] = 2] = "Mouse"; - DeviceType2[DeviceType2["Touch"] = 3] = "Touch"; - DeviceType2[DeviceType2["DualShock"] = 4] = "DualShock"; - DeviceType2[DeviceType2["Xbox"] = 5] = "Xbox"; - DeviceType2[DeviceType2["Switch"] = 6] = "Switch"; - DeviceType2[DeviceType2["DualSense"] = 7] = "DualSense"; -})(DeviceType || (DeviceType = {})); -var PointerInput; -(function(PointerInput2) { - PointerInput2[PointerInput2["Horizontal"] = 0] = "Horizontal"; - PointerInput2[PointerInput2["Vertical"] = 1] = "Vertical"; - PointerInput2[PointerInput2["LeftClick"] = 2] = "LeftClick"; - PointerInput2[PointerInput2["MiddleClick"] = 3] = "MiddleClick"; - PointerInput2[PointerInput2["RightClick"] = 4] = "RightClick"; - PointerInput2[PointerInput2["BrowserBack"] = 5] = "BrowserBack"; - PointerInput2[PointerInput2["BrowserForward"] = 6] = "BrowserForward"; - PointerInput2[PointerInput2["MouseWheelX"] = 7] = "MouseWheelX"; - PointerInput2[PointerInput2["MouseWheelY"] = 8] = "MouseWheelY"; - PointerInput2[PointerInput2["MouseWheelZ"] = 9] = "MouseWheelZ"; - PointerInput2[PointerInput2["Move"] = 12] = "Move"; -})(PointerInput || (PointerInput = {})); -var NativePointerInput; -(function(NativePointerInput2) { - NativePointerInput2[NativePointerInput2["Horizontal"] = 0] = "Horizontal"; - NativePointerInput2[NativePointerInput2["Vertical"] = 1] = "Vertical"; - NativePointerInput2[NativePointerInput2["LeftClick"] = 2] = "LeftClick"; - NativePointerInput2[NativePointerInput2["MiddleClick"] = 3] = "MiddleClick"; - NativePointerInput2[NativePointerInput2["RightClick"] = 4] = "RightClick"; - NativePointerInput2[NativePointerInput2["BrowserBack"] = 5] = "BrowserBack"; - NativePointerInput2[NativePointerInput2["BrowserForward"] = 6] = "BrowserForward"; - NativePointerInput2[NativePointerInput2["MouseWheelX"] = 7] = "MouseWheelX"; - NativePointerInput2[NativePointerInput2["MouseWheelY"] = 8] = "MouseWheelY"; - NativePointerInput2[NativePointerInput2["MouseWheelZ"] = 9] = "MouseWheelZ"; - NativePointerInput2[NativePointerInput2["DeltaHorizontal"] = 10] = "DeltaHorizontal"; - NativePointerInput2[NativePointerInput2["DeltaVertical"] = 11] = "DeltaVertical"; -})(NativePointerInput || (NativePointerInput = {})); -var DualShockInput; -(function(DualShockInput2) { - DualShockInput2[DualShockInput2["Cross"] = 0] = "Cross"; - DualShockInput2[DualShockInput2["Circle"] = 1] = "Circle"; - DualShockInput2[DualShockInput2["Square"] = 2] = "Square"; - DualShockInput2[DualShockInput2["Triangle"] = 3] = "Triangle"; - DualShockInput2[DualShockInput2["L1"] = 4] = "L1"; - DualShockInput2[DualShockInput2["R1"] = 5] = "R1"; - DualShockInput2[DualShockInput2["L2"] = 6] = "L2"; - DualShockInput2[DualShockInput2["R2"] = 7] = "R2"; - DualShockInput2[DualShockInput2["Share"] = 8] = "Share"; - DualShockInput2[DualShockInput2["Options"] = 9] = "Options"; - DualShockInput2[DualShockInput2["L3"] = 10] = "L3"; - DualShockInput2[DualShockInput2["R3"] = 11] = "R3"; - DualShockInput2[DualShockInput2["DPadUp"] = 12] = "DPadUp"; - DualShockInput2[DualShockInput2["DPadDown"] = 13] = "DPadDown"; - DualShockInput2[DualShockInput2["DPadLeft"] = 14] = "DPadLeft"; - DualShockInput2[DualShockInput2["DPadRight"] = 15] = "DPadRight"; - DualShockInput2[DualShockInput2["Home"] = 16] = "Home"; - DualShockInput2[DualShockInput2["TouchPad"] = 17] = "TouchPad"; - DualShockInput2[DualShockInput2["LStickXAxis"] = 18] = "LStickXAxis"; - DualShockInput2[DualShockInput2["LStickYAxis"] = 19] = "LStickYAxis"; - DualShockInput2[DualShockInput2["RStickXAxis"] = 20] = "RStickXAxis"; - DualShockInput2[DualShockInput2["RStickYAxis"] = 21] = "RStickYAxis"; -})(DualShockInput || (DualShockInput = {})); -var DualSenseInput; -(function(DualSenseInput2) { - DualSenseInput2[DualSenseInput2["Cross"] = 0] = "Cross"; - DualSenseInput2[DualSenseInput2["Circle"] = 1] = "Circle"; - DualSenseInput2[DualSenseInput2["Square"] = 2] = "Square"; - DualSenseInput2[DualSenseInput2["Triangle"] = 3] = "Triangle"; - DualSenseInput2[DualSenseInput2["L1"] = 4] = "L1"; - DualSenseInput2[DualSenseInput2["R1"] = 5] = "R1"; - DualSenseInput2[DualSenseInput2["L2"] = 6] = "L2"; - DualSenseInput2[DualSenseInput2["R2"] = 7] = "R2"; - DualSenseInput2[DualSenseInput2["Create"] = 8] = "Create"; - DualSenseInput2[DualSenseInput2["Options"] = 9] = "Options"; - DualSenseInput2[DualSenseInput2["L3"] = 10] = "L3"; - DualSenseInput2[DualSenseInput2["R3"] = 11] = "R3"; - DualSenseInput2[DualSenseInput2["DPadUp"] = 12] = "DPadUp"; - DualSenseInput2[DualSenseInput2["DPadDown"] = 13] = "DPadDown"; - DualSenseInput2[DualSenseInput2["DPadLeft"] = 14] = "DPadLeft"; - DualSenseInput2[DualSenseInput2["DPadRight"] = 15] = "DPadRight"; - DualSenseInput2[DualSenseInput2["Home"] = 16] = "Home"; - DualSenseInput2[DualSenseInput2["TouchPad"] = 17] = "TouchPad"; - DualSenseInput2[DualSenseInput2["LStickXAxis"] = 18] = "LStickXAxis"; - DualSenseInput2[DualSenseInput2["LStickYAxis"] = 19] = "LStickYAxis"; - DualSenseInput2[DualSenseInput2["RStickXAxis"] = 20] = "RStickXAxis"; - DualSenseInput2[DualSenseInput2["RStickYAxis"] = 21] = "RStickYAxis"; -})(DualSenseInput || (DualSenseInput = {})); -var XboxInput; -(function(XboxInput2) { - XboxInput2[XboxInput2["A"] = 0] = "A"; - XboxInput2[XboxInput2["B"] = 1] = "B"; - XboxInput2[XboxInput2["X"] = 2] = "X"; - XboxInput2[XboxInput2["Y"] = 3] = "Y"; - XboxInput2[XboxInput2["LB"] = 4] = "LB"; - XboxInput2[XboxInput2["RB"] = 5] = "RB"; - XboxInput2[XboxInput2["LT"] = 6] = "LT"; - XboxInput2[XboxInput2["RT"] = 7] = "RT"; - XboxInput2[XboxInput2["Back"] = 8] = "Back"; - XboxInput2[XboxInput2["Start"] = 9] = "Start"; - XboxInput2[XboxInput2["LS"] = 10] = "LS"; - XboxInput2[XboxInput2["RS"] = 11] = "RS"; - XboxInput2[XboxInput2["DPadUp"] = 12] = "DPadUp"; - XboxInput2[XboxInput2["DPadDown"] = 13] = "DPadDown"; - XboxInput2[XboxInput2["DPadLeft"] = 14] = "DPadLeft"; - XboxInput2[XboxInput2["DPadRight"] = 15] = "DPadRight"; - XboxInput2[XboxInput2["Home"] = 16] = "Home"; - XboxInput2[XboxInput2["LStickXAxis"] = 17] = "LStickXAxis"; - XboxInput2[XboxInput2["LStickYAxis"] = 18] = "LStickYAxis"; - XboxInput2[XboxInput2["RStickXAxis"] = 19] = "RStickXAxis"; - XboxInput2[XboxInput2["RStickYAxis"] = 20] = "RStickYAxis"; -})(XboxInput || (XboxInput = {})); -var SwitchInput; -(function(SwitchInput2) { - SwitchInput2[SwitchInput2["B"] = 0] = "B"; - SwitchInput2[SwitchInput2["A"] = 1] = "A"; - SwitchInput2[SwitchInput2["Y"] = 2] = "Y"; - SwitchInput2[SwitchInput2["X"] = 3] = "X"; - SwitchInput2[SwitchInput2["L"] = 4] = "L"; - SwitchInput2[SwitchInput2["R"] = 5] = "R"; - SwitchInput2[SwitchInput2["ZL"] = 6] = "ZL"; - SwitchInput2[SwitchInput2["ZR"] = 7] = "ZR"; - SwitchInput2[SwitchInput2["Minus"] = 8] = "Minus"; - SwitchInput2[SwitchInput2["Plus"] = 9] = "Plus"; - SwitchInput2[SwitchInput2["LS"] = 10] = "LS"; - SwitchInput2[SwitchInput2["RS"] = 11] = "RS"; - SwitchInput2[SwitchInput2["DPadUp"] = 12] = "DPadUp"; - SwitchInput2[SwitchInput2["DPadDown"] = 13] = "DPadDown"; - SwitchInput2[SwitchInput2["DPadLeft"] = 14] = "DPadLeft"; - SwitchInput2[SwitchInput2["DPadRight"] = 15] = "DPadRight"; - SwitchInput2[SwitchInput2["Home"] = 16] = "Home"; - SwitchInput2[SwitchInput2["Capture"] = 17] = "Capture"; - SwitchInput2[SwitchInput2["LStickXAxis"] = 18] = "LStickXAxis"; - SwitchInput2[SwitchInput2["LStickYAxis"] = 19] = "LStickYAxis"; - SwitchInput2[SwitchInput2["RStickXAxis"] = 20] = "RStickXAxis"; - SwitchInput2[SwitchInput2["RStickYAxis"] = 21] = "RStickYAxis"; -})(SwitchInput || (SwitchInput = {})); +var DeviceType, PointerInput, NativePointerInput, DualShockInput, DualSenseInput, XboxInput, SwitchInput; +var init_deviceEnums = __esm(() => { + (function(DeviceType2) { + DeviceType2[DeviceType2["Generic"] = 0] = "Generic"; + DeviceType2[DeviceType2["Keyboard"] = 1] = "Keyboard"; + DeviceType2[DeviceType2["Mouse"] = 2] = "Mouse"; + DeviceType2[DeviceType2["Touch"] = 3] = "Touch"; + DeviceType2[DeviceType2["DualShock"] = 4] = "DualShock"; + DeviceType2[DeviceType2["Xbox"] = 5] = "Xbox"; + DeviceType2[DeviceType2["Switch"] = 6] = "Switch"; + DeviceType2[DeviceType2["DualSense"] = 7] = "DualSense"; + })(DeviceType || (DeviceType = {})); + (function(PointerInput2) { + PointerInput2[PointerInput2["Horizontal"] = 0] = "Horizontal"; + PointerInput2[PointerInput2["Vertical"] = 1] = "Vertical"; + PointerInput2[PointerInput2["LeftClick"] = 2] = "LeftClick"; + PointerInput2[PointerInput2["MiddleClick"] = 3] = "MiddleClick"; + PointerInput2[PointerInput2["RightClick"] = 4] = "RightClick"; + PointerInput2[PointerInput2["BrowserBack"] = 5] = "BrowserBack"; + PointerInput2[PointerInput2["BrowserForward"] = 6] = "BrowserForward"; + PointerInput2[PointerInput2["MouseWheelX"] = 7] = "MouseWheelX"; + PointerInput2[PointerInput2["MouseWheelY"] = 8] = "MouseWheelY"; + PointerInput2[PointerInput2["MouseWheelZ"] = 9] = "MouseWheelZ"; + PointerInput2[PointerInput2["Move"] = 12] = "Move"; + })(PointerInput || (PointerInput = {})); + (function(NativePointerInput2) { + NativePointerInput2[NativePointerInput2["Horizontal"] = 0] = "Horizontal"; + NativePointerInput2[NativePointerInput2["Vertical"] = 1] = "Vertical"; + NativePointerInput2[NativePointerInput2["LeftClick"] = 2] = "LeftClick"; + NativePointerInput2[NativePointerInput2["MiddleClick"] = 3] = "MiddleClick"; + NativePointerInput2[NativePointerInput2["RightClick"] = 4] = "RightClick"; + NativePointerInput2[NativePointerInput2["BrowserBack"] = 5] = "BrowserBack"; + NativePointerInput2[NativePointerInput2["BrowserForward"] = 6] = "BrowserForward"; + NativePointerInput2[NativePointerInput2["MouseWheelX"] = 7] = "MouseWheelX"; + NativePointerInput2[NativePointerInput2["MouseWheelY"] = 8] = "MouseWheelY"; + NativePointerInput2[NativePointerInput2["MouseWheelZ"] = 9] = "MouseWheelZ"; + NativePointerInput2[NativePointerInput2["DeltaHorizontal"] = 10] = "DeltaHorizontal"; + NativePointerInput2[NativePointerInput2["DeltaVertical"] = 11] = "DeltaVertical"; + })(NativePointerInput || (NativePointerInput = {})); + (function(DualShockInput2) { + DualShockInput2[DualShockInput2["Cross"] = 0] = "Cross"; + DualShockInput2[DualShockInput2["Circle"] = 1] = "Circle"; + DualShockInput2[DualShockInput2["Square"] = 2] = "Square"; + DualShockInput2[DualShockInput2["Triangle"] = 3] = "Triangle"; + DualShockInput2[DualShockInput2["L1"] = 4] = "L1"; + DualShockInput2[DualShockInput2["R1"] = 5] = "R1"; + DualShockInput2[DualShockInput2["L2"] = 6] = "L2"; + DualShockInput2[DualShockInput2["R2"] = 7] = "R2"; + DualShockInput2[DualShockInput2["Share"] = 8] = "Share"; + DualShockInput2[DualShockInput2["Options"] = 9] = "Options"; + DualShockInput2[DualShockInput2["L3"] = 10] = "L3"; + DualShockInput2[DualShockInput2["R3"] = 11] = "R3"; + DualShockInput2[DualShockInput2["DPadUp"] = 12] = "DPadUp"; + DualShockInput2[DualShockInput2["DPadDown"] = 13] = "DPadDown"; + DualShockInput2[DualShockInput2["DPadLeft"] = 14] = "DPadLeft"; + DualShockInput2[DualShockInput2["DPadRight"] = 15] = "DPadRight"; + DualShockInput2[DualShockInput2["Home"] = 16] = "Home"; + DualShockInput2[DualShockInput2["TouchPad"] = 17] = "TouchPad"; + DualShockInput2[DualShockInput2["LStickXAxis"] = 18] = "LStickXAxis"; + DualShockInput2[DualShockInput2["LStickYAxis"] = 19] = "LStickYAxis"; + DualShockInput2[DualShockInput2["RStickXAxis"] = 20] = "RStickXAxis"; + DualShockInput2[DualShockInput2["RStickYAxis"] = 21] = "RStickYAxis"; + })(DualShockInput || (DualShockInput = {})); + (function(DualSenseInput2) { + DualSenseInput2[DualSenseInput2["Cross"] = 0] = "Cross"; + DualSenseInput2[DualSenseInput2["Circle"] = 1] = "Circle"; + DualSenseInput2[DualSenseInput2["Square"] = 2] = "Square"; + DualSenseInput2[DualSenseInput2["Triangle"] = 3] = "Triangle"; + DualSenseInput2[DualSenseInput2["L1"] = 4] = "L1"; + DualSenseInput2[DualSenseInput2["R1"] = 5] = "R1"; + DualSenseInput2[DualSenseInput2["L2"] = 6] = "L2"; + DualSenseInput2[DualSenseInput2["R2"] = 7] = "R2"; + DualSenseInput2[DualSenseInput2["Create"] = 8] = "Create"; + DualSenseInput2[DualSenseInput2["Options"] = 9] = "Options"; + DualSenseInput2[DualSenseInput2["L3"] = 10] = "L3"; + DualSenseInput2[DualSenseInput2["R3"] = 11] = "R3"; + DualSenseInput2[DualSenseInput2["DPadUp"] = 12] = "DPadUp"; + DualSenseInput2[DualSenseInput2["DPadDown"] = 13] = "DPadDown"; + DualSenseInput2[DualSenseInput2["DPadLeft"] = 14] = "DPadLeft"; + DualSenseInput2[DualSenseInput2["DPadRight"] = 15] = "DPadRight"; + DualSenseInput2[DualSenseInput2["Home"] = 16] = "Home"; + DualSenseInput2[DualSenseInput2["TouchPad"] = 17] = "TouchPad"; + DualSenseInput2[DualSenseInput2["LStickXAxis"] = 18] = "LStickXAxis"; + DualSenseInput2[DualSenseInput2["LStickYAxis"] = 19] = "LStickYAxis"; + DualSenseInput2[DualSenseInput2["RStickXAxis"] = 20] = "RStickXAxis"; + DualSenseInput2[DualSenseInput2["RStickYAxis"] = 21] = "RStickYAxis"; + })(DualSenseInput || (DualSenseInput = {})); + (function(XboxInput2) { + XboxInput2[XboxInput2["A"] = 0] = "A"; + XboxInput2[XboxInput2["B"] = 1] = "B"; + XboxInput2[XboxInput2["X"] = 2] = "X"; + XboxInput2[XboxInput2["Y"] = 3] = "Y"; + XboxInput2[XboxInput2["LB"] = 4] = "LB"; + XboxInput2[XboxInput2["RB"] = 5] = "RB"; + XboxInput2[XboxInput2["LT"] = 6] = "LT"; + XboxInput2[XboxInput2["RT"] = 7] = "RT"; + XboxInput2[XboxInput2["Back"] = 8] = "Back"; + XboxInput2[XboxInput2["Start"] = 9] = "Start"; + XboxInput2[XboxInput2["LS"] = 10] = "LS"; + XboxInput2[XboxInput2["RS"] = 11] = "RS"; + XboxInput2[XboxInput2["DPadUp"] = 12] = "DPadUp"; + XboxInput2[XboxInput2["DPadDown"] = 13] = "DPadDown"; + XboxInput2[XboxInput2["DPadLeft"] = 14] = "DPadLeft"; + XboxInput2[XboxInput2["DPadRight"] = 15] = "DPadRight"; + XboxInput2[XboxInput2["Home"] = 16] = "Home"; + XboxInput2[XboxInput2["LStickXAxis"] = 17] = "LStickXAxis"; + XboxInput2[XboxInput2["LStickYAxis"] = 18] = "LStickYAxis"; + XboxInput2[XboxInput2["RStickXAxis"] = 19] = "RStickXAxis"; + XboxInput2[XboxInput2["RStickYAxis"] = 20] = "RStickYAxis"; + })(XboxInput || (XboxInput = {})); + (function(SwitchInput2) { + SwitchInput2[SwitchInput2["B"] = 0] = "B"; + SwitchInput2[SwitchInput2["A"] = 1] = "A"; + SwitchInput2[SwitchInput2["Y"] = 2] = "Y"; + SwitchInput2[SwitchInput2["X"] = 3] = "X"; + SwitchInput2[SwitchInput2["L"] = 4] = "L"; + SwitchInput2[SwitchInput2["R"] = 5] = "R"; + SwitchInput2[SwitchInput2["ZL"] = 6] = "ZL"; + SwitchInput2[SwitchInput2["ZR"] = 7] = "ZR"; + SwitchInput2[SwitchInput2["Minus"] = 8] = "Minus"; + SwitchInput2[SwitchInput2["Plus"] = 9] = "Plus"; + SwitchInput2[SwitchInput2["LS"] = 10] = "LS"; + SwitchInput2[SwitchInput2["RS"] = 11] = "RS"; + SwitchInput2[SwitchInput2["DPadUp"] = 12] = "DPadUp"; + SwitchInput2[SwitchInput2["DPadDown"] = 13] = "DPadDown"; + SwitchInput2[SwitchInput2["DPadLeft"] = 14] = "DPadLeft"; + SwitchInput2[SwitchInput2["DPadRight"] = 15] = "DPadRight"; + SwitchInput2[SwitchInput2["Home"] = 16] = "Home"; + SwitchInput2[SwitchInput2["Capture"] = 17] = "Capture"; + SwitchInput2[SwitchInput2["LStickXAxis"] = 18] = "LStickXAxis"; + SwitchInput2[SwitchInput2["LStickYAxis"] = 19] = "LStickYAxis"; + SwitchInput2[SwitchInput2["RStickXAxis"] = 20] = "RStickXAxis"; + SwitchInput2[SwitchInput2["RStickYAxis"] = 21] = "RStickYAxis"; + })(SwitchInput || (SwitchInput = {})); +}); // node_modules/@babylonjs/core/Events/deviceInputEvents.js -var DeviceInputEventType; -(function(DeviceInputEventType2) { - DeviceInputEventType2[DeviceInputEventType2["PointerMove"] = 0] = "PointerMove"; - DeviceInputEventType2[DeviceInputEventType2["PointerDown"] = 1] = "PointerDown"; - DeviceInputEventType2[DeviceInputEventType2["PointerUp"] = 2] = "PointerUp"; -})(DeviceInputEventType || (DeviceInputEventType = {})); - class EventConstants { } -EventConstants.DOM_DELTA_PIXEL = 0; -EventConstants.DOM_DELTA_LINE = 1; -EventConstants.DOM_DELTA_PAGE = 2; +var DeviceInputEventType; +var init_deviceInputEvents = __esm(() => { + (function(DeviceInputEventType2) { + DeviceInputEventType2[DeviceInputEventType2["PointerMove"] = 0] = "PointerMove"; + DeviceInputEventType2[DeviceInputEventType2["PointerDown"] = 1] = "PointerDown"; + DeviceInputEventType2[DeviceInputEventType2["PointerUp"] = 2] = "PointerUp"; + })(DeviceInputEventType || (DeviceInputEventType = {})); + EventConstants.DOM_DELTA_PIXEL = 0; + EventConstants.DOM_DELTA_LINE = 1; + EventConstants.DOM_DELTA_PAGE = 2; +}); // node_modules/@babylonjs/core/DeviceInput/eventFactory.js class DeviceEventFactory { @@ -21130,6 +21471,10 @@ class DeviceEventFactory { return evt; } } +var init_eventFactory = __esm(() => { + init_deviceInputEvents(); + init_deviceEnums(); +}); // node_modules/@babylonjs/core/DeviceInput/nativeDeviceInputSystem.js class NativeDeviceInputSystem { @@ -21162,11 +21507,12 @@ class NativeDeviceInputSystem { return nativeInput; } } +var init_nativeDeviceInputSystem = __esm(() => { + init_eventFactory(); + init_deviceEnums(); +}); // node_modules/@babylonjs/core/DeviceInput/webDeviceInputSystem.js -var MAX_KEYCODES = 255; -var MAX_POINTER_INPUTS = Object.keys(PointerInput).length / 2; - class WebDeviceInputSystem { constructor(engine, onDeviceConnected, onDeviceDisconnected, onInputChanged) { this._inputs = []; @@ -21726,6 +22072,15 @@ class WebDeviceInputSystem { return deviceType; } } +var MAX_KEYCODES, MAX_POINTER_INPUTS; +var init_webDeviceInputSystem = __esm(() => { + init_domManagement(); + init_tools(); + init_eventFactory(); + init_deviceEnums(); + MAX_KEYCODES = 255; + MAX_POINTER_INPUTS = Object.keys(PointerInput).length / 2; +}); // node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSource.js class DeviceSource { @@ -21739,6 +22094,9 @@ class DeviceSource { return this._deviceInputSystem.pollInput(this.deviceType, this.deviceSlot, inputIndex); } } +var init_deviceSource = __esm(() => { + init_observable(); +}); // node_modules/@babylonjs/core/DeviceInput/internalDeviceSourceManager.js class InternalDeviceSourceManager { @@ -21801,6 +22159,12 @@ class InternalDeviceSourceManager { this._deviceInputSystem.dispose(); } } +var init_internalDeviceSourceManager = __esm(() => { + init_deviceEnums(); + init_nativeDeviceInputSystem(); + init_webDeviceInputSystem(); + init_deviceSource(); +}); // node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSourceManager.js class DeviceSourceManager { @@ -21912,6 +22276,11 @@ class DeviceSourceManager { } } } +var init_deviceSourceManager = __esm(() => { + init_deviceEnums(); + init_observable(); + init_internalDeviceSourceManager(); +}); // node_modules/@babylonjs/core/Inputs/scene.inputManager.js class _ClickInfo { @@ -22673,10 +23042,21 @@ class InputManager { } } } -InputManager.DragMovementThreshold = 10; -InputManager.LongPressDelay = 500; -InputManager.DoubleClickDelay = 300; -InputManager.ExclusiveDoubleClickMode = false; +var init_scene_inputManager = __esm(() => { + init_pointerEvents(); + init_abstractActionManager(); + init_pickingInfo(); + init_math_vector(); + init_actionEvent(); + init_keyboardEvents(); + init_deviceEnums(); + init_deviceSourceManager(); + init_engineStore(); + InputManager.DragMovementThreshold = 10; + InputManager.LongPressDelay = 500; + InputManager.DoubleClickDelay = 300; + InputManager.ExclusiveDoubleClickMode = false; +}); // node_modules/@babylonjs/core/Misc/perfCounter.js class PerfCounter { @@ -22765,7 +23145,10 @@ class PerfCounter { } } } -PerfCounter.Enabled = true; +var init_perfCounter = __esm(() => { + init_precisionDate(); + PerfCounter.Enabled = true; +}); // node_modules/@babylonjs/core/Maths/math.plane.js class Plane { @@ -22869,7 +23252,10 @@ class Plane { return Vector3.Dot(point, normal) + d; } } -Plane._TmpMatrix = Matrix.Identity(); +var init_math_plane = __esm(() => { + init_math_vector(); + Plane._TmpMatrix = Matrix.Identity(); +}); // node_modules/@babylonjs/core/Maths/math.frustum.js class Frustum { @@ -22946,6 +23332,9 @@ class Frustum { return true; } } +var init_math_frustum = __esm(() => { + init_math_plane(); +}); // node_modules/@babylonjs/core/Misc/uniqueIdGenerator.js class UniqueIdGenerator { @@ -22955,7 +23344,9 @@ class UniqueIdGenerator { return result; } } -UniqueIdGenerator._UniqueIdCounter = 1; +var init_uniqueIdGenerator = __esm(() => { + UniqueIdGenerator._UniqueIdCounter = 1; +}); // node_modules/@babylonjs/core/Lights/lightConstants.js class LightConstants { @@ -22966,22 +23357,24 @@ class LightConstants { return b.renderPriority - a.renderPriority; } } -LightConstants.FALLOFF_DEFAULT = 0; -LightConstants.FALLOFF_PHYSICAL = 1; -LightConstants.FALLOFF_GLTF = 2; -LightConstants.FALLOFF_STANDARD = 3; -LightConstants.LIGHTMAP_DEFAULT = 0; -LightConstants.LIGHTMAP_SPECULAR = 1; -LightConstants.LIGHTMAP_SHADOWSONLY = 2; -LightConstants.INTENSITYMODE_AUTOMATIC = 0; -LightConstants.INTENSITYMODE_LUMINOUSPOWER = 1; -LightConstants.INTENSITYMODE_LUMINOUSINTENSITY = 2; -LightConstants.INTENSITYMODE_ILLUMINANCE = 3; -LightConstants.INTENSITYMODE_LUMINANCE = 4; -LightConstants.LIGHTTYPEID_POINTLIGHT = 0; -LightConstants.LIGHTTYPEID_DIRECTIONALLIGHT = 1; -LightConstants.LIGHTTYPEID_SPOTLIGHT = 2; -LightConstants.LIGHTTYPEID_HEMISPHERICLIGHT = 3; +var init_lightConstants = __esm(() => { + LightConstants.FALLOFF_DEFAULT = 0; + LightConstants.FALLOFF_PHYSICAL = 1; + LightConstants.FALLOFF_GLTF = 2; + LightConstants.FALLOFF_STANDARD = 3; + LightConstants.LIGHTMAP_DEFAULT = 0; + LightConstants.LIGHTMAP_SPECULAR = 1; + LightConstants.LIGHTMAP_SHADOWSONLY = 2; + LightConstants.INTENSITYMODE_AUTOMATIC = 0; + LightConstants.INTENSITYMODE_LUMINOUSPOWER = 1; + LightConstants.INTENSITYMODE_LUMINOUSINTENSITY = 2; + LightConstants.INTENSITYMODE_ILLUMINANCE = 3; + LightConstants.INTENSITYMODE_LUMINANCE = 4; + LightConstants.LIGHTTYPEID_POINTLIGHT = 0; + LightConstants.LIGHTTYPEID_DIRECTIONALLIGHT = 1; + LightConstants.LIGHTTYPEID_SPOTLIGHT = 2; + LightConstants.LIGHTTYPEID_HEMISPHERICLIGHT = 3; +}); // node_modules/@babylonjs/core/Inputs/pointerPickingConfiguration.js class PointerPickingConfiguration { @@ -22994,15 +23387,10 @@ class PointerPickingConfiguration { this.skipPointerUpPicking = false; } } +var init_pointerPickingConfiguration = __esm(() => { +}); // node_modules/@babylonjs/core/scene.js -var ScenePerformancePriority; -(function(ScenePerformancePriority2) { - ScenePerformancePriority2[ScenePerformancePriority2["BackwardCompatible"] = 0] = "BackwardCompatible"; - ScenePerformancePriority2[ScenePerformancePriority2["Intermediate"] = 1] = "Intermediate"; - ScenePerformancePriority2[ScenePerformancePriority2["Aggressive"] = 2] = "Aggressive"; -})(ScenePerformancePriority || (ScenePerformancePriority = {})); - class Scene extends AbstractScene { static DefaultMaterialFactory(scene) { throw _WarnImport("StandardMaterial"); @@ -23368,9 +23756,9 @@ class Scene extends AbstractScene { this._serializableComponents.push(serializableComponent); } } - _getComponent(name) { + _getComponent(name2) { for (const component of this._components) { - if (component.name === name) { + if (component.name === name2) { return component; } } @@ -23941,8 +24329,8 @@ class Scene extends AbstractScene { getSceneUniformBuffer() { return this._multiviewSceneUbo ? this._multiviewSceneUbo : this._sceneUbo; } - createSceneUniformBuffer(name) { - const sceneUbo = new UniformBuffer(this._engine, undefined, false, name !== null && name !== undefined ? name : "scene"); + createSceneUniformBuffer(name2) { + const sceneUbo = new UniformBuffer(this._engine, undefined, false, name2 !== null && name2 !== undefined ? name2 : "scene"); sceneUbo.addUniform("viewProjection", 16); sceneUbo.addUniform("view", 16); sceneUbo.addUniform("projection", 16); @@ -24259,17 +24647,17 @@ class Scene extends AbstractScene { } return null; } - setActiveCameraByName(name) { - const camera = this.getCameraByName(name); + setActiveCameraByName(name2) { + const camera = this.getCameraByName(name2); if (camera) { this.activeCamera = camera; return camera; } return null; } - getAnimationGroupByName(name) { + getAnimationGroupByName(name2) { for (let index = 0;index < this.animationGroups.length; index++) { - if (this.animationGroups[index].name === name) { + if (this.animationGroups[index].name === name2) { return this.animationGroups[index]; } } @@ -24298,8 +24686,8 @@ class Scene extends AbstractScene { getMaterialById(id, allowMultiMaterials = false) { return this._getMaterial(allowMultiMaterials, (m) => m.id === id); } - getMaterialByName(name, allowMultiMaterials = false) { - return this._getMaterial(allowMultiMaterials, (m) => m.name === name); + getMaterialByName(name2, allowMultiMaterials = false) { + return this._getMaterial(allowMultiMaterials, (m) => m.name === name2); } getLastMaterialById(id, allowMultiMaterials = false) { for (let index = this.materials.length - 1;index >= 0; index--) { @@ -24324,9 +24712,9 @@ class Scene extends AbstractScene { } return null; } - getTextureByName(name) { + getTextureByName(name2) { for (let index = 0;index < this.textures.length; index++) { - if (this.textures[index].name === name) { + if (this.textures[index].name === name2) { return this.textures[index]; } } @@ -24348,9 +24736,9 @@ class Scene extends AbstractScene { } return null; } - getCameraByName(name) { + getCameraByName(name2) { for (let index = 0;index < this.cameras.length; index++) { - if (this.cameras[index].name === name) { + if (this.cameras[index].name === name2) { return this.cameras[index]; } } @@ -24367,20 +24755,20 @@ class Scene extends AbstractScene { } return null; } - getBoneByName(name) { + getBoneByName(name2) { for (let skeletonIndex = 0;skeletonIndex < this.skeletons.length; skeletonIndex++) { const skeleton = this.skeletons[skeletonIndex]; for (let boneIndex = 0;boneIndex < skeleton.bones.length; boneIndex++) { - if (skeleton.bones[boneIndex].name === name) { + if (skeleton.bones[boneIndex].name === name2) { return skeleton.bones[boneIndex]; } } } return null; } - getLightByName(name) { + getLightByName(name2) { for (let index = 0;index < this.lights.length; index++) { - if (this.lights[index].name === name) { + if (this.lights[index].name === name2) { return this.lights[index]; } } @@ -24578,40 +24966,40 @@ class Scene extends AbstractScene { } return null; } - getNodeByName(name) { - const mesh = this.getMeshByName(name); + getNodeByName(name2) { + const mesh = this.getMeshByName(name2); if (mesh) { return mesh; } - const transformNode = this.getTransformNodeByName(name); + const transformNode = this.getTransformNodeByName(name2); if (transformNode) { return transformNode; } - const light = this.getLightByName(name); + const light = this.getLightByName(name2); if (light) { return light; } - const camera = this.getCameraByName(name); + const camera = this.getCameraByName(name2); if (camera) { return camera; } - const bone = this.getBoneByName(name); + const bone = this.getBoneByName(name2); if (bone) { return bone; } return null; } - getMeshByName(name) { + getMeshByName(name2) { for (let index = 0;index < this.meshes.length; index++) { - if (this.meshes[index].name === name) { + if (this.meshes[index].name === name2) { return this.meshes[index]; } } return null; } - getTransformNodeByName(name) { + getTransformNodeByName(name2) { for (let index = 0;index < this.transformNodes.length; index++) { - if (this.transformNodes[index].name === name) { + if (this.transformNodes[index].name === name2) { return this.transformNodes[index]; } } @@ -24641,9 +25029,9 @@ class Scene extends AbstractScene { } return null; } - getSkeletonByName(name) { + getSkeletonByName(name2) { for (let index = 0;index < this.skeletons.length; index++) { - if (this.skeletons[index].name === name) { + if (this.skeletons[index].name === name2) { return this.skeletons[index]; } } @@ -24669,22 +25057,22 @@ class Scene extends AbstractScene { } return null; } - getMorphTargetByName(name) { + getMorphTargetByName(name2) { for (let managerIndex = 0;managerIndex < this.morphTargetManagers.length; ++managerIndex) { const morphTargetManager = this.morphTargetManagers[managerIndex]; for (let index = 0;index < morphTargetManager.numTargets; ++index) { const target = morphTargetManager.getTarget(index); - if (target.name === name) { + if (target.name === name2) { return target; } } } return null; } - getPostProcessByName(name) { + getPostProcessByName(name2) { for (let postProcessIndex = 0;postProcessIndex < this.postProcesses.length; ++postProcessIndex) { const postProcess = this.postProcesses[postProcessIndex]; - if (postProcess.name === name) { + if (postProcess.name === name2) { return postProcess; } } @@ -25826,32 +26214,69 @@ class Scene extends AbstractScene { return this.getLastSkeletonById(id); } } -Scene.FOGMODE_NONE = 0; -Scene.FOGMODE_EXP = 1; -Scene.FOGMODE_EXP2 = 2; -Scene.FOGMODE_LINEAR = 3; -Scene.MinDeltaTime = 1; -Scene.MaxDeltaTime = 1000; +var ScenePerformancePriority; +var init_scene = __esm(() => { + init_tools(); + init_precisionDate(); + init_observable(); + init_smartArray(); + init_stringDictionary(); + init_tags(); + init_math_vector(); + init_abstractScene(); + init_imageProcessingConfiguration(); + init_uniformBuffer(); + init_pickingInfo(); + init_actionEvent(); + init_postProcessManager(); + init_renderingManager(); + init_sceneComponent(); + init_domManagement(); + init_engineStore(); + init_devTools(); + init_scene_inputManager(); + init_perfCounter(); + init_math_color(); + init_math_frustum(); + init_uniqueIdGenerator(); + init_fileTools(); + init_lightConstants(); + init_arrayTools(); + init_pointerPickingConfiguration(); + init_logger(); + (function(ScenePerformancePriority2) { + ScenePerformancePriority2[ScenePerformancePriority2["BackwardCompatible"] = 0] = "BackwardCompatible"; + ScenePerformancePriority2[ScenePerformancePriority2["Intermediate"] = 1] = "Intermediate"; + ScenePerformancePriority2[ScenePerformancePriority2["Aggressive"] = 2] = "Aggressive"; + })(ScenePerformancePriority || (ScenePerformancePriority = {})); + Scene.FOGMODE_NONE = 0; + Scene.FOGMODE_EXP = 1; + Scene.FOGMODE_EXP2 = 2; + Scene.FOGMODE_LINEAR = 3; + Scene.MinDeltaTime = 1; + Scene.MaxDeltaTime = 1000; +}); // node_modules/@babylonjs/core/Maths/math.axis.js -var Space; -(function(Space2) { - Space2[Space2["LOCAL"] = 0] = "LOCAL"; - Space2[Space2["WORLD"] = 1] = "WORLD"; - Space2[Space2["BONE"] = 2] = "BONE"; -})(Space || (Space = {})); - class Axis { } -Axis.X = new Vector3(1, 0, 0); -Axis.Y = new Vector3(0, 1, 0); -Axis.Z = new Vector3(0, 0, 1); -var Coordinate; -(function(Coordinate2) { - Coordinate2[Coordinate2["X"] = 0] = "X"; - Coordinate2[Coordinate2["Y"] = 1] = "Y"; - Coordinate2[Coordinate2["Z"] = 2] = "Z"; -})(Coordinate || (Coordinate = {})); +var Space, Coordinate; +var init_math_axis = __esm(() => { + init_math_vector(); + (function(Space2) { + Space2[Space2["LOCAL"] = 0] = "LOCAL"; + Space2[Space2["WORLD"] = 1] = "WORLD"; + Space2[Space2["BONE"] = 2] = "BONE"; + })(Space || (Space = {})); + Axis.X = new Vector3(1, 0, 0); + Axis.Y = new Vector3(0, 1, 0); + Axis.Z = new Vector3(0, 0, 1); + (function(Coordinate2) { + Coordinate2[Coordinate2["X"] = 0] = "X"; + Coordinate2[Coordinate2["Y"] = 1] = "Y"; + Coordinate2[Coordinate2["Z"] = 2] = "Z"; + })(Coordinate || (Coordinate = {})); +}); // node_modules/@babylonjs/core/Bones/bone.js class Bone extends Node2 { @@ -25867,10 +26292,10 @@ class Bone extends Node2 { this._localMatrix.copyFrom(value); this._markAsDirtyAndDecompose(); } - constructor(name, skeleton, parentBone = null, localMatrix = null, restMatrix = null, bindMatrix = null, index = null) { + constructor(name2, skeleton, parentBone = null, localMatrix = null, restMatrix = null, bindMatrix = null, index = null) { var _a; - super(name, skeleton.getScene()); - this.name = name; + super(name2, skeleton.getScene()); + this.name = name2; this.children = []; this.animations = []; this._index = null; @@ -26488,9 +26913,15 @@ class Bone extends Node2 { this.setRestMatrix(this.getLocalMatrix()); } } -Bone._TmpVecs = ArrayTools.BuildArray(2, Vector3.Zero); -Bone._TmpQuat = Quaternion.Identity(); -Bone._TmpMats = ArrayTools.BuildArray(5, Matrix.Identity); +var init_bone = __esm(() => { + init_math_vector(); + init_arrayTools(); + init_node(); + init_math_axis(); + Bone._TmpVecs = ArrayTools.BuildArray(2, Vector3.Zero); + Bone._TmpQuat = Quaternion.Identity(); + Bone._TmpMats = ArrayTools.BuildArray(5, Matrix.Identity); +}); // node_modules/@babylonjs/core/Animations/animatable.js class Animatable { @@ -26754,426 +27185,461 @@ class Animatable { return running; } } -Scene.prototype._animate = function() { - if (!this.animationsEnabled) { - return; - } - const now = PrecisionDate.Now; - if (!this._animationTimeLast) { - if (this._pendingData.length > 0) { +var init_animatable = __esm(() => { + init_animation(); + init_runtimeAnimation(); + init_observable(); + init_scene(); + init_math_vector(); + init_precisionDate(); + init_bone(); + Scene.prototype._animate = function() { + if (!this.animationsEnabled) { return; } + const now = PrecisionDate.Now; + if (!this._animationTimeLast) { + if (this._pendingData.length > 0) { + return; + } + this._animationTimeLast = now; + } + this.deltaTime = this.useConstantAnimationDeltaTime ? 16 : (now - this._animationTimeLast) * this.animationTimeScale; this._animationTimeLast = now; - } - this.deltaTime = this.useConstantAnimationDeltaTime ? 16 : (now - this._animationTimeLast) * this.animationTimeScale; - this._animationTimeLast = now; - const animatables = this._activeAnimatables; - if (animatables.length === 0) { - return; - } - this._animationTime += this.deltaTime; - const animationTime = this._animationTime; - for (let index = 0;index < animatables.length; index++) { - const animatable = animatables[index]; - if (!animatable._animate(animationTime) && animatable.disposeOnEnd) { - index--; + const animatables = this._activeAnimatables; + if (animatables.length === 0) { + return; } - } - this._processLateAnimationBindings(); -}; -Scene.prototype.sortActiveAnimatables = function() { - this._activeAnimatables.sort((a, b) => { - return a.playOrder - b.playOrder; - }); -}; -Scene.prototype.beginWeightedAnimation = function(target, from, to, weight = 1, loop, speedRatio = 1, onAnimationEnd, animatable, targetMask, onAnimationLoop, isAdditive = false) { - const returnedAnimatable = this.beginAnimation(target, from, to, loop, speedRatio, onAnimationEnd, animatable, false, targetMask, onAnimationLoop, isAdditive); - returnedAnimatable.weight = weight; - return returnedAnimatable; -}; -Scene.prototype.beginAnimation = function(target, from, to, loop, speedRatio = 1, onAnimationEnd, animatable, stopCurrent = true, targetMask, onAnimationLoop, isAdditive = false) { - if (from > to && speedRatio > 0) { - speedRatio *= -1; - } - if (stopCurrent) { - this.stopAnimation(target, undefined, targetMask); - } - if (!animatable) { - animatable = new Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd, undefined, onAnimationLoop, isAdditive); - } - const shouldRunTargetAnimations = targetMask ? targetMask(target) : true; - if (target.animations && shouldRunTargetAnimations) { - animatable.appendAnimations(target, target.animations); - } - if (target.getAnimatables) { - const animatables = target.getAnimatables(); + this._animationTime += this.deltaTime; + const animationTime = this._animationTime; for (let index = 0;index < animatables.length; index++) { - this.beginAnimation(animatables[index], from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, onAnimationLoop); + const animatable = animatables[index]; + if (!animatable._animate(animationTime) && animatable.disposeOnEnd) { + index--; + } } - } - animatable.reset(); - return animatable; -}; -Scene.prototype.beginHierarchyAnimation = function(target, directDescendantsOnly, from, to, loop, speedRatio = 1, onAnimationEnd, animatable, stopCurrent = true, targetMask, onAnimationLoop, isAdditive = false) { - const children = target.getDescendants(directDescendantsOnly); - const result = []; - result.push(this.beginAnimation(target, from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, undefined, isAdditive)); - for (const child of children) { - result.push(this.beginAnimation(child, from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, undefined, isAdditive)); - } - return result; -}; -Scene.prototype.beginDirectAnimation = function(target, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive = false) { - if (speedRatio === undefined) { - speedRatio = 1; - } - if (from > to && speedRatio > 0) { - speedRatio *= -1; - } else if (to > from && speedRatio < 0) { - const temp = to; - to = from; - from = temp; - } - const animatable = new Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd, animations, onAnimationLoop, isAdditive); - return animatable; -}; -Scene.prototype.beginDirectHierarchyAnimation = function(target, directDescendantsOnly, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive = false) { - const children = target.getDescendants(directDescendantsOnly); - const result = []; - result.push(this.beginDirectAnimation(target, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive)); - for (const child of children) { - result.push(this.beginDirectAnimation(child, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive)); - } - return result; -}; -Scene.prototype.getAnimatableByTarget = function(target) { - for (let index = 0;index < this._activeAnimatables.length; index++) { - if (this._activeAnimatables[index].target === target) { - return this._activeAnimatables[index]; + this._processLateAnimationBindings(); + }; + Scene.prototype.sortActiveAnimatables = function() { + this._activeAnimatables.sort((a, b) => { + return a.playOrder - b.playOrder; + }); + }; + Scene.prototype.beginWeightedAnimation = function(target, from, to, weight = 1, loop, speedRatio = 1, onAnimationEnd, animatable, targetMask, onAnimationLoop, isAdditive = false) { + const returnedAnimatable = this.beginAnimation(target, from, to, loop, speedRatio, onAnimationEnd, animatable, false, targetMask, onAnimationLoop, isAdditive); + returnedAnimatable.weight = weight; + return returnedAnimatable; + }; + Scene.prototype.beginAnimation = function(target, from, to, loop, speedRatio = 1, onAnimationEnd, animatable, stopCurrent = true, targetMask, onAnimationLoop, isAdditive = false) { + if (from > to && speedRatio > 0) { + speedRatio *= -1; } - } - return null; -}; -Scene.prototype.getAllAnimatablesByTarget = function(target) { - const result = []; - for (let index = 0;index < this._activeAnimatables.length; index++) { - if (this._activeAnimatables[index].target === target) { - result.push(this._activeAnimatables[index]); + if (stopCurrent) { + this.stopAnimation(target, undefined, targetMask); } - } - return result; -}; -Scene.prototype.stopAnimation = function(target, animationName, targetMask) { - const animatables = this.getAllAnimatablesByTarget(target); - for (const animatable of animatables) { - animatable.stop(animationName, targetMask); - } -}; -Scene.prototype.stopAllAnimations = function() { - if (this._activeAnimatables) { - for (let i = 0;i < this._activeAnimatables.length; i++) { - this._activeAnimatables[i].stop(undefined, undefined, true); + if (!animatable) { + animatable = new Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd, undefined, onAnimationLoop, isAdditive); } - this._activeAnimatables.length = 0; - } - for (const group of this.animationGroups) { - group.stop(); - } -}; -Scene.prototype._registerTargetForLateAnimationBinding = function(runtimeAnimation2, originalValue) { - const target = runtimeAnimation2.target; - this._registeredForLateAnimationBindings.pushNoDuplicate(target); - if (!target._lateAnimationHolders) { - target._lateAnimationHolders = {}; - } - if (!target._lateAnimationHolders[runtimeAnimation2.targetPath]) { - target._lateAnimationHolders[runtimeAnimation2.targetPath] = { - totalWeight: 0, - totalAdditiveWeight: 0, - animations: [], - additiveAnimations: [], - originalValue - }; - } - if (runtimeAnimation2.isAdditive) { - target._lateAnimationHolders[runtimeAnimation2.targetPath].additiveAnimations.push(runtimeAnimation2); - target._lateAnimationHolders[runtimeAnimation2.targetPath].totalAdditiveWeight += runtimeAnimation2.weight; - } else { - target._lateAnimationHolders[runtimeAnimation2.targetPath].animations.push(runtimeAnimation2); - target._lateAnimationHolders[runtimeAnimation2.targetPath].totalWeight += runtimeAnimation2.weight; - } -}; -Scene.prototype._processLateAnimationBindingsForMatrices = function(holder) { - if (holder.totalWeight === 0 && holder.totalAdditiveWeight === 0) { - return holder.originalValue; - } - let normalizer = 1; - const finalPosition = TmpVectors.Vector3[0]; - const finalScaling = TmpVectors.Vector3[1]; - const finalQuaternion = TmpVectors.Quaternion[0]; - let startIndex = 0; - const originalAnimation = holder.animations[0]; - const originalValue = holder.originalValue; - let scale = 1; - let skipOverride = false; - if (holder.totalWeight < 1) { - scale = 1 - holder.totalWeight; - originalValue.decompose(finalScaling, finalQuaternion, finalPosition); - } else { - startIndex = 1; - normalizer = holder.totalWeight; - scale = originalAnimation.weight / normalizer; - if (scale == 1) { - if (holder.totalAdditiveWeight) { - skipOverride = true; - } else { - return originalAnimation.currentValue; + const shouldRunTargetAnimations = targetMask ? targetMask(target) : true; + if (target.animations && shouldRunTargetAnimations) { + animatable.appendAnimations(target, target.animations); + } + if (target.getAnimatables) { + const animatables = target.getAnimatables(); + for (let index = 0;index < animatables.length; index++) { + this.beginAnimation(animatables[index], from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, onAnimationLoop); } } - originalAnimation.currentValue.decompose(finalScaling, finalQuaternion, finalPosition); - } - if (!skipOverride) { - finalScaling.scaleInPlace(scale); - finalPosition.scaleInPlace(scale); - finalQuaternion.scaleInPlace(scale); - for (let animIndex = startIndex;animIndex < holder.animations.length; animIndex++) { - const runtimeAnimation2 = holder.animations[animIndex]; - if (runtimeAnimation2.weight === 0) { - continue; + animatable.reset(); + return animatable; + }; + Scene.prototype.beginHierarchyAnimation = function(target, directDescendantsOnly, from, to, loop, speedRatio = 1, onAnimationEnd, animatable, stopCurrent = true, targetMask, onAnimationLoop, isAdditive = false) { + const children = target.getDescendants(directDescendantsOnly); + const result = []; + result.push(this.beginAnimation(target, from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, undefined, isAdditive)); + for (const child of children) { + result.push(this.beginAnimation(child, from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, undefined, isAdditive)); + } + return result; + }; + Scene.prototype.beginDirectAnimation = function(target, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive = false) { + if (speedRatio === undefined) { + speedRatio = 1; + } + if (from > to && speedRatio > 0) { + speedRatio *= -1; + } else if (to > from && speedRatio < 0) { + const temp = to; + to = from; + from = temp; + } + const animatable = new Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd, animations, onAnimationLoop, isAdditive); + return animatable; + }; + Scene.prototype.beginDirectHierarchyAnimation = function(target, directDescendantsOnly, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive = false) { + const children = target.getDescendants(directDescendantsOnly); + const result = []; + result.push(this.beginDirectAnimation(target, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive)); + for (const child of children) { + result.push(this.beginDirectAnimation(child, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive)); + } + return result; + }; + Scene.prototype.getAnimatableByTarget = function(target) { + for (let index = 0;index < this._activeAnimatables.length; index++) { + if (this._activeAnimatables[index].target === target) { + return this._activeAnimatables[index]; } - scale = runtimeAnimation2.weight / normalizer; - const currentPosition = TmpVectors.Vector3[2]; - const currentScaling = TmpVectors.Vector3[3]; - const currentQuaternion = TmpVectors.Quaternion[1]; - runtimeAnimation2.currentValue.decompose(currentScaling, currentQuaternion, currentPosition); - currentScaling.scaleAndAddToRef(scale, finalScaling); - currentQuaternion.scaleAndAddToRef(Quaternion.Dot(finalQuaternion, currentQuaternion) > 0 ? scale : -scale, finalQuaternion); - currentPosition.scaleAndAddToRef(scale, finalPosition); } - finalQuaternion.normalize(); - } - for (let animIndex = 0;animIndex < holder.additiveAnimations.length; animIndex++) { - const runtimeAnimation2 = holder.additiveAnimations[animIndex]; - if (runtimeAnimation2.weight === 0) { - continue; + return null; + }; + Scene.prototype.getAllAnimatablesByTarget = function(target) { + const result = []; + for (let index = 0;index < this._activeAnimatables.length; index++) { + if (this._activeAnimatables[index].target === target) { + result.push(this._activeAnimatables[index]); + } + } + return result; + }; + Scene.prototype.stopAnimation = function(target, animationName, targetMask) { + const animatables = this.getAllAnimatablesByTarget(target); + for (const animatable of animatables) { + animatable.stop(animationName, targetMask); + } + }; + Scene.prototype.stopAllAnimations = function() { + if (this._activeAnimatables) { + for (let i = 0;i < this._activeAnimatables.length; i++) { + this._activeAnimatables[i].stop(undefined, undefined, true); + } + this._activeAnimatables.length = 0; + } + for (const group of this.animationGroups) { + group.stop(); + } + }; + Scene.prototype._registerTargetForLateAnimationBinding = function(runtimeAnimation2, originalValue) { + const target = runtimeAnimation2.target; + this._registeredForLateAnimationBindings.pushNoDuplicate(target); + if (!target._lateAnimationHolders) { + target._lateAnimationHolders = {}; + } + if (!target._lateAnimationHolders[runtimeAnimation2.targetPath]) { + target._lateAnimationHolders[runtimeAnimation2.targetPath] = { + totalWeight: 0, + totalAdditiveWeight: 0, + animations: [], + additiveAnimations: [], + originalValue + }; + } + if (runtimeAnimation2.isAdditive) { + target._lateAnimationHolders[runtimeAnimation2.targetPath].additiveAnimations.push(runtimeAnimation2); + target._lateAnimationHolders[runtimeAnimation2.targetPath].totalAdditiveWeight += runtimeAnimation2.weight; + } else { + target._lateAnimationHolders[runtimeAnimation2.targetPath].animations.push(runtimeAnimation2); + target._lateAnimationHolders[runtimeAnimation2.targetPath].totalWeight += runtimeAnimation2.weight; + } + }; + Scene.prototype._processLateAnimationBindingsForMatrices = function(holder) { + if (holder.totalWeight === 0 && holder.totalAdditiveWeight === 0) { + return holder.originalValue; } - const currentPosition = TmpVectors.Vector3[2]; - const currentScaling = TmpVectors.Vector3[3]; - const currentQuaternion = TmpVectors.Quaternion[1]; - runtimeAnimation2.currentValue.decompose(currentScaling, currentQuaternion, currentPosition); - currentScaling.multiplyToRef(finalScaling, currentScaling); - Vector3.LerpToRef(finalScaling, currentScaling, runtimeAnimation2.weight, finalScaling); - finalQuaternion.multiplyToRef(currentQuaternion, currentQuaternion); - Quaternion.SlerpToRef(finalQuaternion, currentQuaternion, runtimeAnimation2.weight, finalQuaternion); - currentPosition.scaleAndAddToRef(runtimeAnimation2.weight, finalPosition); - } - const workValue = originalAnimation ? originalAnimation._animationState.workValue : TmpVectors.Matrix[0].clone(); - Matrix.ComposeToRef(finalScaling, finalQuaternion, finalPosition, workValue); - return workValue; -}; -Scene.prototype._processLateAnimationBindingsForQuaternions = function(holder, refQuaternion) { - if (holder.totalWeight === 0 && holder.totalAdditiveWeight === 0) { - return refQuaternion; - } - const originalAnimation = holder.animations[0]; - const originalValue = holder.originalValue; - let cumulativeQuaternion = refQuaternion; - if (holder.totalWeight === 0 && holder.totalAdditiveWeight > 0) { - cumulativeQuaternion.copyFrom(originalValue); - } else if (holder.animations.length === 1) { - Quaternion.SlerpToRef(originalValue, originalAnimation.currentValue, Math.min(1, holder.totalWeight), cumulativeQuaternion); - if (holder.totalAdditiveWeight === 0) { - return cumulativeQuaternion; - } - } else if (holder.animations.length > 1) { let normalizer = 1; - let quaternions; - let weights; + const finalPosition = TmpVectors.Vector3[0]; + const finalScaling = TmpVectors.Vector3[1]; + const finalQuaternion = TmpVectors.Quaternion[0]; + let startIndex = 0; + const originalAnimation = holder.animations[0]; + const originalValue = holder.originalValue; + let scale = 1; + let skipOverride = false; if (holder.totalWeight < 1) { - const scale = 1 - holder.totalWeight; - quaternions = []; - weights = []; - quaternions.push(originalValue); - weights.push(scale); + scale = 1 - holder.totalWeight; + originalValue.decompose(finalScaling, finalQuaternion, finalPosition); } else { - if (holder.animations.length === 2) { - Quaternion.SlerpToRef(holder.animations[0].currentValue, holder.animations[1].currentValue, holder.animations[1].weight / holder.totalWeight, refQuaternion); - if (holder.totalAdditiveWeight === 0) { - return refQuaternion; + startIndex = 1; + normalizer = holder.totalWeight; + scale = originalAnimation.weight / normalizer; + if (scale == 1) { + if (holder.totalAdditiveWeight) { + skipOverride = true; + } else { + return originalAnimation.currentValue; } } - quaternions = []; - weights = []; - normalizer = holder.totalWeight; + originalAnimation.currentValue.decompose(finalScaling, finalQuaternion, finalPosition); } - for (let animIndex = 0;animIndex < holder.animations.length; animIndex++) { - const runtimeAnimation2 = holder.animations[animIndex]; - quaternions.push(runtimeAnimation2.currentValue); - weights.push(runtimeAnimation2.weight / normalizer); - } - let cumulativeAmount = 0; - for (let index = 0;index < quaternions.length; ) { - if (!index) { - Quaternion.SlerpToRef(quaternions[index], quaternions[index + 1], weights[index + 1] / (weights[index] + weights[index + 1]), refQuaternion); - cumulativeQuaternion = refQuaternion; - cumulativeAmount = weights[index] + weights[index + 1]; - index += 2; - continue; + if (!skipOverride) { + finalScaling.scaleInPlace(scale); + finalPosition.scaleInPlace(scale); + finalQuaternion.scaleInPlace(scale); + for (let animIndex = startIndex;animIndex < holder.animations.length; animIndex++) { + const runtimeAnimation2 = holder.animations[animIndex]; + if (runtimeAnimation2.weight === 0) { + continue; + } + scale = runtimeAnimation2.weight / normalizer; + const currentPosition = TmpVectors.Vector3[2]; + const currentScaling = TmpVectors.Vector3[3]; + const currentQuaternion = TmpVectors.Quaternion[1]; + runtimeAnimation2.currentValue.decompose(currentScaling, currentQuaternion, currentPosition); + currentScaling.scaleAndAddToRef(scale, finalScaling); + currentQuaternion.scaleAndAddToRef(Quaternion.Dot(finalQuaternion, currentQuaternion) > 0 ? scale : -scale, finalQuaternion); + currentPosition.scaleAndAddToRef(scale, finalPosition); } - cumulativeAmount += weights[index]; - Quaternion.SlerpToRef(cumulativeQuaternion, quaternions[index], weights[index] / cumulativeAmount, cumulativeQuaternion); - index++; + finalQuaternion.normalize(); } - } - for (let animIndex = 0;animIndex < holder.additiveAnimations.length; animIndex++) { - const runtimeAnimation2 = holder.additiveAnimations[animIndex]; - if (runtimeAnimation2.weight === 0) { - continue; + for (let animIndex = 0;animIndex < holder.additiveAnimations.length; animIndex++) { + const runtimeAnimation2 = holder.additiveAnimations[animIndex]; + if (runtimeAnimation2.weight === 0) { + continue; + } + const currentPosition = TmpVectors.Vector3[2]; + const currentScaling = TmpVectors.Vector3[3]; + const currentQuaternion = TmpVectors.Quaternion[1]; + runtimeAnimation2.currentValue.decompose(currentScaling, currentQuaternion, currentPosition); + currentScaling.multiplyToRef(finalScaling, currentScaling); + Vector3.LerpToRef(finalScaling, currentScaling, runtimeAnimation2.weight, finalScaling); + finalQuaternion.multiplyToRef(currentQuaternion, currentQuaternion); + Quaternion.SlerpToRef(finalQuaternion, currentQuaternion, runtimeAnimation2.weight, finalQuaternion); + currentPosition.scaleAndAddToRef(runtimeAnimation2.weight, finalPosition); + } + const workValue = originalAnimation ? originalAnimation._animationState.workValue : TmpVectors.Matrix[0].clone(); + Matrix.ComposeToRef(finalScaling, finalQuaternion, finalPosition, workValue); + return workValue; + }; + Scene.prototype._processLateAnimationBindingsForQuaternions = function(holder, refQuaternion) { + if (holder.totalWeight === 0 && holder.totalAdditiveWeight === 0) { + return refQuaternion; + } + const originalAnimation = holder.animations[0]; + const originalValue = holder.originalValue; + let cumulativeQuaternion = refQuaternion; + if (holder.totalWeight === 0 && holder.totalAdditiveWeight > 0) { + cumulativeQuaternion.copyFrom(originalValue); + } else if (holder.animations.length === 1) { + Quaternion.SlerpToRef(originalValue, originalAnimation.currentValue, Math.min(1, holder.totalWeight), cumulativeQuaternion); + if (holder.totalAdditiveWeight === 0) { + return cumulativeQuaternion; + } + } else if (holder.animations.length > 1) { + let normalizer = 1; + let quaternions; + let weights; + if (holder.totalWeight < 1) { + const scale = 1 - holder.totalWeight; + quaternions = []; + weights = []; + quaternions.push(originalValue); + weights.push(scale); + } else { + if (holder.animations.length === 2) { + Quaternion.SlerpToRef(holder.animations[0].currentValue, holder.animations[1].currentValue, holder.animations[1].weight / holder.totalWeight, refQuaternion); + if (holder.totalAdditiveWeight === 0) { + return refQuaternion; + } + } + quaternions = []; + weights = []; + normalizer = holder.totalWeight; + } + for (let animIndex = 0;animIndex < holder.animations.length; animIndex++) { + const runtimeAnimation2 = holder.animations[animIndex]; + quaternions.push(runtimeAnimation2.currentValue); + weights.push(runtimeAnimation2.weight / normalizer); + } + let cumulativeAmount = 0; + for (let index = 0;index < quaternions.length; ) { + if (!index) { + Quaternion.SlerpToRef(quaternions[index], quaternions[index + 1], weights[index + 1] / (weights[index] + weights[index + 1]), refQuaternion); + cumulativeQuaternion = refQuaternion; + cumulativeAmount = weights[index] + weights[index + 1]; + index += 2; + continue; + } + cumulativeAmount += weights[index]; + Quaternion.SlerpToRef(cumulativeQuaternion, quaternions[index], weights[index] / cumulativeAmount, cumulativeQuaternion); + index++; + } } - cumulativeQuaternion.multiplyToRef(runtimeAnimation2.currentValue, TmpVectors.Quaternion[0]); - Quaternion.SlerpToRef(cumulativeQuaternion, TmpVectors.Quaternion[0], runtimeAnimation2.weight, cumulativeQuaternion); - } - return cumulativeQuaternion; -}; -Scene.prototype._processLateAnimationBindings = function() { - if (!this._registeredForLateAnimationBindings.length) { - return; - } - for (let index = 0;index < this._registeredForLateAnimationBindings.length; index++) { - const target = this._registeredForLateAnimationBindings.data[index]; - for (const path in target._lateAnimationHolders) { - const holder = target._lateAnimationHolders[path]; - const originalAnimation = holder.animations[0]; - const originalValue = holder.originalValue; - if (originalValue === undefined || originalValue === null) { + for (let animIndex = 0;animIndex < holder.additiveAnimations.length; animIndex++) { + const runtimeAnimation2 = holder.additiveAnimations[animIndex]; + if (runtimeAnimation2.weight === 0) { continue; } - const matrixDecomposeMode = Animation.AllowMatrixDecomposeForInterpolation && originalValue.m; - let finalValue = target[path]; - if (matrixDecomposeMode) { - finalValue = this._processLateAnimationBindingsForMatrices(holder); - } else { - const quaternionMode = originalValue.w !== undefined; - if (quaternionMode) { - finalValue = this._processLateAnimationBindingsForQuaternions(holder, finalValue || Quaternion.Identity()); - } else { - let startIndex = 0; - let normalizer = 1; - const originalAnimationIsLoopRelativeFromCurrent = originalAnimation && originalAnimation._animationState.loopMode === Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT; - if (holder.totalWeight < 1) { - if (originalAnimationIsLoopRelativeFromCurrent) { - finalValue = originalValue.clone ? originalValue.clone() : originalValue; - } else if (originalAnimation && originalValue.scale) { - finalValue = originalValue.scale(1 - holder.totalWeight); + cumulativeQuaternion.multiplyToRef(runtimeAnimation2.currentValue, TmpVectors.Quaternion[0]); + Quaternion.SlerpToRef(cumulativeQuaternion, TmpVectors.Quaternion[0], runtimeAnimation2.weight, cumulativeQuaternion); + } + return cumulativeQuaternion; + }; + Scene.prototype._processLateAnimationBindings = function() { + if (!this._registeredForLateAnimationBindings.length) { + return; + } + for (let index = 0;index < this._registeredForLateAnimationBindings.length; index++) { + const target = this._registeredForLateAnimationBindings.data[index]; + for (const path in target._lateAnimationHolders) { + const holder = target._lateAnimationHolders[path]; + const originalAnimation = holder.animations[0]; + const originalValue = holder.originalValue; + if (originalValue === undefined || originalValue === null) { + continue; + } + const matrixDecomposeMode = Animation.AllowMatrixDecomposeForInterpolation && originalValue.m; + let finalValue = target[path]; + if (matrixDecomposeMode) { + finalValue = this._processLateAnimationBindingsForMatrices(holder); + } else { + const quaternionMode = originalValue.w !== undefined; + if (quaternionMode) { + finalValue = this._processLateAnimationBindingsForQuaternions(holder, finalValue || Quaternion.Identity()); + } else { + let startIndex = 0; + let normalizer = 1; + const originalAnimationIsLoopRelativeFromCurrent = originalAnimation && originalAnimation._animationState.loopMode === Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT; + if (holder.totalWeight < 1) { + if (originalAnimationIsLoopRelativeFromCurrent) { + finalValue = originalValue.clone ? originalValue.clone() : originalValue; + } else if (originalAnimation && originalValue.scale) { + finalValue = originalValue.scale(1 - holder.totalWeight); + } else if (originalAnimation) { + finalValue = originalValue * (1 - holder.totalWeight); + } else if (originalValue.clone) { + finalValue = originalValue.clone(); + } else { + finalValue = originalValue; + } } else if (originalAnimation) { - finalValue = originalValue * (1 - holder.totalWeight); - } else if (originalValue.clone) { - finalValue = originalValue.clone(); - } else { - finalValue = originalValue; - } - } else if (originalAnimation) { - normalizer = holder.totalWeight; - const scale = originalAnimation.weight / normalizer; - if (scale !== 1) { - if (originalAnimation.currentValue.scale) { - finalValue = originalAnimation.currentValue.scale(scale); + normalizer = holder.totalWeight; + const scale = originalAnimation.weight / normalizer; + if (scale !== 1) { + if (originalAnimation.currentValue.scale) { + finalValue = originalAnimation.currentValue.scale(scale); + } else { + finalValue = originalAnimation.currentValue * scale; + } } else { - finalValue = originalAnimation.currentValue * scale; + finalValue = originalAnimation.currentValue; } - } else { - finalValue = originalAnimation.currentValue; + if (originalAnimationIsLoopRelativeFromCurrent) { + if (finalValue.addToRef) { + finalValue.addToRef(originalValue, finalValue); + } else { + finalValue += originalValue; + } + } + startIndex = 1; } - if (originalAnimationIsLoopRelativeFromCurrent) { - if (finalValue.addToRef) { - finalValue.addToRef(originalValue, finalValue); + for (let animIndex = startIndex;animIndex < holder.animations.length; animIndex++) { + const runtimeAnimation2 = holder.animations[animIndex]; + const scale = runtimeAnimation2.weight / normalizer; + if (!scale) { + continue; + } else if (runtimeAnimation2.currentValue.scaleAndAddToRef) { + runtimeAnimation2.currentValue.scaleAndAddToRef(scale, finalValue); } else { - finalValue += originalValue; + finalValue += runtimeAnimation2.currentValue * scale; } } - startIndex = 1; - } - for (let animIndex = startIndex;animIndex < holder.animations.length; animIndex++) { - const runtimeAnimation2 = holder.animations[animIndex]; - const scale = runtimeAnimation2.weight / normalizer; - if (!scale) { - continue; - } else if (runtimeAnimation2.currentValue.scaleAndAddToRef) { - runtimeAnimation2.currentValue.scaleAndAddToRef(scale, finalValue); - } else { - finalValue += runtimeAnimation2.currentValue * scale; - } - } - for (let animIndex = 0;animIndex < holder.additiveAnimations.length; animIndex++) { - const runtimeAnimation2 = holder.additiveAnimations[animIndex]; - const scale = runtimeAnimation2.weight; - if (!scale) { - continue; - } else if (runtimeAnimation2.currentValue.scaleAndAddToRef) { - runtimeAnimation2.currentValue.scaleAndAddToRef(scale, finalValue); - } else { - finalValue += runtimeAnimation2.currentValue * scale; + for (let animIndex = 0;animIndex < holder.additiveAnimations.length; animIndex++) { + const runtimeAnimation2 = holder.additiveAnimations[animIndex]; + const scale = runtimeAnimation2.weight; + if (!scale) { + continue; + } else if (runtimeAnimation2.currentValue.scaleAndAddToRef) { + runtimeAnimation2.currentValue.scaleAndAddToRef(scale, finalValue); + } else { + finalValue += runtimeAnimation2.currentValue * scale; + } } } } + target[path] = finalValue; } - target[path] = finalValue; + target._lateAnimationHolders = {}; } - target._lateAnimationHolders = {}; - } - this._registeredForLateAnimationBindings.reset(); -}; -Bone.prototype.copyAnimationRange = function(source, rangeName, frameOffset, rescaleAsRequired = false, skelDimensionsRatio = null) { - if (this.animations.length === 0) { - this.animations.push(new Animation(this.name, "_matrix", source.animations[0].framePerSecond, Animation.ANIMATIONTYPE_MATRIX, 0)); - this.animations[0].setKeys([]); - } - const sourceRange = source.animations[0].getRange(rangeName); - if (!sourceRange) { - return false; - } - const from = sourceRange.from; - const to = sourceRange.to; - const sourceKeys = source.animations[0].getKeys(); - const sourceBoneLength = source.length; - const sourceParent = source.getParent(); - const parent = this.getParent(); - const parentScalingReqd = rescaleAsRequired && sourceParent && sourceBoneLength && this.length && sourceBoneLength !== this.length; - const parentRatio = parentScalingReqd && parent && sourceParent ? parent.length / sourceParent.length : 1; - const dimensionsScalingReqd = rescaleAsRequired && !parent && skelDimensionsRatio && (skelDimensionsRatio.x !== 1 || skelDimensionsRatio.y !== 1 || skelDimensionsRatio.z !== 1); - const destKeys = this.animations[0].getKeys(); - let orig; - let origTranslation; - let mat; - for (let key = 0, nKeys = sourceKeys.length;key < nKeys; key++) { - orig = sourceKeys[key]; - if (orig.frame >= from && orig.frame <= to) { - if (rescaleAsRequired) { - mat = orig.value.clone(); - if (parentScalingReqd) { - origTranslation = mat.getTranslation(); - mat.setTranslation(origTranslation.scaleInPlace(parentRatio)); - } else if (dimensionsScalingReqd && skelDimensionsRatio) { - origTranslation = mat.getTranslation(); - mat.setTranslation(origTranslation.multiplyInPlace(skelDimensionsRatio)); + this._registeredForLateAnimationBindings.reset(); + }; + Bone.prototype.copyAnimationRange = function(source, rangeName, frameOffset, rescaleAsRequired = false, skelDimensionsRatio = null) { + if (this.animations.length === 0) { + this.animations.push(new Animation(this.name, "_matrix", source.animations[0].framePerSecond, Animation.ANIMATIONTYPE_MATRIX, 0)); + this.animations[0].setKeys([]); + } + const sourceRange = source.animations[0].getRange(rangeName); + if (!sourceRange) { + return false; + } + const from = sourceRange.from; + const to = sourceRange.to; + const sourceKeys = source.animations[0].getKeys(); + const sourceBoneLength = source.length; + const sourceParent = source.getParent(); + const parent = this.getParent(); + const parentScalingReqd = rescaleAsRequired && sourceParent && sourceBoneLength && this.length && sourceBoneLength !== this.length; + const parentRatio = parentScalingReqd && parent && sourceParent ? parent.length / sourceParent.length : 1; + const dimensionsScalingReqd = rescaleAsRequired && !parent && skelDimensionsRatio && (skelDimensionsRatio.x !== 1 || skelDimensionsRatio.y !== 1 || skelDimensionsRatio.z !== 1); + const destKeys = this.animations[0].getKeys(); + let orig; + let origTranslation; + let mat; + for (let key = 0, nKeys = sourceKeys.length;key < nKeys; key++) { + orig = sourceKeys[key]; + if (orig.frame >= from && orig.frame <= to) { + if (rescaleAsRequired) { + mat = orig.value.clone(); + if (parentScalingReqd) { + origTranslation = mat.getTranslation(); + mat.setTranslation(origTranslation.scaleInPlace(parentRatio)); + } else if (dimensionsScalingReqd && skelDimensionsRatio) { + origTranslation = mat.getTranslation(); + mat.setTranslation(origTranslation.multiplyInPlace(skelDimensionsRatio)); + } else { + mat = orig.value; + } } else { mat = orig.value; } - } else { - mat = orig.value; + destKeys.push({ frame: orig.frame + frameOffset, value: mat }); } - destKeys.push({ frame: orig.frame + frameOffset, value: mat }); } + this.animations[0].createRange(rangeName, from + frameOffset, to + frameOffset); + return true; + }; +}); + +// node_modules/@babylonjs/core/Animations/animationPropertiesOverride.js +class AnimationPropertiesOverride { + constructor() { + this.enableBlending = false; + this.blendingSpeed = 0.01; + this.loopMode = Animation.ANIMATIONLOOPMODE_CYCLE; } - this.animations[0].createRange(rangeName, from + frameOffset, to + frameOffset); - return true; -}; +} +var init_animationPropertiesOverride = __esm(() => { + init_animation(); +}); + // node_modules/@babylonjs/core/Maths/math.path.js -var Orientation; -(function(Orientation2) { - Orientation2[Orientation2["CW"] = 0] = "CW"; - Orientation2[Orientation2["CCW"] = 1] = "CCW"; -})(Orientation || (Orientation = {})); +class BezierCurve { + static Interpolate(t, x1, y1, x2, y2) { + const f0 = 1 - 3 * x2 + 3 * x1; + const f1 = 3 * x2 - 6 * x1; + const f2 = 3 * x1; + let refinedT = t; + for (let i = 0;i < 5; i++) { + const refinedT2 = refinedT * refinedT; + const refinedT3 = refinedT2 * refinedT; + const x = f0 * refinedT3 + f1 * refinedT2 + f2 * refinedT; + const slope = 1 / (3 * f0 * refinedT2 + 2 * f1 * refinedT + f2); + refinedT -= (x - t) * slope; + refinedT = Math.min(1, Math.max(0, refinedT)); + } + return 3 * Math.pow(1 - refinedT, 2) * refinedT * y1 + 3 * (1 - refinedT) * Math.pow(refinedT, 2) * y2 + Math.pow(refinedT, 3); + } +} + class Angle { constructor(radians) { this._radians = radians; @@ -27837,6 +28303,16 @@ class Curve3 { return l; } } +var Orientation; +var init_math_path = __esm(() => { + init_math_scalar(); + init_math_vector(); + init_math_constants(); + (function(Orientation2) { + Orientation2[Orientation2["CW"] = 0] = "CW"; + Orientation2[Orientation2["CCW"] = 1] = "CCW"; + })(Orientation || (Orientation = {})); +}); // node_modules/@babylonjs/core/Animations/easing.js class EasingFunction { @@ -27866,9 +28342,6 @@ class EasingFunction { return this.easeInCore(gradient * 2) * 0.5; } } -EasingFunction.EASINGMODE_EASEIN = 0; -EasingFunction.EASINGMODE_EASEOUT = 1; -EasingFunction.EASINGMODE_EASEINOUT = 2; class CircleEase extends EasingFunction { easeInCore(gradient) { @@ -27887,6 +28360,60 @@ class BackEase extends EasingFunction { return Math.pow(gradient, 3) - gradient * num * Math.sin(3.141592653589793 * gradient); } } + +class BounceEase extends EasingFunction { + constructor(bounces = 3, bounciness = 2) { + super(); + this.bounces = bounces; + this.bounciness = bounciness; + } + easeInCore(gradient) { + const y = Math.max(0, this.bounces); + let bounciness = this.bounciness; + if (bounciness <= 1) { + bounciness = 1.001; + } + const num9 = Math.pow(bounciness, y); + const num5 = 1 - bounciness; + const num4 = (1 - num9) / num5 + num9 * 0.5; + const num15 = gradient * num4; + const num65 = Math.log(-num15 * (1 - bounciness) + 1) / Math.log(bounciness); + const num3 = Math.floor(num65); + const num13 = num3 + 1; + const num8 = (1 - Math.pow(bounciness, num3)) / (num5 * num4); + const num12 = (1 - Math.pow(bounciness, num13)) / (num5 * num4); + const num7 = (num8 + num12) * 0.5; + const num6 = gradient - num7; + const num2 = num7 - num8; + return -Math.pow(1 / bounciness, y - num3) / (num2 * num2) * (num6 - num2) * (num6 + num2); + } +} + +class CubicEase extends EasingFunction { + easeInCore(gradient) { + return gradient * gradient * gradient; + } +} + +class ElasticEase extends EasingFunction { + constructor(oscillations = 3, springiness = 3) { + super(); + this.oscillations = oscillations; + this.springiness = springiness; + } + easeInCore(gradient) { + let num2; + const num3 = Math.max(0, this.oscillations); + const num = Math.max(0, this.springiness); + if (num == 0) { + num2 = gradient; + } else { + num2 = (Math.exp(num * gradient) - 1) / (Math.exp(num) - 1); + } + return num2 * Math.sin((6.283185307179586 * num3 + 1.5707963267948966) * gradient); + } +} + class ExponentialEase extends EasingFunction { constructor(exponent = 2) { super(); @@ -27899,16 +28426,61 @@ class ExponentialEase extends EasingFunction { return (Math.exp(this.exponent * gradient) - 1) / (Math.exp(this.exponent) - 1); } } + +class PowerEase extends EasingFunction { + constructor(power = 2) { + super(); + this.power = power; + } + easeInCore(gradient) { + const y = Math.max(0, this.power); + return Math.pow(gradient, y); + } +} + class QuadraticEase extends EasingFunction { easeInCore(gradient) { return gradient * gradient; } } + +class QuarticEase extends EasingFunction { + easeInCore(gradient) { + return gradient * gradient * gradient * gradient; + } +} + +class QuinticEase extends EasingFunction { + easeInCore(gradient) { + return gradient * gradient * gradient * gradient * gradient; + } +} + class SineEase extends EasingFunction { easeInCore(gradient) { return 1 - Math.sin(1.5707963267948966 * (1 - gradient)); } } + +class BezierCurveEase extends EasingFunction { + constructor(x1 = 0, y1 = 0, x2 = 1, y2 = 1) { + super(); + this.x1 = x1; + this.y1 = y1; + this.x2 = x2; + this.y2 = y2; + } + easeInCore(gradient) { + return BezierCurve.Interpolate(gradient, this.x1, this.y1, this.x2, this.y2); + } +} +var init_easing = __esm(() => { + init_math_path(); + EasingFunction.EASINGMODE_EASEIN = 0; + EasingFunction.EASINGMODE_EASEOUT = 1; + EasingFunction.EASINGMODE_EASEINOUT = 2; +}); + // node_modules/@babylonjs/core/Animations/animationEvent.js class AnimationEvent { constructor(frame, action7, onlyOnce) { @@ -27921,6 +28493,9 @@ class AnimationEvent { return new AnimationEvent(this.frame, this.action, this.onlyOnce); } } +var init_animationEvent = __esm(() => { +}); + // node_modules/@babylonjs/core/Animations/animationGroup.js class TargetedAnimation { getClassName() { @@ -28125,8 +28700,8 @@ class AnimationGroup { } return mergedAnimationGroup; } - constructor(name, scene2 = null, weight = -1, playOrder = 0) { - this.name = name; + constructor(name2, scene2 = null, weight = -1, playOrder = 0) { + this.name = name2; this._targetedAnimations = new Array; this._animatables = new Array; this._from = Number.MAX_VALUE; @@ -28517,15 +29092,15 @@ class AnimationGroup { } return animationGroup; } - static ClipKeys(sourceAnimationGroup, fromKey, toKey, name, dontCloneAnimations) { - const animationGroup = sourceAnimationGroup.clone(name || sourceAnimationGroup.name); + static ClipKeys(sourceAnimationGroup, fromKey, toKey, name2, dontCloneAnimations) { + const animationGroup = sourceAnimationGroup.clone(name2 || sourceAnimationGroup.name); return AnimationGroup.ClipKeysInPlace(animationGroup, fromKey, toKey, dontCloneAnimations); } static ClipKeysInPlace(animationGroup, fromKey, toKey, dontCloneAnimations) { return AnimationGroup.ClipInPlace(animationGroup, fromKey, toKey, dontCloneAnimations, false); } - static ClipFrames(sourceAnimationGroup, fromFrame, toFrame, name, dontCloneAnimations) { - const animationGroup = sourceAnimationGroup.clone(name || sourceAnimationGroup.name); + static ClipFrames(sourceAnimationGroup, fromFrame, toFrame, name2, dontCloneAnimations) { + const animationGroup = sourceAnimationGroup.clone(name2 || sourceAnimationGroup.name); return AnimationGroup.ClipFramesInPlace(animationGroup, fromFrame, toFrame, dontCloneAnimations); } static ClipFramesInPlace(animationGroup, fromFrame, toFrame, dontCloneAnimations) { @@ -28598,12 +29173,127 @@ class AnimationGroup { return ret; } } +var init_animationGroup = __esm(() => { + init_animation(); + init_observable(); + init_engineStore(); + init_tags(); +}); + +// node_modules/@babylonjs/core/Animations/animatable.interface.js +var init_animatable_interface = __esm(() => { +}); + +// node_modules/@babylonjs/core/Animations/pathCursor.js +class PathCursor { + constructor(_path) { + this._path = _path; + this._onchange = new Array; + this.value = 0; + this.animations = []; + } + getPoint() { + const point = this._path.getPointAtLengthPosition(this.value); + return new Vector3(point.x, 0, point.y); + } + moveAhead(step = 0.002) { + this.move(step); + return this; + } + moveBack(step = 0.002) { + this.move(-step); + return this; + } + move(step) { + if (Math.abs(step) > 1) { + throw "step size should be less than 1."; + } + this.value += step; + this._ensureLimits(); + this._raiseOnChange(); + return this; + } + _ensureLimits() { + while (this.value > 1) { + this.value -= 1; + } + while (this.value < 0) { + this.value += 1; + } + return this; + } + _raiseOnChange() { + this._onchange.forEach((f) => f(this)); + return this; + } + onchange(f) { + this._onchange.push(f); + return this; + } +} +var init_pathCursor = __esm(() => { + init_math_vector(); +}); + // node_modules/@babylonjs/core/Animations/animationGroupMask.js +class AnimationGroupMask { + constructor(names, mode = AnimationGroupMaskMode.Include) { + this.mode = mode; + this.disabled = false; + this._targetNames = new Set; + if (names) { + this.addTargetName(names); + } + } + addTargetName(name2) { + if (Array.isArray(name2)) { + for (const n of name2) { + this._targetNames.add(n); + } + return; + } + this._targetNames.add(name2); + } + removeTargetName(name2) { + if (Array.isArray(name2)) { + for (const n of name2) { + this._targetNames.delete(n); + } + return; + } + this._targetNames.delete(name2); + } + hasTarget(name2) { + return this._targetNames.has(name2); + } + retainsTarget(name2) { + return this._targetNames.has(name2) === (this.mode === AnimationGroupMaskMode.Include); + } +} var AnimationGroupMaskMode; -(function(AnimationGroupMaskMode2) { - AnimationGroupMaskMode2[AnimationGroupMaskMode2["Include"] = 0] = "Include"; - AnimationGroupMaskMode2[AnimationGroupMaskMode2["Exclude"] = 1] = "Exclude"; -})(AnimationGroupMaskMode || (AnimationGroupMaskMode = {})); +var init_animationGroupMask = __esm(() => { + (function(AnimationGroupMaskMode2) { + AnimationGroupMaskMode2[AnimationGroupMaskMode2["Include"] = 0] = "Include"; + AnimationGroupMaskMode2[AnimationGroupMaskMode2["Exclude"] = 1] = "Exclude"; + })(AnimationGroupMaskMode || (AnimationGroupMaskMode = {})); +}); + +// node_modules/@babylonjs/core/Animations/index.js +var init_Animations = __esm(() => { + init_animatable(); + init_animation(); + init_animationPropertiesOverride(); + init_easing(); + init_runtimeAnimation(); + init_animationEvent(); + init_animationGroup(); + init_animationKey(); + init_animationRange(); + init_animatable_interface(); + init_pathCursor(); + init_animationGroupMask(); +}); + // node_modules/@babylonjs/core/Misc/coroutine.js function inlineScheduler(coroutine, onStep, onError) { try { @@ -28681,6 +29371,13 @@ function makeSyncFunction(coroutineFactory, abortSignal) { return runCoroutineSync(coroutineFactory(...params), abortSignal); }; } +function makeAsyncFunction(coroutineFactory, scheduler, abortSignal) { + return (...params) => { + return runCoroutineAsync(coroutineFactory(...params), scheduler, abortSignal); + }; +} +var init_coroutine = __esm(() => { +}); // node_modules/@babylonjs/core/Maths/math.viewport.js class Viewport { @@ -28704,6 +29401,8 @@ class Viewport { return new Viewport(this.x, this.y, this.width, this.height); } } +var init_math_viewport = __esm(() => { +}); // node_modules/@babylonjs/core/Cameras/camera.js class Camera extends Node2 { @@ -28784,8 +29483,8 @@ class Camera extends Node2 { get mode() { return this._mode; } - constructor(name, position, scene2, setActiveOnSceneIfNoneActive = true) { - super(name, scene2); + constructor(name2, position, scene2, setActiveOnSceneIfNoneActive = true) { + super(name2, scene2); this._position = Vector3.Zero(); this._upVector = Vector3.Up(); this.oblique = null; @@ -28830,7 +29529,7 @@ class Camera extends Node2 { this.getScene().activeCamera = this; } this.position = position; - this.renderPassId = this.getScene().getEngine().createRenderPassId(`Camera ${name}`); + this.renderPassId = this.getScene().getEngine().createRenderPassId(`Camera ${name2}`); } storeState() { this._stateStored = true; @@ -29271,16 +29970,16 @@ class Camera extends Node2 { this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix, this._projectionMatrix); return this._projectionMatrix; } - setCameraRigParameter(name, value) { + setCameraRigParameter(name2, value) { if (!this._cameraRigParams) { this._cameraRigParams = {}; } - this._cameraRigParams[name] = value; - if (name === "interaxialDistance") { + this._cameraRigParams[name2] = value; + if (name2 === "interaxialDistance") { this._cameraRigParams.stereoHalfAngle = Tools.ToRadians(value / 0.0637); } } - createRigCamera(name, cameraIndex) { + createRigCamera(name2, cameraIndex) { return null; } _updateRigCameras() { @@ -29311,9 +30010,9 @@ class Camera extends Node2 { serializationObject.isEnabled = this.isEnabled(); return serializationObject; } - clone(name, newParent = null) { - const camera = SerializationHelper.Clone(Camera.GetConstructorFromName(this.getClassName(), name, this.getScene(), this.interaxialDistance, this.isStereoscopicSideBySide), this); - camera.name = name; + clone(name2, newParent = null) { + const camera = SerializationHelper.Clone(Camera.GetConstructorFromName(this.getClassName(), name2, this.getScene(), this.interaxialDistance, this.isStereoscopicSideBySide), this); + camera.name = name2; camera.parent = newParent; this.onClonedObservable.notifyObservers(camera); return camera; @@ -29330,15 +30029,15 @@ class Camera extends Node2 { getDirectionToRef(localAxis, result) { Vector3.TransformNormalToRef(localAxis, this.getWorldMatrix(), result); } - static GetConstructorFromName(type, name, scene2, interaxial_distance = 0, isStereoscopicSideBySide = true) { - const constructorFunc = Node2.Construct(type, name, scene2, { + static GetConstructorFromName(type, name2, scene2, interaxial_distance = 0, isStereoscopicSideBySide = true) { + const constructorFunc = Node2.Construct(type, name2, scene2, { interaxial_distance, isStereoscopicSideBySide }); if (constructorFunc) { return constructorFunc; } - return () => Camera._CreateDefaultParsedCamera(name, scene2); + return () => Camera._CreateDefaultParsedCamera(name2, scene2); } computeWorldMatrix() { return this.getWorldMatrix(); @@ -29399,73 +30098,87 @@ class Camera extends Node2 { return handednessMultiplier; } } -Camera._CreateDefaultParsedCamera = (name, scene2) => { - throw _WarnImport("UniversalCamera"); -}; -Camera.PERSPECTIVE_CAMERA = 0; -Camera.ORTHOGRAPHIC_CAMERA = 1; -Camera.FOVMODE_VERTICAL_FIXED = 0; -Camera.FOVMODE_HORIZONTAL_FIXED = 1; -Camera.RIG_MODE_NONE = 0; -Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10; -Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11; -Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12; -Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER = 13; -Camera.RIG_MODE_STEREOSCOPIC_INTERLACED = 14; -Camera.RIG_MODE_VR = 20; -Camera.RIG_MODE_CUSTOM = 22; -Camera.ForceAttachControlToAlwaysPreventDefault = false; -__decorate2([ - serializeAsVector3("position") -], Camera.prototype, "_position", undefined); -__decorate2([ - serializeAsVector3("upVector") -], Camera.prototype, "_upVector", undefined); -__decorate2([ - serialize() -], Camera.prototype, "orthoLeft", null); -__decorate2([ - serialize() -], Camera.prototype, "orthoRight", null); -__decorate2([ - serialize() -], Camera.prototype, "orthoBottom", null); -__decorate2([ - serialize() -], Camera.prototype, "orthoTop", null); -__decorate2([ - serialize() -], Camera.prototype, "fov", undefined); -__decorate2([ - serialize() -], Camera.prototype, "projectionPlaneTilt", undefined); -__decorate2([ - serialize() -], Camera.prototype, "minZ", undefined); -__decorate2([ - serialize() -], Camera.prototype, "maxZ", undefined); -__decorate2([ - serialize() -], Camera.prototype, "inertia", undefined); -__decorate2([ - serialize() -], Camera.prototype, "mode", null); -__decorate2([ - serialize() -], Camera.prototype, "layerMask", undefined); -__decorate2([ - serialize() -], Camera.prototype, "fovMode", undefined); -__decorate2([ - serialize() -], Camera.prototype, "cameraRigMode", undefined); -__decorate2([ - serialize() -], Camera.prototype, "interaxialDistance", undefined); -__decorate2([ - serialize() -], Camera.prototype, "isStereoscopicSideBySide", undefined); +var init_camera = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_smartArray(); + init_tools(); + init_observable(); + init_math_vector(); + init_node(); + init_logger(); + init_typeStore(); + init_devTools(); + init_math_viewport(); + init_math_frustum(); + Camera._CreateDefaultParsedCamera = (name2, scene2) => { + throw _WarnImport("UniversalCamera"); + }; + Camera.PERSPECTIVE_CAMERA = 0; + Camera.ORTHOGRAPHIC_CAMERA = 1; + Camera.FOVMODE_VERTICAL_FIXED = 0; + Camera.FOVMODE_HORIZONTAL_FIXED = 1; + Camera.RIG_MODE_NONE = 0; + Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10; + Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11; + Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12; + Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER = 13; + Camera.RIG_MODE_STEREOSCOPIC_INTERLACED = 14; + Camera.RIG_MODE_VR = 20; + Camera.RIG_MODE_CUSTOM = 22; + Camera.ForceAttachControlToAlwaysPreventDefault = false; + __decorate2([ + serializeAsVector3("position") + ], Camera.prototype, "_position", undefined); + __decorate2([ + serializeAsVector3("upVector") + ], Camera.prototype, "_upVector", undefined); + __decorate2([ + serialize() + ], Camera.prototype, "orthoLeft", null); + __decorate2([ + serialize() + ], Camera.prototype, "orthoRight", null); + __decorate2([ + serialize() + ], Camera.prototype, "orthoBottom", null); + __decorate2([ + serialize() + ], Camera.prototype, "orthoTop", null); + __decorate2([ + serialize() + ], Camera.prototype, "fov", undefined); + __decorate2([ + serialize() + ], Camera.prototype, "projectionPlaneTilt", undefined); + __decorate2([ + serialize() + ], Camera.prototype, "minZ", undefined); + __decorate2([ + serialize() + ], Camera.prototype, "maxZ", undefined); + __decorate2([ + serialize() + ], Camera.prototype, "inertia", undefined); + __decorate2([ + serialize() + ], Camera.prototype, "mode", null); + __decorate2([ + serialize() + ], Camera.prototype, "layerMask", undefined); + __decorate2([ + serialize() + ], Camera.prototype, "fovMode", undefined); + __decorate2([ + serialize() + ], Camera.prototype, "cameraRigMode", undefined); + __decorate2([ + serialize() + ], Camera.prototype, "interaxialDistance", undefined); + __decorate2([ + serialize() + ], Camera.prototype, "isStereoscopicSideBySide", undefined); +}); // node_modules/@babylonjs/core/Collisions/intersectionInfo.js class IntersectionInfo { @@ -29477,6 +30190,8 @@ class IntersectionInfo { this.subMeshId = 0; } } +var init_intersectionInfo = __esm(() => { +}); // node_modules/@babylonjs/core/Culling/boundingBox.js class BoundingBox { @@ -29644,7 +30359,12 @@ class BoundingBox { return true; } } -BoundingBox._TmpVector3 = ArrayTools.BuildArray(3, Vector3.Zero); +var init_boundingBox = __esm(() => { + init_arrayTools(); + init_math_vector(); + init_math_constants(); + BoundingBox._TmpVector3 = ArrayTools.BuildArray(3, Vector3.Zero); +}); // node_modules/@babylonjs/core/Culling/boundingSphere.js class BoundingSphere { @@ -29735,26 +30455,13 @@ class BoundingSphere { return sphere; } } -BoundingSphere._TmpVector3 = ArrayTools.BuildArray(3, Vector3.Zero); +var init_boundingSphere = __esm(() => { + init_arrayTools(); + init_math_vector(); + BoundingSphere._TmpVector3 = ArrayTools.BuildArray(3, Vector3.Zero); +}); // node_modules/@babylonjs/core/Culling/boundingInfo.js -var _result0 = { min: 0, max: 0 }; -var _result1 = { min: 0, max: 0 }; -var computeBoxExtents = (axis, box, result) => { - const p = Vector3.Dot(box.centerWorld, axis); - const r0 = Math.abs(Vector3.Dot(box.directions[0], axis)) * box.extendSize.x; - const r1 = Math.abs(Vector3.Dot(box.directions[1], axis)) * box.extendSize.y; - const r2 = Math.abs(Vector3.Dot(box.directions[2], axis)) * box.extendSize.z; - const r = r0 + r1 + r2; - result.min = p - r; - result.max = p + r; -}; -var axisOverlap = (axis, box0, box1) => { - computeBoxExtents(axis, box0, _result0); - computeBoxExtents(axis, box1, _result1); - return !(_result0.min > _result1.max || _result1.min > _result0.max); -}; - class BoundingInfo { constructor(minimum, maximum, worldMatrix) { this._isLocked = false; @@ -29911,7 +30618,31 @@ class BoundingInfo { return true; } } -BoundingInfo._TmpVector3 = ArrayTools.BuildArray(2, Vector3.Zero); +var _result0, _result1, computeBoxExtents, axisOverlap; +var init_boundingInfo = __esm(() => { + init_arrayTools(); + init_math_vector(); + init_math_vector(); + init_boundingBox(); + init_boundingSphere(); + _result0 = { min: 0, max: 0 }; + _result1 = { min: 0, max: 0 }; + computeBoxExtents = (axis, box, result) => { + const p = Vector3.Dot(box.centerWorld, axis); + const r0 = Math.abs(Vector3.Dot(box.directions[0], axis)) * box.extendSize.x; + const r1 = Math.abs(Vector3.Dot(box.directions[1], axis)) * box.extendSize.y; + const r2 = Math.abs(Vector3.Dot(box.directions[2], axis)) * box.extendSize.z; + const r = r0 + r1 + r2; + result.min = p - r; + result.max = p + r; + }; + axisOverlap = (axis, box0, box1) => { + computeBoxExtents(axis, box0, _result0); + computeBoxExtents(axis, box1, _result1); + return !(_result0.min > _result1.max || _result1.min > _result0.max); + }; + BoundingInfo._TmpVector3 = ArrayTools.BuildArray(2, Vector3.Zero); +}); // node_modules/@babylonjs/core/Maths/math.functions.js function extractMinAndMaxIndexed(positions, indices, indexStart, indexCount, bias = null) { @@ -29973,12 +30704,17 @@ class MathHelpers { } } } -__decorate2([ - nativeOverride.filter((...[positions, indices]) => !Array.isArray(positions) && !Array.isArray(indices)) -], MathHelpers, "extractMinAndMaxIndexed", null); -__decorate2([ - nativeOverride.filter((...[positions]) => !Array.isArray(positions)) -], MathHelpers, "extractMinAndMax", null); +var init_math_functions = __esm(() => { + init_tslib_es62(); + init_math_vector(); + init_decorators(); + __decorate2([ + nativeOverride.filter((...[positions, indices]) => !Array.isArray(positions) && !Array.isArray(indices)) + ], MathHelpers, "extractMinAndMaxIndexed", null); + __decorate2([ + nativeOverride.filter((...[positions]) => !Array.isArray(positions)) + ], MathHelpers, "extractMinAndMax", null); +}); // node_modules/@babylonjs/core/Meshes/subMesh.js class SubMesh { @@ -30376,6 +31112,13 @@ class SubMesh { return new SubMesh(materialIndex, minVertexIndex, maxVertexIndex - minVertexIndex + 1, startIndex, indexCount, mesh, renderingMesh, createBoundingBox); } } +var init_subMesh = __esm(() => { + init_buffer(); + init_intersectionInfo(); + init_boundingInfo(); + init_math_functions(); + init_drawWrapper(); +}); // node_modules/@babylonjs/core/Meshes/mesh.vertexData.js class VertexDataMaterialInfo { @@ -31577,23 +32320,35 @@ class VertexData { geometry.setAllVerticesData(vertexData, parsedVertexData.updatable); } } -VertexData.FRONTSIDE = 0; -VertexData.BACKSIDE = 1; -VertexData.DOUBLESIDE = 2; -VertexData.DEFAULTSIDE = 0; -VertexData._UniqueIDGenerator = 0; -__decorate2([ - nativeOverride.filter((...[coordinates]) => !Array.isArray(coordinates)) -], VertexData, "_TransformVector3Coordinates", null); -__decorate2([ - nativeOverride.filter((...[normals]) => !Array.isArray(normals)) -], VertexData, "_TransformVector3Normals", null); -__decorate2([ - nativeOverride.filter((...[normals]) => !Array.isArray(normals)) -], VertexData, "_TransformVector4Normals", null); -__decorate2([ - nativeOverride.filter((...[indices]) => !Array.isArray(indices)) -], VertexData, "_FlipFaces", null); +var init_mesh_vertexData = __esm(() => { + init_tslib_es62(); + init_math_vector(); + init_buffer(); + init_devTools(); + init_math_color(); + init_logger(); + init_decorators(); + init_coroutine(); + init_error(); + init_subMesh(); + VertexData.FRONTSIDE = 0; + VertexData.BACKSIDE = 1; + VertexData.DOUBLESIDE = 2; + VertexData.DEFAULTSIDE = 0; + VertexData._UniqueIDGenerator = 0; + __decorate2([ + nativeOverride.filter((...[coordinates]) => !Array.isArray(coordinates)) + ], VertexData, "_TransformVector3Coordinates", null); + __decorate2([ + nativeOverride.filter((...[normals]) => !Array.isArray(normals)) + ], VertexData, "_TransformVector3Normals", null); + __decorate2([ + nativeOverride.filter((...[normals]) => !Array.isArray(normals)) + ], VertexData, "_TransformVector4Normals", null); + __decorate2([ + nativeOverride.filter((...[indices]) => !Array.isArray(indices)) + ], VertexData, "_FlipFaces", null); +}); // node_modules/@babylonjs/core/Loading/sceneLoaderFlags.js class SceneLoaderFlags { @@ -31622,15 +32377,19 @@ class SceneLoaderFlags { SceneLoaderFlags._CleanBoneMatrixWeights = value; } } -SceneLoaderFlags._ForceFullSceneLoadingForIncremental = false; -SceneLoaderFlags._ShowLoadingScreen = true; -SceneLoaderFlags._CleanBoneMatrixWeights = false; -SceneLoaderFlags._LoggingLevel = 0; +var init_sceneLoaderFlags = __esm(() => { + SceneLoaderFlags._ForceFullSceneLoadingForIncremental = false; + SceneLoaderFlags._ShowLoadingScreen = true; + SceneLoaderFlags._CleanBoneMatrixWeights = false; + SceneLoaderFlags._LoggingLevel = 0; +}); // node_modules/@babylonjs/core/Compat/compatibilityOptions.js class CompatibilityOptions { } -CompatibilityOptions.UseOpenGLOrientationForUV = false; +var init_compatibilityOptions = __esm(() => { + CompatibilityOptions.UseOpenGLOrientationForUV = false; +}); // node_modules/@babylonjs/core/Meshes/geometry.js class Geometry { @@ -32667,6 +33426,20 @@ class Geometry { return geometry; } } +var init_geometry = __esm(() => { + init_math_vector(); + init_math_color(); + init_mesh_vertexData(); + init_buffer(); + init_subMesh(); + init_sceneLoaderFlags(); + init_boundingInfo(); + init_tools(); + init_tags(); + init_math_functions(); + init_engineStore(); + init_compatibilityOptions(); +}); // node_modules/@babylonjs/core/Misc/performanceMonitor.js class PerformanceMonitor { @@ -32767,131 +33540,137 @@ class RollingAverage { return (i % max + max) % max; } } +var init_performanceMonitor = __esm(() => { + init_precisionDate(); +}); // node_modules/@babylonjs/core/Engines/Extensions/engine.alpha.js -ThinEngine.prototype.setAlphaConstants = function(r, g, b, a) { - this._alphaState.setAlphaBlendConstants(r, g, b, a); -}; -ThinEngine.prototype.setAlphaMode = function(mode, noDepthWriteChange = false) { - if (this._alphaMode === mode) { - if (!noDepthWriteChange) { - const depthMask = mode === 0; - if (this.depthCullingState.depthMask !== depthMask) { - this.depthCullingState.depthMask = depthMask; +var init_engine_alpha = __esm(() => { + init_thinEngine(); + ThinEngine.prototype.setAlphaConstants = function(r, g, b, a) { + this._alphaState.setAlphaBlendConstants(r, g, b, a); + }; + ThinEngine.prototype.setAlphaMode = function(mode, noDepthWriteChange = false) { + if (this._alphaMode === mode) { + if (!noDepthWriteChange) { + const depthMask = mode === 0; + if (this.depthCullingState.depthMask !== depthMask) { + this.depthCullingState.depthMask = depthMask; + } } + return; } - return; - } - switch (mode) { - case 0: - this._alphaState.alphaBlend = false; - break; - case 7: - this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE); - this._alphaState.alphaBlend = true; - break; - case 8: - this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA); - this._alphaState.alphaBlend = true; - break; - case 2: - this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE); - this._alphaState.alphaBlend = true; - break; - case 6: - this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ZERO, this._gl.ONE); - this._alphaState.alphaBlend = true; - break; - case 1: - this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ONE); - this._alphaState.alphaBlend = true; - break; - case 3: - this._alphaState.setAlphaBlendFunctionParameters(this._gl.ZERO, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE); - this._alphaState.alphaBlend = true; - break; - case 4: - this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR, this._gl.ZERO, this._gl.ONE, this._gl.ONE); - this._alphaState.alphaBlend = true; - break; - case 5: - this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE); - this._alphaState.alphaBlend = true; - break; - case 9: - this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR, this._gl.ONE_MINUS_CONSTANT_COLOR, this._gl.CONSTANT_ALPHA, this._gl.ONE_MINUS_CONSTANT_ALPHA); - this._alphaState.alphaBlend = true; - break; - case 10: - this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA); - this._alphaState.alphaBlend = true; - break; - case 11: - this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ONE); - this._alphaState.alphaBlend = true; - break; - case 12: - this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ZERO); - this._alphaState.alphaBlend = true; - break; - case 13: - this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE_MINUS_DST_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA); - this._alphaState.alphaBlend = true; - break; - case 14: - this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA); - this._alphaState.alphaBlend = true; - break; - case 15: - this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ZERO); - this._alphaState.alphaBlend = true; - break; - case 16: - this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ZERO, this._gl.ONE); - this._alphaState.alphaBlend = true; - break; - case 17: - this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA); - this._alphaState.alphaBlend = true; - break; - } - if (!noDepthWriteChange) { - this.depthCullingState.depthMask = mode === 0; - } - this._alphaMode = mode; -}; -ThinEngine.prototype.getAlphaMode = function() { - return this._alphaMode; -}; -ThinEngine.prototype.setAlphaEquation = function(equation) { - if (this._alphaEquation === equation) { - return; - } - switch (equation) { - case 0: - this._alphaState.setAlphaEquationParameters(32774, 32774); - break; - case 1: - this._alphaState.setAlphaEquationParameters(32778, 32778); - break; - case 2: - this._alphaState.setAlphaEquationParameters(32779, 32779); - break; - case 3: - this._alphaState.setAlphaEquationParameters(32776, 32776); - break; - case 4: - this._alphaState.setAlphaEquationParameters(32775, 32775); - break; - case 5: - this._alphaState.setAlphaEquationParameters(32775, 32774); - break; - } - this._alphaEquation = equation; -}; -ThinEngine.prototype.getAlphaEquation = function() { - return this._alphaEquation; -}; + switch (mode) { + case 0: + this._alphaState.alphaBlend = false; + break; + case 7: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case 8: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA); + this._alphaState.alphaBlend = true; + break; + case 2: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case 6: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ZERO, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case 1: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case 3: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.ZERO, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case 4: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR, this._gl.ZERO, this._gl.ONE, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case 5: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case 9: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR, this._gl.ONE_MINUS_CONSTANT_COLOR, this._gl.CONSTANT_ALPHA, this._gl.ONE_MINUS_CONSTANT_ALPHA); + this._alphaState.alphaBlend = true; + break; + case 10: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA); + this._alphaState.alphaBlend = true; + break; + case 11: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case 12: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ZERO); + this._alphaState.alphaBlend = true; + break; + case 13: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE_MINUS_DST_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA); + this._alphaState.alphaBlend = true; + break; + case 14: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA); + this._alphaState.alphaBlend = true; + break; + case 15: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ZERO); + this._alphaState.alphaBlend = true; + break; + case 16: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ZERO, this._gl.ONE); + this._alphaState.alphaBlend = true; + break; + case 17: + this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA); + this._alphaState.alphaBlend = true; + break; + } + if (!noDepthWriteChange) { + this.depthCullingState.depthMask = mode === 0; + } + this._alphaMode = mode; + }; + ThinEngine.prototype.getAlphaMode = function() { + return this._alphaMode; + }; + ThinEngine.prototype.setAlphaEquation = function(equation) { + if (this._alphaEquation === equation) { + return; + } + switch (equation) { + case 0: + this._alphaState.setAlphaEquationParameters(32774, 32774); + break; + case 1: + this._alphaState.setAlphaEquationParameters(32778, 32778); + break; + case 2: + this._alphaState.setAlphaEquationParameters(32779, 32779); + break; + case 3: + this._alphaState.setAlphaEquationParameters(32776, 32776); + break; + case 4: + this._alphaState.setAlphaEquationParameters(32775, 32775); + break; + case 5: + this._alphaState.setAlphaEquationParameters(32775, 32774); + break; + } + this._alphaEquation = equation; + }; + ThinEngine.prototype.getAlphaEquation = function() { + return this._alphaEquation; + }; +}); // node_modules/@babylonjs/core/Engines/Extensions/engine.readTexture.js function allocateAndCopyTypedBuffer(type, sizeOrDstBuffer, sizeInBytes = false, copyBuffer) { @@ -32961,94 +33740,100 @@ function allocateAndCopyTypedBuffer(type, sizeOrDstBuffer, sizeInBytes = false, } return buffer6; } -ThinEngine.prototype._readTexturePixelsSync = function(texture, width, height, faceIndex = -1, level = 0, buffer6 = null, flushRenderer = true, noDataConversion = false, x = 0, y = 0) { - var _a, _b; - const gl = this._gl; - if (!gl) { - throw new Error("Engine does not have gl rendering context."); - } - if (!this._dummyFramebuffer) { - const dummy = gl.createFramebuffer(); - if (!dummy) { - throw new Error("Unable to create dummy framebuffer"); +var init_engine_readTexture = __esm(() => { + init_thinEngine(); + ThinEngine.prototype._readTexturePixelsSync = function(texture, width, height, faceIndex = -1, level = 0, buffer6 = null, flushRenderer = true, noDataConversion = false, x = 0, y = 0) { + var _a, _b; + const gl = this._gl; + if (!gl) { + throw new Error("Engine does not have gl rendering context."); } - this._dummyFramebuffer = dummy; - } - gl.bindFramebuffer(gl.FRAMEBUFFER, this._dummyFramebuffer); - if (faceIndex > -1) { - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, (_a = texture._hardwareTexture) === null || _a === undefined ? undefined : _a.underlyingResource, level); - } else { - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, (_b = texture._hardwareTexture) === null || _b === undefined ? undefined : _b.underlyingResource, level); - } - let readType = texture.type !== undefined ? this._getWebGLTextureType(texture.type) : gl.UNSIGNED_BYTE; - if (!noDataConversion) { - switch (readType) { - case gl.UNSIGNED_BYTE: - if (!buffer6) { - buffer6 = new Uint8Array(4 * width * height); - } - readType = gl.UNSIGNED_BYTE; - break; - default: - if (!buffer6) { - buffer6 = new Float32Array(4 * width * height); - } - readType = gl.FLOAT; - break; + if (!this._dummyFramebuffer) { + const dummy = gl.createFramebuffer(); + if (!dummy) { + throw new Error("Unable to create dummy framebuffer"); + } + this._dummyFramebuffer = dummy; } - } else if (!buffer6) { - buffer6 = allocateAndCopyTypedBuffer(texture.type, 4 * width * height); - } - if (flushRenderer) { - this.flushFramebuffer(); - } - gl.readPixels(x, y, width, height, gl.RGBA, readType, buffer6); - gl.bindFramebuffer(gl.FRAMEBUFFER, this._currentFramebuffer); - return buffer6; -}; -ThinEngine.prototype._readTexturePixels = function(texture, width, height, faceIndex = -1, level = 0, buffer6 = null, flushRenderer = true, noDataConversion = false, x = 0, y = 0) { - return Promise.resolve(this._readTexturePixelsSync(texture, width, height, faceIndex, level, buffer6, flushRenderer, noDataConversion, x, y)); -}; + gl.bindFramebuffer(gl.FRAMEBUFFER, this._dummyFramebuffer); + if (faceIndex > -1) { + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, (_a = texture._hardwareTexture) === null || _a === undefined ? undefined : _a.underlyingResource, level); + } else { + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, (_b = texture._hardwareTexture) === null || _b === undefined ? undefined : _b.underlyingResource, level); + } + let readType = texture.type !== undefined ? this._getWebGLTextureType(texture.type) : gl.UNSIGNED_BYTE; + if (!noDataConversion) { + switch (readType) { + case gl.UNSIGNED_BYTE: + if (!buffer6) { + buffer6 = new Uint8Array(4 * width * height); + } + readType = gl.UNSIGNED_BYTE; + break; + default: + if (!buffer6) { + buffer6 = new Float32Array(4 * width * height); + } + readType = gl.FLOAT; + break; + } + } else if (!buffer6) { + buffer6 = allocateAndCopyTypedBuffer(texture.type, 4 * width * height); + } + if (flushRenderer) { + this.flushFramebuffer(); + } + gl.readPixels(x, y, width, height, gl.RGBA, readType, buffer6); + gl.bindFramebuffer(gl.FRAMEBUFFER, this._currentFramebuffer); + return buffer6; + }; + ThinEngine.prototype._readTexturePixels = function(texture, width, height, faceIndex = -1, level = 0, buffer6 = null, flushRenderer = true, noDataConversion = false, x = 0, y = 0) { + return Promise.resolve(this._readTexturePixelsSync(texture, width, height, faceIndex, level, buffer6, flushRenderer, noDataConversion, x, y)); + }; +}); // node_modules/@babylonjs/core/Engines/Extensions/engine.dynamicBuffer.js -ThinEngine.prototype.updateDynamicIndexBuffer = function(indexBuffer, indices, offset = 0) { - this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER] = null; - this.bindIndexBuffer(indexBuffer); - let view; - if (indexBuffer.is32Bits) { - view = indices instanceof Uint32Array ? indices : new Uint32Array(indices); - } else { - view = indices instanceof Uint16Array ? indices : new Uint16Array(indices); - } - this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, view, this._gl.DYNAMIC_DRAW); - this._resetIndexBufferBinding(); -}; -ThinEngine.prototype.updateDynamicVertexBuffer = function(vertexBuffer, data, byteOffset, byteLength) { - this.bindArrayBuffer(vertexBuffer); - if (byteOffset === undefined) { - byteOffset = 0; - } - const dataLength = data.byteLength || data.length; - if (byteLength === undefined || byteLength >= dataLength && byteOffset === 0) { - if (data instanceof Array) { - this._gl.bufferSubData(this._gl.ARRAY_BUFFER, byteOffset, new Float32Array(data)); +var init_engine_dynamicBuffer = __esm(() => { + init_thinEngine(); + ThinEngine.prototype.updateDynamicIndexBuffer = function(indexBuffer, indices, offset = 0) { + this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER] = null; + this.bindIndexBuffer(indexBuffer); + let view; + if (indexBuffer.is32Bits) { + view = indices instanceof Uint32Array ? indices : new Uint32Array(indices); } else { - this._gl.bufferSubData(this._gl.ARRAY_BUFFER, byteOffset, data); + view = indices instanceof Uint16Array ? indices : new Uint16Array(indices); } - } else { - if (data instanceof Array) { - this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, new Float32Array(data).subarray(byteOffset, byteOffset + byteLength)); + this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, view, this._gl.DYNAMIC_DRAW); + this._resetIndexBufferBinding(); + }; + ThinEngine.prototype.updateDynamicVertexBuffer = function(vertexBuffer, data, byteOffset, byteLength) { + this.bindArrayBuffer(vertexBuffer); + if (byteOffset === undefined) { + byteOffset = 0; + } + const dataLength = data.byteLength || data.length; + if (byteLength === undefined || byteLength >= dataLength && byteOffset === 0) { + if (data instanceof Array) { + this._gl.bufferSubData(this._gl.ARRAY_BUFFER, byteOffset, new Float32Array(data)); + } else { + this._gl.bufferSubData(this._gl.ARRAY_BUFFER, byteOffset, data); + } } else { - if (data instanceof ArrayBuffer) { - data = new Uint8Array(data, byteOffset, byteLength); + if (data instanceof Array) { + this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, new Float32Array(data).subarray(byteOffset, byteOffset + byteLength)); } else { - data = new Uint8Array(data.buffer, data.byteOffset + byteOffset, byteLength); + if (data instanceof ArrayBuffer) { + data = new Uint8Array(data, byteOffset, byteLength); + } else { + data = new Uint8Array(data.buffer, data.byteOffset + byteOffset, byteLength); + } + this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, data); } - this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, data); } - } - this._resetVertexBufferBinding(); -}; + this._resetVertexBufferBinding(); + }; +}); // node_modules/@babylonjs/core/Engines/engine.js class Engine2 extends ThinEngine { @@ -33426,7 +34211,7 @@ class Engine2 extends ThinEngine { } return this._gl.getShaderSource(shaders[1]); } - setDepthStencilTexture(channel, uniform, texture, name) { + setDepthStencilTexture(channel, uniform, texture, name2) { if (channel === undefined) { return; } @@ -33434,12 +34219,12 @@ class Engine2 extends ThinEngine { this._boundUniforms[channel] = uniform; } if (!texture || !texture.depthStencilTexture) { - this._setTexture(channel, null, undefined, undefined, name); + this._setTexture(channel, null, undefined, undefined, name2); } else { - this._setTexture(channel, texture, false, true, name); + this._setTexture(channel, texture, false, true, name2); } } - setTextureFromPostProcess(channel, postProcess, name) { + setTextureFromPostProcess(channel, postProcess, name2) { var _a; let postProcessInput = null; if (postProcess) { @@ -33449,11 +34234,11 @@ class Engine2 extends ThinEngine { postProcessInput = postProcess._textures.data[postProcess._currentRenderTextureInd]; } } - this._bindTexture(channel, (_a = postProcessInput === null || postProcessInput === undefined ? undefined : postProcessInput.texture) !== null && _a !== undefined ? _a : null, name); + this._bindTexture(channel, (_a = postProcessInput === null || postProcessInput === undefined ? undefined : postProcessInput.texture) !== null && _a !== undefined ? _a : null, name2); } - setTextureFromPostProcessOutput(channel, postProcess, name) { + setTextureFromPostProcessOutput(channel, postProcess, name2) { var _a, _b; - this._bindTexture(channel, (_b = (_a = postProcess === null || postProcess === undefined ? undefined : postProcess._outputTexture) === null || _a === undefined ? undefined : _a.texture) !== null && _b !== undefined ? _b : null, name); + this._bindTexture(channel, (_b = (_a = postProcess === null || postProcess === undefined ? undefined : postProcess._outputTexture) === null || _a === undefined ? undefined : _a.texture) !== null && _b !== undefined ? _b : null, name2); } _rebuildBuffers() { for (const scene2 of this.scenes) { @@ -33642,9 +34427,9 @@ class Engine2 extends ThinEngine { getCurrentRenderPassName() { return this._renderPassNames[this.currentRenderPassId]; } - createRenderPassId(name) { + createRenderPassId(name2) { const id = ++Engine2._RenderPassIdCounter; - this._renderPassNames[id] = name !== null && name !== undefined ? name : "NONAME"; + this._renderPassNames[id] = name2 !== null && name2 !== undefined ? name2 : "NONAME"; return id; } releaseRenderPassId(id) { @@ -33983,103 +34768,117 @@ class Engine2 extends ThinEngine { return { ascent: fontAscent, height: fontHeight, descent: fontHeight - fontAscent }; } } -Engine2.ALPHA_DISABLE = 0; -Engine2.ALPHA_ADD = 1; -Engine2.ALPHA_COMBINE = 2; -Engine2.ALPHA_SUBTRACT = 3; -Engine2.ALPHA_MULTIPLY = 4; -Engine2.ALPHA_MAXIMIZED = 5; -Engine2.ALPHA_ONEONE = 6; -Engine2.ALPHA_PREMULTIPLIED = 7; -Engine2.ALPHA_PREMULTIPLIED_PORTERDUFF = 8; -Engine2.ALPHA_INTERPOLATE = 9; -Engine2.ALPHA_SCREENMODE = 10; -Engine2.DELAYLOADSTATE_NONE = 0; -Engine2.DELAYLOADSTATE_LOADED = 1; -Engine2.DELAYLOADSTATE_LOADING = 2; -Engine2.DELAYLOADSTATE_NOTLOADED = 4; -Engine2.NEVER = 512; -Engine2.ALWAYS = 519; -Engine2.LESS = 513; -Engine2.EQUAL = 514; -Engine2.LEQUAL = 515; -Engine2.GREATER = 516; -Engine2.GEQUAL = 518; -Engine2.NOTEQUAL = 517; -Engine2.KEEP = 7680; -Engine2.REPLACE = 7681; -Engine2.INCR = 7682; -Engine2.DECR = 7683; -Engine2.INVERT = 5386; -Engine2.INCR_WRAP = 34055; -Engine2.DECR_WRAP = 34056; -Engine2.TEXTURE_CLAMP_ADDRESSMODE = 0; -Engine2.TEXTURE_WRAP_ADDRESSMODE = 1; -Engine2.TEXTURE_MIRROR_ADDRESSMODE = 2; -Engine2.TEXTUREFORMAT_ALPHA = 0; -Engine2.TEXTUREFORMAT_LUMINANCE = 1; -Engine2.TEXTUREFORMAT_LUMINANCE_ALPHA = 2; -Engine2.TEXTUREFORMAT_RGB = 4; -Engine2.TEXTUREFORMAT_RGBA = 5; -Engine2.TEXTUREFORMAT_RED = 6; -Engine2.TEXTUREFORMAT_R = 6; -Engine2.TEXTUREFORMAT_RG = 7; -Engine2.TEXTUREFORMAT_RED_INTEGER = 8; -Engine2.TEXTUREFORMAT_R_INTEGER = 8; -Engine2.TEXTUREFORMAT_RG_INTEGER = 9; -Engine2.TEXTUREFORMAT_RGB_INTEGER = 10; -Engine2.TEXTUREFORMAT_RGBA_INTEGER = 11; -Engine2.TEXTURETYPE_UNSIGNED_BYTE = 0; -Engine2.TEXTURETYPE_UNSIGNED_INT = 0; -Engine2.TEXTURETYPE_FLOAT = 1; -Engine2.TEXTURETYPE_HALF_FLOAT = 2; -Engine2.TEXTURETYPE_BYTE = 3; -Engine2.TEXTURETYPE_SHORT = 4; -Engine2.TEXTURETYPE_UNSIGNED_SHORT = 5; -Engine2.TEXTURETYPE_INT = 6; -Engine2.TEXTURETYPE_UNSIGNED_INTEGER = 7; -Engine2.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = 8; -Engine2.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = 9; -Engine2.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = 10; -Engine2.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = 11; -Engine2.TEXTURETYPE_UNSIGNED_INT_24_8 = 12; -Engine2.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = 13; -Engine2.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14; -Engine2.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15; -Engine2.TEXTURE_NEAREST_SAMPLINGMODE = 1; -Engine2.TEXTURE_BILINEAR_SAMPLINGMODE = 2; -Engine2.TEXTURE_TRILINEAR_SAMPLINGMODE = 3; -Engine2.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 8; -Engine2.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 11; -Engine2.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3; -Engine2.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4; -Engine2.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5; -Engine2.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6; -Engine2.TEXTURE_NEAREST_LINEAR = 7; -Engine2.TEXTURE_NEAREST_NEAREST = 1; -Engine2.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9; -Engine2.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10; -Engine2.TEXTURE_LINEAR_LINEAR = 2; -Engine2.TEXTURE_LINEAR_NEAREST = 12; -Engine2.TEXTURE_EXPLICIT_MODE = 0; -Engine2.TEXTURE_SPHERICAL_MODE = 1; -Engine2.TEXTURE_PLANAR_MODE = 2; -Engine2.TEXTURE_CUBIC_MODE = 3; -Engine2.TEXTURE_PROJECTION_MODE = 4; -Engine2.TEXTURE_SKYBOX_MODE = 5; -Engine2.TEXTURE_INVCUBIC_MODE = 6; -Engine2.TEXTURE_EQUIRECTANGULAR_MODE = 7; -Engine2.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8; -Engine2.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9; -Engine2.SCALEMODE_FLOOR = 1; -Engine2.SCALEMODE_NEAREST = 2; -Engine2.SCALEMODE_CEILING = 3; -Engine2._RescalePostProcessFactory = null; -Engine2._RenderPassIdCounter = 0; +var init_engine = __esm(() => { + init_observable(); + init_internalTexture(); + init_domManagement(); + init_engineStore(); + init_devTools(); + init_thinEngine(); + init_performanceMonitor(); + init_perfCounter(); + init_webGLDataBuffer(); + init_logger(); + init_webGLHardwareTexture(); + init_engine_alpha(); + init_engine_readTexture(); + init_engine_dynamicBuffer(); + Engine2.ALPHA_DISABLE = 0; + Engine2.ALPHA_ADD = 1; + Engine2.ALPHA_COMBINE = 2; + Engine2.ALPHA_SUBTRACT = 3; + Engine2.ALPHA_MULTIPLY = 4; + Engine2.ALPHA_MAXIMIZED = 5; + Engine2.ALPHA_ONEONE = 6; + Engine2.ALPHA_PREMULTIPLIED = 7; + Engine2.ALPHA_PREMULTIPLIED_PORTERDUFF = 8; + Engine2.ALPHA_INTERPOLATE = 9; + Engine2.ALPHA_SCREENMODE = 10; + Engine2.DELAYLOADSTATE_NONE = 0; + Engine2.DELAYLOADSTATE_LOADED = 1; + Engine2.DELAYLOADSTATE_LOADING = 2; + Engine2.DELAYLOADSTATE_NOTLOADED = 4; + Engine2.NEVER = 512; + Engine2.ALWAYS = 519; + Engine2.LESS = 513; + Engine2.EQUAL = 514; + Engine2.LEQUAL = 515; + Engine2.GREATER = 516; + Engine2.GEQUAL = 518; + Engine2.NOTEQUAL = 517; + Engine2.KEEP = 7680; + Engine2.REPLACE = 7681; + Engine2.INCR = 7682; + Engine2.DECR = 7683; + Engine2.INVERT = 5386; + Engine2.INCR_WRAP = 34055; + Engine2.DECR_WRAP = 34056; + Engine2.TEXTURE_CLAMP_ADDRESSMODE = 0; + Engine2.TEXTURE_WRAP_ADDRESSMODE = 1; + Engine2.TEXTURE_MIRROR_ADDRESSMODE = 2; + Engine2.TEXTUREFORMAT_ALPHA = 0; + Engine2.TEXTUREFORMAT_LUMINANCE = 1; + Engine2.TEXTUREFORMAT_LUMINANCE_ALPHA = 2; + Engine2.TEXTUREFORMAT_RGB = 4; + Engine2.TEXTUREFORMAT_RGBA = 5; + Engine2.TEXTUREFORMAT_RED = 6; + Engine2.TEXTUREFORMAT_R = 6; + Engine2.TEXTUREFORMAT_RG = 7; + Engine2.TEXTUREFORMAT_RED_INTEGER = 8; + Engine2.TEXTUREFORMAT_R_INTEGER = 8; + Engine2.TEXTUREFORMAT_RG_INTEGER = 9; + Engine2.TEXTUREFORMAT_RGB_INTEGER = 10; + Engine2.TEXTUREFORMAT_RGBA_INTEGER = 11; + Engine2.TEXTURETYPE_UNSIGNED_BYTE = 0; + Engine2.TEXTURETYPE_UNSIGNED_INT = 0; + Engine2.TEXTURETYPE_FLOAT = 1; + Engine2.TEXTURETYPE_HALF_FLOAT = 2; + Engine2.TEXTURETYPE_BYTE = 3; + Engine2.TEXTURETYPE_SHORT = 4; + Engine2.TEXTURETYPE_UNSIGNED_SHORT = 5; + Engine2.TEXTURETYPE_INT = 6; + Engine2.TEXTURETYPE_UNSIGNED_INTEGER = 7; + Engine2.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = 8; + Engine2.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = 9; + Engine2.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = 10; + Engine2.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = 11; + Engine2.TEXTURETYPE_UNSIGNED_INT_24_8 = 12; + Engine2.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = 13; + Engine2.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14; + Engine2.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15; + Engine2.TEXTURE_NEAREST_SAMPLINGMODE = 1; + Engine2.TEXTURE_BILINEAR_SAMPLINGMODE = 2; + Engine2.TEXTURE_TRILINEAR_SAMPLINGMODE = 3; + Engine2.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 8; + Engine2.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 11; + Engine2.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3; + Engine2.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4; + Engine2.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5; + Engine2.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6; + Engine2.TEXTURE_NEAREST_LINEAR = 7; + Engine2.TEXTURE_NEAREST_NEAREST = 1; + Engine2.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9; + Engine2.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10; + Engine2.TEXTURE_LINEAR_LINEAR = 2; + Engine2.TEXTURE_LINEAR_NEAREST = 12; + Engine2.TEXTURE_EXPLICIT_MODE = 0; + Engine2.TEXTURE_SPHERICAL_MODE = 1; + Engine2.TEXTURE_PLANAR_MODE = 2; + Engine2.TEXTURE_CUBIC_MODE = 3; + Engine2.TEXTURE_PROJECTION_MODE = 4; + Engine2.TEXTURE_SKYBOX_MODE = 5; + Engine2.TEXTURE_INVCUBIC_MODE = 6; + Engine2.TEXTURE_EQUIRECTANGULAR_MODE = 7; + Engine2.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8; + Engine2.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9; + Engine2.SCALEMODE_FLOOR = 1; + Engine2.SCALEMODE_NEAREST = 2; + Engine2.SCALEMODE_CEILING = 3; + Engine2._RescalePostProcessFactory = null; + Engine2._RenderPassIdCounter = 0; +}); // node_modules/@babylonjs/core/Meshes/transformNode.js -var convertRHSToLHS = Matrix.Compose(Vector3.One(), Quaternion.FromEulerAngles(0, Math.PI, 0), Vector3.Zero()); - class TransformNode extends Node2 { get billboardMode() { return this._billboardMode; @@ -34114,8 +34913,8 @@ class TransformNode extends Node2 { } this._infiniteDistance = value; } - constructor(name, scene2 = null, isPure = true) { - super(name, scene2); + constructor(name2, scene2 = null, isPure = true) { + super(name2, scene2); this._forward = new Vector3(0, 0, 1); this._up = new Vector3(0, 1, 0); this._right = new Vector3(1, 0, 0); @@ -34850,10 +35649,10 @@ class TransformNode extends Node2 { } return this.getAbsolutePosition().subtract(camera.globalPosition).length(); } - clone(name, newParent, doNotCloneChildren) { - const result = SerializationHelper.Clone(() => new TransformNode(name, this.getScene()), this); - result.name = name; - result.id = name; + clone(name2, newParent, doNotCloneChildren) { + const result = SerializationHelper.Clone(() => new TransformNode(name2, this.getScene()), this); + result.name = name2; + result.id = name2; if (newParent) { result.parent = newParent; } @@ -34862,7 +35661,7 @@ class TransformNode extends Node2 { for (let index = 0;index < directDescendants.length; index++) { const child = directDescendants[index]; if (child.clone) { - child.clone(name + "." + child.name, result); + child.clone(name2 + "." + child.name, result); } } } @@ -34959,45 +35758,55 @@ class TransformNode extends Node2 { } } } -TransformNode.BILLBOARDMODE_NONE = 0; -TransformNode.BILLBOARDMODE_X = 1; -TransformNode.BILLBOARDMODE_Y = 2; -TransformNode.BILLBOARDMODE_Z = 4; -TransformNode.BILLBOARDMODE_ALL = 7; -TransformNode.BILLBOARDMODE_USE_POSITION = 128; -TransformNode.BillboardUseParentOrientation = false; -TransformNode._TmpRotation = Quaternion.Zero(); -TransformNode._TmpScaling = Vector3.Zero(); -TransformNode._TmpTranslation = Vector3.Zero(); -TransformNode._LookAtVectorCache = new Vector3(0, 0, 0); -TransformNode._RotationAxisCache = new Quaternion; -__decorate2([ - serializeAsVector3("position") -], TransformNode.prototype, "_position", undefined); -__decorate2([ - serializeAsVector3("rotation") -], TransformNode.prototype, "_rotation", undefined); -__decorate2([ - serializeAsQuaternion("rotationQuaternion") -], TransformNode.prototype, "_rotationQuaternion", undefined); -__decorate2([ - serializeAsVector3("scaling") -], TransformNode.prototype, "_scaling", undefined); -__decorate2([ - serialize("billboardMode") -], TransformNode.prototype, "_billboardMode", undefined); -__decorate2([ - serialize() -], TransformNode.prototype, "scalingDeterminant", undefined); -__decorate2([ - serialize("infiniteDistance") -], TransformNode.prototype, "_infiniteDistance", undefined); -__decorate2([ - serialize() -], TransformNode.prototype, "ignoreNonUniformScaling", undefined); -__decorate2([ - serialize() -], TransformNode.prototype, "reIntegrateRotationIntoRotationQuaternion", undefined); +var convertRHSToLHS; +var init_transformNode = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_observable(); + init_math_vector(); + init_node(); + init_math_axis(); + convertRHSToLHS = Matrix.Compose(Vector3.One(), Quaternion.FromEulerAngles(0, Math.PI, 0), Vector3.Zero()); + TransformNode.BILLBOARDMODE_NONE = 0; + TransformNode.BILLBOARDMODE_X = 1; + TransformNode.BILLBOARDMODE_Y = 2; + TransformNode.BILLBOARDMODE_Z = 4; + TransformNode.BILLBOARDMODE_ALL = 7; + TransformNode.BILLBOARDMODE_USE_POSITION = 128; + TransformNode.BillboardUseParentOrientation = false; + TransformNode._TmpRotation = Quaternion.Zero(); + TransformNode._TmpScaling = Vector3.Zero(); + TransformNode._TmpTranslation = Vector3.Zero(); + TransformNode._LookAtVectorCache = new Vector3(0, 0, 0); + TransformNode._RotationAxisCache = new Quaternion; + __decorate2([ + serializeAsVector3("position") + ], TransformNode.prototype, "_position", undefined); + __decorate2([ + serializeAsVector3("rotation") + ], TransformNode.prototype, "_rotation", undefined); + __decorate2([ + serializeAsQuaternion("rotationQuaternion") + ], TransformNode.prototype, "_rotationQuaternion", undefined); + __decorate2([ + serializeAsVector3("scaling") + ], TransformNode.prototype, "_scaling", undefined); + __decorate2([ + serialize("billboardMode") + ], TransformNode.prototype, "_billboardMode", undefined); + __decorate2([ + serialize() + ], TransformNode.prototype, "scalingDeterminant", undefined); + __decorate2([ + serialize("infiniteDistance") + ], TransformNode.prototype, "_infiniteDistance", undefined); + __decorate2([ + serialize() + ], TransformNode.prototype, "ignoreNonUniformScaling", undefined); + __decorate2([ + serialize() + ], TransformNode.prototype, "reIntegrateRotationIntoRotationQuaternion", undefined); +}); // node_modules/@babylonjs/core/Collisions/meshCollisionData.js class _MeshCollisionData { @@ -35012,6 +35821,9 @@ class _MeshCollisionData { this._collisionResponse = true; } } +var init_meshCollisionData = __esm(() => { + init_math_vector(); +}); // node_modules/@babylonjs/core/Meshes/abstractMesh.js class _FacetDataStorage { @@ -35353,8 +36165,8 @@ class AbstractMesh extends TransformNode { get skeleton() { return this._internalAbstractMeshDataInfo._skeleton; } - constructor(name, scene3 = null) { - super(name, scene3, false); + constructor(name2, scene3 = null) { + super(name2, scene3, false); this._internalAbstractMeshDataInfo = new _InternalAbstractMeshDataInfo; this._waitingMaterialId = null; this.cullingStrategy = AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY; @@ -35415,7 +36227,7 @@ class AbstractMesh extends TransformNode { scene3 = this.getScene(); scene3.addMesh(this); this._resyncLightSources(); - this._uniformBuffer = new UniformBuffer(this.getScene().getEngine(), undefined, undefined, name, !this.getScene().getEngine().isWebGPU); + this._uniformBuffer = new UniformBuffer(this.getScene().getEngine(), undefined, undefined, name2, !this.getScene().getEngine().isWebGPU); this._buildUniformLayout(); switch (scene3.performancePriority) { case ScenePerformancePriority.Aggressive: @@ -35944,8 +36756,8 @@ class AbstractMesh extends TransformNode { } intersects(ray, fastCheck, trianglePredicate, onlyBoundingInfo = false, worldToUse, skipBoundingInfo = false) { const pickingInfo4 = new PickingInfo; - const className = this.getClassName(); - const intersectionThreshold = className === "InstancedLinesMesh" || className === "LinesMesh" || className === "GreasedLineMesh" ? this.intersectionThreshold : 0; + const className2 = this.getClassName(); + const intersectionThreshold = className2 === "InstancedLinesMesh" || className2 === "LinesMesh" || className2 === "GreasedLineMesh" ? this.intersectionThreshold : 0; const boundingInfo4 = this.getBoundingInfo(); if (!this.subMeshes) { return pickingInfo4; @@ -36022,7 +36834,7 @@ class AbstractMesh extends TransformNode { } return pickingInfo4; } - clone(name, newParent, doNotCloneChildren) { + clone(name2, newParent, doNotCloneChildren) { return null; } releaseSubMeshes() { @@ -36424,16 +37236,35 @@ class AbstractMesh extends TransformNode { return this._scene.particleSystems.filter((particleSystem) => particleSystem.emitter === this); } } -AbstractMesh.OCCLUSION_TYPE_NONE = 0; -AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC = 1; -AbstractMesh.OCCLUSION_TYPE_STRICT = 2; -AbstractMesh.OCCLUSION_ALGORITHM_TYPE_ACCURATE = 0; -AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE = 1; -AbstractMesh.CULLINGSTRATEGY_STANDARD = 0; -AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = 1; -AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION = 2; -AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY = 3; -RegisterClass("BABYLON.AbstractMesh", AbstractMesh); +var init_abstractMesh = __esm(() => { + init_observable(); + init_scene(); + init_math_vector(); + init_engine(); + init_buffer(); + init_mesh_vertexData(); + init_transformNode(); + init_pickingInfo(); + init_boundingInfo(); + init_uniformBuffer(); + init_meshCollisionData(); + init_devTools(); + init_math_functions(); + init_math_color(); + init_math_constants(); + init_math_axis(); + init_typeStore(); + AbstractMesh.OCCLUSION_TYPE_NONE = 0; + AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC = 1; + AbstractMesh.OCCLUSION_TYPE_STRICT = 2; + AbstractMesh.OCCLUSION_ALGORITHM_TYPE_ACCURATE = 0; + AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE = 1; + AbstractMesh.CULLINGSTRATEGY_STANDARD = 0; + AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = 1; + AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION = 2; + AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY = 3; + RegisterClass("BABYLON.AbstractMesh", AbstractMesh); +}); // node_modules/@babylonjs/core/Materials/clipPlaneMaterialHelper.js function addClipPlaneUniforms(uniforms) { @@ -36527,11 +37358,14 @@ function bindClipPlane(effect2, primaryHolder, secondaryHolder) { clipPlane = (_f = primaryHolder.clipPlane6) !== null && _f !== undefined ? _f : secondaryHolder.clipPlane6; setClipPlane(effect2, "vClipPlane6", clipPlane); } -var setClipPlane = function(effect2, uniformName, clipPlane) { - if (clipPlane) { - effect2.setFloat4(uniformName, clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d); - } -}; +var setClipPlane; +var init_clipPlaneMaterialHelper = __esm(() => { + setClipPlane = function(effect2, uniformName, clipPlane) { + if (clipPlane) { + effect2.setFloat4(uniformName, clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d); + } + }; +}); // node_modules/@babylonjs/core/Materials/materialHelper.js class MaterialHelper { @@ -37107,8 +37941,18 @@ class MaterialHelper { } } } -MaterialHelper._TmpMorphInfluencers = { NUM_MORPH_INFLUENCERS: 0 }; -MaterialHelper._TempFogColor = Color3.Black(); +var init_materialHelper = __esm(() => { + init_logger(); + init_camera(); + init_scene(); + init_engineStore(); + init_buffer(); + init_lightConstants(); + init_math_color(); + init_clipPlaneMaterialHelper(); + MaterialHelper._TmpMorphInfluencers = { NUM_MORPH_INFLUENCERS: 0 }; + MaterialHelper._TempFogColor = Color3.Black(); +}); // node_modules/@babylonjs/core/Materials/materialStencilState.js class MaterialStencilState { @@ -37186,49 +38030,55 @@ class MaterialStencilState { SerializationHelper.Parse(() => this, source, scene4, rootUrl); } } -__decorate2([ - serialize() -], MaterialStencilState.prototype, "func", null); -__decorate2([ - serialize() -], MaterialStencilState.prototype, "funcRef", null); -__decorate2([ - serialize() -], MaterialStencilState.prototype, "funcMask", null); -__decorate2([ - serialize() -], MaterialStencilState.prototype, "opStencilFail", null); -__decorate2([ - serialize() -], MaterialStencilState.prototype, "opDepthFail", null); -__decorate2([ - serialize() -], MaterialStencilState.prototype, "opStencilDepthPass", null); -__decorate2([ - serialize() -], MaterialStencilState.prototype, "mask", null); -__decorate2([ - serialize() -], MaterialStencilState.prototype, "enabled", null); +var init_materialStencilState = __esm(() => { + init_tslib_es62(); + init_decorators(); + __decorate2([ + serialize() + ], MaterialStencilState.prototype, "func", null); + __decorate2([ + serialize() + ], MaterialStencilState.prototype, "funcRef", null); + __decorate2([ + serialize() + ], MaterialStencilState.prototype, "funcMask", null); + __decorate2([ + serialize() + ], MaterialStencilState.prototype, "opStencilFail", null); + __decorate2([ + serialize() + ], MaterialStencilState.prototype, "opDepthFail", null); + __decorate2([ + serialize() + ], MaterialStencilState.prototype, "opStencilDepthPass", null); + __decorate2([ + serialize() + ], MaterialStencilState.prototype, "mask", null); + __decorate2([ + serialize() + ], MaterialStencilState.prototype, "enabled", null); +}); // node_modules/@babylonjs/core/Materials/materialPluginEvent.js var MaterialPluginEvent; -(function(MaterialPluginEvent2) { - MaterialPluginEvent2[MaterialPluginEvent2["Created"] = 1] = "Created"; - MaterialPluginEvent2[MaterialPluginEvent2["Disposed"] = 2] = "Disposed"; - MaterialPluginEvent2[MaterialPluginEvent2["GetDefineNames"] = 4] = "GetDefineNames"; - MaterialPluginEvent2[MaterialPluginEvent2["PrepareUniformBuffer"] = 8] = "PrepareUniformBuffer"; - MaterialPluginEvent2[MaterialPluginEvent2["IsReadyForSubMesh"] = 16] = "IsReadyForSubMesh"; - MaterialPluginEvent2[MaterialPluginEvent2["PrepareDefines"] = 32] = "PrepareDefines"; - MaterialPluginEvent2[MaterialPluginEvent2["BindForSubMesh"] = 64] = "BindForSubMesh"; - MaterialPluginEvent2[MaterialPluginEvent2["PrepareEffect"] = 128] = "PrepareEffect"; - MaterialPluginEvent2[MaterialPluginEvent2["GetAnimatables"] = 256] = "GetAnimatables"; - MaterialPluginEvent2[MaterialPluginEvent2["GetActiveTextures"] = 512] = "GetActiveTextures"; - MaterialPluginEvent2[MaterialPluginEvent2["HasTexture"] = 1024] = "HasTexture"; - MaterialPluginEvent2[MaterialPluginEvent2["FillRenderTargetTextures"] = 2048] = "FillRenderTargetTextures"; - MaterialPluginEvent2[MaterialPluginEvent2["HasRenderTargetTextures"] = 4096] = "HasRenderTargetTextures"; - MaterialPluginEvent2[MaterialPluginEvent2["HardBindForSubMesh"] = 8192] = "HardBindForSubMesh"; -})(MaterialPluginEvent || (MaterialPluginEvent = {})); +var init_materialPluginEvent = __esm(() => { + (function(MaterialPluginEvent2) { + MaterialPluginEvent2[MaterialPluginEvent2["Created"] = 1] = "Created"; + MaterialPluginEvent2[MaterialPluginEvent2["Disposed"] = 2] = "Disposed"; + MaterialPluginEvent2[MaterialPluginEvent2["GetDefineNames"] = 4] = "GetDefineNames"; + MaterialPluginEvent2[MaterialPluginEvent2["PrepareUniformBuffer"] = 8] = "PrepareUniformBuffer"; + MaterialPluginEvent2[MaterialPluginEvent2["IsReadyForSubMesh"] = 16] = "IsReadyForSubMesh"; + MaterialPluginEvent2[MaterialPluginEvent2["PrepareDefines"] = 32] = "PrepareDefines"; + MaterialPluginEvent2[MaterialPluginEvent2["BindForSubMesh"] = 64] = "BindForSubMesh"; + MaterialPluginEvent2[MaterialPluginEvent2["PrepareEffect"] = 128] = "PrepareEffect"; + MaterialPluginEvent2[MaterialPluginEvent2["GetAnimatables"] = 256] = "GetAnimatables"; + MaterialPluginEvent2[MaterialPluginEvent2["GetActiveTextures"] = 512] = "GetActiveTextures"; + MaterialPluginEvent2[MaterialPluginEvent2["HasTexture"] = 1024] = "HasTexture"; + MaterialPluginEvent2[MaterialPluginEvent2["FillRenderTargetTextures"] = 2048] = "FillRenderTargetTextures"; + MaterialPluginEvent2[MaterialPluginEvent2["HasRenderTargetTextures"] = 4096] = "HasRenderTargetTextures"; + MaterialPluginEvent2[MaterialPluginEvent2["HardBindForSubMesh"] = 8192] = "HardBindForSubMesh"; + })(MaterialPluginEvent || (MaterialPluginEvent = {})); +}); // node_modules/@babylonjs/core/Materials/material.js class Material { @@ -37409,7 +38259,7 @@ class Material { _setDrawWrapper(drawWrapper4) { this._drawWrapper = drawWrapper4; } - constructor(name, scene5, doNotAdd) { + constructor(name2, scene5, doNotAdd) { this.shadowDepthWrapper = null; this.allowShaderHotSwapping = true; this.metadata = null; @@ -37479,7 +38329,7 @@ class Material { }; this._forceAlphaTest = false; this._transparencyMode = null; - this.name = name; + this.name = name2; const setScene = scene5 || EngineStore.LastCreatedScene; if (!setScene) { return; @@ -37493,7 +38343,7 @@ class Material { this._dirtyCallbacks[16] = this._markAllSubMeshesAsMiscDirty.bind(this); this._dirtyCallbacks[32] = this._markAllSubMeshesAsPrePassDirty.bind(this); this._dirtyCallbacks[63] = this._markAllSubMeshesAsAllDirty.bind(this); - this.id = name || Tools.RandomId(); + this.id = name2 || Tools.RandomId(); this.uniqueId = this._scene.getUniqueId(); this._materialContext = this._scene.getEngine().createMaterialContext(); this._drawWrapper = new DrawWrapper(this._scene.getEngine(), false); @@ -37503,7 +38353,7 @@ class Material { } else { this.sideOrientation = Material.CounterClockWiseSideOrientation; } - this._uniformBuffer = new UniformBuffer(this._scene.getEngine(), undefined, undefined, name); + this._uniformBuffer = new UniformBuffer(this._scene.getEngine(), undefined, undefined, name2); this._useUBO = this.getScene().getEngine().supportsUniformBuffers; if (!doNotAdd) { this._scene.addMaterial(this); @@ -37732,7 +38582,7 @@ class Material { this._callbackPluginEventGeneric(MaterialPluginEvent.HasTexture, this._eventInfo); return this._eventInfo.hasTexture; } - clone(name) { + clone(name2) { return null; } _clonePlugins(targetMaterial, rootUrl) { @@ -38066,131 +38916,147 @@ class Material { } } } -Material.TriangleFillMode = 0; -Material.WireFrameFillMode = 1; -Material.PointFillMode = 2; -Material.PointListDrawMode = 3; -Material.LineListDrawMode = 4; -Material.LineLoopDrawMode = 5; -Material.LineStripDrawMode = 6; -Material.TriangleStripDrawMode = 7; -Material.TriangleFanDrawMode = 8; -Material.ClockWiseSideOrientation = 0; -Material.CounterClockWiseSideOrientation = 1; -Material.TextureDirtyFlag = 1; -Material.LightDirtyFlag = 2; -Material.FresnelDirtyFlag = 4; -Material.AttributesDirtyFlag = 8; -Material.MiscDirtyFlag = 16; -Material.PrePassDirtyFlag = 32; -Material.AllDirtyFlag = 63; -Material.MATERIAL_OPAQUE = 0; -Material.MATERIAL_ALPHATEST = 1; -Material.MATERIAL_ALPHABLEND = 2; -Material.MATERIAL_ALPHATESTANDBLEND = 3; -Material.MATERIAL_NORMALBLENDMETHOD_WHITEOUT = 0; -Material.MATERIAL_NORMALBLENDMETHOD_RNM = 1; -Material.OnEventObservable = new Observable; -Material._AllDirtyCallBack = (defines) => defines.markAllAsDirty(); -Material._ImageProcessingDirtyCallBack = (defines) => defines.markAsImageProcessingDirty(); -Material._TextureDirtyCallBack = (defines) => defines.markAsTexturesDirty(); -Material._FresnelDirtyCallBack = (defines) => defines.markAsFresnelDirty(); -Material._MiscDirtyCallBack = (defines) => defines.markAsMiscDirty(); -Material._PrePassDirtyCallBack = (defines) => defines.markAsPrePassDirty(); -Material._LightsDirtyCallBack = (defines) => defines.markAsLightDirty(); -Material._AttributeDirtyCallBack = (defines) => defines.markAsAttributesDirty(); -Material._FresnelAndMiscDirtyCallBack = (defines) => { - Material._FresnelDirtyCallBack(defines); - Material._MiscDirtyCallBack(defines); -}; -Material._TextureAndMiscDirtyCallBack = (defines) => { - Material._TextureDirtyCallBack(defines); - Material._MiscDirtyCallBack(defines); -}; -Material._DirtyCallbackArray = []; -Material._RunDirtyCallBacks = (defines) => { - for (const cb of Material._DirtyCallbackArray) { - cb(defines); - } -}; -__decorate2([ - serialize() -], Material.prototype, "id", undefined); -__decorate2([ - serialize() -], Material.prototype, "uniqueId", undefined); -__decorate2([ - serialize() -], Material.prototype, "name", undefined); -__decorate2([ - serialize() -], Material.prototype, "metadata", undefined); -__decorate2([ - serialize() -], Material.prototype, "checkReadyOnEveryCall", undefined); -__decorate2([ - serialize() -], Material.prototype, "checkReadyOnlyOnce", undefined); -__decorate2([ - serialize() -], Material.prototype, "state", undefined); -__decorate2([ - serialize("alpha") -], Material.prototype, "_alpha", undefined); -__decorate2([ - serialize("backFaceCulling") -], Material.prototype, "_backFaceCulling", undefined); -__decorate2([ - serialize("cullBackFaces") -], Material.prototype, "_cullBackFaces", undefined); -__decorate2([ - serialize() -], Material.prototype, "sideOrientation", undefined); -__decorate2([ - serialize("alphaMode") -], Material.prototype, "_alphaMode", undefined); -__decorate2([ - serialize() -], Material.prototype, "_needDepthPrePass", undefined); -__decorate2([ - serialize() -], Material.prototype, "disableDepthWrite", undefined); -__decorate2([ - serialize() -], Material.prototype, "disableColorWrite", undefined); -__decorate2([ - serialize() -], Material.prototype, "forceDepthWrite", undefined); -__decorate2([ - serialize() -], Material.prototype, "depthFunction", undefined); -__decorate2([ - serialize() -], Material.prototype, "separateCullingPass", undefined); -__decorate2([ - serialize("fogEnabled") -], Material.prototype, "_fogEnabled", undefined); -__decorate2([ - serialize() -], Material.prototype, "pointSize", undefined); -__decorate2([ - serialize() -], Material.prototype, "zOffset", undefined); -__decorate2([ - serialize() -], Material.prototype, "zOffsetUnits", undefined); -__decorate2([ - serialize() -], Material.prototype, "pointsCloud", null); -__decorate2([ - serialize() -], Material.prototype, "fillMode", null); -__decorate2([ - serialize() -], Material.prototype, "useLogarithmicDepth", null); -__decorate2([ - serialize() -], Material.prototype, "transparencyMode", null); +var init_material = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_tools(); + init_observable(); + init_engineStore(); + init_subMesh(); + init_uniformBuffer(); + init_logger(); + init_math_plane(); + init_materialHelper(); + init_drawWrapper(); + init_materialStencilState(); + init_scene(); + init_materialPluginEvent(); + Material.TriangleFillMode = 0; + Material.WireFrameFillMode = 1; + Material.PointFillMode = 2; + Material.PointListDrawMode = 3; + Material.LineListDrawMode = 4; + Material.LineLoopDrawMode = 5; + Material.LineStripDrawMode = 6; + Material.TriangleStripDrawMode = 7; + Material.TriangleFanDrawMode = 8; + Material.ClockWiseSideOrientation = 0; + Material.CounterClockWiseSideOrientation = 1; + Material.TextureDirtyFlag = 1; + Material.LightDirtyFlag = 2; + Material.FresnelDirtyFlag = 4; + Material.AttributesDirtyFlag = 8; + Material.MiscDirtyFlag = 16; + Material.PrePassDirtyFlag = 32; + Material.AllDirtyFlag = 63; + Material.MATERIAL_OPAQUE = 0; + Material.MATERIAL_ALPHATEST = 1; + Material.MATERIAL_ALPHABLEND = 2; + Material.MATERIAL_ALPHATESTANDBLEND = 3; + Material.MATERIAL_NORMALBLENDMETHOD_WHITEOUT = 0; + Material.MATERIAL_NORMALBLENDMETHOD_RNM = 1; + Material.OnEventObservable = new Observable; + Material._AllDirtyCallBack = (defines) => defines.markAllAsDirty(); + Material._ImageProcessingDirtyCallBack = (defines) => defines.markAsImageProcessingDirty(); + Material._TextureDirtyCallBack = (defines) => defines.markAsTexturesDirty(); + Material._FresnelDirtyCallBack = (defines) => defines.markAsFresnelDirty(); + Material._MiscDirtyCallBack = (defines) => defines.markAsMiscDirty(); + Material._PrePassDirtyCallBack = (defines) => defines.markAsPrePassDirty(); + Material._LightsDirtyCallBack = (defines) => defines.markAsLightDirty(); + Material._AttributeDirtyCallBack = (defines) => defines.markAsAttributesDirty(); + Material._FresnelAndMiscDirtyCallBack = (defines) => { + Material._FresnelDirtyCallBack(defines); + Material._MiscDirtyCallBack(defines); + }; + Material._TextureAndMiscDirtyCallBack = (defines) => { + Material._TextureDirtyCallBack(defines); + Material._MiscDirtyCallBack(defines); + }; + Material._DirtyCallbackArray = []; + Material._RunDirtyCallBacks = (defines) => { + for (const cb of Material._DirtyCallbackArray) { + cb(defines); + } + }; + __decorate2([ + serialize() + ], Material.prototype, "id", undefined); + __decorate2([ + serialize() + ], Material.prototype, "uniqueId", undefined); + __decorate2([ + serialize() + ], Material.prototype, "name", undefined); + __decorate2([ + serialize() + ], Material.prototype, "metadata", undefined); + __decorate2([ + serialize() + ], Material.prototype, "checkReadyOnEveryCall", undefined); + __decorate2([ + serialize() + ], Material.prototype, "checkReadyOnlyOnce", undefined); + __decorate2([ + serialize() + ], Material.prototype, "state", undefined); + __decorate2([ + serialize("alpha") + ], Material.prototype, "_alpha", undefined); + __decorate2([ + serialize("backFaceCulling") + ], Material.prototype, "_backFaceCulling", undefined); + __decorate2([ + serialize("cullBackFaces") + ], Material.prototype, "_cullBackFaces", undefined); + __decorate2([ + serialize() + ], Material.prototype, "sideOrientation", undefined); + __decorate2([ + serialize("alphaMode") + ], Material.prototype, "_alphaMode", undefined); + __decorate2([ + serialize() + ], Material.prototype, "_needDepthPrePass", undefined); + __decorate2([ + serialize() + ], Material.prototype, "disableDepthWrite", undefined); + __decorate2([ + serialize() + ], Material.prototype, "disableColorWrite", undefined); + __decorate2([ + serialize() + ], Material.prototype, "forceDepthWrite", undefined); + __decorate2([ + serialize() + ], Material.prototype, "depthFunction", undefined); + __decorate2([ + serialize() + ], Material.prototype, "separateCullingPass", undefined); + __decorate2([ + serialize("fogEnabled") + ], Material.prototype, "_fogEnabled", undefined); + __decorate2([ + serialize() + ], Material.prototype, "pointSize", undefined); + __decorate2([ + serialize() + ], Material.prototype, "zOffset", undefined); + __decorate2([ + serialize() + ], Material.prototype, "zOffsetUnits", undefined); + __decorate2([ + serialize() + ], Material.prototype, "pointsCloud", null); + __decorate2([ + serialize() + ], Material.prototype, "fillMode", null); + __decorate2([ + serialize() + ], Material.prototype, "useLogarithmicDepth", null); + __decorate2([ + serialize() + ], Material.prototype, "transparencyMode", null); +}); // node_modules/@babylonjs/core/Materials/multiMaterial.js class MultiMaterial extends Material { @@ -38204,8 +39070,8 @@ class MultiMaterial extends Material { getChildren() { return this.subMaterials; } - constructor(name, scene5) { - super(name, scene5, true); + constructor(name2, scene5) { + super(name2, scene5, true); this._waitingSubMaterialsUniqueIds = []; this.getScene().addMultiMaterial(this); this.subMaterials = []; @@ -38272,13 +39138,13 @@ class MultiMaterial extends Material { } return true; } - clone(name, cloneChildren) { - const newMultiMaterial = new MultiMaterial(name, this.getScene()); + clone(name2, cloneChildren) { + const newMultiMaterial = new MultiMaterial(name2, this.getScene()); for (let index = 0;index < this.subMaterials.length; index++) { let subMaterial = null; const current = this.subMaterials[index]; if (cloneChildren && current) { - subMaterial = current.clone(name + "-" + current.name); + subMaterial = current.clone(name2 + "-" + current.name); } else { subMaterial = this.subMaterials[index]; } @@ -38342,7 +39208,12 @@ class MultiMaterial extends Material { return multiMaterial; } } -RegisterClass("BABYLON.MultiMaterial", MultiMaterial); +var init_multiMaterial = __esm(() => { + init_material(); + init_tags(); + init_typeStore(); + RegisterClass("BABYLON.MultiMaterial", MultiMaterial); +}); // node_modules/@babylonjs/core/Meshes/meshLODLevel.js class MeshLODLevel { @@ -38351,6 +39222,8 @@ class MeshLODLevel { this.mesh = mesh; } } +var init_meshLODLevel = __esm(() => { +}); // node_modules/@babylonjs/core/Meshes/mesh.js class _CreationDataStorage { @@ -38522,8 +39395,8 @@ class Mesh extends AbstractMesh { set forceWorldMatrixInstancedBufferUpdate(value) { this._instanceDataStorage.forceMatrixUpdates = value; } - constructor(name, scene6 = null, parent = null, source = null, doNotCloneChildren, clonePhysicsImpostor = true) { - super(name, scene6); + constructor(name2, scene6 = null, parent = null, source = null, doNotCloneChildren, clonePhysicsImpostor = true) { + super(name2, scene6); this._internalMeshDataInfo = new _InternalMeshDataInfo; this.delayLoadState = 0; this.instances = []; @@ -38600,14 +39473,14 @@ class Mesh extends AbstractMesh { this._creationDataStorage = source._creationDataStorage; if (source._ranges) { const ranges = source._ranges; - for (const name2 in ranges) { - if (!Object.prototype.hasOwnProperty.call(ranges, name2)) { + for (const name3 in ranges) { + if (!Object.prototype.hasOwnProperty.call(ranges, name3)) { continue; } - if (!ranges[name2]) { + if (!ranges[name3]) { continue; } - this.createAnimationRange(name2, ranges[name2].from, ranges[name2].to); + this.createAnimationRange(name3, ranges[name3].from, ranges[name3].to); } } if (source.metadata && source.metadata.clone) { @@ -38622,14 +39495,14 @@ class Mesh extends AbstractMesh { this.setEnabled(source.isEnabled(false)); this.parent = source.parent; this.setPivotMatrix(source.getPivotMatrix()); - this.id = name + "." + source.id; + this.id = name2 + "." + source.id; this.material = source.material; if (!doNotCloneChildren) { const directDescendants = source.getDescendants(true); for (let index = 0;index < directDescendants.length; index++) { const child = directDescendants[index]; if (child.clone) { - child.clone(name + "." + child.name, this); + child.clone(name2 + "." + child.name, this); } } } @@ -39959,8 +40832,8 @@ class Mesh extends AbstractMesh { } return false; } - clone(name = "", newParent = null, doNotCloneChildren, clonePhysicsImpostor = true) { - return new Mesh(name, this.getScene(), newParent, this, doNotCloneChildren, clonePhysicsImpostor); + clone(name2 = "", newParent = null, doNotCloneChildren, clonePhysicsImpostor = true) { + return new Mesh(name2, this.getScene(), newParent, this, doNotCloneChildren, clonePhysicsImpostor); } dispose(doNotRecurse, disposeMaterialAndTextures = false) { this.morphTargetManager = null; @@ -40438,14 +41311,14 @@ class Mesh extends AbstractMesh { vertex_data.applyToMesh(this, this.isVertexBufferUpdatable(VertexBuffer.PositionKind)); } } - static _instancedMeshFactory(name, mesh) { + static _instancedMeshFactory(name2, mesh) { throw _WarnImport("InstancedMesh"); } static _PhysicsImpostorParser(scene6, physicObject, jsonObject) { throw _WarnImport("PhysicsImpostor"); } - createInstance(name) { - return Mesh._instancedMeshFactory(name, this); + createInstance(name2) { + return Mesh._instancedMeshFactory(name2, this); } synchronizeInstances() { for (let instanceIndex = 0;instanceIndex < this.instances.length; instanceIndex++) { @@ -41283,138 +42156,153 @@ class Mesh extends AbstractMesh { setMaterialByID(id) { return this.setMaterialById(id); } - static CreateRibbon(name, pathArray, closeArray, closePath, offset, scene6, updatable, sideOrientation, instance) { + static CreateRibbon(name2, pathArray, closeArray, closePath, offset, scene6, updatable, sideOrientation, instance) { throw new Error("Import MeshBuilder to populate this function"); } - static CreateDisc(name, radius, tessellation, scene6, updatable, sideOrientation) { + static CreateDisc(name2, radius, tessellation, scene6, updatable, sideOrientation) { throw new Error("Import MeshBuilder to populate this function"); } - static CreateBox(name, size, scene6, updatable, sideOrientation) { + static CreateBox(name2, size, scene6, updatable, sideOrientation) { throw new Error("Import MeshBuilder to populate this function"); } - static CreateSphere(name, segments, diameter, scene6, updatable, sideOrientation) { + static CreateSphere(name2, segments, diameter, scene6, updatable, sideOrientation) { throw new Error("Import MeshBuilder to populate this function"); } - static CreateHemisphere(name, segments, diameter, scene6) { + static CreateHemisphere(name2, segments, diameter, scene6) { throw new Error("Import MeshBuilder to populate this function"); } - static CreateCylinder(name, height, diameterTop, diameterBottom, tessellation, subdivisions, scene6, updatable, sideOrientation) { + static CreateCylinder(name2, height, diameterTop, diameterBottom, tessellation, subdivisions, scene6, updatable, sideOrientation) { throw new Error("Import MeshBuilder to populate this function"); } - static CreateTorus(name, diameter, thickness, tessellation, scene6, updatable, sideOrientation) { + static CreateTorus(name2, diameter, thickness, tessellation, scene6, updatable, sideOrientation) { throw new Error("Import MeshBuilder to populate this function"); } - static CreateTorusKnot(name, radius, tube, radialSegments, tubularSegments, p, q, scene6, updatable, sideOrientation) { + static CreateTorusKnot(name2, radius, tube, radialSegments, tubularSegments, p, q, scene6, updatable, sideOrientation) { throw new Error("Import MeshBuilder to populate this function"); } - static CreateLines(name, points, scene6, updatable, instance) { + static CreateLines(name2, points, scene6, updatable, instance) { throw new Error("Import MeshBuilder to populate this function"); } - static CreateDashedLines(name, points, dashSize, gapSize, dashNb, scene6, updatable, instance) { + static CreateDashedLines(name2, points, dashSize, gapSize, dashNb, scene6, updatable, instance) { throw new Error("Import MeshBuilder to populate this function"); } - static CreatePolygon(name, shape, scene6, holes, updatable, sideOrientation, earcutInjection) { + static CreatePolygon(name2, shape, scene6, holes, updatable, sideOrientation, earcutInjection) { throw new Error("Import MeshBuilder to populate this function"); } - static ExtrudePolygon(name, shape, depth, scene6, holes, updatable, sideOrientation, earcutInjection) { + static ExtrudePolygon(name2, shape, depth, scene6, holes, updatable, sideOrientation, earcutInjection) { throw new Error("Import MeshBuilder to populate this function"); } - static ExtrudeShape(name, shape, path, scale, rotation, cap, scene6, updatable, sideOrientation, instance) { + static ExtrudeShape(name2, shape, path, scale, rotation, cap, scene6, updatable, sideOrientation, instance) { throw new Error("Import MeshBuilder to populate this function"); } - static ExtrudeShapeCustom(name, shape, path, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, scene6, updatable, sideOrientation, instance) { + static ExtrudeShapeCustom(name2, shape, path, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, scene6, updatable, sideOrientation, instance) { throw new Error("Import MeshBuilder to populate this function"); } - static CreateLathe(name, shape, radius, tessellation, scene6, updatable, sideOrientation) { + static CreateLathe(name2, shape, radius, tessellation, scene6, updatable, sideOrientation) { throw new Error("Import MeshBuilder to populate this function"); } - static CreatePlane(name, size, scene6, updatable, sideOrientation) { + static CreatePlane(name2, size, scene6, updatable, sideOrientation) { throw new Error("Import MeshBuilder to populate this function"); } - static CreateGround(name, width, height, subdivisions, scene6, updatable) { + static CreateGround(name2, width, height, subdivisions, scene6, updatable) { throw new Error("Import MeshBuilder to populate this function"); } - static CreateTiledGround(name, xmin, zmin, xmax, zmax, subdivisions, precision, scene6, updatable) { + static CreateTiledGround(name2, xmin, zmin, xmax, zmax, subdivisions, precision, scene6, updatable) { throw new Error("Import MeshBuilder to populate this function"); } - static CreateGroundFromHeightMap(name, url, width, height, subdivisions, minHeight, maxHeight, scene6, updatable, onReady, alphaFilter) { + static CreateGroundFromHeightMap(name2, url, width, height, subdivisions, minHeight, maxHeight, scene6, updatable, onReady, alphaFilter) { throw new Error("Import MeshBuilder to populate this function"); } - static CreateTube(name, path, radius, tessellation, radiusFunction, cap, scene6, updatable, sideOrientation, instance) { + static CreateTube(name2, path, radius, tessellation, radiusFunction, cap, scene6, updatable, sideOrientation, instance) { throw new Error("Import MeshBuilder to populate this function"); } - static CreatePolyhedron(name, options, scene6) { + static CreatePolyhedron(name2, options, scene6) { throw new Error("Import MeshBuilder to populate this function"); } - static CreateIcoSphere(name, options, scene6) { + static CreateIcoSphere(name2, options, scene6) { throw new Error("Import MeshBuilder to populate this function"); } - static CreateDecal(name, sourceMesh, position, normal, size, angle) { + static CreateDecal(name2, sourceMesh, position, normal, size, angle) { throw new Error("Import MeshBuilder to populate this function"); } - static CreateCapsule(name, options, scene6) { + static CreateCapsule(name2, options, scene6) { throw new Error("Import MeshBuilder to populate this function"); } static ExtendToGoldberg(mesh) { throw new Error("Import MeshBuilder to populate this function"); } } -Mesh.FRONTSIDE = VertexData.FRONTSIDE; -Mesh.BACKSIDE = VertexData.BACKSIDE; -Mesh.DOUBLESIDE = VertexData.DOUBLESIDE; -Mesh.DEFAULTSIDE = VertexData.DEFAULTSIDE; -Mesh.NO_CAP = 0; -Mesh.CAP_START = 1; -Mesh.CAP_END = 2; -Mesh.CAP_ALL = 3; -Mesh.NO_FLIP = 0; -Mesh.FLIP_TILE = 1; -Mesh.ROTATE_TILE = 2; -Mesh.FLIP_ROW = 3; -Mesh.ROTATE_ROW = 4; -Mesh.FLIP_N_ROTATE_TILE = 5; -Mesh.FLIP_N_ROTATE_ROW = 6; -Mesh.CENTER = 0; -Mesh.LEFT = 1; -Mesh.RIGHT = 2; -Mesh.TOP = 3; -Mesh.BOTTOM = 4; -Mesh.INSTANCEDMESH_SORT_TRANSPARENT = false; -Mesh._GroundMeshParser = (parsedMesh, scene6) => { - throw _WarnImport("GroundMesh"); -}; -Mesh._GoldbergMeshParser = (parsedMesh, scene6) => { - throw _WarnImport("GoldbergMesh"); -}; -Mesh._LinesMeshParser = (parsedMesh, scene6) => { - throw _WarnImport("LinesMesh"); -}; -Mesh._GreasedLineMeshParser = (parsedMesh, scene6) => { - throw _WarnImport("GreasedLineMesh"); -}; -Mesh._GreasedLineRibbonMeshParser = (parsedMesh, scene6) => { - throw _WarnImport("GreasedLineRibbonMesh"); -}; -Mesh._TrailMeshParser = (parsedMesh, scene6) => { - throw _WarnImport("TrailMesh"); -}; -RegisterClass("BABYLON.Mesh", Mesh); +var init_mesh = __esm(() => { + init_observable(); + init_tools(); + init_deepCopier(); + init_tags(); + init_coroutine(); + init_camera(); + init_scene(); + init_math_vector(); + init_math_color(); + init_node(); + init_buffer(); + init_mesh_vertexData(); + init_geometry(); + init_abstractMesh(); + init_subMesh(); + init_material(); + init_multiMaterial(); + init_sceneLoaderFlags(); + init_decorators(); + init_logger(); + init_typeStore(); + init_devTools(); + init_sceneComponent(); + init_meshLODLevel(); + Mesh.FRONTSIDE = VertexData.FRONTSIDE; + Mesh.BACKSIDE = VertexData.BACKSIDE; + Mesh.DOUBLESIDE = VertexData.DOUBLESIDE; + Mesh.DEFAULTSIDE = VertexData.DEFAULTSIDE; + Mesh.NO_CAP = 0; + Mesh.CAP_START = 1; + Mesh.CAP_END = 2; + Mesh.CAP_ALL = 3; + Mesh.NO_FLIP = 0; + Mesh.FLIP_TILE = 1; + Mesh.ROTATE_TILE = 2; + Mesh.FLIP_ROW = 3; + Mesh.ROTATE_ROW = 4; + Mesh.FLIP_N_ROTATE_TILE = 5; + Mesh.FLIP_N_ROTATE_ROW = 6; + Mesh.CENTER = 0; + Mesh.LEFT = 1; + Mesh.RIGHT = 2; + Mesh.TOP = 3; + Mesh.BOTTOM = 4; + Mesh.INSTANCEDMESH_SORT_TRANSPARENT = false; + Mesh._GroundMeshParser = (parsedMesh, scene6) => { + throw _WarnImport("GroundMesh"); + }; + Mesh._GoldbergMeshParser = (parsedMesh, scene6) => { + throw _WarnImport("GoldbergMesh"); + }; + Mesh._LinesMeshParser = (parsedMesh, scene6) => { + throw _WarnImport("LinesMesh"); + }; + Mesh._GreasedLineMeshParser = (parsedMesh, scene6) => { + throw _WarnImport("GreasedLineMesh"); + }; + Mesh._GreasedLineRibbonMeshParser = (parsedMesh, scene6) => { + throw _WarnImport("GreasedLineRibbonMesh"); + }; + Mesh._TrailMeshParser = (parsedMesh, scene6) => { + throw _WarnImport("TrailMesh"); + }; + RegisterClass("BABYLON.Mesh", Mesh); +}); // node_modules/@babylonjs/core/Meshes/instancedMesh.js -Mesh._instancedMeshFactory = (name, mesh2) => { - const instance = new InstancedMesh(name, mesh2); - if (mesh2.instancedBuffers) { - instance.instancedBuffers = {}; - for (const key in mesh2.instancedBuffers) { - instance.instancedBuffers[key] = mesh2.instancedBuffers[key]; - } - } - return instance; -}; - class InstancedMesh extends AbstractMesh { - constructor(name, source) { - super(name, source.getScene()); + constructor(name2, source) { + super(name2, source.getScene()); this._indexInSourceMeshInstanceArray = -1; this._distanceToCamera = 0; source.addInstance(this); @@ -41503,8 +42391,8 @@ class InstancedMesh extends AbstractMesh { get sourceMesh() { return this._sourceMesh; } - createInstance(name) { - return this._sourceMesh.createInstance(name); + createInstance(name2) { + return this._sourceMesh.createInstance(name2); } isReady(completeCheck = false) { return this._sourceMesh.isReady(completeCheck, true); @@ -41644,8 +42532,8 @@ class InstancedMesh extends AbstractMesh { this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache); return this; } - clone(name, newParent = null, doNotCloneChildren, newSourceMesh) { - const result = (newSourceMesh || this._sourceMesh).createInstance(name); + clone(name2, newParent = null, doNotCloneChildren, newSourceMesh) { + const result = (newSourceMesh || this._sourceMesh).createInstance(name2); DeepCopier.DeepCopy(this, result, [ "name", "subMeshes", @@ -41716,110 +42604,130 @@ class InstancedMesh extends AbstractMesh { return clone; } } -Mesh.prototype.registerInstancedBuffer = function(kind, stride) { - var _a, _b; - (_b = (_a = this._userInstancedBuffersStorage) === null || _a === undefined ? undefined : _a.vertexBuffers[kind]) === null || _b === undefined || _b.dispose(); - if (!this.instancedBuffers) { - this.instancedBuffers = {}; - for (const instance of this.instances) { +var init_instancedMesh = __esm(() => { + init_math_vector(); + init_logger(); + init_abstractMesh(); + init_mesh(); + init_deepCopier(); + init_transformNode(); + init_buffer(); + init_tools(); + Mesh._instancedMeshFactory = (name2, mesh2) => { + const instance = new InstancedMesh(name2, mesh2); + if (mesh2.instancedBuffers) { instance.instancedBuffers = {}; - } - } - if (!this._userInstancedBuffersStorage) { - this._userInstancedBuffersStorage = { - data: {}, - vertexBuffers: {}, - strides: {}, - sizes: {}, - vertexArrayObjects: this.getEngine().getCaps().vertexArrayObject ? {} : undefined - }; - } - this.instancedBuffers[kind] = null; - this._userInstancedBuffersStorage.strides[kind] = stride; - this._userInstancedBuffersStorage.sizes[kind] = stride * 32; - this._userInstancedBuffersStorage.data[kind] = new Float32Array(this._userInstancedBuffersStorage.sizes[kind]); - this._userInstancedBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), this._userInstancedBuffersStorage.data[kind], kind, true, false, stride, true); - for (const instance of this.instances) { - instance.instancedBuffers[kind] = null; - } - this._invalidateInstanceVertexArrayObject(); - this._markSubMeshesAsAttributesDirty(); -}; -Mesh.prototype._processInstancedBuffers = function(visibleInstances, renderSelf) { - const instanceCount = visibleInstances ? visibleInstances.length : 0; - for (const kind in this.instancedBuffers) { - let size = this._userInstancedBuffersStorage.sizes[kind]; - const stride = this._userInstancedBuffersStorage.strides[kind]; - const expectedSize = (instanceCount + 1) * stride; - while (size < expectedSize) { - size *= 2; - } - if (this._userInstancedBuffersStorage.data[kind].length != size) { - this._userInstancedBuffersStorage.data[kind] = new Float32Array(size); - this._userInstancedBuffersStorage.sizes[kind] = size; - if (this._userInstancedBuffersStorage.vertexBuffers[kind]) { - this._userInstancedBuffersStorage.vertexBuffers[kind].dispose(); - this._userInstancedBuffersStorage.vertexBuffers[kind] = null; + for (const key in mesh2.instancedBuffers) { + instance.instancedBuffers[key] = mesh2.instancedBuffers[key]; } } - const data = this._userInstancedBuffersStorage.data[kind]; - let offset = 0; - if (renderSelf) { - const value = this.instancedBuffers[kind]; - if (value.toArray) { - value.toArray(data, offset); - } else if (value.copyToArray) { - value.copyToArray(data, offset); - } else { - data[offset] = value; - } - offset += stride; + return instance; + }; + Mesh.prototype.registerInstancedBuffer = function(kind, stride) { + var _a, _b; + (_b = (_a = this._userInstancedBuffersStorage) === null || _a === undefined ? undefined : _a.vertexBuffers[kind]) === null || _b === undefined || _b.dispose(); + if (!this.instancedBuffers) { + this.instancedBuffers = {}; + for (const instance of this.instances) { + instance.instancedBuffers = {}; + } + } + if (!this._userInstancedBuffersStorage) { + this._userInstancedBuffersStorage = { + data: {}, + vertexBuffers: {}, + strides: {}, + sizes: {}, + vertexArrayObjects: this.getEngine().getCaps().vertexArrayObject ? {} : undefined + }; } - for (let instanceIndex = 0;instanceIndex < instanceCount; instanceIndex++) { - const instance = visibleInstances[instanceIndex]; - const value = instance.instancedBuffers[kind]; - if (value.toArray) { - value.toArray(data, offset); - } else if (value.copyToArray) { - value.copyToArray(data, offset); + this.instancedBuffers[kind] = null; + this._userInstancedBuffersStorage.strides[kind] = stride; + this._userInstancedBuffersStorage.sizes[kind] = stride * 32; + this._userInstancedBuffersStorage.data[kind] = new Float32Array(this._userInstancedBuffersStorage.sizes[kind]); + this._userInstancedBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), this._userInstancedBuffersStorage.data[kind], kind, true, false, stride, true); + for (const instance of this.instances) { + instance.instancedBuffers[kind] = null; + } + this._invalidateInstanceVertexArrayObject(); + this._markSubMeshesAsAttributesDirty(); + }; + Mesh.prototype._processInstancedBuffers = function(visibleInstances, renderSelf) { + const instanceCount = visibleInstances ? visibleInstances.length : 0; + for (const kind in this.instancedBuffers) { + let size = this._userInstancedBuffersStorage.sizes[kind]; + const stride = this._userInstancedBuffersStorage.strides[kind]; + const expectedSize = (instanceCount + 1) * stride; + while (size < expectedSize) { + size *= 2; + } + if (this._userInstancedBuffersStorage.data[kind].length != size) { + this._userInstancedBuffersStorage.data[kind] = new Float32Array(size); + this._userInstancedBuffersStorage.sizes[kind] = size; + if (this._userInstancedBuffersStorage.vertexBuffers[kind]) { + this._userInstancedBuffersStorage.vertexBuffers[kind].dispose(); + this._userInstancedBuffersStorage.vertexBuffers[kind] = null; + } + } + const data = this._userInstancedBuffersStorage.data[kind]; + let offset = 0; + if (renderSelf) { + const value = this.instancedBuffers[kind]; + if (value.toArray) { + value.toArray(data, offset); + } else if (value.copyToArray) { + value.copyToArray(data, offset); + } else { + data[offset] = value; + } + offset += stride; + } + for (let instanceIndex = 0;instanceIndex < instanceCount; instanceIndex++) { + const instance = visibleInstances[instanceIndex]; + const value = instance.instancedBuffers[kind]; + if (value.toArray) { + value.toArray(data, offset); + } else if (value.copyToArray) { + value.copyToArray(data, offset); + } else { + data[offset] = value; + } + offset += stride; + } + if (!this._userInstancedBuffersStorage.vertexBuffers[kind]) { + this._userInstancedBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), this._userInstancedBuffersStorage.data[kind], kind, true, false, stride, true); + this._invalidateInstanceVertexArrayObject(); } else { - data[offset] = value; + this._userInstancedBuffersStorage.vertexBuffers[kind].updateDirectly(data, 0); } - offset += stride; } - if (!this._userInstancedBuffersStorage.vertexBuffers[kind]) { - this._userInstancedBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), this._userInstancedBuffersStorage.data[kind], kind, true, false, stride, true); - this._invalidateInstanceVertexArrayObject(); - } else { - this._userInstancedBuffersStorage.vertexBuffers[kind].updateDirectly(data, 0); + }; + Mesh.prototype._invalidateInstanceVertexArrayObject = function() { + if (!this._userInstancedBuffersStorage || this._userInstancedBuffersStorage.vertexArrayObjects === undefined) { + return; } - } -}; -Mesh.prototype._invalidateInstanceVertexArrayObject = function() { - if (!this._userInstancedBuffersStorage || this._userInstancedBuffersStorage.vertexArrayObjects === undefined) { - return; - } - for (const kind in this._userInstancedBuffersStorage.vertexArrayObjects) { - this.getEngine().releaseVertexArrayObject(this._userInstancedBuffersStorage.vertexArrayObjects[kind]); - } - this._userInstancedBuffersStorage.vertexArrayObjects = {}; -}; -Mesh.prototype._disposeInstanceSpecificData = function() { - if (this._instanceDataStorage.instancesBuffer) { - this._instanceDataStorage.instancesBuffer.dispose(); - this._instanceDataStorage.instancesBuffer = null; - } - while (this.instances.length) { - this.instances[0].dispose(); - } - for (const kind in this.instancedBuffers) { - if (this._userInstancedBuffersStorage.vertexBuffers[kind]) { - this._userInstancedBuffersStorage.vertexBuffers[kind].dispose(); + for (const kind in this._userInstancedBuffersStorage.vertexArrayObjects) { + this.getEngine().releaseVertexArrayObject(this._userInstancedBuffersStorage.vertexArrayObjects[kind]); } - } - this._invalidateInstanceVertexArrayObject(); - this.instancedBuffers = {}; -}; + this._userInstancedBuffersStorage.vertexArrayObjects = {}; + }; + Mesh.prototype._disposeInstanceSpecificData = function() { + if (this._instanceDataStorage.instancesBuffer) { + this._instanceDataStorage.instancesBuffer.dispose(); + this._instanceDataStorage.instancesBuffer = null; + } + while (this.instances.length) { + this.instances[0].dispose(); + } + for (const kind in this.instancedBuffers) { + if (this._userInstancedBuffersStorage.vertexBuffers[kind]) { + this._userInstancedBuffersStorage.vertexBuffers[kind].dispose(); + } + } + this._invalidateInstanceVertexArrayObject(); + this.instancedBuffers = {}; + }; +}); // node_modules/@babylonjs/core/Lights/light.js class Light extends Node2 { @@ -41898,8 +42806,8 @@ class Light extends Node2 { getProjectionMatrix(_viewMatrix, _renderList) { return null; } - constructor(name, scene6) { - super(name, scene6); + constructor(name2, scene6) { + super(name2, scene6); this.diffuse = new Color3(1, 1, 1); this.specular = new Color3(1, 1, 1); this.falloffType = Light.FALLOFF_DEFAULT; @@ -41919,7 +42827,7 @@ class Light extends Node2 { this._includedOnlyMeshesIds = new Array; this._isLight = true; this.getScene().addLight(this); - this._uniformBuffer = new UniformBuffer(this.getScene().getEngine(), undefined, undefined, name); + this._uniformBuffer = new UniformBuffer(this.getScene().getEngine(), undefined, undefined, name2); this._buildUniformLayout(); this.includedOnlyMeshes = []; this.excludedMeshes = []; @@ -42044,14 +42952,14 @@ class Light extends Node2 { getScaledIntensity() { return this._photometricScale * this.intensity; } - clone(name, newParent = null) { - const constructor = Light.GetConstructorFromName(this.getTypeID(), name, this.getScene()); + clone(name2, newParent = null) { + const constructor = Light.GetConstructorFromName(this.getTypeID(), name2, this.getScene()); if (!constructor) { return null; } const clonedLight = SerializationHelper.Clone(constructor, this); - if (name) { - clonedLight.name = name; + if (name2) { + clonedLight.name = name2; } if (newParent) { clonedLight.parent = newParent; @@ -42084,8 +42992,8 @@ class Light extends Node2 { serializationObject.isEnabled = this.isEnabled(); return serializationObject; } - static GetConstructorFromName(type, name, scene6) { - const constructorFunc = Node2.Construct("Light_Type_" + type, name, scene6); + static GetConstructorFromName(type, name2, scene6) { + const constructorFunc = Node2.Construct("Light_Type_" + type, name2, scene6); if (constructorFunc) { return constructorFunc; } @@ -42239,61 +43147,71 @@ class Light extends Node2 { this.getScene().sortLightsByPriority(); } } -Light.FALLOFF_DEFAULT = LightConstants.FALLOFF_DEFAULT; -Light.FALLOFF_PHYSICAL = LightConstants.FALLOFF_PHYSICAL; -Light.FALLOFF_GLTF = LightConstants.FALLOFF_GLTF; -Light.FALLOFF_STANDARD = LightConstants.FALLOFF_STANDARD; -Light.LIGHTMAP_DEFAULT = LightConstants.LIGHTMAP_DEFAULT; -Light.LIGHTMAP_SPECULAR = LightConstants.LIGHTMAP_SPECULAR; -Light.LIGHTMAP_SHADOWSONLY = LightConstants.LIGHTMAP_SHADOWSONLY; -Light.INTENSITYMODE_AUTOMATIC = LightConstants.INTENSITYMODE_AUTOMATIC; -Light.INTENSITYMODE_LUMINOUSPOWER = LightConstants.INTENSITYMODE_LUMINOUSPOWER; -Light.INTENSITYMODE_LUMINOUSINTENSITY = LightConstants.INTENSITYMODE_LUMINOUSINTENSITY; -Light.INTENSITYMODE_ILLUMINANCE = LightConstants.INTENSITYMODE_ILLUMINANCE; -Light.INTENSITYMODE_LUMINANCE = LightConstants.INTENSITYMODE_LUMINANCE; -Light.LIGHTTYPEID_POINTLIGHT = LightConstants.LIGHTTYPEID_POINTLIGHT; -Light.LIGHTTYPEID_DIRECTIONALLIGHT = LightConstants.LIGHTTYPEID_DIRECTIONALLIGHT; -Light.LIGHTTYPEID_SPOTLIGHT = LightConstants.LIGHTTYPEID_SPOTLIGHT; -Light.LIGHTTYPEID_HEMISPHERICLIGHT = LightConstants.LIGHTTYPEID_HEMISPHERICLIGHT; -__decorate2([ - serializeAsColor3() -], Light.prototype, "diffuse", undefined); -__decorate2([ - serializeAsColor3() -], Light.prototype, "specular", undefined); -__decorate2([ - serialize() -], Light.prototype, "falloffType", undefined); -__decorate2([ - serialize() -], Light.prototype, "intensity", undefined); -__decorate2([ - serialize() -], Light.prototype, "range", null); -__decorate2([ - serialize() -], Light.prototype, "intensityMode", null); -__decorate2([ - serialize() -], Light.prototype, "radius", null); -__decorate2([ - serialize() -], Light.prototype, "_renderPriority", undefined); -__decorate2([ - expandToProperty("_reorderLightsInScene") -], Light.prototype, "renderPriority", undefined); -__decorate2([ - serialize("shadowEnabled") -], Light.prototype, "_shadowEnabled", undefined); -__decorate2([ - serialize("excludeWithLayerMask") -], Light.prototype, "_excludeWithLayerMask", undefined); -__decorate2([ - serialize("includeOnlyWithLayerMask") -], Light.prototype, "_includeOnlyWithLayerMask", undefined); -__decorate2([ - serialize("lightmapMode") -], Light.prototype, "_lightmapMode", undefined); +var init_light = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_math_color(); + init_node(); + init_uniformBuffer(); + init_typeStore(); + init_lightConstants(); + Light.FALLOFF_DEFAULT = LightConstants.FALLOFF_DEFAULT; + Light.FALLOFF_PHYSICAL = LightConstants.FALLOFF_PHYSICAL; + Light.FALLOFF_GLTF = LightConstants.FALLOFF_GLTF; + Light.FALLOFF_STANDARD = LightConstants.FALLOFF_STANDARD; + Light.LIGHTMAP_DEFAULT = LightConstants.LIGHTMAP_DEFAULT; + Light.LIGHTMAP_SPECULAR = LightConstants.LIGHTMAP_SPECULAR; + Light.LIGHTMAP_SHADOWSONLY = LightConstants.LIGHTMAP_SHADOWSONLY; + Light.INTENSITYMODE_AUTOMATIC = LightConstants.INTENSITYMODE_AUTOMATIC; + Light.INTENSITYMODE_LUMINOUSPOWER = LightConstants.INTENSITYMODE_LUMINOUSPOWER; + Light.INTENSITYMODE_LUMINOUSINTENSITY = LightConstants.INTENSITYMODE_LUMINOUSINTENSITY; + Light.INTENSITYMODE_ILLUMINANCE = LightConstants.INTENSITYMODE_ILLUMINANCE; + Light.INTENSITYMODE_LUMINANCE = LightConstants.INTENSITYMODE_LUMINANCE; + Light.LIGHTTYPEID_POINTLIGHT = LightConstants.LIGHTTYPEID_POINTLIGHT; + Light.LIGHTTYPEID_DIRECTIONALLIGHT = LightConstants.LIGHTTYPEID_DIRECTIONALLIGHT; + Light.LIGHTTYPEID_SPOTLIGHT = LightConstants.LIGHTTYPEID_SPOTLIGHT; + Light.LIGHTTYPEID_HEMISPHERICLIGHT = LightConstants.LIGHTTYPEID_HEMISPHERICLIGHT; + __decorate2([ + serializeAsColor3() + ], Light.prototype, "diffuse", undefined); + __decorate2([ + serializeAsColor3() + ], Light.prototype, "specular", undefined); + __decorate2([ + serialize() + ], Light.prototype, "falloffType", undefined); + __decorate2([ + serialize() + ], Light.prototype, "intensity", undefined); + __decorate2([ + serialize() + ], Light.prototype, "range", null); + __decorate2([ + serialize() + ], Light.prototype, "intensityMode", null); + __decorate2([ + serialize() + ], Light.prototype, "radius", null); + __decorate2([ + serialize() + ], Light.prototype, "_renderPriority", undefined); + __decorate2([ + expandToProperty("_reorderLightsInScene") + ], Light.prototype, "renderPriority", undefined); + __decorate2([ + serialize("shadowEnabled") + ], Light.prototype, "_shadowEnabled", undefined); + __decorate2([ + serialize("excludeWithLayerMask") + ], Light.prototype, "_excludeWithLayerMask", undefined); + __decorate2([ + serialize("includeOnlyWithLayerMask") + ], Light.prototype, "_includeOnlyWithLayerMask", undefined); + __decorate2([ + serialize("lightmapMode") + ], Light.prototype, "_lightmapMode", undefined); +}); // node_modules/@babylonjs/core/assetContainer.js class KeepAssets extends AbstractScene { @@ -42978,17 +43896,17 @@ class AssetContainer extends AbstractScene { const _targetConverter = targetConverter ? targetConverter : (target) => { let node7 = null; const targetProperty = target.animations.length ? target.animations[0].targetProperty : ""; - const name = target.name.split(".").join("").split("_primitive")[0]; + const name2 = target.name.split(".").join("").split("_primitive")[0]; switch (targetProperty) { case "position": case "rotationQuaternion": - node7 = scene6.getTransformNodeByName(target.name) || scene6.getTransformNodeByName(name); + node7 = scene6.getTransformNodeByName(target.name) || scene6.getTransformNodeByName(name2); break; case "influence": - node7 = scene6.getMorphTargetByName(target.name) || scene6.getMorphTargetByName(name); + node7 = scene6.getMorphTargetByName(target.name) || scene6.getMorphTargetByName(name2); break; default: - node7 = scene6.getNodeByName(target.name) || scene6.getNodeByName(name); + node7 = scene6.getNodeByName(target.name) || scene6.getNodeByName(name2); } return node7; }; @@ -43096,11 +44014,148 @@ class AssetContainer extends AbstractScene { this.populateRootNodes(); } } -// node_modules/@babylonjs/core/Audio/audioEngine.js -Engine2.AudioEngineFactory = (hostElement, audioContext, audioDestination) => { - return new AudioEngine(hostElement, audioContext, audioDestination); -}; +var init_assetContainer = __esm(() => { + init_abstractScene(); + init_mesh(); + init_transformNode(); + init_abstractMesh(); + init_logger(); + init_engineStore(); + init_instancedMesh(); + init_light(); + init_camera(); + init_tools(); +}); + +// node_modules/@babylonjs/core/Audio/Interfaces/IAudioEngine.js +var init_IAudioEngine = __esm(() => { +}); + +// node_modules/@babylonjs/core/Audio/Interfaces/ISoundOptions.js +var init_ISoundOptions = __esm(() => { +}); + +// node_modules/@babylonjs/core/Audio/analyser.js +class Analyser { + constructor(scene6) { + this.SMOOTHING = 0.75; + this.FFT_SIZE = 512; + this.BARGRAPHAMPLITUDE = 256; + this.DEBUGCANVASPOS = { x: 20, y: 20 }; + this.DEBUGCANVASSIZE = { width: 320, height: 200 }; + scene6 = scene6 || EngineStore.LastCreatedScene; + if (!scene6) { + return; + } + this._scene = scene6; + if (!Engine2.audioEngine) { + Tools.Warn("No audio engine initialized, failed to create an audio analyser"); + return; + } + this._audioEngine = Engine2.audioEngine; + if (this._audioEngine.canUseWebAudio && this._audioEngine.audioContext) { + this._webAudioAnalyser = this._audioEngine.audioContext.createAnalyser(); + this._webAudioAnalyser.minDecibels = -140; + this._webAudioAnalyser.maxDecibels = 0; + this._byteFreqs = new Uint8Array(this._webAudioAnalyser.frequencyBinCount); + this._byteTime = new Uint8Array(this._webAudioAnalyser.frequencyBinCount); + this._floatFreqs = new Float32Array(this._webAudioAnalyser.frequencyBinCount); + } + } + getFrequencyBinCount() { + if (this._audioEngine.canUseWebAudio) { + return this._webAudioAnalyser.frequencyBinCount; + } else { + return 0; + } + } + getByteFrequencyData() { + if (this._audioEngine.canUseWebAudio) { + this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING; + this._webAudioAnalyser.fftSize = this.FFT_SIZE; + this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs); + } + return this._byteFreqs; + } + getByteTimeDomainData() { + if (this._audioEngine.canUseWebAudio) { + this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING; + this._webAudioAnalyser.fftSize = this.FFT_SIZE; + this._webAudioAnalyser.getByteTimeDomainData(this._byteTime); + } + return this._byteTime; + } + getFloatFrequencyData() { + if (this._audioEngine.canUseWebAudio) { + this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING; + this._webAudioAnalyser.fftSize = this.FFT_SIZE; + this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs); + } + return this._floatFreqs; + } + drawDebugCanvas() { + if (this._audioEngine.canUseWebAudio) { + if (!this._debugCanvas) { + this._debugCanvas = document.createElement("canvas"); + this._debugCanvas.width = this.DEBUGCANVASSIZE.width; + this._debugCanvas.height = this.DEBUGCANVASSIZE.height; + this._debugCanvas.style.position = "absolute"; + this._debugCanvas.style.top = this.DEBUGCANVASPOS.y + "px"; + this._debugCanvas.style.left = this.DEBUGCANVASPOS.x + "px"; + this._debugCanvasContext = this._debugCanvas.getContext("2d"); + document.body.appendChild(this._debugCanvas); + this._registerFunc = () => { + this.drawDebugCanvas(); + }; + this._scene.registerBeforeRender(this._registerFunc); + } + if (this._registerFunc && this._debugCanvasContext) { + const workingArray = this.getByteFrequencyData(); + this._debugCanvasContext.fillStyle = "rgb(0, 0, 0)"; + this._debugCanvasContext.fillRect(0, 0, this.DEBUGCANVASSIZE.width, this.DEBUGCANVASSIZE.height); + for (let i = 0;i < this.getFrequencyBinCount(); i++) { + const value = workingArray[i]; + const percent = value / this.BARGRAPHAMPLITUDE; + const height = this.DEBUGCANVASSIZE.height * percent; + const offset = this.DEBUGCANVASSIZE.height - height - 1; + const barWidth = this.DEBUGCANVASSIZE.width / this.getFrequencyBinCount(); + const hue = i / this.getFrequencyBinCount() * 360; + this._debugCanvasContext.fillStyle = "hsl(" + hue + ", 100%, 50%)"; + this._debugCanvasContext.fillRect(i * barWidth, offset, barWidth, height); + } + } + } + } + stopDebugCanvas() { + if (this._debugCanvas) { + if (this._registerFunc) { + this._scene.unregisterBeforeRender(this._registerFunc); + this._registerFunc = null; + } + document.body.removeChild(this._debugCanvas); + this._debugCanvas = null; + this._debugCanvasContext = null; + } + } + connectAudioNodes(inputAudioNode, outputAudioNode) { + if (this._audioEngine.canUseWebAudio) { + inputAudioNode.connect(this._webAudioAnalyser); + this._webAudioAnalyser.connect(outputAudioNode); + } + } + dispose() { + if (this._audioEngine.canUseWebAudio) { + this._webAudioAnalyser.disconnect(); + } + } +} +var init_analyser = __esm(() => { + init_engine(); + init_tools(); + init_engineStore(); +}); +// node_modules/@babylonjs/core/Audio/audioEngine.js class AudioEngine { get audioContext() { if (!this._audioContextInitialized) { @@ -43292,6 +44347,16 @@ class AudioEngine { } } } +var init_audioEngine = __esm(() => { + init_observable(); + init_logger(); + init_engine(); + init_domManagement(); + Engine2.AudioEngineFactory = (hostElement, audioContext, audioDestination) => { + return new AudioEngine(hostElement, audioContext, audioDestination); + }; +}); + // node_modules/@babylonjs/core/Audio/sound.js class Sound { get loop() { @@ -43334,7 +44399,7 @@ class Sound { this.play(); } } - constructor(name, urlOrArrayBuffer, scene6, readyToPlayCallback = null, options) { + constructor(name2, urlOrArrayBuffer, scene6, readyToPlayCallback = null, options) { var _a, _b, _c, _d, _e; this.autoplay = false; this._loop = false; @@ -43363,7 +44428,7 @@ class Sound { this._coneOuterGain = 0; this._isOutputConnected = false; this._urlType = "Unknown"; - this.name = name; + this.name = name2; scene6 = scene6 || EngineStore.LastCreatedScene; if (!scene6) { return; @@ -44229,9 +45294,18 @@ class Sound { } } } -Sound._SceneComponentInitialization = (_) => { - throw _WarnImport("AudioSceneComponent"); -}; +var init_sound = __esm(() => { + init_tools(); + init_observable(); + init_math_vector(); + init_engine(); + init_logger(); + init_devTools(); + init_engineStore(); + Sound._SceneComponentInitialization = (_) => { + throw _WarnImport("AudioSceneComponent"); + }; +}); // node_modules/@babylonjs/core/Audio/soundTrack.js class SoundTrack { @@ -44335,184 +45409,12 @@ class SoundTrack { } } } - -// node_modules/@babylonjs/core/Audio/audioSceneComponent.js -AbstractScene.AddParser(SceneComponentConstants.NAME_AUDIO, (parsedData, scene7, container, rootUrl) => { - var _a; - let loadedSounds = []; - let loadedSound; - container.sounds = container.sounds || []; - if (parsedData.sounds !== undefined && parsedData.sounds !== null) { - for (let index = 0, cache = parsedData.sounds.length;index < cache; index++) { - const parsedSound = parsedData.sounds[index]; - if ((_a = Engine2.audioEngine) === null || _a === undefined ? undefined : _a.canUseWebAudio) { - if (!parsedSound.url) { - parsedSound.url = parsedSound.name; - } - if (!loadedSounds[parsedSound.url]) { - loadedSound = Sound.Parse(parsedSound, scene7, rootUrl); - loadedSounds[parsedSound.url] = loadedSound; - container.sounds.push(loadedSound); - } else { - container.sounds.push(Sound.Parse(parsedSound, scene7, rootUrl, loadedSounds[parsedSound.url])); - } - } else { - container.sounds.push(new Sound(parsedSound.name, null, scene7)); - } - } - } - loadedSounds = []; -}); -Object.defineProperty(Scene.prototype, "mainSoundTrack", { - get: function() { - let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); - if (!compo) { - compo = new AudioSceneComponent(this); - this._addComponent(compo); - } - if (!this._mainSoundTrack) { - this._mainSoundTrack = new SoundTrack(this, { mainTrack: true }); - } - return this._mainSoundTrack; - }, - enumerable: true, - configurable: true -}); -Scene.prototype.getSoundByName = function(name) { - let index; - for (index = 0;index < this.mainSoundTrack.soundCollection.length; index++) { - if (this.mainSoundTrack.soundCollection[index].name === name) { - return this.mainSoundTrack.soundCollection[index]; - } - } - if (this.soundTracks) { - for (let sdIndex = 0;sdIndex < this.soundTracks.length; sdIndex++) { - for (index = 0;index < this.soundTracks[sdIndex].soundCollection.length; index++) { - if (this.soundTracks[sdIndex].soundCollection[index].name === name) { - return this.soundTracks[sdIndex].soundCollection[index]; - } - } - } - } - return null; -}; -Object.defineProperty(Scene.prototype, "audioEnabled", { - get: function() { - let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); - if (!compo) { - compo = new AudioSceneComponent(this); - this._addComponent(compo); - } - return compo.audioEnabled; - }, - set: function(value) { - let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); - if (!compo) { - compo = new AudioSceneComponent(this); - this._addComponent(compo); - } - if (value) { - compo.enableAudio(); - } else { - compo.disableAudio(); - } - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(Scene.prototype, "headphone", { - get: function() { - let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); - if (!compo) { - compo = new AudioSceneComponent(this); - this._addComponent(compo); - } - return compo.headphone; - }, - set: function(value) { - let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); - if (!compo) { - compo = new AudioSceneComponent(this); - this._addComponent(compo); - } - if (value) { - compo.switchAudioModeForHeadphones(); - } else { - compo.switchAudioModeForNormalSpeakers(); - } - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(Scene.prototype, "audioListenerPositionProvider", { - get: function() { - let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); - if (!compo) { - compo = new AudioSceneComponent(this); - this._addComponent(compo); - } - return compo.audioListenerPositionProvider; - }, - set: function(value) { - let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); - if (!compo) { - compo = new AudioSceneComponent(this); - this._addComponent(compo); - } - if (value && typeof value !== "function") { - throw new Error("The value passed to [Scene.audioListenerPositionProvider] must be a function that returns a Vector3"); - } else { - compo.audioListenerPositionProvider = value; - } - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(Scene.prototype, "audioListenerRotationProvider", { - get: function() { - let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); - if (!compo) { - compo = new AudioSceneComponent(this); - this._addComponent(compo); - } - return compo.audioListenerRotationProvider; - }, - set: function(value) { - let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); - if (!compo) { - compo = new AudioSceneComponent(this); - this._addComponent(compo); - } - if (value && typeof value !== "function") { - throw new Error("The value passed to [Scene.audioListenerRotationProvider] must be a function that returns a Vector3"); - } else { - compo.audioListenerRotationProvider = value; - } - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(Scene.prototype, "audioPositioningRefreshRate", { - get: function() { - let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); - if (!compo) { - compo = new AudioSceneComponent(this); - this._addComponent(compo); - } - return compo.audioPositioningRefreshRate; - }, - set: function(value) { - let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); - if (!compo) { - compo = new AudioSceneComponent(this); - this._addComponent(compo); - } - compo.audioPositioningRefreshRate = value; - }, - enumerable: true, - configurable: true +var init_soundTrack = __esm(() => { + init_engine(); + init_engineStore(); }); +// node_modules/@babylonjs/core/Audio/audioSceneComponent.js class AudioSceneComponent { get audioEnabled() { return this._audioEnabled; @@ -44719,14 +45621,202 @@ class AudioSceneComponent { } } } -AudioSceneComponent._CameraDirection = new Vector3(0, 0, -1); -Sound._SceneComponentInitialization = (scene7) => { - let compo = scene7._getComponent(SceneComponentConstants.NAME_AUDIO); - if (!compo) { - compo = new AudioSceneComponent(scene7); - scene7._addComponent(compo); - } -}; +var init_audioSceneComponent = __esm(() => { + init_sound(); + init_soundTrack(); + init_engine(); + init_math_vector(); + init_sceneComponent(); + init_scene(); + init_abstractScene(); + init_audioEngine(); + init_precisionDate(); + init_engineStore(); + AbstractScene.AddParser(SceneComponentConstants.NAME_AUDIO, (parsedData, scene7, container, rootUrl) => { + var _a; + let loadedSounds = []; + let loadedSound; + container.sounds = container.sounds || []; + if (parsedData.sounds !== undefined && parsedData.sounds !== null) { + for (let index = 0, cache = parsedData.sounds.length;index < cache; index++) { + const parsedSound = parsedData.sounds[index]; + if ((_a = Engine2.audioEngine) === null || _a === undefined ? undefined : _a.canUseWebAudio) { + if (!parsedSound.url) { + parsedSound.url = parsedSound.name; + } + if (!loadedSounds[parsedSound.url]) { + loadedSound = Sound.Parse(parsedSound, scene7, rootUrl); + loadedSounds[parsedSound.url] = loadedSound; + container.sounds.push(loadedSound); + } else { + container.sounds.push(Sound.Parse(parsedSound, scene7, rootUrl, loadedSounds[parsedSound.url])); + } + } else { + container.sounds.push(new Sound(parsedSound.name, null, scene7)); + } + } + } + loadedSounds = []; + }); + Object.defineProperty(Scene.prototype, "mainSoundTrack", { + get: function() { + let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); + if (!compo) { + compo = new AudioSceneComponent(this); + this._addComponent(compo); + } + if (!this._mainSoundTrack) { + this._mainSoundTrack = new SoundTrack(this, { mainTrack: true }); + } + return this._mainSoundTrack; + }, + enumerable: true, + configurable: true + }); + Scene.prototype.getSoundByName = function(name2) { + let index; + for (index = 0;index < this.mainSoundTrack.soundCollection.length; index++) { + if (this.mainSoundTrack.soundCollection[index].name === name2) { + return this.mainSoundTrack.soundCollection[index]; + } + } + if (this.soundTracks) { + for (let sdIndex = 0;sdIndex < this.soundTracks.length; sdIndex++) { + for (index = 0;index < this.soundTracks[sdIndex].soundCollection.length; index++) { + if (this.soundTracks[sdIndex].soundCollection[index].name === name2) { + return this.soundTracks[sdIndex].soundCollection[index]; + } + } + } + } + return null; + }; + Object.defineProperty(Scene.prototype, "audioEnabled", { + get: function() { + let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); + if (!compo) { + compo = new AudioSceneComponent(this); + this._addComponent(compo); + } + return compo.audioEnabled; + }, + set: function(value) { + let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); + if (!compo) { + compo = new AudioSceneComponent(this); + this._addComponent(compo); + } + if (value) { + compo.enableAudio(); + } else { + compo.disableAudio(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "headphone", { + get: function() { + let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); + if (!compo) { + compo = new AudioSceneComponent(this); + this._addComponent(compo); + } + return compo.headphone; + }, + set: function(value) { + let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); + if (!compo) { + compo = new AudioSceneComponent(this); + this._addComponent(compo); + } + if (value) { + compo.switchAudioModeForHeadphones(); + } else { + compo.switchAudioModeForNormalSpeakers(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "audioListenerPositionProvider", { + get: function() { + let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); + if (!compo) { + compo = new AudioSceneComponent(this); + this._addComponent(compo); + } + return compo.audioListenerPositionProvider; + }, + set: function(value) { + let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); + if (!compo) { + compo = new AudioSceneComponent(this); + this._addComponent(compo); + } + if (value && typeof value !== "function") { + throw new Error("The value passed to [Scene.audioListenerPositionProvider] must be a function that returns a Vector3"); + } else { + compo.audioListenerPositionProvider = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "audioListenerRotationProvider", { + get: function() { + let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); + if (!compo) { + compo = new AudioSceneComponent(this); + this._addComponent(compo); + } + return compo.audioListenerRotationProvider; + }, + set: function(value) { + let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); + if (!compo) { + compo = new AudioSceneComponent(this); + this._addComponent(compo); + } + if (value && typeof value !== "function") { + throw new Error("The value passed to [Scene.audioListenerRotationProvider] must be a function that returns a Vector3"); + } else { + compo.audioListenerRotationProvider = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "audioPositioningRefreshRate", { + get: function() { + let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); + if (!compo) { + compo = new AudioSceneComponent(this); + this._addComponent(compo); + } + return compo.audioPositioningRefreshRate; + }, + set: function(value) { + let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO); + if (!compo) { + compo = new AudioSceneComponent(this); + this._addComponent(compo); + } + compo.audioPositioningRefreshRate = value; + }, + enumerable: true, + configurable: true + }); + AudioSceneComponent._CameraDirection = new Vector3(0, 0, -1); + Sound._SceneComponentInitialization = (scene7) => { + let compo = scene7._getComponent(SceneComponentConstants.NAME_AUDIO); + if (!compo) { + compo = new AudioSceneComponent(scene7); + scene7._addComponent(compo); + } + }; +}); + // node_modules/@babylonjs/core/Audio/weightedsound.js class WeightedSound { constructor(loop, sounds, weights) { @@ -44843,6 +45933,22 @@ class WeightedSound { this.isPaused = false; } } +var init_weightedsound = __esm(() => { + init_logger(); +}); + +// node_modules/@babylonjs/core/Audio/index.js +var init_Audio = __esm(() => { + init_IAudioEngine(); + init_ISoundOptions(); + init_analyser(); + init_audioEngine(); + init_audioSceneComponent(); + init_sound(); + init_soundTrack(); + init_weightedsound(); +}); + // node_modules/@babylonjs/core/BakedVertexAnimation/bakedVertexAnimationManager.js class BakedVertexAnimationManager { constructor(scene7) { @@ -44903,20 +46009,27 @@ class BakedVertexAnimationManager { SerializationHelper.Parse(() => this, source, scene7, rootUrl); } } -__decorate2([ - serializeAsTexture(), - expandToProperty("_markSubMeshesAsAttributesDirty") -], BakedVertexAnimationManager.prototype, "texture", undefined); -__decorate2([ - serialize(), - expandToProperty("_markSubMeshesAsAttributesDirty") -], BakedVertexAnimationManager.prototype, "isEnabled", undefined); -__decorate2([ - serialize() -], BakedVertexAnimationManager.prototype, "animationParameters", undefined); -__decorate2([ - serialize() -], BakedVertexAnimationManager.prototype, "time", undefined); +var init_bakedVertexAnimationManager = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_engineStore(); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markSubMeshesAsAttributesDirty") + ], BakedVertexAnimationManager.prototype, "texture", undefined); + __decorate2([ + serialize(), + expandToProperty("_markSubMeshesAsAttributesDirty") + ], BakedVertexAnimationManager.prototype, "isEnabled", undefined); + __decorate2([ + serialize() + ], BakedVertexAnimationManager.prototype, "animationParameters", undefined); + __decorate2([ + serialize() + ], BakedVertexAnimationManager.prototype, "time", undefined); +}); + // node_modules/@babylonjs/core/Materials/Textures/thinTexture.js class ThinTexture { get wrapU() { @@ -45061,6 +46174,9 @@ class ThinTexture { } } } +var init_thinTexture = __esm(() => { + init_math_size(); +}); // node_modules/@babylonjs/core/Materials/Textures/baseTexture.js class BaseTexture extends ThinTexture { @@ -45539,79 +46655,89 @@ class BaseTexture extends ThinTexture { return sceneOrEngine.getClassName() === "Scene"; } } -BaseTexture.DEFAULT_ANISOTROPIC_FILTERING_LEVEL = 4; -__decorate2([ - serialize() -], BaseTexture.prototype, "uniqueId", undefined); -__decorate2([ - serialize() -], BaseTexture.prototype, "name", undefined); -__decorate2([ - serialize() -], BaseTexture.prototype, "metadata", undefined); -__decorate2([ - serialize("hasAlpha") -], BaseTexture.prototype, "_hasAlpha", undefined); -__decorate2([ - serialize("getAlphaFromRGB") -], BaseTexture.prototype, "_getAlphaFromRGB", undefined); -__decorate2([ - serialize() -], BaseTexture.prototype, "level", undefined); -__decorate2([ - serialize("coordinatesIndex") -], BaseTexture.prototype, "_coordinatesIndex", undefined); -__decorate2([ - serialize() -], BaseTexture.prototype, "optimizeUVAllocation", undefined); -__decorate2([ - serialize("coordinatesMode") -], BaseTexture.prototype, "_coordinatesMode", undefined); -__decorate2([ - serialize() -], BaseTexture.prototype, "wrapU", null); -__decorate2([ - serialize() -], BaseTexture.prototype, "wrapV", null); -__decorate2([ - serialize() -], BaseTexture.prototype, "wrapR", undefined); -__decorate2([ - serialize() -], BaseTexture.prototype, "anisotropicFilteringLevel", undefined); -__decorate2([ - serialize() -], BaseTexture.prototype, "isCube", null); -__decorate2([ - serialize() -], BaseTexture.prototype, "is3D", null); -__decorate2([ - serialize() -], BaseTexture.prototype, "is2DArray", null); -__decorate2([ - serialize() -], BaseTexture.prototype, "gammaSpace", null); -__decorate2([ - serialize() -], BaseTexture.prototype, "invertZ", undefined); -__decorate2([ - serialize() -], BaseTexture.prototype, "lodLevelInAlpha", undefined); -__decorate2([ - serialize() -], BaseTexture.prototype, "lodGenerationOffset", null); -__decorate2([ - serialize() -], BaseTexture.prototype, "lodGenerationScale", null); -__decorate2([ - serialize() -], BaseTexture.prototype, "linearSpecularLOD", null); -__decorate2([ - serializeAsTexture() -], BaseTexture.prototype, "irradianceTexture", null); -__decorate2([ - serialize() -], BaseTexture.prototype, "isRenderTarget", undefined); +var init_baseTexture = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_observable(); + init_math_vector(); + init_engineStore(); + init_guid(); + init_fileTools(); + init_thinTexture(); + BaseTexture.DEFAULT_ANISOTROPIC_FILTERING_LEVEL = 4; + __decorate2([ + serialize() + ], BaseTexture.prototype, "uniqueId", undefined); + __decorate2([ + serialize() + ], BaseTexture.prototype, "name", undefined); + __decorate2([ + serialize() + ], BaseTexture.prototype, "metadata", undefined); + __decorate2([ + serialize("hasAlpha") + ], BaseTexture.prototype, "_hasAlpha", undefined); + __decorate2([ + serialize("getAlphaFromRGB") + ], BaseTexture.prototype, "_getAlphaFromRGB", undefined); + __decorate2([ + serialize() + ], BaseTexture.prototype, "level", undefined); + __decorate2([ + serialize("coordinatesIndex") + ], BaseTexture.prototype, "_coordinatesIndex", undefined); + __decorate2([ + serialize() + ], BaseTexture.prototype, "optimizeUVAllocation", undefined); + __decorate2([ + serialize("coordinatesMode") + ], BaseTexture.prototype, "_coordinatesMode", undefined); + __decorate2([ + serialize() + ], BaseTexture.prototype, "wrapU", null); + __decorate2([ + serialize() + ], BaseTexture.prototype, "wrapV", null); + __decorate2([ + serialize() + ], BaseTexture.prototype, "wrapR", undefined); + __decorate2([ + serialize() + ], BaseTexture.prototype, "anisotropicFilteringLevel", undefined); + __decorate2([ + serialize() + ], BaseTexture.prototype, "isCube", null); + __decorate2([ + serialize() + ], BaseTexture.prototype, "is3D", null); + __decorate2([ + serialize() + ], BaseTexture.prototype, "is2DArray", null); + __decorate2([ + serialize() + ], BaseTexture.prototype, "gammaSpace", null); + __decorate2([ + serialize() + ], BaseTexture.prototype, "invertZ", undefined); + __decorate2([ + serialize() + ], BaseTexture.prototype, "lodLevelInAlpha", undefined); + __decorate2([ + serialize() + ], BaseTexture.prototype, "lodGenerationOffset", null); + __decorate2([ + serialize() + ], BaseTexture.prototype, "lodGenerationScale", null); + __decorate2([ + serialize() + ], BaseTexture.prototype, "linearSpecularLOD", null); + __decorate2([ + serializeAsTexture() + ], BaseTexture.prototype, "irradianceTexture", null); + __decorate2([ + serialize() + ], BaseTexture.prototype, "isRenderTarget", undefined); +}); // node_modules/@babylonjs/core/Misc/copyTools.js function GenerateBase64StringFromPixelData(pixels, size, invertY = false) { @@ -45679,10 +46805,18 @@ async function GenerateBase64StringFromTextureAsync(texture, faceIndex = 0, leve } return GenerateBase64StringFromPixelData(pixels, texture.getSize(), internalTexture3.invertY); } +var CopyTools; +var init_copyTools = __esm(() => { + CopyTools = { + GenerateBase64StringFromPixelData, + GenerateBase64StringFromTexture, + GenerateBase64StringFromTextureAsync + }; +}); // node_modules/@babylonjs/core/Materials/Textures/texture.js class Texture extends BaseTexture { - static _CreateVideoTexture(name, src, scene7, generateMipMaps = false, invertY = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, settings = {}, onError, format = 5) { + static _CreateVideoTexture(name2, src, scene7, generateMipMaps = false, invertY = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, settings = {}, onError, format = 5) { throw _WarnImport("VideoTexture"); } get noMipmap() { @@ -46215,422 +47349,444 @@ class Texture extends BaseTexture { }, parsedTexture, scene7); return texture; } - static CreateFromBase64String(data, name, scene7, noMipmapOrOptions, invertY, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags) { - return new Texture("data:" + name, scene7, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, data, false, format, undefined, undefined, creationFlags); - } - static LoadFromDataString(name, buffer10, scene7, deleteBuffer = false, noMipmapOrOptions, invertY = true, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags) { - if (name.substr(0, 5) !== "data:") { - name = "data:" + name; - } - return new Texture(name, scene7, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, buffer10, deleteBuffer, format, undefined, undefined, creationFlags); - } -} -Texture.SerializeBuffers = true; -Texture.ForceSerializeBuffers = false; -Texture.OnTextureLoadErrorObservable = new Observable; -Texture._SerializeInternalTextureUniqueId = false; -Texture._CubeTextureParser = (jsonTexture, scene7, rootUrl) => { - throw _WarnImport("CubeTexture"); -}; -Texture._CreateMirror = (name, renderTargetSize, scene7, generateMipMaps) => { - throw _WarnImport("MirrorTexture"); -}; -Texture._CreateRenderTargetTexture = (name, renderTargetSize, scene7, generateMipMaps, creationFlags) => { - throw _WarnImport("RenderTargetTexture"); -}; -Texture.NEAREST_SAMPLINGMODE = 1; -Texture.NEAREST_NEAREST_MIPLINEAR = 8; -Texture.BILINEAR_SAMPLINGMODE = 2; -Texture.LINEAR_LINEAR_MIPNEAREST = 11; -Texture.TRILINEAR_SAMPLINGMODE = 3; -Texture.LINEAR_LINEAR_MIPLINEAR = 3; -Texture.NEAREST_NEAREST_MIPNEAREST = 4; -Texture.NEAREST_LINEAR_MIPNEAREST = 5; -Texture.NEAREST_LINEAR_MIPLINEAR = 6; -Texture.NEAREST_LINEAR = 7; -Texture.NEAREST_NEAREST = 1; -Texture.LINEAR_NEAREST_MIPNEAREST = 9; -Texture.LINEAR_NEAREST_MIPLINEAR = 10; -Texture.LINEAR_LINEAR = 2; -Texture.LINEAR_NEAREST = 12; -Texture.EXPLICIT_MODE = 0; -Texture.SPHERICAL_MODE = 1; -Texture.PLANAR_MODE = 2; -Texture.CUBIC_MODE = 3; -Texture.PROJECTION_MODE = 4; -Texture.SKYBOX_MODE = 5; -Texture.INVCUBIC_MODE = 6; -Texture.EQUIRECTANGULAR_MODE = 7; -Texture.FIXED_EQUIRECTANGULAR_MODE = 8; -Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9; -Texture.CLAMP_ADDRESSMODE = 0; -Texture.WRAP_ADDRESSMODE = 1; -Texture.MIRROR_ADDRESSMODE = 2; -Texture.UseSerializedUrlIfAny = false; -__decorate2([ - serialize() -], Texture.prototype, "url", undefined); -__decorate2([ - serialize() -], Texture.prototype, "uOffset", undefined); -__decorate2([ - serialize() -], Texture.prototype, "vOffset", undefined); -__decorate2([ - serialize() -], Texture.prototype, "uScale", undefined); -__decorate2([ - serialize() -], Texture.prototype, "vScale", undefined); -__decorate2([ - serialize() -], Texture.prototype, "uAng", undefined); -__decorate2([ - serialize() -], Texture.prototype, "vAng", undefined); -__decorate2([ - serialize() -], Texture.prototype, "wAng", undefined); -__decorate2([ - serialize() -], Texture.prototype, "uRotationCenter", undefined); -__decorate2([ - serialize() -], Texture.prototype, "vRotationCenter", undefined); -__decorate2([ - serialize() -], Texture.prototype, "wRotationCenter", undefined); -__decorate2([ - serialize() -], Texture.prototype, "homogeneousRotationInUVTransform", undefined); -__decorate2([ - serialize() -], Texture.prototype, "isBlocking", null); -RegisterClass("BABYLON.Texture", Texture); -SerializationHelper._TextureParser = Texture.Parse; + static CreateFromBase64String(data, name2, scene7, noMipmapOrOptions, invertY, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags) { + return new Texture("data:" + name2, scene7, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, data, false, format, undefined, undefined, creationFlags); + } + static LoadFromDataString(name2, buffer10, scene7, deleteBuffer = false, noMipmapOrOptions, invertY = true, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags) { + if (name2.substr(0, 5) !== "data:") { + name2 = "data:" + name2; + } + return new Texture(name2, scene7, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, buffer10, deleteBuffer, format, undefined, undefined, creationFlags); + } +} +var init_texture = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_observable(); + init_math_vector(); + init_baseTexture(); + init_typeStore(); + init_devTools(); + init_timingTools(); + init_instantiationTools(); + init_math_plane(); + init_stringTools(); + init_copyTools(); + init_compatibilityOptions(); + Texture.SerializeBuffers = true; + Texture.ForceSerializeBuffers = false; + Texture.OnTextureLoadErrorObservable = new Observable; + Texture._SerializeInternalTextureUniqueId = false; + Texture._CubeTextureParser = (jsonTexture, scene7, rootUrl) => { + throw _WarnImport("CubeTexture"); + }; + Texture._CreateMirror = (name2, renderTargetSize, scene7, generateMipMaps) => { + throw _WarnImport("MirrorTexture"); + }; + Texture._CreateRenderTargetTexture = (name2, renderTargetSize, scene7, generateMipMaps, creationFlags) => { + throw _WarnImport("RenderTargetTexture"); + }; + Texture.NEAREST_SAMPLINGMODE = 1; + Texture.NEAREST_NEAREST_MIPLINEAR = 8; + Texture.BILINEAR_SAMPLINGMODE = 2; + Texture.LINEAR_LINEAR_MIPNEAREST = 11; + Texture.TRILINEAR_SAMPLINGMODE = 3; + Texture.LINEAR_LINEAR_MIPLINEAR = 3; + Texture.NEAREST_NEAREST_MIPNEAREST = 4; + Texture.NEAREST_LINEAR_MIPNEAREST = 5; + Texture.NEAREST_LINEAR_MIPLINEAR = 6; + Texture.NEAREST_LINEAR = 7; + Texture.NEAREST_NEAREST = 1; + Texture.LINEAR_NEAREST_MIPNEAREST = 9; + Texture.LINEAR_NEAREST_MIPLINEAR = 10; + Texture.LINEAR_LINEAR = 2; + Texture.LINEAR_NEAREST = 12; + Texture.EXPLICIT_MODE = 0; + Texture.SPHERICAL_MODE = 1; + Texture.PLANAR_MODE = 2; + Texture.CUBIC_MODE = 3; + Texture.PROJECTION_MODE = 4; + Texture.SKYBOX_MODE = 5; + Texture.INVCUBIC_MODE = 6; + Texture.EQUIRECTANGULAR_MODE = 7; + Texture.FIXED_EQUIRECTANGULAR_MODE = 8; + Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9; + Texture.CLAMP_ADDRESSMODE = 0; + Texture.WRAP_ADDRESSMODE = 1; + Texture.MIRROR_ADDRESSMODE = 2; + Texture.UseSerializedUrlIfAny = false; + __decorate2([ + serialize() + ], Texture.prototype, "url", undefined); + __decorate2([ + serialize() + ], Texture.prototype, "uOffset", undefined); + __decorate2([ + serialize() + ], Texture.prototype, "vOffset", undefined); + __decorate2([ + serialize() + ], Texture.prototype, "uScale", undefined); + __decorate2([ + serialize() + ], Texture.prototype, "vScale", undefined); + __decorate2([ + serialize() + ], Texture.prototype, "uAng", undefined); + __decorate2([ + serialize() + ], Texture.prototype, "vAng", undefined); + __decorate2([ + serialize() + ], Texture.prototype, "wAng", undefined); + __decorate2([ + serialize() + ], Texture.prototype, "uRotationCenter", undefined); + __decorate2([ + serialize() + ], Texture.prototype, "vRotationCenter", undefined); + __decorate2([ + serialize() + ], Texture.prototype, "wRotationCenter", undefined); + __decorate2([ + serialize() + ], Texture.prototype, "homogeneousRotationInUVTransform", undefined); + __decorate2([ + serialize() + ], Texture.prototype, "isBlocking", null); + RegisterClass("BABYLON.Texture", Texture); + SerializationHelper._TextureParser = Texture.Parse; +}); // node_modules/@babylonjs/core/Engines/Extensions/engine.rawTexture.js -var _convertRGBtoRGBATextureData = function(rgbData, width, height, textureType) { - let rgbaData; - let val1 = 1; - if (textureType === 1) { - rgbaData = new Float32Array(width * height * 4); - } else if (textureType === 2) { - rgbaData = new Uint16Array(width * height * 4); - val1 = 15360; - } else if (textureType === 7) { - rgbaData = new Uint32Array(width * height * 4); - } else { - rgbaData = new Uint8Array(width * height * 4); - } - for (let x = 0;x < width; x++) { - for (let y = 0;y < height; y++) { - const index = (y * width + x) * 3; - const newIndex = (y * width + x) * 4; - rgbaData[newIndex + 0] = rgbData[index + 0]; - rgbaData[newIndex + 1] = rgbData[index + 1]; - rgbaData[newIndex + 2] = rgbData[index + 2]; - rgbaData[newIndex + 3] = val1; +var _convertRGBtoRGBATextureData, _makeCreateRawTextureFunction, _makeUpdateRawTextureFunction; +var init_engine_rawTexture = __esm(() => { + init_internalTexture(); + init_logger(); + init_tools(); + init_thinEngine(); + _convertRGBtoRGBATextureData = function(rgbData, width, height, textureType) { + let rgbaData; + let val1 = 1; + if (textureType === 1) { + rgbaData = new Float32Array(width * height * 4); + } else if (textureType === 2) { + rgbaData = new Uint16Array(width * height * 4); + val1 = 15360; + } else if (textureType === 7) { + rgbaData = new Uint32Array(width * height * 4); + } else { + rgbaData = new Uint8Array(width * height * 4); } - } - return rgbaData; -}; -var _makeCreateRawTextureFunction = function(is3D) { - return function(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression = null, textureType = 0) { - const target = is3D ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY; - const source = is3D ? InternalTextureSource.Raw3D : InternalTextureSource.Raw2DArray; - const texture = new InternalTexture(this, source); + for (let x = 0;x < width; x++) { + for (let y = 0;y < height; y++) { + const index = (y * width + x) * 3; + const newIndex = (y * width + x) * 4; + rgbaData[newIndex + 0] = rgbData[index + 0]; + rgbaData[newIndex + 1] = rgbData[index + 1]; + rgbaData[newIndex + 2] = rgbData[index + 2]; + rgbaData[newIndex + 3] = val1; + } + } + return rgbaData; + }; + _makeCreateRawTextureFunction = function(is3D) { + return function(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression = null, textureType = 0) { + const target = is3D ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY; + const source = is3D ? InternalTextureSource.Raw3D : InternalTextureSource.Raw2DArray; + const texture = new InternalTexture(this, source); + texture.baseWidth = width; + texture.baseHeight = height; + texture.baseDepth = depth; + texture.width = width; + texture.height = height; + texture.depth = depth; + texture.format = format; + texture.type = textureType; + texture.generateMipMaps = generateMipMaps; + texture.samplingMode = samplingMode; + if (is3D) { + texture.is3D = true; + } else { + texture.is2DArray = true; + } + if (!this._doNotHandleContextLost) { + texture._bufferView = data; + } + if (is3D) { + this.updateRawTexture3D(texture, data, format, invertY, compression, textureType); + } else { + this.updateRawTexture2DArray(texture, data, format, invertY, compression, textureType); + } + this._bindTextureDirectly(target, texture, true); + const filters = this._getSamplingParameters(samplingMode, generateMipMaps); + this._gl.texParameteri(target, this._gl.TEXTURE_MAG_FILTER, filters.mag); + this._gl.texParameteri(target, this._gl.TEXTURE_MIN_FILTER, filters.min); + if (generateMipMaps) { + this._gl.generateMipmap(target); + } + this._bindTextureDirectly(target, null); + this._internalTexturesCache.push(texture); + return texture; + }; + }; + _makeUpdateRawTextureFunction = function(is3D) { + return function(texture, data, format, invertY, compression = null, textureType = 0) { + const target = is3D ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY; + const internalType = this._getWebGLTextureType(textureType); + const internalFormat = this._getInternalFormat(format); + const internalSizedFomat = this._getRGBABufferInternalSizedFormat(textureType, format); + this._bindTextureDirectly(target, texture, true); + this._unpackFlipY(invertY === undefined ? true : invertY ? true : false); + if (!this._doNotHandleContextLost) { + texture._bufferView = data; + texture.format = format; + texture.invertY = invertY; + texture._compression = compression; + } + if (texture.width % 4 !== 0) { + this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1); + } + if (compression && data) { + this._gl.compressedTexImage3D(target, 0, this.getCaps().s3tc[compression], texture.width, texture.height, texture.depth, 0, data); + } else { + this._gl.texImage3D(target, 0, internalSizedFomat, texture.width, texture.height, texture.depth, 0, internalFormat, internalType, data); + } + if (texture.generateMipMaps) { + this._gl.generateMipmap(target); + } + this._bindTextureDirectly(target, null); + texture.isReady = true; + }; + }; + ThinEngine.prototype.updateRawTexture = function(texture, data, format, invertY, compression = null, type = 0, useSRGBBuffer = false) { + if (!texture) { + return; + } + const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type, format, useSRGBBuffer); + const internalFormat = this._getInternalFormat(format); + const textureType = this._getWebGLTextureType(type); + this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true); + this._unpackFlipY(invertY === undefined ? true : invertY ? true : false); + if (!this._doNotHandleContextLost) { + texture._bufferView = data; + texture.format = format; + texture.type = type; + texture.invertY = invertY; + texture._compression = compression; + } + if (texture.width % 4 !== 0) { + this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1); + } + if (compression && data) { + this._gl.compressedTexImage2D(this._gl.TEXTURE_2D, 0, this.getCaps().s3tc[compression], texture.width, texture.height, 0, data); + } else { + this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, data); + } + if (texture.generateMipMaps) { + this._gl.generateMipmap(this._gl.TEXTURE_2D); + } + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + texture.isReady = true; + }; + ThinEngine.prototype.createRawTexture = function(data, width, height, format, generateMipMaps, invertY, samplingMode, compression = null, type = 0, creationFlags = 0, useSRGBBuffer = false) { + const texture = new InternalTexture(this, InternalTextureSource.Raw); texture.baseWidth = width; texture.baseHeight = height; - texture.baseDepth = depth; texture.width = width; texture.height = height; - texture.depth = depth; texture.format = format; - texture.type = textureType; texture.generateMipMaps = generateMipMaps; texture.samplingMode = samplingMode; - if (is3D) { - texture.is3D = true; - } else { - texture.is2DArray = true; - } + texture.invertY = invertY; + texture._compression = compression; + texture.type = type; + texture._useSRGBBuffer = this._getUseSRGBBuffer(useSRGBBuffer, !generateMipMaps); if (!this._doNotHandleContextLost) { texture._bufferView = data; } - if (is3D) { - this.updateRawTexture3D(texture, data, format, invertY, compression, textureType); - } else { - this.updateRawTexture2DArray(texture, data, format, invertY, compression, textureType); - } - this._bindTextureDirectly(target, texture, true); + this.updateRawTexture(texture, data, format, invertY, compression, type, texture._useSRGBBuffer); + this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true); const filters = this._getSamplingParameters(samplingMode, generateMipMaps); - this._gl.texParameteri(target, this._gl.TEXTURE_MAG_FILTER, filters.mag); - this._gl.texParameteri(target, this._gl.TEXTURE_MIN_FILTER, filters.min); + this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, filters.mag); + this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, filters.min); if (generateMipMaps) { - this._gl.generateMipmap(target); + this._gl.generateMipmap(this._gl.TEXTURE_2D); } - this._bindTextureDirectly(target, null); + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); this._internalTexturesCache.push(texture); return texture; }; -}; -var _makeUpdateRawTextureFunction = function(is3D) { - return function(texture, data, format, invertY, compression = null, textureType = 0) { - const target = is3D ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY; - const internalType = this._getWebGLTextureType(textureType); - const internalFormat = this._getInternalFormat(format); - const internalSizedFomat = this._getRGBABufferInternalSizedFormat(textureType, format); - this._bindTextureDirectly(target, texture, true); - this._unpackFlipY(invertY === undefined ? true : invertY ? true : false); + ThinEngine.prototype.createRawCubeTexture = function(data, size, format, type, generateMipMaps, invertY, samplingMode, compression = null) { + const gl = this._gl; + const texture = new InternalTexture(this, InternalTextureSource.CubeRaw); + texture.isCube = true; + texture.format = format; + texture.type = type; if (!this._doNotHandleContextLost) { - texture._bufferView = data; - texture.format = format; - texture.invertY = invertY; - texture._compression = compression; + texture._bufferViewArray = data; } - if (texture.width % 4 !== 0) { - this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1); + const textureType = this._getWebGLTextureType(type); + let internalFormat = this._getInternalFormat(format); + if (internalFormat === gl.RGB) { + internalFormat = gl.RGBA; } - if (compression && data) { - this._gl.compressedTexImage3D(target, 0, this.getCaps().s3tc[compression], texture.width, texture.height, texture.depth, 0, data); + if (textureType === gl.FLOAT && !this._caps.textureFloatLinearFiltering) { + generateMipMaps = false; + samplingMode = 1; + Logger.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."); + } else if (textureType === this._gl.HALF_FLOAT_OES && !this._caps.textureHalfFloatLinearFiltering) { + generateMipMaps = false; + samplingMode = 1; + Logger.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."); + } else if (textureType === gl.FLOAT && !this._caps.textureFloatRender) { + generateMipMaps = false; + Logger.Warn("Render to float textures is not supported. Mipmap generation forced to false."); + } else if (textureType === gl.HALF_FLOAT && !this._caps.colorBufferFloat) { + generateMipMaps = false; + Logger.Warn("Render to half float textures is not supported. Mipmap generation forced to false."); + } + const width = size; + const height = width; + texture.width = width; + texture.height = height; + texture.invertY = invertY; + texture._compression = compression; + const isPot = !this.needPOTTextures || Tools.IsExponentOfTwo(texture.width) && Tools.IsExponentOfTwo(texture.height); + if (!isPot) { + generateMipMaps = false; + } + if (data) { + this.updateRawCubeTexture(texture, data, format, type, invertY, compression); } else { - this._gl.texImage3D(target, 0, internalSizedFomat, texture.width, texture.height, texture.depth, 0, internalFormat, internalType, data); + const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type); + const level = 0; + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true); + for (let faceIndex = 0;faceIndex < 6; faceIndex++) { + if (compression) { + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, this.getCaps().s3tc[compression], texture.width, texture.height, 0, undefined); + } else { + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, null); + } + } + this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null); } - if (texture.generateMipMaps) { - this._gl.generateMipmap(target); + this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, texture, true); + if (data && generateMipMaps) { + this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP); } - this._bindTextureDirectly(target, null); + const filters = this._getSamplingParameters(samplingMode, generateMipMaps); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, filters.mag); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, filters.min); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + texture.generateMipMaps = generateMipMaps; + texture.samplingMode = samplingMode; texture.isReady = true; + return texture; }; -}; -ThinEngine.prototype.updateRawTexture = function(texture, data, format, invertY, compression = null, type = 0, useSRGBBuffer = false) { - if (!texture) { - return; - } - const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type, format, useSRGBBuffer); - const internalFormat = this._getInternalFormat(format); - const textureType = this._getWebGLTextureType(type); - this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true); - this._unpackFlipY(invertY === undefined ? true : invertY ? true : false); - if (!this._doNotHandleContextLost) { - texture._bufferView = data; + ThinEngine.prototype.updateRawCubeTexture = function(texture, data, format, type, invertY, compression = null, level = 0) { + texture._bufferViewArray = data; texture.format = format; texture.type = type; texture.invertY = invertY; texture._compression = compression; - } - if (texture.width % 4 !== 0) { - this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1); - } - if (compression && data) { - this._gl.compressedTexImage2D(this._gl.TEXTURE_2D, 0, this.getCaps().s3tc[compression], texture.width, texture.height, 0, data); - } else { - this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, data); - } - if (texture.generateMipMaps) { - this._gl.generateMipmap(this._gl.TEXTURE_2D); - } - this._bindTextureDirectly(this._gl.TEXTURE_2D, null); - texture.isReady = true; -}; -ThinEngine.prototype.createRawTexture = function(data, width, height, format, generateMipMaps, invertY, samplingMode, compression = null, type = 0, creationFlags = 0, useSRGBBuffer = false) { - const texture = new InternalTexture(this, InternalTextureSource.Raw); - texture.baseWidth = width; - texture.baseHeight = height; - texture.width = width; - texture.height = height; - texture.format = format; - texture.generateMipMaps = generateMipMaps; - texture.samplingMode = samplingMode; - texture.invertY = invertY; - texture._compression = compression; - texture.type = type; - texture._useSRGBBuffer = this._getUseSRGBBuffer(useSRGBBuffer, !generateMipMaps); - if (!this._doNotHandleContextLost) { - texture._bufferView = data; - } - this.updateRawTexture(texture, data, format, invertY, compression, type, texture._useSRGBBuffer); - this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true); - const filters = this._getSamplingParameters(samplingMode, generateMipMaps); - this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, filters.mag); - this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, filters.min); - if (generateMipMaps) { - this._gl.generateMipmap(this._gl.TEXTURE_2D); - } - this._bindTextureDirectly(this._gl.TEXTURE_2D, null); - this._internalTexturesCache.push(texture); - return texture; -}; -ThinEngine.prototype.createRawCubeTexture = function(data, size, format, type, generateMipMaps, invertY, samplingMode, compression = null) { - const gl = this._gl; - const texture = new InternalTexture(this, InternalTextureSource.CubeRaw); - texture.isCube = true; - texture.format = format; - texture.type = type; - if (!this._doNotHandleContextLost) { - texture._bufferViewArray = data; - } - const textureType = this._getWebGLTextureType(type); - let internalFormat = this._getInternalFormat(format); - if (internalFormat === gl.RGB) { - internalFormat = gl.RGBA; - } - if (textureType === gl.FLOAT && !this._caps.textureFloatLinearFiltering) { - generateMipMaps = false; - samplingMode = 1; - Logger.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."); - } else if (textureType === this._gl.HALF_FLOAT_OES && !this._caps.textureHalfFloatLinearFiltering) { - generateMipMaps = false; - samplingMode = 1; - Logger.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."); - } else if (textureType === gl.FLOAT && !this._caps.textureFloatRender) { - generateMipMaps = false; - Logger.Warn("Render to float textures is not supported. Mipmap generation forced to false."); - } else if (textureType === gl.HALF_FLOAT && !this._caps.colorBufferFloat) { - generateMipMaps = false; - Logger.Warn("Render to half float textures is not supported. Mipmap generation forced to false."); - } - const width = size; - const height = width; - texture.width = width; - texture.height = height; - texture.invertY = invertY; - texture._compression = compression; - const isPot = !this.needPOTTextures || Tools.IsExponentOfTwo(texture.width) && Tools.IsExponentOfTwo(texture.height); - if (!isPot) { - generateMipMaps = false; - } - if (data) { - this.updateRawCubeTexture(texture, data, format, type, invertY, compression); - } else { + const gl = this._gl; + const textureType = this._getWebGLTextureType(type); + let internalFormat = this._getInternalFormat(format); const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type); - const level = 0; + let needConversion = false; + if (internalFormat === gl.RGB) { + internalFormat = gl.RGBA; + needConversion = true; + } this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true); + this._unpackFlipY(invertY === undefined ? true : invertY ? true : false); + if (texture.width % 4 !== 0) { + gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + } for (let faceIndex = 0;faceIndex < 6; faceIndex++) { + let faceData = data[faceIndex]; if (compression) { - gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, this.getCaps().s3tc[compression], texture.width, texture.height, 0, undefined); + gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, this.getCaps().s3tc[compression], texture.width, texture.height, 0, faceData); } else { - gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, null); + if (needConversion) { + faceData = _convertRGBtoRGBATextureData(faceData, texture.width, texture.height, type); + } + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, faceData); } } + const isPot = !this.needPOTTextures || Tools.IsExponentOfTwo(texture.width) && Tools.IsExponentOfTwo(texture.height); + if (isPot && texture.generateMipMaps && level === 0) { + this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP); + } this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null); - } - this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, texture, true); - if (data && generateMipMaps) { - this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP); - } - const filters = this._getSamplingParameters(samplingMode, generateMipMaps); - gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, filters.mag); - gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, filters.min); - gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); - texture.generateMipMaps = generateMipMaps; - texture.samplingMode = samplingMode; - texture.isReady = true; - return texture; -}; -ThinEngine.prototype.updateRawCubeTexture = function(texture, data, format, type, invertY, compression = null, level = 0) { - texture._bufferViewArray = data; - texture.format = format; - texture.type = type; - texture.invertY = invertY; - texture._compression = compression; - const gl = this._gl; - const textureType = this._getWebGLTextureType(type); - let internalFormat = this._getInternalFormat(format); - const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type); - let needConversion = false; - if (internalFormat === gl.RGB) { - internalFormat = gl.RGBA; - needConversion = true; - } - this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true); - this._unpackFlipY(invertY === undefined ? true : invertY ? true : false); - if (texture.width % 4 !== 0) { - gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1); - } - for (let faceIndex = 0;faceIndex < 6; faceIndex++) { - let faceData = data[faceIndex]; - if (compression) { - gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, this.getCaps().s3tc[compression], texture.width, texture.height, 0, faceData); - } else { - if (needConversion) { - faceData = _convertRGBtoRGBATextureData(faceData, texture.width, texture.height, type); + texture.isReady = true; + }; + ThinEngine.prototype.createRawCubeTextureFromUrl = function(url, scene7, size, format, type, noMipmap, callback, mipmapGenerator, onLoad = null, onError = null, samplingMode = 3, invertY = false) { + const gl = this._gl; + const texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode, null); + scene7 === null || scene7 === undefined || scene7.addPendingData(texture); + texture.url = url; + texture.isReady = false; + this._internalTexturesCache.push(texture); + const onerror = (request, exception) => { + scene7 === null || scene7 === undefined || scene7.removePendingData(texture); + if (onError && request) { + onError(request.status + " " + request.statusText, exception); } - gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, faceData); - } - } - const isPot = !this.needPOTTextures || Tools.IsExponentOfTwo(texture.width) && Tools.IsExponentOfTwo(texture.height); - if (isPot && texture.generateMipMaps && level === 0) { - this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP); - } - this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null); - texture.isReady = true; -}; -ThinEngine.prototype.createRawCubeTextureFromUrl = function(url, scene7, size, format, type, noMipmap, callback, mipmapGenerator, onLoad = null, onError = null, samplingMode = 3, invertY = false) { - const gl = this._gl; - const texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode, null); - scene7 === null || scene7 === undefined || scene7.addPendingData(texture); - texture.url = url; - texture.isReady = false; - this._internalTexturesCache.push(texture); - const onerror = (request, exception) => { - scene7 === null || scene7 === undefined || scene7.removePendingData(texture); - if (onError && request) { - onError(request.status + " " + request.statusText, exception); - } - }; - const internalCallback = (data) => { - const width = texture.width; - const faceDataArrays = callback(data); - if (!faceDataArrays) { - return; - } - if (mipmapGenerator) { - const textureType = this._getWebGLTextureType(type); - let internalFormat = this._getInternalFormat(format); - const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type); - let needConversion = false; - if (internalFormat === gl.RGB) { - internalFormat = gl.RGBA; - needConversion = true; + }; + const internalCallback = (data) => { + const width = texture.width; + const faceDataArrays = callback(data); + if (!faceDataArrays) { + return; } - this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true); - this._unpackFlipY(false); - const mipData = mipmapGenerator(faceDataArrays); - for (let level = 0;level < mipData.length; level++) { - const mipSize = width >> level; - for (let faceIndex = 0;faceIndex < 6; faceIndex++) { - let mipFaceData = mipData[level][faceIndex]; - if (needConversion) { - mipFaceData = _convertRGBtoRGBATextureData(mipFaceData, mipSize, mipSize, type); + if (mipmapGenerator) { + const textureType = this._getWebGLTextureType(type); + let internalFormat = this._getInternalFormat(format); + const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type); + let needConversion = false; + if (internalFormat === gl.RGB) { + internalFormat = gl.RGBA; + needConversion = true; + } + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true); + this._unpackFlipY(false); + const mipData = mipmapGenerator(faceDataArrays); + for (let level = 0;level < mipData.length; level++) { + const mipSize = width >> level; + for (let faceIndex = 0;faceIndex < 6; faceIndex++) { + let mipFaceData = mipData[level][faceIndex]; + if (needConversion) { + mipFaceData = _convertRGBtoRGBATextureData(mipFaceData, mipSize, mipSize, type); + } + gl.texImage2D(faceIndex, level, internalSizedFomat, mipSize, mipSize, 0, internalFormat, textureType, mipFaceData); } - gl.texImage2D(faceIndex, level, internalSizedFomat, mipSize, mipSize, 0, internalFormat, textureType, mipFaceData); } + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + } else { + this.updateRawCubeTexture(texture, faceDataArrays, format, type, invertY); } - this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); - } else { - this.updateRawCubeTexture(texture, faceDataArrays, format, type, invertY); - } - texture.isReady = true; - scene7 === null || scene7 === undefined || scene7.removePendingData(texture); - texture.onLoadedObservable.notifyObservers(texture); - texture.onLoadedObservable.clear(); - if (onLoad) { - onLoad(); - } + texture.isReady = true; + scene7 === null || scene7 === undefined || scene7.removePendingData(texture); + texture.onLoadedObservable.notifyObservers(texture); + texture.onLoadedObservable.clear(); + if (onLoad) { + onLoad(); + } + }; + this._loadFile(url, (data) => { + internalCallback(data); + }, undefined, scene7 === null || scene7 === undefined ? undefined : scene7.offlineProvider, true, onerror); + return texture; }; - this._loadFile(url, (data) => { - internalCallback(data); - }, undefined, scene7 === null || scene7 === undefined ? undefined : scene7.offlineProvider, true, onerror); - return texture; -}; -ThinEngine.prototype.createRawTexture2DArray = _makeCreateRawTextureFunction(false); -ThinEngine.prototype.createRawTexture3D = _makeCreateRawTextureFunction(true); -ThinEngine.prototype.updateRawTexture2DArray = _makeUpdateRawTextureFunction(false); -ThinEngine.prototype.updateRawTexture3D = _makeUpdateRawTextureFunction(true); + ThinEngine.prototype.createRawTexture2DArray = _makeCreateRawTextureFunction(false); + ThinEngine.prototype.createRawTexture3D = _makeCreateRawTextureFunction(true); + ThinEngine.prototype.updateRawTexture2DArray = _makeUpdateRawTextureFunction(false); + ThinEngine.prototype.updateRawTexture3D = _makeUpdateRawTextureFunction(true); +}); // node_modules/@babylonjs/core/Materials/Textures/rawTexture.js class RawTexture extends Texture { @@ -46678,6 +47834,96 @@ class RawTexture extends Texture { return new RawTexture(data, width, height, 6, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, 1); } } +var init_rawTexture = __esm(() => { + init_texture(); + init_engine_rawTexture(); +}); + +// node_modules/@babylonjs/core/BakedVertexAnimation/vertexAnimationBaker.js +class VertexAnimationBaker { + constructor(scene7, mesh3) { + this._scene = scene7; + this._mesh = mesh3; + } + async bakeVertexData(ranges) { + if (!this._mesh.skeleton) { + throw new Error("No skeleton in this mesh."); + } + const boneCount = this._mesh.skeleton.bones.length; + const frameCount = ranges.reduce((previous, current) => previous + current.to - current.from + 1, 0); + if (isNaN(frameCount)) { + throw new Error("Invalid animation ranges."); + } + let textureIndex = 0; + const textureSize = (boneCount + 1) * 4 * 4 * frameCount; + const vertexData = new Float32Array(textureSize); + this._scene.stopAnimation(this._mesh); + this._mesh.skeleton.returnToRest(); + for (const range of ranges) { + for (let frameIndex = range.from;frameIndex <= range.to; frameIndex++) { + await this._executeAnimationFrame(vertexData, frameIndex, textureIndex++); + } + } + return vertexData; + } + async _executeAnimationFrame(vertexData, frameIndex, textureIndex) { + return new Promise((resolve, _reject) => { + this._scene.beginAnimation(this._mesh.skeleton, frameIndex, frameIndex, false, 1, () => { + const skeletonMatrices = this._mesh.skeleton.getTransformMatrices(this._mesh); + vertexData.set(skeletonMatrices, textureIndex * skeletonMatrices.length); + resolve(); + }); + }); + } + textureFromBakedVertexData(vertexData) { + if (!this._mesh.skeleton) { + throw new Error("No skeleton in this mesh."); + } + const boneCount = this._mesh.skeleton.bones.length; + const texture3 = RawTexture.CreateRGBATexture(vertexData, (boneCount + 1) * 4, vertexData.length / ((boneCount + 1) * 4 * 4), this._scene, false, false, Texture.NEAREST_NEAREST, 1); + texture3.name = "VAT" + this._mesh.skeleton.name; + return texture3; + } + serializeBakedVertexDataToObject(vertexData) { + if (!this._mesh.skeleton) { + throw new Error("No skeleton in this mesh."); + } + const boneCount = this._mesh.skeleton.bones.length; + const width = (boneCount + 1) * 4; + const height = vertexData.length / ((boneCount + 1) * 4 * 4); + const data = { + vertexData: EncodeArrayBufferToBase64(vertexData), + width, + height + }; + return data; + } + loadBakedVertexDataFromObject(data) { + return new Float32Array(DecodeBase64ToBinary(data.vertexData)); + } + serializeBakedVertexDataToJSON(vertexData) { + return JSON.stringify(this.serializeBakedVertexDataToObject(vertexData)); + } + loadBakedVertexDataFromJSON(json) { + return this.loadBakedVertexDataFromObject(JSON.parse(json)); + } +} +var init_vertexAnimationBaker = __esm(() => { + init_rawTexture(); + init_texture(); + init_stringTools(); +}); + +// node_modules/@babylonjs/core/BakedVertexAnimation/index.js +var init_BakedVertexAnimation = __esm(() => { + init_bakedVertexAnimationManager(); + init_vertexAnimationBaker(); +}); + +// node_modules/@babylonjs/core/Behaviors/behavior.js +var init_behavior = __esm(() => { +}); + // node_modules/@babylonjs/core/Behaviors/Cameras/autoRotationBehavior.js class AutoRotationBehavior { constructor() { @@ -46804,6 +48050,12 @@ class AutoRotationBehavior { return this._attachedCamera.inertialAlphaOffset !== 0 || this._attachedCamera.inertialBetaOffset !== 0 || this._attachedCamera.inertialRadiusOffset !== 0 || this._attachedCamera.inertialPanningX !== 0 || this._attachedCamera.inertialPanningY !== 0 || this._isPointerDown; } } +var init_autoRotationBehavior = __esm(() => { + init_pointerEvents(); + init_precisionDate(); + init_math_constants(); +}); + // node_modules/@babylonjs/core/Behaviors/Cameras/bouncingBehavior.js class BouncingBehavior { constructor() { @@ -46916,8 +48168,13 @@ class BouncingBehavior { } } } -BouncingBehavior.EasingFunction = new BackEase(0.3); -BouncingBehavior.EasingMode = EasingFunction.EASINGMODE_EASEOUT; +var init_bouncingBehavior = __esm(() => { + init_easing(); + init_animation(); + BouncingBehavior.EasingFunction = new BackEase(0.3); + BouncingBehavior.EasingMode = EasingFunction.EASINGMODE_EASEOUT; +}); + // node_modules/@babylonjs/core/Behaviors/Cameras/framingBehavior.js class FramingBehavior { constructor() { @@ -47173,10 +48430,152 @@ class FramingBehavior { return this._attachedCamera.inertialAlphaOffset !== 0 || this._attachedCamera.inertialBetaOffset !== 0 || this._attachedCamera.inertialRadiusOffset !== 0 || this._attachedCamera.inertialPanningX !== 0 || this._attachedCamera.inertialPanningY !== 0 || this._isPointerDown; } } -FramingBehavior.EasingFunction = new ExponentialEase; -FramingBehavior.EasingMode = EasingFunction.EASINGMODE_EASEINOUT; -FramingBehavior.IgnoreBoundsSizeMode = 0; -FramingBehavior.FitFrustumSidesMode = 1; +var init_framingBehavior = __esm(() => { + init_easing(); + init_observable(); + init_pointerEvents(); + init_precisionDate(); + init_math_vector(); + init_animation(); + FramingBehavior.EasingFunction = new ExponentialEase; + FramingBehavior.EasingMode = EasingFunction.EASINGMODE_EASEINOUT; + FramingBehavior.IgnoreBoundsSizeMode = 0; + FramingBehavior.FitFrustumSidesMode = 1; +}); + +// node_modules/@babylonjs/core/Behaviors/Cameras/index.js +var init_Cameras = __esm(() => { + init_autoRotationBehavior(); + init_bouncingBehavior(); + init_framingBehavior(); +}); + +// node_modules/@babylonjs/core/Behaviors/Meshes/attachToBoxBehavior.js +class FaceDirectionInfo { + constructor(direction, rotatedDirection = new Vector3, diff = 0, ignore = false) { + this.direction = direction; + this.rotatedDirection = rotatedDirection; + this.diff = diff; + this.ignore = ignore; + } +} + +class AttachToBoxBehavior { + constructor(_ui) { + this._ui = _ui; + this.name = "AttachToBoxBehavior"; + this.distanceAwayFromFace = 0.15; + this.distanceAwayFromBottomOfFace = 0.15; + this._faceVectors = [ + new FaceDirectionInfo(Vector3.Up()), + new FaceDirectionInfo(Vector3.Down()), + new FaceDirectionInfo(Vector3.Left()), + new FaceDirectionInfo(Vector3.Right()), + new FaceDirectionInfo(Vector3.Forward()), + new FaceDirectionInfo(Vector3.Forward().scaleInPlace(-1)) + ]; + this._tmpMatrix = new Matrix; + this._tmpVector = new Vector3; + this._zeroVector = Vector3.Zero(); + this._lookAtTmpMatrix = new Matrix; + } + init() { + } + _closestFace(targetDirection) { + this._faceVectors.forEach((v) => { + if (!this._target.rotationQuaternion) { + this._target.rotationQuaternion = Quaternion.RotationYawPitchRoll(this._target.rotation.y, this._target.rotation.x, this._target.rotation.z); + } + this._target.rotationQuaternion.toRotationMatrix(this._tmpMatrix); + Vector3.TransformCoordinatesToRef(v.direction, this._tmpMatrix, v.rotatedDirection); + v.diff = Vector3.GetAngleBetweenVectors(v.rotatedDirection, targetDirection, Vector3.Cross(v.rotatedDirection, targetDirection)); + }); + return this._faceVectors.reduce((min, p) => { + if (min.ignore) { + return p; + } else if (p.ignore) { + return min; + } else { + return min.diff < p.diff ? min : p; + } + }, this._faceVectors[0]); + } + _lookAtToRef(pos, up = new Vector3(0, 1, 0), ref) { + Matrix.LookAtLHToRef(this._zeroVector, pos, up, this._lookAtTmpMatrix); + this._lookAtTmpMatrix.invert(); + Quaternion.FromRotationMatrixToRef(this._lookAtTmpMatrix, ref); + } + attach(target) { + this._target = target; + this._scene = this._target.getScene(); + this._onRenderObserver = this._scene.onBeforeRenderObservable.add(() => { + if (!this._scene.activeCamera) { + return; + } + let cameraPos = this._scene.activeCamera.position; + if (this._scene.activeCamera.devicePosition) { + cameraPos = this._scene.activeCamera.devicePosition; + } + const facing = this._closestFace(cameraPos.subtract(target.position)); + if (this._scene.activeCamera.leftCamera) { + this._scene.activeCamera.leftCamera.computeWorldMatrix().getRotationMatrixToRef(this._tmpMatrix); + } else { + this._scene.activeCamera.computeWorldMatrix().getRotationMatrixToRef(this._tmpMatrix); + } + Vector3.TransformCoordinatesToRef(Vector3.Up(), this._tmpMatrix, this._tmpVector); + this._faceVectors.forEach((v) => { + if (facing.direction.x && v.direction.x) { + v.ignore = true; + } + if (facing.direction.y && v.direction.y) { + v.ignore = true; + } + if (facing.direction.z && v.direction.z) { + v.ignore = true; + } + }); + const facingUp = this._closestFace(this._tmpVector); + this._faceVectors.forEach((v) => { + v.ignore = false; + }); + this._ui.position.copyFrom(target.position); + if (facing.direction.x) { + facing.rotatedDirection.scaleToRef(target.scaling.x / 2 + this.distanceAwayFromFace, this._tmpVector); + this._ui.position.addInPlace(this._tmpVector); + } + if (facing.direction.y) { + facing.rotatedDirection.scaleToRef(target.scaling.y / 2 + this.distanceAwayFromFace, this._tmpVector); + this._ui.position.addInPlace(this._tmpVector); + } + if (facing.direction.z) { + facing.rotatedDirection.scaleToRef(target.scaling.z / 2 + this.distanceAwayFromFace, this._tmpVector); + this._ui.position.addInPlace(this._tmpVector); + } + if (!this._ui.rotationQuaternion) { + this._ui.rotationQuaternion = Quaternion.RotationYawPitchRoll(this._ui.rotation.y, this._ui.rotation.x, this._ui.rotation.z); + } + facing.rotatedDirection.scaleToRef(-1, this._tmpVector); + this._lookAtToRef(this._tmpVector, facingUp.rotatedDirection, this._ui.rotationQuaternion); + if (facingUp.direction.x) { + this._ui.up.scaleToRef(this.distanceAwayFromBottomOfFace - target.scaling.x / 2, this._tmpVector); + } + if (facingUp.direction.y) { + this._ui.up.scaleToRef(this.distanceAwayFromBottomOfFace - target.scaling.y / 2, this._tmpVector); + } + if (facingUp.direction.z) { + this._ui.up.scaleToRef(this.distanceAwayFromBottomOfFace - target.scaling.z / 2, this._tmpVector); + } + this._ui.position.addInPlace(this._tmpVector); + }); + } + detach() { + this._scene.onBeforeRenderObservable.remove(this._onRenderObserver); + } +} +var init_attachToBoxBehavior = __esm(() => { + init_math_vector(); +}); + // node_modules/@babylonjs/core/Behaviors/Meshes/fadeInOutBehavior.js class FadeInOutBehavior { get delay() { @@ -47273,6 +48672,9 @@ class FadeInOutBehavior { } } } +var init_fadeInOutBehavior = __esm(() => { +}); + // node_modules/@babylonjs/core/Culling/ray.js class Ray { constructor(origin, direction, length = Number.MAX_VALUE) { @@ -47627,240 +49029,249 @@ class Ray { this.direction.normalize(); } } -Ray._TmpVector3 = ArrayTools.BuildArray(6, Vector3.Zero); -Ray._RayDistant = Ray.Zero(); -Ray._Smallnum = 0.00000001; -Ray._Rayl = 1e9; -Scene.prototype.createPickingRay = function(x, y, world, camera5, cameraViewSpace = false) { - const result = Ray.Zero(); - this.createPickingRayToRef(x, y, world, result, camera5, cameraViewSpace); - return result; -}; -Scene.prototype.createPickingRayToRef = function(x, y, world, result, camera5, cameraViewSpace = false, enableDistantPicking = false) { - const engine7 = this.getEngine(); - if (!camera5 && !(camera5 = this.activeCamera)) { - return this; - } - const cameraViewport = camera5.viewport; - const renderHeight = engine7.getRenderHeight(); - const { x: vx, y: vy, width, height } = cameraViewport.toGlobal(engine7.getRenderWidth(), renderHeight); - const levelInv = 1 / engine7.getHardwareScalingLevel(); - x = x * levelInv - vx; - y = y * levelInv - (renderHeight - vy - height); - result.update(x, y, width, height, world ? world : Matrix.IdentityReadOnly, cameraViewSpace ? Matrix.IdentityReadOnly : camera5.getViewMatrix(), camera5.getProjectionMatrix(), enableDistantPicking); - return this; -}; -Scene.prototype.createPickingRayInCameraSpace = function(x, y, camera5) { - const result = Ray.Zero(); - this.createPickingRayInCameraSpaceToRef(x, y, result, camera5); - return result; -}; -Scene.prototype.createPickingRayInCameraSpaceToRef = function(x, y, result, camera5) { - if (!PickingInfo) { - return this; - } - const engine7 = this.getEngine(); - if (!camera5 && !(camera5 = this.activeCamera)) { - throw new Error("Active camera not set"); - } - const cameraViewport = camera5.viewport; - const renderHeight = engine7.getRenderHeight(); - const { x: vx, y: vy, width, height } = cameraViewport.toGlobal(engine7.getRenderWidth(), renderHeight); - const identity = Matrix.Identity(); - const levelInv = 1 / engine7.getHardwareScalingLevel(); - x = x * levelInv - vx; - y = y * levelInv - (renderHeight - vy - height); - result.update(x, y, width, height, identity, identity, camera5.getProjectionMatrix()); - return this; -}; -Scene.prototype._internalPickForMesh = function(pickingInfo5, rayFunction, mesh3, world, fastCheck, onlyBoundingInfo, trianglePredicate, skipBoundingInfo) { - const ray = rayFunction(world, mesh3.enableDistantPicking); - const result = mesh3.intersects(ray, fastCheck, trianglePredicate, onlyBoundingInfo, world, skipBoundingInfo); - if (!result || !result.hit) { - return null; - } - if (!fastCheck && pickingInfo5 != null && result.distance >= pickingInfo5.distance) { - return null; - } - return result; -}; -Scene.prototype._internalPick = function(rayFunction, predicate, fastCheck, onlyBoundingInfo, trianglePredicate) { - let pickingInfo5 = null; - const computeWorldMatrixForCamera = !!(this.activeCameras && this.activeCameras.length > 1 && this.cameraToUseForPointers !== this.activeCamera); - const currentCamera = this.cameraToUseForPointers || this.activeCamera; - for (let meshIndex = 0;meshIndex < this.meshes.length; meshIndex++) { - const mesh3 = this.meshes[meshIndex]; - if (predicate) { - if (!predicate(mesh3)) { - continue; - } - } else if (!mesh3.isEnabled() || !mesh3.isVisible || !mesh3.isPickable) { - continue; +var init_ray = __esm(() => { + init_arrayTools(); + init_math_vector(); + init_pickingInfo(); + init_intersectionInfo(); + init_scene(); + init_camera(); + init_engineStore(); + Ray._TmpVector3 = ArrayTools.BuildArray(6, Vector3.Zero); + Ray._RayDistant = Ray.Zero(); + Ray._Smallnum = 0.00000001; + Ray._Rayl = 1e9; + Scene.prototype.createPickingRay = function(x, y, world, camera5, cameraViewSpace = false) { + const result = Ray.Zero(); + this.createPickingRayToRef(x, y, world, result, camera5, cameraViewSpace); + return result; + }; + Scene.prototype.createPickingRayToRef = function(x, y, world, result, camera5, cameraViewSpace = false, enableDistantPicking = false) { + const engine7 = this.getEngine(); + if (!camera5 && !(camera5 = this.activeCamera)) { + return this; } - const forceCompute = computeWorldMatrixForCamera && mesh3.isWorldMatrixCameraDependent(); - const world = mesh3.computeWorldMatrix(forceCompute, currentCamera); - if (mesh3.hasThinInstances && mesh3.thinInstanceEnablePicking) { - const result = this._internalPickForMesh(pickingInfo5, rayFunction, mesh3, world, true, true, trianglePredicate); - if (result) { - if (onlyBoundingInfo) { - return result; + const cameraViewport = camera5.viewport; + const renderHeight = engine7.getRenderHeight(); + const { x: vx, y: vy, width, height } = cameraViewport.toGlobal(engine7.getRenderWidth(), renderHeight); + const levelInv = 1 / engine7.getHardwareScalingLevel(); + x = x * levelInv - vx; + y = y * levelInv - (renderHeight - vy - height); + result.update(x, y, width, height, world ? world : Matrix.IdentityReadOnly, cameraViewSpace ? Matrix.IdentityReadOnly : camera5.getViewMatrix(), camera5.getProjectionMatrix(), enableDistantPicking); + return this; + }; + Scene.prototype.createPickingRayInCameraSpace = function(x, y, camera5) { + const result = Ray.Zero(); + this.createPickingRayInCameraSpaceToRef(x, y, result, camera5); + return result; + }; + Scene.prototype.createPickingRayInCameraSpaceToRef = function(x, y, result, camera5) { + if (!PickingInfo) { + return this; + } + const engine7 = this.getEngine(); + if (!camera5 && !(camera5 = this.activeCamera)) { + throw new Error("Active camera not set"); + } + const cameraViewport = camera5.viewport; + const renderHeight = engine7.getRenderHeight(); + const { x: vx, y: vy, width, height } = cameraViewport.toGlobal(engine7.getRenderWidth(), renderHeight); + const identity = Matrix.Identity(); + const levelInv = 1 / engine7.getHardwareScalingLevel(); + x = x * levelInv - vx; + y = y * levelInv - (renderHeight - vy - height); + result.update(x, y, width, height, identity, identity, camera5.getProjectionMatrix()); + return this; + }; + Scene.prototype._internalPickForMesh = function(pickingInfo5, rayFunction, mesh3, world, fastCheck, onlyBoundingInfo, trianglePredicate, skipBoundingInfo) { + const ray = rayFunction(world, mesh3.enableDistantPicking); + const result = mesh3.intersects(ray, fastCheck, trianglePredicate, onlyBoundingInfo, world, skipBoundingInfo); + if (!result || !result.hit) { + return null; + } + if (!fastCheck && pickingInfo5 != null && result.distance >= pickingInfo5.distance) { + return null; + } + return result; + }; + Scene.prototype._internalPick = function(rayFunction, predicate, fastCheck, onlyBoundingInfo, trianglePredicate) { + let pickingInfo5 = null; + const computeWorldMatrixForCamera = !!(this.activeCameras && this.activeCameras.length > 1 && this.cameraToUseForPointers !== this.activeCamera); + const currentCamera = this.cameraToUseForPointers || this.activeCamera; + for (let meshIndex = 0;meshIndex < this.meshes.length; meshIndex++) { + const mesh3 = this.meshes[meshIndex]; + if (predicate) { + if (!predicate(mesh3)) { + continue; } - const tmpMatrix = TmpVectors.Matrix[1]; - const thinMatrices = mesh3.thinInstanceGetWorldMatrices(); - for (let index = 0;index < thinMatrices.length; index++) { - const thinMatrix = thinMatrices[index]; - thinMatrix.multiplyToRef(world, tmpMatrix); - const result2 = this._internalPickForMesh(pickingInfo5, rayFunction, mesh3, tmpMatrix, fastCheck, onlyBoundingInfo, trianglePredicate, true); - if (result2) { - pickingInfo5 = result2; - pickingInfo5.thinInstanceIndex = index; - if (fastCheck) { - return pickingInfo5; + } else if (!mesh3.isEnabled() || !mesh3.isVisible || !mesh3.isPickable) { + continue; + } + const forceCompute = computeWorldMatrixForCamera && mesh3.isWorldMatrixCameraDependent(); + const world = mesh3.computeWorldMatrix(forceCompute, currentCamera); + if (mesh3.hasThinInstances && mesh3.thinInstanceEnablePicking) { + const result = this._internalPickForMesh(pickingInfo5, rayFunction, mesh3, world, true, true, trianglePredicate); + if (result) { + if (onlyBoundingInfo) { + return result; + } + const tmpMatrix = TmpVectors.Matrix[1]; + const thinMatrices = mesh3.thinInstanceGetWorldMatrices(); + for (let index = 0;index < thinMatrices.length; index++) { + const thinMatrix = thinMatrices[index]; + thinMatrix.multiplyToRef(world, tmpMatrix); + const result2 = this._internalPickForMesh(pickingInfo5, rayFunction, mesh3, tmpMatrix, fastCheck, onlyBoundingInfo, trianglePredicate, true); + if (result2) { + pickingInfo5 = result2; + pickingInfo5.thinInstanceIndex = index; + if (fastCheck) { + return pickingInfo5; + } } } } - } - } else { - const result = this._internalPickForMesh(pickingInfo5, rayFunction, mesh3, world, fastCheck, onlyBoundingInfo, trianglePredicate); - if (result) { - pickingInfo5 = result; - if (fastCheck) { - return pickingInfo5; + } else { + const result = this._internalPickForMesh(pickingInfo5, rayFunction, mesh3, world, fastCheck, onlyBoundingInfo, trianglePredicate); + if (result) { + pickingInfo5 = result; + if (fastCheck) { + return pickingInfo5; + } } } } - } - return pickingInfo5 || new PickingInfo; -}; -Scene.prototype._internalMultiPick = function(rayFunction, predicate, trianglePredicate) { - if (!PickingInfo) { - return null; - } - const pickingInfos = []; - const computeWorldMatrixForCamera = !!(this.activeCameras && this.activeCameras.length > 1 && this.cameraToUseForPointers !== this.activeCamera); - const currentCamera = this.cameraToUseForPointers || this.activeCamera; - for (let meshIndex = 0;meshIndex < this.meshes.length; meshIndex++) { - const mesh3 = this.meshes[meshIndex]; - if (predicate) { - if (!predicate(mesh3)) { + return pickingInfo5 || new PickingInfo; + }; + Scene.prototype._internalMultiPick = function(rayFunction, predicate, trianglePredicate) { + if (!PickingInfo) { + return null; + } + const pickingInfos = []; + const computeWorldMatrixForCamera = !!(this.activeCameras && this.activeCameras.length > 1 && this.cameraToUseForPointers !== this.activeCamera); + const currentCamera = this.cameraToUseForPointers || this.activeCamera; + for (let meshIndex = 0;meshIndex < this.meshes.length; meshIndex++) { + const mesh3 = this.meshes[meshIndex]; + if (predicate) { + if (!predicate(mesh3)) { + continue; + } + } else if (!mesh3.isEnabled() || !mesh3.isVisible || !mesh3.isPickable) { continue; } - } else if (!mesh3.isEnabled() || !mesh3.isVisible || !mesh3.isPickable) { - continue; - } - const forceCompute = computeWorldMatrixForCamera && mesh3.isWorldMatrixCameraDependent(); - const world = mesh3.computeWorldMatrix(forceCompute, currentCamera); - if (mesh3.hasThinInstances && mesh3.thinInstanceEnablePicking) { - const result = this._internalPickForMesh(null, rayFunction, mesh3, world, true, true, trianglePredicate); - if (result) { - const tmpMatrix = TmpVectors.Matrix[1]; - const thinMatrices = mesh3.thinInstanceGetWorldMatrices(); - for (let index = 0;index < thinMatrices.length; index++) { - const thinMatrix = thinMatrices[index]; - thinMatrix.multiplyToRef(world, tmpMatrix); - const result2 = this._internalPickForMesh(null, rayFunction, mesh3, tmpMatrix, false, false, trianglePredicate, true); - if (result2) { - result2.thinInstanceIndex = index; - pickingInfos.push(result2); + const forceCompute = computeWorldMatrixForCamera && mesh3.isWorldMatrixCameraDependent(); + const world = mesh3.computeWorldMatrix(forceCompute, currentCamera); + if (mesh3.hasThinInstances && mesh3.thinInstanceEnablePicking) { + const result = this._internalPickForMesh(null, rayFunction, mesh3, world, true, true, trianglePredicate); + if (result) { + const tmpMatrix = TmpVectors.Matrix[1]; + const thinMatrices = mesh3.thinInstanceGetWorldMatrices(); + for (let index = 0;index < thinMatrices.length; index++) { + const thinMatrix = thinMatrices[index]; + thinMatrix.multiplyToRef(world, tmpMatrix); + const result2 = this._internalPickForMesh(null, rayFunction, mesh3, tmpMatrix, false, false, trianglePredicate, true); + if (result2) { + result2.thinInstanceIndex = index; + pickingInfos.push(result2); + } } } + } else { + const result = this._internalPickForMesh(null, rayFunction, mesh3, world, false, false, trianglePredicate); + if (result) { + pickingInfos.push(result); + } } - } else { - const result = this._internalPickForMesh(null, rayFunction, mesh3, world, false, false, trianglePredicate); - if (result) { - pickingInfos.push(result); + } + return pickingInfos; + }; + Scene.prototype.pickWithBoundingInfo = function(x, y, predicate, fastCheck, camera5) { + if (!PickingInfo) { + return null; + } + const result = this._internalPick((world) => { + if (!this._tempPickingRay) { + this._tempPickingRay = Ray.Zero(); } + this.createPickingRayToRef(x, y, world, this._tempPickingRay, camera5 || null); + return this._tempPickingRay; + }, predicate, fastCheck, true); + if (result) { + result.ray = this.createPickingRay(x, y, Matrix.Identity(), camera5 || null); } - } - return pickingInfos; -}; -Scene.prototype.pickWithBoundingInfo = function(x, y, predicate, fastCheck, camera5) { - if (!PickingInfo) { - return null; - } - const result = this._internalPick((world) => { - if (!this._tempPickingRay) { - this._tempPickingRay = Ray.Zero(); + return result; + }; + Object.defineProperty(Scene.prototype, "_pickingAvailable", { + get: () => true, + enumerable: false, + configurable: false + }); + Scene.prototype.pick = function(x, y, predicate, fastCheck, camera5, trianglePredicate, _enableDistantPicking = false) { + const result = this._internalPick((world, enableDistantPicking) => { + if (!this._tempPickingRay) { + this._tempPickingRay = Ray.Zero(); + } + this.createPickingRayToRef(x, y, world, this._tempPickingRay, camera5 || null, false, enableDistantPicking); + return this._tempPickingRay; + }, predicate, fastCheck, false, trianglePredicate); + if (result) { + result.ray = this.createPickingRay(x, y, Matrix.Identity(), camera5 || null); } - this.createPickingRayToRef(x, y, world, this._tempPickingRay, camera5 || null); - return this._tempPickingRay; - }, predicate, fastCheck, true); - if (result) { - result.ray = this.createPickingRay(x, y, Matrix.Identity(), camera5 || null); - } - return result; -}; -Object.defineProperty(Scene.prototype, "_pickingAvailable", { - get: () => true, - enumerable: false, - configurable: false -}); -Scene.prototype.pick = function(x, y, predicate, fastCheck, camera5, trianglePredicate, _enableDistantPicking = false) { - const result = this._internalPick((world, enableDistantPicking) => { - if (!this._tempPickingRay) { - this._tempPickingRay = Ray.Zero(); - } - this.createPickingRayToRef(x, y, world, this._tempPickingRay, camera5 || null, false, enableDistantPicking); - return this._tempPickingRay; - }, predicate, fastCheck, false, trianglePredicate); - if (result) { - result.ray = this.createPickingRay(x, y, Matrix.Identity(), camera5 || null); - } - return result; -}; -Scene.prototype.pickWithRay = function(ray, predicate, fastCheck, trianglePredicate) { - const result = this._internalPick((world) => { - if (!this._pickWithRayInverseMatrix) { - this._pickWithRayInverseMatrix = Matrix.Identity(); + return result; + }; + Scene.prototype.pickWithRay = function(ray, predicate, fastCheck, trianglePredicate) { + const result = this._internalPick((world) => { + if (!this._pickWithRayInverseMatrix) { + this._pickWithRayInverseMatrix = Matrix.Identity(); + } + world.invertToRef(this._pickWithRayInverseMatrix); + if (!this._cachedRayForTransform) { + this._cachedRayForTransform = Ray.Zero(); + } + Ray.TransformToRef(ray, this._pickWithRayInverseMatrix, this._cachedRayForTransform); + return this._cachedRayForTransform; + }, predicate, fastCheck, false, trianglePredicate); + if (result) { + result.ray = ray; } - world.invertToRef(this._pickWithRayInverseMatrix); - if (!this._cachedRayForTransform) { - this._cachedRayForTransform = Ray.Zero(); + return result; + }; + Scene.prototype.multiPick = function(x, y, predicate, camera5, trianglePredicate) { + return this._internalMultiPick((world) => this.createPickingRay(x, y, world, camera5 || null), predicate, trianglePredicate); + }; + Scene.prototype.multiPickWithRay = function(ray, predicate, trianglePredicate) { + return this._internalMultiPick((world) => { + if (!this._pickWithRayInverseMatrix) { + this._pickWithRayInverseMatrix = Matrix.Identity(); + } + world.invertToRef(this._pickWithRayInverseMatrix); + if (!this._cachedRayForTransform) { + this._cachedRayForTransform = Ray.Zero(); + } + Ray.TransformToRef(ray, this._pickWithRayInverseMatrix, this._cachedRayForTransform); + return this._cachedRayForTransform; + }, predicate, trianglePredicate); + }; + Camera.prototype.getForwardRay = function(length = 100, transform, origin) { + return this.getForwardRayToRef(new Ray(Vector3.Zero(), Vector3.Zero(), length), length, transform, origin); + }; + Camera.prototype.getForwardRayToRef = function(refRay, length = 100, transform, origin) { + if (!transform) { + transform = this.getWorldMatrix(); } - Ray.TransformToRef(ray, this._pickWithRayInverseMatrix, this._cachedRayForTransform); - return this._cachedRayForTransform; - }, predicate, fastCheck, false, trianglePredicate); - if (result) { - result.ray = ray; - } - return result; -}; -Scene.prototype.multiPick = function(x, y, predicate, camera5, trianglePredicate) { - return this._internalMultiPick((world) => this.createPickingRay(x, y, world, camera5 || null), predicate, trianglePredicate); -}; -Scene.prototype.multiPickWithRay = function(ray, predicate, trianglePredicate) { - return this._internalMultiPick((world) => { - if (!this._pickWithRayInverseMatrix) { - this._pickWithRayInverseMatrix = Matrix.Identity(); - } - world.invertToRef(this._pickWithRayInverseMatrix); - if (!this._cachedRayForTransform) { - this._cachedRayForTransform = Ray.Zero(); - } - Ray.TransformToRef(ray, this._pickWithRayInverseMatrix, this._cachedRayForTransform); - return this._cachedRayForTransform; - }, predicate, trianglePredicate); -}; -Camera.prototype.getForwardRay = function(length = 100, transform, origin) { - return this.getForwardRayToRef(new Ray(Vector3.Zero(), Vector3.Zero(), length), length, transform, origin); -}; -Camera.prototype.getForwardRayToRef = function(refRay, length = 100, transform, origin) { - if (!transform) { - transform = this.getWorldMatrix(); - } - refRay.length = length; - if (origin) { - refRay.origin.copyFrom(origin); - } else { - refRay.origin.copyFrom(this.position); - } - const forward = TmpVectors.Vector3[2]; - forward.set(0, 0, this._scene.useRightHandedSystem ? -1 : 1); - const worldForward = TmpVectors.Vector3[3]; - Vector3.TransformNormalToRef(forward, transform, worldForward); - Vector3.NormalizeToRef(worldForward, refRay.direction); - return refRay; -}; + refRay.length = length; + if (origin) { + refRay.origin.copyFrom(origin); + } else { + refRay.origin.copyFrom(this.position); + } + const forward = TmpVectors.Vector3[2]; + forward.set(0, 0, this._scene.useRightHandedSystem ? -1 : 1); + const worldForward = TmpVectors.Vector3[3]; + Vector3.TransformNormalToRef(forward, transform, worldForward); + Vector3.NormalizeToRef(worldForward, refRay.direction); + return refRay; + }; +}); // node_modules/@babylonjs/core/Misc/pivotTools.js class PivotTools { @@ -47891,11 +49302,14 @@ class PivotTools { this._PivotCached--; } } -PivotTools._PivotCached = 0; -PivotTools._OldPivotPoint = new Vector3; -PivotTools._PivotTranslation = new Vector3; -PivotTools._PivotTmpVector = new Vector3; -PivotTools._PivotPostMultiplyPivotMatrix = false; +var init_pivotTools = __esm(() => { + init_math_vector(); + PivotTools._PivotCached = 0; + PivotTools._OldPivotPoint = new Vector3; + PivotTools._PivotTranslation = new Vector3; + PivotTools._PivotTmpVector = new Vector3; + PivotTools._PivotPostMultiplyPivotMatrix = false; +}); // node_modules/@babylonjs/core/Meshes/Builders/planeBuilder.js function CreatePlaneVertexData(options) { @@ -47934,8 +49348,8 @@ function CreatePlaneVertexData(options) { vertexData.uvs = uvs; return vertexData; } -function CreatePlane(name, options = {}, scene8 = null) { - const plane = new Mesh(name, scene8); +function CreatePlane(name2, options = {}, scene8 = null) { + const plane = new Mesh(name2, scene8); options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation); plane._originalBuilderSideOrientation = options.sideOrientation; const vertexData = CreatePlaneVertexData(options); @@ -47946,17 +49360,26 @@ function CreatePlane(name, options = {}, scene8 = null) { } return plane; } -VertexData.CreatePlane = CreatePlaneVertexData; -Mesh.CreatePlane = (name, size, scene8, updatable, sideOrientation) => { - const options = { - size, - width: size, - height: size, - sideOrientation, - updatable +var PlaneBuilder; +var init_planeBuilder = __esm(() => { + init_mesh(); + init_mesh_vertexData(); + init_compatibilityOptions(); + PlaneBuilder = { + CreatePlane }; - return CreatePlane(name, options, scene8); -}; + VertexData.CreatePlane = CreatePlaneVertexData; + Mesh.CreatePlane = (name2, size, scene8, updatable, sideOrientation) => { + const options = { + size, + width: size, + height: size, + sideOrientation, + updatable + }; + return CreatePlane(name2, options, scene8); + }; +}); // node_modules/@babylonjs/core/Behaviors/Meshes/pointerDragBehavior.js class PointerDragBehavior { @@ -48299,7 +49722,94 @@ class PointerDragBehavior { this.releaseDrag(); } } -PointerDragBehavior._AnyMouseId = -2; +var init_pointerDragBehavior = __esm(() => { + init_mesh(); + init_scene(); + init_observable(); + init_math_vector(); + init_pointerEvents(); + init_ray(); + init_pivotTools(); + init_planeBuilder(); + init_math_constants(); + PointerDragBehavior._AnyMouseId = -2; +}); + +// node_modules/@babylonjs/core/Behaviors/Meshes/multiPointerScaleBehavior.js +class MultiPointerScaleBehavior { + constructor() { + this._startDistance = 0; + this._initialScale = new Vector3(0, 0, 0); + this._targetScale = new Vector3(0, 0, 0); + this._sceneRenderObserver = null; + this._dragBehaviorA = new PointerDragBehavior({}); + this._dragBehaviorA.moveAttached = false; + this._dragBehaviorB = new PointerDragBehavior({}); + this._dragBehaviorB.moveAttached = false; + } + get name() { + return "MultiPointerScale"; + } + init() { + } + _getCurrentDistance() { + return this._dragBehaviorA.lastDragPosition.subtract(this._dragBehaviorB.lastDragPosition).length(); + } + attach(ownerNode) { + this._ownerNode = ownerNode; + this._dragBehaviorA.onDragStartObservable.add(() => { + if (this._dragBehaviorA.dragging && this._dragBehaviorB.dragging) { + if (this._dragBehaviorA.currentDraggingPointerId == this._dragBehaviorB.currentDraggingPointerId) { + this._dragBehaviorA.releaseDrag(); + } else { + this._initialScale.copyFrom(ownerNode.scaling); + this._startDistance = this._getCurrentDistance(); + } + } + }); + this._dragBehaviorB.onDragStartObservable.add(() => { + if (this._dragBehaviorA.dragging && this._dragBehaviorB.dragging) { + if (this._dragBehaviorA.currentDraggingPointerId == this._dragBehaviorB.currentDraggingPointerId) { + this._dragBehaviorB.releaseDrag(); + } else { + this._initialScale.copyFrom(ownerNode.scaling); + this._startDistance = this._getCurrentDistance(); + } + } + }); + [this._dragBehaviorA, this._dragBehaviorB].forEach((behavior) => { + behavior.onDragObservable.add(() => { + if (this._dragBehaviorA.dragging && this._dragBehaviorB.dragging) { + const ratio = this._getCurrentDistance() / this._startDistance; + this._initialScale.scaleToRef(ratio, this._targetScale); + } + }); + }); + ownerNode.addBehavior(this._dragBehaviorA); + ownerNode.addBehavior(this._dragBehaviorB); + this._sceneRenderObserver = ownerNode.getScene().onBeforeRenderObservable.add(() => { + if (this._dragBehaviorA.dragging && this._dragBehaviorB.dragging) { + const change = this._targetScale.subtract(ownerNode.scaling).scaleInPlace(0.1); + if (change.length() > 0.01) { + ownerNode.scaling.addInPlace(change); + } + } + }); + } + detach() { + this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver); + [this._dragBehaviorA, this._dragBehaviorB].forEach((behavior) => { + behavior.onDragStartObservable.clear(); + behavior.onDragObservable.clear(); + this._ownerNode.removeBehavior(behavior); + }); + } +} +var init_multiPointerScaleBehavior = __esm(() => { + init_pointerDragBehavior(); + init_math_vector(); +}); + // node_modules/@babylonjs/core/Behaviors/Meshes/baseSixDofDragBehavior.js class BaseSixDofDragBehavior { constructor() { @@ -48597,6 +50107,14 @@ class BaseSixDofDragBehavior { this.onDragStartObservable.clear(); } } +var init_baseSixDofDragBehavior = __esm(() => { + init_abstractMesh(); + init_scene(); + init_pointerEvents(); + init_math_vector(); + init_observable(); + init_camera(); +}); // node_modules/@babylonjs/core/Behaviors/Meshes/sixDofDragBehavior.js class SixDofDragBehavior extends BaseSixDofDragBehavior { @@ -48763,6 +50281,14 @@ class SixDofDragBehavior extends BaseSixDofDragBehavior { } } } +var init_sixDofDragBehavior = __esm(() => { + init_math_vector(); + init_observable(); + init_baseSixDofDragBehavior(); + init_transformNode(); + init_math_axis(); +}); + // node_modules/@babylonjs/core/Behaviors/Meshes/surfaceMagnetismBehavior.js class SurfaceMagnetismBehavior { constructor() { @@ -48904,6 +50430,11 @@ class SurfaceMagnetismBehavior { this._onBeforeRender = null; } } +var init_surfaceMagnetismBehavior = __esm(() => { + init_pointerEvents(); + init_math_vector(); +}); + // node_modules/@babylonjs/core/Behaviors/Meshes/followBehavior.js class FollowBehavior { constructor() { @@ -49186,30 +50717,15 @@ class FollowBehavior { } } } +var init_followBehavior = __esm(() => { + init_math_vector(); + init_math_scalar(); + init_math_constants(); +}); + // node_modules/@babylonjs/core/XR/webXRFeaturesManager.js class WebXRFeatureName { } -WebXRFeatureName.ANCHOR_SYSTEM = "xr-anchor-system"; -WebXRFeatureName.BACKGROUND_REMOVER = "xr-background-remover"; -WebXRFeatureName.HIT_TEST = "xr-hit-test"; -WebXRFeatureName.MESH_DETECTION = "xr-mesh-detection"; -WebXRFeatureName.PHYSICS_CONTROLLERS = "xr-physics-controller"; -WebXRFeatureName.PLANE_DETECTION = "xr-plane-detection"; -WebXRFeatureName.POINTER_SELECTION = "xr-controller-pointer-selection"; -WebXRFeatureName.TELEPORTATION = "xr-controller-teleportation"; -WebXRFeatureName.FEATURE_POINTS = "xr-feature-points"; -WebXRFeatureName.HAND_TRACKING = "xr-hand-tracking"; -WebXRFeatureName.IMAGE_TRACKING = "xr-image-tracking"; -WebXRFeatureName.NEAR_INTERACTION = "xr-near-interaction"; -WebXRFeatureName.DOM_OVERLAY = "xr-dom-overlay"; -WebXRFeatureName.MOVEMENT = "xr-controller-movement"; -WebXRFeatureName.LIGHT_ESTIMATION = "xr-light-estimation"; -WebXRFeatureName.EYE_TRACKING = "xr-eye-tracking"; -WebXRFeatureName.WALKING_LOCOMOTION = "xr-walking-locomotion"; -WebXRFeatureName.LAYERS = "xr-layers"; -WebXRFeatureName.DEPTH_SENSING = "xr-depth-sensing"; -WebXRFeatureName.SPACE_WARP = "xr-space-warp"; -WebXRFeatureName.RAW_CAMERA_ACCESS = "xr-raw-camera-access"; class WebXRFeaturesManager { constructor(_xrSessionManager) { @@ -49274,13 +50790,13 @@ class WebXRFeaturesManager { } } disableFeature(featureName) { - const name = typeof featureName === "string" ? featureName : featureName.Name; - const feature = this._features[name]; + const name2 = typeof featureName === "string" ? featureName : featureName.Name; + const feature = this._features[name2]; if (feature && feature.enabled) { feature.enabled = false; - this.detachFeature(name); + this.detachFeature(name2); feature.featureImplementation.dispose(); - delete this._features[name]; + delete this._features[name2]; return true; } return false; @@ -49291,36 +50807,36 @@ class WebXRFeaturesManager { }); } enableFeature(featureName, version = "latest", moduleOptions = {}, attachIfPossible = true, required = true) { - const name = typeof featureName === "string" ? featureName : featureName.Name; + const name2 = typeof featureName === "string" ? featureName : featureName.Name; let versionToLoad = 0; if (typeof version === "string") { if (!version) { - throw new Error(`Error in provided version - ${name} (${version})`); + throw new Error(`Error in provided version - ${name2} (${version})`); } if (version === "stable") { - versionToLoad = WebXRFeaturesManager.GetStableVersionOfFeature(name); + versionToLoad = WebXRFeaturesManager.GetStableVersionOfFeature(name2); } else if (version === "latest") { - versionToLoad = WebXRFeaturesManager.GetLatestVersionOfFeature(name); + versionToLoad = WebXRFeaturesManager.GetLatestVersionOfFeature(name2); } else { versionToLoad = +version; } if (versionToLoad === -1 || isNaN(versionToLoad)) { - throw new Error(`feature not found - ${name} (${version})`); + throw new Error(`feature not found - ${name2} (${version})`); } } else { versionToLoad = version; } - const conflictingFeature = WebXRFeaturesManager._ConflictingFeatures[name]; + const conflictingFeature = WebXRFeaturesManager._ConflictingFeatures[name2]; if (conflictingFeature !== undefined && this.getEnabledFeatures().indexOf(conflictingFeature) !== -1) { - throw new Error(`Feature ${name} cannot be enabled while ${conflictingFeature} is enabled.`); + throw new Error(`Feature ${name2} cannot be enabled while ${conflictingFeature} is enabled.`); } - const feature = this._features[name]; - const constructFunction = WebXRFeaturesManager.ConstructFeature(name, versionToLoad, this._xrSessionManager, moduleOptions); + const feature = this._features[name2]; + const constructFunction = WebXRFeaturesManager.ConstructFeature(name2, versionToLoad, this._xrSessionManager, moduleOptions); if (!constructFunction) { - throw new Error(`feature not found - ${name}`); + throw new Error(`feature not found - ${name2}`); } if (feature) { - this.disableFeature(name); + this.disableFeature(name2); } const constructed = constructFunction(); if (constructed.dependsOn) { @@ -49330,25 +50846,25 @@ class WebXRFeaturesManager { } } if (constructed.isCompatible()) { - this._features[name] = { + this._features[name2] = { featureImplementation: constructed, enabled: true, version: versionToLoad, required }; if (attachIfPossible) { - if (this._xrSessionManager.session && !this._features[name].featureImplementation.attached) { - this.attachFeature(name); + if (this._xrSessionManager.session && !this._features[name2].featureImplementation.attached) { + this.attachFeature(name2); } } else { - this._features[name].featureImplementation.disableAutoAttach = true; + this._features[name2].featureImplementation.disableAutoAttach = true; } - return this._features[name].featureImplementation; + return this._features[name2].featureImplementation; } else { if (required) { throw new Error("required feature not compatible"); } else { - Tools.Warn(`Feature ${name} not compatible with the current environment/browser and was not enabled.`); + Tools.Warn(`Feature ${name2} not compatible with the current environment/browser and was not enabled.`); return constructed; } } @@ -49385,11 +50901,35 @@ class WebXRFeaturesManager { return xrSessionInit; } } -WebXRFeaturesManager._AvailableFeatures = {}; -WebXRFeaturesManager._ConflictingFeatures = { - [WebXRFeatureName.TELEPORTATION]: WebXRFeatureName.MOVEMENT, - [WebXRFeatureName.MOVEMENT]: WebXRFeatureName.TELEPORTATION -}; +var init_webXRFeaturesManager = __esm(() => { + init_tools(); + WebXRFeatureName.ANCHOR_SYSTEM = "xr-anchor-system"; + WebXRFeatureName.BACKGROUND_REMOVER = "xr-background-remover"; + WebXRFeatureName.HIT_TEST = "xr-hit-test"; + WebXRFeatureName.MESH_DETECTION = "xr-mesh-detection"; + WebXRFeatureName.PHYSICS_CONTROLLERS = "xr-physics-controller"; + WebXRFeatureName.PLANE_DETECTION = "xr-plane-detection"; + WebXRFeatureName.POINTER_SELECTION = "xr-controller-pointer-selection"; + WebXRFeatureName.TELEPORTATION = "xr-controller-teleportation"; + WebXRFeatureName.FEATURE_POINTS = "xr-feature-points"; + WebXRFeatureName.HAND_TRACKING = "xr-hand-tracking"; + WebXRFeatureName.IMAGE_TRACKING = "xr-image-tracking"; + WebXRFeatureName.NEAR_INTERACTION = "xr-near-interaction"; + WebXRFeatureName.DOM_OVERLAY = "xr-dom-overlay"; + WebXRFeatureName.MOVEMENT = "xr-controller-movement"; + WebXRFeatureName.LIGHT_ESTIMATION = "xr-light-estimation"; + WebXRFeatureName.EYE_TRACKING = "xr-eye-tracking"; + WebXRFeatureName.WALKING_LOCOMOTION = "xr-walking-locomotion"; + WebXRFeatureName.LAYERS = "xr-layers"; + WebXRFeatureName.DEPTH_SENSING = "xr-depth-sensing"; + WebXRFeatureName.SPACE_WARP = "xr-space-warp"; + WebXRFeatureName.RAW_CAMERA_ACCESS = "xr-raw-camera-access"; + WebXRFeaturesManager._AvailableFeatures = {}; + WebXRFeaturesManager._ConflictingFeatures = { + [WebXRFeatureName.TELEPORTATION]: WebXRFeatureName.MOVEMENT, + [WebXRFeatureName.MOVEMENT]: WebXRFeatureName.TELEPORTATION + }; +}); // node_modules/@babylonjs/core/XR/features/WebXRAbstractFeature.js class WebXRAbstractFeature { @@ -49452,6 +50992,9 @@ class WebXRAbstractFeature { }); } } +var init_WebXRAbstractFeature = __esm(() => { + init_observable(); +}); // node_modules/@babylonjs/core/Physics/v1/physicsJoint.js class PhysicsJoint { @@ -49475,27 +51018,66 @@ class PhysicsJoint { func(this._physicsPlugin.world, this._physicsJoint); } } -PhysicsJoint.DistanceJoint = 0; -PhysicsJoint.HingeJoint = 1; -PhysicsJoint.BallAndSocketJoint = 2; -PhysicsJoint.WheelJoint = 3; -PhysicsJoint.SliderJoint = 4; -PhysicsJoint.PrismaticJoint = 5; -PhysicsJoint.UniversalJoint = 6; -PhysicsJoint.Hinge2Joint = PhysicsJoint.WheelJoint; -PhysicsJoint.PointToPointJoint = 8; -PhysicsJoint.SpringJoint = 9; -PhysicsJoint.LockJoint = 10; -// node_modules/@babylonjs/core/Physics/v1/physicsImpostor.js -Mesh._PhysicsImpostorParser = function(scene10, physicObject, jsonObject) { - return new PhysicsImpostor(physicObject, jsonObject.physicsImpostor, { - mass: jsonObject.physicsMass, - friction: jsonObject.physicsFriction, - restitution: jsonObject.physicsRestitution - }, scene10); -}; +class DistanceJoint extends PhysicsJoint { + constructor(jointData) { + super(PhysicsJoint.DistanceJoint, jointData); + } + updateDistance(maxDistance, minDistance) { + this._physicsPlugin.updateDistanceJoint(this, maxDistance, minDistance); + } +} +class MotorEnabledJoint extends PhysicsJoint { + constructor(type, jointData) { + super(type, jointData); + } + setMotor(force, maxForce) { + this._physicsPlugin.setMotor(this, force || 0, maxForce); + } + setLimit(upperLimit, lowerLimit) { + this._physicsPlugin.setLimit(this, upperLimit, lowerLimit); + } +} + +class HingeJoint extends MotorEnabledJoint { + constructor(jointData) { + super(PhysicsJoint.HingeJoint, jointData); + } + setMotor(force, maxForce) { + this._physicsPlugin.setMotor(this, force || 0, maxForce); + } + setLimit(upperLimit, lowerLimit) { + this._physicsPlugin.setLimit(this, upperLimit, lowerLimit); + } +} + +class Hinge2Joint extends MotorEnabledJoint { + constructor(jointData) { + super(PhysicsJoint.Hinge2Joint, jointData); + } + setMotor(targetSpeed, maxForce, motorIndex = 0) { + this._physicsPlugin.setMotor(this, targetSpeed || 0, maxForce, motorIndex); + } + setLimit(upperLimit, lowerLimit, motorIndex = 0) { + this._physicsPlugin.setLimit(this, upperLimit, lowerLimit, motorIndex); + } +} +var init_physicsJoint = __esm(() => { + PhysicsJoint.DistanceJoint = 0; + PhysicsJoint.HingeJoint = 1; + PhysicsJoint.BallAndSocketJoint = 2; + PhysicsJoint.WheelJoint = 3; + PhysicsJoint.SliderJoint = 4; + PhysicsJoint.PrismaticJoint = 5; + PhysicsJoint.UniversalJoint = 6; + PhysicsJoint.Hinge2Joint = PhysicsJoint.WheelJoint; + PhysicsJoint.PointToPointJoint = 8; + PhysicsJoint.SpringJoint = 9; + PhysicsJoint.LockJoint = 10; +}); + +// node_modules/@babylonjs/core/Physics/v1/physicsImpostor.js class PhysicsImpostor { get isDisposed() { return this._isDisposed; @@ -50083,34 +51665,42 @@ class PhysicsImpostor { mesh6.setAbsolutePosition(pos); } } -PhysicsImpostor.DEFAULT_OBJECT_SIZE = new Vector3(1, 1, 1); -PhysicsImpostor.IDENTITY_QUATERNION = Quaternion.Identity(); -PhysicsImpostor._TmpVecs = ArrayTools.BuildArray(3, Vector3.Zero); -PhysicsImpostor._TmpQuat = Quaternion.Identity(); -PhysicsImpostor.NoImpostor = 0; -PhysicsImpostor.SphereImpostor = 1; -PhysicsImpostor.BoxImpostor = 2; -PhysicsImpostor.PlaneImpostor = 3; -PhysicsImpostor.MeshImpostor = 4; -PhysicsImpostor.CapsuleImpostor = 6; -PhysicsImpostor.CylinderImpostor = 7; -PhysicsImpostor.ParticleImpostor = 8; -PhysicsImpostor.HeightmapImpostor = 9; -PhysicsImpostor.ConvexHullImpostor = 10; -PhysicsImpostor.CustomImpostor = 100; -PhysicsImpostor.RopeImpostor = 101; -PhysicsImpostor.ClothImpostor = 102; -PhysicsImpostor.SoftbodyImpostor = 103; +var init_physicsImpostor = __esm(() => { + init_logger(); + init_arrayTools(); + init_math_vector(); + init_abstractMesh(); + init_mesh(); + init_physicsJoint(); + init_math_axis(); + Mesh._PhysicsImpostorParser = function(scene10, physicObject, jsonObject) { + return new PhysicsImpostor(physicObject, jsonObject.physicsImpostor, { + mass: jsonObject.physicsMass, + friction: jsonObject.physicsFriction, + restitution: jsonObject.physicsRestitution + }, scene10); + }; + PhysicsImpostor.DEFAULT_OBJECT_SIZE = new Vector3(1, 1, 1); + PhysicsImpostor.IDENTITY_QUATERNION = Quaternion.Identity(); + PhysicsImpostor._TmpVecs = ArrayTools.BuildArray(3, Vector3.Zero); + PhysicsImpostor._TmpQuat = Quaternion.Identity(); + PhysicsImpostor.NoImpostor = 0; + PhysicsImpostor.SphereImpostor = 1; + PhysicsImpostor.BoxImpostor = 2; + PhysicsImpostor.PlaneImpostor = 3; + PhysicsImpostor.MeshImpostor = 4; + PhysicsImpostor.CapsuleImpostor = 6; + PhysicsImpostor.CylinderImpostor = 7; + PhysicsImpostor.ParticleImpostor = 8; + PhysicsImpostor.HeightmapImpostor = 9; + PhysicsImpostor.ConvexHullImpostor = 10; + PhysicsImpostor.CustomImpostor = 100; + PhysicsImpostor.RopeImpostor = 101; + PhysicsImpostor.ClothImpostor = 102; + PhysicsImpostor.SoftbodyImpostor = 103; +}); // node_modules/@babylonjs/core/Loading/sceneLoader.js -var SceneLoaderAnimationGroupLoadingMode; -(function(SceneLoaderAnimationGroupLoadingMode2) { - SceneLoaderAnimationGroupLoadingMode2[SceneLoaderAnimationGroupLoadingMode2["Clean"] = 0] = "Clean"; - SceneLoaderAnimationGroupLoadingMode2[SceneLoaderAnimationGroupLoadingMode2["Stop"] = 1] = "Stop"; - SceneLoaderAnimationGroupLoadingMode2[SceneLoaderAnimationGroupLoadingMode2["Sync"] = 2] = "Sync"; - SceneLoaderAnimationGroupLoadingMode2[SceneLoaderAnimationGroupLoadingMode2["NoSync"] = 3] = "NoSync"; -})(SceneLoaderAnimationGroupLoadingMode || (SceneLoaderAnimationGroupLoadingMode = {})); - class SceneLoader { static get ForceFullSceneLoadingForIncremental() { return SceneLoaderFlags.ForceFullSceneLoadingForIncremental; @@ -50181,7 +51771,7 @@ class SceneLoader { } return errorMessage; } - static _LoadData(fileInfo, scene11, onSuccess, onProgress, onError, onDispose, pluginExtension, name) { + static _LoadData(fileInfo, scene11, onSuccess, onProgress, onError, onDispose, pluginExtension, name2) { const directLoad = SceneLoader._GetDirectLoad(fileInfo.url); if (fileInfo.rawData && !pluginExtension) { throw "When using ArrayBufferView to load data the file extension must be provided."; @@ -50248,7 +51838,7 @@ class SceneLoader { if (!plugin.loadFile && fileInfo.rawData) { throw "Plugin does not support loading ArrayBufferView."; } - request = plugin.loadFile ? plugin.loadFile(scene11, fileInfo.rawData || fileInfo.file || fileInfo.url, fileInfo.rootUrl, dataCallback, onProgress, useArrayBuffer, errorCallback, name) : scene11._loadFile(fileInfo.file || fileInfo.url, dataCallback, onProgress, true, useArrayBuffer, errorCallback); + request = plugin.loadFile ? plugin.loadFile(scene11, fileInfo.rawData || fileInfo.file || fileInfo.url, fileInfo.rootUrl, dataCallback, onProgress, useArrayBuffer, errorCallback, name2) : scene11._loadFile(fileInfo.file || fileInfo.url, dataCallback, onProgress, true, useArrayBuffer, errorCallback); }; const engine8 = scene11.getEngine(); let canUseOfflineSupport = engine8.enableOfflineSupport; @@ -50271,25 +51861,25 @@ class SceneLoader { } static _GetFileInfo(rootUrl, sceneFilename) { let url; - let name; + let name2; let file = null; let rawData = null; if (!sceneFilename) { url = rootUrl; - name = Tools.GetFilename(rootUrl); + name2 = Tools.GetFilename(rootUrl); rootUrl = Tools.GetFolderPath(rootUrl); } else if (sceneFilename.name) { const sceneFile = sceneFilename; url = `file:${sceneFile.name}`; - name = sceneFile.name; + name2 = sceneFile.name; file = sceneFile; } else if (ArrayBuffer.isView(sceneFilename)) { url = ""; - name = "arrayBuffer"; + name2 = "arrayBuffer"; rawData = sceneFilename; } else if (typeof sceneFilename === "string" && sceneFilename.startsWith("data:")) { url = sceneFilename; - name = ""; + name2 = ""; } else { const filename = sceneFilename; if (filename.substr(0, 1) === "/") { @@ -50297,12 +51887,12 @@ class SceneLoader { return null; } url = rootUrl + filename; - name = filename; + name2 = filename; } return { url, rootUrl, - name, + name: name2, file, rawData }; @@ -50330,7 +51920,7 @@ class SceneLoader { }); } } - static ImportMesh(meshNames, rootUrl, sceneFilename = "", scene11 = EngineStore.LastCreatedScene, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name = "") { + static ImportMesh(meshNames, rootUrl, sceneFilename = "", scene11 = EngineStore.LastCreatedScene, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name2 = "") { if (!scene11) { Logger.Error("No scene available to import mesh to"); return null; @@ -50394,9 +51984,9 @@ class SceneLoader { errorHandler(error4.message, error4); }); } - }, progressHandler, errorHandler, disposeHandler, pluginExtension, name); + }, progressHandler, errorHandler, disposeHandler, pluginExtension, name2); } - static ImportMeshAsync(meshNames, rootUrl, sceneFilename = "", scene11 = EngineStore.LastCreatedScene, onProgress = null, pluginExtension = null, name = "") { + static ImportMeshAsync(meshNames, rootUrl, sceneFilename = "", scene11 = EngineStore.LastCreatedScene, onProgress = null, pluginExtension = null, name2 = "") { return new Promise((resolve, reject) => { SceneLoader.ImportMesh(meshNames, rootUrl, sceneFilename, scene11, (meshes, particleSystems, skeletons, animationGroups, transformNodes, geometries, lights) => { resolve({ @@ -50410,26 +52000,26 @@ class SceneLoader { }); }, onProgress, (scene12, message, exception) => { reject(exception || new Error(message)); - }, pluginExtension, name); + }, pluginExtension, name2); }); } - static Load(rootUrl, sceneFilename = "", engine8 = EngineStore.LastCreatedEngine, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name = "") { + static Load(rootUrl, sceneFilename = "", engine8 = EngineStore.LastCreatedEngine, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name2 = "") { if (!engine8) { Tools.Error("No engine available"); return null; } - return SceneLoader.Append(rootUrl, sceneFilename, new Scene(engine8), onSuccess, onProgress, onError, pluginExtension, name); + return SceneLoader.Append(rootUrl, sceneFilename, new Scene(engine8), onSuccess, onProgress, onError, pluginExtension, name2); } - static LoadAsync(rootUrl, sceneFilename = "", engine8 = EngineStore.LastCreatedEngine, onProgress = null, pluginExtension = null, name = "") { + static LoadAsync(rootUrl, sceneFilename = "", engine8 = EngineStore.LastCreatedEngine, onProgress = null, pluginExtension = null, name2 = "") { return new Promise((resolve, reject) => { SceneLoader.Load(rootUrl, sceneFilename, engine8, (scene11) => { resolve(scene11); }, onProgress, (scene11, message, exception) => { reject(exception || new Error(message)); - }, pluginExtension, name); + }, pluginExtension, name2); }); } - static Append(rootUrl, sceneFilename = "", scene11 = EngineStore.LastCreatedScene, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name = "") { + static Append(rootUrl, sceneFilename = "", scene11 = EngineStore.LastCreatedScene, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name2 = "") { if (!scene11) { Logger.Error("No scene available to append to"); return null; @@ -50494,18 +52084,18 @@ class SceneLoader { errorHandler(error4.message, error4); }); } - }, progressHandler, errorHandler, disposeHandler, pluginExtension, name); + }, progressHandler, errorHandler, disposeHandler, pluginExtension, name2); } - static AppendAsync(rootUrl, sceneFilename = "", scene11 = EngineStore.LastCreatedScene, onProgress = null, pluginExtension = null, name = "") { + static AppendAsync(rootUrl, sceneFilename = "", scene11 = EngineStore.LastCreatedScene, onProgress = null, pluginExtension = null, name2 = "") { return new Promise((resolve, reject) => { SceneLoader.Append(rootUrl, sceneFilename, scene11, (scene12) => { resolve(scene12); }, onProgress, (scene12, message, exception) => { reject(exception || new Error(message)); - }, pluginExtension, name); + }, pluginExtension, name2); }); } - static LoadAssetContainer(rootUrl, sceneFilename = "", scene11 = EngineStore.LastCreatedScene, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name = "") { + static LoadAssetContainer(rootUrl, sceneFilename = "", scene11 = EngineStore.LastCreatedScene, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name2 = "") { if (!scene11) { Logger.Error("No scene available to load asset container to"); return null; @@ -50567,7 +52157,7 @@ class SceneLoader { } else { errorHandler("LoadAssetContainer is not supported by this plugin. Plugin did not provide a loadAssetContainer or loadAssetContainerAsync method."); } - }, progressHandler, errorHandler, disposeHandler, pluginExtension, name); + }, progressHandler, errorHandler, disposeHandler, pluginExtension, name2); } static LoadAssetContainerAsync(rootUrl, sceneFilename = "", scene11 = EngineStore.LastCreatedScene, onProgress = null, pluginExtension = null) { return new Promise((resolve, reject) => { @@ -50643,18 +52233,36 @@ class SceneLoader { }); } } -SceneLoader.NO_LOGGING = 0; -SceneLoader.MINIMAL_LOGGING = 1; -SceneLoader.SUMMARY_LOGGING = 2; -SceneLoader.DETAILED_LOGGING = 3; -SceneLoader.OnPluginActivatedObservable = new Observable; -SceneLoader._RegisteredPlugins = {}; -SceneLoader._ShowingLoadingScreen = false; +var SceneLoaderAnimationGroupLoadingMode; +var init_sceneLoader = __esm(() => { + init_tools(); + init_observable(); + init_scene(); + init_engine(); + init_engineStore(); + init_logger(); + init_sceneLoaderFlags(); + init_fileTools(); + init_error(); + (function(SceneLoaderAnimationGroupLoadingMode2) { + SceneLoaderAnimationGroupLoadingMode2[SceneLoaderAnimationGroupLoadingMode2["Clean"] = 0] = "Clean"; + SceneLoaderAnimationGroupLoadingMode2[SceneLoaderAnimationGroupLoadingMode2["Stop"] = 1] = "Stop"; + SceneLoaderAnimationGroupLoadingMode2[SceneLoaderAnimationGroupLoadingMode2["Sync"] = 2] = "Sync"; + SceneLoaderAnimationGroupLoadingMode2[SceneLoaderAnimationGroupLoadingMode2["NoSync"] = 3] = "NoSync"; + })(SceneLoaderAnimationGroupLoadingMode || (SceneLoaderAnimationGroupLoadingMode = {})); + SceneLoader.NO_LOGGING = 0; + SceneLoader.MINIMAL_LOGGING = 1; + SceneLoader.SUMMARY_LOGGING = 2; + SceneLoader.DETAILED_LOGGING = 3; + SceneLoader.OnPluginActivatedObservable = new Observable; + SceneLoader._RegisteredPlugins = {}; + SceneLoader._ShowingLoadingScreen = false; +}); // node_modules/@babylonjs/core/Materials/pushMaterial.js class PushMaterial extends Material { - constructor(name, scene11, storeEffectOnSubMeshes = true) { - super(name, scene11); + constructor(name2, scene11, storeEffectOnSubMeshes = true) { + super(name2, scene11); this._normalMatrix = new Matrix; this._storeEffectOnSubMeshes = storeEffectOnSubMeshes; } @@ -50709,32 +52317,40 @@ class PushMaterial extends Material { super.dispose(forceDisposeEffect, forceDisposeTextures, notBoundToMesh); } } +var init_pushMaterial = __esm(() => { + init_math_vector(); + init_material(); +}); // node_modules/@babylonjs/core/Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.js var NodeMaterialBlockConnectionPointTypes; -(function(NodeMaterialBlockConnectionPointTypes2) { - NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Float"] = 1] = "Float"; - NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Int"] = 2] = "Int"; - NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Vector2"] = 4] = "Vector2"; - NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Vector3"] = 8] = "Vector3"; - NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Vector4"] = 16] = "Vector4"; - NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Color3"] = 32] = "Color3"; - NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Color4"] = 64] = "Color4"; - NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Matrix"] = 128] = "Matrix"; - NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Object"] = 256] = "Object"; - NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["AutoDetect"] = 1024] = "AutoDetect"; - NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["BasedOnInput"] = 2048] = "BasedOnInput"; - NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["All"] = 4095] = "All"; -})(NodeMaterialBlockConnectionPointTypes || (NodeMaterialBlockConnectionPointTypes = {})); +var init_nodeMaterialBlockConnectionPointTypes = __esm(() => { + (function(NodeMaterialBlockConnectionPointTypes2) { + NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Float"] = 1] = "Float"; + NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Int"] = 2] = "Int"; + NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Vector2"] = 4] = "Vector2"; + NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Vector3"] = 8] = "Vector3"; + NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Vector4"] = 16] = "Vector4"; + NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Color3"] = 32] = "Color3"; + NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Color4"] = 64] = "Color4"; + NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Matrix"] = 128] = "Matrix"; + NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["Object"] = 256] = "Object"; + NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["AutoDetect"] = 1024] = "AutoDetect"; + NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["BasedOnInput"] = 2048] = "BasedOnInput"; + NodeMaterialBlockConnectionPointTypes2[NodeMaterialBlockConnectionPointTypes2["All"] = 4095] = "All"; + })(NodeMaterialBlockConnectionPointTypes || (NodeMaterialBlockConnectionPointTypes = {})); +}); // node_modules/@babylonjs/core/Materials/Node/Enums/nodeMaterialBlockTargets.js var NodeMaterialBlockTargets; -(function(NodeMaterialBlockTargets2) { - NodeMaterialBlockTargets2[NodeMaterialBlockTargets2["Vertex"] = 1] = "Vertex"; - NodeMaterialBlockTargets2[NodeMaterialBlockTargets2["Fragment"] = 2] = "Fragment"; - NodeMaterialBlockTargets2[NodeMaterialBlockTargets2["Neutral"] = 4] = "Neutral"; - NodeMaterialBlockTargets2[NodeMaterialBlockTargets2["VertexAndFragment"] = 3] = "VertexAndFragment"; -})(NodeMaterialBlockTargets || (NodeMaterialBlockTargets = {})); +var init_nodeMaterialBlockTargets = __esm(() => { + (function(NodeMaterialBlockTargets2) { + NodeMaterialBlockTargets2[NodeMaterialBlockTargets2["Vertex"] = 1] = "Vertex"; + NodeMaterialBlockTargets2[NodeMaterialBlockTargets2["Fragment"] = 2] = "Fragment"; + NodeMaterialBlockTargets2[NodeMaterialBlockTargets2["Neutral"] = 4] = "Neutral"; + NodeMaterialBlockTargets2[NodeMaterialBlockTargets2["VertexAndFragment"] = 3] = "VertexAndFragment"; + })(NodeMaterialBlockTargets || (NodeMaterialBlockTargets = {})); +}); // node_modules/@babylonjs/core/Materials/Node/nodeMaterialBuildState.js class NodeMaterialBuildState { @@ -50824,19 +52440,19 @@ class NodeMaterialBuildState { } return prefix + this.sharedData.defineNames[prefix]; } - _excludeVariableName(name) { - this.sharedData.variableNames[name] = 0; + _excludeVariableName(name2) { + this.sharedData.variableNames[name2] = 0; } - _emit2DSampler(name) { - if (this.samplers.indexOf(name) < 0) { - this._samplerDeclaration += `uniform sampler2D ${name};\n`; - this.samplers.push(name); + _emit2DSampler(name2) { + if (this.samplers.indexOf(name2) < 0) { + this._samplerDeclaration += `uniform sampler2D ${name2};\n`; + this.samplers.push(name2); } } - _emit2DArraySampler(name) { - if (this.samplers.indexOf(name) < 0) { - this._samplerDeclaration += `uniform sampler2DArray ${name};\n`; - this.samplers.push(name); + _emit2DArraySampler(name2) { + if (this.samplers.indexOf(name2) < 0) { + this._samplerDeclaration += `uniform sampler2DArray ${name2};\n`; + this.samplers.push(name2); } } _getGLType(type) { @@ -50858,23 +52474,23 @@ class NodeMaterialBuildState { } return ""; } - _emitExtension(name, extension, define = "") { - if (this.extensions[name]) { + _emitExtension(name2, extension, define2 = "") { + if (this.extensions[name2]) { return; } - if (define) { - extension = `#if ${define}\n${extension}\n#endif`; + if (define2) { + extension = `#if ${define2}\n${extension}\n#endif`; } - this.extensions[name] = extension; + this.extensions[name2] = extension; } - _emitFunction(name, code, comments) { - if (this.functions[name]) { + _emitFunction(name2, code, comments) { + if (this.functions[name2]) { return; } if (this.sharedData.emitComments) { code = comments + `\n` + code; } - this.functions[name] = code; + this.functions[name2] = code; } _emitCodeFromInclude(includeName, comments, options) { if (options && options.repeatKey) { @@ -50937,45 +52553,45 @@ class NodeMaterialBuildState { } } } - _registerTempVariable(name) { - if (this.sharedData.temps.indexOf(name) !== -1) { + _registerTempVariable(name2) { + if (this.sharedData.temps.indexOf(name2) !== -1) { return false; } - this.sharedData.temps.push(name); + this.sharedData.temps.push(name2); return true; } - _emitVaryingFromString(name, type, define = "", notDefine = false) { - if (this.sharedData.varyings.indexOf(name) !== -1) { + _emitVaryingFromString(name2, type, define2 = "", notDefine = false) { + if (this.sharedData.varyings.indexOf(name2) !== -1) { return false; } - this.sharedData.varyings.push(name); - if (define) { - if (define.startsWith("defined(")) { - this.sharedData.varyingDeclaration += `#if ${define}\n`; + this.sharedData.varyings.push(name2); + if (define2) { + if (define2.startsWith("defined(")) { + this.sharedData.varyingDeclaration += `#if ${define2}\n`; } else { - this.sharedData.varyingDeclaration += `${notDefine ? "#ifndef" : "#ifdef"} ${define}\n`; + this.sharedData.varyingDeclaration += `${notDefine ? "#ifndef" : "#ifdef"} ${define2}\n`; } } - this.sharedData.varyingDeclaration += `varying ${type} ${name};\n`; - if (define) { + this.sharedData.varyingDeclaration += `varying ${type} ${name2};\n`; + if (define2) { this.sharedData.varyingDeclaration += `#endif\n`; } return true; } - _emitUniformFromString(name, type, define = "", notDefine = false) { - if (this.uniforms.indexOf(name) !== -1) { + _emitUniformFromString(name2, type, define2 = "", notDefine = false) { + if (this.uniforms.indexOf(name2) !== -1) { return; } - this.uniforms.push(name); - if (define) { - if (define.startsWith("defined(")) { - this._uniformDeclaration += `#if ${define}\n`; + this.uniforms.push(name2); + if (define2) { + if (define2.startsWith("defined(")) { + this._uniformDeclaration += `#if ${define2}\n`; } else { - this._uniformDeclaration += `${notDefine ? "#ifndef" : "#ifdef"} ${define}\n`; + this._uniformDeclaration += `${notDefine ? "#ifndef" : "#ifdef"} ${define2}\n`; } } - this._uniformDeclaration += `uniform ${type} ${name};\n`; - if (define) { + this._uniformDeclaration += `uniform ${type} ${name2};\n`; + if (define2) { this._uniformDeclaration += `#endif\n`; } } @@ -50986,6 +52602,11 @@ class NodeMaterialBuildState { return value.toString(); } } +var init_nodeMaterialBuildState = __esm(() => { + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_effect(); +}); // node_modules/@babylonjs/core/Materials/Node/nodeMaterialBuildStateSharedData.js class NodeMaterialBuildStateSharedData { @@ -51062,21 +52683,10 @@ class NodeMaterialBuildStateSharedData { } } } +var init_nodeMaterialBuildStateSharedData = __esm(() => { +}); // node_modules/@babylonjs/core/Materials/Node/nodeMaterialBlockConnectionPoint.js -var NodeMaterialConnectionPointCompatibilityStates; -(function(NodeMaterialConnectionPointCompatibilityStates2) { - NodeMaterialConnectionPointCompatibilityStates2[NodeMaterialConnectionPointCompatibilityStates2["Compatible"] = 0] = "Compatible"; - NodeMaterialConnectionPointCompatibilityStates2[NodeMaterialConnectionPointCompatibilityStates2["TypeIncompatible"] = 1] = "TypeIncompatible"; - NodeMaterialConnectionPointCompatibilityStates2[NodeMaterialConnectionPointCompatibilityStates2["TargetIncompatible"] = 2] = "TargetIncompatible"; - NodeMaterialConnectionPointCompatibilityStates2[NodeMaterialConnectionPointCompatibilityStates2["HierarchyIssue"] = 3] = "HierarchyIssue"; -})(NodeMaterialConnectionPointCompatibilityStates || (NodeMaterialConnectionPointCompatibilityStates = {})); -var NodeMaterialConnectionPointDirection; -(function(NodeMaterialConnectionPointDirection2) { - NodeMaterialConnectionPointDirection2[NodeMaterialConnectionPointDirection2["Input"] = 0] = "Input"; - NodeMaterialConnectionPointDirection2[NodeMaterialConnectionPointDirection2["Output"] = 1] = "Output"; -})(NodeMaterialConnectionPointDirection || (NodeMaterialConnectionPointDirection = {})); - class NodeMaterialConnectionPoint { static AreEquivalentTypes(type1, type2) { switch (type1) { @@ -51266,7 +52876,7 @@ class NodeMaterialConnectionPoint { createCustomInputBlock() { return null; } - constructor(name, ownerBlock, direction) { + constructor(name2, ownerBlock, direction) { this._connectedPoint = null; this._endpoints = new Array; this._typeConnectionSource = null; @@ -51284,7 +52894,7 @@ class NodeMaterialConnectionPoint { this._prioritizeVertex = false; this._target = NodeMaterialBlockTargets.VertexAndFragment; this._ownerBlock = ownerBlock; - this.name = name; + this.name = name2; this._direction = direction; } getClassName() { @@ -51382,6 +52992,22 @@ class NodeMaterialConnectionPoint { this.onConnectionObservable.clear(); } } +var NodeMaterialConnectionPointCompatibilityStates, NodeMaterialConnectionPointDirection; +var init_nodeMaterialBlockConnectionPoint = __esm(() => { + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_observable(); + (function(NodeMaterialConnectionPointCompatibilityStates2) { + NodeMaterialConnectionPointCompatibilityStates2[NodeMaterialConnectionPointCompatibilityStates2["Compatible"] = 0] = "Compatible"; + NodeMaterialConnectionPointCompatibilityStates2[NodeMaterialConnectionPointCompatibilityStates2["TypeIncompatible"] = 1] = "TypeIncompatible"; + NodeMaterialConnectionPointCompatibilityStates2[NodeMaterialConnectionPointCompatibilityStates2["TargetIncompatible"] = 2] = "TargetIncompatible"; + NodeMaterialConnectionPointCompatibilityStates2[NodeMaterialConnectionPointCompatibilityStates2["HierarchyIssue"] = 3] = "HierarchyIssue"; + })(NodeMaterialConnectionPointCompatibilityStates || (NodeMaterialConnectionPointCompatibilityStates = {})); + (function(NodeMaterialConnectionPointDirection2) { + NodeMaterialConnectionPointDirection2[NodeMaterialConnectionPointDirection2["Input"] = 0] = "Input"; + NodeMaterialConnectionPointDirection2[NodeMaterialConnectionPointDirection2["Output"] = 1] = "Output"; + })(NodeMaterialConnectionPointDirection || (NodeMaterialConnectionPointDirection = {})); +}); // node_modules/@babylonjs/core/Materials/Node/nodeMaterialBlock.js class NodeMaterialBlock { @@ -51430,21 +53056,21 @@ class NodeMaterialBlock { get outputs() { return this._outputs; } - getInputByName(name) { - const filter = this._inputs.filter((e) => e.name === name); + getInputByName(name2) { + const filter = this._inputs.filter((e) => e.name === name2); if (filter.length) { return filter[0]; } return null; } - getOutputByName(name) { - const filter = this._outputs.filter((e) => e.name === name); + getOutputByName(name2) { + const filter = this._outputs.filter((e) => e.name === name2); if (filter.length) { return filter[0]; } return null; } - constructor(name, target = NodeMaterialBlockTargets.Vertex, isFinalMerger = false) { + constructor(name2, target = NodeMaterialBlockTargets.Vertex, isFinalMerger = false) { this._isFinalMerger = false; this._isInput = false; this._isTeleportOut = false; @@ -51464,7 +53090,7 @@ class NodeMaterialBlock { this._isInput = this.getClassName() === "InputBlock"; this._isTeleportOut = this.getClassName() === "NodeMaterialTeleportOutBlock"; this._isTeleportIn = this.getClassName() === "NodeMaterialTeleportInBlock"; - this._name = name; + this._name = name2; this.uniqueId = UniqueIdGenerator.UniqueId; } _setInitialTarget(target) { @@ -51498,8 +53124,8 @@ class NodeMaterialBlock { isConnectedInFragmentShader() { return this.outputs.some((o) => o.isConnectedInFragmentShader); } - registerInput(name, type, isOptional = false, target, point) { - point = point !== null && point !== undefined ? point : new NodeMaterialConnectionPoint(name, this, NodeMaterialConnectionPointDirection.Input); + registerInput(name2, type, isOptional = false, target, point) { + point = point !== null && point !== undefined ? point : new NodeMaterialConnectionPoint(name2, this, NodeMaterialConnectionPointDirection.Input); point.type = type; point.isOptional = isOptional; if (target) { @@ -51508,8 +53134,8 @@ class NodeMaterialBlock { this._inputs.push(point); return this; } - registerOutput(name, type, target, point) { - point = point !== null && point !== undefined ? point : new NodeMaterialConnectionPoint(name, this, NodeMaterialConnectionPointDirection.Output); + registerOutput(name2, type, target, point) { + point = point !== null && point !== undefined ? point : new NodeMaterialConnectionPoint(name2, this, NodeMaterialConnectionPointDirection.Output); point.type = type; if (target) { point.target = target; @@ -51733,11 +53359,11 @@ class NodeMaterialBlock { } return false; } - _inputRename(name) { - return name; + _inputRename(name2) { + return name2; } - _outputRename(name) { - return name; + _outputRename(name2) { + return name2; } _dumpPropertiesCode() { const variableName = this._codeVariableName; @@ -51874,11 +53500,18 @@ class NodeMaterialBlock { } } } +var init_nodeMaterialBlock = __esm(() => { + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockConnectionPoint(); + init_nodeMaterialBlockTargets(); + init_uniqueIdGenerator(); + init_typeStore(); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/transformBlock.js class TransformBlock extends NodeMaterialBlock { - constructor(name) { - super(name, NodeMaterialBlockTargets.Neutral); + constructor(name2) { + super(name2, NodeMaterialBlockTargets.Neutral); this.complementW = 1; this.complementZ = 0; this.target = NodeMaterialBlockTargets.Vertex; @@ -51979,12 +53612,18 @@ class TransformBlock extends NodeMaterialBlock { return codeString; } } -RegisterClass("BABYLON.TransformBlock", TransformBlock); +var init_transformBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.TransformBlock", TransformBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/vertexOutputBlock.js class VertexOutputBlock extends NodeMaterialBlock { - constructor(name) { - super(name, NodeMaterialBlockTargets.Vertex, true); + constructor(name2) { + super(name2, NodeMaterialBlockTargets.Vertex, true); this.registerInput("vector", NodeMaterialBlockConnectionPointTypes.Vector4); } getClassName() { @@ -52017,7 +53656,13 @@ class VertexOutputBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.VertexOutputBlock", VertexOutputBlock); +var init_vertexOutputBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.VertexOutputBlock", VertexOutputBlock); +}); // node_modules/@babylonjs/core/Decorators/nodeDecorator.js function editableInPropertyPage(displayName, propertyType = PropertyTypeForEdition.Boolean, groupName = "PROPERTIES", options) { @@ -52037,18 +53682,20 @@ function editableInPropertyPage(displayName, propertyType = PropertyTypeForEditi }; } var PropertyTypeForEdition; -(function(PropertyTypeForEdition2) { - PropertyTypeForEdition2[PropertyTypeForEdition2["Boolean"] = 0] = "Boolean"; - PropertyTypeForEdition2[PropertyTypeForEdition2["Float"] = 1] = "Float"; - PropertyTypeForEdition2[PropertyTypeForEdition2["Int"] = 2] = "Int"; - PropertyTypeForEdition2[PropertyTypeForEdition2["Vector2"] = 3] = "Vector2"; - PropertyTypeForEdition2[PropertyTypeForEdition2["List"] = 4] = "List"; -})(PropertyTypeForEdition || (PropertyTypeForEdition = {})); +var init_nodeDecorator = __esm(() => { + (function(PropertyTypeForEdition2) { + PropertyTypeForEdition2[PropertyTypeForEdition2["Boolean"] = 0] = "Boolean"; + PropertyTypeForEdition2[PropertyTypeForEdition2["Float"] = 1] = "Float"; + PropertyTypeForEdition2[PropertyTypeForEdition2["Int"] = 2] = "Int"; + PropertyTypeForEdition2[PropertyTypeForEdition2["Vector2"] = 3] = "Vector2"; + PropertyTypeForEdition2[PropertyTypeForEdition2["List"] = 4] = "List"; + })(PropertyTypeForEdition || (PropertyTypeForEdition = {})); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js class FragmentOutputBlock extends NodeMaterialBlock { - constructor(name) { - super(name, NodeMaterialBlockTargets.Fragment, true); + constructor(name2) { + super(name2, NodeMaterialBlockTargets.Fragment, true); this.convertToGammaSpace = false; this.convertToLinearSpace = false; this.useLogarithmicDepth = false; @@ -52153,67 +53800,105 @@ class FragmentOutputBlock extends NodeMaterialBlock { this.useLogarithmicDepth = (_a = serializationObject.useLogarithmicDepth) !== null && _a !== undefined ? _a : false; } } -__decorate2([ - editableInPropertyPage("Convert to gamma space", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: true } }) -], FragmentOutputBlock.prototype, "convertToGammaSpace", undefined); -__decorate2([ - editableInPropertyPage("Convert to linear space", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: true } }) -], FragmentOutputBlock.prototype, "convertToLinearSpace", undefined); -__decorate2([ - editableInPropertyPage("Use logarithmic depth", PropertyTypeForEdition.Boolean, "PROPERTIES") -], FragmentOutputBlock.prototype, "useLogarithmicDepth", undefined); -RegisterClass("BABYLON.FragmentOutputBlock", FragmentOutputBlock); +var init_fragmentOutputBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_nodeDecorator(); + init_materialHelper(); + __decorate2([ + editableInPropertyPage("Convert to gamma space", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: true } }) + ], FragmentOutputBlock.prototype, "convertToGammaSpace", undefined); + __decorate2([ + editableInPropertyPage("Convert to linear space", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: true } }) + ], FragmentOutputBlock.prototype, "convertToLinearSpace", undefined); + __decorate2([ + editableInPropertyPage("Use logarithmic depth", PropertyTypeForEdition.Boolean, "PROPERTIES") + ], FragmentOutputBlock.prototype, "useLogarithmicDepth", undefined); + RegisterClass("BABYLON.FragmentOutputBlock", FragmentOutputBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Enums/nodeMaterialBlockConnectionPointMode.js var NodeMaterialBlockConnectionPointMode; -(function(NodeMaterialBlockConnectionPointMode2) { - NodeMaterialBlockConnectionPointMode2[NodeMaterialBlockConnectionPointMode2["Uniform"] = 0] = "Uniform"; - NodeMaterialBlockConnectionPointMode2[NodeMaterialBlockConnectionPointMode2["Attribute"] = 1] = "Attribute"; - NodeMaterialBlockConnectionPointMode2[NodeMaterialBlockConnectionPointMode2["Varying"] = 2] = "Varying"; - NodeMaterialBlockConnectionPointMode2[NodeMaterialBlockConnectionPointMode2["Undefined"] = 3] = "Undefined"; -})(NodeMaterialBlockConnectionPointMode || (NodeMaterialBlockConnectionPointMode = {})); +var init_nodeMaterialBlockConnectionPointMode = __esm(() => { + (function(NodeMaterialBlockConnectionPointMode2) { + NodeMaterialBlockConnectionPointMode2[NodeMaterialBlockConnectionPointMode2["Uniform"] = 0] = "Uniform"; + NodeMaterialBlockConnectionPointMode2[NodeMaterialBlockConnectionPointMode2["Attribute"] = 1] = "Attribute"; + NodeMaterialBlockConnectionPointMode2[NodeMaterialBlockConnectionPointMode2["Varying"] = 2] = "Varying"; + NodeMaterialBlockConnectionPointMode2[NodeMaterialBlockConnectionPointMode2["Undefined"] = 3] = "Undefined"; + })(NodeMaterialBlockConnectionPointMode || (NodeMaterialBlockConnectionPointMode = {})); +}); // node_modules/@babylonjs/core/Materials/Node/Enums/nodeMaterialSystemValues.js var NodeMaterialSystemValues; -(function(NodeMaterialSystemValues2) { - NodeMaterialSystemValues2[NodeMaterialSystemValues2["World"] = 1] = "World"; - NodeMaterialSystemValues2[NodeMaterialSystemValues2["View"] = 2] = "View"; - NodeMaterialSystemValues2[NodeMaterialSystemValues2["Projection"] = 3] = "Projection"; - NodeMaterialSystemValues2[NodeMaterialSystemValues2["ViewProjection"] = 4] = "ViewProjection"; - NodeMaterialSystemValues2[NodeMaterialSystemValues2["WorldView"] = 5] = "WorldView"; - NodeMaterialSystemValues2[NodeMaterialSystemValues2["WorldViewProjection"] = 6] = "WorldViewProjection"; - NodeMaterialSystemValues2[NodeMaterialSystemValues2["CameraPosition"] = 7] = "CameraPosition"; - NodeMaterialSystemValues2[NodeMaterialSystemValues2["FogColor"] = 8] = "FogColor"; - NodeMaterialSystemValues2[NodeMaterialSystemValues2["DeltaTime"] = 9] = "DeltaTime"; - NodeMaterialSystemValues2[NodeMaterialSystemValues2["CameraParameters"] = 10] = "CameraParameters"; - NodeMaterialSystemValues2[NodeMaterialSystemValues2["MaterialAlpha"] = 11] = "MaterialAlpha"; -})(NodeMaterialSystemValues || (NodeMaterialSystemValues = {})); +var init_nodeMaterialSystemValues = __esm(() => { + (function(NodeMaterialSystemValues2) { + NodeMaterialSystemValues2[NodeMaterialSystemValues2["World"] = 1] = "World"; + NodeMaterialSystemValues2[NodeMaterialSystemValues2["View"] = 2] = "View"; + NodeMaterialSystemValues2[NodeMaterialSystemValues2["Projection"] = 3] = "Projection"; + NodeMaterialSystemValues2[NodeMaterialSystemValues2["ViewProjection"] = 4] = "ViewProjection"; + NodeMaterialSystemValues2[NodeMaterialSystemValues2["WorldView"] = 5] = "WorldView"; + NodeMaterialSystemValues2[NodeMaterialSystemValues2["WorldViewProjection"] = 6] = "WorldViewProjection"; + NodeMaterialSystemValues2[NodeMaterialSystemValues2["CameraPosition"] = 7] = "CameraPosition"; + NodeMaterialSystemValues2[NodeMaterialSystemValues2["FogColor"] = 8] = "FogColor"; + NodeMaterialSystemValues2[NodeMaterialSystemValues2["DeltaTime"] = 9] = "DeltaTime"; + NodeMaterialSystemValues2[NodeMaterialSystemValues2["CameraParameters"] = 10] = "CameraParameters"; + NodeMaterialSystemValues2[NodeMaterialSystemValues2["MaterialAlpha"] = 11] = "MaterialAlpha"; + })(NodeMaterialSystemValues || (NodeMaterialSystemValues = {})); +}); + +// node_modules/@babylonjs/core/Maths/math.vertexFormat.js +class PositionNormalVertex { + constructor(position = Vector3.Zero(), normal = Vector3.Up()) { + this.position = position; + this.normal = normal; + } + clone() { + return new PositionNormalVertex(this.position.clone(), this.normal.clone()); + } +} + +class PositionNormalTextureVertex { + constructor(position = Vector3.Zero(), normal = Vector3.Up(), uv = Vector2.Zero()) { + this.position = position; + this.normal = normal; + this.uv = uv; + } + clone() { + return new PositionNormalTextureVertex(this.position.clone(), this.normal.clone(), this.uv.clone()); + } +} +var init_math_vertexFormat = __esm(() => { + init_math_vector(); +}); + +// node_modules/@babylonjs/core/Maths/math.js +var init_math = __esm(() => { + init_math_axis(); + init_math_color(); + init_math_constants(); + init_math_frustum(); + init_math_path(); + init_math_plane(); + init_math_size(); + init_math_vector(); + init_math_vertexFormat(); + init_math_viewport(); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Input/animatedInputBlockTypes.js var AnimatedInputBlockTypes; -(function(AnimatedInputBlockTypes2) { - AnimatedInputBlockTypes2[AnimatedInputBlockTypes2["None"] = 0] = "None"; - AnimatedInputBlockTypes2[AnimatedInputBlockTypes2["Time"] = 1] = "Time"; - AnimatedInputBlockTypes2[AnimatedInputBlockTypes2["RealTime"] = 2] = "RealTime"; -})(AnimatedInputBlockTypes || (AnimatedInputBlockTypes = {})); +var init_animatedInputBlockTypes = __esm(() => { + (function(AnimatedInputBlockTypes2) { + AnimatedInputBlockTypes2[AnimatedInputBlockTypes2["None"] = 0] = "None"; + AnimatedInputBlockTypes2[AnimatedInputBlockTypes2["Time"] = 1] = "Time"; + AnimatedInputBlockTypes2[AnimatedInputBlockTypes2["RealTime"] = 2] = "RealTime"; + })(AnimatedInputBlockTypes || (AnimatedInputBlockTypes = {})); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/Input/inputBlock.js -var remapAttributeName = { - position2d: "position", - particle_uv: "vUV", - particle_color: "vColor", - particle_texturemask: "textureMask", - particle_positionw: "vPositionW" -}; -var attributeInFragmentOnly = { - particle_uv: true, - particle_color: true, - particle_texturemask: true, - particle_positionw: true -}; -var attributeAsUniform = { - particle_texturemask: true -}; - class InputBlock extends NodeMaterialBlock { get type() { if (this._type === NodeMaterialBlockConnectionPointTypes.AutoDetect) { @@ -52307,8 +53992,8 @@ class InputBlock extends NodeMaterialBlock { } return this._type; } - constructor(name, target = NodeMaterialBlockTargets.Vertex, type = NodeMaterialBlockConnectionPointTypes.AutoDetect) { - super(name, target, false); + constructor(name2, target = NodeMaterialBlockTargets.Vertex, type = NodeMaterialBlockConnectionPointTypes.AutoDetect) { + super(name2, target, false); this._mode = NodeMaterialBlockConnectionPointMode.Undefined; this._animationType = AnimatedInputBlockTypes.None; this.min = 0; @@ -52434,11 +54119,11 @@ class InputBlock extends NodeMaterialBlock { } } } - _emitDefine(define) { - if (define[0] === "!") { - return `#ifndef ${define.substring(1)}\n`; + _emitDefine(define2) { + if (define2[0] === "!") { + return `#ifndef ${define2.substring(1)}\n`; } - return `#ifdef ${define}\n`; + return `#ifdef ${define2}\n`; } initialize() { this.associatedVariableName = ""; @@ -52502,7 +54187,7 @@ class InputBlock extends NodeMaterialBlock { get _noContextSwitch() { return attributeInFragmentOnly[this.name]; } - _emit(state, define) { + _emit(state, define2) { var _a; if (this.isUniform) { if (!this.associatedVariableName) { @@ -52520,11 +54205,11 @@ class InputBlock extends NodeMaterialBlock { return; } state.uniforms.push(this.associatedVariableName); - if (define) { - state._uniformDeclaration += this._emitDefine(define); + if (define2) { + state._uniformDeclaration += this._emitDefine(define2); } state._uniformDeclaration += `uniform ${state._getGLType(this.type)} ${this.associatedVariableName};\n`; - if (define) { + if (define2) { state._uniformDeclaration += `#endif\n`; } const hints = state.sharedData.hints; @@ -52549,12 +54234,12 @@ class InputBlock extends NodeMaterialBlock { if (this.target === NodeMaterialBlockTargets.Vertex && state._vertexState) { if (attributeInFragmentOnly[this.name]) { if (attributeAsUniform[this.name]) { - state._emitUniformFromString(this.associatedVariableName, state._getGLType(this.type), define); + state._emitUniformFromString(this.associatedVariableName, state._getGLType(this.type), define2); } else { - state._emitVaryingFromString(this.associatedVariableName, state._getGLType(this.type), define); + state._emitVaryingFromString(this.associatedVariableName, state._getGLType(this.type), define2); } } else { - this._emit(state._vertexState, define); + this._emit(state._vertexState, define2); } return; } @@ -52564,16 +54249,16 @@ class InputBlock extends NodeMaterialBlock { state.attributes.push(this.associatedVariableName); if (attributeInFragmentOnly[this.name]) { if (attributeAsUniform[this.name]) { - state._emitUniformFromString(this.associatedVariableName, state._getGLType(this.type), define); + state._emitUniformFromString(this.associatedVariableName, state._getGLType(this.type), define2); } else { - state._emitVaryingFromString(this.associatedVariableName, state._getGLType(this.type), define); + state._emitVaryingFromString(this.associatedVariableName, state._getGLType(this.type), define2); } } else { - if (define) { - state._attributeDeclaration += this._emitDefine(define); + if (define2) { + state._attributeDeclaration += this._emitDefine(define2); } state._attributeDeclaration += `attribute ${state._getGLType(this.type)} ${this.associatedVariableName};\n`; - if (define) { + if (define2) { state._attributeDeclaration += `#endif\n`; } } @@ -52803,12 +54488,42 @@ class InputBlock extends NodeMaterialBlock { } } } -RegisterClass("BABYLON.InputBlock", InputBlock); +var remapAttributeName, attributeInFragmentOnly, attributeAsUniform; +var init_inputBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockConnectionPointMode(); + init_nodeMaterialSystemValues(); + init_math_vector(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_math(); + init_animatedInputBlockTypes(); + init_observable(); + init_precisionDate(); + remapAttributeName = { + position2d: "position", + particle_uv: "vUV", + particle_color: "vColor", + particle_texturemask: "textureMask", + particle_positionw: "vPositionW" + }; + attributeInFragmentOnly = { + particle_uv: true, + particle_color: true, + particle_texturemask: true, + particle_positionw: true + }; + attributeAsUniform = { + particle_texturemask: true + }; + RegisterClass("BABYLON.InputBlock", InputBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/currentScreenBlock.js class CurrentScreenBlock extends NodeMaterialBlock { - constructor(name) { - super(name, NodeMaterialBlockTargets.VertexAndFragment); + constructor(name2) { + super(name2, NodeMaterialBlockTargets.VertexAndFragment); this._samplerName = "textureSampler"; this.convertToGammaSpace = false; this.convertToLinearSpace = false; @@ -52977,12 +54692,19 @@ class CurrentScreenBlock extends NodeMaterialBlock { } } } -RegisterClass("BABYLON.CurrentScreenBlock", CurrentScreenBlock); +var init_currentScreenBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_texture(); + RegisterClass("BABYLON.CurrentScreenBlock", CurrentScreenBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/Particle/particleTextureBlock.js class ParticleTextureBlock extends NodeMaterialBlock { - constructor(name) { - super(name, NodeMaterialBlockTargets.Fragment); + constructor(name2) { + super(name2, NodeMaterialBlockTargets.Fragment); this._samplerName = "diffuseSampler"; this.convertToGammaSpace = false; this.convertToLinearSpace = false; @@ -53093,12 +54815,20 @@ class ParticleTextureBlock extends NodeMaterialBlock { } } } -RegisterClass("BABYLON.ParticleTextureBlock", ParticleTextureBlock); +var init_particleTextureBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_inputBlock(); + init_typeStore(); + init_texture(); + RegisterClass("BABYLON.ParticleTextureBlock", ParticleTextureBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/Particle/particleRampGradientBlock.js class ParticleRampGradientBlock extends NodeMaterialBlock { - constructor(name) { - super(name, NodeMaterialBlockTargets.Fragment); + constructor(name2) { + super(name2, NodeMaterialBlockTargets.Fragment); this._isUnique = true; this.registerInput("color", NodeMaterialBlockConnectionPointTypes.Color4, false, NodeMaterialBlockTargets.Fragment); this.registerOutput("rampColor", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Fragment); @@ -53150,12 +54880,18 @@ class ParticleRampGradientBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.ParticleRampGradientBlock", ParticleRampGradientBlock); +var init_particleRampGradientBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.ParticleRampGradientBlock", ParticleRampGradientBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.js class ParticleBlendMultiplyBlock extends NodeMaterialBlock { - constructor(name) { - super(name, NodeMaterialBlockTargets.Fragment); + constructor(name2) { + super(name2, NodeMaterialBlockTargets.Fragment); this._isUnique = true; this.registerInput("color", NodeMaterialBlockConnectionPointTypes.Color4, false, NodeMaterialBlockTargets.Fragment); this.registerInput("alphaTexture", NodeMaterialBlockConnectionPointTypes.Float, false, NodeMaterialBlockTargets.Fragment); @@ -53198,7 +54934,13 @@ class ParticleBlendMultiplyBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.ParticleBlendMultiplyBlock", ParticleBlendMultiplyBlock); +var init_particleBlendMultiplyBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.ParticleBlendMultiplyBlock", ParticleBlendMultiplyBlock); +}); // node_modules/@babylonjs/core/Materials/effectFallbacks.js class EffectFallbacks { @@ -53211,7 +54953,7 @@ class EffectFallbacks { unBindMesh() { this._mesh = null; } - addFallback(rank, define) { + addFallback(rank, define2) { if (!this._defines[rank]) { if (rank < this._currentRank) { this._currentRank = rank; @@ -53221,7 +54963,7 @@ class EffectFallbacks { } this._defines[rank] = new Array; } - this._defines[rank].push(define); + this._defines[rank].push(define2); } addCPUSkinningFallback(rank, mesh6) { this._mesh = mesh6; @@ -53276,17 +55018,23 @@ class EffectFallbacks { return currentDefines; } } +var init_effectFallbacks = __esm(() => { +}); // node_modules/@babylonjs/core/Shaders/postprocess.vertex.js -var name = "postprocessVertexShader"; -var shader = `attribute vec2 position;uniform vec2 scale;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5); +var name2, shader; +var init_postprocess_vertex = __esm(() => { + init_shaderStore(); + name2 = "postprocessVertexShader"; + shader = `attribute vec2 position;uniform vec2 scale;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5); #define CUSTOM_VERTEX_DEFINITIONS void main(void) { #define CUSTOM_VERTEX_MAIN_BEGIN vUV=(position*madd+madd)*scale;gl_Position=vec4(position,0.0,1.0); #define CUSTOM_VERTEX_MAIN_END }`; -ShaderStore.ShadersStore[name] = shader; + ShaderStore.ShadersStore[name2] = shader; +}); // node_modules/@babylonjs/core/Engines/renderTargetWrapper.js class RenderTargetWrapper { @@ -53578,6 +55326,9 @@ class RenderTargetWrapper { this._engine._releaseRenderTargetWrapper(this); } } +var init_renderTargetWrapper = __esm(() => { + init_internalTexture(); +}); // node_modules/@babylonjs/core/Engines/WebGL/webGLRenderTargetWrapper.js class WebGLRenderTargetWrapper extends RenderTargetWrapper { @@ -53717,164 +55468,173 @@ class WebGLRenderTargetWrapper extends RenderTargetWrapper { super.dispose(disposeOnlyFramebuffers); } } +var init_webGLRenderTargetWrapper = __esm(() => { + init_renderTargetWrapper(); +}); // node_modules/@babylonjs/core/Engines/Extensions/engine.renderTarget.js -ThinEngine.prototype._createHardwareRenderTargetWrapper = function(isMulti, isCube, size) { - const rtWrapper = new WebGLRenderTargetWrapper(isMulti, isCube, size, this, this._gl); - this._renderTargetWrapperCache.push(rtWrapper); - return rtWrapper; -}; -ThinEngine.prototype.createRenderTargetTexture = function(size, options) { - var _a, _b; - const rtWrapper = this._createHardwareRenderTargetWrapper(false, false, size); - let generateDepthBuffer = true; - let generateStencilBuffer = false; - let noColorAttachment = false; - let colorAttachment = undefined; - let samples = 1; - if (options !== undefined && typeof options === "object") { - generateDepthBuffer = (_a = options.generateDepthBuffer) !== null && _a !== undefined ? _a : true; - generateStencilBuffer = !!options.generateStencilBuffer; - noColorAttachment = !!options.noColorAttachment; - colorAttachment = options.colorAttachment; - samples = (_b = options.samples) !== null && _b !== undefined ? _b : 1; - } - const texture5 = colorAttachment || (noColorAttachment ? null : this._createInternalTexture(size, options, true, InternalTextureSource.RenderTarget)); - const width = size.width || size; - const height = size.height || size; - const currentFrameBuffer = this._currentFramebuffer; - const gl = this._gl; - const framebuffer = gl.createFramebuffer(); - this._bindUnboundFramebuffer(framebuffer); - rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(generateStencilBuffer, generateDepthBuffer, width, height); - if (texture5 && !texture5.is2DArray) { - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture5._hardwareTexture.underlyingResource, 0); - } - this._bindUnboundFramebuffer(currentFrameBuffer); - rtWrapper._framebuffer = framebuffer; - rtWrapper._generateDepthBuffer = generateDepthBuffer; - rtWrapper._generateStencilBuffer = generateStencilBuffer; - rtWrapper.setTextures(texture5); - this.updateRenderTargetTextureSampleCount(rtWrapper, samples); - return rtWrapper; -}; -ThinEngine.prototype.createDepthStencilTexture = function(size, options, rtWrapper) { - if (options.isCube) { +var init_engine_renderTarget = __esm(() => { + init_internalTexture(); + init_logger(); + init_thinEngine(); + init_webGLRenderTargetWrapper(); + ThinEngine.prototype._createHardwareRenderTargetWrapper = function(isMulti, isCube, size) { + const rtWrapper = new WebGLRenderTargetWrapper(isMulti, isCube, size, this, this._gl); + this._renderTargetWrapperCache.push(rtWrapper); + return rtWrapper; + }; + ThinEngine.prototype.createRenderTargetTexture = function(size, options) { + var _a, _b; + const rtWrapper = this._createHardwareRenderTargetWrapper(false, false, size); + let generateDepthBuffer = true; + let generateStencilBuffer = false; + let noColorAttachment = false; + let colorAttachment = undefined; + let samples = 1; + if (options !== undefined && typeof options === "object") { + generateDepthBuffer = (_a = options.generateDepthBuffer) !== null && _a !== undefined ? _a : true; + generateStencilBuffer = !!options.generateStencilBuffer; + noColorAttachment = !!options.noColorAttachment; + colorAttachment = options.colorAttachment; + samples = (_b = options.samples) !== null && _b !== undefined ? _b : 1; + } + const texture5 = colorAttachment || (noColorAttachment ? null : this._createInternalTexture(size, options, true, InternalTextureSource.RenderTarget)); const width = size.width || size; - return this._createDepthStencilCubeTexture(width, options, rtWrapper); - } else { - return this._createDepthStencilTexture(size, options, rtWrapper); - } -}; -ThinEngine.prototype._createDepthStencilTexture = function(size, options, rtWrapper) { - const gl = this._gl; - const layers = size.layers || 0; - const target = layers !== 0 ? gl.TEXTURE_2D_ARRAY : gl.TEXTURE_2D; - const internalTexture6 = new InternalTexture(this, InternalTextureSource.DepthStencil); - if (!this._caps.depthTextureExtension) { - Logger.Error("Depth texture is not supported by your browser or hardware."); - return internalTexture6; - } - const internalOptions = Object.assign({ bilinearFiltering: false, comparisonFunction: 0, generateStencil: false }, options); - this._bindTextureDirectly(target, internalTexture6, true); - this._setupDepthStencilTexture(internalTexture6, size, internalOptions.generateStencil, internalOptions.comparisonFunction === 0 ? false : internalOptions.bilinearFiltering, internalOptions.comparisonFunction, internalOptions.samples); - if (internalOptions.depthTextureFormat !== undefined) { - if (internalOptions.depthTextureFormat !== 15 && internalOptions.depthTextureFormat !== 16 && internalOptions.depthTextureFormat !== 17 && internalOptions.depthTextureFormat !== 13 && internalOptions.depthTextureFormat !== 14 && internalOptions.depthTextureFormat !== 18) { - Logger.Error("Depth texture format is not supported."); + const height = size.height || size; + const currentFrameBuffer = this._currentFramebuffer; + const gl = this._gl; + const framebuffer = gl.createFramebuffer(); + this._bindUnboundFramebuffer(framebuffer); + rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(generateStencilBuffer, generateDepthBuffer, width, height); + if (texture5 && !texture5.is2DArray) { + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture5._hardwareTexture.underlyingResource, 0); + } + this._bindUnboundFramebuffer(currentFrameBuffer); + rtWrapper._framebuffer = framebuffer; + rtWrapper._generateDepthBuffer = generateDepthBuffer; + rtWrapper._generateStencilBuffer = generateStencilBuffer; + rtWrapper.setTextures(texture5); + this.updateRenderTargetTextureSampleCount(rtWrapper, samples); + return rtWrapper; + }; + ThinEngine.prototype.createDepthStencilTexture = function(size, options, rtWrapper) { + if (options.isCube) { + const width = size.width || size; + return this._createDepthStencilCubeTexture(width, options, rtWrapper); + } else { + return this._createDepthStencilTexture(size, options, rtWrapper); + } + }; + ThinEngine.prototype._createDepthStencilTexture = function(size, options, rtWrapper) { + const gl = this._gl; + const layers = size.layers || 0; + const target = layers !== 0 ? gl.TEXTURE_2D_ARRAY : gl.TEXTURE_2D; + const internalTexture6 = new InternalTexture(this, InternalTextureSource.DepthStencil); + if (!this._caps.depthTextureExtension) { + Logger.Error("Depth texture is not supported by your browser or hardware."); return internalTexture6; } - internalTexture6.format = internalOptions.depthTextureFormat; - } else { - internalTexture6.format = internalOptions.generateStencil ? 13 : 16; - } - const hasStencil = internalTexture6.format === 17 || internalTexture6.format === 13 || internalTexture6.format === 18; - rtWrapper._depthStencilTexture = internalTexture6; - rtWrapper._depthStencilTextureWithStencil = hasStencil; - let type = gl.UNSIGNED_INT; - if (internalTexture6.format === 15) { - type = gl.UNSIGNED_SHORT; - } else if (internalTexture6.format === 17 || internalTexture6.format === 13) { - type = gl.UNSIGNED_INT_24_8; - } else if (internalTexture6.format === 14) { - type = gl.FLOAT; - } else if (internalTexture6.format === 18) { - type = gl.FLOAT_32_UNSIGNED_INT_24_8_REV; - } - const format = hasStencil ? gl.DEPTH_STENCIL : gl.DEPTH_COMPONENT; - let internalFormat = format; - if (this.webGLVersion > 1) { + const internalOptions = Object.assign({ bilinearFiltering: false, comparisonFunction: 0, generateStencil: false }, options); + this._bindTextureDirectly(target, internalTexture6, true); + this._setupDepthStencilTexture(internalTexture6, size, internalOptions.generateStencil, internalOptions.comparisonFunction === 0 ? false : internalOptions.bilinearFiltering, internalOptions.comparisonFunction, internalOptions.samples); + if (internalOptions.depthTextureFormat !== undefined) { + if (internalOptions.depthTextureFormat !== 15 && internalOptions.depthTextureFormat !== 16 && internalOptions.depthTextureFormat !== 17 && internalOptions.depthTextureFormat !== 13 && internalOptions.depthTextureFormat !== 14 && internalOptions.depthTextureFormat !== 18) { + Logger.Error("Depth texture format is not supported."); + return internalTexture6; + } + internalTexture6.format = internalOptions.depthTextureFormat; + } else { + internalTexture6.format = internalOptions.generateStencil ? 13 : 16; + } + const hasStencil = internalTexture6.format === 17 || internalTexture6.format === 13 || internalTexture6.format === 18; + rtWrapper._depthStencilTexture = internalTexture6; + rtWrapper._depthStencilTextureWithStencil = hasStencil; + let type = gl.UNSIGNED_INT; if (internalTexture6.format === 15) { - internalFormat = gl.DEPTH_COMPONENT16; - } else if (internalTexture6.format === 16) { - internalFormat = gl.DEPTH_COMPONENT24; + type = gl.UNSIGNED_SHORT; } else if (internalTexture6.format === 17 || internalTexture6.format === 13) { - internalFormat = gl.DEPTH24_STENCIL8; + type = gl.UNSIGNED_INT_24_8; } else if (internalTexture6.format === 14) { - internalFormat = gl.DEPTH_COMPONENT32F; + type = gl.FLOAT; } else if (internalTexture6.format === 18) { - internalFormat = gl.DEPTH32F_STENCIL8; + type = gl.FLOAT_32_UNSIGNED_INT_24_8_REV; } - } - if (internalTexture6.is2DArray) { - gl.texImage3D(target, 0, internalFormat, internalTexture6.width, internalTexture6.height, layers, 0, format, type, null); - } else { - gl.texImage2D(target, 0, internalFormat, internalTexture6.width, internalTexture6.height, 0, format, type, null); - } - this._bindTextureDirectly(target, null); - this._internalTexturesCache.push(internalTexture6); - const glRtWrapper = rtWrapper; - if (glRtWrapper._depthStencilBuffer) { - const currentFrameBuffer = this._currentFramebuffer; - this._bindUnboundFramebuffer(glRtWrapper._framebuffer); - gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, null); - gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, null); - gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, null); - this._bindUnboundFramebuffer(currentFrameBuffer); - gl.deleteRenderbuffer(glRtWrapper._depthStencilBuffer); - glRtWrapper._depthStencilBuffer = null; - } - return internalTexture6; -}; -ThinEngine.prototype.updateRenderTargetTextureSampleCount = function(rtWrapper, samples) { - if (this.webGLVersion < 2 || !rtWrapper || !rtWrapper.texture) { - return 1; - } - if (rtWrapper.samples === samples) { - return samples; - } - const gl = this._gl; - samples = Math.min(samples, this.getCaps().maxMSAASamples); - if (rtWrapper._depthStencilBuffer) { - gl.deleteRenderbuffer(rtWrapper._depthStencilBuffer); - rtWrapper._depthStencilBuffer = null; - } - if (rtWrapper._MSAAFramebuffer) { - gl.deleteFramebuffer(rtWrapper._MSAAFramebuffer); - rtWrapper._MSAAFramebuffer = null; - } - const hardwareTexture = rtWrapper.texture._hardwareTexture; - hardwareTexture.releaseMSAARenderBuffers(); - if (samples > 1 && typeof gl.renderbufferStorageMultisample === "function") { - const framebuffer = gl.createFramebuffer(); - if (!framebuffer) { - throw new Error("Unable to create multi sampled framebuffer"); + const format = hasStencil ? gl.DEPTH_STENCIL : gl.DEPTH_COMPONENT; + let internalFormat = format; + if (this.webGLVersion > 1) { + if (internalTexture6.format === 15) { + internalFormat = gl.DEPTH_COMPONENT16; + } else if (internalTexture6.format === 16) { + internalFormat = gl.DEPTH_COMPONENT24; + } else if (internalTexture6.format === 17 || internalTexture6.format === 13) { + internalFormat = gl.DEPTH24_STENCIL8; + } else if (internalTexture6.format === 14) { + internalFormat = gl.DEPTH_COMPONENT32F; + } else if (internalTexture6.format === 18) { + internalFormat = gl.DEPTH32F_STENCIL8; + } + } + if (internalTexture6.is2DArray) { + gl.texImage3D(target, 0, internalFormat, internalTexture6.width, internalTexture6.height, layers, 0, format, type, null); + } else { + gl.texImage2D(target, 0, internalFormat, internalTexture6.width, internalTexture6.height, 0, format, type, null); } - rtWrapper._MSAAFramebuffer = framebuffer; - this._bindUnboundFramebuffer(rtWrapper._MSAAFramebuffer); - const colorRenderbuffer = this._createRenderBuffer(rtWrapper.texture.width, rtWrapper.texture.height, samples, -1, this._getRGBABufferInternalSizedFormat(rtWrapper.texture.type, rtWrapper.texture.format, rtWrapper.texture._useSRGBBuffer), gl.COLOR_ATTACHMENT0, false); - if (!colorRenderbuffer) { - throw new Error("Unable to create multi sampled framebuffer"); + this._bindTextureDirectly(target, null); + this._internalTexturesCache.push(internalTexture6); + const glRtWrapper = rtWrapper; + if (glRtWrapper._depthStencilBuffer) { + const currentFrameBuffer = this._currentFramebuffer; + this._bindUnboundFramebuffer(glRtWrapper._framebuffer); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, null); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, null); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, null); + this._bindUnboundFramebuffer(currentFrameBuffer); + gl.deleteRenderbuffer(glRtWrapper._depthStencilBuffer); + glRtWrapper._depthStencilBuffer = null; } - hardwareTexture.addMSAARenderBuffer(colorRenderbuffer); - } else { - this._bindUnboundFramebuffer(rtWrapper._framebuffer); - } - rtWrapper.texture.samples = samples; - rtWrapper._samples = samples; - rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(rtWrapper._generateStencilBuffer, rtWrapper._generateDepthBuffer, rtWrapper.texture.width, rtWrapper.texture.height, samples); - this._bindUnboundFramebuffer(null); - return samples; -}; + return internalTexture6; + }; + ThinEngine.prototype.updateRenderTargetTextureSampleCount = function(rtWrapper, samples) { + if (this.webGLVersion < 2 || !rtWrapper || !rtWrapper.texture) { + return 1; + } + if (rtWrapper.samples === samples) { + return samples; + } + const gl = this._gl; + samples = Math.min(samples, this.getCaps().maxMSAASamples); + if (rtWrapper._depthStencilBuffer) { + gl.deleteRenderbuffer(rtWrapper._depthStencilBuffer); + rtWrapper._depthStencilBuffer = null; + } + if (rtWrapper._MSAAFramebuffer) { + gl.deleteFramebuffer(rtWrapper._MSAAFramebuffer); + rtWrapper._MSAAFramebuffer = null; + } + const hardwareTexture = rtWrapper.texture._hardwareTexture; + hardwareTexture.releaseMSAARenderBuffers(); + if (samples > 1 && typeof gl.renderbufferStorageMultisample === "function") { + const framebuffer = gl.createFramebuffer(); + if (!framebuffer) { + throw new Error("Unable to create multi sampled framebuffer"); + } + rtWrapper._MSAAFramebuffer = framebuffer; + this._bindUnboundFramebuffer(rtWrapper._MSAAFramebuffer); + const colorRenderbuffer = this._createRenderBuffer(rtWrapper.texture.width, rtWrapper.texture.height, samples, -1, this._getRGBABufferInternalSizedFormat(rtWrapper.texture.type, rtWrapper.texture.format, rtWrapper.texture._useSRGBBuffer), gl.COLOR_ATTACHMENT0, false); + if (!colorRenderbuffer) { + throw new Error("Unable to create multi sampled framebuffer"); + } + hardwareTexture.addMSAARenderBuffer(colorRenderbuffer); + } else { + this._bindUnboundFramebuffer(rtWrapper._framebuffer); + } + rtWrapper.texture.samples = samples; + rtWrapper._samples = samples; + rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(rtWrapper._generateStencilBuffer, rtWrapper._generateDepthBuffer, rtWrapper.texture.width, rtWrapper.texture.height, samples); + this._bindUnboundFramebuffer(null); + return samples; + }; +}); // node_modules/@babylonjs/core/PostProcesses/postProcess.js class PostProcess { @@ -53957,7 +55717,7 @@ class PostProcess { } return this._texelSize; } - constructor(name2, fragmentUrl, parameters, samplers, _size, camera6, samplingMode = 1, engine9, reusable, defines = null, textureType = 0, vertexUrl = "postprocess", indexParameters, blockCompilation = false, textureFormat = 5, shaderLanguage8 = ShaderLanguage.GLSL) { + constructor(name3, fragmentUrl, parameters, samplers, _size, camera6, samplingMode = 1, engine9, reusable, defines = null, textureType = 0, vertexUrl = "postprocess", indexParameters, blockCompilation = false, textureFormat = 5, shaderLanguage8 = ShaderLanguage.GLSL) { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; this._parentContainer = null; this.width = -1; @@ -53987,7 +55747,7 @@ class PostProcess { this.onApplyObservable = new Observable; this.onBeforeRenderObservable = new Observable; this.onAfterRenderObservable = new Observable; - this.name = name2; + this.name = name3; let size = 1; let uniformBuffers = null; if (parameters && !Array.isArray(parameters)) { @@ -54393,61 +56153,74 @@ class PostProcess { }, parsedPostProcess, scene11, rootUrl); } } -PostProcess._CustomShaderCodeProcessing = {}; -__decorate2([ - serialize() -], PostProcess.prototype, "uniqueId", undefined); -__decorate2([ - serialize() -], PostProcess.prototype, "name", undefined); -__decorate2([ - serialize() -], PostProcess.prototype, "width", undefined); -__decorate2([ - serialize() -], PostProcess.prototype, "height", undefined); -__decorate2([ - serialize() -], PostProcess.prototype, "renderTargetSamplingMode", undefined); -__decorate2([ - serializeAsColor4() -], PostProcess.prototype, "clearColor", undefined); -__decorate2([ - serialize() -], PostProcess.prototype, "autoClear", undefined); -__decorate2([ - serialize() -], PostProcess.prototype, "forceAutoClearInAlphaMode", undefined); -__decorate2([ - serialize() -], PostProcess.prototype, "alphaMode", undefined); -__decorate2([ - serialize() -], PostProcess.prototype, "alphaConstants", undefined); -__decorate2([ - serialize() -], PostProcess.prototype, "enablePixelPerfectMode", undefined); -__decorate2([ - serialize() -], PostProcess.prototype, "forceFullscreenViewport", undefined); -__decorate2([ - serialize() -], PostProcess.prototype, "scaleMode", undefined); -__decorate2([ - serialize() -], PostProcess.prototype, "alwaysForcePOT", undefined); -__decorate2([ - serialize("samples") -], PostProcess.prototype, "_samples", undefined); -__decorate2([ - serialize() -], PostProcess.prototype, "adaptScaleToCurrentViewport", undefined); -RegisterClass("BABYLON.PostProcess", PostProcess); +var init_postProcess = __esm(() => { + init_tslib_es62(); + init_smartArray(); + init_observable(); + init_math_vector(); + init_postprocess_vertex(); + init_engine(); + init_engine_renderTarget(); + init_decorators(); + init_typeStore(); + init_drawWrapper(); + init_shaderLanguage(); + PostProcess._CustomShaderCodeProcessing = {}; + __decorate2([ + serialize() + ], PostProcess.prototype, "uniqueId", undefined); + __decorate2([ + serialize() + ], PostProcess.prototype, "name", undefined); + __decorate2([ + serialize() + ], PostProcess.prototype, "width", undefined); + __decorate2([ + serialize() + ], PostProcess.prototype, "height", undefined); + __decorate2([ + serialize() + ], PostProcess.prototype, "renderTargetSamplingMode", undefined); + __decorate2([ + serializeAsColor4() + ], PostProcess.prototype, "clearColor", undefined); + __decorate2([ + serialize() + ], PostProcess.prototype, "autoClear", undefined); + __decorate2([ + serialize() + ], PostProcess.prototype, "forceAutoClearInAlphaMode", undefined); + __decorate2([ + serialize() + ], PostProcess.prototype, "alphaMode", undefined); + __decorate2([ + serialize() + ], PostProcess.prototype, "alphaConstants", undefined); + __decorate2([ + serialize() + ], PostProcess.prototype, "enablePixelPerfectMode", undefined); + __decorate2([ + serialize() + ], PostProcess.prototype, "forceFullscreenViewport", undefined); + __decorate2([ + serialize() + ], PostProcess.prototype, "scaleMode", undefined); + __decorate2([ + serialize() + ], PostProcess.prototype, "alwaysForcePOT", undefined); + __decorate2([ + serialize("samples") + ], PostProcess.prototype, "_samples", undefined); + __decorate2([ + serialize() + ], PostProcess.prototype, "adaptScaleToCurrentViewport", undefined); + RegisterClass("BABYLON.PostProcess", PostProcess); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/vectorMergerBlock.js class VectorMergerBlock extends NodeMaterialBlock { - constructor(name2) { - super(name2, NodeMaterialBlockTargets.Neutral); + constructor(name3) { + super(name3, NodeMaterialBlockTargets.Neutral); this.xSwizzle = "x"; this.ySwizzle = "y"; this.zSwizzle = "z"; @@ -54510,20 +56283,20 @@ class VectorMergerBlock extends NodeMaterialBlock { get xyz() { return this.xyzOut; } - _inputRename(name2) { - if (name2 === "xyzw ") { + _inputRename(name3) { + if (name3 === "xyzw ") { return "xyzwIn"; } - if (name2 === "xyz ") { + if (name3 === "xyz ") { return "xyzIn"; } - if (name2 === "xy ") { + if (name3 === "xy ") { return "xyIn"; } - if (name2 === "zw ") { + if (name3 === "zw ") { return "zwIn"; } - return name2; + return name3; } _buildSwizzle(len) { const swizzle = this.xSwizzle + this.ySwizzle + this.zSwizzle + this.wSwizzle; @@ -54633,12 +56406,18 @@ class VectorMergerBlock extends NodeMaterialBlock { return codeString; } } -RegisterClass("BABYLON.VectorMergerBlock", VectorMergerBlock); +var init_vectorMergerBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.VectorMergerBlock", VectorMergerBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/remapBlock.js class RemapBlock extends NodeMaterialBlock { - constructor(name2) { - super(name2, NodeMaterialBlockTargets.Neutral); + constructor(name3) { + super(name3, NodeMaterialBlockTargets.Neutral); this.sourceRange = new Vector2(-1, 1); this.targetRange = new Vector2(0, 1); this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect); @@ -54697,18 +56476,27 @@ class RemapBlock extends NodeMaterialBlock { this.targetRange = Vector2.FromArray(serializationObject.targetRange); } } -__decorate2([ - editableInPropertyPage("From", PropertyTypeForEdition.Vector2) -], RemapBlock.prototype, "sourceRange", undefined); -__decorate2([ - editableInPropertyPage("To", PropertyTypeForEdition.Vector2) -], RemapBlock.prototype, "targetRange", undefined); -RegisterClass("BABYLON.RemapBlock", RemapBlock); +var init_remapBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_math_vector(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("From", PropertyTypeForEdition.Vector2) + ], RemapBlock.prototype, "sourceRange", undefined); + __decorate2([ + editableInPropertyPage("To", PropertyTypeForEdition.Vector2) + ], RemapBlock.prototype, "targetRange", undefined); + RegisterClass("BABYLON.RemapBlock", RemapBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/multiplyBlock.js class MultiplyBlock extends NodeMaterialBlock { - constructor(name2) { - super(name2, NodeMaterialBlockTargets.Neutral); + constructor(name3) { + super(name3, NodeMaterialBlockTargets.Neutral); this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); @@ -54736,16 +56524,24 @@ class MultiplyBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.MultiplyBlock", MultiplyBlock); +var init_multiplyBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.MultiplyBlock", MultiplyBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Enums/nodeMaterialModes.js var NodeMaterialModes; -(function(NodeMaterialModes2) { - NodeMaterialModes2[NodeMaterialModes2["Material"] = 0] = "Material"; - NodeMaterialModes2[NodeMaterialModes2["PostProcess"] = 1] = "PostProcess"; - NodeMaterialModes2[NodeMaterialModes2["Particle"] = 2] = "Particle"; - NodeMaterialModes2[NodeMaterialModes2["ProceduralTexture"] = 3] = "ProceduralTexture"; -})(NodeMaterialModes || (NodeMaterialModes = {})); +var init_nodeMaterialModes = __esm(() => { + (function(NodeMaterialModes2) { + NodeMaterialModes2[NodeMaterialModes2["Material"] = 0] = "Material"; + NodeMaterialModes2[NodeMaterialModes2["PostProcess"] = 1] = "PostProcess"; + NodeMaterialModes2[NodeMaterialModes2["Particle"] = 2] = "Particle"; + NodeMaterialModes2[NodeMaterialModes2["ProceduralTexture"] = 3] = "ProceduralTexture"; + })(NodeMaterialModes || (NodeMaterialModes = {})); +}); // node_modules/@babylonjs/core/Particles/EmitterTypes/boxParticleEmitter.js class BoxParticleEmitter { @@ -54818,6 +56614,12 @@ class BoxParticleEmitter { Vector3.FromArrayToRef(serializationObject.maxEmitBox, 0, this.maxEmitBox); } } +var init_boxParticleEmitter = __esm(() => { + init_deepCopier(); + init_math_vector(); + init_math_scalar(); +}); + // node_modules/@babylonjs/core/Particles/EmitterTypes/coneParticleEmitter.js class ConeParticleEmitter { get radius() { @@ -54932,6 +56734,12 @@ class ConeParticleEmitter { this.emitFromSpawnPointOnly = serializationObject.emitFromSpawnPointOnly !== undefined ? serializationObject.emitFromSpawnPointOnly : false; } } +var init_coneParticleEmitter = __esm(() => { + init_deepCopier(); + init_math_vector(); + init_math_scalar(); +}); + // node_modules/@babylonjs/core/Particles/EmitterTypes/cylinderParticleEmitter.js class CylinderParticleEmitter { constructor(radius = 1, height = 1, radiusRange = 1, directionRandomizer = 0) { @@ -55060,6 +56868,12 @@ class CylinderDirectedParticleEmitter extends CylinderParticleEmitter { this.direction2.copyFrom(serializationObject.direction2); } } +var init_cylinderParticleEmitter = __esm(() => { + init_math_vector(); + init_math_scalar(); + init_deepCopier(); +}); + // node_modules/@babylonjs/core/Particles/EmitterTypes/hemisphericParticleEmitter.js class HemisphericParticleEmitter { constructor(radius = 1, radiusRange = 1, directionRandomizer = 0) { @@ -55131,6 +56945,16 @@ class HemisphericParticleEmitter { this.directionRandomizer = serializationObject.directionRandomizer; } } +var init_hemisphericParticleEmitter = __esm(() => { + init_deepCopier(); + init_math_vector(); + init_math_scalar(); +}); + +// node_modules/@babylonjs/core/Particles/EmitterTypes/IParticleEmitterType.js +var init_IParticleEmitterType = __esm(() => { +}); + // node_modules/@babylonjs/core/Particles/EmitterTypes/pointParticleEmitter.js class PointParticleEmitter { constructor() { @@ -55185,6 +57009,12 @@ class PointParticleEmitter { Vector3.FromArrayToRef(serializationObject.direction2, 0, this.direction2); } } +var init_pointParticleEmitter = __esm(() => { + init_deepCopier(); + init_math_vector(); + init_math_scalar(); +}); + // node_modules/@babylonjs/core/Particles/EmitterTypes/sphereParticleEmitter.js class SphereParticleEmitter { constructor(radius = 1, radiusRange = 1, directionRandomizer = 0) { @@ -55304,6 +57134,12 @@ class SphereDirectedParticleEmitter extends SphereParticleEmitter { this.direction2.copyFrom(serializationObject.direction2); } } +var init_sphereParticleEmitter = __esm(() => { + init_math_vector(); + init_math_scalar(); + init_deepCopier(); +}); + // node_modules/@babylonjs/core/Particles/EmitterTypes/customParticleEmitter.js class CustomParticleEmitter { constructor() { @@ -55364,6 +57200,11 @@ class CustomParticleEmitter { parse(serializationObject) { } } +var init_customParticleEmitter = __esm(() => { + init_deepCopier(); + init_math_vector(); +}); + // node_modules/@babylonjs/core/Particles/EmitterTypes/meshParticleEmitter.js class MeshParticleEmitter { get mesh() { @@ -55482,6 +57323,26 @@ class MeshParticleEmitter { this.useMeshNormalsForDirection = serializationObject.useMeshNormalsForDirection; } } +var init_meshParticleEmitter = __esm(() => { + init_deepCopier(); + init_math_vector(); + init_math_scalar(); + init_buffer(); +}); + +// node_modules/@babylonjs/core/Particles/EmitterTypes/index.js +var init_EmitterTypes = __esm(() => { + init_boxParticleEmitter(); + init_coneParticleEmitter(); + init_cylinderParticleEmitter(); + init_hemisphericParticleEmitter(); + init_IParticleEmitterType(); + init_pointParticleEmitter(); + init_sphereParticleEmitter(); + init_customParticleEmitter(); + init_meshParticleEmitter(); +}); + // node_modules/@babylonjs/core/Particles/baseParticleSystem.js class BaseParticleSystem { get noiseTexture() { @@ -55648,7 +57509,7 @@ class BaseParticleSystem { } return this; } - constructor(name2) { + constructor(name3) { this.animations = []; this.renderingGroupId = 0; this.emitter = Vector3.Zero(); @@ -55719,8 +57580,8 @@ class BaseParticleSystem { this._billboardMode = 7; this._isBillboardBased = true; this._imageProcessingConfigurationDefines = new ImageProcessingConfigurationDefines; - this.id = name2; - this.name = name2; + this.id = name3; + this.name = name3; } createPointEmitter(direction1, direction2) { const particleEmitter = new PointParticleEmitter; @@ -55769,16 +57630,23 @@ class BaseParticleSystem { return particleEmitter; } } -BaseParticleSystem.BLENDMODE_ONEONE = 0; -BaseParticleSystem.BLENDMODE_STANDARD = 1; -BaseParticleSystem.BLENDMODE_ADD = 2; -BaseParticleSystem.BLENDMODE_MULTIPLY = 3; -BaseParticleSystem.BLENDMODE_MULTIPLYADD = 4; +var init_baseParticleSystem = __esm(() => { + init_math_vector(); + init_imageProcessingConfiguration(); + init_EmitterTypes(); + init_math_color(); + init_engine_dynamicBuffer(); + BaseParticleSystem.BLENDMODE_ONEONE = 0; + BaseParticleSystem.BLENDMODE_STANDARD = 1; + BaseParticleSystem.BLENDMODE_ADD = 2; + BaseParticleSystem.BLENDMODE_MULTIPLY = 3; + BaseParticleSystem.BLENDMODE_MULTIPLYADD = 4; +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/colorSplitterBlock.js class ColorSplitterBlock extends NodeMaterialBlock { - constructor(name2) { - super(name2, NodeMaterialBlockTargets.Neutral); + constructor(name3) { + super(name3, NodeMaterialBlockTargets.Neutral); this.registerInput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, true); this.registerInput("rgb ", NodeMaterialBlockConnectionPointTypes.Color3, true); this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3); @@ -55812,17 +57680,17 @@ class ColorSplitterBlock extends NodeMaterialBlock { get a() { return this._outputs[4]; } - _inputRename(name2) { - if (name2 === "rgb ") { + _inputRename(name3) { + if (name3 === "rgb ") { return "rgbIn"; } - return name2; + return name3; } - _outputRename(name2) { - if (name2 === "rgb") { + _outputRename(name3) { + if (name3 === "rgb") { return "rgbOut"; } - return name2; + return name3; } _buildBlock(state) { super._buildBlock(state); @@ -55853,64 +57721,70 @@ class ColorSplitterBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.ColorSplitterBlock", ColorSplitterBlock); +var init_colorSplitterBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.ColorSplitterBlock", ColorSplitterBlock); +}); // node_modules/@babylonjs/core/Engines/Extensions/engine.renderTargetCube.js -ThinEngine.prototype.createRenderTargetCubeTexture = function(size, options) { - const rtWrapper = this._createHardwareRenderTargetWrapper(false, true, size); - const fullOptions = Object.assign({ generateMipMaps: true, generateDepthBuffer: true, generateStencilBuffer: false, type: 0, samplingMode: 3, format: 5 }, options); - fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer; - if (fullOptions.type === 1 && !this._caps.textureFloatLinearFiltering) { - fullOptions.samplingMode = 1; - } else if (fullOptions.type === 2 && !this._caps.textureHalfFloatLinearFiltering) { - fullOptions.samplingMode = 1; - } - const gl = this._gl; - const texture5 = new InternalTexture(this, InternalTextureSource.RenderTarget); - this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture5, true); - const filters = this._getSamplingParameters(fullOptions.samplingMode, fullOptions.generateMipMaps); - if (fullOptions.type === 1 && !this._caps.textureFloat) { - fullOptions.type = 0; - Logger.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type"); - } - gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, filters.mag); - gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, filters.min); - gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - for (let face = 0;face < 6; face++) { - gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, this._getRGBABufferInternalSizedFormat(fullOptions.type, fullOptions.format), size, size, 0, this._getInternalFormat(fullOptions.format), this._getWebGLTextureType(fullOptions.type), null); - } - const framebuffer = gl.createFramebuffer(); - this._bindUnboundFramebuffer(framebuffer); - rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(fullOptions.generateStencilBuffer, fullOptions.generateDepthBuffer, size, size); - if (fullOptions.generateMipMaps) { - gl.generateMipmap(gl.TEXTURE_CUBE_MAP); - } - this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); - this._bindUnboundFramebuffer(null); - rtWrapper._framebuffer = framebuffer; - rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer; - rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer; - texture5.width = size; - texture5.height = size; - texture5.isReady = true; - texture5.isCube = true; - texture5.samples = 1; - texture5.generateMipMaps = fullOptions.generateMipMaps; - texture5.samplingMode = fullOptions.samplingMode; - texture5.type = fullOptions.type; - texture5.format = fullOptions.format; - this._internalTexturesCache.push(texture5); - rtWrapper.setTextures(texture5); - return rtWrapper; -}; +var init_engine_renderTargetCube = __esm(() => { + init_internalTexture(); + init_logger(); + init_thinEngine(); + ThinEngine.prototype.createRenderTargetCubeTexture = function(size, options) { + const rtWrapper = this._createHardwareRenderTargetWrapper(false, true, size); + const fullOptions = Object.assign({ generateMipMaps: true, generateDepthBuffer: true, generateStencilBuffer: false, type: 0, samplingMode: 3, format: 5 }, options); + fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer; + if (fullOptions.type === 1 && !this._caps.textureFloatLinearFiltering) { + fullOptions.samplingMode = 1; + } else if (fullOptions.type === 2 && !this._caps.textureHalfFloatLinearFiltering) { + fullOptions.samplingMode = 1; + } + const gl = this._gl; + const texture5 = new InternalTexture(this, InternalTextureSource.RenderTarget); + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture5, true); + const filters = this._getSamplingParameters(fullOptions.samplingMode, fullOptions.generateMipMaps); + if (fullOptions.type === 1 && !this._caps.textureFloat) { + fullOptions.type = 0; + Logger.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type"); + } + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, filters.mag); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, filters.min); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + for (let face = 0;face < 6; face++) { + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, this._getRGBABufferInternalSizedFormat(fullOptions.type, fullOptions.format), size, size, 0, this._getInternalFormat(fullOptions.format), this._getWebGLTextureType(fullOptions.type), null); + } + const framebuffer = gl.createFramebuffer(); + this._bindUnboundFramebuffer(framebuffer); + rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(fullOptions.generateStencilBuffer, fullOptions.generateDepthBuffer, size, size); + if (fullOptions.generateMipMaps) { + gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + } + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + this._bindUnboundFramebuffer(null); + rtWrapper._framebuffer = framebuffer; + rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer; + rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer; + texture5.width = size; + texture5.height = size; + texture5.isReady = true; + texture5.isCube = true; + texture5.samples = 1; + texture5.generateMipMaps = fullOptions.generateMipMaps; + texture5.samplingMode = fullOptions.samplingMode; + texture5.type = fullOptions.type; + texture5.format = fullOptions.format; + this._internalTexturesCache.push(texture5); + rtWrapper.setTextures(texture5); + return rtWrapper; + }; +}); // node_modules/@babylonjs/core/Materials/effectRenderer.js -var defaultOptions = { - positions: [1, 1, -1, 1, -1, -1, 1, -1], - indices: [0, 1, 2, 0, 2, 3] -}; - class EffectRenderer { constructor(engine9, options = defaultOptions) { var _a, _b; @@ -56046,15 +57920,32 @@ class EffectWrapper { this.effect.dispose(); } } +var defaultOptions; +var init_effectRenderer = __esm(() => { + init_buffer(); + init_math_viewport(); + init_observable(); + init_effect(); + init_drawWrapper(); + init_postprocess_vertex(); + defaultOptions = { + positions: [1, 1, -1, 1, -1, -1, 1, -1], + indices: [0, 1, 2, 0, 2, 3] + }; +}); // node_modules/@babylonjs/core/Shaders/pass.fragment.js -var name2 = "passPixelShader"; -var shader2 = `varying vec2 vUV;uniform sampler2D textureSampler; +var name3, shader2, passPixelShader; +var init_pass_fragment = __esm(() => { + init_shaderStore(); + name3 = "passPixelShader"; + shader2 = `varying vec2 vUV;uniform sampler2D textureSampler; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {gl_FragColor=texture2D(textureSampler,vUV);}`; -ShaderStore.ShadersStore[name2] = shader2; -var passPixelShader = { name: name2, shader: shader2 }; + ShaderStore.ShadersStore[name3] = shader2; + passPixelShader = { name: name3, shader: shader2 }; +}); // node_modules/@babylonjs/core/Misc/dumpTools.js class DumpTools { @@ -56147,12 +58038,20 @@ class DumpTools { DumpTools._DumpToolsEngine = null; } } -var initSideEffects2 = () => { - Tools.DumpData = DumpTools.DumpData; - Tools.DumpDataAsync = DumpTools.DumpDataAsync; - Tools.DumpFramebuffer = DumpTools.DumpFramebuffer; -}; -initSideEffects2(); +var initSideEffects2; +var init_dumpTools = __esm(() => { + init_thinEngine(); + init_effectRenderer(); + init_tools(); + init_pass_fragment(); + init_math_scalar(); + initSideEffects2 = () => { + Tools.DumpData = DumpTools.DumpData; + Tools.DumpDataAsync = DumpTools.DumpDataAsync; + Tools.DumpFramebuffer = DumpTools.DumpFramebuffer; + }; + initSideEffects2(); +}); // node_modules/@babylonjs/core/Materials/Textures/renderTargetTexture.js class RenderTargetTexture extends Texture { @@ -56250,7 +58149,7 @@ class RenderTargetTexture extends Texture { var _a, _b; return (_b = (_a = this._renderTarget) === null || _a === undefined ? undefined : _a._depthStencilTexture) !== null && _b !== undefined ? _b : null; } - constructor(name3, size, scene11, generateMipMaps = false, doNotChangeAspectRatio = true, type = 0, isCube = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, generateDepthBuffer = true, generateStencilBuffer = false, isMulti = false, format = 5, delayAllocation = false, samples, creationFlags, noColorAttachment = false, useSRGBBuffer = false) { + constructor(name4, size, scene11, generateMipMaps = false, doNotChangeAspectRatio = true, type = 0, isCube = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, generateDepthBuffer = true, generateStencilBuffer = false, isMulti = false, format = 5, delayAllocation = false, samples, creationFlags, noColorAttachment = false, useSRGBBuffer = false) { var _a, _b, _c, _d, _e, _f, _g; let colorAttachment = undefined; let gammaSpace = true; @@ -56310,7 +58209,7 @@ class RenderTargetTexture extends Texture { this._gammaSpace = gammaSpace; this._coordinatesMode = Texture.PROJECTION_MODE; this.renderList = []; - this.name = name3; + this.name = name4; this.isRenderTarget = true; this._initialSizeParameter = size; this._renderPassIds = []; @@ -56935,12 +58834,24 @@ class RenderTargetTexture extends Texture { return 1; } } -RenderTargetTexture.REFRESHRATE_RENDER_ONCE = 0; -RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYFRAME = 1; -RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYTWOFRAMES = 2; -Texture._CreateRenderTargetTexture = (name3, renderTargetSize, scene11, generateMipMaps, creationFlags) => { - return new RenderTargetTexture(name3, renderTargetSize, scene11, generateMipMaps); -}; +var init_renderTargetTexture = __esm(() => { + init_observable(); + init_math_vector(); + init_texture(); + init_postProcessManager(); + init_renderingManager(); + init_engine_renderTarget(); + init_engine_renderTargetCube(); + init_engine(); + init_arrayTools(); + init_dumpTools(); + RenderTargetTexture.REFRESHRATE_RENDER_ONCE = 0; + RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYFRAME = 1; + RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYTWOFRAMES = 2; + Texture._CreateRenderTargetTexture = (name4, renderTargetSize, scene11, generateMipMaps, creationFlags) => { + return new RenderTargetTexture(name4, renderTargetSize, scene11, generateMipMaps); + }; +}); // node_modules/@babylonjs/core/Materials/Textures/Procedurals/proceduralTextureSceneComponent.js class ProceduralTextureSceneComponent { @@ -56969,21 +58880,29 @@ class ProceduralTextureSceneComponent { } } } +var init_proceduralTextureSceneComponent = __esm(() => { + init_tools(); + init_sceneComponent(); +}); // node_modules/@babylonjs/core/Shaders/procedural.vertex.js -var name3 = "proceduralVertexShader"; -var shader3 = `attribute vec2 position;varying vec2 vPosition;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5); +var name4, shader3; +var init_procedural_vertex = __esm(() => { + init_shaderStore(); + name4 = "proceduralVertexShader"; + shader3 = `attribute vec2 position;varying vec2 vPosition;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5); #define CUSTOM_VERTEX_DEFINITIONS void main(void) { #define CUSTOM_VERTEX_MAIN_BEGIN vPosition=position;vUV=position*madd+madd;gl_Position=vec4(position,0.0,1.0); #define CUSTOM_VERTEX_MAIN_END }`; -ShaderStore.ShadersStore[name3] = shader3; + ShaderStore.ShadersStore[name4] = shader3; +}); // node_modules/@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js class ProceduralTexture extends Texture { - constructor(name4, size, fragment, scene11, fallbackTexture = null, generateMipMaps = true, isCube = false, textureType = 0) { + constructor(name5, size, fragment, scene11, fallbackTexture = null, generateMipMaps = true, isCube = false, textureType = 0) { super(null, scene11, !generateMipMaps); this.isEnabled = true; this.autoClear = true; @@ -57017,7 +58936,7 @@ class ProceduralTexture extends Texture { } scene11.proceduralTextures.push(this); this._fullEngine = scene11.getEngine(); - this.name = name4; + this.name = name5; this.isRenderTarget = true; this._size = size; this._textureType = textureType; @@ -57213,51 +59132,51 @@ class ProceduralTexture extends Texture { this._uniforms.push(uniformName); } } - setTexture(name4, texture7) { - if (this._samplers.indexOf(name4) === -1) { - this._samplers.push(name4); + setTexture(name5, texture7) { + if (this._samplers.indexOf(name5) === -1) { + this._samplers.push(name5); } - this._textures[name4] = texture7; + this._textures[name5] = texture7; return this; } - setFloat(name4, value) { - this._checkUniform(name4); - this._floats[name4] = value; + setFloat(name5, value) { + this._checkUniform(name5); + this._floats[name5] = value; return this; } - setInt(name4, value) { - this._checkUniform(name4); - this._ints[name4] = value; + setInt(name5, value) { + this._checkUniform(name5); + this._ints[name5] = value; return this; } - setFloats(name4, value) { - this._checkUniform(name4); - this._floatsArrays[name4] = value; + setFloats(name5, value) { + this._checkUniform(name5); + this._floatsArrays[name5] = value; return this; } - setColor3(name4, value) { - this._checkUniform(name4); - this._colors3[name4] = value; + setColor3(name5, value) { + this._checkUniform(name5); + this._colors3[name5] = value; return this; } - setColor4(name4, value) { - this._checkUniform(name4); - this._colors4[name4] = value; + setColor4(name5, value) { + this._checkUniform(name5); + this._colors4[name5] = value; return this; } - setVector2(name4, value) { - this._checkUniform(name4); - this._vectors2[name4] = value; + setVector2(name5, value) { + this._checkUniform(name5); + this._vectors2[name5] = value; return this; } - setVector3(name4, value) { - this._checkUniform(name4); - this._vectors3[name4] = value; + setVector3(name5, value) { + this._checkUniform(name5); + this._vectors3[name5] = value; return this; } - setMatrix(name4, value) { - this._checkUniform(name4); - this._matrices[name4] = value; + setMatrix(name5, value) { + this._checkUniform(name5); + this._matrices[name5] = value; return this; } render(useCameraPostProcess) { @@ -57271,33 +59190,33 @@ class ProceduralTexture extends Texture { this.onBeforeGenerationObservable.notifyObservers(this); engine10.setState(false); if (!this.nodeMaterialSource) { - for (const name4 in this._textures) { - this._drawWrapper.effect.setTexture(name4, this._textures[name4]); + for (const name5 in this._textures) { + this._drawWrapper.effect.setTexture(name5, this._textures[name5]); } - for (const name4 in this._ints) { - this._drawWrapper.effect.setInt(name4, this._ints[name4]); + for (const name5 in this._ints) { + this._drawWrapper.effect.setInt(name5, this._ints[name5]); } - for (const name4 in this._floats) { - this._drawWrapper.effect.setFloat(name4, this._floats[name4]); + for (const name5 in this._floats) { + this._drawWrapper.effect.setFloat(name5, this._floats[name5]); } - for (const name4 in this._floatsArrays) { - this._drawWrapper.effect.setArray(name4, this._floatsArrays[name4]); + for (const name5 in this._floatsArrays) { + this._drawWrapper.effect.setArray(name5, this._floatsArrays[name5]); } - for (const name4 in this._colors3) { - this._drawWrapper.effect.setColor3(name4, this._colors3[name4]); + for (const name5 in this._colors3) { + this._drawWrapper.effect.setColor3(name5, this._colors3[name5]); } - for (const name4 in this._colors4) { - const color = this._colors4[name4]; - this._drawWrapper.effect.setFloat4(name4, color.r, color.g, color.b, color.a); + for (const name5 in this._colors4) { + const color = this._colors4[name5]; + this._drawWrapper.effect.setFloat4(name5, color.r, color.g, color.b, color.a); } - for (const name4 in this._vectors2) { - this._drawWrapper.effect.setVector2(name4, this._vectors2[name4]); + for (const name5 in this._vectors2) { + this._drawWrapper.effect.setVector2(name5, this._vectors2[name5]); } - for (const name4 in this._vectors3) { - this._drawWrapper.effect.setVector3(name4, this._vectors3[name4]); + for (const name5 in this._vectors3) { + this._drawWrapper.effect.setVector3(name5, this._vectors3[name5]); } - for (const name4 in this._matrices) { - this._drawWrapper.effect.setMatrix(name4, this._matrices[name4]); + for (const name5 in this._matrices) { + this._drawWrapper.effect.setMatrix(name5, this._matrices[name5]); } } if (!this._texture || !this._rtWrapper) { @@ -57366,49 +59285,44 @@ class ProceduralTexture extends Texture { super.dispose(); } } -__decorate2([ - serialize() -], ProceduralTexture.prototype, "isEnabled", undefined); -__decorate2([ - serialize() -], ProceduralTexture.prototype, "autoClear", undefined); -__decorate2([ - serialize() -], ProceduralTexture.prototype, "_generateMipMaps", undefined); -__decorate2([ - serialize() -], ProceduralTexture.prototype, "_size", undefined); -__decorate2([ - serialize() -], ProceduralTexture.prototype, "refreshRate", null); -RegisterClass("BABYLON.ProceduralTexture", ProceduralTexture); +var init_proceduralTexture = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_observable(); + init_buffer(); + init_sceneComponent(); + init_material(); + init_texture(); + init_renderTargetTexture(); + init_proceduralTextureSceneComponent(); + init_engine_renderTarget(); + init_engine_renderTargetCube(); + init_procedural_vertex(); + init_typeStore(); + init_engineStore(); + init_drawWrapper(); + __decorate2([ + serialize() + ], ProceduralTexture.prototype, "isEnabled", undefined); + __decorate2([ + serialize() + ], ProceduralTexture.prototype, "autoClear", undefined); + __decorate2([ + serialize() + ], ProceduralTexture.prototype, "_generateMipMaps", undefined); + __decorate2([ + serialize() + ], ProceduralTexture.prototype, "_size", undefined); + __decorate2([ + serialize() + ], ProceduralTexture.prototype, "refreshRate", null); + RegisterClass("BABYLON.ProceduralTexture", ProceduralTexture); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/trigonometryBlock.js -var TrigonometryBlockOperations; -(function(TrigonometryBlockOperations2) { - TrigonometryBlockOperations2[TrigonometryBlockOperations2["Cos"] = 0] = "Cos"; - TrigonometryBlockOperations2[TrigonometryBlockOperations2["Sin"] = 1] = "Sin"; - TrigonometryBlockOperations2[TrigonometryBlockOperations2["Abs"] = 2] = "Abs"; - TrigonometryBlockOperations2[TrigonometryBlockOperations2["Exp"] = 3] = "Exp"; - TrigonometryBlockOperations2[TrigonometryBlockOperations2["Exp2"] = 4] = "Exp2"; - TrigonometryBlockOperations2[TrigonometryBlockOperations2["Round"] = 5] = "Round"; - TrigonometryBlockOperations2[TrigonometryBlockOperations2["Floor"] = 6] = "Floor"; - TrigonometryBlockOperations2[TrigonometryBlockOperations2["Ceiling"] = 7] = "Ceiling"; - TrigonometryBlockOperations2[TrigonometryBlockOperations2["Sqrt"] = 8] = "Sqrt"; - TrigonometryBlockOperations2[TrigonometryBlockOperations2["Log"] = 9] = "Log"; - TrigonometryBlockOperations2[TrigonometryBlockOperations2["Tan"] = 10] = "Tan"; - TrigonometryBlockOperations2[TrigonometryBlockOperations2["ArcTan"] = 11] = "ArcTan"; - TrigonometryBlockOperations2[TrigonometryBlockOperations2["ArcCos"] = 12] = "ArcCos"; - TrigonometryBlockOperations2[TrigonometryBlockOperations2["ArcSin"] = 13] = "ArcSin"; - TrigonometryBlockOperations2[TrigonometryBlockOperations2["Fract"] = 14] = "Fract"; - TrigonometryBlockOperations2[TrigonometryBlockOperations2["Sign"] = 15] = "Sign"; - TrigonometryBlockOperations2[TrigonometryBlockOperations2["Radians"] = 16] = "Radians"; - TrigonometryBlockOperations2[TrigonometryBlockOperations2["Degrees"] = 17] = "Degrees"; -})(TrigonometryBlockOperations || (TrigonometryBlockOperations = {})); - class TrigonometryBlock extends NodeMaterialBlock { - constructor(name4) { - super(name4, NodeMaterialBlockTargets.Neutral); + constructor(name5) { + super(name5, NodeMaterialBlockTargets.Neutral); this.operation = TrigonometryBlockOperations.Cos; this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); @@ -57518,11 +59432,36 @@ class TrigonometryBlock extends NodeMaterialBlock { return codeString; } } -RegisterClass("BABYLON.TrigonometryBlock", TrigonometryBlock); +var TrigonometryBlockOperations; +var init_trigonometryBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + (function(TrigonometryBlockOperations2) { + TrigonometryBlockOperations2[TrigonometryBlockOperations2["Cos"] = 0] = "Cos"; + TrigonometryBlockOperations2[TrigonometryBlockOperations2["Sin"] = 1] = "Sin"; + TrigonometryBlockOperations2[TrigonometryBlockOperations2["Abs"] = 2] = "Abs"; + TrigonometryBlockOperations2[TrigonometryBlockOperations2["Exp"] = 3] = "Exp"; + TrigonometryBlockOperations2[TrigonometryBlockOperations2["Exp2"] = 4] = "Exp2"; + TrigonometryBlockOperations2[TrigonometryBlockOperations2["Round"] = 5] = "Round"; + TrigonometryBlockOperations2[TrigonometryBlockOperations2["Floor"] = 6] = "Floor"; + TrigonometryBlockOperations2[TrigonometryBlockOperations2["Ceiling"] = 7] = "Ceiling"; + TrigonometryBlockOperations2[TrigonometryBlockOperations2["Sqrt"] = 8] = "Sqrt"; + TrigonometryBlockOperations2[TrigonometryBlockOperations2["Log"] = 9] = "Log"; + TrigonometryBlockOperations2[TrigonometryBlockOperations2["Tan"] = 10] = "Tan"; + TrigonometryBlockOperations2[TrigonometryBlockOperations2["ArcTan"] = 11] = "ArcTan"; + TrigonometryBlockOperations2[TrigonometryBlockOperations2["ArcCos"] = 12] = "ArcCos"; + TrigonometryBlockOperations2[TrigonometryBlockOperations2["ArcSin"] = 13] = "ArcSin"; + TrigonometryBlockOperations2[TrigonometryBlockOperations2["Fract"] = 14] = "Fract"; + TrigonometryBlockOperations2[TrigonometryBlockOperations2["Sign"] = 15] = "Sign"; + TrigonometryBlockOperations2[TrigonometryBlockOperations2["Radians"] = 16] = "Radians"; + TrigonometryBlockOperations2[TrigonometryBlockOperations2["Degrees"] = 17] = "Degrees"; + })(TrigonometryBlockOperations || (TrigonometryBlockOperations = {})); + RegisterClass("BABYLON.TrigonometryBlock", TrigonometryBlock); +}); // node_modules/@babylonjs/core/Materials/Node/nodeMaterial.js -var onCreatedEffectParameters = { effect: null, subMesh: null }; - class NodeMaterialDefines extends MaterialDefines { constructor() { super(); @@ -57573,14 +59512,14 @@ class NodeMaterialDefines extends MaterialDefines { this.CAMERA_PERSPECTIVE = false; this.rebuild(); } - setValue(name4, value, markAsUnprocessedIfDirty = false) { - if (this[name4] === undefined) { - this._keys.push(name4); + setValue(name5, value, markAsUnprocessedIfDirty = false) { + if (this[name5] === undefined) { + this._keys.push(name5); } - if (markAsUnprocessedIfDirty && this[name4] !== value) { + if (markAsUnprocessedIfDirty && this[name5] !== value) { this.markAsUnprocessed(); } - this[name4] = value; + this[name5] = value; } } @@ -57622,8 +59561,8 @@ class NodeMaterial extends PushMaterial { set buildId(value) { this._buildId = value; } - constructor(name4, scene11, options = {}) { - super(name4, scene11 || EngineStore.LastCreatedScene); + constructor(name5, scene11, options = {}) { + super(name5, scene11 || EngineStore.LastCreatedScene); this._buildId = NodeMaterial._BuildIdGenerator++; this._buildWasSuccessful = false; this._cachedWorldViewMatrix = new Matrix; @@ -57664,14 +59603,14 @@ class NodeMaterial extends PushMaterial { }); } } - getBlockByName(name4) { + getBlockByName(name5) { let result = null; for (const block of this.attachedBlocks) { - if (block.name === name4) { + if (block.name === name5) { if (!result) { result = block; } else { - Tools.Warn("More than one block was found with the name `" + name4 + "`"); + Tools.Warn("More than one block was found with the name `" + name5 + "`"); return result; } } @@ -57800,10 +59739,10 @@ class NodeMaterial extends PushMaterial { node7._preparationId = this._buildId; if (this.attachedBlocks.indexOf(node7) === -1) { if (node7.isUnique) { - const className = node7.getClassName(); + const className2 = node7.getClassName(); for (const other of this.attachedBlocks) { - if (other.getClassName() === className) { - throw `Cannot have multiple blocks of type ${className} in the same NodeMaterial`; + if (other.getClassName() === className2) { + throw `Cannot have multiple blocks of type ${className2} in the same NodeMaterial`; } } } @@ -58774,11 +60713,11 @@ class NodeMaterial extends PushMaterial { loadFromSerialization(source, rootUrl = "", merge = false) { this.parseSerializedObject(source, rootUrl, merge); } - clone(name4, shareEffect = false) { + clone(name5, shareEffect = false) { const serializationObject = this.serialize(); - const clone = SerializationHelper.Clone(() => new NodeMaterial(name4, this.getScene(), this.options), this); - clone.id = name4; - clone.name = name4; + const clone = SerializationHelper.Clone(() => new NodeMaterial(name5, this.getScene(), this.options), this); + clone.id = name5; + clone.name = name5; clone.parseSerializedObject(serializationObject); clone._buildId = this._buildId; clone.build(false, !shareEffect); @@ -58807,8 +60746,8 @@ class NodeMaterial extends PushMaterial { nodeMaterial.build(); return nodeMaterial; } - static async ParseFromFileAsync(name4, url, scene11, rootUrl = "", skipBuild = false, targetMaterial) { - const material5 = targetMaterial !== null && targetMaterial !== undefined ? targetMaterial : new NodeMaterial(name4, scene11); + static async ParseFromFileAsync(name5, url, scene11, rootUrl = "", skipBuild = false, targetMaterial) { + const material5 = targetMaterial !== null && targetMaterial !== undefined ? targetMaterial : new NodeMaterial(name5, scene11); const data = await scene11._loadFileAsync(url); const serializationObject = JSON.parse(data); material5.parseSerializedObject(serializationObject, rootUrl); @@ -58859,33 +60798,78 @@ class NodeMaterial extends PushMaterial { request.send(); }); } - static CreateDefault(name4, scene11) { - const newMaterial = new NodeMaterial(name4, scene11); + static CreateDefault(name5, scene11) { + const newMaterial = new NodeMaterial(name5, scene11); newMaterial.setToDefault(); newMaterial.build(); return newMaterial; } } -NodeMaterial._BuildIdGenerator = 0; -NodeMaterial.EditorURL = `${Tools._DefaultCdnUrl}/v${Engine2.Version}/nodeEditor/babylon.nodeEditor.js`; -NodeMaterial.SnippetUrl = `https://snippet.babylonjs.com`; -NodeMaterial.IgnoreTexturesAtLoadTime = false; -__decorate2([ - serialize() -], NodeMaterial.prototype, "ignoreAlpha", undefined); -__decorate2([ - serialize() -], NodeMaterial.prototype, "maxSimultaneousLights", undefined); -__decorate2([ - serialize("mode") -], NodeMaterial.prototype, "_mode", undefined); -__decorate2([ - serialize("comment") -], NodeMaterial.prototype, "comment", undefined); -__decorate2([ - serialize() -], NodeMaterial.prototype, "forceAlphaBlending", undefined); -RegisterClass("BABYLON.NodeMaterial", NodeMaterial); +var onCreatedEffectParameters; +var init_nodeMaterial = __esm(() => { + init_tslib_es62(); + init_pushMaterial(); + init_abstractMesh(); + init_math_vector(); + init_math_color(); + init_engine(); + init_nodeMaterialBuildState(); + init_effect(); + init_observable(); + init_nodeMaterialBlockTargets(); + init_nodeMaterialBuildStateSharedData(); + init_materialDefines(); + init_buffer(); + init_tools(); + init_transformBlock(); + init_vertexOutputBlock(); + init_fragmentOutputBlock(); + init_inputBlock(); + init_typeStore(); + init_decorators(); + init_currentScreenBlock(); + init_particleTextureBlock(); + init_particleRampGradientBlock(); + init_particleBlendMultiplyBlock(); + init_effectFallbacks(); + init_webRequest(); + init_postProcess(); + init_vectorMergerBlock(); + init_remapBlock(); + init_multiplyBlock(); + init_nodeMaterialModes(); + init_texture(); + init_baseParticleSystem(); + init_colorSplitterBlock(); + init_timingTools(); + init_proceduralTexture(); + init_animatedInputBlockTypes(); + init_trigonometryBlock(); + init_nodeMaterialSystemValues(); + init_engineStore(); + init_materialHelper(); + onCreatedEffectParameters = { effect: null, subMesh: null }; + NodeMaterial._BuildIdGenerator = 0; + NodeMaterial.EditorURL = `${Tools._DefaultCdnUrl}/v${Engine2.Version}/nodeEditor/babylon.nodeEditor.js`; + NodeMaterial.SnippetUrl = `https://snippet.babylonjs.com`; + NodeMaterial.IgnoreTexturesAtLoadTime = false; + __decorate2([ + serialize() + ], NodeMaterial.prototype, "ignoreAlpha", undefined); + __decorate2([ + serialize() + ], NodeMaterial.prototype, "maxSimultaneousLights", undefined); + __decorate2([ + serialize("mode") + ], NodeMaterial.prototype, "_mode", undefined); + __decorate2([ + serialize("comment") + ], NodeMaterial.prototype, "comment", undefined); + __decorate2([ + serialize() + ], NodeMaterial.prototype, "forceAlphaBlending", undefined); + RegisterClass("BABYLON.NodeMaterial", NodeMaterial); +}); // node_modules/@babylonjs/core/Meshes/Builders/icoSphereBuilder.js function CreateIcoSphereVertexData(options) { @@ -59167,123 +61151,36 @@ function CreateIcoSphereVertexData(options) { vertexData.uvs = uvs; return vertexData; } -function CreateIcoSphere(name4, options = {}, scene11 = null) { - const sphere = new Mesh(name4, scene11); +function CreateIcoSphere(name5, options = {}, scene11 = null) { + const sphere = new Mesh(name5, scene11); options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation); sphere._originalBuilderSideOrientation = options.sideOrientation; const vertexData = CreateIcoSphereVertexData(options); vertexData.applyToMesh(sphere, options.updatable); return sphere; } -VertexData.CreateIcoSphere = CreateIcoSphereVertexData; -Mesh.CreateIcoSphere = (name4, options, scene11) => { - return CreateIcoSphere(name4, options, scene11); -}; +var IcoSphereBuilder; +var init_icoSphereBuilder = __esm(() => { + init_math_vector(); + init_mesh(); + init_mesh_vertexData(); + init_compatibilityOptions(); + IcoSphereBuilder = { + CreateIcoSphere + }; + VertexData.CreateIcoSphere = CreateIcoSphereVertexData; + Mesh.CreateIcoSphere = (name5, options, scene11) => { + return CreateIcoSphere(name5, options, scene11); + }; +}); // node_modules/@babylonjs/core/XR/features/WebXRHandTracking.js -var HandPart; -(function(HandPart2) { - HandPart2["WRIST"] = "wrist"; - HandPart2["THUMB"] = "thumb"; - HandPart2["INDEX"] = "index"; - HandPart2["MIDDLE"] = "middle"; - HandPart2["RING"] = "ring"; - HandPart2["LITTLE"] = "little"; -})(HandPart || (HandPart = {})); -var WebXRHandJoint; -(function(WebXRHandJoint2) { - WebXRHandJoint2["WRIST"] = "wrist"; - WebXRHandJoint2["THUMB_METACARPAL"] = "thumb-metacarpal"; - WebXRHandJoint2["THUMB_PHALANX_PROXIMAL"] = "thumb-phalanx-proximal"; - WebXRHandJoint2["THUMB_PHALANX_DISTAL"] = "thumb-phalanx-distal"; - WebXRHandJoint2["THUMB_TIP"] = "thumb-tip"; - WebXRHandJoint2["INDEX_FINGER_METACARPAL"] = "index-finger-metacarpal"; - WebXRHandJoint2["INDEX_FINGER_PHALANX_PROXIMAL"] = "index-finger-phalanx-proximal"; - WebXRHandJoint2["INDEX_FINGER_PHALANX_INTERMEDIATE"] = "index-finger-phalanx-intermediate"; - WebXRHandJoint2["INDEX_FINGER_PHALANX_DISTAL"] = "index-finger-phalanx-distal"; - WebXRHandJoint2["INDEX_FINGER_TIP"] = "index-finger-tip"; - WebXRHandJoint2["MIDDLE_FINGER_METACARPAL"] = "middle-finger-metacarpal"; - WebXRHandJoint2["MIDDLE_FINGER_PHALANX_PROXIMAL"] = "middle-finger-phalanx-proximal"; - WebXRHandJoint2["MIDDLE_FINGER_PHALANX_INTERMEDIATE"] = "middle-finger-phalanx-intermediate"; - WebXRHandJoint2["MIDDLE_FINGER_PHALANX_DISTAL"] = "middle-finger-phalanx-distal"; - WebXRHandJoint2["MIDDLE_FINGER_TIP"] = "middle-finger-tip"; - WebXRHandJoint2["RING_FINGER_METACARPAL"] = "ring-finger-metacarpal"; - WebXRHandJoint2["RING_FINGER_PHALANX_PROXIMAL"] = "ring-finger-phalanx-proximal"; - WebXRHandJoint2["RING_FINGER_PHALANX_INTERMEDIATE"] = "ring-finger-phalanx-intermediate"; - WebXRHandJoint2["RING_FINGER_PHALANX_DISTAL"] = "ring-finger-phalanx-distal"; - WebXRHandJoint2["RING_FINGER_TIP"] = "ring-finger-tip"; - WebXRHandJoint2["PINKY_FINGER_METACARPAL"] = "pinky-finger-metacarpal"; - WebXRHandJoint2["PINKY_FINGER_PHALANX_PROXIMAL"] = "pinky-finger-phalanx-proximal"; - WebXRHandJoint2["PINKY_FINGER_PHALANX_INTERMEDIATE"] = "pinky-finger-phalanx-intermediate"; - WebXRHandJoint2["PINKY_FINGER_PHALANX_DISTAL"] = "pinky-finger-phalanx-distal"; - WebXRHandJoint2["PINKY_FINGER_TIP"] = "pinky-finger-tip"; -})(WebXRHandJoint || (WebXRHandJoint = {})); -var handJointReferenceArray = [ - WebXRHandJoint.WRIST, - WebXRHandJoint.THUMB_METACARPAL, - WebXRHandJoint.THUMB_PHALANX_PROXIMAL, - WebXRHandJoint.THUMB_PHALANX_DISTAL, - WebXRHandJoint.THUMB_TIP, - WebXRHandJoint.INDEX_FINGER_METACARPAL, - WebXRHandJoint.INDEX_FINGER_PHALANX_PROXIMAL, - WebXRHandJoint.INDEX_FINGER_PHALANX_INTERMEDIATE, - WebXRHandJoint.INDEX_FINGER_PHALANX_DISTAL, - WebXRHandJoint.INDEX_FINGER_TIP, - WebXRHandJoint.MIDDLE_FINGER_METACARPAL, - WebXRHandJoint.MIDDLE_FINGER_PHALANX_PROXIMAL, - WebXRHandJoint.MIDDLE_FINGER_PHALANX_INTERMEDIATE, - WebXRHandJoint.MIDDLE_FINGER_PHALANX_DISTAL, - WebXRHandJoint.MIDDLE_FINGER_TIP, - WebXRHandJoint.RING_FINGER_METACARPAL, - WebXRHandJoint.RING_FINGER_PHALANX_PROXIMAL, - WebXRHandJoint.RING_FINGER_PHALANX_INTERMEDIATE, - WebXRHandJoint.RING_FINGER_PHALANX_DISTAL, - WebXRHandJoint.RING_FINGER_TIP, - WebXRHandJoint.PINKY_FINGER_METACARPAL, - WebXRHandJoint.PINKY_FINGER_PHALANX_PROXIMAL, - WebXRHandJoint.PINKY_FINGER_PHALANX_INTERMEDIATE, - WebXRHandJoint.PINKY_FINGER_PHALANX_DISTAL, - WebXRHandJoint.PINKY_FINGER_TIP -]; -var handPartsDefinition = { - [HandPart.WRIST]: [WebXRHandJoint.WRIST], - [HandPart.THUMB]: [WebXRHandJoint.THUMB_METACARPAL, WebXRHandJoint.THUMB_PHALANX_PROXIMAL, WebXRHandJoint.THUMB_PHALANX_DISTAL, WebXRHandJoint.THUMB_TIP], - [HandPart.INDEX]: [ - WebXRHandJoint.INDEX_FINGER_METACARPAL, - WebXRHandJoint.INDEX_FINGER_PHALANX_PROXIMAL, - WebXRHandJoint.INDEX_FINGER_PHALANX_INTERMEDIATE, - WebXRHandJoint.INDEX_FINGER_PHALANX_DISTAL, - WebXRHandJoint.INDEX_FINGER_TIP - ], - [HandPart.MIDDLE]: [ - WebXRHandJoint.MIDDLE_FINGER_METACARPAL, - WebXRHandJoint.MIDDLE_FINGER_PHALANX_PROXIMAL, - WebXRHandJoint.MIDDLE_FINGER_PHALANX_INTERMEDIATE, - WebXRHandJoint.MIDDLE_FINGER_PHALANX_DISTAL, - WebXRHandJoint.MIDDLE_FINGER_TIP - ], - [HandPart.RING]: [ - WebXRHandJoint.RING_FINGER_METACARPAL, - WebXRHandJoint.RING_FINGER_PHALANX_PROXIMAL, - WebXRHandJoint.RING_FINGER_PHALANX_INTERMEDIATE, - WebXRHandJoint.RING_FINGER_PHALANX_DISTAL, - WebXRHandJoint.RING_FINGER_TIP - ], - [HandPart.LITTLE]: [ - WebXRHandJoint.PINKY_FINGER_METACARPAL, - WebXRHandJoint.PINKY_FINGER_PHALANX_PROXIMAL, - WebXRHandJoint.PINKY_FINGER_PHALANX_INTERMEDIATE, - WebXRHandJoint.PINKY_FINGER_PHALANX_DISTAL, - WebXRHandJoint.PINKY_FINGER_TIP - ] -}; - class WebXRHand { get handMesh() { return this._handMesh; } getHandPartMeshes(part) { - return handPartsDefinition[part].map((name4) => this._jointMeshes[handJointReferenceArray.indexOf(name4)]); + return handPartsDefinition[part].map((name5) => this._jointMeshes[handJointReferenceArray.indexOf(name5)]); } getJointMesh(jointName) { return this._jointMeshes[handJointReferenceArray.indexOf(jointName)]; @@ -59659,39 +61556,343 @@ class WebXRHandTracking extends WebXRAbstractFeature { } } } -WebXRHandTracking.Name = WebXRFeatureName.HAND_TRACKING; -WebXRHandTracking.Version = 1; -WebXRHandTracking.DEFAULT_HAND_MODEL_BASE_URL = "https://assets.babylonjs.com/meshes/HandMeshes/"; -WebXRHandTracking.DEFAULT_HAND_MODEL_RIGHT_FILENAME = "r_hand_rhs.glb"; -WebXRHandTracking.DEFAULT_HAND_MODEL_LEFT_FILENAME = "l_hand_rhs.glb"; -WebXRHandTracking.DEFAULT_HAND_MODEL_SHADER_URL = "https://assets.babylonjs.com/meshes/HandMeshes/handsShader.json"; -WebXRHandTracking._ICOSPHERE_PARAMS = { radius: 0.5, flat: false, subdivisions: 2 }; -WebXRHandTracking._RightHandGLB = null; -WebXRHandTracking._LeftHandGLB = null; -WebXRFeaturesManager.AddWebXRFeature(WebXRHandTracking.Name, (xrSessionManager, options) => { - return () => new WebXRHandTracking(xrSessionManager, options); -}, WebXRHandTracking.Version, false); +var HandPart, WebXRHandJoint, handJointReferenceArray, handPartsDefinition; +var init_WebXRHandTracking = __esm(() => { + init_WebXRAbstractFeature(); + init_webXRFeaturesManager(); + init_math_vector(); + init_physicsImpostor(); + init_observable(); + init_sceneLoader(); + init_math_color(); + init_nodeMaterial(); + init_material(); + init_icoSphereBuilder(); + init_transformNode(); + init_math_axis(); + init_engineStore(); + (function(HandPart2) { + HandPart2["WRIST"] = "wrist"; + HandPart2["THUMB"] = "thumb"; + HandPart2["INDEX"] = "index"; + HandPart2["MIDDLE"] = "middle"; + HandPart2["RING"] = "ring"; + HandPart2["LITTLE"] = "little"; + })(HandPart || (HandPart = {})); + (function(WebXRHandJoint2) { + WebXRHandJoint2["WRIST"] = "wrist"; + WebXRHandJoint2["THUMB_METACARPAL"] = "thumb-metacarpal"; + WebXRHandJoint2["THUMB_PHALANX_PROXIMAL"] = "thumb-phalanx-proximal"; + WebXRHandJoint2["THUMB_PHALANX_DISTAL"] = "thumb-phalanx-distal"; + WebXRHandJoint2["THUMB_TIP"] = "thumb-tip"; + WebXRHandJoint2["INDEX_FINGER_METACARPAL"] = "index-finger-metacarpal"; + WebXRHandJoint2["INDEX_FINGER_PHALANX_PROXIMAL"] = "index-finger-phalanx-proximal"; + WebXRHandJoint2["INDEX_FINGER_PHALANX_INTERMEDIATE"] = "index-finger-phalanx-intermediate"; + WebXRHandJoint2["INDEX_FINGER_PHALANX_DISTAL"] = "index-finger-phalanx-distal"; + WebXRHandJoint2["INDEX_FINGER_TIP"] = "index-finger-tip"; + WebXRHandJoint2["MIDDLE_FINGER_METACARPAL"] = "middle-finger-metacarpal"; + WebXRHandJoint2["MIDDLE_FINGER_PHALANX_PROXIMAL"] = "middle-finger-phalanx-proximal"; + WebXRHandJoint2["MIDDLE_FINGER_PHALANX_INTERMEDIATE"] = "middle-finger-phalanx-intermediate"; + WebXRHandJoint2["MIDDLE_FINGER_PHALANX_DISTAL"] = "middle-finger-phalanx-distal"; + WebXRHandJoint2["MIDDLE_FINGER_TIP"] = "middle-finger-tip"; + WebXRHandJoint2["RING_FINGER_METACARPAL"] = "ring-finger-metacarpal"; + WebXRHandJoint2["RING_FINGER_PHALANX_PROXIMAL"] = "ring-finger-phalanx-proximal"; + WebXRHandJoint2["RING_FINGER_PHALANX_INTERMEDIATE"] = "ring-finger-phalanx-intermediate"; + WebXRHandJoint2["RING_FINGER_PHALANX_DISTAL"] = "ring-finger-phalanx-distal"; + WebXRHandJoint2["RING_FINGER_TIP"] = "ring-finger-tip"; + WebXRHandJoint2["PINKY_FINGER_METACARPAL"] = "pinky-finger-metacarpal"; + WebXRHandJoint2["PINKY_FINGER_PHALANX_PROXIMAL"] = "pinky-finger-phalanx-proximal"; + WebXRHandJoint2["PINKY_FINGER_PHALANX_INTERMEDIATE"] = "pinky-finger-phalanx-intermediate"; + WebXRHandJoint2["PINKY_FINGER_PHALANX_DISTAL"] = "pinky-finger-phalanx-distal"; + WebXRHandJoint2["PINKY_FINGER_TIP"] = "pinky-finger-tip"; + })(WebXRHandJoint || (WebXRHandJoint = {})); + handJointReferenceArray = [ + WebXRHandJoint.WRIST, + WebXRHandJoint.THUMB_METACARPAL, + WebXRHandJoint.THUMB_PHALANX_PROXIMAL, + WebXRHandJoint.THUMB_PHALANX_DISTAL, + WebXRHandJoint.THUMB_TIP, + WebXRHandJoint.INDEX_FINGER_METACARPAL, + WebXRHandJoint.INDEX_FINGER_PHALANX_PROXIMAL, + WebXRHandJoint.INDEX_FINGER_PHALANX_INTERMEDIATE, + WebXRHandJoint.INDEX_FINGER_PHALANX_DISTAL, + WebXRHandJoint.INDEX_FINGER_TIP, + WebXRHandJoint.MIDDLE_FINGER_METACARPAL, + WebXRHandJoint.MIDDLE_FINGER_PHALANX_PROXIMAL, + WebXRHandJoint.MIDDLE_FINGER_PHALANX_INTERMEDIATE, + WebXRHandJoint.MIDDLE_FINGER_PHALANX_DISTAL, + WebXRHandJoint.MIDDLE_FINGER_TIP, + WebXRHandJoint.RING_FINGER_METACARPAL, + WebXRHandJoint.RING_FINGER_PHALANX_PROXIMAL, + WebXRHandJoint.RING_FINGER_PHALANX_INTERMEDIATE, + WebXRHandJoint.RING_FINGER_PHALANX_DISTAL, + WebXRHandJoint.RING_FINGER_TIP, + WebXRHandJoint.PINKY_FINGER_METACARPAL, + WebXRHandJoint.PINKY_FINGER_PHALANX_PROXIMAL, + WebXRHandJoint.PINKY_FINGER_PHALANX_INTERMEDIATE, + WebXRHandJoint.PINKY_FINGER_PHALANX_DISTAL, + WebXRHandJoint.PINKY_FINGER_TIP + ]; + handPartsDefinition = { + [HandPart.WRIST]: [WebXRHandJoint.WRIST], + [HandPart.THUMB]: [WebXRHandJoint.THUMB_METACARPAL, WebXRHandJoint.THUMB_PHALANX_PROXIMAL, WebXRHandJoint.THUMB_PHALANX_DISTAL, WebXRHandJoint.THUMB_TIP], + [HandPart.INDEX]: [ + WebXRHandJoint.INDEX_FINGER_METACARPAL, + WebXRHandJoint.INDEX_FINGER_PHALANX_PROXIMAL, + WebXRHandJoint.INDEX_FINGER_PHALANX_INTERMEDIATE, + WebXRHandJoint.INDEX_FINGER_PHALANX_DISTAL, + WebXRHandJoint.INDEX_FINGER_TIP + ], + [HandPart.MIDDLE]: [ + WebXRHandJoint.MIDDLE_FINGER_METACARPAL, + WebXRHandJoint.MIDDLE_FINGER_PHALANX_PROXIMAL, + WebXRHandJoint.MIDDLE_FINGER_PHALANX_INTERMEDIATE, + WebXRHandJoint.MIDDLE_FINGER_PHALANX_DISTAL, + WebXRHandJoint.MIDDLE_FINGER_TIP + ], + [HandPart.RING]: [ + WebXRHandJoint.RING_FINGER_METACARPAL, + WebXRHandJoint.RING_FINGER_PHALANX_PROXIMAL, + WebXRHandJoint.RING_FINGER_PHALANX_INTERMEDIATE, + WebXRHandJoint.RING_FINGER_PHALANX_DISTAL, + WebXRHandJoint.RING_FINGER_TIP + ], + [HandPart.LITTLE]: [ + WebXRHandJoint.PINKY_FINGER_METACARPAL, + WebXRHandJoint.PINKY_FINGER_PHALANX_PROXIMAL, + WebXRHandJoint.PINKY_FINGER_PHALANX_INTERMEDIATE, + WebXRHandJoint.PINKY_FINGER_PHALANX_DISTAL, + WebXRHandJoint.PINKY_FINGER_TIP + ] + }; + WebXRHandTracking.Name = WebXRFeatureName.HAND_TRACKING; + WebXRHandTracking.Version = 1; + WebXRHandTracking.DEFAULT_HAND_MODEL_BASE_URL = "https://assets.babylonjs.com/meshes/HandMeshes/"; + WebXRHandTracking.DEFAULT_HAND_MODEL_RIGHT_FILENAME = "r_hand_rhs.glb"; + WebXRHandTracking.DEFAULT_HAND_MODEL_LEFT_FILENAME = "l_hand_rhs.glb"; + WebXRHandTracking.DEFAULT_HAND_MODEL_SHADER_URL = "https://assets.babylonjs.com/meshes/HandMeshes/handsShader.json"; + WebXRHandTracking._ICOSPHERE_PARAMS = { radius: 0.5, flat: false, subdivisions: 2 }; + WebXRHandTracking._RightHandGLB = null; + WebXRHandTracking._LeftHandGLB = null; + WebXRFeaturesManager.AddWebXRFeature(WebXRHandTracking.Name, (xrSessionManager, options) => { + return () => new WebXRHandTracking(xrSessionManager, options); + }, WebXRHandTracking.Version, false); +}); // node_modules/@babylonjs/core/Behaviors/Meshes/handConstraintBehavior.js -var HandConstraintZone; -(function(HandConstraintZone2) { - HandConstraintZone2[HandConstraintZone2["ABOVE_FINGER_TIPS"] = 0] = "ABOVE_FINGER_TIPS"; - HandConstraintZone2[HandConstraintZone2["RADIAL_SIDE"] = 1] = "RADIAL_SIDE"; - HandConstraintZone2[HandConstraintZone2["ULNAR_SIDE"] = 2] = "ULNAR_SIDE"; - HandConstraintZone2[HandConstraintZone2["BELOW_WRIST"] = 3] = "BELOW_WRIST"; -})(HandConstraintZone || (HandConstraintZone = {})); -var HandConstraintOrientation; -(function(HandConstraintOrientation2) { - HandConstraintOrientation2[HandConstraintOrientation2["LOOK_AT_CAMERA"] = 0] = "LOOK_AT_CAMERA"; - HandConstraintOrientation2[HandConstraintOrientation2["HAND_ROTATION"] = 1] = "HAND_ROTATION"; -})(HandConstraintOrientation || (HandConstraintOrientation = {})); -var HandConstraintVisibility; -(function(HandConstraintVisibility2) { - HandConstraintVisibility2[HandConstraintVisibility2["ALWAYS_VISIBLE"] = 0] = "ALWAYS_VISIBLE"; - HandConstraintVisibility2[HandConstraintVisibility2["PALM_UP"] = 1] = "PALM_UP"; - HandConstraintVisibility2[HandConstraintVisibility2["GAZE_FOCUS"] = 2] = "GAZE_FOCUS"; - HandConstraintVisibility2[HandConstraintVisibility2["PALM_AND_GAZE"] = 3] = "PALM_AND_GAZE"; -})(HandConstraintVisibility || (HandConstraintVisibility = {})); +class HandConstraintBehavior { + constructor() { + this._sceneRenderObserver = null; + this._zoneAxis = {}; + this.handConstraintVisibility = HandConstraintVisibility.PALM_AND_GAZE; + this.palmUpStrictness = 0.95; + this.gazeProximityRadius = 0.15; + this.targetOffset = 0.1; + this.targetZone = HandConstraintZone.ULNAR_SIDE; + this.zoneOrientationMode = HandConstraintOrientation.HAND_ROTATION; + this.nodeOrientationMode = HandConstraintOrientation.HAND_ROTATION; + this.handedness = "none"; + this.lerpTime = 100; + this._zoneAxis[HandConstraintZone.ABOVE_FINGER_TIPS] = new Vector3(0, 1, 0); + this._zoneAxis[HandConstraintZone.RADIAL_SIDE] = new Vector3(-1, 0, 0); + this._zoneAxis[HandConstraintZone.ULNAR_SIDE] = new Vector3(1, 0, 0); + this._zoneAxis[HandConstraintZone.BELOW_WRIST] = new Vector3(0, -1, 0); + } + get name() { + return "HandConstraint"; + } + enable() { + this._node.setEnabled(true); + } + disable() { + this._node.setEnabled(false); + } + _getHandPose() { + if (!this._handTracking) { + return null; + } + let hand; + if (this.handedness === "none") { + hand = this._handTracking.getHandByHandedness("left") || this._handTracking.getHandByHandedness("right"); + } else { + hand = this._handTracking.getHandByHandedness(this.handedness); + } + if (hand) { + const pinkyMetacarpal = hand.getJointMesh(WebXRHandJoint.PINKY_FINGER_METACARPAL); + const middleMetacarpal = hand.getJointMesh(WebXRHandJoint.MIDDLE_FINGER_METACARPAL); + const wrist = hand.getJointMesh(WebXRHandJoint.WRIST); + if (wrist && middleMetacarpal && pinkyMetacarpal) { + const handPose = { position: middleMetacarpal.absolutePosition, quaternion: new Quaternion, id: hand.xrController.uniqueId }; + const up = TmpVectors.Vector3[0]; + const forward = TmpVectors.Vector3[1]; + const left = TmpVectors.Vector3[2]; + up.copyFrom(middleMetacarpal.absolutePosition).subtractInPlace(wrist.absolutePosition).normalize(); + forward.copyFrom(pinkyMetacarpal.absolutePosition).subtractInPlace(middleMetacarpal.absolutePosition).normalize(); + Vector3.CrossToRef(up, forward, forward); + Vector3.CrossToRef(forward, up, left); + Quaternion.FromLookDirectionLHToRef(forward, up, handPose.quaternion); + return handPose; + } + } + return null; + } + init() { + } + attach(node7) { + this._node = node7; + this._scene = node7.getScene(); + if (!this._node.rotationQuaternion) { + this._node.rotationQuaternion = Quaternion.RotationYawPitchRoll(this._node.rotation.y, this._node.rotation.x, this._node.rotation.z); + } + let lastTick = Date.now(); + this._sceneRenderObserver = this._scene.onBeforeRenderObservable.add(() => { + const pose = this._getHandPose(); + this._node.reservedDataStore = this._node.reservedDataStore || {}; + this._node.reservedDataStore.nearInteraction = this._node.reservedDataStore.nearInteraction || {}; + this._node.reservedDataStore.nearInteraction.excludedControllerId = null; + if (pose) { + const zoneOffset = TmpVectors.Vector3[0]; + const camera6 = this._scene.activeCamera; + zoneOffset.copyFrom(this._zoneAxis[this.targetZone]); + const cameraLookAtQuaternion = TmpVectors.Quaternion[0]; + if (camera6 && (this.zoneOrientationMode === HandConstraintOrientation.LOOK_AT_CAMERA || this.nodeOrientationMode === HandConstraintOrientation.LOOK_AT_CAMERA)) { + const toCamera = TmpVectors.Vector3[1]; + toCamera.copyFrom(camera6.position).subtractInPlace(pose.position).normalize(); + if (this._scene.useRightHandedSystem) { + Quaternion.FromLookDirectionRHToRef(toCamera, Vector3.UpReadOnly, cameraLookAtQuaternion); + } else { + Quaternion.FromLookDirectionLHToRef(toCamera, Vector3.UpReadOnly, cameraLookAtQuaternion); + } + } + if (this.zoneOrientationMode === HandConstraintOrientation.HAND_ROTATION) { + pose.quaternion.toRotationMatrix(TmpVectors.Matrix[0]); + } else { + cameraLookAtQuaternion.toRotationMatrix(TmpVectors.Matrix[0]); + } + Vector3.TransformNormalToRef(zoneOffset, TmpVectors.Matrix[0], zoneOffset); + zoneOffset.scaleInPlace(this.targetOffset); + const targetPosition = TmpVectors.Vector3[2]; + const targetRotation = TmpVectors.Quaternion[1]; + targetPosition.copyFrom(pose.position).addInPlace(zoneOffset); + if (this.nodeOrientationMode === HandConstraintOrientation.HAND_ROTATION) { + targetRotation.copyFrom(pose.quaternion); + } else { + targetRotation.copyFrom(cameraLookAtQuaternion); + } + const elapsed = Date.now() - lastTick; + Vector3.SmoothToRef(this._node.position, targetPosition, elapsed, this.lerpTime, this._node.position); + Quaternion.SmoothToRef(this._node.rotationQuaternion, targetRotation, elapsed, this.lerpTime, this._node.rotationQuaternion); + this._node.reservedDataStore.nearInteraction.excludedControllerId = pose.id; + } + this._setVisibility(pose); + lastTick = Date.now(); + }); + } + _setVisibility(pose) { + let palmVisible = true; + let gazeVisible = true; + const camera6 = this._scene.activeCamera; + if (camera6) { + const cameraForward = camera6.getForwardRay(); + if (this.handConstraintVisibility === HandConstraintVisibility.GAZE_FOCUS || this.handConstraintVisibility === HandConstraintVisibility.PALM_AND_GAZE) { + gazeVisible = false; + let gaze; + if (this._eyeTracking) { + gaze = this._eyeTracking.getEyeGaze(); + } + gaze = gaze || cameraForward; + const gazeToBehavior = TmpVectors.Vector3[0]; + if (pose) { + pose.position.subtractToRef(gaze.origin, gazeToBehavior); + } else { + this._node.getAbsolutePosition().subtractToRef(gaze.origin, gazeToBehavior); + } + const projectedDistance = Vector3.Dot(gazeToBehavior, gaze.direction); + const projectedSquared = projectedDistance * projectedDistance; + if (projectedDistance > 0) { + const radiusSquared = gazeToBehavior.lengthSquared() - projectedSquared; + if (radiusSquared < this.gazeProximityRadius * this.gazeProximityRadius) { + gazeVisible = true; + } + } + } + if (this.handConstraintVisibility === HandConstraintVisibility.PALM_UP || this.handConstraintVisibility === HandConstraintVisibility.PALM_AND_GAZE) { + palmVisible = false; + if (pose) { + const palmDirection = TmpVectors.Vector3[0]; + Vector3.LeftHandedForwardReadOnly.rotateByQuaternionToRef(pose.quaternion, palmDirection); + if (Vector3.Dot(palmDirection, cameraForward.direction) > this.palmUpStrictness * 2 - 1) { + palmVisible = true; + } + } + } + } + this._node.setEnabled(palmVisible && gazeVisible); + } + detach() { + this._scene.onBeforeRenderObservable.remove(this._sceneRenderObserver); + } + linkToXRExperience(xr) { + const featuresManager = xr.featuresManager ? xr.featuresManager : xr; + if (!featuresManager) { + Tools.Error("XR features manager must be available or provided directly for the Hand Menu to work"); + } else { + try { + this._eyeTracking = featuresManager.getEnabledFeature(WebXRFeatureName.EYE_TRACKING); + } catch (_a) { + } + try { + this._handTracking = featuresManager.getEnabledFeature(WebXRFeatureName.HAND_TRACKING); + } catch (_b) { + Tools.Error("Hand tracking must be enabled for the Hand Menu to work"); + } + } + } +} +var HandConstraintZone, HandConstraintOrientation, HandConstraintVisibility; +var init_handConstraintBehavior = __esm(() => { + init_webXRFeaturesManager(); + init_WebXRHandTracking(); + init_math_vector(); + init_tools(); + (function(HandConstraintZone2) { + HandConstraintZone2[HandConstraintZone2["ABOVE_FINGER_TIPS"] = 0] = "ABOVE_FINGER_TIPS"; + HandConstraintZone2[HandConstraintZone2["RADIAL_SIDE"] = 1] = "RADIAL_SIDE"; + HandConstraintZone2[HandConstraintZone2["ULNAR_SIDE"] = 2] = "ULNAR_SIDE"; + HandConstraintZone2[HandConstraintZone2["BELOW_WRIST"] = 3] = "BELOW_WRIST"; + })(HandConstraintZone || (HandConstraintZone = {})); + (function(HandConstraintOrientation2) { + HandConstraintOrientation2[HandConstraintOrientation2["LOOK_AT_CAMERA"] = 0] = "LOOK_AT_CAMERA"; + HandConstraintOrientation2[HandConstraintOrientation2["HAND_ROTATION"] = 1] = "HAND_ROTATION"; + })(HandConstraintOrientation || (HandConstraintOrientation = {})); + (function(HandConstraintVisibility2) { + HandConstraintVisibility2[HandConstraintVisibility2["ALWAYS_VISIBLE"] = 0] = "ALWAYS_VISIBLE"; + HandConstraintVisibility2[HandConstraintVisibility2["PALM_UP"] = 1] = "PALM_UP"; + HandConstraintVisibility2[HandConstraintVisibility2["GAZE_FOCUS"] = 2] = "GAZE_FOCUS"; + HandConstraintVisibility2[HandConstraintVisibility2["PALM_AND_GAZE"] = 3] = "PALM_AND_GAZE"; + })(HandConstraintVisibility || (HandConstraintVisibility = {})); +}); + +// node_modules/@babylonjs/core/Behaviors/Meshes/index.js +var init_Meshes = __esm(() => { + init_attachToBoxBehavior(); + init_fadeInOutBehavior(); + init_multiPointerScaleBehavior(); + init_pointerDragBehavior(); + init_sixDofDragBehavior(); + init_surfaceMagnetismBehavior(); + init_baseSixDofDragBehavior(); + init_followBehavior(); + init_handConstraintBehavior(); +}); + +// node_modules/@babylonjs/core/Behaviors/index.js +var init_Behaviors = __esm(() => { + init_behavior(); + init_Cameras(); + init_Meshes(); +}); + // node_modules/@babylonjs/core/Bones/boneIKController.js class BoneIKController { get maxAngle() { @@ -59910,9 +62111,15 @@ class BoneIKController { } } } -BoneIKController._TmpVecs = [Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero()]; -BoneIKController._TmpQuat = Quaternion.Identity(); -BoneIKController._TmpMats = [Matrix.Identity(), Matrix.Identity()]; +var init_boneIKController = __esm(() => { + init_math_vector(); + init_math_axis(); + init_logger(); + BoneIKController._TmpVecs = [Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero()]; + BoneIKController._TmpQuat = Quaternion.Identity(); + BoneIKController._TmpMats = [Matrix.Identity(), Matrix.Identity()]; +}); + // node_modules/@babylonjs/core/Bones/boneLookController.js class BoneLookController { get minYaw() { @@ -60286,9 +62493,15 @@ class BoneLookController { } } } -BoneLookController._TmpVecs = ArrayTools.BuildArray(10, Vector3.Zero); -BoneLookController._TmpQuat = Quaternion.Identity(); -BoneLookController._TmpMats = ArrayTools.BuildArray(5, Matrix.Identity); +var init_boneLookController = __esm(() => { + init_arrayTools(); + init_math_vector(); + init_math_axis(); + BoneLookController._TmpVecs = ArrayTools.BuildArray(10, Vector3.Zero); + BoneLookController._TmpQuat = Quaternion.Identity(); + BoneLookController._TmpMats = ArrayTools.BuildArray(5, Matrix.Identity); +}); + // node_modules/@babylonjs/core/Bones/skeleton.js class Skeleton { get useTextureToStoreBoneMatrices() { @@ -60313,8 +62526,8 @@ class Skeleton { get uniqueId() { return this._uniqueId; } - constructor(name4, id, scene11) { - this.name = name4; + constructor(name5, id, scene11) { + this.name = name5; this.id = id; this.bones = []; this.needInitialSkinMatrix = false; @@ -60374,56 +62587,56 @@ class Skeleton { if (fullDetails) { ret += ", Ranges: {"; let first = true; - for (const name4 in this._ranges) { + for (const name5 in this._ranges) { if (first) { ret += ", "; first = false; } - ret += name4; + ret += name5; } ret += "}"; } return ret; } - getBoneIndexByName(name4) { + getBoneIndexByName(name5) { for (let boneIndex = 0, cache = this.bones.length;boneIndex < cache; boneIndex++) { - if (this.bones[boneIndex].name === name4) { + if (this.bones[boneIndex].name === name5) { return boneIndex; } } return -1; } - createAnimationRange(name4, from, to) { - if (!this._ranges[name4]) { - this._ranges[name4] = new AnimationRange(name4, from, to); + createAnimationRange(name5, from, to) { + if (!this._ranges[name5]) { + this._ranges[name5] = new AnimationRange(name5, from, to); for (let i = 0, nBones = this.bones.length;i < nBones; i++) { if (this.bones[i].animations[0]) { - this.bones[i].animations[0].createRange(name4, from, to); + this.bones[i].animations[0].createRange(name5, from, to); } } } } - deleteAnimationRange(name4, deleteFrames = true) { + deleteAnimationRange(name5, deleteFrames = true) { for (let i = 0, nBones = this.bones.length;i < nBones; i++) { if (this.bones[i].animations[0]) { - this.bones[i].animations[0].deleteRange(name4, deleteFrames); + this.bones[i].animations[0].deleteRange(name5, deleteFrames); } } - this._ranges[name4] = null; + this._ranges[name5] = null; } - getAnimationRange(name4) { - return this._ranges[name4] || null; + getAnimationRange(name5) { + return this._ranges[name5] || null; } getAnimationRanges() { const animationRanges = []; - let name4; - for (name4 in this._ranges) { - animationRanges.push(this._ranges[name4]); + let name5; + for (name5 in this._ranges) { + animationRanges.push(this._ranges[name5]); } return animationRanges; } - copyAnimationRange(source, name4, rescaleAsRequired = false) { - if (this._ranges[name4] || !source.getAnimationRange(name4)) { + copyAnimationRange(source, name5, rescaleAsRequired = false) { + if (this._ranges[name5] || !source.getAnimationRange(name5)) { return false; } let ret = true; @@ -60444,15 +62657,15 @@ class Skeleton { const boneName = this.bones[i].name; const sourceBone = boneDict[boneName]; if (sourceBone) { - ret = ret && this.bones[i].copyAnimationRange(sourceBone, name4, frameOffset, rescaleAsRequired, skelDimensionsRatio); + ret = ret && this.bones[i].copyAnimationRange(sourceBone, name5, frameOffset, rescaleAsRequired, skelDimensionsRatio); } else { Logger.Warn("copyAnimationRange: not same rig, missing source bone " + boneName); ret = false; } } - const range = source.getAnimationRange(name4); + const range = source.getAnimationRange(name5); if (range) { - this._ranges[name4] = new AnimationRange(name4, range.from + frameOffset, range.to + frameOffset); + this._ranges[name5] = new AnimationRange(name5, range.from + frameOffset, range.to + frameOffset); } return ret; } @@ -60475,8 +62688,8 @@ class Skeleton { } return ret; } - beginAnimation(name4, loop, speedRatio, onAnimationEnd) { - const range = this.getAnimationRange(name4); + beginAnimation(name5, loop, speedRatio, onAnimationEnd) { + const range = this.getAnimationRange(name5); if (!range) { return null; } @@ -60633,8 +62846,8 @@ class Skeleton { } return this._animatables; } - clone(name4, id) { - const result = new Skeleton(name4, id || name4, this._scene); + clone(name5, id) { + const result = new Skeleton(name5, id || name5, this._scene); result.needInitialSkinMatrix = this.needInitialSkinMatrix; for (let index = 0;index < this.bones.length; index++) { const source = this.bones[index]; @@ -60721,13 +62934,13 @@ class Skeleton { serializedBone.animation = bone3.animations[0].serialize(); } serializationObject.ranges = []; - for (const name4 in this._ranges) { - const source = this._ranges[name4]; + for (const name5 in this._ranges) { + const source = this._ranges[name5]; if (!source) { continue; } const range = {}; - range.name = name4; + range.name = name5; range.from = source.from; range.to = source.to; serializationObject.ranges.push(range); @@ -60823,6 +63036,26 @@ class Skeleton { }); } } +var init_skeleton = __esm(() => { + init_bone(); + init_observable(); + init_math_vector(); + init_rawTexture(); + init_animation(); + init_animationRange(); + init_engineStore(); + init_logger(); + init_deepCopier(); +}); + +// node_modules/@babylonjs/core/Bones/index.js +var init_Bones = __esm(() => { + init_bone(); + init_boneIKController(); + init_boneLookController(); + init_skeleton(); +}); + // node_modules/@babylonjs/core/Buffers/storageBuffer.js class StorageBuffer { constructor(engine11, size, creationFlags = 3, label) { @@ -60862,117 +63095,133 @@ class StorageBuffer { this._buffer = null; } } -// node_modules/@babylonjs/core/Buffers/buffer.align.js -var isLittleEndian = (() => { - const array = new Uint8Array(4); - const view = new Uint32Array(array.buffer); - return !!((view[0] = 1) & array[0]); -})(); -Object.defineProperty(VertexBuffer.prototype, "effectiveByteStride", { - get: function() { - return this._alignedBuffer && this._alignedBuffer.byteStride || this.byteStride; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(VertexBuffer.prototype, "effectiveByteOffset", { - get: function() { - return this._alignedBuffer ? 0 : this.byteOffset; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(VertexBuffer.prototype, "effectiveBuffer", { - get: function() { - return this._alignedBuffer && this._alignedBuffer.getBuffer() || this._buffer.getBuffer(); - }, - enumerable: true, - configurable: true +var init_storageBuffer = __esm(() => { }); -VertexBuffer.prototype._rebuild = function() { - var _a, _b; - (_a = this._buffer) === null || _a === undefined || _a._rebuild(); - (_b = this._alignedBuffer) === null || _b === undefined || _b._rebuild(); -}; -VertexBuffer.prototype.dispose = function() { - var _a; - if (this._ownsBuffer) { - this._buffer.dispose(); - } - (_a = this._alignedBuffer) === null || _a === undefined || _a.dispose(); - this._alignedBuffer = undefined; - this._isDisposed = true; -}; -VertexBuffer.prototype._alignBuffer = function() { - var _a, _b; - const data = this._buffer.getData(); - if (!this.engine._features.forceVertexBufferStrideMultiple4Bytes || this.byteStride % 4 === 0 || !data) { - return; - } - const typeByteLength = VertexBuffer.GetTypeByteLength(this.type); - const alignedByteStride = this.byteStride + 3 & ~3; - const alignedSize = alignedByteStride / typeByteLength; - const totalVertices = this.totalVertices; - const totalByteLength = totalVertices * alignedByteStride; - const totalLength = totalByteLength / typeByteLength; - let sourceData; - if (Array.isArray(data)) { - const sourceDataAsFloat = new Float32Array(data); - sourceData = new DataView(sourceDataAsFloat.buffer, sourceDataAsFloat.byteOffset, sourceDataAsFloat.byteLength); - } else if (data instanceof ArrayBuffer) { - sourceData = new DataView(data, 0, data.byteLength); - } else { - sourceData = new DataView(data.buffer, data.byteOffset, data.byteLength); - } - let alignedData; - if (this.type === VertexBuffer.BYTE) { - alignedData = new Int8Array(totalLength); - } else if (this.type === VertexBuffer.UNSIGNED_BYTE) { - alignedData = new Uint8Array(totalLength); - } else if (this.type === VertexBuffer.SHORT) { - alignedData = new Int16Array(totalLength); - } else if (this.type === VertexBuffer.UNSIGNED_SHORT) { - alignedData = new Uint16Array(totalLength); - } else if (this.type === VertexBuffer.INT) { - alignedData = new Int32Array(totalLength); - } else if (this.type === VertexBuffer.UNSIGNED_INT) { - alignedData = new Uint32Array(totalLength); - } else { - alignedData = new Float32Array(totalLength); - } - const numComponents = this.getSize(); - let sourceOffset = this.byteOffset; - for (let i = 0;i < totalVertices; ++i) { - for (let j = 0;j < numComponents; ++j) { - switch (this.type) { - case VertexBuffer.BYTE: - alignedData[i * alignedSize + j] = sourceData.getInt8(sourceOffset + j); - break; - case VertexBuffer.UNSIGNED_BYTE: - alignedData[i * alignedSize + j] = sourceData.getUint8(sourceOffset + j); - break; - case VertexBuffer.SHORT: - alignedData[i * alignedSize + j] = sourceData.getInt16(sourceOffset + j * 2, isLittleEndian); - break; - case VertexBuffer.UNSIGNED_SHORT: - alignedData[i * alignedSize + j] = sourceData.getUint16(sourceOffset + j * 2, isLittleEndian); - break; - case VertexBuffer.INT: - alignedData[i * alignedSize + j] = sourceData.getInt32(sourceOffset + j * 4, isLittleEndian); - break; - case VertexBuffer.UNSIGNED_INT: - alignedData[i * alignedSize + j] = sourceData.getUint32(sourceOffset + j * 4, isLittleEndian); - break; - case VertexBuffer.FLOAT: - alignedData[i * alignedSize + j] = sourceData.getFloat32(sourceOffset + j * 4, isLittleEndian); - break; + +// node_modules/@babylonjs/core/Buffers/buffer.align.js +var isLittleEndian; +var init_buffer_align = __esm(() => { + init_buffer(); + isLittleEndian = (() => { + const array = new Uint8Array(4); + const view = new Uint32Array(array.buffer); + return !!((view[0] = 1) & array[0]); + })(); + Object.defineProperty(VertexBuffer.prototype, "effectiveByteStride", { + get: function() { + return this._alignedBuffer && this._alignedBuffer.byteStride || this.byteStride; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VertexBuffer.prototype, "effectiveByteOffset", { + get: function() { + return this._alignedBuffer ? 0 : this.byteOffset; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VertexBuffer.prototype, "effectiveBuffer", { + get: function() { + return this._alignedBuffer && this._alignedBuffer.getBuffer() || this._buffer.getBuffer(); + }, + enumerable: true, + configurable: true + }); + VertexBuffer.prototype._rebuild = function() { + var _a, _b; + (_a = this._buffer) === null || _a === undefined || _a._rebuild(); + (_b = this._alignedBuffer) === null || _b === undefined || _b._rebuild(); + }; + VertexBuffer.prototype.dispose = function() { + var _a; + if (this._ownsBuffer) { + this._buffer.dispose(); + } + (_a = this._alignedBuffer) === null || _a === undefined || _a.dispose(); + this._alignedBuffer = undefined; + this._isDisposed = true; + }; + VertexBuffer.prototype._alignBuffer = function() { + var _a, _b; + const data = this._buffer.getData(); + if (!this.engine._features.forceVertexBufferStrideMultiple4Bytes || this.byteStride % 4 === 0 || !data) { + return; + } + const typeByteLength = VertexBuffer.GetTypeByteLength(this.type); + const alignedByteStride = this.byteStride + 3 & ~3; + const alignedSize = alignedByteStride / typeByteLength; + const totalVertices = this.totalVertices; + const totalByteLength = totalVertices * alignedByteStride; + const totalLength = totalByteLength / typeByteLength; + let sourceData; + if (Array.isArray(data)) { + const sourceDataAsFloat = new Float32Array(data); + sourceData = new DataView(sourceDataAsFloat.buffer, sourceDataAsFloat.byteOffset, sourceDataAsFloat.byteLength); + } else if (data instanceof ArrayBuffer) { + sourceData = new DataView(data, 0, data.byteLength); + } else { + sourceData = new DataView(data.buffer, data.byteOffset, data.byteLength); + } + let alignedData; + if (this.type === VertexBuffer.BYTE) { + alignedData = new Int8Array(totalLength); + } else if (this.type === VertexBuffer.UNSIGNED_BYTE) { + alignedData = new Uint8Array(totalLength); + } else if (this.type === VertexBuffer.SHORT) { + alignedData = new Int16Array(totalLength); + } else if (this.type === VertexBuffer.UNSIGNED_SHORT) { + alignedData = new Uint16Array(totalLength); + } else if (this.type === VertexBuffer.INT) { + alignedData = new Int32Array(totalLength); + } else if (this.type === VertexBuffer.UNSIGNED_INT) { + alignedData = new Uint32Array(totalLength); + } else { + alignedData = new Float32Array(totalLength); + } + const numComponents = this.getSize(); + let sourceOffset = this.byteOffset; + for (let i = 0;i < totalVertices; ++i) { + for (let j = 0;j < numComponents; ++j) { + switch (this.type) { + case VertexBuffer.BYTE: + alignedData[i * alignedSize + j] = sourceData.getInt8(sourceOffset + j); + break; + case VertexBuffer.UNSIGNED_BYTE: + alignedData[i * alignedSize + j] = sourceData.getUint8(sourceOffset + j); + break; + case VertexBuffer.SHORT: + alignedData[i * alignedSize + j] = sourceData.getInt16(sourceOffset + j * 2, isLittleEndian); + break; + case VertexBuffer.UNSIGNED_SHORT: + alignedData[i * alignedSize + j] = sourceData.getUint16(sourceOffset + j * 2, isLittleEndian); + break; + case VertexBuffer.INT: + alignedData[i * alignedSize + j] = sourceData.getInt32(sourceOffset + j * 4, isLittleEndian); + break; + case VertexBuffer.UNSIGNED_INT: + alignedData[i * alignedSize + j] = sourceData.getUint32(sourceOffset + j * 4, isLittleEndian); + break; + case VertexBuffer.FLOAT: + alignedData[i * alignedSize + j] = sourceData.getFloat32(sourceOffset + j * 4, isLittleEndian); + break; + } } + sourceOffset += this.byteStride; } - sourceOffset += this.byteStride; - } - (_a = this._alignedBuffer) === null || _a === undefined || _a.dispose(); - this._alignedBuffer = new Buffer(this.engine, alignedData, false, alignedByteStride, false, this.getIsInstanced(), true, this.instanceDivisor, ((_b = this._label) !== null && _b !== undefined ? _b : "VertexBuffer") + "_aligned"); -}; + (_a = this._alignedBuffer) === null || _a === undefined || _a.dispose(); + this._alignedBuffer = new Buffer(this.engine, alignedData, false, alignedByteStride, false, this.getIsInstanced(), true, this.instanceDivisor, ((_b = this._label) !== null && _b !== undefined ? _b : "VertexBuffer") + "_aligned"); + }; +}); + +// node_modules/@babylonjs/core/Buffers/index.js +var init_Buffers = __esm(() => { + init_buffer(); + init_dataBuffer(); + init_storageBuffer(); + init_buffer_align(); +}); + // node_modules/@babylonjs/core/Cameras/Inputs/BaseCameraMouseWheelInput.js class BaseCameraMouseWheelInput { constructor() { @@ -61032,15 +63281,24 @@ class BaseCameraMouseWheelInput { return "mousewheel"; } } -__decorate2([ - serialize() -], BaseCameraMouseWheelInput.prototype, "wheelPrecisionX", undefined); -__decorate2([ - serialize() -], BaseCameraMouseWheelInput.prototype, "wheelPrecisionY", undefined); -__decorate2([ - serialize() -], BaseCameraMouseWheelInput.prototype, "wheelPrecisionZ", undefined); +var init_BaseCameraMouseWheelInput = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_observable(); + init_pointerEvents(); + init_deviceInputEvents(); + init_tools(); + __decorate2([ + serialize() + ], BaseCameraMouseWheelInput.prototype, "wheelPrecisionX", undefined); + __decorate2([ + serialize() + ], BaseCameraMouseWheelInput.prototype, "wheelPrecisionY", undefined); + __decorate2([ + serialize() + ], BaseCameraMouseWheelInput.prototype, "wheelPrecisionZ", undefined); +}); + // node_modules/@babylonjs/core/Cameras/Inputs/BaseCameraPointersInput.js class BaseCameraPointersInput { constructor() { @@ -61231,12 +63489,17 @@ class BaseCameraPointersInput { onLostFocus() { } } -__decorate2([ - serialize() -], BaseCameraPointersInput.prototype, "buttons", undefined); -// node_modules/@babylonjs/core/Cameras/cameraInputsManager.js -var CameraInputTypes = {}; +var init_BaseCameraPointersInput = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_tools(); + init_pointerEvents(); + __decorate2([ + serialize() + ], BaseCameraPointersInput.prototype, "buttons", undefined); +}); +// node_modules/@babylonjs/core/Cameras/cameraInputsManager.js class CameraInputsManager { constructor(camera7) { this.attachedToElement = false; @@ -61371,8 +63634,22 @@ class CameraInputsManager { } } } +var CameraInputTypes; +var init_cameraInputsManager = __esm(() => { + init_logger(); + init_decorators(); + init_camera(); + CameraInputTypes = {}; +}); // node_modules/@babylonjs/core/Gamepads/gamepad.js +class StickValues { + constructor(x, y) { + this.x = x; + this.y = y; + } +} + class Gamepad { get isConnected() { return this._isConnected; @@ -61435,11 +63712,6 @@ class Gamepad { dispose() { } } -Gamepad.GAMEPAD = 0; -Gamepad.GENERIC = 1; -Gamepad.XBOX = 2; -Gamepad.POSE_ENABLED = 3; -Gamepad.DUALSHOCK = 4; class GenericPad extends Gamepad { onbuttondown(callback) { @@ -61484,6 +63756,14 @@ class GenericPad extends Gamepad { this.onButtonUpObservable.clear(); } } +var init_gamepad = __esm(() => { + init_observable(); + Gamepad.GAMEPAD = 0; + Gamepad.GENERIC = 1; + Gamepad.XBOX = 2; + Gamepad.POSE_ENABLED = 3; + Gamepad.DUALSHOCK = 4; +}); // node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraGamepadInput.js class ArcRotateCameraGamepadInput { @@ -61553,13 +63833,20 @@ class ArcRotateCameraGamepadInput { return "gamepad"; } } -__decorate2([ - serialize() -], ArcRotateCameraGamepadInput.prototype, "gamepadRotationSensibility", undefined); -__decorate2([ - serialize() -], ArcRotateCameraGamepadInput.prototype, "gamepadMoveSensibility", undefined); -CameraInputTypes["ArcRotateCameraGamepadInput"] = ArcRotateCameraGamepadInput; +var init_arcRotateCameraGamepadInput = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_cameraInputsManager(); + init_gamepad(); + __decorate2([ + serialize() + ], ArcRotateCameraGamepadInput.prototype, "gamepadRotationSensibility", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraGamepadInput.prototype, "gamepadMoveSensibility", undefined); + CameraInputTypes["ArcRotateCameraGamepadInput"] = ArcRotateCameraGamepadInput; +}); + // node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js class ArcRotateCameraKeyboardMoveInput { constructor() { @@ -61678,37 +63965,43 @@ class ArcRotateCameraKeyboardMoveInput { return "keyboard"; } } -__decorate2([ - serialize() -], ArcRotateCameraKeyboardMoveInput.prototype, "keysUp", undefined); -__decorate2([ - serialize() -], ArcRotateCameraKeyboardMoveInput.prototype, "keysDown", undefined); -__decorate2([ - serialize() -], ArcRotateCameraKeyboardMoveInput.prototype, "keysLeft", undefined); -__decorate2([ - serialize() -], ArcRotateCameraKeyboardMoveInput.prototype, "keysRight", undefined); -__decorate2([ - serialize() -], ArcRotateCameraKeyboardMoveInput.prototype, "keysReset", undefined); -__decorate2([ - serialize() -], ArcRotateCameraKeyboardMoveInput.prototype, "panningSensibility", undefined); -__decorate2([ - serialize() -], ArcRotateCameraKeyboardMoveInput.prototype, "zoomingSensibility", undefined); -__decorate2([ - serialize() -], ArcRotateCameraKeyboardMoveInput.prototype, "useAltToZoom", undefined); -__decorate2([ - serialize() -], ArcRotateCameraKeyboardMoveInput.prototype, "angularSpeed", undefined); -CameraInputTypes["ArcRotateCameraKeyboardMoveInput"] = ArcRotateCameraKeyboardMoveInput; -// node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraMouseWheelInput.js -var ffMultiplier = 40; +var init_arcRotateCameraKeyboardMoveInput = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_cameraInputsManager(); + init_keyboardEvents(); + init_tools(); + __decorate2([ + serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "keysUp", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "keysDown", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "keysLeft", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "keysRight", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "keysReset", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "panningSensibility", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "zoomingSensibility", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "useAltToZoom", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraKeyboardMoveInput.prototype, "angularSpeed", undefined); + CameraInputTypes["ArcRotateCameraKeyboardMoveInput"] = ArcRotateCameraKeyboardMoveInput; +}); +// node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraMouseWheelInput.js class ArcRotateCameraMouseWheelInput { constructor() { this.wheelPrecision = 3; @@ -61865,16 +64158,31 @@ class ArcRotateCameraMouseWheelInput { } } } -__decorate2([ - serialize() -], ArcRotateCameraMouseWheelInput.prototype, "wheelPrecision", undefined); -__decorate2([ - serialize() -], ArcRotateCameraMouseWheelInput.prototype, "zoomToMouseLocation", undefined); -__decorate2([ - serialize() -], ArcRotateCameraMouseWheelInput.prototype, "wheelDeltaPercentage", undefined); -CameraInputTypes["ArcRotateCameraMouseWheelInput"] = ArcRotateCameraMouseWheelInput; +var ffMultiplier; +var init_arcRotateCameraMouseWheelInput = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_cameraInputsManager(); + init_pointerEvents(); + init_math_plane(); + init_math_vector(); + init_math_constants(); + init_deviceInputEvents(); + init_math_scalar(); + init_tools(); + ffMultiplier = 40; + __decorate2([ + serialize() + ], ArcRotateCameraMouseWheelInput.prototype, "wheelPrecision", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraMouseWheelInput.prototype, "zoomToMouseLocation", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraMouseWheelInput.prototype, "wheelDeltaPercentage", undefined); + CameraInputTypes["ArcRotateCameraMouseWheelInput"] = ArcRotateCameraMouseWheelInput; +}); + // node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraPointersInput.js class ArcRotateCameraPointersInput extends BaseCameraPointersInput { constructor() { @@ -61966,38 +64274,45 @@ class ArcRotateCameraPointersInput extends BaseCameraPointersInput { this._isPinching = false; } } -ArcRotateCameraPointersInput.MinimumRadiusForPinch = 0.001; -__decorate2([ - serialize() -], ArcRotateCameraPointersInput.prototype, "buttons", undefined); -__decorate2([ - serialize() -], ArcRotateCameraPointersInput.prototype, "angularSensibilityX", undefined); -__decorate2([ - serialize() -], ArcRotateCameraPointersInput.prototype, "angularSensibilityY", undefined); -__decorate2([ - serialize() -], ArcRotateCameraPointersInput.prototype, "pinchPrecision", undefined); -__decorate2([ - serialize() -], ArcRotateCameraPointersInput.prototype, "pinchDeltaPercentage", undefined); -__decorate2([ - serialize() -], ArcRotateCameraPointersInput.prototype, "useNaturalPinchZoom", undefined); -__decorate2([ - serialize() -], ArcRotateCameraPointersInput.prototype, "pinchZoom", undefined); -__decorate2([ - serialize() -], ArcRotateCameraPointersInput.prototype, "panningSensibility", undefined); -__decorate2([ - serialize() -], ArcRotateCameraPointersInput.prototype, "multiTouchPanning", undefined); -__decorate2([ - serialize() -], ArcRotateCameraPointersInput.prototype, "multiTouchPanAndZoom", undefined); -CameraInputTypes["ArcRotateCameraPointersInput"] = ArcRotateCameraPointersInput; +var init_arcRotateCameraPointersInput = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_cameraInputsManager(); + init_BaseCameraPointersInput(); + ArcRotateCameraPointersInput.MinimumRadiusForPinch = 0.001; + __decorate2([ + serialize() + ], ArcRotateCameraPointersInput.prototype, "buttons", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraPointersInput.prototype, "angularSensibilityX", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraPointersInput.prototype, "angularSensibilityY", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraPointersInput.prototype, "pinchPrecision", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraPointersInput.prototype, "pinchDeltaPercentage", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraPointersInput.prototype, "useNaturalPinchZoom", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraPointersInput.prototype, "pinchZoom", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraPointersInput.prototype, "panningSensibility", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraPointersInput.prototype, "multiTouchPanning", undefined); + __decorate2([ + serialize() + ], ArcRotateCameraPointersInput.prototype, "multiTouchPanAndZoom", undefined); + CameraInputTypes["ArcRotateCameraPointersInput"] = ArcRotateCameraPointersInput; +}); + // node_modules/@babylonjs/core/Cameras/arcRotateCameraInputsManager.js class ArcRotateCameraInputsManager extends CameraInputsManager { constructor(camera7) { @@ -62016,13 +64331,14 @@ class ArcRotateCameraInputsManager extends CameraInputsManager { return this; } } +var init_arcRotateCameraInputsManager = __esm(() => { + init_arcRotateCameraPointersInput(); + init_arcRotateCameraKeyboardMoveInput(); + init_arcRotateCameraMouseWheelInput(); + init_cameraInputsManager(); +}); // node_modules/@babylonjs/core/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.js -ArcRotateCameraInputsManager.prototype.addVRDeviceOrientation = function() { - this.add(new ArcRotateCameraVRDeviceOrientationInput); - return this; -}; - class ArcRotateCameraVRDeviceOrientationInput { constructor() { this.alphaCorrection = 1; @@ -62081,7 +64397,17 @@ class ArcRotateCameraVRDeviceOrientationInput { return "VRDeviceOrientation"; } } -CameraInputTypes["ArcRotateCameraVRDeviceOrientationInput"] = ArcRotateCameraVRDeviceOrientationInput; +var init_arcRotateCameraVRDeviceOrientationInput = __esm(() => { + init_cameraInputsManager(); + init_arcRotateCameraInputsManager(); + init_tools(); + ArcRotateCameraInputsManager.prototype.addVRDeviceOrientation = function() { + this.add(new ArcRotateCameraVRDeviceOrientationInput); + return this; + }; + CameraInputTypes["ArcRotateCameraVRDeviceOrientationInput"] = ArcRotateCameraVRDeviceOrientationInput; +}); + // node_modules/@babylonjs/core/Cameras/Inputs/flyCameraKeyboardInput.js class FlyCameraKeyboardInput { constructor() { @@ -62179,25 +64505,34 @@ class FlyCameraKeyboardInput { } } } -__decorate2([ - serialize() -], FlyCameraKeyboardInput.prototype, "keysForward", undefined); -__decorate2([ - serialize() -], FlyCameraKeyboardInput.prototype, "keysBackward", undefined); -__decorate2([ - serialize() -], FlyCameraKeyboardInput.prototype, "keysUp", undefined); -__decorate2([ - serialize() -], FlyCameraKeyboardInput.prototype, "keysDown", undefined); -__decorate2([ - serialize() -], FlyCameraKeyboardInput.prototype, "keysRight", undefined); -__decorate2([ - serialize() -], FlyCameraKeyboardInput.prototype, "keysLeft", undefined); -CameraInputTypes["FlyCameraKeyboardInput"] = FlyCameraKeyboardInput; +var init_flyCameraKeyboardInput = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_cameraInputsManager(); + init_keyboardEvents(); + init_math_vector(); + init_tools(); + __decorate2([ + serialize() + ], FlyCameraKeyboardInput.prototype, "keysForward", undefined); + __decorate2([ + serialize() + ], FlyCameraKeyboardInput.prototype, "keysBackward", undefined); + __decorate2([ + serialize() + ], FlyCameraKeyboardInput.prototype, "keysUp", undefined); + __decorate2([ + serialize() + ], FlyCameraKeyboardInput.prototype, "keysDown", undefined); + __decorate2([ + serialize() + ], FlyCameraKeyboardInput.prototype, "keysRight", undefined); + __decorate2([ + serialize() + ], FlyCameraKeyboardInput.prototype, "keysLeft", undefined); + CameraInputTypes["FlyCameraKeyboardInput"] = FlyCameraKeyboardInput; +}); + // node_modules/@babylonjs/core/Cameras/Inputs/flyCameraMouseInput.js class FlyCameraMouseInput { constructor() { @@ -62344,13 +64679,23 @@ class FlyCameraMouseInput { currentRotation.toEulerAnglesToRef(camera7.rotation); } } -__decorate2([ - serialize() -], FlyCameraMouseInput.prototype, "buttons", undefined); -__decorate2([ - serialize() -], FlyCameraMouseInput.prototype, "angularSensibility", undefined); -CameraInputTypes["FlyCameraMouseInput"] = FlyCameraMouseInput; +var init_flyCameraMouseInput = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_cameraInputsManager(); + init_pointerEvents(); + init_math_vector(); + init_math_axis(); + init_tools(); + __decorate2([ + serialize() + ], FlyCameraMouseInput.prototype, "buttons", undefined); + __decorate2([ + serialize() + ], FlyCameraMouseInput.prototype, "angularSensibility", undefined); + CameraInputTypes["FlyCameraMouseInput"] = FlyCameraMouseInput; +}); + // node_modules/@babylonjs/core/Cameras/Inputs/followCameraKeyboardMoveInput.js class FollowCameraKeyboardMoveInput { constructor() { @@ -62468,61 +64813,69 @@ class FollowCameraKeyboardMoveInput { return this.keysRadiusModifierAlt === this._altPressed && this.keysRadiusModifierCtrl === this._ctrlPressed && this.keysRadiusModifierShift === this._shiftPressed; } } -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetIncr", undefined); -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetDecr", undefined); -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetModifierAlt", undefined); -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetModifierCtrl", undefined); -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetModifierShift", undefined); -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetIncr", undefined); -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetDecr", undefined); -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetModifierAlt", undefined); -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetModifierCtrl", undefined); -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetModifierShift", undefined); -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "keysRadiusIncr", undefined); -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "keysRadiusDecr", undefined); -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "keysRadiusModifierAlt", undefined); -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "keysRadiusModifierCtrl", undefined); -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "keysRadiusModifierShift", undefined); -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "heightSensibility", undefined); -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "rotationSensibility", undefined); -__decorate2([ - serialize() -], FollowCameraKeyboardMoveInput.prototype, "radiusSensibility", undefined); -CameraInputTypes["FollowCameraKeyboardMoveInput"] = FollowCameraKeyboardMoveInput; +var init_followCameraKeyboardMoveInput = __esm(() => { + init_tslib_es62(); + init_cameraInputsManager(); + init_decorators(); + init_keyboardEvents(); + init_tools(); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetIncr", undefined); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetDecr", undefined); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetModifierAlt", undefined); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetModifierCtrl", undefined); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "keysHeightOffsetModifierShift", undefined); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetIncr", undefined); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetDecr", undefined); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetModifierAlt", undefined); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetModifierCtrl", undefined); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "keysRotationOffsetModifierShift", undefined); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "keysRadiusIncr", undefined); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "keysRadiusDecr", undefined); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "keysRadiusModifierAlt", undefined); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "keysRadiusModifierCtrl", undefined); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "keysRadiusModifierShift", undefined); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "heightSensibility", undefined); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "rotationSensibility", undefined); + __decorate2([ + serialize() + ], FollowCameraKeyboardMoveInput.prototype, "radiusSensibility", undefined); + CameraInputTypes["FollowCameraKeyboardMoveInput"] = FollowCameraKeyboardMoveInput; +}); + // node_modules/@babylonjs/core/Cameras/Inputs/followCameraMouseWheelInput.js class FollowCameraMouseWheelInput { constructor() { @@ -62584,22 +64937,30 @@ class FollowCameraMouseWheelInput { return "mousewheel"; } } -__decorate2([ - serialize() -], FollowCameraMouseWheelInput.prototype, "axisControlRadius", undefined); -__decorate2([ - serialize() -], FollowCameraMouseWheelInput.prototype, "axisControlHeight", undefined); -__decorate2([ - serialize() -], FollowCameraMouseWheelInput.prototype, "axisControlRotation", undefined); -__decorate2([ - serialize() -], FollowCameraMouseWheelInput.prototype, "wheelPrecision", undefined); -__decorate2([ - serialize() -], FollowCameraMouseWheelInput.prototype, "wheelDeltaPercentage", undefined); -CameraInputTypes["FollowCameraMouseWheelInput"] = FollowCameraMouseWheelInput; +var init_followCameraMouseWheelInput = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_cameraInputsManager(); + init_pointerEvents(); + init_tools(); + __decorate2([ + serialize() + ], FollowCameraMouseWheelInput.prototype, "axisControlRadius", undefined); + __decorate2([ + serialize() + ], FollowCameraMouseWheelInput.prototype, "axisControlHeight", undefined); + __decorate2([ + serialize() + ], FollowCameraMouseWheelInput.prototype, "axisControlRotation", undefined); + __decorate2([ + serialize() + ], FollowCameraMouseWheelInput.prototype, "wheelPrecision", undefined); + __decorate2([ + serialize() + ], FollowCameraMouseWheelInput.prototype, "wheelDeltaPercentage", undefined); + CameraInputTypes["FollowCameraMouseWheelInput"] = FollowCameraMouseWheelInput; +}); + // node_modules/@babylonjs/core/Cameras/Inputs/followCameraPointersInput.js class FollowCameraPointersInput extends BaseCameraPointersInput { constructor() { @@ -62682,46 +65043,53 @@ class FollowCameraPointersInput extends BaseCameraPointersInput { console.assert(this.axisPinchControlRotation + this.axisPinchControlHeight + this.axisPinchControlRadius <= 1, warn + "axisPinchControlRotation: " + this.axisPinchControlRotation + ", axisPinchControlHeight: " + this.axisPinchControlHeight + ", axisPinchControlRadius: " + this.axisPinchControlRadius); } } -__decorate2([ - serialize() -], FollowCameraPointersInput.prototype, "angularSensibilityX", undefined); -__decorate2([ - serialize() -], FollowCameraPointersInput.prototype, "angularSensibilityY", undefined); -__decorate2([ - serialize() -], FollowCameraPointersInput.prototype, "pinchPrecision", undefined); -__decorate2([ - serialize() -], FollowCameraPointersInput.prototype, "pinchDeltaPercentage", undefined); -__decorate2([ - serialize() -], FollowCameraPointersInput.prototype, "axisXControlRadius", undefined); -__decorate2([ - serialize() -], FollowCameraPointersInput.prototype, "axisXControlHeight", undefined); -__decorate2([ - serialize() -], FollowCameraPointersInput.prototype, "axisXControlRotation", undefined); -__decorate2([ - serialize() -], FollowCameraPointersInput.prototype, "axisYControlRadius", undefined); -__decorate2([ - serialize() -], FollowCameraPointersInput.prototype, "axisYControlHeight", undefined); -__decorate2([ - serialize() -], FollowCameraPointersInput.prototype, "axisYControlRotation", undefined); -__decorate2([ - serialize() -], FollowCameraPointersInput.prototype, "axisPinchControlRadius", undefined); -__decorate2([ - serialize() -], FollowCameraPointersInput.prototype, "axisPinchControlHeight", undefined); -__decorate2([ - serialize() -], FollowCameraPointersInput.prototype, "axisPinchControlRotation", undefined); -CameraInputTypes["FollowCameraPointersInput"] = FollowCameraPointersInput; +var init_followCameraPointersInput = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_cameraInputsManager(); + init_BaseCameraPointersInput(); + __decorate2([ + serialize() + ], FollowCameraPointersInput.prototype, "angularSensibilityX", undefined); + __decorate2([ + serialize() + ], FollowCameraPointersInput.prototype, "angularSensibilityY", undefined); + __decorate2([ + serialize() + ], FollowCameraPointersInput.prototype, "pinchPrecision", undefined); + __decorate2([ + serialize() + ], FollowCameraPointersInput.prototype, "pinchDeltaPercentage", undefined); + __decorate2([ + serialize() + ], FollowCameraPointersInput.prototype, "axisXControlRadius", undefined); + __decorate2([ + serialize() + ], FollowCameraPointersInput.prototype, "axisXControlHeight", undefined); + __decorate2([ + serialize() + ], FollowCameraPointersInput.prototype, "axisXControlRotation", undefined); + __decorate2([ + serialize() + ], FollowCameraPointersInput.prototype, "axisYControlRadius", undefined); + __decorate2([ + serialize() + ], FollowCameraPointersInput.prototype, "axisYControlHeight", undefined); + __decorate2([ + serialize() + ], FollowCameraPointersInput.prototype, "axisYControlRotation", undefined); + __decorate2([ + serialize() + ], FollowCameraPointersInput.prototype, "axisPinchControlRadius", undefined); + __decorate2([ + serialize() + ], FollowCameraPointersInput.prototype, "axisPinchControlHeight", undefined); + __decorate2([ + serialize() + ], FollowCameraPointersInput.prototype, "axisPinchControlRotation", undefined); + CameraInputTypes["FollowCameraPointersInput"] = FollowCameraPointersInput; +}); + // node_modules/@babylonjs/core/Cameras/Inputs/freeCameraKeyboardMoveInput.js class FreeCameraKeyboardMoveInput { constructor() { @@ -62843,40 +65211,48 @@ class FreeCameraKeyboardMoveInput { return rotation; } } -__decorate2([ - serialize() -], FreeCameraKeyboardMoveInput.prototype, "keysUp", undefined); -__decorate2([ - serialize() -], FreeCameraKeyboardMoveInput.prototype, "keysUpward", undefined); -__decorate2([ - serialize() -], FreeCameraKeyboardMoveInput.prototype, "keysDown", undefined); -__decorate2([ - serialize() -], FreeCameraKeyboardMoveInput.prototype, "keysDownward", undefined); -__decorate2([ - serialize() -], FreeCameraKeyboardMoveInput.prototype, "keysLeft", undefined); -__decorate2([ - serialize() -], FreeCameraKeyboardMoveInput.prototype, "keysRight", undefined); -__decorate2([ - serialize() -], FreeCameraKeyboardMoveInput.prototype, "rotationSpeed", undefined); -__decorate2([ - serialize() -], FreeCameraKeyboardMoveInput.prototype, "keysRotateLeft", undefined); -__decorate2([ - serialize() -], FreeCameraKeyboardMoveInput.prototype, "keysRotateRight", undefined); -__decorate2([ - serialize() -], FreeCameraKeyboardMoveInput.prototype, "keysRotateUp", undefined); -__decorate2([ - serialize() -], FreeCameraKeyboardMoveInput.prototype, "keysRotateDown", undefined); -CameraInputTypes["FreeCameraKeyboardMoveInput"] = FreeCameraKeyboardMoveInput; +var init_freeCameraKeyboardMoveInput = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_cameraInputsManager(); + init_keyboardEvents(); + init_math_vector(); + init_tools(); + __decorate2([ + serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysUp", undefined); + __decorate2([ + serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysUpward", undefined); + __decorate2([ + serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysDown", undefined); + __decorate2([ + serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysDownward", undefined); + __decorate2([ + serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysLeft", undefined); + __decorate2([ + serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysRight", undefined); + __decorate2([ + serialize() + ], FreeCameraKeyboardMoveInput.prototype, "rotationSpeed", undefined); + __decorate2([ + serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysRotateLeft", undefined); + __decorate2([ + serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysRotateRight", undefined); + __decorate2([ + serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysRotateUp", undefined); + __decorate2([ + serialize() + ], FreeCameraKeyboardMoveInput.prototype, "keysRotateDown", undefined); + CameraInputTypes["FreeCameraKeyboardMoveInput"] = FreeCameraKeyboardMoveInput; +}); // node_modules/@babylonjs/core/Cameras/Inputs/freeCameraMouseInput.js class FreeCameraMouseInput { @@ -63013,22 +65389,23 @@ class FreeCameraMouseInput { return "mouse"; } } -__decorate2([ - serialize() -], FreeCameraMouseInput.prototype, "buttons", undefined); -__decorate2([ - serialize() -], FreeCameraMouseInput.prototype, "angularSensibility", undefined); -CameraInputTypes["FreeCameraMouseInput"] = FreeCameraMouseInput; +var init_freeCameraMouseInput = __esm(() => { + init_tslib_es62(); + init_observable(); + init_decorators(); + init_cameraInputsManager(); + init_pointerEvents(); + init_tools(); + __decorate2([ + serialize() + ], FreeCameraMouseInput.prototype, "buttons", undefined); + __decorate2([ + serialize() + ], FreeCameraMouseInput.prototype, "angularSensibility", undefined); + CameraInputTypes["FreeCameraMouseInput"] = FreeCameraMouseInput; +}); // node_modules/@babylonjs/core/Cameras/Inputs/freeCameraMouseWheelInput.js -var _CameraProperty; -(function(_CameraProperty2) { - _CameraProperty2[_CameraProperty2["MoveRelative"] = 0] = "MoveRelative"; - _CameraProperty2[_CameraProperty2["RotateRelative"] = 1] = "RotateRelative"; - _CameraProperty2[_CameraProperty2["MoveScene"] = 2] = "MoveScene"; -})(_CameraProperty || (_CameraProperty = {})); - class FreeCameraMouseWheelInput extends BaseCameraMouseWheelInput { constructor() { super(...arguments); @@ -63220,34 +65597,48 @@ class FreeCameraMouseWheelInput extends BaseCameraMouseWheelInput { } } } -__decorate2([ - serialize() -], FreeCameraMouseWheelInput.prototype, "wheelXMoveRelative", null); -__decorate2([ - serialize() -], FreeCameraMouseWheelInput.prototype, "wheelYMoveRelative", null); -__decorate2([ - serialize() -], FreeCameraMouseWheelInput.prototype, "wheelZMoveRelative", null); -__decorate2([ - serialize() -], FreeCameraMouseWheelInput.prototype, "wheelXRotateRelative", null); -__decorate2([ - serialize() -], FreeCameraMouseWheelInput.prototype, "wheelYRotateRelative", null); -__decorate2([ - serialize() -], FreeCameraMouseWheelInput.prototype, "wheelZRotateRelative", null); -__decorate2([ - serialize() -], FreeCameraMouseWheelInput.prototype, "wheelXMoveScene", null); -__decorate2([ - serialize() -], FreeCameraMouseWheelInput.prototype, "wheelYMoveScene", null); -__decorate2([ - serialize() -], FreeCameraMouseWheelInput.prototype, "wheelZMoveScene", null); -CameraInputTypes["FreeCameraMouseWheelInput"] = FreeCameraMouseWheelInput; +var _CameraProperty; +var init_freeCameraMouseWheelInput = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_cameraInputsManager(); + init_BaseCameraMouseWheelInput(); + init_math_vector(); + init_math_axis(); + (function(_CameraProperty2) { + _CameraProperty2[_CameraProperty2["MoveRelative"] = 0] = "MoveRelative"; + _CameraProperty2[_CameraProperty2["RotateRelative"] = 1] = "RotateRelative"; + _CameraProperty2[_CameraProperty2["MoveScene"] = 2] = "MoveScene"; + })(_CameraProperty || (_CameraProperty = {})); + __decorate2([ + serialize() + ], FreeCameraMouseWheelInput.prototype, "wheelXMoveRelative", null); + __decorate2([ + serialize() + ], FreeCameraMouseWheelInput.prototype, "wheelYMoveRelative", null); + __decorate2([ + serialize() + ], FreeCameraMouseWheelInput.prototype, "wheelZMoveRelative", null); + __decorate2([ + serialize() + ], FreeCameraMouseWheelInput.prototype, "wheelXRotateRelative", null); + __decorate2([ + serialize() + ], FreeCameraMouseWheelInput.prototype, "wheelYRotateRelative", null); + __decorate2([ + serialize() + ], FreeCameraMouseWheelInput.prototype, "wheelZRotateRelative", null); + __decorate2([ + serialize() + ], FreeCameraMouseWheelInput.prototype, "wheelXMoveScene", null); + __decorate2([ + serialize() + ], FreeCameraMouseWheelInput.prototype, "wheelYMoveScene", null); + __decorate2([ + serialize() + ], FreeCameraMouseWheelInput.prototype, "wheelZMoveScene", null); + CameraInputTypes["FreeCameraMouseWheelInput"] = FreeCameraMouseWheelInput; +}); // node_modules/@babylonjs/core/Cameras/Inputs/freeCameraTouchInput.js class FreeCameraTouchInput { @@ -63369,13 +65760,21 @@ class FreeCameraTouchInput { return "touch"; } } -__decorate2([ - serialize() -], FreeCameraTouchInput.prototype, "touchAngularSensibility", undefined); -__decorate2([ - serialize() -], FreeCameraTouchInput.prototype, "touchMoveSensibility", undefined); -CameraInputTypes["FreeCameraTouchInput"] = FreeCameraTouchInput; +var init_freeCameraTouchInput = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_cameraInputsManager(); + init_pointerEvents(); + init_math_vector(); + init_tools(); + __decorate2([ + serialize() + ], FreeCameraTouchInput.prototype, "touchAngularSensibility", undefined); + __decorate2([ + serialize() + ], FreeCameraTouchInput.prototype, "touchMoveSensibility", undefined); + CameraInputTypes["FreeCameraTouchInput"] = FreeCameraTouchInput; +}); // node_modules/@babylonjs/core/Cameras/freeCameraInputsManager.js class FreeCameraInputsManager extends CameraInputsManager { @@ -63423,19 +65822,15 @@ class FreeCameraInputsManager extends CameraInputsManager { this._mouseInput = null; } } +var init_freeCameraInputsManager = __esm(() => { + init_cameraInputsManager(); + init_freeCameraKeyboardMoveInput(); + init_freeCameraMouseInput(); + init_freeCameraMouseWheelInput(); + init_freeCameraTouchInput(); +}); // node_modules/@babylonjs/core/Cameras/Inputs/freeCameraDeviceOrientationInput.js -FreeCameraInputsManager.prototype.addDeviceOrientation = function(smoothFactor) { - if (!this._deviceOrientationInput) { - this._deviceOrientationInput = new FreeCameraDeviceOrientationInput; - if (smoothFactor) { - this._deviceOrientationInput.smoothFactor = smoothFactor; - } - this.add(this._deviceOrientationInput); - } - return this; -}; - class FreeCameraDeviceOrientationInput { static WaitForOrientationChangeAsync(timeout) { return new Promise((res, rej) => { @@ -63557,7 +65952,25 @@ class FreeCameraDeviceOrientationInput { return "deviceOrientation"; } } -CameraInputTypes["FreeCameraDeviceOrientationInput"] = FreeCameraDeviceOrientationInput; +var init_freeCameraDeviceOrientationInput = __esm(() => { + init_cameraInputsManager(); + init_math_vector(); + init_tools(); + init_freeCameraInputsManager(); + init_observable(); + FreeCameraInputsManager.prototype.addDeviceOrientation = function(smoothFactor) { + if (!this._deviceOrientationInput) { + this._deviceOrientationInput = new FreeCameraDeviceOrientationInput; + if (smoothFactor) { + this._deviceOrientationInput.smoothFactor = smoothFactor; + } + this.add(this._deviceOrientationInput); + } + return this; + }; + CameraInputTypes["FreeCameraDeviceOrientationInput"] = FreeCameraDeviceOrientationInput; +}); + // node_modules/@babylonjs/core/Cameras/Inputs/freeCameraGamepadInput.js class FreeCameraGamepadInput { constructor() { @@ -63635,21 +66048,22 @@ class FreeCameraGamepadInput { return "gamepad"; } } -__decorate2([ - serialize() -], FreeCameraGamepadInput.prototype, "gamepadAngularSensibility", undefined); -__decorate2([ - serialize() -], FreeCameraGamepadInput.prototype, "gamepadMoveSensibility", undefined); -CameraInputTypes["FreeCameraGamepadInput"] = FreeCameraGamepadInput; -// node_modules/@babylonjs/core/Misc/virtualJoystick.js -var JoystickAxis; -(function(JoystickAxis2) { - JoystickAxis2[JoystickAxis2["X"] = 0] = "X"; - JoystickAxis2[JoystickAxis2["Y"] = 1] = "Y"; - JoystickAxis2[JoystickAxis2["Z"] = 2] = "Z"; -})(JoystickAxis || (JoystickAxis = {})); +var init_freeCameraGamepadInput = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_cameraInputsManager(); + init_math_vector(); + init_gamepad(); + __decorate2([ + serialize() + ], FreeCameraGamepadInput.prototype, "gamepadAngularSensibility", undefined); + __decorate2([ + serialize() + ], FreeCameraGamepadInput.prototype, "gamepadMoveSensibility", undefined); + CameraInputTypes["FreeCameraGamepadInput"] = FreeCameraGamepadInput; +}); +// node_modules/@babylonjs/core/Misc/virtualJoystick.js class VirtualJoystick { static _GetDefaultOptions() { return { @@ -64031,15 +66445,20 @@ class VirtualJoystick { this._released = true; } } -VirtualJoystick._GlobalJoystickIndex = 0; -VirtualJoystick._AlwaysVisibleSticks = 0; +var JoystickAxis; +var init_virtualJoystick = __esm(() => { + init_math_vector(); + init_stringDictionary(); + (function(JoystickAxis2) { + JoystickAxis2[JoystickAxis2["X"] = 0] = "X"; + JoystickAxis2[JoystickAxis2["Y"] = 1] = "Y"; + JoystickAxis2[JoystickAxis2["Z"] = 2] = "Z"; + })(JoystickAxis || (JoystickAxis = {})); + VirtualJoystick._GlobalJoystickIndex = 0; + VirtualJoystick._AlwaysVisibleSticks = 0; +}); // node_modules/@babylonjs/core/Cameras/Inputs/freeCameraVirtualJoystickInput.js -FreeCameraInputsManager.prototype.addVirtualJoystick = function() { - this.add(new FreeCameraVirtualJoystickInput); - return this; -}; - class FreeCameraVirtualJoystickInput { getLeftJoystick() { return this._leftjoystick; @@ -64086,11 +66505,45 @@ class FreeCameraVirtualJoystickInput { return "virtualJoystick"; } } -CameraInputTypes["FreeCameraVirtualJoystickInput"] = FreeCameraVirtualJoystickInput; +var init_freeCameraVirtualJoystickInput = __esm(() => { + init_virtualJoystick(); + init_cameraInputsManager(); + init_math_vector(); + init_freeCameraInputsManager(); + FreeCameraInputsManager.prototype.addVirtualJoystick = function() { + this.add(new FreeCameraVirtualJoystickInput); + return this; + }; + CameraInputTypes["FreeCameraVirtualJoystickInput"] = FreeCameraVirtualJoystickInput; +}); + +// node_modules/@babylonjs/core/Cameras/Inputs/index.js +var init_Inputs = __esm(() => { + init_BaseCameraMouseWheelInput(); + init_BaseCameraPointersInput(); + init_arcRotateCameraGamepadInput(); + init_arcRotateCameraKeyboardMoveInput(); + init_arcRotateCameraMouseWheelInput(); + init_arcRotateCameraPointersInput(); + init_arcRotateCameraVRDeviceOrientationInput(); + init_flyCameraKeyboardInput(); + init_flyCameraMouseInput(); + init_followCameraKeyboardMoveInput(); + init_followCameraMouseWheelInput(); + init_followCameraPointersInput(); + init_freeCameraDeviceOrientationInput(); + init_freeCameraGamepadInput(); + init_freeCameraKeyboardMoveInput(); + init_freeCameraMouseInput(); + init_freeCameraMouseWheelInput(); + init_freeCameraTouchInput(); + init_freeCameraVirtualJoystickInput(); +}); + // node_modules/@babylonjs/core/Cameras/targetCamera.js class TargetCamera extends Camera { - constructor(name4, position, scene11, setActiveOnSceneIfNoneActive = true) { - super(name4, position, scene11, setActiveOnSceneIfNoneActive); + constructor(name5, position, scene11, setActiveOnSceneIfNoneActive = true) { + super(name5, position, scene11, setActiveOnSceneIfNoneActive); this._tmpUpVector = Vector3.Zero(); this._tmpTargetVector = Vector3.Zero(); this.cameraDirection = new Vector3(0, 0, 0); @@ -64397,9 +66850,9 @@ class TargetCamera extends Camera { this._globalPosition.copyFrom(position); } } - createRigCamera(name4, cameraIndex) { + createRigCamera(name5, cameraIndex) { if (this.cameraRigMode !== Camera.RIG_MODE_NONE) { - const rigCamera = new TargetCamera(name4, this.position.clone(), this.getScene()); + const rigCamera = new TargetCamera(name5, this.position.clone(), this.getScene()); rigCamera.isRigCamera = true; rigCamera.rigParent = this; if (this.cameraRigMode === Camera.RIG_MODE_VR) { @@ -64464,18 +66917,27 @@ class TargetCamera extends Camera { return "TargetCamera"; } } -TargetCamera._RigCamTransformMatrix = new Matrix; -TargetCamera._TargetTransformMatrix = new Matrix; -TargetCamera._TargetFocalPoint = new Vector3; -__decorate2([ - serializeAsVector3() -], TargetCamera.prototype, "rotation", undefined); -__decorate2([ - serialize() -], TargetCamera.prototype, "speed", undefined); -__decorate2([ - serializeAsMeshReference("lockedTargetId") -], TargetCamera.prototype, "lockedTarget", undefined); +var init_targetCamera = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_camera(); + init_math_vector(); + init_math_constants(); + init_math_axis(); + TargetCamera._RigCamTransformMatrix = new Matrix; + TargetCamera._TargetTransformMatrix = new Matrix; + TargetCamera._TargetFocalPoint = new Vector3; + __decorate2([ + serializeAsVector3() + ], TargetCamera.prototype, "rotation", undefined); + __decorate2([ + serialize() + ], TargetCamera.prototype, "speed", undefined); + __decorate2([ + serializeAsMeshReference("lockedTargetId") + ], TargetCamera.prototype, "lockedTarget", undefined); +}); + // node_modules/@babylonjs/core/Cameras/freeCamera.js class FreeCamera extends TargetCamera { get angularSensibility() { @@ -64621,8 +67083,8 @@ class FreeCamera extends TargetCamera { keyboard.keysRotateDown = value; } } - constructor(name4, position, scene11, setActiveOnSceneIfNoneActive = true) { - super(name4, position, scene11, setActiveOnSceneIfNoneActive); + constructor(name5, position, scene11, setActiveOnSceneIfNoneActive = true) { + super(name5, position, scene11, setActiveOnSceneIfNoneActive); this.ellipsoid = new Vector3(0.5, 1, 0.5); this.ellipsoidOffset = new Vector3(0, 0, 0); this.checkCollisions = false; @@ -64718,23 +67180,29 @@ class FreeCamera extends TargetCamera { return "FreeCamera"; } } -__decorate2([ - serializeAsVector3() -], FreeCamera.prototype, "ellipsoid", undefined); -__decorate2([ - serializeAsVector3() -], FreeCamera.prototype, "ellipsoidOffset", undefined); -__decorate2([ - serialize() -], FreeCamera.prototype, "checkCollisions", undefined); -__decorate2([ - serialize() -], FreeCamera.prototype, "applyGravity", undefined); -// node_modules/@babylonjs/core/Cameras/touchCamera.js -Node2.AddNodeConstructor("TouchCamera", (name4, scene11) => { - return () => new TouchCamera(name4, Vector3.Zero(), scene11); +var init_freeCamera = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_engine(); + init_targetCamera(); + init_freeCameraInputsManager(); + init_tools(); + __decorate2([ + serializeAsVector3() + ], FreeCamera.prototype, "ellipsoid", undefined); + __decorate2([ + serializeAsVector3() + ], FreeCamera.prototype, "ellipsoidOffset", undefined); + __decorate2([ + serialize() + ], FreeCamera.prototype, "checkCollisions", undefined); + __decorate2([ + serialize() + ], FreeCamera.prototype, "applyGravity", undefined); }); +// node_modules/@babylonjs/core/Cameras/touchCamera.js class TouchCamera extends FreeCamera { get touchAngularSensibility() { const touch = this.inputs.attached["touch"]; @@ -64762,8 +67230,8 @@ class TouchCamera extends FreeCamera { touch.touchMoveSensibility = value; } } - constructor(name4, position, scene11) { - super(name4, position, scene11); + constructor(name5, position, scene11) { + super(name5, position, scene11); this.inputs.addTouch(); this._setupInputs(); } @@ -64780,11 +67248,16 @@ class TouchCamera extends FreeCamera { } } } -// node_modules/@babylonjs/core/Cameras/arcRotateCamera.js -Node2.AddNodeConstructor("ArcRotateCamera", (name4, scene11) => { - return () => new ArcRotateCamera(name4, 0, 0, 1, Vector3.Zero(), scene11); +var init_touchCamera = __esm(() => { + init_freeCamera(); + init_math_vector(); + init_node(); + Node2.AddNodeConstructor("TouchCamera", (name5, scene11) => { + return () => new TouchCamera(name5, Vector3.Zero(), scene11); + }); }); +// node_modules/@babylonjs/core/Cameras/arcRotateCamera.js class ArcRotateCamera extends TargetCamera { get target() { return this._target; @@ -65049,8 +67522,8 @@ class ArcRotateCamera extends TargetCamera { this._autoRotationBehavior = null; } } - constructor(name4, alpha, beta, radius, target, scene11, setActiveOnSceneIfNoneActive = true) { - super(name4, Vector3.Zero(), scene11, setActiveOnSceneIfNoneActive); + constructor(name5, alpha, beta, radius, target, scene11, setActiveOnSceneIfNoneActive = true) { + super(name5, Vector3.Zero(), scene11, setActiveOnSceneIfNoneActive); this.inertialAlphaOffset = 0; this.inertialBetaOffset = 0; this.inertialRadiusOffset = 0; @@ -65432,7 +67905,7 @@ class ArcRotateCamera extends TargetCamera { this.maxZ = distance * 2; } } - createRigCamera(name4, cameraIndex) { + createRigCamera(name5, cameraIndex) { let alphaShift = 0; switch (this.cameraRigMode) { case Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH: @@ -65446,7 +67919,7 @@ class ArcRotateCamera extends TargetCamera { alphaShift = this._cameraRigParams.stereoHalfAngle * (cameraIndex === 0 ? -1 : 1); break; } - const rigCam = new ArcRotateCamera(name4, this.alpha + alphaShift, this.beta, this.radius, this._target, this.getScene()); + const rigCam = new ArcRotateCamera(name5, this.alpha + alphaShift, this.beta, this.radius, this._target, this.getScene()); rigCam._cameraRigParams = {}; rigCam.isRigCamera = true; rigCam.rigParent = this; @@ -65498,92 +67971,108 @@ class ArcRotateCamera extends TargetCamera { return "ArcRotateCamera"; } } -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "alpha", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "beta", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "radius", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "overrideCloneAlphaBetaRadius", undefined); -__decorate2([ - serializeAsVector3("target") -], ArcRotateCamera.prototype, "_target", undefined); -__decorate2([ - serializeAsMeshReference("targetHost") -], ArcRotateCamera.prototype, "_targetHost", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "inertialAlphaOffset", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "inertialBetaOffset", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "inertialRadiusOffset", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "lowerAlphaLimit", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "upperAlphaLimit", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "lowerBetaLimit", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "upperBetaLimit", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "lowerRadiusLimit", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "upperRadiusLimit", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "inertialPanningX", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "inertialPanningY", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "pinchToPanMaxDistance", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "panningDistanceLimit", undefined); -__decorate2([ - serializeAsVector3() -], ArcRotateCamera.prototype, "panningOriginTarget", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "panningInertia", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "zoomToMouseLocation", null); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "zoomOnFactor", undefined); -__decorate2([ - serializeAsVector2() -], ArcRotateCamera.prototype, "targetScreenOffset", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "allowUpsideDown", undefined); -__decorate2([ - serialize() -], ArcRotateCamera.prototype, "useInputToRestoreState", undefined); -// node_modules/@babylonjs/core/Cameras/deviceOrientationCamera.js -Node2.AddNodeConstructor("DeviceOrientationCamera", (name4, scene11) => { - return () => new DeviceOrientationCamera(name4, Vector3.Zero(), scene11); +var init_arcRotateCamera = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_observable(); + init_math_vector(); + init_node(); + init_mesh(); + init_autoRotationBehavior(); + init_bouncingBehavior(); + init_framingBehavior(); + init_camera(); + init_targetCamera(); + init_arcRotateCameraInputsManager(); + init_math_constants(); + init_tools(); + Node2.AddNodeConstructor("ArcRotateCamera", (name5, scene11) => { + return () => new ArcRotateCamera(name5, 0, 0, 1, Vector3.Zero(), scene11); + }); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "alpha", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "beta", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "radius", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "overrideCloneAlphaBetaRadius", undefined); + __decorate2([ + serializeAsVector3("target") + ], ArcRotateCamera.prototype, "_target", undefined); + __decorate2([ + serializeAsMeshReference("targetHost") + ], ArcRotateCamera.prototype, "_targetHost", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "inertialAlphaOffset", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "inertialBetaOffset", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "inertialRadiusOffset", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "lowerAlphaLimit", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "upperAlphaLimit", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "lowerBetaLimit", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "upperBetaLimit", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "lowerRadiusLimit", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "upperRadiusLimit", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "inertialPanningX", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "inertialPanningY", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "pinchToPanMaxDistance", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "panningDistanceLimit", undefined); + __decorate2([ + serializeAsVector3() + ], ArcRotateCamera.prototype, "panningOriginTarget", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "panningInertia", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "zoomToMouseLocation", null); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "zoomOnFactor", undefined); + __decorate2([ + serializeAsVector2() + ], ArcRotateCamera.prototype, "targetScreenOffset", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "allowUpsideDown", undefined); + __decorate2([ + serialize() + ], ArcRotateCamera.prototype, "useInputToRestoreState", undefined); }); +// node_modules/@babylonjs/core/Cameras/deviceOrientationCamera.js class DeviceOrientationCamera extends FreeCamera { - constructor(name4, position, scene11) { - super(name4, position, scene11); + constructor(name5, position, scene11) { + super(name5, position, scene11); this._tmpDragQuaternion = new Quaternion; this._disablePointerInputWhenUsingDeviceOrientation = true; this._dragFactor = 0; @@ -65646,6 +68135,17 @@ class DeviceOrientationCamera extends FreeCamera { this._initialQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion); } } +var init_deviceOrientationCamera = __esm(() => { + init_freeCamera(); + init_math_vector(); + init_node(); + init_freeCameraDeviceOrientationInput(); + init_math_axis(); + Node2.AddNodeConstructor("DeviceOrientationCamera", (name5, scene11) => { + return () => new DeviceOrientationCamera(name5, Vector3.Zero(), scene11); + }); +}); + // node_modules/@babylonjs/core/Cameras/flyCameraInputsManager.js class FlyCameraInputsManager extends CameraInputsManager { constructor(camera9) { @@ -65660,6 +68160,11 @@ class FlyCameraInputsManager extends CameraInputsManager { return this; } } +var init_flyCameraInputsManager = __esm(() => { + init_cameraInputsManager(); + init_flyCameraMouseInput(); + init_flyCameraKeyboardInput(); +}); // node_modules/@babylonjs/core/Cameras/flyCamera.js class FlyCamera extends TargetCamera { @@ -65754,8 +68259,8 @@ class FlyCamera extends TargetCamera { keyboard.keysRight = value; } } - constructor(name4, position, scene11, setActiveOnSceneIfNoneActive = true) { - super(name4, position, scene11, setActiveOnSceneIfNoneActive); + constructor(name5, position, scene11, setActiveOnSceneIfNoneActive = true) { + super(name5, position, scene11, setActiveOnSceneIfNoneActive); this.ellipsoid = new Vector3(1, 1, 1); this.ellipsoidOffset = new Vector3(0, 0, 0); this.checkCollisions = false; @@ -65866,18 +68371,28 @@ class FlyCamera extends TargetCamera { return "FlyCamera"; } } -__decorate2([ - serializeAsVector3() -], FlyCamera.prototype, "ellipsoid", undefined); -__decorate2([ - serializeAsVector3() -], FlyCamera.prototype, "ellipsoidOffset", undefined); -__decorate2([ - serialize() -], FlyCamera.prototype, "checkCollisions", undefined); -__decorate2([ - serialize() -], FlyCamera.prototype, "applyGravity", undefined); +var init_flyCamera = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_engine(); + init_targetCamera(); + init_flyCameraInputsManager(); + init_tools(); + __decorate2([ + serializeAsVector3() + ], FlyCamera.prototype, "ellipsoid", undefined); + __decorate2([ + serializeAsVector3() + ], FlyCamera.prototype, "ellipsoidOffset", undefined); + __decorate2([ + serialize() + ], FlyCamera.prototype, "checkCollisions", undefined); + __decorate2([ + serialize() + ], FlyCamera.prototype, "applyGravity", undefined); +}); + // node_modules/@babylonjs/core/Cameras/followCameraInputsManager.js class FollowCameraInputsManager extends CameraInputsManager { constructor(camera9) { @@ -65900,18 +68415,17 @@ class FollowCameraInputsManager extends CameraInputsManager { return this; } } - -// node_modules/@babylonjs/core/Cameras/followCamera.js -Node2.AddNodeConstructor("FollowCamera", (name4, scene11) => { - return () => new FollowCamera(name4, Vector3.Zero(), scene11); -}); -Node2.AddNodeConstructor("ArcFollowCamera", (name4, scene11) => { - return () => new ArcFollowCamera(name4, 0, 0, 1, null, scene11); +var init_followCameraInputsManager = __esm(() => { + init_cameraInputsManager(); + init_followCameraKeyboardMoveInput(); + init_followCameraMouseWheelInput(); + init_followCameraPointersInput(); }); +// node_modules/@babylonjs/core/Cameras/followCamera.js class FollowCamera extends TargetCamera { - constructor(name4, position, scene11, lockedTarget = null) { - super(name4, position, scene11); + constructor(name5, position, scene11, lockedTarget = null) { + super(name5, position, scene11); this.radius = 12; this.lowerRadiusLimit = null; this.upperRadiusLimit = null; @@ -66000,46 +68514,10 @@ class FollowCamera extends TargetCamera { return "FollowCamera"; } } -__decorate2([ - serialize() -], FollowCamera.prototype, "radius", undefined); -__decorate2([ - serialize() -], FollowCamera.prototype, "lowerRadiusLimit", undefined); -__decorate2([ - serialize() -], FollowCamera.prototype, "upperRadiusLimit", undefined); -__decorate2([ - serialize() -], FollowCamera.prototype, "rotationOffset", undefined); -__decorate2([ - serialize() -], FollowCamera.prototype, "lowerRotationOffsetLimit", undefined); -__decorate2([ - serialize() -], FollowCamera.prototype, "upperRotationOffsetLimit", undefined); -__decorate2([ - serialize() -], FollowCamera.prototype, "heightOffset", undefined); -__decorate2([ - serialize() -], FollowCamera.prototype, "lowerHeightOffsetLimit", undefined); -__decorate2([ - serialize() -], FollowCamera.prototype, "upperHeightOffsetLimit", undefined); -__decorate2([ - serialize() -], FollowCamera.prototype, "cameraAcceleration", undefined); -__decorate2([ - serialize() -], FollowCamera.prototype, "maxCameraSpeed", undefined); -__decorate2([ - serializeAsMeshReference("lockedTargetId") -], FollowCamera.prototype, "lockedTarget", undefined); class ArcFollowCamera extends TargetCamera { - constructor(name4, alpha, beta, radius, target, scene11) { - super(name4, Vector3.Zero(), scene11); + constructor(name5, alpha, beta, radius, target, scene11) { + super(name5, Vector3.Zero(), scene11); this.alpha = alpha; this.beta = beta; this.radius = radius; @@ -66069,28 +68547,59 @@ class ArcFollowCamera extends TargetCamera { return "ArcFollowCamera"; } } -// node_modules/@babylonjs/core/Gamepads/xboxGamepad.js -var Xbox360Button; -(function(Xbox360Button2) { - Xbox360Button2[Xbox360Button2["A"] = 0] = "A"; - Xbox360Button2[Xbox360Button2["B"] = 1] = "B"; - Xbox360Button2[Xbox360Button2["X"] = 2] = "X"; - Xbox360Button2[Xbox360Button2["Y"] = 3] = "Y"; - Xbox360Button2[Xbox360Button2["LB"] = 4] = "LB"; - Xbox360Button2[Xbox360Button2["RB"] = 5] = "RB"; - Xbox360Button2[Xbox360Button2["Back"] = 8] = "Back"; - Xbox360Button2[Xbox360Button2["Start"] = 9] = "Start"; - Xbox360Button2[Xbox360Button2["LeftStick"] = 10] = "LeftStick"; - Xbox360Button2[Xbox360Button2["RightStick"] = 11] = "RightStick"; -})(Xbox360Button || (Xbox360Button = {})); -var Xbox360Dpad; -(function(Xbox360Dpad2) { - Xbox360Dpad2[Xbox360Dpad2["Up"] = 12] = "Up"; - Xbox360Dpad2[Xbox360Dpad2["Down"] = 13] = "Down"; - Xbox360Dpad2[Xbox360Dpad2["Left"] = 14] = "Left"; - Xbox360Dpad2[Xbox360Dpad2["Right"] = 15] = "Right"; -})(Xbox360Dpad || (Xbox360Dpad = {})); +var init_followCamera = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_tools(); + init_targetCamera(); + init_math_vector(); + init_node(); + init_followCameraInputsManager(); + Node2.AddNodeConstructor("FollowCamera", (name5, scene11) => { + return () => new FollowCamera(name5, Vector3.Zero(), scene11); + }); + Node2.AddNodeConstructor("ArcFollowCamera", (name5, scene11) => { + return () => new ArcFollowCamera(name5, 0, 0, 1, null, scene11); + }); + __decorate2([ + serialize() + ], FollowCamera.prototype, "radius", undefined); + __decorate2([ + serialize() + ], FollowCamera.prototype, "lowerRadiusLimit", undefined); + __decorate2([ + serialize() + ], FollowCamera.prototype, "upperRadiusLimit", undefined); + __decorate2([ + serialize() + ], FollowCamera.prototype, "rotationOffset", undefined); + __decorate2([ + serialize() + ], FollowCamera.prototype, "lowerRotationOffsetLimit", undefined); + __decorate2([ + serialize() + ], FollowCamera.prototype, "upperRotationOffsetLimit", undefined); + __decorate2([ + serialize() + ], FollowCamera.prototype, "heightOffset", undefined); + __decorate2([ + serialize() + ], FollowCamera.prototype, "lowerHeightOffsetLimit", undefined); + __decorate2([ + serialize() + ], FollowCamera.prototype, "upperHeightOffsetLimit", undefined); + __decorate2([ + serialize() + ], FollowCamera.prototype, "cameraAcceleration", undefined); + __decorate2([ + serialize() + ], FollowCamera.prototype, "maxCameraSpeed", undefined); + __decorate2([ + serializeAsMeshReference("lockedTargetId") + ], FollowCamera.prototype, "lockedTarget", undefined); +}); +// node_modules/@babylonjs/core/Gamepads/xboxGamepad.js class Xbox360Pad extends Gamepad { constructor(id, index, gamepad4, xboxOne = false) { super(id, index, gamepad4, 0, 1, 2, 3); @@ -66318,29 +68827,31 @@ class Xbox360Pad extends Gamepad { this.onPadUpObservable.clear(); } } +var Xbox360Button, Xbox360Dpad; +var init_xboxGamepad = __esm(() => { + init_observable(); + init_gamepad(); + (function(Xbox360Button2) { + Xbox360Button2[Xbox360Button2["A"] = 0] = "A"; + Xbox360Button2[Xbox360Button2["B"] = 1] = "B"; + Xbox360Button2[Xbox360Button2["X"] = 2] = "X"; + Xbox360Button2[Xbox360Button2["Y"] = 3] = "Y"; + Xbox360Button2[Xbox360Button2["LB"] = 4] = "LB"; + Xbox360Button2[Xbox360Button2["RB"] = 5] = "RB"; + Xbox360Button2[Xbox360Button2["Back"] = 8] = "Back"; + Xbox360Button2[Xbox360Button2["Start"] = 9] = "Start"; + Xbox360Button2[Xbox360Button2["LeftStick"] = 10] = "LeftStick"; + Xbox360Button2[Xbox360Button2["RightStick"] = 11] = "RightStick"; + })(Xbox360Button || (Xbox360Button = {})); + (function(Xbox360Dpad2) { + Xbox360Dpad2[Xbox360Dpad2["Up"] = 12] = "Up"; + Xbox360Dpad2[Xbox360Dpad2["Down"] = 13] = "Down"; + Xbox360Dpad2[Xbox360Dpad2["Left"] = 14] = "Left"; + Xbox360Dpad2[Xbox360Dpad2["Right"] = 15] = "Right"; + })(Xbox360Dpad || (Xbox360Dpad = {})); +}); // node_modules/@babylonjs/core/Gamepads/dualShockGamepad.js -var DualShockButton; -(function(DualShockButton2) { - DualShockButton2[DualShockButton2["Cross"] = 0] = "Cross"; - DualShockButton2[DualShockButton2["Circle"] = 1] = "Circle"; - DualShockButton2[DualShockButton2["Square"] = 2] = "Square"; - DualShockButton2[DualShockButton2["Triangle"] = 3] = "Triangle"; - DualShockButton2[DualShockButton2["L1"] = 4] = "L1"; - DualShockButton2[DualShockButton2["R1"] = 5] = "R1"; - DualShockButton2[DualShockButton2["Share"] = 8] = "Share"; - DualShockButton2[DualShockButton2["Options"] = 9] = "Options"; - DualShockButton2[DualShockButton2["LeftStick"] = 10] = "LeftStick"; - DualShockButton2[DualShockButton2["RightStick"] = 11] = "RightStick"; -})(DualShockButton || (DualShockButton = {})); -var DualShockDpad; -(function(DualShockDpad2) { - DualShockDpad2[DualShockDpad2["Up"] = 12] = "Up"; - DualShockDpad2[DualShockDpad2["Down"] = 13] = "Down"; - DualShockDpad2[DualShockDpad2["Left"] = 14] = "Left"; - DualShockDpad2[DualShockDpad2["Right"] = 15] = "Right"; -})(DualShockDpad || (DualShockDpad = {})); - class DualShockPad extends Gamepad { constructor(id, index, gamepad5) { super(id.replace("STANDARD GAMEPAD", "SONY PLAYSTATION DUALSHOCK"), index, gamepad5, 0, 1, 2, 3); @@ -66547,6 +69058,29 @@ class DualShockPad extends Gamepad { this.onPadUpObservable.clear(); } } +var DualShockButton, DualShockDpad; +var init_dualShockGamepad = __esm(() => { + init_observable(); + init_gamepad(); + (function(DualShockButton2) { + DualShockButton2[DualShockButton2["Cross"] = 0] = "Cross"; + DualShockButton2[DualShockButton2["Circle"] = 1] = "Circle"; + DualShockButton2[DualShockButton2["Square"] = 2] = "Square"; + DualShockButton2[DualShockButton2["Triangle"] = 3] = "Triangle"; + DualShockButton2[DualShockButton2["L1"] = 4] = "L1"; + DualShockButton2[DualShockButton2["R1"] = 5] = "R1"; + DualShockButton2[DualShockButton2["Share"] = 8] = "Share"; + DualShockButton2[DualShockButton2["Options"] = 9] = "Options"; + DualShockButton2[DualShockButton2["LeftStick"] = 10] = "LeftStick"; + DualShockButton2[DualShockButton2["RightStick"] = 11] = "RightStick"; + })(DualShockButton || (DualShockButton = {})); + (function(DualShockDpad2) { + DualShockDpad2[DualShockDpad2["Up"] = 12] = "Up"; + DualShockDpad2[DualShockDpad2["Down"] = 13] = "Down"; + DualShockDpad2[DualShockDpad2["Left"] = 14] = "Left"; + DualShockDpad2[DualShockDpad2["Right"] = 15] = "Right"; + })(DualShockDpad || (DualShockDpad = {})); +}); // node_modules/@babylonjs/core/Gamepads/gamepadManager.js class GamepadManager { @@ -66714,32 +69248,17 @@ class GamepadManager { } } } - -// node_modules/@babylonjs/core/Gamepads/gamepadSceneComponent.js -Object.defineProperty(Scene.prototype, "gamepadManager", { - get: function() { - if (!this._gamepadManager) { - this._gamepadManager = new GamepadManager(this); - let component = this._getComponent(SceneComponentConstants.NAME_GAMEPAD); - if (!component) { - component = new GamepadSystemSceneComponent(this); - this._addComponent(component); - } - } - return this._gamepadManager; - }, - enumerable: true, - configurable: true +var init_gamepadManager = __esm(() => { + init_observable(); + init_domManagement(); + init_xboxGamepad(); + init_gamepad(); + init_engine(); + init_dualShockGamepad(); + init_tools(); }); -FreeCameraInputsManager.prototype.addGamepad = function() { - this.add(new FreeCameraGamepadInput); - return this; -}; -ArcRotateCameraInputsManager.prototype.addGamepad = function() { - this.add(new ArcRotateCameraGamepadInput); - return this; -}; +// node_modules/@babylonjs/core/Gamepads/gamepadSceneComponent.js class GamepadSystemSceneComponent { constructor(scene12) { this.name = SceneComponentConstants.NAME_GAMEPAD; @@ -66764,12 +69283,40 @@ class GamepadSystemSceneComponent { } } } - -// node_modules/@babylonjs/core/Cameras/universalCamera.js -Node2.AddNodeConstructor("FreeCamera", (name4, scene12) => { - return () => new UniversalCamera(name4, Vector3.Zero(), scene12); +var init_gamepadSceneComponent = __esm(() => { + init_scene(); + init_sceneComponent(); + init_gamepadManager(); + init_freeCameraInputsManager(); + init_freeCameraGamepadInput(); + init_arcRotateCameraInputsManager(); + init_arcRotateCameraGamepadInput(); + Object.defineProperty(Scene.prototype, "gamepadManager", { + get: function() { + if (!this._gamepadManager) { + this._gamepadManager = new GamepadManager(this); + let component = this._getComponent(SceneComponentConstants.NAME_GAMEPAD); + if (!component) { + component = new GamepadSystemSceneComponent(this); + this._addComponent(component); + } + } + return this._gamepadManager; + }, + enumerable: true, + configurable: true + }); + FreeCameraInputsManager.prototype.addGamepad = function() { + this.add(new FreeCameraGamepadInput); + return this; + }; + ArcRotateCameraInputsManager.prototype.addGamepad = function() { + this.add(new ArcRotateCameraGamepadInput); + return this; + }; }); +// node_modules/@babylonjs/core/Cameras/universalCamera.js class UniversalCamera extends TouchCamera { get gamepadAngularSensibility() { const gamepad6 = this.inputs.attached["gamepad"]; @@ -66797,34 +69344,52 @@ class UniversalCamera extends TouchCamera { gamepad6.gamepadMoveSensibility = value; } } - constructor(name4, position, scene12) { - super(name4, position, scene12); + constructor(name5, position, scene12) { + super(name5, position, scene12); this.inputs.addGamepad(); } getClassName() { return "UniversalCamera"; } } -Camera._CreateDefaultParsedCamera = (name4, scene12) => { - return new UniversalCamera(name4, Vector3.Zero(), scene12); -}; - -// node_modules/@babylonjs/core/Cameras/gamepadCamera.js -Node2.AddNodeConstructor("GamepadCamera", (name4, scene12) => { - return () => new GamepadCamera(name4, Vector3.Zero(), scene12); +var init_universalCamera = __esm(() => { + init_touchCamera(); + init_node(); + init_math_vector(); + init_camera(); + init_gamepadSceneComponent(); + Node2.AddNodeConstructor("FreeCamera", (name5, scene12) => { + return () => new UniversalCamera(name5, Vector3.Zero(), scene12); + }); + Camera._CreateDefaultParsedCamera = (name5, scene12) => { + return new UniversalCamera(name5, Vector3.Zero(), scene12); + }; }); +// node_modules/@babylonjs/core/Cameras/gamepadCamera.js class GamepadCamera extends UniversalCamera { - constructor(name4, position, scene12) { - super(name4, position, scene12); + constructor(name5, position, scene12) { + super(name5, position, scene12); } getClassName() { return "GamepadCamera"; } } +var init_gamepadCamera = __esm(() => { + init_universalCamera(); + init_math_vector(); + init_node(); + Node2.AddNodeConstructor("GamepadCamera", (name5, scene12) => { + return () => new GamepadCamera(name5, Vector3.Zero(), scene12); + }); +}); + // node_modules/@babylonjs/core/Shaders/passCube.fragment.js -var name4 = "passCubePixelShader"; -var shader4 = `varying vec2 vUV;uniform samplerCube textureSampler; +var name5, shader4; +var init_passCube_fragment = __esm(() => { + init_shaderStore(); + name5 = "passCubePixelShader"; + shader4 = `varying vec2 vUV;uniform samplerCube textureSampler; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {vec2 uv=vUV*2.0-1.0; @@ -66847,15 +69412,16 @@ gl_FragColor=textureCube(textureSampler,vec3(uv,1.001)); gl_FragColor=textureCube(textureSampler,vec3(uv,-1.001)); #endif }`; -ShaderStore.ShadersStore[name4] = shader4; + ShaderStore.ShadersStore[name5] = shader4; +}); // node_modules/@babylonjs/core/PostProcesses/passPostProcess.js class PassPostProcess extends PostProcess { getClassName() { return "PassPostProcess"; } - constructor(name5, options, camera10 = null, samplingMode, engine15, reusable, textureType = 0, blockCompilation = false) { - super(name5, "pass", null, null, options, camera10, samplingMode, engine15, reusable, undefined, textureType, undefined, null, blockCompilation); + constructor(name6, options, camera10 = null, samplingMode, engine15, reusable, textureType = 0, blockCompilation = false) { + super(name6, "pass", null, null, options, camera10, samplingMode, engine15, reusable, undefined, textureType, undefined, null, blockCompilation); } static _Parse(parsedPostProcess, targetCamera5, scene12, rootUrl) { return SerializationHelper.Parse(() => { @@ -66863,48 +69429,109 @@ class PassPostProcess extends PostProcess { }, parsedPostProcess, scene12, rootUrl); } } -RegisterClass("BABYLON.PassPostProcess", PassPostProcess); -Engine2._RescalePostProcessFactory = (engine15) => { - return new PassPostProcess("rescale", 1, null, 2, engine15, false, 0); -}; + +class PassCubePostProcess extends PostProcess { + get face() { + return this._face; + } + set face(value) { + if (value < 0 || value > 5) { + return; + } + this._face = value; + switch (this._face) { + case 0: + this.updateEffect("#define POSITIVEX"); + break; + case 1: + this.updateEffect("#define NEGATIVEX"); + break; + case 2: + this.updateEffect("#define POSITIVEY"); + break; + case 3: + this.updateEffect("#define NEGATIVEY"); + break; + case 4: + this.updateEffect("#define POSITIVEZ"); + break; + case 5: + this.updateEffect("#define NEGATIVEZ"); + break; + } + } + getClassName() { + return "PassCubePostProcess"; + } + constructor(name6, options, camera10 = null, samplingMode, engine15, reusable, textureType = 0, blockCompilation = false) { + super(name6, "passCube", null, null, options, camera10, samplingMode, engine15, reusable, "#define POSITIVEX", textureType, undefined, null, blockCompilation); + this._face = 0; + } + static _Parse(parsedPostProcess, targetCamera5, scene12, rootUrl) { + return SerializationHelper.Parse(() => { + return new PassCubePostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera5, parsedPostProcess.renderTargetSamplingMode, parsedPostProcess._engine, parsedPostProcess.reusable); + }, parsedPostProcess, scene12, rootUrl); + } +} +var init_passPostProcess = __esm(() => { + init_postProcess(); + init_engine(); + init_pass_fragment(); + init_passCube_fragment(); + init_typeStore(); + init_decorators(); + RegisterClass("BABYLON.PassPostProcess", PassPostProcess); + Engine2._RescalePostProcessFactory = (engine15) => { + return new PassPostProcess("rescale", 1, null, 2, engine15, false, 0); + }; +}); // node_modules/@babylonjs/core/Shaders/anaglyph.fragment.js -var name5 = "anaglyphPixelShader"; -var shader5 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D leftSampler; +var name6, shader5; +var init_anaglyph_fragment = __esm(() => { + init_shaderStore(); + name6 = "anaglyphPixelShader"; + shader5 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D leftSampler; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {vec4 leftFrag=texture2D(leftSampler,vUV);leftFrag=vec4(1.0,leftFrag.g,leftFrag.b,1.0);vec4 rightFrag=texture2D(textureSampler,vUV);rightFrag=vec4(rightFrag.r,1.0,1.0,1.0);gl_FragColor=vec4(rightFrag.rgb*leftFrag.rgb,1.0);}`; -ShaderStore.ShadersStore[name5] = shader5; + ShaderStore.ShadersStore[name6] = shader5; +}); // node_modules/@babylonjs/core/PostProcesses/anaglyphPostProcess.js class AnaglyphPostProcess extends PostProcess { getClassName() { return "AnaglyphPostProcess"; } - constructor(name6, options, rigCameras, samplingMode, engine15, reusable) { - super(name6, "anaglyph", null, ["leftSampler"], options, rigCameras[1], samplingMode, engine15, reusable); + constructor(name7, options, rigCameras, samplingMode, engine15, reusable) { + super(name7, "anaglyph", null, ["leftSampler"], options, rigCameras[1], samplingMode, engine15, reusable); this._passedProcess = rigCameras[0]._rigPostProcess; this.onApplyObservable.add((effect5) => { effect5.setTextureFromPostProcess("leftSampler", this._passedProcess); }); } } -RegisterClass("BABYLON.AnaglyphPostProcess", AnaglyphPostProcess); +var init_anaglyphPostProcess = __esm(() => { + init_postProcess(); + init_anaglyph_fragment(); + init_typeStore(); + RegisterClass("BABYLON.AnaglyphPostProcess", AnaglyphPostProcess); +}); // node_modules/@babylonjs/core/Cameras/RigModes/stereoscopicAnaglyphRigMode.js function setStereoscopicAnaglyphRigMode(camera10) { camera10._rigCameras[0]._rigPostProcess = new PassPostProcess(camera10.name + "_passthru", 1, camera10._rigCameras[0]); camera10._rigCameras[1]._rigPostProcess = new AnaglyphPostProcess(camera10.name + "_anaglyph", 1, camera10._rigCameras); } - -// node_modules/@babylonjs/core/Cameras/Stereoscopic/anaglyphArcRotateCamera.js -Node2.AddNodeConstructor("AnaglyphArcRotateCamera", (name6, scene12, options) => { - return () => new AnaglyphArcRotateCamera(name6, 0, 0, 1, Vector3.Zero(), options.interaxial_distance, scene12); +var init_stereoscopicAnaglyphRigMode = __esm(() => { + init_passPostProcess(); + init_anaglyphPostProcess(); }); +// node_modules/@babylonjs/core/Cameras/Stereoscopic/anaglyphArcRotateCamera.js class AnaglyphArcRotateCamera extends ArcRotateCamera { - constructor(name6, alpha, beta, radius, target, interaxialDistance, scene12) { - super(name6, alpha, beta, radius, target, scene12); + constructor(name7, alpha, beta, radius, target, interaxialDistance, scene12) { + super(name7, alpha, beta, radius, target, scene12); this._setRigMode = () => setStereoscopicAnaglyphRigMode(this); this.interaxialDistance = interaxialDistance; this.setCameraRigMode(Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance }); @@ -66913,14 +69540,21 @@ class AnaglyphArcRotateCamera extends ArcRotateCamera { return "AnaglyphArcRotateCamera"; } } -// node_modules/@babylonjs/core/Cameras/Stereoscopic/anaglyphFreeCamera.js -Node2.AddNodeConstructor("AnaglyphFreeCamera", (name6, scene12, options) => { - return () => new AnaglyphFreeCamera(name6, Vector3.Zero(), options.interaxial_distance, scene12); +var init_anaglyphArcRotateCamera = __esm(() => { + init_camera(); + init_arcRotateCamera(); + init_math_vector(); + init_node(); + init_stereoscopicAnaglyphRigMode(); + Node2.AddNodeConstructor("AnaglyphArcRotateCamera", (name7, scene12, options) => { + return () => new AnaglyphArcRotateCamera(name7, 0, 0, 1, Vector3.Zero(), options.interaxial_distance, scene12); + }); }); +// node_modules/@babylonjs/core/Cameras/Stereoscopic/anaglyphFreeCamera.js class AnaglyphFreeCamera extends FreeCamera { - constructor(name6, position, interaxialDistance, scene12) { - super(name6, position, scene12); + constructor(name7, position, interaxialDistance, scene12) { + super(name7, position, scene12); this._setRigMode = () => setStereoscopicAnaglyphRigMode(this); this.interaxialDistance = interaxialDistance; this.setCameraRigMode(Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance }); @@ -66929,14 +69563,21 @@ class AnaglyphFreeCamera extends FreeCamera { return "AnaglyphFreeCamera"; } } -// node_modules/@babylonjs/core/Cameras/Stereoscopic/anaglyphGamepadCamera.js -Node2.AddNodeConstructor("AnaglyphGamepadCamera", (name6, scene12, options) => { - return () => new AnaglyphGamepadCamera(name6, Vector3.Zero(), options.interaxial_distance, scene12); +var init_anaglyphFreeCamera = __esm(() => { + init_camera(); + init_freeCamera(); + init_math_vector(); + init_node(); + init_stereoscopicAnaglyphRigMode(); + Node2.AddNodeConstructor("AnaglyphFreeCamera", (name7, scene12, options) => { + return () => new AnaglyphFreeCamera(name7, Vector3.Zero(), options.interaxial_distance, scene12); + }); }); +// node_modules/@babylonjs/core/Cameras/Stereoscopic/anaglyphGamepadCamera.js class AnaglyphGamepadCamera extends GamepadCamera { - constructor(name6, position, interaxialDistance, scene12) { - super(name6, position, scene12); + constructor(name7, position, interaxialDistance, scene12) { + super(name7, position, scene12); this._setRigMode = () => setStereoscopicAnaglyphRigMode(this); this.interaxialDistance = interaxialDistance; this.setCameraRigMode(Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance }); @@ -66945,14 +69586,21 @@ class AnaglyphGamepadCamera extends GamepadCamera { return "AnaglyphGamepadCamera"; } } -// node_modules/@babylonjs/core/Cameras/Stereoscopic/anaglyphUniversalCamera.js -Node2.AddNodeConstructor("AnaglyphUniversalCamera", (name6, scene12, options) => { - return () => new AnaglyphUniversalCamera(name6, Vector3.Zero(), options.interaxial_distance, scene12); +var init_anaglyphGamepadCamera = __esm(() => { + init_camera(); + init_gamepadCamera(); + init_math_vector(); + init_node(); + init_stereoscopicAnaglyphRigMode(); + Node2.AddNodeConstructor("AnaglyphGamepadCamera", (name7, scene12, options) => { + return () => new AnaglyphGamepadCamera(name7, Vector3.Zero(), options.interaxial_distance, scene12); + }); }); +// node_modules/@babylonjs/core/Cameras/Stereoscopic/anaglyphUniversalCamera.js class AnaglyphUniversalCamera extends UniversalCamera { - constructor(name6, position, interaxialDistance, scene12) { - super(name6, position, scene12); + constructor(name7, position, interaxialDistance, scene12) { + super(name7, position, scene12); this._setRigMode = () => setStereoscopicAnaglyphRigMode(this); this.interaxialDistance = interaxialDistance; this.setCameraRigMode(Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance }); @@ -66961,9 +69609,23 @@ class AnaglyphUniversalCamera extends UniversalCamera { return "AnaglyphUniversalCamera"; } } +var init_anaglyphUniversalCamera = __esm(() => { + init_camera(); + init_universalCamera(); + init_math_vector(); + init_node(); + init_stereoscopicAnaglyphRigMode(); + Node2.AddNodeConstructor("AnaglyphUniversalCamera", (name7, scene12, options) => { + return () => new AnaglyphUniversalCamera(name7, Vector3.Zero(), options.interaxial_distance, scene12); + }); +}); + // node_modules/@babylonjs/core/Shaders/stereoscopicInterlace.fragment.js -var name6 = "stereoscopicInterlacePixelShader"; -var shader6 = `const vec3 TWO=vec3(2.0,2.0,2.0);varying vec2 vUV;uniform sampler2D camASampler;uniform sampler2D textureSampler;uniform vec2 stepSize; +var name7, shader6; +var init_stereoscopicInterlace_fragment = __esm(() => { + init_shaderStore(); + name7 = "stereoscopicInterlacePixelShader"; + shader6 = `const vec3 TWO=vec3(2.0,2.0,2.0);varying vec2 vUV;uniform sampler2D camASampler;uniform sampler2D textureSampler;uniform vec2 stepSize; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {bool useCamA;bool useCamB;vec2 texCoord1;vec2 texCoord2;vec3 frag1;vec3 frag2; @@ -66979,15 +69641,16 @@ useCamB=vUV.y>0.5;useCamA=!useCamB;texCoord1=vec2(vUV.x,useCamB ? (vUV.y-0.5)*2. if (useCamB){frag1=texture2D(textureSampler,texCoord1).rgb;frag2=texture2D(textureSampler,texCoord2).rgb;}else if (useCamA){frag1=texture2D(camASampler ,texCoord1).rgb;frag2=texture2D(camASampler ,texCoord2).rgb;}else {discard;} gl_FragColor=vec4((frag1+frag2)/TWO,1.0);} `; -ShaderStore.ShadersStore[name6] = shader6; + ShaderStore.ShadersStore[name7] = shader6; +}); // node_modules/@babylonjs/core/PostProcesses/stereoscopicInterlacePostProcess.js class StereoscopicInterlacePostProcessI extends PostProcess { getClassName() { return "StereoscopicInterlacePostProcessI"; } - constructor(name7, rigCameras, isStereoscopicHoriz, isStereoscopicInterlaced, samplingMode, engine15, reusable) { - super(name7, "stereoscopicInterlace", ["stepSize"], ["camASampler"], 1, rigCameras[1], samplingMode, engine15, reusable, isStereoscopicInterlaced ? "#define IS_STEREOSCOPIC_INTERLACED 1" : isStereoscopicHoriz ? "#define IS_STEREOSCOPIC_HORIZ 1" : undefined); + constructor(name8, rigCameras, isStereoscopicHoriz, isStereoscopicInterlaced, samplingMode, engine15, reusable) { + super(name8, "stereoscopicInterlace", ["stepSize"], ["camASampler"], 1, rigCameras[1], samplingMode, engine15, reusable, isStereoscopicInterlaced ? "#define IS_STEREOSCOPIC_INTERLACED 1" : isStereoscopicHoriz ? "#define IS_STEREOSCOPIC_HORIZ 1" : undefined); this._passedProcess = rigCameras[0]._rigPostProcess; this._stepSize = new Vector2(1 / this.width, 1 / this.height); this.onSizeChangedObservable.add(() => { @@ -67000,6 +69663,29 @@ class StereoscopicInterlacePostProcessI extends PostProcess { } } +class StereoscopicInterlacePostProcess extends PostProcess { + getClassName() { + return "StereoscopicInterlacePostProcess"; + } + constructor(name8, rigCameras, isStereoscopicHoriz, samplingMode, engine15, reusable) { + super(name8, "stereoscopicInterlace", ["stepSize"], ["camASampler"], 1, rigCameras[1], samplingMode, engine15, reusable, isStereoscopicHoriz ? "#define IS_STEREOSCOPIC_HORIZ 1" : undefined); + this._passedProcess = rigCameras[0]._rigPostProcess; + this._stepSize = new Vector2(1 / this.width, 1 / this.height); + this.onSizeChangedObservable.add(() => { + this._stepSize = new Vector2(1 / this.width, 1 / this.height); + }); + this.onApplyObservable.add((effect5) => { + effect5.setTextureFromPostProcess("camASampler", this._passedProcess); + effect5.setFloat2("stepSize", this._stepSize.x, this._stepSize.y); + }); + } +} +var init_stereoscopicInterlacePostProcess = __esm(() => { + init_math_vector(); + init_postProcess(); + init_stereoscopicInterlace_fragment(); +}); + // node_modules/@babylonjs/core/Cameras/RigModes/stereoscopicRigMode.js function setStereoscopicRigMode(camera15) { const isStereoscopicHoriz = camera15.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL || camera15.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED; @@ -67013,15 +69699,17 @@ function setStereoscopicRigMode(camera15) { camera15._rigCameras[isCrossEye ? 0 : 1].viewport = new Viewport(isStereoscopicHoriz ? 0.5 : 0, isStereoscopicHoriz ? 0 : 0.5, isStereoscopicHoriz ? 0.5 : 1, isStereoscopicHoriz ? 1 : 0.5); } } - -// node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicArcRotateCamera.js -Node2.AddNodeConstructor("StereoscopicArcRotateCamera", (name7, scene12, options) => { - return () => new StereoscopicArcRotateCamera(name7, 0, 0, 1, Vector3.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene12); +var init_stereoscopicRigMode = __esm(() => { + init_camera(); + init_math_viewport(); + init_passPostProcess(); + init_stereoscopicInterlacePostProcess(); }); +// node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicArcRotateCamera.js class StereoscopicArcRotateCamera extends ArcRotateCamera { - constructor(name7, alpha, beta, radius, target, interaxialDistance, isStereoscopicSideBySide, scene12) { - super(name7, alpha, beta, radius, target, scene12); + constructor(name8, alpha, beta, radius, target, interaxialDistance, isStereoscopicSideBySide, scene12) { + super(name8, alpha, beta, radius, target, scene12); this._setRigMode = () => setStereoscopicRigMode(this); this.interaxialDistance = interaxialDistance; this.isStereoscopicSideBySide = isStereoscopicSideBySide; @@ -67033,14 +69721,21 @@ class StereoscopicArcRotateCamera extends ArcRotateCamera { return "StereoscopicArcRotateCamera"; } } -// node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicFreeCamera.js -Node2.AddNodeConstructor("StereoscopicFreeCamera", (name7, scene12, options) => { - return () => new StereoscopicFreeCamera(name7, Vector3.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene12); +var init_stereoscopicArcRotateCamera = __esm(() => { + init_camera(); + init_arcRotateCamera(); + init_math_vector(); + init_node(); + init_stereoscopicRigMode(); + Node2.AddNodeConstructor("StereoscopicArcRotateCamera", (name8, scene12, options) => { + return () => new StereoscopicArcRotateCamera(name8, 0, 0, 1, Vector3.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene12); + }); }); +// node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicFreeCamera.js class StereoscopicFreeCamera extends FreeCamera { - constructor(name7, position, interaxialDistance, isStereoscopicSideBySide, scene12) { - super(name7, position, scene12); + constructor(name8, position, interaxialDistance, isStereoscopicSideBySide, scene12) { + super(name8, position, scene12); this._setRigMode = () => setStereoscopicRigMode(this); this.interaxialDistance = interaxialDistance; this.isStereoscopicSideBySide = isStereoscopicSideBySide; @@ -67052,14 +69747,21 @@ class StereoscopicFreeCamera extends FreeCamera { return "StereoscopicFreeCamera"; } } -// node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicGamepadCamera.js -Node2.AddNodeConstructor("StereoscopicGamepadCamera", (name7, scene12, options) => { - return () => new StereoscopicGamepadCamera(name7, Vector3.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene12); +var init_stereoscopicFreeCamera = __esm(() => { + init_camera(); + init_freeCamera(); + init_math_vector(); + init_node(); + init_stereoscopicRigMode(); + Node2.AddNodeConstructor("StereoscopicFreeCamera", (name8, scene12, options) => { + return () => new StereoscopicFreeCamera(name8, Vector3.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene12); + }); }); +// node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicGamepadCamera.js class StereoscopicGamepadCamera extends GamepadCamera { - constructor(name7, position, interaxialDistance, isStereoscopicSideBySide, scene12) { - super(name7, position, scene12); + constructor(name8, position, interaxialDistance, isStereoscopicSideBySide, scene12) { + super(name8, position, scene12); this._setRigMode = () => setStereoscopicRigMode(this); this.interaxialDistance = interaxialDistance; this.isStereoscopicSideBySide = isStereoscopicSideBySide; @@ -67071,14 +69773,21 @@ class StereoscopicGamepadCamera extends GamepadCamera { return "StereoscopicGamepadCamera"; } } -// node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicUniversalCamera.js -Node2.AddNodeConstructor("StereoscopicFreeCamera", (name7, scene12, options) => { - return () => new StereoscopicUniversalCamera(name7, Vector3.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene12); +var init_stereoscopicGamepadCamera = __esm(() => { + init_camera(); + init_gamepadCamera(); + init_math_vector(); + init_node(); + init_stereoscopicRigMode(); + Node2.AddNodeConstructor("StereoscopicGamepadCamera", (name8, scene12, options) => { + return () => new StereoscopicGamepadCamera(name8, Vector3.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene12); + }); }); +// node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicUniversalCamera.js class StereoscopicUniversalCamera extends UniversalCamera { - constructor(name7, position, interaxialDistance, isStereoscopicSideBySide, scene12) { - super(name7, position, scene12); + constructor(name8, position, interaxialDistance, isStereoscopicSideBySide, scene12) { + super(name8, position, scene12); this._setRigMode = () => setStereoscopicRigMode(this); this.interaxialDistance = interaxialDistance; this.isStereoscopicSideBySide = isStereoscopicSideBySide; @@ -67090,20 +69799,129 @@ class StereoscopicUniversalCamera extends UniversalCamera { return "StereoscopicUniversalCamera"; } } -// node_modules/@babylonjs/core/Cameras/virtualJoysticksCamera.js -Node2.AddNodeConstructor("VirtualJoysticksCamera", (name7, scene12) => { - return () => new VirtualJoysticksCamera(name7, Vector3.Zero(), scene12); +var init_stereoscopicUniversalCamera = __esm(() => { + init_camera(); + init_universalCamera(); + init_math_vector(); + init_node(); + init_stereoscopicRigMode(); + Node2.AddNodeConstructor("StereoscopicFreeCamera", (name8, scene12, options) => { + return () => new StereoscopicUniversalCamera(name8, Vector3.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene12); + }); }); +// node_modules/@babylonjs/core/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js +class StereoscopicScreenUniversalCamera extends UniversalCamera { + set distanceBetweenEyes(newValue) { + this._distanceBetweenEyes = newValue; + } + get distanceBetweenEyes() { + return this._distanceBetweenEyes; + } + set distanceToProjectionPlane(newValue) { + this._distanceToProjectionPlane = newValue; + } + get distanceToProjectionPlane() { + return this._distanceToProjectionPlane; + } + constructor(name8, position, scene12, distanceToProjectionPlane = 1, distanceBetweenEyes = 0.065) { + super(name8, position, scene12); + this._distanceBetweenEyes = distanceBetweenEyes; + this._distanceToProjectionPlane = distanceToProjectionPlane; + this.setCameraRigMode(Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL, { + stereoHalfAngle: 0 + }); + this._cameraRigParams.stereoHalfAngle = 0; + this._cameraRigParams.interaxialDistance = distanceBetweenEyes; + } + getClassName() { + return "StereoscopicUniversalCamera"; + } + createRigCamera(name8) { + const camera20 = new TargetCamera(name8, Vector3.Zero(), this.getScene()); + const transform = new TransformNode("tm_" + name8, this.getScene()); + camera20.parent = transform; + transform.setPivotMatrix(Matrix.Identity(), false); + camera20.isRigCamera = true; + camera20.rigParent = this; + return camera20; + } + _updateRigCameras() { + for (let cameraIndex = 0;cameraIndex < this._rigCameras.length; cameraIndex++) { + const cam = this._rigCameras[cameraIndex]; + cam.minZ = this.minZ; + cam.maxZ = this.maxZ; + cam.fov = this.fov; + cam.upVector.copyFrom(this.upVector); + if (cam.rotationQuaternion) { + cam.rotationQuaternion.copyFrom(this.rotationQuaternion); + } else { + cam.rotation.copyFrom(this.rotation); + } + this._updateCamera(this._rigCameras[cameraIndex], cameraIndex); + } + } + _updateCamera(camera20, cameraIndex) { + const b = this.distanceBetweenEyes / 2; + const z = b / this.distanceToProjectionPlane; + camera20.position.copyFrom(this.position); + camera20.position.addInPlaceFromFloats(cameraIndex === 0 ? -b : b, 0, -this._distanceToProjectionPlane); + const transform = camera20.parent; + const m = transform.getPivotMatrix(); + m.setTranslationFromFloats(cameraIndex === 0 ? b : -b, 0, 0); + m.setRowFromFloats(2, cameraIndex === 0 ? z : -z, 0, 1, 0); + transform.setPivotMatrix(m, false); + } + _setRigMode() { + this._rigCameras[0].viewport = new Viewport(0, 0, 0.5, 1); + this._rigCameras[1].viewport = new Viewport(0.5, 0, 0.5, 1); + for (let cameraIndex = 0;cameraIndex < this._rigCameras.length; cameraIndex++) { + this._updateCamera(this._rigCameras[cameraIndex], cameraIndex); + } + } +} +var init_stereoscopicScreenUniversalCamera = __esm(() => { + init_camera(); + init_universalCamera(); + init_math_vector(); + init_targetCamera(); + init_transformNode(); + init_math_viewport(); +}); + +// node_modules/@babylonjs/core/Cameras/Stereoscopic/index.js +var init_Stereoscopic = __esm(() => { + init_anaglyphArcRotateCamera(); + init_anaglyphFreeCamera(); + init_anaglyphGamepadCamera(); + init_anaglyphUniversalCamera(); + init_stereoscopicArcRotateCamera(); + init_stereoscopicFreeCamera(); + init_stereoscopicGamepadCamera(); + init_stereoscopicUniversalCamera(); + init_stereoscopicScreenUniversalCamera(); +}); + +// node_modules/@babylonjs/core/Cameras/virtualJoysticksCamera.js class VirtualJoysticksCamera extends FreeCamera { - constructor(name7, position, scene12) { - super(name7, position, scene12); + constructor(name8, position, scene12) { + super(name8, position, scene12); this.inputs.addVirtualJoystick(); } getClassName() { return "VirtualJoysticksCamera"; } } +var init_virtualJoysticksCamera = __esm(() => { + init_freeCamera(); + init_math_vector(); + init_node(); + init_freeCameraVirtualJoystickInput(); + Node2.AddNodeConstructor("VirtualJoysticksCamera", (name8, scene12) => { + return () => new VirtualJoysticksCamera(name8, Vector3.Zero(), scene12); + }); +}); + // node_modules/@babylonjs/core/Cameras/VR/vrCameraMetrics.js class VRCameraMetrics { constructor() { @@ -67149,23 +69967,31 @@ class VRCameraMetrics { return result; } } +var init_vrCameraMetrics = __esm(() => { + init_math_vector(); +}); + // node_modules/@babylonjs/core/Shaders/vrDistortionCorrection.fragment.js -var name7 = "vrDistortionCorrectionPixelShader"; -var shader7 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 LensCenter;uniform vec2 Scale;uniform vec2 ScaleIn;uniform vec4 HmdWarpParam;vec2 HmdWarp(vec2 in01) {vec2 theta=(in01-LensCenter)*ScaleIn; +var name8, shader7; +var init_vrDistortionCorrection_fragment = __esm(() => { + init_shaderStore(); + name8 = "vrDistortionCorrectionPixelShader"; + shader7 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 LensCenter;uniform vec2 Scale;uniform vec2 ScaleIn;uniform vec4 HmdWarpParam;vec2 HmdWarp(vec2 in01) {vec2 theta=(in01-LensCenter)*ScaleIn; float rSq=theta.x*theta.x+theta.y*theta.y;vec2 rvector=theta*(HmdWarpParam.x+HmdWarpParam.y*rSq+HmdWarpParam.z*rSq*rSq+HmdWarpParam.w*rSq*rSq*rSq);return LensCenter+Scale*rvector;} #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {vec2 tc=HmdWarp(vUV);if (tc.x <0.0 || tc.x>1.0 || tc.y<0.0 || tc.y>1.0) gl_FragColor=vec4(0.0,0.0,0.0,0.0);else{gl_FragColor=texture2D(textureSampler,tc);}}`; -ShaderStore.ShadersStore[name7] = shader7; + ShaderStore.ShadersStore[name8] = shader7; +}); // node_modules/@babylonjs/core/PostProcesses/vrDistortionCorrectionPostProcess.js class VRDistortionCorrectionPostProcess extends PostProcess { getClassName() { return "VRDistortionCorrectionPostProcess"; } - constructor(name8, camera20, isRightEye, vrMetrics) { - super(name8, "vrDistortionCorrection", ["LensCenter", "Scale", "ScaleIn", "HmdWarpParam"], null, vrMetrics.postProcessScaleFactor, camera20, Texture.BILINEAR_SAMPLINGMODE); + constructor(name9, camera20, isRightEye, vrMetrics) { + super(name9, "vrDistortionCorrection", ["LensCenter", "Scale", "ScaleIn", "HmdWarpParam"], null, vrMetrics.postProcessScaleFactor, camera20, Texture.BILINEAR_SAMPLINGMODE); this._isRightEye = isRightEye; this._distortionFactors = vrMetrics.distortionK; this._postProcessScaleFactor = vrMetrics.postProcessScaleFactor; @@ -67184,14 +70010,24 @@ class VRDistortionCorrectionPostProcess extends PostProcess { }); } } +var init_vrDistortionCorrectionPostProcess = __esm(() => { + init_math_vector(); + init_texture(); + init_postProcess(); + init_vrDistortionCorrection_fragment(); +}); // node_modules/@babylonjs/core/Shaders/vrMultiviewToSingleview.fragment.js -var name8 = "vrMultiviewToSingleviewPixelShader"; -var shader8 = `precision mediump sampler2DArray;varying vec2 vUV;uniform sampler2DArray multiviewSampler;uniform int imageIndex; +var name9, shader8; +var init_vrMultiviewToSingleview_fragment = __esm(() => { + init_shaderStore(); + name9 = "vrMultiviewToSingleviewPixelShader"; + shader8 = `precision mediump sampler2DArray;varying vec2 vUV;uniform sampler2DArray multiviewSampler;uniform int imageIndex; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {gl_FragColor=texture2D(multiviewSampler,vec3(vUV,imageIndex));}`; -ShaderStore.ShadersStore[name8] = shader8; + ShaderStore.ShadersStore[name9] = shader8; +}); // node_modules/@babylonjs/core/Materials/Textures/MultiviewRenderTarget.js class MultiviewRenderTarget extends RenderTargetTexture { @@ -67220,139 +70056,153 @@ class MultiviewRenderTarget extends RenderTargetTexture { return 2; } } +var init_MultiviewRenderTarget = __esm(() => { + init_renderTargetTexture(); +}); // node_modules/@babylonjs/core/Engines/Extensions/engine.multiview.js -var createMultiviewUbo = function(engine16, name9) { - const ubo = new UniformBuffer(engine16, undefined, true, name9); - ubo.addUniform("viewProjection", 16); - ubo.addUniform("viewProjectionR", 16); - ubo.addUniform("view", 16); - ubo.addUniform("projection", 16); - ubo.addUniform("vEyePosition", 4); - return ubo; -}; -Engine2.prototype.createMultiviewRenderTargetTexture = function(width, height, colorTexture, depthStencilTexture) { - const gl = this._gl; - if (!this.getCaps().multiview) { - throw "Multiview is not supported"; - } - const rtWrapper = this._createHardwareRenderTargetWrapper(false, false, { width, height }); - rtWrapper._framebuffer = gl.createFramebuffer(); - const internalTexture8 = new InternalTexture(this, InternalTextureSource.Unknown, true); - internalTexture8.width = width; - internalTexture8.height = height; - internalTexture8.isMultiview = true; - if (!colorTexture) { - colorTexture = gl.createTexture(); - gl.bindTexture(gl.TEXTURE_2D_ARRAY, colorTexture); - gl.texStorage3D(gl.TEXTURE_2D_ARRAY, 1, gl.RGBA8, width, height, 2); - } - rtWrapper._colorTextureArray = colorTexture; - if (!depthStencilTexture) { - depthStencilTexture = gl.createTexture(); - gl.bindTexture(gl.TEXTURE_2D_ARRAY, depthStencilTexture); - gl.texStorage3D(gl.TEXTURE_2D_ARRAY, 1, gl.DEPTH24_STENCIL8, width, height, 2); - } - rtWrapper._depthStencilTextureArray = depthStencilTexture; - internalTexture8.isReady = true; - rtWrapper.setTextures(internalTexture8); - rtWrapper._depthStencilTexture = internalTexture8; - return rtWrapper; -}; -Engine2.prototype.bindMultiviewFramebuffer = function(_multiviewTexture) { - const multiviewTexture = _multiviewTexture; - const gl = this._gl; - const ext = this.getCaps().oculusMultiview || this.getCaps().multiview; - this.bindFramebuffer(multiviewTexture, undefined, undefined, undefined, true); - gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, multiviewTexture._framebuffer); - if (multiviewTexture._colorTextureArray && multiviewTexture._depthStencilTextureArray) { - if (this.getCaps().oculusMultiview) { - ext.framebufferTextureMultisampleMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, multiviewTexture._colorTextureArray, 0, multiviewTexture.samples, 0, 2); - ext.framebufferTextureMultisampleMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, multiviewTexture._depthStencilTextureArray, 0, multiviewTexture.samples, 0, 2); - } else { - ext.framebufferTextureMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, multiviewTexture._colorTextureArray, 0, 0, 2); - ext.framebufferTextureMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, multiviewTexture._depthStencilTextureArray, 0, 0, 2); +var createMultiviewUbo, currentCreateSceneUniformBuffer; +var init_engine_multiview = __esm(() => { + init_camera(); + init_engine(); + init_scene(); + init_internalTexture(); + init_math_vector(); + init_uniformBuffer(); + init_MultiviewRenderTarget(); + init_math_frustum(); + createMultiviewUbo = function(engine16, name10) { + const ubo = new UniformBuffer(engine16, undefined, true, name10); + ubo.addUniform("viewProjection", 16); + ubo.addUniform("viewProjectionR", 16); + ubo.addUniform("view", 16); + ubo.addUniform("projection", 16); + ubo.addUniform("vEyePosition", 4); + return ubo; + }; + Engine2.prototype.createMultiviewRenderTargetTexture = function(width, height, colorTexture, depthStencilTexture) { + const gl = this._gl; + if (!this.getCaps().multiview) { + throw "Multiview is not supported"; + } + const rtWrapper = this._createHardwareRenderTargetWrapper(false, false, { width, height }); + rtWrapper._framebuffer = gl.createFramebuffer(); + const internalTexture8 = new InternalTexture(this, InternalTextureSource.Unknown, true); + internalTexture8.width = width; + internalTexture8.height = height; + internalTexture8.isMultiview = true; + if (!colorTexture) { + colorTexture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D_ARRAY, colorTexture); + gl.texStorage3D(gl.TEXTURE_2D_ARRAY, 1, gl.RGBA8, width, height, 2); + } + rtWrapper._colorTextureArray = colorTexture; + if (!depthStencilTexture) { + depthStencilTexture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D_ARRAY, depthStencilTexture); + gl.texStorage3D(gl.TEXTURE_2D_ARRAY, 1, gl.DEPTH24_STENCIL8, width, height, 2); + } + rtWrapper._depthStencilTextureArray = depthStencilTexture; + internalTexture8.isReady = true; + rtWrapper.setTextures(internalTexture8); + rtWrapper._depthStencilTexture = internalTexture8; + return rtWrapper; + }; + Engine2.prototype.bindMultiviewFramebuffer = function(_multiviewTexture) { + const multiviewTexture = _multiviewTexture; + const gl = this._gl; + const ext = this.getCaps().oculusMultiview || this.getCaps().multiview; + this.bindFramebuffer(multiviewTexture, undefined, undefined, undefined, true); + gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, multiviewTexture._framebuffer); + if (multiviewTexture._colorTextureArray && multiviewTexture._depthStencilTextureArray) { + if (this.getCaps().oculusMultiview) { + ext.framebufferTextureMultisampleMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, multiviewTexture._colorTextureArray, 0, multiviewTexture.samples, 0, 2); + ext.framebufferTextureMultisampleMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, multiviewTexture._depthStencilTextureArray, 0, multiviewTexture.samples, 0, 2); + } else { + ext.framebufferTextureMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, multiviewTexture._colorTextureArray, 0, 0, 2); + ext.framebufferTextureMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, multiviewTexture._depthStencilTextureArray, 0, 0, 2); + } + } else { + throw "Invalid multiview frame buffer"; } - } else { - throw "Invalid multiview frame buffer"; - } -}; -Engine2.prototype.bindSpaceWarpFramebuffer = function(_spaceWarpTexture) { - const spaceWarpTexture = _spaceWarpTexture; - const gl = this._gl; - const ext = this.getCaps().oculusMultiview || this.getCaps().multiview; - this.bindFramebuffer(spaceWarpTexture, undefined, undefined, undefined, true); - gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, spaceWarpTexture._framebuffer); - if (spaceWarpTexture._colorTextureArray && spaceWarpTexture._depthStencilTextureArray) { - ext.framebufferTextureMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, spaceWarpTexture._colorTextureArray, 0, 0, 2); - ext.framebufferTextureMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.DEPTH_ATTACHMENT, spaceWarpTexture._depthStencilTextureArray, 0, 0, 2); - } else { - throw new Error("Invalid Space Warp framebuffer"); - } -}; -Camera.prototype._useMultiviewToSingleView = false; -Camera.prototype._multiviewTexture = null; -Camera.prototype._resizeOrCreateMultiviewTexture = function(width, height) { - if (!this._multiviewTexture) { - this._multiviewTexture = new MultiviewRenderTarget(this.getScene(), { width, height }); - } else if (this._multiviewTexture.getRenderWidth() != width || this._multiviewTexture.getRenderHeight() != height) { - this._multiviewTexture.dispose(); - this._multiviewTexture = new MultiviewRenderTarget(this.getScene(), { width, height }); - } -}; -var currentCreateSceneUniformBuffer = Scene.prototype.createSceneUniformBuffer; -Scene.prototype._transformMatrixR = Matrix.Zero(); -Scene.prototype._multiviewSceneUbo = null; -Scene.prototype._createMultiviewUbo = function() { - this._multiviewSceneUbo = createMultiviewUbo(this.getEngine(), "scene_multiview"); -}; -Scene.prototype.createSceneUniformBuffer = function(name9) { - if (this._multiviewSceneUbo) { - return createMultiviewUbo(this.getEngine(), name9); - } - return currentCreateSceneUniformBuffer.bind(this)(name9); -}; -Scene.prototype._updateMultiviewUbo = function(viewR, projectionR) { - if (viewR && projectionR) { - viewR.multiplyToRef(projectionR, this._transformMatrixR); - } - if (viewR && projectionR) { - viewR.multiplyToRef(projectionR, TmpVectors.Matrix[0]); - Frustum.GetRightPlaneToRef(TmpVectors.Matrix[0], this._frustumPlanes[3]); - } - if (this._multiviewSceneUbo) { - this._multiviewSceneUbo.updateMatrix("viewProjection", this.getTransformMatrix()); - this._multiviewSceneUbo.updateMatrix("viewProjectionR", this._transformMatrixR); - this._multiviewSceneUbo.updateMatrix("view", this._viewMatrix); - this._multiviewSceneUbo.updateMatrix("projection", this._projectionMatrix); - } -}; -Scene.prototype._renderMultiviewToSingleView = function(camera21) { - camera21._resizeOrCreateMultiviewTexture(camera21._rigPostProcess && camera21._rigPostProcess && camera21._rigPostProcess.width > 0 ? camera21._rigPostProcess.width : this.getEngine().getRenderWidth(true), camera21._rigPostProcess && camera21._rigPostProcess && camera21._rigPostProcess.height > 0 ? camera21._rigPostProcess.height : this.getEngine().getRenderHeight(true)); - if (!this._multiviewSceneUbo) { - this._createMultiviewUbo(); - } - camera21.outputRenderTarget = camera21._multiviewTexture; - this._renderForCamera(camera21); - camera21.outputRenderTarget = null; - for (let index = 0;index < camera21._rigCameras.length; index++) { - const engine16 = this.getEngine(); - this._activeCamera = camera21._rigCameras[index]; - engine16.setViewport(this._activeCamera.viewport); - if (this.postProcessManager) { - this.postProcessManager._prepareFrame(); - this.postProcessManager._finalizeFrame(this._activeCamera.isIntermediate); + }; + Engine2.prototype.bindSpaceWarpFramebuffer = function(_spaceWarpTexture) { + const spaceWarpTexture = _spaceWarpTexture; + const gl = this._gl; + const ext = this.getCaps().oculusMultiview || this.getCaps().multiview; + this.bindFramebuffer(spaceWarpTexture, undefined, undefined, undefined, true); + gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, spaceWarpTexture._framebuffer); + if (spaceWarpTexture._colorTextureArray && spaceWarpTexture._depthStencilTextureArray) { + ext.framebufferTextureMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, spaceWarpTexture._colorTextureArray, 0, 0, 2); + ext.framebufferTextureMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.DEPTH_ATTACHMENT, spaceWarpTexture._depthStencilTextureArray, 0, 0, 2); + } else { + throw new Error("Invalid Space Warp framebuffer"); } - } -}; + }; + Camera.prototype._useMultiviewToSingleView = false; + Camera.prototype._multiviewTexture = null; + Camera.prototype._resizeOrCreateMultiviewTexture = function(width, height) { + if (!this._multiviewTexture) { + this._multiviewTexture = new MultiviewRenderTarget(this.getScene(), { width, height }); + } else if (this._multiviewTexture.getRenderWidth() != width || this._multiviewTexture.getRenderHeight() != height) { + this._multiviewTexture.dispose(); + this._multiviewTexture = new MultiviewRenderTarget(this.getScene(), { width, height }); + } + }; + currentCreateSceneUniformBuffer = Scene.prototype.createSceneUniformBuffer; + Scene.prototype._transformMatrixR = Matrix.Zero(); + Scene.prototype._multiviewSceneUbo = null; + Scene.prototype._createMultiviewUbo = function() { + this._multiviewSceneUbo = createMultiviewUbo(this.getEngine(), "scene_multiview"); + }; + Scene.prototype.createSceneUniformBuffer = function(name10) { + if (this._multiviewSceneUbo) { + return createMultiviewUbo(this.getEngine(), name10); + } + return currentCreateSceneUniformBuffer.bind(this)(name10); + }; + Scene.prototype._updateMultiviewUbo = function(viewR, projectionR) { + if (viewR && projectionR) { + viewR.multiplyToRef(projectionR, this._transformMatrixR); + } + if (viewR && projectionR) { + viewR.multiplyToRef(projectionR, TmpVectors.Matrix[0]); + Frustum.GetRightPlaneToRef(TmpVectors.Matrix[0], this._frustumPlanes[3]); + } + if (this._multiviewSceneUbo) { + this._multiviewSceneUbo.updateMatrix("viewProjection", this.getTransformMatrix()); + this._multiviewSceneUbo.updateMatrix("viewProjectionR", this._transformMatrixR); + this._multiviewSceneUbo.updateMatrix("view", this._viewMatrix); + this._multiviewSceneUbo.updateMatrix("projection", this._projectionMatrix); + } + }; + Scene.prototype._renderMultiviewToSingleView = function(camera21) { + camera21._resizeOrCreateMultiviewTexture(camera21._rigPostProcess && camera21._rigPostProcess && camera21._rigPostProcess.width > 0 ? camera21._rigPostProcess.width : this.getEngine().getRenderWidth(true), camera21._rigPostProcess && camera21._rigPostProcess && camera21._rigPostProcess.height > 0 ? camera21._rigPostProcess.height : this.getEngine().getRenderHeight(true)); + if (!this._multiviewSceneUbo) { + this._createMultiviewUbo(); + } + camera21.outputRenderTarget = camera21._multiviewTexture; + this._renderForCamera(camera21); + camera21.outputRenderTarget = null; + for (let index = 0;index < camera21._rigCameras.length; index++) { + const engine16 = this.getEngine(); + this._activeCamera = camera21._rigCameras[index]; + engine16.setViewport(this._activeCamera.viewport); + if (this.postProcessManager) { + this.postProcessManager._prepareFrame(); + this.postProcessManager._finalizeFrame(this._activeCamera.isIntermediate); + } + } + }; +}); // node_modules/@babylonjs/core/PostProcesses/vrMultiviewToSingleviewPostProcess.js class VRMultiviewToSingleviewPostProcess extends PostProcess { getClassName() { return "VRMultiviewToSingleviewPostProcess"; } - constructor(name9, camera21, scaleFactor) { - super(name9, "vrMultiviewToSingleview", ["imageIndex"], ["multiviewSampler"], scaleFactor, camera21, Texture.BILINEAR_SAMPLINGMODE); + constructor(name10, camera21, scaleFactor) { + super(name10, "vrMultiviewToSingleview", ["imageIndex"], ["multiviewSampler"], scaleFactor, camera21, Texture.BILINEAR_SAMPLINGMODE); const cam = camera21 !== null && camera21 !== undefined ? camera21 : this.getCamera(); this.onSizeChangedObservable.add(() => { }); @@ -67366,6 +70216,12 @@ class VRMultiviewToSingleviewPostProcess extends PostProcess { }); } } +var init_vrMultiviewToSingleviewPostProcess = __esm(() => { + init_texture(); + init_postProcess(); + init_vrMultiviewToSingleview_fragment(); + init_engine_multiview(); +}); // node_modules/@babylonjs/core/Cameras/RigModes/vrRigMode.js function setVRRigMode(camera21, rigParams) { @@ -67396,15 +70252,19 @@ function setVRRigMode(camera21, rigParams) { camera21._rigCameras[1]._rigPostProcess = new VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Right", camera21._rigCameras[1], true, metrics); } } - -// node_modules/@babylonjs/core/Cameras/VR/vrDeviceOrientationArcRotateCamera.js -Node2.AddNodeConstructor("VRDeviceOrientationArcRotateCamera", (name9, scene13) => { - return () => new VRDeviceOrientationArcRotateCamera(name9, 0, 0, 1, Vector3.Zero(), scene13); +var init_vrRigMode = __esm(() => { + init_math_vector(); + init_vrDistortionCorrectionPostProcess(); + init_vrMultiviewToSingleviewPostProcess(); + init_vrCameraMetrics(); + init_logger(); + init_math_viewport(); }); +// node_modules/@babylonjs/core/Cameras/VR/vrDeviceOrientationArcRotateCamera.js class VRDeviceOrientationArcRotateCamera extends ArcRotateCamera { - constructor(name9, alpha, beta, radius, target, scene13, compensateDistortion = true, vrCameraMetrics3 = VRCameraMetrics.GetDefault()) { - super(name9, alpha, beta, radius, target, scene13); + constructor(name10, alpha, beta, radius, target, scene13, compensateDistortion = true, vrCameraMetrics3 = VRCameraMetrics.GetDefault()) { + super(name10, alpha, beta, radius, target, scene13); this._setRigMode = (rigParams) => setVRRigMode(this, rigParams); vrCameraMetrics3.compensateDistortion = compensateDistortion; this.setCameraRigMode(Camera.RIG_MODE_VR, { vrCameraMetrics: vrCameraMetrics3 }); @@ -67414,14 +70274,23 @@ class VRDeviceOrientationArcRotateCamera extends ArcRotateCamera { return "VRDeviceOrientationArcRotateCamera"; } } -// node_modules/@babylonjs/core/Cameras/VR/vrDeviceOrientationFreeCamera.js -Node2.AddNodeConstructor("VRDeviceOrientationFreeCamera", (name9, scene13) => { - return () => new VRDeviceOrientationFreeCamera(name9, Vector3.Zero(), scene13); +var init_vrDeviceOrientationArcRotateCamera = __esm(() => { + init_camera(); + init_arcRotateCamera(); + init_vrCameraMetrics(); + init_math_vector(); + init_node(); + init_vrRigMode(); + init_arcRotateCameraVRDeviceOrientationInput(); + Node2.AddNodeConstructor("VRDeviceOrientationArcRotateCamera", (name10, scene13) => { + return () => new VRDeviceOrientationArcRotateCamera(name10, 0, 0, 1, Vector3.Zero(), scene13); + }); }); +// node_modules/@babylonjs/core/Cameras/VR/vrDeviceOrientationFreeCamera.js class VRDeviceOrientationFreeCamera extends DeviceOrientationCamera { - constructor(name9, position, scene13, compensateDistortion = true, vrCameraMetrics4 = VRCameraMetrics.GetDefault()) { - super(name9, position, scene13); + constructor(name10, position, scene13, compensateDistortion = true, vrCameraMetrics4 = VRCameraMetrics.GetDefault()) { + super(name10, position, scene13); this._setRigMode = (rigParams) => setVRRigMode(this, rigParams); vrCameraMetrics4.compensateDistortion = compensateDistortion; this.setCameraRigMode(Camera.RIG_MODE_VR, { vrCameraMetrics: vrCameraMetrics4 }); @@ -67430,14 +70299,22 @@ class VRDeviceOrientationFreeCamera extends DeviceOrientationCamera { return "VRDeviceOrientationFreeCamera"; } } -// node_modules/@babylonjs/core/Cameras/VR/vrDeviceOrientationGamepadCamera.js -Node2.AddNodeConstructor("VRDeviceOrientationGamepadCamera", (name9, scene13) => { - return () => new VRDeviceOrientationGamepadCamera(name9, Vector3.Zero(), scene13); +var init_vrDeviceOrientationFreeCamera = __esm(() => { + init_camera(); + init_deviceOrientationCamera(); + init_vrCameraMetrics(); + init_math_vector(); + init_node(); + init_vrRigMode(); + Node2.AddNodeConstructor("VRDeviceOrientationFreeCamera", (name10, scene13) => { + return () => new VRDeviceOrientationFreeCamera(name10, Vector3.Zero(), scene13); + }); }); +// node_modules/@babylonjs/core/Cameras/VR/vrDeviceOrientationGamepadCamera.js class VRDeviceOrientationGamepadCamera extends VRDeviceOrientationFreeCamera { - constructor(name9, position, scene13, compensateDistortion = true, vrCameraMetrics5 = VRCameraMetrics.GetDefault()) { - super(name9, position, scene13, compensateDistortion, vrCameraMetrics5); + constructor(name10, position, scene13, compensateDistortion = true, vrCameraMetrics5 = VRCameraMetrics.GetDefault()) { + super(name10, position, scene13, compensateDistortion, vrCameraMetrics5); this._setRigMode = (rigParams) => setVRRigMode(this, rigParams); this.inputs.addGamepad(); } @@ -67445,6 +70322,18 @@ class VRDeviceOrientationGamepadCamera extends VRDeviceOrientationFreeCamera { return "VRDeviceOrientationGamepadCamera"; } } +var init_vrDeviceOrientationGamepadCamera = __esm(() => { + init_vrDeviceOrientationFreeCamera(); + init_vrCameraMetrics(); + init_math_vector(); + init_node(); + init_vrRigMode(); + init_gamepadSceneComponent(); + Node2.AddNodeConstructor("VRDeviceOrientationGamepadCamera", (name10, scene13) => { + return () => new VRDeviceOrientationGamepadCamera(name10, Vector3.Zero(), scene13); + }); +}); + // node_modules/@babylonjs/core/Materials/prePassConfiguration.js class PrePassConfiguration { constructor() { @@ -67482,6 +70371,8 @@ class PrePassConfiguration { } } } +var init_prePassConfiguration = __esm(() => { +}); // node_modules/@babylonjs/core/Materials/materialFlags.js class MaterialFlags { @@ -67706,40 +70597,51 @@ class MaterialFlags { Engine2.MarkAllMaterialsAsDirty(1); } } -MaterialFlags._DiffuseTextureEnabled = true; -MaterialFlags._DetailTextureEnabled = true; -MaterialFlags._DecalMapEnabled = true; -MaterialFlags._AmbientTextureEnabled = true; -MaterialFlags._OpacityTextureEnabled = true; -MaterialFlags._ReflectionTextureEnabled = true; -MaterialFlags._EmissiveTextureEnabled = true; -MaterialFlags._SpecularTextureEnabled = true; -MaterialFlags._BumpTextureEnabled = true; -MaterialFlags._LightmapTextureEnabled = true; -MaterialFlags._RefractionTextureEnabled = true; -MaterialFlags._ColorGradingTextureEnabled = true; -MaterialFlags._FresnelEnabled = true; -MaterialFlags._ClearCoatTextureEnabled = true; -MaterialFlags._ClearCoatBumpTextureEnabled = true; -MaterialFlags._ClearCoatTintTextureEnabled = true; -MaterialFlags._SheenTextureEnabled = true; -MaterialFlags._AnisotropicTextureEnabled = true; -MaterialFlags._ThicknessTextureEnabled = true; -MaterialFlags._RefractionIntensityTextureEnabled = true; -MaterialFlags._TranslucencyIntensityTextureEnabled = true; -MaterialFlags._IridescenceTextureEnabled = true; +var init_materialFlags = __esm(() => { + init_engine(); + MaterialFlags._DiffuseTextureEnabled = true; + MaterialFlags._DetailTextureEnabled = true; + MaterialFlags._DecalMapEnabled = true; + MaterialFlags._AmbientTextureEnabled = true; + MaterialFlags._OpacityTextureEnabled = true; + MaterialFlags._ReflectionTextureEnabled = true; + MaterialFlags._EmissiveTextureEnabled = true; + MaterialFlags._SpecularTextureEnabled = true; + MaterialFlags._BumpTextureEnabled = true; + MaterialFlags._LightmapTextureEnabled = true; + MaterialFlags._RefractionTextureEnabled = true; + MaterialFlags._ColorGradingTextureEnabled = true; + MaterialFlags._FresnelEnabled = true; + MaterialFlags._ClearCoatTextureEnabled = true; + MaterialFlags._ClearCoatBumpTextureEnabled = true; + MaterialFlags._ClearCoatTintTextureEnabled = true; + MaterialFlags._SheenTextureEnabled = true; + MaterialFlags._AnisotropicTextureEnabled = true; + MaterialFlags._ThicknessTextureEnabled = true; + MaterialFlags._RefractionIntensityTextureEnabled = true; + MaterialFlags._TranslucencyIntensityTextureEnabled = true; + MaterialFlags._IridescenceTextureEnabled = true; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/decalFragmentDeclaration.js -var name9 = "decalFragmentDeclaration"; -var shader9 = `#ifdef DECAL +var name10, shader9; +var init_decalFragmentDeclaration = __esm(() => { + init_shaderStore(); + name10 = "decalFragmentDeclaration"; + shader9 = `#ifdef DECAL uniform vec4 vDecalInfos; #endif `; -ShaderStore.IncludesShadersStore[name9] = shader9; + ShaderStore.IncludesShadersStore[name10] = shader9; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/defaultFragmentDeclaration.js -var name10 = "defaultFragmentDeclaration"; -var shader10 = `uniform vec4 vEyePosition;uniform vec4 vDiffuseColor; +var name11, shader10; +var init_defaultFragmentDeclaration = __esm(() => { + init_shaderStore(); + init_decalFragmentDeclaration(); + name11 = "defaultFragmentDeclaration"; + shader10 = `uniform vec4 vEyePosition;uniform vec4 vDiffuseColor; #ifdef SPECULARTERM uniform vec4 vSpecularColor; #endif @@ -67812,21 +70714,29 @@ uniform vec4 vDetailInfos; #include #define ADDITIONAL_FRAGMENT_DECLARATION `; -ShaderStore.IncludesShadersStore[name10] = shader10; + ShaderStore.IncludesShadersStore[name11] = shader10; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/sceneUboDeclaration.js -var name11 = "sceneUboDeclaration"; -var shader11 = `layout(std140,column_major) uniform;uniform Scene {mat4 viewProjection; +var name12, shader11; +var init_sceneUboDeclaration = __esm(() => { + init_shaderStore(); + name12 = "sceneUboDeclaration"; + shader11 = `layout(std140,column_major) uniform;uniform Scene {mat4 viewProjection; #ifdef MULTIVIEW mat4 viewProjectionR; #endif mat4 view;mat4 projection;vec4 vEyePosition;}; `; -ShaderStore.IncludesShadersStore[name11] = shader11; + ShaderStore.IncludesShadersStore[name12] = shader11; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/meshUboDeclaration.js -var name12 = "meshUboDeclaration"; -var shader12 = `#ifdef WEBGL2 +var name13, shader12; +var init_meshUboDeclaration = __esm(() => { + init_shaderStore(); + name13 = "meshUboDeclaration"; + shader12 = `#ifdef WEBGL2 uniform mat4 world;uniform float visibility; #else layout(std140,column_major) uniform;uniform Mesh @@ -67834,22 +70744,32 @@ layout(std140,column_major) uniform;uniform Mesh #endif #define WORLD_UBO `; -ShaderStore.IncludesShadersStore[name12] = shader12; + ShaderStore.IncludesShadersStore[name13] = shader12; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/defaultUboDeclaration.js -var name13 = "defaultUboDeclaration"; -var shader13 = `layout(std140,column_major) uniform;uniform Material +var name14, shader13; +var init_defaultUboDeclaration = __esm(() => { + init_shaderStore(); + init_sceneUboDeclaration(); + init_meshUboDeclaration(); + name14 = "defaultUboDeclaration"; + shader13 = `layout(std140,column_major) uniform;uniform Material {vec4 diffuseLeftColor;vec4 diffuseRightColor;vec4 opacityParts;vec4 reflectionLeftColor;vec4 reflectionRightColor;vec4 refractionLeftColor;vec4 refractionRightColor;vec4 emissiveLeftColor;vec4 emissiveRightColor;vec2 vDiffuseInfos;vec2 vAmbientInfos;vec2 vOpacityInfos;vec2 vReflectionInfos;vec3 vReflectionPosition;vec3 vReflectionSize;vec2 vEmissiveInfos;vec2 vLightmapInfos;vec2 vSpecularInfos;vec3 vBumpInfos;mat4 diffuseMatrix;mat4 ambientMatrix;mat4 opacityMatrix;mat4 reflectionMatrix;mat4 emissiveMatrix;mat4 lightmapMatrix;mat4 specularMatrix;mat4 bumpMatrix;vec2 vTangentSpaceParams;float pointSize;float alphaCutOff;mat4 refractionMatrix;vec4 vRefractionInfos;vec3 vRefractionPosition;vec3 vRefractionSize;vec4 vSpecularColor;vec3 vEmissiveColor;vec4 vDiffuseColor;vec3 vAmbientColor; #define ADDITIONAL_UBO_DECLARATION }; #include #include `; -ShaderStore.IncludesShadersStore[name13] = shader13; + ShaderStore.IncludesShadersStore[name14] = shader13; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassDeclaration.js -var name14 = "prePassDeclaration"; -var shader14 = `#ifdef PREPASS +var name15, shader14; +var init_prePassDeclaration = __esm(() => { + init_shaderStore(); + name15 = "prePassDeclaration"; + shader14 = `#ifdef PREPASS #extension GL_EXT_draw_buffers : require layout(location=0) out highp vec4 glFragData[{X}];highp vec4 gl_FragColor; #ifdef PREPASS_DEPTH @@ -67860,11 +70780,15 @@ varying highp vec4 vCurrentPosition;varying highp vec4 vPreviousPosition; #endif #endif `; -ShaderStore.IncludesShadersStore[name14] = shader14; + ShaderStore.IncludesShadersStore[name15] = shader14; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/oitDeclaration.js -var name15 = "oitDeclaration"; -var shader15 = `#ifdef ORDER_INDEPENDENT_TRANSPARENCY +var name16, shader15; +var init_oitDeclaration = __esm(() => { + init_shaderStore(); + name16 = "oitDeclaration"; + shader15 = `#ifdef ORDER_INDEPENDENT_TRANSPARENCY #extension GL_EXT_draw_buffers : require layout(location=0) out vec2 depth; layout(location=1) out vec4 frontColor;layout(location=2) out vec4 backColor; @@ -67872,19 +70796,27 @@ layout(location=1) out vec4 frontColor;layout(location=2) out vec4 backColor; highp vec4 gl_FragColor;uniform sampler2D oitDepthSampler;uniform sampler2D oitFrontColorSampler; #endif `; -ShaderStore.IncludesShadersStore[name15] = shader15; + ShaderStore.IncludesShadersStore[name16] = shader15; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/mainUVVaryingDeclaration.js -var name16 = "mainUVVaryingDeclaration"; -var shader16 = `#ifdef MAINUV{X} +var name17, shader16; +var init_mainUVVaryingDeclaration = __esm(() => { + init_shaderStore(); + name17 = "mainUVVaryingDeclaration"; + shader16 = `#ifdef MAINUV{X} varying vec2 vMainUV{X}; #endif `; -ShaderStore.IncludesShadersStore[name16] = shader16; + ShaderStore.IncludesShadersStore[name17] = shader16; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js -var name17 = "helperFunctions"; -var shader17 = `const float PI=3.1415926535897932384626433832795;const float RECIPROCAL_PI=0.3183098861837907;const float RECIPROCAL_PI2=0.15915494309189535;const float HALF_MIN=5.96046448e-08; +var name18, shader17; +var init_helperFunctions = __esm(() => { + init_shaderStore(); + name18 = "helperFunctions"; + shader17 = `const float PI=3.1415926535897932384626433832795;const float RECIPROCAL_PI=0.3183098861837907;const float RECIPROCAL_PI2=0.15915494309189535;const float HALF_MIN=5.96046448e-08; const float LinearEncodePowerApprox=2.2;const float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;const vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);const float Epsilon=0.0000001; #define saturate(x) clamp(x,0.0,1.0) #define absEps(x) abs(x)+Epsilon @@ -67985,11 +70917,15 @@ const float rgbdMaxRange=255.0;vec4 toRGBD(vec3 color) {float maxRGB=maxEps(max( vec3 fromRGBD(vec4 rgbd) {rgbd.rgb=toLinearSpace(rgbd.rgb);return rgbd.rgb/rgbd.a;} vec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {vec3 invOrigVec=vec3(1.0,1.0,1.0)/origVec;vec3 halfSize=cubeSize*0.5;vec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;vec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;vec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);float distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);vec3 intersectPositionWS=vertexPos+origVec*distance;return intersectPositionWS-cubePos;} `; -ShaderStore.IncludesShadersStore[name17] = shader17; + ShaderStore.IncludesShadersStore[name18] = shader17; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js -var name18 = "lightFragmentDeclaration"; -var shader18 = `#ifdef LIGHT{X} +var name19, shader18; +var init_lightFragmentDeclaration = __esm(() => { + init_shaderStore(); + name19 = "lightFragmentDeclaration"; + shader18 = `#ifdef LIGHT{X} uniform vec4 vLightData{X};uniform vec4 vLightDiffuse{X}; #ifdef SPECULARTERM uniform vec4 vLightSpecular{X}; @@ -68052,11 +70988,15 @@ uniform mat4 textureProjectionMatrix{X};uniform sampler2D projectionLightSampler #endif #endif `; -ShaderStore.IncludesShadersStore[name18] = shader18; + ShaderStore.IncludesShadersStore[name19] = shader18; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js -var name19 = "lightUboDeclaration"; -var shader19 = `#ifdef LIGHT{X} +var name20, shader19; +var init_lightUboDeclaration = __esm(() => { + init_shaderStore(); + name20 = "lightUboDeclaration"; + shader19 = `#ifdef LIGHT{X} uniform Light{X} {vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular; #ifdef SPOTLIGHT{X} @@ -68115,11 +71055,15 @@ uniform mat4 lightMatrix{X}; #endif #endif `; -ShaderStore.IncludesShadersStore[name19] = shader19; + ShaderStore.IncludesShadersStore[name20] = shader19; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/lightsFragmentFunctions.js -var name20 = "lightsFragmentFunctions"; -var shader20 = `struct lightingInfo +var name21, shader20; +var init_lightsFragmentFunctions = __esm(() => { + init_shaderStore(); + name21 = "lightsFragmentFunctions"; + shader20 = `struct lightingInfo {vec3 diffuse; #ifdef SPECULARTERM vec3 specular; @@ -68169,11 +71113,15 @@ vec3 angleW=normalize(viewDirectionW+lightData.xyz);float specComp=max(0.,dot(vN return result;} #define inline vec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix){vec4 strq=textureProjectionMatrix*vec4(vPositionW,1.0);strq/=strq.w;vec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;return textureColor;}`; -ShaderStore.IncludesShadersStore[name20] = shader20; + ShaderStore.IncludesShadersStore[name21] = shader20; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js -var name21 = "shadowsFragmentFunctions"; -var shader21 = `#ifdef SHADOWS +var name22, shader21; +var init_shadowsFragmentFunctions = __esm(() => { + init_shaderStore(); + name22 = "shadowsFragmentFunctions"; + shader21 = `#ifdef SHADOWS #if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) #define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l) #else @@ -68500,11 +71448,15 @@ float computeShadowWithCSMPCSS64(float layer,vec4 vPositionFromLight,float depth #endif #endif `; -ShaderStore.IncludesShadersStore[name21] = shader21; + ShaderStore.IncludesShadersStore[name22] = shader21; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerFragmentDeclaration.js -var name22 = "samplerFragmentDeclaration"; -var shader22 = `#ifdef _DEFINENAME_ +var name23, shader22; +var init_samplerFragmentDeclaration = __esm(() => { + init_shaderStore(); + name23 = "samplerFragmentDeclaration"; + shader22 = `#ifdef _DEFINENAME_ #if _DEFINENAME_DIRECTUV==1 #define v_VARYINGNAME_UV vMainUV1 #elif _DEFINENAME_DIRECTUV==2 @@ -68523,20 +71475,28 @@ varying vec2 v_VARYINGNAME_UV; uniform sampler2D _SAMPLERNAME_Sampler; #endif `; -ShaderStore.IncludesShadersStore[name22] = shader22; + ShaderStore.IncludesShadersStore[name23] = shader22; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/fresnelFunction.js -var name23 = "fresnelFunction"; -var shader23 = `#ifdef FRESNEL +var name24, shader23; +var init_fresnelFunction = __esm(() => { + init_shaderStore(); + name24 = "fresnelFunction"; + shader23 = `#ifdef FRESNEL float computeFresnelTerm(vec3 viewDirection,vec3 worldNormal,float bias,float power) {float fresnelTerm=pow(bias+abs(dot(viewDirection,worldNormal)),power);return clamp(fresnelTerm,0.,1.);} #endif `; -ShaderStore.IncludesShadersStore[name23] = shader23; + ShaderStore.IncludesShadersStore[name24] = shader23; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/reflectionFunction.js -var name24 = "reflectionFunction"; -var shader24 = `vec3 computeFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction) +var name25, shader24; +var init_reflectionFunction = __esm(() => { + init_shaderStore(); + name25 = "reflectionFunction"; + shader24 = `vec3 computeFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction) {float lon=atan(direction.z,direction.x);float lat=acos(direction.y);vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;float s=sphereCoords.x*0.5+0.5;float t=sphereCoords.y;return vec3(s,t,0); } vec3 computeMirroredFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction) {float lon=atan(direction.z,direction.x);float lat=acos(direction.y);vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;float s=sphereCoords.x*0.5+0.5;float t=sphereCoords.y;return vec3(1.0-s,t,0); } @@ -68599,11 +71559,15 @@ return vec3(0,0,0); } #endif `; -ShaderStore.IncludesShadersStore[name24] = shader24; + ShaderStore.IncludesShadersStore[name25] = shader24; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingDeclaration.js -var name25 = "imageProcessingDeclaration"; -var shader25 = `#ifdef EXPOSURE +var name26, shader25; +var init_imageProcessingDeclaration = __esm(() => { + init_shaderStore(); + name26 = "imageProcessingDeclaration"; + shader25 = `#ifdef EXPOSURE uniform float exposureLinear; #endif #ifdef CONTRAST @@ -68630,11 +71594,15 @@ uniform vec4 colorTransformSettings; uniform float ditherIntensity; #endif `; -ShaderStore.IncludesShadersStore[name25] = shader25; + ShaderStore.IncludesShadersStore[name26] = shader25; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingFunctions.js -var name26 = "imageProcessingFunctions"; -var shader26 = `#if defined(COLORGRADING) && !defined(COLORGRADING3D) +var name27, shader26; +var init_imageProcessingFunctions = __esm(() => { + init_shaderStore(); + name27 = "imageProcessingFunctions"; + shader26 = `#if defined(COLORGRADING) && !defined(COLORGRADING3D) /** * Polyfill for SAMPLE_TEXTURE_3D,which is unsupported in WebGL. * sampler3dSetting.x=textureOffset (0.5/textureSize). @@ -68719,11 +71687,15 @@ float rand=getRand(gl_FragCoord.xy*vInverseScreenSize);float dither=mix(-ditherI #endif #define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATEND return result;}`; -ShaderStore.IncludesShadersStore[name26] = shader26; + ShaderStore.IncludesShadersStore[name27] = shader26; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentMainFunctions.js -var name27 = "bumpFragmentMainFunctions"; -var shader27 = `#if defined(BUMP) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(DETAIL) +var name28, shader27; +var init_bumpFragmentMainFunctions = __esm(() => { + init_shaderStore(); + name28 = "bumpFragmentMainFunctions"; + shader27 = `#if defined(BUMP) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(DETAIL) #if defined(TANGENT) && defined(NORMAL) varying mat3 vTBN; #endif @@ -68785,11 +71757,16 @@ mat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv,vec2 tangentSpaceParams) {vec3 dp1=dFdx(p);vec3 dp2=dFdy(p);vec2 duv1=dFdx(uv);vec2 duv2=dFdy(uv);vec3 dp2perp=cross(dp2,normal);vec3 dp1perp=cross(normal,dp1);vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;vec3 bitangent=dp2perp*duv1.y+dp1perp*duv2.y;tangent*=tangentSpaceParams.x;bitangent*=tangentSpaceParams.y;float det=max(dot(tangent,tangent),dot(bitangent,bitangent));float invmax=det==0.0 ? 0.0 : inversesqrt(det);return mat3(tangent*invmax,bitangent*invmax,normal);} #endif `; -ShaderStore.IncludesShadersStore[name27] = shader27; + ShaderStore.IncludesShadersStore[name28] = shader27; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragmentFunctions.js -var name28 = "bumpFragmentFunctions"; -var shader28 = `#if defined(BUMP) +var name29, shader28; +var init_bumpFragmentFunctions = __esm(() => { + init_shaderStore(); + init_samplerFragmentDeclaration(); + name29 = "bumpFragmentFunctions"; + shader28 = `#if defined(BUMP) #include(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_SAMPLERNAME_,bump) #endif #if defined(DETAIL) @@ -68820,11 +71797,15 @@ return -texCoordOffset; } #endif `; -ShaderStore.IncludesShadersStore[name28] = shader28; + ShaderStore.IncludesShadersStore[name29] = shader28; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js -var name29 = "clipPlaneFragmentDeclaration"; -var shader29 = `#ifdef CLIPPLANE +var name30, shader29; +var init_clipPlaneFragmentDeclaration = __esm(() => { + init_shaderStore(); + name30 = "clipPlaneFragmentDeclaration"; + shader29 = `#ifdef CLIPPLANE varying float fClipDistance; #endif #ifdef CLIPPLANE2 @@ -68843,19 +71824,27 @@ varying float fClipDistance5; varying float fClipDistance6; #endif `; -ShaderStore.IncludesShadersStore[name29] = shader29; + ShaderStore.IncludesShadersStore[name30] = shader29; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js -var name30 = "logDepthDeclaration"; -var shader30 = `#ifdef LOGARITHMICDEPTH +var name31, shader30; +var init_logDepthDeclaration = __esm(() => { + init_shaderStore(); + name31 = "logDepthDeclaration"; + shader30 = `#ifdef LOGARITHMICDEPTH uniform float logarithmicDepthConstant;varying float vFragmentDepth; #endif `; -ShaderStore.IncludesShadersStore[name30] = shader30; + ShaderStore.IncludesShadersStore[name31] = shader30; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js -var name31 = "fogFragmentDeclaration"; -var shader31 = `#ifdef FOG +var name32, shader31; +var init_fogFragmentDeclaration = __esm(() => { + init_shaderStore(); + name32 = "fogFragmentDeclaration"; + shader31 = `#ifdef FOG #define FOGMODE_NONE 0. #define FOGMODE_EXP 1. #define FOGMODE_EXP2 2. @@ -68871,11 +71860,15 @@ else if (FOGMODE_EXP2==vFogInfos.x) return clamp(fogCoeff,0.0,1.0);} #endif `; -ShaderStore.IncludesShadersStore[name31] = shader31; + ShaderStore.IncludesShadersStore[name32] = shader31; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js -var name32 = "clipPlaneFragment"; -var shader32 = `#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6) +var name33, shader32; +var init_clipPlaneFragment = __esm(() => { + init_shaderStore(); + name33 = "clipPlaneFragment"; + shader32 = `#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6) if (false) {} #endif #ifdef CLIPPLANE @@ -68903,11 +71896,15 @@ else if (fClipDistance6>0.0) {discard;} #endif `; -ShaderStore.IncludesShadersStore[name32] = shader32; + ShaderStore.IncludesShadersStore[name33] = shader32; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpFragment.js -var name33 = "bumpFragment"; -var shader33 = `vec2 uvOffset=vec2(0.0,0.0); +var name34, shader33; +var init_bumpFragment = __esm(() => { + init_shaderStore(); + name34 = "bumpFragment"; + shader33 = `vec2 uvOffset=vec2(0.0,0.0); #if defined(BUMP) || defined(PARALLAX) || defined(DETAIL) #ifdef NORMALXYSCALE float normalScale=1.0; @@ -68960,11 +71957,15 @@ normalW=perturbNormalBase(TBN,blendedNormal,vBumpInfos.y); detailNormal.xy*=vDetailInfos.z;normalW=perturbNormalBase(TBN,detailNormal,vDetailInfos.z); #endif `; -ShaderStore.IncludesShadersStore[name33] = shader33; + ShaderStore.IncludesShadersStore[name34] = shader33; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/decalFragment.js -var name34 = "decalFragment"; -var shader34 = `#ifdef DECAL +var name35, shader34; +var init_decalFragment = __esm(() => { + init_shaderStore(); + name35 = "decalFragment"; + shader34 = `#ifdef DECAL #ifdef GAMMADECAL decalColor.rgb=toLinearSpace(decalColor.rgb); #endif @@ -68974,19 +71975,27 @@ decalColor.a*=decalColor.a; surfaceAlbedo.rgb=mix(surfaceAlbedo.rgb,decalColor.rgb,decalColor.a); #endif `; -ShaderStore.IncludesShadersStore[name34] = shader34; + ShaderStore.IncludesShadersStore[name35] = shader34; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/depthPrePass.js -var name35 = "depthPrePass"; -var shader35 = `#ifdef DEPTHPREPASS +var name36, shader35; +var init_depthPrePass = __esm(() => { + init_shaderStore(); + name36 = "depthPrePass"; + shader35 = `#ifdef DEPTHPREPASS gl_FragColor=vec4(0.,0.,0.,1.0);return; #endif `; -ShaderStore.IncludesShadersStore[name35] = shader35; + ShaderStore.IncludesShadersStore[name36] = shader35; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/lightFragment.js -var name36 = "lightFragment"; -var shader36 = `#ifdef LIGHT{X} +var name37, shader36; +var init_lightFragment = __esm(() => { + init_shaderStore(); + name37 = "lightFragment"; + shader36 = `#ifdef LIGHT{X} #if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X}) #else #ifdef PBR @@ -69249,19 +72258,27 @@ sheenBase+=info.sheen.rgb*shadow; #endif #endif `; -ShaderStore.IncludesShadersStore[name36] = shader36; + ShaderStore.IncludesShadersStore[name37] = shader36; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js -var name37 = "logDepthFragment"; -var shader37 = `#ifdef LOGARITHMICDEPTH +var name38, shader37; +var init_logDepthFragment = __esm(() => { + init_shaderStore(); + name38 = "logDepthFragment"; + shader37 = `#ifdef LOGARITHMICDEPTH gl_FragDepthEXT=log2(vFragmentDepth)*logarithmicDepthConstant*0.5; #endif `; -ShaderStore.IncludesShadersStore[name37] = shader37; + ShaderStore.IncludesShadersStore[name38] = shader37; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/fogFragment.js -var name38 = "fogFragment"; -var shader38 = `#ifdef FOG +var name39, shader38; +var init_fogFragment = __esm(() => { + init_shaderStore(); + name39 = "fogFragment"; + shader38 = `#ifdef FOG float fog=CalcFogFactor(); #ifdef PBR fog=toLinearSpace(fog); @@ -69269,11 +72286,15 @@ fog=toLinearSpace(fog); color.rgb=mix(vFogColor,color.rgb,fog); #endif `; -ShaderStore.IncludesShadersStore[name38] = shader38; + ShaderStore.IncludesShadersStore[name39] = shader38; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/oitFragment.js -var name39 = "oitFragment"; -var shader39 = `#ifdef ORDER_INDEPENDENT_TRANSPARENCY +var name40, shader39; +var init_oitFragment = __esm(() => { + init_shaderStore(); + name40 = "oitFragment"; + shader39 = `#ifdef ORDER_INDEPENDENT_TRANSPARENCY float fragDepth=gl_FragCoord.z; #ifdef ORDER_INDEPENDENT_TRANSPARENCY_16BITS uint halfFloat=packHalf2x16(vec2(fragDepth));vec2 full=unpackHalf2x16(halfFloat);fragDepth=full.x; @@ -69299,11 +72320,43 @@ if (fragDepth>nearestDepth && fragDepth +var name41, shader40; +var init_default_fragment = __esm(() => { + init_shaderStore(); + init_defaultFragmentDeclaration(); + init_defaultUboDeclaration(); + init_prePassDeclaration(); + init_oitDeclaration(); + init_mainUVVaryingDeclaration(); + init_helperFunctions(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_lightsFragmentFunctions(); + init_shadowsFragmentFunctions(); + init_samplerFragmentDeclaration(); + init_fresnelFunction(); + init_reflectionFunction(); + init_imageProcessingDeclaration(); + init_imageProcessingFunctions(); + init_bumpFragmentMainFunctions(); + init_bumpFragmentFunctions(); + init_clipPlaneFragmentDeclaration(); + init_logDepthDeclaration(); + init_fogFragmentDeclaration(); + init_clipPlaneFragment(); + init_bumpFragment(); + init_decalFragment(); + init_depthPrePass(); + init_lightFragment(); + init_logDepthFragment(); + init_fogFragment(); + init_oitFragment(); + name41 = "defaultPixelShader"; + shader40 = `#include<__decl__defaultFragment> #if defined(BUMP) || !defined(NORMAL) #extension GL_OES_standard_derivatives : enable #endif @@ -69633,19 +72686,28 @@ if (fragDepth==nearestDepth) {frontColor.rgb+=color.rgb*color.a*alphaMultiplier; #define CUSTOM_FRAGMENT_MAIN_END } `; -ShaderStore.ShadersStore[name40] = shader40; + ShaderStore.ShadersStore[name41] = shader40; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/decalVertexDeclaration.js -var name41 = "decalVertexDeclaration"; -var shader41 = `#ifdef DECAL +var name42, shader41; +var init_decalVertexDeclaration = __esm(() => { + init_shaderStore(); + name42 = "decalVertexDeclaration"; + shader41 = `#ifdef DECAL uniform vec4 vDecalInfos;uniform mat4 decalMatrix; #endif `; -ShaderStore.IncludesShadersStore[name41] = shader41; + ShaderStore.IncludesShadersStore[name42] = shader41; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/defaultVertexDeclaration.js -var name42 = "defaultVertexDeclaration"; -var shader42 = `uniform mat4 viewProjection;uniform mat4 view; +var name43, shader42; +var init_defaultVertexDeclaration = __esm(() => { + init_shaderStore(); + init_decalVertexDeclaration(); + name43 = "defaultVertexDeclaration"; + shader42 = `uniform mat4 viewProjection;uniform mat4 view; #ifdef DIFFUSE uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos; #endif @@ -69679,19 +72741,27 @@ uniform vec4 vDetailInfos;uniform mat4 detailMatrix; #include #define ADDITIONAL_VERTEX_DECLARATION `; -ShaderStore.IncludesShadersStore[name42] = shader42; + ShaderStore.IncludesShadersStore[name43] = shader42; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/uvAttributeDeclaration.js -var name43 = "uvAttributeDeclaration"; -var shader43 = `#ifdef UV{X} +var name44, shader43; +var init_uvAttributeDeclaration = __esm(() => { + init_shaderStore(); + name44 = "uvAttributeDeclaration"; + shader43 = `#ifdef UV{X} attribute vec2 uv{X}; #endif `; -ShaderStore.IncludesShadersStore[name43] = shader43; + ShaderStore.IncludesShadersStore[name44] = shader43; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js -var name44 = "bonesDeclaration"; -var shader44 = `#if NUM_BONE_INFLUENCERS>0 +var name45, shader44; +var init_bonesDeclaration = __esm(() => { + init_shaderStore(); + name45 = "bonesDeclaration"; + shader44 = `#if NUM_BONE_INFLUENCERS>0 attribute vec4 matricesIndices;attribute vec4 matricesWeights; #if NUM_BONE_INFLUENCERS>4 attribute vec4 matricesIndicesExtra;attribute vec4 matricesWeightsExtra; @@ -69713,11 +72783,15 @@ mat4 readMatrixFromRawSampler(sampler2D smp,float index) #endif #endif `; -ShaderStore.IncludesShadersStore[name44] = shader44; + ShaderStore.IncludesShadersStore[name45] = shader44; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js -var name45 = "bakedVertexAnimationDeclaration"; -var shader45 = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE +var name46, shader45; +var init_bakedVertexAnimationDeclaration = __esm(() => { + init_shaderStore(); + name46 = "bakedVertexAnimationDeclaration"; + shader45 = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE uniform float bakedVertexAnimationTime;uniform vec2 bakedVertexAnimationTextureSizeInverted;uniform vec4 bakedVertexAnimationSettings;uniform sampler2D bakedVertexAnimationTexture; #ifdef INSTANCES attribute vec4 bakedVertexAnimationSettingsInstanced; @@ -69727,11 +72801,15 @@ mat4 readMatrixFromRawSamplerVAT(sampler2D smp,float index,float frame) {float offset=index*4.0;float frameUV=(frame+0.5)*bakedVertexAnimationTextureSizeInverted.y;float dx=bakedVertexAnimationTextureSizeInverted.x;vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),frameUV));vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),frameUV));vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),frameUV));vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),frameUV));return mat4(m0,m1,m2,m3);} #endif `; -ShaderStore.IncludesShadersStore[name45] = shader45; + ShaderStore.IncludesShadersStore[name46] = shader45; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js -var name46 = "instancesDeclaration"; -var shader46 = `#ifdef INSTANCES +var name47, shader46; +var init_instancesDeclaration = __esm(() => { + init_shaderStore(); + name47 = "instancesDeclaration"; + shader46 = `#ifdef INSTANCES attribute vec4 world0;attribute vec4 world1;attribute vec4 world2;attribute vec4 world3; #ifdef INSTANCESCOLOR attribute vec4 instanceColor; @@ -69754,11 +72832,15 @@ uniform mat4 previousWorld; #endif #endif `; -ShaderStore.IncludesShadersStore[name46] = shader46; + ShaderStore.IncludesShadersStore[name47] = shader46; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertexDeclaration.js -var name47 = "prePassVertexDeclaration"; -var shader47 = `#ifdef PREPASS +var name48, shader47; +var init_prePassVertexDeclaration = __esm(() => { + init_shaderStore(); + name48 = "prePassVertexDeclaration"; + shader47 = `#ifdef PREPASS #ifdef PREPASS_DEPTH varying vec3 vViewPos; #endif @@ -69767,29 +72849,41 @@ uniform mat4 previousViewProjection;varying vec4 vCurrentPosition;varying vec4 v #endif #endif `; -ShaderStore.IncludesShadersStore[name47] = shader47; + ShaderStore.IncludesShadersStore[name48] = shader47; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexDeclaration.js -var name48 = "samplerVertexDeclaration"; -var shader48 = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0 +var name49, shader48; +var init_samplerVertexDeclaration = __esm(() => { + init_shaderStore(); + name49 = "samplerVertexDeclaration"; + shader48 = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0 varying vec2 v_VARYINGNAME_UV; #endif `; -ShaderStore.IncludesShadersStore[name48] = shader48; + ShaderStore.IncludesShadersStore[name49] = shader48; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertexDeclaration.js -var name49 = "bumpVertexDeclaration"; -var shader49 = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) +var name50, shader49; +var init_bumpVertexDeclaration = __esm(() => { + init_shaderStore(); + name50 = "bumpVertexDeclaration"; + shader49 = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) #if defined(TANGENT) && defined(NORMAL) varying mat3 vTBN; #endif #endif `; -ShaderStore.IncludesShadersStore[name49] = shader49; + ShaderStore.IncludesShadersStore[name50] = shader49; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js -var name50 = "clipPlaneVertexDeclaration"; -var shader50 = `#ifdef CLIPPLANE +var name51, shader50; +var init_clipPlaneVertexDeclaration = __esm(() => { + init_shaderStore(); + name51 = "clipPlaneVertexDeclaration"; + shader50 = `#ifdef CLIPPLANE uniform vec4 vClipPlane;varying float fClipDistance; #endif #ifdef CLIPPLANE2 @@ -69808,19 +72902,27 @@ uniform vec4 vClipPlane5;varying float fClipDistance5; uniform vec4 vClipPlane6;varying float fClipDistance6; #endif `; -ShaderStore.IncludesShadersStore[name50] = shader50; + ShaderStore.IncludesShadersStore[name51] = shader50; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js -var name51 = "fogVertexDeclaration"; -var shader51 = `#ifdef FOG +var name52, shader51; +var init_fogVertexDeclaration = __esm(() => { + init_shaderStore(); + name52 = "fogVertexDeclaration"; + shader51 = `#ifdef FOG varying vec3 vFogDistance; #endif `; -ShaderStore.IncludesShadersStore[name51] = shader51; + ShaderStore.IncludesShadersStore[name52] = shader51; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxFragmentDeclaration.js -var name52 = "lightVxFragmentDeclaration"; -var shader52 = `#ifdef LIGHT{X} +var name53, shader52; +var init_lightVxFragmentDeclaration = __esm(() => { + init_shaderStore(); + name53 = "lightVxFragmentDeclaration"; + shader52 = `#ifdef LIGHT{X} uniform vec4 vLightData{X};uniform vec4 vLightDiffuse{X}; #ifdef SPECULARTERM uniform vec4 vLightSpecular{X}; @@ -69845,11 +72947,15 @@ uniform vec3 vLightGround{X}; #endif #endif `; -ShaderStore.IncludesShadersStore[name52] = shader52; + ShaderStore.IncludesShadersStore[name53] = shader52; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/lightVxUboDeclaration.js -var name53 = "lightVxUboDeclaration"; -var shader53 = `#ifdef LIGHT{X} +var name54, shader53; +var init_lightVxUboDeclaration = __esm(() => { + init_shaderStore(); + name54 = "lightVxUboDeclaration"; + shader53 = `#ifdef LIGHT{X} uniform Light{X} {vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular; #ifdef SPOTLIGHT{X} @@ -69870,11 +72976,15 @@ varying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 li #endif #endif `; -ShaderStore.IncludesShadersStore[name53] = shader53; + ShaderStore.IncludesShadersStore[name54] = shader53; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js -var name54 = "morphTargetsVertexGlobalDeclaration"; -var shader54 = `#ifdef MORPHTARGETS +var name55, shader54; +var init_morphTargetsVertexGlobalDeclaration = __esm(() => { + init_shaderStore(); + name55 = "morphTargetsVertexGlobalDeclaration"; + shader54 = `#ifdef MORPHTARGETS uniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS]; #ifdef MORPHTARGETS_TEXTURE uniform float morphTargetTextureIndices[NUM_MORPH_INFLUENCERS];uniform vec3 morphTargetTextureInfo;uniform highp sampler2DArray morphTargets;vec3 readVector3FromRawSampler(int targetIndex,float vertexIndex) @@ -69883,11 +72993,15 @@ float y=floor(vertexIndex/morphTargetTextureInfo.y);float x=vertexIndex-y*morphT #endif #endif `; -ShaderStore.IncludesShadersStore[name54] = shader54; + ShaderStore.IncludesShadersStore[name55] = shader54; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js -var name55 = "morphTargetsVertexDeclaration"; -var shader55 = `#ifdef MORPHTARGETS +var name56, shader55; +var init_morphTargetsVertexDeclaration = __esm(() => { + init_shaderStore(); + name56 = "morphTargetsVertexDeclaration"; + shader55 = `#ifdef MORPHTARGETS #ifndef MORPHTARGETS_TEXTURE attribute vec3 position{X}; #ifdef MORPHTARGETS_NORMAL @@ -69902,21 +73016,29 @@ attribute vec2 uv_{X}; #endif #endif `; -ShaderStore.IncludesShadersStore[name55] = shader55; + ShaderStore.IncludesShadersStore[name56] = shader55; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertexGlobal.js -var name56 = "morphTargetsVertexGlobal"; -var shader56 = `#ifdef MORPHTARGETS +var name57, shader56; +var init_morphTargetsVertexGlobal = __esm(() => { + init_shaderStore(); + name57 = "morphTargetsVertexGlobal"; + shader56 = `#ifdef MORPHTARGETS #ifdef MORPHTARGETS_TEXTURE float vertexID; #endif #endif `; -ShaderStore.IncludesShadersStore[name56] = shader56; + ShaderStore.IncludesShadersStore[name57] = shader56; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/morphTargetsVertex.js -var name57 = "morphTargetsVertex"; -var shader57 = `#ifdef MORPHTARGETS +var name58, shader57; +var init_morphTargetsVertex = __esm(() => { + init_shaderStore(); + name58 = "morphTargetsVertex"; + shader57 = `#ifdef MORPHTARGETS #ifdef MORPHTARGETS_TEXTURE vertexID=float(gl_VertexID)*morphTargetTextureInfo.x;positionUpdated+=(readVector3FromRawSampler({X},vertexID)-position)*morphTargetInfluences[{X}];vertexID+=1.0; #ifdef MORPHTARGETS_NORMAL @@ -69942,11 +73064,15 @@ uvUpdated+=(uv_{X}-uv)*morphTargetInfluences[{X}]; #endif #endif `; -ShaderStore.IncludesShadersStore[name57] = shader57; + ShaderStore.IncludesShadersStore[name58] = shader57; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js -var name58 = "instancesVertex"; -var shader58 = `#ifdef INSTANCES +var name59, shader58; +var init_instancesVertex = __esm(() => { + init_shaderStore(); + name59 = "instancesVertex"; + shader58 = `#ifdef INSTANCES mat4 finalWorld=mat4(world0,world1,world2,world3); #if defined(PREPASS_VELOCITY) || defined(VELOCITY) mat4 finalPreviousWorld=mat4(previousWorld0,previousWorld1,previousWorld2,previousWorld3); @@ -69964,11 +73090,15 @@ mat4 finalPreviousWorld=previousWorld; #endif #endif `; -ShaderStore.IncludesShadersStore[name58] = shader58; + ShaderStore.IncludesShadersStore[name59] = shader58; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js -var name59 = "bonesVertex"; -var shader59 = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE +var name60, shader59; +var init_bonesVertex = __esm(() => { + init_shaderStore(); + name60 = "bonesVertex"; + shader59 = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE #if NUM_BONE_INFLUENCERS>0 mat4 influence; #ifdef BONETEXTURE @@ -70022,11 +73152,15 @@ finalWorld=finalWorld*influence; #endif #endif `; -ShaderStore.IncludesShadersStore[name59] = shader59; + ShaderStore.IncludesShadersStore[name60] = shader59; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js -var name60 = "bakedVertexAnimation"; -var shader60 = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE +var name61, shader60; +var init_bakedVertexAnimation = __esm(() => { + init_shaderStore(); + name61 = "bakedVertexAnimation"; + shader60 = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE { #ifdef INSTANCES #define BVASNAME bakedVertexAnimationSettingsInstanced @@ -70058,11 +73192,15 @@ VATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIn finalWorld=finalWorld*VATInfluence;} #endif `; -ShaderStore.IncludesShadersStore[name60] = shader60; + ShaderStore.IncludesShadersStore[name61] = shader60; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/prePassVertex.js -var name61 = "prePassVertex"; -var shader61 = `#ifdef PREPASS_DEPTH +var name62, shader61; +var init_prePassVertex = __esm(() => { + init_shaderStore(); + name62 = "prePassVertex"; + shader61 = `#ifdef PREPASS_DEPTH vViewPos=(view*worldPos).rgb; #endif #if defined(PREPASS_VELOCITY) && defined(BONES_VELOCITY_ENABLED) @@ -70096,22 +73234,30 @@ vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated #endif #endif `; -ShaderStore.IncludesShadersStore[name61] = shader61; + ShaderStore.IncludesShadersStore[name62] = shader61; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/uvVariableDeclaration.js -var name62 = "uvVariableDeclaration"; -var shader62 = `#if !defined(UV{X}) && defined(MAINUV{X}) +var name63, shader62; +var init_uvVariableDeclaration = __esm(() => { + init_shaderStore(); + name63 = "uvVariableDeclaration"; + shader62 = `#if !defined(UV{X}) && defined(MAINUV{X}) vec2 uv{X}=vec2(0.,0.); #endif #ifdef MAINUV{X} vMainUV{X}=uv{X}; #endif `; -ShaderStore.IncludesShadersStore[name62] = shader62; + ShaderStore.IncludesShadersStore[name63] = shader62; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerVertexImplementation.js -var name63 = "samplerVertexImplementation"; -var shader63 = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0 +var name64, shader63; +var init_samplerVertexImplementation = __esm(() => { + init_shaderStore(); + name64 = "samplerVertexImplementation"; + shader63 = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0 if (v_INFONAME_==0.) {v_VARYINGNAME_UV=vec2(_MATRIXNAME_Matrix*vec4(uvUpdated,1.0,0.0));} #ifdef UV2 @@ -70136,21 +73282,29 @@ else if (v_INFONAME_==5.) #endif #endif `; -ShaderStore.IncludesShadersStore[name63] = shader63; + ShaderStore.IncludesShadersStore[name64] = shader63; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/bumpVertex.js -var name64 = "bumpVertex"; -var shader64 = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) +var name65, shader64; +var init_bumpVertex = __esm(() => { + init_shaderStore(); + name65 = "bumpVertex"; + shader64 = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) #if defined(TANGENT) && defined(NORMAL) vec3 tbnNormal=normalize(normalUpdated);vec3 tbnTangent=normalize(tangentUpdated.xyz);vec3 tbnBitangent=cross(tbnNormal,tbnTangent)*tangentUpdated.w;vTBN=mat3(finalWorld)*mat3(tbnTangent,tbnBitangent,tbnNormal); #endif #endif `; -ShaderStore.IncludesShadersStore[name64] = shader64; + ShaderStore.IncludesShadersStore[name65] = shader64; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js -var name65 = "clipPlaneVertex"; -var shader65 = `#ifdef CLIPPLANE +var name66, shader65; +var init_clipPlaneVertex = __esm(() => { + init_shaderStore(); + name66 = "clipPlaneVertex"; + shader65 = `#ifdef CLIPPLANE fClipDistance=dot(worldPos,vClipPlane); #endif #ifdef CLIPPLANE2 @@ -70169,19 +73323,27 @@ fClipDistance5=dot(worldPos,vClipPlane5); fClipDistance6=dot(worldPos,vClipPlane6); #endif `; -ShaderStore.IncludesShadersStore[name65] = shader65; + ShaderStore.IncludesShadersStore[name66] = shader65; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/fogVertex.js -var name66 = "fogVertex"; -var shader66 = `#ifdef FOG +var name67, shader66; +var init_fogVertex = __esm(() => { + init_shaderStore(); + name67 = "fogVertex"; + shader66 = `#ifdef FOG vFogDistance=(view*worldPos).xyz; #endif `; -ShaderStore.IncludesShadersStore[name66] = shader66; + ShaderStore.IncludesShadersStore[name67] = shader66; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js -var name67 = "shadowsVertex"; -var shader67 = `#ifdef SHADOWS +var name68, shader67; +var init_shadowsVertex = __esm(() => { + init_shaderStore(); + name68 = "shadowsVertex"; + shader67 = `#ifdef SHADOWS #if defined(SHADOWCSM{X}) vPositionFromCamera{X}=view*worldPos;for (int i=0; i { + init_shaderStore(); + name69 = "vertexColorMixing"; + shader68 = `#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) vColor=vec4(1.0); #ifdef VERTEXCOLOR #ifdef VERTEXALPHA @@ -70218,27 +73384,72 @@ vColor*=instanceColor; #endif #endif `; -ShaderStore.IncludesShadersStore[name68] = shader68; + ShaderStore.IncludesShadersStore[name69] = shader68; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pointCloudVertex.js -var name69 = "pointCloudVertex"; -var shader69 = `#if defined(POINTSIZE) && !defined(WEBGPU) +var name70, shader69; +var init_pointCloudVertex = __esm(() => { + init_shaderStore(); + name70 = "pointCloudVertex"; + shader69 = `#if defined(POINTSIZE) && !defined(WEBGPU) gl_PointSize=pointSize; #endif `; -ShaderStore.IncludesShadersStore[name69] = shader69; + ShaderStore.IncludesShadersStore[name70] = shader69; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js -var name70 = "logDepthVertex"; -var shader70 = `#ifdef LOGARITHMICDEPTH +var name71, shader70; +var init_logDepthVertex = __esm(() => { + init_shaderStore(); + name71 = "logDepthVertex"; + shader70 = `#ifdef LOGARITHMICDEPTH vFragmentDepth=1.0+gl_Position.w;gl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant; #endif `; -ShaderStore.IncludesShadersStore[name70] = shader70; + ShaderStore.IncludesShadersStore[name71] = shader70; +}); // node_modules/@babylonjs/core/Shaders/default.vertex.js -var name71 = "defaultVertexShader"; -var shader71 = `#include<__decl__defaultVertex> +var name72, shader71; +var init_default_vertex = __esm(() => { + init_shaderStore(); + init_defaultVertexDeclaration(); + init_defaultUboDeclaration(); + init_uvAttributeDeclaration(); + init_helperFunctions(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_instancesDeclaration(); + init_prePassVertexDeclaration(); + init_mainUVVaryingDeclaration(); + init_samplerVertexDeclaration(); + init_bumpVertexDeclaration(); + init_clipPlaneVertexDeclaration(); + init_fogVertexDeclaration(); + init_lightVxFragmentDeclaration(); + init_lightVxUboDeclaration(); + init_morphTargetsVertexGlobalDeclaration(); + init_morphTargetsVertexDeclaration(); + init_logDepthDeclaration(); + init_morphTargetsVertexGlobal(); + init_morphTargetsVertex(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_prePassVertex(); + init_uvVariableDeclaration(); + init_samplerVertexImplementation(); + init_bumpVertex(); + init_clipPlaneVertex(); + init_fogVertex(); + init_shadowsVertex(); + init_vertexColorMixing(); + init_pointCloudVertex(); + init_logDepthVertex(); + name72 = "defaultVertexShader"; + shader71 = `#include<__decl__defaultVertex> #define CUSTOM_VERTEX_BEGIN attribute vec3 position; #ifdef NORMAL @@ -70368,16 +73579,44 @@ vMainUV1=uvUpdated; #define CUSTOM_VERTEX_MAIN_END } `; -ShaderStore.ShadersStore[name71] = shader71; + ShaderStore.ShadersStore[name72] = shader71; +}); // node_modules/@babylonjs/core/Materials/materialPluginManager.js +function RegisterMaterialPlugin(pluginName, factory) { + if (!inited) { + observer = Material.OnEventObservable.add((material7) => { + for (const [, factory2] of plugins) { + factory2(material7); + } + }, MaterialPluginEvent.Created); + inited = true; + } + const existing = plugins.filter(([name73, _factory]) => name73 === pluginName); + if (existing.length > 0) { + existing[0][1] = factory; + } else { + plugins.push([pluginName, factory]); + } +} +function UnregisterMaterialPlugin(pluginName) { + for (let i = 0;i < plugins.length; ++i) { + if (plugins[i][0] === pluginName) { + plugins.splice(i, 1); + if (plugins.length === 0) { + UnregisterAllMaterialPlugins(); + } + return true; + } + } + return false; +} function UnregisterAllMaterialPlugins() { plugins.length = 0; inited = false; Material.OnEventObservable.remove(observer); observer = null; } -var rxOption = new RegExp("^([gimus]+)!"); class MaterialPluginManager { constructor(material7) { @@ -70435,9 +73674,9 @@ class MaterialPluginManager { } } } - getPlugin(name72) { + getPlugin(name73) { for (let i = 0;i < this._plugins.length; ++i) { - if (this._plugins[i].name === name72) { + if (this._plugins[i].name === name73) { return this._plugins[i]; } } @@ -70680,16 +73919,26 @@ class MaterialPluginManager { }; } } -MaterialPluginManager._MaterialPluginClassToMainDefine = {}; -MaterialPluginManager._MaterialPluginCounter = 0; -(() => { - EngineStore.OnEnginesDisposedObservable.add(() => { - UnregisterAllMaterialPlugins(); - }); -})(); -var plugins = []; -var inited = false; -var observer = null; +var rxOption, plugins, inited, observer; +var init_materialPluginManager = __esm(() => { + init_material(); + init_materialPluginEvent(); + init_engineStore(); + init_shaderProcessor(); + init_shaderLanguage(); + init_shaderStore(); + rxOption = new RegExp("^([gimus]+)!"); + MaterialPluginManager._MaterialPluginClassToMainDefine = {}; + MaterialPluginManager._MaterialPluginCounter = 0; + (() => { + EngineStore.OnEnginesDisposedObservable.add(() => { + UnregisterAllMaterialPlugins(); + }); + })(); + plugins = []; + inited = false; + observer = null; +}); // node_modules/@babylonjs/core/Materials/materialPluginBase.js class MaterialPluginBase { @@ -70698,12 +73947,12 @@ class MaterialPluginBase { this._pluginManager._activatePlugin(this); } } - constructor(material7, name72, priority, defines, addToPluginList = true, enable = false, resolveIncludes = false) { + constructor(material7, name73, priority, defines, addToPluginList = true, enable = false, resolveIncludes = false) { this.priority = 500; this.resolveIncludes = false; this.registerForExtraEvents = false; this._material = material7; - this.name = name72; + this.name = name73; this.priority = priority; this.resolveIncludes = resolveIncludes; if (!material7.pluginManager) { @@ -70790,18 +74039,23 @@ class MaterialPluginBase { SerializationHelper.Parse(() => this, source, scene13, rootUrl); } } -__decorate2([ - serialize() -], MaterialPluginBase.prototype, "name", undefined); -__decorate2([ - serialize() -], MaterialPluginBase.prototype, "priority", undefined); -__decorate2([ - serialize() -], MaterialPluginBase.prototype, "resolveIncludes", undefined); -__decorate2([ - serialize() -], MaterialPluginBase.prototype, "registerForExtraEvents", undefined); +var init_materialPluginBase = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_materialPluginManager(); + __decorate2([ + serialize() + ], MaterialPluginBase.prototype, "name", undefined); + __decorate2([ + serialize() + ], MaterialPluginBase.prototype, "priority", undefined); + __decorate2([ + serialize() + ], MaterialPluginBase.prototype, "resolveIncludes", undefined); + __decorate2([ + serialize() + ], MaterialPluginBase.prototype, "registerForExtraEvents", undefined); +}); // node_modules/@babylonjs/core/Materials/material.detailMapConfiguration.js class MaterialDetailMapDefines extends MaterialDefines { @@ -70912,31 +74166,38 @@ class DetailMapConfiguration extends MaterialPluginBase { }; } } -__decorate2([ - serializeAsTexture("detailTexture"), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], DetailMapConfiguration.prototype, "texture", undefined); -__decorate2([ - serialize() -], DetailMapConfiguration.prototype, "diffuseBlendLevel", undefined); -__decorate2([ - serialize() -], DetailMapConfiguration.prototype, "roughnessBlendLevel", undefined); -__decorate2([ - serialize() -], DetailMapConfiguration.prototype, "bumpLevel", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], DetailMapConfiguration.prototype, "normalBlendMethod", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], DetailMapConfiguration.prototype, "isEnabled", undefined); +var init_material_detailMapConfiguration = __esm(() => { + init_tslib_es62(); + init_material(); + init_decorators(); + init_materialFlags(); + init_materialHelper(); + init_materialDefines(); + init_materialPluginBase(); + __decorate2([ + serializeAsTexture("detailTexture"), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], DetailMapConfiguration.prototype, "texture", undefined); + __decorate2([ + serialize() + ], DetailMapConfiguration.prototype, "diffuseBlendLevel", undefined); + __decorate2([ + serialize() + ], DetailMapConfiguration.prototype, "roughnessBlendLevel", undefined); + __decorate2([ + serialize() + ], DetailMapConfiguration.prototype, "bumpLevel", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], DetailMapConfiguration.prototype, "normalBlendMethod", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], DetailMapConfiguration.prototype, "isEnabled", undefined); +}); // node_modules/@babylonjs/core/Materials/standardMaterial.js -var onCreatedEffectParameters2 = { effect: null, subMesh: null }; - class StandardMaterialDefines extends MaterialDefines { constructor(externalProperties) { super(externalProperties); @@ -71178,8 +74439,8 @@ class StandardMaterial extends PushMaterial { get canRenderToMRT() { return true; } - constructor(name72, scene14) { - super(name72, scene14); + constructor(name73, scene14) { + super(name73, scene14); this._diffuseTexture = null; this._ambientTexture = null; this._opacityTexture = null; @@ -72075,10 +75336,10 @@ class StandardMaterial extends PushMaterial { } super.dispose(forceDisposeEffect, forceDisposeTextures); } - clone(name72, cloneTexturesOnlyOnce = true, rootUrl = "") { - const result = SerializationHelper.Clone(() => new StandardMaterial(name72, this.getScene()), this, { cloneTexturesOnlyOnce }); - result.name = name72; - result.id = name72; + clone(name73, cloneTexturesOnlyOnce = true, rootUrl = "") { + const result = SerializationHelper.Clone(() => new StandardMaterial(name73, this.getScene()), this, { cloneTexturesOnlyOnce }); + result.name = name73; + result.id = name73; this.stencil.copyTo(result.stencil); this._clonePlugins(result, rootUrl); return result; @@ -72164,286 +75425,316 @@ class StandardMaterial extends PushMaterial { MaterialFlags.FresnelEnabled = value; } } -__decorate2([ - serializeAsTexture("diffuseTexture") -], StandardMaterial.prototype, "_diffuseTexture", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") -], StandardMaterial.prototype, "diffuseTexture", undefined); -__decorate2([ - serializeAsTexture("ambientTexture") -], StandardMaterial.prototype, "_ambientTexture", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "ambientTexture", undefined); -__decorate2([ - serializeAsTexture("opacityTexture") -], StandardMaterial.prototype, "_opacityTexture", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") -], StandardMaterial.prototype, "opacityTexture", undefined); -__decorate2([ - serializeAsTexture("reflectionTexture") -], StandardMaterial.prototype, "_reflectionTexture", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "reflectionTexture", undefined); -__decorate2([ - serializeAsTexture("emissiveTexture") -], StandardMaterial.prototype, "_emissiveTexture", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "emissiveTexture", undefined); -__decorate2([ - serializeAsTexture("specularTexture") -], StandardMaterial.prototype, "_specularTexture", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "specularTexture", undefined); -__decorate2([ - serializeAsTexture("bumpTexture") -], StandardMaterial.prototype, "_bumpTexture", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "bumpTexture", undefined); -__decorate2([ - serializeAsTexture("lightmapTexture") -], StandardMaterial.prototype, "_lightmapTexture", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "lightmapTexture", undefined); -__decorate2([ - serializeAsTexture("refractionTexture") -], StandardMaterial.prototype, "_refractionTexture", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "refractionTexture", undefined); -__decorate2([ - serializeAsColor3("ambient") -], StandardMaterial.prototype, "ambientColor", undefined); -__decorate2([ - serializeAsColor3("diffuse") -], StandardMaterial.prototype, "diffuseColor", undefined); -__decorate2([ - serializeAsColor3("specular") -], StandardMaterial.prototype, "specularColor", undefined); -__decorate2([ - serializeAsColor3("emissive") -], StandardMaterial.prototype, "emissiveColor", undefined); -__decorate2([ - serialize() -], StandardMaterial.prototype, "specularPower", undefined); -__decorate2([ - serialize("useAlphaFromDiffuseTexture") -], StandardMaterial.prototype, "_useAlphaFromDiffuseTexture", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") -], StandardMaterial.prototype, "useAlphaFromDiffuseTexture", undefined); -__decorate2([ - serialize("useEmissiveAsIllumination") -], StandardMaterial.prototype, "_useEmissiveAsIllumination", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "useEmissiveAsIllumination", undefined); -__decorate2([ - serialize("linkEmissiveWithDiffuse") -], StandardMaterial.prototype, "_linkEmissiveWithDiffuse", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "linkEmissiveWithDiffuse", undefined); -__decorate2([ - serialize("useSpecularOverAlpha") -], StandardMaterial.prototype, "_useSpecularOverAlpha", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "useSpecularOverAlpha", undefined); -__decorate2([ - serialize("useReflectionOverAlpha") -], StandardMaterial.prototype, "_useReflectionOverAlpha", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "useReflectionOverAlpha", undefined); -__decorate2([ - serialize("disableLighting") -], StandardMaterial.prototype, "_disableLighting", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsLightsDirty") -], StandardMaterial.prototype, "disableLighting", undefined); -__decorate2([ - serialize("useObjectSpaceNormalMap") -], StandardMaterial.prototype, "_useObjectSpaceNormalMap", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "useObjectSpaceNormalMap", undefined); -__decorate2([ - serialize("useParallax") -], StandardMaterial.prototype, "_useParallax", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "useParallax", undefined); -__decorate2([ - serialize("useParallaxOcclusion") -], StandardMaterial.prototype, "_useParallaxOcclusion", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "useParallaxOcclusion", undefined); -__decorate2([ - serialize() -], StandardMaterial.prototype, "parallaxScaleBias", undefined); -__decorate2([ - serialize("roughness") -], StandardMaterial.prototype, "_roughness", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "roughness", undefined); -__decorate2([ - serialize() -], StandardMaterial.prototype, "indexOfRefraction", undefined); -__decorate2([ - serialize() -], StandardMaterial.prototype, "invertRefractionY", undefined); -__decorate2([ - serialize() -], StandardMaterial.prototype, "alphaCutOff", undefined); -__decorate2([ - serialize("useLightmapAsShadowmap") -], StandardMaterial.prototype, "_useLightmapAsShadowmap", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "useLightmapAsShadowmap", undefined); -__decorate2([ - serializeAsFresnelParameters("diffuseFresnelParameters") -], StandardMaterial.prototype, "_diffuseFresnelParameters", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsFresnelDirty") -], StandardMaterial.prototype, "diffuseFresnelParameters", undefined); -__decorate2([ - serializeAsFresnelParameters("opacityFresnelParameters") -], StandardMaterial.prototype, "_opacityFresnelParameters", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsFresnelAndMiscDirty") -], StandardMaterial.prototype, "opacityFresnelParameters", undefined); -__decorate2([ - serializeAsFresnelParameters("reflectionFresnelParameters") -], StandardMaterial.prototype, "_reflectionFresnelParameters", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsFresnelDirty") -], StandardMaterial.prototype, "reflectionFresnelParameters", undefined); -__decorate2([ - serializeAsFresnelParameters("refractionFresnelParameters") -], StandardMaterial.prototype, "_refractionFresnelParameters", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsFresnelDirty") -], StandardMaterial.prototype, "refractionFresnelParameters", undefined); -__decorate2([ - serializeAsFresnelParameters("emissiveFresnelParameters") -], StandardMaterial.prototype, "_emissiveFresnelParameters", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsFresnelDirty") -], StandardMaterial.prototype, "emissiveFresnelParameters", undefined); -__decorate2([ - serialize("useReflectionFresnelFromSpecular") -], StandardMaterial.prototype, "_useReflectionFresnelFromSpecular", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsFresnelDirty") -], StandardMaterial.prototype, "useReflectionFresnelFromSpecular", undefined); -__decorate2([ - serialize("useGlossinessFromSpecularMapAlpha") -], StandardMaterial.prototype, "_useGlossinessFromSpecularMapAlpha", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "useGlossinessFromSpecularMapAlpha", undefined); -__decorate2([ - serialize("maxSimultaneousLights") -], StandardMaterial.prototype, "_maxSimultaneousLights", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsLightsDirty") -], StandardMaterial.prototype, "maxSimultaneousLights", undefined); -__decorate2([ - serialize("invertNormalMapX") -], StandardMaterial.prototype, "_invertNormalMapX", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "invertNormalMapX", undefined); -__decorate2([ - serialize("invertNormalMapY") -], StandardMaterial.prototype, "_invertNormalMapY", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "invertNormalMapY", undefined); -__decorate2([ - serialize("twoSidedLighting") -], StandardMaterial.prototype, "_twoSidedLighting", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], StandardMaterial.prototype, "twoSidedLighting", undefined); -__decorate2([ - serialize("applyDecalMapAfterDetailMap") -], StandardMaterial.prototype, "_applyDecalMapAfterDetailMap", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsMiscDirty") -], StandardMaterial.prototype, "applyDecalMapAfterDetailMap", undefined); -RegisterClass("BABYLON.StandardMaterial", StandardMaterial); -Scene.DefaultMaterialFactory = (scene14) => { - return new StandardMaterial("default material", scene14); -}; +var onCreatedEffectParameters2; +var init_standardMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_smartArray(); + init_scene(); + init_math_vector(); + init_math_color(); + init_buffer(); + init_prePassConfiguration(); + init_imageProcessingConfiguration(); + init_material(); + init_materialPluginEvent(); + init_materialDefines(); + init_pushMaterial(); + init_materialHelper(); + init_texture(); + init_typeStore(); + init_materialFlags(); + init_default_fragment(); + init_default_vertex(); + init_effectFallbacks(); + init_material_detailMapConfiguration(); + init_clipPlaneMaterialHelper(); + onCreatedEffectParameters2 = { effect: null, subMesh: null }; + __decorate2([ + serializeAsTexture("diffuseTexture") + ], StandardMaterial.prototype, "_diffuseTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") + ], StandardMaterial.prototype, "diffuseTexture", undefined); + __decorate2([ + serializeAsTexture("ambientTexture") + ], StandardMaterial.prototype, "_ambientTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "ambientTexture", undefined); + __decorate2([ + serializeAsTexture("opacityTexture") + ], StandardMaterial.prototype, "_opacityTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") + ], StandardMaterial.prototype, "opacityTexture", undefined); + __decorate2([ + serializeAsTexture("reflectionTexture") + ], StandardMaterial.prototype, "_reflectionTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "reflectionTexture", undefined); + __decorate2([ + serializeAsTexture("emissiveTexture") + ], StandardMaterial.prototype, "_emissiveTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "emissiveTexture", undefined); + __decorate2([ + serializeAsTexture("specularTexture") + ], StandardMaterial.prototype, "_specularTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "specularTexture", undefined); + __decorate2([ + serializeAsTexture("bumpTexture") + ], StandardMaterial.prototype, "_bumpTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "bumpTexture", undefined); + __decorate2([ + serializeAsTexture("lightmapTexture") + ], StandardMaterial.prototype, "_lightmapTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "lightmapTexture", undefined); + __decorate2([ + serializeAsTexture("refractionTexture") + ], StandardMaterial.prototype, "_refractionTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "refractionTexture", undefined); + __decorate2([ + serializeAsColor3("ambient") + ], StandardMaterial.prototype, "ambientColor", undefined); + __decorate2([ + serializeAsColor3("diffuse") + ], StandardMaterial.prototype, "diffuseColor", undefined); + __decorate2([ + serializeAsColor3("specular") + ], StandardMaterial.prototype, "specularColor", undefined); + __decorate2([ + serializeAsColor3("emissive") + ], StandardMaterial.prototype, "emissiveColor", undefined); + __decorate2([ + serialize() + ], StandardMaterial.prototype, "specularPower", undefined); + __decorate2([ + serialize("useAlphaFromDiffuseTexture") + ], StandardMaterial.prototype, "_useAlphaFromDiffuseTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") + ], StandardMaterial.prototype, "useAlphaFromDiffuseTexture", undefined); + __decorate2([ + serialize("useEmissiveAsIllumination") + ], StandardMaterial.prototype, "_useEmissiveAsIllumination", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "useEmissiveAsIllumination", undefined); + __decorate2([ + serialize("linkEmissiveWithDiffuse") + ], StandardMaterial.prototype, "_linkEmissiveWithDiffuse", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "linkEmissiveWithDiffuse", undefined); + __decorate2([ + serialize("useSpecularOverAlpha") + ], StandardMaterial.prototype, "_useSpecularOverAlpha", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "useSpecularOverAlpha", undefined); + __decorate2([ + serialize("useReflectionOverAlpha") + ], StandardMaterial.prototype, "_useReflectionOverAlpha", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "useReflectionOverAlpha", undefined); + __decorate2([ + serialize("disableLighting") + ], StandardMaterial.prototype, "_disableLighting", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], StandardMaterial.prototype, "disableLighting", undefined); + __decorate2([ + serialize("useObjectSpaceNormalMap") + ], StandardMaterial.prototype, "_useObjectSpaceNormalMap", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "useObjectSpaceNormalMap", undefined); + __decorate2([ + serialize("useParallax") + ], StandardMaterial.prototype, "_useParallax", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "useParallax", undefined); + __decorate2([ + serialize("useParallaxOcclusion") + ], StandardMaterial.prototype, "_useParallaxOcclusion", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "useParallaxOcclusion", undefined); + __decorate2([ + serialize() + ], StandardMaterial.prototype, "parallaxScaleBias", undefined); + __decorate2([ + serialize("roughness") + ], StandardMaterial.prototype, "_roughness", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "roughness", undefined); + __decorate2([ + serialize() + ], StandardMaterial.prototype, "indexOfRefraction", undefined); + __decorate2([ + serialize() + ], StandardMaterial.prototype, "invertRefractionY", undefined); + __decorate2([ + serialize() + ], StandardMaterial.prototype, "alphaCutOff", undefined); + __decorate2([ + serialize("useLightmapAsShadowmap") + ], StandardMaterial.prototype, "_useLightmapAsShadowmap", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "useLightmapAsShadowmap", undefined); + __decorate2([ + serializeAsFresnelParameters("diffuseFresnelParameters") + ], StandardMaterial.prototype, "_diffuseFresnelParameters", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsFresnelDirty") + ], StandardMaterial.prototype, "diffuseFresnelParameters", undefined); + __decorate2([ + serializeAsFresnelParameters("opacityFresnelParameters") + ], StandardMaterial.prototype, "_opacityFresnelParameters", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsFresnelAndMiscDirty") + ], StandardMaterial.prototype, "opacityFresnelParameters", undefined); + __decorate2([ + serializeAsFresnelParameters("reflectionFresnelParameters") + ], StandardMaterial.prototype, "_reflectionFresnelParameters", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsFresnelDirty") + ], StandardMaterial.prototype, "reflectionFresnelParameters", undefined); + __decorate2([ + serializeAsFresnelParameters("refractionFresnelParameters") + ], StandardMaterial.prototype, "_refractionFresnelParameters", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsFresnelDirty") + ], StandardMaterial.prototype, "refractionFresnelParameters", undefined); + __decorate2([ + serializeAsFresnelParameters("emissiveFresnelParameters") + ], StandardMaterial.prototype, "_emissiveFresnelParameters", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsFresnelDirty") + ], StandardMaterial.prototype, "emissiveFresnelParameters", undefined); + __decorate2([ + serialize("useReflectionFresnelFromSpecular") + ], StandardMaterial.prototype, "_useReflectionFresnelFromSpecular", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsFresnelDirty") + ], StandardMaterial.prototype, "useReflectionFresnelFromSpecular", undefined); + __decorate2([ + serialize("useGlossinessFromSpecularMapAlpha") + ], StandardMaterial.prototype, "_useGlossinessFromSpecularMapAlpha", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "useGlossinessFromSpecularMapAlpha", undefined); + __decorate2([ + serialize("maxSimultaneousLights") + ], StandardMaterial.prototype, "_maxSimultaneousLights", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], StandardMaterial.prototype, "maxSimultaneousLights", undefined); + __decorate2([ + serialize("invertNormalMapX") + ], StandardMaterial.prototype, "_invertNormalMapX", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "invertNormalMapX", undefined); + __decorate2([ + serialize("invertNormalMapY") + ], StandardMaterial.prototype, "_invertNormalMapY", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "invertNormalMapY", undefined); + __decorate2([ + serialize("twoSidedLighting") + ], StandardMaterial.prototype, "_twoSidedLighting", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], StandardMaterial.prototype, "twoSidedLighting", undefined); + __decorate2([ + serialize("applyDecalMapAfterDetailMap") + ], StandardMaterial.prototype, "_applyDecalMapAfterDetailMap", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsMiscDirty") + ], StandardMaterial.prototype, "applyDecalMapAfterDetailMap", undefined); + RegisterClass("BABYLON.StandardMaterial", StandardMaterial); + Scene.DefaultMaterialFactory = (scene14) => { + return new StandardMaterial("default material", scene14); + }; +}); // node_modules/@babylonjs/core/Engines/Extensions/engine.dynamicTexture.js -ThinEngine.prototype.createDynamicTexture = function(width, height, generateMipMaps, samplingMode) { - const texture11 = new InternalTexture(this, InternalTextureSource.Dynamic); - texture11.baseWidth = width; - texture11.baseHeight = height; - if (generateMipMaps) { - width = this.needPOTTextures ? ThinEngine.GetExponentOfTwo(width, this._caps.maxTextureSize) : width; - height = this.needPOTTextures ? ThinEngine.GetExponentOfTwo(height, this._caps.maxTextureSize) : height; - } - texture11.width = width; - texture11.height = height; - texture11.isReady = false; - texture11.generateMipMaps = generateMipMaps; - texture11.samplingMode = samplingMode; - this.updateTextureSamplingMode(samplingMode, texture11); - this._internalTexturesCache.push(texture11); - return texture11; -}; -ThinEngine.prototype.updateDynamicTexture = function(texture11, source, invertY, premulAlpha = false, format, forceBindTexture = false, allowGPUOptimization = false) { - if (!texture11) { - return; - } - const gl = this._gl; - const target = gl.TEXTURE_2D; - const wasPreviouslyBound = this._bindTextureDirectly(target, texture11, true, forceBindTexture); - this._unpackFlipY(invertY === undefined ? texture11.invertY : invertY); - if (premulAlpha) { - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1); - } - const textureType = this._getWebGLTextureType(texture11.type); - const glformat = this._getInternalFormat(format ? format : texture11.format); - const internalFormat = this._getRGBABufferInternalSizedFormat(texture11.type, glformat); - gl.texImage2D(target, 0, internalFormat, glformat, textureType, source); - if (texture11.generateMipMaps) { - gl.generateMipmap(target); - } - if (!wasPreviouslyBound) { - this._bindTextureDirectly(target, null); - } - if (premulAlpha) { - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0); - } - if (format) { - texture11.format = format; - } - texture11._dynamicTextureSource = source; - texture11._premulAlpha = premulAlpha; - texture11.invertY = invertY || false; - texture11.isReady = true; -}; +var init_engine_dynamicTexture = __esm(() => { + init_thinEngine(); + init_internalTexture(); + ThinEngine.prototype.createDynamicTexture = function(width, height, generateMipMaps, samplingMode) { + const texture11 = new InternalTexture(this, InternalTextureSource.Dynamic); + texture11.baseWidth = width; + texture11.baseHeight = height; + if (generateMipMaps) { + width = this.needPOTTextures ? ThinEngine.GetExponentOfTwo(width, this._caps.maxTextureSize) : width; + height = this.needPOTTextures ? ThinEngine.GetExponentOfTwo(height, this._caps.maxTextureSize) : height; + } + texture11.width = width; + texture11.height = height; + texture11.isReady = false; + texture11.generateMipMaps = generateMipMaps; + texture11.samplingMode = samplingMode; + this.updateTextureSamplingMode(samplingMode, texture11); + this._internalTexturesCache.push(texture11); + return texture11; + }; + ThinEngine.prototype.updateDynamicTexture = function(texture11, source, invertY, premulAlpha = false, format, forceBindTexture = false, allowGPUOptimization = false) { + if (!texture11) { + return; + } + const gl = this._gl; + const target = gl.TEXTURE_2D; + const wasPreviouslyBound = this._bindTextureDirectly(target, texture11, true, forceBindTexture); + this._unpackFlipY(invertY === undefined ? texture11.invertY : invertY); + if (premulAlpha) { + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1); + } + const textureType = this._getWebGLTextureType(texture11.type); + const glformat = this._getInternalFormat(format ? format : texture11.format); + const internalFormat = this._getRGBABufferInternalSizedFormat(texture11.type, glformat); + gl.texImage2D(target, 0, internalFormat, glformat, textureType, source); + if (texture11.generateMipMaps) { + gl.generateMipmap(target); + } + if (!wasPreviouslyBound) { + this._bindTextureDirectly(target, null); + } + if (premulAlpha) { + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0); + } + if (format) { + texture11.format = format; + } + texture11._dynamicTextureSource = source; + texture11._premulAlpha = premulAlpha; + texture11.invertY = invertY || false; + texture11.isReady = true; + }; +}); // node_modules/@babylonjs/core/Materials/Textures/dynamicTexture.js class DynamicTexture extends Texture { - constructor(name72, options, scene14 = null, generateMipMaps = false, samplingMode = 3, format = 5, invertY) { + constructor(name73, options, scene14 = null, generateMipMaps = false, samplingMode = 3, format = 5, invertY) { super(null, scene14, !generateMipMaps, invertY, samplingMode, undefined, undefined, undefined, undefined, format); - this.name = name72; + this.name = name73; this.wrapU = Texture.CLAMP_ADDRESSMODE; this.wrapV = Texture.CLAMP_ADDRESSMODE; this._generateMipMaps = generateMipMaps; @@ -72562,6 +75853,11 @@ class DynamicTexture extends Texture { this.update(); } } +var init_dynamicTexture = __esm(() => { + init_logger(); + init_texture(); + init_engine_dynamicTexture(); +}); // node_modules/@babylonjs/core/XR/webXRLayerWrapper.js class WebXRLayerWrapper { @@ -72588,6 +75884,8 @@ class WebXRLayerWrapper { this.createRenderTargetTextureProvider = createRenderTargetTextureProvider; } } +var init_webXRLayerWrapper = __esm(() => { +}); // node_modules/@babylonjs/core/XR/webXRRenderTargetTextureProvider.js class WebXRLayerRenderTargetTextureProvider { @@ -72651,6 +75949,12 @@ class WebXRLayerRenderTargetTextureProvider { this._renderTargetTextures.length = 0; } } +var init_webXRRenderTargetTextureProvider = __esm(() => { + init_webGLHardwareTexture(); + init_internalTexture(); + init_MultiviewRenderTarget(); + init_renderTargetTexture(); +}); // node_modules/@babylonjs/core/XR/webXRWebGLLayer.js class WebXRWebGLLayerWrapper extends WebXRLayerWrapper { @@ -72699,6 +76003,10 @@ class WebXRWebGLLayerRenderTargetTextureProvider extends WebXRLayerRenderTargetT return this.getRenderTargetTextureForEye(view.eye); } } +var init_webXRWebGLLayer = __esm(() => { + init_webXRLayerWrapper(); + init_webXRRenderTargetTextureProvider(); +}); // node_modules/@babylonjs/core/XR/webXRManagedOutputCanvas.js class WebXRManagedOutputCanvasOptions { @@ -72823,6 +76131,11 @@ class WebXRManagedOutputCanvas { } } } +var init_webXRManagedOutputCanvas = __esm(() => { + init_observable(); + init_tools(); + init_webXRWebGLLayer(); +}); // node_modules/@babylonjs/core/XR/native/nativeXRRenderTarget.js class NativeXRLayerWrapper extends WebXRLayerWrapper { @@ -72872,6 +76185,10 @@ class NativeXRRenderTarget { dispose() { } } +var init_nativeXRRenderTarget = __esm(() => { + init_webXRLayerWrapper(); + init_webXRRenderTargetTextureProvider(); +}); // node_modules/@babylonjs/core/XR/webXRSessionManager.js class WebXRSessionManager { @@ -73116,30 +76433,34 @@ class WebXRSessionManager { return (_b = (_a = this.session) === null || _a === undefined ? undefined : _a.enabledFeatures) !== null && _b !== undefined ? _b : null; } } +var init_webXRSessionManager = __esm(() => { + init_logger(); + init_observable(); + init_webXRManagedOutputCanvas(); + init_nativeXRRenderTarget(); + init_webXRWebGLLayer(); +}); // node_modules/@babylonjs/core/XR/webXRTypes.js -var WebXRState; -(function(WebXRState2) { - WebXRState2[WebXRState2["ENTERING_XR"] = 0] = "ENTERING_XR"; - WebXRState2[WebXRState2["EXITING_XR"] = 1] = "EXITING_XR"; - WebXRState2[WebXRState2["IN_XR"] = 2] = "IN_XR"; - WebXRState2[WebXRState2["NOT_IN_XR"] = 3] = "NOT_IN_XR"; -})(WebXRState || (WebXRState = {})); -var WebXRTrackingState; -(function(WebXRTrackingState2) { - WebXRTrackingState2[WebXRTrackingState2["NOT_TRACKING"] = 0] = "NOT_TRACKING"; - WebXRTrackingState2[WebXRTrackingState2["TRACKING_LOST"] = 1] = "TRACKING_LOST"; - WebXRTrackingState2[WebXRTrackingState2["TRACKING"] = 2] = "TRACKING"; -})(WebXRTrackingState || (WebXRTrackingState = {})); +var WebXRState, WebXRTrackingState; +var init_webXRTypes = __esm(() => { + (function(WebXRState2) { + WebXRState2[WebXRState2["ENTERING_XR"] = 0] = "ENTERING_XR"; + WebXRState2[WebXRState2["EXITING_XR"] = 1] = "EXITING_XR"; + WebXRState2[WebXRState2["IN_XR"] = 2] = "IN_XR"; + WebXRState2[WebXRState2["NOT_IN_XR"] = 3] = "NOT_IN_XR"; + })(WebXRState || (WebXRState = {})); + (function(WebXRTrackingState2) { + WebXRTrackingState2[WebXRTrackingState2["NOT_TRACKING"] = 0] = "NOT_TRACKING"; + WebXRTrackingState2[WebXRTrackingState2["TRACKING_LOST"] = 1] = "TRACKING_LOST"; + WebXRTrackingState2[WebXRTrackingState2["TRACKING"] = 2] = "TRACKING"; + })(WebXRTrackingState || (WebXRTrackingState = {})); +}); // node_modules/@babylonjs/core/Meshes/groundMesh.js -Mesh._GroundMeshParser = (parsedMesh, scene14) => { - return GroundMesh.Parse(parsedMesh, scene14); -}; - class GroundMesh extends Mesh { - constructor(name72, scene14) { - super(name72, scene14); + constructor(name73, scene14) { + super(name73, scene14); this.generateOctree = false; } getClassName() { @@ -73321,6 +76642,14 @@ class GroundMesh extends Mesh { return result; } } +var init_groundMesh = __esm(() => { + init_math_vector(); + init_buffer(); + init_mesh(); + Mesh._GroundMeshParser = (parsedMesh, scene14) => { + return GroundMesh.Parse(parsedMesh, scene14); + }; +}); // node_modules/@babylonjs/core/Meshes/Builders/groundBuilder.js function CreateGroundVertexData(options) { @@ -73489,8 +76818,8 @@ function CreateGroundFromHeightMapVertexData(options) { vertexData.uvs = uvs; return vertexData; } -function CreateGround(name72, options = {}, scene14) { - const ground = new GroundMesh(name72, scene14); +function CreateGround(name73, options = {}, scene14) { + const ground = new GroundMesh(name73, scene14); ground._setReady(false); ground._subdivisionsX = options.subdivisionsX || options.subdivisions || 1; ground._subdivisionsY = options.subdivisionsY || options.subdivisions || 1; @@ -73505,13 +76834,13 @@ function CreateGround(name72, options = {}, scene14) { ground._setReady(true); return ground; } -function CreateTiledGround(name72, options, scene14 = null) { - const tiledGround = new Mesh(name72, scene14); +function CreateTiledGround(name73, options, scene14 = null) { + const tiledGround = new Mesh(name73, scene14); const vertexData = CreateTiledGroundVertexData(options); vertexData.applyToMesh(tiledGround, options.updatable); return tiledGround; } -function CreateGroundFromHeightMap(name72, url, options = {}, scene14 = null) { +function CreateGroundFromHeightMap(name73, url, options = {}, scene14 = null) { const width = options.width || 10; const height = options.height || 10; const subdivisions = options.subdivisions || 1 | 0; @@ -73522,7 +76851,7 @@ function CreateGroundFromHeightMap(name72, url, options = {}, scene14 = null) { const updatable = options.updatable; const onReady = options.onReady; scene14 = scene14 || EngineStore.LastCreatedScene; - const ground = new GroundMesh(name72, scene14); + const ground = new GroundMesh(name73, scene14); ground._subdivisionsX = subdivisions; ground._subdivisionsY = subdivisions; ground._width = width; @@ -73561,43 +76890,60 @@ function CreateGroundFromHeightMap(name72, url, options = {}, scene14 = null) { }, scene14.offlineProvider); return ground; } -VertexData.CreateGround = CreateGroundVertexData; -VertexData.CreateTiledGround = CreateTiledGroundVertexData; -VertexData.CreateGroundFromHeightMap = CreateGroundFromHeightMapVertexData; -Mesh.CreateGround = (name72, width, height, subdivisions, scene14, updatable) => { - const options = { - width, - height, - subdivisions, - updatable - }; - return CreateGround(name72, options, scene14); -}; -Mesh.CreateTiledGround = (name72, xmin, zmin, xmax, zmax, subdivisions, precision, scene14, updatable) => { - const options = { - xmin, - zmin, - xmax, - zmax, - subdivisions, - precision, - updatable - }; - return CreateTiledGround(name72, options, scene14); -}; -Mesh.CreateGroundFromHeightMap = (name72, url, width, height, subdivisions, minHeight, maxHeight, scene14, updatable, onReady, alphaFilter) => { - const options = { - width, - height, - subdivisions, - minHeight, - maxHeight, - updatable, - onReady, - alphaFilter +var GroundBuilder; +var init_groundBuilder = __esm(() => { + init_math_vector(); + init_math_color(); + init_mesh(); + init_mesh_vertexData(); + init_groundMesh(); + init_tools(); + init_engineStore(); + init_math_constants(); + init_compatibilityOptions(); + GroundBuilder = { + CreateGround, + CreateGroundFromHeightMap, + CreateTiledGround }; - return CreateGroundFromHeightMap(name72, url, options, scene14); -}; + VertexData.CreateGround = CreateGroundVertexData; + VertexData.CreateTiledGround = CreateTiledGroundVertexData; + VertexData.CreateGroundFromHeightMap = CreateGroundFromHeightMapVertexData; + Mesh.CreateGround = (name73, width, height, subdivisions, scene14, updatable) => { + const options = { + width, + height, + subdivisions, + updatable + }; + return CreateGround(name73, options, scene14); + }; + Mesh.CreateTiledGround = (name73, xmin, zmin, xmax, zmax, subdivisions, precision, scene14, updatable) => { + const options = { + xmin, + zmin, + xmax, + zmax, + subdivisions, + precision, + updatable + }; + return CreateTiledGround(name73, options, scene14); + }; + Mesh.CreateGroundFromHeightMap = (name73, url, width, height, subdivisions, minHeight, maxHeight, scene14, updatable, onReady, alphaFilter) => { + const options = { + width, + height, + subdivisions, + minHeight, + maxHeight, + updatable, + onReady, + alphaFilter + }; + return CreateGroundFromHeightMap(name73, url, options, scene14); + }; +}); // node_modules/@babylonjs/core/Meshes/Builders/torusBuilder.js function CreateTorusVertexData(options) { @@ -73645,25 +76991,35 @@ function CreateTorusVertexData(options) { vertexData.uvs = uvs; return vertexData; } -function CreateTorus(name72, options = {}, scene14) { - const torus = new Mesh(name72, scene14); +function CreateTorus(name73, options = {}, scene14) { + const torus = new Mesh(name73, scene14); options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation); torus._originalBuilderSideOrientation = options.sideOrientation; const vertexData = CreateTorusVertexData(options); vertexData.applyToMesh(torus, options.updatable); return torus; } -VertexData.CreateTorus = CreateTorusVertexData; -Mesh.CreateTorus = (name72, diameter, thickness, tessellation, scene14, updatable, sideOrientation) => { - const options = { - diameter, - thickness, - tessellation, - sideOrientation, - updatable +var TorusBuilder; +var init_torusBuilder = __esm(() => { + init_math_vector(); + init_mesh(); + init_mesh_vertexData(); + init_compatibilityOptions(); + TorusBuilder = { + CreateTorus }; - return CreateTorus(name72, options, scene14); -}; + VertexData.CreateTorus = CreateTorusVertexData; + Mesh.CreateTorus = (name73, diameter, thickness, tessellation, scene14, updatable, sideOrientation) => { + const options = { + diameter, + thickness, + tessellation, + sideOrientation, + updatable + }; + return CreateTorus(name73, options, scene14); + }; +}); // node_modules/@babylonjs/core/Cameras/VR/vrExperienceHelper.js class VRExperienceHelperGazer { @@ -73728,7 +77084,6 @@ class VRExperienceHelperGazer { } } } -VRExperienceHelperGazer._IdCounter = 0; class VRExperienceHelperCameraGazer extends VRExperienceHelperGazer { constructor(_getCamera, scene14) { @@ -73744,6 +77099,10 @@ class VRExperienceHelperCameraGazer extends VRExperienceHelperGazer { } } } + +class OnAfterEnteringVRObservableEvent { +} + class VRExperienceHelper { get onEnteringVR() { return this.onEnteringVRObservable; @@ -74660,61 +78019,76 @@ class VRExperienceHelper { return "VRExperienceHelper"; } } -VRExperienceHelper.TELEPORTATIONMODE_CONSTANTTIME = 0; -VRExperienceHelper.TELEPORTATIONMODE_CONSTANTSPEED = 1; -// node_modules/@babylonjs/core/Collisions/collider.js -var intersectBoxAASphere = (boxMin, boxMax, sphereCenter, sphereRadius) => { - if (boxMin.x > sphereCenter.x + sphereRadius) { - return false; - } - if (sphereCenter.x - sphereRadius > boxMax.x) { - return false; - } - if (boxMin.y > sphereCenter.y + sphereRadius) { - return false; - } - if (sphereCenter.y - sphereRadius > boxMax.y) { - return false; - } - if (boxMin.z > sphereCenter.z + sphereRadius) { - return false; - } - if (sphereCenter.z - sphereRadius > boxMax.z) { - return false; - } - return true; -}; -var getLowestRoot = function() { - const result = { root: 0, found: false }; - return function(a, b, c, maxR) { - result.root = 0; - result.found = false; - const determinant = b * b - 4 * a * c; - if (determinant < 0) { - return result; - } - const sqrtD = Math.sqrt(determinant); - let r1 = (-b - sqrtD) / (2 * a); - let r2 = (-b + sqrtD) / (2 * a); - if (r1 > r2) { - const temp = r2; - r2 = r1; - r1 = temp; - } - if (r1 > 0 && r1 < maxR) { - result.root = r1; - result.found = true; - return result; - } - if (r2 > 0 && r2 < maxR) { - result.root = r2; - result.found = true; - return result; - } - return result; - }; -}(); +var init_vrExperienceHelper = __esm(() => { + init_logger(); + init_observable(); + init_freeCamera(); + init_targetCamera(); + init_deviceOrientationCamera(); + init_vrDeviceOrientationFreeCamera(); + init_pointerEvents(); + init_math_vector(); + init_math_color(); + init_gamepad(); + init_xboxGamepad(); + init_ray(); + init_imageProcessingConfiguration(); + init_standardMaterial(); + init_dynamicTexture(); + init_easing(); + init_animation(); + init_gamepadSceneComponent(); + init_animatable(); + init_webXRSessionManager(); + init_webXRTypes(); + init_groundBuilder(); + init_torusBuilder(); + VRExperienceHelperGazer._IdCounter = 0; + VRExperienceHelper.TELEPORTATIONMODE_CONSTANTTIME = 0; + VRExperienceHelper.TELEPORTATIONMODE_CONSTANTSPEED = 1; +}); +// node_modules/@babylonjs/core/Cameras/VR/index.js +var init_VR = __esm(() => { + init_vrCameraMetrics(); + init_vrDeviceOrientationArcRotateCamera(); + init_vrDeviceOrientationFreeCamera(); + init_vrDeviceOrientationGamepadCamera(); + init_vrExperienceHelper(); +}); + +// node_modules/@babylonjs/core/Cameras/RigModes/index.js +var init_RigModes = __esm(() => { + init_stereoscopicAnaglyphRigMode(); + init_stereoscopicRigMode(); + init_vrRigMode(); +}); + +// node_modules/@babylonjs/core/Cameras/index.js +var init_Cameras2 = __esm(() => { + init_Inputs(); + init_cameraInputsManager(); + init_camera(); + init_targetCamera(); + init_freeCamera(); + init_freeCameraInputsManager(); + init_touchCamera(); + init_arcRotateCamera(); + init_arcRotateCameraInputsManager(); + init_deviceOrientationCamera(); + init_flyCamera(); + init_flyCameraInputsManager(); + init_followCamera(); + init_followCameraInputsManager(); + init_gamepadCamera(); + init_Stereoscopic(); + init_universalCamera(); + init_virtualJoysticksCamera(); + init_VR(); + init_RigModes(); +}); + +// node_modules/@babylonjs/core/Collisions/collider.js class Collider { constructor() { this._collisionPoint = Vector3.Zero(); @@ -75022,7 +78396,64 @@ class Collider { this._destinationPoint.subtractToRef(this.intersectionPoint, vel); } } -Collider.DoubleSidedCheck = false; +var intersectBoxAASphere, getLowestRoot; +var init_collider = __esm(() => { + init_math_vector(); + init_math_plane(); + intersectBoxAASphere = (boxMin, boxMax, sphereCenter, sphereRadius) => { + if (boxMin.x > sphereCenter.x + sphereRadius) { + return false; + } + if (sphereCenter.x - sphereRadius > boxMax.x) { + return false; + } + if (boxMin.y > sphereCenter.y + sphereRadius) { + return false; + } + if (sphereCenter.y - sphereRadius > boxMax.y) { + return false; + } + if (boxMin.z > sphereCenter.z + sphereRadius) { + return false; + } + if (sphereCenter.z - sphereRadius > boxMax.z) { + return false; + } + return true; + }; + getLowestRoot = function() { + const result = { root: 0, found: false }; + return function(a, b, c, maxR) { + result.root = 0; + result.found = false; + const determinant = b * b - 4 * a * c; + if (determinant < 0) { + return result; + } + const sqrtD = Math.sqrt(determinant); + let r1 = (-b - sqrtD) / (2 * a); + let r2 = (-b + sqrtD) / (2 * a); + if (r1 > r2) { + const temp = r2; + r2 = r1; + r1 = temp; + } + if (r1 > 0 && r1 < maxR) { + result.root = r1; + result.found = true; + return result; + } + if (r2 > 0 && r2 < maxR) { + result.root = r2; + result.found = true; + return result; + } + return result; + }; + }(); + Collider.DoubleSidedCheck = false; +}); + // node_modules/@babylonjs/core/Collisions/collisionCoordinator.js class DefaultCollisionCoordinator { constructor() { @@ -75077,9 +78508,25 @@ class DefaultCollisionCoordinator { this._collideWithWorld(position, velocity, collider2, maximumRetry, finalPosition, excludedMesh); } } -Scene.CollisionCoordinatorFactory = () => { - return new DefaultCollisionCoordinator; -}; +var init_collisionCoordinator = __esm(() => { + init_scene(); + init_math_vector(); + init_engine(); + init_collider(); + Scene.CollisionCoordinatorFactory = () => { + return new DefaultCollisionCoordinator; + }; +}); + +// node_modules/@babylonjs/core/Collisions/index.js +var init_Collisions = __esm(() => { + init_collider(); + init_collisionCoordinator(); + init_pickingInfo(); + init_intersectionInfo(); + init_meshCollisionData(); +}); + // node_modules/@babylonjs/core/Compute/computeEffect.js class ComputeEffect { constructor(baseName, options, engine18, key = "") { @@ -75332,51 +78779,63 @@ class ComputeEffect { } this._engine._releaseComputeEffect(this); } - static RegisterShader(name72, computeShader) { - ShaderStore.GetShadersStore(ShaderLanguage.WGSL)[`${name72}ComputeShader`] = computeShader; + static RegisterShader(name73, computeShader) { + ShaderStore.GetShadersStore(ShaderLanguage.WGSL)[`${name73}ComputeShader`] = computeShader; } } -ComputeEffect._UniqueIdSeed = 0; -ComputeEffect.LogShaderCodeOnCompilationError = true; +var init_computeEffect = __esm(() => { + init_logger(); + init_observable(); + init_domManagement(); + init_shaderProcessor(); + init_shaderStore(); + init_shaderLanguage(); + ComputeEffect._UniqueIdSeed = 0; + ComputeEffect.LogShaderCodeOnCompilationError = true; +}); + // node_modules/@babylonjs/core/Engines/Extensions/engine.computeShader.js var ComputeBindingType; -(function(ComputeBindingType2) { - ComputeBindingType2[ComputeBindingType2["Texture"] = 0] = "Texture"; - ComputeBindingType2[ComputeBindingType2["StorageTexture"] = 1] = "StorageTexture"; - ComputeBindingType2[ComputeBindingType2["UniformBuffer"] = 2] = "UniformBuffer"; - ComputeBindingType2[ComputeBindingType2["StorageBuffer"] = 3] = "StorageBuffer"; - ComputeBindingType2[ComputeBindingType2["TextureWithoutSampler"] = 4] = "TextureWithoutSampler"; - ComputeBindingType2[ComputeBindingType2["Sampler"] = 5] = "Sampler"; - ComputeBindingType2[ComputeBindingType2["ExternalTexture"] = 6] = "ExternalTexture"; -})(ComputeBindingType || (ComputeBindingType = {})); -ThinEngine.prototype.createComputeEffect = function(baseName, options) { - throw new Error("createComputeEffect: This engine does not support compute shaders!"); -}; -ThinEngine.prototype.createComputePipelineContext = function() { - throw new Error("createComputePipelineContext: This engine does not support compute shaders!"); -}; -ThinEngine.prototype.createComputeContext = function() { - return; -}; -ThinEngine.prototype.computeDispatch = function(effect5, context, bindings, x, y, z, bindingsMapping) { - throw new Error("computeDispatch: This engine does not support compute shaders!"); -}; -ThinEngine.prototype.areAllComputeEffectsReady = function() { - return true; -}; -ThinEngine.prototype.releaseComputeEffects = function() { -}; -ThinEngine.prototype._prepareComputePipelineContext = function(pipelineContext, computeSourceCode, rawComputeSourceCode, defines, entryPoint) { -}; -ThinEngine.prototype._rebuildComputeEffects = function() { -}; -ThinEngine.prototype._executeWhenComputeStateIsCompiled = function(pipelineContext, action7) { - action7(); -}; -ThinEngine.prototype._releaseComputeEffect = function(effect5) { -}; -ThinEngine.prototype._deleteComputePipelineContext = function(pipelineContext) { -}; +var init_engine_computeShader = __esm(() => { + init_thinEngine(); + (function(ComputeBindingType2) { + ComputeBindingType2[ComputeBindingType2["Texture"] = 0] = "Texture"; + ComputeBindingType2[ComputeBindingType2["StorageTexture"] = 1] = "StorageTexture"; + ComputeBindingType2[ComputeBindingType2["UniformBuffer"] = 2] = "UniformBuffer"; + ComputeBindingType2[ComputeBindingType2["StorageBuffer"] = 3] = "StorageBuffer"; + ComputeBindingType2[ComputeBindingType2["TextureWithoutSampler"] = 4] = "TextureWithoutSampler"; + ComputeBindingType2[ComputeBindingType2["Sampler"] = 5] = "Sampler"; + ComputeBindingType2[ComputeBindingType2["ExternalTexture"] = 6] = "ExternalTexture"; + })(ComputeBindingType || (ComputeBindingType = {})); + ThinEngine.prototype.createComputeEffect = function(baseName, options) { + throw new Error("createComputeEffect: This engine does not support compute shaders!"); + }; + ThinEngine.prototype.createComputePipelineContext = function() { + throw new Error("createComputePipelineContext: This engine does not support compute shaders!"); + }; + ThinEngine.prototype.createComputeContext = function() { + return; + }; + ThinEngine.prototype.computeDispatch = function(effect5, context, bindings, x, y, z, bindingsMapping) { + throw new Error("computeDispatch: This engine does not support compute shaders!"); + }; + ThinEngine.prototype.areAllComputeEffectsReady = function() { + return true; + }; + ThinEngine.prototype.releaseComputeEffects = function() { + }; + ThinEngine.prototype._prepareComputePipelineContext = function(pipelineContext, computeSourceCode, rawComputeSourceCode, defines, entryPoint) { + }; + ThinEngine.prototype._rebuildComputeEffects = function() { + }; + ThinEngine.prototype._executeWhenComputeStateIsCompiled = function(pipelineContext, action7) { + action7(); + }; + ThinEngine.prototype._releaseComputeEffect = function(effect5) { + }; + ThinEngine.prototype._deleteComputePipelineContext = function(pipelineContext) { + }; +}); // node_modules/@babylonjs/core/Compute/computeShader.js class ComputeShader { @@ -75386,14 +78845,14 @@ class ComputeShader { get shaderPath() { return this._shaderPath; } - constructor(name72, engine18, shaderPath, options = {}) { + constructor(name73, engine18, shaderPath, options = {}) { this._bindings = {}; this._samplers = {}; this._contextIsDirty = false; this.fastMode = false; this.onCompiled = null; this.onError = null; - this.name = name72; + this.name = name73; this._engine = engine18; this.uniqueId = UniqueIdGenerator.UniqueId; if (!this._engine.getCaps().supportComputeShaders) { @@ -75411,62 +78870,62 @@ class ComputeShader { getClassName() { return "ComputeShader"; } - setTexture(name72, texture13, bindSampler = true) { - const current = this._bindings[name72]; - this._bindings[name72] = { + setTexture(name73, texture13, bindSampler = true) { + const current = this._bindings[name73]; + this._bindings[name73] = { type: bindSampler ? ComputeBindingType.Texture : ComputeBindingType.TextureWithoutSampler, object: texture13, indexInGroupEntries: current === null || current === undefined ? undefined : current.indexInGroupEntries }; - this._contextIsDirty || (this._contextIsDirty = !current || current.object !== texture13 || current.type !== this._bindings[name72].type); + this._contextIsDirty || (this._contextIsDirty = !current || current.object !== texture13 || current.type !== this._bindings[name73].type); } - setStorageTexture(name72, texture13) { - const current = this._bindings[name72]; + setStorageTexture(name73, texture13) { + const current = this._bindings[name73]; this._contextIsDirty || (this._contextIsDirty = !current || current.object !== texture13); - this._bindings[name72] = { + this._bindings[name73] = { type: ComputeBindingType.StorageTexture, object: texture13, indexInGroupEntries: current === null || current === undefined ? undefined : current.indexInGroupEntries }; } - setExternalTexture(name72, texture13) { - const current = this._bindings[name72]; + setExternalTexture(name73, texture13) { + const current = this._bindings[name73]; this._contextIsDirty || (this._contextIsDirty = !current || current.object !== texture13); - this._bindings[name72] = { + this._bindings[name73] = { type: ComputeBindingType.ExternalTexture, object: texture13, indexInGroupEntries: current === null || current === undefined ? undefined : current.indexInGroupEntries }; } - setVideoTexture(name72, texture13) { + setVideoTexture(name73, texture13) { if (texture13.externalTexture) { - this.setExternalTexture(name72, texture13.externalTexture); + this.setExternalTexture(name73, texture13.externalTexture); return true; } return false; } - setUniformBuffer(name72, buffer18) { - const current = this._bindings[name72]; + setUniformBuffer(name73, buffer18) { + const current = this._bindings[name73]; this._contextIsDirty || (this._contextIsDirty = !current || current.object !== buffer18); - this._bindings[name72] = { + this._bindings[name73] = { type: ComputeBindingType.UniformBuffer, object: buffer18, indexInGroupEntries: current === null || current === undefined ? undefined : current.indexInGroupEntries }; } - setStorageBuffer(name72, buffer18) { - const current = this._bindings[name72]; + setStorageBuffer(name73, buffer18) { + const current = this._bindings[name73]; this._contextIsDirty || (this._contextIsDirty = !current || current.object !== buffer18); - this._bindings[name72] = { + this._bindings[name73] = { type: ComputeBindingType.StorageBuffer, object: buffer18, indexInGroupEntries: current === null || current === undefined ? undefined : current.indexInGroupEntries }; } - setTextureSampler(name72, sampler) { - const current = this._bindings[name72]; + setTextureSampler(name73, sampler) { + const current = this._bindings[name73]; this._contextIsDirty || (this._contextIsDirty = !current || !sampler.compareSampler(current.object)); - this._bindings[name72] = { + this._bindings[name73] = { type: ComputeBindingType.Sampler, object: sampler, indexInGroupEntries: current === null || current === undefined ? undefined : current.indexInGroupEntries @@ -75618,13 +79077,30 @@ class ComputeShader { return compute; } } -__decorate2([ - serialize() -], ComputeShader.prototype, "name", undefined); -__decorate2([ - serialize() -], ComputeShader.prototype, "fastMode", undefined); -RegisterClass("BABYLON.ComputeShader", ComputeShader); +var init_computeShader = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_typeStore(); + init_engine_computeShader(); + init_texture(); + init_uniqueIdGenerator(); + init_logger(); + init_textureSampler(); + __decorate2([ + serialize() + ], ComputeShader.prototype, "name", undefined); + __decorate2([ + serialize() + ], ComputeShader.prototype, "fastMode", undefined); + RegisterClass("BABYLON.ComputeShader", ComputeShader); +}); + +// node_modules/@babylonjs/core/Compute/index.js +var init_Compute = __esm(() => { + init_computeEffect(); + init_computeShader(); +}); + // node_modules/@babylonjs/core/Culling/Octrees/octreeBlock.js class OctreeBlock { constructor(minPoint, maxPoint, capacity, depth, maxDepth, creationFunc) { @@ -75756,6 +79232,10 @@ class OctreeBlock { } } } +var init_octreeBlock = __esm(() => { + init_math_vector(); + init_boundingBox(); +}); // node_modules/@babylonjs/core/Culling/Octrees/octree.js class Octree { @@ -75817,56 +79297,24 @@ class Octree { return this._selectionContent; } } -Octree.CreationFuncForMeshes = (entry, block) => { - const boundingInfo4 = entry.getBoundingInfo(); - if (!entry.isBlocked && boundingInfo4.boundingBox.intersectsMinMax(block.minPoint, block.maxPoint)) { - block.entries.push(entry); - } -}; -Octree.CreationFuncForSubMeshes = (entry, block) => { - const boundingInfo4 = entry.getBoundingInfo(); - if (boundingInfo4.boundingBox.intersectsMinMax(block.minPoint, block.maxPoint)) { - block.entries.push(entry); - } -}; -// node_modules/@babylonjs/core/Culling/Octrees/octreeSceneComponent.js -Scene.prototype.createOrUpdateSelectionOctree = function(maxCapacity = 64, maxDepth = 2) { - let component = this._getComponent(SceneComponentConstants.NAME_OCTREE); - if (!component) { - component = new OctreeSceneComponent(this); - this._addComponent(component); - } - if (!this._selectionOctree) { - this._selectionOctree = new Octree(Octree.CreationFuncForMeshes, maxCapacity, maxDepth); - } - const worldExtends = this.getWorldExtends(); - this._selectionOctree.update(worldExtends.min, worldExtends.max, this.meshes); - return this._selectionOctree; -}; -Object.defineProperty(Scene.prototype, "selectionOctree", { - get: function() { - return this._selectionOctree; - }, - enumerable: true, - configurable: true +var init_octree = __esm(() => { + init_smartArray(); + init_octreeBlock(); + Octree.CreationFuncForMeshes = (entry, block) => { + const boundingInfo4 = entry.getBoundingInfo(); + if (!entry.isBlocked && boundingInfo4.boundingBox.intersectsMinMax(block.minPoint, block.maxPoint)) { + block.entries.push(entry); + } + }; + Octree.CreationFuncForSubMeshes = (entry, block) => { + const boundingInfo4 = entry.getBoundingInfo(); + if (boundingInfo4.boundingBox.intersectsMinMax(block.minPoint, block.maxPoint)) { + block.entries.push(entry); + } + }; }); -AbstractMesh.prototype.createOrUpdateSubmeshesOctree = function(maxCapacity = 64, maxDepth = 2) { - const scene16 = this.getScene(); - let component = scene16._getComponent(SceneComponentConstants.NAME_OCTREE); - if (!component) { - component = new OctreeSceneComponent(scene16); - scene16._addComponent(component); - } - if (!this._submeshesOctree) { - this._submeshesOctree = new Octree(Octree.CreationFuncForSubMeshes, maxCapacity, maxDepth); - } - this.computeWorldMatrix(true); - const boundingInfo4 = this.getBoundingInfo(); - const bbox = boundingInfo4.boundingBox; - this._submeshesOctree.update(bbox.minimumWorld, bbox.maximumWorld, this.subMeshes); - return this._submeshesOctree; -}; +// node_modules/@babylonjs/core/Culling/Octrees/octreeSceneComponent.js class OctreeSceneComponent { constructor(scene16) { this.name = SceneComponentConstants.NAME_OCTREE; @@ -75931,6 +79379,68 @@ class OctreeSceneComponent { dispose() { } } +var init_octreeSceneComponent = __esm(() => { + init_scene(); + init_math_vector(); + init_abstractMesh(); + init_ray(); + init_sceneComponent(); + init_octree(); + init_engineStore(); + Scene.prototype.createOrUpdateSelectionOctree = function(maxCapacity = 64, maxDepth = 2) { + let component = this._getComponent(SceneComponentConstants.NAME_OCTREE); + if (!component) { + component = new OctreeSceneComponent(this); + this._addComponent(component); + } + if (!this._selectionOctree) { + this._selectionOctree = new Octree(Octree.CreationFuncForMeshes, maxCapacity, maxDepth); + } + const worldExtends = this.getWorldExtends(); + this._selectionOctree.update(worldExtends.min, worldExtends.max, this.meshes); + return this._selectionOctree; + }; + Object.defineProperty(Scene.prototype, "selectionOctree", { + get: function() { + return this._selectionOctree; + }, + enumerable: true, + configurable: true + }); + AbstractMesh.prototype.createOrUpdateSubmeshesOctree = function(maxCapacity = 64, maxDepth = 2) { + const scene16 = this.getScene(); + let component = scene16._getComponent(SceneComponentConstants.NAME_OCTREE); + if (!component) { + component = new OctreeSceneComponent(scene16); + scene16._addComponent(component); + } + if (!this._submeshesOctree) { + this._submeshesOctree = new Octree(Octree.CreationFuncForSubMeshes, maxCapacity, maxDepth); + } + this.computeWorldMatrix(true); + const boundingInfo4 = this.getBoundingInfo(); + const bbox = boundingInfo4.boundingBox; + this._submeshesOctree.update(bbox.minimumWorld, bbox.maximumWorld, this.subMeshes); + return this._submeshesOctree; + }; +}); + +// node_modules/@babylonjs/core/Culling/Octrees/index.js +var init_Octrees = __esm(() => { + init_octree(); + init_octreeBlock(); + init_octreeSceneComponent(); +}); + +// node_modules/@babylonjs/core/Culling/index.js +var init_Culling = __esm(() => { + init_boundingBox(); + init_boundingInfo(); + init_boundingSphere(); + init_Octrees(); + init_ray(); +}); + // node_modules/@babylonjs/core/Meshes/Builders/cylinderBuilder.js function CreateCylinderVertexData(options) { const height = options.height || 2; @@ -76153,44 +79663,53 @@ function CreateCylinderVertexData(options) { } return vertexData; } -function CreateCylinder(name72, options = {}, scene17) { - const cylinder = new Mesh(name72, scene17); +function CreateCylinder(name73, options = {}, scene17) { + const cylinder = new Mesh(name73, scene17); options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation); cylinder._originalBuilderSideOrientation = options.sideOrientation; const vertexData = CreateCylinderVertexData(options); vertexData.applyToMesh(cylinder, options.updatable); return cylinder; } -VertexData.CreateCylinder = CreateCylinderVertexData; -Mesh.CreateCylinder = (name72, height, diameterTop, diameterBottom, tessellation, subdivisions, scene17, updatable, sideOrientation) => { - if (scene17 === undefined || !(scene17 instanceof Scene)) { - if (scene17 !== undefined) { - sideOrientation = updatable || Mesh.DEFAULTSIDE; - updatable = scene17; - } - scene17 = subdivisions; - subdivisions = 1; - } - const options = { - height, - diameterTop, - diameterBottom, - tessellation, - subdivisions, - sideOrientation, - updatable +var CylinderBuilder; +var init_cylinderBuilder = __esm(() => { + init_math_vector(); + init_math_color(); + init_mesh(); + init_mesh_vertexData(); + init_scene(); + init_math_axis(); + init_compatibilityOptions(); + CylinderBuilder = { + CreateCylinder + }; + VertexData.CreateCylinder = CreateCylinderVertexData; + Mesh.CreateCylinder = (name73, height, diameterTop, diameterBottom, tessellation, subdivisions, scene17, updatable, sideOrientation) => { + if (scene17 === undefined || !(scene17 instanceof Scene)) { + if (scene17 !== undefined) { + sideOrientation = updatable || Mesh.DEFAULTSIDE; + updatable = scene17; + } + scene17 = subdivisions; + subdivisions = 1; + } + const options = { + height, + diameterTop, + diameterBottom, + tessellation, + subdivisions, + sideOrientation, + updatable + }; + return CreateCylinder(name73, options, scene17); }; - return CreateCylinder(name72, options, scene17); -}; - -// node_modules/@babylonjs/core/Lights/hemisphericLight.js -Node2.AddNodeConstructor("Light_Type_3", (name72, scene17) => { - return () => new HemisphericLight(name72, Vector3.Zero(), scene17); }); +// node_modules/@babylonjs/core/Lights/hemisphericLight.js class HemisphericLight extends Light { - constructor(name72, direction, scene17) { - super(name72, scene17); + constructor(name73, direction, scene17) { + super(name73, scene17); this.groundColor = new Color3(0, 0, 0); this.direction = direction || Vector3.Up(); } @@ -76237,12 +79756,23 @@ class HemisphericLight extends Light { defines["HEMILIGHT" + lightIndex] = true; } } -__decorate2([ - serializeAsColor3() -], HemisphericLight.prototype, "groundColor", undefined); -__decorate2([ - serializeAsVector3() -], HemisphericLight.prototype, "direction", undefined); +var init_hemisphericLight = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_math_color(); + init_node(); + init_light(); + Node2.AddNodeConstructor("Light_Type_3", (name73, scene17) => { + return () => new HemisphericLight(name73, Vector3.Zero(), scene17); + }); + __decorate2([ + serializeAsColor3() + ], HemisphericLight.prototype, "groundColor", undefined); + __decorate2([ + serializeAsVector3() + ], HemisphericLight.prototype, "direction", undefined); +}); // node_modules/@babylonjs/core/Rendering/utilityLayerRenderer.js class UtilityLayerRenderer { @@ -76481,21 +80011,20 @@ class UtilityLayerRenderer { this.utilityLayerScene.activeCamera = this.getRenderCamera(); } } -UtilityLayerRenderer._DefaultUtilityLayer = null; -UtilityLayerRenderer._DefaultKeepDepthUtilityLayer = null; +var init_utilityLayerRenderer = __esm(() => { + init_scene(); + init_observable(); + init_pointerEvents(); + init_pickingInfo(); + init_engineStore(); + init_hemisphericLight(); + init_math_vector(); + init_math_color(); + UtilityLayerRenderer._DefaultUtilityLayer = null; + UtilityLayerRenderer._DefaultKeepDepthUtilityLayer = null; +}); // node_modules/@babylonjs/core/Gizmos/gizmo.js -var GizmoAnchorPoint; -(function(GizmoAnchorPoint2) { - GizmoAnchorPoint2[GizmoAnchorPoint2["Origin"] = 0] = "Origin"; - GizmoAnchorPoint2[GizmoAnchorPoint2["Pivot"] = 1] = "Pivot"; -})(GizmoAnchorPoint || (GizmoAnchorPoint = {})); -var GizmoCoordinatesMode; -(function(GizmoCoordinatesMode2) { - GizmoCoordinatesMode2[GizmoCoordinatesMode2["World"] = 0] = "World"; - GizmoCoordinatesMode2[GizmoCoordinatesMode2["Local"] = 1] = "Local"; -})(GizmoCoordinatesMode || (GizmoCoordinatesMode = {})); - class Gizmo { set scaleRatio(value) { this._scaleRatio = value; @@ -76845,28 +80374,361 @@ class Gizmo { } } } -Gizmo.PreserveScaling = false; -Gizmo.UseAbsoluteScaling = true; -// node_modules/@babylonjs/core/Debug/debugLayer.js -Object.defineProperty(Scene.prototype, "debugLayer", { - get: function() { - if (!this._debugLayer) { - this._debugLayer = new DebugLayer(this); +var GizmoAnchorPoint, GizmoCoordinatesMode; +var init_gizmo = __esm(() => { + init_math_vector(); + init_mesh(); + init_camera(); + init_utilityLayerRenderer(); + init_pointerEvents(); + init_light(); + (function(GizmoAnchorPoint2) { + GizmoAnchorPoint2[GizmoAnchorPoint2["Origin"] = 0] = "Origin"; + GizmoAnchorPoint2[GizmoAnchorPoint2["Pivot"] = 1] = "Pivot"; + })(GizmoAnchorPoint || (GizmoAnchorPoint = {})); + (function(GizmoCoordinatesMode2) { + GizmoCoordinatesMode2[GizmoCoordinatesMode2["World"] = 0] = "World"; + GizmoCoordinatesMode2[GizmoCoordinatesMode2["Local"] = 1] = "Local"; + })(GizmoCoordinatesMode || (GizmoCoordinatesMode = {})); + Gizmo.PreserveScaling = false; + Gizmo.UseAbsoluteScaling = true; +}); + +// node_modules/@babylonjs/core/Gizmos/axisDragGizmo.js +class AxisDragGizmo extends Gizmo { + get coloredMaterial() { + return this._coloredMaterial; + } + get hoverMaterial() { + return this._hoverMaterial; + } + get disableMaterial() { + return this._disableMaterial; + } + static _CreateArrow(scene18, material9, thickness = 1, isCollider = false) { + const arrow = new TransformNode("arrow", scene18); + const cylinder = CreateCylinder("cylinder", { + diameterTop: 0, + height: 0.075, + diameterBottom: 0.0375 * (1 + (thickness - 1) / 4), + tessellation: 96 + }, scene18); + const line = CreateCylinder("cylinder", { + diameterTop: 0.005 * thickness, + height: 0.275, + diameterBottom: 0.005 * thickness, + tessellation: 96 + }, scene18); + cylinder.parent = arrow; + cylinder.material = material9; + cylinder.rotation.x = Math.PI / 2; + cylinder.position.z += 0.3; + line.parent = arrow; + line.material = material9; + line.position.z += 0.275 / 2; + line.rotation.x = Math.PI / 2; + if (isCollider) { + line.visibility = 0; + cylinder.visibility = 0; } - return this._debugLayer; - }, - enumerable: true, - configurable: true + return arrow; + } + static _CreateArrowInstance(scene18, arrow) { + const instance = new TransformNode("arrow", scene18); + for (const mesh14 of arrow.getChildMeshes()) { + const childInstance = mesh14.createInstance(mesh14.name); + childInstance.parent = instance; + } + return instance; + } + constructor(dragAxis, color = Color3.Gray(), gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer, parent = null, thickness = 1, hoverColor = Color3.Yellow(), disableColor = Color3.Gray()) { + var _a; + super(gizmoLayer); + this._pointerObserver = null; + this.snapDistance = 0; + this.onSnapObservable = new Observable; + this._isEnabled = true; + this._parent = null; + this._dragging = false; + this._parent = parent; + this._coloredMaterial = new StandardMaterial("", gizmoLayer.utilityLayerScene); + this._coloredMaterial.diffuseColor = color; + this._coloredMaterial.specularColor = color.subtract(new Color3(0.1, 0.1, 0.1)); + this._hoverMaterial = new StandardMaterial("", gizmoLayer.utilityLayerScene); + this._hoverMaterial.diffuseColor = hoverColor; + this._disableMaterial = new StandardMaterial("", gizmoLayer.utilityLayerScene); + this._disableMaterial.diffuseColor = disableColor; + this._disableMaterial.alpha = 0.4; + const arrow = AxisDragGizmo._CreateArrow(gizmoLayer.utilityLayerScene, this._coloredMaterial, thickness); + const collider3 = AxisDragGizmo._CreateArrow(gizmoLayer.utilityLayerScene, this._coloredMaterial, thickness + 4, true); + this._gizmoMesh = new Mesh("", gizmoLayer.utilityLayerScene); + this._gizmoMesh.addChild(arrow); + this._gizmoMesh.addChild(collider3); + this._gizmoMesh.lookAt(this._rootMesh.position.add(dragAxis)); + this._gizmoMesh.scaling.scaleInPlace(1 / 3); + this._gizmoMesh.parent = this._rootMesh; + let currentSnapDragDistance = 0; + const tmpSnapEvent = { snapDistance: 0 }; + this.dragBehavior = new PointerDragBehavior({ dragAxis }); + this.dragBehavior.moveAttached = false; + this.dragBehavior.updateDragPlane = false; + this._rootMesh.addBehavior(this.dragBehavior); + this.dragBehavior.onDragObservable.add((event) => { + if (this.attachedNode) { + let matrixChanged = false; + if (this.snapDistance == 0) { + this.attachedNode.getWorldMatrix().getTranslationToRef(TmpVectors.Vector3[2]); + TmpVectors.Vector3[2].addInPlace(event.delta); + if (this.dragBehavior.validateDrag(TmpVectors.Vector3[2])) { + if (this.attachedNode.position) { + this.attachedNode.position.addInPlaceFromFloats(event.delta.x, event.delta.y, event.delta.z); + } + this.attachedNode.getWorldMatrix().addTranslationFromFloats(event.delta.x, event.delta.y, event.delta.z); + this.attachedNode.updateCache(); + matrixChanged = true; + } + } else { + currentSnapDragDistance += event.dragDistance; + if (Math.abs(currentSnapDragDistance) > this.snapDistance) { + const dragSteps = Math.floor(Math.abs(currentSnapDragDistance) / this.snapDistance); + currentSnapDragDistance = currentSnapDragDistance % this.snapDistance; + event.delta.normalizeToRef(TmpVectors.Vector3[1]); + TmpVectors.Vector3[1].scaleInPlace(this.snapDistance * dragSteps); + this.attachedNode.getWorldMatrix().getTranslationToRef(TmpVectors.Vector3[2]); + TmpVectors.Vector3[2].addInPlace(TmpVectors.Vector3[1]); + if (this.dragBehavior.validateDrag(TmpVectors.Vector3[2])) { + this.attachedNode.getWorldMatrix().addTranslationFromFloats(TmpVectors.Vector3[1].x, TmpVectors.Vector3[1].y, TmpVectors.Vector3[1].z); + this.attachedNode.updateCache(); + tmpSnapEvent.snapDistance = this.snapDistance * dragSteps * Math.sign(currentSnapDragDistance); + this.onSnapObservable.notifyObservers(tmpSnapEvent); + matrixChanged = true; + } + } + } + if (matrixChanged) { + this._matrixChanged(); + } + } + }); + this.dragBehavior.onDragStartObservable.add(() => { + this._dragging = true; + }); + this.dragBehavior.onDragEndObservable.add(() => { + this._dragging = false; + }); + const light4 = gizmoLayer._getSharedGizmoLight(); + light4.includedOnlyMeshes = light4.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(false)); + const cache = { + gizmoMeshes: arrow.getChildMeshes(), + colliderMeshes: collider3.getChildMeshes(), + material: this._coloredMaterial, + hoverMaterial: this._hoverMaterial, + disableMaterial: this._disableMaterial, + active: false, + dragBehavior: this.dragBehavior + }; + (_a = this._parent) === null || _a === undefined || _a.addToAxisCache(collider3, cache); + this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => { + var _a2; + if (this._customMeshSet) { + return; + } + this._isHovered = !!(cache.colliderMeshes.indexOf((_a2 = pointerInfo === null || pointerInfo === undefined ? undefined : pointerInfo.pickInfo) === null || _a2 === undefined ? undefined : _a2.pickedMesh) != -1); + if (!this._parent) { + const material9 = this.dragBehavior.enabled ? this._isHovered || this._dragging ? this._hoverMaterial : this._coloredMaterial : this._disableMaterial; + this._setGizmoMeshMaterial(cache.gizmoMeshes, material9); + } + }); + this.dragBehavior.onEnabledObservable.add((newState) => { + this._setGizmoMeshMaterial(cache.gizmoMeshes, newState ? cache.material : cache.disableMaterial); + }); + } + _attachedNodeChanged(value) { + if (this.dragBehavior) { + this.dragBehavior.enabled = value ? true : false; + } + } + set isEnabled(value) { + this._isEnabled = value; + if (!value) { + this.attachedMesh = null; + this.attachedNode = null; + } else { + if (this._parent) { + this.attachedMesh = this._parent.attachedMesh; + this.attachedNode = this._parent.attachedNode; + } + } + } + get isEnabled() { + return this._isEnabled; + } + dispose() { + this.onSnapObservable.clear(); + this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver); + this.dragBehavior.detach(); + if (this._gizmoMesh) { + this._gizmoMesh.dispose(); + } + [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((matl) => { + if (matl) { + matl.dispose(); + } + }); + super.dispose(); + } +} +var init_axisDragGizmo = __esm(() => { + init_observable(); + init_transformNode(); + init_mesh(); + init_cylinderBuilder(); + init_pointerDragBehavior(); + init_gizmo(); + init_utilityLayerRenderer(); + init_standardMaterial(); + init_math_color(); + init_math_vector(); +}); + +// node_modules/@babylonjs/core/Debug/axesViewer.js +class AxesViewer { + get scaleLines() { + return this._scaleLines; + } + set scaleLines(value) { + this._scaleLines = value; + this._xAxis.scaling.setAll(this._scaleLines * this._scaleLinesFactor); + this._yAxis.scaling.setAll(this._scaleLines * this._scaleLinesFactor); + this._zAxis.scaling.setAll(this._scaleLines * this._scaleLinesFactor); + } + get xAxis() { + return this._xAxis; + } + get yAxis() { + return this._yAxis; + } + get zAxis() { + return this._zAxis; + } + constructor(scene18, scaleLines = 1, renderingGroupId = 2, xAxis, yAxis, zAxis, lineThickness = 1) { + this._scaleLinesFactor = 4; + this._instanced = false; + this.scene = null; + this._scaleLines = 1; + scene18 = scene18 || EngineStore.LastCreatedScene; + if (!scene18) { + return; + } + if (!xAxis) { + const redColoredMaterial = new StandardMaterial("xAxisMaterial", scene18); + redColoredMaterial.disableLighting = true; + redColoredMaterial.emissiveColor = Color3.Red().scale(0.5); + xAxis = AxisDragGizmo._CreateArrow(scene18, redColoredMaterial, lineThickness); + } + if (!yAxis) { + const greenColoredMaterial = new StandardMaterial("yAxisMaterial", scene18); + greenColoredMaterial.disableLighting = true; + greenColoredMaterial.emissiveColor = Color3.Green().scale(0.5); + yAxis = AxisDragGizmo._CreateArrow(scene18, greenColoredMaterial, lineThickness); + } + if (!zAxis) { + const blueColoredMaterial = new StandardMaterial("zAxisMaterial", scene18); + blueColoredMaterial.disableLighting = true; + blueColoredMaterial.emissiveColor = Color3.Blue().scale(0.5); + zAxis = AxisDragGizmo._CreateArrow(scene18, blueColoredMaterial, lineThickness); + } + this._xAxis = xAxis; + this._yAxis = yAxis; + this._zAxis = zAxis; + this.scaleLines = scaleLines; + if (renderingGroupId != null) { + AxesViewer._SetRenderingGroupId(this._xAxis, renderingGroupId); + AxesViewer._SetRenderingGroupId(this._yAxis, renderingGroupId); + AxesViewer._SetRenderingGroupId(this._zAxis, renderingGroupId); + } + this.scene = scene18; + this.update(new Vector3, Vector3.Right(), Vector3.Up(), Vector3.Forward()); + } + update(position, xaxis, yaxis, zaxis) { + this._xAxis.position.copyFrom(position); + this._xAxis.setDirection(xaxis); + this._yAxis.position.copyFrom(position); + this._yAxis.setDirection(yaxis); + this._zAxis.position.copyFrom(position); + this._zAxis.setDirection(zaxis); + } + createInstance() { + const xAxis = AxisDragGizmo._CreateArrowInstance(this.scene, this._xAxis); + const yAxis = AxisDragGizmo._CreateArrowInstance(this.scene, this._yAxis); + const zAxis = AxisDragGizmo._CreateArrowInstance(this.scene, this._zAxis); + const axesViewer = new AxesViewer(this.scene, this.scaleLines, null, xAxis, yAxis, zAxis); + axesViewer._instanced = true; + return axesViewer; + } + dispose() { + if (this._xAxis) { + this._xAxis.dispose(false, !this._instanced); + } + if (this._yAxis) { + this._yAxis.dispose(false, !this._instanced); + } + if (this._zAxis) { + this._zAxis.dispose(false, !this._instanced); + } + this.scene = null; + } + static _SetRenderingGroupId(node26, id) { + node26.getChildMeshes().forEach((mesh14) => { + mesh14.renderingGroupId = id; + }); + } +} +var init_axesViewer = __esm(() => { + init_math_vector(); + init_standardMaterial(); + init_axisDragGizmo(); + init_math_color(); + init_engineStore(); }); -var DebugLayerTab; -(function(DebugLayerTab2) { - DebugLayerTab2[DebugLayerTab2["Properties"] = 0] = "Properties"; - DebugLayerTab2[DebugLayerTab2["Debug"] = 1] = "Debug"; - DebugLayerTab2[DebugLayerTab2["Statistics"] = 2] = "Statistics"; - DebugLayerTab2[DebugLayerTab2["Tools"] = 3] = "Tools"; - DebugLayerTab2[DebugLayerTab2["Settings"] = 4] = "Settings"; -})(DebugLayerTab || (DebugLayerTab = {})); +// node_modules/@babylonjs/core/Debug/boneAxesViewer.js +class BoneAxesViewer extends AxesViewer { + constructor(scene18, bone4, mesh14, scaleLines = 1) { + super(scene18, scaleLines); + this.pos = Vector3.Zero(); + this.xaxis = Vector3.Zero(); + this.yaxis = Vector3.Zero(); + this.zaxis = Vector3.Zero(); + this.mesh = mesh14; + this.bone = bone4; + } + update() { + if (!this.mesh || !this.bone) { + return; + } + const bone4 = this.bone; + bone4.getAbsolutePositionToRef(this.mesh, this.pos); + bone4.getDirectionToRef(Axis.X, this.mesh, this.xaxis); + bone4.getDirectionToRef(Axis.Y, this.mesh, this.yaxis); + bone4.getDirectionToRef(Axis.Z, this.mesh, this.zaxis); + super.update(this.pos, this.xaxis, this.yaxis, this.zaxis); + } + dispose() { + if (this.mesh) { + this.mesh = null; + this.bone = null; + super.dispose(); + } + } +} +var init_boneAxesViewer = __esm(() => { + init_axesViewer(); + init_math_vector(); + init_math_axis(); +}); + +// node_modules/@babylonjs/core/Debug/debugLayer.js class DebugLayer { get onPropertyChangedObservable() { if (this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector) { @@ -76969,15 +80831,41 @@ class DebugLayer { }); } } -DebugLayer.InspectorURL = `${Tools._DefaultCdnUrl}/v${Engine2.Version}/inspector/babylon.inspector.bundle.js`; -DebugLayer.Config = { - overlay: false, - showExplorer: true, - showInspector: true, - embedMode: false, - handleResize: true, - enablePopup: true -}; +var DebugLayerTab; +var init_debugLayer = __esm(() => { + init_tools(); + init_observable(); + init_scene(); + init_engine(); + init_engineStore(); + Object.defineProperty(Scene.prototype, "debugLayer", { + get: function() { + if (!this._debugLayer) { + this._debugLayer = new DebugLayer(this); + } + return this._debugLayer; + }, + enumerable: true, + configurable: true + }); + (function(DebugLayerTab2) { + DebugLayerTab2[DebugLayerTab2["Properties"] = 0] = "Properties"; + DebugLayerTab2[DebugLayerTab2["Debug"] = 1] = "Debug"; + DebugLayerTab2[DebugLayerTab2["Statistics"] = 2] = "Statistics"; + DebugLayerTab2[DebugLayerTab2["Tools"] = 3] = "Tools"; + DebugLayerTab2[DebugLayerTab2["Settings"] = 4] = "Settings"; + })(DebugLayerTab || (DebugLayerTab = {})); + DebugLayer.InspectorURL = `${Tools._DefaultCdnUrl}/v${Engine2.Version}/inspector/babylon.inspector.bundle.js`; + DebugLayer.Config = { + overlay: false, + showExplorer: true, + showInspector: true, + embedMode: false, + handleResize: true, + enablePopup: true + }; +}); + // node_modules/@babylonjs/core/Meshes/Builders/boxBuilder.js function CreateBoxVertexData(options) { const nbFaces = 6; @@ -77304,23 +81192,35 @@ function CreateSegmentedBoxVertexData(options) { bottomPlane.merge([topPlane, posXPlane, negXPlane, negZPlane, posZPlane], true); return bottomPlane; } -function CreateBox(name72, options = {}, scene19 = null) { - const box = new Mesh(name72, scene19); +function CreateBox(name73, options = {}, scene19 = null) { + const box = new Mesh(name73, scene19); options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation); box._originalBuilderSideOrientation = options.sideOrientation; const vertexData = CreateBoxVertexData(options); vertexData.applyToMesh(box, options.updatable); return box; } -VertexData.CreateBox = CreateBoxVertexData; -Mesh.CreateBox = (name72, size, scene19 = null, updatable, sideOrientation) => { - const options = { - size, - sideOrientation, - updatable +var BoxBuilder; +var init_boxBuilder = __esm(() => { + init_math_vector(); + init_math_color(); + init_mesh(); + init_mesh_vertexData(); + init_compatibilityOptions(); + init_groundBuilder(); + BoxBuilder = { + CreateBox }; - return CreateBox(name72, options, scene19); -}; + VertexData.CreateBox = CreateBoxVertexData; + Mesh.CreateBox = (name73, size, scene19 = null, updatable, sideOrientation) => { + const options = { + size, + sideOrientation, + updatable + }; + return CreateBox(name73, options, scene19); + }; +}); // node_modules/@babylonjs/core/Meshes/Builders/sphereBuilder.js function CreateSphereVertexData(options) { @@ -77388,26 +81288,36 @@ function CreateSphereVertexData(options) { vertexData.uvs = uvs; return vertexData; } -function CreateSphere(name72, options = {}, scene19 = null) { - const sphere = new Mesh(name72, scene19); +function CreateSphere(name73, options = {}, scene19 = null) { + const sphere = new Mesh(name73, scene19); options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation); sphere._originalBuilderSideOrientation = options.sideOrientation; const vertexData = CreateSphereVertexData(options); vertexData.applyToMesh(sphere, options.updatable); return sphere; } -VertexData.CreateSphere = CreateSphereVertexData; -Mesh.CreateSphere = (name72, segments, diameter, scene19, updatable, sideOrientation) => { - const options = { - segments, - diameterX: diameter, - diameterY: diameter, - diameterZ: diameter, - sideOrientation, - updatable +var SphereBuilder; +var init_sphereBuilder = __esm(() => { + init_math_vector(); + init_mesh(); + init_mesh_vertexData(); + init_compatibilityOptions(); + SphereBuilder = { + CreateSphere }; - return CreateSphere(name72, options, scene19); -}; + VertexData.CreateSphere = CreateSphereVertexData; + Mesh.CreateSphere = (name73, segments, diameter, scene19, updatable, sideOrientation) => { + const options = { + segments, + diameterX: diameter, + diameterY: diameter, + diameterZ: diameter, + sideOrientation, + updatable + }; + return CreateSphere(name73, options, scene19); + }; +}); // node_modules/@babylonjs/core/Meshes/Builders/capsuleBuilder.js function CreateCapsuleVertexData(options = { @@ -77552,7 +81462,7 @@ function CreateCapsuleVertexData(options = { vDat.indices = indices; return vDat; } -function CreateCapsule(name72, options = { +function CreateCapsule(name73, options = { orientation: Vector3.Up(), subdivisions: 2, tessellation: 16, @@ -77561,15 +81471,25 @@ function CreateCapsule(name72, options = { capSubdivisions: 6, updatable: false }, scene19 = null) { - const capsule = new Mesh(name72, scene19); + const capsule = new Mesh(name73, scene19); const vertexData = CreateCapsuleVertexData(options); vertexData.applyToMesh(capsule, options.updatable); return capsule; } -Mesh.CreateCapsule = (name72, options, scene19) => { - return CreateCapsule(name72, options, scene19); -}; -VertexData.CreateCapsule = CreateCapsuleVertexData; +var CapsuleBuilder; +var init_capsuleBuilder = __esm(() => { + init_mesh_vertexData(); + init_math_vector(); + init_mesh(); + init_compatibilityOptions(); + CapsuleBuilder = { + CreateCapsule + }; + Mesh.CreateCapsule = (name73, options, scene19) => { + return CreateCapsule(name73, options, scene19); + }; + VertexData.CreateCapsule = CreateCapsuleVertexData; +}); // node_modules/@babylonjs/core/Meshes/Builders/ribbonBuilder.js function CreateRibbonVertexData(options) { @@ -77766,7 +81686,7 @@ function CreateRibbonVertexData(options) { } return vertexData; } -function CreateRibbon(name72, options, scene19 = null) { +function CreateRibbon(name73, options, scene19 = null) { const pathArray = options.pathArray; const closeArray = options.closeArray; const closePath = options.closePath; @@ -77861,7 +81781,7 @@ function CreateRibbon(name72, options, scene19 = null) { } return instance; } else { - const ribbon = new Mesh(name72, scene19); + const ribbon = new Mesh(name73, scene19); ribbon._originalBuilderSideOrientation = sideOrientation; ribbon._creationDataStorage = new _CreationDataStorage; const vertexData = CreateRibbonVertexData(options); @@ -77874,18 +81794,29 @@ function CreateRibbon(name72, options, scene19 = null) { return ribbon; } } -VertexData.CreateRibbon = CreateRibbonVertexData; -Mesh.CreateRibbon = (name72, pathArray, closeArray = false, closePath, offset, scene19, updatable = false, sideOrientation, instance) => { - return CreateRibbon(name72, { - pathArray, - closeArray, - closePath, - offset, - updatable, - sideOrientation, - instance - }, scene19); -}; +var RibbonBuilder; +var init_ribbonBuilder = __esm(() => { + init_math_vector(); + init_mesh(); + init_buffer(); + init_mesh_vertexData(); + init_compatibilityOptions(); + RibbonBuilder = { + CreateRibbon + }; + VertexData.CreateRibbon = CreateRibbonVertexData; + Mesh.CreateRibbon = (name73, pathArray, closeArray = false, closePath, offset, scene19, updatable = false, sideOrientation, instance) => { + return CreateRibbon(name73, { + pathArray, + closeArray, + closePath, + offset, + updatable, + sideOrientation, + instance + }, scene19); + }; +}); // node_modules/@babylonjs/core/Meshes/Builders/discBuilder.js function CreateDiscVertexData(options) { @@ -77928,24 +81859,33 @@ function CreateDiscVertexData(options) { vertexData.uvs = uvs; return vertexData; } -function CreateDisc(name72, options = {}, scene19 = null) { - const disc = new Mesh(name72, scene19); +function CreateDisc(name73, options = {}, scene19 = null) { + const disc = new Mesh(name73, scene19); options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation); disc._originalBuilderSideOrientation = options.sideOrientation; const vertexData = CreateDiscVertexData(options); vertexData.applyToMesh(disc, options.updatable); return disc; } -VertexData.CreateDisc = CreateDiscVertexData; -Mesh.CreateDisc = (name72, radius, tessellation, scene19 = null, updatable, sideOrientation) => { - const options = { - radius, - tessellation, - sideOrientation, - updatable +var DiscBuilder; +var init_discBuilder = __esm(() => { + init_mesh(); + init_mesh_vertexData(); + init_compatibilityOptions(); + DiscBuilder = { + CreateDisc }; - return CreateDisc(name72, options, scene19); -}; + VertexData.CreateDisc = CreateDiscVertexData; + Mesh.CreateDisc = (name73, radius, tessellation, scene19 = null, updatable, sideOrientation) => { + const options = { + radius, + tessellation, + sideOrientation, + updatable + }; + return CreateDisc(name73, options, scene19); + }; +}); // node_modules/@babylonjs/core/Meshes/Builders/tiledPlaneBuilder.js function CreateTiledPlaneVertexData(options) { @@ -78300,15 +82240,23 @@ function CreateTiledPlaneVertexData(options) { vertexData.colors = totalColors; return vertexData; } -function CreateTiledPlane(name72, options, scene19 = null) { - const plane = new Mesh(name72, scene19); +function CreateTiledPlane(name73, options, scene19 = null) { + const plane = new Mesh(name73, scene19); options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation); plane._originalBuilderSideOrientation = options.sideOrientation; const vertexData = CreateTiledPlaneVertexData(options); vertexData.applyToMesh(plane, options.updatable); return plane; } -VertexData.CreateTiledPlane = CreateTiledPlaneVertexData; +var TiledPlaneBuilder; +var init_tiledPlaneBuilder = __esm(() => { + init_mesh(); + init_mesh_vertexData(); + TiledPlaneBuilder = { + CreateTiledPlane + }; + VertexData.CreateTiledPlane = CreateTiledPlaneVertexData; +}); // node_modules/@babylonjs/core/Meshes/Builders/tiledBoxBuilder.js function CreateTiledBoxVertexData(options) { @@ -78446,15 +82394,27 @@ function CreateTiledBoxVertexData(options) { } return vertexData; } -function CreateTiledBox(name72, options, scene19 = null) { - const box = new Mesh(name72, scene19); +function CreateTiledBox(name73, options, scene19 = null) { + const box = new Mesh(name73, scene19); options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation); box._originalBuilderSideOrientation = options.sideOrientation; const vertexData = CreateTiledBoxVertexData(options); vertexData.applyToMesh(box, options.updatable); return box; } -VertexData.CreateTiledBox = CreateTiledBoxVertexData; +var TiledBoxBuilder; +var init_tiledBoxBuilder = __esm(() => { + init_math_vector(); + init_math_color(); + init_mesh(); + init_mesh_vertexData(); + init_tiledPlaneBuilder(); + init_compatibilityOptions(); + TiledBoxBuilder = { + CreateTiledBox + }; + VertexData.CreateTiledBox = CreateTiledBoxVertexData; +}); // node_modules/@babylonjs/core/Meshes/Builders/torusKnotBuilder.js function CreateTorusKnotVertexData(options) { @@ -78528,35 +82488,43 @@ function CreateTorusKnotVertexData(options) { vertexData.uvs = uvs; return vertexData; } -function CreateTorusKnot(name72, options = {}, scene19) { - const torusKnot = new Mesh(name72, scene19); +function CreateTorusKnot(name73, options = {}, scene19) { + const torusKnot = new Mesh(name73, scene19); options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation); torusKnot._originalBuilderSideOrientation = options.sideOrientation; const vertexData = CreateTorusKnotVertexData(options); vertexData.applyToMesh(torusKnot, options.updatable); return torusKnot; } -VertexData.CreateTorusKnot = CreateTorusKnotVertexData; -Mesh.CreateTorusKnot = (name72, radius, tube, radialSegments, tubularSegments, p, q, scene19, updatable, sideOrientation) => { - const options = { - radius, - tube, - radialSegments, - tubularSegments, - p, - q, - sideOrientation, - updatable +var TorusKnotBuilder; +var init_torusKnotBuilder = __esm(() => { + init_math_vector(); + init_mesh(); + init_mesh_vertexData(); + init_compatibilityOptions(); + TorusKnotBuilder = { + CreateTorusKnot }; - return CreateTorusKnot(name72, options, scene19); -}; + VertexData.CreateTorusKnot = CreateTorusKnotVertexData; + Mesh.CreateTorusKnot = (name73, radius, tube, radialSegments, tubularSegments, p, q, scene19, updatable, sideOrientation) => { + const options = { + radius, + tube, + radialSegments, + tubularSegments, + p, + q, + sideOrientation, + updatable + }; + return CreateTorusKnot(name73, options, scene19); + }; +}); // node_modules/@babylonjs/core/Materials/shaderMaterial.js -var onCreatedEffectParameters3 = { effect: null, subMesh: null }; - class ShaderMaterial extends PushMaterial { - constructor(name72, scene19, shaderPath, options = {}, storeEffectOnSubMeshes = true) { - super(name72, scene19, storeEffectOnSubMeshes); + constructor(name73, scene19, shaderPath, options = {}, storeEffectOnSubMeshes = true) { + super(name73, scene19, storeEffectOnSubMeshes); this._textures = {}; this._textureArrays = {}; this._externalTextures = {}; @@ -78616,166 +82584,166 @@ class ShaderMaterial extends PushMaterial { this._options.uniforms.push(uniformName); } } - setTexture(name72, texture14) { - if (this._options.samplers.indexOf(name72) === -1) { - this._options.samplers.push(name72); + setTexture(name73, texture14) { + if (this._options.samplers.indexOf(name73) === -1) { + this._options.samplers.push(name73); } - this._textures[name72] = texture14; + this._textures[name73] = texture14; return this; } - setTextureArray(name72, textures) { - if (this._options.samplers.indexOf(name72) === -1) { - this._options.samplers.push(name72); + setTextureArray(name73, textures) { + if (this._options.samplers.indexOf(name73) === -1) { + this._options.samplers.push(name73); } - this._checkUniform(name72); - this._textureArrays[name72] = textures; + this._checkUniform(name73); + this._textureArrays[name73] = textures; return this; } - setExternalTexture(name72, texture14) { - if (this._options.externalTextures.indexOf(name72) === -1) { - this._options.externalTextures.push(name72); + setExternalTexture(name73, texture14) { + if (this._options.externalTextures.indexOf(name73) === -1) { + this._options.externalTextures.push(name73); } - this._externalTextures[name72] = texture14; + this._externalTextures[name73] = texture14; return this; } - setFloat(name72, value) { - this._checkUniform(name72); - this._floats[name72] = value; + setFloat(name73, value) { + this._checkUniform(name73); + this._floats[name73] = value; return this; } - setInt(name72, value) { - this._checkUniform(name72); - this._ints[name72] = value; + setInt(name73, value) { + this._checkUniform(name73); + this._ints[name73] = value; return this; } - setUInt(name72, value) { - this._checkUniform(name72); - this._uints[name72] = value; + setUInt(name73, value) { + this._checkUniform(name73); + this._uints[name73] = value; return this; } - setFloats(name72, value) { - this._checkUniform(name72); - this._floatsArrays[name72] = value; + setFloats(name73, value) { + this._checkUniform(name73); + this._floatsArrays[name73] = value; return this; } - setColor3(name72, value) { - this._checkUniform(name72); - this._colors3[name72] = value; + setColor3(name73, value) { + this._checkUniform(name73); + this._colors3[name73] = value; return this; } - setColor3Array(name72, value) { - this._checkUniform(name72); - this._colors3Arrays[name72] = value.reduce((arr, color) => { + setColor3Array(name73, value) { + this._checkUniform(name73); + this._colors3Arrays[name73] = value.reduce((arr, color) => { color.toArray(arr, arr.length); return arr; }, []); return this; } - setColor4(name72, value) { - this._checkUniform(name72); - this._colors4[name72] = value; + setColor4(name73, value) { + this._checkUniform(name73); + this._colors4[name73] = value; return this; } - setColor4Array(name72, value) { - this._checkUniform(name72); - this._colors4Arrays[name72] = value.reduce((arr, color) => { + setColor4Array(name73, value) { + this._checkUniform(name73); + this._colors4Arrays[name73] = value.reduce((arr, color) => { color.toArray(arr, arr.length); return arr; }, []); return this; } - setVector2(name72, value) { - this._checkUniform(name72); - this._vectors2[name72] = value; + setVector2(name73, value) { + this._checkUniform(name73); + this._vectors2[name73] = value; return this; } - setVector3(name72, value) { - this._checkUniform(name72); - this._vectors3[name72] = value; + setVector3(name73, value) { + this._checkUniform(name73); + this._vectors3[name73] = value; return this; } - setVector4(name72, value) { - this._checkUniform(name72); - this._vectors4[name72] = value; + setVector4(name73, value) { + this._checkUniform(name73); + this._vectors4[name73] = value; return this; } - setQuaternion(name72, value) { - this._checkUniform(name72); - this._quaternions[name72] = value; + setQuaternion(name73, value) { + this._checkUniform(name73); + this._quaternions[name73] = value; return this; } - setQuaternionArray(name72, value) { - this._checkUniform(name72); - this._quaternionsArrays[name72] = value.reduce((arr, quaternion) => { + setQuaternionArray(name73, value) { + this._checkUniform(name73); + this._quaternionsArrays[name73] = value.reduce((arr, quaternion) => { quaternion.toArray(arr, arr.length); return arr; }, []); return this; } - setMatrix(name72, value) { - this._checkUniform(name72); - this._matrices[name72] = value; + setMatrix(name73, value) { + this._checkUniform(name73); + this._matrices[name73] = value; return this; } - setMatrices(name72, value) { - this._checkUniform(name72); + setMatrices(name73, value) { + this._checkUniform(name73); const float32Array = new Float32Array(value.length * 16); for (let index = 0;index < value.length; index++) { const matrix = value[index]; matrix.copyToArray(float32Array, index * 16); } - this._matrixArrays[name72] = float32Array; + this._matrixArrays[name73] = float32Array; return this; } - setMatrix3x3(name72, value) { - this._checkUniform(name72); - this._matrices3x3[name72] = value; + setMatrix3x3(name73, value) { + this._checkUniform(name73); + this._matrices3x3[name73] = value; return this; } - setMatrix2x2(name72, value) { - this._checkUniform(name72); - this._matrices2x2[name72] = value; + setMatrix2x2(name73, value) { + this._checkUniform(name73); + this._matrices2x2[name73] = value; return this; } - setArray2(name72, value) { - this._checkUniform(name72); - this._vectors2Arrays[name72] = value; + setArray2(name73, value) { + this._checkUniform(name73); + this._vectors2Arrays[name73] = value; return this; } - setArray3(name72, value) { - this._checkUniform(name72); - this._vectors3Arrays[name72] = value; + setArray3(name73, value) { + this._checkUniform(name73); + this._vectors3Arrays[name73] = value; return this; } - setArray4(name72, value) { - this._checkUniform(name72); - this._vectors4Arrays[name72] = value; + setArray4(name73, value) { + this._checkUniform(name73); + this._vectors4Arrays[name73] = value; return this; } - setUniformBuffer(name72, buffer20) { - if (this._options.uniformBuffers.indexOf(name72) === -1) { - this._options.uniformBuffers.push(name72); + setUniformBuffer(name73, buffer20) { + if (this._options.uniformBuffers.indexOf(name73) === -1) { + this._options.uniformBuffers.push(name73); } - this._uniformBuffers[name72] = buffer20; + this._uniformBuffers[name73] = buffer20; return this; } - setTextureSampler(name72, sampler) { - if (this._options.samplerObjects.indexOf(name72) === -1) { - this._options.samplerObjects.push(name72); + setTextureSampler(name73, sampler) { + if (this._options.samplerObjects.indexOf(name73) === -1) { + this._options.samplerObjects.push(name73); } - this._textureSamplers[name72] = sampler; + this._textureSamplers[name73] = sampler; return this; } - setStorageBuffer(name72, buffer20) { - if (this._options.storageBuffers.indexOf(name72) === -1) { - this._options.storageBuffers.push(name72); + setStorageBuffer(name73, buffer20) { + if (this._options.storageBuffers.indexOf(name73) === -1) { + this._options.storageBuffers.push(name73); } - this._storageBuffers[name72] = buffer20; + this._storageBuffers[name73] = buffer20; return this; } - setDefine(define, value) { - const defineName = define.trimEnd() + " "; - const existingDefineIdx = this.options.defines.findIndex((x) => x === define || x.startsWith(defineName)); + setDefine(define2, value) { + const defineName = define2.trimEnd() + " "; + const existingDefineIdx = this.options.defines.findIndex((x) => x === define2 || x.startsWith(defineName)); if (existingDefineIdx >= 0) { this.options.defines.splice(existingDefineIdx, 1); } @@ -78935,8 +82903,8 @@ class ShaderMaterial extends PushMaterial { } MaterialHelper.PrepareAttributesForBakedVertexAnimation(attribs, mesh22, defines); } - for (const name72 in this._textures) { - if (!this._textures[name72].isReady()) { + for (const name73 in this._textures) { + if (!this._textures[name73].isReady()) { return false; } } @@ -79072,88 +83040,88 @@ class ShaderMaterial extends PushMaterial { if (this._useLogarithmicDepth) { MaterialHelper.BindLogDepth(storeEffectOnSubMeshes ? subMesh5.materialDefines : effect5.defines, effect5, scene19); } - let name72; - for (name72 in this._textures) { - effect5.setTexture(name72, this._textures[name72]); + let name73; + for (name73 in this._textures) { + effect5.setTexture(name73, this._textures[name73]); } - for (name72 in this._textureArrays) { - effect5.setTextureArray(name72, this._textureArrays[name72]); + for (name73 in this._textureArrays) { + effect5.setTextureArray(name73, this._textureArrays[name73]); } - for (name72 in this._externalTextures) { - effect5.setExternalTexture(name72, this._externalTextures[name72]); + for (name73 in this._externalTextures) { + effect5.setExternalTexture(name73, this._externalTextures[name73]); } - for (name72 in this._ints) { - effect5.setInt(name72, this._ints[name72]); + for (name73 in this._ints) { + effect5.setInt(name73, this._ints[name73]); } - for (name72 in this._uints) { - effect5.setUInt(name72, this._uints[name72]); + for (name73 in this._uints) { + effect5.setUInt(name73, this._uints[name73]); } - for (name72 in this._floats) { - effect5.setFloat(name72, this._floats[name72]); + for (name73 in this._floats) { + effect5.setFloat(name73, this._floats[name73]); } - for (name72 in this._floatsArrays) { - effect5.setArray(name72, this._floatsArrays[name72]); + for (name73 in this._floatsArrays) { + effect5.setArray(name73, this._floatsArrays[name73]); } - for (name72 in this._colors3) { - effect5.setColor3(name72, this._colors3[name72]); + for (name73 in this._colors3) { + effect5.setColor3(name73, this._colors3[name73]); } - for (name72 in this._colors3Arrays) { - effect5.setArray3(name72, this._colors3Arrays[name72]); + for (name73 in this._colors3Arrays) { + effect5.setArray3(name73, this._colors3Arrays[name73]); } - for (name72 in this._colors4) { - const color = this._colors4[name72]; - effect5.setFloat4(name72, color.r, color.g, color.b, color.a); + for (name73 in this._colors4) { + const color = this._colors4[name73]; + effect5.setFloat4(name73, color.r, color.g, color.b, color.a); } - for (name72 in this._colors4Arrays) { - effect5.setArray4(name72, this._colors4Arrays[name72]); + for (name73 in this._colors4Arrays) { + effect5.setArray4(name73, this._colors4Arrays[name73]); } - for (name72 in this._vectors2) { - effect5.setVector2(name72, this._vectors2[name72]); + for (name73 in this._vectors2) { + effect5.setVector2(name73, this._vectors2[name73]); } - for (name72 in this._vectors3) { - effect5.setVector3(name72, this._vectors3[name72]); + for (name73 in this._vectors3) { + effect5.setVector3(name73, this._vectors3[name73]); } - for (name72 in this._vectors4) { - effect5.setVector4(name72, this._vectors4[name72]); + for (name73 in this._vectors4) { + effect5.setVector4(name73, this._vectors4[name73]); } - for (name72 in this._quaternions) { - effect5.setQuaternion(name72, this._quaternions[name72]); + for (name73 in this._quaternions) { + effect5.setQuaternion(name73, this._quaternions[name73]); } - for (name72 in this._matrices) { - effect5.setMatrix(name72, this._matrices[name72]); + for (name73 in this._matrices) { + effect5.setMatrix(name73, this._matrices[name73]); } - for (name72 in this._matrixArrays) { - effect5.setMatrices(name72, this._matrixArrays[name72]); + for (name73 in this._matrixArrays) { + effect5.setMatrices(name73, this._matrixArrays[name73]); } - for (name72 in this._matrices3x3) { - effect5.setMatrix3x3(name72, this._matrices3x3[name72]); + for (name73 in this._matrices3x3) { + effect5.setMatrix3x3(name73, this._matrices3x3[name73]); } - for (name72 in this._matrices2x2) { - effect5.setMatrix2x2(name72, this._matrices2x2[name72]); + for (name73 in this._matrices2x2) { + effect5.setMatrix2x2(name73, this._matrices2x2[name73]); } - for (name72 in this._vectors2Arrays) { - effect5.setArray2(name72, this._vectors2Arrays[name72]); + for (name73 in this._vectors2Arrays) { + effect5.setArray2(name73, this._vectors2Arrays[name73]); } - for (name72 in this._vectors3Arrays) { - effect5.setArray3(name72, this._vectors3Arrays[name72]); + for (name73 in this._vectors3Arrays) { + effect5.setArray3(name73, this._vectors3Arrays[name73]); } - for (name72 in this._vectors4Arrays) { - effect5.setArray4(name72, this._vectors4Arrays[name72]); + for (name73 in this._vectors4Arrays) { + effect5.setArray4(name73, this._vectors4Arrays[name73]); } - for (name72 in this._quaternionsArrays) { - effect5.setArray4(name72, this._quaternionsArrays[name72]); + for (name73 in this._quaternionsArrays) { + effect5.setArray4(name73, this._quaternionsArrays[name73]); } - for (name72 in this._uniformBuffers) { - const buffer20 = this._uniformBuffers[name72].getBuffer(); + for (name73 in this._uniformBuffers) { + const buffer20 = this._uniformBuffers[name73].getBuffer(); if (buffer20) { - effect5.bindUniformBuffer(buffer20, name72); + effect5.bindUniformBuffer(buffer20, name73); } } - for (name72 in this._textureSamplers) { - effect5.setTextureSampler(name72, this._textureSamplers[name72]); + for (name73 in this._textureSamplers) { + effect5.setTextureSampler(name73, this._textureSamplers[name73]); } - for (name72 in this._storageBuffers) { - effect5.setStorageBuffer(name72, this._storageBuffers[name72]); + for (name73 in this._storageBuffers) { + effect5.setStorageBuffer(name73, this._storageBuffers[name73]); } } if (effect5 && mesh22 && (mustRebind || !this.isFrozen)) { @@ -79170,11 +83138,11 @@ class ShaderMaterial extends PushMaterial { } getActiveTextures() { const activeTextures = super.getActiveTextures(); - for (const name72 in this._textures) { - activeTextures.push(this._textures[name72]); + for (const name73 in this._textures) { + activeTextures.push(this._textures[name73]); } - for (const name72 in this._textureArrays) { - const array = this._textureArrays[name72]; + for (const name73 in this._textureArrays) { + const array = this._textureArrays[name73]; for (let index = 0;index < array.length; index++) { activeTextures.push(array[index]); } @@ -79185,13 +83153,13 @@ class ShaderMaterial extends PushMaterial { if (super.hasTexture(texture14)) { return true; } - for (const name72 in this._textures) { - if (this._textures[name72] === texture14) { + for (const name73 in this._textures) { + if (this._textures[name73] === texture14) { return true; } } - for (const name72 in this._textureArrays) { - const array = this._textureArrays[name72]; + for (const name73 in this._textureArrays) { + const array = this._textureArrays[name73]; for (let index = 0;index < array.length; index++) { if (array[index] === texture14) { return true; @@ -79200,10 +83168,10 @@ class ShaderMaterial extends PushMaterial { } return false; } - clone(name72) { - const result = SerializationHelper.Clone(() => new ShaderMaterial(name72, this.getScene(), this._shaderPath, this._options, this._storeEffectOnSubMeshes), this); - result.name = name72; - result.id = name72; + clone(name73) { + const result = SerializationHelper.Clone(() => new ShaderMaterial(name73, this.getScene(), this._shaderPath, this._options, this._storeEffectOnSubMeshes), this); + result.name = name73; + result.id = name73; if (typeof result._shaderPath === "object") { result._shaderPath = Object.assign({}, result._shaderPath); } @@ -79297,12 +83265,12 @@ class ShaderMaterial extends PushMaterial { } dispose(forceDisposeEffect, forceDisposeTextures, notBoundToMesh) { if (forceDisposeTextures) { - let name72; - for (name72 in this._textures) { - this._textures[name72].dispose(); + let name73; + for (name73 in this._textures) { + this._textures[name73].dispose(); } - for (name72 in this._textureArrays) { - const array = this._textureArrays[name72]; + for (name73 in this._textureArrays) { + const array = this._textureArrays[name73]; for (let index = 0;index < array.length; index++) { array[index].dispose(); } @@ -79318,136 +83286,136 @@ class ShaderMaterial extends PushMaterial { serializationObject.options = this._options; serializationObject.shaderPath = this._shaderPath; serializationObject.storeEffectOnSubMeshes = this._storeEffectOnSubMeshes; - let name72; + let name73; serializationObject.stencil = this.stencil.serialize(); serializationObject.textures = {}; - for (name72 in this._textures) { - serializationObject.textures[name72] = this._textures[name72].serialize(); + for (name73 in this._textures) { + serializationObject.textures[name73] = this._textures[name73].serialize(); } serializationObject.textureArrays = {}; - for (name72 in this._textureArrays) { - serializationObject.textureArrays[name72] = []; - const array = this._textureArrays[name72]; + for (name73 in this._textureArrays) { + serializationObject.textureArrays[name73] = []; + const array = this._textureArrays[name73]; for (let index = 0;index < array.length; index++) { - serializationObject.textureArrays[name72].push(array[index].serialize()); + serializationObject.textureArrays[name73].push(array[index].serialize()); } } serializationObject.ints = {}; - for (name72 in this._ints) { - serializationObject.ints[name72] = this._ints[name72]; + for (name73 in this._ints) { + serializationObject.ints[name73] = this._ints[name73]; } serializationObject.uints = {}; - for (name72 in this._uints) { - serializationObject.uints[name72] = this._uints[name72]; + for (name73 in this._uints) { + serializationObject.uints[name73] = this._uints[name73]; } serializationObject.floats = {}; - for (name72 in this._floats) { - serializationObject.floats[name72] = this._floats[name72]; + for (name73 in this._floats) { + serializationObject.floats[name73] = this._floats[name73]; } serializationObject.FloatArrays = {}; - for (name72 in this._floatsArrays) { - serializationObject.FloatArrays[name72] = this._floatsArrays[name72]; + for (name73 in this._floatsArrays) { + serializationObject.FloatArrays[name73] = this._floatsArrays[name73]; } serializationObject.colors3 = {}; - for (name72 in this._colors3) { - serializationObject.colors3[name72] = this._colors3[name72].asArray(); + for (name73 in this._colors3) { + serializationObject.colors3[name73] = this._colors3[name73].asArray(); } serializationObject.colors3Arrays = {}; - for (name72 in this._colors3Arrays) { - serializationObject.colors3Arrays[name72] = this._colors3Arrays[name72]; + for (name73 in this._colors3Arrays) { + serializationObject.colors3Arrays[name73] = this._colors3Arrays[name73]; } serializationObject.colors4 = {}; - for (name72 in this._colors4) { - serializationObject.colors4[name72] = this._colors4[name72].asArray(); + for (name73 in this._colors4) { + serializationObject.colors4[name73] = this._colors4[name73].asArray(); } serializationObject.colors4Arrays = {}; - for (name72 in this._colors4Arrays) { - serializationObject.colors4Arrays[name72] = this._colors4Arrays[name72]; + for (name73 in this._colors4Arrays) { + serializationObject.colors4Arrays[name73] = this._colors4Arrays[name73]; } serializationObject.vectors2 = {}; - for (name72 in this._vectors2) { - serializationObject.vectors2[name72] = this._vectors2[name72].asArray(); + for (name73 in this._vectors2) { + serializationObject.vectors2[name73] = this._vectors2[name73].asArray(); } serializationObject.vectors3 = {}; - for (name72 in this._vectors3) { - serializationObject.vectors3[name72] = this._vectors3[name72].asArray(); + for (name73 in this._vectors3) { + serializationObject.vectors3[name73] = this._vectors3[name73].asArray(); } serializationObject.vectors4 = {}; - for (name72 in this._vectors4) { - serializationObject.vectors4[name72] = this._vectors4[name72].asArray(); + for (name73 in this._vectors4) { + serializationObject.vectors4[name73] = this._vectors4[name73].asArray(); } serializationObject.quaternions = {}; - for (name72 in this._quaternions) { - serializationObject.quaternions[name72] = this._quaternions[name72].asArray(); + for (name73 in this._quaternions) { + serializationObject.quaternions[name73] = this._quaternions[name73].asArray(); } serializationObject.matrices = {}; - for (name72 in this._matrices) { - serializationObject.matrices[name72] = this._matrices[name72].asArray(); + for (name73 in this._matrices) { + serializationObject.matrices[name73] = this._matrices[name73].asArray(); } serializationObject.matrixArray = {}; - for (name72 in this._matrixArrays) { - serializationObject.matrixArray[name72] = this._matrixArrays[name72]; + for (name73 in this._matrixArrays) { + serializationObject.matrixArray[name73] = this._matrixArrays[name73]; } serializationObject.matrices3x3 = {}; - for (name72 in this._matrices3x3) { - serializationObject.matrices3x3[name72] = this._matrices3x3[name72]; + for (name73 in this._matrices3x3) { + serializationObject.matrices3x3[name73] = this._matrices3x3[name73]; } serializationObject.matrices2x2 = {}; - for (name72 in this._matrices2x2) { - serializationObject.matrices2x2[name72] = this._matrices2x2[name72]; + for (name73 in this._matrices2x2) { + serializationObject.matrices2x2[name73] = this._matrices2x2[name73]; } serializationObject.vectors2Arrays = {}; - for (name72 in this._vectors2Arrays) { - serializationObject.vectors2Arrays[name72] = this._vectors2Arrays[name72]; + for (name73 in this._vectors2Arrays) { + serializationObject.vectors2Arrays[name73] = this._vectors2Arrays[name73]; } serializationObject.vectors3Arrays = {}; - for (name72 in this._vectors3Arrays) { - serializationObject.vectors3Arrays[name72] = this._vectors3Arrays[name72]; + for (name73 in this._vectors3Arrays) { + serializationObject.vectors3Arrays[name73] = this._vectors3Arrays[name73]; } serializationObject.vectors4Arrays = {}; - for (name72 in this._vectors4Arrays) { - serializationObject.vectors4Arrays[name72] = this._vectors4Arrays[name72]; + for (name73 in this._vectors4Arrays) { + serializationObject.vectors4Arrays[name73] = this._vectors4Arrays[name73]; } serializationObject.quaternionsArrays = {}; - for (name72 in this._quaternionsArrays) { - serializationObject.quaternionsArrays[name72] = this._quaternionsArrays[name72]; + for (name73 in this._quaternionsArrays) { + serializationObject.quaternionsArrays[name73] = this._quaternionsArrays[name73]; } return serializationObject; } static Parse(source, scene19, rootUrl) { const material9 = SerializationHelper.Parse(() => new ShaderMaterial(source.name, scene19, source.shaderPath, source.options, source.storeEffectOnSubMeshes), source, scene19, rootUrl); - let name72; + let name73; if (source.stencil) { material9.stencil.parse(source.stencil, scene19, rootUrl); } - for (name72 in source.textures) { - material9.setTexture(name72, Texture.Parse(source.textures[name72], scene19, rootUrl)); + for (name73 in source.textures) { + material9.setTexture(name73, Texture.Parse(source.textures[name73], scene19, rootUrl)); } - for (name72 in source.textureArrays) { - const array = source.textureArrays[name72]; + for (name73 in source.textureArrays) { + const array = source.textureArrays[name73]; const textureArray = []; for (let index = 0;index < array.length; index++) { textureArray.push(Texture.Parse(array[index], scene19, rootUrl)); } - material9.setTextureArray(name72, textureArray); + material9.setTextureArray(name73, textureArray); } - for (name72 in source.ints) { - material9.setInt(name72, source.ints[name72]); + for (name73 in source.ints) { + material9.setInt(name73, source.ints[name73]); } - for (name72 in source.uints) { - material9.setUInt(name72, source.uints[name72]); + for (name73 in source.uints) { + material9.setUInt(name73, source.uints[name73]); } - for (name72 in source.floats) { - material9.setFloat(name72, source.floats[name72]); + for (name73 in source.floats) { + material9.setFloat(name73, source.floats[name73]); } - for (name72 in source.floatsArrays) { - material9.setFloats(name72, source.floatsArrays[name72]); + for (name73 in source.floatsArrays) { + material9.setFloats(name73, source.floatsArrays[name73]); } - for (name72 in source.colors3) { - material9.setColor3(name72, Color3.FromArray(source.colors3[name72])); + for (name73 in source.colors3) { + material9.setColor3(name73, Color3.FromArray(source.colors3[name73])); } - for (name72 in source.colors3Arrays) { - const colors = source.colors3Arrays[name72].reduce((arr, num, i) => { + for (name73 in source.colors3Arrays) { + const colors = source.colors3Arrays[name73].reduce((arr, num, i) => { if (i % 3 === 0) { arr.push([num]); } else { @@ -79455,13 +83423,13 @@ class ShaderMaterial extends PushMaterial { } return arr; }, []).map((color) => Color3.FromArray(color)); - material9.setColor3Array(name72, colors); + material9.setColor3Array(name73, colors); } - for (name72 in source.colors4) { - material9.setColor4(name72, Color4.FromArray(source.colors4[name72])); + for (name73 in source.colors4) { + material9.setColor4(name73, Color4.FromArray(source.colors4[name73])); } - for (name72 in source.colors4Arrays) { - const colors = source.colors4Arrays[name72].reduce((arr, num, i) => { + for (name73 in source.colors4Arrays) { + const colors = source.colors4Arrays[name73].reduce((arr, num, i) => { if (i % 4 === 0) { arr.push([num]); } else { @@ -79469,47 +83437,47 @@ class ShaderMaterial extends PushMaterial { } return arr; }, []).map((color) => Color4.FromArray(color)); - material9.setColor4Array(name72, colors); + material9.setColor4Array(name73, colors); } - for (name72 in source.vectors2) { - material9.setVector2(name72, Vector2.FromArray(source.vectors2[name72])); + for (name73 in source.vectors2) { + material9.setVector2(name73, Vector2.FromArray(source.vectors2[name73])); } - for (name72 in source.vectors3) { - material9.setVector3(name72, Vector3.FromArray(source.vectors3[name72])); + for (name73 in source.vectors3) { + material9.setVector3(name73, Vector3.FromArray(source.vectors3[name73])); } - for (name72 in source.vectors4) { - material9.setVector4(name72, Vector4.FromArray(source.vectors4[name72])); + for (name73 in source.vectors4) { + material9.setVector4(name73, Vector4.FromArray(source.vectors4[name73])); } - for (name72 in source.quaternions) { - material9.setQuaternion(name72, Quaternion.FromArray(source.quaternions[name72])); + for (name73 in source.quaternions) { + material9.setQuaternion(name73, Quaternion.FromArray(source.quaternions[name73])); } - for (name72 in source.matrices) { - material9.setMatrix(name72, Matrix.FromArray(source.matrices[name72])); + for (name73 in source.matrices) { + material9.setMatrix(name73, Matrix.FromArray(source.matrices[name73])); } - for (name72 in source.matrixArray) { - material9._matrixArrays[name72] = new Float32Array(source.matrixArray[name72]); + for (name73 in source.matrixArray) { + material9._matrixArrays[name73] = new Float32Array(source.matrixArray[name73]); } - for (name72 in source.matrices3x3) { - material9.setMatrix3x3(name72, source.matrices3x3[name72]); + for (name73 in source.matrices3x3) { + material9.setMatrix3x3(name73, source.matrices3x3[name73]); } - for (name72 in source.matrices2x2) { - material9.setMatrix2x2(name72, source.matrices2x2[name72]); + for (name73 in source.matrices2x2) { + material9.setMatrix2x2(name73, source.matrices2x2[name73]); } - for (name72 in source.vectors2Arrays) { - material9.setArray2(name72, source.vectors2Arrays[name72]); + for (name73 in source.vectors2Arrays) { + material9.setArray2(name73, source.vectors2Arrays[name73]); } - for (name72 in source.vectors3Arrays) { - material9.setArray3(name72, source.vectors3Arrays[name72]); + for (name73 in source.vectors3Arrays) { + material9.setArray3(name73, source.vectors3Arrays[name73]); } - for (name72 in source.vectors4Arrays) { - material9.setArray4(name72, source.vectors4Arrays[name72]); + for (name73 in source.vectors4Arrays) { + material9.setArray4(name73, source.vectors4Arrays[name73]); } - for (name72 in source.quaternionsArrays) { - material9.setArray4(name72, source.quaternionsArrays[name72]); + for (name73 in source.quaternionsArrays) { + material9.setArray4(name73, source.quaternionsArrays[name73]); } return material9; } - static ParseFromFileAsync(name72, url, scene19, rootUrl = "") { + static ParseFromFileAsync(name73, url, scene19, rootUrl = "") { return new Promise((resolve, reject) => { const request = new WebRequest; request.addEventListener("readystatechange", () => { @@ -79517,8 +83485,8 @@ class ShaderMaterial extends PushMaterial { if (request.status == 200) { const serializationObject = JSON.parse(request.responseText); const output = this.Parse(serializationObject, scene19 || EngineStore.LastCreatedScene, rootUrl); - if (name72) { - output.name = name72; + if (name73) { + output.name = name73; } resolve(output); } else { @@ -79551,13 +83519,34 @@ class ShaderMaterial extends PushMaterial { }); } } -ShaderMaterial.SnippetUrl = `https://snippet.babylonjs.com`; -ShaderMaterial.CreateFromSnippetAsync = ShaderMaterial.ParseFromSnippetAsync; -RegisterClass("BABYLON.ShaderMaterial", ShaderMaterial); +var onCreatedEffectParameters3; +var init_shaderMaterial = __esm(() => { + init_decorators(); + init_math_vector(); + init_buffer(); + init_texture(); + init_materialHelper(); + init_typeStore(); + init_math_color(); + init_effectFallbacks(); + init_webRequest(); + init_pushMaterial(); + init_engineStore(); + init_clipPlaneMaterialHelper(); + onCreatedEffectParameters3 = { effect: null, subMesh: null }; + ShaderMaterial.SnippetUrl = `https://snippet.babylonjs.com`; + ShaderMaterial.CreateFromSnippetAsync = ShaderMaterial.ParseFromSnippetAsync; + RegisterClass("BABYLON.ShaderMaterial", ShaderMaterial); +}); // node_modules/@babylonjs/core/Shaders/color.fragment.js -var name72 = "colorPixelShader"; -var shader72 = `#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) +var name73, shader72; +var init_color_fragment = __esm(() => { + init_shaderStore(); + init_clipPlaneFragmentDeclaration(); + init_clipPlaneFragment(); + name73 = "colorPixelShader"; + shader72 = `#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) #define VERTEXCOLOR varying vec4 vColor; #else @@ -79575,11 +83564,24 @@ gl_FragColor=color; #endif #define CUSTOM_FRAGMENT_MAIN_END }`; -ShaderStore.ShadersStore[name72] = shader72; + ShaderStore.ShadersStore[name73] = shader72; +}); // node_modules/@babylonjs/core/Shaders/color.vertex.js -var name73 = "colorVertexShader"; -var shader73 = `attribute vec3 position; +var name74, shader73; +var init_color_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_clipPlaneVertexDeclaration(); + init_instancesDeclaration(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + init_vertexColorMixing(); + name74 = "colorVertexShader"; + shader73 = `attribute vec3 position; #ifdef VERTEXCOLOR attribute vec4 color; #endif @@ -79610,19 +83612,16 @@ gl_Position=viewProjection*worldPos; #include #define CUSTOM_VERTEX_MAIN_END }`; -ShaderStore.ShadersStore[name73] = shader73; + ShaderStore.ShadersStore[name74] = shader73; +}); // node_modules/@babylonjs/core/Meshes/linesMesh.js -Mesh._LinesMeshParser = (parsedMesh, scene19) => { - return LinesMesh.Parse(parsedMesh, scene19); -}; - class LinesMesh extends Mesh { _isShaderMaterial(shader74) { return shader74.getClassName() === "ShaderMaterial"; } - constructor(name74, scene19 = null, parent = null, source = null, doNotCloneChildren, useVertexColor, useVertexAlpha, material10) { - super(name74, scene19, parent, source, doNotCloneChildren); + constructor(name75, scene19 = null, parent = null, source = null, doNotCloneChildren, useVertexColor, useVertexAlpha, material10) { + super(name75, scene19, parent, source, doNotCloneChildren); this.useVertexColor = useVertexColor; this.useVertexAlpha = useVertexAlpha; this.color = new Color3(1, 1, 1); @@ -79717,11 +83716,11 @@ class LinesMesh extends Mesh { } super.dispose(doNotRecurse); } - clone(name74, newParent = null, doNotCloneChildren) { - return new LinesMesh(name74, this.getScene(), newParent, this, doNotCloneChildren); + clone(name75, newParent = null, doNotCloneChildren) { + return new LinesMesh(name75, this.getScene(), newParent, this, doNotCloneChildren); } - createInstance(name74) { - const instance = new InstancedLinesMesh(name74, this); + createInstance(name75) { + const instance = new InstancedLinesMesh(name75, this); if (this.instancedBuffers) { instance.instancedBuffers = {}; for (const key in this.instancedBuffers) { @@ -79744,14 +83743,27 @@ class LinesMesh extends Mesh { } class InstancedLinesMesh extends InstancedMesh { - constructor(name74, source) { - super(name74, source); + constructor(name75, source) { + super(name75, source); this.intersectionThreshold = source.intersectionThreshold; } getClassName() { return "InstancedLinesMesh"; } } +var init_linesMesh = __esm(() => { + init_math_color(); + init_buffer(); + init_mesh(); + init_instancedMesh(); + init_material(); + init_shaderMaterial(); + init_color_fragment(); + init_color_vertex(); + Mesh._LinesMeshParser = (parsedMesh, scene19) => { + return LinesMesh.Parse(parsedMesh, scene19); + }; +}); // node_modules/@babylonjs/core/Meshes/Builders/linesBuilder.js function CreateLineSystemVertexData(options) { @@ -79824,7 +83836,7 @@ function CreateDashedLinesVertexData(options) { vertexData.indices = indices; return vertexData; } -function CreateLineSystem(name74, options, scene19 = null) { +function CreateLineSystem(name75, options, scene19 = null) { const instance = options.instance; const lines = options.lines; const colors = options.colors; @@ -79861,17 +83873,17 @@ function CreateLineSystem(name74, options, scene19 = null) { return instance; } const useVertexColor = colors ? true : false; - const lineSystem = new LinesMesh(name74, scene19, null, undefined, undefined, useVertexColor, options.useVertexAlpha, options.material); + const lineSystem = new LinesMesh(name75, scene19, null, undefined, undefined, useVertexColor, options.useVertexAlpha, options.material); const vertexData = CreateLineSystemVertexData(options); vertexData.applyToMesh(lineSystem, options.updatable); return lineSystem; } -function CreateLines(name74, options, scene19 = null) { +function CreateLines(name75, options, scene19 = null) { const colors = options.colors ? [options.colors] : null; - const lines = CreateLineSystem(name74, { lines: [options.points], updatable: options.updatable, instance: options.instance, colors, useVertexAlpha: options.useVertexAlpha, material: options.material }, scene19); + const lines = CreateLineSystem(name75, { lines: [options.points], updatable: options.updatable, instance: options.instance, colors, useVertexAlpha: options.useVertexAlpha, material: options.material }, scene19); return lines; } -function CreateDashedLines(name74, options, scene19 = null) { +function CreateDashedLines(name75, options, scene19 = null) { const points = options.points; const instance = options.instance; const gapSize = options.gapSize || 1; @@ -79926,7 +83938,7 @@ function CreateDashedLines(name74, options, scene19 = null) { instance.updateMeshPositions(positionFunction, false); return instance; } - const dashedLines = new LinesMesh(name74, scene19, null, undefined, undefined, undefined, options.useVertexAlpha, options.material); + const dashedLines = new LinesMesh(name75, scene19, null, undefined, undefined, undefined, options.useVertexAlpha, options.material); const vertexData = CreateDashedLinesVertexData(options); vertexData.applyToMesh(dashedLines, options.updatable); dashedLines._creationDataStorage = new _CreationDataStorage; @@ -79934,27 +83946,41 @@ function CreateDashedLines(name74, options, scene19 = null) { dashedLines._creationDataStorage.gapSize = gapSize; return dashedLines; } -VertexData.CreateLineSystem = CreateLineSystemVertexData; -VertexData.CreateDashedLines = CreateDashedLinesVertexData; -Mesh.CreateLines = (name74, points, scene19 = null, updatable = false, instance = null) => { - const options = { - points, - updatable, - instance +var LinesBuilder; +var init_linesBuilder = __esm(() => { + init_math_vector(); + init_mesh(); + init_mesh_vertexData(); + init_linesMesh(); + init_buffer(); + init_logger(); + LinesBuilder = { + CreateDashedLines, + CreateLineSystem, + CreateLines }; - return CreateLines(name74, options, scene19); -}; -Mesh.CreateDashedLines = (name74, points, dashSize, gapSize, dashNb, scene19 = null, updatable, instance) => { - const options = { - points, - dashSize, - gapSize, - dashNb, - updatable, - instance + VertexData.CreateLineSystem = CreateLineSystemVertexData; + VertexData.CreateDashedLines = CreateDashedLinesVertexData; + Mesh.CreateLines = (name75, points, scene19 = null, updatable = false, instance = null) => { + const options = { + points, + updatable, + instance + }; + return CreateLines(name75, options, scene19); }; - return CreateDashedLines(name74, options, scene19); -}; + Mesh.CreateDashedLines = (name75, points, dashSize, gapSize, dashNb, scene19 = null, updatable, instance) => { + const options = { + points, + dashSize, + gapSize, + dashNb, + updatable, + instance + }; + return CreateDashedLines(name75, options, scene19); + }; +}); // node_modules/@babylonjs/core/Meshes/polygonMesh.js class IndexedVector2 extends Vector2 { @@ -80000,20 +84026,49 @@ class PolygonPoints { }; } } + +class Polygon { + static Rectangle(xmin, ymin, xmax, ymax) { + return [new Vector2(xmin, ymin), new Vector2(xmax, ymin), new Vector2(xmax, ymax), new Vector2(xmin, ymax)]; + } + static Circle(radius, cx = 0, cy = 0, numberOfSides = 32) { + const result = []; + let angle = 0; + const increment = Math.PI * 2 / numberOfSides; + for (let i = 0;i < numberOfSides; i++) { + result.push(new Vector2(cx + Math.cos(angle) * radius, cy + Math.sin(angle) * radius)); + angle -= increment; + } + return result; + } + static Parse(input) { + const floats = input.split(/[^-+eE.\d]+/).map(parseFloat).filter((val) => !isNaN(val)); + let i; + const result = []; + for (i = 0;i < (floats.length & 2147483646); i += 2) { + result.push(new Vector2(floats[i], floats[i + 1])); + } + return result; + } + static StartingAt(x, y) { + return Path2.StartingAt(x, y); + } +} + class PolygonMeshBuilder { _addToepoint(points) { for (const p of points) { this._epoints.push(p.x, p.y); } } - constructor(name74, contours, scene19, earcutInjection = earcut) { + constructor(name75, contours, scene19, earcutInjection = earcut) { this._points = new PolygonPoints; this._outlinepoints = new PolygonPoints; this._holes = new Array; this._epoints = new Array; this._eholes = new Array; this.bjsEarcut = earcutInjection; - this._name = name74; + this._name = name75; this._scene = scene19 || EngineStore.LastCreatedScene; let points; if (contours instanceof Path2) { @@ -80160,6 +84215,16 @@ class PolygonMeshBuilder { } } } +var init_polygonMesh = __esm(() => { + init_logger(); + init_math_vector(); + init_buffer(); + init_mesh(); + init_mesh_vertexData(); + init_math_path(); + init_math_constants(); + init_engineStore(); +}); // node_modules/@babylonjs/core/Meshes/Builders/polygonBuilder.js function CreatePolygonVertexData(polygon, sideOrientation, fUV, fColors, frontUVs, backUVs, wrp) { @@ -80251,7 +84316,7 @@ function CreatePolygonVertexData(polygon, sideOrientation, fUV, fColors, frontUV } return vertexData; } -function CreatePolygon(name74, options, scene19 = null, earcutInjection = earcut) { +function CreatePolygon(name75, options, scene19 = null, earcutInjection = earcut) { options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation); const shape = options.shape; const holes = options.holes || []; @@ -80266,7 +84331,7 @@ function CreatePolygon(name74, options, scene19 = null, earcutInjection = earcut if (contours[0].equalsWithEpsilon(contours[contours.length - 1], epsilon)) { contours.pop(); } - const polygonTriangulation = new PolygonMeshBuilder(name74, contours, scene19 || EngineStore.LastCreatedScene, earcutInjection); + const polygonTriangulation = new PolygonMeshBuilder(name75, contours, scene19 || EngineStore.LastCreatedScene, earcutInjection); for (let hNb = 0;hNb < holes.length; hNb++) { hole = []; for (let hPoint = 0;hPoint < holes[hNb].length; hPoint++) { @@ -80280,32 +84345,47 @@ function CreatePolygon(name74, options, scene19 = null, earcutInjection = earcut vertexData.applyToMesh(polygon, options.updatable); return polygon; } -function ExtrudePolygon(name74, options, scene19 = null, earcutInjection = earcut) { - return CreatePolygon(name74, options, scene19, earcutInjection); -} -VertexData.CreatePolygon = CreatePolygonVertexData; -Mesh.CreatePolygon = (name74, shape, scene19, holes, updatable, sideOrientation, earcutInjection = earcut) => { - const options = { - shape, - holes, - updatable, - sideOrientation +function ExtrudePolygon(name75, options, scene19 = null, earcutInjection = earcut) { + return CreatePolygon(name75, options, scene19, earcutInjection); +} +var PolygonBuilder; +var init_polygonBuilder = __esm(() => { + init_math_vector(); + init_math_color(); + init_mesh(); + init_mesh_vertexData(); + init_polygonMesh(); + init_buffer(); + init_engineStore(); + init_compatibilityOptions(); + PolygonBuilder = { + ExtrudePolygon, + CreatePolygon }; - return CreatePolygon(name74, options, scene19, earcutInjection); -}; -Mesh.ExtrudePolygon = (name74, shape, depth, scene19, holes, updatable, sideOrientation, earcutInjection = earcut) => { - const options = { - shape, - holes, - depth, - updatable, - sideOrientation + VertexData.CreatePolygon = CreatePolygonVertexData; + Mesh.CreatePolygon = (name75, shape, scene19, holes, updatable, sideOrientation, earcutInjection = earcut) => { + const options = { + shape, + holes, + updatable, + sideOrientation + }; + return CreatePolygon(name75, options, scene19, earcutInjection); }; - return ExtrudePolygon(name74, options, scene19, earcutInjection); -}; + Mesh.ExtrudePolygon = (name75, shape, depth, scene19, holes, updatable, sideOrientation, earcutInjection = earcut) => { + const options = { + shape, + holes, + depth, + updatable, + sideOrientation + }; + return ExtrudePolygon(name75, options, scene19, earcutInjection); + }; +}); // node_modules/@babylonjs/core/Meshes/Builders/shapeBuilder.js -function ExtrudeShape(name74, options, scene19 = null) { +function ExtrudeShape(name75, options, scene19 = null) { const path = options.path; const shape = options.shape; const scale = options.scale || 1; @@ -80317,9 +84397,9 @@ function ExtrudeShape(name74, options, scene19 = null) { const invertUV = options.invertUV || false; const closeShape = options.closeShape || false; const closePath = options.closePath || false; - return _ExtrudeShapeGeneric(name74, shape, path, scale, rotation, null, null, closePath, closeShape, cap, false, scene19, updatable ? true : false, sideOrientation, instance, invertUV, options.frontUVs || null, options.backUVs || null, options.firstNormal || null, options.adjustFrame ? true : false); + return _ExtrudeShapeGeneric(name75, shape, path, scale, rotation, null, null, closePath, closeShape, cap, false, scene19, updatable ? true : false, sideOrientation, instance, invertUV, options.frontUVs || null, options.backUVs || null, options.firstNormal || null, options.adjustFrame ? true : false); } -function ExtrudeShapeCustom(name74, options, scene19 = null) { +function ExtrudeShapeCustom(name75, options, scene19 = null) { const path = options.path; const shape = options.shape; const scaleFunction = options.scaleFunction || (() => { @@ -80337,162 +84417,173 @@ function ExtrudeShapeCustom(name74, options, scene19 = null) { const sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation); const instance = options.instance; const invertUV = options.invertUV || false; - return _ExtrudeShapeGeneric(name74, shape, path, null, null, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, true, scene19, updatable ? true : false, sideOrientation, instance || null, invertUV, options.frontUVs || null, options.backUVs || null, firstNormal, adjustFrame); -} -var _ExtrudeShapeGeneric = function(name74, shape, curve, scale, rotation, scaleFunction, rotateFunction, rbCA, rbCP, cap, custom, scene19, updtbl, side, instance, invertUV, frontUVs, backUVs, firstNormal, adjustFrame) { - const extrusionPathArray = (shape2, curve2, path3D2, shapePaths, scale2, rotation2, scaleFunction2, rotateFunction2, cap2, custom2, adjustFrame2) => { - const tangents = path3D2.getTangents(); - const normals = path3D2.getNormals(); - const binormals = path3D2.getBinormals(); - const distances = path3D2.getDistances(); - if (adjustFrame2) { - for (let i = 0;i < tangents.length; i++) { - if (tangents[i].x == 0 && tangents[i].y == 0 && tangents[i].z == 0) { - tangents[i].copyFrom(tangents[i - 1]); - } - if (normals[i].x == 0 && normals[i].y == 0 && normals[i].z == 0) { - normals[i].copyFrom(normals[i - 1]); - } - if (binormals[i].x == 0 && binormals[i].y == 0 && binormals[i].z == 0) { - binormals[i].copyFrom(binormals[i - 1]); - } - if (i > 0) { - let v = tangents[i - 1]; - if (Vector3.Dot(v, tangents[i]) < 0) { - tangents[i].scaleInPlace(-1); + return _ExtrudeShapeGeneric(name75, shape, path, null, null, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, true, scene19, updatable ? true : false, sideOrientation, instance || null, invertUV, options.frontUVs || null, options.backUVs || null, firstNormal, adjustFrame); +} +var _ExtrudeShapeGeneric, ShapeBuilder; +var init_shapeBuilder = __esm(() => { + init_math_vector(); + init_mesh(); + init_ribbonBuilder(); + init_math_path(); + _ExtrudeShapeGeneric = function(name75, shape, curve, scale, rotation, scaleFunction, rotateFunction, rbCA, rbCP, cap, custom, scene19, updtbl, side, instance, invertUV, frontUVs, backUVs, firstNormal, adjustFrame) { + const extrusionPathArray = (shape2, curve2, path3D2, shapePaths, scale2, rotation2, scaleFunction2, rotateFunction2, cap2, custom2, adjustFrame2) => { + const tangents = path3D2.getTangents(); + const normals = path3D2.getNormals(); + const binormals = path3D2.getBinormals(); + const distances = path3D2.getDistances(); + if (adjustFrame2) { + for (let i = 0;i < tangents.length; i++) { + if (tangents[i].x == 0 && tangents[i].y == 0 && tangents[i].z == 0) { + tangents[i].copyFrom(tangents[i - 1]); } - v = normals[i - 1]; - if (Vector3.Dot(v, normals[i]) < 0) { - normals[i].scaleInPlace(-1); + if (normals[i].x == 0 && normals[i].y == 0 && normals[i].z == 0) { + normals[i].copyFrom(normals[i - 1]); } - v = binormals[i - 1]; - if (Vector3.Dot(v, binormals[i]) < 0) { - binormals[i].scaleInPlace(-1); + if (binormals[i].x == 0 && binormals[i].y == 0 && binormals[i].z == 0) { + binormals[i].copyFrom(binormals[i - 1]); + } + if (i > 0) { + let v = tangents[i - 1]; + if (Vector3.Dot(v, tangents[i]) < 0) { + tangents[i].scaleInPlace(-1); + } + v = normals[i - 1]; + if (Vector3.Dot(v, normals[i]) < 0) { + normals[i].scaleInPlace(-1); + } + v = binormals[i - 1]; + if (Vector3.Dot(v, binormals[i]) < 0) { + binormals[i].scaleInPlace(-1); + } } } } - } - let angle = 0; - const returnScale = () => { - return scale2 !== null ? scale2 : 1; - }; - const returnRotation = () => { - return rotation2 !== null ? rotation2 : 0; - }; - const rotate = custom2 && rotateFunction2 ? rotateFunction2 : returnRotation; - const scl = custom2 && scaleFunction2 ? scaleFunction2 : returnScale; - let index = cap2 === Mesh.NO_CAP || cap2 === Mesh.CAP_END ? 0 : 2; - const rotationMatrix = TmpVectors.Matrix[0]; - for (let i = 0;i < curve2.length; i++) { - const shapePath = []; - const angleStep = rotate(i, distances[i]); - const scaleRatio = scl(i, distances[i]); - Matrix.RotationAxisToRef(tangents[i], angle, rotationMatrix); - for (let p = 0;p < shape2.length; p++) { - const planed = tangents[i].scale(shape2[p].z).add(normals[i].scale(shape2[p].x)).add(binormals[i].scale(shape2[p].y)); - const rotated = Vector3.Zero(); - Vector3.TransformCoordinatesToRef(planed, rotationMatrix, rotated); - rotated.scaleInPlace(scaleRatio).addInPlace(curve2[i]); - shapePath[p] = rotated; - } - shapePaths[index] = shapePath; - angle += angleStep; - index++; - } - const capPath = (shapePath) => { - const pointCap = Array(); - const barycenter = Vector3.Zero(); - let i; - for (i = 0;i < shapePath.length; i++) { - barycenter.addInPlace(shapePath[i]); + let angle = 0; + const returnScale = () => { + return scale2 !== null ? scale2 : 1; + }; + const returnRotation = () => { + return rotation2 !== null ? rotation2 : 0; + }; + const rotate = custom2 && rotateFunction2 ? rotateFunction2 : returnRotation; + const scl = custom2 && scaleFunction2 ? scaleFunction2 : returnScale; + let index = cap2 === Mesh.NO_CAP || cap2 === Mesh.CAP_END ? 0 : 2; + const rotationMatrix = TmpVectors.Matrix[0]; + for (let i = 0;i < curve2.length; i++) { + const shapePath = []; + const angleStep = rotate(i, distances[i]); + const scaleRatio = scl(i, distances[i]); + Matrix.RotationAxisToRef(tangents[i], angle, rotationMatrix); + for (let p = 0;p < shape2.length; p++) { + const planed = tangents[i].scale(shape2[p].z).add(normals[i].scale(shape2[p].x)).add(binormals[i].scale(shape2[p].y)); + const rotated = Vector3.Zero(); + Vector3.TransformCoordinatesToRef(planed, rotationMatrix, rotated); + rotated.scaleInPlace(scaleRatio).addInPlace(curve2[i]); + shapePath[p] = rotated; + } + shapePaths[index] = shapePath; + angle += angleStep; + index++; } - barycenter.scaleInPlace(1 / shapePath.length); - for (i = 0;i < shapePath.length; i++) { - pointCap.push(barycenter); + const capPath = (shapePath) => { + const pointCap = Array(); + const barycenter = Vector3.Zero(); + let i; + for (i = 0;i < shapePath.length; i++) { + barycenter.addInPlace(shapePath[i]); + } + barycenter.scaleInPlace(1 / shapePath.length); + for (i = 0;i < shapePath.length; i++) { + pointCap.push(barycenter); + } + return pointCap; + }; + switch (cap2) { + case Mesh.NO_CAP: + break; + case Mesh.CAP_START: + shapePaths[0] = capPath(shapePaths[2]); + shapePaths[1] = shapePaths[2]; + break; + case Mesh.CAP_END: + shapePaths[index] = shapePaths[index - 1]; + shapePaths[index + 1] = capPath(shapePaths[index - 1]); + break; + case Mesh.CAP_ALL: + shapePaths[0] = capPath(shapePaths[2]); + shapePaths[1] = shapePaths[2]; + shapePaths[index] = shapePaths[index - 1]; + shapePaths[index + 1] = capPath(shapePaths[index - 1]); + break; + default: + break; } - return pointCap; + return shapePaths; }; - switch (cap2) { - case Mesh.NO_CAP: - break; - case Mesh.CAP_START: - shapePaths[0] = capPath(shapePaths[2]); - shapePaths[1] = shapePaths[2]; - break; - case Mesh.CAP_END: - shapePaths[index] = shapePaths[index - 1]; - shapePaths[index + 1] = capPath(shapePaths[index - 1]); - break; - case Mesh.CAP_ALL: - shapePaths[0] = capPath(shapePaths[2]); - shapePaths[1] = shapePaths[2]; - shapePaths[index] = shapePaths[index - 1]; - shapePaths[index + 1] = capPath(shapePaths[index - 1]); - break; - default: - break; + let path3D; + let pathArray; + if (instance) { + const storage = instance._creationDataStorage; + path3D = firstNormal ? storage.path3D.update(curve, firstNormal) : storage.path3D.update(curve); + pathArray = extrusionPathArray(shape, curve, storage.path3D, storage.pathArray, scale, rotation, scaleFunction, rotateFunction, storage.cap, custom, adjustFrame); + instance = CreateRibbon("", { pathArray, closeArray: false, closePath: false, offset: 0, updatable: false, sideOrientation: 0, instance }, scene19 || undefined); + return instance; } - return shapePaths; + path3D = firstNormal ? new Path3D(curve, firstNormal) : new Path3D(curve); + const newShapePaths = new Array; + cap = cap < 0 || cap > 3 ? 0 : cap; + pathArray = extrusionPathArray(shape, curve, path3D, newShapePaths, scale, rotation, scaleFunction, rotateFunction, cap, custom, adjustFrame); + const extrudedGeneric = CreateRibbon(name75, { + pathArray, + closeArray: rbCA, + closePath: rbCP, + updatable: updtbl, + sideOrientation: side, + invertUV, + frontUVs: frontUVs || undefined, + backUVs: backUVs || undefined + }, scene19); + extrudedGeneric._creationDataStorage.pathArray = pathArray; + extrudedGeneric._creationDataStorage.path3D = path3D; + extrudedGeneric._creationDataStorage.cap = cap; + return extrudedGeneric; }; - let path3D; - let pathArray; - if (instance) { - const storage = instance._creationDataStorage; - path3D = firstNormal ? storage.path3D.update(curve, firstNormal) : storage.path3D.update(curve); - pathArray = extrusionPathArray(shape, curve, storage.path3D, storage.pathArray, scale, rotation, scaleFunction, rotateFunction, storage.cap, custom, adjustFrame); - instance = CreateRibbon("", { pathArray, closeArray: false, closePath: false, offset: 0, updatable: false, sideOrientation: 0, instance }, scene19 || undefined); - return instance; - } - path3D = firstNormal ? new Path3D(curve, firstNormal) : new Path3D(curve); - const newShapePaths = new Array; - cap = cap < 0 || cap > 3 ? 0 : cap; - pathArray = extrusionPathArray(shape, curve, path3D, newShapePaths, scale, rotation, scaleFunction, rotateFunction, cap, custom, adjustFrame); - const extrudedGeneric = CreateRibbon(name74, { - pathArray, - closeArray: rbCA, - closePath: rbCP, - updatable: updtbl, - sideOrientation: side, - invertUV, - frontUVs: frontUVs || undefined, - backUVs: backUVs || undefined - }, scene19); - extrudedGeneric._creationDataStorage.pathArray = pathArray; - extrudedGeneric._creationDataStorage.path3D = path3D; - extrudedGeneric._creationDataStorage.cap = cap; - return extrudedGeneric; -}; -Mesh.ExtrudeShape = (name74, shape, path, scale, rotation, cap, scene19 = null, updatable, sideOrientation, instance) => { - const options = { - shape, - path, - scale, - rotation, - cap: cap === 0 ? 0 : cap || Mesh.NO_CAP, - sideOrientation, - instance, - updatable + ShapeBuilder = { + ExtrudeShape, + ExtrudeShapeCustom }; - return ExtrudeShape(name74, options, scene19); -}; -Mesh.ExtrudeShapeCustom = (name74, shape, path, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, scene19, updatable, sideOrientation, instance) => { - const options = { - shape, - path, - scaleFunction, - rotationFunction, - ribbonCloseArray, - ribbonClosePath, - cap: cap === 0 ? 0 : cap || Mesh.NO_CAP, - sideOrientation, - instance, - updatable + Mesh.ExtrudeShape = (name75, shape, path, scale, rotation, cap, scene19 = null, updatable, sideOrientation, instance) => { + const options = { + shape, + path, + scale, + rotation, + cap: cap === 0 ? 0 : cap || Mesh.NO_CAP, + sideOrientation, + instance, + updatable + }; + return ExtrudeShape(name75, options, scene19); }; - return ExtrudeShapeCustom(name74, options, scene19); -}; + Mesh.ExtrudeShapeCustom = (name75, shape, path, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, scene19, updatable, sideOrientation, instance) => { + const options = { + shape, + path, + scaleFunction, + rotationFunction, + ribbonCloseArray, + ribbonClosePath, + cap: cap === 0 ? 0 : cap || Mesh.NO_CAP, + sideOrientation, + instance, + updatable + }; + return ExtrudeShapeCustom(name75, options, scene19); + }; +}); // node_modules/@babylonjs/core/Meshes/Builders/latheBuilder.js -function CreateLathe(name74, options, scene19 = null) { +function CreateLathe(name75, options, scene19 = null) { const arc = options.arc ? options.arc <= 0 || options.arc > 1 ? 1 : options.arc : 1; const closed = options.closed === undefined ? true : options.closed; const shape = options.shape; @@ -80526,22 +84617,31 @@ function CreateLathe(name74, options, scene19 = null) { } paths.push(path); } - const lathe = CreateRibbon(name74, { pathArray: paths, closeArray: closed, sideOrientation, updatable, invertUV, frontUVs: options.frontUVs, backUVs: options.backUVs }, scene19); + const lathe = CreateRibbon(name75, { pathArray: paths, closeArray: closed, sideOrientation, updatable, invertUV, frontUVs: options.frontUVs, backUVs: options.backUVs }, scene19); return lathe; } -Mesh.CreateLathe = (name74, shape, radius, tessellation, scene19, updatable, sideOrientation) => { - const options = { - shape, - radius, - tessellation, - sideOrientation, - updatable +var LatheBuilder; +var init_latheBuilder = __esm(() => { + init_math_vector(); + init_mesh(); + init_ribbonBuilder(); + LatheBuilder = { + CreateLathe }; - return CreateLathe(name74, options, scene19); -}; + Mesh.CreateLathe = (name75, shape, radius, tessellation, scene19, updatable, sideOrientation) => { + const options = { + shape, + radius, + tessellation, + sideOrientation, + updatable + }; + return CreateLathe(name75, options, scene19); + }; +}); // node_modules/@babylonjs/core/Meshes/Builders/tubeBuilder.js -function CreateTube(name74, options, scene19 = null) { +function CreateTube(name75, options, scene19 = null) { const path = options.path; let instance = options.instance; let radius = 1; @@ -80632,7 +84732,7 @@ function CreateTube(name74, options, scene19 = null) { const newPathArray = new Array; cap = cap < 0 || cap > 3 ? 0 : cap; pathArray = tubePathArray(path, path3D, newPathArray, radius, tessellation, radiusFunction, cap, options.arc); - const tube = CreateRibbon(name74, { + const tube = CreateRibbon(name75, { pathArray, closePath: true, closeArray: false, @@ -80650,20 +84750,30 @@ function CreateTube(name74, options, scene19 = null) { tube._creationDataStorage.radius = radius; return tube; } -Mesh.CreateTube = (name74, path, radius, tessellation, radiusFunction, cap, scene19, updatable, sideOrientation, instance) => { - const options = { - path, - radius, - tessellation, - radiusFunction, - arc: 1, - cap, - updatable, - sideOrientation, - instance +var TubeBuilder; +var init_tubeBuilder = __esm(() => { + init_math_vector(); + init_mesh(); + init_ribbonBuilder(); + init_math_path(); + TubeBuilder = { + CreateTube }; - return CreateTube(name74, options, scene19); -}; + Mesh.CreateTube = (name75, path, radius, tessellation, radiusFunction, cap, scene19, updatable, sideOrientation, instance) => { + const options = { + path, + radius, + tessellation, + radiusFunction, + arc: 1, + cap, + updatable, + sideOrientation, + instance + }; + return CreateTube(name75, options, scene19); + }; +}); // node_modules/@babylonjs/core/Meshes/Builders/polyhedronBuilder.js function CreatePolyhedronVertexData(options) { @@ -81168,21 +85278,32 @@ function CreatePolyhedronVertexData(options) { } return vertexData; } -function CreatePolyhedron(name74, options = {}, scene19 = null) { - const polyhedron = new Mesh(name74, scene19); +function CreatePolyhedron(name75, options = {}, scene19 = null) { + const polyhedron = new Mesh(name75, scene19); options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation); polyhedron._originalBuilderSideOrientation = options.sideOrientation; const vertexData = CreatePolyhedronVertexData(options); vertexData.applyToMesh(polyhedron, options.updatable); return polyhedron; } -VertexData.CreatePolyhedron = CreatePolyhedronVertexData; -Mesh.CreatePolyhedron = (name74, options, scene19) => { - return CreatePolyhedron(name74, options, scene19); -}; +var PolyhedronBuilder; +var init_polyhedronBuilder = __esm(() => { + init_math_vector(); + init_math_color(); + init_mesh(); + init_mesh_vertexData(); + init_compatibilityOptions(); + PolyhedronBuilder = { + CreatePolyhedron + }; + VertexData.CreatePolyhedron = CreatePolyhedronVertexData; + Mesh.CreatePolyhedron = (name75, options, scene19) => { + return CreatePolyhedron(name75, options, scene19); + }; +}); // node_modules/@babylonjs/core/Meshes/Builders/decalBuilder.js -function CreateDecal(name74, sourceMesh, options) { +function CreateDecal(name75, sourceMesh, options) { var _a, _b, _c, _d; const hasSkeleton = !!sourceMesh.skeleton; const useLocalComputation = options.localMode || hasSkeleton; @@ -81551,7 +85672,7 @@ function CreateDecal(name74, sourceMesh, options) { vertexData.matricesIndicesExtra = null; if (((_d = vertexData.matricesWeightsExtra) === null || _d === undefined ? undefined : _d.length) === 0) vertexData.matricesWeightsExtra = null; - const decal = new Mesh(name74, sourceMesh.getScene()); + const decal = new Mesh(name75, sourceMesh.getScene()); vertexData.applyToMesh(decal); if (useLocalComputation) { decal.skeleton = sourceMesh.skeleton; @@ -81564,12 +85685,6 @@ function CreateDecal(name74, sourceMesh, options) { decal.refreshBoundingInfo(true, true); return decal; } -var xpAxis = new Vector3(1, 0, 0); -var xnAxis = new Vector3(-1, 0, 0); -var ypAxis = new Vector3(0, 1, 0); -var ynAxis = new Vector3(0, -1, 0); -var zpAxis = new Vector3(0, 0, 1); -var znAxis = new Vector3(0, 0, -1); class DecalVertex { constructor(position = Vector3.Zero(), normal = Vector3.Up(), uv = Vector2.Zero(), vertexIdx = 0, vertexIdxForBones = 0, localPositionOverride = null, localNormalOverride = null, matrixIndicesOverride = null, matrixWeightsOverride = null) { @@ -81588,15 +85703,33 @@ class DecalVertex { return new DecalVertex(this.position.clone(), this.normal.clone(), this.uv.clone(), this.vertexIdx, this.vertexIdxForBones, (_a = this.localPositionOverride) === null || _a === undefined ? undefined : _a.slice(), (_b = this.localNormalOverride) === null || _b === undefined ? undefined : _b.slice(), (_c = this.matrixIndicesOverride) === null || _c === undefined ? undefined : _c.slice(), (_d = this.matrixWeightsOverride) === null || _d === undefined ? undefined : _d.slice()); } } -Mesh.CreateDecal = (name74, sourceMesh, position, normal, size, angle) => { - const options = { - position, - normal, - size, - angle +var xpAxis, xnAxis, ypAxis, ynAxis, zpAxis, znAxis, DecalBuilder; +var init_decalBuilder = __esm(() => { + init_math_vector(); + init_math_scalar(); + init_mesh(); + init_buffer(); + init_mesh_vertexData(); + init_compatibilityOptions(); + xpAxis = new Vector3(1, 0, 0); + xnAxis = new Vector3(-1, 0, 0); + ypAxis = new Vector3(0, 1, 0); + ynAxis = new Vector3(0, -1, 0); + zpAxis = new Vector3(0, 0, 1); + znAxis = new Vector3(0, 0, -1); + DecalBuilder = { + CreateDecal }; - return CreateDecal(name74, sourceMesh, options); -}; + Mesh.CreateDecal = (name75, sourceMesh, position, normal, size, angle) => { + const options = { + position, + normal, + size, + angle + }; + return CreateDecal(name75, sourceMesh, options); + }; +}); // node_modules/@babylonjs/core/Maths/math.isovector.js class _IsoVector { @@ -81665,6 +85798,10 @@ class _IsoVector { return new _IsoVector(0, 0); } } +var init_math_isovector = __esm(() => { + init_logger(); + init_math_vector(); +}); // node_modules/@babylonjs/core/Meshes/geodesicMesh.js class _PrimaryIsoTriangle { @@ -82105,8 +86242,8 @@ class _PrimaryIsoTriangle { } class PolyhedronData { - constructor(name74, category, vertex, face) { - this.name = name74; + constructor(name75, category, vertex, face) { + this.name = name75; this.category = category; this.vertex = vertex; this.face = face; @@ -82321,9 +86458,15 @@ class GeodesicData extends PolyhedronData { return geodesicData; } } +var init_geodesicMesh = __esm(() => { + init_math_vector(); + init_math_scalar(); + init_math_constants(); + init_math_isovector(); +}); // node_modules/@babylonjs/core/Meshes/Builders/geodesicBuilder.js -function CreateGeodesic(name74, options, scene19 = null) { +function CreateGeodesic(name75, options, scene19 = null) { let m = options.m || 1; if (m !== Math.floor(m)) { Math.floor(m); @@ -82357,15 +86500,16 @@ function CreateGeodesic(name74, options, scene19 = null) { frontUVs: options.frontUVs, backUVs: options.backUVs }; - const geodesic = CreatePolyhedron(name74, geoOptions, scene19); + const geodesic = CreatePolyhedron(name75, geoOptions, scene19); return geodesic; } +var init_geodesicBuilder = __esm(() => { + init_polyhedronBuilder(); + init_logger(); + init_geodesicMesh(); +}); // node_modules/@babylonjs/core/Meshes/goldbergMesh.js -Mesh._GoldbergMeshParser = (parsedMesh, scene19) => { - return GoldbergMesh.Parse(parsedMesh, scene19); -}; - class GoldbergMesh extends Mesh { constructor() { super(...arguments); @@ -82545,6 +86689,16 @@ class GoldbergMesh extends Mesh { return goldberg; } } +var init_goldbergMesh = __esm(() => { + init_math_vector(); + init_buffer(); + init_mesh(); + init_math_color(); + init_logger(); + Mesh._GoldbergMeshParser = (parsedMesh, scene19) => { + return GoldbergMesh.Parse(parsedMesh, scene19); + }; +}); // node_modules/@babylonjs/core/Meshes/Builders/goldbergBuilder.js function CreateGoldbergVertexData(options, goldbergData) { @@ -82596,7 +86750,7 @@ function CreateGoldbergVertexData(options, goldbergData) { vertexData.uvs = uvs; return vertexData; } -function CreateGoldberg(name74, options, scene19 = null) { +function CreateGoldberg(name75, options, scene19 = null) { const size = options.size; const sizeX = options.sizeX || size || 1; const sizeY = options.sizeY || size || 1; @@ -82621,7 +86775,7 @@ function CreateGoldberg(name74, options, scene19 = null) { primTri.build(m, n); const geodesicData = GeodesicData.BuildGeodesicData(primTri); const goldbergData = geodesicData.toGoldbergPolyhedronData(); - const goldberg = new GoldbergMesh(name74, scene19); + const goldberg = new GoldbergMesh(name75, scene19); options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation); goldberg._originalBuilderSideOrientation = options.sideOrientation; const vertexData = CreateGoldbergVertexData(options, goldbergData); @@ -82653,55 +86807,18 @@ function CreateGoldberg(name74, options, scene19 = null) { } return goldberg; } +var init_goldbergBuilder = __esm(() => { + init_math_vector(); + init_math_color(); + init_mesh(); + init_mesh_vertexData(); + init_logger(); + init_geodesicMesh(); + init_goldbergMesh(); + init_compatibilityOptions(); +}); // node_modules/@babylonjs/core/Meshes/Builders/textBuilder.js -var CreateShapePath = function(char, scale, offsetX, offsetY, resolution, fontData) { - const glyph = fontData.glyphs[char] || fontData.glyphs["?"]; - if (!glyph) { - return null; - } - const shapePath = new ShapePath(resolution); - if (glyph.o) { - const outline = glyph.o.split(" "); - for (let i = 0, l = outline.length;i < l; ) { - const action7 = outline[i++]; - switch (action7) { - case "m": { - const x = parseInt(outline[i++]) * scale + offsetX; - const y = parseInt(outline[i++]) * scale + offsetY; - shapePath.moveTo(x, y); - break; - } - case "l": { - const x = parseInt(outline[i++]) * scale + offsetX; - const y = parseInt(outline[i++]) * scale + offsetY; - shapePath.lineTo(x, y); - break; - } - case "q": { - const cpx = parseInt(outline[i++]) * scale + offsetX; - const cpy = parseInt(outline[i++]) * scale + offsetY; - const cpx1 = parseInt(outline[i++]) * scale + offsetX; - const cpy1 = parseInt(outline[i++]) * scale + offsetY; - shapePath.quadraticCurveTo(cpx1, cpy1, cpx, cpy); - break; - } - case "b": { - const cpx = parseInt(outline[i++]) * scale + offsetX; - const cpy = parseInt(outline[i++]) * scale + offsetY; - const cpx1 = parseInt(outline[i++]) * scale + offsetX; - const cpy1 = parseInt(outline[i++]) * scale + offsetY; - const cpx2 = parseInt(outline[i++]) * scale + offsetX; - const cpy2 = parseInt(outline[i++]) * scale + offsetY; - shapePath.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, cpx, cpy); - break; - } - } - } - } - shapePath.extractHoles(); - return { offsetX: glyph.ha * scale, shapePath }; -}; function CreateTextShapePaths(text, size, resolution, fontData) { const chars = Array.from(text); const scale = size / fontData.resolution; @@ -82723,7 +86840,7 @@ function CreateTextShapePaths(text, size, resolution, fontData) { } return shapePaths; } -function CreateText(name74, text, fontData, options = { +function CreateText(name75, text, fontData, options = { size: 50, resolution: 8, depth: 1 @@ -82774,7 +86891,7 @@ function CreateText(name74, text, fontData, options = { holeVectors.push(holePoints); } } - const mesh34 = ExtrudePolygon(name74, { + const mesh34 = ExtrudePolygon(name75, { shape: shapeVectors, holes: holeVectors.length ? holeVectors : undefined, depth: options.depth || 1, @@ -82792,7 +86909,7 @@ function CreateText(name74, text, fontData, options = { newMesh.position.x += -(bbox.minimumWorld.x + bbox.maximumWorld.x) / 2; newMesh.position.y += -(bbox.minimumWorld.y + bbox.maximumWorld.y) / 2; newMesh.position.z += -(bbox.minimumWorld.z + bbox.maximumWorld.z) / 2 + bbox.extendSize.z; - newMesh.name = name74; + newMesh.name = name75; const pivot = new TransformNode("pivot", scene19); pivot.rotation.x = -Math.PI / 2; newMesh.parent = pivot; @@ -82845,39 +86962,936 @@ class ShapePath { return this._holes; } } +var CreateShapePath; +var init_textBuilder = __esm(() => { + init_math_path(); + init_math_vector(); + init_mesh(); + init_transformNode(); + init_polygonBuilder(); + CreateShapePath = function(char, scale, offsetX, offsetY, resolution, fontData) { + const glyph = fontData.glyphs[char] || fontData.glyphs["?"]; + if (!glyph) { + return null; + } + const shapePath = new ShapePath(resolution); + if (glyph.o) { + const outline = glyph.o.split(" "); + for (let i = 0, l = outline.length;i < l; ) { + const action7 = outline[i++]; + switch (action7) { + case "m": { + const x = parseInt(outline[i++]) * scale + offsetX; + const y = parseInt(outline[i++]) * scale + offsetY; + shapePath.moveTo(x, y); + break; + } + case "l": { + const x = parseInt(outline[i++]) * scale + offsetX; + const y = parseInt(outline[i++]) * scale + offsetY; + shapePath.lineTo(x, y); + break; + } + case "q": { + const cpx = parseInt(outline[i++]) * scale + offsetX; + const cpy = parseInt(outline[i++]) * scale + offsetY; + const cpx1 = parseInt(outline[i++]) * scale + offsetX; + const cpy1 = parseInt(outline[i++]) * scale + offsetY; + shapePath.quadraticCurveTo(cpx1, cpy1, cpx, cpy); + break; + } + case "b": { + const cpx = parseInt(outline[i++]) * scale + offsetX; + const cpy = parseInt(outline[i++]) * scale + offsetY; + const cpx1 = parseInt(outline[i++]) * scale + offsetX; + const cpy1 = parseInt(outline[i++]) * scale + offsetY; + const cpx2 = parseInt(outline[i++]) * scale + offsetX; + const cpy2 = parseInt(outline[i++]) * scale + offsetY; + shapePath.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, cpx, cpy); + break; + } + } + } + } + shapePath.extractHoles(); + return { offsetX: glyph.ha * scale, shapePath }; + }; +}); // node_modules/@babylonjs/core/Meshes/meshBuilder.js -var MeshBuilder = { - CreateBox, - CreateTiledBox, - CreateSphere, - CreateDisc, - CreateIcoSphere, - CreateRibbon, - CreateCylinder, - CreateTorus, - CreateTorusKnot, - CreateLineSystem, - CreateLines, - CreateDashedLines, - ExtrudeShape, - ExtrudeShapeCustom, - CreateLathe, - CreateTiledPlane, - CreatePlane, - CreateGround, - CreateTiledGround, - CreateGroundFromHeightMap, - CreatePolygon, - ExtrudePolygon, - CreateTube, - CreatePolyhedron, - CreateGeodesic, - CreateGoldberg, - CreateDecal, - CreateCapsule, - CreateText -}; +var MeshBuilder; +var init_meshBuilder = __esm(() => { + init_ribbonBuilder(); + init_discBuilder(); + init_boxBuilder(); + init_tiledBoxBuilder(); + init_sphereBuilder(); + init_cylinderBuilder(); + init_torusBuilder(); + init_torusKnotBuilder(); + init_linesBuilder(); + init_polygonBuilder(); + init_shapeBuilder(); + init_latheBuilder(); + init_planeBuilder(); + init_tiledPlaneBuilder(); + init_groundBuilder(); + init_tubeBuilder(); + init_polyhedronBuilder(); + init_icoSphereBuilder(); + init_decalBuilder(); + init_capsuleBuilder(); + init_geodesicBuilder(); + init_goldbergBuilder(); + init_textBuilder(); + MeshBuilder = { + CreateBox, + CreateTiledBox, + CreateSphere, + CreateDisc, + CreateIcoSphere, + CreateRibbon, + CreateCylinder, + CreateTorus, + CreateTorusKnot, + CreateLineSystem, + CreateLines, + CreateDashedLines, + ExtrudeShape, + ExtrudeShapeCustom, + CreateLathe, + CreateTiledPlane, + CreatePlane, + CreateGround, + CreateTiledGround, + CreateGroundFromHeightMap, + CreatePolygon, + ExtrudePolygon, + CreateTube, + CreatePolyhedron, + CreateGeodesic, + CreateGoldberg, + CreateDecal, + CreateCapsule, + CreateText + }; +}); + +// node_modules/@babylonjs/core/Debug/physicsViewer.js +class PhysicsViewer { + constructor(scene19) { + this._impostors = []; + this._meshes = []; + this._bodies = []; + this._inertiaBodies = []; + this._constraints = []; + this._bodyMeshes = []; + this._inertiaMeshes = []; + this._constraintMeshes = []; + this._numMeshes = 0; + this._numBodies = 0; + this._numInertiaBodies = 0; + this._numConstraints = 0; + this._debugMeshMeshes = new Array; + this._constraintAxesSize = 0.4; + this._scene = scene19 || EngineStore.LastCreatedScene; + if (!this._scene) { + return; + } + const physicEngine = this._scene.getPhysicsEngine(); + if (physicEngine) { + this._physicsEnginePlugin = physicEngine.getPhysicsPlugin(); + } + this._utilityLayer = new UtilityLayerRenderer(this._scene, false); + this._utilityLayer.pickUtilitySceneFirst = false; + this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil = true; + } + _updateDebugMeshes() { + const plugin = this._physicsEnginePlugin; + if ((plugin === null || plugin === undefined ? undefined : plugin.getPluginVersion()) === 1) { + this._updateDebugMeshesV1(); + } else { + this._updateDebugMeshesV2(); + } + } + _updateDebugMeshesV1() { + const plugin = this._physicsEnginePlugin; + for (let i = 0;i < this._numMeshes; i++) { + const impostor = this._impostors[i]; + if (!impostor) { + continue; + } + if (impostor.isDisposed) { + this.hideImpostor(this._impostors[i--]); + } else { + if (impostor.type === PhysicsImpostor.MeshImpostor) { + continue; + } + const mesh35 = this._meshes[i]; + if (mesh35 && plugin) { + plugin.syncMeshWithImpostor(mesh35, impostor); + } + } + } + } + _updateDebugMeshesV2() { + const plugin = this._physicsEnginePlugin; + for (let i = 0;i < this._numBodies; i++) { + const body = this._bodies[i]; + const transform = this._bodyMeshes[i]; + if (body && transform) { + plugin.syncTransform(body, transform); + } + } + } + _updateInertiaMeshes() { + for (let i = 0;i < this._numInertiaBodies; i++) { + const body = this._inertiaBodies[i]; + const mesh35 = this._inertiaMeshes[i]; + if (body && mesh35) { + this._updateDebugInertia(body, mesh35); + } + } + } + _updateDebugInertia(body, inertiaMesh) { + var _a; + const inertiaMatrixRef = Matrix.Identity(); + const transformMatrixRef = Matrix.Identity(); + const finalMatrixRef = Matrix.Identity(); + if (body._pluginDataInstances.length) { + const inertiaAsMesh = inertiaMesh; + const inertiaMeshMatrixData = inertiaAsMesh._thinInstanceDataStorage.matrixData; + const bodyTransformMatrixData = body.transformNode._thinInstanceDataStorage.matrixData; + for (let i = 0;i < body._pluginDataInstances.length; i++) { + const props = body.getMassProperties(i); + this._getMeshDebugInertiaMatrixToRef(props, inertiaMatrixRef); + Matrix.FromArrayToRef(bodyTransformMatrixData, i * 16, transformMatrixRef); + inertiaMatrixRef.multiplyToRef(transformMatrixRef, finalMatrixRef); + finalMatrixRef.copyToArray(inertiaMeshMatrixData, i * 16); + } + inertiaAsMesh.thinInstanceBufferUpdated("matrix"); + } else { + const props = body.getMassProperties(); + this._getMeshDebugInertiaMatrixToRef(props, inertiaMatrixRef); + (_a = body.transformNode.rotationQuaternion) === null || _a === undefined || _a.toRotationMatrix(transformMatrixRef); + transformMatrixRef.setTranslation(body.transformNode.position); + if (body.transformNode.parent) { + const parentTransform = body.transformNode.parent.computeWorldMatrix(true); + transformMatrixRef.multiplyToRef(parentTransform, transformMatrixRef); + } + inertiaMatrixRef.multiplyToRef(transformMatrixRef, inertiaMatrixRef); + inertiaMatrixRef.decomposeToTransformNode(inertiaMesh); + } + } + _updateDebugConstraints() { + for (let i = 0;i < this._numConstraints; i++) { + const constraint = this._constraints[i]; + const mesh35 = this._constraintMeshes[i]; + if (constraint && mesh35) { + this._updateDebugConstraint(constraint, mesh35); + } + } + } + _makeScalingUnitInPlace(scaling) { + if (Math.abs(scaling.x - 1) > Epsilon) { + scaling.x = 1 * Math.sign(scaling.x); + } + if (Math.abs(scaling.y - 1) > Epsilon) { + scaling.y = 1 * Math.sign(scaling.y); + } + if (Math.abs(scaling.z - 1) > Epsilon) { + scaling.z = 1 * Math.sign(scaling.z); + } + } + _updateDebugConstraint(constraint, parentingMesh) { + if (!constraint._initOptions) { + return; + } + const { pivotA, pivotB, axisA, axisB, perpAxisA, perpAxisB } = constraint._initOptions; + if (!pivotA || !pivotB || !axisA || !axisB || !perpAxisA || !perpAxisB) { + return; + } + parentingMesh.getDescendants(true).forEach((parentConstraintMesh) => { + const parentCoordSystemNode = parentConstraintMesh.getDescendants(true)[0]; + const childCoordSystemNode = parentConstraintMesh.getDescendants(true)[1]; + const { parentBody, parentBodyIndex } = parentCoordSystemNode.metadata; + const { childBody, childBodyIndex } = childCoordSystemNode.metadata; + const parentTransform = this._getTransformFromBodyToRef(parentBody, TmpVectors.Matrix[0], parentBodyIndex); + const childTransform = this._getTransformFromBodyToRef(childBody, TmpVectors.Matrix[1], childBodyIndex); + parentTransform.decomposeToTransformNode(parentCoordSystemNode); + this._makeScalingUnitInPlace(parentCoordSystemNode.scaling); + childTransform.decomposeToTransformNode(childCoordSystemNode); + this._makeScalingUnitInPlace(childCoordSystemNode.scaling); + const parentTransformNode = parentCoordSystemNode.getDescendants(true)[0]; + parentTransformNode.position.copyFrom(pivotA); + const childTransformNode = childCoordSystemNode.getDescendants(true)[0]; + childTransformNode.position.copyFrom(pivotB); + Quaternion.FromRotationMatrixToRef(Matrix.FromXYZAxesToRef(axisA, perpAxisA, Vector3.CrossToRef(axisA, perpAxisA, TmpVectors.Vector3[0]), TmpVectors.Matrix[0]), parentTransformNode.rotationQuaternion); + Quaternion.FromRotationMatrixToRef(Matrix.FromXYZAxesToRef(axisB, perpAxisB, Vector3.CrossToRef(axisB, perpAxisB, TmpVectors.Vector3[1]), TmpVectors.Matrix[1]), childTransformNode.rotationQuaternion); + }); + } + showImpostor(impostor, targetMesh) { + if (!this._scene) { + return null; + } + for (let i = 0;i < this._numMeshes; i++) { + if (this._impostors[i] == impostor) { + return null; + } + } + const debugMesh = this._getDebugMesh(impostor, targetMesh); + if (debugMesh) { + this._impostors[this._numMeshes] = impostor; + this._meshes[this._numMeshes] = debugMesh; + if (this._numMeshes === 0) { + this._renderFunction = () => this._updateDebugMeshes(); + this._scene.registerBeforeRender(this._renderFunction); + } + this._numMeshes++; + } + return debugMesh; + } + showBody(body) { + if (!this._scene) { + return null; + } + for (let i = 0;i < this._numBodies; i++) { + if (this._bodies[i] == body) { + return null; + } + } + const debugMesh = this._getDebugBodyMesh(body); + if (debugMesh) { + this._bodies[this._numBodies] = body; + this._bodyMeshes[this._numBodies] = debugMesh; + if (this._numBodies === 0) { + this._renderFunction = () => this._updateDebugMeshes(); + this._scene.registerBeforeRender(this._renderFunction); + } + this._numBodies++; + } + return debugMesh; + } + showInertia(body) { + if (!this._scene) { + return null; + } + for (let i = 0;i < this._numInertiaBodies; i++) { + if (this._inertiaBodies[i] == body) { + return null; + } + } + const debugMesh = this._getDebugInertiaMesh(body); + if (debugMesh) { + this._inertiaBodies[this._numInertiaBodies] = body; + this._inertiaMeshes[this._numInertiaBodies] = debugMesh; + if (this._numInertiaBodies === 0) { + this._inertiaRenderFunction = () => this._updateInertiaMeshes(); + this._scene.registerBeforeRender(this._inertiaRenderFunction); + } + this._numInertiaBodies++; + } + return debugMesh; + } + showConstraint(constraint) { + if (!this._scene) { + return null; + } + for (let i = 0;i < this._numConstraints; i++) { + if (this._constraints[i] == constraint) { + return null; + } + } + const debugMesh = this._getDebugConstraintMesh(constraint); + if (debugMesh) { + this._constraints[this._numConstraints] = constraint; + this._constraintMeshes[this._numConstraints] = debugMesh; + if (this._numConstraints === 0) { + this._constraintRenderFunction = () => this._updateDebugConstraints(); + this._scene.registerBeforeRender(this._constraintRenderFunction); + } + this._numConstraints++; + } + return debugMesh; + } + hideImpostor(impostor) { + if (!impostor || !this._scene || !this._utilityLayer) { + return; + } + let removed = false; + const utilityLayerScene = this._utilityLayer.utilityLayerScene; + for (let i = 0;i < this._numMeshes; i++) { + if (this._impostors[i] == impostor) { + const mesh35 = this._meshes[i]; + if (!mesh35) { + continue; + } + utilityLayerScene.removeMesh(mesh35); + mesh35.dispose(); + const index = this._debugMeshMeshes.indexOf(mesh35); + if (index > -1) { + this._debugMeshMeshes.splice(index, 1); + } + this._numMeshes--; + if (this._numMeshes > 0) { + this._meshes[i] = this._meshes[this._numMeshes]; + this._impostors[i] = this._impostors[this._numMeshes]; + this._meshes[this._numMeshes] = null; + this._impostors[this._numMeshes] = null; + } else { + this._meshes[0] = null; + this._impostors[0] = null; + } + removed = true; + break; + } + } + if (removed && this._numMeshes === 0) { + this._scene.unregisterBeforeRender(this._renderFunction); + } + } + hideBody(body) { + if (!body || !this._scene || !this._utilityLayer) { + return; + } + let removed = false; + const utilityLayerScene = this._utilityLayer.utilityLayerScene; + for (let i = 0;i < this._numBodies; i++) { + if (this._bodies[i] === body) { + const mesh35 = this._bodyMeshes[i]; + if (!mesh35) { + continue; + } + utilityLayerScene.removeMesh(mesh35); + mesh35.dispose(); + this._numBodies--; + if (this._numBodies > 0) { + this._bodyMeshes[i] = this._bodyMeshes[this._numBodies]; + this._bodies[i] = this._bodies[this._numBodies]; + this._bodyMeshes[this._numBodies] = null; + this._bodies[this._numBodies] = null; + } else { + this._bodyMeshes[0] = null; + this._bodies[0] = null; + } + removed = true; + break; + } + } + if (removed && this._numBodies === 0) { + this._scene.unregisterBeforeRender(this._renderFunction); + } + } + hideInertia(body) { + if (!body || !this._scene || !this._utilityLayer) { + return; + } + let removed = false; + const utilityLayerScene = this._utilityLayer.utilityLayerScene; + for (let i = 0;i < this._numInertiaBodies; i++) { + if (this._inertiaBodies[i] === body) { + const mesh35 = this._inertiaMeshes[i]; + if (!mesh35) { + continue; + } + utilityLayerScene.removeMesh(mesh35); + mesh35.dispose(); + this._inertiaBodies.splice(i, 1); + this._inertiaMeshes.splice(i, 1); + this._numInertiaBodies--; + removed = true; + break; + } + } + if (removed && this._numInertiaBodies === 0) { + this._scene.unregisterBeforeRender(this._inertiaRenderFunction); + } + } + hideConstraint(constraint) { + if (!constraint || !this._scene || !this._utilityLayer) { + return; + } + let removed = false; + const utilityLayerScene = this._utilityLayer.utilityLayerScene; + for (let i = 0;i < this._numConstraints; i++) { + if (this._constraints[i] === constraint) { + const mesh35 = this._constraintMeshes[i]; + if (!mesh35) { + continue; + } + utilityLayerScene.removeMesh(mesh35); + mesh35.dispose(); + this._constraints.splice(i, 1); + this._constraintMeshes.splice(i, 1); + this._numConstraints--; + if (this._numConstraints > 0) { + this._constraints[i] = this._constraints[this._numConstraints]; + this._constraintMeshes[i] = this._constraintMeshes[this._numConstraints]; + this._constraints[this._numConstraints] = null; + this._constraintMeshes[this._numConstraints] = null; + } else { + this._constraints[0] = null; + this._constraintMeshes[0] = null; + } + removed = true; + break; + } + } + if (removed && this._numConstraints === 0) { + this._scene.unregisterBeforeRender(this._constraintRenderFunction); + } + } + _getDebugMaterial(scene19) { + if (!this._debugMaterial) { + this._debugMaterial = new StandardMaterial("", scene19); + this._debugMaterial.wireframe = true; + this._debugMaterial.emissiveColor = Color3.White(); + this._debugMaterial.disableLighting = true; + } + return this._debugMaterial; + } + _getDebugInertiaMaterial(scene19) { + if (!this._debugInertiaMaterial) { + this._debugInertiaMaterial = new StandardMaterial("", scene19); + this._debugInertiaMaterial.disableLighting = true; + this._debugInertiaMaterial.alpha = 0; + } + return this._debugInertiaMaterial; + } + _getDebugBoxMesh(scene19) { + if (!this._debugBoxMesh) { + this._debugBoxMesh = CreateBox("physicsBodyBoxViewMesh", { size: 1 }, scene19); + this._debugBoxMesh.rotationQuaternion = Quaternion.Identity(); + this._debugBoxMesh.material = this._getDebugMaterial(scene19); + this._debugBoxMesh.setEnabled(false); + } + return this._debugBoxMesh.createInstance("physicsBodyBoxViewInstance"); + } + _getDebugSphereMesh(scene19) { + if (!this._debugSphereMesh) { + this._debugSphereMesh = CreateSphere("physicsBodySphereViewMesh", { diameter: 1 }, scene19); + this._debugSphereMesh.rotationQuaternion = Quaternion.Identity(); + this._debugSphereMesh.material = this._getDebugMaterial(scene19); + this._debugSphereMesh.setEnabled(false); + } + return this._debugSphereMesh.createInstance("physicsBodySphereViewInstance"); + } + _getDebugCapsuleMesh(scene19) { + if (!this._debugCapsuleMesh) { + this._debugCapsuleMesh = CreateCapsule("physicsBodyCapsuleViewMesh", { height: 1 }, scene19); + this._debugCapsuleMesh.rotationQuaternion = Quaternion.Identity(); + this._debugCapsuleMesh.material = this._getDebugMaterial(scene19); + this._debugCapsuleMesh.setEnabled(false); + } + return this._debugCapsuleMesh.createInstance("physicsBodyCapsuleViewInstance"); + } + _getDebugCylinderMesh(scene19) { + if (!this._debugCylinderMesh) { + this._debugCylinderMesh = CreateCylinder("physicsBodyCylinderViewMesh", { diameterTop: 1, diameterBottom: 1, height: 1 }, scene19); + this._debugCylinderMesh.rotationQuaternion = Quaternion.Identity(); + this._debugCylinderMesh.material = this._getDebugMaterial(scene19); + this._debugCylinderMesh.setEnabled(false); + } + return this._debugCylinderMesh.createInstance("physicsBodyCylinderViewInstance"); + } + _getDebugMeshMesh(mesh35, scene19) { + const wireframeOver = new Mesh(mesh35.name, scene19, null, mesh35); + wireframeOver.setParent(mesh35); + wireframeOver.position = Vector3.Zero(); + wireframeOver.material = this._getDebugMaterial(scene19); + this._debugMeshMeshes.push(wireframeOver); + return wireframeOver; + } + _getDebugMesh(impostor, targetMesh) { + if (!this._utilityLayer) { + return null; + } + if (targetMesh && targetMesh.parent && targetMesh.parent.physicsImpostor) { + return null; + } + let mesh35 = null; + const utilityLayerScene = this._utilityLayer.utilityLayerScene; + if (!impostor.physicsBody) { + Logger.Warn("Unable to get physicsBody of impostor. It might be initialized later by its parent's impostor."); + return null; + } + switch (impostor.type) { + case PhysicsImpostor.BoxImpostor: + mesh35 = this._getDebugBoxMesh(utilityLayerScene); + impostor.getBoxSizeToRef(mesh35.scaling); + break; + case PhysicsImpostor.SphereImpostor: { + mesh35 = this._getDebugSphereMesh(utilityLayerScene); + const radius = impostor.getRadius(); + mesh35.scaling.x = radius * 2; + mesh35.scaling.y = radius * 2; + mesh35.scaling.z = radius * 2; + break; + } + case PhysicsImpostor.CapsuleImpostor: { + mesh35 = this._getDebugCapsuleMesh(utilityLayerScene); + const bi = impostor.object.getBoundingInfo(); + mesh35.scaling.x = (bi.boundingBox.maximum.x - bi.boundingBox.minimum.x) * 2 * impostor.object.scaling.x; + mesh35.scaling.y = (bi.boundingBox.maximum.y - bi.boundingBox.minimum.y) * impostor.object.scaling.y; + mesh35.scaling.z = (bi.boundingBox.maximum.z - bi.boundingBox.minimum.z) * 2 * impostor.object.scaling.z; + break; + } + case PhysicsImpostor.MeshImpostor: + if (targetMesh) { + mesh35 = this._getDebugMeshMesh(targetMesh, utilityLayerScene); + } + break; + case PhysicsImpostor.NoImpostor: + if (targetMesh) { + const childMeshes = targetMesh.getChildMeshes().filter((c) => { + return c.physicsImpostor ? 1 : 0; + }); + childMeshes.forEach((m) => { + if (m.physicsImpostor && m.getClassName() === "Mesh") { + const boundingInfo5 = m.getBoundingInfo(); + const min = boundingInfo5.boundingBox.minimum; + const max = boundingInfo5.boundingBox.maximum; + switch (m.physicsImpostor.type) { + case PhysicsImpostor.BoxImpostor: + mesh35 = this._getDebugBoxMesh(utilityLayerScene); + mesh35.position.copyFrom(min); + mesh35.position.addInPlace(max); + mesh35.position.scaleInPlace(0.5); + break; + case PhysicsImpostor.SphereImpostor: + mesh35 = this._getDebugSphereMesh(utilityLayerScene); + break; + case PhysicsImpostor.CylinderImpostor: + mesh35 = this._getDebugCylinderMesh(utilityLayerScene); + break; + default: + mesh35 = null; + break; + } + if (mesh35) { + mesh35.scaling.x = max.x - min.x; + mesh35.scaling.y = max.y - min.y; + mesh35.scaling.z = max.z - min.z; + mesh35.parent = m; + } + } + }); + } else { + Logger.Warn("No target mesh parameter provided for NoImpostor. Skipping."); + } + mesh35 = null; + break; + case PhysicsImpostor.CylinderImpostor: { + mesh35 = this._getDebugCylinderMesh(utilityLayerScene); + const bi = impostor.object.getBoundingInfo(); + mesh35.scaling.x = (bi.boundingBox.maximum.x - bi.boundingBox.minimum.x) * impostor.object.scaling.x; + mesh35.scaling.y = (bi.boundingBox.maximum.y - bi.boundingBox.minimum.y) * impostor.object.scaling.y; + mesh35.scaling.z = (bi.boundingBox.maximum.z - bi.boundingBox.minimum.z) * impostor.object.scaling.z; + break; + } + } + return mesh35; + } + _getDebugBodyMesh(body) { + if (!this._utilityLayer) { + return null; + } + const utilityLayerScene = this._utilityLayer.utilityLayerScene; + const mesh35 = new Mesh("custom", utilityLayerScene); + const vertexData = new VertexData; + const geometry2 = body.getGeometry(); + vertexData.positions = geometry2.positions; + vertexData.indices = geometry2.indices; + vertexData.applyToMesh(mesh35); + if (body._pluginDataInstances) { + const instanceBuffer = new Float32Array(body._pluginDataInstances.length * 16); + mesh35.thinInstanceSetBuffer("matrix", instanceBuffer, 16); + } + mesh35.material = this._getDebugMaterial(utilityLayerScene); + return mesh35; + } + _getMeshDebugInertiaMatrixToRef(massProps, matrix) { + var _a, _b, _c; + const orientation = (_a = massProps.inertiaOrientation) !== null && _a !== undefined ? _a : Quaternion.Identity(); + const inertiaLocal = (_b = massProps.inertia) !== null && _b !== undefined ? _b : Vector3.Zero(); + const center = (_c = massProps.centerOfMass) !== null && _c !== undefined ? _c : Vector3.Zero(); + const betaSqrd = (inertiaLocal.x - inertiaLocal.y + inertiaLocal.z) * 6; + const beta = Math.sqrt(Math.max(betaSqrd, 0)); + const gammaSqrd = inertiaLocal.x * 12 - betaSqrd; + const gamma = Math.sqrt(Math.max(gammaSqrd, 0)); + const alphaSqrd = inertiaLocal.z * 12 - betaSqrd; + const alpha = Math.sqrt(Math.max(alphaSqrd, 0)); + const extents = TmpVectors.Vector3[0]; + extents.set(alpha, beta, gamma); + const scaling = Matrix.ScalingToRef(extents.x, extents.y, extents.z, TmpVectors.Matrix[0]); + const rotation = orientation.toRotationMatrix(TmpVectors.Matrix[1]); + const translation = Matrix.TranslationToRef(center.x, center.y, center.z, TmpVectors.Matrix[2]); + scaling.multiplyToRef(rotation, matrix); + matrix.multiplyToRef(translation, matrix); + return matrix; + } + _getDebugInertiaMesh(body) { + if (!this._utilityLayer) { + return null; + } + const utilityLayerScene = this._utilityLayer.utilityLayerScene; + const inertiaBoxMesh = MeshBuilder.CreateBox("custom", { size: 1 }, utilityLayerScene); + const matrixRef = Matrix.Identity(); + if (body._pluginDataInstances.length) { + const instanceBuffer = new Float32Array(body._pluginDataInstances.length * 16); + for (let i = 0;i < body._pluginDataInstances.length; ++i) { + const props = body.getMassProperties(i); + this._getMeshDebugInertiaMatrixToRef(props, matrixRef); + matrixRef.copyToArray(instanceBuffer, i * 16); + } + inertiaBoxMesh.thinInstanceSetBuffer("matrix", instanceBuffer, 16); + } else { + const props = body.getMassProperties(); + this._getMeshDebugInertiaMatrixToRef(props, matrixRef); + matrixRef.decomposeToTransformNode(inertiaBoxMesh); + } + inertiaBoxMesh.enableEdgesRendering(); + inertiaBoxMesh.edgesWidth = 2; + inertiaBoxMesh.edgesColor = new Color4(1, 0, 1, 1); + inertiaBoxMesh.material = this._getDebugInertiaMaterial(utilityLayerScene); + return inertiaBoxMesh; + } + _getTransformFromBodyToRef(body, matrix, instanceIndex) { + const tnode = body.transformNode; + if (instanceIndex && instanceIndex >= 0) { + return Matrix.FromArrayToRef(tnode._thinInstanceDataStorage.matrixData, instanceIndex, matrix); + } else { + return matrix.copyFrom(tnode.getWorldMatrix()); + } + } + _getDebugConstraintMesh(constraint) { + if (!this._utilityLayer) { + return null; + } + const utilityLayerScene = this._utilityLayer.utilityLayerScene; + if (!constraint._initOptions) { + return null; + } + const { pivotA, pivotB, axisA, axisB, perpAxisA, perpAxisB } = constraint._initOptions; + if (!pivotA || !pivotB || !axisA || !axisB || !perpAxisA || !perpAxisB) { + return null; + } + const parentingMesh = new Mesh("parentingDebugConstraint", utilityLayerScene); + const bodiesUsingConstraint = constraint.getBodiesUsingConstraint(); + for (const bodyPairInfo of bodiesUsingConstraint) { + const parentOfPair = new TransformNode("parentOfPair", utilityLayerScene); + parentOfPair.parent = parentingMesh; + const { parentBody, parentBodyIndex, childBody, childBodyIndex } = bodyPairInfo; + const parentTransform = this._getTransformFromBodyToRef(parentBody, TmpVectors.Matrix[0], parentBodyIndex); + const childTransform = this._getTransformFromBodyToRef(childBody, TmpVectors.Matrix[1], childBodyIndex); + const parentCoordSystemNode = new TransformNode("parentCoordSystem", utilityLayerScene); + parentCoordSystemNode.parent = parentOfPair; + parentCoordSystemNode.metadata = { parentBody, parentBodyIndex }; + parentTransform.decomposeToTransformNode(parentCoordSystemNode); + const childCoordSystemNode = new TransformNode("childCoordSystem", utilityLayerScene); + childCoordSystemNode.parent = parentOfPair; + childCoordSystemNode.metadata = { childBody, childBodyIndex }; + childTransform.decomposeToTransformNode(childCoordSystemNode); + const rotTransformParent = Quaternion.FromRotationMatrix(Matrix.FromXYZAxesToRef(axisA, perpAxisA, axisA.cross(perpAxisA), TmpVectors.Matrix[0])); + const rotTransformChild = Quaternion.FromRotationMatrix(Matrix.FromXYZAxesToRef(axisB, perpAxisB, axisB.cross(perpAxisB), TmpVectors.Matrix[0])); + const translateTransformParent = pivotA; + const translateTransformChild = pivotB; + const parentTransformNode = new TransformNode("constraint_parent", utilityLayerScene); + parentTransformNode.position.copyFrom(translateTransformParent); + parentTransformNode.rotationQuaternion = rotTransformParent; + parentTransformNode.parent = parentCoordSystemNode; + const childTransformNode = new TransformNode("constraint_child", utilityLayerScene); + childTransformNode.parent = childCoordSystemNode; + childTransformNode.position.copyFrom(translateTransformChild); + childTransformNode.rotationQuaternion = rotTransformChild; + const parentAxes = new AxesViewer(utilityLayerScene, this._constraintAxesSize); + parentAxes.xAxis.parent = parentTransformNode; + parentAxes.yAxis.parent = parentTransformNode; + parentAxes.zAxis.parent = parentTransformNode; + const childAxes = new AxesViewer(utilityLayerScene, this._constraintAxesSize); + childAxes.xAxis.parent = childTransformNode; + childAxes.yAxis.parent = childTransformNode; + childAxes.zAxis.parent = childTransformNode; + } + return parentingMesh; + } + dispose() { + for (let index = this._numMeshes - 1;index >= 0; index--) { + this.hideImpostor(this._impostors[0]); + } + for (let index = this._numBodies - 1;index >= 0; index--) { + this.hideBody(this._bodies[0]); + } + for (let index = this._numInertiaBodies - 1;index >= 0; index--) { + this.hideInertia(this._inertiaBodies[0]); + } + if (this._debugBoxMesh) { + this._debugBoxMesh.dispose(); + } + if (this._debugSphereMesh) { + this._debugSphereMesh.dispose(); + } + if (this._debugCylinderMesh) { + this._debugCylinderMesh.dispose(); + } + if (this._debugMaterial) { + this._debugMaterial.dispose(); + } + this._impostors.length = 0; + this._scene = null; + this._physicsEnginePlugin = null; + if (this._utilityLayer) { + this._utilityLayer.dispose(); + this._utilityLayer = null; + } + } +} +var init_physicsViewer = __esm(() => { + init_mesh(); + init_boxBuilder(); + init_sphereBuilder(); + init_math_vector(); + init_math_color(); + init_engineStore(); + init_standardMaterial(); + init_physicsImpostor(); + init_utilityLayerRenderer(); + init_cylinderBuilder(); + init_capsuleBuilder(); + init_logger(); + init_mesh_vertexData(); + init_meshBuilder(); + init_axesViewer(); + init_transformNode(); + init_math_constants(); +}); + +// node_modules/@babylonjs/core/Debug/rayHelper.js +class RayHelper { + static CreateAndShow(ray5, scene19, color) { + const helper = new RayHelper(ray5); + helper.show(scene19, color); + return helper; + } + constructor(ray5) { + this.ray = ray5; + } + show(scene19, color) { + if (!this._renderFunction && this.ray) { + const ray5 = this.ray; + this._renderFunction = () => this._render(); + this._scene = scene19; + this._renderPoints = [ray5.origin, ray5.origin.add(ray5.direction.scale(ray5.length))]; + this._renderLine = CreateLines("ray", { points: this._renderPoints, updatable: true }, scene19); + this._renderLine.isPickable = false; + if (this._renderFunction) { + this._scene.registerBeforeRender(this._renderFunction); + } + } + if (color && this._renderLine) { + this._renderLine.color.copyFrom(color); + } + } + hide() { + if (this._renderFunction && this._scene) { + this._scene.unregisterBeforeRender(this._renderFunction); + this._scene = null; + this._renderFunction = null; + if (this._renderLine) { + this._renderLine.dispose(); + this._renderLine = null; + } + this._renderPoints = []; + } + } + _render() { + var _a; + const ray5 = this.ray; + if (!ray5) { + return; + } + const point = this._renderPoints[1]; + const len = Math.min(ray5.length, 1e6); + point.copyFrom(ray5.direction); + point.scaleInPlace(len); + point.addInPlace(ray5.origin); + this._renderPoints[0].copyFrom(ray5.origin); + CreateLines("ray", { points: this._renderPoints, updatable: true, instance: this._renderLine }, this._scene); + (_a = this._renderLine) === null || _a === undefined || _a.refreshBoundingInfo(); + } + attachToMesh(mesh35, meshSpaceDirection, meshSpaceOrigin, length) { + this._attachedToMesh = mesh35; + const ray5 = this.ray; + if (!ray5) { + return; + } + if (!ray5.direction) { + ray5.direction = Vector3.Zero(); + } + if (!ray5.origin) { + ray5.origin = Vector3.Zero(); + } + if (length) { + ray5.length = length; + } + if (!meshSpaceOrigin) { + meshSpaceOrigin = Vector3.Zero(); + } + if (!meshSpaceDirection) { + meshSpaceDirection = new Vector3(0, 0, -1); + } + if (!this._scene) { + this._scene = mesh35.getScene(); + } + if (!this._meshSpaceDirection) { + this._meshSpaceDirection = meshSpaceDirection.clone(); + this._meshSpaceOrigin = meshSpaceOrigin.clone(); + } else { + this._meshSpaceDirection.copyFrom(meshSpaceDirection); + this._meshSpaceOrigin.copyFrom(meshSpaceOrigin); + } + if (!this._onAfterRenderObserver) { + this._onAfterRenderObserver = this._scene.onBeforeRenderObservable.add(() => this._updateToMesh()); + this._onAfterStepObserver = this._scene.onAfterStepObservable.add(() => this._updateToMesh()); + } + this._attachedToMesh.computeWorldMatrix(true); + this._updateToMesh(); + } + detachFromMesh() { + if (this._attachedToMesh && this._scene) { + if (this._onAfterRenderObserver) { + this._scene.onBeforeRenderObservable.remove(this._onAfterRenderObserver); + this._scene.onAfterStepObservable.remove(this._onAfterStepObserver); + } + this._attachedToMesh = null; + this._onAfterRenderObserver = null; + this._onAfterStepObserver = null; + this._scene = null; + } + } + _updateToMesh() { + const ray5 = this.ray; + if (!this._attachedToMesh || !ray5) { + return; + } + if (this._attachedToMesh.isDisposed()) { + this.detachFromMesh(); + return; + } + this._attachedToMesh.getDirectionToRef(this._meshSpaceDirection, ray5.direction); + Vector3.TransformCoordinatesToRef(this._meshSpaceOrigin, this._attachedToMesh.getWorldMatrix(), ray5.origin); + } + dispose() { + this.hide(); + this.detachFromMesh(); + this.ray = null; + } +} +var init_rayHelper = __esm(() => { + init_math_vector(); + init_linesBuilder(); +}); + // node_modules/@babylonjs/core/Debug/skeletonViewer.js class SkeletonViewer { static CreateBoneWeightShader(options, scene19) { @@ -83597,1428 +88611,2279 @@ class SkeletonViewer { this.ready = false; } } -SkeletonViewer.DISPLAY_LINES = 0; -SkeletonViewer.DISPLAY_SPHERES = 1; -SkeletonViewer.DISPLAY_SPHERE_AND_SPURS = 2; -// node_modules/@babylonjs/core/Engines/constants.js -class Constants { -} -Constants.ALPHA_DISABLE = 0; -Constants.ALPHA_ADD = 1; -Constants.ALPHA_COMBINE = 2; -Constants.ALPHA_SUBTRACT = 3; -Constants.ALPHA_MULTIPLY = 4; -Constants.ALPHA_MAXIMIZED = 5; -Constants.ALPHA_ONEONE = 6; -Constants.ALPHA_PREMULTIPLIED = 7; -Constants.ALPHA_PREMULTIPLIED_PORTERDUFF = 8; -Constants.ALPHA_INTERPOLATE = 9; -Constants.ALPHA_SCREENMODE = 10; -Constants.ALPHA_ONEONE_ONEONE = 11; -Constants.ALPHA_ALPHATOCOLOR = 12; -Constants.ALPHA_REVERSEONEMINUS = 13; -Constants.ALPHA_SRC_DSTONEMINUSSRCALPHA = 14; -Constants.ALPHA_ONEONE_ONEZERO = 15; -Constants.ALPHA_EXCLUSION = 16; -Constants.ALPHA_LAYER_ACCUMULATE = 17; -Constants.ALPHA_EQUATION_ADD = 0; -Constants.ALPHA_EQUATION_SUBSTRACT = 1; -Constants.ALPHA_EQUATION_REVERSE_SUBTRACT = 2; -Constants.ALPHA_EQUATION_MAX = 3; -Constants.ALPHA_EQUATION_MIN = 4; -Constants.ALPHA_EQUATION_DARKEN = 5; -Constants.DELAYLOADSTATE_NONE = 0; -Constants.DELAYLOADSTATE_LOADED = 1; -Constants.DELAYLOADSTATE_LOADING = 2; -Constants.DELAYLOADSTATE_NOTLOADED = 4; -Constants.NEVER = 512; -Constants.ALWAYS = 519; -Constants.LESS = 513; -Constants.EQUAL = 514; -Constants.LEQUAL = 515; -Constants.GREATER = 516; -Constants.GEQUAL = 518; -Constants.NOTEQUAL = 517; -Constants.KEEP = 7680; -Constants.ZERO = 0; -Constants.REPLACE = 7681; -Constants.INCR = 7682; -Constants.DECR = 7683; -Constants.INVERT = 5386; -Constants.INCR_WRAP = 34055; -Constants.DECR_WRAP = 34056; -Constants.TEXTURE_CLAMP_ADDRESSMODE = 0; -Constants.TEXTURE_WRAP_ADDRESSMODE = 1; -Constants.TEXTURE_MIRROR_ADDRESSMODE = 2; -Constants.TEXTURE_CREATIONFLAG_STORAGE = 1; -Constants.TEXTUREFORMAT_ALPHA = 0; -Constants.TEXTUREFORMAT_LUMINANCE = 1; -Constants.TEXTUREFORMAT_LUMINANCE_ALPHA = 2; -Constants.TEXTUREFORMAT_RGB = 4; -Constants.TEXTUREFORMAT_RGBA = 5; -Constants.TEXTUREFORMAT_RED = 6; -Constants.TEXTUREFORMAT_R = 6; -Constants.TEXTUREFORMAT_RG = 7; -Constants.TEXTUREFORMAT_RED_INTEGER = 8; -Constants.TEXTUREFORMAT_R_INTEGER = 8; -Constants.TEXTUREFORMAT_RG_INTEGER = 9; -Constants.TEXTUREFORMAT_RGB_INTEGER = 10; -Constants.TEXTUREFORMAT_RGBA_INTEGER = 11; -Constants.TEXTUREFORMAT_BGRA = 12; -Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 = 13; -Constants.TEXTUREFORMAT_DEPTH32_FLOAT = 14; -Constants.TEXTUREFORMAT_DEPTH16 = 15; -Constants.TEXTUREFORMAT_DEPTH24 = 16; -Constants.TEXTUREFORMAT_DEPTH24UNORM_STENCIL8 = 17; -Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8 = 18; -Constants.TEXTUREFORMAT_STENCIL8 = 19; -Constants.TEXTUREFORMAT_UNDEFINED = 4294967295; -Constants.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM = 36492; -Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 36493; -Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 36495; -Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 36494; -Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5 = 33779; -Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 35919; -Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3 = 33778; -Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 35918; -Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1 = 33777; -Constants.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1 = 33776; -Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 35917; -Constants.TEXTUREFORMAT_COMPRESSED_SRGB_S3TC_DXT1_EXT = 35916; -Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4 = 37808; -Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 37840; -Constants.TEXTUREFORMAT_COMPRESSED_RGB_ETC1_WEBGL = 36196; -Constants.TEXTUREFORMAT_COMPRESSED_RGB8_ETC2 = 37492; -Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_ETC2 = 37493; -Constants.TEXTUREFORMAT_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494; -Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495; -Constants.TEXTUREFORMAT_COMPRESSED_RGBA8_ETC2_EAC = 37496; -Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497; -Constants.TEXTURETYPE_UNSIGNED_BYTE = 0; -Constants.TEXTURETYPE_UNSIGNED_INT = 0; -Constants.TEXTURETYPE_FLOAT = 1; -Constants.TEXTURETYPE_HALF_FLOAT = 2; -Constants.TEXTURETYPE_BYTE = 3; -Constants.TEXTURETYPE_SHORT = 4; -Constants.TEXTURETYPE_UNSIGNED_SHORT = 5; -Constants.TEXTURETYPE_INT = 6; -Constants.TEXTURETYPE_UNSIGNED_INTEGER = 7; -Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = 8; -Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = 9; -Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = 10; -Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = 11; -Constants.TEXTURETYPE_UNSIGNED_INT_24_8 = 12; -Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = 13; -Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14; -Constants.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15; -Constants.TEXTURETYPE_UNDEFINED = 16; -Constants.TEXTURE_2D = 3553; -Constants.TEXTURE_2D_ARRAY = 35866; -Constants.TEXTURE_CUBE_MAP = 34067; -Constants.TEXTURE_CUBE_MAP_ARRAY = 3735928559; -Constants.TEXTURE_3D = 32879; -Constants.TEXTURE_NEAREST_SAMPLINGMODE = 1; -Constants.TEXTURE_NEAREST_NEAREST = 1; -Constants.TEXTURE_BILINEAR_SAMPLINGMODE = 2; -Constants.TEXTURE_LINEAR_LINEAR = 2; -Constants.TEXTURE_TRILINEAR_SAMPLINGMODE = 3; -Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3; -Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4; -Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5; -Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6; -Constants.TEXTURE_NEAREST_LINEAR = 7; -Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 8; -Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9; -Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10; -Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 11; -Constants.TEXTURE_LINEAR_NEAREST = 12; -Constants.TEXTURE_EXPLICIT_MODE = 0; -Constants.TEXTURE_SPHERICAL_MODE = 1; -Constants.TEXTURE_PLANAR_MODE = 2; -Constants.TEXTURE_CUBIC_MODE = 3; -Constants.TEXTURE_PROJECTION_MODE = 4; -Constants.TEXTURE_SKYBOX_MODE = 5; -Constants.TEXTURE_INVCUBIC_MODE = 6; -Constants.TEXTURE_EQUIRECTANGULAR_MODE = 7; -Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8; -Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9; -Constants.TEXTURE_FILTERING_QUALITY_OFFLINE = 4096; -Constants.TEXTURE_FILTERING_QUALITY_HIGH = 64; -Constants.TEXTURE_FILTERING_QUALITY_MEDIUM = 16; -Constants.TEXTURE_FILTERING_QUALITY_LOW = 8; -Constants.SCALEMODE_FLOOR = 1; -Constants.SCALEMODE_NEAREST = 2; -Constants.SCALEMODE_CEILING = 3; -Constants.MATERIAL_TextureDirtyFlag = 1; -Constants.MATERIAL_LightDirtyFlag = 2; -Constants.MATERIAL_FresnelDirtyFlag = 4; -Constants.MATERIAL_AttributesDirtyFlag = 8; -Constants.MATERIAL_MiscDirtyFlag = 16; -Constants.MATERIAL_PrePassDirtyFlag = 32; -Constants.MATERIAL_AllDirtyFlag = 63; -Constants.MATERIAL_TriangleFillMode = 0; -Constants.MATERIAL_WireFrameFillMode = 1; -Constants.MATERIAL_PointFillMode = 2; -Constants.MATERIAL_PointListDrawMode = 3; -Constants.MATERIAL_LineListDrawMode = 4; -Constants.MATERIAL_LineLoopDrawMode = 5; -Constants.MATERIAL_LineStripDrawMode = 6; -Constants.MATERIAL_TriangleStripDrawMode = 7; -Constants.MATERIAL_TriangleFanDrawMode = 8; -Constants.MATERIAL_ClockWiseSideOrientation = 0; -Constants.MATERIAL_CounterClockWiseSideOrientation = 1; -Constants.ACTION_NothingTrigger = 0; -Constants.ACTION_OnPickTrigger = 1; -Constants.ACTION_OnLeftPickTrigger = 2; -Constants.ACTION_OnRightPickTrigger = 3; -Constants.ACTION_OnCenterPickTrigger = 4; -Constants.ACTION_OnPickDownTrigger = 5; -Constants.ACTION_OnDoublePickTrigger = 6; -Constants.ACTION_OnPickUpTrigger = 7; -Constants.ACTION_OnPickOutTrigger = 16; -Constants.ACTION_OnLongPressTrigger = 8; -Constants.ACTION_OnPointerOverTrigger = 9; -Constants.ACTION_OnPointerOutTrigger = 10; -Constants.ACTION_OnEveryFrameTrigger = 11; -Constants.ACTION_OnIntersectionEnterTrigger = 12; -Constants.ACTION_OnIntersectionExitTrigger = 13; -Constants.ACTION_OnKeyDownTrigger = 14; -Constants.ACTION_OnKeyUpTrigger = 15; -Constants.PARTICLES_BILLBOARDMODE_Y = 2; -Constants.PARTICLES_BILLBOARDMODE_ALL = 7; -Constants.PARTICLES_BILLBOARDMODE_STRETCHED = 8; -Constants.PARTICLES_BILLBOARDMODE_STRETCHED_LOCAL = 9; -Constants.MESHES_CULLINGSTRATEGY_STANDARD = 0; -Constants.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = 1; -Constants.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION = 2; -Constants.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY = 3; -Constants.SCENELOADER_NO_LOGGING = 0; -Constants.SCENELOADER_MINIMAL_LOGGING = 1; -Constants.SCENELOADER_SUMMARY_LOGGING = 2; -Constants.SCENELOADER_DETAILED_LOGGING = 3; -Constants.PREPASS_IRRADIANCE_TEXTURE_TYPE = 0; -Constants.PREPASS_POSITION_TEXTURE_TYPE = 1; -Constants.PREPASS_VELOCITY_TEXTURE_TYPE = 2; -Constants.PREPASS_REFLECTIVITY_TEXTURE_TYPE = 3; -Constants.PREPASS_COLOR_TEXTURE_TYPE = 4; -Constants.PREPASS_DEPTH_TEXTURE_TYPE = 5; -Constants.PREPASS_NORMAL_TEXTURE_TYPE = 6; -Constants.PREPASS_ALBEDO_SQRT_TEXTURE_TYPE = 7; -Constants.BUFFER_CREATIONFLAG_READ = 1; -Constants.BUFFER_CREATIONFLAG_WRITE = 2; -Constants.BUFFER_CREATIONFLAG_READWRITE = 3; -Constants.BUFFER_CREATIONFLAG_UNIFORM = 4; -Constants.BUFFER_CREATIONFLAG_VERTEX = 8; -Constants.BUFFER_CREATIONFLAG_INDEX = 16; -Constants.BUFFER_CREATIONFLAG_STORAGE = 32; -Constants.RENDERPASS_MAIN = 0; -Constants.INPUT_ALT_KEY = 18; -Constants.INPUT_CTRL_KEY = 17; -Constants.INPUT_META_KEY1 = 91; -Constants.INPUT_META_KEY2 = 92; -Constants.INPUT_META_KEY3 = 93; -Constants.INPUT_SHIFT_KEY = 16; -Constants.SNAPSHOTRENDERING_STANDARD = 0; -Constants.SNAPSHOTRENDERING_FAST = 1; -Constants.PERSPECTIVE_CAMERA = 0; -Constants.ORTHOGRAPHIC_CAMERA = 1; -Constants.FOVMODE_VERTICAL_FIXED = 0; -Constants.FOVMODE_HORIZONTAL_FIXED = 1; -Constants.RIG_MODE_NONE = 0; -Constants.RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10; -Constants.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11; -Constants.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12; -Constants.RIG_MODE_STEREOSCOPIC_OVERUNDER = 13; -Constants.RIG_MODE_STEREOSCOPIC_INTERLACED = 14; -Constants.RIG_MODE_VR = 20; -Constants.RIG_MODE_CUSTOM = 22; -Constants.MAX_SUPPORTED_UV_SETS = 6; -Constants.GL_ALPHA_EQUATION_ADD = 32774; -Constants.GL_ALPHA_EQUATION_MIN = 32775; -Constants.GL_ALPHA_EQUATION_MAX = 32776; -Constants.GL_ALPHA_EQUATION_SUBTRACT = 32778; -Constants.GL_ALPHA_EQUATION_REVERSE_SUBTRACT = 32779; -Constants.GL_ALPHA_FUNCTION_SRC = 768; -Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR = 769; -Constants.GL_ALPHA_FUNCTION_SRC_ALPHA = 770; -Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA = 771; -Constants.GL_ALPHA_FUNCTION_DST_ALPHA = 772; -Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_ALPHA = 773; -Constants.GL_ALPHA_FUNCTION_DST_COLOR = 774; -Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_COLOR = 775; -Constants.GL_ALPHA_FUNCTION_SRC_ALPHA_SATURATED = 776; -Constants.GL_ALPHA_FUNCTION_CONSTANT_COLOR = 32769; -Constants.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_COLOR = 32770; -Constants.GL_ALPHA_FUNCTION_CONSTANT_ALPHA = 32771; -Constants.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_ALPHA = 32772; -Constants.SnippetUrl = "https://snippet.babylonjs.com"; -// node_modules/@babylonjs/core/Engines/Extensions/engine.debugging.js -ThinEngine.prototype._debugPushGroup = function(groupName, targetObject) { -}; -ThinEngine.prototype._debugPopGroup = function(targetObject) { -}; -ThinEngine.prototype._debugInsertMarker = function(text, targetObject) { -}; -ThinEngine.prototype._debugFlushPendingCommands = function() { -}; -// node_modules/@babylonjs/core/Instrumentation/timeToken.js -class _TimeToken { - constructor() { - this._timeElapsedQueryEnded = false; - } -} +var init_skeletonViewer = __esm(() => { + init_math_vector(); + init_math_color(); + init_mesh(); + init_linesBuilder(); + init_utilityLayerRenderer(); + init_material(); + init_shaderMaterial(); + init_dynamicTexture(); + init_buffer(); + init_effect(); + init_sphereBuilder(); + init_shapeBuilder(); + init_transformNode(); + SkeletonViewer.DISPLAY_LINES = 0; + SkeletonViewer.DISPLAY_SPHERES = 1; + SkeletonViewer.DISPLAY_SPHERE_AND_SPURS = 2; +}); -// node_modules/@babylonjs/core/Engines/Extensions/engine.query.js -class _OcclusionDataStorage { - constructor() { - this.occlusionInternalRetryCounter = 0; - this.isOcclusionQueryInProgress = false; - this.isOccluded = false; - this.occlusionRetryCount = -1; - this.occlusionType = AbstractMesh.OCCLUSION_TYPE_NONE; - this.occlusionQueryAlgorithmType = AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE; - this.forceRenderingWhenOccluded = false; - } -} -Engine2.prototype.createQuery = function() { - const query = this._gl.createQuery(); - if (!query) { - throw new Error("Unable to create Occlusion Query"); - } - return query; -}; -Engine2.prototype.deleteQuery = function(query) { - this._gl.deleteQuery(query); - return this; -}; -Engine2.prototype.isQueryResultAvailable = function(query) { - return this._gl.getQueryParameter(query, this._gl.QUERY_RESULT_AVAILABLE); -}; -Engine2.prototype.getQueryResult = function(query) { - return this._gl.getQueryParameter(query, this._gl.QUERY_RESULT); -}; -Engine2.prototype.beginOcclusionQuery = function(algorithmType, query) { - const glAlgorithm = this._getGlAlgorithmType(algorithmType); - this._gl.beginQuery(glAlgorithm, query); - return true; -}; -Engine2.prototype.endOcclusionQuery = function(algorithmType) { - const glAlgorithm = this._getGlAlgorithmType(algorithmType); - this._gl.endQuery(glAlgorithm); - return this; -}; -Engine2.prototype._createTimeQuery = function() { - const timerQuery = this.getCaps().timerQuery; - if (timerQuery.createQueryEXT) { - return timerQuery.createQueryEXT(); - } - return this.createQuery(); -}; -Engine2.prototype._deleteTimeQuery = function(query) { - const timerQuery = this.getCaps().timerQuery; - if (timerQuery.deleteQueryEXT) { - timerQuery.deleteQueryEXT(query); - return; - } - this.deleteQuery(query); -}; -Engine2.prototype._getTimeQueryResult = function(query) { - const timerQuery = this.getCaps().timerQuery; - if (timerQuery.getQueryObjectEXT) { - return timerQuery.getQueryObjectEXT(query, timerQuery.QUERY_RESULT_EXT); - } - return this.getQueryResult(query); -}; -Engine2.prototype._getTimeQueryAvailability = function(query) { - const timerQuery = this.getCaps().timerQuery; - if (timerQuery.getQueryObjectEXT) { - return timerQuery.getQueryObjectEXT(query, timerQuery.QUERY_RESULT_AVAILABLE_EXT); - } - return this.isQueryResultAvailable(query); -}; -Engine2.prototype.startTimeQuery = function() { - const caps = this.getCaps(); - const timerQuery = caps.timerQuery; - if (!timerQuery) { - return null; +// node_modules/@babylonjs/core/Debug/ISkeletonViewer.js +var init_ISkeletonViewer = __esm(() => { +}); + +// node_modules/@babylonjs/core/Debug/directionalLightFrustumViewer.js +class DirectionalLightFrustumViewer { + get transparency() { + return this._transparency; } - const token = new _TimeToken; - this._gl.getParameter(timerQuery.GPU_DISJOINT_EXT); - if (caps.canUseTimestampForTimerQuery) { - token._startTimeQuery = this._createTimeQuery(); - timerQuery.queryCounterEXT(token._startTimeQuery, timerQuery.TIMESTAMP_EXT); - } else { - if (this._currentNonTimestampToken) { - return this._currentNonTimestampToken; - } - token._timeElapsedQuery = this._createTimeQuery(); - if (timerQuery.beginQueryEXT) { - timerQuery.beginQueryEXT(timerQuery.TIME_ELAPSED_EXT, token._timeElapsedQuery); - } else { - this._gl.beginQuery(timerQuery.TIME_ELAPSED_EXT, token._timeElapsedQuery); + set transparency(alpha) { + this._transparency = alpha; + for (let i = 6;i < 12; ++i) { + this._lightHelperFrustumMeshes[i].material.alpha = alpha; } - this._currentNonTimestampToken = token; } - return token; -}; -Engine2.prototype.endTimeQuery = function(token) { - const caps = this.getCaps(); - const timerQuery = caps.timerQuery; - if (!timerQuery || !token) { - return -1; + get showLines() { + return this._showLines; } - if (caps.canUseTimestampForTimerQuery) { - if (!token._startTimeQuery) { - return -1; - } - if (!token._endTimeQuery) { - token._endTimeQuery = this._createTimeQuery(); - timerQuery.queryCounterEXT(token._endTimeQuery, timerQuery.TIMESTAMP_EXT); - } - } else if (!token._timeElapsedQueryEnded) { - if (!token._timeElapsedQuery) { - return -1; + set showLines(show) { + if (this._showLines === show) { + return; } - if (timerQuery.endQueryEXT) { - timerQuery.endQueryEXT(timerQuery.TIME_ELAPSED_EXT); - } else { - this._gl.endQuery(timerQuery.TIME_ELAPSED_EXT); - this._currentNonTimestampToken = null; + this._showLines = show; + for (let i = 0;i < 6; ++i) { + this._lightHelperFrustumMeshes[i].setEnabled(show); } - token._timeElapsedQueryEnded = true; } - const disjoint = this._gl.getParameter(timerQuery.GPU_DISJOINT_EXT); - let available = false; - if (token._endTimeQuery) { - available = this._getTimeQueryAvailability(token._endTimeQuery); - } else if (token._timeElapsedQuery) { - available = this._getTimeQueryAvailability(token._timeElapsedQuery); + get showPlanes() { + return this._showPlanes; } - if (available && !disjoint) { - let result = 0; - if (caps.canUseTimestampForTimerQuery) { - if (!token._startTimeQuery || !token._endTimeQuery) { - return -1; - } - const timeStart = this._getTimeQueryResult(token._startTimeQuery); - const timeEnd = this._getTimeQueryResult(token._endTimeQuery); - result = timeEnd - timeStart; - this._deleteTimeQuery(token._startTimeQuery); - this._deleteTimeQuery(token._endTimeQuery); - token._startTimeQuery = null; - token._endTimeQuery = null; - } else { - if (!token._timeElapsedQuery) { - return -1; - } - result = this._getTimeQueryResult(token._timeElapsedQuery); - this._deleteTimeQuery(token._timeElapsedQuery); - token._timeElapsedQuery = null; - token._timeElapsedQueryEnded = false; + set showPlanes(show) { + if (this._showPlanes === show) { + return; + } + this._showPlanes = show; + for (let i = 6;i < 12; ++i) { + this._lightHelperFrustumMeshes[i].setEnabled(show); } - return result; } - return -1; -}; -Engine2.prototype._captureGPUFrameTime = false; -Engine2.prototype._gpuFrameTime = new PerfCounter; -Engine2.prototype.getGPUFrameTimeCounter = function() { - return this._gpuFrameTime; -}; -Engine2.prototype.captureGPUFrameTime = function(value) { - if (value === this._captureGPUFrameTime) { - return; + constructor(light4, camera25) { + this._oldPosition = new Vector3(Number.NaN, Number.NaN, Number.NaN); + this._oldDirection = new Vector3(Number.NaN, Number.NaN, Number.NaN); + this._transparency = 0.3; + this._showLines = true; + this._showPlanes = true; + this._scene = light4.getScene(); + this._light = light4; + this._camera = camera25; + this._inverseViewMatrix = Matrix.Identity(); + this._lightHelperFrustumMeshes = []; + this._createGeometry(); + this.show(); + this.update(); } - this._captureGPUFrameTime = value; - if (value) { - this._onBeginFrameObserver = this.onBeginFrameObservable.add(() => { - if (!this._gpuFrameTimeToken) { - this._gpuFrameTimeToken = this.startTimeQuery(); - } + show() { + this._lightHelperFrustumMeshes.forEach((mesh37, index) => { + mesh37.setEnabled(index < 6 && this._showLines || index >= 6 && this._showPlanes); }); - this._onEndFrameObserver = this.onEndFrameObservable.add(() => { - if (!this._gpuFrameTimeToken) { - return; - } - const time = this.endTimeQuery(this._gpuFrameTimeToken); - if (time > -1) { - this._gpuFrameTimeToken = null; - this._gpuFrameTime.fetchNewFrame(); - this._gpuFrameTime.addCount(time, true); - } + this._oldPosition.set(Number.NaN, Number.NaN, Number.NaN); + this._visible = true; + } + hide() { + this._lightHelperFrustumMeshes.forEach((mesh37) => { + mesh37.setEnabled(false); }); - } else { - this.onBeginFrameObservable.remove(this._onBeginFrameObserver); - this._onBeginFrameObserver = null; - this.onEndFrameObservable.remove(this._onEndFrameObserver); - this._onEndFrameObserver = null; + this._visible = false; } -}; -Engine2.prototype._getGlAlgorithmType = function(algorithmType) { - return algorithmType === AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED; -}; -Object.defineProperty(AbstractMesh.prototype, "isOcclusionQueryInProgress", { - get: function() { - return this._occlusionDataStorage.isOcclusionQueryInProgress; - }, - set: function(value) { - this._occlusionDataStorage.isOcclusionQueryInProgress = value; - }, - enumerable: false, - configurable: true + update() { + var _a, _b, _c, _d, _e, _f; + if (!this._visible) { + return; + } + if (this._oldPosition.equals(this._light.position) && this._oldDirection.equals(this._light.direction) && this._oldAutoCalc === this._light.autoCalcShadowZBounds && this._oldMinZ === this._light.shadowMinZ && this._oldMaxZ === this._light.shadowMaxZ) { + return; + } + this._oldPosition.copyFrom(this._light.position); + this._oldDirection.copyFrom(this._light.direction); + this._oldAutoCalc = this._light.autoCalcShadowZBounds; + this._oldMinZ = this._light.shadowMinZ; + this._oldMaxZ = this._light.shadowMaxZ; + TmpVectors.Vector3[0].set(this._light.orthoLeft, this._light.orthoBottom, this._light.shadowMinZ !== undefined ? this._light.shadowMinZ : this._camera.minZ); + TmpVectors.Vector3[1].set(this._light.orthoRight, this._light.orthoTop, this._light.shadowMaxZ !== undefined ? this._light.shadowMaxZ : this._camera.maxZ); + const invLightView = this._getInvertViewMatrix(); + TmpVectors.Vector3[2].copyFromFloats(TmpVectors.Vector3[1].x, TmpVectors.Vector3[1].y, TmpVectors.Vector3[0].z); + TmpVectors.Vector3[3].copyFromFloats(TmpVectors.Vector3[1].x, TmpVectors.Vector3[0].y, TmpVectors.Vector3[0].z); + TmpVectors.Vector3[4].copyFromFloats(TmpVectors.Vector3[0].x, TmpVectors.Vector3[0].y, TmpVectors.Vector3[0].z); + TmpVectors.Vector3[5].copyFromFloats(TmpVectors.Vector3[0].x, TmpVectors.Vector3[1].y, TmpVectors.Vector3[0].z); + Vector3.TransformCoordinatesToRef(TmpVectors.Vector3[2], invLightView, TmpVectors.Vector3[2]); + Vector3.TransformCoordinatesToRef(TmpVectors.Vector3[3], invLightView, TmpVectors.Vector3[3]); + Vector3.TransformCoordinatesToRef(TmpVectors.Vector3[4], invLightView, TmpVectors.Vector3[4]); + Vector3.TransformCoordinatesToRef(TmpVectors.Vector3[5], invLightView, TmpVectors.Vector3[5]); + TmpVectors.Vector3[6].copyFromFloats(TmpVectors.Vector3[1].x, TmpVectors.Vector3[1].y, TmpVectors.Vector3[1].z); + TmpVectors.Vector3[7].copyFromFloats(TmpVectors.Vector3[1].x, TmpVectors.Vector3[0].y, TmpVectors.Vector3[1].z); + TmpVectors.Vector3[8].copyFromFloats(TmpVectors.Vector3[0].x, TmpVectors.Vector3[0].y, TmpVectors.Vector3[1].z); + TmpVectors.Vector3[9].copyFromFloats(TmpVectors.Vector3[0].x, TmpVectors.Vector3[1].y, TmpVectors.Vector3[1].z); + Vector3.TransformCoordinatesToRef(TmpVectors.Vector3[6], invLightView, TmpVectors.Vector3[6]); + Vector3.TransformCoordinatesToRef(TmpVectors.Vector3[7], invLightView, TmpVectors.Vector3[7]); + Vector3.TransformCoordinatesToRef(TmpVectors.Vector3[8], invLightView, TmpVectors.Vector3[8]); + Vector3.TransformCoordinatesToRef(TmpVectors.Vector3[9], invLightView, TmpVectors.Vector3[9]); + CreateLines("nearlines", { updatable: true, points: this._nearLinesPoints, instance: this._lightHelperFrustumMeshes[0] }, this._scene); + CreateLines("farlines", { updatable: true, points: this._farLinesPoints, instance: this._lightHelperFrustumMeshes[1] }, this._scene); + CreateLines("trlines", { updatable: true, points: this._trLinesPoints, instance: this._lightHelperFrustumMeshes[2] }, this._scene); + CreateLines("brlines", { updatable: true, points: this._brLinesPoints, instance: this._lightHelperFrustumMeshes[3] }, this._scene); + CreateLines("tllines", { updatable: true, points: this._tlLinesPoints, instance: this._lightHelperFrustumMeshes[4] }, this._scene); + CreateLines("bllines", { updatable: true, points: this._blLinesPoints, instance: this._lightHelperFrustumMeshes[5] }, this._scene); + TmpVectors.Vector3[2].toArray(this._nearPlaneVertices, 0); + TmpVectors.Vector3[3].toArray(this._nearPlaneVertices, 3); + TmpVectors.Vector3[4].toArray(this._nearPlaneVertices, 6); + TmpVectors.Vector3[5].toArray(this._nearPlaneVertices, 9); + (_a = this._lightHelperFrustumMeshes[6].geometry) === null || _a === undefined || _a.updateVerticesDataDirectly("position", this._nearPlaneVertices, 0); + TmpVectors.Vector3[6].toArray(this._farPlaneVertices, 0); + TmpVectors.Vector3[7].toArray(this._farPlaneVertices, 3); + TmpVectors.Vector3[8].toArray(this._farPlaneVertices, 6); + TmpVectors.Vector3[9].toArray(this._farPlaneVertices, 9); + (_b = this._lightHelperFrustumMeshes[7].geometry) === null || _b === undefined || _b.updateVerticesDataDirectly("position", this._farPlaneVertices, 0); + TmpVectors.Vector3[2].toArray(this._rightPlaneVertices, 0); + TmpVectors.Vector3[6].toArray(this._rightPlaneVertices, 3); + TmpVectors.Vector3[7].toArray(this._rightPlaneVertices, 6); + TmpVectors.Vector3[3].toArray(this._rightPlaneVertices, 9); + (_c = this._lightHelperFrustumMeshes[8].geometry) === null || _c === undefined || _c.updateVerticesDataDirectly("position", this._rightPlaneVertices, 0); + TmpVectors.Vector3[5].toArray(this._leftPlaneVertices, 0); + TmpVectors.Vector3[9].toArray(this._leftPlaneVertices, 3); + TmpVectors.Vector3[8].toArray(this._leftPlaneVertices, 6); + TmpVectors.Vector3[4].toArray(this._leftPlaneVertices, 9); + (_d = this._lightHelperFrustumMeshes[9].geometry) === null || _d === undefined || _d.updateVerticesDataDirectly("position", this._leftPlaneVertices, 0); + TmpVectors.Vector3[2].toArray(this._topPlaneVertices, 0); + TmpVectors.Vector3[6].toArray(this._topPlaneVertices, 3); + TmpVectors.Vector3[9].toArray(this._topPlaneVertices, 6); + TmpVectors.Vector3[5].toArray(this._topPlaneVertices, 9); + (_e = this._lightHelperFrustumMeshes[10].geometry) === null || _e === undefined || _e.updateVerticesDataDirectly("position", this._topPlaneVertices, 0); + TmpVectors.Vector3[3].toArray(this._bottomPlaneVertices, 0); + TmpVectors.Vector3[7].toArray(this._bottomPlaneVertices, 3); + TmpVectors.Vector3[8].toArray(this._bottomPlaneVertices, 6); + TmpVectors.Vector3[4].toArray(this._bottomPlaneVertices, 9); + (_f = this._lightHelperFrustumMeshes[11].geometry) === null || _f === undefined || _f.updateVerticesDataDirectly("position", this._bottomPlaneVertices, 0); + } + dispose() { + this._lightHelperFrustumMeshes.forEach((mesh37) => { + var _a; + (_a = mesh37.material) === null || _a === undefined || _a.dispose(); + mesh37.dispose(); + }); + this._rootNode.dispose(); + } + _createGeometry() { + this._rootNode = new TransformNode("directionalLightHelperRoot_" + this._light.name, this._scene); + this._rootNode.parent = this._light.parent; + this._nearLinesPoints = [Vector3.ZeroReadOnly, Vector3.ZeroReadOnly, Vector3.ZeroReadOnly, Vector3.ZeroReadOnly, Vector3.ZeroReadOnly]; + const nearLines = CreateLines("nearlines", { updatable: true, points: this._nearLinesPoints }, this._scene); + nearLines.parent = this._rootNode; + nearLines.alwaysSelectAsActiveMesh = true; + this._farLinesPoints = [Vector3.ZeroReadOnly, Vector3.ZeroReadOnly, Vector3.ZeroReadOnly, Vector3.ZeroReadOnly, Vector3.ZeroReadOnly]; + const farLines = CreateLines("farlines", { updatable: true, points: this._farLinesPoints }, this._scene); + farLines.parent = this._rootNode; + farLines.alwaysSelectAsActiveMesh = true; + this._trLinesPoints = [Vector3.ZeroReadOnly, Vector3.ZeroReadOnly]; + const trLines = CreateLines("trlines", { updatable: true, points: this._trLinesPoints }, this._scene); + trLines.parent = this._rootNode; + trLines.alwaysSelectAsActiveMesh = true; + this._brLinesPoints = [Vector3.ZeroReadOnly, Vector3.ZeroReadOnly]; + const brLines = CreateLines("brlines", { updatable: true, points: this._brLinesPoints }, this._scene); + brLines.parent = this._rootNode; + brLines.alwaysSelectAsActiveMesh = true; + this._tlLinesPoints = [Vector3.ZeroReadOnly, Vector3.ZeroReadOnly]; + const tlLines = CreateLines("tllines", { updatable: true, points: this._tlLinesPoints }, this._scene); + tlLines.parent = this._rootNode; + tlLines.alwaysSelectAsActiveMesh = true; + this._blLinesPoints = [Vector3.ZeroReadOnly, Vector3.ZeroReadOnly]; + const blLines = CreateLines("bllines", { updatable: true, points: this._blLinesPoints }, this._scene); + blLines.parent = this._rootNode; + blLines.alwaysSelectAsActiveMesh = true; + this._lightHelperFrustumMeshes.push(nearLines, farLines, trLines, brLines, tlLines, blLines); + const makePlane = (name75, color, positions) => { + const plane = new Mesh(name75 + "plane", this._scene); + const mat = new StandardMaterial(name75 + "PlaneMat", this._scene); + plane.material = mat; + plane.parent = this._rootNode; + plane.alwaysSelectAsActiveMesh = true; + mat.emissiveColor = color; + mat.alpha = this.transparency; + mat.backFaceCulling = false; + mat.disableLighting = true; + const indices = [0, 1, 2, 0, 2, 3]; + const vertexData = new VertexData; + vertexData.positions = positions; + vertexData.indices = indices; + vertexData.applyToMesh(plane, true); + this._lightHelperFrustumMeshes.push(plane); + }; + this._nearPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + this._farPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + this._rightPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + this._leftPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + this._topPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + this._bottomPlaneVertices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + makePlane("near", new Color3(1, 0, 0), this._nearPlaneVertices); + makePlane("far", new Color3(0.3, 0, 0), this._farPlaneVertices); + makePlane("right", new Color3(0, 1, 0), this._rightPlaneVertices); + makePlane("left", new Color3(0, 0.3, 0), this._leftPlaneVertices); + makePlane("top", new Color3(0, 0, 1), this._topPlaneVertices); + makePlane("bottom", new Color3(0, 0, 0.3), this._bottomPlaneVertices); + this._nearLinesPoints[0] = TmpVectors.Vector3[2]; + this._nearLinesPoints[1] = TmpVectors.Vector3[3]; + this._nearLinesPoints[2] = TmpVectors.Vector3[4]; + this._nearLinesPoints[3] = TmpVectors.Vector3[5]; + this._nearLinesPoints[4] = TmpVectors.Vector3[2]; + this._farLinesPoints[0] = TmpVectors.Vector3[6]; + this._farLinesPoints[1] = TmpVectors.Vector3[7]; + this._farLinesPoints[2] = TmpVectors.Vector3[8]; + this._farLinesPoints[3] = TmpVectors.Vector3[9]; + this._farLinesPoints[4] = TmpVectors.Vector3[6]; + this._trLinesPoints[0] = TmpVectors.Vector3[2]; + this._trLinesPoints[1] = TmpVectors.Vector3[6]; + this._brLinesPoints[0] = TmpVectors.Vector3[3]; + this._brLinesPoints[1] = TmpVectors.Vector3[7]; + this._tlLinesPoints[0] = TmpVectors.Vector3[4]; + this._tlLinesPoints[1] = TmpVectors.Vector3[8]; + this._blLinesPoints[0] = TmpVectors.Vector3[5]; + this._blLinesPoints[1] = TmpVectors.Vector3[9]; + } + _getInvertViewMatrix() { + Matrix.LookAtLHToRef(this._light.position, this._light.position.add(this._light.direction), Vector3.UpReadOnly, this._inverseViewMatrix); + this._inverseViewMatrix.invertToRef(this._inverseViewMatrix); + return this._inverseViewMatrix; + } +} +var init_directionalLightFrustumViewer = __esm(() => { + init_standardMaterial(); + init_math_color(); + init_math_vector(); + init_linesBuilder(); + init_mesh(); + init_mesh_vertexData(); + init_transformNode(); }); -Object.defineProperty(AbstractMesh.prototype, "_occlusionDataStorage", { - get: function() { - if (!this.__occlusionDataStorage) { - this.__occlusionDataStorage = new _OcclusionDataStorage; - } - return this.__occlusionDataStorage; - }, - enumerable: false, - configurable: true + +// node_modules/@babylonjs/core/Debug/index.js +var init_Debug = __esm(() => { + init_axesViewer(); + init_boneAxesViewer(); + init_debugLayer(); + init_physicsViewer(); + init_rayHelper(); + init_skeletonViewer(); + init_ISkeletonViewer(); + init_directionalLightFrustumViewer(); }); -Object.defineProperty(AbstractMesh.prototype, "isOccluded", { - get: function() { - return this._occlusionDataStorage.isOccluded; - }, - set: function(value) { - this._occlusionDataStorage.isOccluded = value; - }, - enumerable: true, - configurable: true + +// node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceTypes.js +var init_deviceTypes = __esm(() => { }); -Object.defineProperty(AbstractMesh.prototype, "occlusionQueryAlgorithmType", { - get: function() { - return this._occlusionDataStorage.occlusionQueryAlgorithmType; - }, - set: function(value) { - this._occlusionDataStorage.occlusionQueryAlgorithmType = value; - }, - enumerable: true, - configurable: true + +// node_modules/@babylonjs/core/DeviceInput/index.js +var init_DeviceInput = __esm(() => { + init_deviceEnums(); + init_deviceTypes(); + init_deviceSource(); + init_deviceSourceManager(); }); -Object.defineProperty(AbstractMesh.prototype, "occlusionType", { - get: function() { - return this._occlusionDataStorage.occlusionType; - }, - set: function(value) { - this._occlusionDataStorage.occlusionType = value; - }, - enumerable: true, - configurable: true + +// node_modules/@babylonjs/core/Engines/constants.js +class Constants { +} +var init_constants = __esm(() => { + Constants.ALPHA_DISABLE = 0; + Constants.ALPHA_ADD = 1; + Constants.ALPHA_COMBINE = 2; + Constants.ALPHA_SUBTRACT = 3; + Constants.ALPHA_MULTIPLY = 4; + Constants.ALPHA_MAXIMIZED = 5; + Constants.ALPHA_ONEONE = 6; + Constants.ALPHA_PREMULTIPLIED = 7; + Constants.ALPHA_PREMULTIPLIED_PORTERDUFF = 8; + Constants.ALPHA_INTERPOLATE = 9; + Constants.ALPHA_SCREENMODE = 10; + Constants.ALPHA_ONEONE_ONEONE = 11; + Constants.ALPHA_ALPHATOCOLOR = 12; + Constants.ALPHA_REVERSEONEMINUS = 13; + Constants.ALPHA_SRC_DSTONEMINUSSRCALPHA = 14; + Constants.ALPHA_ONEONE_ONEZERO = 15; + Constants.ALPHA_EXCLUSION = 16; + Constants.ALPHA_LAYER_ACCUMULATE = 17; + Constants.ALPHA_EQUATION_ADD = 0; + Constants.ALPHA_EQUATION_SUBSTRACT = 1; + Constants.ALPHA_EQUATION_REVERSE_SUBTRACT = 2; + Constants.ALPHA_EQUATION_MAX = 3; + Constants.ALPHA_EQUATION_MIN = 4; + Constants.ALPHA_EQUATION_DARKEN = 5; + Constants.DELAYLOADSTATE_NONE = 0; + Constants.DELAYLOADSTATE_LOADED = 1; + Constants.DELAYLOADSTATE_LOADING = 2; + Constants.DELAYLOADSTATE_NOTLOADED = 4; + Constants.NEVER = 512; + Constants.ALWAYS = 519; + Constants.LESS = 513; + Constants.EQUAL = 514; + Constants.LEQUAL = 515; + Constants.GREATER = 516; + Constants.GEQUAL = 518; + Constants.NOTEQUAL = 517; + Constants.KEEP = 7680; + Constants.ZERO = 0; + Constants.REPLACE = 7681; + Constants.INCR = 7682; + Constants.DECR = 7683; + Constants.INVERT = 5386; + Constants.INCR_WRAP = 34055; + Constants.DECR_WRAP = 34056; + Constants.TEXTURE_CLAMP_ADDRESSMODE = 0; + Constants.TEXTURE_WRAP_ADDRESSMODE = 1; + Constants.TEXTURE_MIRROR_ADDRESSMODE = 2; + Constants.TEXTURE_CREATIONFLAG_STORAGE = 1; + Constants.TEXTUREFORMAT_ALPHA = 0; + Constants.TEXTUREFORMAT_LUMINANCE = 1; + Constants.TEXTUREFORMAT_LUMINANCE_ALPHA = 2; + Constants.TEXTUREFORMAT_RGB = 4; + Constants.TEXTUREFORMAT_RGBA = 5; + Constants.TEXTUREFORMAT_RED = 6; + Constants.TEXTUREFORMAT_R = 6; + Constants.TEXTUREFORMAT_RG = 7; + Constants.TEXTUREFORMAT_RED_INTEGER = 8; + Constants.TEXTUREFORMAT_R_INTEGER = 8; + Constants.TEXTUREFORMAT_RG_INTEGER = 9; + Constants.TEXTUREFORMAT_RGB_INTEGER = 10; + Constants.TEXTUREFORMAT_RGBA_INTEGER = 11; + Constants.TEXTUREFORMAT_BGRA = 12; + Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 = 13; + Constants.TEXTUREFORMAT_DEPTH32_FLOAT = 14; + Constants.TEXTUREFORMAT_DEPTH16 = 15; + Constants.TEXTUREFORMAT_DEPTH24 = 16; + Constants.TEXTUREFORMAT_DEPTH24UNORM_STENCIL8 = 17; + Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8 = 18; + Constants.TEXTUREFORMAT_STENCIL8 = 19; + Constants.TEXTUREFORMAT_UNDEFINED = 4294967295; + Constants.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM = 36492; + Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 36493; + Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 36495; + Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 36494; + Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5 = 33779; + Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 35919; + Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3 = 33778; + Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 35918; + Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1 = 33777; + Constants.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1 = 33776; + Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 35917; + Constants.TEXTUREFORMAT_COMPRESSED_SRGB_S3TC_DXT1_EXT = 35916; + Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4 = 37808; + Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 37840; + Constants.TEXTUREFORMAT_COMPRESSED_RGB_ETC1_WEBGL = 36196; + Constants.TEXTUREFORMAT_COMPRESSED_RGB8_ETC2 = 37492; + Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_ETC2 = 37493; + Constants.TEXTUREFORMAT_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494; + Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495; + Constants.TEXTUREFORMAT_COMPRESSED_RGBA8_ETC2_EAC = 37496; + Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497; + Constants.TEXTURETYPE_UNSIGNED_BYTE = 0; + Constants.TEXTURETYPE_UNSIGNED_INT = 0; + Constants.TEXTURETYPE_FLOAT = 1; + Constants.TEXTURETYPE_HALF_FLOAT = 2; + Constants.TEXTURETYPE_BYTE = 3; + Constants.TEXTURETYPE_SHORT = 4; + Constants.TEXTURETYPE_UNSIGNED_SHORT = 5; + Constants.TEXTURETYPE_INT = 6; + Constants.TEXTURETYPE_UNSIGNED_INTEGER = 7; + Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = 8; + Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = 9; + Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = 10; + Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = 11; + Constants.TEXTURETYPE_UNSIGNED_INT_24_8 = 12; + Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = 13; + Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14; + Constants.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15; + Constants.TEXTURETYPE_UNDEFINED = 16; + Constants.TEXTURE_2D = 3553; + Constants.TEXTURE_2D_ARRAY = 35866; + Constants.TEXTURE_CUBE_MAP = 34067; + Constants.TEXTURE_CUBE_MAP_ARRAY = 3735928559; + Constants.TEXTURE_3D = 32879; + Constants.TEXTURE_NEAREST_SAMPLINGMODE = 1; + Constants.TEXTURE_NEAREST_NEAREST = 1; + Constants.TEXTURE_BILINEAR_SAMPLINGMODE = 2; + Constants.TEXTURE_LINEAR_LINEAR = 2; + Constants.TEXTURE_TRILINEAR_SAMPLINGMODE = 3; + Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3; + Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4; + Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5; + Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6; + Constants.TEXTURE_NEAREST_LINEAR = 7; + Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 8; + Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9; + Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10; + Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 11; + Constants.TEXTURE_LINEAR_NEAREST = 12; + Constants.TEXTURE_EXPLICIT_MODE = 0; + Constants.TEXTURE_SPHERICAL_MODE = 1; + Constants.TEXTURE_PLANAR_MODE = 2; + Constants.TEXTURE_CUBIC_MODE = 3; + Constants.TEXTURE_PROJECTION_MODE = 4; + Constants.TEXTURE_SKYBOX_MODE = 5; + Constants.TEXTURE_INVCUBIC_MODE = 6; + Constants.TEXTURE_EQUIRECTANGULAR_MODE = 7; + Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8; + Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9; + Constants.TEXTURE_FILTERING_QUALITY_OFFLINE = 4096; + Constants.TEXTURE_FILTERING_QUALITY_HIGH = 64; + Constants.TEXTURE_FILTERING_QUALITY_MEDIUM = 16; + Constants.TEXTURE_FILTERING_QUALITY_LOW = 8; + Constants.SCALEMODE_FLOOR = 1; + Constants.SCALEMODE_NEAREST = 2; + Constants.SCALEMODE_CEILING = 3; + Constants.MATERIAL_TextureDirtyFlag = 1; + Constants.MATERIAL_LightDirtyFlag = 2; + Constants.MATERIAL_FresnelDirtyFlag = 4; + Constants.MATERIAL_AttributesDirtyFlag = 8; + Constants.MATERIAL_MiscDirtyFlag = 16; + Constants.MATERIAL_PrePassDirtyFlag = 32; + Constants.MATERIAL_AllDirtyFlag = 63; + Constants.MATERIAL_TriangleFillMode = 0; + Constants.MATERIAL_WireFrameFillMode = 1; + Constants.MATERIAL_PointFillMode = 2; + Constants.MATERIAL_PointListDrawMode = 3; + Constants.MATERIAL_LineListDrawMode = 4; + Constants.MATERIAL_LineLoopDrawMode = 5; + Constants.MATERIAL_LineStripDrawMode = 6; + Constants.MATERIAL_TriangleStripDrawMode = 7; + Constants.MATERIAL_TriangleFanDrawMode = 8; + Constants.MATERIAL_ClockWiseSideOrientation = 0; + Constants.MATERIAL_CounterClockWiseSideOrientation = 1; + Constants.ACTION_NothingTrigger = 0; + Constants.ACTION_OnPickTrigger = 1; + Constants.ACTION_OnLeftPickTrigger = 2; + Constants.ACTION_OnRightPickTrigger = 3; + Constants.ACTION_OnCenterPickTrigger = 4; + Constants.ACTION_OnPickDownTrigger = 5; + Constants.ACTION_OnDoublePickTrigger = 6; + Constants.ACTION_OnPickUpTrigger = 7; + Constants.ACTION_OnPickOutTrigger = 16; + Constants.ACTION_OnLongPressTrigger = 8; + Constants.ACTION_OnPointerOverTrigger = 9; + Constants.ACTION_OnPointerOutTrigger = 10; + Constants.ACTION_OnEveryFrameTrigger = 11; + Constants.ACTION_OnIntersectionEnterTrigger = 12; + Constants.ACTION_OnIntersectionExitTrigger = 13; + Constants.ACTION_OnKeyDownTrigger = 14; + Constants.ACTION_OnKeyUpTrigger = 15; + Constants.PARTICLES_BILLBOARDMODE_Y = 2; + Constants.PARTICLES_BILLBOARDMODE_ALL = 7; + Constants.PARTICLES_BILLBOARDMODE_STRETCHED = 8; + Constants.PARTICLES_BILLBOARDMODE_STRETCHED_LOCAL = 9; + Constants.MESHES_CULLINGSTRATEGY_STANDARD = 0; + Constants.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = 1; + Constants.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION = 2; + Constants.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY = 3; + Constants.SCENELOADER_NO_LOGGING = 0; + Constants.SCENELOADER_MINIMAL_LOGGING = 1; + Constants.SCENELOADER_SUMMARY_LOGGING = 2; + Constants.SCENELOADER_DETAILED_LOGGING = 3; + Constants.PREPASS_IRRADIANCE_TEXTURE_TYPE = 0; + Constants.PREPASS_POSITION_TEXTURE_TYPE = 1; + Constants.PREPASS_VELOCITY_TEXTURE_TYPE = 2; + Constants.PREPASS_REFLECTIVITY_TEXTURE_TYPE = 3; + Constants.PREPASS_COLOR_TEXTURE_TYPE = 4; + Constants.PREPASS_DEPTH_TEXTURE_TYPE = 5; + Constants.PREPASS_NORMAL_TEXTURE_TYPE = 6; + Constants.PREPASS_ALBEDO_SQRT_TEXTURE_TYPE = 7; + Constants.BUFFER_CREATIONFLAG_READ = 1; + Constants.BUFFER_CREATIONFLAG_WRITE = 2; + Constants.BUFFER_CREATIONFLAG_READWRITE = 3; + Constants.BUFFER_CREATIONFLAG_UNIFORM = 4; + Constants.BUFFER_CREATIONFLAG_VERTEX = 8; + Constants.BUFFER_CREATIONFLAG_INDEX = 16; + Constants.BUFFER_CREATIONFLAG_STORAGE = 32; + Constants.RENDERPASS_MAIN = 0; + Constants.INPUT_ALT_KEY = 18; + Constants.INPUT_CTRL_KEY = 17; + Constants.INPUT_META_KEY1 = 91; + Constants.INPUT_META_KEY2 = 92; + Constants.INPUT_META_KEY3 = 93; + Constants.INPUT_SHIFT_KEY = 16; + Constants.SNAPSHOTRENDERING_STANDARD = 0; + Constants.SNAPSHOTRENDERING_FAST = 1; + Constants.PERSPECTIVE_CAMERA = 0; + Constants.ORTHOGRAPHIC_CAMERA = 1; + Constants.FOVMODE_VERTICAL_FIXED = 0; + Constants.FOVMODE_HORIZONTAL_FIXED = 1; + Constants.RIG_MODE_NONE = 0; + Constants.RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10; + Constants.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11; + Constants.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12; + Constants.RIG_MODE_STEREOSCOPIC_OVERUNDER = 13; + Constants.RIG_MODE_STEREOSCOPIC_INTERLACED = 14; + Constants.RIG_MODE_VR = 20; + Constants.RIG_MODE_CUSTOM = 22; + Constants.MAX_SUPPORTED_UV_SETS = 6; + Constants.GL_ALPHA_EQUATION_ADD = 32774; + Constants.GL_ALPHA_EQUATION_MIN = 32775; + Constants.GL_ALPHA_EQUATION_MAX = 32776; + Constants.GL_ALPHA_EQUATION_SUBTRACT = 32778; + Constants.GL_ALPHA_EQUATION_REVERSE_SUBTRACT = 32779; + Constants.GL_ALPHA_FUNCTION_SRC = 768; + Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR = 769; + Constants.GL_ALPHA_FUNCTION_SRC_ALPHA = 770; + Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA = 771; + Constants.GL_ALPHA_FUNCTION_DST_ALPHA = 772; + Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_ALPHA = 773; + Constants.GL_ALPHA_FUNCTION_DST_COLOR = 774; + Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_COLOR = 775; + Constants.GL_ALPHA_FUNCTION_SRC_ALPHA_SATURATED = 776; + Constants.GL_ALPHA_FUNCTION_CONSTANT_COLOR = 32769; + Constants.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_COLOR = 32770; + Constants.GL_ALPHA_FUNCTION_CONSTANT_ALPHA = 32771; + Constants.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_ALPHA = 32772; + Constants.SnippetUrl = "https://snippet.babylonjs.com"; }); -Object.defineProperty(AbstractMesh.prototype, "occlusionRetryCount", { - get: function() { - return this._occlusionDataStorage.occlusionRetryCount; - }, - set: function(value) { - this._occlusionDataStorage.occlusionRetryCount = value; - }, - enumerable: true, - configurable: true + +// node_modules/@babylonjs/core/Engines/engineCapabilities.js +var init_engineCapabilities = __esm(() => { }); -Object.defineProperty(AbstractMesh.prototype, "forceRenderingWhenOccluded", { - get: function() { - return this._occlusionDataStorage.forceRenderingWhenOccluded; - }, - set: function(value) { - this._occlusionDataStorage.forceRenderingWhenOccluded = value; - }, - enumerable: true, - configurable: true + +// node_modules/@babylonjs/core/Engines/instancingAttributeInfo.js +var init_instancingAttributeInfo = __esm(() => { }); -AbstractMesh.prototype._checkOcclusionQuery = function() { - const dataStorage = this._occlusionDataStorage; - if (dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_NONE) { - dataStorage.isOccluded = false; - return false; + +// node_modules/@babylonjs/core/Engines/nullEngine.js +class NullEngineOptions { + constructor() { + this.renderWidth = 512; + this.renderHeight = 256; + this.textureSize = 512; + this.deterministicLockstep = false; + this.lockstepMaxSteps = 4; } - const engine21 = this.getEngine(); - if (!engine21.getCaps().supportOcclusionQuery) { - dataStorage.isOccluded = false; - return false; +} + +class NullEngine extends Engine2 { + isDeterministicLockStep() { + return this._options.deterministicLockstep; } - if (!engine21.isQueryResultAvailable) { - dataStorage.isOccluded = false; - return false; + getLockstepMaxSteps() { + return this._options.lockstepMaxSteps; } - if (this.isOcclusionQueryInProgress && this._occlusionQuery !== null && this._occlusionQuery !== undefined) { - const isOcclusionQueryAvailable = engine21.isQueryResultAvailable(this._occlusionQuery); - if (isOcclusionQueryAvailable) { - const occlusionQueryResult = engine21.getQueryResult(this._occlusionQuery); - dataStorage.isOcclusionQueryInProgress = false; - dataStorage.occlusionInternalRetryCounter = 0; - dataStorage.isOccluded = occlusionQueryResult > 0 ? false : true; - } else { - dataStorage.occlusionInternalRetryCounter++; - if (dataStorage.occlusionRetryCount !== -1 && dataStorage.occlusionInternalRetryCounter > dataStorage.occlusionRetryCount) { - dataStorage.isOcclusionQueryInProgress = false; - dataStorage.occlusionInternalRetryCounter = 0; - dataStorage.isOccluded = dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded; - } else { - return dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded; - } - } + getHardwareScalingLevel() { + return 1; } - const scene19 = this.getScene(); - if (scene19.getBoundingBoxRenderer) { - const occlusionBoundingBoxRenderer = scene19.getBoundingBoxRenderer(); - if (this._occlusionQuery === null) { - this._occlusionQuery = engine21.createQuery(); + constructor(options = new NullEngineOptions) { + super(null); + Engine2.Instances.push(this); + if (options.deterministicLockstep === undefined) { + options.deterministicLockstep = false; + } + if (options.lockstepMaxSteps === undefined) { + options.lockstepMaxSteps = 4; + } + this._options = options; + PerformanceConfigurator.SetMatrixPrecision(!!options.useHighPrecisionMatrix); + this._caps = { + maxTexturesImageUnits: 16, + maxVertexTextureImageUnits: 16, + maxCombinedTexturesImageUnits: 32, + maxTextureSize: 512, + maxCubemapTextureSize: 512, + maxRenderTextureSize: 512, + maxVertexAttribs: 16, + maxVaryingVectors: 16, + maxFragmentUniformVectors: 16, + maxVertexUniformVectors: 16, + standardDerivatives: false, + astc: null, + pvrtc: null, + etc1: null, + etc2: null, + bptc: null, + maxAnisotropy: 0, + uintIndices: false, + fragmentDepthSupported: false, + highPrecisionShaderSupported: true, + colorBufferFloat: false, + supportFloatTexturesResolve: false, + textureFloat: false, + textureFloatLinearFiltering: false, + textureFloatRender: false, + textureHalfFloat: false, + textureHalfFloatLinearFiltering: false, + textureHalfFloatRender: false, + textureLOD: false, + texelFetch: false, + drawBuffersExtension: false, + depthTextureExtension: false, + vertexArrayObject: false, + instancedArrays: false, + supportOcclusionQuery: false, + canUseTimestampForTimerQuery: false, + maxMSAASamples: 1, + blendMinMax: false, + canUseGLInstanceID: false, + canUseGLVertexID: false, + supportComputeShaders: false, + supportSRGBBuffers: false, + supportTransformFeedbacks: false, + textureMaxLevel: false, + texture2DArrayMaxLayerCount: 128, + disableMorphTargetTexture: false + }; + this._features = { + forceBitmapOverHTMLImageElement: false, + supportRenderAndCopyToLodForFloatTextures: false, + supportDepthStencilTexture: false, + supportShadowSamplers: false, + uniformBufferHardCheckMatrix: false, + allowTexturePrefiltering: false, + trackUbosInFrame: false, + checkUbosContentBeforeUpload: false, + supportCSM: false, + basisNeedsPOT: false, + support3DTextures: false, + needTypeSuffixInShaderConstants: false, + supportMSAA: false, + supportSSAO2: false, + supportExtendedTextureFormats: false, + supportSwitchCaseInShader: false, + supportSyncTextureRead: false, + needsInvertingBitmap: false, + useUBOBindingCache: false, + needShaderCodeInlining: false, + needToAlwaysBindUniformBuffers: false, + supportRenderPasses: true, + supportSpriteInstancing: false, + forceVertexBufferStrideMultiple4Bytes: false, + _collectUbosUpdatedInFrame: false + }; + Logger.Log(`Babylon.js v${Engine2.Version} - Null engine`); + const theCurrentGlobal = typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : window; + if (typeof URL === "undefined") { + theCurrentGlobal.URL = { + createObjectURL: function() { + }, + revokeObjectURL: function() { + } + }; } - if (engine21.beginOcclusionQuery(dataStorage.occlusionQueryAlgorithmType, this._occlusionQuery)) { - occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this); - engine21.endOcclusionQuery(dataStorage.occlusionQueryAlgorithmType); - this._occlusionDataStorage.isOcclusionQueryInProgress = true; + if (typeof Blob === "undefined") { + theCurrentGlobal.Blob = function() { + }; } } - return dataStorage.isOccluded; -}; -// node_modules/@babylonjs/core/Engines/Extensions/engine.transformFeedback.js -Engine2.prototype.createTransformFeedback = function() { - const transformFeedback = this._gl.createTransformFeedback(); - if (!transformFeedback) { - throw new Error("Unable to create Transform Feedback"); + createVertexBuffer(vertices) { + const buffer27 = new DataBuffer; + buffer27.references = 1; + return buffer27; } - return transformFeedback; -}; -Engine2.prototype.deleteTransformFeedback = function(value) { - this._gl.deleteTransformFeedback(value); -}; -Engine2.prototype.bindTransformFeedback = function(value) { - this._gl.bindTransformFeedback(this._gl.TRANSFORM_FEEDBACK, value); -}; -Engine2.prototype.beginTransformFeedback = function(usePoints = true) { - this._gl.beginTransformFeedback(usePoints ? this._gl.POINTS : this._gl.TRIANGLES); -}; -Engine2.prototype.endTransformFeedback = function() { - this._gl.endTransformFeedback(); -}; -Engine2.prototype.setTranformFeedbackVaryings = function(program, value) { - this._gl.transformFeedbackVaryings(program, value, this._gl.INTERLEAVED_ATTRIBS); -}; -Engine2.prototype.bindTransformFeedbackBuffer = function(value) { - this._gl.bindBufferBase(this._gl.TRANSFORM_FEEDBACK_BUFFER, 0, value ? value.underlyingResource : null); -}; -// node_modules/@babylonjs/core/Engines/Extensions/engine.externalTexture.js -ThinEngine.prototype.createExternalTexture = function(video) { - return null; -}; -ThinEngine.prototype.setExternalTexture = function(name74, texture14) { - throw new Error("setExternalTexture: This engine does not support external textures!"); -}; -// node_modules/@babylonjs/core/Engines/Extensions/engine.videoTexture.js -ThinEngine.prototype.updateVideoTexture = function(texture14, video, invertY) { - if (!texture14 || texture14._isDisabled) { - return; + createIndexBuffer(indices) { + const buffer27 = new DataBuffer; + buffer27.references = 1; + return buffer27; } - const glformat = this._getInternalFormat(texture14.format); - const internalFormat = this._getRGBABufferInternalSizedFormat(0, texture14.format); - const wasPreviouslyBound = this._bindTextureDirectly(this._gl.TEXTURE_2D, texture14, true); - this._unpackFlipY(!invertY); - try { - if (this._videoTextureSupported === undefined) { - this._gl.getError(); - this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalFormat, glformat, this._gl.UNSIGNED_BYTE, video); - if (this._gl.getError() !== 0) { - this._videoTextureSupported = false; - } else { - this._videoTextureSupported = true; - } + clear(color, backBuffer, depth, stencil = false) { + } + getRenderWidth(useScreen = false) { + if (!useScreen && this._currentRenderTarget) { + return this._currentRenderTarget.width; } - if (!this._videoTextureSupported) { - if (!texture14._workingCanvas) { - texture14._workingCanvas = this.createCanvas(texture14.width, texture14.height); - const context = texture14._workingCanvas.getContext("2d"); - if (!context) { - throw new Error("Unable to get 2d context"); - } - texture14._workingContext = context; - texture14._workingCanvas.width = texture14.width; - texture14._workingCanvas.height = texture14.height; - } - texture14._workingContext.clearRect(0, 0, texture14.width, texture14.height); - texture14._workingContext.drawImage(video, 0, 0, video.videoWidth, video.videoHeight, 0, 0, texture14.width, texture14.height); - this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalFormat, glformat, this._gl.UNSIGNED_BYTE, texture14._workingCanvas); - } else { - this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalFormat, glformat, this._gl.UNSIGNED_BYTE, video); + return this._options.renderWidth; + } + getRenderHeight(useScreen = false) { + if (!useScreen && this._currentRenderTarget) { + return this._currentRenderTarget.height; } - if (texture14.generateMipMaps) { - this._gl.generateMipmap(this._gl.TEXTURE_2D); + return this._options.renderHeight; + } + setViewport(viewport, requiredWidth, requiredHeight) { + this._cachedViewport = viewport; + } + createShaderProgram(pipelineContext, vertexCode, fragmentCode, defines, context) { + return { + __SPECTOR_rebuildProgram: null + }; + } + getUniforms(pipelineContext, uniformsNames) { + return []; + } + getAttributes(pipelineContext, attributesNames) { + return []; + } + bindSamplers(effect6) { + this._currentEffect = null; + } + enableEffect(effect6) { + effect6 = effect6 !== null && DrawWrapper.IsWrapper(effect6) ? effect6.effect : effect6; + this._currentEffect = effect6; + if (!effect6) { + return; } - if (!wasPreviouslyBound) { - this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + if (effect6.onBind) { + effect6.onBind(effect6); } - texture14.isReady = true; - } catch (ex) { - texture14._isDisabled = true; - } -}; -// node_modules/@babylonjs/core/Engines/Extensions/engine.multiRender.js -ThinEngine.prototype.restoreSingleAttachment = function() { - const gl = this._gl; - this.bindAttachments([gl.BACK]); -}; -ThinEngine.prototype.restoreSingleAttachmentForRenderTarget = function() { - const gl = this._gl; - this.bindAttachments([gl.COLOR_ATTACHMENT0]); -}; -ThinEngine.prototype.buildTextureLayout = function(textureStatus) { - const gl = this._gl; - const result = []; - for (let i = 0;i < textureStatus.length; i++) { - if (textureStatus[i]) { - result.push(gl["COLOR_ATTACHMENT" + i]); - } else { - result.push(gl.NONE); + if (effect6._onBindObservable) { + effect6._onBindObservable.notifyObservers(effect6); } } - return result; -}; -ThinEngine.prototype.bindAttachments = function(attachments) { - const gl = this._gl; - gl.drawBuffers(attachments); -}; -ThinEngine.prototype.unBindMultiColorAttachmentFramebuffer = function(rtWrapper, disableGenerateMipMaps = false, onBeforeUnbind) { - this._currentRenderTarget = null; - const gl = this._gl; - const attachments = rtWrapper._attachments; - const count = attachments.length; - if (rtWrapper._MSAAFramebuffer) { - gl.bindFramebuffer(gl.READ_FRAMEBUFFER, rtWrapper._MSAAFramebuffer); - gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, rtWrapper._framebuffer); - for (let i = 0;i < count; i++) { - const texture14 = rtWrapper.textures[i]; - for (let j = 0;j < count; j++) { - attachments[j] = gl.NONE; - } - attachments[i] = gl[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"]; - gl.readBuffer(attachments[i]); - gl.drawBuffers(attachments); - gl.blitFramebuffer(0, 0, texture14.width, texture14.height, 0, 0, texture14.width, texture14.height, gl.COLOR_BUFFER_BIT, gl.NEAREST); + setState(culling, zOffset = 0, force, reverseSide = false, cullBackFaces, stencil, zOffsetUnits = 0) { + } + setIntArray(uniform, array) { + return true; + } + setIntArray2(uniform, array) { + return true; + } + setIntArray3(uniform, array) { + return true; + } + setIntArray4(uniform, array) { + return true; + } + setFloatArray(uniform, array) { + return true; + } + setFloatArray2(uniform, array) { + return true; + } + setFloatArray3(uniform, array) { + return true; + } + setFloatArray4(uniform, array) { + return true; + } + setArray(uniform, array) { + return true; + } + setArray2(uniform, array) { + return true; + } + setArray3(uniform, array) { + return true; + } + setArray4(uniform, array) { + return true; + } + setMatrices(uniform, matrices) { + return true; + } + setMatrix3x3(uniform, matrix) { + return true; + } + setMatrix2x2(uniform, matrix) { + return true; + } + setFloat(uniform, value) { + return true; + } + setFloat2(uniform, x, y) { + return true; + } + setFloat3(uniform, x, y, z) { + return true; + } + setBool(uniform, bool) { + return true; + } + setFloat4(uniform, x, y, z, w) { + return true; + } + setAlphaMode(mode, noDepthWriteChange = false) { + if (this._alphaMode === mode) { + return; } - for (let i = 0;i < count; i++) { - attachments[i] = gl[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"]; + this.alphaState.alphaBlend = mode !== 0; + if (!noDepthWriteChange) { + this.setDepthWrite(mode === 0); } - gl.drawBuffers(attachments); + this._alphaMode = mode; } - for (let i = 0;i < count; i++) { - const texture14 = rtWrapper.textures[i]; - if ((texture14 === null || texture14 === undefined ? undefined : texture14.generateMipMaps) && !disableGenerateMipMaps && !texture14.isCube) { - this._bindTextureDirectly(gl.TEXTURE_2D, texture14, true); - gl.generateMipmap(gl.TEXTURE_2D); - this._bindTextureDirectly(gl.TEXTURE_2D, null); - } + bindBuffers(vertexBuffers, indexBuffer, effect6) { } - if (onBeforeUnbind) { - if (rtWrapper._MSAAFramebuffer) { - this._bindUnboundFramebuffer(rtWrapper._framebuffer); + wipeCaches(bruteForce) { + if (this.preventCacheWipeBetweenFrames) { + return; } - onBeforeUnbind(); - } - this._bindUnboundFramebuffer(null); -}; -ThinEngine.prototype.createMultipleRenderTarget = function(size, options, initializeBuffers = true) { - var _a; - let generateMipMaps = false; - let generateDepthBuffer = true; - let generateStencilBuffer = false; - let generateDepthTexture = false; - let depthTextureFormat = 15; - let textureCount = 1; - const defaultType = 0; - const defaultSamplingMode = 3; - const defaultUseSRGBBuffer = false; - const defaultFormat = 5; - const defaultTarget = 3553; - let types2 = []; - let samplingModes = []; - let useSRGBBuffers = []; - let formats = []; - let targets = []; - let faceIndex = []; - let layerIndex = []; - let layers = []; - const rtWrapper = this._createHardwareRenderTargetWrapper(true, false, size); - if (options !== undefined) { - generateMipMaps = options.generateMipMaps === undefined ? false : options.generateMipMaps; - generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer; - generateStencilBuffer = options.generateStencilBuffer === undefined ? false : options.generateStencilBuffer; - generateDepthTexture = options.generateDepthTexture === undefined ? false : options.generateDepthTexture; - textureCount = options.textureCount || 1; - if (options.types) { - types2 = options.types; - } - if (options.samplingModes) { - samplingModes = options.samplingModes; - } - if (options.useSRGBBuffers) { - useSRGBBuffers = options.useSRGBBuffers; - } - if (options.formats) { - formats = options.formats; - } - if (options.targetTypes) { - targets = options.targetTypes; - } - if (options.faceIndex) { - faceIndex = options.faceIndex; - } - if (options.layerIndex) { - layerIndex = options.layerIndex; - } - if (options.layerCounts) { - layers = options.layerCounts; - } - if (this.webGLVersion > 1 && (options.depthTextureFormat === 13 || options.depthTextureFormat === 17 || options.depthTextureFormat === 16 || options.depthTextureFormat === 14 || options.depthTextureFormat === 18)) { - depthTextureFormat = options.depthTextureFormat; - } - } - const gl = this._gl; - const framebuffer = gl.createFramebuffer(); - this._bindUnboundFramebuffer(framebuffer); - const width = size.width || size; - const height = size.height || size; - const textures = []; - const attachments = []; - const useStencilTexture = this.webGLVersion > 1 && generateDepthTexture && (options.depthTextureFormat === 13 || options.depthTextureFormat === 17 || options.depthTextureFormat === 18); - const depthStencilBuffer = this._setupFramebufferDepthAttachments(!useStencilTexture && generateStencilBuffer, !generateDepthTexture && generateDepthBuffer, width, height); - rtWrapper._framebuffer = framebuffer; - rtWrapper._depthStencilBuffer = depthStencilBuffer; - rtWrapper._generateDepthBuffer = !generateDepthTexture && generateDepthBuffer; - rtWrapper._generateStencilBuffer = !useStencilTexture && generateStencilBuffer; - rtWrapper._attachments = attachments; - for (let i = 0;i < textureCount; i++) { - let samplingMode = samplingModes[i] || defaultSamplingMode; - let type = types2[i] || defaultType; - let useSRGBBuffer = useSRGBBuffers[i] || defaultUseSRGBBuffer; - const format = formats[i] || defaultFormat; - const target = targets[i] || defaultTarget; - const layerCount = (_a = layers[i]) !== null && _a !== undefined ? _a : 1; - if (type === 1 && !this._caps.textureFloatLinearFiltering) { - samplingMode = 1; - } else if (type === 2 && !this._caps.textureHalfFloatLinearFiltering) { - samplingMode = 1; + this.resetTextureCache(); + this._currentEffect = null; + if (bruteForce) { + this._currentProgram = null; + this._stencilStateComposer.reset(); + this.depthCullingState.reset(); + this.alphaState.reset(); } - const filters = this._getSamplingParameters(samplingMode, generateMipMaps); - if (type === 1 && !this._caps.textureFloat) { - type = 0; - Logger.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"); + this._cachedVertexBuffers = null; + this._cachedIndexBuffer = null; + this._cachedEffectForVertexBuffers = null; + } + draw(useTriangles, indexStart, indexCount, instancesCount) { + } + drawElementsType(fillMode, indexStart, indexCount, instancesCount) { + } + drawArraysType(fillMode, verticesStart, verticesCount, instancesCount) { + } + _createTexture() { + return {}; + } + _releaseTexture(texture14) { + } + createTexture(urlArg, noMipmap, invertY, scene19, samplingMode = 3, onLoad = null, onError = null, buffer27 = null, fallback = null, format = null, forcedExtension = null, mimeType) { + const texture14 = new InternalTexture(this, InternalTextureSource.Url); + const url = String(urlArg); + texture14.url = url; + texture14.generateMipMaps = !noMipmap; + texture14.samplingMode = samplingMode; + texture14.invertY = invertY; + texture14.baseWidth = this._options.textureSize; + texture14.baseHeight = this._options.textureSize; + texture14.width = this._options.textureSize; + texture14.height = this._options.textureSize; + if (format) { + texture14.format = format; } - useSRGBBuffer = useSRGBBuffer && this._caps.supportSRGBBuffers && (this.webGLVersion > 1 || this.isWebGPU); - const isWebGL2 = this.webGLVersion > 1; - const attachment = gl[isWebGL2 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"]; - attachments.push(attachment); - if (target === -1) { - continue; + texture14.isReady = true; + if (onLoad) { + setTimeout(() => { + onLoad(texture14); + }); } - const texture14 = new InternalTexture(this, InternalTextureSource.MultiRenderTarget); - textures[i] = texture14; - gl.activeTexture(gl["TEXTURE" + i]); - gl.bindTexture(target, texture14._hardwareTexture.underlyingResource); - gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, filters.mag); - gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, filters.min); - gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - const internalSizedFormat = this._getRGBABufferInternalSizedFormat(type, format, useSRGBBuffer); - const internalFormat = this._getInternalFormat(format); - const webGLTextureType = this._getWebGLTextureType(type); - if (isWebGL2 && (target === 35866 || target === 32879)) { - if (target === 35866) { - texture14.is2DArray = true; - } else { - texture14.is3D = true; - } - texture14.baseDepth = texture14.depth = layerCount; - gl.texImage3D(target, 0, internalSizedFormat, width, height, layerCount, 0, internalFormat, webGLTextureType, null); - } else if (target === 34067) { - for (let i2 = 0;i2 < 6; i2++) { - gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + i2, 0, internalSizedFormat, width, height, 0, internalFormat, webGLTextureType, null); - } - texture14.isCube = true; + this._internalTexturesCache.push(texture14); + return texture14; + } + _createHardwareRenderTargetWrapper(isMulti, isCube, size) { + const rtWrapper = new RenderTargetWrapper(isMulti, isCube, size, this); + this._renderTargetWrapperCache.push(rtWrapper); + return rtWrapper; + } + createRenderTargetTexture(size, options) { + const rtWrapper = this._createHardwareRenderTargetWrapper(false, false, size); + const fullOptions = {}; + if (options !== undefined && typeof options === "object") { + fullOptions.generateMipMaps = options.generateMipMaps; + fullOptions.generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer; + fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer; + fullOptions.type = options.type === undefined ? 0 : options.type; + fullOptions.samplingMode = options.samplingMode === undefined ? 3 : options.samplingMode; } else { - gl.texImage2D(gl.TEXTURE_2D, 0, internalSizedFormat, width, height, 0, internalFormat, webGLTextureType, null); - } - if (generateMipMaps) { - gl.generateMipmap(target); + fullOptions.generateMipMaps = options; + fullOptions.generateDepthBuffer = true; + fullOptions.generateStencilBuffer = false; + fullOptions.type = 0; + fullOptions.samplingMode = 3; } - this._bindTextureDirectly(target, null); + const texture14 = new InternalTexture(this, InternalTextureSource.RenderTarget); + const width = size.width || size; + const height = size.height || size; + rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer; + rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer ? true : false; texture14.baseWidth = width; texture14.baseHeight = height; texture14.width = width; texture14.height = height; texture14.isReady = true; texture14.samples = 1; + texture14.generateMipMaps = fullOptions.generateMipMaps ? true : false; + texture14.samplingMode = fullOptions.samplingMode; + texture14.type = fullOptions.type; + this._internalTexturesCache.push(texture14); + return rtWrapper; + } + createRenderTargetCubeTexture(size, options) { + const rtWrapper = this._createHardwareRenderTargetWrapper(false, true, size); + const fullOptions = Object.assign({ generateMipMaps: true, generateDepthBuffer: true, generateStencilBuffer: false, type: 0, samplingMode: 3, format: 5 }, options); + fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer; + if (fullOptions.type === 1 && !this._caps.textureFloatLinearFiltering) { + fullOptions.samplingMode = 1; + } else if (fullOptions.type === 2 && !this._caps.textureHalfFloatLinearFiltering) { + fullOptions.samplingMode = 1; + } + rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer; + rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer ? true : false; + const texture14 = new InternalTexture(this, InternalTextureSource.RenderTarget); + texture14.baseWidth = size; + texture14.baseHeight = size; + texture14.width = size; + texture14.height = size; + texture14.isReady = true; + texture14.isCube = true; + texture14.samples = 1; + texture14.generateMipMaps = fullOptions.generateMipMaps ? true : false; + texture14.samplingMode = fullOptions.samplingMode; + texture14.type = fullOptions.type; + this._internalTexturesCache.push(texture14); + return rtWrapper; + } + updateTextureSamplingMode(samplingMode, texture14) { + texture14.samplingMode = samplingMode; + } + createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode, compression = null, type = 0, creationFlags = 0, useSRGBBuffer = false) { + const texture14 = new InternalTexture(this, InternalTextureSource.Raw); + texture14.baseWidth = width; + texture14.baseHeight = height; + texture14.width = width; + texture14.height = height; + texture14.format = format; texture14.generateMipMaps = generateMipMaps; texture14.samplingMode = samplingMode; + texture14.invertY = invertY; + texture14._compression = compression; texture14.type = type; texture14._useSRGBBuffer = useSRGBBuffer; - texture14.format = format; - this._internalTexturesCache.push(texture14); + if (!this._doNotHandleContextLost) { + texture14._bufferView = data; + } + return texture14; } - if (generateDepthTexture && this._caps.depthTextureExtension) { - const depthTexture = new InternalTexture(this, InternalTextureSource.Depth); - let depthTextureType = 5; - let glDepthTextureInternalFormat = gl.DEPTH_COMPONENT16; - let glDepthTextureFormat = gl.DEPTH_COMPONENT; - let glDepthTextureType = gl.UNSIGNED_SHORT; - let glDepthTextureAttachment = gl.DEPTH_ATTACHMENT; - if (this.webGLVersion < 2) { - glDepthTextureInternalFormat = gl.DEPTH_COMPONENT; - } else { - if (depthTextureFormat === 14) { - depthTextureType = 1; - glDepthTextureType = gl.FLOAT; - glDepthTextureInternalFormat = gl.DEPTH_COMPONENT32F; - } else if (depthTextureFormat === 18) { - depthTextureType = 0; - glDepthTextureType = gl.FLOAT_32_UNSIGNED_INT_24_8_REV; - glDepthTextureInternalFormat = gl.DEPTH32F_STENCIL8; - glDepthTextureFormat = gl.DEPTH_STENCIL; - glDepthTextureAttachment = gl.DEPTH_STENCIL_ATTACHMENT; - } else if (depthTextureFormat === 16) { - depthTextureType = 0; - glDepthTextureType = gl.UNSIGNED_INT; - glDepthTextureInternalFormat = gl.DEPTH_COMPONENT24; - glDepthTextureAttachment = gl.DEPTH_ATTACHMENT; - } else if (depthTextureFormat === 13 || depthTextureFormat === 17) { - depthTextureType = 12; - glDepthTextureType = gl.UNSIGNED_INT_24_8; - glDepthTextureInternalFormat = gl.DEPTH24_STENCIL8; - glDepthTextureFormat = gl.DEPTH_STENCIL; - glDepthTextureAttachment = gl.DEPTH_STENCIL_ATTACHMENT; - } - } - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, depthTexture._hardwareTexture.underlyingResource); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - gl.texImage2D(gl.TEXTURE_2D, 0, glDepthTextureInternalFormat, width, height, 0, glDepthTextureFormat, glDepthTextureType, null); - gl.framebufferTexture2D(gl.FRAMEBUFFER, glDepthTextureAttachment, gl.TEXTURE_2D, depthTexture._hardwareTexture.underlyingResource, 0); - depthTexture.baseWidth = width; - depthTexture.baseHeight = height; - depthTexture.width = width; - depthTexture.height = height; - depthTexture.isReady = true; - depthTexture.samples = 1; - depthTexture.generateMipMaps = generateMipMaps; - depthTexture.samplingMode = 1; - depthTexture.format = depthTextureFormat; - depthTexture.type = depthTextureType; - textures[textureCount] = depthTexture; - this._internalTexturesCache.push(depthTexture); - } - rtWrapper.setTextures(textures); - if (initializeBuffers) { - gl.drawBuffers(attachments); + updateRawTexture(texture14, data, format, invertY, compression = null, type = 0, useSRGBBuffer = false) { + if (texture14) { + texture14._bufferView = data; + texture14.format = format; + texture14.invertY = invertY; + texture14._compression = compression; + texture14.type = type; + texture14._useSRGBBuffer = useSRGBBuffer; + } } - this._bindUnboundFramebuffer(null); - rtWrapper.setLayerAndFaceIndices(layerIndex, faceIndex); - this.resetTextureCache(); - return rtWrapper; -}; -ThinEngine.prototype.updateMultipleRenderTargetTextureSampleCount = function(rtWrapper, samples, initializeBuffers = true) { - if (this.webGLVersion < 2 || !rtWrapper || !rtWrapper.texture) { - return 1; + bindFramebuffer(rtWrapper, faceIndex, requiredWidth, requiredHeight, forceFullscreenViewport) { + if (this._currentRenderTarget) { + this.unBindFramebuffer(this._currentRenderTarget); + } + this._currentRenderTarget = rtWrapper; + this._currentFramebuffer = null; + if (this._cachedViewport && !forceFullscreenViewport) { + this.setViewport(this._cachedViewport, requiredWidth, requiredHeight); + } } - if (rtWrapper.samples === samples) { - return samples; + unBindFramebuffer(rtWrapper, disableGenerateMipMaps = false, onBeforeUnbind) { + this._currentRenderTarget = null; + if (onBeforeUnbind) { + onBeforeUnbind(); + } + this._currentFramebuffer = null; + } + createDynamicVertexBuffer(vertices) { + const buffer27 = new DataBuffer; + buffer27.references = 1; + buffer27.capacity = 1; + return buffer27; + } + updateDynamicTexture(texture14, canvas, invertY, premulAlpha = false, format) { + } + areAllEffectsReady() { + return true; + } + getError() { + return 0; } - const count = rtWrapper._attachments.length; - if (count === 0) { + _getUnpackAlignement() { return 1; } - const gl = this._gl; - samples = Math.min(samples, this.getCaps().maxMSAASamples); - const useDepthStencil = !!rtWrapper._depthStencilBuffer; - if (useDepthStencil) { - gl.deleteRenderbuffer(rtWrapper._depthStencilBuffer); - rtWrapper._depthStencilBuffer = null; + _unpackFlipY(value) { + } + updateDynamicIndexBuffer(indexBuffer, indices, offset = 0) { } - if (rtWrapper._MSAAFramebuffer) { - gl.deleteFramebuffer(rtWrapper._MSAAFramebuffer); - rtWrapper._MSAAFramebuffer = null; + updateDynamicVertexBuffer(vertexBuffer, vertices, byteOffset, byteLength) { } - if (samples > 1 && typeof gl.renderbufferStorageMultisample === "function") { - const framebuffer = gl.createFramebuffer(); - if (!framebuffer) { - throw new Error("Unable to create multi sampled framebuffer"); - } - rtWrapper._MSAAFramebuffer = framebuffer; - this._bindUnboundFramebuffer(framebuffer); - const attachments = []; - for (let i = 0;i < count; i++) { - const texture14 = rtWrapper.textures[i]; - const hardwareTexture = texture14._hardwareTexture; - hardwareTexture.releaseMSAARenderBuffers(); - } - for (let i = 0;i < count; i++) { - const texture14 = rtWrapper.textures[i]; - const hardwareTexture = texture14._hardwareTexture; - const attachment = gl[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"]; - const colorRenderbuffer = this._createRenderBuffer(texture14.width, texture14.height, samples, -1, this._getRGBABufferInternalSizedFormat(texture14.type, texture14.format, texture14._useSRGBBuffer), attachment); - if (!colorRenderbuffer) { - throw new Error("Unable to create multi sampled framebuffer"); - } - hardwareTexture.addMSAARenderBuffer(colorRenderbuffer); - texture14.samples = samples; - attachments.push(attachment); + _bindTextureDirectly(target, texture14) { + if (this._boundTexturesCache[this._activeChannel] !== texture14) { + this._boundTexturesCache[this._activeChannel] = texture14; + return true; } - if (initializeBuffers) { - gl.drawBuffers(attachments); + return false; + } + _bindTexture(channel, texture14) { + if (channel < 0) { + return; } - } else { - this._bindUnboundFramebuffer(rtWrapper._framebuffer); + this._bindTextureDirectly(0, texture14); } - if (useDepthStencil) { - rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(rtWrapper._generateStencilBuffer, rtWrapper._generateDepthBuffer, rtWrapper.texture.width, rtWrapper.texture.height, samples); + _deleteBuffer(buffer27) { } - this._bindUnboundFramebuffer(null); - return samples; -}; -// node_modules/@babylonjs/core/Engines/Extensions/engine.cubeTexture.js -ThinEngine.prototype._createDepthStencilCubeTexture = function(size, options, rtWrapper) { - const internalTexture13 = new InternalTexture(this, InternalTextureSource.DepthStencil); - internalTexture13.isCube = true; - if (this.webGLVersion === 1) { - Logger.Error("Depth cube texture is not supported by WebGL 1."); - return internalTexture13; + releaseEffects() { } - const internalOptions = Object.assign({ bilinearFiltering: false, comparisonFunction: 0, generateStencil: false }, options); - const gl = this._gl; - this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, internalTexture13, true); - this._setupDepthStencilTexture(internalTexture13, size, internalOptions.generateStencil, internalOptions.bilinearFiltering, internalOptions.comparisonFunction); - rtWrapper._depthStencilTexture = internalTexture13; - rtWrapper._depthStencilTextureWithStencil = internalOptions.generateStencil; - for (let face = 0;face < 6; face++) { - if (internalOptions.generateStencil) { - gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, gl.DEPTH24_STENCIL8, size, size, 0, gl.DEPTH_STENCIL, gl.UNSIGNED_INT_24_8, null); - } else { - gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, gl.DEPTH_COMPONENT24, size, size, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_INT, null); - } + displayLoadingUI() { } - this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); - this._internalTexturesCache.push(internalTexture13); - return internalTexture13; -}; -ThinEngine.prototype._partialLoadFile = function(url, index, loadedFiles, onfinish, onErrorCallBack = null) { - const onload = (data) => { - loadedFiles[index] = data; - loadedFiles._internalCount++; - if (loadedFiles._internalCount === 6) { - onfinish(loadedFiles); - } + hideLoadingUI() { + } + set loadingUIText(_) { + } + _uploadCompressedDataToTextureDirectly(texture14, internalFormat, width, height, data, faceIndex = 0, lod = 0) { + } + _uploadDataToTextureDirectly(texture14, imageData, faceIndex = 0, lod = 0) { + } + _uploadArrayBufferViewToTexture(texture14, imageData, faceIndex = 0, lod = 0) { + } + _uploadImageToTexture(texture14, image, faceIndex = 0, lod = 0) { + } +} +var init_nullEngine = __esm(() => { + init_logger(); + init_engine(); + init_internalTexture(); + init_dataBuffer(); + init_performanceConfigurator(); + init_drawWrapper(); + init_renderTargetWrapper(); +}); + +// node_modules/@babylonjs/core/Engines/Extensions/engine.debugging.js +var init_engine_debugging = __esm(() => { + init_thinEngine(); + ThinEngine.prototype._debugPushGroup = function(groupName, targetObject) { }; - const onerror = (request, exception) => { - if (onErrorCallBack && request) { - onErrorCallBack(request.status + " " + request.statusText, exception); - } + ThinEngine.prototype._debugPopGroup = function(targetObject) { }; - this._loadFile(url, onload, undefined, undefined, true, onerror); -}; -ThinEngine.prototype._cascadeLoadFiles = function(scene19, onfinish, files, onError = null) { - const loadedFiles = []; - loadedFiles._internalCount = 0; - for (let index = 0;index < 6; index++) { - this._partialLoadFile(files[index], index, loadedFiles, onfinish, onError); + ThinEngine.prototype._debugInsertMarker = function(text, targetObject) { + }; + ThinEngine.prototype._debugFlushPendingCommands = function() { + }; +}); + +// node_modules/@babylonjs/core/Instrumentation/timeToken.js +class _TimeToken { + constructor() { + this._timeElapsedQueryEnded = false; } -}; -ThinEngine.prototype._cascadeLoadImgs = function(scene19, texture14, onfinish, files, onError = null, mimeType) { - const loadedImages = []; - loadedImages._internalCount = 0; - for (let index = 0;index < 6; index++) { - this._partialLoadImg(files[index], index, loadedImages, scene19, texture14, onfinish, onError, mimeType); +} +var init_timeToken = __esm(() => { +}); + +// node_modules/@babylonjs/core/Engines/Extensions/engine.query.js +class _OcclusionDataStorage { + constructor() { + this.occlusionInternalRetryCounter = 0; + this.isOcclusionQueryInProgress = false; + this.isOccluded = false; + this.occlusionRetryCount = -1; + this.occlusionType = AbstractMesh.OCCLUSION_TYPE_NONE; + this.occlusionQueryAlgorithmType = AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE; + this.forceRenderingWhenOccluded = false; } -}; -ThinEngine.prototype._partialLoadImg = function(url, index, loadedImages, scene19, texture14, onfinish, onErrorCallBack = null, mimeType) { - const tokenPendingData = RandomGUID(); - const onload = (img) => { - loadedImages[index] = img; - loadedImages._internalCount++; - if (scene19) { - scene19.removePendingData(tokenPendingData); +} +var init_engine_query = __esm(() => { + init_engine(); + init_abstractMesh(); + init_timeToken(); + init_perfCounter(); + Engine2.prototype.createQuery = function() { + const query = this._gl.createQuery(); + if (!query) { + throw new Error("Unable to create Occlusion Query"); + } + return query; + }; + Engine2.prototype.deleteQuery = function(query) { + this._gl.deleteQuery(query); + return this; + }; + Engine2.prototype.isQueryResultAvailable = function(query) { + return this._gl.getQueryParameter(query, this._gl.QUERY_RESULT_AVAILABLE); + }; + Engine2.prototype.getQueryResult = function(query) { + return this._gl.getQueryParameter(query, this._gl.QUERY_RESULT); + }; + Engine2.prototype.beginOcclusionQuery = function(algorithmType, query) { + const glAlgorithm = this._getGlAlgorithmType(algorithmType); + this._gl.beginQuery(glAlgorithm, query); + return true; + }; + Engine2.prototype.endOcclusionQuery = function(algorithmType) { + const glAlgorithm = this._getGlAlgorithmType(algorithmType); + this._gl.endQuery(glAlgorithm); + return this; + }; + Engine2.prototype._createTimeQuery = function() { + const timerQuery = this.getCaps().timerQuery; + if (timerQuery.createQueryEXT) { + return timerQuery.createQueryEXT(); } - if (loadedImages._internalCount === 6 && onfinish) { - onfinish(texture14, loadedImages); + return this.createQuery(); + }; + Engine2.prototype._deleteTimeQuery = function(query) { + const timerQuery = this.getCaps().timerQuery; + if (timerQuery.deleteQueryEXT) { + timerQuery.deleteQueryEXT(query); + return; } + this.deleteQuery(query); }; - const onerror = (message, exception) => { - if (scene19) { - scene19.removePendingData(tokenPendingData); + Engine2.prototype._getTimeQueryResult = function(query) { + const timerQuery = this.getCaps().timerQuery; + if (timerQuery.getQueryObjectEXT) { + return timerQuery.getQueryObjectEXT(query, timerQuery.QUERY_RESULT_EXT); } - if (onErrorCallBack) { - onErrorCallBack(message, exception); + return this.getQueryResult(query); + }; + Engine2.prototype._getTimeQueryAvailability = function(query) { + const timerQuery = this.getCaps().timerQuery; + if (timerQuery.getQueryObjectEXT) { + return timerQuery.getQueryObjectEXT(query, timerQuery.QUERY_RESULT_AVAILABLE_EXT); } + return this.isQueryResultAvailable(query); }; - LoadImage(url, onload, onerror, scene19 ? scene19.offlineProvider : null, mimeType); - if (scene19) { - scene19.addPendingData(tokenPendingData); - } -}; -ThinEngine.prototype._setCubeMapTextureParams = function(texture14, loadMipmap, maxLevel) { - const gl = this._gl; - gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR); - gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, loadMipmap ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR); - gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - texture14.samplingMode = loadMipmap ? 3 : 2; - if (loadMipmap && this.getCaps().textureMaxLevel && maxLevel !== undefined && maxLevel > 0) { - gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAX_LEVEL, maxLevel); - texture14._maxLodLevel = maxLevel; - } - this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); -}; -ThinEngine.prototype.createCubeTextureBase = function(rootUrl, scene19, files, noMipmap, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = false, lodScale = 0, lodOffset = 0, fallback = null, beforeLoadCubeDataCallback = null, imageHandler = null, useSRGBBuffer = false) { - const texture14 = fallback ? fallback : new InternalTexture(this, InternalTextureSource.Cube); - texture14.isCube = true; - texture14.url = rootUrl; - texture14.generateMipMaps = !noMipmap; - texture14._lodGenerationScale = lodScale; - texture14._lodGenerationOffset = lodOffset; - texture14._useSRGBBuffer = !!useSRGBBuffer && this._caps.supportSRGBBuffers && (this.webGLVersion > 1 || this.isWebGPU || !!noMipmap); - if (texture14 !== fallback) { - texture14.label = rootUrl.substring(0, 60); - } - if (!this._doNotHandleContextLost) { - texture14._extension = forcedExtension; - texture14._files = files; - } - const originalRootUrl = rootUrl; - if (this._transformTextureUrl && !fallback) { - rootUrl = this._transformTextureUrl(rootUrl); - } - const rootUrlWithoutUriParams = rootUrl.split("?")[0]; - const lastDot = rootUrlWithoutUriParams.lastIndexOf("."); - const extension = forcedExtension ? forcedExtension : lastDot > -1 ? rootUrlWithoutUriParams.substring(lastDot).toLowerCase() : ""; - let loader = null; - for (const availableLoader of ThinEngine._TextureLoaders) { - if (availableLoader.canLoad(extension)) { - loader = availableLoader; - break; + Engine2.prototype.startTimeQuery = function() { + const caps = this.getCaps(); + const timerQuery = caps.timerQuery; + if (!timerQuery) { + return null; } - } - const onInternalError = (request, exception) => { - if (rootUrl === originalRootUrl) { - if (onError && request) { - onError(request.status + " " + request.statusText, exception); + const token = new _TimeToken; + this._gl.getParameter(timerQuery.GPU_DISJOINT_EXT); + if (caps.canUseTimestampForTimerQuery) { + token._startTimeQuery = this._createTimeQuery(); + timerQuery.queryCounterEXT(token._startTimeQuery, timerQuery.TIMESTAMP_EXT); + } else { + if (this._currentNonTimestampToken) { + return this._currentNonTimestampToken; + } + token._timeElapsedQuery = this._createTimeQuery(); + if (timerQuery.beginQueryEXT) { + timerQuery.beginQueryEXT(timerQuery.TIME_ELAPSED_EXT, token._timeElapsedQuery); + } else { + this._gl.beginQuery(timerQuery.TIME_ELAPSED_EXT, token._timeElapsedQuery); + } + this._currentNonTimestampToken = token; + } + return token; + }; + Engine2.prototype.endTimeQuery = function(token) { + const caps = this.getCaps(); + const timerQuery = caps.timerQuery; + if (!timerQuery || !token) { + return -1; + } + if (caps.canUseTimestampForTimerQuery) { + if (!token._startTimeQuery) { + return -1; + } + if (!token._endTimeQuery) { + token._endTimeQuery = this._createTimeQuery(); + timerQuery.queryCounterEXT(token._endTimeQuery, timerQuery.TIMESTAMP_EXT); + } + } else if (!token._timeElapsedQueryEnded) { + if (!token._timeElapsedQuery) { + return -1; + } + if (timerQuery.endQueryEXT) { + timerQuery.endQueryEXT(timerQuery.TIME_ELAPSED_EXT); + } else { + this._gl.endQuery(timerQuery.TIME_ELAPSED_EXT); + this._currentNonTimestampToken = null; + } + token._timeElapsedQueryEnded = true; + } + const disjoint = this._gl.getParameter(timerQuery.GPU_DISJOINT_EXT); + let available = false; + if (token._endTimeQuery) { + available = this._getTimeQueryAvailability(token._endTimeQuery); + } else if (token._timeElapsedQuery) { + available = this._getTimeQueryAvailability(token._timeElapsedQuery); + } + if (available && !disjoint) { + let result = 0; + if (caps.canUseTimestampForTimerQuery) { + if (!token._startTimeQuery || !token._endTimeQuery) { + return -1; + } + const timeStart = this._getTimeQueryResult(token._startTimeQuery); + const timeEnd = this._getTimeQueryResult(token._endTimeQuery); + result = timeEnd - timeStart; + this._deleteTimeQuery(token._startTimeQuery); + this._deleteTimeQuery(token._endTimeQuery); + token._startTimeQuery = null; + token._endTimeQuery = null; + } else { + if (!token._timeElapsedQuery) { + return -1; + } + result = this._getTimeQueryResult(token._timeElapsedQuery); + this._deleteTimeQuery(token._timeElapsedQuery); + token._timeElapsedQuery = null; + token._timeElapsedQueryEnded = false; } + return result; + } + return -1; + }; + Engine2.prototype._captureGPUFrameTime = false; + Engine2.prototype._gpuFrameTime = new PerfCounter; + Engine2.prototype.getGPUFrameTimeCounter = function() { + return this._gpuFrameTime; + }; + Engine2.prototype.captureGPUFrameTime = function(value) { + if (value === this._captureGPUFrameTime) { + return; + } + this._captureGPUFrameTime = value; + if (value) { + this._onBeginFrameObserver = this.onBeginFrameObservable.add(() => { + if (!this._gpuFrameTimeToken) { + this._gpuFrameTimeToken = this.startTimeQuery(); + } + }); + this._onEndFrameObserver = this.onEndFrameObservable.add(() => { + if (!this._gpuFrameTimeToken) { + return; + } + const time = this.endTimeQuery(this._gpuFrameTimeToken); + if (time > -1) { + this._gpuFrameTimeToken = null; + this._gpuFrameTime.fetchNewFrame(); + this._gpuFrameTime.addCount(time, true); + } + }); } else { - Logger.Warn(`Failed to load ${rootUrl}, falling back to the ${originalRootUrl}`); - this.createCubeTextureBase(originalRootUrl, scene19, files, !!noMipmap, onLoad, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset, texture14, beforeLoadCubeDataCallback, imageHandler, useSRGBBuffer); + this.onBeginFrameObservable.remove(this._onBeginFrameObserver); + this._onBeginFrameObserver = null; + this.onEndFrameObservable.remove(this._onEndFrameObserver); + this._onEndFrameObserver = null; } }; - if (loader) { - const onloaddata = (data) => { - if (beforeLoadCubeDataCallback) { - beforeLoadCubeDataCallback(texture14, data); + Engine2.prototype._getGlAlgorithmType = function(algorithmType) { + return algorithmType === AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED; + }; + Object.defineProperty(AbstractMesh.prototype, "isOcclusionQueryInProgress", { + get: function() { + return this._occlusionDataStorage.isOcclusionQueryInProgress; + }, + set: function(value) { + this._occlusionDataStorage.isOcclusionQueryInProgress = value; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "_occlusionDataStorage", { + get: function() { + if (!this.__occlusionDataStorage) { + this.__occlusionDataStorage = new _OcclusionDataStorage; } - loader.loadCubeData(data, texture14, createPolynomials, onLoad, onError); - }; - if (files && files.length === 6) { - if (loader.supportCascades) { - this._cascadeLoadFiles(scene19, (images) => onloaddata(images.map((image) => new Uint8Array(image))), files, onError); + return this.__occlusionDataStorage; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "isOccluded", { + get: function() { + return this._occlusionDataStorage.isOccluded; + }, + set: function(value) { + this._occlusionDataStorage.isOccluded = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "occlusionQueryAlgorithmType", { + get: function() { + return this._occlusionDataStorage.occlusionQueryAlgorithmType; + }, + set: function(value) { + this._occlusionDataStorage.occlusionQueryAlgorithmType = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "occlusionType", { + get: function() { + return this._occlusionDataStorage.occlusionType; + }, + set: function(value) { + this._occlusionDataStorage.occlusionType = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "occlusionRetryCount", { + get: function() { + return this._occlusionDataStorage.occlusionRetryCount; + }, + set: function(value) { + this._occlusionDataStorage.occlusionRetryCount = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AbstractMesh.prototype, "forceRenderingWhenOccluded", { + get: function() { + return this._occlusionDataStorage.forceRenderingWhenOccluded; + }, + set: function(value) { + this._occlusionDataStorage.forceRenderingWhenOccluded = value; + }, + enumerable: true, + configurable: true + }); + AbstractMesh.prototype._checkOcclusionQuery = function() { + const dataStorage = this._occlusionDataStorage; + if (dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_NONE) { + dataStorage.isOccluded = false; + return false; + } + const engine21 = this.getEngine(); + if (!engine21.getCaps().supportOcclusionQuery) { + dataStorage.isOccluded = false; + return false; + } + if (!engine21.isQueryResultAvailable) { + dataStorage.isOccluded = false; + return false; + } + if (this.isOcclusionQueryInProgress && this._occlusionQuery !== null && this._occlusionQuery !== undefined) { + const isOcclusionQueryAvailable = engine21.isQueryResultAvailable(this._occlusionQuery); + if (isOcclusionQueryAvailable) { + const occlusionQueryResult = engine21.getQueryResult(this._occlusionQuery); + dataStorage.isOcclusionQueryInProgress = false; + dataStorage.occlusionInternalRetryCounter = 0; + dataStorage.isOccluded = occlusionQueryResult > 0 ? false : true; } else { - if (onError) { - onError("Textures type does not support cascades."); + dataStorage.occlusionInternalRetryCounter++; + if (dataStorage.occlusionRetryCount !== -1 && dataStorage.occlusionInternalRetryCounter > dataStorage.occlusionRetryCount) { + dataStorage.isOcclusionQueryInProgress = false; + dataStorage.occlusionInternalRetryCounter = 0; + dataStorage.isOccluded = dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded; } else { - Logger.Warn("Texture loader does not support cascades."); + return dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded; } } - } else { - this._loadFile(rootUrl, (data) => onloaddata(new Uint8Array(data)), undefined, undefined, true, onInternalError); } - } else { - if (!files) { - throw new Error("Cannot load cubemap because files were not defined"); + const scene19 = this.getScene(); + if (scene19.getBoundingBoxRenderer) { + const occlusionBoundingBoxRenderer = scene19.getBoundingBoxRenderer(); + if (this._occlusionQuery === null) { + this._occlusionQuery = engine21.createQuery(); + } + if (engine21.beginOcclusionQuery(dataStorage.occlusionQueryAlgorithmType, this._occlusionQuery)) { + occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this); + engine21.endOcclusionQuery(dataStorage.occlusionQueryAlgorithmType); + this._occlusionDataStorage.isOcclusionQueryInProgress = true; + } + } + return dataStorage.isOccluded; + }; +}); + +// node_modules/@babylonjs/core/Engines/Extensions/engine.transformFeedback.js +var _forceTransformFeedbackToBundle; +var init_engine_transformFeedback = __esm(() => { + init_engine(); + _forceTransformFeedbackToBundle = true; + Engine2.prototype.createTransformFeedback = function() { + const transformFeedback = this._gl.createTransformFeedback(); + if (!transformFeedback) { + throw new Error("Unable to create Transform Feedback"); + } + return transformFeedback; + }; + Engine2.prototype.deleteTransformFeedback = function(value) { + this._gl.deleteTransformFeedback(value); + }; + Engine2.prototype.bindTransformFeedback = function(value) { + this._gl.bindTransformFeedback(this._gl.TRANSFORM_FEEDBACK, value); + }; + Engine2.prototype.beginTransformFeedback = function(usePoints = true) { + this._gl.beginTransformFeedback(usePoints ? this._gl.POINTS : this._gl.TRIANGLES); + }; + Engine2.prototype.endTransformFeedback = function() { + this._gl.endTransformFeedback(); + }; + Engine2.prototype.setTranformFeedbackVaryings = function(program, value) { + this._gl.transformFeedbackVaryings(program, value, this._gl.INTERLEAVED_ATTRIBS); + }; + Engine2.prototype.bindTransformFeedbackBuffer = function(value) { + this._gl.bindBufferBase(this._gl.TRANSFORM_FEEDBACK_BUFFER, 0, value ? value.underlyingResource : null); + }; +}); + +// node_modules/@babylonjs/core/Engines/Extensions/engine.externalTexture.js +var init_engine_externalTexture = __esm(() => { + init_thinEngine(); + ThinEngine.prototype.createExternalTexture = function(video) { + return null; + }; + ThinEngine.prototype.setExternalTexture = function(name75, texture14) { + throw new Error("setExternalTexture: This engine does not support external textures!"); + }; +}); + +// node_modules/@babylonjs/core/Engines/Extensions/engine.videoTexture.js +var init_engine_videoTexture = __esm(() => { + init_thinEngine(); + ThinEngine.prototype.updateVideoTexture = function(texture14, video, invertY) { + if (!texture14 || texture14._isDisabled) { + return; } - this._cascadeLoadImgs(scene19, texture14, (texture15, imgs) => { - if (imageHandler) { - imageHandler(texture15, imgs); + const glformat = this._getInternalFormat(texture14.format); + const internalFormat = this._getRGBABufferInternalSizedFormat(0, texture14.format); + const wasPreviouslyBound = this._bindTextureDirectly(this._gl.TEXTURE_2D, texture14, true); + this._unpackFlipY(!invertY); + try { + if (this._videoTextureSupported === undefined) { + this._gl.getError(); + this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalFormat, glformat, this._gl.UNSIGNED_BYTE, video); + if (this._gl.getError() !== 0) { + this._videoTextureSupported = false; + } else { + this._videoTextureSupported = true; + } } - }, files, onError); - } - this._internalTexturesCache.push(texture14); - return texture14; -}; -ThinEngine.prototype.createCubeTexture = function(rootUrl, scene19, files, noMipmap, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = false, lodScale = 0, lodOffset = 0, fallback = null, loaderOptions, useSRGBBuffer = false) { - const gl = this._gl; - return this.createCubeTextureBase(rootUrl, scene19, files, !!noMipmap, onLoad, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset, fallback, (texture14) => this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture14, true), (texture14, imgs) => { - const width = this.needPOTTextures ? ThinEngine.GetExponentOfTwo(imgs[0].width, this._caps.maxCubemapTextureSize) : imgs[0].width; - const height = width; - const faces = [ - gl.TEXTURE_CUBE_MAP_POSITIVE_X, - gl.TEXTURE_CUBE_MAP_POSITIVE_Y, - gl.TEXTURE_CUBE_MAP_POSITIVE_Z, - gl.TEXTURE_CUBE_MAP_NEGATIVE_X, - gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, - gl.TEXTURE_CUBE_MAP_NEGATIVE_Z - ]; - this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture14, true); - this._unpackFlipY(false); - const internalFormat = format ? this._getInternalFormat(format, texture14._useSRGBBuffer) : texture14._useSRGBBuffer ? this._glSRGBExtensionValues.SRGB8_ALPHA8 : gl.RGBA; - let texelFormat = format ? this._getInternalFormat(format) : gl.RGBA; - if (texture14._useSRGBBuffer && this.webGLVersion === 1) { - texelFormat = internalFormat; - } - for (let index = 0;index < faces.length; index++) { - if (imgs[index].width !== width || imgs[index].height !== height) { - this._prepareWorkingCanvas(); - if (!this._workingCanvas || !this._workingContext) { - Logger.Warn("Cannot create canvas to resize texture."); - return; + if (!this._videoTextureSupported) { + if (!texture14._workingCanvas) { + texture14._workingCanvas = this.createCanvas(texture14.width, texture14.height); + const context = texture14._workingCanvas.getContext("2d"); + if (!context) { + throw new Error("Unable to get 2d context"); + } + texture14._workingContext = context; + texture14._workingCanvas.width = texture14.width; + texture14._workingCanvas.height = texture14.height; } - this._workingCanvas.width = width; - this._workingCanvas.height = height; - this._workingContext.drawImage(imgs[index], 0, 0, imgs[index].width, imgs[index].height, 0, 0, width, height); - gl.texImage2D(faces[index], 0, internalFormat, texelFormat, gl.UNSIGNED_BYTE, this._workingCanvas); + texture14._workingContext.clearRect(0, 0, texture14.width, texture14.height); + texture14._workingContext.drawImage(video, 0, 0, video.videoWidth, video.videoHeight, 0, 0, texture14.width, texture14.height); + this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalFormat, glformat, this._gl.UNSIGNED_BYTE, texture14._workingCanvas); } else { - gl.texImage2D(faces[index], 0, internalFormat, texelFormat, gl.UNSIGNED_BYTE, imgs[index]); + this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalFormat, glformat, this._gl.UNSIGNED_BYTE, video); + } + if (texture14.generateMipMaps) { + this._gl.generateMipmap(this._gl.TEXTURE_2D); } + if (!wasPreviouslyBound) { + this._bindTextureDirectly(this._gl.TEXTURE_2D, null); + } + texture14.isReady = true; + } catch (ex) { + texture14._isDisabled = true; } - if (!noMipmap) { - gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + }; +}); + +// node_modules/@babylonjs/core/Engines/Extensions/engine.multiRender.js +var init_engine_multiRender = __esm(() => { + init_internalTexture(); + init_logger(); + init_thinEngine(); + ThinEngine.prototype.restoreSingleAttachment = function() { + const gl = this._gl; + this.bindAttachments([gl.BACK]); + }; + ThinEngine.prototype.restoreSingleAttachmentForRenderTarget = function() { + const gl = this._gl; + this.bindAttachments([gl.COLOR_ATTACHMENT0]); + }; + ThinEngine.prototype.buildTextureLayout = function(textureStatus) { + const gl = this._gl; + const result = []; + for (let i = 0;i < textureStatus.length; i++) { + if (textureStatus[i]) { + result.push(gl["COLOR_ATTACHMENT" + i]); + } else { + result.push(gl.NONE); + } } - this._setCubeMapTextureParams(texture14, !noMipmap); - texture14.width = width; - texture14.height = height; - texture14.isReady = true; - if (format) { + return result; + }; + ThinEngine.prototype.bindAttachments = function(attachments) { + const gl = this._gl; + gl.drawBuffers(attachments); + }; + ThinEngine.prototype.unBindMultiColorAttachmentFramebuffer = function(rtWrapper, disableGenerateMipMaps = false, onBeforeUnbind) { + this._currentRenderTarget = null; + const gl = this._gl; + const attachments = rtWrapper._attachments; + const count = attachments.length; + if (rtWrapper._MSAAFramebuffer) { + gl.bindFramebuffer(gl.READ_FRAMEBUFFER, rtWrapper._MSAAFramebuffer); + gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, rtWrapper._framebuffer); + for (let i = 0;i < count; i++) { + const texture14 = rtWrapper.textures[i]; + for (let j = 0;j < count; j++) { + attachments[j] = gl.NONE; + } + attachments[i] = gl[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"]; + gl.readBuffer(attachments[i]); + gl.drawBuffers(attachments); + gl.blitFramebuffer(0, 0, texture14.width, texture14.height, 0, 0, texture14.width, texture14.height, gl.COLOR_BUFFER_BIT, gl.NEAREST); + } + for (let i = 0;i < count; i++) { + attachments[i] = gl[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"]; + } + gl.drawBuffers(attachments); + } + for (let i = 0;i < count; i++) { + const texture14 = rtWrapper.textures[i]; + if ((texture14 === null || texture14 === undefined ? undefined : texture14.generateMipMaps) && !disableGenerateMipMaps && !texture14.isCube) { + this._bindTextureDirectly(gl.TEXTURE_2D, texture14, true); + gl.generateMipmap(gl.TEXTURE_2D); + this._bindTextureDirectly(gl.TEXTURE_2D, null); + } + } + if (onBeforeUnbind) { + if (rtWrapper._MSAAFramebuffer) { + this._bindUnboundFramebuffer(rtWrapper._framebuffer); + } + onBeforeUnbind(); + } + this._bindUnboundFramebuffer(null); + }; + ThinEngine.prototype.createMultipleRenderTarget = function(size, options, initializeBuffers = true) { + var _a; + let generateMipMaps = false; + let generateDepthBuffer = true; + let generateStencilBuffer = false; + let generateDepthTexture = false; + let depthTextureFormat = 15; + let textureCount = 1; + const defaultType = 0; + const defaultSamplingMode = 3; + const defaultUseSRGBBuffer = false; + const defaultFormat = 5; + const defaultTarget = 3553; + let types2 = []; + let samplingModes = []; + let useSRGBBuffers = []; + let formats = []; + let targets = []; + let faceIndex = []; + let layerIndex = []; + let layers = []; + const rtWrapper = this._createHardwareRenderTargetWrapper(true, false, size); + if (options !== undefined) { + generateMipMaps = options.generateMipMaps === undefined ? false : options.generateMipMaps; + generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer; + generateStencilBuffer = options.generateStencilBuffer === undefined ? false : options.generateStencilBuffer; + generateDepthTexture = options.generateDepthTexture === undefined ? false : options.generateDepthTexture; + textureCount = options.textureCount || 1; + if (options.types) { + types2 = options.types; + } + if (options.samplingModes) { + samplingModes = options.samplingModes; + } + if (options.useSRGBBuffers) { + useSRGBBuffers = options.useSRGBBuffers; + } + if (options.formats) { + formats = options.formats; + } + if (options.targetTypes) { + targets = options.targetTypes; + } + if (options.faceIndex) { + faceIndex = options.faceIndex; + } + if (options.layerIndex) { + layerIndex = options.layerIndex; + } + if (options.layerCounts) { + layers = options.layerCounts; + } + if (this.webGLVersion > 1 && (options.depthTextureFormat === 13 || options.depthTextureFormat === 17 || options.depthTextureFormat === 16 || options.depthTextureFormat === 14 || options.depthTextureFormat === 18)) { + depthTextureFormat = options.depthTextureFormat; + } + } + const gl = this._gl; + const framebuffer = gl.createFramebuffer(); + this._bindUnboundFramebuffer(framebuffer); + const width = size.width || size; + const height = size.height || size; + const textures = []; + const attachments = []; + const useStencilTexture = this.webGLVersion > 1 && generateDepthTexture && (options.depthTextureFormat === 13 || options.depthTextureFormat === 17 || options.depthTextureFormat === 18); + const depthStencilBuffer = this._setupFramebufferDepthAttachments(!useStencilTexture && generateStencilBuffer, !generateDepthTexture && generateDepthBuffer, width, height); + rtWrapper._framebuffer = framebuffer; + rtWrapper._depthStencilBuffer = depthStencilBuffer; + rtWrapper._generateDepthBuffer = !generateDepthTexture && generateDepthBuffer; + rtWrapper._generateStencilBuffer = !useStencilTexture && generateStencilBuffer; + rtWrapper._attachments = attachments; + for (let i = 0;i < textureCount; i++) { + let samplingMode = samplingModes[i] || defaultSamplingMode; + let type = types2[i] || defaultType; + let useSRGBBuffer = useSRGBBuffers[i] || defaultUseSRGBBuffer; + const format = formats[i] || defaultFormat; + const target = targets[i] || defaultTarget; + const layerCount = (_a = layers[i]) !== null && _a !== undefined ? _a : 1; + if (type === 1 && !this._caps.textureFloatLinearFiltering) { + samplingMode = 1; + } else if (type === 2 && !this._caps.textureHalfFloatLinearFiltering) { + samplingMode = 1; + } + const filters = this._getSamplingParameters(samplingMode, generateMipMaps); + if (type === 1 && !this._caps.textureFloat) { + type = 0; + Logger.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"); + } + useSRGBBuffer = useSRGBBuffer && this._caps.supportSRGBBuffers && (this.webGLVersion > 1 || this.isWebGPU); + const isWebGL2 = this.webGLVersion > 1; + const attachment = gl[isWebGL2 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"]; + attachments.push(attachment); + if (target === -1) { + continue; + } + const texture14 = new InternalTexture(this, InternalTextureSource.MultiRenderTarget); + textures[i] = texture14; + gl.activeTexture(gl["TEXTURE" + i]); + gl.bindTexture(target, texture14._hardwareTexture.underlyingResource); + gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, filters.mag); + gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, filters.min); + gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + const internalSizedFormat = this._getRGBABufferInternalSizedFormat(type, format, useSRGBBuffer); + const internalFormat = this._getInternalFormat(format); + const webGLTextureType = this._getWebGLTextureType(type); + if (isWebGL2 && (target === 35866 || target === 32879)) { + if (target === 35866) { + texture14.is2DArray = true; + } else { + texture14.is3D = true; + } + texture14.baseDepth = texture14.depth = layerCount; + gl.texImage3D(target, 0, internalSizedFormat, width, height, layerCount, 0, internalFormat, webGLTextureType, null); + } else if (target === 34067) { + for (let i2 = 0;i2 < 6; i2++) { + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + i2, 0, internalSizedFormat, width, height, 0, internalFormat, webGLTextureType, null); + } + texture14.isCube = true; + } else { + gl.texImage2D(gl.TEXTURE_2D, 0, internalSizedFormat, width, height, 0, internalFormat, webGLTextureType, null); + } + if (generateMipMaps) { + gl.generateMipmap(target); + } + this._bindTextureDirectly(target, null); + texture14.baseWidth = width; + texture14.baseHeight = height; + texture14.width = width; + texture14.height = height; + texture14.isReady = true; + texture14.samples = 1; + texture14.generateMipMaps = generateMipMaps; + texture14.samplingMode = samplingMode; + texture14.type = type; + texture14._useSRGBBuffer = useSRGBBuffer; texture14.format = format; + this._internalTexturesCache.push(texture14); + } + if (generateDepthTexture && this._caps.depthTextureExtension) { + const depthTexture = new InternalTexture(this, InternalTextureSource.Depth); + let depthTextureType = 5; + let glDepthTextureInternalFormat = gl.DEPTH_COMPONENT16; + let glDepthTextureFormat = gl.DEPTH_COMPONENT; + let glDepthTextureType = gl.UNSIGNED_SHORT; + let glDepthTextureAttachment = gl.DEPTH_ATTACHMENT; + if (this.webGLVersion < 2) { + glDepthTextureInternalFormat = gl.DEPTH_COMPONENT; + } else { + if (depthTextureFormat === 14) { + depthTextureType = 1; + glDepthTextureType = gl.FLOAT; + glDepthTextureInternalFormat = gl.DEPTH_COMPONENT32F; + } else if (depthTextureFormat === 18) { + depthTextureType = 0; + glDepthTextureType = gl.FLOAT_32_UNSIGNED_INT_24_8_REV; + glDepthTextureInternalFormat = gl.DEPTH32F_STENCIL8; + glDepthTextureFormat = gl.DEPTH_STENCIL; + glDepthTextureAttachment = gl.DEPTH_STENCIL_ATTACHMENT; + } else if (depthTextureFormat === 16) { + depthTextureType = 0; + glDepthTextureType = gl.UNSIGNED_INT; + glDepthTextureInternalFormat = gl.DEPTH_COMPONENT24; + glDepthTextureAttachment = gl.DEPTH_ATTACHMENT; + } else if (depthTextureFormat === 13 || depthTextureFormat === 17) { + depthTextureType = 12; + glDepthTextureType = gl.UNSIGNED_INT_24_8; + glDepthTextureInternalFormat = gl.DEPTH24_STENCIL8; + glDepthTextureFormat = gl.DEPTH_STENCIL; + glDepthTextureAttachment = gl.DEPTH_STENCIL_ATTACHMENT; + } + } + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, depthTexture._hardwareTexture.underlyingResource); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + gl.texImage2D(gl.TEXTURE_2D, 0, glDepthTextureInternalFormat, width, height, 0, glDepthTextureFormat, glDepthTextureType, null); + gl.framebufferTexture2D(gl.FRAMEBUFFER, glDepthTextureAttachment, gl.TEXTURE_2D, depthTexture._hardwareTexture.underlyingResource, 0); + depthTexture.baseWidth = width; + depthTexture.baseHeight = height; + depthTexture.width = width; + depthTexture.height = height; + depthTexture.isReady = true; + depthTexture.samples = 1; + depthTexture.generateMipMaps = generateMipMaps; + depthTexture.samplingMode = 1; + depthTexture.format = depthTextureFormat; + depthTexture.type = depthTextureType; + textures[textureCount] = depthTexture; + this._internalTexturesCache.push(depthTexture); + } + rtWrapper.setTextures(textures); + if (initializeBuffers) { + gl.drawBuffers(attachments); } - texture14.onLoadedObservable.notifyObservers(texture14); - texture14.onLoadedObservable.clear(); - if (onLoad) { - onLoad(); + this._bindUnboundFramebuffer(null); + rtWrapper.setLayerAndFaceIndices(layerIndex, faceIndex); + this.resetTextureCache(); + return rtWrapper; + }; + ThinEngine.prototype.updateMultipleRenderTargetTextureSampleCount = function(rtWrapper, samples, initializeBuffers = true) { + if (this.webGLVersion < 2 || !rtWrapper || !rtWrapper.texture) { + return 1; } - }, !!useSRGBBuffer); -}; -// node_modules/@babylonjs/core/Engines/Extensions/engine.textureSampler.js -ThinEngine.prototype.setTextureSampler = function(name74, sampler) { - throw new Error("setTextureSampler: This engine does not support separate texture sampler objects!"); -}; -// node_modules/@babylonjs/core/Engines/Extensions/engine.views.js -var _onBeforeViewRenderObservable = new Observable; -var _onAfterViewRenderObservable = new Observable; -Object.defineProperty(Engine2.prototype, "onBeforeViewRenderObservable", { - get: function() { - return _onBeforeViewRenderObservable; - } -}); -Object.defineProperty(Engine2.prototype, "onAfterViewRenderObservable", { - get: function() { - return _onAfterViewRenderObservable; - } + if (rtWrapper.samples === samples) { + return samples; + } + const count = rtWrapper._attachments.length; + if (count === 0) { + return 1; + } + const gl = this._gl; + samples = Math.min(samples, this.getCaps().maxMSAASamples); + const useDepthStencil = !!rtWrapper._depthStencilBuffer; + if (useDepthStencil) { + gl.deleteRenderbuffer(rtWrapper._depthStencilBuffer); + rtWrapper._depthStencilBuffer = null; + } + if (rtWrapper._MSAAFramebuffer) { + gl.deleteFramebuffer(rtWrapper._MSAAFramebuffer); + rtWrapper._MSAAFramebuffer = null; + } + if (samples > 1 && typeof gl.renderbufferStorageMultisample === "function") { + const framebuffer = gl.createFramebuffer(); + if (!framebuffer) { + throw new Error("Unable to create multi sampled framebuffer"); + } + rtWrapper._MSAAFramebuffer = framebuffer; + this._bindUnboundFramebuffer(framebuffer); + const attachments = []; + for (let i = 0;i < count; i++) { + const texture14 = rtWrapper.textures[i]; + const hardwareTexture = texture14._hardwareTexture; + hardwareTexture.releaseMSAARenderBuffers(); + } + for (let i = 0;i < count; i++) { + const texture14 = rtWrapper.textures[i]; + const hardwareTexture = texture14._hardwareTexture; + const attachment = gl[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"]; + const colorRenderbuffer = this._createRenderBuffer(texture14.width, texture14.height, samples, -1, this._getRGBABufferInternalSizedFormat(texture14.type, texture14.format, texture14._useSRGBBuffer), attachment); + if (!colorRenderbuffer) { + throw new Error("Unable to create multi sampled framebuffer"); + } + hardwareTexture.addMSAARenderBuffer(colorRenderbuffer); + texture14.samples = samples; + attachments.push(attachment); + } + if (initializeBuffers) { + gl.drawBuffers(attachments); + } + } else { + this._bindUnboundFramebuffer(rtWrapper._framebuffer); + } + if (useDepthStencil) { + rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(rtWrapper._generateStencilBuffer, rtWrapper._generateDepthBuffer, rtWrapper.texture.width, rtWrapper.texture.height, samples); + } + this._bindUnboundFramebuffer(null); + return samples; + }; }); -Object.defineProperty(Engine2.prototype, "inputElement", { - get: function() { - return this._inputElement; - }, - set: function(value) { - var _a; - if (this._inputElement !== value) { - this._inputElement = value; - (_a = this._onEngineViewChanged) === null || _a === undefined || _a.call(this); + +// node_modules/@babylonjs/core/Engines/Extensions/engine.cubeTexture.js +var init_engine_cubeTexture = __esm(() => { + init_thinEngine(); + init_internalTexture(); + init_logger(); + init_fileTools(); + init_guid(); + ThinEngine.prototype._createDepthStencilCubeTexture = function(size, options, rtWrapper) { + const internalTexture13 = new InternalTexture(this, InternalTextureSource.DepthStencil); + internalTexture13.isCube = true; + if (this.webGLVersion === 1) { + Logger.Error("Depth cube texture is not supported by WebGL 1."); + return internalTexture13; } - } + const internalOptions = Object.assign({ bilinearFiltering: false, comparisonFunction: 0, generateStencil: false }, options); + const gl = this._gl; + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, internalTexture13, true); + this._setupDepthStencilTexture(internalTexture13, size, internalOptions.generateStencil, internalOptions.bilinearFiltering, internalOptions.comparisonFunction); + rtWrapper._depthStencilTexture = internalTexture13; + rtWrapper._depthStencilTextureWithStencil = internalOptions.generateStencil; + for (let face = 0;face < 6; face++) { + if (internalOptions.generateStencil) { + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, gl.DEPTH24_STENCIL8, size, size, 0, gl.DEPTH_STENCIL, gl.UNSIGNED_INT_24_8, null); + } else { + gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + face, 0, gl.DEPTH_COMPONENT24, size, size, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_INT, null); + } + } + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + this._internalTexturesCache.push(internalTexture13); + return internalTexture13; + }; + ThinEngine.prototype._partialLoadFile = function(url, index, loadedFiles, onfinish, onErrorCallBack = null) { + const onload = (data) => { + loadedFiles[index] = data; + loadedFiles._internalCount++; + if (loadedFiles._internalCount === 6) { + onfinish(loadedFiles); + } + }; + const onerror = (request, exception) => { + if (onErrorCallBack && request) { + onErrorCallBack(request.status + " " + request.statusText, exception); + } + }; + this._loadFile(url, onload, undefined, undefined, true, onerror); + }; + ThinEngine.prototype._cascadeLoadFiles = function(scene19, onfinish, files, onError = null) { + const loadedFiles = []; + loadedFiles._internalCount = 0; + for (let index = 0;index < 6; index++) { + this._partialLoadFile(files[index], index, loadedFiles, onfinish, onError); + } + }; + ThinEngine.prototype._cascadeLoadImgs = function(scene19, texture14, onfinish, files, onError = null, mimeType) { + const loadedImages = []; + loadedImages._internalCount = 0; + for (let index = 0;index < 6; index++) { + this._partialLoadImg(files[index], index, loadedImages, scene19, texture14, onfinish, onError, mimeType); + } + }; + ThinEngine.prototype._partialLoadImg = function(url, index, loadedImages, scene19, texture14, onfinish, onErrorCallBack = null, mimeType) { + const tokenPendingData = RandomGUID(); + const onload = (img) => { + loadedImages[index] = img; + loadedImages._internalCount++; + if (scene19) { + scene19.removePendingData(tokenPendingData); + } + if (loadedImages._internalCount === 6 && onfinish) { + onfinish(texture14, loadedImages); + } + }; + const onerror = (message, exception) => { + if (scene19) { + scene19.removePendingData(tokenPendingData); + } + if (onErrorCallBack) { + onErrorCallBack(message, exception); + } + }; + LoadImage(url, onload, onerror, scene19 ? scene19.offlineProvider : null, mimeType); + if (scene19) { + scene19.addPendingData(tokenPendingData); + } + }; + ThinEngine.prototype._setCubeMapTextureParams = function(texture14, loadMipmap, maxLevel) { + const gl = this._gl; + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, loadMipmap ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + texture14.samplingMode = loadMipmap ? 3 : 2; + if (loadMipmap && this.getCaps().textureMaxLevel && maxLevel !== undefined && maxLevel > 0) { + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAX_LEVEL, maxLevel); + texture14._maxLodLevel = maxLevel; + } + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + }; + ThinEngine.prototype.createCubeTextureBase = function(rootUrl, scene19, files, noMipmap, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = false, lodScale = 0, lodOffset = 0, fallback = null, beforeLoadCubeDataCallback = null, imageHandler = null, useSRGBBuffer = false) { + const texture14 = fallback ? fallback : new InternalTexture(this, InternalTextureSource.Cube); + texture14.isCube = true; + texture14.url = rootUrl; + texture14.generateMipMaps = !noMipmap; + texture14._lodGenerationScale = lodScale; + texture14._lodGenerationOffset = lodOffset; + texture14._useSRGBBuffer = !!useSRGBBuffer && this._caps.supportSRGBBuffers && (this.webGLVersion > 1 || this.isWebGPU || !!noMipmap); + if (texture14 !== fallback) { + texture14.label = rootUrl.substring(0, 60); + } + if (!this._doNotHandleContextLost) { + texture14._extension = forcedExtension; + texture14._files = files; + } + const originalRootUrl = rootUrl; + if (this._transformTextureUrl && !fallback) { + rootUrl = this._transformTextureUrl(rootUrl); + } + const rootUrlWithoutUriParams = rootUrl.split("?")[0]; + const lastDot = rootUrlWithoutUriParams.lastIndexOf("."); + const extension = forcedExtension ? forcedExtension : lastDot > -1 ? rootUrlWithoutUriParams.substring(lastDot).toLowerCase() : ""; + let loader = null; + for (const availableLoader of ThinEngine._TextureLoaders) { + if (availableLoader.canLoad(extension)) { + loader = availableLoader; + break; + } + } + const onInternalError = (request, exception) => { + if (rootUrl === originalRootUrl) { + if (onError && request) { + onError(request.status + " " + request.statusText, exception); + } + } else { + Logger.Warn(`Failed to load ${rootUrl}, falling back to the ${originalRootUrl}`); + this.createCubeTextureBase(originalRootUrl, scene19, files, !!noMipmap, onLoad, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset, texture14, beforeLoadCubeDataCallback, imageHandler, useSRGBBuffer); + } + }; + if (loader) { + const onloaddata = (data) => { + if (beforeLoadCubeDataCallback) { + beforeLoadCubeDataCallback(texture14, data); + } + loader.loadCubeData(data, texture14, createPolynomials, onLoad, onError); + }; + if (files && files.length === 6) { + if (loader.supportCascades) { + this._cascadeLoadFiles(scene19, (images) => onloaddata(images.map((image) => new Uint8Array(image))), files, onError); + } else { + if (onError) { + onError("Textures type does not support cascades."); + } else { + Logger.Warn("Texture loader does not support cascades."); + } + } + } else { + this._loadFile(rootUrl, (data) => onloaddata(new Uint8Array(data)), undefined, undefined, true, onInternalError); + } + } else { + if (!files) { + throw new Error("Cannot load cubemap because files were not defined"); + } + this._cascadeLoadImgs(scene19, texture14, (texture15, imgs) => { + if (imageHandler) { + imageHandler(texture15, imgs); + } + }, files, onError); + } + this._internalTexturesCache.push(texture14); + return texture14; + }; + ThinEngine.prototype.createCubeTexture = function(rootUrl, scene19, files, noMipmap, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = false, lodScale = 0, lodOffset = 0, fallback = null, loaderOptions, useSRGBBuffer = false) { + const gl = this._gl; + return this.createCubeTextureBase(rootUrl, scene19, files, !!noMipmap, onLoad, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset, fallback, (texture14) => this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture14, true), (texture14, imgs) => { + const width = this.needPOTTextures ? ThinEngine.GetExponentOfTwo(imgs[0].width, this._caps.maxCubemapTextureSize) : imgs[0].width; + const height = width; + const faces = [ + gl.TEXTURE_CUBE_MAP_POSITIVE_X, + gl.TEXTURE_CUBE_MAP_POSITIVE_Y, + gl.TEXTURE_CUBE_MAP_POSITIVE_Z, + gl.TEXTURE_CUBE_MAP_NEGATIVE_X, + gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, + gl.TEXTURE_CUBE_MAP_NEGATIVE_Z + ]; + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture14, true); + this._unpackFlipY(false); + const internalFormat = format ? this._getInternalFormat(format, texture14._useSRGBBuffer) : texture14._useSRGBBuffer ? this._glSRGBExtensionValues.SRGB8_ALPHA8 : gl.RGBA; + let texelFormat = format ? this._getInternalFormat(format) : gl.RGBA; + if (texture14._useSRGBBuffer && this.webGLVersion === 1) { + texelFormat = internalFormat; + } + for (let index = 0;index < faces.length; index++) { + if (imgs[index].width !== width || imgs[index].height !== height) { + this._prepareWorkingCanvas(); + if (!this._workingCanvas || !this._workingContext) { + Logger.Warn("Cannot create canvas to resize texture."); + return; + } + this._workingCanvas.width = width; + this._workingCanvas.height = height; + this._workingContext.drawImage(imgs[index], 0, 0, imgs[index].width, imgs[index].height, 0, 0, width, height); + gl.texImage2D(faces[index], 0, internalFormat, texelFormat, gl.UNSIGNED_BYTE, this._workingCanvas); + } else { + gl.texImage2D(faces[index], 0, internalFormat, texelFormat, gl.UNSIGNED_BYTE, imgs[index]); + } + } + if (!noMipmap) { + gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + } + this._setCubeMapTextureParams(texture14, !noMipmap); + texture14.width = width; + texture14.height = height; + texture14.isReady = true; + if (format) { + texture14.format = format; + } + texture14.onLoadedObservable.notifyObservers(texture14); + texture14.onLoadedObservable.clear(); + if (onLoad) { + onLoad(); + } + }, !!useSRGBBuffer); + }; }); -Engine2.prototype.getInputElement = function() { - return this.inputElement || this.getRenderingCanvas(); -}; -Engine2.prototype.registerView = function(canvas, camera25, clearBeforeCopy) { - if (!this.views) { - this.views = []; - } - for (const view of this.views) { - if (view.target === canvas) { - return view; + +// node_modules/@babylonjs/core/Engines/Extensions/engine.textureSampler.js +var init_engine_textureSampler = __esm(() => { + init_thinEngine(); + ThinEngine.prototype.setTextureSampler = function(name75, sampler) { + throw new Error("setTextureSampler: This engine does not support separate texture sampler objects!"); + }; +}); + +// node_modules/@babylonjs/core/Engines/Extensions/engine.views.js +class EngineView { +} +var _onBeforeViewRenderObservable, _onAfterViewRenderObservable; +var init_engine_views = __esm(() => { + init_engine(); + init_observable(); + _onBeforeViewRenderObservable = new Observable; + _onAfterViewRenderObservable = new Observable; + Object.defineProperty(Engine2.prototype, "onBeforeViewRenderObservable", { + get: function() { + return _onBeforeViewRenderObservable; } - } - const masterCanvas = this.getRenderingCanvas(); - if (masterCanvas) { - canvas.width = masterCanvas.width; - canvas.height = masterCanvas.height; - } - const newView = { target: canvas, camera: camera25, clearBeforeCopy, enabled: true, id: (Math.random() * 1e5).toFixed() }; - this.views.push(newView); - if (camera25 && !Array.isArray(camera25)) { - camera25.onDisposeObservable.add(() => { - this.unRegisterView(canvas); - }); - } - return newView; -}; -Engine2.prototype.unRegisterView = function(canvas) { - if (!this.views || this.views.length === 0) { - return this; - } - for (const view of this.views) { - if (view.target === canvas) { - const index = this.views.indexOf(view); - if (index !== -1) { - this.views.splice(index, 1); + }); + Object.defineProperty(Engine2.prototype, "onAfterViewRenderObservable", { + get: function() { + return _onAfterViewRenderObservable; + } + }); + Object.defineProperty(Engine2.prototype, "inputElement", { + get: function() { + return this._inputElement; + }, + set: function(value) { + var _a; + if (this._inputElement !== value) { + this._inputElement = value; + (_a = this._onEngineViewChanged) === null || _a === undefined || _a.call(this); } - break; } - } - return this; -}; -Engine2.prototype._renderViewStep = function(view) { - const canvas = view.target; - const context = canvas.getContext("2d"); - if (!context) { - return true; - } - const parent = this.getRenderingCanvas(); - _onBeforeViewRenderObservable.notifyObservers(view); - const camera25 = view.camera; - let previewCamera = null; - let previewCameras = null; - let scene19 = null; - if (camera25) { - scene19 = Array.isArray(camera25) ? camera25[0].getScene() : camera25.getScene(); - previewCamera = scene19.activeCamera; - previewCameras = scene19.activeCameras; - this.activeView = view; - if (Array.isArray(camera25)) { - scene19.activeCameras = camera25; - } else { - scene19.activeCamera = camera25; - scene19.activeCameras = null; - } - } - if (view.customResize) { - view.customResize(canvas); - } else { - const width = Math.floor(canvas.clientWidth / this._hardwareScalingLevel); - const height = Math.floor(canvas.clientHeight / this._hardwareScalingLevel); - const dimsChanged = width !== canvas.width || parent.width !== canvas.width || height !== canvas.height || parent.height !== canvas.height; - if (canvas.clientWidth && canvas.clientHeight && dimsChanged) { - canvas.width = width; - canvas.height = height; - this.setSize(width, height); + }); + Engine2.prototype.getInputElement = function() { + return this.inputElement || this.getRenderingCanvas(); + }; + Engine2.prototype.registerView = function(canvas, camera25, clearBeforeCopy) { + if (!this.views) { + this.views = []; } - } - if (!parent.width || !parent.height) { - return false; - } - this._renderFrame(); - this.flushFramebuffer(); - if (view.clearBeforeCopy) { - context.clearRect(0, 0, parent.width, parent.height); - } - context.drawImage(parent, 0, 0); - if (scene19) { - scene19.activeCameras = previewCameras; - scene19.activeCamera = previewCamera; - } - _onAfterViewRenderObservable.notifyObservers(view); - return true; -}; -Engine2.prototype._renderViews = function() { - if (!this.views || this.views.length === 0) { - return false; - } - const parent = this.getRenderingCanvas(); - if (!parent) { - return false; - } - let inputElementView; - for (const view of this.views) { - if (!view.enabled) { - continue; + for (const view of this.views) { + if (view.target === canvas) { + return view; + } + } + const masterCanvas = this.getRenderingCanvas(); + if (masterCanvas) { + canvas.width = masterCanvas.width; + canvas.height = masterCanvas.height; + } + const newView = { target: canvas, camera: camera25, clearBeforeCopy, enabled: true, id: (Math.random() * 1e5).toFixed() }; + this.views.push(newView); + if (camera25 && !Array.isArray(camera25)) { + camera25.onDisposeObservable.add(() => { + this.unRegisterView(canvas); + }); + } + return newView; + }; + Engine2.prototype.unRegisterView = function(canvas) { + if (!this.views || this.views.length === 0) { + return this; + } + for (const view of this.views) { + if (view.target === canvas) { + const index = this.views.indexOf(view); + if (index !== -1) { + this.views.splice(index, 1); + } + break; + } } + return this; + }; + Engine2.prototype._renderViewStep = function(view) { const canvas = view.target; - if (canvas === this.inputElement) { - inputElementView = view; - continue; + const context = canvas.getContext("2d"); + if (!context) { + return true; } - if (!this._renderViewStep(view)) { - return false; + const parent = this.getRenderingCanvas(); + _onBeforeViewRenderObservable.notifyObservers(view); + const camera25 = view.camera; + let previewCamera = null; + let previewCameras = null; + let scene19 = null; + if (camera25) { + scene19 = Array.isArray(camera25) ? camera25[0].getScene() : camera25.getScene(); + previewCamera = scene19.activeCamera; + previewCameras = scene19.activeCameras; + this.activeView = view; + if (Array.isArray(camera25)) { + scene19.activeCameras = camera25; + } else { + scene19.activeCamera = camera25; + scene19.activeCameras = null; + } } - } - if (inputElementView) { - if (!this._renderViewStep(inputElementView)) { + if (view.customResize) { + view.customResize(canvas); + } else { + const width = Math.floor(canvas.clientWidth / this._hardwareScalingLevel); + const height = Math.floor(canvas.clientHeight / this._hardwareScalingLevel); + const dimsChanged = width !== canvas.width || parent.width !== canvas.width || height !== canvas.height || parent.height !== canvas.height; + if (canvas.clientWidth && canvas.clientHeight && dimsChanged) { + canvas.width = width; + canvas.height = height; + this.setSize(width, height); + } + } + if (!parent.width || !parent.height) { return false; } - } - this.activeView = null; - return true; -}; -// node_modules/@babylonjs/core/Engines/Extensions/engine.storageBuffer.js -ThinEngine.prototype.createStorageBuffer = function(data, creationFlags) { - throw new Error("createStorageBuffer: Unsupported method in this engine!"); -}; -ThinEngine.prototype.updateStorageBuffer = function(buffer27, data, byteOffset, byteLength) { -}; -ThinEngine.prototype.readFromStorageBuffer = function(storageBuffer2, offset, size, buffer27) { - throw new Error("readFromStorageBuffer: Unsupported method in this engine!"); -}; -ThinEngine.prototype.setStorageBuffer = function(name74, buffer27) { - throw new Error("setStorageBuffer: Unsupported method in this engine!"); -}; -// node_modules/@babylonjs/core/Engines/Extensions/engine.textureSelector.js -var transformTextureUrl = function(url) { - const excludeFn = (entry) => { - const strRegExPattern = "\\b" + entry + "\\b"; - return url && (url === entry || url.match(new RegExp(strRegExPattern, "g"))); - }; - if (this._excludedCompressedTextures && this._excludedCompressedTextures.some(excludeFn)) { - return url; - } - const lastDot = url.lastIndexOf("."); - const lastQuestionMark = url.lastIndexOf("?"); - const querystring = lastQuestionMark > -1 ? url.substring(lastQuestionMark, url.length) : ""; - return (lastDot > -1 ? url.substring(0, lastDot) : url) + this._textureFormatInUse + querystring; -}; -Object.defineProperty(Engine2.prototype, "texturesSupported", { - get: function() { - const texturesSupported = []; - if (this._caps.astc) { - texturesSupported.push("-astc.ktx"); + this._renderFrame(); + this.flushFramebuffer(); + if (view.clearBeforeCopy) { + context.clearRect(0, 0, parent.width, parent.height); + } + context.drawImage(parent, 0, 0); + if (scene19) { + scene19.activeCameras = previewCameras; + scene19.activeCamera = previewCamera; } - if (this._caps.s3tc) { - texturesSupported.push("-dxt.ktx"); + _onAfterViewRenderObservable.notifyObservers(view); + return true; + }; + Engine2.prototype._renderViews = function() { + if (!this.views || this.views.length === 0) { + return false; } - if (this._caps.pvrtc) { - texturesSupported.push("-pvrtc.ktx"); + const parent = this.getRenderingCanvas(); + if (!parent) { + return false; } - if (this._caps.etc2) { - texturesSupported.push("-etc2.ktx"); + let inputElementView; + for (const view of this.views) { + if (!view.enabled) { + continue; + } + const canvas = view.target; + if (canvas === this.inputElement) { + inputElementView = view; + continue; + } + if (!this._renderViewStep(view)) { + return false; + } } - if (this._caps.etc1) { - texturesSupported.push("-etc1.ktx"); + if (inputElementView) { + if (!this._renderViewStep(inputElementView)) { + return false; + } } - return texturesSupported; - }, - enumerable: true, - configurable: true + this.activeView = null; + return true; + }; }); -Object.defineProperty(Engine2.prototype, "textureFormatInUse", { - get: function() { - return this._textureFormatInUse || null; - }, - enumerable: true, - configurable: true + +// node_modules/@babylonjs/core/Engines/Extensions/engine.storageBuffer.js +var init_engine_storageBuffer = __esm(() => { + init_thinEngine(); + ThinEngine.prototype.createStorageBuffer = function(data, creationFlags) { + throw new Error("createStorageBuffer: Unsupported method in this engine!"); + }; + ThinEngine.prototype.updateStorageBuffer = function(buffer27, data, byteOffset, byteLength) { + }; + ThinEngine.prototype.readFromStorageBuffer = function(storageBuffer2, offset, size, buffer27) { + throw new Error("readFromStorageBuffer: Unsupported method in this engine!"); + }; + ThinEngine.prototype.setStorageBuffer = function(name75, buffer27) { + throw new Error("setStorageBuffer: Unsupported method in this engine!"); + }; }); -Engine2.prototype.setCompressedTextureExclusions = function(skippedFiles) { - this._excludedCompressedTextures = skippedFiles; -}; -Engine2.prototype.setTextureFormatToUse = function(formatsAvailable) { - const texturesSupported = this.texturesSupported; - for (let i = 0, len1 = texturesSupported.length;i < len1; i++) { - for (let j = 0, len2 = formatsAvailable.length;j < len2; j++) { - if (texturesSupported[i] === formatsAvailable[j].toLowerCase()) { - this._transformTextureUrl = transformTextureUrl.bind(this); - return this._textureFormatInUse = texturesSupported[i]; + +// node_modules/@babylonjs/core/Engines/Extensions/engine.textureSelector.js +var transformTextureUrl; +var init_engine_textureSelector = __esm(() => { + init_engine(); + transformTextureUrl = function(url) { + const excludeFn = (entry) => { + const strRegExPattern = "\\b" + entry + "\\b"; + return url && (url === entry || url.match(new RegExp(strRegExPattern, "g"))); + }; + if (this._excludedCompressedTextures && this._excludedCompressedTextures.some(excludeFn)) { + return url; + } + const lastDot = url.lastIndexOf("."); + const lastQuestionMark = url.lastIndexOf("?"); + const querystring = lastQuestionMark > -1 ? url.substring(lastQuestionMark, url.length) : ""; + return (lastDot > -1 ? url.substring(0, lastDot) : url) + this._textureFormatInUse + querystring; + }; + Object.defineProperty(Engine2.prototype, "texturesSupported", { + get: function() { + const texturesSupported = []; + if (this._caps.astc) { + texturesSupported.push("-astc.ktx"); + } + if (this._caps.s3tc) { + texturesSupported.push("-dxt.ktx"); + } + if (this._caps.pvrtc) { + texturesSupported.push("-pvrtc.ktx"); + } + if (this._caps.etc2) { + texturesSupported.push("-etc2.ktx"); + } + if (this._caps.etc1) { + texturesSupported.push("-etc1.ktx"); + } + return texturesSupported; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Engine2.prototype, "textureFormatInUse", { + get: function() { + return this._textureFormatInUse || null; + }, + enumerable: true, + configurable: true + }); + Engine2.prototype.setCompressedTextureExclusions = function(skippedFiles) { + this._excludedCompressedTextures = skippedFiles; + }; + Engine2.prototype.setTextureFormatToUse = function(formatsAvailable) { + const texturesSupported = this.texturesSupported; + for (let i = 0, len1 = texturesSupported.length;i < len1; i++) { + for (let j = 0, len2 = formatsAvailable.length;j < len2; j++) { + if (texturesSupported[i] === formatsAvailable[j].toLowerCase()) { + this._transformTextureUrl = transformTextureUrl.bind(this); + return this._textureFormatInUse = texturesSupported[i]; + } } } - } - this._textureFormatInUse = ""; - this._transformTextureUrl = null; - return null; -}; + this._textureFormatInUse = ""; + this._transformTextureUrl = null; + return null; + }; +}); + +// node_modules/@babylonjs/core/Engines/Extensions/index.js +var init_Extensions = __esm(() => { + init_engine_alpha(); + init_engine_debugging(); + init_engine_query(); + init_engine_transformFeedback(); + init_engine_multiview(); + init_engine_rawTexture(); + init_engine_dynamicTexture(); + init_engine_externalTexture(); + init_engine_videoTexture(); + init_engine_multiRender(); + init_engine_cubeTexture(); + init_engine_renderTarget(); + init_engine_renderTargetCube(); + init_engine_textureSampler(); + init_engine_uniformBuffer(); + init_engine_dynamicBuffer(); + init_engine_views(); + init_engine_readTexture(); + init_engine_computeShader(); + init_engine_storageBuffer(); + init_engine_textureSelector(); + init_engine_textureSelector(); +}); + // node_modules/@babylonjs/core/Engines/Native/nativeDataStream.js class NativeDataStream { constructor() { @@ -85080,35 +90945,11 @@ class NativeDataStream { this._position = 0; } } -NativeDataStream.DEFAULT_BUFFER_SIZE = 65536; -// node_modules/@babylonjs/core/Maths/sphericalPolynomial.js -var SH3ylmBasisConstants = [ - Math.sqrt(1 / (4 * Math.PI)), - -Math.sqrt(3 / (4 * Math.PI)), - Math.sqrt(3 / (4 * Math.PI)), - -Math.sqrt(3 / (4 * Math.PI)), - Math.sqrt(15 / (4 * Math.PI)), - -Math.sqrt(15 / (4 * Math.PI)), - Math.sqrt(5 / (16 * Math.PI)), - -Math.sqrt(15 / (4 * Math.PI)), - Math.sqrt(15 / (16 * Math.PI)) -]; -var SH3ylmBasisTrigonometricTerms = [ - () => 1, - (direction) => direction.y, - (direction) => direction.z, - (direction) => direction.x, - (direction) => direction.x * direction.y, - (direction) => direction.y * direction.z, - (direction) => 3 * direction.z * direction.z - 1, - (direction) => direction.x * direction.z, - (direction) => direction.x * direction.x - direction.y * direction.y -]; -var applySH3 = (lm, direction) => { - return SH3ylmBasisConstants[lm] * SH3ylmBasisTrigonometricTerms[lm](direction); -}; -var SHCosKernelConvolution = [Math.PI, 2 * Math.PI / 3, 2 * Math.PI / 3, 2 * Math.PI / 3, Math.PI / 4, Math.PI / 4, Math.PI / 4, Math.PI / 4, Math.PI / 4]; +var init_nativeDataStream = __esm(() => { + NativeDataStream.DEFAULT_BUFFER_SIZE = 65536; +}); +// node_modules/@babylonjs/core/Maths/sphericalPolynomial.js class SphericalHarmonics { constructor() { this.preScaled = false; @@ -85314,15 +91155,51 @@ class SphericalPolynomial { return sp; } } +var SH3ylmBasisConstants, SH3ylmBasisTrigonometricTerms, applySH3, SHCosKernelConvolution; +var init_sphericalPolynomial = __esm(() => { + init_math_vector(); + init_math(); + SH3ylmBasisConstants = [ + Math.sqrt(1 / (4 * Math.PI)), + -Math.sqrt(3 / (4 * Math.PI)), + Math.sqrt(3 / (4 * Math.PI)), + -Math.sqrt(3 / (4 * Math.PI)), + Math.sqrt(15 / (4 * Math.PI)), + -Math.sqrt(15 / (4 * Math.PI)), + Math.sqrt(5 / (16 * Math.PI)), + -Math.sqrt(15 / (4 * Math.PI)), + Math.sqrt(15 / (16 * Math.PI)) + ]; + SH3ylmBasisTrigonometricTerms = [ + () => 1, + (direction) => direction.y, + (direction) => direction.z, + (direction) => direction.x, + (direction) => direction.x * direction.y, + (direction) => direction.y * direction.z, + (direction) => 3 * direction.z * direction.z - 1, + (direction) => direction.x * direction.z, + (direction) => direction.x * direction.x - direction.y * direction.y + ]; + applySH3 = (lm, direction) => { + return SH3ylmBasisConstants[lm] * SH3ylmBasisTrigonometricTerms[lm](direction); + }; + SHCosKernelConvolution = [Math.PI, 2 * Math.PI / 3, 2 * Math.PI / 3, 2 * Math.PI / 3, Math.PI / 4, Math.PI / 4, Math.PI / 4, Math.PI / 4, Math.PI / 4]; +}); // node_modules/@babylonjs/core/Shaders/rgbdDecode.fragment.js -var name74 = "rgbdDecodePixelShader"; -var shader74 = `varying vec2 vUV;uniform sampler2D textureSampler; +var name75, shader74; +var init_rgbdDecode_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + name75 = "rgbdDecodePixelShader"; + shader74 = `varying vec2 vUV;uniform sampler2D textureSampler; #include #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {gl_FragColor=vec4(fromRGBD(texture2D(textureSampler,vUV)),1.0);}`; -ShaderStore.ShadersStore[name74] = shader74; + ShaderStore.ShadersStore[name75] = shader74; +}); // node_modules/@babylonjs/core/Misc/textureTools.js function CreateResizedCopy(texture15, width, height, useBilinearMode = true) { @@ -85454,59 +91331,64 @@ async function GetTextureDataAsync(texture15, width, height, face = 0, lod = 0) } return await ProcessAsync(texture15, width, height, face, lod); } -var floatView; -var int32View; -var ProcessAsync = async (texture15, width, height, face, lod) => { - const scene19 = texture15.getScene(); - const engine24 = scene19.getEngine(); - let lodPostProcess; - if (!texture15.isCube) { - lodPostProcess = new PostProcess("lod", "lod", ["lod", "gamma"], null, 1, null, Texture.NEAREST_NEAREST_MIPNEAREST, engine24); - } else { - const faceDefines = ["#define POSITIVEX", "#define NEGATIVEX", "#define POSITIVEY", "#define NEGATIVEY", "#define POSITIVEZ", "#define NEGATIVEZ"]; - lodPostProcess = new PostProcess("lodCube", "lodCube", ["lod", "gamma"], null, 1, null, Texture.NEAREST_NEAREST_MIPNEAREST, engine24, false, faceDefines[face]); - } - await new Promise((resolve) => { - lodPostProcess.getEffect().executeWhenCompiled(() => { - resolve(0); - }); - }); - const rtt = new RenderTargetTexture("temp", { width, height }, scene19, false); - lodPostProcess.onApply = function(effect6) { - effect6.setTexture("textureSampler", texture15); - effect6.setFloat("lod", lod); - effect6.setBool("gamma", texture15.gammaSpace); - }; - const internalTexture13 = texture15.getInternalTexture(); - try { - if (rtt.renderTarget && internalTexture13) { - const samplingMode = internalTexture13.samplingMode; - if (lod !== 0) { - texture15.updateSamplingMode(Texture.NEAREST_NEAREST_MIPNEAREST); - } else { - texture15.updateSamplingMode(Texture.NEAREST_NEAREST); - } - scene19.postProcessManager.directRender([lodPostProcess], rtt.renderTarget, true); - texture15.updateSamplingMode(samplingMode); - const bufferView = await engine24.readPixels(0, 0, width, height); - const data = new Uint8Array(bufferView.buffer, 0, bufferView.byteLength); - engine24.unBindFramebuffer(rtt.renderTarget); - return data; +var floatView, int32View, ProcessAsync, TextureTools; +var init_textureTools = __esm(() => { + init_texture(); + init_renderTargetTexture(); + init_passPostProcess(); + init_postProcess(); + ProcessAsync = async (texture15, width, height, face, lod) => { + const scene19 = texture15.getScene(); + const engine24 = scene19.getEngine(); + let lodPostProcess; + if (!texture15.isCube) { + lodPostProcess = new PostProcess("lod", "lod", ["lod", "gamma"], null, 1, null, Texture.NEAREST_NEAREST_MIPNEAREST, engine24); } else { - throw Error("Render to texture failed."); + const faceDefines = ["#define POSITIVEX", "#define NEGATIVEX", "#define POSITIVEY", "#define NEGATIVEY", "#define POSITIVEZ", "#define NEGATIVEZ"]; + lodPostProcess = new PostProcess("lodCube", "lodCube", ["lod", "gamma"], null, 1, null, Texture.NEAREST_NEAREST_MIPNEAREST, engine24, false, faceDefines[face]); } - } finally { - rtt.dispose(); - lodPostProcess.dispose(); - } -}; -var TextureTools = { - CreateResizedCopy, - ApplyPostProcess, - ToHalfFloat, - FromHalfFloat, - GetTextureDataAsync -}; + await new Promise((resolve) => { + lodPostProcess.getEffect().executeWhenCompiled(() => { + resolve(0); + }); + }); + const rtt = new RenderTargetTexture("temp", { width, height }, scene19, false); + lodPostProcess.onApply = function(effect6) { + effect6.setTexture("textureSampler", texture15); + effect6.setFloat("lod", lod); + effect6.setBool("gamma", texture15.gammaSpace); + }; + const internalTexture13 = texture15.getInternalTexture(); + try { + if (rtt.renderTarget && internalTexture13) { + const samplingMode = internalTexture13.samplingMode; + if (lod !== 0) { + texture15.updateSamplingMode(Texture.NEAREST_NEAREST_MIPNEAREST); + } else { + texture15.updateSamplingMode(Texture.NEAREST_NEAREST); + } + scene19.postProcessManager.directRender([lodPostProcess], rtt.renderTarget, true); + texture15.updateSamplingMode(samplingMode); + const bufferView = await engine24.readPixels(0, 0, width, height); + const data = new Uint8Array(bufferView.buffer, 0, bufferView.byteLength); + engine24.unBindFramebuffer(rtt.renderTarget); + return data; + } else { + throw Error("Render to texture failed."); + } + } finally { + rtt.dispose(); + lodPostProcess.dispose(); + } + }; + TextureTools = { + CreateResizedCopy, + ApplyPostProcess, + ToHalfFloat, + FromHalfFloat, + GetTextureDataAsync + }; +}); // node_modules/@babylonjs/core/Misc/rgbdTextureTools.js class RGBDTextureTools { @@ -85569,11 +91451,17 @@ class RGBDTextureTools { return ApplyPostProcess("rgbdEncode", internalTexture13, scene19, outputTextureType, 1, 5); } } +var init_rgbdTextureTools = __esm(() => { + init_postProcess(); + init_rgbdDecode_fragment(); + init_engine_renderTarget(); + init_textureTools(); +}); // node_modules/@babylonjs/core/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js class FileFaceOrientation { - constructor(name75, worldAxisForNormal, worldAxisForFileX, worldAxisForFileY) { - this.name = name75; + constructor(name76, worldAxisForNormal, worldAxisForFileX, worldAxisForFileY) { + this.name = name76; this.worldAxisForNormal = worldAxisForNormal; this.worldAxisForFileX = worldAxisForFileX; this.worldAxisForFileY = worldAxisForFileY; @@ -85700,65 +91588,81 @@ class CubeMapToSphericalPolynomialTools { return SphericalPolynomial.FromHarmonics(sphericalHarmonics); } } -CubeMapToSphericalPolynomialTools._FileFaces = [ - new FileFaceOrientation("right", new Vector3(1, 0, 0), new Vector3(0, 0, -1), new Vector3(0, -1, 0)), - new FileFaceOrientation("left", new Vector3(-1, 0, 0), new Vector3(0, 0, 1), new Vector3(0, -1, 0)), - new FileFaceOrientation("up", new Vector3(0, 1, 0), new Vector3(1, 0, 0), new Vector3(0, 0, 1)), - new FileFaceOrientation("down", new Vector3(0, -1, 0), new Vector3(1, 0, 0), new Vector3(0, 0, -1)), - new FileFaceOrientation("front", new Vector3(0, 0, 1), new Vector3(1, 0, 0), new Vector3(0, -1, 0)), - new FileFaceOrientation("back", new Vector3(0, 0, -1), new Vector3(-1, 0, 0), new Vector3(0, -1, 0)) -]; -CubeMapToSphericalPolynomialTools.MAX_HDRI_VALUE = 4096; -CubeMapToSphericalPolynomialTools.PRESERVE_CLAMPED_COLORS = false; +var init_cubemapToSphericalPolynomial = __esm(() => { + init_math_vector(); + init_math_scalar(); + init_sphericalPolynomial(); + init_math_constants(); + init_math_color(); + CubeMapToSphericalPolynomialTools._FileFaces = [ + new FileFaceOrientation("right", new Vector3(1, 0, 0), new Vector3(0, 0, -1), new Vector3(0, -1, 0)), + new FileFaceOrientation("left", new Vector3(-1, 0, 0), new Vector3(0, 0, 1), new Vector3(0, -1, 0)), + new FileFaceOrientation("up", new Vector3(0, 1, 0), new Vector3(1, 0, 0), new Vector3(0, 0, 1)), + new FileFaceOrientation("down", new Vector3(0, -1, 0), new Vector3(1, 0, 0), new Vector3(0, 0, -1)), + new FileFaceOrientation("front", new Vector3(0, 0, 1), new Vector3(1, 0, 0), new Vector3(0, -1, 0)), + new FileFaceOrientation("back", new Vector3(0, 0, -1), new Vector3(-1, 0, 0), new Vector3(0, -1, 0)) + ]; + CubeMapToSphericalPolynomialTools.MAX_HDRI_VALUE = 4096; + CubeMapToSphericalPolynomialTools.PRESERVE_CLAMPED_COLORS = false; +}); // node_modules/@babylonjs/core/Materials/Textures/baseTexture.polynomial.js -BaseTexture.prototype.forceSphericalPolynomialsRecompute = function() { - if (this._texture) { - this._texture._sphericalPolynomial = null; - this._texture._sphericalPolynomialPromise = null; - this._texture._sphericalPolynomialComputed = false; - } -}; -Object.defineProperty(BaseTexture.prototype, "sphericalPolynomial", { - get: function() { +var init_baseTexture_polynomial = __esm(() => { + init_cubemapToSphericalPolynomial(); + init_baseTexture(); + BaseTexture.prototype.forceSphericalPolynomialsRecompute = function() { if (this._texture) { - if (this._texture._sphericalPolynomial || this._texture._sphericalPolynomialComputed) { - return this._texture._sphericalPolynomial; - } - if (this._texture.isReady) { - if (!this._texture._sphericalPolynomialPromise) { - this._texture._sphericalPolynomialPromise = CubeMapToSphericalPolynomialTools.ConvertCubeMapTextureToSphericalPolynomial(this); - if (this._texture._sphericalPolynomialPromise === null) { - this._texture._sphericalPolynomialComputed = true; - } else { - this._texture._sphericalPolynomialPromise.then((sphericalPolynomial2) => { - this._texture._sphericalPolynomial = sphericalPolynomial2; + this._texture._sphericalPolynomial = null; + this._texture._sphericalPolynomialPromise = null; + this._texture._sphericalPolynomialComputed = false; + } + }; + Object.defineProperty(BaseTexture.prototype, "sphericalPolynomial", { + get: function() { + if (this._texture) { + if (this._texture._sphericalPolynomial || this._texture._sphericalPolynomialComputed) { + return this._texture._sphericalPolynomial; + } + if (this._texture.isReady) { + if (!this._texture._sphericalPolynomialPromise) { + this._texture._sphericalPolynomialPromise = CubeMapToSphericalPolynomialTools.ConvertCubeMapTextureToSphericalPolynomial(this); + if (this._texture._sphericalPolynomialPromise === null) { this._texture._sphericalPolynomialComputed = true; - }); + } else { + this._texture._sphericalPolynomialPromise.then((sphericalPolynomial2) => { + this._texture._sphericalPolynomial = sphericalPolynomial2; + this._texture._sphericalPolynomialComputed = true; + }); + } } + return null; } - return null; } - } - return null; - }, - set: function(value) { - if (this._texture) { - this._texture._sphericalPolynomial = value; - } - }, - enumerable: true, - configurable: true + return null; + }, + set: function(value) { + if (this._texture) { + this._texture._sphericalPolynomial = value; + } + }, + enumerable: true, + configurable: true + }); }); // node_modules/@babylonjs/core/Shaders/rgbdEncode.fragment.js -var name75 = "rgbdEncodePixelShader"; -var shader75 = `varying vec2 vUV;uniform sampler2D textureSampler; +var name76, shader75; +var init_rgbdEncode_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + name76 = "rgbdEncodePixelShader"; + shader75 = `varying vec2 vUV;uniform sampler2D textureSampler; #include #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {gl_FragColor=toRGBD(texture2D(textureSampler,vUV).rgb);}`; -ShaderStore.ShadersStore[name75] = shader75; + ShaderStore.ShadersStore[name76] = shader75; +}); // node_modules/@babylonjs/core/Misc/environmentTextureTools.js function GetEnvInfo(data) { @@ -85793,6 +91697,107 @@ function normalizeEnvInfo(info) { info = Object.assign(Object.assign({}, info), { version: 2, imageType: DefaultEnvironmentTextureImageType }); return info; } +async function CreateEnvTextureAsync(texture15, options = {}) { + var _a, _b; + const internalTexture14 = texture15.getInternalTexture(); + if (!internalTexture14) { + return Promise.reject("The cube texture is invalid."); + } + const imageType = (_a = options.imageType) !== null && _a !== undefined ? _a : DefaultEnvironmentTextureImageType; + const engine24 = internalTexture14.getEngine(); + if (texture15.textureType !== 2 && texture15.textureType !== 1 && texture15.textureType !== 0 && texture15.textureType !== 0 && texture15.textureType !== 7 && texture15.textureType !== -1) { + return Promise.reject("The cube texture should allow HDR (Full Float or Half Float)."); + } + let textureType = 1; + if (!engine24.getCaps().textureFloatRender) { + textureType = 2; + if (!engine24.getCaps().textureHalfFloatRender) { + return Promise.reject("Env texture can only be created when the browser supports half float or full float rendering."); + } + } + texture15.sphericalPolynomial; + const sphericalPolynomialPromise = (_b = texture15.getInternalTexture()) === null || _b === undefined ? undefined : _b._sphericalPolynomialPromise; + const cubeWidth = internalTexture14.width; + const hostingScene = new Scene(engine24); + const specularTextures = {}; + engine24.flushFramebuffer(); + const mipmapsCount = Scalar.ILog2(internalTexture14.width); + for (let i = 0;i <= mipmapsCount; i++) { + const faceWidth = Math.pow(2, mipmapsCount - i); + for (let face = 0;face < 6; face++) { + let faceData = await texture15.readPixels(face, i, undefined, false); + if (faceData && faceData.byteLength === faceData.length) { + const faceDataFloat = new Float32Array(faceData.byteLength * 4); + for (let i2 = 0;i2 < faceData.byteLength; i2++) { + faceDataFloat[i2] = faceData[i2] / 255; + faceDataFloat[i2] = Math.pow(faceDataFloat[i2], 2.2); + } + faceData = faceDataFloat; + } else if (faceData && texture15.gammaSpace) { + const floatData = faceData; + for (let i2 = 0;i2 < floatData.length; i2++) { + floatData[i2] = Math.pow(floatData[i2], 2.2); + } + } + const tempTexture = engine24.createRawTexture(faceData, faceWidth, faceWidth, 5, false, true, 1, null, textureType); + await RGBDTextureTools.EncodeTextureToRGBD(tempTexture, hostingScene, textureType); + const rgbdEncodedData = await engine24._readTexturePixels(tempTexture, faceWidth, faceWidth); + const imageEncodedData = await DumpTools.DumpDataAsync(faceWidth, faceWidth, rgbdEncodedData, imageType, undefined, false, true, options.imageQuality); + specularTextures[i * 6 + face] = imageEncodedData; + tempTexture.dispose(); + } + } + hostingScene.dispose(); + if (sphericalPolynomialPromise) { + await sphericalPolynomialPromise; + } + const info = { + version: CurrentVersion, + width: cubeWidth, + imageType, + irradiance: _CreateEnvTextureIrradiance(texture15), + specular: { + mipmaps: [], + lodGenerationScale: texture15.lodGenerationScale + } + }; + let position = 0; + for (let i = 0;i <= mipmapsCount; i++) { + for (let face = 0;face < 6; face++) { + const byteLength = specularTextures[i * 6 + face].byteLength; + info.specular.mipmaps.push({ + length: byteLength, + position + }); + position += byteLength; + } + } + const infoString = JSON.stringify(info); + const infoBuffer = new ArrayBuffer(infoString.length + 1); + const infoView = new Uint8Array(infoBuffer); + for (let i = 0, strLen = infoString.length;i < strLen; i++) { + infoView[i] = infoString.charCodeAt(i); + } + infoView[infoString.length] = 0; + const totalSize = MagicBytes.length + position + infoBuffer.byteLength; + const finalBuffer = new ArrayBuffer(totalSize); + const finalBufferView = new Uint8Array(finalBuffer); + const dataView = new DataView(finalBuffer); + let pos = 0; + for (let i = 0;i < MagicBytes.length; i++) { + dataView.setUint8(pos++, MagicBytes[i]); + } + finalBufferView.set(new Uint8Array(infoBuffer), pos); + pos += infoBuffer.byteLength; + for (let i = 0;i <= mipmapsCount; i++) { + for (let face = 0;face < 6; face++) { + const dataBuffer5 = specularTextures[i * 6 + face]; + finalBufferView.set(new Uint8Array(dataBuffer5), pos); + pos += dataBuffer5.byteLength; + } + } + return finalBuffer; +} function CreateImageDataArrayBufferViews(data, info) { info = normalizeEnvInfo(info); const specularInfo = info.specular; @@ -85821,39 +91826,6 @@ function UploadEnvLevelsAsync(texture15, data, info) { const imageData = CreateImageDataArrayBufferViews(data, info); return UploadLevelsAsync(texture15, imageData, info.imageType); } -var _OnImageReadyAsync = function(image, engine24, expandTexture, rgbdPostProcess, url, face, i, generateNonLODTextures, lodTextures, cubeRtt, texture15) { - return new Promise((resolve, reject) => { - if (expandTexture) { - const tempTexture = engine24.createTexture(null, true, true, null, 1, null, (message) => { - reject(message); - }, image); - rgbdPostProcess.getEffect().executeWhenCompiled(() => { - rgbdPostProcess.externalTextureSamplerBinding = true; - rgbdPostProcess.onApply = (effect6) => { - effect6._bindTexture("textureSampler", tempTexture); - effect6.setFloat2("scale", 1, engine24._features.needsInvertingBitmap && image instanceof ImageBitmap ? -1 : 1); - }; - if (!engine24.scenes.length) { - return; - } - engine24.scenes[0].postProcessManager.directRender([rgbdPostProcess], cubeRtt, true, face, i); - engine24.restoreDefaultFramebuffer(); - tempTexture.dispose(); - URL.revokeObjectURL(url); - resolve(); - }); - } else { - engine24._uploadImageToTexture(texture15, image, face, i); - if (generateNonLODTextures) { - const lodTexture = lodTextures[i]; - if (lodTexture) { - engine24._uploadImageToTexture(lodTexture._texture, image, face, 0); - } - } - resolve(); - } - }); -}; function UploadLevelsAsync(texture15, imageData, imageType = DefaultEnvironmentTextureImageType) { if (!Tools.IsExponentOfTwo(texture15.width)) { throw new Error("Texture size must be a power of two"); @@ -86044,9 +92016,86 @@ function _UpdateRGBDAsync(internalTexture14, data, sphericalPolynomial3, lodScal return internalTexture14; }); } -var DefaultEnvironmentTextureImageType = "image/png"; -var CurrentVersion = 2; -var MagicBytes = [134, 22, 135, 150, 246, 214, 150, 54]; +var _CreateEnvTextureIrradiance, _OnImageReadyAsync, DefaultEnvironmentTextureImageType, CurrentVersion, MagicBytes, EnvironmentTextureTools; +var init_environmentTextureTools = __esm(() => { + init_tools(); + init_math_vector(); + init_math_scalar(); + init_sphericalPolynomial(); + init_internalTexture(); + init_baseTexture(); + init_scene(); + init_postProcess(); + init_logger(); + init_rgbdTextureTools(); + init_engine_renderTargetCube(); + init_engine_readTexture(); + init_baseTexture_polynomial(); + init_rgbdEncode_fragment(); + init_rgbdDecode_fragment(); + init_dumpTools(); + _CreateEnvTextureIrradiance = function(texture15) { + const polynmials = texture15.sphericalPolynomial; + if (polynmials == null) { + return null; + } + return { + x: [polynmials.x.x, polynmials.x.y, polynmials.x.z], + y: [polynmials.y.x, polynmials.y.y, polynmials.y.z], + z: [polynmials.z.x, polynmials.z.y, polynmials.z.z], + xx: [polynmials.xx.x, polynmials.xx.y, polynmials.xx.z], + yy: [polynmials.yy.x, polynmials.yy.y, polynmials.yy.z], + zz: [polynmials.zz.x, polynmials.zz.y, polynmials.zz.z], + yz: [polynmials.yz.x, polynmials.yz.y, polynmials.yz.z], + zx: [polynmials.zx.x, polynmials.zx.y, polynmials.zx.z], + xy: [polynmials.xy.x, polynmials.xy.y, polynmials.xy.z] + }; + }; + _OnImageReadyAsync = function(image, engine24, expandTexture, rgbdPostProcess, url, face, i, generateNonLODTextures, lodTextures, cubeRtt, texture15) { + return new Promise((resolve, reject) => { + if (expandTexture) { + const tempTexture = engine24.createTexture(null, true, true, null, 1, null, (message) => { + reject(message); + }, image); + rgbdPostProcess.getEffect().executeWhenCompiled(() => { + rgbdPostProcess.externalTextureSamplerBinding = true; + rgbdPostProcess.onApply = (effect6) => { + effect6._bindTexture("textureSampler", tempTexture); + effect6.setFloat2("scale", 1, engine24._features.needsInvertingBitmap && image instanceof ImageBitmap ? -1 : 1); + }; + if (!engine24.scenes.length) { + return; + } + engine24.scenes[0].postProcessManager.directRender([rgbdPostProcess], cubeRtt, true, face, i); + engine24.restoreDefaultFramebuffer(); + tempTexture.dispose(); + URL.revokeObjectURL(url); + resolve(); + }); + } else { + engine24._uploadImageToTexture(texture15, image, face, i); + if (generateNonLODTextures) { + const lodTexture = lodTextures[i]; + if (lodTexture) { + engine24._uploadImageToTexture(lodTexture._texture, image, face, 0); + } + } + resolve(); + } + }); + }; + DefaultEnvironmentTextureImageType = "image/png"; + CurrentVersion = 2; + MagicBytes = [134, 22, 135, 150, 246, 214, 150, 54]; + EnvironmentTextureTools = { + GetEnvInfo, + CreateEnvTextureAsync, + CreateImageDataArrayBufferViews, + UploadEnvLevelsAsync, + UploadLevelsAsync, + UploadEnvSpherical + }; +}); // node_modules/@babylonjs/core/Misc/codeStringParsingTools.js function ExtractBetweenMarkers(markerOpen, markerClose, block, startIndex) { @@ -86175,6 +92224,8 @@ function FindBackward(s, index, c, c2) { function EscapeRegExp(s) { return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); } +var init_codeStringParsingTools = __esm(() => { +}); // node_modules/@babylonjs/core/Engines/Processors/shaderCodeInliner.js class ShaderCodeInliner { @@ -86291,28 +92342,28 @@ class ShaderCodeInliner { _replaceFunctionCallsByCode() { let doAgain = false; for (const func of this._functionDescr) { - const { name: name76, type, parameters, body } = func; + const { name: name77, type, parameters, body } = func; let startIndex = 0; while (startIndex < this._sourceCode.length) { - const functionCallIndex = this._sourceCode.indexOf(name76, startIndex); + const functionCallIndex = this._sourceCode.indexOf(name77, startIndex); if (functionCallIndex < 0) { break; } if (functionCallIndex === 0 || IsIdentifierChar(this._sourceCode.charAt(functionCallIndex - 1))) { - startIndex = functionCallIndex + name76.length; + startIndex = functionCallIndex + name77.length; continue; } - const callParamsStartIndex = SkipWhitespaces(this._sourceCode, functionCallIndex + name76.length); + const callParamsStartIndex = SkipWhitespaces(this._sourceCode, functionCallIndex + name77.length); if (callParamsStartIndex === this._sourceCode.length || this._sourceCode.charAt(callParamsStartIndex) !== "(") { - startIndex = functionCallIndex + name76.length; + startIndex = functionCallIndex + name77.length; continue; } const callParamsEndIndex = ExtractBetweenMarkers("(", ")", this._sourceCode, callParamsStartIndex); if (callParamsEndIndex < 0) { if (this.debug) { - console.warn(`Could not extract the parameters of the function call. Function '${name76}' (type=${type}). callParamsStartIndex=${callParamsStartIndex}`); + console.warn(`Could not extract the parameters of the function call. Function '${name77}' (type=${type}). callParamsStartIndex=${callParamsStartIndex}`); } - startIndex = functionCallIndex + name76.length; + startIndex = functionCallIndex + name77.length; continue; } const callParams = this._sourceCode.substring(callParamsStartIndex + 1, callParamsEndIndex); @@ -86340,9 +92391,9 @@ class ShaderCodeInliner { const params = splitParameterCall(RemoveComments(callParams)); if (params === null) { if (this.debug) { - console.warn(`Invalid function call: can't extract the parameters of the function call. Function '${name76}' (type=${type}). callParamsStartIndex=${callParamsStartIndex}, callParams=` + callParams); + console.warn(`Invalid function call: can't extract the parameters of the function call. Function '${name77}' (type=${type}). callParamsStartIndex=${callParamsStartIndex}, callParams=` + callParams); } - startIndex = functionCallIndex + name76.length; + startIndex = functionCallIndex + name77.length; continue; } const paramNames = []; @@ -86350,15 +92401,15 @@ class ShaderCodeInliner { const param = params[p].trim(); paramNames.push(param); } - const retParamName = type !== "void" ? name76 + "_" + func.callIndex++ : null; + const retParamName = type !== "void" ? name77 + "_" + func.callIndex++ : null; if (retParamName) { paramNames.push(retParamName + " ="); } if (paramNames.length !== parameters.length) { if (this.debug) { - console.warn(`Invalid function call: not the same number of parameters for the call than the number expected by the function. Function '${name76}' (type=${type}). function parameters=${parameters}, call parameters=${paramNames}`); + console.warn(`Invalid function call: not the same number of parameters for the call than the number expected by the function. Function '${name77}' (type=${type}). function parameters=${parameters}, call parameters=${paramNames}`); } - startIndex = functionCallIndex + name76.length; + startIndex = functionCallIndex + name77.length; continue; } startIndex = callParamsEndIndex + 1; @@ -86371,13 +92422,13 @@ class ShaderCodeInliner { const partBetween = this._sourceCode.substring(injectDeclarationIndex + 1, functionCallIndex); this._sourceCode = partBefore + type + " " + retParamName + ";\n" + funcBody + "\n" + partBetween + retParamName + partAfter; if (this.debug) { - console.log(`Replace function call by code. Function '${name76}' (type=${type}). injectDeclarationIndex=${injectDeclarationIndex}, call parameters=${paramNames}`); + console.log(`Replace function call by code. Function '${name77}' (type=${type}). injectDeclarationIndex=${injectDeclarationIndex}, call parameters=${paramNames}`); } } else { this._sourceCode = partBefore + funcBody + partAfter; startIndex += funcBody.length - (callParamsEndIndex + 1 - functionCallIndex); if (this.debug) { - console.log(`Replace function call by code. Function '${name76}' (type=${type}). functionCallIndex=${functionCallIndex}, call parameters=${paramNames}`); + console.log(`Replace function call by code. Function '${name77}' (type=${type}). functionCallIndex=${functionCallIndex}, call parameters=${paramNames}`); } } doAgain = true; @@ -86399,7 +92450,10 @@ class ShaderCodeInliner { return code; } } -ShaderCodeInliner._RegexpFindFunctionNameAndType = /((\s+?)(\w+)\s+(\w+)\s*?)$/; +var init_shaderCodeInliner = __esm(() => { + init_codeStringParsingTools(); + ShaderCodeInliner._RegexpFindFunctionNameAndType = /((\s+?)(\w+)\s+(\w+)\s*?)$/; +}); // node_modules/@babylonjs/core/Engines/Native/nativePipelineContext.js class NativePipelineContext { @@ -86431,8 +92485,8 @@ class NativePipelineContext { _fillEffectInformation(effect6, uniformBuffersNames, uniformsNames, uniforms, samplerList, samplers, attributesNames, attributes) { const engine24 = this._engine; if (engine24.supportsUniformBuffers) { - for (const name76 in uniformBuffersNames) { - effect6.bindUniformBlock(name76, uniformBuffersNames[name76]); + for (const name77 in uniformBuffersNames) { + effect6.bindUniformBlock(name77, uniformBuffersNames[name77]); } } const effectAvailableUniforms = this._engine.getUniforms(this, uniformsNames); @@ -86448,8 +92502,8 @@ class NativePipelineContext { index--; } } - samplerList.forEach((name76, index2) => { - samplers[name76] = index2; + samplerList.forEach((name77, index2) => { + samplers[name77] = index2; }); attributes.push(...engine24.getAttributes(this, attributesNames)); } @@ -86766,6 +92820,8 @@ class NativePipelineContext { } } } +var init_nativePipelineContext = __esm(() => { +}); // node_modules/@babylonjs/core/Engines/Native/nativeRenderTargetWrapper.js class NativeRenderTargetWrapper extends RenderTargetWrapper { @@ -86799,6 +92855,9 @@ class NativeRenderTargetWrapper extends RenderTargetWrapper { super.dispose(disposeOnlyFramebuffers); } } +var init_nativeRenderTargetWrapper = __esm(() => { + init_renderTargetWrapper(); +}); // node_modules/@babylonjs/core/Engines/Native/nativeHardwareTexture.js class NativeHardwareTexture { @@ -86824,6 +92883,8 @@ class NativeHardwareTexture { this.reset(); } } +var init_nativeHardwareTexture = __esm(() => { +}); // node_modules/@babylonjs/core/Engines/Native/nativeHelpers.js function getNativeTextureFormat(format, type) { @@ -87116,6 +93177,10 @@ function getNativeAttribType(type) { throw new Error(`Unsupported attribute type: ${type}.`); } } +var init_nativeHelpers = __esm(() => { + init_error(); + init_buffer(); +}); // node_modules/@babylonjs/core/Engines/nativeEngine.js function AcquireNativeObjectAsync() { @@ -87130,19 +93195,6 @@ function AcquireNativeObjectAsync() { async function RegisterNativeTypeAsync(typeName, constructor) { (await AcquireNativeObjectAsync())[typeName] = constructor; } -var onNativeObjectInitialized = new Observable; -if (typeof self !== "undefined" && !Object.prototype.hasOwnProperty.call(self, "_native")) { - let __native; - Object.defineProperty(self, "_native", { - get: () => __native, - set: (value) => { - __native = value; - if (__native) { - onNativeObjectInitialized.notifyObservers(__native); - } - } - }); -} class NativeDataBuffer extends DataBuffer { } @@ -88752,17 +94804,42 @@ class NativeEngine extends Engine2 { }); } } -NativeEngine.PROTOCOL_VERSION = 8; - -// node_modules/@babylonjs/core/Engines/Native/validatedNativeDataStream.js -NativeEngine._createNativeDataStream = function() { - if (_native.NativeDataStream.VALIDATION_ENABLED) { - return new ValidatedNativeDataStream; - } else { - return new NativeDataStream; +var onNativeObjectInitialized; +var init_nativeEngine = __esm(() => { + init_engine(); + init_internalTexture(); + init_texture(); + init_dataBuffer(); + init_tools(); + init_observable(); + init_environmentTextureTools(); + init_logger(); + init_thinEngine(); + init_engineStore(); + init_shaderCodeInliner(); + init_webGL2ShaderProcessors(); + init_nativeDataStream(); + init_nativePipelineContext(); + init_nativeRenderTargetWrapper(); + init_nativeHardwareTexture(); + init_nativeHelpers(); + onNativeObjectInitialized = new Observable; + if (typeof self !== "undefined" && !Object.prototype.hasOwnProperty.call(self, "_native")) { + let __native; + Object.defineProperty(self, "_native", { + get: () => __native, + set: (value) => { + __native = value; + if (__native) { + onNativeObjectInitialized.notifyObservers(__native); + } + } + }); } -}; + NativeEngine.PROTOCOL_VERSION = 8; +}); +// node_modules/@babylonjs/core/Engines/Native/validatedNativeDataStream.js class ValidatedNativeDataStream extends NativeDataStream { constructor() { super(); @@ -88800,396 +94877,377 @@ class ValidatedNativeDataStream extends NativeDataStream { super.writeBoolean(value); } } +var init_validatedNativeDataStream = __esm(() => { + init_nativeEngine(); + init_nativeDataStream(); + NativeEngine._createNativeDataStream = function() { + if (_native.NativeDataStream.VALIDATION_ENABLED) { + return new ValidatedNativeDataStream; + } else { + return new NativeDataStream; + } + }; +}); + +// node_modules/@babylonjs/core/Engines/Native/index.js +var init_Native = __esm(() => { + init_nativeDataStream(); + init_validatedNativeDataStream(); +}); + // node_modules/@babylonjs/core/Engines/WebGPU/webgpuConstants.js -var PowerPreference; -(function(PowerPreference2) { - PowerPreference2["LowPower"] = "low-power"; - PowerPreference2["HighPerformance"] = "high-performance"; -})(PowerPreference || (PowerPreference = {})); -var FeatureName; -(function(FeatureName2) { - FeatureName2["DepthClipControl"] = "depth-clip-control"; - FeatureName2["Depth32FloatStencil8"] = "depth32float-stencil8"; - FeatureName2["TextureCompressionBC"] = "texture-compression-bc"; - FeatureName2["TextureCompressionETC2"] = "texture-compression-etc2"; - FeatureName2["TextureCompressionASTC"] = "texture-compression-astc"; - FeatureName2["TimestampQuery"] = "timestamp-query"; - FeatureName2["IndirectFirstInstance"] = "indirect-first-instance"; - FeatureName2["ShaderF16"] = "shader-f16"; - FeatureName2["RG11B10UFloatRenderable"] = "rg11b10ufloat-renderable"; - FeatureName2["BGRA8UnormStorage"] = "bgra8unorm-storage"; - FeatureName2["Float32Filterable"] = "float32-filterable"; -})(FeatureName || (FeatureName = {})); -var BufferMapState; -(function(BufferMapState2) { - BufferMapState2["Unmapped"] = "unmapped"; - BufferMapState2["Pending"] = "pending"; - BufferMapState2["Mapped"] = "mapped"; -})(BufferMapState || (BufferMapState = {})); -var BufferUsage; -(function(BufferUsage2) { - BufferUsage2[BufferUsage2["MapRead"] = 1] = "MapRead"; - BufferUsage2[BufferUsage2["MapWrite"] = 2] = "MapWrite"; - BufferUsage2[BufferUsage2["CopySrc"] = 4] = "CopySrc"; - BufferUsage2[BufferUsage2["CopyDst"] = 8] = "CopyDst"; - BufferUsage2[BufferUsage2["Index"] = 16] = "Index"; - BufferUsage2[BufferUsage2["Vertex"] = 32] = "Vertex"; - BufferUsage2[BufferUsage2["Uniform"] = 64] = "Uniform"; - BufferUsage2[BufferUsage2["Storage"] = 128] = "Storage"; - BufferUsage2[BufferUsage2["Indirect"] = 256] = "Indirect"; - BufferUsage2[BufferUsage2["QueryResolve"] = 512] = "QueryResolve"; -})(BufferUsage || (BufferUsage = {})); -var MapMode; -(function(MapMode2) { - MapMode2[MapMode2["Read"] = 1] = "Read"; - MapMode2[MapMode2["Write"] = 2] = "Write"; -})(MapMode || (MapMode = {})); -var TextureDimension; -(function(TextureDimension2) { - TextureDimension2["E1d"] = "1d"; - TextureDimension2["E2d"] = "2d"; - TextureDimension2["E3d"] = "3d"; -})(TextureDimension || (TextureDimension = {})); -var TextureUsage; -(function(TextureUsage2) { - TextureUsage2[TextureUsage2["CopySrc"] = 1] = "CopySrc"; - TextureUsage2[TextureUsage2["CopyDst"] = 2] = "CopyDst"; - TextureUsage2[TextureUsage2["TextureBinding"] = 4] = "TextureBinding"; - TextureUsage2[TextureUsage2["StorageBinding"] = 8] = "StorageBinding"; - TextureUsage2[TextureUsage2["RenderAttachment"] = 16] = "RenderAttachment"; -})(TextureUsage || (TextureUsage = {})); -var TextureViewDimension; -(function(TextureViewDimension2) { - TextureViewDimension2["E1d"] = "1d"; - TextureViewDimension2["E2d"] = "2d"; - TextureViewDimension2["E2dArray"] = "2d-array"; - TextureViewDimension2["Cube"] = "cube"; - TextureViewDimension2["CubeArray"] = "cube-array"; - TextureViewDimension2["E3d"] = "3d"; -})(TextureViewDimension || (TextureViewDimension = {})); -var TextureAspect; -(function(TextureAspect2) { - TextureAspect2["All"] = "all"; - TextureAspect2["StencilOnly"] = "stencil-only"; - TextureAspect2["DepthOnly"] = "depth-only"; -})(TextureAspect || (TextureAspect = {})); -var TextureFormat; -(function(TextureFormat2) { - TextureFormat2["R8Unorm"] = "r8unorm"; - TextureFormat2["R8Snorm"] = "r8snorm"; - TextureFormat2["R8Uint"] = "r8uint"; - TextureFormat2["R8Sint"] = "r8sint"; - TextureFormat2["R16Uint"] = "r16uint"; - TextureFormat2["R16Sint"] = "r16sint"; - TextureFormat2["R16Float"] = "r16float"; - TextureFormat2["RG8Unorm"] = "rg8unorm"; - TextureFormat2["RG8Snorm"] = "rg8snorm"; - TextureFormat2["RG8Uint"] = "rg8uint"; - TextureFormat2["RG8Sint"] = "rg8sint"; - TextureFormat2["R32Uint"] = "r32uint"; - TextureFormat2["R32Sint"] = "r32sint"; - TextureFormat2["R32Float"] = "r32float"; - TextureFormat2["RG16Uint"] = "rg16uint"; - TextureFormat2["RG16Sint"] = "rg16sint"; - TextureFormat2["RG16Float"] = "rg16float"; - TextureFormat2["RGBA8Unorm"] = "rgba8unorm"; - TextureFormat2["RGBA8UnormSRGB"] = "rgba8unorm-srgb"; - TextureFormat2["RGBA8Snorm"] = "rgba8snorm"; - TextureFormat2["RGBA8Uint"] = "rgba8uint"; - TextureFormat2["RGBA8Sint"] = "rgba8sint"; - TextureFormat2["BGRA8Unorm"] = "bgra8unorm"; - TextureFormat2["BGRA8UnormSRGB"] = "bgra8unorm-srgb"; - TextureFormat2["RGB9E5UFloat"] = "rgb9e5ufloat"; - TextureFormat2["RGB10A2UINT"] = "rgb10a2uint"; - TextureFormat2["RGB10A2Unorm"] = "rgb10a2unorm"; - TextureFormat2["RG11B10UFloat"] = "rg11b10ufloat"; - TextureFormat2["RG32Uint"] = "rg32uint"; - TextureFormat2["RG32Sint"] = "rg32sint"; - TextureFormat2["RG32Float"] = "rg32float"; - TextureFormat2["RGBA16Uint"] = "rgba16uint"; - TextureFormat2["RGBA16Sint"] = "rgba16sint"; - TextureFormat2["RGBA16Float"] = "rgba16float"; - TextureFormat2["RGBA32Uint"] = "rgba32uint"; - TextureFormat2["RGBA32Sint"] = "rgba32sint"; - TextureFormat2["RGBA32Float"] = "rgba32float"; - TextureFormat2["Stencil8"] = "stencil8"; - TextureFormat2["Depth16Unorm"] = "depth16unorm"; - TextureFormat2["Depth24Plus"] = "depth24plus"; - TextureFormat2["Depth24PlusStencil8"] = "depth24plus-stencil8"; - TextureFormat2["Depth32Float"] = "depth32float"; - TextureFormat2["BC1RGBAUnorm"] = "bc1-rgba-unorm"; - TextureFormat2["BC1RGBAUnormSRGB"] = "bc1-rgba-unorm-srgb"; - TextureFormat2["BC2RGBAUnorm"] = "bc2-rgba-unorm"; - TextureFormat2["BC2RGBAUnormSRGB"] = "bc2-rgba-unorm-srgb"; - TextureFormat2["BC3RGBAUnorm"] = "bc3-rgba-unorm"; - TextureFormat2["BC3RGBAUnormSRGB"] = "bc3-rgba-unorm-srgb"; - TextureFormat2["BC4RUnorm"] = "bc4-r-unorm"; - TextureFormat2["BC4RSnorm"] = "bc4-r-snorm"; - TextureFormat2["BC5RGUnorm"] = "bc5-rg-unorm"; - TextureFormat2["BC5RGSnorm"] = "bc5-rg-snorm"; - TextureFormat2["BC6HRGBUFloat"] = "bc6h-rgb-ufloat"; - TextureFormat2["BC6HRGBFloat"] = "bc6h-rgb-float"; - TextureFormat2["BC7RGBAUnorm"] = "bc7-rgba-unorm"; - TextureFormat2["BC7RGBAUnormSRGB"] = "bc7-rgba-unorm-srgb"; - TextureFormat2["ETC2RGB8Unorm"] = "etc2-rgb8unorm"; - TextureFormat2["ETC2RGB8UnormSRGB"] = "etc2-rgb8unorm-srgb"; - TextureFormat2["ETC2RGB8A1Unorm"] = "etc2-rgb8a1unorm"; - TextureFormat2["ETC2RGB8A1UnormSRGB"] = "etc2-rgb8a1unorm-srgb"; - TextureFormat2["ETC2RGBA8Unorm"] = "etc2-rgba8unorm"; - TextureFormat2["ETC2RGBA8UnormSRGB"] = "etc2-rgba8unorm-srgb"; - TextureFormat2["EACR11Unorm"] = "eac-r11unorm"; - TextureFormat2["EACR11Snorm"] = "eac-r11snorm"; - TextureFormat2["EACRG11Unorm"] = "eac-rg11unorm"; - TextureFormat2["EACRG11Snorm"] = "eac-rg11snorm"; - TextureFormat2["ASTC4x4Unorm"] = "astc-4x4-unorm"; - TextureFormat2["ASTC4x4UnormSRGB"] = "astc-4x4-unorm-srgb"; - TextureFormat2["ASTC5x4Unorm"] = "astc-5x4-unorm"; - TextureFormat2["ASTC5x4UnormSRGB"] = "astc-5x4-unorm-srgb"; - TextureFormat2["ASTC5x5Unorm"] = "astc-5x5-unorm"; - TextureFormat2["ASTC5x5UnormSRGB"] = "astc-5x5-unorm-srgb"; - TextureFormat2["ASTC6x5Unorm"] = "astc-6x5-unorm"; - TextureFormat2["ASTC6x5UnormSRGB"] = "astc-6x5-unorm-srgb"; - TextureFormat2["ASTC6x6Unorm"] = "astc-6x6-unorm"; - TextureFormat2["ASTC6x6UnormSRGB"] = "astc-6x6-unorm-srgb"; - TextureFormat2["ASTC8x5Unorm"] = "astc-8x5-unorm"; - TextureFormat2["ASTC8x5UnormSRGB"] = "astc-8x5-unorm-srgb"; - TextureFormat2["ASTC8x6Unorm"] = "astc-8x6-unorm"; - TextureFormat2["ASTC8x6UnormSRGB"] = "astc-8x6-unorm-srgb"; - TextureFormat2["ASTC8x8Unorm"] = "astc-8x8-unorm"; - TextureFormat2["ASTC8x8UnormSRGB"] = "astc-8x8-unorm-srgb"; - TextureFormat2["ASTC10x5Unorm"] = "astc-10x5-unorm"; - TextureFormat2["ASTC10x5UnormSRGB"] = "astc-10x5-unorm-srgb"; - TextureFormat2["ASTC10x6Unorm"] = "astc-10x6-unorm"; - TextureFormat2["ASTC10x6UnormSRGB"] = "astc-10x6-unorm-srgb"; - TextureFormat2["ASTC10x8Unorm"] = "astc-10x8-unorm"; - TextureFormat2["ASTC10x8UnormSRGB"] = "astc-10x8-unorm-srgb"; - TextureFormat2["ASTC10x10Unorm"] = "astc-10x10-unorm"; - TextureFormat2["ASTC10x10UnormSRGB"] = "astc-10x10-unorm-srgb"; - TextureFormat2["ASTC12x10Unorm"] = "astc-12x10-unorm"; - TextureFormat2["ASTC12x10UnormSRGB"] = "astc-12x10-unorm-srgb"; - TextureFormat2["ASTC12x12Unorm"] = "astc-12x12-unorm"; - TextureFormat2["ASTC12x12UnormSRGB"] = "astc-12x12-unorm-srgb"; - TextureFormat2["Depth32FloatStencil8"] = "depth32float-stencil8"; -})(TextureFormat || (TextureFormat = {})); -var AddressMode; -(function(AddressMode2) { - AddressMode2["ClampToEdge"] = "clamp-to-edge"; - AddressMode2["Repeat"] = "repeat"; - AddressMode2["MirrorRepeat"] = "mirror-repeat"; -})(AddressMode || (AddressMode = {})); -var FilterMode; -(function(FilterMode2) { - FilterMode2["Nearest"] = "nearest"; - FilterMode2["Linear"] = "linear"; -})(FilterMode || (FilterMode = {})); -var MipmapFilterMode; -(function(MipmapFilterMode2) { - MipmapFilterMode2["Nearest"] = "nearest"; - MipmapFilterMode2["Linear"] = "linear"; -})(MipmapFilterMode || (MipmapFilterMode = {})); -var CompareFunction; -(function(CompareFunction2) { - CompareFunction2["Never"] = "never"; - CompareFunction2["Less"] = "less"; - CompareFunction2["Equal"] = "equal"; - CompareFunction2["LessEqual"] = "less-equal"; - CompareFunction2["Greater"] = "greater"; - CompareFunction2["NotEqual"] = "not-equal"; - CompareFunction2["GreaterEqual"] = "greater-equal"; - CompareFunction2["Always"] = "always"; -})(CompareFunction || (CompareFunction = {})); -var ShaderStage; -(function(ShaderStage2) { - ShaderStage2[ShaderStage2["Vertex"] = 1] = "Vertex"; - ShaderStage2[ShaderStage2["Fragment"] = 2] = "Fragment"; - ShaderStage2[ShaderStage2["Compute"] = 4] = "Compute"; -})(ShaderStage || (ShaderStage = {})); -var BufferBindingType; -(function(BufferBindingType2) { - BufferBindingType2["Uniform"] = "uniform"; - BufferBindingType2["Storage"] = "storage"; - BufferBindingType2["ReadOnlyStorage"] = "read-only-storage"; -})(BufferBindingType || (BufferBindingType = {})); -var SamplerBindingType; -(function(SamplerBindingType2) { - SamplerBindingType2["Filtering"] = "filtering"; - SamplerBindingType2["NonFiltering"] = "non-filtering"; - SamplerBindingType2["Comparison"] = "comparison"; -})(SamplerBindingType || (SamplerBindingType = {})); -var TextureSampleType; -(function(TextureSampleType2) { - TextureSampleType2["Float"] = "float"; - TextureSampleType2["UnfilterableFloat"] = "unfilterable-float"; - TextureSampleType2["Depth"] = "depth"; - TextureSampleType2["Sint"] = "sint"; - TextureSampleType2["Uint"] = "uint"; -})(TextureSampleType || (TextureSampleType = {})); -var StorageTextureAccess; -(function(StorageTextureAccess2) { - StorageTextureAccess2["WriteOnly"] = "write-only"; -})(StorageTextureAccess || (StorageTextureAccess = {})); -var CompilationMessageType; -(function(CompilationMessageType2) { - CompilationMessageType2["Error"] = "error"; - CompilationMessageType2["Warning"] = "warning"; - CompilationMessageType2["Info"] = "info"; -})(CompilationMessageType || (CompilationMessageType = {})); -var PipelineErrorReason; -(function(PipelineErrorReason2) { - PipelineErrorReason2["Validation"] = "validation"; - PipelineErrorReason2["Internal"] = "internal"; -})(PipelineErrorReason || (PipelineErrorReason = {})); -var AutoLayoutMode; -(function(AutoLayoutMode2) { - AutoLayoutMode2["Auto"] = "auto"; -})(AutoLayoutMode || (AutoLayoutMode = {})); -var PrimitiveTopology; -(function(PrimitiveTopology2) { - PrimitiveTopology2["PointList"] = "point-list"; - PrimitiveTopology2["LineList"] = "line-list"; - PrimitiveTopology2["LineStrip"] = "line-strip"; - PrimitiveTopology2["TriangleList"] = "triangle-list"; - PrimitiveTopology2["TriangleStrip"] = "triangle-strip"; -})(PrimitiveTopology || (PrimitiveTopology = {})); -var FrontFace; -(function(FrontFace2) { - FrontFace2["CCW"] = "ccw"; - FrontFace2["CW"] = "cw"; -})(FrontFace || (FrontFace = {})); -var CullMode; -(function(CullMode2) { - CullMode2["None"] = "none"; - CullMode2["Front"] = "front"; - CullMode2["Back"] = "back"; -})(CullMode || (CullMode = {})); -var ColorWrite; -(function(ColorWrite2) { - ColorWrite2[ColorWrite2["Red"] = 1] = "Red"; - ColorWrite2[ColorWrite2["Green"] = 2] = "Green"; - ColorWrite2[ColorWrite2["Blue"] = 4] = "Blue"; - ColorWrite2[ColorWrite2["Alpha"] = 8] = "Alpha"; - ColorWrite2[ColorWrite2["All"] = 15] = "All"; -})(ColorWrite || (ColorWrite = {})); -var BlendFactor; -(function(BlendFactor2) { - BlendFactor2["Zero"] = "zero"; - BlendFactor2["One"] = "one"; - BlendFactor2["Src"] = "src"; - BlendFactor2["OneMinusSrc"] = "one-minus-src"; - BlendFactor2["SrcAlpha"] = "src-alpha"; - BlendFactor2["OneMinusSrcAlpha"] = "one-minus-src-alpha"; - BlendFactor2["Dst"] = "dst"; - BlendFactor2["OneMinusDst"] = "one-minus-dst"; - BlendFactor2["DstAlpha"] = "dst-alpha"; - BlendFactor2["OneMinusDstAlpha"] = "one-minus-dst-alpha"; - BlendFactor2["SrcAlphaSaturated"] = "src-alpha-saturated"; - BlendFactor2["Constant"] = "constant"; - BlendFactor2["OneMinusConstant"] = "one-minus-constant"; -})(BlendFactor || (BlendFactor = {})); -var BlendOperation; -(function(BlendOperation2) { - BlendOperation2["Add"] = "add"; - BlendOperation2["Subtract"] = "subtract"; - BlendOperation2["ReverseSubtract"] = "reverse-subtract"; - BlendOperation2["Min"] = "min"; - BlendOperation2["Max"] = "max"; -})(BlendOperation || (BlendOperation = {})); -var StencilOperation; -(function(StencilOperation2) { - StencilOperation2["Keep"] = "keep"; - StencilOperation2["Zero"] = "zero"; - StencilOperation2["Replace"] = "replace"; - StencilOperation2["Invert"] = "invert"; - StencilOperation2["IncrementClamp"] = "increment-clamp"; - StencilOperation2["DecrementClamp"] = "decrement-clamp"; - StencilOperation2["IncrementWrap"] = "increment-wrap"; - StencilOperation2["DecrementWrap"] = "decrement-wrap"; -})(StencilOperation || (StencilOperation = {})); -var IndexFormat; -(function(IndexFormat2) { - IndexFormat2["Uint16"] = "uint16"; - IndexFormat2["Uint32"] = "uint32"; -})(IndexFormat || (IndexFormat = {})); -var VertexFormat; -(function(VertexFormat2) { - VertexFormat2["Uint8x2"] = "uint8x2"; - VertexFormat2["Uint8x4"] = "uint8x4"; - VertexFormat2["Sint8x2"] = "sint8x2"; - VertexFormat2["Sint8x4"] = "sint8x4"; - VertexFormat2["Unorm8x2"] = "unorm8x2"; - VertexFormat2["Unorm8x4"] = "unorm8x4"; - VertexFormat2["Snorm8x2"] = "snorm8x2"; - VertexFormat2["Snorm8x4"] = "snorm8x4"; - VertexFormat2["Uint16x2"] = "uint16x2"; - VertexFormat2["Uint16x4"] = "uint16x4"; - VertexFormat2["Sint16x2"] = "sint16x2"; - VertexFormat2["Sint16x4"] = "sint16x4"; - VertexFormat2["Unorm16x2"] = "unorm16x2"; - VertexFormat2["Unorm16x4"] = "unorm16x4"; - VertexFormat2["Snorm16x2"] = "snorm16x2"; - VertexFormat2["Snorm16x4"] = "snorm16x4"; - VertexFormat2["Float16x2"] = "float16x2"; - VertexFormat2["Float16x4"] = "float16x4"; - VertexFormat2["Float32"] = "float32"; - VertexFormat2["Float32x2"] = "float32x2"; - VertexFormat2["Float32x3"] = "float32x3"; - VertexFormat2["Float32x4"] = "float32x4"; - VertexFormat2["Uint32"] = "uint32"; - VertexFormat2["Uint32x2"] = "uint32x2"; - VertexFormat2["Uint32x3"] = "uint32x3"; - VertexFormat2["Uint32x4"] = "uint32x4"; - VertexFormat2["Sint32"] = "sint32"; - VertexFormat2["Sint32x2"] = "sint32x2"; - VertexFormat2["Sint32x3"] = "sint32x3"; - VertexFormat2["Sint32x4"] = "sint32x4"; - VertexFormat2["UNORM10x10x10x2"] = "unorm10-10-10-2"; -})(VertexFormat || (VertexFormat = {})); -var VertexStepMode; -(function(VertexStepMode2) { - VertexStepMode2["Vertex"] = "vertex"; - VertexStepMode2["Instance"] = "instance"; -})(VertexStepMode || (VertexStepMode = {})); -var ComputePassTimestampLocation; -(function(ComputePassTimestampLocation2) { - ComputePassTimestampLocation2["Beginning"] = "beginning"; - ComputePassTimestampLocation2["End"] = "end"; -})(ComputePassTimestampLocation || (ComputePassTimestampLocation = {})); -var RenderPassTimestampLocation; -(function(RenderPassTimestampLocation2) { - RenderPassTimestampLocation2["Beginning"] = "beginning"; - RenderPassTimestampLocation2["End"] = "end"; -})(RenderPassTimestampLocation || (RenderPassTimestampLocation = {})); -var LoadOp; -(function(LoadOp2) { - LoadOp2["Load"] = "load"; - LoadOp2["Clear"] = "clear"; -})(LoadOp || (LoadOp = {})); -var StoreOp; -(function(StoreOp2) { - StoreOp2["Store"] = "store"; - StoreOp2["Discard"] = "discard"; -})(StoreOp || (StoreOp = {})); -var QueryType; -(function(QueryType2) { - QueryType2["Occlusion"] = "occlusion"; - QueryType2["Timestamp"] = "timestamp"; -})(QueryType || (QueryType = {})); -var CanvasAlphaMode; -(function(CanvasAlphaMode2) { - CanvasAlphaMode2["Opaque"] = "opaque"; - CanvasAlphaMode2["Premultiplied"] = "premultiplied"; -})(CanvasAlphaMode || (CanvasAlphaMode = {})); -var DeviceLostReason; -(function(DeviceLostReason2) { - DeviceLostReason2["Unknown"] = "unknown"; - DeviceLostReason2["Destroyed"] = "destroyed"; -})(DeviceLostReason || (DeviceLostReason = {})); -var ErrorFilter; -(function(ErrorFilter2) { - ErrorFilter2["Validation"] = "validation"; - ErrorFilter2["OutOfMemory"] = "out-of-memory"; - ErrorFilter2["Internal"] = "internal"; -})(ErrorFilter || (ErrorFilter = {})); +var PowerPreference, FeatureName, BufferMapState, BufferUsage, MapMode, TextureDimension, TextureUsage, TextureViewDimension, TextureAspect, TextureFormat, AddressMode, FilterMode, MipmapFilterMode, CompareFunction, ShaderStage, BufferBindingType, SamplerBindingType, TextureSampleType, StorageTextureAccess, CompilationMessageType, PipelineErrorReason, AutoLayoutMode, PrimitiveTopology, FrontFace, CullMode, ColorWrite, BlendFactor, BlendOperation, StencilOperation, IndexFormat, VertexFormat, VertexStepMode, ComputePassTimestampLocation, RenderPassTimestampLocation, LoadOp, StoreOp, QueryType, CanvasAlphaMode, DeviceLostReason, ErrorFilter; +var init_webgpuConstants = __esm(() => { + (function(PowerPreference2) { + PowerPreference2["LowPower"] = "low-power"; + PowerPreference2["HighPerformance"] = "high-performance"; + })(PowerPreference || (PowerPreference = {})); + (function(FeatureName2) { + FeatureName2["DepthClipControl"] = "depth-clip-control"; + FeatureName2["Depth32FloatStencil8"] = "depth32float-stencil8"; + FeatureName2["TextureCompressionBC"] = "texture-compression-bc"; + FeatureName2["TextureCompressionETC2"] = "texture-compression-etc2"; + FeatureName2["TextureCompressionASTC"] = "texture-compression-astc"; + FeatureName2["TimestampQuery"] = "timestamp-query"; + FeatureName2["IndirectFirstInstance"] = "indirect-first-instance"; + FeatureName2["ShaderF16"] = "shader-f16"; + FeatureName2["RG11B10UFloatRenderable"] = "rg11b10ufloat-renderable"; + FeatureName2["BGRA8UnormStorage"] = "bgra8unorm-storage"; + FeatureName2["Float32Filterable"] = "float32-filterable"; + })(FeatureName || (FeatureName = {})); + (function(BufferMapState2) { + BufferMapState2["Unmapped"] = "unmapped"; + BufferMapState2["Pending"] = "pending"; + BufferMapState2["Mapped"] = "mapped"; + })(BufferMapState || (BufferMapState = {})); + (function(BufferUsage2) { + BufferUsage2[BufferUsage2["MapRead"] = 1] = "MapRead"; + BufferUsage2[BufferUsage2["MapWrite"] = 2] = "MapWrite"; + BufferUsage2[BufferUsage2["CopySrc"] = 4] = "CopySrc"; + BufferUsage2[BufferUsage2["CopyDst"] = 8] = "CopyDst"; + BufferUsage2[BufferUsage2["Index"] = 16] = "Index"; + BufferUsage2[BufferUsage2["Vertex"] = 32] = "Vertex"; + BufferUsage2[BufferUsage2["Uniform"] = 64] = "Uniform"; + BufferUsage2[BufferUsage2["Storage"] = 128] = "Storage"; + BufferUsage2[BufferUsage2["Indirect"] = 256] = "Indirect"; + BufferUsage2[BufferUsage2["QueryResolve"] = 512] = "QueryResolve"; + })(BufferUsage || (BufferUsage = {})); + (function(MapMode2) { + MapMode2[MapMode2["Read"] = 1] = "Read"; + MapMode2[MapMode2["Write"] = 2] = "Write"; + })(MapMode || (MapMode = {})); + (function(TextureDimension2) { + TextureDimension2["E1d"] = "1d"; + TextureDimension2["E2d"] = "2d"; + TextureDimension2["E3d"] = "3d"; + })(TextureDimension || (TextureDimension = {})); + (function(TextureUsage2) { + TextureUsage2[TextureUsage2["CopySrc"] = 1] = "CopySrc"; + TextureUsage2[TextureUsage2["CopyDst"] = 2] = "CopyDst"; + TextureUsage2[TextureUsage2["TextureBinding"] = 4] = "TextureBinding"; + TextureUsage2[TextureUsage2["StorageBinding"] = 8] = "StorageBinding"; + TextureUsage2[TextureUsage2["RenderAttachment"] = 16] = "RenderAttachment"; + })(TextureUsage || (TextureUsage = {})); + (function(TextureViewDimension2) { + TextureViewDimension2["E1d"] = "1d"; + TextureViewDimension2["E2d"] = "2d"; + TextureViewDimension2["E2dArray"] = "2d-array"; + TextureViewDimension2["Cube"] = "cube"; + TextureViewDimension2["CubeArray"] = "cube-array"; + TextureViewDimension2["E3d"] = "3d"; + })(TextureViewDimension || (TextureViewDimension = {})); + (function(TextureAspect2) { + TextureAspect2["All"] = "all"; + TextureAspect2["StencilOnly"] = "stencil-only"; + TextureAspect2["DepthOnly"] = "depth-only"; + })(TextureAspect || (TextureAspect = {})); + (function(TextureFormat2) { + TextureFormat2["R8Unorm"] = "r8unorm"; + TextureFormat2["R8Snorm"] = "r8snorm"; + TextureFormat2["R8Uint"] = "r8uint"; + TextureFormat2["R8Sint"] = "r8sint"; + TextureFormat2["R16Uint"] = "r16uint"; + TextureFormat2["R16Sint"] = "r16sint"; + TextureFormat2["R16Float"] = "r16float"; + TextureFormat2["RG8Unorm"] = "rg8unorm"; + TextureFormat2["RG8Snorm"] = "rg8snorm"; + TextureFormat2["RG8Uint"] = "rg8uint"; + TextureFormat2["RG8Sint"] = "rg8sint"; + TextureFormat2["R32Uint"] = "r32uint"; + TextureFormat2["R32Sint"] = "r32sint"; + TextureFormat2["R32Float"] = "r32float"; + TextureFormat2["RG16Uint"] = "rg16uint"; + TextureFormat2["RG16Sint"] = "rg16sint"; + TextureFormat2["RG16Float"] = "rg16float"; + TextureFormat2["RGBA8Unorm"] = "rgba8unorm"; + TextureFormat2["RGBA8UnormSRGB"] = "rgba8unorm-srgb"; + TextureFormat2["RGBA8Snorm"] = "rgba8snorm"; + TextureFormat2["RGBA8Uint"] = "rgba8uint"; + TextureFormat2["RGBA8Sint"] = "rgba8sint"; + TextureFormat2["BGRA8Unorm"] = "bgra8unorm"; + TextureFormat2["BGRA8UnormSRGB"] = "bgra8unorm-srgb"; + TextureFormat2["RGB9E5UFloat"] = "rgb9e5ufloat"; + TextureFormat2["RGB10A2UINT"] = "rgb10a2uint"; + TextureFormat2["RGB10A2Unorm"] = "rgb10a2unorm"; + TextureFormat2["RG11B10UFloat"] = "rg11b10ufloat"; + TextureFormat2["RG32Uint"] = "rg32uint"; + TextureFormat2["RG32Sint"] = "rg32sint"; + TextureFormat2["RG32Float"] = "rg32float"; + TextureFormat2["RGBA16Uint"] = "rgba16uint"; + TextureFormat2["RGBA16Sint"] = "rgba16sint"; + TextureFormat2["RGBA16Float"] = "rgba16float"; + TextureFormat2["RGBA32Uint"] = "rgba32uint"; + TextureFormat2["RGBA32Sint"] = "rgba32sint"; + TextureFormat2["RGBA32Float"] = "rgba32float"; + TextureFormat2["Stencil8"] = "stencil8"; + TextureFormat2["Depth16Unorm"] = "depth16unorm"; + TextureFormat2["Depth24Plus"] = "depth24plus"; + TextureFormat2["Depth24PlusStencil8"] = "depth24plus-stencil8"; + TextureFormat2["Depth32Float"] = "depth32float"; + TextureFormat2["BC1RGBAUnorm"] = "bc1-rgba-unorm"; + TextureFormat2["BC1RGBAUnormSRGB"] = "bc1-rgba-unorm-srgb"; + TextureFormat2["BC2RGBAUnorm"] = "bc2-rgba-unorm"; + TextureFormat2["BC2RGBAUnormSRGB"] = "bc2-rgba-unorm-srgb"; + TextureFormat2["BC3RGBAUnorm"] = "bc3-rgba-unorm"; + TextureFormat2["BC3RGBAUnormSRGB"] = "bc3-rgba-unorm-srgb"; + TextureFormat2["BC4RUnorm"] = "bc4-r-unorm"; + TextureFormat2["BC4RSnorm"] = "bc4-r-snorm"; + TextureFormat2["BC5RGUnorm"] = "bc5-rg-unorm"; + TextureFormat2["BC5RGSnorm"] = "bc5-rg-snorm"; + TextureFormat2["BC6HRGBUFloat"] = "bc6h-rgb-ufloat"; + TextureFormat2["BC6HRGBFloat"] = "bc6h-rgb-float"; + TextureFormat2["BC7RGBAUnorm"] = "bc7-rgba-unorm"; + TextureFormat2["BC7RGBAUnormSRGB"] = "bc7-rgba-unorm-srgb"; + TextureFormat2["ETC2RGB8Unorm"] = "etc2-rgb8unorm"; + TextureFormat2["ETC2RGB8UnormSRGB"] = "etc2-rgb8unorm-srgb"; + TextureFormat2["ETC2RGB8A1Unorm"] = "etc2-rgb8a1unorm"; + TextureFormat2["ETC2RGB8A1UnormSRGB"] = "etc2-rgb8a1unorm-srgb"; + TextureFormat2["ETC2RGBA8Unorm"] = "etc2-rgba8unorm"; + TextureFormat2["ETC2RGBA8UnormSRGB"] = "etc2-rgba8unorm-srgb"; + TextureFormat2["EACR11Unorm"] = "eac-r11unorm"; + TextureFormat2["EACR11Snorm"] = "eac-r11snorm"; + TextureFormat2["EACRG11Unorm"] = "eac-rg11unorm"; + TextureFormat2["EACRG11Snorm"] = "eac-rg11snorm"; + TextureFormat2["ASTC4x4Unorm"] = "astc-4x4-unorm"; + TextureFormat2["ASTC4x4UnormSRGB"] = "astc-4x4-unorm-srgb"; + TextureFormat2["ASTC5x4Unorm"] = "astc-5x4-unorm"; + TextureFormat2["ASTC5x4UnormSRGB"] = "astc-5x4-unorm-srgb"; + TextureFormat2["ASTC5x5Unorm"] = "astc-5x5-unorm"; + TextureFormat2["ASTC5x5UnormSRGB"] = "astc-5x5-unorm-srgb"; + TextureFormat2["ASTC6x5Unorm"] = "astc-6x5-unorm"; + TextureFormat2["ASTC6x5UnormSRGB"] = "astc-6x5-unorm-srgb"; + TextureFormat2["ASTC6x6Unorm"] = "astc-6x6-unorm"; + TextureFormat2["ASTC6x6UnormSRGB"] = "astc-6x6-unorm-srgb"; + TextureFormat2["ASTC8x5Unorm"] = "astc-8x5-unorm"; + TextureFormat2["ASTC8x5UnormSRGB"] = "astc-8x5-unorm-srgb"; + TextureFormat2["ASTC8x6Unorm"] = "astc-8x6-unorm"; + TextureFormat2["ASTC8x6UnormSRGB"] = "astc-8x6-unorm-srgb"; + TextureFormat2["ASTC8x8Unorm"] = "astc-8x8-unorm"; + TextureFormat2["ASTC8x8UnormSRGB"] = "astc-8x8-unorm-srgb"; + TextureFormat2["ASTC10x5Unorm"] = "astc-10x5-unorm"; + TextureFormat2["ASTC10x5UnormSRGB"] = "astc-10x5-unorm-srgb"; + TextureFormat2["ASTC10x6Unorm"] = "astc-10x6-unorm"; + TextureFormat2["ASTC10x6UnormSRGB"] = "astc-10x6-unorm-srgb"; + TextureFormat2["ASTC10x8Unorm"] = "astc-10x8-unorm"; + TextureFormat2["ASTC10x8UnormSRGB"] = "astc-10x8-unorm-srgb"; + TextureFormat2["ASTC10x10Unorm"] = "astc-10x10-unorm"; + TextureFormat2["ASTC10x10UnormSRGB"] = "astc-10x10-unorm-srgb"; + TextureFormat2["ASTC12x10Unorm"] = "astc-12x10-unorm"; + TextureFormat2["ASTC12x10UnormSRGB"] = "astc-12x10-unorm-srgb"; + TextureFormat2["ASTC12x12Unorm"] = "astc-12x12-unorm"; + TextureFormat2["ASTC12x12UnormSRGB"] = "astc-12x12-unorm-srgb"; + TextureFormat2["Depth32FloatStencil8"] = "depth32float-stencil8"; + })(TextureFormat || (TextureFormat = {})); + (function(AddressMode2) { + AddressMode2["ClampToEdge"] = "clamp-to-edge"; + AddressMode2["Repeat"] = "repeat"; + AddressMode2["MirrorRepeat"] = "mirror-repeat"; + })(AddressMode || (AddressMode = {})); + (function(FilterMode2) { + FilterMode2["Nearest"] = "nearest"; + FilterMode2["Linear"] = "linear"; + })(FilterMode || (FilterMode = {})); + (function(MipmapFilterMode2) { + MipmapFilterMode2["Nearest"] = "nearest"; + MipmapFilterMode2["Linear"] = "linear"; + })(MipmapFilterMode || (MipmapFilterMode = {})); + (function(CompareFunction2) { + CompareFunction2["Never"] = "never"; + CompareFunction2["Less"] = "less"; + CompareFunction2["Equal"] = "equal"; + CompareFunction2["LessEqual"] = "less-equal"; + CompareFunction2["Greater"] = "greater"; + CompareFunction2["NotEqual"] = "not-equal"; + CompareFunction2["GreaterEqual"] = "greater-equal"; + CompareFunction2["Always"] = "always"; + })(CompareFunction || (CompareFunction = {})); + (function(ShaderStage2) { + ShaderStage2[ShaderStage2["Vertex"] = 1] = "Vertex"; + ShaderStage2[ShaderStage2["Fragment"] = 2] = "Fragment"; + ShaderStage2[ShaderStage2["Compute"] = 4] = "Compute"; + })(ShaderStage || (ShaderStage = {})); + (function(BufferBindingType2) { + BufferBindingType2["Uniform"] = "uniform"; + BufferBindingType2["Storage"] = "storage"; + BufferBindingType2["ReadOnlyStorage"] = "read-only-storage"; + })(BufferBindingType || (BufferBindingType = {})); + (function(SamplerBindingType2) { + SamplerBindingType2["Filtering"] = "filtering"; + SamplerBindingType2["NonFiltering"] = "non-filtering"; + SamplerBindingType2["Comparison"] = "comparison"; + })(SamplerBindingType || (SamplerBindingType = {})); + (function(TextureSampleType2) { + TextureSampleType2["Float"] = "float"; + TextureSampleType2["UnfilterableFloat"] = "unfilterable-float"; + TextureSampleType2["Depth"] = "depth"; + TextureSampleType2["Sint"] = "sint"; + TextureSampleType2["Uint"] = "uint"; + })(TextureSampleType || (TextureSampleType = {})); + (function(StorageTextureAccess2) { + StorageTextureAccess2["WriteOnly"] = "write-only"; + })(StorageTextureAccess || (StorageTextureAccess = {})); + (function(CompilationMessageType2) { + CompilationMessageType2["Error"] = "error"; + CompilationMessageType2["Warning"] = "warning"; + CompilationMessageType2["Info"] = "info"; + })(CompilationMessageType || (CompilationMessageType = {})); + (function(PipelineErrorReason2) { + PipelineErrorReason2["Validation"] = "validation"; + PipelineErrorReason2["Internal"] = "internal"; + })(PipelineErrorReason || (PipelineErrorReason = {})); + (function(AutoLayoutMode2) { + AutoLayoutMode2["Auto"] = "auto"; + })(AutoLayoutMode || (AutoLayoutMode = {})); + (function(PrimitiveTopology2) { + PrimitiveTopology2["PointList"] = "point-list"; + PrimitiveTopology2["LineList"] = "line-list"; + PrimitiveTopology2["LineStrip"] = "line-strip"; + PrimitiveTopology2["TriangleList"] = "triangle-list"; + PrimitiveTopology2["TriangleStrip"] = "triangle-strip"; + })(PrimitiveTopology || (PrimitiveTopology = {})); + (function(FrontFace2) { + FrontFace2["CCW"] = "ccw"; + FrontFace2["CW"] = "cw"; + })(FrontFace || (FrontFace = {})); + (function(CullMode2) { + CullMode2["None"] = "none"; + CullMode2["Front"] = "front"; + CullMode2["Back"] = "back"; + })(CullMode || (CullMode = {})); + (function(ColorWrite2) { + ColorWrite2[ColorWrite2["Red"] = 1] = "Red"; + ColorWrite2[ColorWrite2["Green"] = 2] = "Green"; + ColorWrite2[ColorWrite2["Blue"] = 4] = "Blue"; + ColorWrite2[ColorWrite2["Alpha"] = 8] = "Alpha"; + ColorWrite2[ColorWrite2["All"] = 15] = "All"; + })(ColorWrite || (ColorWrite = {})); + (function(BlendFactor2) { + BlendFactor2["Zero"] = "zero"; + BlendFactor2["One"] = "one"; + BlendFactor2["Src"] = "src"; + BlendFactor2["OneMinusSrc"] = "one-minus-src"; + BlendFactor2["SrcAlpha"] = "src-alpha"; + BlendFactor2["OneMinusSrcAlpha"] = "one-minus-src-alpha"; + BlendFactor2["Dst"] = "dst"; + BlendFactor2["OneMinusDst"] = "one-minus-dst"; + BlendFactor2["DstAlpha"] = "dst-alpha"; + BlendFactor2["OneMinusDstAlpha"] = "one-minus-dst-alpha"; + BlendFactor2["SrcAlphaSaturated"] = "src-alpha-saturated"; + BlendFactor2["Constant"] = "constant"; + BlendFactor2["OneMinusConstant"] = "one-minus-constant"; + })(BlendFactor || (BlendFactor = {})); + (function(BlendOperation2) { + BlendOperation2["Add"] = "add"; + BlendOperation2["Subtract"] = "subtract"; + BlendOperation2["ReverseSubtract"] = "reverse-subtract"; + BlendOperation2["Min"] = "min"; + BlendOperation2["Max"] = "max"; + })(BlendOperation || (BlendOperation = {})); + (function(StencilOperation2) { + StencilOperation2["Keep"] = "keep"; + StencilOperation2["Zero"] = "zero"; + StencilOperation2["Replace"] = "replace"; + StencilOperation2["Invert"] = "invert"; + StencilOperation2["IncrementClamp"] = "increment-clamp"; + StencilOperation2["DecrementClamp"] = "decrement-clamp"; + StencilOperation2["IncrementWrap"] = "increment-wrap"; + StencilOperation2["DecrementWrap"] = "decrement-wrap"; + })(StencilOperation || (StencilOperation = {})); + (function(IndexFormat2) { + IndexFormat2["Uint16"] = "uint16"; + IndexFormat2["Uint32"] = "uint32"; + })(IndexFormat || (IndexFormat = {})); + (function(VertexFormat2) { + VertexFormat2["Uint8x2"] = "uint8x2"; + VertexFormat2["Uint8x4"] = "uint8x4"; + VertexFormat2["Sint8x2"] = "sint8x2"; + VertexFormat2["Sint8x4"] = "sint8x4"; + VertexFormat2["Unorm8x2"] = "unorm8x2"; + VertexFormat2["Unorm8x4"] = "unorm8x4"; + VertexFormat2["Snorm8x2"] = "snorm8x2"; + VertexFormat2["Snorm8x4"] = "snorm8x4"; + VertexFormat2["Uint16x2"] = "uint16x2"; + VertexFormat2["Uint16x4"] = "uint16x4"; + VertexFormat2["Sint16x2"] = "sint16x2"; + VertexFormat2["Sint16x4"] = "sint16x4"; + VertexFormat2["Unorm16x2"] = "unorm16x2"; + VertexFormat2["Unorm16x4"] = "unorm16x4"; + VertexFormat2["Snorm16x2"] = "snorm16x2"; + VertexFormat2["Snorm16x4"] = "snorm16x4"; + VertexFormat2["Float16x2"] = "float16x2"; + VertexFormat2["Float16x4"] = "float16x4"; + VertexFormat2["Float32"] = "float32"; + VertexFormat2["Float32x2"] = "float32x2"; + VertexFormat2["Float32x3"] = "float32x3"; + VertexFormat2["Float32x4"] = "float32x4"; + VertexFormat2["Uint32"] = "uint32"; + VertexFormat2["Uint32x2"] = "uint32x2"; + VertexFormat2["Uint32x3"] = "uint32x3"; + VertexFormat2["Uint32x4"] = "uint32x4"; + VertexFormat2["Sint32"] = "sint32"; + VertexFormat2["Sint32x2"] = "sint32x2"; + VertexFormat2["Sint32x3"] = "sint32x3"; + VertexFormat2["Sint32x4"] = "sint32x4"; + VertexFormat2["UNORM10x10x10x2"] = "unorm10-10-10-2"; + })(VertexFormat || (VertexFormat = {})); + (function(VertexStepMode2) { + VertexStepMode2["Vertex"] = "vertex"; + VertexStepMode2["Instance"] = "instance"; + })(VertexStepMode || (VertexStepMode = {})); + (function(ComputePassTimestampLocation2) { + ComputePassTimestampLocation2["Beginning"] = "beginning"; + ComputePassTimestampLocation2["End"] = "end"; + })(ComputePassTimestampLocation || (ComputePassTimestampLocation = {})); + (function(RenderPassTimestampLocation2) { + RenderPassTimestampLocation2["Beginning"] = "beginning"; + RenderPassTimestampLocation2["End"] = "end"; + })(RenderPassTimestampLocation || (RenderPassTimestampLocation = {})); + (function(LoadOp2) { + LoadOp2["Load"] = "load"; + LoadOp2["Clear"] = "clear"; + })(LoadOp || (LoadOp = {})); + (function(StoreOp2) { + StoreOp2["Store"] = "store"; + StoreOp2["Discard"] = "discard"; + })(StoreOp || (StoreOp = {})); + (function(QueryType2) { + QueryType2["Occlusion"] = "occlusion"; + QueryType2["Timestamp"] = "timestamp"; + })(QueryType || (QueryType = {})); + (function(CanvasAlphaMode2) { + CanvasAlphaMode2["Opaque"] = "opaque"; + CanvasAlphaMode2["Premultiplied"] = "premultiplied"; + })(CanvasAlphaMode || (CanvasAlphaMode = {})); + (function(DeviceLostReason2) { + DeviceLostReason2["Unknown"] = "unknown"; + DeviceLostReason2["Destroyed"] = "destroyed"; + })(DeviceLostReason || (DeviceLostReason = {})); + (function(ErrorFilter2) { + ErrorFilter2["Validation"] = "validation"; + ErrorFilter2["OutOfMemory"] = "out-of-memory"; + ErrorFilter2["Internal"] = "internal"; + })(ErrorFilter || (ErrorFilter = {})); +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuShaderProcessor.js class WebGPUShaderProcessor { @@ -89197,16 +95255,16 @@ class WebGPUShaderProcessor { this.shaderLanguage = ShaderLanguage.GLSL; this.vertexBufferKindToNumberOfComponents = {}; } - _addUniformToLeftOverUBO(name76, uniformType, preProcessors) { + _addUniformToLeftOverUBO(name77, uniformType, preProcessors) { let length = 0; - [name76, uniformType, length] = this._getArraySize(name76, uniformType, preProcessors); + [name77, uniformType, length] = this._getArraySize(name77, uniformType, preProcessors); for (let i = 0;i < this._webgpuProcessingContext.leftOverUniforms.length; i++) { - if (this._webgpuProcessingContext.leftOverUniforms[i].name === name76) { + if (this._webgpuProcessingContext.leftOverUniforms[i].name === name77) { return; } } this._webgpuProcessingContext.leftOverUniforms.push({ - name: name76, + name: name77, type: uniformType, length }); @@ -89215,17 +95273,17 @@ class WebGPUShaderProcessor { if (!this._webgpuProcessingContext.leftOverUniforms.length) { return ""; } - const name76 = WebGPUShaderProcessor.LeftOvertUBOName; - let availableUBO = this._webgpuProcessingContext.availableBuffers[name76]; + const name77 = WebGPUShaderProcessor.LeftOvertUBOName; + let availableUBO = this._webgpuProcessingContext.availableBuffers[name77]; if (!availableUBO) { availableUBO = { binding: this._webgpuProcessingContext.getNextFreeUBOBinding() }; - this._webgpuProcessingContext.availableBuffers[name76] = availableUBO; - this._addBufferBindingDescription(name76, availableUBO, BufferBindingType.Uniform, true); - this._addBufferBindingDescription(name76, availableUBO, BufferBindingType.Uniform, false); + this._webgpuProcessingContext.availableBuffers[name77] = availableUBO; + this._addBufferBindingDescription(name77, availableUBO, BufferBindingType.Uniform, true); + this._addBufferBindingDescription(name77, availableUBO, BufferBindingType.Uniform, false); } - return this._generateLeftOverUBOCode(name76, availableUBO); + return this._generateLeftOverUBOCode(name77, availableUBO); } _collectBindingNames() { for (let i = 0;i < this._webgpuProcessingContext.bindGroupLayoutEntries.length; i++) { @@ -89236,15 +95294,15 @@ class WebGPUShaderProcessor { } for (let j = 0;j < setDefinition.length; j++) { const entry = this._webgpuProcessingContext.bindGroupLayoutEntries[i][j]; - const name76 = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].name; + const name77 = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].name; const nameInArrayOfTexture = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].nameInArrayOfTexture; if (entry) { if (entry.texture || entry.externalTexture || entry.storageTexture) { this._webgpuProcessingContext.textureNames.push(nameInArrayOfTexture); } else if (entry.sampler) { - this._webgpuProcessingContext.samplerNames.push(name76); + this._webgpuProcessingContext.samplerNames.push(name77); } else if (entry.buffer) { - this._webgpuProcessingContext.bufferNames.push(name76); + this._webgpuProcessingContext.bufferNames.push(name77); } } } @@ -89276,7 +95334,7 @@ class WebGPUShaderProcessor { bindGroupEntries[i] = entries; } } - _addTextureBindingDescription(name76, textureInfo, textureIndex, dimension, format, isVertex) { + _addTextureBindingDescription(name77, textureInfo, textureIndex, dimension, format, isVertex) { let { groupIndex, bindingIndex } = textureInfo.textures[textureIndex]; if (!this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex]) { this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = []; @@ -89311,8 +95369,8 @@ class WebGPUShaderProcessor { } }); } - const textureName = textureInfo.isTextureArray ? name76 + textureIndex : name76; - this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name: name76, index: len - 1, nameInArrayOfTexture: textureName }; + const textureName = textureInfo.isTextureArray ? name77 + textureIndex : name77; + this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name: name77, index: len - 1, nameInArrayOfTexture: textureName }; } bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index; if (isVertex) { @@ -89321,7 +95379,7 @@ class WebGPUShaderProcessor { this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= ShaderStage.Fragment; } } - _addSamplerBindingDescription(name76, samplerInfo, isVertex) { + _addSamplerBindingDescription(name77, samplerInfo, isVertex) { let { groupIndex, bindingIndex } = samplerInfo.binding; if (!this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex]) { this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = []; @@ -89335,7 +95393,7 @@ class WebGPUShaderProcessor { type: samplerInfo.type } }); - this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name: name76, index: len - 1 }; + this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name: name77, index: len - 1 }; } bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index; if (isVertex) { @@ -89344,7 +95402,7 @@ class WebGPUShaderProcessor { this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= ShaderStage.Fragment; } } - _addBufferBindingDescription(name76, uniformBufferInfo, bufferType, isVertex) { + _addBufferBindingDescription(name77, uniformBufferInfo, bufferType, isVertex) { let { groupIndex, bindingIndex } = uniformBufferInfo.binding; if (!this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex]) { this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = []; @@ -89358,7 +95416,7 @@ class WebGPUShaderProcessor { type: bufferType } }); - this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name: name76, index: len - 1 }; + this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name: name77, index: len - 1 }; } bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index; if (isVertex) { @@ -89390,65 +95448,69 @@ class WebGPUShaderProcessor { return code; } } -WebGPUShaderProcessor.AutoSamplerSuffix = "Sampler"; -WebGPUShaderProcessor.LeftOvertUBOName = "LeftOver"; -WebGPUShaderProcessor.InternalsUBOName = "Internals"; -WebGPUShaderProcessor.UniformSizes = { - bool: 1, - int: 1, - float: 1, - vec2: 2, - ivec2: 2, - uvec2: 2, - vec3: 3, - ivec3: 3, - uvec3: 3, - vec4: 4, - ivec4: 4, - uvec4: 4, - mat2: 4, - mat3: 12, - mat4: 16, - i32: 1, - u32: 1, - f32: 1, - mat2x2: 4, - mat3x3: 12, - mat4x4: 16 -}; -WebGPUShaderProcessor._SamplerFunctionByWebGLSamplerType = { - sampler2D: "sampler2D", - sampler2DArray: "sampler2DArray", - sampler2DShadow: "sampler2DShadow", - sampler2DArrayShadow: "sampler2DArrayShadow", - samplerCube: "samplerCube", - sampler3D: "sampler3D" -}; -WebGPUShaderProcessor._TextureTypeByWebGLSamplerType = { - sampler2D: "texture2D", - sampler2DArray: "texture2DArray", - sampler2DShadow: "texture2D", - sampler2DArrayShadow: "texture2DArray", - samplerCube: "textureCube", - samplerCubeArray: "textureCubeArray", - sampler3D: "texture3D" -}; -WebGPUShaderProcessor._GpuTextureViewDimensionByWebGPUTextureType = { - textureCube: TextureViewDimension.Cube, - textureCubeArray: TextureViewDimension.CubeArray, - texture2D: TextureViewDimension.E2d, - texture2DArray: TextureViewDimension.E2dArray, - texture3D: TextureViewDimension.E3d -}; -WebGPUShaderProcessor._SamplerTypeByWebGLSamplerType = { - sampler2DShadow: "samplerShadow", - sampler2DArrayShadow: "samplerShadow" -}; -WebGPUShaderProcessor._IsComparisonSamplerByWebGPUSamplerType = { - samplerShadow: true, - samplerArrayShadow: true, - sampler: false -}; +var init_webgpuShaderProcessor = __esm(() => { + init_shaderLanguage(); + init_webgpuConstants(); + WebGPUShaderProcessor.AutoSamplerSuffix = "Sampler"; + WebGPUShaderProcessor.LeftOvertUBOName = "LeftOver"; + WebGPUShaderProcessor.InternalsUBOName = "Internals"; + WebGPUShaderProcessor.UniformSizes = { + bool: 1, + int: 1, + float: 1, + vec2: 2, + ivec2: 2, + uvec2: 2, + vec3: 3, + ivec3: 3, + uvec3: 3, + vec4: 4, + ivec4: 4, + uvec4: 4, + mat2: 4, + mat3: 12, + mat4: 16, + i32: 1, + u32: 1, + f32: 1, + mat2x2: 4, + mat3x3: 12, + mat4x4: 16 + }; + WebGPUShaderProcessor._SamplerFunctionByWebGLSamplerType = { + sampler2D: "sampler2D", + sampler2DArray: "sampler2DArray", + sampler2DShadow: "sampler2DShadow", + sampler2DArrayShadow: "sampler2DArrayShadow", + samplerCube: "samplerCube", + sampler3D: "sampler3D" + }; + WebGPUShaderProcessor._TextureTypeByWebGLSamplerType = { + sampler2D: "texture2D", + sampler2DArray: "texture2DArray", + sampler2DShadow: "texture2D", + sampler2DArrayShadow: "texture2DArray", + samplerCube: "textureCube", + samplerCubeArray: "textureCubeArray", + sampler3D: "texture3D" + }; + WebGPUShaderProcessor._GpuTextureViewDimensionByWebGPUTextureType = { + textureCube: TextureViewDimension.Cube, + textureCubeArray: TextureViewDimension.CubeArray, + texture2D: TextureViewDimension.E2d, + texture2DArray: TextureViewDimension.E2dArray, + texture3D: TextureViewDimension.E3d + }; + WebGPUShaderProcessor._SamplerTypeByWebGLSamplerType = { + sampler2DShadow: "samplerShadow", + sampler2DArrayShadow: "samplerShadow" + }; + WebGPUShaderProcessor._IsComparisonSamplerByWebGPUSamplerType = { + samplerShadow: true, + samplerArrayShadow: true, + sampler: false + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuPipelineContext.js class WebGPUPipelineContext { @@ -89478,13 +95540,13 @@ class WebGPUPipelineContext { const foundSamplers = this.shaderProcessingContext.availableTextures; let index; for (index = 0;index < samplerList.length; index++) { - const name76 = samplerList[index]; + const name77 = samplerList[index]; const sampler = foundSamplers[samplerList[index]]; if (sampler == null || sampler == undefined) { samplerList.splice(index, 1); index--; } else { - samplers[name76] = index; + samplers[name77] = index; } } for (const attr of engine25.getAttributes(this, attributesNames)) { @@ -89692,19 +95754,12 @@ class WebGPUPipelineContext { return (_a = this.sources) === null || _a === undefined ? undefined : _a.fragment; } } +var init_webgpuPipelineContext = __esm(() => { + init_uniformBuffer(); + init_webgpuShaderProcessor(); +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuShaderProcessingContext.js -var _maxGroups = 4; -var _maxBindingsPerGroup = 1 << 16; -var _typeToLocationSize = { - mat2: 2, - mat3: 3, - mat4: 4, - mat2x2: 2, - mat3x3: 3, - mat4x4: 4 -}; - class WebGPUShaderProcessingContext { static get KnownUBOs() { return WebGPUShaderProcessingContext._SimplifiedKnownBindings ? WebGPUShaderProcessingContext._SimplifiedKnownUBOs : WebGPUShaderProcessingContext._KnownUBOs; @@ -89733,8 +95788,8 @@ class WebGPUShaderProcessingContext { _findStartingGroupBinding() { const knownUBOs = WebGPUShaderProcessingContext.KnownUBOs; const groups = []; - for (const name76 in knownUBOs) { - const binding = knownUBOs[name76].binding; + for (const name77 in knownUBOs) { + const binding = knownUBOs[name77].binding; if (binding.groupIndex === -1) { continue; } @@ -89783,83 +95838,96 @@ class WebGPUShaderProcessingContext { return returnValue; } } -WebGPUShaderProcessingContext._SimplifiedKnownBindings = true; -WebGPUShaderProcessingContext._SimplifiedKnownUBOs = { - Scene: { binding: { groupIndex: 0, bindingIndex: 0 } }, - Light0: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light1: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light2: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light3: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light4: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light5: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light6: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light7: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light8: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light9: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light10: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light11: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light12: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light13: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light14: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light15: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light16: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light17: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light18: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light19: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light20: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light21: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light22: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light23: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light24: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light25: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light26: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light27: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light28: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light29: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light30: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Light31: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Material: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Mesh: { binding: { groupIndex: -1, bindingIndex: -1 } }, - Internals: { binding: { groupIndex: -1, bindingIndex: -1 } } -}; -WebGPUShaderProcessingContext._KnownUBOs = { - Scene: { binding: { groupIndex: 0, bindingIndex: 0 } }, - Light0: { binding: { groupIndex: 1, bindingIndex: 0 } }, - Light1: { binding: { groupIndex: 1, bindingIndex: 1 } }, - Light2: { binding: { groupIndex: 1, bindingIndex: 2 } }, - Light3: { binding: { groupIndex: 1, bindingIndex: 3 } }, - Light4: { binding: { groupIndex: 1, bindingIndex: 4 } }, - Light5: { binding: { groupIndex: 1, bindingIndex: 5 } }, - Light6: { binding: { groupIndex: 1, bindingIndex: 6 } }, - Light7: { binding: { groupIndex: 1, bindingIndex: 7 } }, - Light8: { binding: { groupIndex: 1, bindingIndex: 8 } }, - Light9: { binding: { groupIndex: 1, bindingIndex: 9 } }, - Light10: { binding: { groupIndex: 1, bindingIndex: 10 } }, - Light11: { binding: { groupIndex: 1, bindingIndex: 11 } }, - Light12: { binding: { groupIndex: 1, bindingIndex: 12 } }, - Light13: { binding: { groupIndex: 1, bindingIndex: 13 } }, - Light14: { binding: { groupIndex: 1, bindingIndex: 14 } }, - Light15: { binding: { groupIndex: 1, bindingIndex: 15 } }, - Light16: { binding: { groupIndex: 1, bindingIndex: 16 } }, - Light17: { binding: { groupIndex: 1, bindingIndex: 17 } }, - Light18: { binding: { groupIndex: 1, bindingIndex: 18 } }, - Light19: { binding: { groupIndex: 1, bindingIndex: 19 } }, - Light20: { binding: { groupIndex: 1, bindingIndex: 20 } }, - Light21: { binding: { groupIndex: 1, bindingIndex: 21 } }, - Light22: { binding: { groupIndex: 1, bindingIndex: 22 } }, - Light23: { binding: { groupIndex: 1, bindingIndex: 23 } }, - Light24: { binding: { groupIndex: 1, bindingIndex: 24 } }, - Light25: { binding: { groupIndex: 1, bindingIndex: 25 } }, - Light26: { binding: { groupIndex: 1, bindingIndex: 26 } }, - Light27: { binding: { groupIndex: 1, bindingIndex: 27 } }, - Light28: { binding: { groupIndex: 1, bindingIndex: 28 } }, - Light29: { binding: { groupIndex: 1, bindingIndex: 29 } }, - Light30: { binding: { groupIndex: 1, bindingIndex: 30 } }, - Light31: { binding: { groupIndex: 1, bindingIndex: 31 } }, - Material: { binding: { groupIndex: 2, bindingIndex: 0 } }, - Mesh: { binding: { groupIndex: 2, bindingIndex: 1 } }, - Internals: { binding: { groupIndex: 2, bindingIndex: 2 } } -}; +var _maxGroups, _maxBindingsPerGroup, _typeToLocationSize; +var init_webgpuShaderProcessingContext = __esm(() => { + _maxGroups = 4; + _maxBindingsPerGroup = 1 << 16; + _typeToLocationSize = { + mat2: 2, + mat3: 3, + mat4: 4, + mat2x2: 2, + mat3x3: 3, + mat4x4: 4 + }; + WebGPUShaderProcessingContext._SimplifiedKnownBindings = true; + WebGPUShaderProcessingContext._SimplifiedKnownUBOs = { + Scene: { binding: { groupIndex: 0, bindingIndex: 0 } }, + Light0: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light1: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light2: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light3: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light4: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light5: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light6: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light7: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light8: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light9: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light10: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light11: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light12: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light13: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light14: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light15: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light16: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light17: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light18: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light19: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light20: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light21: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light22: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light23: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light24: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light25: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light26: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light27: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light28: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light29: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light30: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Light31: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Material: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Mesh: { binding: { groupIndex: -1, bindingIndex: -1 } }, + Internals: { binding: { groupIndex: -1, bindingIndex: -1 } } + }; + WebGPUShaderProcessingContext._KnownUBOs = { + Scene: { binding: { groupIndex: 0, bindingIndex: 0 } }, + Light0: { binding: { groupIndex: 1, bindingIndex: 0 } }, + Light1: { binding: { groupIndex: 1, bindingIndex: 1 } }, + Light2: { binding: { groupIndex: 1, bindingIndex: 2 } }, + Light3: { binding: { groupIndex: 1, bindingIndex: 3 } }, + Light4: { binding: { groupIndex: 1, bindingIndex: 4 } }, + Light5: { binding: { groupIndex: 1, bindingIndex: 5 } }, + Light6: { binding: { groupIndex: 1, bindingIndex: 6 } }, + Light7: { binding: { groupIndex: 1, bindingIndex: 7 } }, + Light8: { binding: { groupIndex: 1, bindingIndex: 8 } }, + Light9: { binding: { groupIndex: 1, bindingIndex: 9 } }, + Light10: { binding: { groupIndex: 1, bindingIndex: 10 } }, + Light11: { binding: { groupIndex: 1, bindingIndex: 11 } }, + Light12: { binding: { groupIndex: 1, bindingIndex: 12 } }, + Light13: { binding: { groupIndex: 1, bindingIndex: 13 } }, + Light14: { binding: { groupIndex: 1, bindingIndex: 14 } }, + Light15: { binding: { groupIndex: 1, bindingIndex: 15 } }, + Light16: { binding: { groupIndex: 1, bindingIndex: 16 } }, + Light17: { binding: { groupIndex: 1, bindingIndex: 17 } }, + Light18: { binding: { groupIndex: 1, bindingIndex: 18 } }, + Light19: { binding: { groupIndex: 1, bindingIndex: 19 } }, + Light20: { binding: { groupIndex: 1, bindingIndex: 20 } }, + Light21: { binding: { groupIndex: 1, bindingIndex: 21 } }, + Light22: { binding: { groupIndex: 1, bindingIndex: 22 } }, + Light23: { binding: { groupIndex: 1, bindingIndex: 23 } }, + Light24: { binding: { groupIndex: 1, bindingIndex: 24 } }, + Light25: { binding: { groupIndex: 1, bindingIndex: 25 } }, + Light26: { binding: { groupIndex: 1, bindingIndex: 26 } }, + Light27: { binding: { groupIndex: 1, bindingIndex: 27 } }, + Light28: { binding: { groupIndex: 1, bindingIndex: 28 } }, + Light29: { binding: { groupIndex: 1, bindingIndex: 29 } }, + Light30: { binding: { groupIndex: 1, bindingIndex: 30 } }, + Light31: { binding: { groupIndex: 1, bindingIndex: 31 } }, + Material: { binding: { groupIndex: 2, bindingIndex: 0 } }, + Mesh: { binding: { groupIndex: 2, bindingIndex: 1 } }, + Internals: { binding: { groupIndex: 2, bindingIndex: 2 } } + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuShaderProcessorsGLSL.js class WebGPUShaderProcessorGLSL extends WebGPUShaderProcessor { @@ -89872,19 +95940,19 @@ class WebGPUShaderProcessorGLSL extends WebGPUShaderProcessor { this.shaderLanguage = ShaderLanguage.GLSL; this.parseGLES3 = true; } - _getArraySize(name76, type, preProcessors) { + _getArraySize(name77, type, preProcessors) { let length = 0; - const startArray = name76.indexOf("["); - const endArray = name76.indexOf("]"); + const startArray = name77.indexOf("["); + const endArray = name77.indexOf("]"); if (startArray > 0 && endArray > 0) { - const lengthInString = name76.substring(startArray + 1, endArray); + const lengthInString = name77.substring(startArray + 1, endArray); length = +lengthInString; if (isNaN(length)) { length = +preProcessors[lengthInString.trim()]; } - name76 = name76.substr(0, startArray); + name77 = name77.substr(0, startArray); } - return [name76, type, length]; + return [name77, type, length]; } initializeShaders(processingContext) { this._webgpuProcessingContext = processingContext; @@ -89929,20 +95997,20 @@ class WebGPUShaderProcessorGLSL extends WebGPUShaderProcessor { if (match !== null) { const interpolationQualifier = (_a = match[1]) !== null && _a !== undefined ? _a : ""; const varyingType = match[2]; - const name76 = match[3]; + const name77 = match[3]; let location2; if (isFragment) { - location2 = this._webgpuProcessingContext.availableVaryings[name76]; + location2 = this._webgpuProcessingContext.availableVaryings[name77]; this._missingVaryings[location2] = ""; if (location2 === undefined) { - Logger.Warn(`Invalid fragment shader: The varying named "${name76}" is not declared in the vertex shader! This declaration will be ignored.`); + Logger.Warn(`Invalid fragment shader: The varying named "${name77}" is not declared in the vertex shader! This declaration will be ignored.`); } } else { - location2 = this._webgpuProcessingContext.getVaryingNextLocation(varyingType, this._getArraySize(name76, varyingType, preProcessors)[2]); - this._webgpuProcessingContext.availableVaryings[name76] = location2; - this._missingVaryings[location2] = `layout(location = ${location2}) ${interpolationQualifier} in ${varyingType} ${name76};`; + location2 = this._webgpuProcessingContext.getVaryingNextLocation(varyingType, this._getArraySize(name77, varyingType, preProcessors)[2]); + this._webgpuProcessingContext.availableVaryings[name77] = location2; + this._missingVaryings[location2] = `layout(location = ${location2}) ${interpolationQualifier} in ${varyingType} ${name77};`; } - varying = varying.replace(match[0], location2 === undefined ? "" : `layout(location = ${location2}) ${interpolationQualifier} ${isFragment ? "in" : "out"} ${varyingType} ${name76};`); + varying = varying.replace(match[0], location2 === undefined ? "" : `layout(location = ${location2}) ${interpolationQualifier} ${isFragment ? "in" : "out"} ${varyingType} ${name77};`); } return varying; } @@ -89954,17 +96022,17 @@ class WebGPUShaderProcessorGLSL extends WebGPUShaderProcessor { const match = regex.exec(attribute); if (match !== null) { const attributeType = match[1]; - const name76 = match[2]; - const location2 = this._webgpuProcessingContext.getAttributeNextLocation(attributeType, this._getArraySize(name76, attributeType, preProcessors)[2]); - this._webgpuProcessingContext.availableAttributes[name76] = location2; - this._webgpuProcessingContext.orderedAttributes[location2] = name76; - const numComponents = this.vertexBufferKindToNumberOfComponents[name76]; + const name77 = match[2]; + const location2 = this._webgpuProcessingContext.getAttributeNextLocation(attributeType, this._getArraySize(name77, attributeType, preProcessors)[2]); + this._webgpuProcessingContext.availableAttributes[name77] = location2; + this._webgpuProcessingContext.orderedAttributes[location2] = name77; + const numComponents = this.vertexBufferKindToNumberOfComponents[name77]; if (numComponents !== undefined) { const newType = numComponents < 0 ? numComponents === -1 ? "int" : "ivec" + -numComponents : numComponents === 1 ? "uint" : "uvec" + numComponents; - const newName = `_int_${name76}_`; - attribute = attribute.replace(match[0], `layout(location = ${location2}) in ${newType} ${newName}; ${attributeType} ${name76} = ${attributeType}(${newName});`); + const newName = `_int_${name77}_`; + attribute = attribute.replace(match[0], `layout(location = ${location2}) in ${newType} ${newName}; ${attributeType} ${name77} = ${attributeType}(${newName});`); } else { - attribute = attribute.replace(match[0], `layout(location = ${location2}) in ${attributeType} ${name76};`); + attribute = attribute.replace(match[0], `layout(location = ${location2}) in ${attributeType} ${name77};`); } } return attribute; @@ -89976,11 +96044,11 @@ class WebGPUShaderProcessorGLSL extends WebGPUShaderProcessor { const match = uniformRegex.exec(uniform); if (match !== null) { let uniformType = match[1]; - let name76 = match[2]; + let name77 = match[2]; if (uniformType.indexOf("sampler") === 0 || uniformType.indexOf("sampler") === 1) { let arraySize = 0; - [name76, uniformType, arraySize] = this._getArraySize(name76, uniformType, preProcessors); - let textureInfo = this._webgpuProcessingContext.availableTextures[name76]; + [name77, uniformType, arraySize] = this._getArraySize(name77, uniformType, preProcessors); + let textureInfo = this._webgpuProcessingContext.availableTextures[name77]; if (!textureInfo) { textureInfo = { autoBindSampler: true, @@ -89996,7 +96064,7 @@ class WebGPUShaderProcessorGLSL extends WebGPUShaderProcessor { const samplerType = (_a = WebGPUShaderProcessor._SamplerTypeByWebGLSamplerType[uniformType]) !== null && _a !== undefined ? _a : "sampler"; const isComparisonSampler = !!WebGPUShaderProcessor._IsComparisonSamplerByWebGPUSamplerType[samplerType]; const samplerBindingType = isComparisonSampler ? SamplerBindingType.Comparison : SamplerBindingType.Filtering; - const samplerName = name76 + WebGPUShaderProcessor.AutoSamplerSuffix; + const samplerName = name77 + WebGPUShaderProcessor.AutoSamplerSuffix; let samplerInfo = this._webgpuProcessingContext.availableSamplers[samplerName]; if (!samplerInfo) { samplerInfo = { @@ -90019,8 +96087,8 @@ class WebGPUShaderProcessorGLSL extends WebGPUShaderProcessor { if (!isTextureArray) { arraySize = 1; uniform = `layout(set = ${samplerGroupIndex}, binding = ${samplerBindingIndex}) uniform ${samplerType} ${samplerName}; - layout(set = ${textureInfo.textures[0].groupIndex}, binding = ${textureInfo.textures[0].bindingIndex}) uniform ${componentType}${textureType} ${name76}Texture; - #define ${name76} ${componentType}${samplerFunction}(${name76}Texture, ${samplerName})`; + layout(set = ${textureInfo.textures[0].groupIndex}, binding = ${textureInfo.textures[0].bindingIndex}) uniform ${componentType}${textureType} ${name77}Texture; + #define ${name77} ${componentType}${samplerFunction}(${name77}Texture, ${samplerName})`; } else { const layouts = []; layouts.push(`layout(set = ${samplerGroupIndex}, binding = ${samplerBindingIndex}) uniform ${componentType}${samplerType} ${samplerName};`); @@ -90028,20 +96096,20 @@ class WebGPUShaderProcessorGLSL extends WebGPUShaderProcessor { for (let i = 0;i < arraySize; ++i) { const textureSetIndex = textureInfo.textures[i].groupIndex; const textureBindingIndex = textureInfo.textures[i].bindingIndex; - layouts.push(`layout(set = ${textureSetIndex}, binding = ${textureBindingIndex}) uniform ${textureType} ${name76}Texture${i};`); - uniform += `${i > 0 ? "\n" : ""}#define ${name76}${i} ${componentType}${samplerFunction}(${name76}Texture${i}, ${samplerName})`; + layouts.push(`layout(set = ${textureSetIndex}, binding = ${textureBindingIndex}) uniform ${textureType} ${name77}Texture${i};`); + uniform += `${i > 0 ? "\n" : ""}#define ${name77}${i} ${componentType}${samplerFunction}(${name77}Texture${i}, ${samplerName})`; } uniform = layouts.join("\n") + uniform; - this._textureArrayProcessing.push(name76); + this._textureArrayProcessing.push(name77); } - this._webgpuProcessingContext.availableTextures[name76] = textureInfo; + this._webgpuProcessingContext.availableTextures[name77] = textureInfo; this._webgpuProcessingContext.availableSamplers[samplerName] = samplerInfo; this._addSamplerBindingDescription(samplerName, samplerInfo, !isFragment); for (let i = 0;i < arraySize; ++i) { - this._addTextureBindingDescription(name76, textureInfo, i, textureDimension, null, !isFragment); + this._addTextureBindingDescription(name77, textureInfo, i, textureDimension, null, !isFragment); } } else { - this._addUniformToLeftOverUBO(name76, uniformType, preProcessors); + this._addUniformToLeftOverUBO(name77, uniformType, preProcessors); uniform = ""; } } @@ -90051,10 +96119,10 @@ class WebGPUShaderProcessorGLSL extends WebGPUShaderProcessor { const uboRegex = /uniform\s+(\w+)/gm; const match = uboRegex.exec(uniformBuffer7); if (match !== null) { - const name76 = match[1]; - let uniformBufferInfo = this._webgpuProcessingContext.availableBuffers[name76]; + const name77 = match[1]; + let uniformBufferInfo = this._webgpuProcessingContext.availableBuffers[name77]; if (!uniformBufferInfo) { - const knownUBO = WebGPUShaderProcessingContext.KnownUBOs[name76]; + const knownUBO = WebGPUShaderProcessingContext.KnownUBOs[name77]; let binding; if (knownUBO && knownUBO.binding.groupIndex !== -1) { binding = knownUBO.binding; @@ -90062,9 +96130,9 @@ class WebGPUShaderProcessorGLSL extends WebGPUShaderProcessor { binding = this._webgpuProcessingContext.getNextFreeUBOBinding(); } uniformBufferInfo = { binding }; - this._webgpuProcessingContext.availableBuffers[name76] = uniformBufferInfo; + this._webgpuProcessingContext.availableBuffers[name77] = uniformBufferInfo; } - this._addBufferBindingDescription(name76, uniformBufferInfo, BufferBindingType.Uniform, !isFragment); + this._addBufferBindingDescription(name77, uniformBufferInfo, BufferBindingType.Uniform, !isFragment); uniformBuffer7 = uniformBuffer7.replace("uniform", `layout(set = ${uniformBufferInfo.binding.groupIndex}, binding = ${uniformBufferInfo.binding.bindingIndex}) uniform`); } return uniformBuffer7; @@ -90123,8 +96191,8 @@ class WebGPUShaderProcessorGLSL extends WebGPUShaderProcessor { } return code; } - _applyTextureArrayProcessing(code, name76) { - const regex = new RegExp(name76 + "\\s*\\[(.+)?\\]", "gm"); + _applyTextureArrayProcessing(code, name77) { + const regex = new RegExp(name77 + "\\s*\\[(.+)?\\]", "gm"); let match = regex.exec(code); while (match !== null) { const index = match[1]; @@ -90132,13 +96200,13 @@ class WebGPUShaderProcessorGLSL extends WebGPUShaderProcessor { if (this._preProcessors && isNaN(iindex)) { iindex = +this._preProcessors[index.trim()]; } - code = code.replace(match[0], name76 + iindex); + code = code.replace(match[0], name77 + iindex); match = regex.exec(code); } return code; } - _generateLeftOverUBOCode(name76, uniformBufferDescription) { - let ubo = `layout(set = ${uniformBufferDescription.binding.groupIndex}, binding = ${uniformBufferDescription.binding.bindingIndex}) uniform ${name76} {\n `; + _generateLeftOverUBOCode(name77, uniformBufferDescription) { + let ubo = `layout(set = ${uniformBufferDescription.binding.groupIndex}, binding = ${uniformBufferDescription.binding.bindingIndex}) uniform ${name77} {\n `; for (const leftOverUniform of this._webgpuProcessingContext.leftOverUniforms) { if (leftOverUniform.length > 0) { ubo += ` ${leftOverUniform.type} ${leftOverUniform.name}[${leftOverUniform.length}];\n`; @@ -90151,9 +96219,9 @@ class WebGPUShaderProcessorGLSL extends WebGPUShaderProcessor { } finalizeShaders(vertexCode, fragmentCode) { for (let i = 0;i < this._textureArrayProcessing.length; ++i) { - const name76 = this._textureArrayProcessing[i]; - vertexCode = this._applyTextureArrayProcessing(vertexCode, name76); - fragmentCode = this._applyTextureArrayProcessing(fragmentCode, name76); + const name77 = this._textureArrayProcessing[i]; + vertexCode = this._applyTextureArrayProcessing(vertexCode, name77); + fragmentCode = this._applyTextureArrayProcessing(fragmentCode, name77); } for (let i = 0;i < this._missingVaryings.length; ++i) { const decl = this._missingVaryings[i]; @@ -90171,10 +96239,20 @@ class WebGPUShaderProcessorGLSL extends WebGPUShaderProcessor { return { vertexCode, fragmentCode }; } } +var init_webgpuShaderProcessorsGLSL = __esm(() => { + init_webgpuShaderProcessingContext(); + init_webgpuConstants(); + init_logger(); + init_webgpuShaderProcessor(); + init_shaderLanguage(); +}); // node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bonesDeclaration.js -var name76 = "bonesDeclaration"; -var shader76 = `#if NUM_BONE_INFLUENCERS>0 +var name77, shader76; +var init_bonesDeclaration2 = __esm(() => { + init_shaderStore(); + name77 = "bonesDeclaration"; + shader76 = `#if NUM_BONE_INFLUENCERS>0 attribute matricesIndices : vec4;attribute matricesWeights : vec4; #if NUM_BONE_INFLUENCERS>4 attribute matricesIndicesExtra : vec4;attribute matricesWeightsExtra : vec4; @@ -90196,11 +96274,15 @@ let m0=textureLoad(smp,vec2(offset+0,0),0);let m1=textureLoad(smp,vec2 #endif #endif `; -ShaderStore.IncludesShadersStoreWGSL[name76] = shader76; + ShaderStore.IncludesShadersStoreWGSL[name77] = shader76; +}); // node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bonesVertex.js -var name77 = "bonesVertex"; -var shader77 = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE +var name78, shader77; +var init_bonesVertex2 = __esm(() => { + init_shaderStore(); + name78 = "bonesVertex"; + shader77 = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE #if NUM_BONE_INFLUENCERS>0 var influence : mat4x4; #ifdef BONETEXTURE @@ -90254,11 +96336,15 @@ finalWorld=finalWorld*influence; #endif #endif `; -ShaderStore.IncludesShadersStoreWGSL[name77] = shader77; + ShaderStore.IncludesShadersStoreWGSL[name78] = shader77; +}); // node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.js -var name78 = "bakedVertexAnimationDeclaration"; -var shader78 = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE +var name79, shader78; +var init_bakedVertexAnimationDeclaration2 = __esm(() => { + init_shaderStore(); + name79 = "bakedVertexAnimationDeclaration"; + shader78 = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE uniform bakedVertexAnimationTime: f32;uniform bakedVertexAnimationTextureSizeInverted: vec2;uniform bakedVertexAnimationSettings: vec4;var bakedVertexAnimationTexture : texture_2d; #ifdef INSTANCES attribute bakedVertexAnimationSettingsInstanced : vec4; @@ -90267,11 +96353,15 @@ fn readMatrixFromRawSamplerVAT(smp : texture_2d,index : f32,frame : f32)->m {let offset=i32(index)*4;let frameUV=i32(frame);let m0=textureLoad(smp,vec2(offset+0,frameUV),0);let m1=textureLoad(smp,vec2(offset+1,frameUV),0);let m2=textureLoad(smp,vec2(offset+2,frameUV),0);let m3=textureLoad(smp,vec2(offset+3,frameUV),0);return mat4x4(m0,m1,m2,m3);} #endif `; -ShaderStore.IncludesShadersStoreWGSL[name78] = shader78; + ShaderStore.IncludesShadersStoreWGSL[name79] = shader78; +}); // node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimation.js -var name79 = "bakedVertexAnimation"; -var shader79 = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE +var name80, shader79; +var init_bakedVertexAnimation2 = __esm(() => { + init_shaderStore(); + name80 = "bakedVertexAnimation"; + shader79 = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE { #ifdef INSTANCES let VATStartFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.x;let VATEndFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.y;let VATOffsetFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.z;let VATSpeed: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.w; @@ -90303,11 +96393,15 @@ VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTextur finalWorld=finalWorld*VATInfluence;} #endif `; -ShaderStore.IncludesShadersStoreWGSL[name79] = shader79; + ShaderStore.IncludesShadersStoreWGSL[name80] = shader79; +}); // node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragment.js -var name80 = "clipPlaneFragment"; -var shader80 = `#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6) +var name81, shader80; +var init_clipPlaneFragment2 = __esm(() => { + init_shaderStore(); + name81 = "clipPlaneFragment"; + shader80 = `#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6) if (false) {} #endif #ifdef CLIPPLANE @@ -90335,11 +96429,15 @@ else if (fragmentInputs.fClipDistance6>0.0) {discard;} #endif `; -ShaderStore.IncludesShadersStoreWGSL[name80] = shader80; + ShaderStore.IncludesShadersStoreWGSL[name81] = shader80; +}); // node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.js -var name81 = "clipPlaneFragmentDeclaration"; -var shader81 = `#ifdef CLIPPLANE +var name82, shader81; +var init_clipPlaneFragmentDeclaration2 = __esm(() => { + init_shaderStore(); + name82 = "clipPlaneFragmentDeclaration"; + shader81 = `#ifdef CLIPPLANE varying fClipDistance: f32; #endif #ifdef CLIPPLANE2 @@ -90358,11 +96456,15 @@ varying fClipDistance5: f32; varying fClipDistance6: f32; #endif `; -ShaderStore.IncludesShadersStoreWGSL[name81] = shader81; + ShaderStore.IncludesShadersStoreWGSL[name82] = shader81; +}); // node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertex.js -var name82 = "clipPlaneVertex"; -var shader82 = `#ifdef CLIPPLANE +var name83, shader82; +var init_clipPlaneVertex2 = __esm(() => { + init_shaderStore(); + name83 = "clipPlaneVertex"; + shader82 = `#ifdef CLIPPLANE vertexOutputs.fClipDistance=dot(worldPos,uniforms.vClipPlane); #endif #ifdef CLIPPLANE2 @@ -90381,11 +96483,15 @@ vertexOutputs.fClipDistance5=dot(worldPos,uniforms.vClipPlane5); vertexOutputs.fClipDistance6=dot(worldPos,uniforms.vClipPlane6); #endif `; -ShaderStore.IncludesShadersStoreWGSL[name82] = shader82; + ShaderStore.IncludesShadersStoreWGSL[name83] = shader82; +}); // node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.js -var name83 = "clipPlaneVertexDeclaration"; -var shader83 = `#ifdef CLIPPLANE +var name84, shader83; +var init_clipPlaneVertexDeclaration2 = __esm(() => { + init_shaderStore(); + name84 = "clipPlaneVertexDeclaration"; + shader83 = `#ifdef CLIPPLANE uniform vClipPlane: vec4;varying fClipDistance: f32; #endif #ifdef CLIPPLANE2 @@ -90404,11 +96510,15 @@ uniform vClipPlane5: vec4;varying fClipDistance5: f32; uniform vClipPlane6: vec4;varying fClipDistance6: f32; #endif `; -ShaderStore.IncludesShadersStoreWGSL[name83] = shader83; + ShaderStore.IncludesShadersStoreWGSL[name84] = shader83; +}); // node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/instancesDeclaration.js -var name84 = "instancesDeclaration"; -var shader84 = `#ifdef INSTANCES +var name85, shader84; +var init_instancesDeclaration2 = __esm(() => { + init_shaderStore(); + name85 = "instancesDeclaration"; + shader84 = `#ifdef INSTANCES attribute world0 : vec4;attribute world1 : vec4;attribute world2 : vec4;attribute world3 : vec4; #ifdef INSTANCESCOLOR attribute instanceColor : vec4; @@ -90431,11 +96541,15 @@ uniform previousWorld : mat4x4; #endif #endif `; -ShaderStore.IncludesShadersStoreWGSL[name84] = shader84; + ShaderStore.IncludesShadersStoreWGSL[name85] = shader84; +}); // node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/instancesVertex.js -var name85 = "instancesVertex"; -var shader85 = `#ifdef INSTANCES +var name86, shader85; +var init_instancesVertex2 = __esm(() => { + init_shaderStore(); + name86 = "instancesVertex"; + shader85 = `#ifdef INSTANCES var finalWorld=mat4x4(vertexInputs.world0,vertexInputs.world1,vertexInputs.world2,vertexInputs.world3); #if defined(PREPASS_VELOCITY) || defined(VELOCITY) var finalPreviousWorld=mat4x4(previousWorld0,previousWorld1,previousWorld2,previousWorld3); @@ -90461,19 +96575,27 @@ var finalPreviousWorld=previousWorld; #endif #endif `; -ShaderStore.IncludesShadersStoreWGSL[name85] = shader85; + ShaderStore.IncludesShadersStoreWGSL[name86] = shader85; +}); // node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/meshUboDeclaration.js -var name86 = "meshUboDeclaration"; -var shader86 = `struct Mesh {world : mat4x4, +var name87, shader86; +var init_meshUboDeclaration2 = __esm(() => { + init_shaderStore(); + name87 = "meshUboDeclaration"; + shader86 = `struct Mesh {world : mat4x4, visibility : f32,};var mesh : Mesh; #define WORLD_UBO `; -ShaderStore.IncludesShadersStoreWGSL[name86] = shader86; + ShaderStore.IncludesShadersStoreWGSL[name87] = shader86; +}); // node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertex.js -var name87 = "morphTargetsVertex"; -var shader87 = `#ifdef MORPHTARGETS +var name88, shader87; +var init_morphTargetsVertex2 = __esm(() => { + init_shaderStore(); + name88 = "morphTargetsVertex"; + shader87 = `#ifdef MORPHTARGETS #ifdef MORPHTARGETS_TEXTURE vertexID=f32(vertexInputs.vertexIndex)*uniforms.morphTargetTextureInfo.x;positionUpdated=positionUpdated+(readVector3FromRawSampler({X},vertexID)-vertexInputs.position)*uniforms.morphTargetInfluences[{X}];vertexID=vertexID+1.0; #ifdef MORPHTARGETS_NORMAL @@ -90499,11 +96621,15 @@ uvUpdated=uvUpdated+(uv_{X}-vertexInputs.uv)*uniforms.morphTargetInfluences[{X}] #endif #endif `; -ShaderStore.IncludesShadersStoreWGSL[name87] = shader87; + ShaderStore.IncludesShadersStoreWGSL[name88] = shader87; +}); // node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertexDeclaration.js -var name88 = "morphTargetsVertexDeclaration"; -var shader88 = `#ifdef MORPHTARGETS +var name89, shader88; +var init_morphTargetsVertexDeclaration2 = __esm(() => { + init_shaderStore(); + name89 = "morphTargetsVertexDeclaration"; + shader88 = `#ifdef MORPHTARGETS #ifndef MORPHTARGETS_TEXTURE attribute position{X} : vec3; #ifdef MORPHTARGETS_NORMAL @@ -90518,21 +96644,29 @@ attribute uv_{X} : vec2; #endif #endif `; -ShaderStore.IncludesShadersStoreWGSL[name88] = shader88; + ShaderStore.IncludesShadersStoreWGSL[name89] = shader88; +}); // node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobal.js -var name89 = "morphTargetsVertexGlobal"; -var shader89 = `#ifdef MORPHTARGETS +var name90, shader89; +var init_morphTargetsVertexGlobal2 = __esm(() => { + init_shaderStore(); + name90 = "morphTargetsVertexGlobal"; + shader89 = `#ifdef MORPHTARGETS #ifdef MORPHTARGETS_TEXTURE var vertexID : f32; #endif #endif `; -ShaderStore.IncludesShadersStoreWGSL[name89] = shader89; + ShaderStore.IncludesShadersStoreWGSL[name90] = shader89; +}); // node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobalDeclaration.js -var name90 = "morphTargetsVertexGlobalDeclaration"; -var shader90 = `#ifdef MORPHTARGETS +var name91, shader90; +var init_morphTargetsVertexGlobalDeclaration2 = __esm(() => { + init_shaderStore(); + name91 = "morphTargetsVertexGlobalDeclaration"; + shader90 = `#ifdef MORPHTARGETS uniform morphTargetInfluences : array; #ifdef MORPHTARGETS_TEXTURE uniform morphTargetTextureIndices : array;uniform morphTargetTextureInfo : vec3;var morphTargets : texture_2d_array;var morphTargetsSampler : sampler;fn readVector3FromRawSampler(targetIndex : i32,vertexIndex : f32)->vec3 @@ -90541,11 +96675,15 @@ let y=floor(vertexIndex/uniforms.morphTargetTextureInfo.y);let x=vertexIndex-y*u #endif #endif `; -ShaderStore.IncludesShadersStoreWGSL[name90] = shader90; + ShaderStore.IncludesShadersStoreWGSL[name91] = shader90; +}); // node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js -var name91 = "sceneUboDeclaration"; -var shader91 = `struct Scene {viewProjection : mat4x4, +var name92, shader91; +var init_sceneUboDeclaration2 = __esm(() => { + init_shaderStore(); + name92 = "sceneUboDeclaration"; + shader91 = `struct Scene {viewProjection : mat4x4, #ifdef MULTIVIEW viewProjectionR : mat4x4, #endif @@ -90553,32 +96691,10 @@ view : mat4x4, projection : mat4x4, vEyePosition : vec4,};var scene : Scene; `; -ShaderStore.IncludesShadersStoreWGSL[name91] = shader91; + ShaderStore.IncludesShadersStoreWGSL[name92] = shader91; +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuShaderProcessorsWGSL.js -var builtInName_frag_depth = "fragmentOutputs.fragDepth"; -var leftOverVarName = "uniforms"; -var internalsVarName = "internals"; -var gpuTextureViewDimensionByWebGPUTextureFunction = { - texture_1d: TextureViewDimension.E1d, - texture_2d: TextureViewDimension.E2d, - texture_2d_array: TextureViewDimension.E2dArray, - texture_3d: TextureViewDimension.E3d, - texture_cube: TextureViewDimension.Cube, - texture_cube_array: TextureViewDimension.CubeArray, - texture_multisampled_2d: TextureViewDimension.E2d, - texture_depth_2d: TextureViewDimension.E2d, - texture_depth_2d_array: TextureViewDimension.E2dArray, - texture_depth_cube: TextureViewDimension.Cube, - texture_depth_cube_array: TextureViewDimension.CubeArray, - texture_depth_multisampled_2d: TextureViewDimension.E2d, - texture_storage_1d: TextureViewDimension.E1d, - texture_storage_2d: TextureViewDimension.E2d, - texture_storage_2d_array: TextureViewDimension.E2dArray, - texture_storage_3d: TextureViewDimension.E3d, - texture_external: null -}; - class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor { constructor() { super(...arguments); @@ -90587,7 +96703,7 @@ class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor { this.textureRegexp = /var\s+(\w+)\s*:\s*((array<\s*)?(texture_\w+)\s*(<\s*(.+)\s*>)?\s*(,\s*\w+\s*>\s*)?);/; this.noPrecision = true; } - _getArraySize(name92, uniformType, preProcessors) { + _getArraySize(name93, uniformType, preProcessors) { let length = 0; const endArray = uniformType.lastIndexOf(">"); if (uniformType.indexOf("array") >= 0 && endArray > 0) { @@ -90605,7 +96721,7 @@ class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor { } uniformType = uniformType.substring(uniformType.indexOf("<") + 1, startArray + 1); } - return [name92, uniformType, length]; + return [name93, uniformType, length]; } initializeShaders(processingContext) { this._webgpuProcessingContext = processingContext; @@ -90625,18 +96741,18 @@ class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor { const match = varyingRegex2.exec(varying); if (match !== null) { const varyingType = match[2]; - const name92 = match[1]; + const name93 = match[1]; let location2; if (isFragment) { - location2 = this._webgpuProcessingContext.availableVaryings[name92]; + location2 = this._webgpuProcessingContext.availableVaryings[name93]; if (location2 === undefined) { - Logger.Warn(`Invalid fragment shader: The varying named "${name92}" is not declared in the vertex shader! This declaration will be ignored.`); + Logger.Warn(`Invalid fragment shader: The varying named "${name93}" is not declared in the vertex shader! This declaration will be ignored.`); } } else { - location2 = this._webgpuProcessingContext.getVaryingNextLocation(varyingType, this._getArraySize(name92, varyingType, preProcessors)[2]); - this._webgpuProcessingContext.availableVaryings[name92] = location2; - this._varyingsWGSL.push(` @location(${location2}) ${name92} : ${varyingType},`); - this._varyingNamesWGSL.push(name92); + location2 = this._webgpuProcessingContext.getVaryingNextLocation(varyingType, this._getArraySize(name93, varyingType, preProcessors)[2]); + this._webgpuProcessingContext.availableVaryings[name93] = location2; + this._varyingsWGSL.push(` @location(${location2}) ${name93} : ${varyingType},`); + this._varyingNamesWGSL.push(name93); } varying = ""; } @@ -90647,22 +96763,22 @@ class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor { const match = attribRegex.exec(attribute); if (match !== null) { const attributeType = match[2]; - const name92 = match[1]; - const location2 = this._webgpuProcessingContext.getAttributeNextLocation(attributeType, this._getArraySize(name92, attributeType, preProcessors)[2]); - this._webgpuProcessingContext.availableAttributes[name92] = location2; - this._webgpuProcessingContext.orderedAttributes[location2] = name92; - const numComponents = this.vertexBufferKindToNumberOfComponents[name92]; + const name93 = match[1]; + const location2 = this._webgpuProcessingContext.getAttributeNextLocation(attributeType, this._getArraySize(name93, attributeType, preProcessors)[2]); + this._webgpuProcessingContext.availableAttributes[name93] = location2; + this._webgpuProcessingContext.orderedAttributes[location2] = name93; + const numComponents = this.vertexBufferKindToNumberOfComponents[name93]; if (numComponents !== undefined) { const newType = numComponents < 0 ? numComponents === -1 ? "i32" : "vec" + -numComponents + "" : numComponents === 1 ? "u32" : "vec" + numComponents + ""; - const newName = `_int_${name92}_`; + const newName = `_int_${name93}_`; this._attributesInputWGSL.push(`@location(${location2}) ${newName} : ${newType},`); - this._attributesWGSL.push(`${name92} : ${attributeType},`); - this._attributesConversionCodeWGSL.push(`vertexInputs.${name92} = ${attributeType}(vertexInputs_.${newName});`); + this._attributesWGSL.push(`${name93} : ${attributeType},`); + this._attributesConversionCodeWGSL.push(`vertexInputs.${name93} = ${attributeType}(vertexInputs_.${newName});`); this._hasNonFloatAttribute = true; } else { - this._attributesInputWGSL.push(`@location(${location2}) ${name92} : ${attributeType},`); - this._attributesWGSL.push(`${name92} : ${attributeType},`); - this._attributesConversionCodeWGSL.push(`vertexInputs.${name92} = vertexInputs_.${name92};`); + this._attributesInputWGSL.push(`@location(${location2}) ${name93} : ${attributeType},`); + this._attributesWGSL.push(`${name93} : ${attributeType},`); + this._attributesConversionCodeWGSL.push(`vertexInputs.${name93} = vertexInputs_.${name93};`); } attribute = ""; } @@ -90672,8 +96788,8 @@ class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor { const match = this.uniformRegexp.exec(uniform); if (match !== null) { const uniformType = match[2]; - const name92 = match[1]; - this._addUniformToLeftOverUBO(name92, uniformType, preProcessors); + const name93 = match[1]; + this._addUniformToLeftOverUBO(name93, uniformType, preProcessors); uniform = ""; } return uniform; @@ -90681,15 +96797,15 @@ class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor { textureProcessor(texture16, isFragment, preProcessors) { const match = this.textureRegexp.exec(texture16); if (match !== null) { - const name92 = match[1]; + const name93 = match[1]; const type = match[2]; const isArrayOfTexture = !!match[3]; const textureFunc = match[4]; const isStorageTexture = textureFunc.indexOf("storage") > 0; const componentType = match[6]; const storageTextureFormat = isStorageTexture ? componentType.substring(0, componentType.indexOf(",")).trim() : null; - let arraySize = isArrayOfTexture ? this._getArraySize(name92, type, preProcessors)[2] : 0; - let textureInfo = this._webgpuProcessingContext.availableTextures[name92]; + let arraySize = isArrayOfTexture ? this._getArraySize(name93, type, preProcessors)[2] : 0; + let textureInfo = this._webgpuProcessingContext.availableTextures[name93]; if (!textureInfo) { textureInfo = { isTextureArray: arraySize > 0, @@ -90704,7 +96820,7 @@ class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor { } else { arraySize = textureInfo.textures.length; } - this._webgpuProcessingContext.availableTextures[name92] = textureInfo; + this._webgpuProcessingContext.availableTextures[name93] = textureInfo; const isDepthTexture = textureFunc.indexOf("depth") > 0; const textureDimension = gpuTextureViewDimensionByWebGPUTextureFunction[textureFunc]; const sampleType = isDepthTexture ? TextureSampleType.Depth : componentType === "u32" ? TextureSampleType.Uint : componentType === "i32" ? TextureSampleType.Sint : TextureSampleType.Float; @@ -90717,7 +96833,7 @@ class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor { if (i === 0) { texture16 = `@group(${groupIndex}) @binding(${bindingIndex}) ${texture16}`; } - this._addTextureBindingDescription(name92, textureInfo, i, textureDimension, storageTextureFormat, !isFragment); + this._addTextureBindingDescription(name93, textureInfo, i, textureDimension, storageTextureFormat, !isFragment); } } return texture16; @@ -90804,15 +96920,15 @@ class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor { this.vertexBufferKindToNumberOfComponents = {}; return { vertexCode, fragmentCode }; } - _generateLeftOverUBOCode(name92, uniformBufferDescription) { + _generateLeftOverUBOCode(name93, uniformBufferDescription) { let stridedArrays = ""; - let ubo = `struct ${name92} {\n`; + let ubo = `struct ${name93} {\n`; for (const leftOverUniform of this._webgpuProcessingContext.leftOverUniforms) { const type = leftOverUniform.type.replace(/^(.*?)(<.*>)?$/, "$1"); const size = WebGPUShaderProcessor.UniformSizes[type]; if (leftOverUniform.length > 0) { if (size <= 2) { - const stridedArrayType = `${name92}_${this._stridedUniformArrays.length}_strided_arr`; + const stridedArrayType = `${name93}_${this._stridedUniformArrays.length}_strided_arr`; stridedArrays += `struct ${stridedArrayType} { @size(16) el: ${type}, @@ -90828,7 +96944,7 @@ class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor { } ubo += "};\n"; ubo = `${stridedArrays}\n${ubo}`; - ubo += `@group(${uniformBufferDescription.binding.groupIndex}) @binding(${uniformBufferDescription.binding.bindingIndex}) var ${leftOverVarName} : ${name92};\n`; + ubo += `@group(${uniformBufferDescription.binding.groupIndex}) @binding(${uniformBufferDescription.binding.bindingIndex}) var ${leftOverVarName} : ${name93};\n`; return ubo; } _processSamplers(code, isVertex) { @@ -90838,9 +96954,9 @@ class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor { if (match === null) { break; } - const name92 = match[1]; + const name93 = match[1]; const samplerType = match[2]; - const textureName = name92.indexOf(WebGPUShaderProcessor.AutoSamplerSuffix) === name92.length - WebGPUShaderProcessor.AutoSamplerSuffix.length ? name92.substring(0, name92.indexOf(WebGPUShaderProcessor.AutoSamplerSuffix)) : null; + const textureName = name93.indexOf(WebGPUShaderProcessor.AutoSamplerSuffix) === name93.length - WebGPUShaderProcessor.AutoSamplerSuffix.length ? name93.substring(0, name93.indexOf(WebGPUShaderProcessor.AutoSamplerSuffix)) : null; const samplerBindingType = samplerType === "sampler_comparison" ? SamplerBindingType.Comparison : SamplerBindingType.Filtering; if (textureName) { const textureInfo = this._webgpuProcessingContext.availableTextures[textureName]; @@ -90848,15 +96964,15 @@ class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor { textureInfo.autoBindSampler = true; } } - let samplerInfo = this._webgpuProcessingContext.availableSamplers[name92]; + let samplerInfo = this._webgpuProcessingContext.availableSamplers[name93]; if (!samplerInfo) { samplerInfo = { binding: this._webgpuProcessingContext.getNextFreeUBOBinding(), type: samplerBindingType }; - this._webgpuProcessingContext.availableSamplers[name92] = samplerInfo; + this._webgpuProcessingContext.availableSamplers[name93] = samplerInfo; } - this._addSamplerBindingDescription(name92, samplerInfo, isVertex); + this._addSamplerBindingDescription(name93, samplerInfo, isVertex); const part1 = code.substring(0, match.index); const insertPart = `@group(${samplerInfo.binding.groupIndex}) @binding(${samplerInfo.binding.bindingIndex}) `; const part2 = code.substring(match.index); @@ -90874,14 +96990,14 @@ class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor { } const type = match[1]; const decoration = match[3]; - let name92 = match[4]; + let name93 = match[4]; const structName = match[5]; - let bufferInfo = this._webgpuProcessingContext.availableBuffers[name92]; + let bufferInfo = this._webgpuProcessingContext.availableBuffers[name93]; if (!bufferInfo) { const knownUBO = type === "uniform" ? WebGPUShaderProcessingContext.KnownUBOs[structName] : null; let binding; if (knownUBO) { - name92 = structName; + name93 = structName; binding = knownUBO.binding; if (binding.groupIndex === -1) { binding = this._webgpuProcessingContext.getNextFreeUBOBinding(); @@ -90890,9 +97006,9 @@ class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor { binding = this._webgpuProcessingContext.getNextFreeUBOBinding(); } bufferInfo = { binding }; - this._webgpuProcessingContext.availableBuffers[name92] = bufferInfo; + this._webgpuProcessingContext.availableBuffers[name93] = bufferInfo; } - this._addBufferBindingDescription(name92, this._webgpuProcessingContext.availableBuffers[name92], decoration === "read_write" ? BufferBindingType.Storage : type === "storage" ? BufferBindingType.ReadOnlyStorage : BufferBindingType.Uniform, isVertex); + this._addBufferBindingDescription(name93, this._webgpuProcessingContext.availableBuffers[name93], decoration === "read_write" ? BufferBindingType.Storage : type === "storage" ? BufferBindingType.ReadOnlyStorage : BufferBindingType.Uniform, isVertex); const groupIndex = bufferInfo.binding.groupIndex; const bindingIndex = bufferInfo.binding.bindingIndex; const part1 = code.substring(0, match.index); @@ -90910,6 +97026,53 @@ class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor { return code; } } +var builtInName_frag_depth, leftOverVarName, internalsVarName, gpuTextureViewDimensionByWebGPUTextureFunction; +var init_webgpuShaderProcessorsWGSL = __esm(() => { + init_webgpuShaderProcessingContext(); + init_webgpuConstants(); + init_logger(); + init_webgpuShaderProcessor(); + init_codeStringParsingTools(); + init_bonesDeclaration2(); + init_bonesVertex2(); + init_bakedVertexAnimationDeclaration2(); + init_bakedVertexAnimation2(); + init_clipPlaneFragment2(); + init_clipPlaneFragmentDeclaration2(); + init_clipPlaneVertex2(); + init_clipPlaneVertexDeclaration2(); + init_instancesDeclaration2(); + init_instancesVertex2(); + init_meshUboDeclaration2(); + init_morphTargetsVertex2(); + init_morphTargetsVertexDeclaration2(); + init_morphTargetsVertexGlobal2(); + init_morphTargetsVertexGlobalDeclaration2(); + init_sceneUboDeclaration2(); + init_shaderLanguage(); + builtInName_frag_depth = "fragmentOutputs.fragDepth"; + leftOverVarName = "uniforms"; + internalsVarName = "internals"; + gpuTextureViewDimensionByWebGPUTextureFunction = { + texture_1d: TextureViewDimension.E1d, + texture_2d: TextureViewDimension.E2d, + texture_2d_array: TextureViewDimension.E2dArray, + texture_3d: TextureViewDimension.E3d, + texture_cube: TextureViewDimension.Cube, + texture_cube_array: TextureViewDimension.CubeArray, + texture_multisampled_2d: TextureViewDimension.E2d, + texture_depth_2d: TextureViewDimension.E2d, + texture_depth_2d_array: TextureViewDimension.E2dArray, + texture_depth_cube: TextureViewDimension.Cube, + texture_depth_cube_array: TextureViewDimension.CubeArray, + texture_depth_multisampled_2d: TextureViewDimension.E2d, + texture_storage_1d: TextureViewDimension.E1d, + texture_storage_2d: TextureViewDimension.E2d, + texture_storage_2d_array: TextureViewDimension.E2dArray, + texture_storage_3d: TextureViewDimension.E3d, + texture_external: null + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuHardwareTexture.js class WebGPUHardwareTexture { @@ -90983,237 +97146,12 @@ class WebGPUHardwareTexture { this.reset(); } } +var init_webgpuHardwareTexture = __esm(() => { + init_math_scalar(); + init_webgpuConstants(); +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuTextureHelper.js -var mipmapVertexSource = ` - const vec2 pos[4] = vec2[4](vec2(-1.0f, 1.0f), vec2(1.0f, 1.0f), vec2(-1.0f, -1.0f), vec2(1.0f, -1.0f)); - const vec2 tex[4] = vec2[4](vec2(0.0f, 0.0f), vec2(1.0f, 0.0f), vec2(0.0f, 1.0f), vec2(1.0f, 1.0f)); - - layout(location = 0) out vec2 vTex; - - void main() { - vTex = tex[gl_VertexIndex]; - gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0); - } - `; -var mipmapFragmentSource = ` - layout(set = 0, binding = 0) uniform sampler imgSampler; - layout(set = 0, binding = 1) uniform texture2D img; - - layout(location = 0) in vec2 vTex; - layout(location = 0) out vec4 outColor; - - void main() { - outColor = texture(sampler2D(img, imgSampler), vTex); - } - `; -var invertYPreMultiplyAlphaVertexSource = ` - #extension GL_EXT_samplerless_texture_functions : enable - - const vec2 pos[4] = vec2[4](vec2(-1.0f, 1.0f), vec2(1.0f, 1.0f), vec2(-1.0f, -1.0f), vec2(1.0f, -1.0f)); - const vec2 tex[4] = vec2[4](vec2(0.0f, 0.0f), vec2(1.0f, 0.0f), vec2(0.0f, 1.0f), vec2(1.0f, 1.0f)); - - layout(set = 0, binding = 0) uniform texture2D img; - - #ifdef INVERTY - layout(location = 0) out flat ivec2 vTextureSize; - #endif - - void main() { - #ifdef INVERTY - vTextureSize = textureSize(img, 0); - #endif - gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0); - } - `; -var invertYPreMultiplyAlphaFragmentSource = ` - #extension GL_EXT_samplerless_texture_functions : enable - - layout(set = 0, binding = 0) uniform texture2D img; - - #ifdef INVERTY - layout(location = 0) in flat ivec2 vTextureSize; - #endif - layout(location = 0) out vec4 outColor; - - void main() { - #ifdef INVERTY - vec4 color = texelFetch(img, ivec2(gl_FragCoord.x, vTextureSize.y - gl_FragCoord.y), 0); - #else - vec4 color = texelFetch(img, ivec2(gl_FragCoord.xy), 0); - #endif - #ifdef PREMULTIPLYALPHA - color.rgb *= color.a; - #endif - outColor = color; - } - `; -var invertYPreMultiplyAlphaWithOfstVertexSource = invertYPreMultiplyAlphaVertexSource; -var invertYPreMultiplyAlphaWithOfstFragmentSource = ` - #extension GL_EXT_samplerless_texture_functions : enable - - layout(set = 0, binding = 0) uniform texture2D img; - layout(set = 0, binding = 1) uniform Params { - float ofstX; - float ofstY; - float width; - float height; - }; - - #ifdef INVERTY - layout(location = 0) in flat ivec2 vTextureSize; - #endif - layout(location = 0) out vec4 outColor; - - void main() { - if (gl_FragCoord.x < ofstX || gl_FragCoord.x >= ofstX + width) { - discard; - } - if (gl_FragCoord.y < ofstY || gl_FragCoord.y >= ofstY + height) { - discard; - } - #ifdef INVERTY - vec4 color = texelFetch(img, ivec2(gl_FragCoord.x, ofstY + height - (gl_FragCoord.y - ofstY)), 0); - #else - vec4 color = texelFetch(img, ivec2(gl_FragCoord.xy), 0); - #endif - #ifdef PREMULTIPLYALPHA - color.rgb *= color.a; - #endif - outColor = color; - } - `; -var clearVertexSource = ` - const vec2 pos[4] = vec2[4](vec2(-1.0f, 1.0f), vec2(1.0f, 1.0f), vec2(-1.0f, -1.0f), vec2(1.0f, -1.0f)); - - void main() { - gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0); - } - `; -var clearFragmentSource = ` - layout(set = 0, binding = 0) uniform Uniforms { - uniform vec4 color; - }; - - layout(location = 0) out vec4 outColor; - - void main() { - outColor = color; - } - `; -var copyVideoToTextureVertexSource = ` - struct VertexOutput { - @builtin(position) Position : vec4, - @location(0) fragUV : vec2 - } - - @vertex - fn main( - @builtin(vertex_index) VertexIndex : u32 - ) -> VertexOutput { - var pos = array, 4>( - vec2(-1.0, 1.0), - vec2( 1.0, 1.0), - vec2(-1.0, -1.0), - vec2( 1.0, -1.0) - ); - var tex = array, 4>( - vec2(0.0, 0.0), - vec2(1.0, 0.0), - vec2(0.0, 1.0), - vec2(1.0, 1.0) - ); - - var output: VertexOutput; - - output.Position = vec4(pos[VertexIndex], 0.0, 1.0); - output.fragUV = tex[VertexIndex]; - - return output; - } - `; -var copyVideoToTextureFragmentSource = ` - @group(0) @binding(0) var videoSampler: sampler; - @group(0) @binding(1) var videoTexture: texture_external; - - @fragment - fn main( - @location(0) fragUV: vec2 - ) -> @location(0) vec4 { - return textureSampleBaseClampToEdge(videoTexture, videoSampler, fragUV); - } - `; -var copyVideoToTextureInvertYFragmentSource = ` - @group(0) @binding(0) var videoSampler: sampler; - @group(0) @binding(1) var videoTexture: texture_external; - - @fragment - fn main( - @location(0) fragUV: vec2 - ) -> @location(0) vec4 { - return textureSampleBaseClampToEdge(videoTexture, videoSampler, vec2(fragUV.x, 1.0 - fragUV.y)); - } - `; -var PipelineType; -(function(PipelineType2) { - PipelineType2[PipelineType2["MipMap"] = 0] = "MipMap"; - PipelineType2[PipelineType2["InvertYPremultiplyAlpha"] = 1] = "InvertYPremultiplyAlpha"; - PipelineType2[PipelineType2["Clear"] = 2] = "Clear"; - PipelineType2[PipelineType2["InvertYPremultiplyAlphaWithOfst"] = 3] = "InvertYPremultiplyAlphaWithOfst"; -})(PipelineType || (PipelineType = {})); -var VideoPipelineType; -(function(VideoPipelineType2) { - VideoPipelineType2[VideoPipelineType2["DontInvertY"] = 0] = "DontInvertY"; - VideoPipelineType2[VideoPipelineType2["InvertY"] = 1] = "InvertY"; -})(VideoPipelineType || (VideoPipelineType = {})); -var shadersForPipelineType = [ - { vertex: mipmapVertexSource, fragment: mipmapFragmentSource }, - { vertex: invertYPreMultiplyAlphaVertexSource, fragment: invertYPreMultiplyAlphaFragmentSource }, - { vertex: clearVertexSource, fragment: clearFragmentSource }, - { vertex: invertYPreMultiplyAlphaWithOfstVertexSource, fragment: invertYPreMultiplyAlphaWithOfstFragmentSource } -]; -var renderableTextureFormatToIndex = { - "": 0, - r8unorm: 1, - r8uint: 2, - r8sint: 3, - r16uint: 4, - r16sint: 5, - r16float: 6, - rg8unorm: 7, - rg8uint: 8, - rg8sint: 9, - r32uint: 10, - r32sint: 11, - r32float: 12, - rg16uint: 13, - rg16sint: 14, - rg16float: 15, - rgba8unorm: 16, - "rgba8unorm-srgb": 17, - rgba8uint: 18, - rgba8sint: 19, - bgra8unorm: 20, - "bgra8unorm-srgb": 21, - rgb10a2uint: 22, - rgb10a2unorm: 23, - rg32uint: 24, - rg32sint: 25, - rg32float: 26, - rgba16uint: 27, - rgba16sint: 28, - rgba16float: 29, - rgba32uint: 30, - rgba32sint: 31, - rgba32float: 32, - stencil8: 33, - depth16unorm: 34, - depth24plus: 35, - "depth24plus-stencil8": 36, - depth32float: 37, - "depth32float-stencil8": 38 -}; - class WebGPUTextureHelper { static ComputeNumMipmapLevels(width, height) { return Scalar.ILog2(Math.max(width, height)) + 1; @@ -92537,6 +98475,239 @@ class WebGPUTextureHelper { this._deferredReleaseTextures.length = 0; } } +var mipmapVertexSource, mipmapFragmentSource, invertYPreMultiplyAlphaVertexSource, invertYPreMultiplyAlphaFragmentSource, invertYPreMultiplyAlphaWithOfstVertexSource, invertYPreMultiplyAlphaWithOfstFragmentSource, clearVertexSource, clearFragmentSource, copyVideoToTextureVertexSource, copyVideoToTextureFragmentSource, copyVideoToTextureInvertYFragmentSource, PipelineType, VideoPipelineType, shadersForPipelineType, renderableTextureFormatToIndex; +var init_webgpuTextureHelper = __esm(() => { + init_webgpuConstants(); + init_math_scalar(); + init_internalTexture(); + init_webgpuHardwareTexture(); + mipmapVertexSource = ` + const vec2 pos[4] = vec2[4](vec2(-1.0f, 1.0f), vec2(1.0f, 1.0f), vec2(-1.0f, -1.0f), vec2(1.0f, -1.0f)); + const vec2 tex[4] = vec2[4](vec2(0.0f, 0.0f), vec2(1.0f, 0.0f), vec2(0.0f, 1.0f), vec2(1.0f, 1.0f)); + + layout(location = 0) out vec2 vTex; + + void main() { + vTex = tex[gl_VertexIndex]; + gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0); + } + `; + mipmapFragmentSource = ` + layout(set = 0, binding = 0) uniform sampler imgSampler; + layout(set = 0, binding = 1) uniform texture2D img; + + layout(location = 0) in vec2 vTex; + layout(location = 0) out vec4 outColor; + + void main() { + outColor = texture(sampler2D(img, imgSampler), vTex); + } + `; + invertYPreMultiplyAlphaVertexSource = ` + #extension GL_EXT_samplerless_texture_functions : enable + + const vec2 pos[4] = vec2[4](vec2(-1.0f, 1.0f), vec2(1.0f, 1.0f), vec2(-1.0f, -1.0f), vec2(1.0f, -1.0f)); + const vec2 tex[4] = vec2[4](vec2(0.0f, 0.0f), vec2(1.0f, 0.0f), vec2(0.0f, 1.0f), vec2(1.0f, 1.0f)); + + layout(set = 0, binding = 0) uniform texture2D img; + + #ifdef INVERTY + layout(location = 0) out flat ivec2 vTextureSize; + #endif + + void main() { + #ifdef INVERTY + vTextureSize = textureSize(img, 0); + #endif + gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0); + } + `; + invertYPreMultiplyAlphaFragmentSource = ` + #extension GL_EXT_samplerless_texture_functions : enable + + layout(set = 0, binding = 0) uniform texture2D img; + + #ifdef INVERTY + layout(location = 0) in flat ivec2 vTextureSize; + #endif + layout(location = 0) out vec4 outColor; + + void main() { + #ifdef INVERTY + vec4 color = texelFetch(img, ivec2(gl_FragCoord.x, vTextureSize.y - gl_FragCoord.y), 0); + #else + vec4 color = texelFetch(img, ivec2(gl_FragCoord.xy), 0); + #endif + #ifdef PREMULTIPLYALPHA + color.rgb *= color.a; + #endif + outColor = color; + } + `; + invertYPreMultiplyAlphaWithOfstVertexSource = invertYPreMultiplyAlphaVertexSource; + invertYPreMultiplyAlphaWithOfstFragmentSource = ` + #extension GL_EXT_samplerless_texture_functions : enable + + layout(set = 0, binding = 0) uniform texture2D img; + layout(set = 0, binding = 1) uniform Params { + float ofstX; + float ofstY; + float width; + float height; + }; + + #ifdef INVERTY + layout(location = 0) in flat ivec2 vTextureSize; + #endif + layout(location = 0) out vec4 outColor; + + void main() { + if (gl_FragCoord.x < ofstX || gl_FragCoord.x >= ofstX + width) { + discard; + } + if (gl_FragCoord.y < ofstY || gl_FragCoord.y >= ofstY + height) { + discard; + } + #ifdef INVERTY + vec4 color = texelFetch(img, ivec2(gl_FragCoord.x, ofstY + height - (gl_FragCoord.y - ofstY)), 0); + #else + vec4 color = texelFetch(img, ivec2(gl_FragCoord.xy), 0); + #endif + #ifdef PREMULTIPLYALPHA + color.rgb *= color.a; + #endif + outColor = color; + } + `; + clearVertexSource = ` + const vec2 pos[4] = vec2[4](vec2(-1.0f, 1.0f), vec2(1.0f, 1.0f), vec2(-1.0f, -1.0f), vec2(1.0f, -1.0f)); + + void main() { + gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0); + } + `; + clearFragmentSource = ` + layout(set = 0, binding = 0) uniform Uniforms { + uniform vec4 color; + }; + + layout(location = 0) out vec4 outColor; + + void main() { + outColor = color; + } + `; + copyVideoToTextureVertexSource = ` + struct VertexOutput { + @builtin(position) Position : vec4, + @location(0) fragUV : vec2 + } + + @vertex + fn main( + @builtin(vertex_index) VertexIndex : u32 + ) -> VertexOutput { + var pos = array, 4>( + vec2(-1.0, 1.0), + vec2( 1.0, 1.0), + vec2(-1.0, -1.0), + vec2( 1.0, -1.0) + ); + var tex = array, 4>( + vec2(0.0, 0.0), + vec2(1.0, 0.0), + vec2(0.0, 1.0), + vec2(1.0, 1.0) + ); + + var output: VertexOutput; + + output.Position = vec4(pos[VertexIndex], 0.0, 1.0); + output.fragUV = tex[VertexIndex]; + + return output; + } + `; + copyVideoToTextureFragmentSource = ` + @group(0) @binding(0) var videoSampler: sampler; + @group(0) @binding(1) var videoTexture: texture_external; + + @fragment + fn main( + @location(0) fragUV: vec2 + ) -> @location(0) vec4 { + return textureSampleBaseClampToEdge(videoTexture, videoSampler, fragUV); + } + `; + copyVideoToTextureInvertYFragmentSource = ` + @group(0) @binding(0) var videoSampler: sampler; + @group(0) @binding(1) var videoTexture: texture_external; + + @fragment + fn main( + @location(0) fragUV: vec2 + ) -> @location(0) vec4 { + return textureSampleBaseClampToEdge(videoTexture, videoSampler, vec2(fragUV.x, 1.0 - fragUV.y)); + } + `; + (function(PipelineType2) { + PipelineType2[PipelineType2["MipMap"] = 0] = "MipMap"; + PipelineType2[PipelineType2["InvertYPremultiplyAlpha"] = 1] = "InvertYPremultiplyAlpha"; + PipelineType2[PipelineType2["Clear"] = 2] = "Clear"; + PipelineType2[PipelineType2["InvertYPremultiplyAlphaWithOfst"] = 3] = "InvertYPremultiplyAlphaWithOfst"; + })(PipelineType || (PipelineType = {})); + (function(VideoPipelineType2) { + VideoPipelineType2[VideoPipelineType2["DontInvertY"] = 0] = "DontInvertY"; + VideoPipelineType2[VideoPipelineType2["InvertY"] = 1] = "InvertY"; + })(VideoPipelineType || (VideoPipelineType = {})); + shadersForPipelineType = [ + { vertex: mipmapVertexSource, fragment: mipmapFragmentSource }, + { vertex: invertYPreMultiplyAlphaVertexSource, fragment: invertYPreMultiplyAlphaFragmentSource }, + { vertex: clearVertexSource, fragment: clearFragmentSource }, + { vertex: invertYPreMultiplyAlphaWithOfstVertexSource, fragment: invertYPreMultiplyAlphaWithOfstFragmentSource } + ]; + renderableTextureFormatToIndex = { + "": 0, + r8unorm: 1, + r8uint: 2, + r8sint: 3, + r16uint: 4, + r16sint: 5, + r16float: 6, + rg8unorm: 7, + rg8uint: 8, + rg8sint: 9, + r32uint: 10, + r32sint: 11, + r32float: 12, + rg16uint: 13, + rg16sint: 14, + rg16float: 15, + rgba8unorm: 16, + "rgba8unorm-srgb": 17, + rgba8uint: 18, + rgba8sint: 19, + bgra8unorm: 20, + "bgra8unorm-srgb": 21, + rgb10a2uint: 22, + rgb10a2unorm: 23, + rg32uint: 24, + rg32sint: 25, + rg32float: 26, + rgba16uint: 27, + rgba16sint: 28, + rgba16float: 29, + rgba32uint: 30, + rgba32sint: 31, + rgba32float: 32, + stencil8: 33, + depth16unorm: 34, + depth24plus: 35, + "depth24plus-stencil8": 36, + depth32float: 37, + "depth32float-stencil8": 38 + }; +}); // node_modules/@babylonjs/core/Meshes/WebGPU/webgpuDataBuffer.js class WebGPUDataBuffer extends DataBuffer { @@ -92549,6 +98720,9 @@ class WebGPUDataBuffer extends DataBuffer { return this._buffer; } } +var init_webgpuDataBuffer = __esm(() => { + init_dataBuffer(); +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuBufferManager.js class WebGPUBufferManager { @@ -92718,50 +98892,14 @@ class WebGPUBufferManager { this._deferredReleaseBuffers.length = 0; } } +var init_webgpuBufferManager = __esm(() => { + init_webgpuDataBuffer(); + init_textureTools(); + init_engine_readTexture(); + init_webgpuConstants(); +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuCacheSampler.js -var filterToBits = [ - 0 | 0 << 1 | 0 << 2, - 0 | 0 << 1 | 0 << 2, - 1 | 1 << 1 | 0 << 2, - 1 | 1 << 1 | 1 << 2, - 0 | 0 << 1 | 0 << 2, - 0 | 1 << 1 | 0 << 2, - 0 | 1 << 1 | 1 << 2, - 0 | 1 << 1 | 0 << 2, - 0 | 0 << 1 | 1 << 2, - 1 | 0 << 1 | 0 << 2, - 1 | 0 << 1 | 1 << 2, - 1 | 1 << 1 | 0 << 2, - 1 | 0 << 1 | 0 << 2 -]; -var comparisonFunctionToBits = [ - 0 << 3 | 0 << 4 | 0 << 5 | 0 << 6, - 0 << 3 | 0 << 4 | 0 << 5 | 1 << 6, - 0 << 3 | 0 << 4 | 1 << 5 | 0 << 6, - 0 << 3 | 0 << 4 | 1 << 5 | 1 << 6, - 0 << 3 | 1 << 4 | 0 << 5 | 0 << 6, - 0 << 3 | 1 << 4 | 0 << 5 | 1 << 6, - 0 << 3 | 1 << 4 | 1 << 5 | 0 << 6, - 0 << 3 | 1 << 4 | 1 << 5 | 1 << 6, - 1 << 3 | 0 << 4 | 0 << 5 | 0 << 6 -]; -var filterNoMipToBits = [ - 0 << 7, - 1 << 7, - 1 << 7, - 0 << 7, - 0 << 7, - 0 << 7, - 0 << 7, - 1 << 7, - 0 << 7, - 0 << 7, - 0 << 7, - 0 << 7, - 1 << 7 -]; - class WebGPUCacheSampler { constructor(device) { this._samplers = {}; @@ -92964,69 +99102,53 @@ class WebGPUCacheSampler { return gpuSampler; } } +var filterToBits, comparisonFunctionToBits, filterNoMipToBits; +var init_webgpuCacheSampler = __esm(() => { + init_webgpuConstants(); + filterToBits = [ + 0 | 0 << 1 | 0 << 2, + 0 | 0 << 1 | 0 << 2, + 1 | 1 << 1 | 0 << 2, + 1 | 1 << 1 | 1 << 2, + 0 | 0 << 1 | 0 << 2, + 0 | 1 << 1 | 0 << 2, + 0 | 1 << 1 | 1 << 2, + 0 | 1 << 1 | 0 << 2, + 0 | 0 << 1 | 1 << 2, + 1 | 0 << 1 | 0 << 2, + 1 | 0 << 1 | 1 << 2, + 1 | 1 << 1 | 0 << 2, + 1 | 0 << 1 | 0 << 2 + ]; + comparisonFunctionToBits = [ + 0 << 3 | 0 << 4 | 0 << 5 | 0 << 6, + 0 << 3 | 0 << 4 | 0 << 5 | 1 << 6, + 0 << 3 | 0 << 4 | 1 << 5 | 0 << 6, + 0 << 3 | 0 << 4 | 1 << 5 | 1 << 6, + 0 << 3 | 1 << 4 | 0 << 5 | 0 << 6, + 0 << 3 | 1 << 4 | 0 << 5 | 1 << 6, + 0 << 3 | 1 << 4 | 1 << 5 | 0 << 6, + 0 << 3 | 1 << 4 | 1 << 5 | 1 << 6, + 1 << 3 | 0 << 4 | 0 << 5 | 0 << 6 + ]; + filterNoMipToBits = [ + 0 << 7, + 1 << 7, + 1 << 7, + 0 << 7, + 0 << 7, + 0 << 7, + 0 << 7, + 1 << 7, + 0 << 7, + 0 << 7, + 0 << 7, + 0 << 7, + 1 << 7 + ]; +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuCacheRenderPipeline.js -var StatePosition; -(function(StatePosition2) { - StatePosition2[StatePosition2["StencilReadMask"] = 0] = "StencilReadMask"; - StatePosition2[StatePosition2["StencilWriteMask"] = 1] = "StencilWriteMask"; - StatePosition2[StatePosition2["DepthBias"] = 2] = "DepthBias"; - StatePosition2[StatePosition2["DepthBiasSlopeScale"] = 3] = "DepthBiasSlopeScale"; - StatePosition2[StatePosition2["DepthStencilState"] = 4] = "DepthStencilState"; - StatePosition2[StatePosition2["MRTAttachments1"] = 5] = "MRTAttachments1"; - StatePosition2[StatePosition2["MRTAttachments2"] = 6] = "MRTAttachments2"; - StatePosition2[StatePosition2["RasterizationState"] = 7] = "RasterizationState"; - StatePosition2[StatePosition2["ColorStates"] = 8] = "ColorStates"; - StatePosition2[StatePosition2["ShaderStage"] = 9] = "ShaderStage"; - StatePosition2[StatePosition2["TextureStage"] = 10] = "TextureStage"; - StatePosition2[StatePosition2["VertexState"] = 11] = "VertexState"; - StatePosition2[StatePosition2["NumStates"] = 12] = "NumStates"; -})(StatePosition || (StatePosition = {})); -var alphaBlendFactorToIndex = { - 0: 1, - 1: 2, - 768: 3, - 769: 4, - 770: 5, - 771: 6, - 772: 7, - 773: 8, - 774: 9, - 775: 10, - 776: 11, - 32769: 12, - 32770: 13, - 32771: 12, - 32772: 13 -}; -var stencilOpToIndex = { - 0: 0, - 7680: 1, - 7681: 2, - 7682: 3, - 7683: 4, - 5386: 5, - 34055: 6, - 34056: 7 -}; -var vertexBufferKindForNonFloatProcessing = { - [VertexBuffer.PositionKind]: true, - [VertexBuffer.NormalKind]: true, - [VertexBuffer.TangentKind]: true, - [VertexBuffer.UVKind]: true, - [VertexBuffer.UV2Kind]: true, - [VertexBuffer.UV3Kind]: true, - [VertexBuffer.UV4Kind]: true, - [VertexBuffer.UV5Kind]: true, - [VertexBuffer.UV6Kind]: true, - [VertexBuffer.ColorKind]: true, - [VertexBuffer.ColorInstanceKind]: true, - [VertexBuffer.MatricesIndicesKind]: true, - [VertexBuffer.MatricesWeightsKind]: true, - [VertexBuffer.MatricesIndicesExtraKind]: true, - [VertexBuffer.MatricesWeightsExtraKind]: true -}; - class WebGPUCacheRenderPipeline { static _IsSignedType(type) { switch (type) { @@ -93622,9 +99744,9 @@ class WebGPUCacheRenderPipeline { for (let j = 0;j < setDefinition.length; j++) { const entry = bindGroupLayoutEntries[i][j]; if (entry.texture) { - const name92 = shaderProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].name; - const textureInfo = shaderProcessingContext.availableTextures[name92]; - const samplerInfo = textureInfo.autoBindSampler ? shaderProcessingContext.availableSamplers[name92 + WebGPUShaderProcessor.AutoSamplerSuffix] : null; + const name93 = shaderProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].name; + const textureInfo = shaderProcessingContext.availableTextures[name93]; + const samplerInfo = textureInfo.autoBindSampler ? shaderProcessingContext.availableSamplers[name93 + WebGPUShaderProcessor.AutoSamplerSuffix] : null; let sampleType = textureInfo.sampleType; let samplerType = (_a = samplerInfo === null || samplerInfo === undefined ? undefined : samplerInfo.type) !== null && _a !== undefined ? _a : SamplerBindingType.Filtering; if (this._textureState & bitVal && sampleType !== TextureSampleType.Depth) { @@ -93808,11 +99930,77 @@ class WebGPUCacheRenderPipeline { }); } } -WebGPUCacheRenderPipeline.NumCacheHitWithoutHash = 0; -WebGPUCacheRenderPipeline.NumCacheHitWithHash = 0; -WebGPUCacheRenderPipeline.NumCacheMiss = 0; -WebGPUCacheRenderPipeline.NumPipelineCreationLastFrame = 0; -WebGPUCacheRenderPipeline._NumPipelineCreationCurrentFrame = 0; +var StatePosition, alphaBlendFactorToIndex, stencilOpToIndex, vertexBufferKindForNonFloatProcessing; +var init_webgpuCacheRenderPipeline = __esm(() => { + init_webgpuConstants(); + init_buffer(); + init_webgpuShaderProcessor(); + init_webgpuTextureHelper(); + (function(StatePosition2) { + StatePosition2[StatePosition2["StencilReadMask"] = 0] = "StencilReadMask"; + StatePosition2[StatePosition2["StencilWriteMask"] = 1] = "StencilWriteMask"; + StatePosition2[StatePosition2["DepthBias"] = 2] = "DepthBias"; + StatePosition2[StatePosition2["DepthBiasSlopeScale"] = 3] = "DepthBiasSlopeScale"; + StatePosition2[StatePosition2["DepthStencilState"] = 4] = "DepthStencilState"; + StatePosition2[StatePosition2["MRTAttachments1"] = 5] = "MRTAttachments1"; + StatePosition2[StatePosition2["MRTAttachments2"] = 6] = "MRTAttachments2"; + StatePosition2[StatePosition2["RasterizationState"] = 7] = "RasterizationState"; + StatePosition2[StatePosition2["ColorStates"] = 8] = "ColorStates"; + StatePosition2[StatePosition2["ShaderStage"] = 9] = "ShaderStage"; + StatePosition2[StatePosition2["TextureStage"] = 10] = "TextureStage"; + StatePosition2[StatePosition2["VertexState"] = 11] = "VertexState"; + StatePosition2[StatePosition2["NumStates"] = 12] = "NumStates"; + })(StatePosition || (StatePosition = {})); + alphaBlendFactorToIndex = { + 0: 1, + 1: 2, + 768: 3, + 769: 4, + 770: 5, + 771: 6, + 772: 7, + 773: 8, + 774: 9, + 775: 10, + 776: 11, + 32769: 12, + 32770: 13, + 32771: 12, + 32772: 13 + }; + stencilOpToIndex = { + 0: 0, + 7680: 1, + 7681: 2, + 7682: 3, + 7683: 4, + 5386: 5, + 34055: 6, + 34056: 7 + }; + vertexBufferKindForNonFloatProcessing = { + [VertexBuffer.PositionKind]: true, + [VertexBuffer.NormalKind]: true, + [VertexBuffer.TangentKind]: true, + [VertexBuffer.UVKind]: true, + [VertexBuffer.UV2Kind]: true, + [VertexBuffer.UV3Kind]: true, + [VertexBuffer.UV4Kind]: true, + [VertexBuffer.UV5Kind]: true, + [VertexBuffer.UV6Kind]: true, + [VertexBuffer.ColorKind]: true, + [VertexBuffer.ColorInstanceKind]: true, + [VertexBuffer.MatricesIndicesKind]: true, + [VertexBuffer.MatricesWeightsKind]: true, + [VertexBuffer.MatricesIndicesExtraKind]: true, + [VertexBuffer.MatricesWeightsExtraKind]: true + }; + WebGPUCacheRenderPipeline.NumCacheHitWithoutHash = 0; + WebGPUCacheRenderPipeline.NumCacheHitWithHash = 0; + WebGPUCacheRenderPipeline.NumCacheMiss = 0; + WebGPUCacheRenderPipeline.NumPipelineCreationLastFrame = 0; + WebGPUCacheRenderPipeline._NumPipelineCreationCurrentFrame = 0; +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuCacheRenderPipelineTree.js class NodeState { @@ -93877,7 +100065,10 @@ class WebGPUCacheRenderPipelineTree extends WebGPUCacheRenderPipeline { param.token.pipeline = param.pipeline; } } -WebGPUCacheRenderPipelineTree._Cache = new NodeState; +var init_webgpuCacheRenderPipelineTree = __esm(() => { + init_webgpuCacheRenderPipeline(); + WebGPUCacheRenderPipelineTree._Cache = new NodeState; +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuStencilStateComposer.js class WebGPUStencilStateComposer extends StencilStateComposer { @@ -93976,6 +100167,9 @@ class WebGPUStencilStateComposer extends StencilStateComposer { this.mask = stencilMaterialEnabled ? this.stencilMaterial.mask : this.stencilGlobal.mask; } } +var init_webgpuStencilStateComposer = __esm(() => { + init_stencilStateComposer(); +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuDepthCullingState.js class WebGPUDepthCullingState extends DepthCullingState { @@ -94079,6 +100273,9 @@ class WebGPUDepthCullingState extends DepthCullingState { apply() { } } +var init_webgpuDepthCullingState = __esm(() => { + init_depthCullingState(); +}); // node_modules/@babylonjs/core/Materials/Textures/externalTexture.js class ExternalTexture { @@ -94104,6 +100301,9 @@ class ExternalTexture { dispose() { } } +var init_externalTexture = __esm(() => { + init_internalTexture(); +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuMaterialContext.js class WebGPUMaterialContext { @@ -94126,11 +100326,11 @@ class WebGPUMaterialContext { this._numFloatOrDepthTextures = 0; this._numExternalTextures = 0; } - setSampler(name92, sampler) { - let samplerCache = this.samplers[name92]; + setSampler(name93, sampler) { + let samplerCache = this.samplers[name93]; let currentHashCode = -1; if (!samplerCache) { - this.samplers[name92] = samplerCache = { sampler, hashCode: 0 }; + this.samplers[name93] = samplerCache = { sampler, hashCode: 0 }; } else { currentHashCode = samplerCache.hashCode; } @@ -94142,12 +100342,12 @@ class WebGPUMaterialContext { } this.isDirty || (this.isDirty = isDirty); } - setTexture(name92, texture16) { + setTexture(name93, texture16) { var _a, _b, _c; - let textureCache = this.textures[name92]; + let textureCache = this.textures[name93]; let currentTextureId = -1; if (!textureCache) { - this.textures[name92] = textureCache = { texture: texture16, isFloatOrDepthTexture: false, isExternalTexture: false }; + this.textures[name93] = textureCache = { texture: texture16, isFloatOrDepthTexture: false, isExternalTexture: false }; } else { currentTextureId = (_b = (_a = textureCache.texture) === null || _a === undefined ? undefined : _a.uniqueId) !== null && _b !== undefined ? _b : -1; } @@ -94178,7 +100378,11 @@ class WebGPUMaterialContext { this.isDirty || (this.isDirty = isDirty); } } -WebGPUMaterialContext._Counter = 0; +var init_webgpuMaterialContext = __esm(() => { + init_externalTexture(); + init_webgpuCacheSampler(); + WebGPUMaterialContext._Counter = 0; +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuDrawContext.js class WebGPUDrawContext { @@ -94225,10 +100429,10 @@ class WebGPUDrawContext { this.fastBundle = undefined; this.bindGroups = undefined; } - setBuffer(name92, buffer29) { + setBuffer(name93, buffer29) { var _a; - this._isDirty || (this._isDirty = (buffer29 === null || buffer29 === undefined ? undefined : buffer29.uniqueId) !== ((_a = this.buffers[name92]) === null || _a === undefined ? undefined : _a.uniqueId)); - this.buffers[name92] = buffer29; + this._isDirty || (this._isDirty = (buffer29 === null || buffer29 === undefined ? undefined : buffer29.uniqueId) !== ((_a = this.buffers[name93]) === null || _a === undefined ? undefined : _a.uniqueId)); + this.buffers[name93] = buffer29; } setIndirectData(indexOrVertexCount, instanceCount, firstIndexOrVertex) { if (instanceCount === this._currentInstanceCount || !this.indirectDrawBuffer || !this._indirectDrawData) { @@ -94251,7 +100455,10 @@ class WebGPUDrawContext { this.buffers = undefined; } } -WebGPUDrawContext._Counter = 0; +var init_webgpuDrawContext = __esm(() => { + init_webgpuConstants(); + WebGPUDrawContext._Counter = 0; +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuCacheBindGroups.js class WebGPUBindGroupCacheNode { @@ -94343,23 +100550,23 @@ class WebGPUCacheBindGroups { for (let j = 0;j < setDefinition.length; j++) { const entry = webgpuPipelineContext.shaderProcessingContext.bindGroupLayoutEntries[i][j]; const entryInfo = webgpuPipelineContext.shaderProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding]; - const name92 = (_h = entryInfo.nameInArrayOfTexture) !== null && _h !== undefined ? _h : entryInfo.name; + const name93 = (_h = entryInfo.nameInArrayOfTexture) !== null && _h !== undefined ? _h : entryInfo.name; if (entry.sampler) { - const bindingInfo = materialContext.samplers[name92]; + const bindingInfo = materialContext.samplers[name93]; if (bindingInfo) { const sampler = bindingInfo.sampler; if (!sampler) { if (this._engine.dbgSanityChecks) { - Logger.Error(`Trying to bind a null sampler! entry=${JSON.stringify(entry)}, name=${name92}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => key === "texture" ? "" : value)}, materialContext.uniqueId=${materialContext.uniqueId}`, 50); + Logger.Error(`Trying to bind a null sampler! entry=${JSON.stringify(entry)}, name=${name93}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => key === "texture" ? "" : value)}, materialContext.uniqueId=${materialContext.uniqueId}`, 50); } continue; } entries[j].resource = this._cacheSampler.getSampler(sampler, false, bindingInfo.hashCode, sampler.label); } else { - Logger.Error(`Sampler "${name92}" could not be bound. entry=${JSON.stringify(entry)}, materialContext=${JSON.stringify(materialContext, (key, value) => key === "texture" || key === "sampler" ? "" : value)}`, 50); + Logger.Error(`Sampler "${name93}" could not be bound. entry=${JSON.stringify(entry)}, materialContext=${JSON.stringify(materialContext, (key, value) => key === "texture" || key === "sampler" ? "" : value)}`, 50); } } else if (entry.texture || entry.storageTexture) { - const bindingInfo = materialContext.textures[name92]; + const bindingInfo = materialContext.textures[name93]; if (bindingInfo) { if (this._engine.dbgSanityChecks && bindingInfo.texture === null) { Logger.Error(`Trying to bind a null texture! entry=${JSON.stringify(entry)}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => key === "texture" ? "" : value)}, materialContext.uniqueId=${materialContext.uniqueId}`, 50); @@ -94367,37 +100574,37 @@ class WebGPUCacheBindGroups { } const hardwareTexture = bindingInfo.texture._hardwareTexture; if (this._engine.dbgSanityChecks && (!hardwareTexture || entry.texture && !hardwareTexture.view || entry.storageTexture && !hardwareTexture.viewForWriting)) { - Logger.Error(`Trying to bind a null gpu texture or view! entry=${JSON.stringify(entry)}, name=${name92}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => key === "texture" ? "" : value)}, isReady=${(_j = bindingInfo.texture) === null || _j === undefined ? undefined : _j.isReady}, materialContext.uniqueId=${materialContext.uniqueId}`, 50); + Logger.Error(`Trying to bind a null gpu texture or view! entry=${JSON.stringify(entry)}, name=${name93}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => key === "texture" ? "" : value)}, isReady=${(_j = bindingInfo.texture) === null || _j === undefined ? undefined : _j.isReady}, materialContext.uniqueId=${materialContext.uniqueId}`, 50); continue; } entries[j].resource = entry.storageTexture ? hardwareTexture.viewForWriting : hardwareTexture.view; } else { - Logger.Error(`Texture "${name92}" could not be bound. entry=${JSON.stringify(entry)}, materialContext=${JSON.stringify(materialContext, (key, value) => key === "texture" || key === "sampler" ? "" : value)}`, 50); + Logger.Error(`Texture "${name93}" could not be bound. entry=${JSON.stringify(entry)}, materialContext=${JSON.stringify(materialContext, (key, value) => key === "texture" || key === "sampler" ? "" : value)}`, 50); } } else if (entry.externalTexture) { - const bindingInfo = materialContext.textures[name92]; + const bindingInfo = materialContext.textures[name93]; if (bindingInfo) { if (this._engine.dbgSanityChecks && bindingInfo.texture === null) { - Logger.Error(`Trying to bind a null external texture! entry=${JSON.stringify(entry)}, name=${name92}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => key === "texture" ? "" : value)}, materialContext.uniqueId=${materialContext.uniqueId}`, 50); + Logger.Error(`Trying to bind a null external texture! entry=${JSON.stringify(entry)}, name=${name93}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => key === "texture" ? "" : value)}, materialContext.uniqueId=${materialContext.uniqueId}`, 50); continue; } const externalTexture2 = bindingInfo.texture.underlyingResource; if (this._engine.dbgSanityChecks && !externalTexture2) { - Logger.Error(`Trying to bind a null gpu external texture! entry=${JSON.stringify(entry)}, name=${name92}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => key === "texture" ? "" : value)}, isReady=${(_k = bindingInfo.texture) === null || _k === undefined ? undefined : _k.isReady}, materialContext.uniqueId=${materialContext.uniqueId}`, 50); + Logger.Error(`Trying to bind a null gpu external texture! entry=${JSON.stringify(entry)}, name=${name93}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => key === "texture" ? "" : value)}, isReady=${(_k = bindingInfo.texture) === null || _k === undefined ? undefined : _k.isReady}, materialContext.uniqueId=${materialContext.uniqueId}`, 50); continue; } entries[j].resource = this._device.importExternalTexture({ source: externalTexture2 }); } else { - Logger.Error(`Texture "${name92}" could not be bound. entry=${JSON.stringify(entry)}, materialContext=${JSON.stringify(materialContext, (key, value) => key === "texture" || key === "sampler" ? "" : value)}`, 50); + Logger.Error(`Texture "${name93}" could not be bound. entry=${JSON.stringify(entry)}, materialContext=${JSON.stringify(materialContext, (key, value) => key === "texture" || key === "sampler" ? "" : value)}`, 50); } } else if (entry.buffer) { - const dataBuffer7 = drawContext.buffers[name92]; + const dataBuffer7 = drawContext.buffers[name93]; if (dataBuffer7) { const webgpuBuffer = dataBuffer7.underlyingResource; entries[j].resource.buffer = webgpuBuffer; entries[j].resource.size = dataBuffer7.capacity; } else { - Logger.Error(`Can't find buffer "${name92}". entry=${JSON.stringify(entry)}, buffers=${JSON.stringify(drawContext.buffers)}, drawContext.uniqueId=${drawContext.uniqueId}`, 50); + Logger.Error(`Can't find buffer "${name93}". entry=${JSON.stringify(entry)}, buffers=${JSON.stringify(drawContext.buffers)}, drawContext.uniqueId=${drawContext.uniqueId}`, 50); } } } @@ -94410,18 +100617,24 @@ class WebGPUCacheBindGroups { return bindGroups; } } -WebGPUCacheBindGroups.NumBindGroupsCreatedTotal = 0; -WebGPUCacheBindGroups.NumBindGroupsCreatedLastFrame = 0; -WebGPUCacheBindGroups.NumBindGroupsLookupLastFrame = 0; -WebGPUCacheBindGroups.NumBindGroupsNoLookupLastFrame = 0; -WebGPUCacheBindGroups._Cache = new WebGPUBindGroupCacheNode; -WebGPUCacheBindGroups._NumBindGroupsCreatedCurrentFrame = 0; -WebGPUCacheBindGroups._NumBindGroupsLookupCurrentFrame = 0; -WebGPUCacheBindGroups._NumBindGroupsNoLookupCurrentFrame = 0; +var init_webgpuCacheBindGroups = __esm(() => { + init_logger(); + WebGPUCacheBindGroups.NumBindGroupsCreatedTotal = 0; + WebGPUCacheBindGroups.NumBindGroupsCreatedLastFrame = 0; + WebGPUCacheBindGroups.NumBindGroupsLookupLastFrame = 0; + WebGPUCacheBindGroups.NumBindGroupsNoLookupLastFrame = 0; + WebGPUCacheBindGroups._Cache = new WebGPUBindGroupCacheNode; + WebGPUCacheBindGroups._NumBindGroupsCreatedCurrentFrame = 0; + WebGPUCacheBindGroups._NumBindGroupsLookupCurrentFrame = 0; + WebGPUCacheBindGroups._NumBindGroupsNoLookupCurrentFrame = 0; +}); // node_modules/@babylonjs/core/Shaders/clearQuad.vertex.js -var name92 = "clearQuadVertexShader"; -var shader92 = `uniform float depthValue;const vec2 pos[4]={vec2(-1.0,1.0), +var name93, shader92; +var init_clearQuad_vertex = __esm(() => { + init_shaderStore(); + name93 = "clearQuadVertexShader"; + shader92 = `uniform float depthValue;const vec2 pos[4]={vec2(-1.0,1.0), vec2(1.0,1.0), vec2(-1.0,-1.0), vec2(1.0,-1.0)}; @@ -94432,13 +100645,18 @@ gl_Position=vec4(pos[gl_VertexID],depthValue,1.0); #define CUSTOM_VERTEX_MAIN_END } `; -ShaderStore.ShadersStore[name92] = shader92; + ShaderStore.ShadersStore[name93] = shader92; +}); // node_modules/@babylonjs/core/Shaders/clearQuad.fragment.js -var name93 = "clearQuadPixelShader"; -var shader93 = `uniform vec4 color;void main() {gl_FragColor=color;} +var name94, shader93; +var init_clearQuad_fragment = __esm(() => { + init_shaderStore(); + name94 = "clearQuadPixelShader"; + shader93 = `uniform vec4 color;void main() {gl_FragColor=color;} `; -ShaderStore.ShadersStore[name93] = shader93; + ShaderStore.ShadersStore[name94] = shader93; +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuClearQuad.js class WebGPUClearQuad { @@ -94553,6 +100771,13 @@ class WebGPUClearQuad { return bundle; } } +var init_webgpuClearQuad = __esm(() => { + init_webgpuCacheRenderPipelineTree(); + init_webgpuShaderProcessingContext(); + init_webgpuTextureHelper(); + init_clearQuad_vertex(); + init_clearQuad_fragment(); +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuBundleList.js class WebGPURenderItemViewport { @@ -94713,6 +100938,9 @@ class WebGPUBundleList { return cloned; } } +var init_webgpuBundleList = __esm(() => { + init_webgpuTextureHelper(); +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuQuerySet.js class WebGPUQuerySet { @@ -94795,6 +101023,9 @@ class WebGPUQuerySet { } } } +var init_webgpuQuerySet = __esm(() => { + init_webgpuConstants(); +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuTimestampQuery.js class WebGPUTimestampQuery { @@ -94858,6 +101089,11 @@ class WebGPUDurationMeasure { this._querySet.dispose(); } } +var init_webgpuTimestampQuery = __esm(() => { + init_webgpuConstants(); + init_perfCounter(); + init_webgpuQuerySet(); +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuOcclusionQuery.js class WebGPUOcclusionQuery { @@ -94941,6 +101177,10 @@ class WebGPUOcclusionQuery { this._availableIndices.length = 0; } } +var init_webgpuOcclusionQuery = __esm(() => { + init_webgpuConstants(); + init_webgpuQuerySet(); +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuTintWASM.js class WebGPUTintWASM { @@ -94972,13 +101212,16 @@ class WebGPUTintWASM { return WebGPUTintWASM.DisableUniformityAnalysis || disableUniformityAnalysis ? "diagnostic(off, derivative_uniformity);\n" + ccode : ccode; } } -WebGPUTintWASM._TWgslDefaultOptions = { - jsPath: `${Tools._DefaultCdnUrl}/twgsl/twgsl.js`, - wasmPath: `${Tools._DefaultCdnUrl}/twgsl/twgsl.wasm` -}; -WebGPUTintWASM.ShowWGSLShaderCode = false; -WebGPUTintWASM.DisableUniformityAnalysis = false; -WebGPUTintWASM._twgsl = null; +var init_webgpuTintWASM = __esm(() => { + init_tools(); + WebGPUTintWASM._TWgslDefaultOptions = { + jsPath: `${Tools._DefaultCdnUrl}/twgsl/twgsl.js`, + wasmPath: `${Tools._DefaultCdnUrl}/twgsl/twgsl.wasm` + }; + WebGPUTintWASM.ShowWGSLShaderCode = false; + WebGPUTintWASM.DisableUniformityAnalysis = false; + WebGPUTintWASM._twgsl = null; +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuSnapshotRendering.js class WebGPUSnapshotRendering { @@ -95054,10 +101297,15 @@ class WebGPUSnapshotRendering { this.enabled = true; } } +var init_webgpuSnapshotRendering = __esm(() => { +}); // node_modules/@babylonjs/core/ShadersWGSL/postprocess.vertex.js -var name94 = "postprocessVertexShader"; -var shader94 = `attribute position: vec2;uniform scale: vec2;varying vUV: vec2;const madd=vec2(0.5,0.5); +var name95, shader94; +var init_postprocess_vertex2 = __esm(() => { + init_shaderStore(); + name95 = "postprocessVertexShader"; + shader94 = `attribute position: vec2;uniform scale: vec2;varying vUV: vec2;const madd=vec2(0.5,0.5); #define CUSTOM_VERTEX_DEFINITIONS @vertex fn main(input : VertexInputs)->FragmentInputs { @@ -95066,26 +101314,10 @@ vertexOutputs.vUV=(vertexInputs.position*madd+madd)*uniforms.scale;vertexOutputs #define CUSTOM_VERTEX_MAIN_END } `; -ShaderStore.ShadersStoreWGSL[name94] = shader94; + ShaderStore.ShadersStoreWGSL[name95] = shader94; +}); // node_modules/@babylonjs/core/Engines/webgpuEngine.js -var viewDescriptorSwapChainAntialiasing = { - label: `TextureView_SwapChain_ResolveTarget`, - dimension: TextureDimension.E2d, - format: undefined, - mipLevelCount: 1, - arrayLayerCount: 1 -}; -var viewDescriptorSwapChain = { - label: `TextureView_SwapChain`, - dimension: TextureDimension.E2d, - format: undefined, - mipLevelCount: 1, - arrayLayerCount: 1 -}; -var disableUniformityAnalysisMarker = "/* disable_uniformity_analysis */"; -var tempColor4 = new Color4; - class WebGPUEngine extends Engine2 { get snapshotRenderingMode() { return this._snapshotRendering.mode; @@ -95304,8 +101536,8 @@ class WebGPUEngine extends Engine2 { } if (this._options.setMaximumLimits && !deviceDescriptor.requiredLimits) { deviceDescriptor.requiredLimits = {}; - for (const name95 in this._adapterSupportedLimits) { - deviceDescriptor.requiredLimits[name95] = this._adapterSupportedLimits[name95]; + for (const name96 in this._adapterSupportedLimits) { + deviceDescriptor.requiredLimits[name96] = this._adapterSupportedLimits[name96]; } } return this._adapter.requestDevice(deviceDescriptor); @@ -95927,16 +102159,16 @@ class WebGPUEngine extends Engine2 { if (globalDefines) { fullDefines += "\n" + globalDefines; } - const name95 = vertex + "+" + fragment + "@" + fullDefines; - if (this._compiledEffects[name95]) { - const compiledEffect = this._compiledEffects[name95]; + const name96 = vertex + "+" + fragment + "@" + fullDefines; + if (this._compiledEffects[name96]) { + const compiledEffect = this._compiledEffects[name96]; if (onCompiled && compiledEffect.isReady()) { onCompiled(compiledEffect); } return compiledEffect; } - const effect7 = new Effect(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, this, defines, fallbacks, onCompiled, onError, indexParameters, name95, shaderLanguage14); - this._compiledEffects[name95] = effect7; + const effect7 = new Effect(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, this, defines, fallbacks, onCompiled, onError, indexParameters, name96, shaderLanguage14); + this._compiledEffects[name96] = effect7; return effect7; } _compileRawShaderToSpirV(source, type) { @@ -96095,8 +102327,8 @@ class WebGPUEngine extends Engine2 { } } releaseEffects() { - for (const name95 in this._compiledEffects) { - const webGPUPipelineContext = this._compiledEffects[name95].getPipelineContext(); + for (const name96 in this._compiledEffects) { + const webGPUPipelineContext = this._compiledEffects[name96].getPipelineContext(); this._deletePipelineContext(webGPUPipelineContext); } this._compiledEffects = {}; @@ -96262,31 +102494,31 @@ class WebGPUEngine extends Engine2 { texture16._hardwareTexture.release(); this._textureHelper.createGPUTextureForInternalTexture(texture16, width, height, depth, additionalUsages); } - _setInternalTexture(name95, texture16, baseName) { - baseName = baseName !== null && baseName !== undefined ? baseName : name95; + _setInternalTexture(name96, texture16, baseName) { + baseName = baseName !== null && baseName !== undefined ? baseName : name96; if (this._currentEffect) { const webgpuPipelineContext2 = this._currentEffect._pipelineContext; const availableTexture = webgpuPipelineContext2.shaderProcessingContext.availableTextures[baseName]; - this._currentMaterialContext.setTexture(name95, texture16); + this._currentMaterialContext.setTexture(name96, texture16); if (availableTexture && availableTexture.autoBindSampler) { const samplerName = baseName + WebGPUShaderProcessor.AutoSamplerSuffix; this._currentMaterialContext.setSampler(samplerName, texture16); } } } - setTexture(channel, unused, texture16, name95) { - this._setTexture(channel, texture16, false, false, name95, name95); + setTexture(channel, unused, texture16, name96) { + this._setTexture(channel, texture16, false, false, name96, name96); } - setTextureArray(channel, unused, textures, name95) { + setTextureArray(channel, unused, textures, name96) { for (let index = 0;index < textures.length; index++) { - this._setTexture(-1, textures[index], true, false, name95 + index.toString(), name95); + this._setTexture(-1, textures[index], true, false, name96 + index.toString(), name96); } } - _setTexture(channel, texture16, isPartOfTextureArray = false, depthStencilTexture = false, name95 = "", baseName) { - baseName = baseName !== null && baseName !== undefined ? baseName : name95; + _setTexture(channel, texture16, isPartOfTextureArray = false, depthStencilTexture = false, name96 = "", baseName) { + baseName = baseName !== null && baseName !== undefined ? baseName : name96; if (this._currentEffect) { if (!texture16) { - this._currentMaterialContext.setTexture(name95, null); + this._currentMaterialContext.setTexture(name96, null); return false; } if (texture16.video) { @@ -96323,7 +102555,7 @@ class WebGPUEngine extends Engine2 { } this._setAnisotropicLevel(0, internalTexture18, texture16.anisotropicFilteringLevel); } - this._setInternalTexture(name95, internalTexture18, baseName); + this._setInternalTexture(name96, internalTexture18, baseName); } else { if (this.dbgVerboseLogsForFirstFrames) { if (this._count === undefined) { @@ -96341,11 +102573,11 @@ class WebGPUEngine extends Engine2 { internalTexture18._cachedAnisotropicFilteringLevel = Math.min(anisotropicFilteringLevel, this._caps.maxAnisotropy); } } - _bindTexture(channel, texture16, name95) { + _bindTexture(channel, texture16, name96) { if (channel === undefined) { return; } - this._setInternalTexture(name95, texture16); + this._setInternalTexture(name96, texture16); } generateMipmaps(texture16) { this._generateMipmaps(texture16); @@ -96460,8 +102692,8 @@ class WebGPUEngine extends Engine2 { } if (!this._count || this._count < this.dbgVerboseLogsNumFrames) { const list = []; - for (const name95 in UniformBuffer._UpdatedUbosInFrame) { - list.push(name95 + ":" + UniformBuffer._UpdatedUbosInFrame[name95]); + for (const name96 in UniformBuffer._UpdatedUbosInFrame) { + list.push(name96 + ":" + UniformBuffer._UpdatedUbosInFrame[name96]); } console.log("frame #" + this._count + " - updated ubos -", list.join(", ")); } @@ -97031,109 +103263,167 @@ class WebGPUEngine extends Engine2 { return false; } } -WebGPUEngine._GLSLslangDefaultOptions = { - jsPath: `${Tools._DefaultCdnUrl}/glslang/glslang.js`, - wasmPath: `${Tools._DefaultCdnUrl}/glslang/glslang.wasm` -}; -WebGPUEngine.UseTWGSL = true; +var viewDescriptorSwapChainAntialiasing, viewDescriptorSwapChain, disableUniformityAnalysisMarker, tempColor4; +var init_webgpuEngine = __esm(() => { + init_logger(); + init_math(); + init_engine(); + init_internalTexture(); + init_effect(); + init_webgpuConstants(); + init_buffer(); + init_webgpuPipelineContext(); + init_webgpuShaderProcessorsGLSL(); + init_webgpuShaderProcessorsWGSL(); + init_webgpuShaderProcessingContext(); + init_tools(); + init_webgpuTextureHelper(); + init_webgpuBufferManager(); + init_webgpuHardwareTexture(); + init_uniformBuffer(); + init_webgpuCacheSampler(); + init_webgpuCacheRenderPipelineTree(); + init_webgpuStencilStateComposer(); + init_webgpuDepthCullingState(); + init_drawWrapper(); + init_webgpuMaterialContext(); + init_webgpuDrawContext(); + init_webgpuCacheBindGroups(); + init_webgpuClearQuad(); + init_webgpuBundleList(); + init_webgpuTimestampQuery(); + init_webgpuOcclusionQuery(); + init_shaderCodeInliner(); + init_webgpuTintWASM(); + init_webgpuShaderProcessor(); + init_shaderLanguage(); + init_webgpuSnapshotRendering(); + init_buffer_align(); + init_postprocess_vertex2(); + viewDescriptorSwapChainAntialiasing = { + label: `TextureView_SwapChain_ResolveTarget`, + dimension: TextureDimension.E2d, + format: undefined, + mipLevelCount: 1, + arrayLayerCount: 1 + }; + viewDescriptorSwapChain = { + label: `TextureView_SwapChain`, + dimension: TextureDimension.E2d, + format: undefined, + mipLevelCount: 1, + arrayLayerCount: 1 + }; + disableUniformityAnalysisMarker = "/* disable_uniformity_analysis */"; + tempColor4 = new Color4; + WebGPUEngine._GLSLslangDefaultOptions = { + jsPath: `${Tools._DefaultCdnUrl}/glslang/glslang.js`, + wasmPath: `${Tools._DefaultCdnUrl}/glslang/glslang.wasm` + }; + WebGPUEngine.UseTWGSL = true; +}); // node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.alpha.js -WebGPUEngine.prototype.setAlphaMode = function(mode, noDepthWriteChange = false) { - if (this._alphaMode === mode && (mode === 0 && !this._alphaState.alphaBlend || mode !== 0 && this._alphaState.alphaBlend)) { - if (!noDepthWriteChange) { - const depthMask = mode === 0; - if (this.depthCullingState.depthMask !== depthMask) { - this.setDepthWrite(depthMask); - this._cacheRenderPipeline.setDepthWriteEnabled(depthMask); +var init_engine_alpha2 = __esm(() => { + init_engine(); + init_webgpuEngine(); + WebGPUEngine.prototype.setAlphaMode = function(mode, noDepthWriteChange = false) { + if (this._alphaMode === mode && (mode === 0 && !this._alphaState.alphaBlend || mode !== 0 && this._alphaState.alphaBlend)) { + if (!noDepthWriteChange) { + const depthMask = mode === 0; + if (this.depthCullingState.depthMask !== depthMask) { + this.setDepthWrite(depthMask); + this._cacheRenderPipeline.setDepthWriteEnabled(depthMask); + } } + return; } - return; - } - switch (mode) { - case 0: - this._alphaState.alphaBlend = false; - break; - case 7: - this._alphaState.setAlphaBlendFunctionParameters(1, 771, 1, 1); - this._alphaState.alphaBlend = true; - break; - case 8: - this._alphaState.setAlphaBlendFunctionParameters(1, 771, 1, 771); - this._alphaState.alphaBlend = true; - break; - case 2: - this._alphaState.setAlphaBlendFunctionParameters(770, 771, 1, 1); - this._alphaState.alphaBlend = true; - break; - case 6: - this._alphaState.setAlphaBlendFunctionParameters(1, 1, 0, 1); - this._alphaState.alphaBlend = true; - break; - case 1: - this._alphaState.setAlphaBlendFunctionParameters(770, 1, 0, 1); - this._alphaState.alphaBlend = true; - break; - case 3: - this._alphaState.setAlphaBlendFunctionParameters(0, 769, 1, 1); - this._alphaState.alphaBlend = true; - break; - case 4: - this._alphaState.setAlphaBlendFunctionParameters(774, 0, 1, 1); - this._alphaState.alphaBlend = true; - break; - case 5: - this._alphaState.setAlphaBlendFunctionParameters(770, 769, 1, 1); - this._alphaState.alphaBlend = true; - break; - case 9: - this._alphaState.setAlphaBlendFunctionParameters(32769, 32770, 32771, 32772); - this._alphaState.alphaBlend = true; - break; - case 10: - this._alphaState.setAlphaBlendFunctionParameters(1, 769, 1, 771); - this._alphaState.alphaBlend = true; - break; - case 11: - this._alphaState.setAlphaBlendFunctionParameters(1, 1, 1, 1); - this._alphaState.alphaBlend = true; - break; - case 12: - this._alphaState.setAlphaBlendFunctionParameters(772, 1, 0, 0); - this._alphaState.alphaBlend = true; - break; - case 13: - this._alphaState.setAlphaBlendFunctionParameters(775, 769, 773, 771); - this._alphaState.alphaBlend = true; - break; - case 14: - this._alphaState.setAlphaBlendFunctionParameters(1, 771, 1, 771); - this._alphaState.alphaBlend = true; - break; - case 15: - this._alphaState.setAlphaBlendFunctionParameters(1, 1, 1, 0); - this._alphaState.alphaBlend = true; - break; - case 16: - this._alphaState.setAlphaBlendFunctionParameters(775, 769, 0, 1); - this._alphaState.alphaBlend = true; - break; - case 17: - this._alphaState.setAlphaBlendFunctionParameters(770, 771, 1, 771); - this._alphaState.alphaBlend = true; - break; - } - if (!noDepthWriteChange) { - this.setDepthWrite(mode === Engine2.ALPHA_DISABLE); - this._cacheRenderPipeline.setDepthWriteEnabled(mode === Engine2.ALPHA_DISABLE); - } - this._alphaMode = mode; - this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState.alphaBlend); - this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters); -}; -WebGPUEngine.prototype.setAlphaEquation = function(equation) { - Engine2.prototype.setAlphaEquation.call(this, equation); - this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters); -}; + switch (mode) { + case 0: + this._alphaState.alphaBlend = false; + break; + case 7: + this._alphaState.setAlphaBlendFunctionParameters(1, 771, 1, 1); + this._alphaState.alphaBlend = true; + break; + case 8: + this._alphaState.setAlphaBlendFunctionParameters(1, 771, 1, 771); + this._alphaState.alphaBlend = true; + break; + case 2: + this._alphaState.setAlphaBlendFunctionParameters(770, 771, 1, 1); + this._alphaState.alphaBlend = true; + break; + case 6: + this._alphaState.setAlphaBlendFunctionParameters(1, 1, 0, 1); + this._alphaState.alphaBlend = true; + break; + case 1: + this._alphaState.setAlphaBlendFunctionParameters(770, 1, 0, 1); + this._alphaState.alphaBlend = true; + break; + case 3: + this._alphaState.setAlphaBlendFunctionParameters(0, 769, 1, 1); + this._alphaState.alphaBlend = true; + break; + case 4: + this._alphaState.setAlphaBlendFunctionParameters(774, 0, 1, 1); + this._alphaState.alphaBlend = true; + break; + case 5: + this._alphaState.setAlphaBlendFunctionParameters(770, 769, 1, 1); + this._alphaState.alphaBlend = true; + break; + case 9: + this._alphaState.setAlphaBlendFunctionParameters(32769, 32770, 32771, 32772); + this._alphaState.alphaBlend = true; + break; + case 10: + this._alphaState.setAlphaBlendFunctionParameters(1, 769, 1, 771); + this._alphaState.alphaBlend = true; + break; + case 11: + this._alphaState.setAlphaBlendFunctionParameters(1, 1, 1, 1); + this._alphaState.alphaBlend = true; + break; + case 12: + this._alphaState.setAlphaBlendFunctionParameters(772, 1, 0, 0); + this._alphaState.alphaBlend = true; + break; + case 13: + this._alphaState.setAlphaBlendFunctionParameters(775, 769, 773, 771); + this._alphaState.alphaBlend = true; + break; + case 14: + this._alphaState.setAlphaBlendFunctionParameters(1, 771, 1, 771); + this._alphaState.alphaBlend = true; + break; + case 15: + this._alphaState.setAlphaBlendFunctionParameters(1, 1, 1, 0); + this._alphaState.alphaBlend = true; + break; + case 16: + this._alphaState.setAlphaBlendFunctionParameters(775, 769, 0, 1); + this._alphaState.alphaBlend = true; + break; + case 17: + this._alphaState.setAlphaBlendFunctionParameters(770, 771, 1, 771); + this._alphaState.alphaBlend = true; + break; + } + if (!noDepthWriteChange) { + this.setDepthWrite(mode === Engine2.ALPHA_DISABLE); + this._cacheRenderPipeline.setDepthWriteEnabled(mode === Engine2.ALPHA_DISABLE); + } + this._alphaMode = mode; + this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState.alphaBlend); + this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters); + }; + WebGPUEngine.prototype.setAlphaEquation = function(equation) { + Engine2.prototype.setAlphaEquation.call(this, equation); + this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters); + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuComputeContext.js class WebGPUComputeContext { @@ -97268,7 +103558,12 @@ class WebGPUComputeContext { this._bindGroups = []; } } -WebGPUComputeContext._Counter = 0; +var init_webgpuComputeContext = __esm(() => { + init_logger(); + init_engine_computeShader(); + init_webgpuConstants(); + WebGPUComputeContext._Counter = 0; +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuComputePipelineContext.js class WebGPUComputePipelineContext { @@ -97292,265 +103587,287 @@ class WebGPUComputePipelineContext { dispose() { } } +var init_webgpuComputePipelineContext = __esm(() => { +}); // node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.computeShader.js -WebGPUEngine.prototype.createComputeContext = function() { - return new WebGPUComputeContext(this._device, this._cacheSampler); -}; -WebGPUEngine.prototype.createComputeEffect = function(baseName, options) { - const compute = baseName.computeElement || baseName.compute || baseName.computeToken || baseName.computeSource || baseName; - const name95 = compute + "@" + options.defines; - if (this._compiledComputeEffects[name95]) { - const compiledEffect = this._compiledComputeEffects[name95]; - if (options.onCompiled && compiledEffect.isReady()) { - options.onCompiled(compiledEffect); - } - return compiledEffect; - } - const effect7 = new ComputeEffect(baseName, options, this, name95); - this._compiledComputeEffects[name95] = effect7; - return effect7; -}; -WebGPUEngine.prototype.createComputePipelineContext = function() { - return new WebGPUComputePipelineContext(this); -}; -WebGPUEngine.prototype.areAllComputeEffectsReady = function() { - for (const key in this._compiledComputeEffects) { - const effect7 = this._compiledComputeEffects[key]; - if (!effect7.isReady()) { - return false; +var init_engine_computeShader2 = __esm(() => { + init_computeEffect(); + init_webgpuEngine(); + init_webgpuComputeContext(); + init_webgpuComputePipelineContext(); + init_webgpuConstants(); + WebGPUEngine.prototype.createComputeContext = function() { + return new WebGPUComputeContext(this._device, this._cacheSampler); + }; + WebGPUEngine.prototype.createComputeEffect = function(baseName, options) { + const compute = baseName.computeElement || baseName.compute || baseName.computeToken || baseName.computeSource || baseName; + const name96 = compute + "@" + options.defines; + if (this._compiledComputeEffects[name96]) { + const compiledEffect = this._compiledComputeEffects[name96]; + if (options.onCompiled && compiledEffect.isReady()) { + options.onCompiled(compiledEffect); + } + return compiledEffect; } - } - return true; -}; -WebGPUEngine.prototype.computeDispatch = function(effect7, context, bindings, x, y = 1, z = 1, bindingsMapping) { - this._endCurrentRenderPass(); - const contextPipeline = effect7._pipelineContext; - const computeContext = context; - if (!contextPipeline.computePipeline) { - contextPipeline.computePipeline = this._device.createComputePipeline({ - layout: AutoLayoutMode.Auto, - compute: contextPipeline.stage - }); - } - const computePass = this._renderEncoder.beginComputePass(); - computePass.setPipeline(contextPipeline.computePipeline); - const bindGroups = computeContext.getBindGroups(bindings, contextPipeline.computePipeline, bindingsMapping); - for (let i = 0;i < bindGroups.length; ++i) { - const bindGroup = bindGroups[i]; - if (!bindGroup) { - continue; + const effect7 = new ComputeEffect(baseName, options, this, name96); + this._compiledComputeEffects[name96] = effect7; + return effect7; + }; + WebGPUEngine.prototype.createComputePipelineContext = function() { + return new WebGPUComputePipelineContext(this); + }; + WebGPUEngine.prototype.areAllComputeEffectsReady = function() { + for (const key in this._compiledComputeEffects) { + const effect7 = this._compiledComputeEffects[key]; + if (!effect7.isReady()) { + return false; + } } - computePass.setBindGroup(i, bindGroup); - } - if (x + y + z > 0) { - computePass.dispatchWorkgroups(x, y, z); - } - computePass.end(); -}; -WebGPUEngine.prototype.releaseComputeEffects = function() { - for (const name95 in this._compiledComputeEffects) { - const webGPUPipelineContextCompute = this._compiledComputeEffects[name95].getPipelineContext(); - this._deleteComputePipelineContext(webGPUPipelineContextCompute); - } - this._compiledComputeEffects = {}; -}; -WebGPUEngine.prototype._prepareComputePipelineContext = function(pipelineContext, computeSourceCode, rawComputeSourceCode, defines, entryPoint) { - const webGpuContext = pipelineContext; - if (this.dbgShowShaderCode) { - console.log(defines); - console.log(computeSourceCode); - } - webGpuContext.sources = { - compute: computeSourceCode, - rawCompute: rawComputeSourceCode + return true; }; - webGpuContext.stage = this._createComputePipelineStageDescriptor(computeSourceCode, defines, entryPoint); -}; -WebGPUEngine.prototype._releaseComputeEffect = function(effect7) { - if (this._compiledComputeEffects[effect7._key]) { - delete this._compiledComputeEffects[effect7._key]; - this._deleteComputePipelineContext(effect7.getPipelineContext()); - } -}; -WebGPUEngine.prototype._rebuildComputeEffects = function() { - for (const key in this._compiledComputeEffects) { - const effect7 = this._compiledComputeEffects[key]; - effect7._pipelineContext = null; - effect7._wasPreviouslyReady = false; - effect7._prepareEffect(); - } -}; -WebGPUEngine.prototype._deleteComputePipelineContext = function(pipelineContext) { - const webgpuPipelineContext2 = pipelineContext; - if (webgpuPipelineContext2) { - pipelineContext.dispose(); - } -}; -WebGPUEngine.prototype._createComputePipelineStageDescriptor = function(computeShader2, defines, entryPoint) { - if (defines) { - defines = "//" + defines.split("\n").join("\n//") + "\n"; - } else { - defines = ""; - } - return { - module: this._device.createShaderModule({ - code: defines + computeShader2 - }), - entryPoint + WebGPUEngine.prototype.computeDispatch = function(effect7, context, bindings, x, y = 1, z = 1, bindingsMapping) { + this._endCurrentRenderPass(); + const contextPipeline = effect7._pipelineContext; + const computeContext = context; + if (!contextPipeline.computePipeline) { + contextPipeline.computePipeline = this._device.createComputePipeline({ + layout: AutoLayoutMode.Auto, + compute: contextPipeline.stage + }); + } + const computePass = this._renderEncoder.beginComputePass(); + computePass.setPipeline(contextPipeline.computePipeline); + const bindGroups = computeContext.getBindGroups(bindings, contextPipeline.computePipeline, bindingsMapping); + for (let i = 0;i < bindGroups.length; ++i) { + const bindGroup = bindGroups[i]; + if (!bindGroup) { + continue; + } + computePass.setBindGroup(i, bindGroup); + } + if (x + y + z > 0) { + computePass.dispatchWorkgroups(x, y, z); + } + computePass.end(); }; -}; + WebGPUEngine.prototype.releaseComputeEffects = function() { + for (const name96 in this._compiledComputeEffects) { + const webGPUPipelineContextCompute = this._compiledComputeEffects[name96].getPipelineContext(); + this._deleteComputePipelineContext(webGPUPipelineContextCompute); + } + this._compiledComputeEffects = {}; + }; + WebGPUEngine.prototype._prepareComputePipelineContext = function(pipelineContext, computeSourceCode, rawComputeSourceCode, defines, entryPoint) { + const webGpuContext = pipelineContext; + if (this.dbgShowShaderCode) { + console.log(defines); + console.log(computeSourceCode); + } + webGpuContext.sources = { + compute: computeSourceCode, + rawCompute: rawComputeSourceCode + }; + webGpuContext.stage = this._createComputePipelineStageDescriptor(computeSourceCode, defines, entryPoint); + }; + WebGPUEngine.prototype._releaseComputeEffect = function(effect7) { + if (this._compiledComputeEffects[effect7._key]) { + delete this._compiledComputeEffects[effect7._key]; + this._deleteComputePipelineContext(effect7.getPipelineContext()); + } + }; + WebGPUEngine.prototype._rebuildComputeEffects = function() { + for (const key in this._compiledComputeEffects) { + const effect7 = this._compiledComputeEffects[key]; + effect7._pipelineContext = null; + effect7._wasPreviouslyReady = false; + effect7._prepareEffect(); + } + }; + WebGPUEngine.prototype._deleteComputePipelineContext = function(pipelineContext) { + const webgpuPipelineContext2 = pipelineContext; + if (webgpuPipelineContext2) { + pipelineContext.dispose(); + } + }; + WebGPUEngine.prototype._createComputePipelineStageDescriptor = function(computeShader2, defines, entryPoint) { + if (defines) { + defines = "//" + defines.split("\n").join("\n//") + "\n"; + } else { + defines = ""; + } + return { + module: this._device.createShaderModule({ + code: defines + computeShader2 + }), + entryPoint + }; + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.cubeTexture.js -WebGPUEngine.prototype._createDepthStencilCubeTexture = function(size, options) { - const internalTexture19 = new InternalTexture(this, InternalTextureSource.DepthStencil); - internalTexture19.isCube = true; - const internalOptions = Object.assign({ bilinearFiltering: false, comparisonFunction: 0, generateStencil: false, samples: 1 }, options); - internalTexture19.format = internalOptions.generateStencil ? 13 : 14; - this._setupDepthStencilTexture(internalTexture19, size, internalOptions.generateStencil, internalOptions.bilinearFiltering, internalOptions.comparisonFunction, internalOptions.samples); - this._textureHelper.createGPUTextureForInternalTexture(internalTexture19); - this._internalTexturesCache.push(internalTexture19); - return internalTexture19; -}; -WebGPUEngine.prototype.createCubeTexture = function(rootUrl, scene20, files, noMipmap, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = false, lodScale = 0, lodOffset = 0, fallback = null, useSRGBBuffer = false) { - return this.createCubeTextureBase(rootUrl, scene20, files, !!noMipmap, onLoad, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset, fallback, null, (texture16, imgs) => { - const imageBitmaps = imgs; - const width = imageBitmaps[0].width; - const height = width; - this._setCubeMapTextureParams(texture16, !noMipmap); - texture16.format = format !== null && format !== undefined ? format : -1; - const gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture16, width, height); - this._textureHelper.updateCubeTextures(imageBitmaps, gpuTextureWrapper.underlyingResource, width, height, gpuTextureWrapper.format, false, false, 0, 0); - if (!noMipmap) { - this._generateMipmaps(texture16, this._uploadEncoder); - } - texture16.isReady = true; - texture16.onLoadedObservable.notifyObservers(texture16); - texture16.onLoadedObservable.clear(); - if (onLoad) { - onLoad(); +var init_engine_cubeTexture2 = __esm(() => { + init_internalTexture(); + init_webgpuEngine(); + WebGPUEngine.prototype._createDepthStencilCubeTexture = function(size, options) { + const internalTexture19 = new InternalTexture(this, InternalTextureSource.DepthStencil); + internalTexture19.isCube = true; + const internalOptions = Object.assign({ bilinearFiltering: false, comparisonFunction: 0, generateStencil: false, samples: 1 }, options); + internalTexture19.format = internalOptions.generateStencil ? 13 : 14; + this._setupDepthStencilTexture(internalTexture19, size, internalOptions.generateStencil, internalOptions.bilinearFiltering, internalOptions.comparisonFunction, internalOptions.samples); + this._textureHelper.createGPUTextureForInternalTexture(internalTexture19); + this._internalTexturesCache.push(internalTexture19); + return internalTexture19; + }; + WebGPUEngine.prototype.createCubeTexture = function(rootUrl, scene20, files, noMipmap, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = false, lodScale = 0, lodOffset = 0, fallback = null, useSRGBBuffer = false) { + return this.createCubeTextureBase(rootUrl, scene20, files, !!noMipmap, onLoad, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset, fallback, null, (texture16, imgs) => { + const imageBitmaps = imgs; + const width = imageBitmaps[0].width; + const height = width; + this._setCubeMapTextureParams(texture16, !noMipmap); + texture16.format = format !== null && format !== undefined ? format : -1; + const gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture16, width, height); + this._textureHelper.updateCubeTextures(imageBitmaps, gpuTextureWrapper.underlyingResource, width, height, gpuTextureWrapper.format, false, false, 0, 0); + if (!noMipmap) { + this._generateMipmaps(texture16, this._uploadEncoder); + } + texture16.isReady = true; + texture16.onLoadedObservable.notifyObservers(texture16); + texture16.onLoadedObservable.clear(); + if (onLoad) { + onLoad(); + } + }, !!useSRGBBuffer); + }; + WebGPUEngine.prototype._setCubeMapTextureParams = function(texture16, loadMipmap, maxLevel) { + texture16.samplingMode = loadMipmap ? 3 : 2; + texture16._cachedWrapU = 0; + texture16._cachedWrapV = 0; + if (maxLevel) { + texture16._maxLodLevel = maxLevel; } - }, !!useSRGBBuffer); -}; -WebGPUEngine.prototype._setCubeMapTextureParams = function(texture16, loadMipmap, maxLevel) { - texture16.samplingMode = loadMipmap ? 3 : 2; - texture16._cachedWrapU = 0; - texture16._cachedWrapV = 0; - if (maxLevel) { - texture16._maxLodLevel = maxLevel; - } -}; + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.debugging.js -WebGPUEngine.prototype._debugPushGroup = function(groupName, targetObject) { - if (!this._options.enableGPUDebugMarkers) { - return; - } - if (targetObject === 0 || targetObject === 1) { - this._renderEncoder.pushDebugGroup(groupName); - } else if (this._currentRenderPass) { - this._currentRenderPass.pushDebugGroup(groupName); - } else { - this._pendingDebugCommands.push(["push", groupName]); - } -}; -WebGPUEngine.prototype._debugPopGroup = function(targetObject) { - if (!this._options.enableGPUDebugMarkers) { - return; - } - if (targetObject === 0 || targetObject === 1) { - this._renderEncoder.popDebugGroup(); - } else if (this._currentRenderPass) { - this._currentRenderPass.popDebugGroup(); - } else { - this._pendingDebugCommands.push(["pop", null]); - } -}; -WebGPUEngine.prototype._debugInsertMarker = function(text, targetObject) { - if (!this._options.enableGPUDebugMarkers) { - return; - } - if (targetObject === 0 || targetObject === 1) { - this._renderEncoder.insertDebugMarker(text); - } else if (this._currentRenderPass) { - this._currentRenderPass.insertDebugMarker(text); - } else { - this._pendingDebugCommands.push(["insert", text]); - } -}; -WebGPUEngine.prototype._debugFlushPendingCommands = function() { - for (let i = 0;i < this._pendingDebugCommands.length; ++i) { - const [name95, param] = this._pendingDebugCommands[i]; - switch (name95) { - case "push": - this._debugPushGroup(param); - break; - case "pop": - this._debugPopGroup(); - break; - case "insert": - this._debugInsertMarker(param); - break; +var init_engine_debugging2 = __esm(() => { + init_webgpuEngine(); + WebGPUEngine.prototype._debugPushGroup = function(groupName, targetObject) { + if (!this._options.enableGPUDebugMarkers) { + return; } - } - this._pendingDebugCommands.length = 0; -}; + if (targetObject === 0 || targetObject === 1) { + this._renderEncoder.pushDebugGroup(groupName); + } else if (this._currentRenderPass) { + this._currentRenderPass.pushDebugGroup(groupName); + } else { + this._pendingDebugCommands.push(["push", groupName]); + } + }; + WebGPUEngine.prototype._debugPopGroup = function(targetObject) { + if (!this._options.enableGPUDebugMarkers) { + return; + } + if (targetObject === 0 || targetObject === 1) { + this._renderEncoder.popDebugGroup(); + } else if (this._currentRenderPass) { + this._currentRenderPass.popDebugGroup(); + } else { + this._pendingDebugCommands.push(["pop", null]); + } + }; + WebGPUEngine.prototype._debugInsertMarker = function(text, targetObject) { + if (!this._options.enableGPUDebugMarkers) { + return; + } + if (targetObject === 0 || targetObject === 1) { + this._renderEncoder.insertDebugMarker(text); + } else if (this._currentRenderPass) { + this._currentRenderPass.insertDebugMarker(text); + } else { + this._pendingDebugCommands.push(["insert", text]); + } + }; + WebGPUEngine.prototype._debugFlushPendingCommands = function() { + for (let i = 0;i < this._pendingDebugCommands.length; ++i) { + const [name96, param] = this._pendingDebugCommands[i]; + switch (name96) { + case "push": + this._debugPushGroup(param); + break; + case "pop": + this._debugPopGroup(); + break; + case "insert": + this._debugInsertMarker(param); + break; + } + } + this._pendingDebugCommands.length = 0; + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.dynamicBuffer.js -WebGPUEngine.prototype.updateDynamicIndexBuffer = function(indexBuffer, indices, offset = 0) { - const gpuBuffer = indexBuffer; - let view; - if (indexBuffer.is32Bits) { - view = indices instanceof Uint32Array ? indices : new Uint32Array(indices); - } else { - view = indices instanceof Uint16Array ? indices : new Uint16Array(indices); - } - this._bufferManager.setSubData(gpuBuffer, offset, view); -}; -WebGPUEngine.prototype.updateDynamicVertexBuffer = function(vertexBuffer, data, byteOffset, byteLength) { - const dataBuffer7 = vertexBuffer; - if (byteOffset === undefined) { - byteOffset = 0; - } - let view; - if (byteLength === undefined) { - if (data instanceof Array) { - view = new Float32Array(data); - } else if (data instanceof ArrayBuffer) { - view = new Uint8Array(data); +var init_engine_dynamicBuffer2 = __esm(() => { + init_webgpuEngine(); + WebGPUEngine.prototype.updateDynamicIndexBuffer = function(indexBuffer, indices, offset = 0) { + const gpuBuffer = indexBuffer; + let view; + if (indexBuffer.is32Bits) { + view = indices instanceof Uint32Array ? indices : new Uint32Array(indices); } else { - view = data; + view = indices instanceof Uint16Array ? indices : new Uint16Array(indices); } - byteLength = view.byteLength; - } else { - if (data instanceof Array) { - view = new Float32Array(data); - } else if (data instanceof ArrayBuffer) { - view = new Uint8Array(data); + this._bufferManager.setSubData(gpuBuffer, offset, view); + }; + WebGPUEngine.prototype.updateDynamicVertexBuffer = function(vertexBuffer, data, byteOffset, byteLength) { + const dataBuffer7 = vertexBuffer; + if (byteOffset === undefined) { + byteOffset = 0; + } + let view; + if (byteLength === undefined) { + if (data instanceof Array) { + view = new Float32Array(data); + } else if (data instanceof ArrayBuffer) { + view = new Uint8Array(data); + } else { + view = data; + } + byteLength = view.byteLength; } else { - view = data; + if (data instanceof Array) { + view = new Float32Array(data); + } else if (data instanceof ArrayBuffer) { + view = new Uint8Array(data); + } else { + view = data; + } } - } - this._bufferManager.setSubData(dataBuffer7, byteOffset, view, 0, byteLength); -}; + this._bufferManager.setSubData(dataBuffer7, byteOffset, view, 0, byteLength); + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.dynamicTexture.js -WebGPUEngine.prototype.updateDynamicTexture = function(texture16, canvas, invertY, premulAlpha = false, format, forceBindTexture, allowGPUOptimization) { - var _a; - if (!texture16) { - return; - } - const { width, height } = canvas; - let gpuTextureWrapper = texture16._hardwareTexture; - if (!((_a = texture16._hardwareTexture) === null || _a === undefined ? undefined : _a.underlyingResource)) { - gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture16, width, height); - } - this._textureHelper.updateTexture(canvas, texture16, width, height, texture16.depth, gpuTextureWrapper.format, 0, 0, invertY, premulAlpha, 0, 0, allowGPUOptimization); - if (texture16.generateMipMaps) { - this._generateMipmaps(texture16); - } - texture16.isReady = true; -}; +var init_engine_dynamicTexture2 = __esm(() => { + init_webgpuEngine(); + WebGPUEngine.prototype.updateDynamicTexture = function(texture16, canvas, invertY, premulAlpha = false, format, forceBindTexture, allowGPUOptimization) { + var _a; + if (!texture16) { + return; + } + const { width, height } = canvas; + let gpuTextureWrapper = texture16._hardwareTexture; + if (!((_a = texture16._hardwareTexture) === null || _a === undefined ? undefined : _a.underlyingResource)) { + gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture16, width, height); + } + this._textureHelper.updateTexture(canvas, texture16, width, height, texture16.depth, gpuTextureWrapper.format, 0, 0, invertY, premulAlpha, 0, 0, allowGPUOptimization); + if (texture16.generateMipMaps) { + this._generateMipmaps(texture16); + } + texture16.isReady = true; + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuExternalTexture.js class WebGPUExternalTexture extends ExternalTexture { @@ -97558,851 +103875,1006 @@ class WebGPUExternalTexture extends ExternalTexture { super(video); } } +var init_webgpuExternalTexture = __esm(() => { + init_externalTexture(); +}); // node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.externalTexture.js -Effect.prototype.setExternalTexture = function(name95, texture16) { - this._engine.setExternalTexture(name95, texture16); -}; -WebGPUEngine.prototype.createExternalTexture = function(video) { - const texture16 = new WebGPUExternalTexture(video); - return texture16; -}; -WebGPUEngine.prototype.setExternalTexture = function(name95, texture16) { - if (!texture16) { - this._currentMaterialContext.setTexture(name95, null); - return; - } - this._setInternalTexture(name95, texture16); -}; +var init_engine_externalTexture2 = __esm(() => { + init_webgpuEngine(); + init_webgpuExternalTexture(); + init_effect(); + Effect.prototype.setExternalTexture = function(name96, texture16) { + this._engine.setExternalTexture(name96, texture16); + }; + WebGPUEngine.prototype.createExternalTexture = function(video) { + const texture16 = new WebGPUExternalTexture(video); + return texture16; + }; + WebGPUEngine.prototype.setExternalTexture = function(name96, texture16) { + if (!texture16) { + this._currentMaterialContext.setTexture(name96, null); + return; + } + this._setInternalTexture(name96, texture16); + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.multiRender.js -WebGPUEngine.prototype.unBindMultiColorAttachmentFramebuffer = function(rtWrapper, disableGenerateMipMaps = false, onBeforeUnbind) { - if (onBeforeUnbind) { - onBeforeUnbind(); - } - const attachments = rtWrapper._attachments; - const count = attachments.length; - this._endCurrentRenderPass(); - for (let i = 0;i < count; i++) { - const texture16 = rtWrapper.textures[i]; - if (texture16.generateMipMaps && !disableGenerateMipMaps && !texture16.isCube) { - this._generateMipmaps(texture16); +var init_engine_multiRender2 = __esm(() => { + init_internalTexture(); + init_logger(); + init_webgpuEngine(); + WebGPUEngine.prototype.unBindMultiColorAttachmentFramebuffer = function(rtWrapper, disableGenerateMipMaps = false, onBeforeUnbind) { + if (onBeforeUnbind) { + onBeforeUnbind(); } - } - this._currentRenderTarget = null; - this._mrtAttachments = []; - this._cacheRenderPipeline.setMRT([]); - this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments); -}; -WebGPUEngine.prototype.createMultipleRenderTarget = function(size, options, initializeBuffers) { - var _a, _b, _c; - let generateMipMaps = false; - let generateDepthBuffer = true; - let generateStencilBuffer = false; - let generateDepthTexture = false; - let depthTextureFormat = 15; - let textureCount = 1; - const defaultType = 0; - const defaultSamplingMode = 3; - const defaultUseSRGBBuffer = false; - const defaultFormat = 5; - const defaultTarget = 3553; - let types2 = []; - let samplingModes = []; - let useSRGBBuffers = []; - let formats = []; - let targets = []; - let faceIndex = []; - let layerIndex = []; - let layers = []; - let labels = []; - const rtWrapper = this._createHardwareRenderTargetWrapper(true, false, size); - if (options !== undefined) { - generateMipMaps = options.generateMipMaps === undefined ? false : options.generateMipMaps; - generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer; - generateStencilBuffer = options.generateStencilBuffer === undefined ? false : options.generateStencilBuffer; - generateDepthTexture = options.generateDepthTexture === undefined ? false : options.generateDepthTexture; - textureCount = options.textureCount || 1; - depthTextureFormat = (_a = options.depthTextureFormat) !== null && _a !== undefined ? _a : 15; - if (options.types) { - types2 = options.types; - } - if (options.samplingModes) { - samplingModes = options.samplingModes; - } - if (options.useSRGBBuffers) { - useSRGBBuffers = options.useSRGBBuffers; - } - if (options.formats) { - formats = options.formats; - } - if (options.targetTypes) { - targets = options.targetTypes; - } - if (options.faceIndex) { - faceIndex = options.faceIndex; - } - if (options.layerIndex) { - layerIndex = options.layerIndex; - } - if (options.layerCounts) { - layers = options.layerCounts; - } - labels = (_b = options.labels) !== null && _b !== undefined ? _b : labels; - } - const width = size.width || size; - const height = size.height || size; - let depthStencilTexture = null; - if (generateDepthBuffer || generateStencilBuffer || generateDepthTexture) { - if (!generateDepthTexture) { - if (generateDepthBuffer && generateStencilBuffer) { - depthTextureFormat = 13; - } else if (generateDepthBuffer) { - depthTextureFormat = 14; - } else { - depthTextureFormat = 19; - } - } - depthStencilTexture = rtWrapper.createDepthStencilTexture(0, false, generateStencilBuffer, 1, depthTextureFormat, "MultipleRenderTargetDepthStencil"); - } - const textures = []; - const attachments = []; - const defaultAttachments = []; - rtWrapper._generateDepthBuffer = generateDepthBuffer; - rtWrapper._generateStencilBuffer = generateStencilBuffer; - rtWrapper._attachments = attachments; - rtWrapper._defaultAttachments = defaultAttachments; - for (let i = 0;i < textureCount; i++) { - let samplingMode = samplingModes[i] || defaultSamplingMode; - let type = types2[i] || defaultType; - const format = formats[i] || defaultFormat; - const useSRGBBuffer = (useSRGBBuffers[i] || defaultUseSRGBBuffer) && this._caps.supportSRGBBuffers; - const target = targets[i] || defaultTarget; - const layerCount = (_c = layers[i]) !== null && _c !== undefined ? _c : 1; - if (type === 1 && !this._caps.textureFloatLinearFiltering) { - samplingMode = 1; - } else if (type === 2 && !this._caps.textureHalfFloatLinearFiltering) { - samplingMode = 1; + const attachments = rtWrapper._attachments; + const count = attachments.length; + this._endCurrentRenderPass(); + for (let i = 0;i < count; i++) { + const texture16 = rtWrapper.textures[i]; + if (texture16.generateMipMaps && !disableGenerateMipMaps && !texture16.isCube) { + this._generateMipmaps(texture16); + } } - if (type === 1 && !this._caps.textureFloat) { - type = 0; - Logger.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"); + this._currentRenderTarget = null; + this._mrtAttachments = []; + this._cacheRenderPipeline.setMRT([]); + this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments); + }; + WebGPUEngine.prototype.createMultipleRenderTarget = function(size, options, initializeBuffers) { + var _a, _b, _c; + let generateMipMaps = false; + let generateDepthBuffer = true; + let generateStencilBuffer = false; + let generateDepthTexture = false; + let depthTextureFormat = 15; + let textureCount = 1; + const defaultType = 0; + const defaultSamplingMode = 3; + const defaultUseSRGBBuffer = false; + const defaultFormat = 5; + const defaultTarget = 3553; + let types2 = []; + let samplingModes = []; + let useSRGBBuffers = []; + let formats = []; + let targets = []; + let faceIndex = []; + let layerIndex = []; + let layers = []; + let labels = []; + const rtWrapper = this._createHardwareRenderTargetWrapper(true, false, size); + if (options !== undefined) { + generateMipMaps = options.generateMipMaps === undefined ? false : options.generateMipMaps; + generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer; + generateStencilBuffer = options.generateStencilBuffer === undefined ? false : options.generateStencilBuffer; + generateDepthTexture = options.generateDepthTexture === undefined ? false : options.generateDepthTexture; + textureCount = options.textureCount || 1; + depthTextureFormat = (_a = options.depthTextureFormat) !== null && _a !== undefined ? _a : 15; + if (options.types) { + types2 = options.types; + } + if (options.samplingModes) { + samplingModes = options.samplingModes; + } + if (options.useSRGBBuffers) { + useSRGBBuffers = options.useSRGBBuffers; + } + if (options.formats) { + formats = options.formats; + } + if (options.targetTypes) { + targets = options.targetTypes; + } + if (options.faceIndex) { + faceIndex = options.faceIndex; + } + if (options.layerIndex) { + layerIndex = options.layerIndex; + } + if (options.layerCounts) { + layers = options.layerCounts; + } + labels = (_b = options.labels) !== null && _b !== undefined ? _b : labels; } - attachments.push(i + 1); - defaultAttachments.push(initializeBuffers ? i + 1 : i === 0 ? 1 : 0); - if (target === -1) { - continue; + const width = size.width || size; + const height = size.height || size; + let depthStencilTexture = null; + if (generateDepthBuffer || generateStencilBuffer || generateDepthTexture) { + if (!generateDepthTexture) { + if (generateDepthBuffer && generateStencilBuffer) { + depthTextureFormat = 13; + } else if (generateDepthBuffer) { + depthTextureFormat = 14; + } else { + depthTextureFormat = 19; + } + } + depthStencilTexture = rtWrapper.createDepthStencilTexture(0, false, generateStencilBuffer, 1, depthTextureFormat, "MultipleRenderTargetDepthStencil"); } - const texture16 = new InternalTexture(this, InternalTextureSource.MultiRenderTarget); - textures[i] = texture16; - switch (target) { - case 34067: - texture16.isCube = true; - break; - case 32879: - texture16.is3D = true; - texture16.baseDepth = texture16.depth = layerCount; - break; - case 35866: - texture16.is2DArray = true; - texture16.baseDepth = texture16.depth = layerCount; - break; + const textures = []; + const attachments = []; + const defaultAttachments = []; + rtWrapper._generateDepthBuffer = generateDepthBuffer; + rtWrapper._generateStencilBuffer = generateStencilBuffer; + rtWrapper._attachments = attachments; + rtWrapper._defaultAttachments = defaultAttachments; + for (let i = 0;i < textureCount; i++) { + let samplingMode = samplingModes[i] || defaultSamplingMode; + let type = types2[i] || defaultType; + const format = formats[i] || defaultFormat; + const useSRGBBuffer = (useSRGBBuffers[i] || defaultUseSRGBBuffer) && this._caps.supportSRGBBuffers; + const target = targets[i] || defaultTarget; + const layerCount = (_c = layers[i]) !== null && _c !== undefined ? _c : 1; + if (type === 1 && !this._caps.textureFloatLinearFiltering) { + samplingMode = 1; + } else if (type === 2 && !this._caps.textureHalfFloatLinearFiltering) { + samplingMode = 1; + } + if (type === 1 && !this._caps.textureFloat) { + type = 0; + Logger.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"); + } + attachments.push(i + 1); + defaultAttachments.push(initializeBuffers ? i + 1 : i === 0 ? 1 : 0); + if (target === -1) { + continue; + } + const texture16 = new InternalTexture(this, InternalTextureSource.MultiRenderTarget); + textures[i] = texture16; + switch (target) { + case 34067: + texture16.isCube = true; + break; + case 32879: + texture16.is3D = true; + texture16.baseDepth = texture16.depth = layerCount; + break; + case 35866: + texture16.is2DArray = true; + texture16.baseDepth = texture16.depth = layerCount; + break; + } + texture16.baseWidth = width; + texture16.baseHeight = height; + texture16.width = width; + texture16.height = height; + texture16.isReady = true; + texture16.samples = 1; + texture16.generateMipMaps = generateMipMaps; + texture16.samplingMode = samplingMode; + texture16.type = type; + texture16._cachedWrapU = 0; + texture16._cachedWrapV = 0; + texture16._useSRGBBuffer = useSRGBBuffer; + texture16.format = format; + texture16.label = labels[i]; + this._internalTexturesCache.push(texture16); + this._textureHelper.createGPUTextureForInternalTexture(texture16); + } + if (depthStencilTexture) { + depthStencilTexture.incrementReferences(); + textures[textureCount] = depthStencilTexture; + this._internalTexturesCache.push(depthStencilTexture); + } + rtWrapper.setTextures(textures); + rtWrapper.setLayerAndFaceIndices(layerIndex, faceIndex); + return rtWrapper; + }; + WebGPUEngine.prototype.updateMultipleRenderTargetTextureSampleCount = function(rtWrapper, samples) { + if (!rtWrapper || !rtWrapper.textures || rtWrapper.textures[0].samples === samples) { + return samples; + } + const count = rtWrapper.textures.length; + if (count === 0) { + return 1; + } + samples = Math.min(samples, this.getCaps().maxMSAASamples); + for (let i = 0;i < count; ++i) { + const texture16 = rtWrapper.textures[i]; + const gpuTextureWrapper = texture16._hardwareTexture; + gpuTextureWrapper === null || gpuTextureWrapper === undefined || gpuTextureWrapper.releaseMSAATexture(); + } + const lastTextureIsDepthTexture = rtWrapper._depthStencilTexture === rtWrapper.textures[count - 1]; + for (let i = 0;i < count; ++i) { + const texture16 = rtWrapper.textures[i]; + this._textureHelper.createMSAATexture(texture16, samples, false, i === count - 1 && lastTextureIsDepthTexture ? 0 : i); + texture16.samples = samples; + } + if (rtWrapper._depthStencilTexture && !lastTextureIsDepthTexture) { + this._textureHelper.createMSAATexture(rtWrapper._depthStencilTexture, samples); + rtWrapper._depthStencilTexture.samples = samples; } - texture16.baseWidth = width; - texture16.baseHeight = height; - texture16.width = width; - texture16.height = height; - texture16.isReady = true; - texture16.samples = 1; - texture16.generateMipMaps = generateMipMaps; - texture16.samplingMode = samplingMode; - texture16.type = type; - texture16._cachedWrapU = 0; - texture16._cachedWrapV = 0; - texture16._useSRGBBuffer = useSRGBBuffer; - texture16.format = format; - texture16.label = labels[i]; - this._internalTexturesCache.push(texture16); - this._textureHelper.createGPUTextureForInternalTexture(texture16); - } - if (depthStencilTexture) { - depthStencilTexture.incrementReferences(); - textures[textureCount] = depthStencilTexture; - this._internalTexturesCache.push(depthStencilTexture); - } - rtWrapper.setTextures(textures); - rtWrapper.setLayerAndFaceIndices(layerIndex, faceIndex); - return rtWrapper; -}; -WebGPUEngine.prototype.updateMultipleRenderTargetTextureSampleCount = function(rtWrapper, samples) { - if (!rtWrapper || !rtWrapper.textures || rtWrapper.textures[0].samples === samples) { return samples; - } - const count = rtWrapper.textures.length; - if (count === 0) { - return 1; - } - samples = Math.min(samples, this.getCaps().maxMSAASamples); - for (let i = 0;i < count; ++i) { - const texture16 = rtWrapper.textures[i]; - const gpuTextureWrapper = texture16._hardwareTexture; - gpuTextureWrapper === null || gpuTextureWrapper === undefined || gpuTextureWrapper.releaseMSAATexture(); - } - const lastTextureIsDepthTexture = rtWrapper._depthStencilTexture === rtWrapper.textures[count - 1]; - for (let i = 0;i < count; ++i) { - const texture16 = rtWrapper.textures[i]; - this._textureHelper.createMSAATexture(texture16, samples, false, i === count - 1 && lastTextureIsDepthTexture ? 0 : i); - texture16.samples = samples; - } - if (rtWrapper._depthStencilTexture && !lastTextureIsDepthTexture) { - this._textureHelper.createMSAATexture(rtWrapper._depthStencilTexture, samples); - rtWrapper._depthStencilTexture.samples = samples; - } - return samples; -}; -WebGPUEngine.prototype.bindAttachments = function(attachments) { - if (attachments.length === 0 || !this._currentRenderTarget) { - return; - } - this._mrtAttachments = attachments; - if (this._currentRenderPass) { - this._cacheRenderPipeline.setMRTAttachments(attachments); - } else { - } -}; -WebGPUEngine.prototype.buildTextureLayout = function(textureStatus) { - const result = []; - for (let i = 0;i < textureStatus.length; i++) { - if (textureStatus[i]) { - result.push(i + 1); + }; + WebGPUEngine.prototype.bindAttachments = function(attachments) { + if (attachments.length === 0 || !this._currentRenderTarget) { + return; + } + this._mrtAttachments = attachments; + if (this._currentRenderPass) { + this._cacheRenderPipeline.setMRTAttachments(attachments); } else { - result.push(0); } - } - return result; -}; -WebGPUEngine.prototype.restoreSingleAttachment = function() { -}; -WebGPUEngine.prototype.restoreSingleAttachmentForRenderTarget = function() { -}; + }; + WebGPUEngine.prototype.buildTextureLayout = function(textureStatus) { + const result = []; + for (let i = 0;i < textureStatus.length; i++) { + if (textureStatus[i]) { + result.push(i + 1); + } else { + result.push(0); + } + } + return result; + }; + WebGPUEngine.prototype.restoreSingleAttachment = function() { + }; + WebGPUEngine.prototype.restoreSingleAttachmentForRenderTarget = function() { + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.query.js -WebGPUEngine.prototype.getGPUFrameTimeCounter = function() { - return this._timestampQuery.gpuFrameTimeCounter; -}; -WebGPUEngine.prototype.captureGPUFrameTime = function(value) { - this._timestampQuery.enable = value && !!this._caps.timerQuery; -}; -WebGPUEngine.prototype.createQuery = function() { - return this._occlusionQuery.createQuery(); -}; -WebGPUEngine.prototype.deleteQuery = function(query) { - this._occlusionQuery.deleteQuery(query); - return this; -}; -WebGPUEngine.prototype.isQueryResultAvailable = function(query) { - return this._occlusionQuery.isQueryResultAvailable(query); -}; -WebGPUEngine.prototype.getQueryResult = function(query) { - return this._occlusionQuery.getQueryResult(query); -}; -WebGPUEngine.prototype.beginOcclusionQuery = function(algorithmType, query) { - var _a; - if (this.compatibilityMode) { - if (this._occlusionQuery.canBeginQuery(query)) { - (_a = this._currentRenderPass) === null || _a === undefined || _a.beginOcclusionQuery(query); +var init_engine_query2 = __esm(() => { + init_webgpuEngine(); + init_webgpuBundleList(); + WebGPUEngine.prototype.getGPUFrameTimeCounter = function() { + return this._timestampQuery.gpuFrameTimeCounter; + }; + WebGPUEngine.prototype.captureGPUFrameTime = function(value) { + this._timestampQuery.enable = value && !!this._caps.timerQuery; + }; + WebGPUEngine.prototype.createQuery = function() { + return this._occlusionQuery.createQuery(); + }; + WebGPUEngine.prototype.deleteQuery = function(query) { + this._occlusionQuery.deleteQuery(query); + return this; + }; + WebGPUEngine.prototype.isQueryResultAvailable = function(query) { + return this._occlusionQuery.isQueryResultAvailable(query); + }; + WebGPUEngine.prototype.getQueryResult = function(query) { + return this._occlusionQuery.getQueryResult(query); + }; + WebGPUEngine.prototype.beginOcclusionQuery = function(algorithmType, query) { + var _a; + if (this.compatibilityMode) { + if (this._occlusionQuery.canBeginQuery(query)) { + (_a = this._currentRenderPass) === null || _a === undefined || _a.beginOcclusionQuery(query); + return true; + } + } else { + this._bundleList.addItem(new WebGPURenderItemBeginOcclusionQuery(query)); return true; } - } else { - this._bundleList.addItem(new WebGPURenderItemBeginOcclusionQuery(query)); - return true; - } - return false; -}; -WebGPUEngine.prototype.endOcclusionQuery = function() { - var _a; - if (this.compatibilityMode) { - (_a = this._currentRenderPass) === null || _a === undefined || _a.endOcclusionQuery(); - } else { - this._bundleList.addItem(new WebGPURenderItemEndOcclusionQuery); - } - return this; -}; + return false; + }; + WebGPUEngine.prototype.endOcclusionQuery = function() { + var _a; + if (this.compatibilityMode) { + (_a = this._currentRenderPass) === null || _a === undefined || _a.endOcclusionQuery(); + } else { + this._bundleList.addItem(new WebGPURenderItemEndOcclusionQuery); + } + return this; + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.rawTexture.js -var _convertRGBtoRGBATextureData2 = function(rgbData, width, height, textureType) { - let rgbaData; - let val1 = 1; - if (textureType === 1) { - rgbaData = new Float32Array(width * height * 4); - } else if (textureType === 2) { - rgbaData = new Uint16Array(width * height * 4); - val1 = 15360; - } else if (textureType === 7) { - rgbaData = new Uint32Array(width * height * 4); - } else { - rgbaData = new Uint8Array(width * height * 4); - } - for (let x = 0;x < width; x++) { - for (let y = 0;y < height; y++) { - const index = (y * width + x) * 3; - const newIndex = (y * width + x) * 4; - rgbaData[newIndex + 0] = rgbData[index + 0]; - rgbaData[newIndex + 1] = rgbData[index + 1]; - rgbaData[newIndex + 2] = rgbData[index + 2]; - rgbaData[newIndex + 3] = val1; +var _convertRGBtoRGBATextureData2; +var init_engine_rawTexture2 = __esm(() => { + init_internalTexture(); + init_webgpuEngine(); + init_logger(); + _convertRGBtoRGBATextureData2 = function(rgbData, width, height, textureType) { + let rgbaData; + let val1 = 1; + if (textureType === 1) { + rgbaData = new Float32Array(width * height * 4); + } else if (textureType === 2) { + rgbaData = new Uint16Array(width * height * 4); + val1 = 15360; + } else if (textureType === 7) { + rgbaData = new Uint32Array(width * height * 4); + } else { + rgbaData = new Uint8Array(width * height * 4); } - } - return rgbaData; -}; -WebGPUEngine.prototype.createRawTexture = function(data, width, height, format, generateMipMaps, invertY, samplingMode, compression = null, type = 0, creationFlags = 0, useSRGBBuffer = false) { - const texture16 = new InternalTexture(this, InternalTextureSource.Raw); - texture16.baseWidth = width; - texture16.baseHeight = height; - texture16.width = width; - texture16.height = height; - texture16.format = format; - texture16.generateMipMaps = generateMipMaps; - texture16.samplingMode = samplingMode; - texture16.invertY = invertY; - texture16._compression = compression; - texture16.type = type; - texture16._useSRGBBuffer = useSRGBBuffer; - if (!this._doNotHandleContextLost) { - texture16._bufferView = data; - } - this._textureHelper.createGPUTextureForInternalTexture(texture16, width, height, undefined, creationFlags); - this.updateRawTexture(texture16, data, format, invertY, compression, type, useSRGBBuffer); - this._internalTexturesCache.push(texture16); - return texture16; -}; -WebGPUEngine.prototype.updateRawTexture = function(texture16, bufferView, format, invertY, compression = null, type = 0, useSRGBBuffer = false) { - if (!texture16) { - return; - } - if (!this._doNotHandleContextLost) { - texture16._bufferView = bufferView; + for (let x = 0;x < width; x++) { + for (let y = 0;y < height; y++) { + const index = (y * width + x) * 3; + const newIndex = (y * width + x) * 4; + rgbaData[newIndex + 0] = rgbData[index + 0]; + rgbaData[newIndex + 1] = rgbData[index + 1]; + rgbaData[newIndex + 2] = rgbData[index + 2]; + rgbaData[newIndex + 3] = val1; + } + } + return rgbaData; + }; + WebGPUEngine.prototype.createRawTexture = function(data, width, height, format, generateMipMaps, invertY, samplingMode, compression = null, type = 0, creationFlags = 0, useSRGBBuffer = false) { + const texture16 = new InternalTexture(this, InternalTextureSource.Raw); + texture16.baseWidth = width; + texture16.baseHeight = height; + texture16.width = width; + texture16.height = height; + texture16.format = format; + texture16.generateMipMaps = generateMipMaps; + texture16.samplingMode = samplingMode; texture16.invertY = invertY; texture16._compression = compression; + texture16.type = type; texture16._useSRGBBuffer = useSRGBBuffer; - } - if (bufferView) { - const gpuTextureWrapper = texture16._hardwareTexture; - const needConversion = format === 4; - if (needConversion) { - bufferView = _convertRGBtoRGBATextureData2(bufferView, texture16.width, texture16.height, type); - } - const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength); - this._textureHelper.updateTexture(data, texture16, texture16.width, texture16.height, texture16.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0); - if (texture16.generateMipMaps) { - this._generateMipmaps(texture16, this._uploadEncoder); + if (!this._doNotHandleContextLost) { + texture16._bufferView = data; } - } - texture16.isReady = true; -}; -WebGPUEngine.prototype.createRawCubeTexture = function(data, size, format, type, generateMipMaps, invertY, samplingMode, compression = null) { - const texture16 = new InternalTexture(this, InternalTextureSource.CubeRaw); - if (type === 1 && !this._caps.textureFloatLinearFiltering) { - generateMipMaps = false; - samplingMode = 1; - Logger.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."); - } else if (type === 2 && !this._caps.textureHalfFloatLinearFiltering) { - generateMipMaps = false; - samplingMode = 1; - Logger.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."); - } else if (type === 1 && !this._caps.textureFloatRender) { - generateMipMaps = false; - Logger.Warn("Render to float textures is not supported. Mipmap generation forced to false."); - } else if (type === 2 && !this._caps.colorBufferFloat) { - generateMipMaps = false; - Logger.Warn("Render to half float textures is not supported. Mipmap generation forced to false."); - } - texture16.isCube = true; - texture16.format = format === 4 ? 5 : format; - texture16.type = type; - texture16.generateMipMaps = generateMipMaps; - texture16.width = size; - texture16.height = size; - texture16.samplingMode = samplingMode; - if (!this._doNotHandleContextLost) { - texture16._bufferViewArray = data; - } - texture16.invertY = invertY; - texture16._compression = compression; - texture16._cachedWrapU = 0; - texture16._cachedWrapV = 0; - this._textureHelper.createGPUTextureForInternalTexture(texture16); - if (data) { - this.updateRawCubeTexture(texture16, data, format, type, invertY, compression); - } - texture16.isReady = true; - return texture16; -}; -WebGPUEngine.prototype.updateRawCubeTexture = function(texture16, bufferView, format, type, invertY, compression = null) { - texture16._bufferViewArray = bufferView; - texture16.invertY = invertY; - texture16._compression = compression; - const gpuTextureWrapper = texture16._hardwareTexture; - const needConversion = format === 4; - const data = []; - for (let i = 0;i < bufferView.length; ++i) { - let faceData = bufferView[i]; - if (needConversion) { - faceData = _convertRGBtoRGBATextureData2(bufferView[i], texture16.width, texture16.height, type); - } - data.push(new Uint8Array(faceData.buffer, faceData.byteOffset, faceData.byteLength)); - } - this._textureHelper.updateCubeTextures(data, gpuTextureWrapper.underlyingResource, texture16.width, texture16.height, gpuTextureWrapper.format, invertY, false, 0, 0); - if (texture16.generateMipMaps) { - this._generateMipmaps(texture16, this._uploadEncoder); - } - texture16.isReady = true; -}; -WebGPUEngine.prototype.createRawCubeTextureFromUrl = function(url, scene20, size, format, type, noMipmap, callback, mipmapGenerator, onLoad = null, onError = null, samplingMode = 3, invertY = false) { - const texture16 = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode, null); - scene20 === null || scene20 === undefined || scene20.addPendingData(texture16); - texture16.url = url; - this._internalTexturesCache.push(texture16); - const onerror = (request, exception) => { - scene20 === null || scene20 === undefined || scene20.removePendingData(texture16); - if (onError && request) { - onError(request.status + " " + request.statusText, exception); - } - }; - const internalCallback = (data) => { - const width = texture16.width; - const faceDataArrays = callback(data); - if (!faceDataArrays) { + this._textureHelper.createGPUTextureForInternalTexture(texture16, width, height, undefined, creationFlags); + this.updateRawTexture(texture16, data, format, invertY, compression, type, useSRGBBuffer); + this._internalTexturesCache.push(texture16); + return texture16; + }; + WebGPUEngine.prototype.updateRawTexture = function(texture16, bufferView, format, invertY, compression = null, type = 0, useSRGBBuffer = false) { + if (!texture16) { return; } - const faces = [0, 2, 4, 1, 3, 5]; - if (mipmapGenerator) { - const needConversion = format === 4; - const mipData = mipmapGenerator(faceDataArrays); + if (!this._doNotHandleContextLost) { + texture16._bufferView = bufferView; + texture16.invertY = invertY; + texture16._compression = compression; + texture16._useSRGBBuffer = useSRGBBuffer; + } + if (bufferView) { const gpuTextureWrapper = texture16._hardwareTexture; - const faces2 = [0, 1, 2, 3, 4, 5]; - for (let level = 0;level < mipData.length; level++) { - const mipSize = width >> level; - const allFaces = []; - for (let faceIndex = 0;faceIndex < 6; faceIndex++) { - let mipFaceData = mipData[level][faces2[faceIndex]]; - if (needConversion) { - mipFaceData = _convertRGBtoRGBATextureData2(mipFaceData, mipSize, mipSize, type); - } - allFaces.push(new Uint8Array(mipFaceData.buffer, mipFaceData.byteOffset, mipFaceData.byteLength)); - } - this._textureHelper.updateCubeTextures(allFaces, gpuTextureWrapper.underlyingResource, mipSize, mipSize, gpuTextureWrapper.format, invertY, false, 0, 0); + const needConversion = format === 4; + if (needConversion) { + bufferView = _convertRGBtoRGBATextureData2(bufferView, texture16.width, texture16.height, type); } - } else { - const allFaces = []; - for (let faceIndex = 0;faceIndex < 6; faceIndex++) { - allFaces.push(faceDataArrays[faces[faceIndex]]); + const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength); + this._textureHelper.updateTexture(data, texture16, texture16.width, texture16.height, texture16.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0); + if (texture16.generateMipMaps) { + this._generateMipmaps(texture16, this._uploadEncoder); } - this.updateRawCubeTexture(texture16, allFaces, format, type, invertY); } texture16.isReady = true; - scene20 === null || scene20 === undefined || scene20.removePendingData(texture16); - if (onLoad) { - onLoad(); + }; + WebGPUEngine.prototype.createRawCubeTexture = function(data, size, format, type, generateMipMaps, invertY, samplingMode, compression = null) { + const texture16 = new InternalTexture(this, InternalTextureSource.CubeRaw); + if (type === 1 && !this._caps.textureFloatLinearFiltering) { + generateMipMaps = false; + samplingMode = 1; + Logger.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."); + } else if (type === 2 && !this._caps.textureHalfFloatLinearFiltering) { + generateMipMaps = false; + samplingMode = 1; + Logger.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."); + } else if (type === 1 && !this._caps.textureFloatRender) { + generateMipMaps = false; + Logger.Warn("Render to float textures is not supported. Mipmap generation forced to false."); + } else if (type === 2 && !this._caps.colorBufferFloat) { + generateMipMaps = false; + Logger.Warn("Render to half float textures is not supported. Mipmap generation forced to false."); + } + texture16.isCube = true; + texture16.format = format === 4 ? 5 : format; + texture16.type = type; + texture16.generateMipMaps = generateMipMaps; + texture16.width = size; + texture16.height = size; + texture16.samplingMode = samplingMode; + if (!this._doNotHandleContextLost) { + texture16._bufferViewArray = data; + } + texture16.invertY = invertY; + texture16._compression = compression; + texture16._cachedWrapU = 0; + texture16._cachedWrapV = 0; + this._textureHelper.createGPUTextureForInternalTexture(texture16); + if (data) { + this.updateRawCubeTexture(texture16, data, format, type, invertY, compression); } + texture16.isReady = true; + return texture16; }; - this._loadFile(url, (data) => { - internalCallback(data); - }, undefined, scene20 === null || scene20 === undefined ? undefined : scene20.offlineProvider, true, onerror); - return texture16; -}; -WebGPUEngine.prototype.createRawTexture3D = function(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression = null, textureType = 0, creationFlags = 0) { - const source = InternalTextureSource.Raw3D; - const texture16 = new InternalTexture(this, source); - texture16.baseWidth = width; - texture16.baseHeight = height; - texture16.baseDepth = depth; - texture16.width = width; - texture16.height = height; - texture16.depth = depth; - texture16.format = format; - texture16.type = textureType; - texture16.generateMipMaps = generateMipMaps; - texture16.samplingMode = samplingMode; - texture16.is3D = true; - if (!this._doNotHandleContextLost) { - texture16._bufferView = data; - } - this._textureHelper.createGPUTextureForInternalTexture(texture16, width, height, undefined, creationFlags); - this.updateRawTexture3D(texture16, data, format, invertY, compression, textureType); - this._internalTexturesCache.push(texture16); - return texture16; -}; -WebGPUEngine.prototype.updateRawTexture3D = function(texture16, bufferView, format, invertY, compression = null, textureType = 0) { - if (!this._doNotHandleContextLost) { - texture16._bufferView = bufferView; - texture16.format = format; + WebGPUEngine.prototype.updateRawCubeTexture = function(texture16, bufferView, format, type, invertY, compression = null) { + texture16._bufferViewArray = bufferView; texture16.invertY = invertY; texture16._compression = compression; - } - if (bufferView) { const gpuTextureWrapper = texture16._hardwareTexture; const needConversion = format === 4; - if (needConversion) { - bufferView = _convertRGBtoRGBATextureData2(bufferView, texture16.width, texture16.height, textureType); + const data = []; + for (let i = 0;i < bufferView.length; ++i) { + let faceData = bufferView[i]; + if (needConversion) { + faceData = _convertRGBtoRGBATextureData2(bufferView[i], texture16.width, texture16.height, type); + } + data.push(new Uint8Array(faceData.buffer, faceData.byteOffset, faceData.byteLength)); } - const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength); - this._textureHelper.updateTexture(data, texture16, texture16.width, texture16.height, texture16.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0); + this._textureHelper.updateCubeTextures(data, gpuTextureWrapper.underlyingResource, texture16.width, texture16.height, gpuTextureWrapper.format, invertY, false, 0, 0); if (texture16.generateMipMaps) { this._generateMipmaps(texture16, this._uploadEncoder); } - } - texture16.isReady = true; -}; -WebGPUEngine.prototype.createRawTexture2DArray = function(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression = null, textureType = 0, creationFlags = 0) { - const source = InternalTextureSource.Raw2DArray; - const texture16 = new InternalTexture(this, source); - texture16.baseWidth = width; - texture16.baseHeight = height; - texture16.baseDepth = depth; - texture16.width = width; - texture16.height = height; - texture16.depth = depth; - texture16.format = format; - texture16.type = textureType; - texture16.generateMipMaps = generateMipMaps; - texture16.samplingMode = samplingMode; - texture16.is2DArray = true; - if (!this._doNotHandleContextLost) { - texture16._bufferView = data; - } - this._textureHelper.createGPUTextureForInternalTexture(texture16, width, height, depth, creationFlags); - this.updateRawTexture2DArray(texture16, data, format, invertY, compression, textureType); - this._internalTexturesCache.push(texture16); - return texture16; -}; -WebGPUEngine.prototype.updateRawTexture2DArray = function(texture16, bufferView, format, invertY, compression = null, textureType = 0) { - if (!this._doNotHandleContextLost) { - texture16._bufferView = bufferView; + texture16.isReady = true; + }; + WebGPUEngine.prototype.createRawCubeTextureFromUrl = function(url, scene20, size, format, type, noMipmap, callback, mipmapGenerator, onLoad = null, onError = null, samplingMode = 3, invertY = false) { + const texture16 = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode, null); + scene20 === null || scene20 === undefined || scene20.addPendingData(texture16); + texture16.url = url; + this._internalTexturesCache.push(texture16); + const onerror = (request, exception) => { + scene20 === null || scene20 === undefined || scene20.removePendingData(texture16); + if (onError && request) { + onError(request.status + " " + request.statusText, exception); + } + }; + const internalCallback = (data) => { + const width = texture16.width; + const faceDataArrays = callback(data); + if (!faceDataArrays) { + return; + } + const faces = [0, 2, 4, 1, 3, 5]; + if (mipmapGenerator) { + const needConversion = format === 4; + const mipData = mipmapGenerator(faceDataArrays); + const gpuTextureWrapper = texture16._hardwareTexture; + const faces2 = [0, 1, 2, 3, 4, 5]; + for (let level = 0;level < mipData.length; level++) { + const mipSize = width >> level; + const allFaces = []; + for (let faceIndex = 0;faceIndex < 6; faceIndex++) { + let mipFaceData = mipData[level][faces2[faceIndex]]; + if (needConversion) { + mipFaceData = _convertRGBtoRGBATextureData2(mipFaceData, mipSize, mipSize, type); + } + allFaces.push(new Uint8Array(mipFaceData.buffer, mipFaceData.byteOffset, mipFaceData.byteLength)); + } + this._textureHelper.updateCubeTextures(allFaces, gpuTextureWrapper.underlyingResource, mipSize, mipSize, gpuTextureWrapper.format, invertY, false, 0, 0); + } + } else { + const allFaces = []; + for (let faceIndex = 0;faceIndex < 6; faceIndex++) { + allFaces.push(faceDataArrays[faces[faceIndex]]); + } + this.updateRawCubeTexture(texture16, allFaces, format, type, invertY); + } + texture16.isReady = true; + scene20 === null || scene20 === undefined || scene20.removePendingData(texture16); + if (onLoad) { + onLoad(); + } + }; + this._loadFile(url, (data) => { + internalCallback(data); + }, undefined, scene20 === null || scene20 === undefined ? undefined : scene20.offlineProvider, true, onerror); + return texture16; + }; + WebGPUEngine.prototype.createRawTexture3D = function(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression = null, textureType = 0, creationFlags = 0) { + const source = InternalTextureSource.Raw3D; + const texture16 = new InternalTexture(this, source); + texture16.baseWidth = width; + texture16.baseHeight = height; + texture16.baseDepth = depth; + texture16.width = width; + texture16.height = height; + texture16.depth = depth; texture16.format = format; - texture16.invertY = invertY; - texture16._compression = compression; - } - if (bufferView) { - const gpuTextureWrapper = texture16._hardwareTexture; - const needConversion = format === 4; - if (needConversion) { - bufferView = _convertRGBtoRGBATextureData2(bufferView, texture16.width, texture16.height, textureType); + texture16.type = textureType; + texture16.generateMipMaps = generateMipMaps; + texture16.samplingMode = samplingMode; + texture16.is3D = true; + if (!this._doNotHandleContextLost) { + texture16._bufferView = data; } - const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength); - this._textureHelper.updateTexture(data, texture16, texture16.width, texture16.height, texture16.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0); - if (texture16.generateMipMaps) { - this._generateMipmaps(texture16, this._uploadEncoder); + this._textureHelper.createGPUTextureForInternalTexture(texture16, width, height, undefined, creationFlags); + this.updateRawTexture3D(texture16, data, format, invertY, compression, textureType); + this._internalTexturesCache.push(texture16); + return texture16; + }; + WebGPUEngine.prototype.updateRawTexture3D = function(texture16, bufferView, format, invertY, compression = null, textureType = 0) { + if (!this._doNotHandleContextLost) { + texture16._bufferView = bufferView; + texture16.format = format; + texture16.invertY = invertY; + texture16._compression = compression; } - } - texture16.isReady = true; -}; + if (bufferView) { + const gpuTextureWrapper = texture16._hardwareTexture; + const needConversion = format === 4; + if (needConversion) { + bufferView = _convertRGBtoRGBATextureData2(bufferView, texture16.width, texture16.height, textureType); + } + const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength); + this._textureHelper.updateTexture(data, texture16, texture16.width, texture16.height, texture16.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0); + if (texture16.generateMipMaps) { + this._generateMipmaps(texture16, this._uploadEncoder); + } + } + texture16.isReady = true; + }; + WebGPUEngine.prototype.createRawTexture2DArray = function(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression = null, textureType = 0, creationFlags = 0) { + const source = InternalTextureSource.Raw2DArray; + const texture16 = new InternalTexture(this, source); + texture16.baseWidth = width; + texture16.baseHeight = height; + texture16.baseDepth = depth; + texture16.width = width; + texture16.height = height; + texture16.depth = depth; + texture16.format = format; + texture16.type = textureType; + texture16.generateMipMaps = generateMipMaps; + texture16.samplingMode = samplingMode; + texture16.is2DArray = true; + if (!this._doNotHandleContextLost) { + texture16._bufferView = data; + } + this._textureHelper.createGPUTextureForInternalTexture(texture16, width, height, depth, creationFlags); + this.updateRawTexture2DArray(texture16, data, format, invertY, compression, textureType); + this._internalTexturesCache.push(texture16); + return texture16; + }; + WebGPUEngine.prototype.updateRawTexture2DArray = function(texture16, bufferView, format, invertY, compression = null, textureType = 0) { + if (!this._doNotHandleContextLost) { + texture16._bufferView = bufferView; + texture16.format = format; + texture16.invertY = invertY; + texture16._compression = compression; + } + if (bufferView) { + const gpuTextureWrapper = texture16._hardwareTexture; + const needConversion = format === 4; + if (needConversion) { + bufferView = _convertRGBtoRGBATextureData2(bufferView, texture16.width, texture16.height, textureType); + } + const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength); + this._textureHelper.updateTexture(data, texture16, texture16.width, texture16.height, texture16.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0); + if (texture16.generateMipMaps) { + this._generateMipmaps(texture16, this._uploadEncoder); + } + } + texture16.isReady = true; + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.readTexture.js -WebGPUEngine.prototype._readTexturePixels = function(texture16, width, height, faceIndex = -1, level = 0, buffer30 = null, flushRenderer = true, noDataConversion = false, x = 0, y = 0) { - const gpuTextureWrapper = texture16._hardwareTexture; - if (flushRenderer) { - this.flushFramebuffer(); - } - return this._textureHelper.readPixels(gpuTextureWrapper.underlyingResource, x, y, width, height, gpuTextureWrapper.format, faceIndex, level, buffer30, noDataConversion); -}; -WebGPUEngine.prototype._readTexturePixelsSync = function() { - throw "_readTexturePixelsSync is unsupported in WebGPU!"; -}; +var init_engine_readTexture2 = __esm(() => { + init_webgpuEngine(); + WebGPUEngine.prototype._readTexturePixels = function(texture16, width, height, faceIndex = -1, level = 0, buffer30 = null, flushRenderer = true, noDataConversion = false, x = 0, y = 0) { + const gpuTextureWrapper = texture16._hardwareTexture; + if (flushRenderer) { + this.flushFramebuffer(); + } + return this._textureHelper.readPixels(gpuTextureWrapper.underlyingResource, x, y, width, height, gpuTextureWrapper.format, faceIndex, level, buffer30, noDataConversion); + }; + WebGPUEngine.prototype._readTexturePixelsSync = function() { + throw "_readTexturePixelsSync is unsupported in WebGPU!"; + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/webgpuRenderTargetWrapper.js class WebGPURenderTargetWrapper extends RenderTargetWrapper { } +var init_webgpuRenderTargetWrapper = __esm(() => { + init_renderTargetWrapper(); +}); // node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.renderTarget.js -WebGPUEngine.prototype._createHardwareRenderTargetWrapper = function(isMulti, isCube, size) { - const rtWrapper = new WebGPURenderTargetWrapper(isMulti, isCube, size, this); - this._renderTargetWrapperCache.push(rtWrapper); - return rtWrapper; -}; -WebGPUEngine.prototype.createRenderTargetTexture = function(size, options) { - var _a, _b, _c; - const rtWrapper = this._createHardwareRenderTargetWrapper(false, false, size); - const fullOptions = {}; - if (options !== undefined && typeof options === "object") { - fullOptions.generateMipMaps = options.generateMipMaps; - fullOptions.generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer; - fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer; - fullOptions.samplingMode = options.samplingMode === undefined ? 3 : options.samplingMode; - fullOptions.creationFlags = (_a = options.creationFlags) !== null && _a !== undefined ? _a : 0; - fullOptions.noColorAttachment = !!options.noColorAttachment; - fullOptions.samples = options.samples; - fullOptions.label = options.label; - } else { - fullOptions.generateMipMaps = options; - fullOptions.generateDepthBuffer = true; - fullOptions.generateStencilBuffer = false; - fullOptions.samplingMode = 3; - fullOptions.creationFlags = 0; - fullOptions.noColorAttachment = false; - } - const texture16 = fullOptions.noColorAttachment ? null : this._createInternalTexture(size, options, true, InternalTextureSource.RenderTarget); - rtWrapper.label = (_b = fullOptions.label) !== null && _b !== undefined ? _b : "RenderTargetWrapper"; - rtWrapper._samples = (_c = fullOptions.samples) !== null && _c !== undefined ? _c : 1; - rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer; - rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer ? true : false; - rtWrapper.setTextures(texture16); - if (rtWrapper._generateDepthBuffer || rtWrapper._generateStencilBuffer) { - rtWrapper.createDepthStencilTexture(0, false, rtWrapper._generateStencilBuffer, rtWrapper.samples, fullOptions.generateStencilBuffer ? 13 : 14, fullOptions.label ? fullOptions.label + "-DepthStencil" : undefined); - } - if (texture16) { - if (options !== undefined && typeof options === "object" && options.createMipMaps && !fullOptions.generateMipMaps) { - texture16.generateMipMaps = true; +var init_engine_renderTarget2 = __esm(() => { + init_internalTexture(); + init_webgpuEngine(); + init_webgpuRenderTargetWrapper(); + init_webgpuTextureHelper(); + WebGPUEngine.prototype._createHardwareRenderTargetWrapper = function(isMulti, isCube, size) { + const rtWrapper = new WebGPURenderTargetWrapper(isMulti, isCube, size, this); + this._renderTargetWrapperCache.push(rtWrapper); + return rtWrapper; + }; + WebGPUEngine.prototype.createRenderTargetTexture = function(size, options) { + var _a, _b, _c; + const rtWrapper = this._createHardwareRenderTargetWrapper(false, false, size); + const fullOptions = {}; + if (options !== undefined && typeof options === "object") { + fullOptions.generateMipMaps = options.generateMipMaps; + fullOptions.generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer; + fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer; + fullOptions.samplingMode = options.samplingMode === undefined ? 3 : options.samplingMode; + fullOptions.creationFlags = (_a = options.creationFlags) !== null && _a !== undefined ? _a : 0; + fullOptions.noColorAttachment = !!options.noColorAttachment; + fullOptions.samples = options.samples; + fullOptions.label = options.label; + } else { + fullOptions.generateMipMaps = options; + fullOptions.generateDepthBuffer = true; + fullOptions.generateStencilBuffer = false; + fullOptions.samplingMode = 3; + fullOptions.creationFlags = 0; + fullOptions.noColorAttachment = false; } - this._textureHelper.createGPUTextureForInternalTexture(texture16, undefined, undefined, undefined, fullOptions.creationFlags); - if (options !== undefined && typeof options === "object" && options.createMipMaps && !fullOptions.generateMipMaps) { - texture16.generateMipMaps = false; + const texture16 = fullOptions.noColorAttachment ? null : this._createInternalTexture(size, options, true, InternalTextureSource.RenderTarget); + rtWrapper.label = (_b = fullOptions.label) !== null && _b !== undefined ? _b : "RenderTargetWrapper"; + rtWrapper._samples = (_c = fullOptions.samples) !== null && _c !== undefined ? _c : 1; + rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer; + rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer ? true : false; + rtWrapper.setTextures(texture16); + if (rtWrapper._generateDepthBuffer || rtWrapper._generateStencilBuffer) { + rtWrapper.createDepthStencilTexture(0, false, rtWrapper._generateStencilBuffer, rtWrapper.samples, fullOptions.generateStencilBuffer ? 13 : 14, fullOptions.label ? fullOptions.label + "-DepthStencil" : undefined); } - } - return rtWrapper; -}; -WebGPUEngine.prototype._createDepthStencilTexture = function(size, options) { - const internalTexture22 = new InternalTexture(this, InternalTextureSource.DepthStencil); - internalTexture22.label = options.label; - const internalOptions = Object.assign({ bilinearFiltering: false, comparisonFunction: 0, generateStencil: false, samples: 1, depthTextureFormat: options.generateStencil ? 13 : 14 }, options); - internalTexture22.format = internalOptions.depthTextureFormat; - this._setupDepthStencilTexture(internalTexture22, size, internalOptions.generateStencil, internalOptions.bilinearFiltering, internalOptions.comparisonFunction, internalOptions.samples); - this._textureHelper.createGPUTextureForInternalTexture(internalTexture22); - const gpuTextureWrapper = internalTexture22._hardwareTexture; - internalTexture22.type = WebGPUTextureHelper.GetTextureTypeFromFormat(gpuTextureWrapper.format); - this._internalTexturesCache.push(internalTexture22); - return internalTexture22; -}; -WebGPUEngine.prototype._setupDepthStencilTexture = function(internalTexture22, size, generateStencil, bilinearFiltering, comparisonFunction, samples = 1) { - const width = size.width || size; - const height = size.height || size; - const layers = size.layers || 0; - internalTexture22.baseWidth = width; - internalTexture22.baseHeight = height; - internalTexture22.width = width; - internalTexture22.height = height; - internalTexture22.is2DArray = layers > 0; - internalTexture22.depth = layers; - internalTexture22.isReady = true; - internalTexture22.samples = samples; - internalTexture22.generateMipMaps = false; - internalTexture22.samplingMode = bilinearFiltering ? 2 : 1; - internalTexture22.type = 1; - internalTexture22._comparisonFunction = comparisonFunction; - internalTexture22._cachedWrapU = 0; - internalTexture22._cachedWrapV = 0; -}; -WebGPUEngine.prototype.updateRenderTargetTextureSampleCount = function(rtWrapper, samples) { - if (!rtWrapper || !rtWrapper.texture || rtWrapper.samples === samples) { + if (texture16) { + if (options !== undefined && typeof options === "object" && options.createMipMaps && !fullOptions.generateMipMaps) { + texture16.generateMipMaps = true; + } + this._textureHelper.createGPUTextureForInternalTexture(texture16, undefined, undefined, undefined, fullOptions.creationFlags); + if (options !== undefined && typeof options === "object" && options.createMipMaps && !fullOptions.generateMipMaps) { + texture16.generateMipMaps = false; + } + } + return rtWrapper; + }; + WebGPUEngine.prototype._createDepthStencilTexture = function(size, options) { + const internalTexture22 = new InternalTexture(this, InternalTextureSource.DepthStencil); + internalTexture22.label = options.label; + const internalOptions = Object.assign({ bilinearFiltering: false, comparisonFunction: 0, generateStencil: false, samples: 1, depthTextureFormat: options.generateStencil ? 13 : 14 }, options); + internalTexture22.format = internalOptions.depthTextureFormat; + this._setupDepthStencilTexture(internalTexture22, size, internalOptions.generateStencil, internalOptions.bilinearFiltering, internalOptions.comparisonFunction, internalOptions.samples); + this._textureHelper.createGPUTextureForInternalTexture(internalTexture22); + const gpuTextureWrapper = internalTexture22._hardwareTexture; + internalTexture22.type = WebGPUTextureHelper.GetTextureTypeFromFormat(gpuTextureWrapper.format); + this._internalTexturesCache.push(internalTexture22); + return internalTexture22; + }; + WebGPUEngine.prototype._setupDepthStencilTexture = function(internalTexture22, size, generateStencil, bilinearFiltering, comparisonFunction, samples = 1) { + const width = size.width || size; + const height = size.height || size; + const layers = size.layers || 0; + internalTexture22.baseWidth = width; + internalTexture22.baseHeight = height; + internalTexture22.width = width; + internalTexture22.height = height; + internalTexture22.is2DArray = layers > 0; + internalTexture22.depth = layers; + internalTexture22.isReady = true; + internalTexture22.samples = samples; + internalTexture22.generateMipMaps = false; + internalTexture22.samplingMode = bilinearFiltering ? 2 : 1; + internalTexture22.type = 1; + internalTexture22._comparisonFunction = comparisonFunction; + internalTexture22._cachedWrapU = 0; + internalTexture22._cachedWrapV = 0; + }; + WebGPUEngine.prototype.updateRenderTargetTextureSampleCount = function(rtWrapper, samples) { + if (!rtWrapper || !rtWrapper.texture || rtWrapper.samples === samples) { + return samples; + } + samples = Math.min(samples, this.getCaps().maxMSAASamples); + this._textureHelper.createMSAATexture(rtWrapper.texture, samples); + if (rtWrapper._depthStencilTexture) { + this._textureHelper.createMSAATexture(rtWrapper._depthStencilTexture, samples); + rtWrapper._depthStencilTexture.samples = samples; + } + rtWrapper._samples = samples; + rtWrapper.texture.samples = samples; return samples; - } - samples = Math.min(samples, this.getCaps().maxMSAASamples); - this._textureHelper.createMSAATexture(rtWrapper.texture, samples); - if (rtWrapper._depthStencilTexture) { - this._textureHelper.createMSAATexture(rtWrapper._depthStencilTexture, samples); - rtWrapper._depthStencilTexture.samples = samples; - } - rtWrapper._samples = samples; - rtWrapper.texture.samples = samples; - return samples; -}; + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.renderTargetCube.js -WebGPUEngine.prototype.createRenderTargetCubeTexture = function(size, options) { - var _a; - const rtWrapper = this._createHardwareRenderTargetWrapper(false, true, size); - const fullOptions = Object.assign({ generateMipMaps: true, generateDepthBuffer: true, generateStencilBuffer: false, type: 0, samplingMode: 3, format: 5, samples: 1 }, options); - fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer; - rtWrapper.label = (_a = fullOptions.label) !== null && _a !== undefined ? _a : "RenderTargetWrapper"; - rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer; - rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer; - const texture16 = new InternalTexture(this, InternalTextureSource.RenderTarget); - texture16.width = size; - texture16.height = size; - texture16.depth = 0; - texture16.isReady = true; - texture16.isCube = true; - texture16.samples = fullOptions.samples; - texture16.generateMipMaps = fullOptions.generateMipMaps; - texture16.samplingMode = fullOptions.samplingMode; - texture16.type = fullOptions.type; - texture16.format = fullOptions.format; - this._internalTexturesCache.push(texture16); - rtWrapper.setTextures(texture16); - if (rtWrapper._generateDepthBuffer || rtWrapper._generateStencilBuffer) { - rtWrapper.createDepthStencilTexture(0, fullOptions.samplingMode === undefined || fullOptions.samplingMode === 2 || fullOptions.samplingMode === 2 || fullOptions.samplingMode === 3 || fullOptions.samplingMode === 3 || fullOptions.samplingMode === 5 || fullOptions.samplingMode === 6 || fullOptions.samplingMode === 7 || fullOptions.samplingMode === 11, rtWrapper._generateStencilBuffer, rtWrapper.samples); - } - if (options && options.createMipMaps && !fullOptions.generateMipMaps) { - texture16.generateMipMaps = true; - } - this._textureHelper.createGPUTextureForInternalTexture(texture16); - if (options && options.createMipMaps && !fullOptions.generateMipMaps) { - texture16.generateMipMaps = false; - } - return rtWrapper; -}; +var init_engine_renderTargetCube2 = __esm(() => { + init_internalTexture(); + init_webgpuEngine(); + WebGPUEngine.prototype.createRenderTargetCubeTexture = function(size, options) { + var _a; + const rtWrapper = this._createHardwareRenderTargetWrapper(false, true, size); + const fullOptions = Object.assign({ generateMipMaps: true, generateDepthBuffer: true, generateStencilBuffer: false, type: 0, samplingMode: 3, format: 5, samples: 1 }, options); + fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer; + rtWrapper.label = (_a = fullOptions.label) !== null && _a !== undefined ? _a : "RenderTargetWrapper"; + rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer; + rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer; + const texture16 = new InternalTexture(this, InternalTextureSource.RenderTarget); + texture16.width = size; + texture16.height = size; + texture16.depth = 0; + texture16.isReady = true; + texture16.isCube = true; + texture16.samples = fullOptions.samples; + texture16.generateMipMaps = fullOptions.generateMipMaps; + texture16.samplingMode = fullOptions.samplingMode; + texture16.type = fullOptions.type; + texture16.format = fullOptions.format; + this._internalTexturesCache.push(texture16); + rtWrapper.setTextures(texture16); + if (rtWrapper._generateDepthBuffer || rtWrapper._generateStencilBuffer) { + rtWrapper.createDepthStencilTexture(0, fullOptions.samplingMode === undefined || fullOptions.samplingMode === 2 || fullOptions.samplingMode === 2 || fullOptions.samplingMode === 3 || fullOptions.samplingMode === 3 || fullOptions.samplingMode === 5 || fullOptions.samplingMode === 6 || fullOptions.samplingMode === 7 || fullOptions.samplingMode === 11, rtWrapper._generateStencilBuffer, rtWrapper.samples); + } + if (options && options.createMipMaps && !fullOptions.generateMipMaps) { + texture16.generateMipMaps = true; + } + this._textureHelper.createGPUTextureForInternalTexture(texture16); + if (options && options.createMipMaps && !fullOptions.generateMipMaps) { + texture16.generateMipMaps = false; + } + return rtWrapper; + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.textureSampler.js -Effect.prototype.setTextureSampler = function(name95, sampler) { - this._engine.setTextureSampler(name95, sampler); -}; -WebGPUEngine.prototype.setTextureSampler = function(name95, sampler) { - var _a; - (_a = this._currentMaterialContext) === null || _a === undefined || _a.setSampler(name95, sampler); -}; +var init_engine_textureSampler2 = __esm(() => { + init_webgpuEngine(); + init_effect(); + Effect.prototype.setTextureSampler = function(name96, sampler) { + this._engine.setTextureSampler(name96, sampler); + }; + WebGPUEngine.prototype.setTextureSampler = function(name96, sampler) { + var _a; + (_a = this._currentMaterialContext) === null || _a === undefined || _a.setSampler(name96, sampler); + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.storageBuffer.js -Effect.prototype.setStorageBuffer = function(name95, buffer30) { - this._engine.setStorageBuffer(name95, buffer30); -}; -WebGPUEngine.prototype.createStorageBuffer = function(data, creationFlags, label) { - return this._createBuffer(data, creationFlags | 32, label); -}; -WebGPUEngine.prototype.updateStorageBuffer = function(buffer30, data, byteOffset, byteLength) { - const dataBuffer7 = buffer30; - if (byteOffset === undefined) { - byteOffset = 0; - } - let view; - if (byteLength === undefined) { - if (data instanceof Array) { - view = new Float32Array(data); - } else if (data instanceof ArrayBuffer) { - view = new Uint8Array(data); - } else { - view = data; +var init_engine_storageBuffer2 = __esm(() => { + init_webgpuEngine(); + init_webgpuConstants(); + init_effect(); + Effect.prototype.setStorageBuffer = function(name96, buffer30) { + this._engine.setStorageBuffer(name96, buffer30); + }; + WebGPUEngine.prototype.createStorageBuffer = function(data, creationFlags, label) { + return this._createBuffer(data, creationFlags | 32, label); + }; + WebGPUEngine.prototype.updateStorageBuffer = function(buffer30, data, byteOffset, byteLength) { + const dataBuffer7 = buffer30; + if (byteOffset === undefined) { + byteOffset = 0; } - byteLength = view.byteLength; - } else { - if (data instanceof Array) { - view = new Float32Array(data); - } else if (data instanceof ArrayBuffer) { - view = new Uint8Array(data); + let view; + if (byteLength === undefined) { + if (data instanceof Array) { + view = new Float32Array(data); + } else if (data instanceof ArrayBuffer) { + view = new Uint8Array(data); + } else { + view = data; + } + byteLength = view.byteLength; } else { - view = data; + if (data instanceof Array) { + view = new Float32Array(data); + } else if (data instanceof ArrayBuffer) { + view = new Uint8Array(data); + } else { + view = data; + } } - } - this._bufferManager.setSubData(dataBuffer7, byteOffset, view, 0, byteLength); -}; -WebGPUEngine.prototype.readFromStorageBuffer = function(storageBuffer2, offset, size, buffer30, noDelay) { - size = size || storageBuffer2.capacity; - const gpuBuffer = this._bufferManager.createRawBuffer(size, BufferUsage.MapRead | BufferUsage.CopyDst, undefined, "TempReadFromStorageBuffer"); - this._renderEncoder.copyBufferToBuffer(storageBuffer2.underlyingResource, offset !== null && offset !== undefined ? offset : 0, gpuBuffer, 0, size); - return new Promise((resolve, reject) => { - const readFromBuffer = () => { - gpuBuffer.mapAsync(MapMode.Read, 0, size).then(() => { - const copyArrayBuffer = gpuBuffer.getMappedRange(0, size); - let data = buffer30; - if (data === undefined) { - data = new Uint8Array(size); - data.set(new Uint8Array(copyArrayBuffer)); - } else { - const ctor = data.constructor; - data = new ctor(data.buffer); - data.set(new ctor(copyArrayBuffer)); - } - gpuBuffer.unmap(); - this._bufferManager.releaseBuffer(gpuBuffer); - resolve(data); - }, (reason) => reject(reason)); - }; - if (noDelay) { - this.flushFramebuffer(); - readFromBuffer(); - } else { - this.onEndFrameObservable.addOnce(() => { + this._bufferManager.setSubData(dataBuffer7, byteOffset, view, 0, byteLength); + }; + WebGPUEngine.prototype.readFromStorageBuffer = function(storageBuffer2, offset, size, buffer30, noDelay) { + size = size || storageBuffer2.capacity; + const gpuBuffer = this._bufferManager.createRawBuffer(size, BufferUsage.MapRead | BufferUsage.CopyDst, undefined, "TempReadFromStorageBuffer"); + this._renderEncoder.copyBufferToBuffer(storageBuffer2.underlyingResource, offset !== null && offset !== undefined ? offset : 0, gpuBuffer, 0, size); + return new Promise((resolve, reject) => { + const readFromBuffer = () => { + gpuBuffer.mapAsync(MapMode.Read, 0, size).then(() => { + const copyArrayBuffer = gpuBuffer.getMappedRange(0, size); + let data = buffer30; + if (data === undefined) { + data = new Uint8Array(size); + data.set(new Uint8Array(copyArrayBuffer)); + } else { + const ctor = data.constructor; + data = new ctor(data.buffer); + data.set(new ctor(copyArrayBuffer)); + } + gpuBuffer.unmap(); + this._bufferManager.releaseBuffer(gpuBuffer); + resolve(data); + }, (reason) => reject(reason)); + }; + if (noDelay) { + this.flushFramebuffer(); readFromBuffer(); - }); - } - }); -}; -WebGPUEngine.prototype.setStorageBuffer = function(name95, buffer30) { - var _a, _b; - (_a = this._currentDrawContext) === null || _a === undefined || _a.setBuffer(name95, (_b = buffer30 === null || buffer30 === undefined ? undefined : buffer30.getBuffer()) !== null && _b !== undefined ? _b : null); -}; + } else { + this.onEndFrameObservable.addOnce(() => { + readFromBuffer(); + }); + } + }); + }; + WebGPUEngine.prototype.setStorageBuffer = function(name96, buffer30) { + var _a, _b; + (_a = this._currentDrawContext) === null || _a === undefined || _a.setBuffer(name96, (_b = buffer30 === null || buffer30 === undefined ? undefined : buffer30.getBuffer()) !== null && _b !== undefined ? _b : null); + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.uniformBuffer.js -WebGPUEngine.prototype.createUniformBuffer = function(elements, label) { - let view; - if (elements instanceof Array) { - view = new Float32Array(elements); - } else { - view = elements; - } - const dataBuffer7 = this._bufferManager.createBuffer(view, BufferUsage.Uniform | BufferUsage.CopyDst, label); - return dataBuffer7; -}; -WebGPUEngine.prototype.createDynamicUniformBuffer = function(elements, label) { - return this.createUniformBuffer(elements, label); -}; -WebGPUEngine.prototype.updateUniformBuffer = function(uniformBuffer8, elements, offset, count) { - if (offset === undefined) { - offset = 0; - } - const dataBuffer7 = uniformBuffer8; - let view; - if (count === undefined) { - if (elements instanceof Float32Array) { - view = elements; - } else { +var init_engine_uniformBuffer2 = __esm(() => { + init_webgpuEngine(); + init_webgpuConstants(); + WebGPUEngine.prototype.createUniformBuffer = function(elements, label) { + let view; + if (elements instanceof Array) { view = new Float32Array(elements); - } - count = view.byteLength; - } else { - if (elements instanceof Float32Array) { + } else { view = elements; + } + const dataBuffer7 = this._bufferManager.createBuffer(view, BufferUsage.Uniform | BufferUsage.CopyDst, label); + return dataBuffer7; + }; + WebGPUEngine.prototype.createDynamicUniformBuffer = function(elements, label) { + return this.createUniformBuffer(elements, label); + }; + WebGPUEngine.prototype.updateUniformBuffer = function(uniformBuffer8, elements, offset, count) { + if (offset === undefined) { + offset = 0; + } + const dataBuffer7 = uniformBuffer8; + let view; + if (count === undefined) { + if (elements instanceof Float32Array) { + view = elements; + } else { + view = new Float32Array(elements); + } + count = view.byteLength; } else { - view = new Float32Array(elements); + if (elements instanceof Float32Array) { + view = elements; + } else { + view = new Float32Array(elements); + } } - } - this._bufferManager.setSubData(dataBuffer7, offset, view, 0, count); -}; -WebGPUEngine.prototype.bindUniformBufferBase = function(buffer30, _location, name95) { - this._currentDrawContext.setBuffer(name95, buffer30); -}; -WebGPUEngine.prototype.bindUniformBlock = function() { -}; + this._bufferManager.setSubData(dataBuffer7, offset, view, 0, count); + }; + WebGPUEngine.prototype.bindUniformBufferBase = function(buffer30, _location, name96) { + this._currentDrawContext.setBuffer(name96, buffer30); + }; + WebGPUEngine.prototype.bindUniformBlock = function() { + }; +}); // node_modules/@babylonjs/core/Engines/WebGPU/Extensions/engine.videoTexture.js -var IsExternalTexture = function(texture16) { - return texture16 && texture16.underlyingResource !== undefined ? true : false; -}; -WebGPUEngine.prototype.updateVideoTexture = function(texture16, video, invertY) { - var _a; - if (!texture16 || texture16._isDisabled) { - return; - } - if (this._videoTextureSupported === undefined) { - this._videoTextureSupported = true; - } - let gpuTextureWrapper = texture16._hardwareTexture; - if (!((_a = texture16._hardwareTexture) === null || _a === undefined ? undefined : _a.underlyingResource)) { - gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture16); - } - if (IsExternalTexture(video)) { - this._textureHelper.copyVideoToTexture(video, texture16, gpuTextureWrapper.format, !invertY); - if (texture16.generateMipMaps) { - this._generateMipmaps(texture16); +var IsExternalTexture; +var init_engine_videoTexture2 = __esm(() => { + init_webgpuEngine(); + IsExternalTexture = function(texture16) { + return texture16 && texture16.underlyingResource !== undefined ? true : false; + }; + WebGPUEngine.prototype.updateVideoTexture = function(texture16, video, invertY) { + var _a; + if (!texture16 || texture16._isDisabled) { + return; } - texture16.isReady = true; - } else if (video) { - this.createImageBitmap(video).then((bitmap) => { - this._textureHelper.updateTexture(bitmap, texture16, texture16.width, texture16.height, texture16.depth, gpuTextureWrapper.format, 0, 0, !invertY, false, 0, 0); + if (this._videoTextureSupported === undefined) { + this._videoTextureSupported = true; + } + let gpuTextureWrapper = texture16._hardwareTexture; + if (!((_a = texture16._hardwareTexture) === null || _a === undefined ? undefined : _a.underlyingResource)) { + gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture16); + } + if (IsExternalTexture(video)) { + this._textureHelper.copyVideoToTexture(video, texture16, gpuTextureWrapper.format, !invertY); if (texture16.generateMipMaps) { this._generateMipmaps(texture16); } texture16.isReady = true; - }).catch(() => { - texture16.isReady = true; - }); + } else if (video) { + this.createImageBitmap(video).then((bitmap) => { + this._textureHelper.updateTexture(bitmap, texture16, texture16.width, texture16.height, texture16.depth, gpuTextureWrapper.format, 0, 0, !invertY, false, 0, 0); + if (texture16.generateMipMaps) { + this._generateMipmaps(texture16); + } + texture16.isReady = true; + }).catch(() => { + texture16.isReady = true; + }); + } + }; +}); + +// node_modules/@babylonjs/core/Engines/WebGPU/Extensions/index.js +var init_Extensions2 = __esm(() => { + init_engine_alpha2(); + init_engine_computeShader2(); + init_engine_cubeTexture2(); + init_engine_debugging2(); + init_engine_dynamicBuffer2(); + init_engine_dynamicTexture2(); + init_engine_externalTexture2(); + init_engine_multiRender2(); + init_engine_query2(); + init_engine_rawTexture2(); + init_engine_readTexture2(); + init_engine_renderTarget2(); + init_engine_renderTargetCube2(); + init_engine_textureSampler2(); + init_engine_storageBuffer2(); + init_engine_uniformBuffer2(); + init_engine_videoTexture2(); +}); + +// node_modules/@babylonjs/core/Engines/IPipelineContext.js +var init_IPipelineContext = __esm(() => { +}); + +// node_modules/@babylonjs/core/Engines/ICanvas.js +var init_ICanvas = __esm(() => { +}); + +// node_modules/@babylonjs/core/Engines/engineFeatures.js +var init_engineFeatures = __esm(() => { +}); + +// node_modules/@babylonjs/core/Engines/engineFactory.js +class EngineFactory { + static async CreateAsync(canvas, options) { + const supported = await WebGPUEngine.IsSupportedAsync; + if (supported) { + return WebGPUEngine.CreateAsync(canvas, options); + } + if (Engine2.IsSupported) { + return new Engine2(canvas, undefined, options); + } + return new NullEngine(options); } -}; +} +var init_engineFactory = __esm(() => { + init_engine(); + init_nullEngine(); + init_webgpuEngine(); +}); + +// node_modules/@babylonjs/core/Engines/IMaterialContext.js +var init_IMaterialContext = __esm(() => { +}); + +// node_modules/@babylonjs/core/Engines/IDrawContext.js +var init_IDrawContext = __esm(() => { +}); + +// node_modules/@babylonjs/core/Engines/Processors/iShaderProcessor.js +var init_iShaderProcessor = __esm(() => { +}); + +// node_modules/@babylonjs/core/Engines/index.js +var init_Engines = __esm(() => { + init_constants(); + init_engineCapabilities(); + init_instancingAttributeInfo(); + init_thinEngine(); + init_engine(); + init_engineStore(); + init_nullEngine(); + init_Extensions(); + init_Native(); + init_Extensions2(); + init_IPipelineContext(); + init_ICanvas(); + init_webGLPipelineContext(); + init_webGLHardwareTexture(); + init_webgpuConstants(); + init_webgpuEngine(); + init_webgpuCacheRenderPipeline(); + init_webgpuCacheRenderPipelineTree(); + init_webgpuCacheBindGroups(); + init_webgpuCacheSampler(); + init_webgpuDrawContext(); + init_webgpuTintWASM(); + init_webGL2ShaderProcessors(); + init_nativeEngine(); + init_shaderCodeInliner(); + init_performanceConfigurator(); + init_engineFeatures(); + init_engineFactory(); + init_IMaterialContext(); + init_IDrawContext(); + init_shaderStore(); + init_renderTargetWrapper(); + init_iShaderProcessor(); +}); + // node_modules/@babylonjs/core/Events/clipboardEvents.js class ClipboardEventTypes { } -ClipboardEventTypes.COPY = 1; -ClipboardEventTypes.CUT = 2; -ClipboardEventTypes.PASTE = 3; class ClipboardInfo { constructor(type, event) { @@ -98423,6 +104895,29 @@ class ClipboardInfo { } } } +var init_clipboardEvents = __esm(() => { + ClipboardEventTypes.COPY = 1; + ClipboardEventTypes.CUT = 2; + ClipboardEventTypes.PASTE = 3; +}); + +// node_modules/@babylonjs/core/Events/index.js +var init_Events = __esm(() => { + init_keyboardEvents(); + init_pointerEvents(); + init_clipboardEvents(); + init_deviceInputEvents(); +}); + +// node_modules/@babylonjs/core/Gamepads/index.js +var init_Gamepads = __esm(() => { + init_gamepad(); + init_gamepadManager(); + init_gamepadSceneComponent(); + init_xboxGamepad(); + init_dualShockGamepad(); +}); + // node_modules/@babylonjs/core/Gizmos/axisScaleGizmo.js class AxisScaleGizmo extends Gizmo { get coloredMaterial() { @@ -98650,7 +105145,580 @@ class AxisScaleGizmo extends Gizmo { } } } -AxisScaleGizmo.MinimumAbsoluteScale = Epsilon; +var init_axisScaleGizmo = __esm(() => { + init_observable(); + init_math_vector(); + init_mesh(); + init_boxBuilder(); + init_cylinderBuilder(); + init_standardMaterial(); + init_pointerDragBehavior(); + init_gizmo(); + init_utilityLayerRenderer(); + init_math_color(); + init_math_constants(); + AxisScaleGizmo.MinimumAbsoluteScale = Epsilon; +}); + +// node_modules/@babylonjs/core/Gizmos/boundingBoxGizmo.js +class BoundingBoxGizmo extends Gizmo { + set axisFactor(factor) { + this._axisFactor = factor; + const scaleBoxes = this._scaleBoxesParent.getChildMeshes(); + let index = 0; + for (let i = 0;i < 3; i++) { + for (let j = 0;j < 3; j++) { + for (let k = 0;k < 3; k++) { + const zeroAxisCount = (i === 1 ? 1 : 0) + (j === 1 ? 1 : 0) + (k === 1 ? 1 : 0); + if (zeroAxisCount === 1 || zeroAxisCount === 3) { + continue; + } + if (scaleBoxes[index]) { + const dragAxis = new Vector3(i - 1, j - 1, k - 1); + dragAxis.multiplyInPlace(this._axisFactor); + scaleBoxes[index].setEnabled(dragAxis.lengthSquared() > Epsilon); + } + index++; + } + } + } + } + get axisFactor() { + return this._axisFactor; + } + set scaleDragSpeed(value) { + this._scaleDragSpeed = value; + } + get scaleDragSpeed() { + return this._scaleDragSpeed; + } + get coloredMaterial() { + return this._coloredMaterial; + } + get hoverMaterial() { + return this._hoverColoredMaterial; + } + get pointerDragBehavior() { + return this._pointerDragBehavior; + } + setColor(color) { + this._coloredMaterial.emissiveColor = color; + this._hoverColoredMaterial.emissiveColor = color.clone().add(new Color3(0.3, 0.3, 0.3)); + this._lineBoundingBox.getChildren().forEach((l) => { + if (l.color) { + l.color = color; + } + }); + } + constructor(color = Color3.Gray(), gizmoLayer = UtilityLayerRenderer.DefaultKeepDepthUtilityLayer) { + super(gizmoLayer); + this._boundingDimensions = new Vector3(1, 1, 1); + this._renderObserver = null; + this._pointerObserver = null; + this._scaleDragSpeed = 0.2; + this._tmpQuaternion = new Quaternion; + this._tmpVector = new Vector3(0, 0, 0); + this._tmpRotationMatrix = new Matrix; + this.ignoreChildren = false; + this.includeChildPredicate = null; + this.rotationSphereSize = 0.1; + this.scaleBoxSize = 0.1; + this.fixedDragMeshScreenSize = false; + this.fixedDragMeshBoundsSize = false; + this.fixedDragMeshScreenSizeDistanceFactor = 10; + this.scalingSnapDistance = 0; + this.rotationSnapDistance = 0; + this.onDragStartObservable = new Observable; + this.onScaleBoxDragObservable = new Observable; + this.onScaleBoxDragEndObservable = new Observable; + this.onRotationSphereDragObservable = new Observable; + this.onRotationSphereDragEndObservable = new Observable; + this.scalePivot = null; + this._axisFactor = new Vector3(1, 1, 1); + this._existingMeshScale = new Vector3; + this._dragMesh = null; + this._pointerDragBehavior = new PointerDragBehavior; + this.updateScale = false; + this._anchorMesh = new AbstractMesh("anchor", gizmoLayer.utilityLayerScene); + this._coloredMaterial = new StandardMaterial("", gizmoLayer.utilityLayerScene); + this._coloredMaterial.disableLighting = true; + this._hoverColoredMaterial = new StandardMaterial("", gizmoLayer.utilityLayerScene); + this._hoverColoredMaterial.disableLighting = true; + this._lineBoundingBox = new AbstractMesh("", gizmoLayer.utilityLayerScene); + this._lineBoundingBox.rotationQuaternion = new Quaternion; + const lines = []; + lines.push(CreateLines("lines", { points: [new Vector3(0, 0, 0), new Vector3(this._boundingDimensions.x, 0, 0)] }, gizmoLayer.utilityLayerScene)); + lines.push(CreateLines("lines", { points: [new Vector3(0, 0, 0), new Vector3(0, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene)); + lines.push(CreateLines("lines", { points: [new Vector3(0, 0, 0), new Vector3(0, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene)); + lines.push(CreateLines("lines", { points: [new Vector3(this._boundingDimensions.x, 0, 0), new Vector3(this._boundingDimensions.x, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene)); + lines.push(CreateLines("lines", { points: [new Vector3(this._boundingDimensions.x, 0, 0), new Vector3(this._boundingDimensions.x, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene)); + lines.push(CreateLines("lines", { points: [new Vector3(0, this._boundingDimensions.y, 0), new Vector3(this._boundingDimensions.x, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene)); + lines.push(CreateLines("lines", { points: [new Vector3(0, this._boundingDimensions.y, 0), new Vector3(0, this._boundingDimensions.y, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene)); + lines.push(CreateLines("lines", { points: [new Vector3(0, 0, this._boundingDimensions.z), new Vector3(this._boundingDimensions.x, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene)); + lines.push(CreateLines("lines", { points: [new Vector3(0, 0, this._boundingDimensions.z), new Vector3(0, this._boundingDimensions.y, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene)); + lines.push(CreateLines("lines", { + points: [ + new Vector3(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z), + new Vector3(0, this._boundingDimensions.y, this._boundingDimensions.z) + ] + }, gizmoLayer.utilityLayerScene)); + lines.push(CreateLines("lines", { + points: [ + new Vector3(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z), + new Vector3(this._boundingDimensions.x, 0, this._boundingDimensions.z) + ] + }, gizmoLayer.utilityLayerScene)); + lines.push(CreateLines("lines", { + points: [ + new Vector3(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z), + new Vector3(this._boundingDimensions.x, this._boundingDimensions.y, 0) + ] + }, gizmoLayer.utilityLayerScene)); + lines.forEach((l) => { + l.color = color; + l.position.addInPlace(new Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)); + l.isPickable = false; + this._lineBoundingBox.addChild(l); + }); + this._rootMesh.addChild(this._lineBoundingBox); + this.setColor(color); + this._rotateSpheresParent = new AbstractMesh("", gizmoLayer.utilityLayerScene); + this._rotateSpheresParent.rotationQuaternion = new Quaternion; + for (let i = 0;i < 12; i++) { + const sphere = CreateSphere("", { diameter: 1 }, gizmoLayer.utilityLayerScene); + sphere.rotationQuaternion = new Quaternion; + sphere.material = this._coloredMaterial; + sphere.isNearGrabbable = true; + const _dragBehavior = new PointerDragBehavior({}); + _dragBehavior.moveAttached = false; + _dragBehavior.updateDragPlane = false; + sphere.addBehavior(_dragBehavior); + const startingTurnDirection = new Vector3(1, 0, 0); + let totalTurnAmountOfDrag = 0; + let previousProjectDist = 0; + _dragBehavior.onDragStartObservable.add(() => { + startingTurnDirection.copyFrom(sphere.forward); + totalTurnAmountOfDrag = 0; + previousProjectDist = 0; + }); + _dragBehavior.onDragObservable.add((event) => { + this.onRotationSphereDragObservable.notifyObservers({}); + if (this.attachedMesh) { + const originalParent = this.attachedMesh.parent; + if (originalParent && originalParent.scaling && originalParent.scaling.isNonUniformWithinEpsilon(0.001)) { + Logger.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling"); + return; + } + PivotTools._RemoveAndStorePivotPoint(this.attachedMesh); + const worldDragDirection = startingTurnDirection; + const toSub = event.dragPlaneNormal.scale(Vector3.Dot(event.dragPlaneNormal, worldDragDirection)); + const dragAxis = worldDragDirection.subtract(toSub).normalizeToNew(); + let projectDist = Vector3.Dot(dragAxis, event.delta) < 0 ? Math.abs(event.delta.length()) : -Math.abs(event.delta.length()); + projectDist = projectDist / this._boundingDimensions.length() * this._anchorMesh.scaling.length(); + if (!this.attachedMesh.rotationQuaternion) { + this.attachedMesh.rotationQuaternion = Quaternion.RotationYawPitchRoll(this.attachedMesh.rotation.y, this.attachedMesh.rotation.x, this.attachedMesh.rotation.z); + } + if (!this._anchorMesh.rotationQuaternion) { + this._anchorMesh.rotationQuaternion = Quaternion.RotationYawPitchRoll(this._anchorMesh.rotation.y, this._anchorMesh.rotation.x, this._anchorMesh.rotation.z); + } + totalTurnAmountOfDrag += projectDist; + if (Math.abs(totalTurnAmountOfDrag) <= 2 * Math.PI) { + if (this.rotationSnapDistance > 0) { + const dragSteps = Math.floor(Math.abs(totalTurnAmountOfDrag) / this.rotationSnapDistance) * (totalTurnAmountOfDrag < 0 ? -1 : 1); + const angle = this.rotationSnapDistance * dragSteps; + projectDist = angle - previousProjectDist; + previousProjectDist = angle; + } + if (i >= 8) { + Quaternion.RotationYawPitchRollToRef(0, 0, projectDist, this._tmpQuaternion); + } else if (i >= 4) { + Quaternion.RotationYawPitchRollToRef(projectDist, 0, 0, this._tmpQuaternion); + } else { + Quaternion.RotationYawPitchRollToRef(0, projectDist, 0, this._tmpQuaternion); + } + if (this.attachedMesh.isUsingPivotMatrix()) { + this._anchorMesh.position.copyFrom(this.attachedMesh.position); + } + this._anchorMesh.addChild(this.attachedMesh); + if (this._anchorMesh.getScene().useRightHandedSystem) { + this._tmpQuaternion.conjugateInPlace(); + } + this._tmpQuaternion.normalize(); + this._anchorMesh.rotationQuaternion.multiplyToRef(this._tmpQuaternion, this._anchorMesh.rotationQuaternion); + this._anchorMesh.rotationQuaternion.normalize(); + this._anchorMesh.removeChild(this.attachedMesh); + this.attachedMesh.setParent(originalParent); + } + this.updateBoundingBox(); + PivotTools._RestorePivotPoint(this.attachedMesh); + } + this._updateDummy(); + }); + _dragBehavior.onDragStartObservable.add(() => { + this.onDragStartObservable.notifyObservers({}); + this._selectNode(sphere); + }); + _dragBehavior.onDragEndObservable.add((event) => { + this.onRotationSphereDragEndObservable.notifyObservers({}); + this._selectNode(null); + this._updateDummy(); + this._unhoverMeshOnTouchUp(event.pointerInfo, sphere); + }); + this._rotateSpheresParent.addChild(sphere); + } + this._rootMesh.addChild(this._rotateSpheresParent); + this._scaleBoxesParent = new AbstractMesh("", gizmoLayer.utilityLayerScene); + this._scaleBoxesParent.rotationQuaternion = new Quaternion; + for (let i = 0;i < 3; i++) { + for (let j = 0;j < 3; j++) { + for (let k = 0;k < 3; k++) { + const zeroAxisCount = (i === 1 ? 1 : 0) + (j === 1 ? 1 : 0) + (k === 1 ? 1 : 0); + if (zeroAxisCount === 1 || zeroAxisCount === 3) { + continue; + } + const box = CreateBox("", { size: 1 }, gizmoLayer.utilityLayerScene); + box.material = this._coloredMaterial; + box._internalMetadata = zeroAxisCount === 2; + box.isNearGrabbable = true; + const dragAxis = new Vector3(i - 1, j - 1, k - 1).normalize(); + const _dragBehavior = new PointerDragBehavior({ dragAxis }); + _dragBehavior.updateDragPlane = false; + _dragBehavior.moveAttached = false; + let totalRelativeDragDistance = 0; + let previousScale = 0; + box.addBehavior(_dragBehavior); + _dragBehavior.onDragObservable.add((event) => { + this.onScaleBoxDragObservable.notifyObservers({}); + if (this.attachedMesh) { + const originalParent = this.attachedMesh.parent; + if (originalParent && originalParent.scaling && originalParent.scaling.isNonUniformWithinEpsilon(0.001)) { + Logger.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling"); + return; + } + PivotTools._RemoveAndStorePivotPoint(this.attachedMesh); + let relativeDragDistance = event.dragDistance / this._boundingDimensions.length() * this._anchorMesh.scaling.length(); + totalRelativeDragDistance += relativeDragDistance; + if (this.scalingSnapDistance > 0) { + const dragSteps = Math.floor(Math.abs(totalRelativeDragDistance) / this.scalingSnapDistance) * (totalRelativeDragDistance < 0 ? -1 : 1); + const scale = this.scalingSnapDistance * dragSteps; + relativeDragDistance = scale - previousScale; + previousScale = scale; + } + const deltaScale = new Vector3(relativeDragDistance, relativeDragDistance, relativeDragDistance); + if (zeroAxisCount === 2) { + deltaScale.x *= Math.abs(dragAxis.x); + deltaScale.y *= Math.abs(dragAxis.y); + deltaScale.z *= Math.abs(dragAxis.z); + } + deltaScale.scaleInPlace(this._scaleDragSpeed); + deltaScale.multiplyInPlace(this._axisFactor); + this.updateBoundingBox(); + if (this.scalePivot) { + this.attachedMesh.getWorldMatrix().getRotationMatrixToRef(this._tmpRotationMatrix); + this._boundingDimensions.scaleToRef(0.5, this._tmpVector); + Vector3.TransformCoordinatesToRef(this._tmpVector, this._tmpRotationMatrix, this._tmpVector); + this._anchorMesh.position.subtractInPlace(this._tmpVector); + this._boundingDimensions.multiplyToRef(this.scalePivot, this._tmpVector); + Vector3.TransformCoordinatesToRef(this._tmpVector, this._tmpRotationMatrix, this._tmpVector); + this._anchorMesh.position.addInPlace(this._tmpVector); + } else { + box.absolutePosition.subtractToRef(this._anchorMesh.position, this._tmpVector); + this._anchorMesh.position.subtractInPlace(this._tmpVector); + if (this.attachedMesh.isUsingPivotMatrix()) { + this._anchorMesh.position.subtractInPlace(this.attachedMesh.getPivotPoint()); + } + } + this._anchorMesh.addChild(this.attachedMesh); + this._anchorMesh.scaling.addInPlace(deltaScale); + if (this._anchorMesh.scaling.x < 0 || this._anchorMesh.scaling.y < 0 || this._anchorMesh.scaling.z < 0) { + this._anchorMesh.scaling.subtractInPlace(deltaScale); + } + this._anchorMesh.removeChild(this.attachedMesh); + this.attachedMesh.setParent(originalParent); + PivotTools._RestorePivotPoint(this.attachedMesh); + } + this._updateDummy(); + }); + _dragBehavior.onDragStartObservable.add(() => { + this.onDragStartObservable.notifyObservers({}); + this._selectNode(box); + totalRelativeDragDistance = 0; + previousScale = 0; + }); + _dragBehavior.onDragEndObservable.add((event) => { + this.onScaleBoxDragEndObservable.notifyObservers({}); + this._selectNode(null); + this._updateDummy(); + this._unhoverMeshOnTouchUp(event.pointerInfo, box); + }); + this._scaleBoxesParent.addChild(box); + } + } + } + this._rootMesh.addChild(this._scaleBoxesParent); + const pointerIds = []; + this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => { + if (!pointerIds[pointerInfo.event.pointerId]) { + this._rotateSpheresParent.getChildMeshes().concat(this._scaleBoxesParent.getChildMeshes()).forEach((mesh38) => { + if (pointerInfo.pickInfo && pointerInfo.pickInfo.pickedMesh == mesh38) { + pointerIds[pointerInfo.event.pointerId] = mesh38; + mesh38.material = this._hoverColoredMaterial; + this._isHovered = true; + } + }); + } else { + if (pointerInfo.pickInfo && pointerInfo.pickInfo.pickedMesh != pointerIds[pointerInfo.event.pointerId]) { + pointerIds[pointerInfo.event.pointerId].material = this._coloredMaterial; + delete pointerIds[pointerInfo.event.pointerId]; + this._isHovered = false; + } + } + }); + this._renderObserver = this.gizmoLayer.originalScene.onBeforeRenderObservable.add(() => { + if (this.attachedMesh && !this._existingMeshScale.equals(this.attachedMesh.scaling)) { + this.updateBoundingBox(); + } else if (this.fixedDragMeshScreenSize || this.fixedDragMeshBoundsSize) { + this._updateRotationSpheres(); + this._updateScaleBoxes(); + } + if (this._dragMesh && this.attachedMesh && this._pointerDragBehavior.dragging) { + this._lineBoundingBox.position.rotateByQuaternionToRef(this._rootMesh.rotationQuaternion, this._tmpVector); + this.attachedMesh.setAbsolutePosition(this._dragMesh.position.add(this._tmpVector.scale(-1))); + } + }); + this.updateBoundingBox(); + } + _attachedNodeChanged(value) { + if (value) { + this._anchorMesh.scaling.setAll(1); + PivotTools._RemoveAndStorePivotPoint(value); + const originalParent = value.parent; + this._anchorMesh.addChild(value); + this._anchorMesh.removeChild(value); + value.setParent(originalParent); + PivotTools._RestorePivotPoint(value); + this.updateBoundingBox(); + value.getChildMeshes(false).forEach((m) => { + m.markAsDirty("scaling"); + }); + this.gizmoLayer.utilityLayerScene.onAfterRenderObservable.addOnce(() => { + this._updateDummy(); + }); + } + } + _selectNode(selectedMesh) { + this._rotateSpheresParent.getChildMeshes().concat(this._scaleBoxesParent.getChildMeshes()).forEach((m) => { + m.isVisible = !selectedMesh || m == selectedMesh; + }); + } + _unhoverMeshOnTouchUp(pointerInfo, selectedMesh) { + if ((pointerInfo === null || pointerInfo === undefined ? undefined : pointerInfo.event) instanceof PointerEvent && (pointerInfo === null || pointerInfo === undefined ? undefined : pointerInfo.event.pointerType) === "touch") { + selectedMesh.material = this._coloredMaterial; + } + } + getScaleBoxes() { + return this._scaleBoxesParent.getChildMeshes(); + } + updateBoundingBox() { + if (this.attachedMesh) { + PivotTools._RemoveAndStorePivotPoint(this.attachedMesh); + const originalParent = this.attachedMesh.parent; + this.attachedMesh.setParent(null); + this._update(); + if (!this.attachedMesh.rotationQuaternion) { + this.attachedMesh.rotationQuaternion = Quaternion.RotationYawPitchRoll(this.attachedMesh.rotation.y, this.attachedMesh.rotation.x, this.attachedMesh.rotation.z); + } + if (!this._anchorMesh.rotationQuaternion) { + this._anchorMesh.rotationQuaternion = Quaternion.RotationYawPitchRoll(this._anchorMesh.rotation.y, this._anchorMesh.rotation.x, this._anchorMesh.rotation.z); + } + this._anchorMesh.rotationQuaternion.copyFrom(this.attachedMesh.rotationQuaternion); + this._tmpQuaternion.copyFrom(this.attachedMesh.rotationQuaternion); + this._tmpVector.copyFrom(this.attachedMesh.position); + this.attachedMesh.rotationQuaternion.set(0, 0, 0, 1); + this.attachedMesh.position.set(0, 0, 0); + const boundingMinMax = this.attachedMesh.getHierarchyBoundingVectors(!this.ignoreChildren, this.includeChildPredicate); + boundingMinMax.max.subtractToRef(boundingMinMax.min, this._boundingDimensions); + this._lineBoundingBox.scaling.copyFrom(this._boundingDimensions); + this._lineBoundingBox.position.set((boundingMinMax.max.x + boundingMinMax.min.x) / 2, (boundingMinMax.max.y + boundingMinMax.min.y) / 2, (boundingMinMax.max.z + boundingMinMax.min.z) / 2); + this._rotateSpheresParent.position.copyFrom(this._lineBoundingBox.position); + this._scaleBoxesParent.position.copyFrom(this._lineBoundingBox.position); + this._lineBoundingBox.computeWorldMatrix(); + this._anchorMesh.position.copyFrom(this._lineBoundingBox.absolutePosition); + this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion); + this.attachedMesh.position.copyFrom(this._tmpVector); + this.attachedMesh.setParent(originalParent); + } + this._updateRotationSpheres(); + this._updateScaleBoxes(); + if (this.attachedMesh) { + this._existingMeshScale.copyFrom(this.attachedMesh.scaling); + PivotTools._RestorePivotPoint(this.attachedMesh); + } + } + _updateRotationSpheres() { + const rotateSpheres = this._rotateSpheresParent.getChildMeshes(); + for (let i = 0;i < 3; i++) { + for (let j = 0;j < 2; j++) { + for (let k = 0;k < 2; k++) { + const index = i * 4 + j * 2 + k; + if (i == 0) { + rotateSpheres[index].position.set(this._boundingDimensions.x / 2, this._boundingDimensions.y * j, this._boundingDimensions.z * k); + rotateSpheres[index].position.addInPlace(new Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)); + rotateSpheres[index].lookAt(Vector3.Cross(rotateSpheres[index].position.normalizeToNew(), Vector3.Right()).normalizeToNew().add(rotateSpheres[index].position)); + } + if (i == 1) { + rotateSpheres[index].position.set(this._boundingDimensions.x * j, this._boundingDimensions.y / 2, this._boundingDimensions.z * k); + rotateSpheres[index].position.addInPlace(new Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)); + rotateSpheres[index].lookAt(Vector3.Cross(rotateSpheres[index].position.normalizeToNew(), Vector3.Up()).normalizeToNew().add(rotateSpheres[index].position)); + } + if (i == 2) { + rotateSpheres[index].position.set(this._boundingDimensions.x * j, this._boundingDimensions.y * k, this._boundingDimensions.z / 2); + rotateSpheres[index].position.addInPlace(new Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)); + rotateSpheres[index].lookAt(Vector3.Cross(rotateSpheres[index].position.normalizeToNew(), Vector3.Forward()).normalizeToNew().add(rotateSpheres[index].position)); + } + if (this.fixedDragMeshScreenSize && this.gizmoLayer.utilityLayerScene.activeCamera) { + rotateSpheres[index].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector); + const distanceFromCamera = this.rotationSphereSize * this._tmpVector.length() / this.fixedDragMeshScreenSizeDistanceFactor; + rotateSpheres[index].scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera); + } else if (this.fixedDragMeshBoundsSize) { + rotateSpheres[index].scaling.set(this.rotationSphereSize * this._boundingDimensions.x, this.rotationSphereSize * this._boundingDimensions.y, this.rotationSphereSize * this._boundingDimensions.z); + } else { + rotateSpheres[index].scaling.set(this.rotationSphereSize, this.rotationSphereSize, this.rotationSphereSize); + } + } + } + } + } + _updateScaleBoxes() { + const scaleBoxes = this._scaleBoxesParent.getChildMeshes(); + let index = 0; + for (let i = 0;i < 3; i++) { + for (let j = 0;j < 3; j++) { + for (let k = 0;k < 3; k++) { + const zeroAxisCount = (i === 1 ? 1 : 0) + (j === 1 ? 1 : 0) + (k === 1 ? 1 : 0); + if (zeroAxisCount === 1 || zeroAxisCount === 3) { + continue; + } + if (scaleBoxes[index]) { + scaleBoxes[index].position.set(this._boundingDimensions.x * (i / 2), this._boundingDimensions.y * (j / 2), this._boundingDimensions.z * (k / 2)); + scaleBoxes[index].position.addInPlace(new Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)); + if (this.fixedDragMeshScreenSize && this.gizmoLayer.utilityLayerScene.activeCamera) { + scaleBoxes[index].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector); + const distanceFromCamera = this.scaleBoxSize * this._tmpVector.length() / this.fixedDragMeshScreenSizeDistanceFactor; + scaleBoxes[index].scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera); + } else if (this.fixedDragMeshBoundsSize) { + scaleBoxes[index].scaling.set(this.scaleBoxSize * this._boundingDimensions.x, this.scaleBoxSize * this._boundingDimensions.y, this.scaleBoxSize * this._boundingDimensions.z); + } else { + scaleBoxes[index].scaling.set(this.scaleBoxSize, this.scaleBoxSize, this.scaleBoxSize); + } + } + index++; + } + } + } + } + setEnabledRotationAxis(axis) { + this._rotateSpheresParent.getChildMeshes().forEach((m, i) => { + if (i < 4) { + m.setEnabled(axis.indexOf("x") != -1); + } else if (i < 8) { + m.setEnabled(axis.indexOf("y") != -1); + } else { + m.setEnabled(axis.indexOf("z") != -1); + } + }); + } + setEnabledScaling(enable, homogeneousScaling = false) { + this._scaleBoxesParent.getChildMeshes().forEach((m) => { + let enableMesh = enable; + if (homogeneousScaling && m._internalMetadata === true) { + enableMesh = false; + } + m.setEnabled(enableMesh); + }); + } + _updateDummy() { + if (this._dragMesh) { + this._dragMesh.position.copyFrom(this._lineBoundingBox.getAbsolutePosition()); + this._dragMesh.scaling.copyFrom(this._lineBoundingBox.scaling); + this._dragMesh.rotationQuaternion.copyFrom(this._rootMesh.rotationQuaternion); + } + } + enableDragBehavior() { + this._dragMesh = CreateBox("dummy", { size: 1 }, this.gizmoLayer.utilityLayerScene); + this._dragMesh.visibility = 0; + this._dragMesh.rotationQuaternion = new Quaternion; + this._pointerDragBehavior.useObjectOrientationForDragging = false; + this._dragMesh.addBehavior(this._pointerDragBehavior); + } + dispose() { + this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver); + this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver); + this._lineBoundingBox.dispose(); + this._rotateSpheresParent.dispose(); + this._scaleBoxesParent.dispose(); + if (this._dragMesh) { + this._dragMesh.dispose(); + } + super.dispose(); + } + static MakeNotPickableAndWrapInBoundingBox(mesh38) { + const makeNotPickable = (root) => { + root.isPickable = false; + root.getChildMeshes().forEach((c) => { + makeNotPickable(c); + }); + }; + makeNotPickable(mesh38); + if (!mesh38.rotationQuaternion) { + mesh38.rotationQuaternion = Quaternion.RotationYawPitchRoll(mesh38.rotation.y, mesh38.rotation.x, mesh38.rotation.z); + } + const oldPos = mesh38.position.clone(); + const oldRot = mesh38.rotationQuaternion.clone(); + mesh38.rotationQuaternion.set(0, 0, 0, 1); + mesh38.position.set(0, 0, 0); + const box = CreateBox("box", { size: 1 }, mesh38.getScene()); + const boundingMinMax = mesh38.getHierarchyBoundingVectors(); + boundingMinMax.max.subtractToRef(boundingMinMax.min, box.scaling); + if (box.scaling.y === 0) { + box.scaling.y = Epsilon; + } + if (box.scaling.x === 0) { + box.scaling.x = Epsilon; + } + if (box.scaling.z === 0) { + box.scaling.z = Epsilon; + } + box.position.set((boundingMinMax.max.x + boundingMinMax.min.x) / 2, (boundingMinMax.max.y + boundingMinMax.min.y) / 2, (boundingMinMax.max.z + boundingMinMax.min.z) / 2); + mesh38.addChild(box); + mesh38.rotationQuaternion.copyFrom(oldRot); + mesh38.position.copyFrom(oldPos); + mesh38.removeChild(box); + box.addChild(mesh38); + box.visibility = 0; + return box; + } + setCustomMesh() { + Logger.Error("Custom meshes are not supported on this gizmo"); + } +} +var init_boundingBoxGizmo = __esm(() => { + init_observable(); + init_logger(); + init_math_vector(); + init_abstractMesh(); + init_sphereBuilder(); + init_boxBuilder(); + init_linesBuilder(); + init_pointerDragBehavior(); + init_gizmo(); + init_utilityLayerRenderer(); + init_standardMaterial(); + init_pivotTools(); + init_math_color(); + init_math_constants(); +}); + // node_modules/@babylonjs/core/Gizmos/planeRotationGizmo.js class PlaneRotationGizmo extends Gizmo { get coloredMaterial() { @@ -98914,8 +105982,24 @@ class PlaneRotationGizmo extends Gizmo { super.dispose(); } } -PlaneRotationGizmo.MaxDragAngle = Math.PI * 9 / 20; -PlaneRotationGizmo._RotationGizmoVertexShader = ` +var init_planeRotationGizmo = __esm(() => { + init_observable(); + init_math_vector(); + init_math_color(); + init_linesBuilder(); + init_mesh(); + init_pointerDragBehavior(); + init_gizmo(); + init_utilityLayerRenderer(); + init_standardMaterial(); + init_shaderMaterial(); + init_effect(); + init_planeBuilder(); + init_torusBuilder(); + init_math_constants(); + init_logger(); + PlaneRotationGizmo.MaxDragAngle = Math.PI * 9 / 20; + PlaneRotationGizmo._RotationGizmoVertexShader = ` precision highp float; attribute vec3 position; attribute vec2 uv; @@ -98927,7 +106011,7 @@ PlaneRotationGizmo._RotationGizmoVertexShader = ` gl_Position = worldViewProjection * vec4(position, 1.0); vUV = uv; }`; -PlaneRotationGizmo._RotationGizmoFragmentShader = ` + PlaneRotationGizmo._RotationGizmoFragmentShader = ` precision highp float; varying vec2 vUV; varying vec3 vPosition; @@ -98959,88 +106043,1159 @@ PlaneRotationGizmo._RotationGizmoFragmentShader = ` gl_FragColor = vec4(rotationColor, min(intensity * 0.25, 0.8)) * opacity; } `; -// node_modules/@babylonjs/core/Lights/shadowLight.js -class ShadowLight extends Light { - constructor() { - super(...arguments); - this._needProjectionMatrixCompute = true; - this._viewMatrix = Matrix.Identity(); - this._projectionMatrix = Matrix.Identity(); - } - _setPosition(value) { - this._position = value; - } - get position() { - return this._position; +}); + +// node_modules/@babylonjs/core/Gizmos/rotationGizmo.js +class RotationGizmo extends Gizmo { + get attachedMesh() { + return this._meshAttached; + } + set attachedMesh(mesh39) { + this._meshAttached = mesh39; + this._nodeAttached = mesh39; + this._checkBillboardTransform(); + [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo6) => { + if (gizmo6.isEnabled) { + gizmo6.attachedMesh = mesh39; + } else { + gizmo6.attachedMesh = null; + } + }); } - set position(value) { - this._setPosition(value); + get attachedNode() { + return this._nodeAttached; + } + set attachedNode(node26) { + this._meshAttached = null; + this._nodeAttached = node26; + this._checkBillboardTransform(); + [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo6) => { + if (gizmo6.isEnabled) { + gizmo6.attachedNode = node26; + } else { + gizmo6.attachedNode = null; + } + }); } - _setDirection(value) { - this._direction = value; + _checkBillboardTransform() { + if (this._nodeAttached && this._nodeAttached.billboardMode) { + console.log("Rotation Gizmo will not work with transforms in billboard mode."); + } } - get direction() { - return this._direction; + set sensitivity(value) { + this._sensitivity = value; + [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo6) => { + if (gizmo6) { + gizmo6.sensitivity = value; + } + }); } - set direction(value) { - this._setDirection(value); + get sensitivity() { + return this._sensitivity; } - get shadowMinZ() { - return this._shadowMinZ; + get isHovered() { + let hovered = false; + [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo6) => { + hovered = hovered || gizmo6.isHovered; + }); + return hovered; } - set shadowMinZ(value) { - this._shadowMinZ = value; - this.forceProjectionMatrixCompute(); + constructor(gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer, tessellation = 32, useEulerRotation = false, thickness = 1, gizmoManager, options) { + super(gizmoLayer); + this.onDragStartObservable = new Observable; + this.onDragObservable = new Observable; + this.onDragEndObservable = new Observable; + this._observables = []; + this._sensitivity = 1; + this._gizmoAxisCache = new Map; + const xColor = options && options.xOptions && options.xOptions.color ? options.xOptions.color : Color3.Red().scale(0.5); + const yColor = options && options.yOptions && options.yOptions.color ? options.yOptions.color : Color3.Green().scale(0.5); + const zColor = options && options.zOptions && options.zOptions.color ? options.zOptions.color : Color3.Blue().scale(0.5); + this.xGizmo = new PlaneRotationGizmo(new Vector3(1, 0, 0), xColor, gizmoLayer, tessellation, this, useEulerRotation, thickness); + this.yGizmo = new PlaneRotationGizmo(new Vector3(0, 1, 0), yColor, gizmoLayer, tessellation, this, useEulerRotation, thickness); + this.zGizmo = new PlaneRotationGizmo(new Vector3(0, 0, 1), zColor, gizmoLayer, tessellation, this, useEulerRotation, thickness); + [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo6) => { + if (options && options.updateScale != null) { + gizmo6.updateScale = options.updateScale; + } + gizmo6.dragBehavior.onDragStartObservable.add(() => { + this.onDragStartObservable.notifyObservers({}); + }); + gizmo6.dragBehavior.onDragObservable.add(() => { + this.onDragObservable.notifyObservers({}); + }); + gizmo6.dragBehavior.onDragEndObservable.add(() => { + this.onDragEndObservable.notifyObservers({}); + }); + }); + this.attachedMesh = null; + this.attachedNode = null; + if (gizmoManager) { + gizmoManager.addToAxisCache(this._gizmoAxisCache); + } else { + Gizmo.GizmoAxisPointerObserver(gizmoLayer, this._gizmoAxisCache); + } } - get shadowMaxZ() { - return this._shadowMaxZ; + set updateGizmoRotationToMatchAttachedMesh(value) { + if (this.xGizmo) { + this.xGizmo.updateGizmoRotationToMatchAttachedMesh = value; + this.yGizmo.updateGizmoRotationToMatchAttachedMesh = value; + this.zGizmo.updateGizmoRotationToMatchAttachedMesh = value; + } } - set shadowMaxZ(value) { - this._shadowMaxZ = value; - this.forceProjectionMatrixCompute(); + get updateGizmoRotationToMatchAttachedMesh() { + return this.xGizmo.updateGizmoRotationToMatchAttachedMesh; } - computeTransformedInformation() { - if (this.parent && this.parent.getWorldMatrix) { - if (!this.transformedPosition) { - this.transformedPosition = Vector3.Zero(); - } - Vector3.TransformCoordinatesToRef(this.position, this.parent.getWorldMatrix(), this.transformedPosition); - if (this.direction) { - if (!this.transformedDirection) { - this.transformedDirection = Vector3.Zero(); - } - Vector3.TransformNormalToRef(this.direction, this.parent.getWorldMatrix(), this.transformedDirection); - } - return true; + set updateGizmoPositionToMatchAttachedMesh(value) { + if (this.xGizmo) { + this.xGizmo.updateGizmoPositionToMatchAttachedMesh = value; + this.yGizmo.updateGizmoPositionToMatchAttachedMesh = value; + this.zGizmo.updateGizmoPositionToMatchAttachedMesh = value; } - return false; } - getDepthScale() { - return 50; + get updateGizmoPositionToMatchAttachedMesh() { + return this.xGizmo.updateGizmoPositionToMatchAttachedMesh; } - getShadowDirection(faceIndex) { - return this.transformedDirection ? this.transformedDirection : this.direction; + set anchorPoint(value) { + this._anchorPoint = value; + [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo6) => { + gizmo6.anchorPoint = value; + }); } - getAbsolutePosition() { - return this.transformedPosition ? this.transformedPosition : this.position; + get anchorPoint() { + return this._anchorPoint; } - setDirectionToTarget(target) { - this.direction = Vector3.Normalize(target.subtract(this.position)); - return this.direction; + set coordinatesMode(coordinatesMode) { + [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo6) => { + gizmo6.coordinatesMode = coordinatesMode; + }); } - getRotation() { - this.direction.normalize(); - const xaxis = Vector3.Cross(this.direction, Axis.Y); - const yaxis = Vector3.Cross(xaxis, this.direction); - return Vector3.RotationFromAxis(xaxis, yaxis, this.direction); + set updateScale(value) { + if (this.xGizmo) { + this.xGizmo.updateScale = value; + this.yGizmo.updateScale = value; + this.zGizmo.updateScale = value; + } } - needCube() { - return false; + get updateScale() { + return this.xGizmo.updateScale; } - needProjectionMatrixCompute() { - return this._needProjectionMatrixCompute; + set snapDistance(value) { + if (this.xGizmo) { + this.xGizmo.snapDistance = value; + this.yGizmo.snapDistance = value; + this.zGizmo.snapDistance = value; + } } - forceProjectionMatrixCompute() { + get snapDistance() { + return this.xGizmo.snapDistance; + } + set scaleRatio(value) { + if (this.xGizmo) { + this.xGizmo.scaleRatio = value; + this.yGizmo.scaleRatio = value; + this.zGizmo.scaleRatio = value; + } + } + get scaleRatio() { + return this.xGizmo.scaleRatio; + } + get customRotationQuaternion() { + return this._customRotationQuaternion; + } + set customRotationQuaternion(customRotationQuaternion) { + this._customRotationQuaternion = customRotationQuaternion; + [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo6) => { + if (gizmo6) { + gizmo6.customRotationQuaternion = customRotationQuaternion; + } + }); + } + addToAxisCache(mesh39, cache) { + this._gizmoAxisCache.set(mesh39, cache); + } + dispose() { + this.xGizmo.dispose(); + this.yGizmo.dispose(); + this.zGizmo.dispose(); + this.onDragStartObservable.clear(); + this.onDragObservable.clear(); + this.onDragEndObservable.clear(); + this._observables.forEach((obs) => { + this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(obs); + }); + } + setCustomMesh() { + Logger.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)"); + } +} +var init_rotationGizmo = __esm(() => { + init_logger(); + init_observable(); + init_math_vector(); + init_math_color(); + init_gizmo(); + init_planeRotationGizmo(); + init_utilityLayerRenderer(); +}); + +// node_modules/@babylonjs/core/Gizmos/planeDragGizmo.js +class PlaneDragGizmo extends Gizmo { + get coloredMaterial() { + return this._coloredMaterial; + } + get hoverMaterial() { + return this._hoverMaterial; + } + get disableMaterial() { + return this._disableMaterial; + } + static _CreatePlane(scene20, material11) { + const plane = new TransformNode("plane", scene20); + const dragPlane = CreatePlane("dragPlane", { width: 0.1375, height: 0.1375, sideOrientation: 2 }, scene20); + dragPlane.material = material11; + dragPlane.parent = plane; + return plane; + } + constructor(dragPlaneNormal, color = Color3.Gray(), gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer, parent = null, hoverColor = Color3.Yellow(), disableColor = Color3.Gray()) { + var _a; + super(gizmoLayer); + this._pointerObserver = null; + this.snapDistance = 0; + this.onSnapObservable = new Observable; + this._isEnabled = false; + this._parent = null; + this._dragging = false; + this._parent = parent; + this._coloredMaterial = new StandardMaterial("", gizmoLayer.utilityLayerScene); + this._coloredMaterial.diffuseColor = color; + this._coloredMaterial.specularColor = color.subtract(new Color3(0.1, 0.1, 0.1)); + this._hoverMaterial = new StandardMaterial("", gizmoLayer.utilityLayerScene); + this._hoverMaterial.diffuseColor = hoverColor; + this._disableMaterial = new StandardMaterial("", gizmoLayer.utilityLayerScene); + this._disableMaterial.diffuseColor = disableColor; + this._disableMaterial.alpha = 0.4; + this._gizmoMesh = PlaneDragGizmo._CreatePlane(gizmoLayer.utilityLayerScene, this._coloredMaterial); + this._gizmoMesh.lookAt(this._rootMesh.position.add(dragPlaneNormal)); + this._gizmoMesh.scaling.scaleInPlace(1 / 3); + this._gizmoMesh.parent = this._rootMesh; + let currentSnapDragDistance = 0; + const tmpVector = new Vector3; + const tmpSnapEvent = { snapDistance: 0 }; + this.dragBehavior = new PointerDragBehavior({ dragPlaneNormal }); + this.dragBehavior.moveAttached = false; + this._rootMesh.addBehavior(this.dragBehavior); + this.dragBehavior.onDragObservable.add((event) => { + if (this.attachedNode) { + if (this.snapDistance == 0) { + this.attachedNode.getWorldMatrix().getTranslationToRef(TmpVectors.Vector3[0]); + TmpVectors.Vector3[0].addToRef(event.delta, TmpVectors.Vector3[0]); + if (this.dragBehavior.validateDrag(TmpVectors.Vector3[0])) { + this.attachedNode.getWorldMatrix().addTranslationFromFloats(event.delta.x, event.delta.y, event.delta.z); + } + } else { + currentSnapDragDistance += event.dragDistance; + if (Math.abs(currentSnapDragDistance) > this.snapDistance) { + const dragSteps = Math.floor(Math.abs(currentSnapDragDistance) / this.snapDistance); + currentSnapDragDistance = currentSnapDragDistance % this.snapDistance; + event.delta.normalizeToRef(tmpVector); + tmpVector.scaleInPlace(this.snapDistance * dragSteps); + this.attachedNode.getWorldMatrix().getTranslationToRef(TmpVectors.Vector3[0]); + TmpVectors.Vector3[0].addToRef(tmpVector, TmpVectors.Vector3[0]); + if (this.dragBehavior.validateDrag(TmpVectors.Vector3[0])) { + this.attachedNode.getWorldMatrix().addTranslationFromFloats(tmpVector.x, tmpVector.y, tmpVector.z); + tmpSnapEvent.snapDistance = this.snapDistance * dragSteps; + this.onSnapObservable.notifyObservers(tmpSnapEvent); + } + } + } + this._matrixChanged(); + } + }); + this.dragBehavior.onDragStartObservable.add(() => { + this._dragging = true; + }); + this.dragBehavior.onDragEndObservable.add(() => { + this._dragging = false; + }); + const light4 = gizmoLayer._getSharedGizmoLight(); + light4.includedOnlyMeshes = light4.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(false)); + const cache = { + gizmoMeshes: this._gizmoMesh.getChildMeshes(), + colliderMeshes: this._gizmoMesh.getChildMeshes(), + material: this._coloredMaterial, + hoverMaterial: this._hoverMaterial, + disableMaterial: this._disableMaterial, + active: false, + dragBehavior: this.dragBehavior + }; + (_a = this._parent) === null || _a === undefined || _a.addToAxisCache(this._gizmoMesh, cache); + this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add((pointerInfo) => { + var _a2; + if (this._customMeshSet) { + return; + } + this._isHovered = !!(cache.colliderMeshes.indexOf((_a2 = pointerInfo === null || pointerInfo === undefined ? undefined : pointerInfo.pickInfo) === null || _a2 === undefined ? undefined : _a2.pickedMesh) != -1); + if (!this._parent) { + const material11 = cache.dragBehavior.enabled ? this._isHovered || this._dragging ? this._hoverMaterial : this._coloredMaterial : this._disableMaterial; + this._setGizmoMeshMaterial(cache.gizmoMeshes, material11); + } + }); + this.dragBehavior.onEnabledObservable.add((newState) => { + this._setGizmoMeshMaterial(cache.gizmoMeshes, newState ? this._coloredMaterial : this._disableMaterial); + }); + } + _attachedNodeChanged(value) { + if (this.dragBehavior) { + this.dragBehavior.enabled = value ? true : false; + } + } + set isEnabled(value) { + this._isEnabled = value; + if (!value) { + this.attachedNode = null; + } else { + if (this._parent) { + this.attachedNode = this._parent.attachedNode; + } + } + } + get isEnabled() { + return this._isEnabled; + } + dispose() { + this.onSnapObservable.clear(); + this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver); + this.dragBehavior.detach(); + super.dispose(); + if (this._gizmoMesh) { + this._gizmoMesh.dispose(); + } + [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((matl) => { + if (matl) { + matl.dispose(); + } + }); + } +} +var init_planeDragGizmo = __esm(() => { + init_observable(); + init_math_vector(); + init_math_color(); + init_transformNode(); + init_planeBuilder(); + init_pointerDragBehavior(); + init_gizmo(); + init_utilityLayerRenderer(); + init_standardMaterial(); +}); + +// node_modules/@babylonjs/core/Gizmos/positionGizmo.js +class PositionGizmo extends Gizmo { + get attachedMesh() { + return this._meshAttached; + } + set attachedMesh(mesh39) { + this._meshAttached = mesh39; + this._nodeAttached = mesh39; + [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo8) => { + if (gizmo8.isEnabled) { + gizmo8.attachedMesh = mesh39; + } else { + gizmo8.attachedMesh = null; + } + }); + } + get attachedNode() { + return this._nodeAttached; + } + set attachedNode(node26) { + this._meshAttached = null; + this._nodeAttached = node26; + [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo8) => { + if (gizmo8.isEnabled) { + gizmo8.attachedNode = node26; + } else { + gizmo8.attachedNode = null; + } + }); + } + get isHovered() { + let hovered = false; + [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo8) => { + hovered = hovered || gizmo8.isHovered; + }); + return hovered; + } + constructor(gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer, thickness = 1, gizmoManager) { + super(gizmoLayer); + this._meshAttached = null; + this._nodeAttached = null; + this._observables = []; + this._gizmoAxisCache = new Map; + this.onDragStartObservable = new Observable; + this.onDragObservable = new Observable; + this.onDragEndObservable = new Observable; + this._planarGizmoEnabled = false; + this.xGizmo = new AxisDragGizmo(new Vector3(1, 0, 0), Color3.Red().scale(0.5), gizmoLayer, this, thickness); + this.yGizmo = new AxisDragGizmo(new Vector3(0, 1, 0), Color3.Green().scale(0.5), gizmoLayer, this, thickness); + this.zGizmo = new AxisDragGizmo(new Vector3(0, 0, 1), Color3.Blue().scale(0.5), gizmoLayer, this, thickness); + this.xPlaneGizmo = new PlaneDragGizmo(new Vector3(1, 0, 0), Color3.Red().scale(0.5), this.gizmoLayer, this); + this.yPlaneGizmo = new PlaneDragGizmo(new Vector3(0, 1, 0), Color3.Green().scale(0.5), this.gizmoLayer, this); + this.zPlaneGizmo = new PlaneDragGizmo(new Vector3(0, 0, 1), Color3.Blue().scale(0.5), this.gizmoLayer, this); + [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo8) => { + gizmo8.dragBehavior.onDragStartObservable.add(() => { + this.onDragStartObservable.notifyObservers({}); + }); + gizmo8.dragBehavior.onDragObservable.add(() => { + this.onDragObservable.notifyObservers({}); + }); + gizmo8.dragBehavior.onDragEndObservable.add(() => { + this.onDragEndObservable.notifyObservers({}); + }); + }); + this.attachedMesh = null; + if (gizmoManager) { + gizmoManager.addToAxisCache(this._gizmoAxisCache); + } else { + Gizmo.GizmoAxisPointerObserver(gizmoLayer, this._gizmoAxisCache); + } + } + set planarGizmoEnabled(value) { + this._planarGizmoEnabled = value; + [this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo8) => { + if (gizmo8) { + gizmo8.isEnabled = value; + if (value) { + if (gizmo8.attachedMesh) { + gizmo8.attachedMesh = this.attachedMesh; + } else { + gizmo8.attachedNode = this.attachedNode; + } + } + } + }, this); + } + get planarGizmoEnabled() { + return this._planarGizmoEnabled; + } + get customRotationQuaternion() { + return this._customRotationQuaternion; + } + set customRotationQuaternion(customRotationQuaternion) { + this._customRotationQuaternion = customRotationQuaternion; + [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo8) => { + if (gizmo8) { + gizmo8.customRotationQuaternion = customRotationQuaternion; + } + }); + } + set updateGizmoRotationToMatchAttachedMesh(value) { + this._updateGizmoRotationToMatchAttachedMesh = value; + [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo8) => { + if (gizmo8) { + gizmo8.updateGizmoRotationToMatchAttachedMesh = value; + } + }); + } + get updateGizmoRotationToMatchAttachedMesh() { + return this._updateGizmoRotationToMatchAttachedMesh; + } + set updateGizmoPositionToMatchAttachedMesh(value) { + this._updateGizmoPositionToMatchAttachedMesh = value; + [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo8) => { + if (gizmo8) { + gizmo8.updateGizmoPositionToMatchAttachedMesh = value; + } + }); + } + get updateGizmoPositionToMatchAttachedMesh() { + return this._updateGizmoPositionToMatchAttachedMesh; + } + set anchorPoint(value) { + this._anchorPoint = value; + [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo8) => { + gizmo8.anchorPoint = value; + }); + } + get anchorPoint() { + return this._anchorPoint; + } + set coordinatesMode(coordinatesMode) { + [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo8) => { + gizmo8.coordinatesMode = coordinatesMode; + }); + } + set updateScale(value) { + if (this.xGizmo) { + this.xGizmo.updateScale = value; + this.yGizmo.updateScale = value; + this.zGizmo.updateScale = value; + } + } + get updateScale() { + return this.xGizmo.updateScale; + } + set snapDistance(value) { + this._snapDistance = value; + [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo8) => { + if (gizmo8) { + gizmo8.snapDistance = value; + } + }); + } + get snapDistance() { + return this._snapDistance; + } + set scaleRatio(value) { + this._scaleRatio = value; + [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo8) => { + if (gizmo8) { + gizmo8.scaleRatio = value; + } + }); + } + get scaleRatio() { + return this._scaleRatio; + } + addToAxisCache(mesh39, cache) { + this._gizmoAxisCache.set(mesh39, cache); + } + dispose() { + [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo8) => { + if (gizmo8) { + gizmo8.dispose(); + } + }); + this._observables.forEach((obs) => { + this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(obs); + }); + this.onDragStartObservable.clear(); + this.onDragObservable.clear(); + this.onDragEndObservable.clear(); + } + setCustomMesh() { + Logger.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo,gizmo.xPlaneGizmo, gizmo.yPlaneGizmo, gizmo.zPlaneGizmo)"); + } +} +var init_positionGizmo = __esm(() => { + init_logger(); + init_observable(); + init_math_vector(); + init_math_color(); + init_gizmo(); + init_axisDragGizmo(); + init_planeDragGizmo(); + init_utilityLayerRenderer(); +}); + +// node_modules/@babylonjs/core/Gizmos/scaleGizmo.js +class ScaleGizmo extends Gizmo { + get coloredMaterial() { + return this._coloredMaterial; + } + get hoverMaterial() { + return this._hoverMaterial; + } + get disableMaterial() { + return this._disableMaterial; + } + get attachedMesh() { + return this._meshAttached; + } + set attachedMesh(mesh39) { + this._meshAttached = mesh39; + this._nodeAttached = mesh39; + [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo9) => { + if (gizmo9.isEnabled) { + gizmo9.attachedMesh = mesh39; + } else { + gizmo9.attachedMesh = null; + } + }); + } + get attachedNode() { + return this._nodeAttached; + } + set attachedNode(node26) { + this._meshAttached = null; + this._nodeAttached = node26; + [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo9) => { + if (gizmo9.isEnabled) { + gizmo9.attachedNode = node26; + } else { + gizmo9.attachedNode = null; + } + }); + } + set updateScale(value) { + if (this.xGizmo) { + this.xGizmo.updateScale = value; + this.yGizmo.updateScale = value; + this.zGizmo.updateScale = value; + } + } + get updateScale() { + return this.xGizmo.updateScale; + } + get isHovered() { + let hovered = false; + [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo9) => { + hovered = hovered || gizmo9.isHovered; + }); + return hovered; + } + constructor(gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer, thickness = 1, gizmoManager) { + super(gizmoLayer); + this._meshAttached = null; + this._nodeAttached = null; + this._incrementalSnap = false; + this._sensitivity = 1; + this._observables = []; + this._gizmoAxisCache = new Map; + this.onDragStartObservable = new Observable; + this.onDragObservable = new Observable; + this.onDragEndObservable = new Observable; + this.uniformScaleGizmo = this._createUniformScaleMesh(); + this.xGizmo = new AxisScaleGizmo(new Vector3(1, 0, 0), Color3.Red().scale(0.5), gizmoLayer, this, thickness); + this.yGizmo = new AxisScaleGizmo(new Vector3(0, 1, 0), Color3.Green().scale(0.5), gizmoLayer, this, thickness); + this.zGizmo = new AxisScaleGizmo(new Vector3(0, 0, 1), Color3.Blue().scale(0.5), gizmoLayer, this, thickness); + [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo9) => { + gizmo9.dragBehavior.onDragStartObservable.add(() => { + this.onDragStartObservable.notifyObservers({}); + }); + gizmo9.dragBehavior.onDragObservable.add(() => { + this.onDragObservable.notifyObservers({}); + }); + gizmo9.dragBehavior.onDragEndObservable.add(() => { + this.onDragEndObservable.notifyObservers({}); + }); + }); + this.attachedMesh = null; + this.attachedNode = null; + if (gizmoManager) { + gizmoManager.addToAxisCache(this._gizmoAxisCache); + } else { + Gizmo.GizmoAxisPointerObserver(gizmoLayer, this._gizmoAxisCache); + } + } + _createUniformScaleMesh() { + this._coloredMaterial = new StandardMaterial("", this.gizmoLayer.utilityLayerScene); + this._coloredMaterial.diffuseColor = Color3.Gray(); + this._hoverMaterial = new StandardMaterial("", this.gizmoLayer.utilityLayerScene); + this._hoverMaterial.diffuseColor = Color3.Yellow(); + this._disableMaterial = new StandardMaterial("", this.gizmoLayer.utilityLayerScene); + this._disableMaterial.diffuseColor = Color3.Gray(); + this._disableMaterial.alpha = 0.4; + const uniformScaleGizmo = new AxisScaleGizmo(new Vector3(0, 1, 0), Color3.Gray().scale(0.5), this.gizmoLayer, this); + uniformScaleGizmo.updateGizmoRotationToMatchAttachedMesh = false; + uniformScaleGizmo.uniformScaling = true; + this._uniformScalingMesh = CreatePolyhedron("uniform", { type: 1 }, uniformScaleGizmo.gizmoLayer.utilityLayerScene); + this._uniformScalingMesh.scaling.scaleInPlace(0.01); + this._uniformScalingMesh.visibility = 0; + this._octahedron = CreatePolyhedron("", { type: 1 }, uniformScaleGizmo.gizmoLayer.utilityLayerScene); + this._octahedron.scaling.scaleInPlace(0.007); + this._uniformScalingMesh.addChild(this._octahedron); + uniformScaleGizmo.setCustomMesh(this._uniformScalingMesh, true); + const light4 = this.gizmoLayer._getSharedGizmoLight(); + light4.includedOnlyMeshes = light4.includedOnlyMeshes.concat(this._octahedron); + const cache = { + gizmoMeshes: [this._octahedron, this._uniformScalingMesh], + colliderMeshes: [this._uniformScalingMesh], + material: this._coloredMaterial, + hoverMaterial: this._hoverMaterial, + disableMaterial: this._disableMaterial, + active: false, + dragBehavior: uniformScaleGizmo.dragBehavior + }; + this.addToAxisCache(uniformScaleGizmo._rootMesh, cache); + return uniformScaleGizmo; + } + set updateGizmoRotationToMatchAttachedMesh(value) { + if (!value) { + Logger.Warn("Setting updateGizmoRotationToMatchAttachedMesh = false on scaling gizmo is not supported."); + } else { + this._updateGizmoRotationToMatchAttachedMesh = value; + [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo9) => { + if (gizmo9) { + gizmo9.updateGizmoRotationToMatchAttachedMesh = value; + } + }); + } + } + get updateGizmoRotationToMatchAttachedMesh() { + return this._updateGizmoRotationToMatchAttachedMesh; + } + set anchorPoint(value) { + this._anchorPoint = value; + [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo9) => { + if (gizmo9) { + gizmo9.anchorPoint = value; + } + }); + } + get anchorPoint() { + return this._anchorPoint; + } + get customRotationQuaternion() { + return this._customRotationQuaternion; + } + set customRotationQuaternion(customRotationQuaternion) { + this._customRotationQuaternion = customRotationQuaternion; + [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo9) => { + if (gizmo9) { + gizmo9.customRotationQuaternion = customRotationQuaternion; + } + }); + } + set coordinatesMode(coordinatesMode) { + if (coordinatesMode == GizmoCoordinatesMode.World) { + Logger.Warn("Setting coordinates Mode to world on scaling gizmo is not supported."); + } + [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo9) => { + gizmo9.coordinatesMode = GizmoCoordinatesMode.Local; + }); + } + set snapDistance(value) { + this._snapDistance = value; + [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo9) => { + if (gizmo9) { + gizmo9.snapDistance = value; + } + }); + } + get snapDistance() { + return this._snapDistance; + } + set incrementalSnap(value) { + this._incrementalSnap = value; + [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo9) => { + if (gizmo9) { + gizmo9.incrementalSnap = value; + } + }); + } + get incrementalSnap() { + return this._incrementalSnap; + } + set scaleRatio(value) { + this._scaleRatio = value; + [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo9) => { + if (gizmo9) { + gizmo9.scaleRatio = value; + } + }); + } + get scaleRatio() { + return this._scaleRatio; + } + set sensitivity(value) { + this._sensitivity = value; + [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo9) => { + if (gizmo9) { + gizmo9.sensitivity = value; + } + }); + } + get sensitivity() { + return this._sensitivity; + } + addToAxisCache(mesh39, cache) { + this._gizmoAxisCache.set(mesh39, cache); + } + dispose() { + [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach((gizmo9) => { + if (gizmo9) { + gizmo9.dispose(); + } + }); + this._observables.forEach((obs) => { + this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(obs); + }); + this.onDragStartObservable.clear(); + this.onDragObservable.clear(); + this.onDragEndObservable.clear(); + [this._uniformScalingMesh, this._octahedron].forEach((msh) => { + if (msh) { + msh.dispose(); + } + }); + [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach((matl) => { + if (matl) { + matl.dispose(); + } + }); + } +} +var init_scaleGizmo = __esm(() => { + init_logger(); + init_observable(); + init_math_vector(); + init_math_color(); + init_polyhedronBuilder(); + init_gizmo(); + init_axisScaleGizmo(); + init_utilityLayerRenderer(); + init_standardMaterial(); +}); + +// node_modules/@babylonjs/core/Gizmos/gizmoManager.js +class GizmoManager { + get keepDepthUtilityLayer() { + return this._defaultKeepDepthUtilityLayer; + } + get utilityLayer() { + return this._defaultUtilityLayer; + } + get isHovered() { + let hovered = false; + for (const key in this.gizmos) { + const gizmo10 = this.gizmos[key]; + if (gizmo10 && gizmo10.isHovered) { + hovered = true; + break; + } + } + return hovered; + } + set scaleRatio(value) { + this._scaleRatio = value; + [this.gizmos.positionGizmo, this.gizmos.rotationGizmo, this.gizmos.scaleGizmo].forEach((gizmo10) => { + if (gizmo10) { + gizmo10.scaleRatio = value; + } + }); + } + get scaleRatio() { + return this._scaleRatio; + } + set coordinatesMode(coordinatesMode) { + this._coordinatesMode = coordinatesMode; + [this.gizmos.positionGizmo, this.gizmos.rotationGizmo, this.gizmos.scaleGizmo].forEach((gizmo10) => { + if (gizmo10) { + gizmo10.coordinatesMode = coordinatesMode; + } + }); + } + get coordinatesMode() { + return this._coordinatesMode; + } + constructor(_scene, thickness = 1, utilityLayer = UtilityLayerRenderer.DefaultUtilityLayer, keepDepthUtilityLayer = UtilityLayerRenderer.DefaultKeepDepthUtilityLayer) { + this._scene = _scene; + this.clearGizmoOnEmptyPointerEvent = false; + this.enableAutoPicking = true; + this.onAttachedToMeshObservable = new Observable; + this.onAttachedToNodeObservable = new Observable; + this._gizmosEnabled = { positionGizmo: false, rotationGizmo: false, scaleGizmo: false, boundingBoxGizmo: false }; + this._pointerObservers = []; + this._attachedMesh = null; + this._attachedNode = null; + this._boundingBoxColor = Color3.FromHexString("#0984e3"); + this._thickness = 1; + this._scaleRatio = 1; + this._coordinatesMode = GizmoCoordinatesMode.Local; + this._gizmoAxisCache = new Map; + this.boundingBoxDragBehavior = new SixDofDragBehavior; + this.attachableMeshes = null; + this.attachableNodes = null; + this.usePointerToAttachGizmos = true; + this._defaultUtilityLayer = utilityLayer; + this._defaultKeepDepthUtilityLayer = keepDepthUtilityLayer; + this._defaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil = false; + this._thickness = thickness; + this.gizmos = { positionGizmo: null, rotationGizmo: null, scaleGizmo: null, boundingBoxGizmo: null }; + const attachToMeshPointerObserver = this._attachToMeshPointerObserver(_scene); + const gizmoAxisPointerObserver = Gizmo.GizmoAxisPointerObserver(this._defaultUtilityLayer, this._gizmoAxisCache); + this._pointerObservers = [attachToMeshPointerObserver, gizmoAxisPointerObserver]; + } + _attachToMeshPointerObserver(scene20) { + const pointerObserver = scene20.onPointerObservable.add((pointerInfo) => { + if (!this.usePointerToAttachGizmos) { + return; + } + if (pointerInfo.type == PointerEventTypes.POINTERDOWN) { + if (pointerInfo.pickInfo && pointerInfo.pickInfo.pickedMesh) { + if (this.enableAutoPicking) { + let node26 = pointerInfo.pickInfo.pickedMesh; + if (this.attachableMeshes == null) { + while (node26 && node26.parent != null) { + node26 = node26.parent; + } + } else { + let found = false; + this.attachableMeshes.forEach((mesh39) => { + if (node26 && (node26 == mesh39 || node26.isDescendantOf(mesh39))) { + node26 = mesh39; + found = true; + } + }); + if (!found) { + node26 = null; + } + } + if (node26 instanceof AbstractMesh) { + if (this._attachedMesh != node26) { + this.attachToMesh(node26); + } + } else { + if (this.clearGizmoOnEmptyPointerEvent) { + this.attachToMesh(null); + } + } + } + } else { + if (this.clearGizmoOnEmptyPointerEvent) { + this.attachToMesh(null); + } + } + } + }); + return pointerObserver; + } + attachToMesh(mesh39) { + if (this._attachedMesh) { + this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior); + } + if (this._attachedNode) { + this._attachedNode.removeBehavior(this.boundingBoxDragBehavior); + } + this._attachedMesh = mesh39; + this._attachedNode = null; + for (const key in this.gizmos) { + const gizmo10 = this.gizmos[key]; + if (gizmo10 && this._gizmosEnabled[key]) { + gizmo10.attachedMesh = mesh39; + } + } + if (this.boundingBoxGizmoEnabled && this._attachedMesh) { + this._attachedMesh.addBehavior(this.boundingBoxDragBehavior); + } + this.onAttachedToMeshObservable.notifyObservers(mesh39); + } + attachToNode(node26) { + if (this._attachedMesh) { + this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior); + } + if (this._attachedNode) { + this._attachedNode.removeBehavior(this.boundingBoxDragBehavior); + } + this._attachedMesh = null; + this._attachedNode = node26; + for (const key in this.gizmos) { + const gizmo10 = this.gizmos[key]; + if (gizmo10 && this._gizmosEnabled[key]) { + gizmo10.attachedNode = node26; + } + } + if (this.boundingBoxGizmoEnabled && this._attachedNode) { + this._attachedNode.addBehavior(this.boundingBoxDragBehavior); + } + this.onAttachedToNodeObservable.notifyObservers(node26); + } + set positionGizmoEnabled(value) { + if (value) { + if (!this.gizmos.positionGizmo) { + this.gizmos.positionGizmo = new PositionGizmo(this._defaultUtilityLayer, this._thickness, this); + } + if (this._attachedNode) { + this.gizmos.positionGizmo.attachedNode = this._attachedNode; + } else { + this.gizmos.positionGizmo.attachedMesh = this._attachedMesh; + } + } else if (this.gizmos.positionGizmo) { + this.gizmos.positionGizmo.attachedNode = null; + } + this._gizmosEnabled.positionGizmo = value; + } + get positionGizmoEnabled() { + return this._gizmosEnabled.positionGizmo; + } + set rotationGizmoEnabled(value) { + if (value) { + if (!this.gizmos.rotationGizmo) { + this.gizmos.rotationGizmo = new RotationGizmo(this._defaultUtilityLayer, 32, false, this._thickness, this); + } + if (this._attachedNode) { + this.gizmos.rotationGizmo.attachedNode = this._attachedNode; + } else { + this.gizmos.rotationGizmo.attachedMesh = this._attachedMesh; + } + } else if (this.gizmos.rotationGizmo) { + this.gizmos.rotationGizmo.attachedNode = null; + } + this._gizmosEnabled.rotationGizmo = value; + } + get rotationGizmoEnabled() { + return this._gizmosEnabled.rotationGizmo; + } + set scaleGizmoEnabled(value) { + if (value) { + this.gizmos.scaleGizmo = this.gizmos.scaleGizmo || new ScaleGizmo(this._defaultUtilityLayer, this._thickness, this); + if (this._attachedNode) { + this.gizmos.scaleGizmo.attachedNode = this._attachedNode; + } else { + this.gizmos.scaleGizmo.attachedMesh = this._attachedMesh; + } + } else if (this.gizmos.scaleGizmo) { + this.gizmos.scaleGizmo.attachedNode = null; + } + this._gizmosEnabled.scaleGizmo = value; + } + get scaleGizmoEnabled() { + return this._gizmosEnabled.scaleGizmo; + } + set boundingBoxGizmoEnabled(value) { + if (value) { + this.gizmos.boundingBoxGizmo = this.gizmos.boundingBoxGizmo || new BoundingBoxGizmo(this._boundingBoxColor, this._defaultKeepDepthUtilityLayer); + if (this._attachedMesh) { + this.gizmos.boundingBoxGizmo.attachedMesh = this._attachedMesh; + } else { + this.gizmos.boundingBoxGizmo.attachedNode = this._attachedNode; + } + if (this._attachedMesh) { + this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior); + this._attachedMesh.addBehavior(this.boundingBoxDragBehavior); + } else if (this._attachedNode) { + this._attachedNode.removeBehavior(this.boundingBoxDragBehavior); + this._attachedNode.addBehavior(this.boundingBoxDragBehavior); + } + } else if (this.gizmos.boundingBoxGizmo) { + if (this._attachedMesh) { + this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior); + } else if (this._attachedNode) { + this._attachedNode.removeBehavior(this.boundingBoxDragBehavior); + } + this.gizmos.boundingBoxGizmo.attachedNode = null; + } + this._gizmosEnabled.boundingBoxGizmo = value; + } + get boundingBoxGizmoEnabled() { + return this._gizmosEnabled.boundingBoxGizmo; + } + addToAxisCache(gizmoAxisCache) { + if (gizmoAxisCache.size > 0) { + gizmoAxisCache.forEach((v, k) => { + this._gizmoAxisCache.set(k, v); + }); + } + } + dispose() { + var _a, _b; + this._pointerObservers.forEach((observer2) => { + this._scene.onPointerObservable.remove(observer2); + }); + for (const key in this.gizmos) { + const gizmo10 = this.gizmos[key]; + if (gizmo10) { + gizmo10.dispose(); + } + } + if (this._defaultKeepDepthUtilityLayer !== UtilityLayerRenderer._DefaultKeepDepthUtilityLayer) { + (_a = this._defaultKeepDepthUtilityLayer) === null || _a === undefined || _a.dispose(); + } + if (this._defaultUtilityLayer !== UtilityLayerRenderer._DefaultUtilityLayer) { + (_b = this._defaultUtilityLayer) === null || _b === undefined || _b.dispose(); + } + this.boundingBoxDragBehavior.detach(); + this.onAttachedToMeshObservable.clear(); + } +} +var init_gizmoManager = __esm(() => { + init_observable(); + init_pointerEvents(); + init_abstractMesh(); + init_utilityLayerRenderer(); + init_math_color(); + init_sixDofDragBehavior(); + init_gizmo(); + init_rotationGizmo(); + init_positionGizmo(); + init_scaleGizmo(); + init_boundingBoxGizmo(); +}); + +// node_modules/@babylonjs/core/Lights/shadowLight.js +class ShadowLight extends Light { + constructor() { + super(...arguments); + this._needProjectionMatrixCompute = true; + this._viewMatrix = Matrix.Identity(); + this._projectionMatrix = Matrix.Identity(); + } + _setPosition(value) { + this._position = value; + } + get position() { + return this._position; + } + set position(value) { + this._setPosition(value); + } + _setDirection(value) { + this._direction = value; + } + get direction() { + return this._direction; + } + set direction(value) { + this._setDirection(value); + } + get shadowMinZ() { + return this._shadowMinZ; + } + set shadowMinZ(value) { + this._shadowMinZ = value; + this.forceProjectionMatrixCompute(); + } + get shadowMaxZ() { + return this._shadowMaxZ; + } + set shadowMaxZ(value) { + this._shadowMaxZ = value; + this.forceProjectionMatrixCompute(); + } + computeTransformedInformation() { + if (this.parent && this.parent.getWorldMatrix) { + if (!this.transformedPosition) { + this.transformedPosition = Vector3.Zero(); + } + Vector3.TransformCoordinatesToRef(this.position, this.parent.getWorldMatrix(), this.transformedPosition); + if (this.direction) { + if (!this.transformedDirection) { + this.transformedDirection = Vector3.Zero(); + } + Vector3.TransformNormalToRef(this.direction, this.parent.getWorldMatrix(), this.transformedDirection); + } + return true; + } + return false; + } + getDepthScale() { + return 50; + } + getShadowDirection(faceIndex) { + return this.transformedDirection ? this.transformedDirection : this.direction; + } + getAbsolutePosition() { + return this.transformedPosition ? this.transformedPosition : this.position; + } + setDirectionToTarget(target) { + this.direction = Vector3.Normalize(target.subtract(this.position)); + return this.direction; + } + getRotation() { + this.direction.normalize(); + const xaxis = Vector3.Cross(this.direction, Axis.Y); + const yaxis = Vector3.Cross(xaxis, this.direction); + return Vector3.RotationFromAxis(xaxis, yaxis, this.direction); + } + needCube() { + return false; + } + needProjectionMatrixCompute() { + return this._needProjectionMatrixCompute; + } + forceProjectionMatrixCompute() { this._needProjectionMatrixCompute = true; } _initCache() { @@ -99112,24 +107267,27 @@ class ShadowLight extends Light { return this._projectionMatrix; } } -__decorate2([ - serializeAsVector3() -], ShadowLight.prototype, "position", null); -__decorate2([ - serializeAsVector3() -], ShadowLight.prototype, "direction", null); -__decorate2([ - serialize() -], ShadowLight.prototype, "shadowMinZ", null); -__decorate2([ - serialize() -], ShadowLight.prototype, "shadowMaxZ", null); - -// node_modules/@babylonjs/core/Lights/directionalLight.js -Node2.AddNodeConstructor("Light_Type_1", (name95, scene20) => { - return () => new DirectionalLight(name95, Vector3.Zero(), scene20); +var init_shadowLight = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_light(); + init_math_axis(); + __decorate2([ + serializeAsVector3() + ], ShadowLight.prototype, "position", null); + __decorate2([ + serializeAsVector3() + ], ShadowLight.prototype, "direction", null); + __decorate2([ + serialize() + ], ShadowLight.prototype, "shadowMinZ", null); + __decorate2([ + serialize() + ], ShadowLight.prototype, "shadowMaxZ", null); }); +// node_modules/@babylonjs/core/Lights/directionalLight.js class DirectionalLight extends ShadowLight { get shadowFrustumSize() { return this._shadowFrustumSize; @@ -99169,8 +107327,8 @@ class DirectionalLight extends ShadowLight { set orthoBottom(bottom) { this._orthoBottom = bottom; } - constructor(name95, direction, scene20) { - super(name95, scene20); + constructor(name96, direction, scene20) { + super(name96, scene20); this._shadowFrustumSize = 0; this._shadowOrthoScale = 0.1; this.autoUpdateExtends = true; @@ -99294,33 +107452,44 @@ class DirectionalLight extends ShadowLight { defines["DIRLIGHT" + lightIndex] = true; } } -__decorate2([ - serialize() -], DirectionalLight.prototype, "shadowFrustumSize", null); -__decorate2([ - serialize() -], DirectionalLight.prototype, "shadowOrthoScale", null); -__decorate2([ - serialize() -], DirectionalLight.prototype, "autoUpdateExtends", undefined); -__decorate2([ - serialize() -], DirectionalLight.prototype, "autoCalcShadowZBounds", undefined); -__decorate2([ - serialize("orthoLeft") -], DirectionalLight.prototype, "_orthoLeft", undefined); -__decorate2([ - serialize("orthoRight") -], DirectionalLight.prototype, "_orthoRight", undefined); -__decorate2([ - serialize("orthoTop") -], DirectionalLight.prototype, "_orthoTop", undefined); -__decorate2([ - serialize("orthoBottom") -], DirectionalLight.prototype, "_orthoBottom", undefined); +var init_directionalLight = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_node(); + init_light(); + init_shadowLight(); + Node2.AddNodeConstructor("Light_Type_1", (name96, scene20) => { + return () => new DirectionalLight(name96, Vector3.Zero(), scene20); + }); + __decorate2([ + serialize() + ], DirectionalLight.prototype, "shadowFrustumSize", null); + __decorate2([ + serialize() + ], DirectionalLight.prototype, "shadowOrthoScale", null); + __decorate2([ + serialize() + ], DirectionalLight.prototype, "autoUpdateExtends", undefined); + __decorate2([ + serialize() + ], DirectionalLight.prototype, "autoCalcShadowZBounds", undefined); + __decorate2([ + serialize("orthoLeft") + ], DirectionalLight.prototype, "_orthoLeft", undefined); + __decorate2([ + serialize("orthoRight") + ], DirectionalLight.prototype, "_orthoRight", undefined); + __decorate2([ + serialize("orthoTop") + ], DirectionalLight.prototype, "_orthoTop", undefined); + __decorate2([ + serialize("orthoBottom") + ], DirectionalLight.prototype, "_orthoBottom", undefined); +}); // node_modules/@babylonjs/core/Meshes/Builders/hemisphereBuilder.js -function CreateHemisphere(name95, options = {}, scene20) { +function CreateHemisphere(name96, options = {}, scene20) { if (!options.diameter) { options.diameter = 1; } @@ -99332,22 +107501,27 @@ function CreateHemisphere(name95, options = {}, scene20) { disc.rotation.x = -Math.PI / 2; disc.parent = halfSphere; const merged = Mesh.MergeMeshes([disc, halfSphere], true); - merged.name = name95; + merged.name = name96; return merged; } -Mesh.CreateHemisphere = (name95, segments, diameter, scene20) => { - const options = { - segments, - diameter +var HemisphereBuilder; +var init_hemisphereBuilder = __esm(() => { + init_mesh(); + init_sphereBuilder(); + init_discBuilder(); + HemisphereBuilder = { + CreateHemisphere + }; + Mesh.CreateHemisphere = (name96, segments, diameter, scene20) => { + const options = { + segments, + diameter + }; + return CreateHemisphere(name96, options, scene20); }; - return CreateHemisphere(name95, options, scene20); -}; - -// node_modules/@babylonjs/core/Lights/spotLight.js -Node2.AddNodeConstructor("Light_Type_2", (name95, scene20) => { - return () => new SpotLight(name95, Vector3.Zero(), Vector3.Zero(), 0, 0, scene20); }); +// node_modules/@babylonjs/core/Lights/spotLight.js class SpotLight extends ShadowLight { get angle() { return this._angle; @@ -99432,8 +107606,8 @@ class SpotLight extends ShadowLight { this._projectionTextureProjectionLightDirty = false; this._projectionTextureDirty = true; } - constructor(name95, position, direction, angle, exponent, scene20) { - super(name95, scene20); + constructor(name96, position, direction, angle, exponent, scene20) { + super(name96, scene20); this._innerAngle = 0; this._projectionTextureMatrix = Matrix.Zero(); this._projectionTextureLightNear = 0.000001; @@ -99582,30 +107756,42 @@ class SpotLight extends ShadowLight { defines["PROJECTEDLIGHTTEXTURE" + lightIndex] = this.projectionTexture && this.projectionTexture.isReady() ? true : false; } } -__decorate2([ - serialize() -], SpotLight.prototype, "angle", null); -__decorate2([ - serialize() -], SpotLight.prototype, "innerAngle", null); -__decorate2([ - serialize() -], SpotLight.prototype, "shadowAngleScale", null); -__decorate2([ - serialize() -], SpotLight.prototype, "exponent", undefined); -__decorate2([ - serialize() -], SpotLight.prototype, "projectionTextureLightNear", null); -__decorate2([ - serialize() -], SpotLight.prototype, "projectionTextureLightFar", null); -__decorate2([ - serialize() -], SpotLight.prototype, "projectionTextureUpDirection", null); -__decorate2([ - serializeAsTexture("projectedLightTexture") -], SpotLight.prototype, "_projectionTexture", undefined); +var init_spotLight = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_node(); + init_light(); + init_shadowLight(); + init_texture(); + Node2.AddNodeConstructor("Light_Type_2", (name96, scene20) => { + return () => new SpotLight(name96, Vector3.Zero(), Vector3.Zero(), 0, 0, scene20); + }); + __decorate2([ + serialize() + ], SpotLight.prototype, "angle", null); + __decorate2([ + serialize() + ], SpotLight.prototype, "innerAngle", null); + __decorate2([ + serialize() + ], SpotLight.prototype, "shadowAngleScale", null); + __decorate2([ + serialize() + ], SpotLight.prototype, "exponent", undefined); + __decorate2([ + serialize() + ], SpotLight.prototype, "projectionTextureLightNear", null); + __decorate2([ + serialize() + ], SpotLight.prototype, "projectionTextureLightFar", null); + __decorate2([ + serialize() + ], SpotLight.prototype, "projectionTextureUpDirection", null); + __decorate2([ + serializeAsTexture("projectedLightTexture") + ], SpotLight.prototype, "_projectionTexture", undefined); +}); // node_modules/@babylonjs/core/Gizmos/lightGizmo.js class LightGizmo extends Gizmo { @@ -99813,60 +107999,79 @@ class LightGizmo extends Gizmo { return root; } } -LightGizmo._Scale = 0.007; -LightGizmo._CreateLightLines = (levels, scene20) => { - const distFromSphere = 1.2; - const root = new Mesh("root", scene20); - root.rotation.x = Math.PI / 2; - const linePivot = new Mesh("linePivot", scene20); - linePivot.parent = root; - const line = CreateCylinder("line", { - updatable: false, - height: 2, - diameterTop: 0.2, - diameterBottom: 0.3, - tessellation: 6, - subdivisions: 1 - }, scene20); - line.position.y = line.scaling.y / 2 + distFromSphere; - line.parent = linePivot; - if (levels < 2) { - return linePivot; - } - for (let i = 0;i < 4; i++) { - const l2 = linePivot.clone("lineParentClone"); - l2.rotation.z = Math.PI / 4; - l2.rotation.y = Math.PI / 2 + Math.PI / 2 * i; - l2.getChildMeshes()[0].scaling.y = 0.5; - l2.getChildMeshes()[0].scaling.x = l2.getChildMeshes()[0].scaling.z = 0.8; - l2.getChildMeshes()[0].position.y = l2.getChildMeshes()[0].scaling.y / 2 + distFromSphere; - } - if (levels < 3) { - return root; - } - for (let i = 0;i < 4; i++) { - const l2 = linePivot.clone("linePivotClone"); - l2.rotation.z = Math.PI / 2; - l2.rotation.y = Math.PI / 2 * i; - } - if (levels < 4) { - return root; - } - for (let i = 0;i < 4; i++) { - const l2 = linePivot.clone("linePivotClone"); - l2.rotation.z = Math.PI + Math.PI / 4; - l2.rotation.y = Math.PI / 2 + Math.PI / 2 * i; - l2.getChildMeshes()[0].scaling.y = 0.5; - l2.getChildMeshes()[0].scaling.x = l2.getChildMeshes()[0].scaling.z = 0.8; - l2.getChildMeshes()[0].position.y = l2.getChildMeshes()[0].scaling.y / 2 + distFromSphere; - } - if (levels < 5) { +var init_lightGizmo = __esm(() => { + init_math_vector(); + init_math_color(); + init_abstractMesh(); + init_mesh(); + init_gizmo(); + init_utilityLayerRenderer(); + init_standardMaterial(); + init_hemisphericLight(); + init_directionalLight(); + init_sphereBuilder(); + init_hemisphereBuilder(); + init_spotLight(); + init_transformNode(); + init_pointerEvents(); + init_observable(); + init_cylinderBuilder(); + LightGizmo._Scale = 0.007; + LightGizmo._CreateLightLines = (levels, scene20) => { + const distFromSphere = 1.2; + const root = new Mesh("root", scene20); + root.rotation.x = Math.PI / 2; + const linePivot = new Mesh("linePivot", scene20); + linePivot.parent = root; + const line = CreateCylinder("line", { + updatable: false, + height: 2, + diameterTop: 0.2, + diameterBottom: 0.3, + tessellation: 6, + subdivisions: 1 + }, scene20); + line.position.y = line.scaling.y / 2 + distFromSphere; + line.parent = linePivot; + if (levels < 2) { + return linePivot; + } + for (let i = 0;i < 4; i++) { + const l2 = linePivot.clone("lineParentClone"); + l2.rotation.z = Math.PI / 4; + l2.rotation.y = Math.PI / 2 + Math.PI / 2 * i; + l2.getChildMeshes()[0].scaling.y = 0.5; + l2.getChildMeshes()[0].scaling.x = l2.getChildMeshes()[0].scaling.z = 0.8; + l2.getChildMeshes()[0].position.y = l2.getChildMeshes()[0].scaling.y / 2 + distFromSphere; + } + if (levels < 3) { + return root; + } + for (let i = 0;i < 4; i++) { + const l2 = linePivot.clone("linePivotClone"); + l2.rotation.z = Math.PI / 2; + l2.rotation.y = Math.PI / 2 * i; + } + if (levels < 4) { + return root; + } + for (let i = 0;i < 4; i++) { + const l2 = linePivot.clone("linePivotClone"); + l2.rotation.z = Math.PI + Math.PI / 4; + l2.rotation.y = Math.PI / 2 + Math.PI / 2 * i; + l2.getChildMeshes()[0].scaling.y = 0.5; + l2.getChildMeshes()[0].scaling.x = l2.getChildMeshes()[0].scaling.z = 0.8; + l2.getChildMeshes()[0].position.y = l2.getChildMeshes()[0].scaling.y / 2 + distFromSphere; + } + if (levels < 5) { + return root; + } + const l = linePivot.clone("linePivotClone"); + l.rotation.z = Math.PI; return root; - } - const l = linePivot.clone("linePivotClone"); - l.rotation.z = Math.PI; - return root; -}; + }; +}); + // node_modules/@babylonjs/core/Gizmos/cameraGizmo.js class CameraGizmo extends Gizmo { constructor(gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer, gizmoColor) { @@ -100006,23 +108211,65 @@ class CameraGizmo extends Gizmo { return root; } } -CameraGizmo._Scale = 0.05; +var init_cameraGizmo = __esm(() => { + init_math_vector(); + init_math_color(); + init_mesh(); + init_gizmo(); + init_utilityLayerRenderer(); + init_standardMaterial(); + init_boxBuilder(); + init_cylinderBuilder(); + init_math(); + init_linesBuilder(); + init_pointerEvents(); + init_observable(); + CameraGizmo._Scale = 0.05; +}); + +// node_modules/@babylonjs/core/Gizmos/index.js +var init_Gizmos = __esm(() => { + init_axisDragGizmo(); + init_axisScaleGizmo(); + init_boundingBoxGizmo(); + init_gizmo(); + init_gizmoManager(); + init_planeRotationGizmo(); + init_positionGizmo(); + init_rotationGizmo(); + init_scaleGizmo(); + init_lightGizmo(); + init_cameraGizmo(); + init_planeDragGizmo(); +}); + // node_modules/@babylonjs/core/Shaders/ShadersInclude/kernelBlurVaryingDeclaration.js -var name95 = "kernelBlurVaryingDeclaration"; -var shader95 = `varying vec2 sampleCoord{X};`; -ShaderStore.IncludesShadersStore[name95] = shader95; +var name96, shader95; +var init_kernelBlurVaryingDeclaration = __esm(() => { + init_shaderStore(); + name96 = "kernelBlurVaryingDeclaration"; + shader95 = `varying vec2 sampleCoord{X};`; + ShaderStore.IncludesShadersStore[name96] = shader95; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/packingFunctions.js -var name96 = "packingFunctions"; -var shader96 = `vec4 pack(float depth) +var name97, shader96; +var init_packingFunctions = __esm(() => { + init_shaderStore(); + name97 = "packingFunctions"; + shader96 = `vec4 pack(float depth) {const vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;} float unpack(vec4 color) {const vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}`; -ShaderStore.IncludesShadersStore[name96] = shader96; + ShaderStore.IncludesShadersStore[name97] = shader96; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/kernelBlurFragment.js -var name97 = "kernelBlurFragment"; -var shader97 = `#ifdef DOF +var name98, shader97; +var init_kernelBlurFragment = __esm(() => { + init_shaderStore(); + name98 = "kernelBlurFragment"; + shader97 = `#ifdef DOF factor=sampleCoC(sampleCoord{X}); computedWeight=KERNEL_WEIGHT{X}*factor;sumOfWeights+=computedWeight; #else @@ -100034,11 +108281,15 @@ blend+=unpack(texture2D(textureSampler,sampleCoord{X}))*computedWeight; blend+=texture2D(textureSampler,sampleCoord{X})*computedWeight; #endif `; -ShaderStore.IncludesShadersStore[name97] = shader97; + ShaderStore.IncludesShadersStore[name98] = shader97; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/kernelBlurFragment2.js -var name98 = "kernelBlurFragment2"; -var shader98 = `#ifdef DOF +var name99, shader98; +var init_kernelBlurFragment2 = __esm(() => { + init_shaderStore(); + name99 = "kernelBlurFragment2"; + shader98 = `#ifdef DOF factor=sampleCoC(sampleCenter+delta*KERNEL_DEP_OFFSET{X});computedWeight=KERNEL_DEP_WEIGHT{X}*factor;sumOfWeights+=computedWeight; #else computedWeight=KERNEL_DEP_WEIGHT{X}; @@ -100049,11 +108300,19 @@ blend+=unpack(texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X})) blend+=texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X})*computedWeight; #endif `; -ShaderStore.IncludesShadersStore[name98] = shader98; + ShaderStore.IncludesShadersStore[name99] = shader98; +}); // node_modules/@babylonjs/core/Shaders/kernelBlur.fragment.js -var name99 = "kernelBlurPixelShader"; -var shader99 = `uniform sampler2D textureSampler;uniform vec2 delta;varying vec2 sampleCenter; +var name100, shader99; +var init_kernelBlur_fragment = __esm(() => { + init_shaderStore(); + init_kernelBlurVaryingDeclaration(); + init_packingFunctions(); + init_kernelBlurFragment(); + init_kernelBlurFragment2(); + name100 = "kernelBlurPixelShader"; + shader99 = `uniform sampler2D textureSampler;uniform vec2 delta;varying vec2 sampleCenter; #ifdef DOF uniform sampler2D circleOfConfusionSampler;float sampleCoC(in vec2 offset) {float coc=texture2D(circleOfConfusionSampler,offset).r;return coc; } #endif @@ -100089,16 +108348,26 @@ gl_FragColor=blend; gl_FragColor/=sumOfWeights; #endif }`; -ShaderStore.ShadersStore[name99] = shader99; + ShaderStore.ShadersStore[name100] = shader99; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/kernelBlurVertex.js -var name100 = "kernelBlurVertex"; -var shader100 = `sampleCoord{X}=sampleCenter+delta*KERNEL_OFFSET{X};`; -ShaderStore.IncludesShadersStore[name100] = shader100; +var name101, shader100; +var init_kernelBlurVertex = __esm(() => { + init_shaderStore(); + name101 = "kernelBlurVertex"; + shader100 = `sampleCoord{X}=sampleCenter+delta*KERNEL_OFFSET{X};`; + ShaderStore.IncludesShadersStore[name101] = shader100; +}); // node_modules/@babylonjs/core/Shaders/kernelBlur.vertex.js -var name101 = "kernelBlurVertexShader"; -var shader101 = `attribute vec2 position;uniform vec2 delta;varying vec2 sampleCenter; +var name102, shader101; +var init_kernelBlur_vertex = __esm(() => { + init_shaderStore(); + init_kernelBlurVaryingDeclaration(); + init_kernelBlurVertex(); + name102 = "kernelBlurVertexShader"; + shader101 = `attribute vec2 position;uniform vec2 delta;varying vec2 sampleCenter; #include[0..varyingCount] const vec2 madd=vec2(0.5,0.5); #define CUSTOM_VERTEX_DEFINITIONS @@ -100109,7 +108378,8 @@ sampleCenter=(position*madd+madd); gl_Position=vec4(position,0.0,1.0); #define CUSTOM_VERTEX_MAIN_END }`; -ShaderStore.ShadersStore[name101] = shader101; + ShaderStore.ShadersStore[name102] = shader101; +}); // node_modules/@babylonjs/core/PostProcesses/blurPostProcess.js class BlurPostProcess extends PostProcess { @@ -100142,8 +108412,8 @@ class BlurPostProcess extends PostProcess { getClassName() { return "BlurPostProcess"; } - constructor(name102, direction, kernel, options, camera25, samplingMode = Texture.BILINEAR_SAMPLINGMODE, engine29, reusable, textureType = 0, defines = "", _blockCompilation = false, textureFormat = 5) { - super(name102, "kernelBlur", ["delta", "direction"], ["circleOfConfusionSampler"], options, camera25, samplingMode, engine29, reusable, null, textureType, "kernelBlur", { varyingCount: 0, depCount: 0 }, true, textureFormat); + constructor(name103, direction, kernel, options, camera25, samplingMode = Texture.BILINEAR_SAMPLINGMODE, engine29, reusable, textureType = 0, defines = "", _blockCompilation = false, textureFormat = 5) { + super(name103, "kernelBlur", ["delta", "direction"], ["circleOfConfusionSampler"], options, camera25, samplingMode, engine29, reusable, null, textureType, "kernelBlur", { varyingCount: 0, depCount: 0 }, true, textureFormat); this._blockCompilation = _blockCompilation; this._packedFloat = false; this._staticDefines = ""; @@ -100257,16 +108527,25 @@ class BlurPostProcess extends PostProcess { }, parsedPostProcess, scene20, rootUrl); } } -__decorate2([ - serialize("kernel") -], BlurPostProcess.prototype, "_kernel", undefined); -__decorate2([ - serialize("packedFloat") -], BlurPostProcess.prototype, "_packedFloat", undefined); -__decorate2([ - serializeAsVector2() -], BlurPostProcess.prototype, "direction", undefined); -RegisterClass("BABYLON.BlurPostProcess", BlurPostProcess); +var init_blurPostProcess = __esm(() => { + init_tslib_es62(); + init_postProcess(); + init_texture(); + init_kernelBlur_fragment(); + init_kernelBlur_vertex(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize("kernel") + ], BlurPostProcess.prototype, "_kernel", undefined); + __decorate2([ + serialize("packedFloat") + ], BlurPostProcess.prototype, "_packedFloat", undefined); + __decorate2([ + serializeAsVector2() + ], BlurPostProcess.prototype, "direction", undefined); + RegisterClass("BABYLON.BlurPostProcess", BlurPostProcess); +}); // node_modules/@babylonjs/core/Materials/Textures/mirrorTexture.js class MirrorTexture extends RenderTargetTexture { @@ -100333,8 +108612,8 @@ class MirrorTexture extends RenderTargetTexture { } this.gammaSpace = !scene20.imageProcessingConfiguration.isEnabled || !scene20.imageProcessingConfiguration.applyByPostProcess; } - constructor(name102, size, scene20, generateMipMaps, type = 0, samplingMode = Texture.BILINEAR_SAMPLINGMODE, generateDepthBuffer = true) { - super(name102, size, scene20, generateMipMaps, true, type, false, samplingMode, generateDepthBuffer); + constructor(name103, size, scene20, generateMipMaps, type = 0, samplingMode = Texture.BILINEAR_SAMPLINGMODE, generateDepthBuffer = true) { + super(name103, size, scene20, generateMipMaps, true, type, false, samplingMode, generateDepthBuffer); this.mirrorPlane = new Plane(0, 1, 0, 1); this._transformMatrix = Matrix.Zero(); this._mirrorMatrix = Matrix.Zero(); @@ -100353,11 +108632,11 @@ class MirrorTexture extends RenderTargetTexture { }); const engine29 = scene20.getEngine(); if (engine29.supportsUniformBuffers) { - this._sceneUBO = scene20.createSceneUniformBuffer(`Scene for Mirror Texture (name "${name102}")`); + this._sceneUBO = scene20.createSceneUniformBuffer(`Scene for Mirror Texture (name "${name103}")`); } this.onBeforeBindObservable.add(() => { var _a; - (_a = engine29._debugPushGroup) === null || _a === undefined || _a.call(engine29, `mirror generation for ${name102}`, 1); + (_a = engine29._debugPushGroup) === null || _a === undefined || _a.call(engine29, `mirror generation for ${name103}`, 1); }); this.onAfterUnbindObservable.add(() => { var _a; @@ -100449,9 +108728,16 @@ class MirrorTexture extends RenderTargetTexture { (_a = this._sceneUBO) === null || _a === undefined || _a.dispose(); } } -Texture._CreateMirror = (name102, renderTargetSize, scene20, generateMipMaps) => { - return new MirrorTexture(name102, renderTargetSize, scene20, generateMipMaps); -}; +var init_mirrorTexture = __esm(() => { + init_math_vector(); + init_texture(); + init_renderTargetTexture(); + init_blurPostProcess(); + init_math_plane(); + Texture._CreateMirror = (name103, renderTargetSize, scene20, generateMipMaps) => { + return new MirrorTexture(name103, renderTargetSize, scene20, generateMipMaps); + }; +}); // node_modules/@babylonjs/core/Materials/Textures/cubeTexture.js class CubeTexture extends BaseTexture { @@ -100689,39 +108975,53 @@ class CubeTexture extends BaseTexture { return newCubeTexture; } } -__decorate2([ - serialize() -], CubeTexture.prototype, "url", undefined); -__decorate2([ - serializeAsVector3() -], CubeTexture.prototype, "boundingBoxPosition", undefined); -__decorate2([ - serializeAsVector3() -], CubeTexture.prototype, "boundingBoxSize", null); -__decorate2([ - serialize("rotationY") -], CubeTexture.prototype, "rotationY", null); -__decorate2([ - serialize("files") -], CubeTexture.prototype, "_files", undefined); -__decorate2([ - serialize("forcedExtension") -], CubeTexture.prototype, "_forcedExtension", undefined); -__decorate2([ - serialize("extensions") -], CubeTexture.prototype, "_extensions", undefined); -__decorate2([ - serializeAsMatrix("textureMatrix") -], CubeTexture.prototype, "_textureMatrix", undefined); -__decorate2([ - serializeAsMatrix("textureMatrixRefraction") -], CubeTexture.prototype, "_textureMatrixRefraction", undefined); -Texture._CubeTextureParser = CubeTexture.Parse; -RegisterClass("BABYLON.CubeTexture", CubeTexture); +var init_cubeTexture = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_tools(); + init_math_vector(); + init_baseTexture(); + init_texture(); + init_typeStore(); + init_engine_cubeTexture(); + init_observable(); + __decorate2([ + serialize() + ], CubeTexture.prototype, "url", undefined); + __decorate2([ + serializeAsVector3() + ], CubeTexture.prototype, "boundingBoxPosition", undefined); + __decorate2([ + serializeAsVector3() + ], CubeTexture.prototype, "boundingBoxSize", null); + __decorate2([ + serialize("rotationY") + ], CubeTexture.prototype, "rotationY", null); + __decorate2([ + serialize("files") + ], CubeTexture.prototype, "_files", undefined); + __decorate2([ + serialize("forcedExtension") + ], CubeTexture.prototype, "_forcedExtension", undefined); + __decorate2([ + serialize("extensions") + ], CubeTexture.prototype, "_extensions", undefined); + __decorate2([ + serializeAsMatrix("textureMatrix") + ], CubeTexture.prototype, "_textureMatrix", undefined); + __decorate2([ + serializeAsMatrix("textureMatrixRefraction") + ], CubeTexture.prototype, "_textureMatrixRefraction", undefined); + Texture._CubeTextureParser = CubeTexture.Parse; + RegisterClass("BABYLON.CubeTexture", CubeTexture); +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/backgroundFragmentDeclaration.js -var name102 = "backgroundFragmentDeclaration"; -var shader102 = `uniform vec4 vEyePosition;uniform vec4 vPrimaryColor; +var name103, shader102; +var init_backgroundFragmentDeclaration = __esm(() => { + init_shaderStore(); + name103 = "backgroundFragmentDeclaration"; + shader102 = `uniform vec4 vEyePosition;uniform vec4 vPrimaryColor; #ifdef USEHIGHLIGHTANDSHADOWCOLORS uniform vec4 vPrimaryColorShadow; #endif @@ -100745,19 +109045,45 @@ uniform mat4 view; uniform vec2 projectedGroundInfos; #endif `; -ShaderStore.IncludesShadersStore[name102] = shader102; + ShaderStore.IncludesShadersStore[name103] = shader102; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/backgroundUboDeclaration.js -var name103 = "backgroundUboDeclaration"; -var shader103 = `layout(std140,column_major) uniform;uniform Material +var name104, shader103; +var init_backgroundUboDeclaration = __esm(() => { + init_shaderStore(); + init_sceneUboDeclaration(); + name104 = "backgroundUboDeclaration"; + shader103 = `layout(std140,column_major) uniform;uniform Material {uniform vec4 vPrimaryColor;uniform vec4 vPrimaryColorShadow;uniform vec2 vDiffuseInfos;uniform vec2 vReflectionInfos;uniform mat4 diffuseMatrix;uniform mat4 reflectionMatrix;uniform vec3 vReflectionMicrosurfaceInfos;uniform float fFovMultiplier;uniform float pointSize;uniform float shadowLevel;uniform float alpha;uniform vec3 vBackgroundCenter;uniform vec4 vReflectionControl;uniform vec2 projectedGroundInfos;}; #include `; -ShaderStore.IncludesShadersStore[name103] = shader103; + ShaderStore.IncludesShadersStore[name104] = shader103; +}); // node_modules/@babylonjs/core/Shaders/background.fragment.js -var name104 = "backgroundPixelShader"; -var shader104 = `#ifdef TEXTURELODSUPPORT +var name105, shader104; +var init_background_fragment = __esm(() => { + init_shaderStore(); + init_backgroundFragmentDeclaration(); + init_backgroundUboDeclaration(); + init_helperFunctions(); + init_reflectionFunction(); + init_imageProcessingDeclaration(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_lightsFragmentFunctions(); + init_shadowsFragmentFunctions(); + init_imageProcessingFunctions(); + init_logDepthDeclaration(); + init_clipPlaneFragmentDeclaration(); + init_fogFragmentDeclaration(); + init_clipPlaneFragment(); + init_lightFragment(); + init_logDepthFragment(); + init_fogFragment(); + name105 = "backgroundPixelShader"; + shader104 = `#ifdef TEXTURELODSUPPORT #extension GL_EXT_shader_texture_lod : enable #endif precision highp float; @@ -100969,11 +109295,15 @@ gl_FragColor=color; #define CUSTOM_FRAGMENT_MAIN_END } `; -ShaderStore.ShadersStore[name104] = shader104; + ShaderStore.ShadersStore[name105] = shader104; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/backgroundVertexDeclaration.js -var name105 = "backgroundVertexDeclaration"; -var shader105 = `uniform mat4 view;uniform mat4 viewProjection;uniform float shadowLevel; +var name106, shader105; +var init_backgroundVertexDeclaration = __esm(() => { + init_shaderStore(); + name106 = "backgroundVertexDeclaration"; + shader105 = `uniform mat4 view;uniform mat4 viewProjection;uniform float shadowLevel; #ifdef DIFFUSE uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos; #endif @@ -100984,11 +109314,33 @@ uniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix;uniform vec3 vReflec uniform float pointSize; #endif `; -ShaderStore.IncludesShadersStore[name105] = shader105; + ShaderStore.IncludesShadersStore[name106] = shader105; +}); // node_modules/@babylonjs/core/Shaders/background.vertex.js -var name106 = "backgroundVertexShader"; -var shader106 = `precision highp float; +var name107, shader106; +var init_background_vertex = __esm(() => { + init_shaderStore(); + init_backgroundVertexDeclaration(); + init_backgroundUboDeclaration(); + init_helperFunctions(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_instancesDeclaration(); + init_clipPlaneVertexDeclaration(); + init_fogVertexDeclaration(); + init_lightVxFragmentDeclaration(); + init_lightVxUboDeclaration(); + init_logDepthDeclaration(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + init_fogVertex(); + init_shadowsVertex(); + init_logDepthVertex(); + name107 = "backgroundVertexShader"; + shader106 = `precision highp float; #include<__decl__backgroundVertex> #include attribute vec3 position; @@ -101086,7 +109438,8 @@ gl_PointSize=pointSize; #define CUSTOM_VERTEX_MAIN_END } `; -ShaderStore.ShadersStore[name106] = shader106; + ShaderStore.ShadersStore[name107] = shader106; +}); // node_modules/@babylonjs/core/Materials/Background/backgroundMaterial.js class BackgroundMaterialDefines extends MaterialDefines { @@ -101280,8 +109633,8 @@ class BackgroundMaterial extends PushMaterial { set cameraColorCurves(value) { this.imageProcessingConfiguration.colorCurves = value; } - constructor(name107, scene20) { - super(name107, scene20); + constructor(name108, scene20) { + super(name108, scene20); this.primaryColor = Color3.White(); this._primaryColorShadowLevel = 0; this._primaryColorHighlightLevel = 0; @@ -101752,8 +110105,8 @@ class BackgroundMaterial extends PushMaterial { } super.dispose(forceDisposeEffect); } - clone(name107) { - return SerializationHelper.Clone(() => new BackgroundMaterial(name107, this.getScene()), this); + clone(name108) { + return SerializationHelper.Clone(() => new BackgroundMaterial(name108, this.getScene()), this); } serialize() { const serializationObject = super.serialize(); @@ -101767,133 +110120,153 @@ class BackgroundMaterial extends PushMaterial { return SerializationHelper.Parse(() => new BackgroundMaterial(source.name, scene20), source, scene20, rootUrl); } } -BackgroundMaterial.StandardReflectance0 = 0.05; -BackgroundMaterial.StandardReflectance90 = 0.5; -__decorate2([ - serializeAsColor3() -], BackgroundMaterial.prototype, "_primaryColor", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsLightsDirty") -], BackgroundMaterial.prototype, "primaryColor", undefined); -__decorate2([ - serializeAsColor3() -], BackgroundMaterial.prototype, "__perceptualColor", undefined); -__decorate2([ - serialize() -], BackgroundMaterial.prototype, "_primaryColorShadowLevel", undefined); -__decorate2([ - serialize() -], BackgroundMaterial.prototype, "_primaryColorHighlightLevel", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsLightsDirty") -], BackgroundMaterial.prototype, "primaryColorHighlightLevel", null); -__decorate2([ - serializeAsTexture() -], BackgroundMaterial.prototype, "_reflectionTexture", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], BackgroundMaterial.prototype, "reflectionTexture", undefined); -__decorate2([ - serialize() -], BackgroundMaterial.prototype, "_reflectionBlur", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], BackgroundMaterial.prototype, "reflectionBlur", undefined); -__decorate2([ - serializeAsTexture() -], BackgroundMaterial.prototype, "_diffuseTexture", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], BackgroundMaterial.prototype, "diffuseTexture", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], BackgroundMaterial.prototype, "shadowLights", undefined); -__decorate2([ - serialize() -], BackgroundMaterial.prototype, "_shadowLevel", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], BackgroundMaterial.prototype, "shadowLevel", undefined); -__decorate2([ - serializeAsVector3() -], BackgroundMaterial.prototype, "_sceneCenter", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], BackgroundMaterial.prototype, "sceneCenter", undefined); -__decorate2([ - serialize() -], BackgroundMaterial.prototype, "_opacityFresnel", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], BackgroundMaterial.prototype, "opacityFresnel", undefined); -__decorate2([ - serialize() -], BackgroundMaterial.prototype, "_reflectionFresnel", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], BackgroundMaterial.prototype, "reflectionFresnel", undefined); -__decorate2([ - serialize() -], BackgroundMaterial.prototype, "_reflectionFalloffDistance", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], BackgroundMaterial.prototype, "reflectionFalloffDistance", undefined); -__decorate2([ - serialize() -], BackgroundMaterial.prototype, "_reflectionAmount", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], BackgroundMaterial.prototype, "reflectionAmount", undefined); -__decorate2([ - serialize() -], BackgroundMaterial.prototype, "_reflectionReflectance0", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], BackgroundMaterial.prototype, "reflectionReflectance0", undefined); -__decorate2([ - serialize() -], BackgroundMaterial.prototype, "_reflectionReflectance90", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], BackgroundMaterial.prototype, "reflectionReflectance90", undefined); -__decorate2([ - serialize() -], BackgroundMaterial.prototype, "_useRGBColor", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], BackgroundMaterial.prototype, "useRGBColor", undefined); -__decorate2([ - serialize() -], BackgroundMaterial.prototype, "_enableNoise", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], BackgroundMaterial.prototype, "enableNoise", undefined); -__decorate2([ - serialize() -], BackgroundMaterial.prototype, "_maxSimultaneousLights", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], BackgroundMaterial.prototype, "maxSimultaneousLights", undefined); -__decorate2([ - serialize() -], BackgroundMaterial.prototype, "_shadowOnly", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsLightsDirty") -], BackgroundMaterial.prototype, "shadowOnly", undefined); -__decorate2([ - serializeAsImageProcessingConfiguration() -], BackgroundMaterial.prototype, "_imageProcessingConfiguration", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsMiscDirty") -], BackgroundMaterial.prototype, "enableGroundProjection", undefined); -__decorate2([ - serialize() -], BackgroundMaterial.prototype, "projectedGroundRadius", undefined); -__decorate2([ - serialize() -], BackgroundMaterial.prototype, "projectedGroundHeight", undefined); -RegisterClass("BABYLON.BackgroundMaterial", BackgroundMaterial); +var init_backgroundMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_smartArray(); + init_logger(); + init_math_vector(); + init_buffer(); + init_materialHelper(); + init_materialDefines(); + init_pushMaterial(); + init_imageProcessingConfiguration(); + init_texture(); + init_typeStore(); + init_materialFlags(); + init_math_color(); + init_background_fragment(); + init_background_vertex(); + init_effectFallbacks(); + init_clipPlaneMaterialHelper(); + BackgroundMaterial.StandardReflectance0 = 0.05; + BackgroundMaterial.StandardReflectance90 = 0.5; + __decorate2([ + serializeAsColor3() + ], BackgroundMaterial.prototype, "_primaryColor", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], BackgroundMaterial.prototype, "primaryColor", undefined); + __decorate2([ + serializeAsColor3() + ], BackgroundMaterial.prototype, "__perceptualColor", undefined); + __decorate2([ + serialize() + ], BackgroundMaterial.prototype, "_primaryColorShadowLevel", undefined); + __decorate2([ + serialize() + ], BackgroundMaterial.prototype, "_primaryColorHighlightLevel", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], BackgroundMaterial.prototype, "primaryColorHighlightLevel", null); + __decorate2([ + serializeAsTexture() + ], BackgroundMaterial.prototype, "_reflectionTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], BackgroundMaterial.prototype, "reflectionTexture", undefined); + __decorate2([ + serialize() + ], BackgroundMaterial.prototype, "_reflectionBlur", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], BackgroundMaterial.prototype, "reflectionBlur", undefined); + __decorate2([ + serializeAsTexture() + ], BackgroundMaterial.prototype, "_diffuseTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], BackgroundMaterial.prototype, "diffuseTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], BackgroundMaterial.prototype, "shadowLights", undefined); + __decorate2([ + serialize() + ], BackgroundMaterial.prototype, "_shadowLevel", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], BackgroundMaterial.prototype, "shadowLevel", undefined); + __decorate2([ + serializeAsVector3() + ], BackgroundMaterial.prototype, "_sceneCenter", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], BackgroundMaterial.prototype, "sceneCenter", undefined); + __decorate2([ + serialize() + ], BackgroundMaterial.prototype, "_opacityFresnel", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], BackgroundMaterial.prototype, "opacityFresnel", undefined); + __decorate2([ + serialize() + ], BackgroundMaterial.prototype, "_reflectionFresnel", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], BackgroundMaterial.prototype, "reflectionFresnel", undefined); + __decorate2([ + serialize() + ], BackgroundMaterial.prototype, "_reflectionFalloffDistance", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], BackgroundMaterial.prototype, "reflectionFalloffDistance", undefined); + __decorate2([ + serialize() + ], BackgroundMaterial.prototype, "_reflectionAmount", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], BackgroundMaterial.prototype, "reflectionAmount", undefined); + __decorate2([ + serialize() + ], BackgroundMaterial.prototype, "_reflectionReflectance0", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], BackgroundMaterial.prototype, "reflectionReflectance0", undefined); + __decorate2([ + serialize() + ], BackgroundMaterial.prototype, "_reflectionReflectance90", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], BackgroundMaterial.prototype, "reflectionReflectance90", undefined); + __decorate2([ + serialize() + ], BackgroundMaterial.prototype, "_useRGBColor", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], BackgroundMaterial.prototype, "useRGBColor", undefined); + __decorate2([ + serialize() + ], BackgroundMaterial.prototype, "_enableNoise", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], BackgroundMaterial.prototype, "enableNoise", undefined); + __decorate2([ + serialize() + ], BackgroundMaterial.prototype, "_maxSimultaneousLights", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], BackgroundMaterial.prototype, "maxSimultaneousLights", undefined); + __decorate2([ + serialize() + ], BackgroundMaterial.prototype, "_shadowOnly", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], BackgroundMaterial.prototype, "shadowOnly", undefined); + __decorate2([ + serializeAsImageProcessingConfiguration() + ], BackgroundMaterial.prototype, "_imageProcessingConfiguration", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsMiscDirty") + ], BackgroundMaterial.prototype, "enableGroundProjection", undefined); + __decorate2([ + serialize() + ], BackgroundMaterial.prototype, "projectedGroundRadius", undefined); + __decorate2([ + serialize() + ], BackgroundMaterial.prototype, "projectedGroundHeight", undefined); + RegisterClass("BABYLON.BackgroundMaterial", BackgroundMaterial); +}); // node_modules/@babylonjs/core/Helpers/environmentHelper.js class EnvironmentHelper { @@ -102211,9 +110584,25 @@ class EnvironmentHelper { this._rootMesh.dispose(false); } } -EnvironmentHelper._GroundTextureCDNUrl = "https://assets.babylonjs.com/environments/backgroundGround.png"; -EnvironmentHelper._SkyboxTextureCDNUrl = "https://assets.babylonjs.com/environments/backgroundSkybox.dds"; -EnvironmentHelper._EnvironmentTextureCDNUrl = "https://assets.babylonjs.com/environments/environmentSpecular.env"; +var init_environmentHelper = __esm(() => { + init_observable(); + init_arcRotateCamera(); + init_math_vector(); + init_math_color(); + init_mesh(); + init_baseTexture(); + init_texture(); + init_mirrorTexture(); + init_cubeTexture(); + init_backgroundMaterial(); + init_planeBuilder(); + init_boxBuilder(); + init_math_plane(); + EnvironmentHelper._GroundTextureCDNUrl = "https://assets.babylonjs.com/environments/backgroundGround.png"; + EnvironmentHelper._SkyboxTextureCDNUrl = "https://assets.babylonjs.com/environments/backgroundSkybox.dds"; + EnvironmentHelper._EnvironmentTextureCDNUrl = "https://assets.babylonjs.com/environments/environmentSpecular.env"; +}); + // node_modules/@babylonjs/core/Helpers/textureDome.js class TextureDome extends TransformNode { get texture() { @@ -102271,8 +110660,8 @@ class TextureDome extends TransformNode { get material() { return this._material; } - constructor(name107, textureUrlOrElement, options, scene20, onError = null) { - super(name107, scene20); + constructor(name108, textureUrlOrElement, options, scene20, onError = null) { + super(name108, scene20); this.onError = onError; this._halfDome = false; this._crossEye = false; @@ -102282,7 +110671,7 @@ class TextureDome extends TransformNode { this.onLoadErrorObservable = new Observable; this.onLoadObservable = new Observable; scene20 = this.getScene(); - name107 = name107 || "textureDome"; + name108 = name108 || "textureDome"; options.resolution = Math.abs(options.resolution) | 0 || 32; options.clickToPlay = Boolean(options.clickToPlay); options.autoPlay = options.autoPlay === undefined ? true : Boolean(options.autoPlay); @@ -102298,11 +110687,11 @@ class TextureDome extends TransformNode { } this._setReady(false); if (!options.mesh) { - this._mesh = CreateSphere(name107 + "_mesh", { segments: options.resolution, diameter: options.size, updatable: false, sideOrientation: Mesh.BACKSIDE }, scene20); + this._mesh = CreateSphere(name108 + "_mesh", { segments: options.resolution, diameter: options.size, updatable: false, sideOrientation: Mesh.BACKSIDE }, scene20); } else { this._mesh = options.mesh; } - const material11 = this._material = new BackgroundMaterial(name107 + "_material", scene20); + const material11 = this._material = new BackgroundMaterial(name108 + "_material", scene20); material11.useEquirectangularFOV = true; material11.fovMultiplier = 1; material11.opacityFresnel = false; @@ -102383,9 +110772,19 @@ class TextureDome extends TransformNode { super.dispose(doNotRecurse, disposeMaterialAndTextures); } } -TextureDome.MODE_MONOSCOPIC = 0; -TextureDome.MODE_TOPBOTTOM = 1; -TextureDome.MODE_SIDEBYSIDE = 2; +var init_textureDome = __esm(() => { + init_transformNode(); + init_mesh(); + init_texture(); + init_backgroundMaterial(); + init_sphereBuilder(); + init_observable(); + init_math_vector(); + init_math(); + TextureDome.MODE_MONOSCOPIC = 0; + TextureDome.MODE_TOPBOTTOM = 1; + TextureDome.MODE_SIDEBYSIDE = 2; +}); // node_modules/@babylonjs/core/Helpers/photoDome.js class PhotoDome extends TextureDome { @@ -102412,48 +110811,62 @@ class PhotoDome extends TextureDome { }); } } -PhotoDome.MODE_MONOSCOPIC = TextureDome.MODE_MONOSCOPIC; -PhotoDome.MODE_TOPBOTTOM = TextureDome.MODE_TOPBOTTOM; -PhotoDome.MODE_SIDEBYSIDE = TextureDome.MODE_SIDEBYSIDE; +var init_photoDome = __esm(() => { + init_texture(); + init_textureDome(); + PhotoDome.MODE_MONOSCOPIC = TextureDome.MODE_MONOSCOPIC; + PhotoDome.MODE_TOPBOTTOM = TextureDome.MODE_TOPBOTTOM; + PhotoDome.MODE_SIDEBYSIDE = TextureDome.MODE_SIDEBYSIDE; +}); + // node_modules/@babylonjs/core/Misc/brdfTextureTools.js -var _environmentBRDFBase64Texture = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAgAElEQVR42u29yY5tWXIlZnbuiSaTbZFUkZRKrCKhElASQA0EoQABgn6hJvoXzfUP+gP9hWb6Bg00IgRoQJaKqUxmZmTEe8/v0uB2u7Fm2T7HIyIrnz88uPvt3f2a2WrMbOvf/u3PvvzP/sUf/N6//i8vf/lv/3v5H//d//Sb//Uq/5u8yf8hV/m/5Cp/L1f5hVzlG7nKJ7mKyJuIXN/hPwqXI/g++zq6rPI5u8z+WqfLre+zy7PrVv9L8brsMiGvk8XLmM/sdfHXal4e3ad6GXPdyu2ij8u/+uv/5cuf/OSLfdtEfvUr+dnf/d0X//t3H/7bf/hP//N/928h/0Yg/4VA/kogfyGQP5Wr/IFAvhbIlwK5CGQTPP+9z5uPeePJSW+yo2+s/GtN30Rnv1E+f5zxof9R/lSXv/nr//mrr3+i+5dfyX7ZZQP07Tffys//8R/l/9TtX7790T/7r/8G8pdy+/8XAvnnAvkzgfwzgfyxQP5AIL8vkJ8K5KsmMVzu1U7p5PA5AXxOAJ8TwPf7sX/51ZeXfcemqnp9w/W77/S7X/6T/vzf/7383RWCX3/z05/9i3/13/0PX//eX/2FyP8tIv+PiPy9iPy/IvIzEfm5iPxCRH4lIt/c/393//9BRD6KyKf7f488fP74/PH544dJAF9cLl98IZfLBZtuqterXr/7Dt9982v95S9+Lv+gF/3i7Spv/8lf/vnf/vGf/dF/JfKnIvLnIvLvReQ/NEngn0TklyLy6/v/34jIt00iGJOBlxAsdvv54/PH5493SQCXy9t2ueh2ueimKorrFbjq9eNH+fDtb+TXv/ol/vHyhX4Fxfbx7euPf/Lnf/PfiPyeiPyhiPxxkwB+fk8AvxzQgJcIrGTwFsiAEXH4/PH54/PHUgLY7whgu2C7bLqpQgHB2xvePn6SDx8+6G9+84384vKF/IPu8iVU9Y/+7C/+jWxffiHytYj8VER+X0T+oEEBvxqQwCMJeIngo5EI3goIwVMIPn98/vj8ESaAbbtu2ybbvl8u2ybbdtluSECA65u8ffqIDx8+6G++/VZ/efkV/sO261dQXP7wT/7kX8vl8qXIFyLylbySwe/dE0CLAr65B/9vGn0gQwRMMqgmhM/J4fPH548eAezbZd/lsm3YtssNAYiqiogAAkCvb5/k46cP8u2HD/rrb7+R/2/b9Wu9yJe//8d/9Ney6S5yEZFdRL68/38khG/uKOCnAwoYkcCoEXwkEgGDDq7CeQfyOTl8/vhd1QCum26ybZtu2yabbrKpQvXue1yvuF6v+vbpTT5+/CDffviAX1++1V9sO77WXb/66R/+4V/dgkbllQi+aBLBV/dE8LWRALwkYCWCNyMZXElkwLTMeMkga/P4/PH547ccAVwuctkvdxSw6bbdtYDbTfSZBN7e8PHTR/3u4wf55vKd/nL7DX6mu3791U9//5+/gkNFZGuSgZUQvnKowKgLWLTAQgRtEniTuEfwaELw0MJvf3LQzynud+53uG+X6y3gN9kul+2y6XVT1U27JCDAFVc8ksAn/e7jR/nN5YP+avtWfq6Xy9f7Vz/9w1dgRYngiyYhfNkkgzYBWHTg44AEMmqQUYQKOmDaiCIa8TmsfmzB+DnZDQjgcpGLbti2y3bZHjRAdRMVvb/dcYU8kcDbPQlsH/CrbddfbF98+RPZfvLFnAQeieCRDC5DMvju/vmD4JkEvjRQgKULeGggowdHkAHTYxihg89vu88I5UeGAPSOAFTlrgPopiqbKPSmCKreUoAAkCcSePukHz590m8vH+WbD9/JP335k6/+tA86KxFchv8jMvhiogE4JQm8XhfKqOAqx5qRPyeGzx8/cgSwbXcUoLJtim27C4Oi93+4v6VxQwKAvl2v+Hj9pB8+fZJvt4/yzfbF9lPdv/wJnsE2BogmyeCRED40tGFvksIXiSbgiYSRRpDNDZ6BDI6ghM+J4fPHeyKAO+zX7cb9t4tedMMNAQju5V+f1uAtBSiu1zsduMrHy5t8ePsk3376KN98sX/xE5FPAnm7/782o0DiUINXMkCXCB7/P94/e87AWUmARQWVvgMuKej9t1RLBp+Tw+ePgwngsutFFdu26WXbbl+rSvdfbnqAiuA23QcBgCugV1zl7e1NPm5v+LC96XfbJ/1W9y++fgXjA3bDYXV+MuhRwSPwL3JLMFYC+HS/LU8HYrGwIhwyNOF12SvgM4SgztdifP85MXz+KGsA2C6X7aJ6bXSAOwrY5OYIqGy3d5uq4P5GhABXuV6veLvRAf10fZMPb2/y3b7vX7+g+9v98/WOBq7GG7RNAlYy+Dgkhhb+Xxp0sE8IAC4SGAP/TbgVJK/PoJPBnAiwPKxsXfbbnRg+i3s/JAK4Q/4b9NfLtomBAqCickMBjy7BuywAUVyv8na94tMjCVzf9KNcLl/0SeA6oAEYb1i9g+FtSALb/bKL8/+t+wxXFMyswqiHoK4ToIgKqslgpg1qUC0QoYbvJZg/B/q5v4szHmPX7YEAsD0CX25OwEUVm9xag1+agKg+nxQArnKjAtDr9U0+Xd/k4/UqH7bL5YsewrcBBiMJZPRAp6TwQgWfjM9vgRbgUYGL8AvLWH2gqhesCokeUmCSwPsnhs8fP2YNYMO2XeSmAWxy2VQaXeDmDIhApf33rD4PTUCuV+DtCn27XuXT5ir8VmCJ2G5BpBM8/r/dEcJb8/0lEQMtJHA5TAlqNuLRhJChhEpSqFabH3di+G1AGj+W1/dyAR4IYJNNnuLf6+tWC9CHHiAtFhAIFLjK2/Uqn65X+SS67aK+3QeTDoy/IG2ogQ7fb/dAtz5vBgrYGqrwNtCHsVfgIvwK07OTQBURVNCBFpKCOjqCHn5L/67TgTN+fpySAC56nwSUi256kXsSuFGAVyLoUIDo8/Pz7fdoErr/v17lk162HbgHvFpIYDfoAJJfW4sGPjkU4VNAF8ZEcLmLhdc7kljdY1y1Dq9yLiI4IiRqcLujb138KIPn80ejATwRwIbtBvn1cqv+2J78/5EI5N4cJA8qIPcmwRsKAHDF9WYP6mV7VmrgLuTpxYTcMEW0LAmoQxFsuvAI8tv/a/C5fV2ZMMiKg++FCM7RDPRu8ebWY7VG6VJi+Bzk35MI2LsAckMAgwvQ0gC5DQjd3ABg2HQLAPpEAlZ1Bu7VV7MGHDFRAbo3VKsTbAY9sPWC/uvx86gBbDK3D1eEQS8pbAeSgSwmhepnJb6uBv/o/PzHLzxWA/X7TH77De5j6AGQi6o0CUGfCOD2X7cXAlCFQABtEsGLDtxuOyQB2UTQBKZe5GUPXgkUYCUAbZJRhBDeuq8xBf+bgwbehDm+BFQi2IJksOocvA8ysIMfxluVcRsY/eB3JzH8GFDAXQO48X/dcIf9jyDHptIigDsFkEe066tBSETQUYF7ElDdYEBytN4+rk9UcBPfrKaZqFHWcw3i4J8/X4ev2//bSXqAhwTay6OEIPLD2Ipt8OtAGzxkwLw9WVFRjTc/qC6H3+YK/b1oAA0KuOizHfieCLaHHiAb5NYTIC9EMEbZrVEQt1xwhVy1UfBh8PUOquMizwaap3tQXfY5B//tea/NZdfhsvbz+PURQTDSGWB87VX/7WSd4KxjUqrIgE0IUkoKGnhIvwvawpGf6eECXJ7tv4qbA7DJgwpsKthEmmYgfaAAffYF3HLxo0vwNjJ0SwRWMG4db4eh1gPNm18vQ+us/0eGmxDemu/fnM/X4evq/8342ksGHgLY5LyT/zg0wM8lcMjgGFXwqIOVFJBQw99eCvF9oZL9Mfl3QwAvIXDsBRC9R+fz8x0FPBLB0xJEpwUobrfAkARgIAF41h3wQgP6QAmX5E/7eI43IxGwwf/moIkRyWRJQIPgt9CA9b39nzt4bYUWjAlCjWDPgv8IEjgLJfzuaAsrv9VdVG4OwOXW/fdoA35qAdL0BDwvf6AAUVHd8LIEu94A3K+Q+2YxaB84MOH62P//qoo38fCRDERE2zf0JfmDa+MieElAjcDPKz+mRKCOtdgGtXaBjgNJ4H2owSpNeAW/rRH4CaHSpMwnBYYycjgSJwfie9CR6mPu20Uv8kABF206AvXlBMiIBPSlB9wjBW1fwEuSb94296VCqgMaGCt/G1BbExi3IG+r3a3J6P48Gv/J0YmEYoiGY7V/SxwFCwGoE/xa0AJ0CEiV9QPCJb1OJ5F1VTjEY2/MO9AEJvj1BJTQpqLfTlGwjABuzT962e4IoKnyrdh3+/6mzDVJ4PHOxj0JqGKoy20+wBMN6D1gLWi9NQHfVP5MEEPzjGYy8BMAOnTAJgEr8HUIejRo5xrA5xkR5AngmiSHs+zDDAmMgWzTg55GSJEmHE8IvWPAoYTfhWak/Wn/bQ0CGLSAjv83SUEfKp5q24LXuQICpzrjrgWoza8xVE00CQCORdhMJuTUT/rjuls0gO4Iby8BIEgK6gS7BsGuTtDrScH/fR68biUHNVGBnxjeNyHEvQe/ve3LZQqgG3rof6cEclsNflG9J4KtaQ8WHcVBHS1BtHE4QP9OBMS98mpbKTeDW7dJwRsnHpMBTFJpV4I+b0kY/NqInVFSyBLANbnMSgBM8F+Fqfxq/h657/Up+GaBnwV9hRqc9bZ/vA6vu+T9E8KPJWns94UfTeCj2QXwCHS9dNL8Xf3Ho/rfewSeFODGDV69AU0y6NFAE1DP3qK++rdB7/1HRxf86gT376zOr99T/h/ioBiXWQkgQgVeIrCC/WomhDmQK+hASI2ARQZKooHMLdCJwGEBBXC3+uERwg+VOHZ9ioAt9H80AI06wGgJ3nQA3BoCut6AhxYwgcPOFnxuFnrphk+NIKIGrWPQtgz3b0i7Y6D5rs1GKqTop0nQX52vmQC4BkjA+r4a7Kx9WLENGeegkhSETBCrNXIMdi/444Rw1n6E96ry7OPuj8UfLxtQ78NA2iSBbg7gIiIbdDLsb5agPhLC3RkYKv8NDbS2YGsatNRAG2oQwf9ZIOydgy1MAzBkAw8UwEEIDzSAqdPQ6za0PkeJAMH3Z0wXniUSZoHvBXU2mcjQgv56TedIKglCpIoQfgwCIjOytd8WgN0bfxoR8Fn9Gx0Aj5Zgq0lIZbsH/ibSJoFnS+C98g9ooHEELI3gliy25yONIiE6pb0NfBlyNEYyENoodkKwgl6I6s8kARgJ4ZoEfuYWHLEJa0LhSBXm7kImGeSfVdoJ1DO2G7WXsehAptupSOoyrCSF904k+6vt98X/ZcM98Hsd4JYIXhQAIg3/f9AAUYhsLQKAtkHVBnzjCKhOoYl2ym+iBtvzDzQ2DLXJ4PUmbJHAVnBQX4jkxfvHhNDqAdHXGQJgv0aSDGItgOseHIU+K9hXnIJzkoGlEKzNHagTdJ6VWEUH4iCKH4fd2AwDPaYBm4Wgng4gQ9V/CoGiuNmD04AQtNGMGzSAAQ2I2pzfogY9LRh7BrbOh4+D30sAencljFu2CUFrwY8UAWRfWwGvVOVfbx2uIILM0pwDv082dUTw8hYs8L+uIWiHGpWgClnAa1lMPJogovvvbePPs/q3Xr++kgCsfgB5oQF9WYKPJqEn6G+OE3i5AqouF59FQOmahQC8rlPLj38kg1c2f30vw+XaoIX24/pMGIgSBoZqoH3wo0sIIGlA9PWcCPrAtpPB8eBf6x1o6cHra+2+tpIFP4PgBfxZtZUJfo4qxELT948D9ucK8Mt9+ccjIQw6QJcEbrD/1g340ATuDgDkFfx6twSf1f9xvuBECYxq/7ythQQGm+5JDx6Brw4CkMGT3wgscCUoQ4sU2t6DR2ciBjTgtcpenQoZVX9NuL4Owc+dVaDursYVkVALX+shjSBKBuvCYDUZjE5BdNkxdHAUBexyHwB6NP7Iyw7sxUDViwge1t+mz8B/LAvVx/c3PeBBCToB8IUGOgqA3iV4yUg6UAOxaUFHDx6CYS8SorMOue0CCJGAf5YfRhoAI+A1CvwxqNkAY5yAIx2EQmkFfeWOXi+nEdSQQA0ZHMEItiagJArQxDXIrj8nCfQi4HZPAttrIahso9oPQ/2/JwV5JQU8zw+7I4D7/sBn4EO6rjw0FR+i3Z9fHtahzsFvJgM0X+tmVH5vaYiNDGAigewAz+gyNLThnjCURQFR1b9d3lZvnVqmj9mEPDKIUIC4KCCjBXywS4N+otp/Hk3QVthOkwEKlV9PQwXjT7s/zwF4Qf9toAAzFdjuaEB6S7D1//U5FIQu2MevO0rQQH8ZmoXE6B/IkgE60XCjVoq8gt2iCG0S8L5GdxkM1cGsfsCMArSCAnrr7dzAZxCEEpepvB8tqHJ/q+bmJGGts/AcAXFOMMeTwC7Pw0B6CtCtA2vWgonqBQJFSwH0JQK29OB2kvgj2HHXAoyeAIsCQO0kMNECAhFMqCBf8mElAkyBbX1tJQP2RJ/ha0gpAfS9l+/5n00CkrQpq0MZbOdAuxmMvHswog62jZj7BnYQe19b14kxNq2D/ehX/p68HEcF+x3yP7z/V/A/q/5DA3i5A/dzA5pdgbKp3v3/wQF4Bb70WkCTHGRAA6+KL0bFl6FJaFw0ImZwm6igSwbbwPn9RMBWf3sN2JgA/BVh/Rg0kQBgePf6HglAHLFQwqQQOwDjbdVxNZjR4iM6Qa3WxwvNxh0JFb3g/WzFQQS8b/ttKcDWoABtUMAd8j9hf0MB2uDXhzX4CHj03L9DBU3Qjz0C0l4mLSLQPicOOwZoVCB6P6dA7nDbGkVuxcNr8PU2JQO4wX5trEqmccZaHU4q8oCDFOpzAnOwqyMIMktNNNAHouDGxO37DgArQZzlmp/14W1QlqHTMaIIx7SCx0+5yza7AKJ3IXBrNAHVDcMZAU/BT/vgv/ULPOA+XiLggAREDF2g0ci6xNDRglegd7P7TWWH5oJfayliEg7bScQRBVgI4Ookg/F6rvpLWP29swREqA3CaG8/FpKqS8DTAV4TiBqIqtxfzaQRLys5I0XEFIFrPbZRQb+16Fgi2LvJv8EFUPW1gGfQv1T/F/d/HBnccP7rAwnIIyHI4ArgWeGbU4eHy6Tx/EeTZIb5bo/BsMBjmjBE08f/RB0PHYBd9eVRAGY7cHRwiBf8WeCPHY1bgBTa9xKTELzEkQX9CPtl0gJiqsAmCT7I8xbjivh3JGFI+D2nBcSJQJ8agDX+O9iBL7UfG4bzAkcaICrbtYHz1ycSmGmAjJfL3CMgT3tQpmrfB7gxSzC1DnvdhQMieG47u75+kTouKNkM8c/+vq/Q7ZYjO/hhVvRq8F/9gGfhP8aqE9EIdR6LTwJ1h0BItyDqB8iFwuNqASscRnYioxOg9ApvnYA35f8e9Ohbfe8J4rknoFkO0lmA2gmAG0YK0DkB4ieEjiLoMD8wBzom27ANZkzIoU8EMHk/uo1mzeVoEoRWKn8L/62EYAX/lsB7D/LXg74uAMr9oGivJ0CNJCGD6i9DhZdQF+gtOp4S+NODRzsDVbhdgv4BqTMNyIL9SCKwL9/FGPp5oQKxIf8A/UX6r231H7YIqLML0Ae2GtrADOvRQH5b/MPE9dt9BGLNG8jVTAQvIaK5TtvvvWQgDvyXIClUA78S9Nfg7VtIBlO7cbsEYkQDMot+ygQ7QwmOawTHnAM2XUSnJvPIYRYMmYPS+sv3J+cfP3d04JYIXsF/EwMbBKB9Q9AY+BiSwFj9mzrSXmcJhFPVHySTbgHJCPvRQ/z7G/SVUETsg0ZF+i3CRoCjhf7y1A9mOiDD7TwdwEoEXjLwAv+avLE2B7Jnb+OqDpBoAchoQJskxKnss0vu7Q2YhcDv4ySeLOg9GsCKiUIihP7yfW7zbTsBh0TQfN0iAWn9f72Z56/Ax9P7j5OAH/Qvv3/QxKfk0DgDuP+R3USg3bzBC7bO/QT9Eeh9QvDPG7glBQzJwK740lAFFgFk8P88CqDGAa223YckWYhr+c0BPdwetl2ocnsfzePAWcVnnAIp6gDVhDLyfV4nqFEDPxHsbWD3k4BDkN+pARqKMLYBPzYEvxp9xmCHQQdgWH/9EtH2TIFpu3AH/cdGydv1j0TQbRrq+D/mLcX3ZACZ15bF378CG0My6Kq/zoGOQwhASDFwFbxyNGBuSxbCEhQ/uEPe/6gAERWQObCVVfjPpQX+rexxYhYFxIkgpgX7Y/vPs+Pvxf9vwt8kAs7i32t3QCP+3SPaTwIytQXP38u0PESm+YER+o9B3vr8mETAUfDrEkPI80ck0FZ0dXh9U+HRbhey0cAc2H7A4y4egoD6y8JfkBiigLdFP8v2W00E8deT2IeAKujZ/QAVKpAtKI20gLWksHedfgPcb+0+NEHefd9vB9rayi8h7J91gBbaw20MsnWAF5xHkyDUCOoXp+yrOwwxcKj0aL6fFppaaKDv6OpHR5sgx5BAlK/+fYhuP1D196o8e7lFBaKqv5YIMnFQpd0FGVR35RJCnCDaABaXBtgbiSwtICMtalKC+1JQ6bx/PLcDPQL91QFodQNKpwOgF/9eqcBxBBqRcKAAVk+ArQOMx1RYGgB6naDhlK+uQQwJYx4meQbxtNnYQwMjt/d4f3M9ZE4UOld1LAh99fbfzOxiEkKFCkTJIUIMUeVnJ/9sDt8/e1NEJOi9oVHDGYhgnSLss9DX2IAqw1zALUncKcDr0FB5NP+0cBQNrEezDiyiADPkt9qGpwoPdL0AGPx/NOKeyf3b9WJNdfcFv6bKd2cLMJVfJ6Y3B6wB9WFUfWWEwKMfGiQL+3bz9XGQz2EHKhF41GCtZyDi/gUCsNhYoAr3UNJ58YidHKqnMb/6AB5J4N73/4L+t7mAkeeP3P+1LNSB/l0SkMEd8DcEuUlguEw6t2AU/PCE/q++Akw6QFf1u6SBrj1ZnnhG50AfkoGIdf7gJv1KcSfgzWWkQ9U33Z3tHXYASKJ9e/YhU90rvD+q9Ej69/wxYJVs506Eg/r3DkMDzEdDBRGgcZay49XihLA30P+l8N+hf1f57/0AoxbQbwYaan/rBMirE9Dk+sBzTkC8JNDEUlv5McB8PP19Y01Gayep+hC/2zvQ/2HGLAurowsNGlA1cnqGGzeH5weiYLZm7h3QQC4O2tXdhvMMk1ZS5ebpgI8eMrPvPGkwaxayk8Yc6PMOBPEdC1XZ+2UfbfOPtxLMQQAG9BcZFoF0gp/RKjxe7+oAw9T7ZPWhgedodgz0gf5KBtrtIZhQAZpAV1Bi36w6t98qVfH7hqGI318lLCjLCUFlxRHwqYEH9a2qb4XjWvDT7kBwfbZA5P0+PNuRuW1yf4yNQH3zzwv6b70QOJ0G9OT/dhoYRUGT15uQH/71MjQLtQlxfDuiCXrtM+SkA+icQdH6sU/xz7Ze7FlubV4TpoTQ2osdpaEjtqADmEU7OkBEFoLeC3IWFFeswJXKXzkboNL+wzcFHU8hTGKIboO7CLi1/P+5F+gydQhuvRbwEgxvtACmANikhLTbj0gCYk8KdlYgmj+4Ymaod7TwahwadICuX0Cm2fE5iNHPK0x/CDV66Kyg1MnqjNFBnhBoLQCgUULfaVe5nq/6EQWY67bXCszUb+7232fVPz51iGB12owK9peyP1T4raMFF/OEYJP792mgXYfZ04GHMAhBkCSmSj+dKqRPgVFGHbpLEGMiGFeQWfSgrY52VxaeDUPSNJI0P7NoisG729HHl78z6hxfs9rV3m4JjgM/lsui2qmThjCfDFSb+I9vwUqG5wwL55U7C+6ot8B+7N2o6r3q37T9trfpjgmTvv7PSQATLLeRAOZhIJHBQfDQQJPBdUwEbVW3+L08EcEE/9G4ANrCeWcnPKRHDupbNynMx5AA9IRYLmrc/YLSiD5EaEBS/s/TgnU9ILcH19n+CpHwegLejx7Mn/d25fdN+e9U/1vgb7bqf08MOtf8EXxaoh+GY8L6gDfhvs4i6HQ7seYI2sv1GchdMsBIG3xlvxcCRzdgCPTn+6q/TW00VE8Q9FaFv+R2VlOM1vm/hhjhDCdgNflVKME5B47I9xT8z0YgPAJ8myb/LqHy36j/Mwqw9AALxuO1JVjiuQAYLcFzIhiEPe05fk8tRjGw7yWQbsfuLAT2VqOId1osnr0F49VM8INACPHDoBz4B5mqqSnUgyh3ArjXxfQH5BbgUS8gP7aU+w0zHD9GGD0CGHf+P1p/DeivlhU4BbxR9a2kYFR58YaDZCUR2P0DMmgED2eg77puegy6PgDphEB0CwlG/i9d+/Hs34pBEQrBn0W51mqGnJAk3ACCHeiqkQ1XFQA5AlKH7Lk8yJKWY3/nym14h2C3JvxeMwD9ZVMz0BPMi1n1RbKl1cYhIVblF3G0ATsRiCMUvoK9//OgcwYMoe+ZKOLlC6/Xk50br9NFz9fanqA8UIYSpCwlBO4kHc4WLLBfBHVaKwKgLQjmP4Un61Vq+3s7Bsyi0WztmLjJwJwFeE0I2vD/1Q6MVwefxfUf32skCPbCnxQqf+QMPEUDHZ7vGeyj020JgkPXXwsldA7SYR1RE3h94NvNtugswcgxXEkIcBPCGZ1rmrgDC0A4K88nm2fn/eTnpQtWyZfybRoK8Dro4zYDIMGsf7saTBzvX0SMbkAD6o9CYbsfMK38cJKD9l2FJt9/VGs0h5Gib33pxMKWNsigFUh3G2un+/N1WUglI/EEx8fq27vUNnwsiOoKecL7kQS8VnWAGCFUgn6dBtQhv40CmIYggwK0uwDHRGAuBXVdfwzHUjZzATLMAoyJ4FmBhzaWBlrHld9CCWpPHRqofBqMReMGTJ78q9rDes1Tv7/0m0v0AFHXNR6P6g30SHivin7V1BOhh3iWPwvps/yE836L2XiwnUT8x2iHgfqhnwn667QHEE8oLQjEvtEW7GYBZDrDVkwNIO4G5GiBDf9fGoFM6n+vbEtzXwP6u9AduaWnGYSLAlVdl/AU+ikrSeEIKgwdaZ4AACAASURBVKj4/wtgHcHtdO2nWKcBkPfxcvnNQvsj2Me9f02r76T8q0IBn9OLKfz1HX8yVXQYGoAB/2UeBQ5/5kCL6+H/OGGoRnLSwdd3oH8r7KkGTbgIxEwVWvnF8KOpHnyzfF9Jod5Px+IF1h8owyitDw/XEgRb5bPqbt1uvn7qBIQ16vtS/u+DP3cR7CH0WWJgd5mTJKYgNzoGjQrfvu99NDBC+bnyW1x/qhTatv2OaMKgJWPvv5kwnMgxHYGFRtJW8VMl3uP+MgoqSZyWFKr7+KIDw1d6+IiOgZI4+d5iYL3imzbgyO+tph9t2oSBxOM3ugHtPoFZ1LM0hF4kXNEBssvVgPdjdXZWK7uKvyS3q1Xb1WQwtVDqSUggq+Vw3t56JA2cz7PXOwGNW1ecwxPhfe3QEUsDsFaAz8jg0nf+iZMAHNg/XSazDuC18Iq1HBRrOsAQ8NLB+16g614jmuSgs3bROxE55D+WDDQNA4ivdMJ9M1b309UqknaDU8ObV9/PwmMPATvTMAxpABLBzugUtV9bLdhNDQA+7B9tQJ06/7QNDHGSwtgZOCIA47InIoDdROQGtt0U1HI3GaoUnCnC/rzBMQJteN17+VaAzYNA7e+PFqHQUyXPUYB7iQYa5ZFjq1Zqpx8Uqu/XT7+6BWC1Xaj0GlBIwMoHu7UzcI/6/Acb8KIq+hzmGWmAYnADrIpvKP7TZeLaf0LAeQkGgebbq9FToI44p654F47tekKkI0L5PQNZPsDwPBpy/ni+wKMN76Vav4+2cFZFf8+JwAraMt0DFB7beA/u4Zz/a+RXx0M/ct4/jwaNAS8G17eSwmta0Fhx0VRxJkHMivso+onMXr+YwdWKbgioy1jp4x4AzIKg5lEA7wvHEYCRmdx11TAuT6lDLVl4KvXkAET9P4RT8H2u+lg9EPQIpw+/NpJ7RwE8HaDv/Mu4f3OdNkq/EfAiEiOANjEALvcWL9gfFV4NZbgbQc6qPky4Pm35QZxtH1f4j+P/jXuaYPcWwIEH/fmEPBoAO4m4LGxV3txOQqDU+dXgey+UwSzuqP++uImO/u/6ogCb7wTc1n61sL+vZi87rxnrNas+giTg6QLzaUCjIp6JfhwtGI7AjBBB9JjDY4ePYVR6ZPgN4owVv6Q2N5hhVHwNeYrM+w6dN6K1sMHZm/Ce7bHe3dzKr1xw1w4JrSQMZtgnoQHlr18fzunAszD4qurNUg/TDqzx/lfCaO6t4tACMUQ6P6htWjDPC1hCoZ8kpODzJ70MUR9AODcgwyqyPhmE+wfHYB/hvSqt6qeXUShhXH+d9SR8DzrDaZZdpSp/HxqLMQuATgDU/qDPRgOIeT8cvz/h/XC6BtE7ACLOWPE0KIS4UUjmZaJ2grBphiWgT41BUVWZfP3AnEIT6OrfoF122l2rMycBoU5i/OXoUZ4/aglsXwLzHNU++FVF3qikOj5HXm2PBitT1WuvJRAB+6O//W0/PY8vQH5IrAsMs/WuVmAdHBrQgrbOxJShXwRSsu08h8JMBpo0+aDTALwV4tbswgzHrftG/dJKIAQb5h9KCssWIMeto+GYqG12/HWGjx8kzqNJaa0noMWOr2KwW01AMwJoNvhMQda2/RKQP/3ecABM3g9uD6BY68Ntz9+nDOMb5iV+hIE+dP/Zs/wwJhJ9mgBnohBuStABUXjugF3hkXF9ZZJAjefKdHZCc389LoStKvIl7QIEb1d9RyciQgFDI9Cjyccc/23Aam7/PZJBhgDgin5CtQvbCzX8ip9YgIFtOAt+w0owp/hOiCWgEGbVHuYjRigPGR/YOnEoqPDoV5z5YqB3mRq2ox5ICmSSgAP1Ne+XV2NE+/vuFbCTRADxtS70VRBCjgBk2OyDUQiUgfl77b7DwaHm2rAZ7osRSOOUoHgKfNBSLI767+oDYrfwZvqChSpGfj3pFwZFsCJg2jeIQQBUiyI4WgD68ww4qO8khuWkkIuDrxWv2nv+UTBpJYiPd0KemTA8qqFiuUF1jWS3BoG6pADJq751JqBI0wvAVPyMQvjcX1zbELltKK+zBiXRFiRxG+b7q3M9xuLdzR8g0gCGNzSM5gNYfqGO9CBT8OHct6oB3KsSDBisUnwsFuISQaRHxDSv0vptt2oeLHMERfRn/FG/Cx01EpgIQG8LP+/i37PKw53xn6sYCM4/JwSRrCnIeB1ZkLsawDhaPKv/njU3wnZ/dBdGE8+YTHSG8+ofGgIjsC19YnwdM/KAnTSsqj6ig7uGgIPw3nYFzhhIIvriAxFP9CQd4HSlnzgxONIdrE7A8ZDPx9fjib8ifgegNIliRgdx95+E1T7+3nQVNNhEzDgGA3T2rEDLduwtPpuuouPcs8swwXFjdTaMKt+jA5gUAQPcf95KJQxYU0cYxEDvsBSmYuukp7AwnqniC9Afa5z8vboI68ImT0t26CvwBzSggkj447r9IojvCn7U92J/Hw0QSdwZKNNjxPCfSxRqnATkdwpOwh88oc4J8KTSm/wdbZjrc+4iFP8YO0/5JJDCfaijK5xVXevqfg6zGRrQf83chvX4aRfAE//6vv5+6490U4ADdO7QgM/5bcHP/n4OtCQhBEFeDWSvos8DPq8/IwzLzjpa8/U6MMSkBklDm8e0mn3QIY7XG1Om8wzN48y7HwhOK3P0/ZwUQHHv4psbdoVeb9VlAjChBCdtDDpOKTh9ZfcagOYq31RFjN4/gwBYzp8lAwYNwBELhZoxECeZxMlAzWGdCRV0fQWGHo8+8Kx+AAxnCIzowAxy9KvNepWfsfp4RR9kUrD88CPVTuXRybhqqTHcnxEGndsgub1Gdug8yz9fHt3Hpl57x/mfCOC29FOSQ7/noAZR5W3Ob24UMpuPYAYiQrQgk1gnFoUIKr4vKFpV15pHUJO3Y5rfH3UFHU4bGkU+NKJ9f2hJyOMxDBDpjAgwiYqvk5TqNl9EH2Arb6fA3yaA4cBtPWewhkEcIQJBlGzYp6zRmr1v+e3Fv27xpzvyI44NGDkCIi7CGNV9Dw0M8NtHC2vUwHINumCGNG8erxOwtQINsW88Tlwdoc+F85nI559ngEDpt2F/Uu3hiXYrkN/pBFS26hYDAkFgErMK67y9mGBA3L5ore5izf8b3n805MOq/t7XU4WHv1DUF/5gugCSOAIW/59uMwl6CHWAib8bvfxWl9/rBGEMTTwDfG+ezEYG4yk6FvRPuPwE+wvc39IRjENWM+/cm5b0W4Pf4WuKUnw/vD6eDbB1ETs5vl77Dhnm/51g6wPWwQAqxnivgQaeS3gy/u/1H4hpTPrIgHAN0mSgXUX13YP5PMIuQAfBr/f70cdeE+QoCX3i8nFMLcAjInBoAIYqt1LhC1WdtvmSab28AYffaeivCB+ohdYQgfUa/WS4ToMsNLHLc9nnvPZLwn1/EefPVf+U/xvnCVSEQEkEQEnEQJO7S7RvYDxNeNYKrG7DKMhtsQ8cMmhgPKKKj+F7CiHYFR5KIIPxOmg5IVAtu3ACQSPh7CzUQOgAej5CWEkIe3vgxz0ROGO//qYfz/dnLT+ZxDr4QW0eNCJBorCFOVC312Ec2TiY5Bk0cAaQmiA1VH1MOwDHQ0kHdEDDf+2UTWhS4Z8diQMicLx8MLBfverLcP/jQzF0P8EJj5+NGK9RCz755S6F/f1+X/gxeP+Wsedv+vF8/54aSPJYFjIQd624MDz/UDLQnr8HU3ztKHRf8Qeno1vyAQJBaLcMtTV3cvgP56COCqd/QP9xLgBkH4BxO13n4hNUDtACC6G1S3zqooZ6Ba4lp/zcAFb7iERKQwQcF39IFJjdXECGADw0IE4gg674pYAnk4HoHPx54tD5daO5vxrugSkMjgiiqc7TVKAT6AT8R4ckbHEQCYR/IZBxJgA+XZjsR7vaoRpIxWqeqfXuGC2CxwudicwePEB1kNkaZCuwyF0DuKv/4sz9mzP/Qxdg3BDkBTMC8Q+loD6UGBzx0Kz6eAX/KArOQTlPHFoI4vVtf4rNuLrca9edRn4xBP7k8w+9AgZCgBfEUZWfEs8iFNZ3UO7TqmkjCO/rWdgco/yIqHcQWaC2EGTzgz5y/iXQAvyx3riyxxV/JeBriaGB9OrTA5g9/eokM+37GszqfA/UZk9iW5UnCtBqBl3XoNN6Ag/+zy6A5evPAp+TIFDn15gQw9rjrOzFX0s2JBVAxa/nP1a6AsNWYGjPNGPLTQgBsNUFvOA3Ht9o/rGDN0tWOCcxJGp+f7++kkP7PxcGv1+GjkaLt/fawpwwerQxBJNW4b+PJsYEgiAYYdEAGIlDNaAbRkIgK3ut0jKByp+8yz23X6GttmBmjwDvChgiYLP5V/zhH6/110sGcKo5CkggCngxnIPoPja0j2B+1BRkiYJiviaLJqghDI63G2nAgAxMCuDdnoD0wIQm+urMB3VuAwbBrFGgGgnhAFqg9+ujKsLxB3qGCQNEEtPinIQlAj4WgIw7/iXc9V/x/yUWFs2KH504bAh4aYWf4TrTLGTy9YbftyLeVOWNfYNyt/ji29mQnqMAltU3ioTtbX343yv/1u0YPUBz6zB702tQucnX0gWaFh6DgPdmhXaapGotw0SFz1qDiTMdd8h45HfcqCPRUhA3+NmKz1l9teCPaMd4urGaewRitNBDdahR5c3AfQmDCFT9vmtQEwqAYXX4XI2n23Z9B/Yb1FL+LWox6wHGbZSo6FR1LzyG+3hriSZvWT6jfXhl2cmQZJDrAbuYAqAHo1GA/EOgD8eGcU7A8eDvH4fQBuAhBL/Zp/vamPTrRENDGLTV/7E1WEPLDlP/PwzU4YhusIMUgfIPAr6Dhv5R4y2r8ldFwiFoYHnmr8TAHbhRQSZOctH598ZYhqt6wP7q/ouqe77RJxvzFYaji/z4vna4v5cUMDXqDAJ5ytktqtBDckyjvJg04hl16LB0xFfyMfD77PZjErGQRRjYIfSvoAXntks0ok8MsUC4KARWnYPlJBeIgLeFrUgDOHYCag0/XNAbWgRwQuLAsaQwIhC1g7+jCNKuT38JfnYSyTi+QQEwwHeT4/dWHYxJPxfOj5oAnRQqgU3YgGZSOaDyK3n/qkDYBKptzR3oD6B4fyRKjp2AzSl80YR/3P+/1vBjX18Jbu+YsrMRgbqPP8zrDLTAaupphfeZtyPs9BPztpLSBZjowF3woYRwBwOWaqbev15b7X4RWsiqYiY6ZkFEIoUwUA2OrkeEQE8HYNyD/rl3m88jCGgO/nPW3xy8x4Q/HBcM1dYg5q8N+B/SBSYhtD0EY1PRGLDoKIBHF3yLz4H/gSYQJRETgqeB2d4vC8L2NVnQn4PoVJJAcP0inahAfdXVI8CFszjRagCTtRdV7Sr895NBpRKXIT64RMFw/iw5eChhEvmmyUIH+k+Qu3cLzOAN6ILlFvgWnx3YWFDz0f38ze9GlfP6UQ3ojEY0gtqRIEbA5/WgQFhsEuIeL75uTzvqHktAWfj/OD6sQXssROcGiRgFn0QVkld7OznMDT7CJKzhMIqxW9B+LCOQdH4uyxIcE49VTSeLj0wKjzcp2oDXQA8YoDEGBLMW0BJw+eAxXejPV/IXd59/tp5rVyYXDw5BlRetSpQAcvgfOwVM8ObzBq/AQ2wX4lwkQV3vNhYFfn2LFgaoDU1ogqsfqGkJYmrj9Tr22KQwBLzbLuzDeA9yzyJjVRfwegWq0H+FThDPA6ZhZwX2M2Kh4waovCzAWJTzD/qY00c+6PM8coz08VNqglzx54LfHuTJK7z2rwX35ABLg1DzsZ7Qv7l/f2yXDlbf4C/irg0MJ0aCuD0wP74MrxfdFlX7tq+vtRdCpvt599EG9Yz3V+P+Oj/n4zLruZHcJ7oMt/MNp9eD6HEeFb6/TMfbWo85Pb79HJo8t3371/PuIAZqMvjPC34nVV6ZB4hEuA7AzA5cfU0y2n6ux89D/35/n2/vWY5Bf0qwf3tPLISO1Tap9qzFB6eap/beqI94NCCbGwgqOItY3CGl446CaQ8i2Q9g0AvmgJOnBoAA0gu17tsKtKS7D4udgCYERy2QIceCX/P7mBW+g/7D9S6Mn50CS0eAoQPDcBjopIA5+EcxEjLweRjXq0UbLIjcBxsGx2IZvlf0ATjz/6qypAmY7bhrk4ahsIis6ccXKHdueAfUgk+RWPCLh42c6zEeKyJpRTdRAOqBbl/Wq/uT+q+Fx3FoTIuCzc6+hN8j4veGjuAnhSE5gKnco3A3XwYlq2sq+lmP4yEOpqEoG0M+mGDYuYT0pKCFHgLHKt3T7T9p8GcWH+n1UwGa8X6kQt2x4CeqPexegT6o/Z4Cr313PHdgrsS2ZReLfpKIf+IMFnmVmwxQ9AhithYT73+p2s+JIVfrjwiHnpAZrSsr9CMstQXP1+1+510N/q8E/YoekMN9OMFvi5LvkRDsy9rgFCOoPdpgaQIWBZjf5KCSQszZJ1ivTvLokpen6tsJAVND0NFqb6GUGg2Im4Dyx9Pn7/0dm4pADAslJzTv+dKNrAPQ0wyySm7bj1RQgbAXsRa4R+mBJzpaQmHLmy0BLoL+Nh2ZRca8uUc6P37k97n451fvTieAE8BdZ2ItqFEK6oOJIYPsiU4woo140Oh+H/UC++gatHYcOFT+2y3AYvD1rM/fpxdUcsAi70c0OxAEP45X/hymE9XeoC0zfYhbcqfbhs09HpwnKMDR6g0mmYyKth/UcLl9ITGQ8N1S6s+gA1HvQCc2pluPvN2Br8SyZyfyxPP/VhCi1L1HWX2CQCuAE8TIq/sBYdANZmTIwqq0sb0HIzhhugBeUpBZLFyA8y+EErsBUYDZHYN9QAAooQwOws+uQlhdESSSqk5Qsh8LSYI6LDS1AbmOvLlRBqQIeITvM36+TP63VfE5hFClCTr9zEyVFwS3STQBy66DMHB+PJWIrfgGnYBx2dTboPa2X49GaBVlePA7CFx4iaGi4ns0aLVjMGvtPTDtmO4XEE8E5Kb/8qYai+NHl60LgAICcUCoJPVeiYG6Pxw/X9VFNVbFn9FNPzXoIRDTyzcpREYB5Fm1EQQn3KRi9wKApR8Tz48SwxnV3qM0q7ZhpdKvr0zfY+gO4oQf+EGPFYW/Xf5hwWsUgxiBbShGoGIx+D2eH1h2EeR3UQMH4zMaUKr4033nzkSkfQADelFbLOQCalxdxvN8mInhPas9bxtGJw29Fx3Y8429MAS0fL33Oeo7qFZeiToCC3B/VSNYuU0fgDnkhxGgMFdxiYEY7MYel+OHPH30IMeVFK1C79l+QdXVpFqHlMAXEf3EYDyfkkGdNvJ8f3RAXU0jpgM7jMNA5yCrtfzOicKG/M9bgEkEjqqPPDEcDfqVwGZv6zcO9avDfOhf4OmLFd9OLBHHdxp51HvOBlnAoQksYjASA1xnIhPsapTCPjbsGB2YevpPpgM73EYeSYIftgPgte6CWesVBB9QEgfnWYMgoeC8ql69bWoRIqYHvSIv/u26bj/jdqZ9KSGk74JRo6QS9PuTiSHm6Z62kLUGH0UO4rwWrhtRETkR4iKRdI8giJ2D2nUCMjsA0TXiVDb98NAf/rCMlajA9wesWHZrAe1dlwRyVI2jx4KkyUHSx7YDe6YD4tOC6XW01puEdAJwaEJzf1uATHi6ZlSCpBQscsh6C1xRcWEG4bCFeKcAVhVlDu54JQIkTT21hptIT/Afk0kMcS9BKfjBJozcDXCrtgbWXxbMAw3INQIxtQJPAGwXmYaBbYh4SCsuKwLOAQ5awKskCMmRg8P3xwlBfbosQaDqyZqBkyQe1CLQACoTgN4qbyHsPwkTiF2pYaj6MAXBmUosQHnUEYCsBL3MW39SNKMJ5PfoBsT33DVJCEbFnBCMOkHfvj6Xq8uw+dgRIhGgAiUqf5QgKDFyhe8nnYrlqn9sG1GoAfirubygX4H+8IM1CmQrMFAJ5ExzKIp54nPoVU2Auh6eBShDlTV4u5c4HE/fVvjFrsII0Ik6QX+Iq68jB19ziLoKC27FYe0gC+j1RSS+BgB7AvAM3m8HLdy5fV60C8RMVuhD1ieQB32MCCq0QPJuvuw5IHF/geMKwOPdpmsxBwVEfGEOgeincJqNmuSFIPhPq/xM81CWIIi+gCFBqDX3QPYd2OcCRo6GZBoA3AM+00aesAOQ7/2Pe/vBCXoguD4OBD1WfPwClzcui12AuH+gC0gEwW72KfjBCQRBr05D0IQc7N8PzOCMehPWK384MPVDJQim7yDdoiRTItzzFV/ZOX9sYFetP0fsQzb6O7wOoFjxk89YoQXv+BmSN+yYHYO+BsDRAXHhuJXsEFbdIEGZQWUkNVNzGA9NZUVBIQL7jASR0AclE4Pb7JN3BO72mG92+o8UG3nybj+mASh0FsLKn9GPxDrEcS2Au35BzHO1BksriIJdpqWjKR1wlpR4fN977rZqI+XbYjYDgVDpcYQalOYKMiuQbB3G6Pu/HlMbi9a0EMkksXtjvvXTfgMKAEZRN/i/O7yD8Da2S2Bdh3ICWfp8yuMkYl5a4df4vVWt4UF0yyqEnaT6swYyWB8/j111Y1ERS9oB0SLMtBGDEBD1PEHwtdjUEAHnqmoHU4wCDAoAS+lHwtu9eQLUAgmxVvAuMB9cELMV3m8EUtcBYYI9nkNIEEJYrQeUHfnzzRyC39j8CgSkir/E0P2odnAmAqDnDIhqrtV9BDNS2POjv/0pwKr6z1h/PMz3uf9ykFYq9TtoAXSwpz0HljdvBCVAPY6t7osv6gFhMpkX13rcfXQMIpuTsfTibkfOPRAC2meLRipI4mDPwMD5x+v3+Ey+qEfACwoUEkKQSMZxYJDz9R68PyP43yvo2aYf881rNQbZgRU/jp80QnW/hdXqJxMvCFxXQSNHpE8QiF4XI+wFfQcw7VL2Md7RRajsKgh2D+6SLAKPF356+/7yXYBTUgFy/38StUjFHweD+iiHh8/LV/i/TSvGk4L5x7F6AsIKbgb4C0YjgdGRIToGUx7cgS3JKP8pRcgak95BJGQbjaJdBYQ1qHYnYHL8F45QgHx2gLMQ2cDxBD/4SeR0LSDi5XzPQNjM4ySE/HGG6g+ugltLNSARn281BPtNO72eJLjdX4ITSEgpQvJYFEUg24f1qAYQNQdxx6Q/RcB85j9f+03zf2QV33IDPHegNgPABTfqFR8cZK9TA7/ll0EQbUUHW8Gr1d+MSadia+LRHwhunv87yWoJ3h/pRDwJAbDNQQFd2P2mH4kP/wDT/ZeN3CK3+ZjvgVpw4r20AMafb58j4N1UMknuj6iCx883PU9g2VHVH5JX2eEcPghSgRBCKPzK0Q3fknwPN0Hk0CyC0zBkz//7duEetgFjVtypASDI4CsknYJgYDhqsBxxy29+eyxrAZX75EEf8f+CkOcijMDDHx4ASYGGu8WHgPwpHJc0qOG8FgFTuVk0cRZVePFwHEIUEu8xSHoL5qWg4I7/HgOKXe2dcnu2SSdCGIDTA+AcxY1zYL6Q6AAFu+/1GvjKPSeEoJV3NiM4Dz9C6oWkEav+NWjPWXNOIkKgNTi2I8LeBgaZHJxqrC4oNXoB9pzzMws/OW3ghSyQJgjbygOVEDhoj4nHLld8HPD6UUMFVLIgKrTL7cFoBRLQgEdXIseZ2/HhFPKbk4d5tYWwwR0nIFQSD2P5gQhs6meVfB+Bkyz2fOIvX/zxqsSODuAGIOLtPNnmIPCrv6Kqvgz3q4tCwNl9lWYfnsdHj2HTgQw5IBHwULmfSu1jEV3gDFSxTBmqSEVqiYK2IkWcRiAkwV/cyW9YhqHXDw9dkNQAcO6HFNJT7oChfrPUYc3KY17zAd+evAwF2w5SCKLV4EuCEKsKfjBVWHu9Q9Arh4CoBqEMWYBsNX7YgKP/69uC3M7/mOOz232QT+ox4iCyJGEFP4oBHd+GVvXBwX35nqp7qeIbV6L6tdZub3ueJ+gBIKgC6S5gOQFxDoGr+Bv2nzqbknd7ph/EmXzO0o+kZdc/wqvQkAOUffVMzKtYgx5Vob1/+HAfCdzHSiXHenX35/2JTr3KZ9Ruj2lYiMhLIFoNyMq9hFroeYMTE0bSLbhb4l3YlFPa6hMd2jk8dmrDgdQCnC4/+ANFlYTB6ATlx2GDGXP1rvL+SnWHw+cJes5/rRWt4H2pw9GklD4uSMpwasIQiaYR92gIyFX5S8dtRZt/nCAH48VXW3hRE/HKOsGquj8EM85Q9cfeAV4XwNGAlmIFIwPYrfLKuxV476RRetzcdeAsRSZhiHizCKEIOHn3EMOWy5X4uIJnXX6sFiBFLaBm/THOQAkVJK9j6TKwiSDTBWpwHkSPQJX7U959uAkoaTUuug6oQCBz1Zlxm0OJSIoIw04M+7zCGuYiznCfHww9AN6Ir+HXA7lfn2oBSJ2FOOh8SzINfmcAyITq8JX/sOMPx6A9LeYtVfwgCBZhdu25OB9/XmWWNPUEPD5dUuJ68wd1AqD2+w1PI9KxE9BW5t3z/igdYGWiL7L+wPv9jgVY8f0ZcbCKCuLAHN+c5wa69Zpr0J9t2KnpAGzyiAIPiFalJ8/xXrrA6Y+/8NoDnWCPNwFJzf5DpVkHte8hx76P+HU1+HEytEeSEIzAsu5r6wPJGu6oLz8VrKofXLce+ywIHhNa/Dmw8LrptWXZ4NKZm4pr/QQ7Qk8ehMrPtAF7PQCD309QgRgRZMKgAbFREAfBBXNalbHA9cEHMo4IgIUuPjjBWEUFEQpYTkhVO43eRiynJw9Jjj8TOUIlJExK+0wA4gWgQvcFBHAc7P4/u78/Ff4CC5ATB3P3oUwFClYgcALcxzp/B9Ez4DUV8RjBbsCBrMH4dLNwIDaCGhA6o3pXksdBvYBsktrXDgNJKAFy1Z+ZGIy5NXgXoBT8a3ZgVSPIUAMV6DjLxhsV8wX4n4ibbONObHNyCr8Z4FinNFjg8ziiF5zSV8A99u7Zdf5OisvVaAAAG3VJREFU/kIPAJLWX3hUIFD6o7MD4WkHIMXBk4IftSrPNBJVk0OoC7ice8HGS8XBKDoz/YFBLaQi392lGpCMJfhD9xVkx5Xbj73P9V4m1j0v73x9FjDDPlYvATkgFAVWcdNvJBamliOjAwRV0EpeRymAe717kMYRyy/j5FwFBX0fP7Dyx8gq8wn2ZXi8GfGYR+lFcGJSxa3Y84WgzBHetlU4cvKY44Ps4iP9fsgsPGEhQTAcHqwwGCj61SoPexKwasXFqtxq8qhD9SixoBBYcJEDNzmIoi3J7QkoJActVHocTVpPBCDhElAvMDK1PT/Sq3DwB/ygmyB9GNhYDH4so4Foy48kkPtZfZEv1PQTxYpyX0EI3Bu+/5krcN8fgwVdwWu2JNVNWAk+PcOOPMNdGFyAZ5Aj6gicgzNfwuHZg0HrLxBWfjSRl88fVCo/apX/IBrIvf65ZxtEoK9Bec4KZIPLe76osQns46NwW0pUPCPAyMc4A/KXOwZzFLGbAqD5xhhbgBcWfoJBAlarcCSQgdQJ+Movnih4gjZQTw51rz588y/ZgxVUEAQ8soCfX8OR26JwujCLGFAMsOjnwGrlPuQw9D/PPv8BYVR7pG/eeFtQpsLzR2KFI8SwKj9KlX++HeLOPuSBKrKeHBi7L4b+Kx184+ptAp4Trcscv69oARVYzWgaK01H1X0K3zNSmARKtxXYHvwJuT+8gLGGWgpHcWOmBeljFB2Ckg6wiAYOqfxEK3GMCAj6kIiTWdCBCXhkjUKMgJcLk271N9uLSbtvvK0S69OXAvoA5z94VsFubbmZvx4QAnXgBnJxENyQjy38wef81uPhxMpPJIQzr5ckuUTKe0wZyN57iFTWga8GvCwlh5UqvYgmaNV9XSxEVWs40kkosFwA70RgNOu8mLZfR6wDiwRa35y7j08NksqPQhcfkRBK/J8R75Iz+9C8gJpqzwiIeZII3QnYOkJWbVEI5jNuA+o2BwK82ifwnpSgHwaC+GNAdmW2VXfC+vPu6wR6lBj84C9WfvivZyUhZMJlJhjSukDlFJ3g4AvGJfC1iEpQJ/CaEd7G9wds7p71+odruKrHip/C7RdsxeVjzIxhoNkFGOW/+sk/YVAGtltfzZAIfzix8gcHhZCXpcGN2u69qWqD9OlRFAy7x2fQBhHUiETB+DocqvArYt98f+AEAXApsEmEcNLC0t2uPHCqPQIXwHYDfI4/9+8LMpchqr5HK39MJSrBXwnutNqjovjHFdq+fcHLp7YLR4mGgduW5hFpAXUoL4cTTuW5HJSkB5PC0S7A+8c+837DyoM1J9iv/po/o3BunlDqPjOSO/YbLFd+FGy9sxKFeT8b+nLNPrkAyD53FtT27yUS32yqUaEGTMBiASGcZ0FmK8nWxbvjC1q6WQC4VdWdAcBY8eFoAzIrC0b7Wt8wlPcIdE1FhUWeKU1Igv8Q/0dl4k/NnYSxdlDon8diUDeuQB4c8XVzcahRgyyZmNC+LAgeCfSVALde8/t1DCYawNoePGT83wlOpFUdOZKwxn89OsMEf0X8CxJCBN/dwKbFwkSMgx0ACJJDJD4iC1JEYh6XcEqVHpx4+J4I4UiAl26r5x64sttvSlAn3LBuQCz6edU8C+J5epBrC4YP52EFDgHrCw1B0eU9bOaTgh3wmYvQV3Oqqcf53XnVNXUBELX1xtSgFrirlII5d3HFulxBCNEfZx0h7K2f34XwdHpuYQcguN189Ow/nPXclaUcqMH5leCXjKOjbv3F0a7i2ZaRHmBe5zwnhA9S736ZC8AH8LHkg/T5znYgmES1dtuzGo92qwHIquiWX+4KgVLd8utv9Ml1BQNhEJW/FOgweiTguCUoQHkEwYhjfQIgm8eAzPKzHqAG5xGiiPyxeGRRaYetUpDVpHVC1T9bHGyaknb/TQTnuG7rDYwYCUT7/cMjtILzA+Go/FPw581F/mWeTkDuBsBCAK8ki+A29nMzPn4Rzjv6QV7xWW4fzQFUxb9jQQ1qc28kMi4mDl1NBr4usIsz5ltZqNm7AeJXfuTHd7nioLEyPBISU+8/tP1AC4Il/n+YGmjg2NiBRdl6yCw//zG5ph7bqaBuz8B4VMU/TqSsNPbwCeZA1cdxyG9SgKzRZPL+GXFOiH1/SFZ9wX8M3zUgvH8a4rMBjZj/h1W9MrwTiN6MlsCKiI4gycBzgV/xUaQGjGDHwHiYi0VIzeEAasCpNuL76AC7BIEl7i4AIxnAfoMxk35eJbZ68wWEUChs8IPz/EEE9BkUoNA4RCWSLJkY1h0Y/dG9bVCtUVPe7QRhtStXG4nOECDfUxc4Uw/Ik8JkA9o9+a83IrfHH11EdFUWc4phNgVFWkPsIHBnCvCCYBSgqEN9qtoXuwHhByYoJJA7BxIkkRwpDGgAHo+vQ3ZGOwCFJCJKUAx4MBpFZWvReeLgtBBkDDQu2OJxXa7SE/P4ZiUPHABjY1DsFIhPAaygWewiXK72hHjow/k8gCL6gKES8qcDZ7A+EhYlWCPGCX1wXIwzkQEKt8cP6iqkC0FEhFj/ZYtvXCtwuBLcDT5wXN+9H6ZEIkTwV/x/s78fXFX3siWHEKrC3tw7EFZ31Ll7ttknQyEMGgAqCaVe1bGk8r8nFWCQQR0h7CY0dsU/mIeIuA1AGCo02Q0YVXxub36sG1Qgfo0CBBUXxap+ECFEycQVyViBEBFPt14TK9rZHB9EwMG7DPXOv0OVHkdtx7OSCXfb3av4CFZGTwQBwT7/hKPHE4PzpJ4L4+FM9r1n8B+B+9R9I4Fu9brYUZgCunZWNxdQgIs8mASBQ4F8hJpEiaf4GPihk8FdAxin/kybjZjTj+mAQy6ihZ9whDvHAWB6BKrBXQr+5SBfqPaINwiz12UIwoTmbPACZY/fshBBBKNlW8ZCHwH/cVKSOZMm4Mxk4OwE9JeB+EFkn1IzcPQoiSB4vGgNeJSoik1A7m0TCmE/HrggB+/1M12C1Z18ACGoIeH1pH2IhAqFWgBq+kDFEWAvA3X8tpW0cnSD5WAOriOHhnYraF1eLTkS8P/QsHUBdtMPnOrMaANJE9AZiaKWII5Ue/8PTHn/UcCSTgIF2xN4zdmAQYIAKeBFl6FiO0aKfq5jcImHfPwTxcEdRmD3LcFoAva1Hdjm9UgGggI9YOoPkOBYLsT8HlG3nucMDGkOOJ8CkNOELdSO7D5qqAeJYBb2GpABgRi2gxLITgrOQ9C937HgB+0i7MeRx3gfPWCXLtgbLJAu/gCFBPzRX8eADJqCvA3FViC/BlOQC4LZyrBq8BdQAOUKoKjqR7v7EFfVFMojPgEoSlJesNIePyLHwW9NRgq7E6HvUN8A0yj0wyWDHRZ3J2A1jHdMyu3hCGwSDwdRir7h9VP7AKLgPoMCgKziOFLtrUm8aIFHlgxYfz8WBYUU55iAXauo+evJaIK/NTgRJM9sUcZRzcCnMdNKMJc7usnAyrpxHYkTRHK+n1HxS01LheAHqRWwKIDqLvQC0+PupHZgBawfVGsiniTVHwZHRqbUI/D4Cd+ftgyLAR1ehkIiqaKFw7MJEwUIuK5zsu4svoFYCFKgBJZACBuppOId2RDkPZas8H9kULcA9a0KTCQDGtpnzT+RMJiOGseHl4BQ1C29AWUXIIf/OIwwqoNEK3SCuA7FRiBrE9B4/PcrGJ1OQNj83F4Xbol/TgVHfMiIZLAdcaVkgh8sLrd+liNQH/FqsNTfj15m1J0X+ffZuq/gTY7QnvIfJz6UzBJLs83ItQpt3RfZz5iuGfNPajpngUm0R8DoA5jDlzsOTAwZjzsC3Jjxg7H914PjlcskGdghgx9HG4OOQH34uwQyzz61/0qiYNQjXxECuWYbGM/DrjtPH/Mw/K+gBLLSA+cEfPr4MroArzcDuybbr8Zc72i2UnzeHnTgzD4Ug78SzIvCoARVOQxaFFR3TzWnkkHUVFShEuqKxZnKz4p4YYcf8ZhYhuu8wFgSHcuuwCJagI4bgchJQK/qe9c/RT6nGcg6KGREJpb+MI0EY/b0jcsni3AJBeCQNsBOFVYoApcM2Aom4VFgIRdHpeIG8D3YaxBD+qCiQ+rBOSVnci8hzkAG1t/pgHA4uwDzmu8xFKkkkIqCfkIRs204r/hiDgutoAAcowBMZ9+KS0CcXVBOHCvJw2jMQSJyeoeExF2DuTuRcuWAo9sefyUQ6/oBaIjPtiRH1KvQKvygAHb171d+vc4GRMDPoxN/kL5pwlVh1mBQ1quQJAJ5j0TgOAis+h8d3mnC8xTKE34+8sDNjyVXE6nFMN+H39TQDmocHScENvN74LoGScGU4f7g6IG3n3C3qnG6JBS+Z5tHOOzRYQx+u7MZmAl0OSsRLAS/VIKfRAWU92+12aaVPksGDBWQuCMvgNy2M2Mt8EwqbjosZAec5xLEAmXmcFTHiOWARWglpNpjdEtBQRxJJU5VL5/7F1X86XntXgUK4q+KggsUoIIK8oA+kgy4+zLaACqQGTVOX6MBWdehL6BxHn+tlyBMDGAqufd7WOX5WTJwKYDfXJJP2GXDPk7Tj5Ed7BOG7DMFaBRAJgI/+H2Ngeb2SKb0zkoGlQBHkefDr7xMA5HZeJPtKIzyApI9gmnPgf1c3mulfhe0gFekDCdNFnrOwi4Gs6eTACNjB+Uegcgojog4V25P8bctRYY6RL8AJklE9ACFAGZdBEahd4d4CmghFhbzcwaXYH5qTlS6DY+KfNH5Avzjo2JJ0poDkSCMxLn73H/eB+ifvgvyIFCWAji7BWC8hd0qj0FziMdrS70BlVbgamIgcmotGZDNPwm0L9l5iHv7WRoAFx57ScFS2r2iwot8oKu8l+TOCOg2mZ2nFdjTgOFQENzKkJ8OjEnsE8f6AzyXwT6MNF3RDRnuj0Lwo6wTlBMDIyqaz6G+RiLJMg/KUrQV/rh9uH0tWduwoxmky0kSMQ+rnXxZsGadgnxfgk1pCnsIsGYltvfdzTOBIclIsN8MLAGcz5gBwj94AE8DuC9Molip/JGwB57nRyJiyD3pyk6q5ij+3TzRLohcqyqCEQBTepF15+WVmW8SEr5jMUUkx3oMIsrH3ndwAQganKzyMpOJNxMQooGBYwcByw7axIhgPRGEr6GSGJhkAELoQ1YRg+dPeD5IIRDIqq5PA2Jh0Rq0YcS8XBi0ghGRFpCtWTdum5+yLOsQf2EuYY8AfnbQZDgCjHxBSKwTGpt8QCIDVH3/4H5OwEvldhliINwAFLsEyyIfGKV+vm3eEehVqKTdNxtDiPoLHCRiuwTJxCECxMDqDjTvZ63KaPKvRgV2i/F3ohm88V8LN8hgJcXD5pVGIPPNn9EBqSQC0I4AMxBUcQNCkarkFgSn/oCs9GCVep4eUG5BRAOcQOCWlGSc3If0IFqRfURQGRrKewPKEJ9sLnIowKCcw+f48N6UHjqYtgInaCCkBbPSj8VEkCr2g8U43wY1xX/BNkwreQrzg+oaJghOCGTU8RBxuIp6VFOGoEXgEsBLIgV6gBgxoLSI5CgiYNT+GBHsU01GthrceiMUtv9KgAYktgVNeGrBbtiOQVi9x8WjiAW7UNUnm4Vet7WtsFgDCDYEwQ/EVL1PnQf/xCDLTowTh4c4HPRDoQaiwhKIAae4B7xgCBydI/CDPOrevK0FR4p6w3VfoXgQiB3T1N8Y1PCD0X19JqcHGfzB5WkQE4p/kdeXBcEVUXEIFqSij82lMyrWq/7c+LFHA7z5/dwOHHg8s/Y8C2CmhbmALtare+4UWLfb25BmXABKABTniC8gRAP2yvDAiUAsElnrxFzITQa/sAFecAOY7zPV/8jMQHSbWAiUPGkQNABhw85xrSCv+mMSzFR8+7mjw01A8f4F8S/td4jnDHYxpT8/OEyV3gz2+GTfdAeAszswfJNGlQhEIjB0Bls0BKn4Iw7WKu9f1gmSagmvqleEwJwnZwjO7npz1HdCJ1hS/mlBcRXyF3i/M7NxqJFoeH27z7nnJaBmpUZKHsTbGUc1ALEoIGsGYl9ixS50gjAT/VhB8IzvGTrBVfWEz1MzAkRFTtecW731VdjNQPukVdhdn0Y8d/a7WYH6i/TBPBzUFwAlHwtGHOQISrgb1AMUgDETTA3+THAdeRJhg59V/Ektofa9I8wxVICkC7QQSAd2O3cftzPzdMK6aA4iZI4ILfYRbb9RgqICt2AxVnYZ4kkBvHOBxT/zN9ybHx/f5Ql2fkGCX6ANm6F8WCfqAS+Eq5AGcHJd2IFHagTMHAAj+mWBnDXuc81CjhsAi5dL2K8QCYI1aJ/PJtSSxEFXASv7C2I3ZB9/a0j/7nDn/j1pHsz9Jr8fNpxPBUAUUYD4wz5GBlmyAiORjtAIGDFwzSUwqiNZ1d1tPiB7/Q9VeI9KeJU16/knkEeQJEALjY4rkp74fCZiMDSA/PgvT/aT2gYgp5E/P29AKBQAo6TRth5T4VesQFb0i4K7RA2MZpgyFXCEQHCOixuYMPgy2L7+45ezSSKt2oUkURlpXkEMOLSiXPuDQZjk63N5bmzOSxQdLHX7AhwUEA0BAeQPJIQzkAuFlOK/GtyLdiGDKEBdllQ7YouxV2Xdwza9So4Kp5Z0yAgUhTlJgFzSFrznIHYIwKcCu2/L3LsCg6UI1b1/CA+ApIV5/32HqOIjdQusE4azip5Wc1b0q/QGIAlaWEJbXP3r/L+AEipw/+BtkQVY9fIM2i/ZhgVEgJO6DZ1ksVtlYdoQAPhVO0oKmYBmnAYco4DRCRB3TwCziptaE0auER9/VzRqKNOEYINOQg2m1l9GpGNQAhh1v6UmxNQh2M4+LmlUzll0OTjYQOaGlZAEMCrdhmBphaMBwBADrSQQc3//He8KgFETT7p6BHnjj2X9EXsDjrgBS6ihoAmcSQVYmE4JgYWFpp1waAQRoqDzxDhU+HxSnZHz/9JEY6Y5MJA+cwoWrt99+U3Mc/9g/NQTFaigAEtwB1yBzwzucZSX7RZEILhR1d5GDCsBLVUdIQvsldZfEJt5i/MHx2hGJZFkVVyK242iFeh58oBUFqIQbkfp2DV2X0CkAYgv1sU+P+I/HmBu8nErugdRnUWhfp+A/ddlbEH3uQlBsNobUEMHasK1HOYn8BEEvCUaiuigXRIKj+sGOPA4KAWz9/s7WxcgB4+a6/fI2osEwv4yOENAiPf+wQhbc/5f0gGisWuQaRFmGoIqguARWsBQgTTocDLMT5OJUQnhqdCEig+/EShKSEgTVV0MBMnz04BcshPnLk/+OaV0/dwKzB4QUt1NB6uTDfGOP+cNm9mEsBAFiM7AQh9AKVEU75vy68jeOxrUC4mDEuYO0oLqoSdHaEF2eXYYSm0V+oEOwpLmYFOF3Z4CmAeBTIGueiIw2xoKPzDBJVBXQ5g5O8/twwA+QguIjJt3+g0NQEcDfUXgO5gsqlTBLkQLdl86K3CWneitQ8sg/5oWAUJP2C3V3RoEyji5n4b9lB4t9pz2CA+cAFn1Z9I/uzYsU/ELtEBOCHYQQqGcFejV+yeuRJX31zsKV5IGjway9z6PLDxKwNEPsBuOEiqw57jGgOtZ1Y++T50AuMFl7hPIbhskiOwsATtRoc7rS7dXrpcgrMCGJca6ELJo+Y0be0BW5ZKGcFz4y8W9BduwcDnK9iO5fagsKpp9ANnvDPxeP8THNyIVFo1AMas8Qk5v2Ytm0LCCYAXqn+wQsPTBh/5Bcnne14Os3uCQt28vsK1WUESJFviBgAW//3u9PLxusXchcCR2WsNzv/ImvgZzzkUByDUAIrjTvmSHAowpJBQE4SUlxMxnARlQbIqkArVAJ6pBBvELCCKlkyCDAP45BYfEPfcUpfMch3Vn4bheYK4E66BxAxHSVd5INgEPgU/NBCDfNQ8Ho1CoINAPQAW/QT8OCIZlNFCB84XhoDChFByHGjx35v9BLgyhmojqHYb5QYXnuAecvua0hZe6BV9f7v4ibvgvamrmAc1TmaEir0LQ9h97eYAYVoM/nWA60i8Q3Ifezha9BqaaL3zvqd6IAuwwLSCCuCLuJWch4h30giPtyiAphKEBcCu9BV5wwzkMxID8rhMwdwMhcSFgrBT3RUTQboAUg3+p+Qe1IGarOioVnazmefV3lHpwA0AcLWCahUiXwePHWJsP+GH1gnp/we5KfOhJAbsj0H/BIEb04TbrTPsAyb2LLu93KwfCvn5PLAwrOXAa72eEQRo1CNdw5IprsAZ3hApy9zlcITG2vpCihsRSYxNS+J4vdBZ6B52eqRcQ/QXmSjAWSfa/5GA5qEg4iJFtm624AqXLrSA2gx8p1Mdqcghv41S0lSp/xAYs9gakQc4Ie2RTUYwYgt748mV+FU1Xgp14eW3XYZ6cdqGTNHwHICTwEeTPl0jEZwIgP9gDEaogeg5IHWCF+1eoAhvEKPB/EAeTRsM/pSAP5wjWEUMM1/NJRhwJbpJSgK7S7zF3EOsI5jBQBK9DV80Z8Y0COzvmWzJXgDl40KEC6cqvqgi4OB5cpgLFYK/1CvDiItXqC6/S87wfAUfPtxqfGNzlYaOjlf1IsHPPvffHgDAoEeEST4ZLZUd/RSo91/BjXY5ggWgQ4In3fyj4mUqPrInHOCLKO3wUwRsfyXpt1nEIRLrqcWeTuk7bigsbid1zD4iDRQtnIdQsyIXnFCn1I9D7ADgxEhOvR5AJosoUbu1FkJyYCi9OhQERoIx+4AX/YqUXQhtYEwKN4Cy1HntLMmtaAQpqfrT/UCoLSxeswjA5UWPPi0mjajUWxMTdVusNvt/ChMdmILK5IRMFu90BMEzFYHdg2GAgeYVHMMJIBTA7EFTx/5fpgTFXz9w/en0ZjD8kCDoKPNGwlB01BmoWQbh+AxR689mBponGJOr9OwmMu3dtJ/ylW1Tik4ElUPmR9RqII+pVhD9ychABMQ51gOIZg+/G+5mGIzLB1JJC5WhzYjhJ7IWmLDpA8jzsAafUPkB2WnFBF4iSxkq1ty7f25rv/+EQLOxs2oUdTSA9HIR9swdBlCcFe9owPC3XWDDC0ISVzsEVbSCF/sWdA5Fu4HJqankp2SeQCYYrImNalfmhpVxYrGkUS4LeSUjg8dD7+D7w/ybIfy7vlB9/HJ978zr7/45Qgajzj+4EjIK/ULHPRAOlKr/aG0AFcqCyu0GcW45Igh6JMJmhA49/U+cEssHNJhtXDC1MOya3j/sAiAGcrEtqtgjBD6wEzSDc7D8o6C8rIqAZyPk+NQoNLAZ1hR64Yl1FBY648smUYKnSg1Xwk/0DyRyArByMUobyByhCcPnOaPyoegREFS4jNfYAw+IHCjdC1J2WDZBke/OyN85J24WiXwDYPoJyYuCD238ulvuzwt6KgHf0shWKsqCFFGjB/w8HU8eeTED9wAAAAABJRU5ErkJggg=="; -var _instanceNumber = 0; -var GetEnvironmentBRDFTexture = (scene20) => { - if (!scene20.environmentBRDFTexture) { - const useDelayedTextureLoading = scene20.useDelayedTextureLoading; - scene20.useDelayedTextureLoading = false; - const previousState = scene20._blockEntityCollection; - scene20._blockEntityCollection = false; - const texture25 = Texture.CreateFromBase64String(_environmentBRDFBase64Texture, "EnvironmentBRDFTexture" + _instanceNumber++, scene20, true, false, Texture.BILINEAR_SAMPLINGMODE); - scene20._blockEntityCollection = previousState; - const texturesCache = scene20.getEngine().getLoadedTexturesCache(); - const index = texturesCache.indexOf(texture25.getInternalTexture()); - if (index !== -1) { - texturesCache.splice(index, 1); - } - texture25.isRGBD = true; - texture25.wrapU = Texture.CLAMP_ADDRESSMODE; - texture25.wrapV = Texture.CLAMP_ADDRESSMODE; - scene20.environmentBRDFTexture = texture25; - scene20.useDelayedTextureLoading = useDelayedTextureLoading; - RGBDTextureTools.ExpandRGBDTexture(texture25); - const observer2 = scene20.getEngine().onContextRestoredObservable.add(() => { +var _environmentBRDFBase64Texture, _instanceNumber, GetEnvironmentBRDFTexture, BRDFTextureTools; +var init_brdfTextureTools = __esm(() => { + init_texture(); + init_rgbdTextureTools(); + init_tools(); + _environmentBRDFBase64Texture = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAgAElEQVR42u29yY5tWXIlZnbuiSaTbZFUkZRKrCKhElASQA0EoQABgn6hJvoXzfUP+gP9hWb6Bg00IgRoQJaKqUxmZmTEe8/v0uB2u7Fm2T7HIyIrnz88uPvt3f2a2WrMbOvf/u3PvvzP/sUf/N6//i8vf/lv/3v5H//d//Sb//Uq/5u8yf8hV/m/5Cp/L1f5hVzlG7nKJ7mKyJuIXN/hPwqXI/g++zq6rPI5u8z+WqfLre+zy7PrVv9L8brsMiGvk8XLmM/sdfHXal4e3ad6GXPdyu2ij8u/+uv/5cuf/OSLfdtEfvUr+dnf/d0X//t3H/7bf/hP//N/928h/0Yg/4VA/kogfyGQP5Wr/IFAvhbIlwK5CGQTPP+9z5uPeePJSW+yo2+s/GtN30Rnv1E+f5zxof9R/lSXv/nr//mrr3+i+5dfyX7ZZQP07Tffys//8R/l/9TtX7790T/7r/8G8pdy+/8XAvnnAvkzgfwzgfyxQP5AIL8vkJ8K5KsmMVzu1U7p5PA5AXxOAJ8TwPf7sX/51ZeXfcemqnp9w/W77/S7X/6T/vzf/7383RWCX3/z05/9i3/13/0PX//eX/2FyP8tIv+PiPy9iPy/IvIzEfm5iPxCRH4lIt/c/393//9BRD6KyKf7f488fP74/PH544dJAF9cLl98IZfLBZtuqterXr/7Dt9982v95S9+Lv+gF/3i7Spv/8lf/vnf/vGf/dF/JfKnIvLnIvLvReQ/NEngn0TklyLy6/v/34jIt00iGJOBlxAsdvv54/PH5493SQCXy9t2ueh2ueimKorrFbjq9eNH+fDtb+TXv/ol/vHyhX4Fxfbx7euPf/Lnf/PfiPyeiPyhiPxxkwB+fk8AvxzQgJcIrGTwFsiAEXH4/PH54/PHUgLY7whgu2C7bLqpQgHB2xvePn6SDx8+6G9+84384vKF/IPu8iVU9Y/+7C/+jWxffiHytYj8VER+X0T+oEEBvxqQwCMJeIngo5EI3goIwVMIPn98/vj8ESaAbbtu2ybbvl8u2ybbdtluSECA65u8ffqIDx8+6G++/VZ/efkV/sO261dQXP7wT/7kX8vl8qXIFyLylbySwe/dE0CLAr65B/9vGn0gQwRMMqgmhM/J4fPH548eAezbZd/lsm3YtssNAYiqiogAAkCvb5/k46cP8u2HD/rrb7+R/2/b9Wu9yJe//8d/9Ney6S5yEZFdRL68/38khG/uKOCnAwoYkcCoEXwkEgGDDq7CeQfyOTl8/vhd1QCum26ybZtu2yabbrKpQvXue1yvuF6v+vbpTT5+/CDffviAX1++1V9sO77WXb/66R/+4V/dgkbllQi+aBLBV/dE8LWRALwkYCWCNyMZXElkwLTMeMkga/P4/PH547ccAVwuctkvdxSw6bbdtYDbTfSZBN7e8PHTR/3u4wf55vKd/nL7DX6mu3791U9//5+/gkNFZGuSgZUQvnKowKgLWLTAQgRtEniTuEfwaELw0MJvf3LQzynud+53uG+X6y3gN9kul+2y6XVT1U27JCDAFVc8ksAn/e7jR/nN5YP+avtWfq6Xy9f7Vz/9w1dgRYngiyYhfNkkgzYBWHTg44AEMmqQUYQKOmDaiCIa8TmsfmzB+DnZDQjgcpGLbti2y3bZHjRAdRMVvb/dcYU8kcDbPQlsH/CrbddfbF98+RPZfvLFnAQeieCRDC5DMvju/vmD4JkEvjRQgKULeGggowdHkAHTYxihg89vu88I5UeGAPSOAFTlrgPopiqbKPSmCKreUoAAkCcSePukHz590m8vH+WbD9/JP335k6/+tA86KxFchv8jMvhiogE4JQm8XhfKqOAqx5qRPyeGzx8/cgSwbXcUoLJtim27C4Oi93+4v6VxQwKAvl2v+Hj9pB8+fZJvt4/yzfbF9lPdv/wJnsE2BogmyeCRED40tGFvksIXiSbgiYSRRpDNDZ6BDI6ghM+J4fPHeyKAO+zX7cb9t4tedMMNAQju5V+f1uAtBSiu1zsduMrHy5t8ePsk3376KN98sX/xE5FPAnm7/782o0DiUINXMkCXCB7/P94/e87AWUmARQWVvgMuKej9t1RLBp+Tw+ePgwngsutFFdu26WXbbl+rSvdfbnqAiuA23QcBgCugV1zl7e1NPm5v+LC96XfbJ/1W9y++fgXjA3bDYXV+MuhRwSPwL3JLMFYC+HS/LU8HYrGwIhwyNOF12SvgM4SgztdifP85MXz+KGsA2C6X7aJ6bXSAOwrY5OYIqGy3d5uq4P5GhABXuV6veLvRAf10fZMPb2/y3b7vX7+g+9v98/WOBq7GG7RNAlYy+Dgkhhb+Xxp0sE8IAC4SGAP/TbgVJK/PoJPBnAiwPKxsXfbbnRg+i3s/JAK4Q/4b9NfLtomBAqCickMBjy7BuywAUVyv8na94tMjCVzf9KNcLl/0SeA6oAEYb1i9g+FtSALb/bKL8/+t+wxXFMyswqiHoK4ToIgKqslgpg1qUC0QoYbvJZg/B/q5v4szHmPX7YEAsD0CX25OwEUVm9xag1+agKg+nxQArnKjAtDr9U0+Xd/k4/UqH7bL5YsewrcBBiMJZPRAp6TwQgWfjM9vgRbgUYGL8AvLWH2gqhesCokeUmCSwPsnhs8fP2YNYMO2XeSmAWxy2VQaXeDmDIhApf33rD4PTUCuV+DtCn27XuXT5ir8VmCJ2G5BpBM8/r/dEcJb8/0lEQMtJHA5TAlqNuLRhJChhEpSqFabH3di+G1AGj+W1/dyAR4IYJNNnuLf6+tWC9CHHiAtFhAIFLjK2/Uqn65X+SS67aK+3QeTDoy/IG2ogQ7fb/dAtz5vBgrYGqrwNtCHsVfgIvwK07OTQBURVNCBFpKCOjqCHn5L/67TgTN+fpySAC56nwSUi256kXsSuFGAVyLoUIDo8/Pz7fdoErr/v17lk162HbgHvFpIYDfoAJJfW4sGPjkU4VNAF8ZEcLmLhdc7kljdY1y1Dq9yLiI4IiRqcLujb138KIPn80ejATwRwIbtBvn1cqv+2J78/5EI5N4cJA8qIPcmwRsKAHDF9WYP6mV7VmrgLuTpxYTcMEW0LAmoQxFsuvAI8tv/a/C5fV2ZMMiKg++FCM7RDPRu8ebWY7VG6VJi+Bzk35MI2LsAckMAgwvQ0gC5DQjd3ABg2HQLAPpEAlZ1Bu7VV7MGHDFRAbo3VKsTbAY9sPWC/uvx86gBbDK3D1eEQS8pbAeSgSwmhepnJb6uBv/o/PzHLzxWA/X7TH77De5j6AGQi6o0CUGfCOD2X7cXAlCFQABtEsGLDtxuOyQB2UTQBKZe5GUPXgkUYCUAbZJRhBDeuq8xBf+bgwbehDm+BFQi2IJksOocvA8ysIMfxluVcRsY/eB3JzH8GFDAXQO48X/dcIf9jyDHptIigDsFkEe066tBSETQUYF7ElDdYEBytN4+rk9UcBPfrKaZqFHWcw3i4J8/X4ev2//bSXqAhwTay6OEIPLD2Ipt8OtAGzxkwLw9WVFRjTc/qC6H3+YK/b1oAA0KuOizHfieCLaHHiAb5NYTIC9EMEbZrVEQt1xwhVy1UfBh8PUOquMizwaap3tQXfY5B//tea/NZdfhsvbz+PURQTDSGWB87VX/7WSd4KxjUqrIgE0IUkoKGnhIvwvawpGf6eECXJ7tv4qbA7DJgwpsKthEmmYgfaAAffYF3HLxo0vwNjJ0SwRWMG4db4eh1gPNm18vQ+us/0eGmxDemu/fnM/X4evq/8342ksGHgLY5LyT/zg0wM8lcMjgGFXwqIOVFJBQw99eCvF9oZL9Mfl3QwAvIXDsBRC9R+fz8x0FPBLB0xJEpwUobrfAkARgIAF41h3wQgP6QAmX5E/7eI43IxGwwf/moIkRyWRJQIPgt9CA9b39nzt4bYUWjAlCjWDPgv8IEjgLJfzuaAsrv9VdVG4OwOXW/fdoA35qAdL0BDwvf6AAUVHd8LIEu94A3K+Q+2YxaB84MOH62P//qoo38fCRDERE2zf0JfmDa+MieElAjcDPKz+mRKCOtdgGtXaBjgNJ4H2owSpNeAW/rRH4CaHSpMwnBYYycjgSJwfie9CR6mPu20Uv8kABF206AvXlBMiIBPSlB9wjBW1fwEuSb94296VCqgMaGCt/G1BbExi3IG+r3a3J6P48Gv/J0YmEYoiGY7V/SxwFCwGoE/xa0AJ0CEiV9QPCJb1OJ5F1VTjEY2/MO9AEJvj1BJTQpqLfTlGwjABuzT962e4IoKnyrdh3+/6mzDVJ4PHOxj0JqGKoy20+wBMN6D1gLWi9NQHfVP5MEEPzjGYy8BMAOnTAJgEr8HUIejRo5xrA5xkR5AngmiSHs+zDDAmMgWzTg55GSJEmHE8IvWPAoYTfhWak/Wn/bQ0CGLSAjv83SUEfKp5q24LXuQICpzrjrgWoza8xVE00CQCORdhMJuTUT/rjuls0gO4Iby8BIEgK6gS7BsGuTtDrScH/fR68biUHNVGBnxjeNyHEvQe/ve3LZQqgG3rof6cEclsNflG9J4KtaQ8WHcVBHS1BtHE4QP9OBMS98mpbKTeDW7dJwRsnHpMBTFJpV4I+b0kY/NqInVFSyBLANbnMSgBM8F+Fqfxq/h657/Up+GaBnwV9hRqc9bZ/vA6vu+T9E8KPJWns94UfTeCj2QXwCHS9dNL8Xf3Ho/rfewSeFODGDV69AU0y6NFAE1DP3qK++rdB7/1HRxf86gT376zOr99T/h/ioBiXWQkgQgVeIrCC/WomhDmQK+hASI2ARQZKooHMLdCJwGEBBXC3+uERwg+VOHZ9ioAt9H80AI06wGgJ3nQA3BoCut6AhxYwgcPOFnxuFnrphk+NIKIGrWPQtgz3b0i7Y6D5rs1GKqTop0nQX52vmQC4BkjA+r4a7Kx9WLENGeegkhSETBCrNXIMdi/444Rw1n6E96ry7OPuj8UfLxtQ78NA2iSBbg7gIiIbdDLsb5agPhLC3RkYKv8NDbS2YGsatNRAG2oQwf9ZIOydgy1MAzBkAw8UwEEIDzSAqdPQ6za0PkeJAMH3Z0wXniUSZoHvBXU2mcjQgv56TedIKglCpIoQfgwCIjOytd8WgN0bfxoR8Fn9Gx0Aj5Zgq0lIZbsH/ibSJoFnS+C98g9ooHEELI3gliy25yONIiE6pb0NfBlyNEYyENoodkKwgl6I6s8kARgJ4ZoEfuYWHLEJa0LhSBXm7kImGeSfVdoJ1DO2G7WXsehAptupSOoyrCSF904k+6vt98X/ZcM98Hsd4JYIXhQAIg3/f9AAUYhsLQKAtkHVBnzjCKhOoYl2ym+iBtvzDzQ2DLXJ4PUmbJHAVnBQX4jkxfvHhNDqAdHXGQJgv0aSDGItgOseHIU+K9hXnIJzkoGlEKzNHagTdJ6VWEUH4iCKH4fd2AwDPaYBm4Wgng4gQ9V/CoGiuNmD04AQtNGMGzSAAQ2I2pzfogY9LRh7BrbOh4+D30sAencljFu2CUFrwY8UAWRfWwGvVOVfbx2uIILM0pwDv082dUTw8hYs8L+uIWiHGpWgClnAa1lMPJogovvvbePPs/q3Xr++kgCsfgB5oQF9WYKPJqEn6G+OE3i5AqouF59FQOmahQC8rlPLj38kg1c2f30vw+XaoIX24/pMGIgSBoZqoH3wo0sIIGlA9PWcCPrAtpPB8eBf6x1o6cHra+2+tpIFP4PgBfxZtZUJfo4qxELT948D9ucK8Mt9+ccjIQw6QJcEbrD/1g340ATuDgDkFfx6twSf1f9xvuBECYxq/7ythQQGm+5JDx6Brw4CkMGT3wgscCUoQ4sU2t6DR2ciBjTgtcpenQoZVX9NuL4Owc+dVaDursYVkVALX+shjSBKBuvCYDUZjE5BdNkxdHAUBexyHwB6NP7Iyw7sxUDViwge1t+mz8B/LAvVx/c3PeBBCToB8IUGOgqA3iV4yUg6UAOxaUFHDx6CYS8SorMOue0CCJGAf5YfRhoAI+A1CvwxqNkAY5yAIx2EQmkFfeWOXi+nEdSQQA0ZHMEItiagJArQxDXIrj8nCfQi4HZPAttrIahso9oPQ/2/JwV5JQU8zw+7I4D7/sBn4EO6rjw0FR+i3Z9fHtahzsFvJgM0X+tmVH5vaYiNDGAigewAz+gyNLThnjCURQFR1b9d3lZvnVqmj9mEPDKIUIC4KCCjBXywS4N+otp/Hk3QVthOkwEKlV9PQwXjT7s/zwF4Qf9toAAzFdjuaEB6S7D1//U5FIQu2MevO0rQQH8ZmoXE6B/IkgE60XCjVoq8gt2iCG0S8L5GdxkM1cGsfsCMArSCAnrr7dzAZxCEEpepvB8tqHJ/q+bmJGGts/AcAXFOMMeTwC7Pw0B6CtCtA2vWgonqBQJFSwH0JQK29OB2kvgj2HHXAoyeAIsCQO0kMNECAhFMqCBf8mElAkyBbX1tJQP2RJ/ha0gpAfS9l+/5n00CkrQpq0MZbOdAuxmMvHswog62jZj7BnYQe19b14kxNq2D/ehX/p68HEcF+x3yP7z/V/A/q/5DA3i5A/dzA5pdgbKp3v3/wQF4Bb70WkCTHGRAA6+KL0bFl6FJaFw0ImZwm6igSwbbwPn9RMBWf3sN2JgA/BVh/Rg0kQBgePf6HglAHLFQwqQQOwDjbdVxNZjR4iM6Qa3WxwvNxh0JFb3g/WzFQQS8b/ttKcDWoABtUMAd8j9hf0MB2uDXhzX4CHj03L9DBU3Qjz0C0l4mLSLQPicOOwZoVCB6P6dA7nDbGkVuxcNr8PU2JQO4wX5trEqmccZaHU4q8oCDFOpzAnOwqyMIMktNNNAHouDGxO37DgArQZzlmp/14W1QlqHTMaIIx7SCx0+5yza7AKJ3IXBrNAHVDcMZAU/BT/vgv/ULPOA+XiLggAREDF2g0ci6xNDRglegd7P7TWWH5oJfayliEg7bScQRBVgI4Ookg/F6rvpLWP29swREqA3CaG8/FpKqS8DTAV4TiBqIqtxfzaQRLys5I0XEFIFrPbZRQb+16Fgi2LvJv8EFUPW1gGfQv1T/F/d/HBnccP7rAwnIIyHI4ArgWeGbU4eHy6Tx/EeTZIb5bo/BsMBjmjBE08f/RB0PHYBd9eVRAGY7cHRwiBf8WeCPHY1bgBTa9xKTELzEkQX9CPtl0gJiqsAmCT7I8xbjivh3JGFI+D2nBcSJQJ8agDX+O9iBL7UfG4bzAkcaICrbtYHz1ycSmGmAjJfL3CMgT3tQpmrfB7gxSzC1DnvdhQMieG47u75+kTouKNkM8c/+vq/Q7ZYjO/hhVvRq8F/9gGfhP8aqE9EIdR6LTwJ1h0BItyDqB8iFwuNqASscRnYioxOg9ApvnYA35f8e9Ohbfe8J4rknoFkO0lmA2gmAG0YK0DkB4ieEjiLoMD8wBzom27ANZkzIoU8EMHk/uo1mzeVoEoRWKn8L/62EYAX/lsB7D/LXg74uAMr9oGivJ0CNJCGD6i9DhZdQF+gtOp4S+NODRzsDVbhdgv4BqTMNyIL9SCKwL9/FGPp5oQKxIf8A/UX6r231H7YIqLML0Ae2GtrADOvRQH5b/MPE9dt9BGLNG8jVTAQvIaK5TtvvvWQgDvyXIClUA78S9Nfg7VtIBlO7cbsEYkQDMot+ygQ7QwmOawTHnAM2XUSnJvPIYRYMmYPS+sv3J+cfP3d04JYIXsF/EwMbBKB9Q9AY+BiSwFj9mzrSXmcJhFPVHySTbgHJCPvRQ/z7G/SVUETsg0ZF+i3CRoCjhf7y1A9mOiDD7TwdwEoEXjLwAv+avLE2B7Jnb+OqDpBoAchoQJskxKnss0vu7Q2YhcDv4ySeLOg9GsCKiUIihP7yfW7zbTsBh0TQfN0iAWn9f72Z56/Ax9P7j5OAH/Qvv3/QxKfk0DgDuP+R3USg3bzBC7bO/QT9Eeh9QvDPG7glBQzJwK740lAFFgFk8P88CqDGAa223YckWYhr+c0BPdwetl2ocnsfzePAWcVnnAIp6gDVhDLyfV4nqFEDPxHsbWD3k4BDkN+pARqKMLYBPzYEvxp9xmCHQQdgWH/9EtH2TIFpu3AH/cdGydv1j0TQbRrq+D/mLcX3ZACZ15bF378CG0My6Kq/zoGOQwhASDFwFbxyNGBuSxbCEhQ/uEPe/6gAERWQObCVVfjPpQX+rexxYhYFxIkgpgX7Y/vPs+Pvxf9vwt8kAs7i32t3QCP+3SPaTwIytQXP38u0PESm+YER+o9B3vr8mETAUfDrEkPI80ck0FZ0dXh9U+HRbhey0cAc2H7A4y4egoD6y8JfkBiigLdFP8v2W00E8deT2IeAKujZ/QAVKpAtKI20gLWksHedfgPcb+0+NEHefd9vB9rayi8h7J91gBbaw20MsnWAF5xHkyDUCOoXp+yrOwwxcKj0aL6fFppaaKDv6OpHR5sgx5BAlK/+fYhuP1D196o8e7lFBaKqv5YIMnFQpd0FGVR35RJCnCDaABaXBtgbiSwtICMtalKC+1JQ6bx/PLcDPQL91QFodQNKpwOgF/9eqcBxBBqRcKAAVk+ArQOMx1RYGgB6naDhlK+uQQwJYx4meQbxtNnYQwMjt/d4f3M9ZE4UOld1LAh99fbfzOxiEkKFCkTJIUIMUeVnJ/9sDt8/e1NEJOi9oVHDGYhgnSLss9DX2IAqw1zALUncKcDr0FB5NP+0cBQNrEezDiyiADPkt9qGpwoPdL0AGPx/NOKeyf3b9WJNdfcFv6bKd2cLMJVfJ6Y3B6wB9WFUfWWEwKMfGiQL+3bz9XGQz2EHKhF41GCtZyDi/gUCsNhYoAr3UNJ58YidHKqnMb/6AB5J4N73/4L+t7mAkeeP3P+1LNSB/l0SkMEd8DcEuUlguEw6t2AU/PCE/q++Akw6QFf1u6SBrj1ZnnhG50AfkoGIdf7gJv1KcSfgzWWkQ9U33Z3tHXYASKJ9e/YhU90rvD+q9Ej69/wxYJVs506Eg/r3DkMDzEdDBRGgcZay49XihLA30P+l8N+hf1f57/0AoxbQbwYaan/rBMirE9Dk+sBzTkC8JNDEUlv5McB8PP19Y01Gayep+hC/2zvQ/2HGLAurowsNGlA1cnqGGzeH5weiYLZm7h3QQC4O2tXdhvMMk1ZS5ebpgI8eMrPvPGkwaxayk8Yc6PMOBPEdC1XZ+2UfbfOPtxLMQQAG9BcZFoF0gp/RKjxe7+oAw9T7ZPWhgedodgz0gf5KBtrtIZhQAZpAV1Bi36w6t98qVfH7hqGI318lLCjLCUFlxRHwqYEH9a2qb4XjWvDT7kBwfbZA5P0+PNuRuW1yf4yNQH3zzwv6b70QOJ0G9OT/dhoYRUGT15uQH/71MjQLtQlxfDuiCXrtM+SkA+icQdH6sU/xz7Ze7FlubV4TpoTQ2osdpaEjtqADmEU7OkBEFoLeC3IWFFeswJXKXzkboNL+wzcFHU8hTGKIboO7CLi1/P+5F+gydQhuvRbwEgxvtACmANikhLTbj0gCYk8KdlYgmj+4Ymaod7TwahwadICuX0Cm2fE5iNHPK0x/CDV66Kyg1MnqjNFBnhBoLQCgUULfaVe5nq/6EQWY67bXCszUb+7232fVPz51iGB12owK9peyP1T4raMFF/OEYJP792mgXYfZ04GHMAhBkCSmSj+dKqRPgVFGHbpLEGMiGFeQWfSgrY52VxaeDUPSNJI0P7NoisG729HHl78z6hxfs9rV3m4JjgM/lsui2qmThjCfDFSb+I9vwUqG5wwL55U7C+6ot8B+7N2o6r3q37T9trfpjgmTvv7PSQATLLeRAOZhIJHBQfDQQJPBdUwEbVW3+L08EcEE/9G4ANrCeWcnPKRHDupbNynMx5AA9IRYLmrc/YLSiD5EaEBS/s/TgnU9ILcH19n+CpHwegLejx7Mn/d25fdN+e9U/1vgb7bqf08MOtf8EXxaoh+GY8L6gDfhvs4i6HQ7seYI2sv1GchdMsBIG3xlvxcCRzdgCPTn+6q/TW00VE8Q9FaFv+R2VlOM1vm/hhjhDCdgNflVKME5B47I9xT8z0YgPAJ8myb/LqHy36j/Mwqw9AALxuO1JVjiuQAYLcFzIhiEPe05fk8tRjGw7yWQbsfuLAT2VqOId1osnr0F49VM8INACPHDoBz4B5mqqSnUgyh3ArjXxfQH5BbgUS8gP7aU+w0zHD9GGD0CGHf+P1p/DeivlhU4BbxR9a2kYFR58YaDZCUR2P0DMmgED2eg77puegy6PgDphEB0CwlG/i9d+/Hs34pBEQrBn0W51mqGnJAk3ACCHeiqkQ1XFQA5AlKH7Lk8yJKWY3/nym14h2C3JvxeMwD9ZVMz0BPMi1n1RbKl1cYhIVblF3G0ATsRiCMUvoK9//OgcwYMoe+ZKOLlC6/Xk50br9NFz9fanqA8UIYSpCwlBO4kHc4WLLBfBHVaKwKgLQjmP4Un61Vq+3s7Bsyi0WztmLjJwJwFeE0I2vD/1Q6MVwefxfUf32skCPbCnxQqf+QMPEUDHZ7vGeyj020JgkPXXwsldA7SYR1RE3h94NvNtugswcgxXEkIcBPCGZ1rmrgDC0A4K88nm2fn/eTnpQtWyZfybRoK8Dro4zYDIMGsf7saTBzvX0SMbkAD6o9CYbsfMK38cJKD9l2FJt9/VGs0h5Gib33pxMKWNsigFUh3G2un+/N1WUglI/EEx8fq27vUNnwsiOoKecL7kQS8VnWAGCFUgn6dBtQhv40CmIYggwK0uwDHRGAuBXVdfwzHUjZzATLMAoyJ4FmBhzaWBlrHld9CCWpPHRqofBqMReMGTJ78q9rDes1Tv7/0m0v0AFHXNR6P6g30SHivin7V1BOhh3iWPwvps/yE836L2XiwnUT8x2iHgfqhnwn667QHEE8oLQjEvtEW7GYBZDrDVkwNIO4G5GiBDf9fGoFM6n+vbEtzXwP6u9AduaWnGYSLAlVdl/AU+ikrSeEIKgwdaZ4AACAASURBVKj4/wtgHcHtdO2nWKcBkPfxcvnNQvsj2Me9f02r76T8q0IBn9OLKfz1HX8yVXQYGoAB/2UeBQ5/5kCL6+H/OGGoRnLSwdd3oH8r7KkGTbgIxEwVWvnF8KOpHnyzfF9Jod5Px+IF1h8owyitDw/XEgRb5bPqbt1uvn7qBIQ16vtS/u+DP3cR7CH0WWJgd5mTJKYgNzoGjQrfvu99NDBC+bnyW1x/qhTatv2OaMKgJWPvv5kwnMgxHYGFRtJW8VMl3uP+MgoqSZyWFKr7+KIDw1d6+IiOgZI4+d5iYL3imzbgyO+tph9t2oSBxOM3ugHtPoFZ1LM0hF4kXNEBssvVgPdjdXZWK7uKvyS3q1Xb1WQwtVDqSUggq+Vw3t56JA2cz7PXOwGNW1ecwxPhfe3QEUsDsFaAz8jg0nf+iZMAHNg/XSazDuC18Iq1HBRrOsAQ8NLB+16g614jmuSgs3bROxE55D+WDDQNA4ivdMJ9M1b309UqknaDU8ObV9/PwmMPATvTMAxpABLBzugUtV9bLdhNDQA+7B9tQJ06/7QNDHGSwtgZOCIA47InIoDdROQGtt0U1HI3GaoUnCnC/rzBMQJteN17+VaAzYNA7e+PFqHQUyXPUYB7iQYa5ZFjq1Zqpx8Uqu/XT7+6BWC1Xaj0GlBIwMoHu7UzcI/6/Acb8KIq+hzmGWmAYnADrIpvKP7TZeLaf0LAeQkGgebbq9FToI44p654F47tekKkI0L5PQNZPsDwPBpy/ni+wKMN76Vav4+2cFZFf8+JwAraMt0DFB7beA/u4Zz/a+RXx0M/ct4/jwaNAS8G17eSwmta0Fhx0VRxJkHMivso+onMXr+YwdWKbgioy1jp4x4AzIKg5lEA7wvHEYCRmdx11TAuT6lDLVl4KvXkAET9P4RT8H2u+lg9EPQIpw+/NpJ7RwE8HaDv/Mu4f3OdNkq/EfAiEiOANjEALvcWL9gfFV4NZbgbQc6qPky4Pm35QZxtH1f4j+P/jXuaYPcWwIEH/fmEPBoAO4m4LGxV3txOQqDU+dXgey+UwSzuqP++uImO/u/6ogCb7wTc1n61sL+vZi87rxnrNas+giTg6QLzaUCjIp6JfhwtGI7AjBBB9JjDY4ePYVR6ZPgN4owVv6Q2N5hhVHwNeYrM+w6dN6K1sMHZm/Ce7bHe3dzKr1xw1w4JrSQMZtgnoQHlr18fzunAszD4qurNUg/TDqzx/lfCaO6t4tACMUQ6P6htWjDPC1hCoZ8kpODzJ70MUR9AODcgwyqyPhmE+wfHYB/hvSqt6qeXUShhXH+d9SR8DzrDaZZdpSp/HxqLMQuATgDU/qDPRgOIeT8cvz/h/XC6BtE7ACLOWPE0KIS4UUjmZaJ2grBphiWgT41BUVWZfP3AnEIT6OrfoF122l2rMycBoU5i/OXoUZ4/aglsXwLzHNU++FVF3qikOj5HXm2PBitT1WuvJRAB+6O//W0/PY8vQH5IrAsMs/WuVmAdHBrQgrbOxJShXwRSsu08h8JMBpo0+aDTALwV4tbswgzHrftG/dJKIAQb5h9KCssWIMeto+GYqG12/HWGjx8kzqNJaa0noMWOr2KwW01AMwJoNvhMQda2/RKQP/3ecABM3g9uD6BY68Ntz9+nDOMb5iV+hIE+dP/Zs/wwJhJ9mgBnohBuStABUXjugF3hkXF9ZZJAjefKdHZCc389LoStKvIl7QIEb1d9RyciQgFDI9Cjyccc/23Aam7/PZJBhgDgin5CtQvbCzX8ip9YgIFtOAt+w0owp/hOiCWgEGbVHuYjRigPGR/YOnEoqPDoV5z5YqB3mRq2ox5ICmSSgAP1Ne+XV2NE+/vuFbCTRADxtS70VRBCjgBk2OyDUQiUgfl77b7DwaHm2rAZ7osRSOOUoHgKfNBSLI767+oDYrfwZvqChSpGfj3pFwZFsCJg2jeIQQBUiyI4WgD68ww4qO8khuWkkIuDrxWv2nv+UTBpJYiPd0KemTA8qqFiuUF1jWS3BoG6pADJq751JqBI0wvAVPyMQvjcX1zbELltKK+zBiXRFiRxG+b7q3M9xuLdzR8g0gCGNzSM5gNYfqGO9CBT8OHct6oB3KsSDBisUnwsFuISQaRHxDSv0vptt2oeLHMERfRn/FG/Cx01EpgIQG8LP+/i37PKw53xn6sYCM4/JwSRrCnIeB1ZkLsawDhaPKv/njU3wnZ/dBdGE8+YTHSG8+ofGgIjsC19YnwdM/KAnTSsqj6ig7uGgIPw3nYFzhhIIvriAxFP9CQd4HSlnzgxONIdrE7A8ZDPx9fjib8ifgegNIliRgdx95+E1T7+3nQVNNhEzDgGA3T2rEDLduwtPpuuouPcs8swwXFjdTaMKt+jA5gUAQPcf95KJQxYU0cYxEDvsBSmYuukp7AwnqniC9Afa5z8vboI68ImT0t26CvwBzSggkj447r9IojvCn7U92J/Hw0QSdwZKNNjxPCfSxRqnATkdwpOwh88oc4J8KTSm/wdbZjrc+4iFP8YO0/5JJDCfaijK5xVXevqfg6zGRrQf83chvX4aRfAE//6vv5+6490U4ADdO7QgM/5bcHP/n4OtCQhBEFeDWSvos8DPq8/IwzLzjpa8/U6MMSkBklDm8e0mn3QIY7XG1Om8wzN48y7HwhOK3P0/ZwUQHHv4psbdoVeb9VlAjChBCdtDDpOKTh9ZfcagOYq31RFjN4/gwBYzp8lAwYNwBELhZoxECeZxMlAzWGdCRV0fQWGHo8+8Kx+AAxnCIzowAxy9KvNepWfsfp4RR9kUrD88CPVTuXRybhqqTHcnxEGndsgub1Gdug8yz9fHt3Hpl57x/mfCOC29FOSQ7/noAZR5W3Ob24UMpuPYAYiQrQgk1gnFoUIKr4vKFpV15pHUJO3Y5rfH3UFHU4bGkU+NKJ9f2hJyOMxDBDpjAgwiYqvk5TqNl9EH2Arb6fA3yaA4cBtPWewhkEcIQJBlGzYp6zRmr1v+e3Fv27xpzvyI44NGDkCIi7CGNV9Dw0M8NtHC2vUwHINumCGNG8erxOwtQINsW88Tlwdoc+F85nI559ngEDpt2F/Uu3hiXYrkN/pBFS26hYDAkFgErMK67y9mGBA3L5ore5izf8b3n805MOq/t7XU4WHv1DUF/5gugCSOAIW/59uMwl6CHWAib8bvfxWl9/rBGEMTTwDfG+ezEYG4yk6FvRPuPwE+wvc39IRjENWM+/cm5b0W4Pf4WuKUnw/vD6eDbB1ETs5vl77Dhnm/51g6wPWwQAqxnivgQaeS3gy/u/1H4hpTPrIgHAN0mSgXUX13YP5PMIuQAfBr/f70cdeE+QoCX3i8nFMLcAjInBoAIYqt1LhC1WdtvmSab28AYffaeivCB+ohdYQgfUa/WS4ToMsNLHLc9nnvPZLwn1/EefPVf+U/xvnCVSEQEkEQEnEQJO7S7RvYDxNeNYKrG7DKMhtsQ8cMmhgPKKKj+F7CiHYFR5KIIPxOmg5IVAtu3ACQSPh7CzUQOgAej5CWEkIe3vgxz0ROGO//qYfz/dnLT+ZxDr4QW0eNCJBorCFOVC312Ec2TiY5Bk0cAaQmiA1VH1MOwDHQ0kHdEDDf+2UTWhS4Z8diQMicLx8MLBfverLcP/jQzF0P8EJj5+NGK9RCz755S6F/f1+X/gxeP+Wsedv+vF8/54aSPJYFjIQd624MDz/UDLQnr8HU3ztKHRf8Qeno1vyAQJBaLcMtTV3cvgP56COCqd/QP9xLgBkH4BxO13n4hNUDtACC6G1S3zqooZ6Ba4lp/zcAFb7iERKQwQcF39IFJjdXECGADw0IE4gg674pYAnk4HoHPx54tD5daO5vxrugSkMjgiiqc7TVKAT6AT8R4ckbHEQCYR/IZBxJgA+XZjsR7vaoRpIxWqeqfXuGC2CxwudicwePEB1kNkaZCuwyF0DuKv/4sz9mzP/Qxdg3BDkBTMC8Q+loD6UGBzx0Kz6eAX/KArOQTlPHFoI4vVtf4rNuLrca9edRn4xBP7k8w+9AgZCgBfEUZWfEs8iFNZ3UO7TqmkjCO/rWdgco/yIqHcQWaC2EGTzgz5y/iXQAvyx3riyxxV/JeBriaGB9OrTA5g9/eokM+37GszqfA/UZk9iW5UnCtBqBl3XoNN6Ag/+zy6A5evPAp+TIFDn15gQw9rjrOzFX0s2JBVAxa/nP1a6AsNWYGjPNGPLTQgBsNUFvOA3Ht9o/rGDN0tWOCcxJGp+f7++kkP7PxcGv1+GjkaLt/fawpwwerQxBJNW4b+PJsYEgiAYYdEAGIlDNaAbRkIgK3ut0jKByp+8yz23X6GttmBmjwDvChgiYLP5V/zhH6/110sGcKo5CkggCngxnIPoPja0j2B+1BRkiYJiviaLJqghDI63G2nAgAxMCuDdnoD0wIQm+urMB3VuAwbBrFGgGgnhAFqg9+ujKsLxB3qGCQNEEtPinIQlAj4WgIw7/iXc9V/x/yUWFs2KH504bAh4aYWf4TrTLGTy9YbftyLeVOWNfYNyt/ji29mQnqMAltU3ioTtbX343yv/1u0YPUBz6zB702tQucnX0gWaFh6DgPdmhXaapGotw0SFz1qDiTMdd8h45HfcqCPRUhA3+NmKz1l9teCPaMd4urGaewRitNBDdahR5c3AfQmDCFT9vmtQEwqAYXX4XI2n23Z9B/Yb1FL+LWox6wHGbZSo6FR1LzyG+3hriSZvWT6jfXhl2cmQZJDrAbuYAqAHo1GA/EOgD8eGcU7A8eDvH4fQBuAhBL/Zp/vamPTrRENDGLTV/7E1WEPLDlP/PwzU4YhusIMUgfIPAr6Dhv5R4y2r8ldFwiFoYHnmr8TAHbhRQSZOctH598ZYhqt6wP7q/ouqe77RJxvzFYaji/z4vna4v5cUMDXqDAJ5ytktqtBDckyjvJg04hl16LB0xFfyMfD77PZjErGQRRjYIfSvoAXntks0ok8MsUC4KARWnYPlJBeIgLeFrUgDOHYCag0/XNAbWgRwQuLAsaQwIhC1g7+jCNKuT38JfnYSyTi+QQEwwHeT4/dWHYxJPxfOj5oAnRQqgU3YgGZSOaDyK3n/qkDYBKptzR3oD6B4fyRKjp2AzSl80YR/3P+/1vBjX18Jbu+YsrMRgbqPP8zrDLTAaupphfeZtyPs9BPztpLSBZjowF3woYRwBwOWaqbev15b7X4RWsiqYiY6ZkFEIoUwUA2OrkeEQE8HYNyD/rl3m88jCGgO/nPW3xy8x4Q/HBcM1dYg5q8N+B/SBSYhtD0EY1PRGLDoKIBHF3yLz4H/gSYQJRETgqeB2d4vC8L2NVnQn4PoVJJAcP0inahAfdXVI8CFszjRagCTtRdV7Sr895NBpRKXIT64RMFw/iw5eChhEvmmyUIH+k+Qu3cLzOAN6ILlFvgWnx3YWFDz0f38ze9GlfP6UQ3ojEY0gtqRIEbA5/WgQFhsEuIeL75uTzvqHktAWfj/OD6sQXssROcGiRgFn0QVkld7OznMDT7CJKzhMIqxW9B+LCOQdH4uyxIcE49VTSeLj0wKjzcp2oDXQA8YoDEGBLMW0BJw+eAxXejPV/IXd59/tp5rVyYXDw5BlRetSpQAcvgfOwVM8ObzBq/AQ2wX4lwkQV3vNhYFfn2LFgaoDU1ogqsfqGkJYmrj9Tr22KQwBLzbLuzDeA9yzyJjVRfwegWq0H+FThDPA6ZhZwX2M2Kh4waovCzAWJTzD/qY00c+6PM8coz08VNqglzx54LfHuTJK7z2rwX35ABLg1DzsZ7Qv7l/f2yXDlbf4C/irg0MJ0aCuD0wP74MrxfdFlX7tq+vtRdCpvt599EG9Yz3V+P+Oj/n4zLruZHcJ7oMt/MNp9eD6HEeFb6/TMfbWo85Pb79HJo8t3371/PuIAZqMvjPC34nVV6ZB4hEuA7AzA5cfU0y2n6ux89D/35/n2/vWY5Bf0qwf3tPLISO1Tap9qzFB6eap/beqI94NCCbGwgqOItY3CGl446CaQ8i2Q9g0AvmgJOnBoAA0gu17tsKtKS7D4udgCYERy2QIceCX/P7mBW+g/7D9S6Mn50CS0eAoQPDcBjopIA5+EcxEjLweRjXq0UbLIjcBxsGx2IZvlf0ATjz/6qypAmY7bhrk4ahsIis6ccXKHdueAfUgk+RWPCLh42c6zEeKyJpRTdRAOqBbl/Wq/uT+q+Fx3FoTIuCzc6+hN8j4veGjuAnhSE5gKnco3A3XwYlq2sq+lmP4yEOpqEoG0M+mGDYuYT0pKCFHgLHKt3T7T9p8GcWH+n1UwGa8X6kQt2x4CeqPexegT6o/Z4Cr313PHdgrsS2ZReLfpKIf+IMFnmVmwxQ9AhithYT73+p2s+JIVfrjwiHnpAZrSsr9CMstQXP1+1+510N/q8E/YoekMN9OMFvi5LvkRDsy9rgFCOoPdpgaQIWBZjf5KCSQszZJ1ivTvLokpen6tsJAVND0NFqb6GUGg2Im4Dyx9Pn7/0dm4pADAslJzTv+dKNrAPQ0wyySm7bj1RQgbAXsRa4R+mBJzpaQmHLmy0BLoL+Nh2ZRca8uUc6P37k97n451fvTieAE8BdZ2ItqFEK6oOJIYPsiU4woo140Oh+H/UC++gatHYcOFT+2y3AYvD1rM/fpxdUcsAi70c0OxAEP45X/hymE9XeoC0zfYhbcqfbhs09HpwnKMDR6g0mmYyKth/UcLl9ITGQ8N1S6s+gA1HvQCc2pluPvN2Br8SyZyfyxPP/VhCi1L1HWX2CQCuAE8TIq/sBYdANZmTIwqq0sb0HIzhhugBeUpBZLFyA8y+EErsBUYDZHYN9QAAooQwOws+uQlhdESSSqk5Qsh8LSYI6LDS1AbmOvLlRBqQIeITvM36+TP63VfE5hFClCTr9zEyVFwS3STQBy66DMHB+PJWIrfgGnYBx2dTboPa2X49GaBVlePA7CFx4iaGi4ns0aLVjMGvtPTDtmO4XEE8E5Kb/8qYai+NHl60LgAICcUCoJPVeiYG6Pxw/X9VFNVbFn9FNPzXoIRDTyzcpREYB5Fm1EQQn3KRi9wKApR8Tz48SwxnV3qM0q7ZhpdKvr0zfY+gO4oQf+EGPFYW/Xf5hwWsUgxiBbShGoGIx+D2eH1h2EeR3UQMH4zMaUKr4033nzkSkfQADelFbLOQCalxdxvN8mInhPas9bxtGJw29Fx3Y8429MAS0fL33Oeo7qFZeiToCC3B/VSNYuU0fgDnkhxGgMFdxiYEY7MYel+OHPH30IMeVFK1C79l+QdXVpFqHlMAXEf3EYDyfkkGdNvJ8f3RAXU0jpgM7jMNA5yCrtfzOicKG/M9bgEkEjqqPPDEcDfqVwGZv6zcO9avDfOhf4OmLFd9OLBHHdxp51HvOBlnAoQksYjASA1xnIhPsapTCPjbsGB2YevpPpgM73EYeSYIftgPgte6CWesVBB9QEgfnWYMgoeC8ql69bWoRIqYHvSIv/u26bj/jdqZ9KSGk74JRo6QS9PuTiSHm6Z62kLUGH0UO4rwWrhtRETkR4iKRdI8giJ2D2nUCMjsA0TXiVDb98NAf/rCMlajA9wesWHZrAe1dlwRyVI2jx4KkyUHSx7YDe6YD4tOC6XW01puEdAJwaEJzf1uATHi6ZlSCpBQscsh6C1xRcWEG4bCFeKcAVhVlDu54JQIkTT21hptIT/Afk0kMcS9BKfjBJozcDXCrtgbWXxbMAw3INQIxtQJPAGwXmYaBbYh4SCsuKwLOAQ5awKskCMmRg8P3xwlBfbosQaDqyZqBkyQe1CLQACoTgN4qbyHsPwkTiF2pYaj6MAXBmUosQHnUEYCsBL3MW39SNKMJ5PfoBsT33DVJCEbFnBCMOkHfvj6Xq8uw+dgRIhGgAiUqf5QgKDFyhe8nnYrlqn9sG1GoAfirubygX4H+8IM1CmQrMFAJ5ExzKIp54nPoVU2Auh6eBShDlTV4u5c4HE/fVvjFrsII0Ik6QX+Iq68jB19ziLoKC27FYe0gC+j1RSS+BgB7AvAM3m8HLdy5fV60C8RMVuhD1ieQB32MCCq0QPJuvuw5IHF/geMKwOPdpmsxBwVEfGEOgeincJqNmuSFIPhPq/xM81CWIIi+gCFBqDX3QPYd2OcCRo6GZBoA3AM+00aesAOQ7/2Pe/vBCXoguD4OBD1WfPwClzcui12AuH+gC0gEwW72KfjBCQRBr05D0IQc7N8PzOCMehPWK384MPVDJQim7yDdoiRTItzzFV/ZOX9sYFetP0fsQzb6O7wOoFjxk89YoQXv+BmSN+yYHYO+BsDRAXHhuJXsEFbdIEGZQWUkNVNzGA9NZUVBIQL7jASR0AclE4Pb7JN3BO72mG92+o8UG3nybj+mASh0FsLKn9GPxDrEcS2Au35BzHO1BksriIJdpqWjKR1wlpR4fN977rZqI+XbYjYDgVDpcYQalOYKMiuQbB3G6Pu/HlMbi9a0EMkksXtjvvXTfgMKAEZRN/i/O7yD8Da2S2Bdh3ICWfp8yuMkYl5a4df4vVWt4UF0yyqEnaT6swYyWB8/j111Y1ERS9oB0SLMtBGDEBD1PEHwtdjUEAHnqmoHU4wCDAoAS+lHwtu9eQLUAgmxVvAuMB9cELMV3m8EUtcBYYI9nkNIEEJYrQeUHfnzzRyC39j8CgSkir/E0P2odnAmAqDnDIhqrtV9BDNS2POjv/0pwKr6z1h/PMz3uf9ykFYq9TtoAXSwpz0HljdvBCVAPY6t7osv6gFhMpkX13rcfXQMIpuTsfTibkfOPRAC2meLRipI4mDPwMD5x+v3+Ey+qEfACwoUEkKQSMZxYJDz9R68PyP43yvo2aYf881rNQbZgRU/jp80QnW/hdXqJxMvCFxXQSNHpE8QiF4XI+wFfQcw7VL2Md7RRajsKgh2D+6SLAKPF356+/7yXYBTUgFy/38StUjFHweD+iiHh8/LV/i/TSvGk4L5x7F6AsIKbgb4C0YjgdGRIToGUx7cgS3JKP8pRcgak95BJGQbjaJdBYQ1qHYnYHL8F45QgHx2gLMQ2cDxBD/4SeR0LSDi5XzPQNjM4ySE/HGG6g+ugltLNSARn281BPtNO72eJLjdX4ITSEgpQvJYFEUg24f1qAYQNQdxx6Q/RcB85j9f+03zf2QV33IDPHegNgPABTfqFR8cZK9TA7/ll0EQbUUHW8Gr1d+MSadia+LRHwhunv87yWoJ3h/pRDwJAbDNQQFd2P2mH4kP/wDT/ZeN3CK3+ZjvgVpw4r20AMafb58j4N1UMknuj6iCx883PU9g2VHVH5JX2eEcPghSgRBCKPzK0Q3fknwPN0Hk0CyC0zBkz//7duEetgFjVtypASDI4CsknYJgYDhqsBxxy29+eyxrAZX75EEf8f+CkOcijMDDHx4ASYGGu8WHgPwpHJc0qOG8FgFTuVk0cRZVePFwHEIUEu8xSHoL5qWg4I7/HgOKXe2dcnu2SSdCGIDTA+AcxY1zYL6Q6AAFu+/1GvjKPSeEoJV3NiM4Dz9C6oWkEav+NWjPWXNOIkKgNTi2I8LeBgaZHJxqrC4oNXoB9pzzMws/OW3ghSyQJgjbygOVEDhoj4nHLld8HPD6UUMFVLIgKrTL7cFoBRLQgEdXIseZ2/HhFPKbk4d5tYWwwR0nIFQSD2P5gQhs6meVfB+Bkyz2fOIvX/zxqsSODuAGIOLtPNnmIPCrv6Kqvgz3q4tCwNl9lWYfnsdHj2HTgQw5IBHwULmfSu1jEV3gDFSxTBmqSEVqiYK2IkWcRiAkwV/cyW9YhqHXDw9dkNQAcO6HFNJT7oChfrPUYc3KY17zAd+evAwF2w5SCKLV4EuCEKsKfjBVWHu9Q9Arh4CoBqEMWYBsNX7YgKP/69uC3M7/mOOz232QT+ox4iCyJGEFP4oBHd+GVvXBwX35nqp7qeIbV6L6tdZub3ueJ+gBIKgC6S5gOQFxDoGr+Bv2nzqbknd7ph/EmXzO0o+kZdc/wqvQkAOUffVMzKtYgx5Vob1/+HAfCdzHSiXHenX35/2JTr3KZ9Ruj2lYiMhLIFoNyMq9hFroeYMTE0bSLbhb4l3YlFPa6hMd2jk8dmrDgdQCnC4/+ANFlYTB6ATlx2GDGXP1rvL+SnWHw+cJes5/rRWt4H2pw9GklD4uSMpwasIQiaYR92gIyFX5S8dtRZt/nCAH48VXW3hRE/HKOsGquj8EM85Q9cfeAV4XwNGAlmIFIwPYrfLKuxV476RRetzcdeAsRSZhiHizCKEIOHn3EMOWy5X4uIJnXX6sFiBFLaBm/THOQAkVJK9j6TKwiSDTBWpwHkSPQJX7U959uAkoaTUuug6oQCBz1Zlxm0OJSIoIw04M+7zCGuYiznCfHww9AN6Ir+HXA7lfn2oBSJ2FOOh8SzINfmcAyITq8JX/sOMPx6A9LeYtVfwgCBZhdu25OB9/XmWWNPUEPD5dUuJ68wd1AqD2+w1PI9KxE9BW5t3z/igdYGWiL7L+wPv9jgVY8f0ZcbCKCuLAHN+c5wa69Zpr0J9t2KnpAGzyiAIPiFalJ8/xXrrA6Y+/8NoDnWCPNwFJzf5DpVkHte8hx76P+HU1+HEytEeSEIzAsu5r6wPJGu6oLz8VrKofXLce+ywIHhNa/Dmw8LrptWXZ4NKZm4pr/QQ7Qk8ehMrPtAF7PQCD309QgRgRZMKgAbFREAfBBXNalbHA9cEHMo4IgIUuPjjBWEUFEQpYTkhVO43eRiynJw9Jjj8TOUIlJExK+0wA4gWgQvcFBHAc7P4/u78/Ff4CC5ATB3P3oUwFClYgcALcxzp/B9Ez4DUV8RjBbsCBrMH4dLNwIDaCGhA6o3pXksdBvYBsktrXDgNJKAFy1Z+ZGIy5NXgXoBT8a3ZgVSPIUAMV6DjLxhsV8wX4n4ibbONObHNyCr8Z4FinNFjg8ziiF5zSV8A99u7Zdf5OisvVaAAAG3VJREFU/kIPAJLWX3hUIFD6o7MD4WkHIMXBk4IftSrPNBJVk0OoC7ice8HGS8XBKDoz/YFBLaQi392lGpCMJfhD9xVkx5Xbj73P9V4m1j0v73x9FjDDPlYvATkgFAVWcdNvJBamliOjAwRV0EpeRymAe717kMYRyy/j5FwFBX0fP7Dyx8gq8wn2ZXi8GfGYR+lFcGJSxa3Y84WgzBHetlU4cvKY44Ps4iP9fsgsPGEhQTAcHqwwGCj61SoPexKwasXFqtxq8qhD9SixoBBYcJEDNzmIoi3J7QkoJActVHocTVpPBCDhElAvMDK1PT/Sq3DwB/ygmyB9GNhYDH4so4Foy48kkPtZfZEv1PQTxYpyX0EI3Bu+/5krcN8fgwVdwWu2JNVNWAk+PcOOPMNdGFyAZ5Aj6gicgzNfwuHZg0HrLxBWfjSRl88fVCo/apX/IBrIvf65ZxtEoK9Bec4KZIPLe76osQns46NwW0pUPCPAyMc4A/KXOwZzFLGbAqD5xhhbgBcWfoJBAlarcCSQgdQJ+Movnih4gjZQTw51rz588y/ZgxVUEAQ8soCfX8OR26JwujCLGFAMsOjnwGrlPuQw9D/PPv8BYVR7pG/eeFtQpsLzR2KFI8SwKj9KlX++HeLOPuSBKrKeHBi7L4b+Kx184+ptAp4Trcscv69oARVYzWgaK01H1X0K3zNSmARKtxXYHvwJuT+8gLGGWgpHcWOmBeljFB2Ckg6wiAYOqfxEK3GMCAj6kIiTWdCBCXhkjUKMgJcLk271N9uLSbtvvK0S69OXAvoA5z94VsFubbmZvx4QAnXgBnJxENyQjy38wef81uPhxMpPJIQzr5ckuUTKe0wZyN57iFTWga8GvCwlh5UqvYgmaNV9XSxEVWs40kkosFwA70RgNOu8mLZfR6wDiwRa35y7j08NksqPQhcfkRBK/J8R75Iz+9C8gJpqzwiIeZII3QnYOkJWbVEI5jNuA+o2BwK82ifwnpSgHwaC+GNAdmW2VXfC+vPu6wR6lBj84C9WfvivZyUhZMJlJhjSukDlFJ3g4AvGJfC1iEpQJ/CaEd7G9wds7p71+odruKrHip/C7RdsxeVjzIxhoNkFGOW/+sk/YVAGtltfzZAIfzix8gcHhZCXpcGN2u69qWqD9OlRFAy7x2fQBhHUiETB+DocqvArYt98f+AEAXApsEmEcNLC0t2uPHCqPQIXwHYDfI4/9+8LMpchqr5HK39MJSrBXwnutNqjovjHFdq+fcHLp7YLR4mGgduW5hFpAXUoL4cTTuW5HJSkB5PC0S7A+8c+837DyoM1J9iv/po/o3BunlDqPjOSO/YbLFd+FGy9sxKFeT8b+nLNPrkAyD53FtT27yUS32yqUaEGTMBiASGcZ0FmK8nWxbvjC1q6WQC4VdWdAcBY8eFoAzIrC0b7Wt8wlPcIdE1FhUWeKU1Igv8Q/0dl4k/NnYSxdlDon8diUDeuQB4c8XVzcahRgyyZmNC+LAgeCfSVALde8/t1DCYawNoePGT83wlOpFUdOZKwxn89OsMEf0X8CxJCBN/dwKbFwkSMgx0ACJJDJD4iC1JEYh6XcEqVHpx4+J4I4UiAl26r5x64sttvSlAn3LBuQCz6edU8C+J5epBrC4YP52EFDgHrCw1B0eU9bOaTgh3wmYvQV3Oqqcf53XnVNXUBELX1xtSgFrirlII5d3HFulxBCNEfZx0h7K2f34XwdHpuYQcguN189Ow/nPXclaUcqMH5leCXjKOjbv3F0a7i2ZaRHmBe5zwnhA9S736ZC8AH8LHkg/T5znYgmES1dtuzGo92qwHIquiWX+4KgVLd8utv9Ml1BQNhEJW/FOgweiTguCUoQHkEwYhjfQIgm8eAzPKzHqAG5xGiiPyxeGRRaYetUpDVpHVC1T9bHGyaknb/TQTnuG7rDYwYCUT7/cMjtILzA+Go/FPw581F/mWeTkDuBsBCAK8ki+A29nMzPn4Rzjv6QV7xWW4fzQFUxb9jQQ1qc28kMi4mDl1NBr4usIsz5ltZqNm7AeJXfuTHd7nioLEyPBISU+8/tP1AC4Il/n+YGmjg2NiBRdl6yCw//zG5ph7bqaBuz8B4VMU/TqSsNPbwCeZA1cdxyG9SgKzRZPL+GXFOiH1/SFZ9wX8M3zUgvH8a4rMBjZj/h1W9MrwTiN6MlsCKiI4gycBzgV/xUaQGjGDHwHiYi0VIzeEAasCpNuL76AC7BIEl7i4AIxnAfoMxk35eJbZ68wWEUChs8IPz/EEE9BkUoNA4RCWSLJkY1h0Y/dG9bVCtUVPe7QRhtStXG4nOECDfUxc4Uw/Ik8JkA9o9+a83IrfHH11EdFUWc4phNgVFWkPsIHBnCvCCYBSgqEN9qtoXuwHhByYoJJA7BxIkkRwpDGgAHo+vQ3ZGOwCFJCJKUAx4MBpFZWvReeLgtBBkDDQu2OJxXa7SE/P4ZiUPHABjY1DsFIhPAaygWewiXK72hHjow/k8gCL6gKES8qcDZ7A+EhYlWCPGCX1wXIwzkQEKt8cP6iqkC0FEhFj/ZYtvXCtwuBLcDT5wXN+9H6ZEIkTwV/x/s78fXFX3siWHEKrC3tw7EFZ31Ll7ttknQyEMGgAqCaVe1bGk8r8nFWCQQR0h7CY0dsU/mIeIuA1AGCo02Q0YVXxub36sG1Qgfo0CBBUXxap+ECFEycQVyViBEBFPt14TK9rZHB9EwMG7DPXOv0OVHkdtx7OSCXfb3av4CFZGTwQBwT7/hKPHE4PzpJ4L4+FM9r1n8B+B+9R9I4Fu9brYUZgCunZWNxdQgIs8mASBQ4F8hJpEiaf4GPihk8FdAxin/kybjZjTj+mAQy6ihZ9whDvHAWB6BKrBXQr+5SBfqPaINwiz12UIwoTmbPACZY/fshBBBKNlW8ZCHwH/cVKSOZMm4Mxk4OwE9JeB+EFkn1IzcPQoiSB4vGgNeJSoik1A7m0TCmE/HrggB+/1M12C1Z18ACGoIeH1pH2IhAqFWgBq+kDFEWAvA3X8tpW0cnSD5WAOriOHhnYraF1eLTkS8P/QsHUBdtMPnOrMaANJE9AZiaKWII5Ue/8PTHn/UcCSTgIF2xN4zdmAQYIAKeBFl6FiO0aKfq5jcImHfPwTxcEdRmD3LcFoAva1Hdjm9UgGggI9YOoPkOBYLsT8HlG3nucMDGkOOJ8CkNOELdSO7D5qqAeJYBb2GpABgRi2gxLITgrOQ9C937HgB+0i7MeRx3gfPWCXLtgbLJAu/gCFBPzRX8eADJqCvA3FViC/BlOQC4LZyrBq8BdQAOUKoKjqR7v7EFfVFMojPgEoSlJesNIePyLHwW9NRgq7E6HvUN8A0yj0wyWDHRZ3J2A1jHdMyu3hCGwSDwdRir7h9VP7AKLgPoMCgKziOFLtrUm8aIFHlgxYfz8WBYUU55iAXauo+evJaIK/NTgRJM9sUcZRzcCnMdNKMJc7usnAyrpxHYkTRHK+n1HxS01LheAHqRWwKIDqLvQC0+PupHZgBawfVGsiniTVHwZHRqbUI/D4Cd+ftgyLAR1ehkIiqaKFw7MJEwUIuK5zsu4svoFYCFKgBJZACBuppOId2RDkPZas8H9kULcA9a0KTCQDGtpnzT+RMJiOGseHl4BQ1C29AWUXIIf/OIwwqoNEK3SCuA7FRiBrE9B4/PcrGJ1OQNj83F4Xbol/TgVHfMiIZLAdcaVkgh8sLrd+liNQH/FqsNTfj15m1J0X+ffZuq/gTY7QnvIfJz6UzBJLs83ItQpt3RfZz5iuGfNPajpngUm0R8DoA5jDlzsOTAwZjzsC3Jjxg7H914PjlcskGdghgx9HG4OOQH34uwQyzz61/0qiYNQjXxECuWYbGM/DrjtPH/Mw/K+gBLLSA+cEfPr4MroArzcDuybbr8Zc72i2UnzeHnTgzD4Ug78SzIvCoARVOQxaFFR3TzWnkkHUVFShEuqKxZnKz4p4YYcf8ZhYhuu8wFgSHcuuwCJagI4bgchJQK/qe9c/RT6nGcg6KGREJpb+MI0EY/b0jcsni3AJBeCQNsBOFVYoApcM2Aom4VFgIRdHpeIG8D3YaxBD+qCiQ+rBOSVnci8hzkAG1t/pgHA4uwDzmu8xFKkkkIqCfkIRs204r/hiDgutoAAcowBMZ9+KS0CcXVBOHCvJw2jMQSJyeoeExF2DuTuRcuWAo9sefyUQ6/oBaIjPtiRH1KvQKvygAHb171d+vc4GRMDPoxN/kL5pwlVh1mBQ1quQJAJ5j0TgOAis+h8d3mnC8xTKE34+8sDNjyVXE6nFMN+H39TQDmocHScENvN74LoGScGU4f7g6IG3n3C3qnG6JBS+Z5tHOOzRYQx+u7MZmAl0OSsRLAS/VIKfRAWU92+12aaVPksGDBWQuCMvgNy2M2Mt8EwqbjosZAec5xLEAmXmcFTHiOWARWglpNpjdEtBQRxJJU5VL5/7F1X86XntXgUK4q+KggsUoIIK8oA+kgy4+zLaACqQGTVOX6MBWdehL6BxHn+tlyBMDGAqufd7WOX5WTJwKYDfXJJP2GXDPk7Tj5Ed7BOG7DMFaBRAJgI/+H2Ngeb2SKb0zkoGlQBHkefDr7xMA5HZeJPtKIzyApI9gmnPgf1c3mulfhe0gFekDCdNFnrOwi4Gs6eTACNjB+Uegcgojog4V25P8bctRYY6RL8AJklE9ACFAGZdBEahd4d4CmghFhbzcwaXYH5qTlS6DY+KfNH5Avzjo2JJ0poDkSCMxLn73H/eB+ifvgvyIFCWAji7BWC8hd0qj0FziMdrS70BlVbgamIgcmotGZDNPwm0L9l5iHv7WRoAFx57ScFS2r2iwot8oKu8l+TOCOg2mZ2nFdjTgOFQENzKkJ8OjEnsE8f6AzyXwT6MNF3RDRnuj0Lwo6wTlBMDIyqaz6G+RiLJMg/KUrQV/rh9uH0tWduwoxmky0kSMQ+rnXxZsGadgnxfgk1pCnsIsGYltvfdzTOBIclIsN8MLAGcz5gBwj94AE8DuC9Molip/JGwB57nRyJiyD3pyk6q5ij+3TzRLohcqyqCEQBTepF15+WVmW8SEr5jMUUkx3oMIsrH3ndwAQganKzyMpOJNxMQooGBYwcByw7axIhgPRGEr6GSGJhkAELoQ1YRg+dPeD5IIRDIqq5PA2Jh0Rq0YcS8XBi0ghGRFpCtWTdum5+yLOsQf2EuYY8AfnbQZDgCjHxBSKwTGpt8QCIDVH3/4H5OwEvldhliINwAFLsEyyIfGKV+vm3eEehVqKTdNxtDiPoLHCRiuwTJxCECxMDqDjTvZ63KaPKvRgV2i/F3ohm88V8LN8hgJcXD5pVGIPPNn9EBqSQC0I4AMxBUcQNCkarkFgSn/oCs9GCVep4eUG5BRAOcQOCWlGSc3If0IFqRfURQGRrKewPKEJ9sLnIowKCcw+f48N6UHjqYtgInaCCkBbPSj8VEkCr2g8U43wY1xX/BNkwreQrzg+oaJghOCGTU8RBxuIp6VFOGoEXgEsBLIgV6gBgxoLSI5CgiYNT+GBHsU01GthrceiMUtv9KgAYktgVNeGrBbtiOQVi9x8WjiAW7UNUnm4Vet7WtsFgDCDYEwQ/EVL1PnQf/xCDLTowTh4c4HPRDoQaiwhKIAae4B7xgCBydI/CDPOrevK0FR4p6w3VfoXgQiB3T1N8Y1PCD0X19JqcHGfzB5WkQE4p/kdeXBcEVUXEIFqSij82lMyrWq/7c+LFHA7z5/dwOHHg8s/Y8C2CmhbmALtare+4UWLfb25BmXABKABTniC8gRAP2yvDAiUAsElnrxFzITQa/sAFecAOY7zPV/8jMQHSbWAiUPGkQNABhw85xrSCv+mMSzFR8+7mjw01A8f4F8S/td4jnDHYxpT8/OEyV3gz2+GTfdAeAszswfJNGlQhEIjB0Bls0BKn4Iw7WKu9f1gmSagmvqleEwJwnZwjO7npz1HdCJ1hS/mlBcRXyF3i/M7NxqJFoeH27z7nnJaBmpUZKHsTbGUc1ALEoIGsGYl9ixS50gjAT/VhB8IzvGTrBVfWEz1MzAkRFTtecW731VdjNQPukVdhdn0Y8d/a7WYH6i/TBPBzUFwAlHwtGHOQISrgb1AMUgDETTA3+THAdeRJhg59V/Ektofa9I8wxVICkC7QQSAd2O3cftzPzdMK6aA4iZI4ILfYRbb9RgqICt2AxVnYZ4kkBvHOBxT/zN9ybHx/f5Ql2fkGCX6ANm6F8WCfqAS+Eq5AGcHJd2IFHagTMHAAj+mWBnDXuc81CjhsAi5dL2K8QCYI1aJ/PJtSSxEFXASv7C2I3ZB9/a0j/7nDn/j1pHsz9Jr8fNpxPBUAUUYD4wz5GBlmyAiORjtAIGDFwzSUwqiNZ1d1tPiB7/Q9VeI9KeJU16/knkEeQJEALjY4rkp74fCZiMDSA/PgvT/aT2gYgp5E/P29AKBQAo6TRth5T4VesQFb0i4K7RA2MZpgyFXCEQHCOixuYMPgy2L7+45ezSSKt2oUkURlpXkEMOLSiXPuDQZjk63N5bmzOSxQdLHX7AhwUEA0BAeQPJIQzkAuFlOK/GtyLdiGDKEBdllQ7YouxV2Xdwza9So4Kp5Z0yAgUhTlJgFzSFrznIHYIwKcCu2/L3LsCg6UI1b1/CA+ApIV5/32HqOIjdQusE4azip5Wc1b0q/QGIAlaWEJbXP3r/L+AEipw/+BtkQVY9fIM2i/ZhgVEgJO6DZ1ksVtlYdoQAPhVO0oKmYBmnAYco4DRCRB3TwCziptaE0auER9/VzRqKNOEYINOQg2m1l9GpGNQAhh1v6UmxNQh2M4+LmlUzll0OTjYQOaGlZAEMCrdhmBphaMBwBADrSQQc3//He8KgFETT7p6BHnjj2X9EXsDjrgBS6ihoAmcSQVYmE4JgYWFpp1waAQRoqDzxDhU+HxSnZHz/9JEY6Y5MJA+cwoWrt99+U3Mc/9g/NQTFaigAEtwB1yBzwzucZSX7RZEILhR1d5GDCsBLVUdIQvsldZfEJt5i/MHx2hGJZFkVVyK242iFeh58oBUFqIQbkfp2DV2X0CkAYgv1sU+P+I/HmBu8nErugdRnUWhfp+A/ddlbEH3uQlBsNobUEMHasK1HOYn8BEEvCUaiuigXRIKj+sGOPA4KAWz9/s7WxcgB4+a6/fI2osEwv4yOENAiPf+wQhbc/5f0gGisWuQaRFmGoIqguARWsBQgTTocDLMT5OJUQnhqdCEig+/EShKSEgTVV0MBMnz04BcshPnLk/+OaV0/dwKzB4QUt1NB6uTDfGOP+cNm9mEsBAFiM7AQh9AKVEU75vy68jeOxrUC4mDEuYO0oLqoSdHaEF2eXYYSm0V+oEOwpLmYFOF3Z4CmAeBTIGueiIw2xoKPzDBJVBXQ5g5O8/twwA+QguIjJt3+g0NQEcDfUXgO5gsqlTBLkQLdl86K3CWneitQ8sg/5oWAUJP2C3V3RoEyji5n4b9lB4t9pz2CA+cAFn1Z9I/uzYsU/ELtEBOCHYQQqGcFejV+yeuRJX31zsKV5IGjway9z6PLDxKwNEPsBuOEiqw57jGgOtZ1Y++T50AuMFl7hPIbhskiOwsATtRoc7rS7dXrpcgrMCGJca6ELJo+Y0be0BW5ZKGcFz4y8W9BduwcDnK9iO5fagsKpp9ANnvDPxeP8THNyIVFo1AMas8Qk5v2Ytm0LCCYAXqn+wQsPTBh/5Bcnne14Os3uCQt28vsK1WUESJFviBgAW//3u9PLxusXchcCR2WsNzv/ImvgZzzkUByDUAIrjTvmSHAowpJBQE4SUlxMxnARlQbIqkArVAJ6pBBvELCCKlkyCDAP45BYfEPfcUpfMch3Vn4bheYK4E66BxAxHSVd5INgEPgU/NBCDfNQ8Ho1CoINAPQAW/QT8OCIZlNFCB84XhoDChFByHGjx35v9BLgyhmojqHYb5QYXnuAecvua0hZe6BV9f7v4ibvgvamrmAc1TmaEir0LQ9h97eYAYVoM/nWA60i8Q3Ifezha9BqaaL3zvqd6IAuwwLSCCuCLuJWch4h30giPtyiAphKEBcCu9BV5wwzkMxID8rhMwdwMhcSFgrBT3RUTQboAUg3+p+Qe1IGarOioVnazmefV3lHpwA0AcLWCahUiXwePHWJsP+GH1gnp/we5KfOhJAbsj0H/BIEb04TbrTPsAyb2LLu93KwfCvn5PLAwrOXAa72eEQRo1CNdw5IprsAZ3hApy9zlcITG2vpCihsRSYxNS+J4vdBZ6B52eqRcQ/QXmSjAWSfa/5GA5qEg4iJFtm624AqXLrSA2gx8p1Mdqcghv41S0lSp/xAYs9gakQc4Ie2RTUYwYgt748mV+FU1Xgp14eW3XYZ6cdqGTNHwHICTwEeTPl0jEZwIgP9gDEaogeg5IHWCF+1eoAhvEKPB/EAeTRsM/pSAP5wjWEUMM1/NJRhwJbpJSgK7S7zF3EOsI5jBQBK9DV80Z8Y0COzvmWzJXgDl40KEC6cqvqgi4OB5cpgLFYK/1CvDiItXqC6/S87wfAUfPtxqfGNzlYaOjlf1IsHPPvffHgDAoEeEST4ZLZUd/RSo91/BjXY5ggWgQ4In3fyj4mUqPrInHOCLKO3wUwRsfyXpt1nEIRLrqcWeTuk7bigsbid1zD4iDRQtnIdQsyIXnFCn1I9D7ADgxEhOvR5AJosoUbu1FkJyYCi9OhQERoIx+4AX/YqUXQhtYEwKN4Cy1HntLMmtaAQpqfrT/UCoLSxeswjA5UWPPi0mjajUWxMTdVusNvt/ChMdmILK5IRMFu90BMEzFYHdg2GAgeYVHMMJIBTA7EFTx/5fpgTFXz9w/en0ZjD8kCDoKPNGwlB01BmoWQbh+AxR689mBponGJOr9OwmMu3dtJ/ylW1Tik4ElUPmR9RqII+pVhD9ychABMQ51gOIZg+/G+5mGIzLB1JJC5WhzYjhJ7IWmLDpA8jzsAafUPkB2WnFBF4iSxkq1ty7f25rv/+EQLOxs2oUdTSA9HIR9swdBlCcFe9owPC3XWDDC0ISVzsEVbSCF/sWdA5Fu4HJqankp2SeQCYYrImNalfmhpVxYrGkUS4LeSUjg8dD7+D7w/ybIfy7vlB9/HJ978zr7/45Qgajzj+4EjIK/ULHPRAOlKr/aG0AFcqCyu0GcW45Igh6JMJmhA49/U+cEssHNJhtXDC1MOya3j/sAiAGcrEtqtgjBD6wEzSDc7D8o6C8rIqAZyPk+NQoNLAZ1hR64Yl1FBY648smUYKnSg1Xwk/0DyRyArByMUobyByhCcPnOaPyoegREFS4jNfYAw+IHCjdC1J2WDZBke/OyN85J24WiXwDYPoJyYuCD238ulvuzwt6KgHf0shWKsqCFFGjB/w8HU8eeTED9wAAAAABJRU5ErkJggg=="; + _instanceNumber = 0; + GetEnvironmentBRDFTexture = (scene20) => { + if (!scene20.environmentBRDFTexture) { + const useDelayedTextureLoading = scene20.useDelayedTextureLoading; + scene20.useDelayedTextureLoading = false; + const previousState = scene20._blockEntityCollection; + scene20._blockEntityCollection = false; + const texture25 = Texture.CreateFromBase64String(_environmentBRDFBase64Texture, "EnvironmentBRDFTexture" + _instanceNumber++, scene20, true, false, Texture.BILINEAR_SAMPLINGMODE); + scene20._blockEntityCollection = previousState; + const texturesCache = scene20.getEngine().getLoadedTexturesCache(); + const index = texturesCache.indexOf(texture25.getInternalTexture()); + if (index !== -1) { + texturesCache.splice(index, 1); + } texture25.isRGBD = true; - const checkReady = () => { - if (texture25.isReady()) { - RGBDTextureTools.ExpandRGBDTexture(texture25); - } else { - Tools.SetImmediate(checkReady); - } - }; - checkReady(); - }); - scene20.onDisposeObservable.add(() => { - scene20.getEngine().onContextRestoredObservable.remove(observer2); - }); - } - return scene20.environmentBRDFTexture; -}; + texture25.wrapU = Texture.CLAMP_ADDRESSMODE; + texture25.wrapV = Texture.CLAMP_ADDRESSMODE; + scene20.environmentBRDFTexture = texture25; + scene20.useDelayedTextureLoading = useDelayedTextureLoading; + RGBDTextureTools.ExpandRGBDTexture(texture25); + const observer2 = scene20.getEngine().onContextRestoredObservable.add(() => { + texture25.isRGBD = true; + const checkReady = () => { + if (texture25.isReady()) { + RGBDTextureTools.ExpandRGBDTexture(texture25); + } else { + Tools.SetImmediate(checkReady); + } + }; + checkReady(); + }); + scene20.onDisposeObservable.add(() => { + scene20.getEngine().onContextRestoredObservable.remove(observer2); + }); + } + return scene20.environmentBRDFTexture; + }; + BRDFTextureTools = { + GetEnvironmentBRDFTexture + }; +}); // node_modules/@babylonjs/core/Materials/PBR/pbrBRDFConfiguration.js class MaterialBRDFDefines extends MaterialDefines { @@ -102493,30 +110906,40 @@ class PBRBRDFConfiguration extends MaterialPluginBase { return "PBRBRDFConfiguration"; } } -PBRBRDFConfiguration.DEFAULT_USE_ENERGY_CONSERVATION = true; -PBRBRDFConfiguration.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED = true; -PBRBRDFConfiguration.DEFAULT_USE_SPHERICAL_HARMONICS = true; -PBRBRDFConfiguration.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION = true; -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsMiscDirty") -], PBRBRDFConfiguration.prototype, "useEnergyConservation", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsMiscDirty") -], PBRBRDFConfiguration.prototype, "useSmithVisibilityHeightCorrelated", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsMiscDirty") -], PBRBRDFConfiguration.prototype, "useSphericalHarmonics", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsMiscDirty") -], PBRBRDFConfiguration.prototype, "useSpecularGlossinessInputEnergyConservation", undefined); +var init_pbrBRDFConfiguration = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_materialDefines(); + init_materialPluginBase(); + PBRBRDFConfiguration.DEFAULT_USE_ENERGY_CONSERVATION = true; + PBRBRDFConfiguration.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED = true; + PBRBRDFConfiguration.DEFAULT_USE_SPHERICAL_HARMONICS = true; + PBRBRDFConfiguration.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION = true; + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsMiscDirty") + ], PBRBRDFConfiguration.prototype, "useEnergyConservation", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsMiscDirty") + ], PBRBRDFConfiguration.prototype, "useSmithVisibilityHeightCorrelated", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsMiscDirty") + ], PBRBRDFConfiguration.prototype, "useSphericalHarmonics", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsMiscDirty") + ], PBRBRDFConfiguration.prototype, "useSpecularGlossinessInputEnergyConservation", undefined); +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrFragmentDeclaration.js -var name107 = "pbrFragmentDeclaration"; -var shader107 = `uniform vec4 vEyePosition;uniform vec3 vReflectionColor;uniform vec4 vAlbedoColor;uniform vec4 vLightingIntensity;uniform vec4 vReflectivityColor;uniform vec4 vMetallicReflectanceFactors;uniform vec3 vEmissiveColor;uniform float visibility;uniform vec3 vAmbientColor; +var name108, shader107; +var init_pbrFragmentDeclaration = __esm(() => { + init_shaderStore(); + init_decalFragmentDeclaration(); + name108 = "pbrFragmentDeclaration"; + shader107 = `uniform vec4 vEyePosition;uniform vec3 vReflectionColor;uniform vec4 vAlbedoColor;uniform vec4 vLightingIntensity;uniform vec4 vReflectivityColor;uniform vec4 vMetallicReflectanceFactors;uniform vec3 vEmissiveColor;uniform float visibility;uniform vec3 vAmbientColor; #ifdef ALBEDO uniform vec2 vAlbedoInfos; #endif @@ -102653,21 +111076,32 @@ uniform vec3 vSphericalX;uniform vec3 vSphericalY;uniform vec3 vSphericalZ;unifo #endif #define ADDITIONAL_FRAGMENT_DECLARATION `; -ShaderStore.IncludesShadersStore[name107] = shader107; + ShaderStore.IncludesShadersStore[name108] = shader107; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrUboDeclaration.js -var name108 = "pbrUboDeclaration"; -var shader108 = `layout(std140,column_major) uniform;uniform Material {vec2 vAlbedoInfos;vec4 vAmbientInfos;vec2 vOpacityInfos;vec2 vEmissiveInfos;vec2 vLightmapInfos;vec3 vReflectivityInfos;vec2 vMicroSurfaceSamplerInfos;vec2 vReflectionInfos;vec2 vReflectionFilteringInfo;vec3 vReflectionPosition;vec3 vReflectionSize;vec3 vBumpInfos;mat4 albedoMatrix;mat4 ambientMatrix;mat4 opacityMatrix;mat4 emissiveMatrix;mat4 lightmapMatrix;mat4 reflectivityMatrix;mat4 microSurfaceSamplerMatrix;mat4 bumpMatrix;vec2 vTangentSpaceParams;mat4 reflectionMatrix;vec3 vReflectionColor;vec4 vAlbedoColor;vec4 vLightingIntensity;vec3 vReflectionMicrosurfaceInfos;float pointSize;vec4 vReflectivityColor;vec3 vEmissiveColor;vec3 vAmbientColor;vec2 vDebugMode;vec4 vMetallicReflectanceFactors;vec2 vMetallicReflectanceInfos;mat4 metallicReflectanceMatrix;vec2 vReflectanceInfos;mat4 reflectanceMatrix;vec3 vSphericalL00;vec3 vSphericalL1_1;vec3 vSphericalL10;vec3 vSphericalL11;vec3 vSphericalL2_2;vec3 vSphericalL2_1;vec3 vSphericalL20;vec3 vSphericalL21;vec3 vSphericalL22;vec3 vSphericalX;vec3 vSphericalY;vec3 vSphericalZ;vec3 vSphericalXX_ZZ;vec3 vSphericalYY_ZZ;vec3 vSphericalZZ;vec3 vSphericalXY;vec3 vSphericalYZ;vec3 vSphericalZX; +var name109, shader108; +var init_pbrUboDeclaration = __esm(() => { + init_shaderStore(); + init_sceneUboDeclaration(); + init_meshUboDeclaration(); + name109 = "pbrUboDeclaration"; + shader108 = `layout(std140,column_major) uniform;uniform Material {vec2 vAlbedoInfos;vec4 vAmbientInfos;vec2 vOpacityInfos;vec2 vEmissiveInfos;vec2 vLightmapInfos;vec3 vReflectivityInfos;vec2 vMicroSurfaceSamplerInfos;vec2 vReflectionInfos;vec2 vReflectionFilteringInfo;vec3 vReflectionPosition;vec3 vReflectionSize;vec3 vBumpInfos;mat4 albedoMatrix;mat4 ambientMatrix;mat4 opacityMatrix;mat4 emissiveMatrix;mat4 lightmapMatrix;mat4 reflectivityMatrix;mat4 microSurfaceSamplerMatrix;mat4 bumpMatrix;vec2 vTangentSpaceParams;mat4 reflectionMatrix;vec3 vReflectionColor;vec4 vAlbedoColor;vec4 vLightingIntensity;vec3 vReflectionMicrosurfaceInfos;float pointSize;vec4 vReflectivityColor;vec3 vEmissiveColor;vec3 vAmbientColor;vec2 vDebugMode;vec4 vMetallicReflectanceFactors;vec2 vMetallicReflectanceInfos;mat4 metallicReflectanceMatrix;vec2 vReflectanceInfos;mat4 reflectanceMatrix;vec3 vSphericalL00;vec3 vSphericalL1_1;vec3 vSphericalL10;vec3 vSphericalL11;vec3 vSphericalL2_2;vec3 vSphericalL2_1;vec3 vSphericalL20;vec3 vSphericalL21;vec3 vSphericalL22;vec3 vSphericalX;vec3 vSphericalY;vec3 vSphericalZ;vec3 vSphericalXX_ZZ;vec3 vSphericalYY_ZZ;vec3 vSphericalZZ;vec3 vSphericalXY;vec3 vSphericalYZ;vec3 vSphericalZX; #define ADDITIONAL_UBO_DECLARATION }; #include #include `; -ShaderStore.IncludesShadersStore[name108] = shader108; + ShaderStore.IncludesShadersStore[name109] = shader108; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrFragmentExtraDeclaration.js -var name109 = "pbrFragmentExtraDeclaration"; -var shader109 = `varying vec3 vPositionW; +var name110, shader109; +var init_pbrFragmentExtraDeclaration = __esm(() => { + init_shaderStore(); + init_mainUVVaryingDeclaration(); + name110 = "pbrFragmentExtraDeclaration"; + shader109 = `varying vec3 vPositionW; #if DEBUGMODE>0 varying vec4 vClipSpacePosition; #endif @@ -102682,11 +111116,15 @@ varying vec3 vEnvironmentIrradiance; varying vec4 vColor; #endif `; -ShaderStore.IncludesShadersStore[name109] = shader109; + ShaderStore.IncludesShadersStore[name110] = shader109; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/samplerFragmentAlternateDeclaration.js -var name110 = "samplerFragmentAlternateDeclaration"; -var shader110 = `#ifdef _DEFINENAME_ +var name111, shader110; +var init_samplerFragmentAlternateDeclaration = __esm(() => { + init_shaderStore(); + name111 = "samplerFragmentAlternateDeclaration"; + shader110 = `#ifdef _DEFINENAME_ #if _DEFINENAME_DIRECTUV==1 #define v_VARYINGNAME_UV vMainUV1 #elif _DEFINENAME_DIRECTUV==2 @@ -102704,11 +111142,17 @@ varying vec2 v_VARYINGNAME_UV; #endif #endif `; -ShaderStore.IncludesShadersStore[name110] = shader110; + ShaderStore.IncludesShadersStore[name111] = shader110; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js -var name111 = "pbrFragmentSamplersDeclaration"; -var shader111 = `#include(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_SAMPLERNAME_,albedo) +var name112, shader111; +var init_pbrFragmentSamplersDeclaration = __esm(() => { + init_shaderStore(); + init_samplerFragmentDeclaration(); + init_samplerFragmentAlternateDeclaration(); + name112 = "pbrFragmentSamplersDeclaration"; + shader111 = `#include(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_SAMPLERNAME_,albedo) #include(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient) #include(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity) #include(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive) @@ -102801,25 +111245,37 @@ uniform sampler2D refractionSamplerLow;uniform sampler2D refractionSamplerHigh; #include(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_SAMPLERNAME_,translucencyIntensity) #endif `; -ShaderStore.IncludesShadersStore[name111] = shader111; + ShaderStore.IncludesShadersStore[name112] = shader111; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/subSurfaceScatteringFunctions.js -var name112 = "subSurfaceScatteringFunctions"; -var shader112 = `bool testLightingForSSS(float diffusionProfile) +var name113, shader112; +var init_subSurfaceScatteringFunctions = __esm(() => { + init_shaderStore(); + name113 = "subSurfaceScatteringFunctions"; + shader112 = `bool testLightingForSSS(float diffusionProfile) {return diffusionProfile<1.;}`; -ShaderStore.IncludesShadersStore[name112] = shader112; + ShaderStore.IncludesShadersStore[name113] = shader112; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/importanceSampling.js -var name113 = "importanceSampling"; -var shader113 = `vec3 hemisphereCosSample(vec2 u) {float phi=2.*PI*u.x;float cosTheta2=1.-u.y;float cosTheta=sqrt(cosTheta2);float sinTheta=sqrt(1.-cosTheta2);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);} +var name114, shader113; +var init_importanceSampling = __esm(() => { + init_shaderStore(); + name114 = "importanceSampling"; + shader113 = `vec3 hemisphereCosSample(vec2 u) {float phi=2.*PI*u.x;float cosTheta2=1.-u.y;float cosTheta=sqrt(cosTheta2);float sinTheta=sqrt(1.-cosTheta2);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);} vec3 hemisphereImportanceSampleDggx(vec2 u,float a) {float phi=2.*PI*u.x;float cosTheta2=(1.-u.y)/(1.+(a+1.)*((a-1.)*u.y));float cosTheta=sqrt(cosTheta2);float sinTheta=sqrt(1.-cosTheta2);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);} vec3 hemisphereImportanceSampleDCharlie(vec2 u,float a) { float phi=2.*PI*u.x;float sinTheta=pow(u.y,a/(2.*a+1.));float cosTheta=sqrt(1.-sinTheta*sinTheta);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}`; -ShaderStore.IncludesShadersStore[name113] = shader113; + ShaderStore.IncludesShadersStore[name114] = shader113; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrHelperFunctions.js -var name114 = "pbrHelperFunctions"; -var shader114 = `#define MINIMUMVARIANCE 0.0005 +var name115, shader114; +var init_pbrHelperFunctions = __esm(() => { + init_shaderStore(); + name115 = "pbrHelperFunctions"; + shader114 = `#define MINIMUMVARIANCE 0.0005 float convertRoughnessToAverageSlope(float roughness) {return square(roughness)+MINIMUMVARIANCE;} float fresnelGrazingReflectance(float reflectance0) {float reflectance90=saturate(reflectance0*25.0);return reflectance90;} @@ -102852,11 +111308,15 @@ float computeDefaultMicroSurface(float microSurface,vec3 reflectivityColor) {const float kReflectivityNoAlphaWorkflow_SmoothnessMax=0.95;float reflectivityLuminance=getLuminance(reflectivityColor);float reflectivityLuma=sqrt(reflectivityLuminance);microSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;return microSurface;} #endif `; -ShaderStore.IncludesShadersStore[name114] = shader114; + ShaderStore.IncludesShadersStore[name115] = shader114; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/harmonicsFunctions.js -var name115 = "harmonicsFunctions"; -var shader115 = `#ifdef USESPHERICALFROMREFLECTIONMAP +var name116, shader115; +var init_harmonicsFunctions = __esm(() => { + init_shaderStore(); + name116 = "harmonicsFunctions"; + shader115 = `#ifdef USESPHERICALFROMREFLECTIONMAP #ifdef SPHERICAL_HARMONICS vec3 computeEnvironmentIrradiance(vec3 normal) {return vSphericalL00 + vSphericalL1_1*(normal.y) @@ -102872,11 +111332,15 @@ vec3 computeEnvironmentIrradiance(vec3 normal) {float Nx=normal.x;float Ny=norma #endif #endif `; -ShaderStore.IncludesShadersStore[name115] = shader115; + ShaderStore.IncludesShadersStore[name116] = shader115; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrDirectLightingSetupFunctions.js -var name116 = "pbrDirectLightingSetupFunctions"; -var shader116 = `struct preLightingInfo +var name117, shader116; +var init_pbrDirectLightingSetupFunctions = __esm(() => { + init_shaderStore(); + name117 = "pbrDirectLightingSetupFunctions"; + shader116 = `struct preLightingInfo {vec3 lightOffset;float lightDistanceSquared;float lightDistance;float attenuation;vec3 L;vec3 H;float NdotV;float NdotLUnclamped;float NdotL;float VdotH;float roughness; #ifdef IRIDESCENCE float iridescenceIntensity; @@ -102888,11 +111352,15 @@ preLightingInfo computeHemisphericPreLightingInfo(vec4 lightData,vec3 V,vec3 N) result.L=normalize(lightData.xyz);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H)); #endif return result;}`; -ShaderStore.IncludesShadersStore[name116] = shader116; + ShaderStore.IncludesShadersStore[name117] = shader116; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrDirectLightingFalloffFunctions.js -var name117 = "pbrDirectLightingFalloffFunctions"; -var shader117 = `float computeDistanceLightFalloff_Standard(vec3 lightOffset,float range) +var name118, shader117; +var init_pbrDirectLightingFalloffFunctions = __esm(() => { + init_shaderStore(); + name118 = "pbrDirectLightingFalloffFunctions"; + shader117 = `float computeDistanceLightFalloff_Standard(vec3 lightOffset,float range) {return max(0.,1.0-length(lightOffset)/range);} float computeDistanceLightFalloff_Physical(float lightDistanceSquared) {return 1.0/maxEps(lightDistanceSquared);} @@ -102927,11 +111395,15 @@ return computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenter return computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent); #endif }`; -ShaderStore.IncludesShadersStore[name117] = shader117; + ShaderStore.IncludesShadersStore[name118] = shader117; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBRDFFunctions.js -var name118 = "pbrBRDFFunctions"; -var shader118 = `#define FRESNEL_MAXIMUM_ON_ROUGH 0.25 +var name119, shader118; +var init_pbrBRDFFunctions = __esm(() => { + init_shaderStore(); + name119 = "pbrBRDFFunctions"; + shader118 = `#define FRESNEL_MAXIMUM_ON_ROUGH 0.25 #ifdef MS_BRDF_ENERGY_CONSERVATION vec3 getEnergyConservationFactor(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {return 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);} #endif @@ -103062,11 +111534,15 @@ vec3 transmittanceBRDF_Burley(const vec3 tintColor,const vec3 diffusionDistance, float computeWrappedDiffuseNdotL(float NdotL,float w) {float t=1.0+w;float invt2=1.0/square(t);return saturate((NdotL+w)*invt2);} #endif `; -ShaderStore.IncludesShadersStore[name118] = shader118; + ShaderStore.IncludesShadersStore[name119] = shader118; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/hdrFilteringFunctions.js -var name119 = "hdrFilteringFunctions"; -var shader119 = `#ifdef NUM_SAMPLES +var name120, shader119; +var init_hdrFilteringFunctions = __esm(() => { + init_shaderStore(); + name120 = "hdrFilteringFunctions"; + shader119 = `#ifdef NUM_SAMPLES #if NUM_SAMPLES>0 #if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) float radicalInverse_VdC(uint bits) @@ -103120,11 +111596,15 @@ result=result/weight;return result;}} #endif #endif `; -ShaderStore.IncludesShadersStore[name119] = shader119; + ShaderStore.IncludesShadersStore[name120] = shader119; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrDirectLightingFunctions.js -var name120 = "pbrDirectLightingFunctions"; -var shader120 = `#define CLEARCOATREFLECTANCE90 1.0 +var name121, shader120; +var init_pbrDirectLightingFunctions = __esm(() => { + init_shaderStore(); + name121 = "pbrDirectLightingFunctions"; + shader120 = `#define CLEARCOATREFLECTANCE90 1.0 struct lightingInfo {vec3 diffuse; #ifdef SPECULARTERM @@ -103185,11 +111665,15 @@ float visibility=visibility_Ashikhmin(info.NdotL,info.NdotV);/* #endif */ float sheenTerm=fresnel*distribution*visibility;return sheenTerm*info.attenuation*info.NdotL*lightColor;} #endif `; -ShaderStore.IncludesShadersStore[name120] = shader120; + ShaderStore.IncludesShadersStore[name121] = shader120; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrIBLFunctions.js -var name121 = "pbrIBLFunctions"; -var shader121 = `#if defined(REFLECTION) || defined(SS_REFRACTION) +var name122, shader121; +var init_pbrIBLFunctions = __esm(() => { + init_shaderStore(); + name122 = "pbrIBLFunctions"; + shader121 = `#if defined(REFLECTION) || defined(SS_REFRACTION) float getLodFromAlphaG(float cubeMapDimensionPixels,float microsurfaceAverageSlope) {float microsurfaceAverageSlopeTexels=cubeMapDimensionPixels*microsurfaceAverageSlope;float lod=log2(microsurfaceAverageSlopeTexels);return lod;} float getLinearLodFromRoughness(float cubeMapDimensionPixels,float roughness) {float lod=log2(cubeMapDimensionPixels)*roughness;return lod;} #endif @@ -103204,11 +111688,16 @@ float environmentHorizonOcclusion(vec3 view,vec3 normal,vec3 geometricNormal) {v float getLodFromAlphaG(float cubeMapDimensionPixels,float alphaG,float NdotV) {float microsurfaceAverageSlope=alphaG;microsurfaceAverageSlope*=sqrt(abs(NdotV));return getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);} #endif `; -ShaderStore.IncludesShadersStore[name121] = shader121; + ShaderStore.IncludesShadersStore[name122] = shader121; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js -var name122 = "pbrBlockAlbedoOpacity"; -var shader122 = `struct albedoOpacityOutParams +var name123, shader122; +var init_pbrBlockAlbedoOpacity = __esm(() => { + init_shaderStore(); + init_decalFragment(); + name123 = "pbrBlockAlbedoOpacity"; + shader122 = `struct albedoOpacityOutParams {vec3 surfaceAlbedo;float alpha;}; #define pbr_inline void albedoOpacityBlock( @@ -103280,11 +111769,15 @@ alpha=1.0; #endif outParams.surfaceAlbedo=surfaceAlbedo;outParams.alpha=alpha;} `; -ShaderStore.IncludesShadersStore[name122] = shader122; + ShaderStore.IncludesShadersStore[name123] = shader122; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockReflectivity.js -var name123 = "pbrBlockReflectivity"; -var shader123 = `struct reflectivityOutParams +var name124, shader123; +var init_pbrBlockReflectivity = __esm(() => { + init_shaderStore(); + name124 = "pbrBlockReflectivity"; + shader123 = `struct reflectivityOutParams {float microSurface;float roughness;vec3 surfaceReflectivityColor; #ifdef METALLICWORKFLOW vec3 surfaceAlbedo; @@ -103395,11 +111888,15 @@ microSurface*=microSurfaceTexel.r; #endif microSurface=saturate(microSurface);float roughness=1.-microSurface;outParams.microSurface=microSurface;outParams.roughness=roughness;outParams.surfaceReflectivityColor=surfaceReflectivityColor;} `; -ShaderStore.IncludesShadersStore[name123] = shader123; + ShaderStore.IncludesShadersStore[name124] = shader123; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockAmbientOcclusion.js -var name124 = "pbrBlockAmbientOcclusion"; -var shader124 = `struct ambientOcclusionOutParams +var name125, shader124; +var init_pbrBlockAmbientOcclusion = __esm(() => { + init_shaderStore(); + name125 = "pbrBlockAmbientOcclusion"; + shader124 = `struct ambientOcclusionOutParams {vec3 ambientOcclusionColor; #if DEBUGMODE>0 && defined(AMBIENT) vec3 ambientOcclusionColorMap; @@ -103426,11 +111923,15 @@ outParams.ambientOcclusionColorMap=ambientOcclusionColorMap; #endif outParams.ambientOcclusionColor=ambientOcclusionColor;} `; -ShaderStore.IncludesShadersStore[name124] = shader124; + ShaderStore.IncludesShadersStore[name125] = shader124; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockAlphaFresnel.js -var name125 = "pbrBlockAlphaFresnel"; -var shader125 = `#ifdef ALPHAFRESNEL +var name126, shader125; +var init_pbrBlockAlphaFresnel = __esm(() => { + init_shaderStore(); + name126 = "pbrBlockAlphaFresnel"; + shader125 = `#ifdef ALPHAFRESNEL #if defined(ALPHATEST) || defined(ALPHABLEND) struct alphaFresnelOutParams {float alpha;}; @@ -103460,11 +111961,15 @@ outParams.alpha=1.0; #endif #endif `; -ShaderStore.IncludesShadersStore[name125] = shader125; + ShaderStore.IncludesShadersStore[name126] = shader125; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockAnisotropic.js -var name126 = "pbrBlockAnisotropic"; -var shader126 = `#ifdef ANISOTROPIC +var name127, shader126; +var init_pbrBlockAnisotropic = __esm(() => { + init_shaderStore(); + name127 = "pbrBlockAnisotropic"; + shader126 = `#ifdef ANISOTROPIC struct anisotropicOutParams {float anisotropy;vec3 anisotropicTangent;vec3 anisotropicBitangent;vec3 anisotropicNormal; #if DEBUGMODE>0 && defined(ANISOTROPIC_TEXTURE) @@ -103499,11 +112004,15 @@ anisotropyDirection.xy=mat2(anisotropyDirection.x,anisotropyDirection.y,-anisotr mat3 anisoTBN=mat3(normalize(TBN[0]),normalize(TBN[1]),normalize(TBN[2]));vec3 anisotropicTangent=normalize(anisoTBN*anisotropyDirection);vec3 anisotropicBitangent=normalize(cross(anisoTBN[2],anisotropicTangent));outParams.anisotropy=anisotropy;outParams.anisotropicTangent=anisotropicTangent;outParams.anisotropicBitangent=anisotropicBitangent;outParams.anisotropicNormal=getAnisotropicBentNormals(anisotropicTangent,anisotropicBitangent,normalW,viewDirectionW,anisotropy,roughness);} #endif `; -ShaderStore.IncludesShadersStore[name126] = shader126; + ShaderStore.IncludesShadersStore[name127] = shader126; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockReflection.js -var name127 = "pbrBlockReflection"; -var shader127 = `#ifdef REFLECTION +var name128, shader127; +var init_pbrBlockReflection = __esm(() => { + init_shaderStore(); + name128 = "pbrBlockReflection"; + shader127 = `#ifdef REFLECTION struct reflectionOutParams {vec4 environmentRadiance;vec3 environmentIrradiance; #ifdef REFLECTIONMAP_3D @@ -103751,11 +112260,15 @@ environmentIrradiance.rgb=toLinearSpace(environmentIrradiance.rgb); environmentIrradiance*=vReflectionColor.rgb;outParams.environmentRadiance=environmentRadiance;outParams.environmentIrradiance=environmentIrradiance;outParams.reflectionCoords=reflectionCoords;} #endif `; -ShaderStore.IncludesShadersStore[name127] = shader127; + ShaderStore.IncludesShadersStore[name128] = shader127; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockSheen.js -var name128 = "pbrBlockSheen"; -var shader128 = `#ifdef SHEEN +var name129, shader128; +var init_pbrBlockSheen = __esm(() => { + init_shaderStore(); + name129 = "pbrBlockSheen"; + shader128 = `#ifdef SHEEN struct sheenOutParams {float sheenIntensity;vec3 sheenColor;float sheenRoughness; #ifdef SHEEN_LINKWITHALBEDO @@ -103938,11 +112451,15 @@ outParams.sheenAlbedoScaling=1.0-sheenIntensity*max(max(sheenColor.r,sheenColor. outParams.sheenIntensity=sheenIntensity;outParams.sheenColor=sheenColor;outParams.sheenRoughness=sheenRoughness;} #endif `; -ShaderStore.IncludesShadersStore[name128] = shader128; + ShaderStore.IncludesShadersStore[name129] = shader128; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockClearcoat.js -var name129 = "pbrBlockClearcoat"; -var shader129 = `struct clearcoatOutParams +var name130, shader129; +var init_pbrBlockClearcoat = __esm(() => { + init_shaderStore(); + name130 = "pbrBlockClearcoat"; + shader129 = `struct clearcoatOutParams {vec3 specularEnvironmentR0;float conservationFactor;vec3 clearCoatNormalW;vec2 clearCoatAARoughnessFactors;float clearCoatIntensity;float clearCoatRoughness; #ifdef REFLECTION vec3 finalClearCoatRadianceScaled; @@ -104190,11 +112707,15 @@ outParams.energyConservationFactorClearCoat=getEnergyConservationFactor(outParam } #endif `; -ShaderStore.IncludesShadersStore[name129] = shader129; + ShaderStore.IncludesShadersStore[name130] = shader129; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockIridescence.js -var name130 = "pbrBlockIridescence"; -var shader130 = `struct iridescenceOutParams +var name131, shader130; +var init_pbrBlockIridescence = __esm(() => { + init_shaderStore(); + name131 = "pbrBlockIridescence"; + shader130 = `struct iridescenceOutParams {float iridescenceIntensity;float iridescenceIOR;float iridescenceThickness;vec3 specularEnvironmentR0;}; #ifdef IRIDESCENCE #define pbr_inline @@ -104238,11 +112759,15 @@ topIor=mix(1.0,vClearCoatRefractionParams.w-1.,clearCoatIntensity);viewAngle=sqr vec3 iridescenceFresnel=evalIridescence(topIor,iridescenceIOR,viewAngle,iridescenceThickness,specularEnvironmentR0);outParams.specularEnvironmentR0=mix(specularEnvironmentR0,iridescenceFresnel,iridescenceIntensity);outParams.iridescenceIntensity=iridescenceIntensity;outParams.iridescenceThickness=iridescenceThickness;outParams.iridescenceIOR=iridescenceIOR;} #endif `; -ShaderStore.IncludesShadersStore[name130] = shader130; + ShaderStore.IncludesShadersStore[name131] = shader130; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockSubSurface.js -var name131 = "pbrBlockSubSurface"; -var shader131 = `struct subSurfaceOutParams +var name132, shader131; +var init_pbrBlockSubSurface = __esm(() => { + init_shaderStore(); + name132 = "pbrBlockSubSurface"; + shader131 = `struct subSurfaceOutParams {vec3 specularEnvironmentReflectance; #ifdef SS_REFRACTION vec3 finalRefraction;vec3 surfaceAlbedo; @@ -104621,11 +113146,15 @@ outParams.refractionIrradiance=refractionIrradiance.rgb; } #endif `; -ShaderStore.IncludesShadersStore[name131] = shader131; + ShaderStore.IncludesShadersStore[name132] = shader131; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockNormalGeometric.js -var name132 = "pbrBlockNormalGeometric"; -var shader132 = `vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW); +var name133, shader132; +var init_pbrBlockNormalGeometric = __esm(() => { + init_shaderStore(); + name133 = "pbrBlockNormalGeometric"; + shader132 = `vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW); #ifdef NORMAL vec3 normalW=normalize(vNormalW); #else @@ -104636,11 +113165,15 @@ vec3 geometricNormalW=normalW; geometricNormalW=gl_FrontFacing ? geometricNormalW : -geometricNormalW; #endif `; -ShaderStore.IncludesShadersStore[name132] = shader132; + ShaderStore.IncludesShadersStore[name133] = shader132; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockNormalFinal.js -var name133 = "pbrBlockNormalFinal"; -var shader133 = `#if defined(FORCENORMALFORWARD) && defined(NORMAL) +var name134, shader133; +var init_pbrBlockNormalFinal = __esm(() => { + init_shaderStore(); + name134 = "pbrBlockNormalFinal"; + shader133 = `#if defined(FORCENORMALFORWARD) && defined(NORMAL) vec3 faceNormal=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w; #if defined(TWOSIDEDLIGHTING) faceNormal=gl_FrontFacing ? faceNormal : -faceNormal; @@ -104651,11 +113184,15 @@ normalW*=sign(dot(normalW,faceNormal)); normalW=gl_FrontFacing ? normalW : -normalW; #endif `; -ShaderStore.IncludesShadersStore[name133] = shader133; + ShaderStore.IncludesShadersStore[name134] = shader133; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockLightmapInit.js -var name134 = "pbrBlockLightmapInit"; -var shader134 = `#ifdef LIGHTMAP +var name135, shader134; +var init_pbrBlockLightmapInit = __esm(() => { + init_shaderStore(); + name135 = "pbrBlockLightmapInit"; + shader134 = `#ifdef LIGHTMAP vec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset); #ifdef RGBDLIGHTMAP lightmapColor.rgb=fromRGBD(lightmapColor); @@ -104666,11 +113203,15 @@ lightmapColor.rgb=toLinearSpace(lightmapColor.rgb); lightmapColor.rgb*=vLightmapInfos.y; #endif `; -ShaderStore.IncludesShadersStore[name134] = shader134; + ShaderStore.IncludesShadersStore[name135] = shader134; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockGeometryInfo.js -var name135 = "pbrBlockGeometryInfo"; -var shader135 = `float NdotVUnclamped=dot(normalW,viewDirectionW);float NdotV=absEps(NdotVUnclamped);float alphaG=convertRoughnessToAverageSlope(roughness);vec2 AARoughnessFactors=getAARoughnessFactors(normalW.xyz); +var name136, shader135; +var init_pbrBlockGeometryInfo = __esm(() => { + init_shaderStore(); + name136 = "pbrBlockGeometryInfo"; + shader135 = `float NdotVUnclamped=dot(normalW,viewDirectionW);float NdotV=absEps(NdotVUnclamped);float alphaG=convertRoughnessToAverageSlope(roughness);vec2 AARoughnessFactors=getAARoughnessFactors(normalW.xyz); #ifdef SPECULARAA alphaG+=AARoughnessFactors.y; #endif @@ -104695,11 +113236,15 @@ float eho=environmentHorizonOcclusion(-viewDirectionW,normalW,geometricNormalW); #endif #endif `; -ShaderStore.IncludesShadersStore[name135] = shader135; + ShaderStore.IncludesShadersStore[name136] = shader135; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockReflectance0.js -var name136 = "pbrBlockReflectance0"; -var shader136 = `float reflectance=max(max(reflectivityOut.surfaceReflectivityColor.r,reflectivityOut.surfaceReflectivityColor.g),reflectivityOut.surfaceReflectivityColor.b);vec3 specularEnvironmentR0=reflectivityOut.surfaceReflectivityColor.rgb; +var name137, shader136; +var init_pbrBlockReflectance0 = __esm(() => { + init_shaderStore(); + name137 = "pbrBlockReflectance0"; + shader136 = `float reflectance=max(max(reflectivityOut.surfaceReflectivityColor.r,reflectivityOut.surfaceReflectivityColor.g),reflectivityOut.surfaceReflectivityColor.b);vec3 specularEnvironmentR0=reflectivityOut.surfaceReflectivityColor.rgb; #ifdef METALLICWORKFLOW vec3 specularEnvironmentR90=vec3(metallicReflectanceFactors.a); #else @@ -104709,11 +113254,15 @@ vec3 specularEnvironmentR90=vec3(1.0,1.0,1.0); float reflectance90=fresnelGrazingReflectance(reflectance);specularEnvironmentR90=specularEnvironmentR90*reflectance90; #endif `; -ShaderStore.IncludesShadersStore[name136] = shader136; + ShaderStore.IncludesShadersStore[name137] = shader136; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockReflectance.js -var name137 = "pbrBlockReflectance"; -var shader137 = `#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX) +var name138, shader137; +var init_pbrBlockReflectance = __esm(() => { + init_shaderStore(); + name138 = "pbrBlockReflectance"; + shader137 = `#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX) vec3 specularEnvironmentReflectance=getReflectanceFromBRDFLookup(clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,environmentBrdf); #ifdef RADIANCEOCCLUSION specularEnvironmentReflectance*=seo; @@ -104735,11 +113284,15 @@ specularEnvironmentReflectance*=clearcoatOut.absorption; #endif #endif `; -ShaderStore.IncludesShadersStore[name137] = shader137; + ShaderStore.IncludesShadersStore[name138] = shader137; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockDirectLighting.js -var name138 = "pbrBlockDirectLighting"; -var shader138 = `vec3 diffuseBase=vec3(0.,0.,0.); +var name139, shader138; +var init_pbrBlockDirectLighting = __esm(() => { + init_shaderStore(); + name139 = "pbrBlockDirectLighting"; + shader138 = `vec3 diffuseBase=vec3(0.,0.,0.); #ifdef SPECULARTERM vec3 specularBase=vec3(0.,0.,0.); #endif @@ -104755,11 +113308,15 @@ float aggShadow=0.;float numLights=0.; vec3 absorption=vec3(0.); #endif `; -ShaderStore.IncludesShadersStore[name138] = shader138; + ShaderStore.IncludesShadersStore[name139] = shader138; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockFinalLitComponents.js -var name139 = "pbrBlockFinalLitComponents"; -var shader139 = `aggShadow=aggShadow/numLights; +var name140, shader139; +var init_pbrBlockFinalLitComponents = __esm(() => { + init_shaderStore(); + name140 = "pbrBlockFinalLitComponents"; + shader139 = `aggShadow=aggShadow/numLights; #if defined(ENVIRONMENTBRDF) #ifdef MS_BRDF_ENERGY_CONSERVATION vec3 energyConservationFactor=getEnergyConservationFactor(clearcoatOut.specularEnvironmentR0,environmentBrdf); @@ -104847,11 +113404,15 @@ alpha=saturate(alpha+luminanceOverAlpha*luminanceOverAlpha); #endif #endif `; -ShaderStore.IncludesShadersStore[name139] = shader139; + ShaderStore.IncludesShadersStore[name140] = shader139; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockFinalUnlitComponents.js -var name140 = "pbrBlockFinalUnlitComponents"; -var shader140 = `vec3 finalDiffuse=diffuseBase;finalDiffuse*=surfaceAlbedo.rgb;finalDiffuse=max(finalDiffuse,0.0);finalDiffuse*=vLightingIntensity.x;vec3 finalAmbient=vAmbientColor;finalAmbient*=surfaceAlbedo.rgb;vec3 finalEmissive=vEmissiveColor; +var name141, shader140; +var init_pbrBlockFinalUnlitComponents = __esm(() => { + init_shaderStore(); + name141 = "pbrBlockFinalUnlitComponents"; + shader140 = `vec3 finalDiffuse=diffuseBase;finalDiffuse*=surfaceAlbedo.rgb;finalDiffuse=max(finalDiffuse,0.0);finalDiffuse*=vLightingIntensity.x;vec3 finalAmbient=vAmbientColor;finalAmbient*=surfaceAlbedo.rgb;vec3 finalEmissive=vEmissiveColor; #ifdef EMISSIVE vec3 emissiveColorTex=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb; #ifdef GAMMAEMISSIVE @@ -104869,11 +113430,15 @@ vec3 ambientOcclusionForDirectDiffuse=aoOut.ambientOcclusionColor; #endif finalAmbient*=aoOut.ambientOcclusionColor;finalDiffuse*=ambientOcclusionForDirectDiffuse; `; -ShaderStore.IncludesShadersStore[name140] = shader140; + ShaderStore.IncludesShadersStore[name141] = shader140; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockFinalColorComposition.js -var name141 = "pbrBlockFinalColorComposition"; -var shader141 = `vec4 finalColor=vec4( +var name142, shader141; +var init_pbrBlockFinalColorComposition = __esm(() => { + init_shaderStore(); + name142 = "pbrBlockFinalColorComposition"; + shader141 = `vec4 finalColor=vec4( #ifndef UNLIT #ifdef REFLECTION finalIrradiance + @@ -104916,11 +113481,15 @@ finalColor.rgb+=finalEmissive; #define CUSTOM_FRAGMENT_BEFORE_FOG finalColor=max(finalColor,0.0); `; -ShaderStore.IncludesShadersStore[name141] = shader141; + ShaderStore.IncludesShadersStore[name142] = shader141; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrBlockImageProcessing.js -var name142 = "pbrBlockImageProcessing"; -var shader142 = `#if defined(IMAGEPROCESSINGPOSTPROCESS) || defined(SS_SCATTERING) +var name143, shader142; +var init_pbrBlockImageProcessing = __esm(() => { + init_shaderStore(); + name143 = "pbrBlockImageProcessing"; + shader142 = `#if defined(IMAGEPROCESSINGPOSTPROCESS) || defined(SS_SCATTERING) #if !defined(SKIPFINALCOLORCLAMP) finalColor.rgb=clamp(finalColor.rgb,0.,30.0); #endif @@ -104932,11 +113501,15 @@ finalColor.a*=visibility; finalColor.rgb*=finalColor.a; #endif `; -ShaderStore.IncludesShadersStore[name142] = shader142; + ShaderStore.IncludesShadersStore[name143] = shader142; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrDebug.js -var name143 = "pbrDebug"; -var shader143 = `#if DEBUGMODE>0 +var name144, shader143; +var init_pbrDebug = __esm(() => { + init_shaderStore(); + name144 = "pbrDebug"; + shader143 = `#if DEBUGMODE>0 if (vClipSpacePosition.x/vClipSpacePosition.w>=vDebugMode.x) { #if DEBUGMODE==1 gl_FragColor.rgb=vPositionW.rgb; @@ -105119,11 +113692,72 @@ return; } #endif `; -ShaderStore.IncludesShadersStore[name143] = shader143; + ShaderStore.IncludesShadersStore[name144] = shader143; +}); // node_modules/@babylonjs/core/Shaders/pbr.fragment.js -var name144 = "pbrPixelShader"; -var shader144 = `#if defined(BUMP) || !defined(NORMAL) || defined(FORCENORMALFORWARD) || defined(SPECULARAA) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) +var name145, shader144; +var init_pbr_fragment = __esm(() => { + init_shaderStore(); + init_prePassDeclaration(); + init_oitDeclaration(); + init_pbrFragmentDeclaration(); + init_pbrUboDeclaration(); + init_pbrFragmentExtraDeclaration(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_pbrFragmentSamplersDeclaration(); + init_imageProcessingDeclaration(); + init_clipPlaneFragmentDeclaration(); + init_logDepthDeclaration(); + init_fogFragmentDeclaration(); + init_helperFunctions(); + init_subSurfaceScatteringFunctions(); + init_importanceSampling(); + init_pbrHelperFunctions(); + init_imageProcessingFunctions(); + init_shadowsFragmentFunctions(); + init_harmonicsFunctions(); + init_pbrDirectLightingSetupFunctions(); + init_pbrDirectLightingFalloffFunctions(); + init_pbrBRDFFunctions(); + init_hdrFilteringFunctions(); + init_pbrDirectLightingFunctions(); + init_pbrIBLFunctions(); + init_bumpFragmentMainFunctions(); + init_bumpFragmentFunctions(); + init_reflectionFunction(); + init_pbrBlockAlbedoOpacity(); + init_pbrBlockReflectivity(); + init_pbrBlockAmbientOcclusion(); + init_pbrBlockAlphaFresnel(); + init_pbrBlockAnisotropic(); + init_pbrBlockReflection(); + init_pbrBlockSheen(); + init_pbrBlockClearcoat(); + init_pbrBlockIridescence(); + init_pbrBlockSubSurface(); + init_clipPlaneFragment(); + init_pbrBlockNormalGeometric(); + init_bumpFragment(); + init_pbrBlockNormalFinal(); + init_depthPrePass(); + init_pbrBlockLightmapInit(); + init_pbrBlockGeometryInfo(); + init_pbrBlockReflectance0(); + init_pbrBlockReflectance(); + init_pbrBlockDirectLighting(); + init_lightFragment(); + init_pbrBlockFinalLitComponents(); + init_pbrBlockFinalUnlitComponents(); + init_pbrBlockFinalColorComposition(); + init_logDepthFragment(); + init_fogFragment(); + init_pbrBlockImageProcessing(); + init_oitFragment(); + init_pbrDebug(); + name145 = "pbrPixelShader"; + shader144 = `#if defined(BUMP) || !defined(NORMAL) || defined(FORCENORMALFORWARD) || defined(SPECULARAA) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) #extension GL_OES_standard_derivatives : enable #endif #ifdef LODBASEDMICROSFURACE @@ -105700,11 +114334,16 @@ if (fragDepth==nearestDepth) {frontColor.rgb+=finalColor.rgb*finalColor.a*alphaM #define CUSTOM_FRAGMENT_MAIN_END } `; -ShaderStore.ShadersStore[name144] = shader144; + ShaderStore.ShadersStore[name145] = shader144; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pbrVertexDeclaration.js -var name145 = "pbrVertexDeclaration"; -var shader145 = `uniform mat4 view;uniform mat4 viewProjection; +var name146, shader145; +var init_pbrVertexDeclaration = __esm(() => { + init_shaderStore(); + init_decalVertexDeclaration(); + name146 = "pbrVertexDeclaration"; + shader145 = `uniform mat4 view;uniform mat4 viewProjection; #ifdef ALBEDO uniform mat4 albedoMatrix;uniform vec2 vAlbedoInfos; #endif @@ -105816,11 +114455,48 @@ uniform vec4 vDetailInfos;uniform mat4 detailMatrix; #include #define ADDITIONAL_VERTEX_DECLARATION `; -ShaderStore.IncludesShadersStore[name145] = shader145; + ShaderStore.IncludesShadersStore[name146] = shader145; +}); // node_modules/@babylonjs/core/Shaders/pbr.vertex.js -var name146 = "pbrVertexShader"; -var shader146 = `precision highp float; +var name147, shader146; +var init_pbr_vertex = __esm(() => { + init_shaderStore(); + init_pbrVertexDeclaration(); + init_pbrUboDeclaration(); + init_uvAttributeDeclaration(); + init_mainUVVaryingDeclaration(); + init_helperFunctions(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_instancesDeclaration(); + init_prePassVertexDeclaration(); + init_samplerVertexDeclaration(); + init_harmonicsFunctions(); + init_bumpVertexDeclaration(); + init_clipPlaneVertexDeclaration(); + init_fogVertexDeclaration(); + init_lightVxFragmentDeclaration(); + init_lightVxUboDeclaration(); + init_morphTargetsVertexGlobalDeclaration(); + init_morphTargetsVertexDeclaration(); + init_logDepthDeclaration(); + init_morphTargetsVertexGlobal(); + init_morphTargetsVertex(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_prePassVertex(); + init_uvVariableDeclaration(); + init_samplerVertexImplementation(); + init_bumpVertex(); + init_clipPlaneVertex(); + init_fogVertex(); + init_shadowsVertex(); + init_vertexColorMixing(); + init_logDepthVertex(); + name147 = "pbrVertexShader"; + shader146 = `precision highp float; #include<__decl__pbrVertex> #define CUSTOM_VERTEX_BEGIN attribute vec3 position; @@ -106014,7 +114690,8 @@ gl_PointSize=pointSize; #include #define CUSTOM_VERTEX_MAIN_END }`; -ShaderStore.ShadersStore[name146] = shader146; + ShaderStore.ShadersStore[name147] = shader146; +}); // node_modules/@babylonjs/core/Materials/PBR/pbrClearCoatConfiguration.js class MaterialClearCoatDefines extends MaterialDefines { @@ -106310,58 +114987,67 @@ class PBRClearCoatConfiguration extends MaterialPluginBase { }; } } -PBRClearCoatConfiguration._DefaultIndexOfRefraction = 1.5; -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRClearCoatConfiguration.prototype, "isEnabled", undefined); -__decorate2([ - serialize() -], PBRClearCoatConfiguration.prototype, "intensity", undefined); -__decorate2([ - serialize() -], PBRClearCoatConfiguration.prototype, "roughness", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRClearCoatConfiguration.prototype, "indexOfRefraction", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRClearCoatConfiguration.prototype, "texture", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRClearCoatConfiguration.prototype, "useRoughnessFromMainTexture", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRClearCoatConfiguration.prototype, "textureRoughness", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRClearCoatConfiguration.prototype, "remapF0OnInterfaceChange", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRClearCoatConfiguration.prototype, "bumpTexture", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRClearCoatConfiguration.prototype, "isTintEnabled", undefined); -__decorate2([ - serializeAsColor3() -], PBRClearCoatConfiguration.prototype, "tintColor", undefined); -__decorate2([ - serialize() -], PBRClearCoatConfiguration.prototype, "tintColorAtDistance", undefined); -__decorate2([ - serialize() -], PBRClearCoatConfiguration.prototype, "tintThickness", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRClearCoatConfiguration.prototype, "tintTexture", undefined); +var init_pbrClearCoatConfiguration = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_color(); + init_materialFlags(); + init_materialHelper(); + init_materialPluginBase(); + init_materialDefines(); + PBRClearCoatConfiguration._DefaultIndexOfRefraction = 1.5; + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRClearCoatConfiguration.prototype, "isEnabled", undefined); + __decorate2([ + serialize() + ], PBRClearCoatConfiguration.prototype, "intensity", undefined); + __decorate2([ + serialize() + ], PBRClearCoatConfiguration.prototype, "roughness", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRClearCoatConfiguration.prototype, "indexOfRefraction", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRClearCoatConfiguration.prototype, "texture", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRClearCoatConfiguration.prototype, "useRoughnessFromMainTexture", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRClearCoatConfiguration.prototype, "textureRoughness", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRClearCoatConfiguration.prototype, "remapF0OnInterfaceChange", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRClearCoatConfiguration.prototype, "bumpTexture", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRClearCoatConfiguration.prototype, "isTintEnabled", undefined); + __decorate2([ + serializeAsColor3() + ], PBRClearCoatConfiguration.prototype, "tintColor", undefined); + __decorate2([ + serialize() + ], PBRClearCoatConfiguration.prototype, "tintColorAtDistance", undefined); + __decorate2([ + serialize() + ], PBRClearCoatConfiguration.prototype, "tintThickness", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRClearCoatConfiguration.prototype, "tintTexture", undefined); +}); // node_modules/@babylonjs/core/Materials/PBR/pbrIridescenceConfiguration.js class MaterialIridescenceDefines extends MaterialDefines { @@ -106530,33 +115216,41 @@ class PBRIridescenceConfiguration extends MaterialPluginBase { }; } } -PBRIridescenceConfiguration._DefaultMinimumThickness = 100; -PBRIridescenceConfiguration._DefaultMaximumThickness = 400; -PBRIridescenceConfiguration._DefaultIndexOfRefraction = 1.3; -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRIridescenceConfiguration.prototype, "isEnabled", undefined); -__decorate2([ - serialize() -], PBRIridescenceConfiguration.prototype, "intensity", undefined); -__decorate2([ - serialize() -], PBRIridescenceConfiguration.prototype, "minimumThickness", undefined); -__decorate2([ - serialize() -], PBRIridescenceConfiguration.prototype, "maximumThickness", undefined); -__decorate2([ - serialize() -], PBRIridescenceConfiguration.prototype, "indexOfRefraction", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRIridescenceConfiguration.prototype, "texture", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRIridescenceConfiguration.prototype, "thicknessTexture", undefined); +var init_pbrIridescenceConfiguration = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_materialFlags(); + init_materialHelper(); + init_materialPluginBase(); + init_materialDefines(); + PBRIridescenceConfiguration._DefaultMinimumThickness = 100; + PBRIridescenceConfiguration._DefaultMaximumThickness = 400; + PBRIridescenceConfiguration._DefaultIndexOfRefraction = 1.3; + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRIridescenceConfiguration.prototype, "isEnabled", undefined); + __decorate2([ + serialize() + ], PBRIridescenceConfiguration.prototype, "intensity", undefined); + __decorate2([ + serialize() + ], PBRIridescenceConfiguration.prototype, "minimumThickness", undefined); + __decorate2([ + serialize() + ], PBRIridescenceConfiguration.prototype, "maximumThickness", undefined); + __decorate2([ + serialize() + ], PBRIridescenceConfiguration.prototype, "indexOfRefraction", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRIridescenceConfiguration.prototype, "texture", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRIridescenceConfiguration.prototype, "thicknessTexture", undefined); +}); // node_modules/@babylonjs/core/Materials/PBR/pbrAnisotropicConfiguration.js class MaterialAnisotropicDefines extends MaterialDefines { @@ -106709,24 +115403,34 @@ class PBRAnisotropicConfiguration extends MaterialPluginBase { } } } -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRAnisotropicConfiguration.prototype, "isEnabled", undefined); -__decorate2([ - serialize() -], PBRAnisotropicConfiguration.prototype, "intensity", undefined); -__decorate2([ - serializeAsVector2() -], PBRAnisotropicConfiguration.prototype, "direction", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRAnisotropicConfiguration.prototype, "texture", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsMiscDirty") -], PBRAnisotropicConfiguration.prototype, "legacy", undefined); +var init_pbrAnisotropicConfiguration = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_buffer(); + init_math_vector(); + init_materialFlags(); + init_materialHelper(); + init_materialPluginBase(); + init_materialDefines(); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRAnisotropicConfiguration.prototype, "isEnabled", undefined); + __decorate2([ + serialize() + ], PBRAnisotropicConfiguration.prototype, "intensity", undefined); + __decorate2([ + serializeAsVector2() + ], PBRAnisotropicConfiguration.prototype, "direction", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRAnisotropicConfiguration.prototype, "texture", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsMiscDirty") + ], PBRAnisotropicConfiguration.prototype, "legacy", undefined); +}); // node_modules/@babylonjs/core/Materials/PBR/pbrSheenConfiguration.js class MaterialSheenDefines extends MaterialDefines { @@ -106920,40 +115624,49 @@ class PBRSheenConfiguration extends MaterialPluginBase { }; } } -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSheenConfiguration.prototype, "isEnabled", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSheenConfiguration.prototype, "linkSheenWithAlbedo", undefined); -__decorate2([ - serialize() -], PBRSheenConfiguration.prototype, "intensity", undefined); -__decorate2([ - serializeAsColor3() -], PBRSheenConfiguration.prototype, "color", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSheenConfiguration.prototype, "texture", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSheenConfiguration.prototype, "useRoughnessFromMainTexture", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSheenConfiguration.prototype, "roughness", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSheenConfiguration.prototype, "textureRoughness", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSheenConfiguration.prototype, "albedoScaling", undefined); +var init_pbrSheenConfiguration = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_color(); + init_materialFlags(); + init_materialHelper(); + init_materialPluginBase(); + init_materialDefines(); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSheenConfiguration.prototype, "isEnabled", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSheenConfiguration.prototype, "linkSheenWithAlbedo", undefined); + __decorate2([ + serialize() + ], PBRSheenConfiguration.prototype, "intensity", undefined); + __decorate2([ + serializeAsColor3() + ], PBRSheenConfiguration.prototype, "color", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSheenConfiguration.prototype, "texture", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSheenConfiguration.prototype, "useRoughnessFromMainTexture", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSheenConfiguration.prototype, "roughness", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSheenConfiguration.prototype, "textureRoughness", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSheenConfiguration.prototype, "albedoScaling", undefined); +}); // node_modules/@babylonjs/core/Materials/PBR/pbrSubSurfaceConfiguration.js class MaterialSubSurfaceDefines extends MaterialDefines { @@ -107370,104 +116083,113 @@ class PBRSubSurfaceConfiguration extends MaterialPluginBase { }; } } -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSubSurfaceConfiguration.prototype, "isRefractionEnabled", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSubSurfaceConfiguration.prototype, "isTranslucencyEnabled", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSubSurfaceConfiguration.prototype, "isDispersionEnabled", undefined); -__decorate2([ - serialize(), - expandToProperty("_markScenePrePassDirty") -], PBRSubSurfaceConfiguration.prototype, "isScatteringEnabled", undefined); -__decorate2([ - serialize() -], PBRSubSurfaceConfiguration.prototype, "_scatteringDiffusionProfileIndex", undefined); -__decorate2([ - serialize() -], PBRSubSurfaceConfiguration.prototype, "refractionIntensity", undefined); -__decorate2([ - serialize() -], PBRSubSurfaceConfiguration.prototype, "translucencyIntensity", undefined); -__decorate2([ - serialize() -], PBRSubSurfaceConfiguration.prototype, "useAlbedoToTintRefraction", undefined); -__decorate2([ - serialize() -], PBRSubSurfaceConfiguration.prototype, "useAlbedoToTintTranslucency", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSubSurfaceConfiguration.prototype, "thicknessTexture", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSubSurfaceConfiguration.prototype, "refractionTexture", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSubSurfaceConfiguration.prototype, "indexOfRefraction", undefined); -__decorate2([ - serialize() -], PBRSubSurfaceConfiguration.prototype, "_volumeIndexOfRefraction", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSubSurfaceConfiguration.prototype, "volumeIndexOfRefraction", null); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSubSurfaceConfiguration.prototype, "invertRefractionY", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSubSurfaceConfiguration.prototype, "linkRefractionWithTransparency", undefined); -__decorate2([ - serialize() -], PBRSubSurfaceConfiguration.prototype, "minimumThickness", undefined); -__decorate2([ - serialize() -], PBRSubSurfaceConfiguration.prototype, "maximumThickness", undefined); -__decorate2([ - serialize() -], PBRSubSurfaceConfiguration.prototype, "useThicknessAsDepth", undefined); -__decorate2([ - serializeAsColor3() -], PBRSubSurfaceConfiguration.prototype, "tintColor", undefined); -__decorate2([ - serialize() -], PBRSubSurfaceConfiguration.prototype, "tintColorAtDistance", undefined); -__decorate2([ - serialize() -], PBRSubSurfaceConfiguration.prototype, "dispersion", undefined); -__decorate2([ - serializeAsColor3() -], PBRSubSurfaceConfiguration.prototype, "diffusionDistance", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSubSurfaceConfiguration.prototype, "useMaskFromThicknessTexture", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSubSurfaceConfiguration.prototype, "refractionIntensityTexture", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSubSurfaceConfiguration.prototype, "translucencyIntensityTexture", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRSubSurfaceConfiguration.prototype, "useGltfStyleTextures", undefined); +var init_pbrSubSurfaceConfiguration = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_color(); + init_materialFlags(); + init_materialHelper(); + init_math_scalar(); + init_math_vector(); + init_materialPluginBase(); + init_materialDefines(); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSubSurfaceConfiguration.prototype, "isRefractionEnabled", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSubSurfaceConfiguration.prototype, "isTranslucencyEnabled", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSubSurfaceConfiguration.prototype, "isDispersionEnabled", undefined); + __decorate2([ + serialize(), + expandToProperty("_markScenePrePassDirty") + ], PBRSubSurfaceConfiguration.prototype, "isScatteringEnabled", undefined); + __decorate2([ + serialize() + ], PBRSubSurfaceConfiguration.prototype, "_scatteringDiffusionProfileIndex", undefined); + __decorate2([ + serialize() + ], PBRSubSurfaceConfiguration.prototype, "refractionIntensity", undefined); + __decorate2([ + serialize() + ], PBRSubSurfaceConfiguration.prototype, "translucencyIntensity", undefined); + __decorate2([ + serialize() + ], PBRSubSurfaceConfiguration.prototype, "useAlbedoToTintRefraction", undefined); + __decorate2([ + serialize() + ], PBRSubSurfaceConfiguration.prototype, "useAlbedoToTintTranslucency", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSubSurfaceConfiguration.prototype, "thicknessTexture", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSubSurfaceConfiguration.prototype, "refractionTexture", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSubSurfaceConfiguration.prototype, "indexOfRefraction", undefined); + __decorate2([ + serialize() + ], PBRSubSurfaceConfiguration.prototype, "_volumeIndexOfRefraction", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSubSurfaceConfiguration.prototype, "volumeIndexOfRefraction", null); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSubSurfaceConfiguration.prototype, "invertRefractionY", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSubSurfaceConfiguration.prototype, "linkRefractionWithTransparency", undefined); + __decorate2([ + serialize() + ], PBRSubSurfaceConfiguration.prototype, "minimumThickness", undefined); + __decorate2([ + serialize() + ], PBRSubSurfaceConfiguration.prototype, "maximumThickness", undefined); + __decorate2([ + serialize() + ], PBRSubSurfaceConfiguration.prototype, "useThicknessAsDepth", undefined); + __decorate2([ + serializeAsColor3() + ], PBRSubSurfaceConfiguration.prototype, "tintColor", undefined); + __decorate2([ + serialize() + ], PBRSubSurfaceConfiguration.prototype, "tintColorAtDistance", undefined); + __decorate2([ + serialize() + ], PBRSubSurfaceConfiguration.prototype, "dispersion", undefined); + __decorate2([ + serializeAsColor3() + ], PBRSubSurfaceConfiguration.prototype, "diffusionDistance", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSubSurfaceConfiguration.prototype, "useMaskFromThicknessTexture", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSubSurfaceConfiguration.prototype, "refractionIntensityTexture", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSubSurfaceConfiguration.prototype, "translucencyIntensityTexture", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRSubSurfaceConfiguration.prototype, "useGltfStyleTextures", undefined); +}); // node_modules/@babylonjs/core/Materials/PBR/pbrBaseMaterial.js -var onCreatedEffectParameters4 = { effect: null, subMesh: null }; - class PBRMaterialDefines extends MaterialDefines { constructor(externalProperties) { super(externalProperties); @@ -107687,8 +116409,8 @@ class PBRBaseMaterial extends PushMaterial { }); } } - constructor(name147, scene21) { - super(name147, scene21); + constructor(name148, scene21) { + super(name148, scene21); this._directIntensity = 1; this._emissiveIntensity = 1; this._environmentIntensity = 1; @@ -108976,20 +117698,55 @@ class PBRBaseMaterial extends PushMaterial { super.dispose(forceDisposeEffect, forceDisposeTextures); } } -PBRBaseMaterial.PBRMATERIAL_OPAQUE = Material.MATERIAL_OPAQUE; -PBRBaseMaterial.PBRMATERIAL_ALPHATEST = Material.MATERIAL_ALPHATEST; -PBRBaseMaterial.PBRMATERIAL_ALPHABLEND = Material.MATERIAL_ALPHABLEND; -PBRBaseMaterial.PBRMATERIAL_ALPHATESTANDBLEND = Material.MATERIAL_ALPHATESTANDBLEND; -PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS = 0; -PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL = 0; -PBRBaseMaterial.LIGHTFALLOFF_GLTF = 1; -PBRBaseMaterial.LIGHTFALLOFF_STANDARD = 2; -__decorate2([ - serializeAsImageProcessingConfiguration() -], PBRBaseMaterial.prototype, "_imageProcessingConfiguration", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsMiscDirty") -], PBRBaseMaterial.prototype, "debugMode", undefined); +var onCreatedEffectParameters4; +var init_pbrBaseMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_logger(); + init_smartArray(); + init_brdfTextureTools(); + init_scene(); + init_math_vector(); + init_buffer(); + init_pbrBRDFConfiguration(); + init_prePassConfiguration(); + init_math_color(); + init_math_scalar(); + init_imageProcessingConfiguration(); + init_material(); + init_materialPluginEvent(); + init_materialDefines(); + init_pushMaterial(); + init_materialHelper(); + init_texture(); + init_materialFlags(); + init_baseTexture_polynomial(); + init_pbr_fragment(); + init_pbr_vertex(); + init_effectFallbacks(); + init_pbrClearCoatConfiguration(); + init_pbrIridescenceConfiguration(); + init_pbrAnisotropicConfiguration(); + init_pbrSheenConfiguration(); + init_pbrSubSurfaceConfiguration(); + init_material_detailMapConfiguration(); + init_clipPlaneMaterialHelper(); + onCreatedEffectParameters4 = { effect: null, subMesh: null }; + PBRBaseMaterial.PBRMATERIAL_OPAQUE = Material.MATERIAL_OPAQUE; + PBRBaseMaterial.PBRMATERIAL_ALPHATEST = Material.MATERIAL_ALPHATEST; + PBRBaseMaterial.PBRMATERIAL_ALPHABLEND = Material.MATERIAL_ALPHABLEND; + PBRBaseMaterial.PBRMATERIAL_ALPHATESTANDBLEND = Material.MATERIAL_ALPHATESTANDBLEND; + PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS = 0; + PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL = 0; + PBRBaseMaterial.LIGHTFALLOFF_GLTF = 1; + PBRBaseMaterial.LIGHTFALLOFF_STANDARD = 2; + __decorate2([ + serializeAsImageProcessingConfiguration() + ], PBRBaseMaterial.prototype, "_imageProcessingConfiguration", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsMiscDirty") + ], PBRBaseMaterial.prototype, "debugMode", undefined); +}); // node_modules/@babylonjs/core/Materials/PBR/pbrMaterial.js class PBRMaterial extends PBRBaseMaterial { @@ -109100,8 +117857,8 @@ class PBRMaterial extends PBRBaseMaterial { set cameraColorCurves(value) { this._imageProcessingConfiguration.colorCurves = value; } - constructor(name147, scene21) { - super(name147, scene21); + constructor(name148, scene21) { + super(name148, scene21); this.directIntensity = 1; this.emissiveIntensity = 1; this.environmentIntensity = 1; @@ -109155,10 +117912,10 @@ class PBRMaterial extends PBRBaseMaterial { getClassName() { return "PBRMaterial"; } - clone(name147, cloneTexturesOnlyOnce = true, rootUrl = "") { - const clone = SerializationHelper.Clone(() => new PBRMaterial(name147, this.getScene()), this, { cloneTexturesOnlyOnce }); - clone.id = name147; - clone.name = name147; + clone(name148, cloneTexturesOnlyOnce = true, rootUrl = "") { + const clone = SerializationHelper.Clone(() => new PBRMaterial(name148, this.getScene()), this, { cloneTexturesOnlyOnce }); + clone.id = name148; + clone.name = name148; this.stencil.copyTo(clone.stencil); this._clonePlugins(clone, rootUrl); return clone; @@ -109195,305 +117952,276 @@ class PBRMaterial extends PBRBaseMaterial { return material13; } } -PBRMaterial.PBRMATERIAL_OPAQUE = PBRBaseMaterial.PBRMATERIAL_OPAQUE; -PBRMaterial.PBRMATERIAL_ALPHATEST = PBRBaseMaterial.PBRMATERIAL_ALPHATEST; -PBRMaterial.PBRMATERIAL_ALPHABLEND = PBRBaseMaterial.PBRMATERIAL_ALPHABLEND; -PBRMaterial.PBRMATERIAL_ALPHATESTANDBLEND = PBRBaseMaterial.PBRMATERIAL_ALPHATESTANDBLEND; -PBRMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS = PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS; -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "directIntensity", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "emissiveIntensity", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "environmentIntensity", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "specularIntensity", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "disableBumpMap", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "albedoTexture", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "ambientTexture", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "ambientTextureStrength", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "ambientTextureImpactOnAnalyticalLights", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") -], PBRMaterial.prototype, "opacityTexture", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "reflectionTexture", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "emissiveTexture", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "reflectivityTexture", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "metallicTexture", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "metallic", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "roughness", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "metallicF0Factor", undefined); -__decorate2([ - serializeAsColor3(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "metallicReflectanceColor", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useOnlyMetallicFromMetallicReflectanceTexture", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "metallicReflectanceTexture", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "reflectanceTexture", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "microSurfaceTexture", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "bumpTexture", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty", null) -], PBRMaterial.prototype, "lightmapTexture", undefined); -__decorate2([ - serializeAsColor3("ambient"), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "ambientColor", undefined); -__decorate2([ - serializeAsColor3("albedo"), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "albedoColor", undefined); -__decorate2([ - serializeAsColor3("reflectivity"), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "reflectivityColor", undefined); -__decorate2([ - serializeAsColor3("reflection"), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "reflectionColor", undefined); -__decorate2([ - serializeAsColor3("emissive"), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "emissiveColor", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "microSurface", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useLightmapAsShadowmap", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") -], PBRMaterial.prototype, "useAlphaFromAlbedoTexture", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") -], PBRMaterial.prototype, "forceAlphaTest", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") -], PBRMaterial.prototype, "alphaCutOff", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useSpecularOverAlpha", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useMicroSurfaceFromReflectivityMapAlpha", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useRoughnessFromMetallicTextureAlpha", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useRoughnessFromMetallicTextureGreen", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useMetallnessFromMetallicTextureBlue", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useAmbientOcclusionFromMetallicTextureRed", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useAmbientInGrayScale", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useAutoMicroSurfaceFromReflectivityMap", undefined); -__decorate2([ - serialize() -], PBRMaterial.prototype, "usePhysicalLightFalloff", null); -__decorate2([ - serialize() -], PBRMaterial.prototype, "useGLTFLightFalloff", null); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useRadianceOverAlpha", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useObjectSpaceNormalMap", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useParallax", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useParallaxOcclusion", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "parallaxScaleBias", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsLightsDirty") -], PBRMaterial.prototype, "disableLighting", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "forceIrradianceInFragment", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsLightsDirty") -], PBRMaterial.prototype, "maxSimultaneousLights", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "invertNormalMapX", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "invertNormalMapY", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "twoSidedLighting", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useAlphaFresnel", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useLinearAlphaFresnel", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "environmentBRDFTexture", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "forceNormalForward", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "enableSpecularAntiAliasing", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useHorizonOcclusion", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMaterial.prototype, "useRadianceOcclusion", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsMiscDirty") -], PBRMaterial.prototype, "unlit", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsMiscDirty") -], PBRMaterial.prototype, "applyDecalMapAfterDetailMap", undefined); -RegisterClass("BABYLON.PBRMaterial", PBRMaterial); +var init_pbrMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_brdfTextureTools(); + init_math_color(); + init_pbrBaseMaterial(); + init_typeStore(); + init_material(); + PBRMaterial.PBRMATERIAL_OPAQUE = PBRBaseMaterial.PBRMATERIAL_OPAQUE; + PBRMaterial.PBRMATERIAL_ALPHATEST = PBRBaseMaterial.PBRMATERIAL_ALPHATEST; + PBRMaterial.PBRMATERIAL_ALPHABLEND = PBRBaseMaterial.PBRMATERIAL_ALPHABLEND; + PBRMaterial.PBRMATERIAL_ALPHATESTANDBLEND = PBRBaseMaterial.PBRMATERIAL_ALPHATESTANDBLEND; + PBRMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS = PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS; + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "directIntensity", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "emissiveIntensity", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "environmentIntensity", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "specularIntensity", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "disableBumpMap", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "albedoTexture", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "ambientTexture", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "ambientTextureStrength", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "ambientTextureImpactOnAnalyticalLights", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") + ], PBRMaterial.prototype, "opacityTexture", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "reflectionTexture", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "emissiveTexture", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "reflectivityTexture", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "metallicTexture", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "metallic", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "roughness", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "metallicF0Factor", undefined); + __decorate2([ + serializeAsColor3(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "metallicReflectanceColor", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useOnlyMetallicFromMetallicReflectanceTexture", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "metallicReflectanceTexture", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "reflectanceTexture", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "microSurfaceTexture", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "bumpTexture", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty", null) + ], PBRMaterial.prototype, "lightmapTexture", undefined); + __decorate2([ + serializeAsColor3("ambient"), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "ambientColor", undefined); + __decorate2([ + serializeAsColor3("albedo"), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "albedoColor", undefined); + __decorate2([ + serializeAsColor3("reflectivity"), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "reflectivityColor", undefined); + __decorate2([ + serializeAsColor3("reflection"), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "reflectionColor", undefined); + __decorate2([ + serializeAsColor3("emissive"), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "emissiveColor", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "microSurface", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useLightmapAsShadowmap", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") + ], PBRMaterial.prototype, "useAlphaFromAlbedoTexture", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") + ], PBRMaterial.prototype, "forceAlphaTest", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") + ], PBRMaterial.prototype, "alphaCutOff", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useSpecularOverAlpha", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useMicroSurfaceFromReflectivityMapAlpha", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useRoughnessFromMetallicTextureAlpha", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useRoughnessFromMetallicTextureGreen", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useMetallnessFromMetallicTextureBlue", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useAmbientOcclusionFromMetallicTextureRed", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useAmbientInGrayScale", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useAutoMicroSurfaceFromReflectivityMap", undefined); + __decorate2([ + serialize() + ], PBRMaterial.prototype, "usePhysicalLightFalloff", null); + __decorate2([ + serialize() + ], PBRMaterial.prototype, "useGLTFLightFalloff", null); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useRadianceOverAlpha", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useObjectSpaceNormalMap", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useParallax", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useParallaxOcclusion", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "parallaxScaleBias", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], PBRMaterial.prototype, "disableLighting", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "forceIrradianceInFragment", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], PBRMaterial.prototype, "maxSimultaneousLights", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "invertNormalMapX", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "invertNormalMapY", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "twoSidedLighting", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useAlphaFresnel", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useLinearAlphaFresnel", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "environmentBRDFTexture", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "forceNormalForward", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "enableSpecularAntiAliasing", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useHorizonOcclusion", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMaterial.prototype, "useRadianceOcclusion", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsMiscDirty") + ], PBRMaterial.prototype, "unlit", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsMiscDirty") + ], PBRMaterial.prototype, "applyDecalMapAfterDetailMap", undefined); + RegisterClass("BABYLON.PBRMaterial", PBRMaterial); +}); // node_modules/@babylonjs/core/Misc/dds.js -var FourCCToInt32 = function(value) { - return value.charCodeAt(0) + (value.charCodeAt(1) << 8) + (value.charCodeAt(2) << 16) + (value.charCodeAt(3) << 24); -}; -var Int32ToFourCC = function(value) { - return String.fromCharCode(value & 255, value >> 8 & 255, value >> 16 & 255, value >> 24 & 255); -}; -var DDS_MAGIC = 542327876; -var DDSD_MIPMAPCOUNT = 131072; -var DDSCAPS2_CUBEMAP = 512; -var DDPF_FOURCC = 4; -var DDPF_RGB = 64; -var DDPF_LUMINANCE = 131072; -var FOURCC_DXT1 = FourCCToInt32("DXT1"); -var FOURCC_DXT3 = FourCCToInt32("DXT3"); -var FOURCC_DXT5 = FourCCToInt32("DXT5"); -var FOURCC_DX10 = FourCCToInt32("DX10"); -var FOURCC_D3DFMT_R16G16B16A16F = 113; -var FOURCC_D3DFMT_R32G32B32A32F = 116; -var DXGI_FORMAT_R32G32B32A32_FLOAT = 2; -var DXGI_FORMAT_R16G16B16A16_FLOAT = 10; -var DXGI_FORMAT_B8G8R8X8_UNORM = 88; -var headerLengthInt = 31; -var off_magic = 0; -var off_size = 1; -var off_flags = 2; -var off_height = 3; -var off_width = 4; -var off_mipmapCount = 7; -var off_pfFlags = 20; -var off_pfFourCC = 21; -var off_RGBbpp = 22; -var off_RMask = 23; -var off_GMask = 24; -var off_BMask = 25; -var off_AMask = 26; -var off_caps2 = 28; -var off_dxgiFormat = 32; - class DDSTools { static GetDDSInfo(data) { const header = new Int32Array(data.buffer, data.byteOffset, headerLengthInt); @@ -109926,80 +118654,129 @@ class DDSTools { } } } -DDSTools.StoreLODInAlphaChannel = false; -ThinEngine.prototype.createPrefilteredCubeTexture = function(rootUrl, scene21, lodScale, lodOffset, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = true) { - const callback = (loadData) => { - if (!loadData) { - if (onLoad) { - onLoad(null); +var FourCCToInt32, Int32ToFourCC, DDS_MAGIC, DDSD_MIPMAPCOUNT, DDSCAPS2_CUBEMAP, DDPF_FOURCC, DDPF_RGB, DDPF_LUMINANCE, FOURCC_DXT1, FOURCC_DXT3, FOURCC_DXT5, FOURCC_DX10, FOURCC_D3DFMT_R16G16B16A16F, FOURCC_D3DFMT_R32G32B32A32F, DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_B8G8R8X8_UNORM, headerLengthInt, off_magic, off_size, off_flags, off_height, off_width, off_mipmapCount, off_pfFlags, off_pfFourCC, off_RGBbpp, off_RMask, off_GMask, off_BMask, off_AMask, off_caps2, off_dxgiFormat; +var init_dds = __esm(() => { + init_math_scalar(); + init_sphericalPolynomial(); + init_internalTexture(); + init_logger(); + init_cubemapToSphericalPolynomial(); + init_baseTexture(); + init_thinEngine(); + init_textureTools(); + init_engine_cubeTexture(); + FourCCToInt32 = function(value) { + return value.charCodeAt(0) + (value.charCodeAt(1) << 8) + (value.charCodeAt(2) << 16) + (value.charCodeAt(3) << 24); + }; + Int32ToFourCC = function(value) { + return String.fromCharCode(value & 255, value >> 8 & 255, value >> 16 & 255, value >> 24 & 255); + }; + DDS_MAGIC = 542327876; + DDSD_MIPMAPCOUNT = 131072; + DDSCAPS2_CUBEMAP = 512; + DDPF_FOURCC = 4; + DDPF_RGB = 64; + DDPF_LUMINANCE = 131072; + FOURCC_DXT1 = FourCCToInt32("DXT1"); + FOURCC_DXT3 = FourCCToInt32("DXT3"); + FOURCC_DXT5 = FourCCToInt32("DXT5"); + FOURCC_DX10 = FourCCToInt32("DX10"); + FOURCC_D3DFMT_R16G16B16A16F = 113; + FOURCC_D3DFMT_R32G32B32A32F = 116; + DXGI_FORMAT_R32G32B32A32_FLOAT = 2; + DXGI_FORMAT_R16G16B16A16_FLOAT = 10; + DXGI_FORMAT_B8G8R8X8_UNORM = 88; + headerLengthInt = 31; + off_magic = 0; + off_size = 1; + off_flags = 2; + off_height = 3; + off_width = 4; + off_mipmapCount = 7; + off_pfFlags = 20; + off_pfFourCC = 21; + off_RGBbpp = 22; + off_RMask = 23; + off_GMask = 24; + off_BMask = 25; + off_AMask = 26; + off_caps2 = 28; + off_dxgiFormat = 32; + DDSTools.StoreLODInAlphaChannel = false; + ThinEngine.prototype.createPrefilteredCubeTexture = function(rootUrl, scene21, lodScale, lodOffset, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = true) { + const callback = (loadData) => { + if (!loadData) { + if (onLoad) { + onLoad(null); + } + return; } - return; - } - const texture26 = loadData.texture; - if (!createPolynomials) { - texture26._sphericalPolynomial = new SphericalPolynomial; - } else if (loadData.info.sphericalPolynomial) { - texture26._sphericalPolynomial = loadData.info.sphericalPolynomial; - } - texture26._source = InternalTextureSource.CubePrefiltered; - if (this.getCaps().textureLOD) { + const texture26 = loadData.texture; + if (!createPolynomials) { + texture26._sphericalPolynomial = new SphericalPolynomial; + } else if (loadData.info.sphericalPolynomial) { + texture26._sphericalPolynomial = loadData.info.sphericalPolynomial; + } + texture26._source = InternalTextureSource.CubePrefiltered; + if (this.getCaps().textureLOD) { + if (onLoad) { + onLoad(texture26); + } + return; + } + const mipSlices = 3; + const gl = this._gl; + const width = loadData.width; + if (!width) { + return; + } + const textures = []; + for (let i = 0;i < mipSlices; i++) { + const smoothness = i / (mipSlices - 1); + const roughness = 1 - smoothness; + const minLODIndex = lodOffset; + const maxLODIndex = Scalar.Log2(width) * lodScale + lodOffset; + const lodIndex = minLODIndex + (maxLODIndex - minLODIndex) * roughness; + const mipmapIndex = Math.round(Math.min(Math.max(lodIndex, 0), maxLODIndex)); + const glTextureFromLod = new InternalTexture(this, InternalTextureSource.Temp); + glTextureFromLod.type = texture26.type; + glTextureFromLod.format = texture26.format; + glTextureFromLod.width = Math.pow(2, Math.max(Scalar.Log2(width) - mipmapIndex, 0)); + glTextureFromLod.height = glTextureFromLod.width; + glTextureFromLod.isCube = true; + glTextureFromLod._cachedWrapU = 0; + glTextureFromLod._cachedWrapV = 0; + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, glTextureFromLod, true); + glTextureFromLod.samplingMode = 2; + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + if (loadData.isDDS) { + const info = loadData.info; + const data = loadData.data; + this._unpackFlipY(info.isCompressed); + DDSTools.UploadDDSLevels(this, glTextureFromLod, data, info, true, 6, mipmapIndex); + } else { + Logger.Warn("DDS is the only prefiltered cube map supported so far."); + } + this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); + const lodTexture = new BaseTexture(scene21); + lodTexture._isCube = true; + lodTexture._texture = glTextureFromLod; + glTextureFromLod.isReady = true; + textures.push(lodTexture); + } + texture26._lodTextureHigh = textures[2]; + texture26._lodTextureMid = textures[1]; + texture26._lodTextureLow = textures[0]; if (onLoad) { onLoad(texture26); } - return; - } - const mipSlices = 3; - const gl = this._gl; - const width = loadData.width; - if (!width) { - return; - } - const textures = []; - for (let i = 0;i < mipSlices; i++) { - const smoothness = i / (mipSlices - 1); - const roughness = 1 - smoothness; - const minLODIndex = lodOffset; - const maxLODIndex = Scalar.Log2(width) * lodScale + lodOffset; - const lodIndex = minLODIndex + (maxLODIndex - minLODIndex) * roughness; - const mipmapIndex = Math.round(Math.min(Math.max(lodIndex, 0), maxLODIndex)); - const glTextureFromLod = new InternalTexture(this, InternalTextureSource.Temp); - glTextureFromLod.type = texture26.type; - glTextureFromLod.format = texture26.format; - glTextureFromLod.width = Math.pow(2, Math.max(Scalar.Log2(width) - mipmapIndex, 0)); - glTextureFromLod.height = glTextureFromLod.width; - glTextureFromLod.isCube = true; - glTextureFromLod._cachedWrapU = 0; - glTextureFromLod._cachedWrapV = 0; - this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, glTextureFromLod, true); - glTextureFromLod.samplingMode = 2; - gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR); - gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR); - gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - if (loadData.isDDS) { - const info = loadData.info; - const data = loadData.data; - this._unpackFlipY(info.isCompressed); - DDSTools.UploadDDSLevels(this, glTextureFromLod, data, info, true, 6, mipmapIndex); - } else { - Logger.Warn("DDS is the only prefiltered cube map supported so far."); - } - this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null); - const lodTexture = new BaseTexture(scene21); - lodTexture._isCube = true; - lodTexture._texture = glTextureFromLod; - glTextureFromLod.isReady = true; - textures.push(lodTexture); - } - texture26._lodTextureHigh = textures[2]; - texture26._lodTextureMid = textures[1]; - texture26._lodTextureLow = textures[0]; - if (onLoad) { - onLoad(texture26); - } + }; + return this.createCubeTexture(rootUrl, scene21, null, false, callback, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset); }; - return this.createCubeTexture(rootUrl, scene21, null, false, callback, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset); -}; +}); // node_modules/@babylonjs/core/Materials/Textures/Loaders/ddsTextureLoader.js class _DDSTextureLoader { @@ -110062,7 +118839,12 @@ class _DDSTextureLoader { }); } } -Engine2._TextureLoaders.push(new _DDSTextureLoader); +var init_ddsTextureLoader = __esm(() => { + init_sphericalPolynomial(); + init_engine(); + init_dds(); + Engine2._TextureLoaders.push(new _DDSTextureLoader); +}); // node_modules/@babylonjs/core/Materials/Textures/Loaders/envTextureLoader.js class _ENVTextureLoader { @@ -110103,7 +118885,11 @@ class _ENVTextureLoader { throw ".env not supported in 2d."; } } -Engine2._TextureLoaders.push(new _ENVTextureLoader); +var init_envTextureLoader = __esm(() => { + init_environmentTextureTools(); + init_engine(); + Engine2._TextureLoaders.push(new _ENVTextureLoader); +}); // node_modules/@babylonjs/core/Misc/khronosTextureContainer.js class KhronosTextureContainer { @@ -110194,11 +118980,14 @@ class KhronosTextureContainer { return false; } } -KhronosTextureContainer.HEADER_LEN = 12 + 13 * 4; -KhronosTextureContainer.COMPRESSED_2D = 0; -KhronosTextureContainer.COMPRESSED_3D = 1; -KhronosTextureContainer.TEX_2D = 2; -KhronosTextureContainer.TEX_3D = 3; +var init_khronosTextureContainer = __esm(() => { + init_logger(); + KhronosTextureContainer.HEADER_LEN = 12 + 13 * 4; + KhronosTextureContainer.COMPRESSED_2D = 0; + KhronosTextureContainer.COMPRESSED_3D = 1; + KhronosTextureContainer.TEX_2D = 2; + KhronosTextureContainer.TEX_3D = 3; +}); // node_modules/@babylonjs/core/Misc/workerPool.js class WorkerPool { @@ -110291,113 +119080,49 @@ class AutoReleaseWorkerPool extends WorkerPool { }); } } -AutoReleaseWorkerPool.DefaultOptions = { - idleTimeElapsedBeforeRelease: 1000 -}; +var init_workerPool = __esm(() => { + AutoReleaseWorkerPool.DefaultOptions = { + idleTimeElapsedBeforeRelease: 1000 + }; +}); // node_modules/@babylonjs/core/Materials/Textures/ktx2decoderTypes.js -var SourceTextureFormat; -(function(SourceTextureFormat2) { - SourceTextureFormat2[SourceTextureFormat2["ETC1S"] = 0] = "ETC1S"; - SourceTextureFormat2[SourceTextureFormat2["UASTC4x4"] = 1] = "UASTC4x4"; -})(SourceTextureFormat || (SourceTextureFormat = {})); -var TranscodeTarget; -(function(TranscodeTarget2) { - TranscodeTarget2[TranscodeTarget2["ASTC_4X4_RGBA"] = 0] = "ASTC_4X4_RGBA"; - TranscodeTarget2[TranscodeTarget2["BC7_RGBA"] = 1] = "BC7_RGBA"; - TranscodeTarget2[TranscodeTarget2["BC3_RGBA"] = 2] = "BC3_RGBA"; - TranscodeTarget2[TranscodeTarget2["BC1_RGB"] = 3] = "BC1_RGB"; - TranscodeTarget2[TranscodeTarget2["PVRTC1_4_RGBA"] = 4] = "PVRTC1_4_RGBA"; - TranscodeTarget2[TranscodeTarget2["PVRTC1_4_RGB"] = 5] = "PVRTC1_4_RGB"; - TranscodeTarget2[TranscodeTarget2["ETC2_RGBA"] = 6] = "ETC2_RGBA"; - TranscodeTarget2[TranscodeTarget2["ETC1_RGB"] = 7] = "ETC1_RGB"; - TranscodeTarget2[TranscodeTarget2["RGBA32"] = 8] = "RGBA32"; - TranscodeTarget2[TranscodeTarget2["R8"] = 9] = "R8"; - TranscodeTarget2[TranscodeTarget2["RG8"] = 10] = "RG8"; -})(TranscodeTarget || (TranscodeTarget = {})); -var EngineFormat; -(function(EngineFormat2) { - EngineFormat2[EngineFormat2["COMPRESSED_RGBA_BPTC_UNORM_EXT"] = 36492] = "COMPRESSED_RGBA_BPTC_UNORM_EXT"; - EngineFormat2[EngineFormat2["COMPRESSED_RGBA_ASTC_4X4_KHR"] = 37808] = "COMPRESSED_RGBA_ASTC_4X4_KHR"; - EngineFormat2[EngineFormat2["COMPRESSED_RGB_S3TC_DXT1_EXT"] = 33776] = "COMPRESSED_RGB_S3TC_DXT1_EXT"; - EngineFormat2[EngineFormat2["COMPRESSED_RGBA_S3TC_DXT5_EXT"] = 33779] = "COMPRESSED_RGBA_S3TC_DXT5_EXT"; - EngineFormat2[EngineFormat2["COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"] = 35842] = "COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"; - EngineFormat2[EngineFormat2["COMPRESSED_RGB_PVRTC_4BPPV1_IMG"] = 35840] = "COMPRESSED_RGB_PVRTC_4BPPV1_IMG"; - EngineFormat2[EngineFormat2["COMPRESSED_RGBA8_ETC2_EAC"] = 37496] = "COMPRESSED_RGBA8_ETC2_EAC"; - EngineFormat2[EngineFormat2["COMPRESSED_RGB8_ETC2"] = 37492] = "COMPRESSED_RGB8_ETC2"; - EngineFormat2[EngineFormat2["COMPRESSED_RGB_ETC1_WEBGL"] = 36196] = "COMPRESSED_RGB_ETC1_WEBGL"; - EngineFormat2[EngineFormat2["RGBA8Format"] = 32856] = "RGBA8Format"; - EngineFormat2[EngineFormat2["R8Format"] = 33321] = "R8Format"; - EngineFormat2[EngineFormat2["RG8Format"] = 33323] = "RG8Format"; -})(EngineFormat || (EngineFormat = {})); +var SourceTextureFormat, TranscodeTarget, EngineFormat; +var init_ktx2decoderTypes = __esm(() => { + (function(SourceTextureFormat2) { + SourceTextureFormat2[SourceTextureFormat2["ETC1S"] = 0] = "ETC1S"; + SourceTextureFormat2[SourceTextureFormat2["UASTC4x4"] = 1] = "UASTC4x4"; + })(SourceTextureFormat || (SourceTextureFormat = {})); + (function(TranscodeTarget2) { + TranscodeTarget2[TranscodeTarget2["ASTC_4X4_RGBA"] = 0] = "ASTC_4X4_RGBA"; + TranscodeTarget2[TranscodeTarget2["BC7_RGBA"] = 1] = "BC7_RGBA"; + TranscodeTarget2[TranscodeTarget2["BC3_RGBA"] = 2] = "BC3_RGBA"; + TranscodeTarget2[TranscodeTarget2["BC1_RGB"] = 3] = "BC1_RGB"; + TranscodeTarget2[TranscodeTarget2["PVRTC1_4_RGBA"] = 4] = "PVRTC1_4_RGBA"; + TranscodeTarget2[TranscodeTarget2["PVRTC1_4_RGB"] = 5] = "PVRTC1_4_RGB"; + TranscodeTarget2[TranscodeTarget2["ETC2_RGBA"] = 6] = "ETC2_RGBA"; + TranscodeTarget2[TranscodeTarget2["ETC1_RGB"] = 7] = "ETC1_RGB"; + TranscodeTarget2[TranscodeTarget2["RGBA32"] = 8] = "RGBA32"; + TranscodeTarget2[TranscodeTarget2["R8"] = 9] = "R8"; + TranscodeTarget2[TranscodeTarget2["RG8"] = 10] = "RG8"; + })(TranscodeTarget || (TranscodeTarget = {})); + (function(EngineFormat2) { + EngineFormat2[EngineFormat2["COMPRESSED_RGBA_BPTC_UNORM_EXT"] = 36492] = "COMPRESSED_RGBA_BPTC_UNORM_EXT"; + EngineFormat2[EngineFormat2["COMPRESSED_RGBA_ASTC_4X4_KHR"] = 37808] = "COMPRESSED_RGBA_ASTC_4X4_KHR"; + EngineFormat2[EngineFormat2["COMPRESSED_RGB_S3TC_DXT1_EXT"] = 33776] = "COMPRESSED_RGB_S3TC_DXT1_EXT"; + EngineFormat2[EngineFormat2["COMPRESSED_RGBA_S3TC_DXT5_EXT"] = 33779] = "COMPRESSED_RGBA_S3TC_DXT5_EXT"; + EngineFormat2[EngineFormat2["COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"] = 35842] = "COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"; + EngineFormat2[EngineFormat2["COMPRESSED_RGB_PVRTC_4BPPV1_IMG"] = 35840] = "COMPRESSED_RGB_PVRTC_4BPPV1_IMG"; + EngineFormat2[EngineFormat2["COMPRESSED_RGBA8_ETC2_EAC"] = 37496] = "COMPRESSED_RGBA8_ETC2_EAC"; + EngineFormat2[EngineFormat2["COMPRESSED_RGB8_ETC2"] = 37492] = "COMPRESSED_RGB8_ETC2"; + EngineFormat2[EngineFormat2["COMPRESSED_RGB_ETC1_WEBGL"] = 36196] = "COMPRESSED_RGB_ETC1_WEBGL"; + EngineFormat2[EngineFormat2["RGBA8Format"] = 32856] = "RGBA8Format"; + EngineFormat2[EngineFormat2["R8Format"] = 33321] = "R8Format"; + EngineFormat2[EngineFormat2["RG8Format"] = 33323] = "RG8Format"; + })(EngineFormat || (EngineFormat = {})); +}); // node_modules/@babylonjs/core/Misc/khronosTextureContainer2.js -var applyConfig = function(urls) { - if (urls.wasmUASTCToASTC) { - KTX2DECODER.LiteTranscoder_UASTC_ASTC.WasmModuleURL = urls.wasmUASTCToASTC; - } - if (urls.wasmUASTCToBC7) { - KTX2DECODER.LiteTranscoder_UASTC_BC7.WasmModuleURL = urls.wasmUASTCToBC7; - } - if (urls.wasmUASTCToRGBA_UNORM) { - KTX2DECODER.LiteTranscoder_UASTC_RGBA_UNORM.WasmModuleURL = urls.wasmUASTCToRGBA_UNORM; - } - if (urls.wasmUASTCToRGBA_SRGB) { - KTX2DECODER.LiteTranscoder_UASTC_RGBA_SRGB.WasmModuleURL = urls.wasmUASTCToRGBA_SRGB; - } - if (urls.wasmUASTCToR8_UNORM) { - KTX2DECODER.LiteTranscoder_UASTC_R8_UNORM.WasmModuleURL = urls.wasmUASTCToR8_UNORM; - } - if (urls.wasmUASTCToRG8_UNORM) { - KTX2DECODER.LiteTranscoder_UASTC_RG8_UNORM.WasmModuleURL = urls.wasmUASTCToRG8_UNORM; - } - if (urls.jsMSCTranscoder) { - KTX2DECODER.MSCTranscoder.JSModuleURL = urls.jsMSCTranscoder; - } - if (urls.wasmMSCTranscoder) { - KTX2DECODER.MSCTranscoder.WasmModuleURL = urls.wasmMSCTranscoder; - } - if (urls.wasmZSTDDecoder) { - KTX2DECODER.ZSTDDecoder.WasmModuleURL = urls.wasmZSTDDecoder; - } -}; -var workerFunc = function() { - let ktx2Decoder; - onmessage = (event) => { - if (!event.data) { - return; - } - switch (event.data.action) { - case "init": { - const urls = event.data.urls; - importScripts(urls.jsDecoderModule); - applyConfig(urls); - ktx2Decoder = new KTX2DECODER.KTX2Decoder; - postMessage({ action: "init" }); - break; - } - case "setDefaultDecoderOptions": { - KTX2DECODER.KTX2Decoder.DefaultDecoderOptions = event.data.options; - break; - } - case "decode": - ktx2Decoder.decode(event.data.data, event.data.caps, event.data.options).then((data) => { - const buffers = []; - for (let mip = 0;mip < data.mipmaps.length; ++mip) { - const mipmap = data.mipmaps[mip]; - if (mipmap && mipmap.data) { - buffers.push(mipmap.data.buffer); - } - } - postMessage({ action: "decoded", success: true, decodedData: data }, buffers); - }).catch((reason) => { - postMessage({ action: "decoded", success: false, msg: reason }); - }); - break; - } - }; -}; - class DefaultKTX2DecoderOptions { constructor() { this._isDirty = true; @@ -110687,44 +119412,93 @@ class KhronosTextureContainer2 { return false; } } -KhronosTextureContainer2.URLConfig = { - jsDecoderModule: "https://cdn.babylonjs.com/babylon.ktx2Decoder.js", - wasmUASTCToASTC: null, - wasmUASTCToBC7: null, - wasmUASTCToRGBA_UNORM: null, - wasmUASTCToRGBA_SRGB: null, - wasmUASTCToR8_UNORM: null, - wasmUASTCToRG8_UNORM: null, - jsMSCTranscoder: null, - wasmMSCTranscoder: null, - wasmZSTDDecoder: null -}; -KhronosTextureContainer2.DefaultNumWorkers = KhronosTextureContainer2.GetDefaultNumWorkers(); -KhronosTextureContainer2.DefaultDecoderOptions = new DefaultKTX2DecoderOptions; +var applyConfig, workerFunc; +var init_khronosTextureContainer2 = __esm(() => { + init_workerPool(); + init_tools(); + init_ktx2decoderTypes(); + applyConfig = function(urls) { + if (urls.wasmUASTCToASTC) { + KTX2DECODER.LiteTranscoder_UASTC_ASTC.WasmModuleURL = urls.wasmUASTCToASTC; + } + if (urls.wasmUASTCToBC7) { + KTX2DECODER.LiteTranscoder_UASTC_BC7.WasmModuleURL = urls.wasmUASTCToBC7; + } + if (urls.wasmUASTCToRGBA_UNORM) { + KTX2DECODER.LiteTranscoder_UASTC_RGBA_UNORM.WasmModuleURL = urls.wasmUASTCToRGBA_UNORM; + } + if (urls.wasmUASTCToRGBA_SRGB) { + KTX2DECODER.LiteTranscoder_UASTC_RGBA_SRGB.WasmModuleURL = urls.wasmUASTCToRGBA_SRGB; + } + if (urls.wasmUASTCToR8_UNORM) { + KTX2DECODER.LiteTranscoder_UASTC_R8_UNORM.WasmModuleURL = urls.wasmUASTCToR8_UNORM; + } + if (urls.wasmUASTCToRG8_UNORM) { + KTX2DECODER.LiteTranscoder_UASTC_RG8_UNORM.WasmModuleURL = urls.wasmUASTCToRG8_UNORM; + } + if (urls.jsMSCTranscoder) { + KTX2DECODER.MSCTranscoder.JSModuleURL = urls.jsMSCTranscoder; + } + if (urls.wasmMSCTranscoder) { + KTX2DECODER.MSCTranscoder.WasmModuleURL = urls.wasmMSCTranscoder; + } + if (urls.wasmZSTDDecoder) { + KTX2DECODER.ZSTDDecoder.WasmModuleURL = urls.wasmZSTDDecoder; + } + }; + workerFunc = function() { + let ktx2Decoder; + onmessage = (event) => { + if (!event.data) { + return; + } + switch (event.data.action) { + case "init": { + const urls = event.data.urls; + importScripts(urls.jsDecoderModule); + applyConfig(urls); + ktx2Decoder = new KTX2DECODER.KTX2Decoder; + postMessage({ action: "init" }); + break; + } + case "setDefaultDecoderOptions": { + KTX2DECODER.KTX2Decoder.DefaultDecoderOptions = event.data.options; + break; + } + case "decode": + ktx2Decoder.decode(event.data.data, event.data.caps, event.data.options).then((data) => { + const buffers = []; + for (let mip = 0;mip < data.mipmaps.length; ++mip) { + const mipmap = data.mipmaps[mip]; + if (mipmap && mipmap.data) { + buffers.push(mipmap.data.buffer); + } + } + postMessage({ action: "decoded", success: true, decodedData: data }, buffers); + }).catch((reason) => { + postMessage({ action: "decoded", success: false, msg: reason }); + }); + break; + } + }; + }; + KhronosTextureContainer2.URLConfig = { + jsDecoderModule: "https://cdn.babylonjs.com/babylon.ktx2Decoder.js", + wasmUASTCToASTC: null, + wasmUASTCToBC7: null, + wasmUASTCToRGBA_UNORM: null, + wasmUASTCToRGBA_SRGB: null, + wasmUASTCToR8_UNORM: null, + wasmUASTCToRG8_UNORM: null, + jsMSCTranscoder: null, + wasmMSCTranscoder: null, + wasmZSTDDecoder: null + }; + KhronosTextureContainer2.DefaultNumWorkers = KhronosTextureContainer2.GetDefaultNumWorkers(); + KhronosTextureContainer2.DefaultDecoderOptions = new DefaultKTX2DecoderOptions; +}); // node_modules/@babylonjs/core/Materials/Textures/Loaders/ktxTextureLoader.js -var mapSRGBToLinear = function(format) { - switch (format) { - case 35916: - return 33776; - case 35918: - return 33778; - case 35919: - return 33779; - case 37493: - return 37492; - case 37497: - return 37496; - case 37495: - return 37494; - case 37840: - return 37808; - case 36493: - return 36492; - } - return null; -}; - class _KTXTextureLoader { constructor() { this.supportCascades = false; @@ -110784,12 +119558,40 @@ class _KTXTextureLoader { } } } -Engine2._TextureLoaders.unshift(new _KTXTextureLoader); +var mapSRGBToLinear; +var init_ktxTextureLoader = __esm(() => { + init_khronosTextureContainer(); + init_khronosTextureContainer2(); + init_engine(); + init_logger(); + mapSRGBToLinear = function(format) { + switch (format) { + case 35916: + return 33776; + case 35918: + return 33778; + case 35919: + return 33779; + case 37493: + return 37492; + case 37497: + return 37496; + case 37495: + return 37494; + case 37840: + return 37808; + case 36493: + return 36492; + } + return null; + }; + Engine2._TextureLoaders.unshift(new _KTXTextureLoader); +}); // node_modules/@babylonjs/core/XR/webXRCamera.js class WebXRCamera extends FreeCamera { - constructor(name147, scene21, _xrSessionManager) { - super(name147, Vector3.Zero(), scene21); + constructor(name148, scene21, _xrSessionManager) { + super(name148, Vector3.Zero(), scene21); this._xrSessionManager = _xrSessionManager; this._firstFrame = false; this._referenceQuaternion = Quaternion.Identity(); @@ -111013,7 +119815,16 @@ class WebXRCamera extends FreeCamera { } } } -WebXRCamera._ScaleReadOnly = Vector3.One(); +var init_webXRCamera = __esm(() => { + init_math_vector(); + init_camera(); + init_freeCamera(); + init_targetCamera(); + init_math_viewport(); + init_observable(); + init_webXRTypes(); + WebXRCamera._ScaleReadOnly = Vector3.One(); +}); // node_modules/@babylonjs/core/XR/webXRExperienceHelper.js class WebXRExperienceHelper { @@ -111204,6 +120015,16 @@ class WebXRExperienceHelper { this.onStateChangedObservable.notifyObservers(this.state); } } +var init_webXRExperienceHelper = __esm(() => { + init_observable(); + init_webXRSessionManager(); + init_webXRCamera(); + init_webXRTypes(); + init_webXRFeaturesManager(); + init_logger(); + init_universalCamera(); + init_math_vector(); +}); // node_modules/@babylonjs/core/XR/motionController/webXRControllerComponent.js class WebXRControllerComponent { @@ -111331,11 +120152,14 @@ class WebXRControllerComponent { } } } -WebXRControllerComponent.BUTTON_TYPE = "button"; -WebXRControllerComponent.SQUEEZE_TYPE = "squeeze"; -WebXRControllerComponent.THUMBSTICK_TYPE = "thumbstick"; -WebXRControllerComponent.TOUCHPAD_TYPE = "touchpad"; -WebXRControllerComponent.TRIGGER_TYPE = "trigger"; +var init_webXRControllerComponent = __esm(() => { + init_observable(); + WebXRControllerComponent.BUTTON_TYPE = "button"; + WebXRControllerComponent.SQUEEZE_TYPE = "squeeze"; + WebXRControllerComponent.THUMBSTICK_TYPE = "thumbstick"; + WebXRControllerComponent.TOUCHPAD_TYPE = "touchpad"; + WebXRControllerComponent.TRIGGER_TYPE = "trigger"; +}); // node_modules/@babylonjs/core/XR/motionController/webXRAbstractMotionController.js class WebXRAbstractMotionController { @@ -111447,11 +120271,11 @@ class WebXRAbstractMotionController { return Promise.resolve(false); } } - _getChildByName(node28, name147) { - return node28.getChildren((n) => n.name === name147, false)[0]; + _getChildByName(node28, name148) { + return node28.getChildren((n) => n.name === name148, false)[0]; } - _getImmediateChildByName(node28, name147) { - return node28.getChildren((n) => n.name == name147, true)[0]; + _getImmediateChildByName(node28, name148) { + return node28.getChildren((n) => n.name == name148, true)[0]; } _lerpTransform(axisMap, axisValue, fixValueCoordinates) { if (!axisMap.minMesh || !axisMap.maxMesh || !axisMap.valueMesh) { @@ -111487,6 +120311,14 @@ class WebXRAbstractMotionController { this.rootMesh.rotationQuaternion = Quaternion.FromEulerAngles(0, Math.PI, 0); } } +var init_webXRAbstractMotionController = __esm(() => { + init_webXRControllerComponent(); + init_observable(); + init_logger(); + init_sceneLoader(); + init_math_vector(); + init_mesh(); +}); // node_modules/@babylonjs/core/XR/motionController/webXRGenericMotionController.js class WebXRGenericTriggerMotionController extends WebXRAbstractMotionController { @@ -111518,57 +120350,63 @@ class WebXRGenericTriggerMotionController extends WebXRAbstractMotionController _updateModel() { } } -WebXRGenericTriggerMotionController.ProfileId = "generic-trigger"; -var GenericTriggerLayout = { - left: { - selectComponentId: "xr-standard-trigger", - components: { - "xr-standard-trigger": { - type: "trigger", - gamepadIndices: { - button: 0 - }, - rootNodeName: "xr_standard_trigger", - visualResponses: {} - } - }, - gamepadMapping: "xr-standard", - rootNodeName: "generic-trigger-left", - assetPath: "left.glb" - }, - right: { - selectComponentId: "xr-standard-trigger", - components: { - "xr-standard-trigger": { - type: "trigger", - gamepadIndices: { - button: 0 - }, - rootNodeName: "xr_standard_trigger", - visualResponses: {} - } +var GenericTriggerLayout; +var init_webXRGenericMotionController = __esm(() => { + init_webXRAbstractMotionController(); + init_mesh(); + init_math_vector(); + WebXRGenericTriggerMotionController.ProfileId = "generic-trigger"; + GenericTriggerLayout = { + left: { + selectComponentId: "xr-standard-trigger", + components: { + "xr-standard-trigger": { + type: "trigger", + gamepadIndices: { + button: 0 + }, + rootNodeName: "xr_standard_trigger", + visualResponses: {} + } + }, + gamepadMapping: "xr-standard", + rootNodeName: "generic-trigger-left", + assetPath: "left.glb" }, - gamepadMapping: "xr-standard", - rootNodeName: "generic-trigger-right", - assetPath: "right.glb" - }, - none: { - selectComponentId: "xr-standard-trigger", - components: { - "xr-standard-trigger": { - type: "trigger", - gamepadIndices: { - button: 0 - }, - rootNodeName: "xr_standard_trigger", - visualResponses: {} - } + right: { + selectComponentId: "xr-standard-trigger", + components: { + "xr-standard-trigger": { + type: "trigger", + gamepadIndices: { + button: 0 + }, + rootNodeName: "xr_standard_trigger", + visualResponses: {} + } + }, + gamepadMapping: "xr-standard", + rootNodeName: "generic-trigger-right", + assetPath: "right.glb" }, - gamepadMapping: "xr-standard", - rootNodeName: "generic-trigger-none", - assetPath: "none.glb" - } -}; + none: { + selectComponentId: "xr-standard-trigger", + components: { + "xr-standard-trigger": { + type: "trigger", + gamepadIndices: { + button: 0 + }, + rootNodeName: "xr_standard_trigger", + visualResponses: {} + } + }, + gamepadMapping: "xr-standard", + rootNodeName: "generic-trigger-none", + assetPath: "none.glb" + } + }; +}); // node_modules/@babylonjs/core/XR/motionController/webXRProfiledMotionController.js class WebXRProfiledMotionController extends WebXRAbstractMotionController { @@ -111688,10 +120526,19 @@ class WebXRProfiledMotionController extends WebXRAbstractMotionController { }); } } +var init_webXRProfiledMotionController = __esm(() => { + init_webXRAbstractMotionController(); + init_sceneLoader(); + init_mesh(); + init_math_axis(); + init_math_color(); + init_webXRControllerComponent(); + init_sphereBuilder(); + init_standardMaterial(); + init_logger(); +}); // node_modules/@babylonjs/core/XR/motionController/webXRMotionControllerManager.js -var controllerCache = []; - class WebXRMotionControllerManager { static ClearProfilesCache() { this._ProfilesList = null; @@ -111816,21 +120663,26 @@ class WebXRMotionControllerManager { throw new Error(`no controller requested was found in the available controllers list`); } } -WebXRMotionControllerManager._AvailableControllers = {}; -WebXRMotionControllerManager._Fallbacks = {}; -WebXRMotionControllerManager._ProfileLoadingPromises = {}; -WebXRMotionControllerManager.BaseRepositoryUrl = "https://immersive-web.github.io/webxr-input-profiles/packages/viewer/dist"; -WebXRMotionControllerManager.PrioritizeOnlineRepository = true; -WebXRMotionControllerManager.UseOnlineRepository = true; -WebXRMotionControllerManager.DisableControllerCache = true; -WebXRMotionControllerManager.RegisterController(WebXRGenericTriggerMotionController.ProfileId, (xrInput, scene21) => { - return new WebXRGenericTriggerMotionController(scene21, xrInput.gamepad, xrInput.handedness); +var controllerCache; +var init_webXRMotionControllerManager = __esm(() => { + init_webXRGenericMotionController(); + init_tools(); + init_webXRProfiledMotionController(); + controllerCache = []; + WebXRMotionControllerManager._AvailableControllers = {}; + WebXRMotionControllerManager._Fallbacks = {}; + WebXRMotionControllerManager._ProfileLoadingPromises = {}; + WebXRMotionControllerManager.BaseRepositoryUrl = "https://immersive-web.github.io/webxr-input-profiles/packages/viewer/dist"; + WebXRMotionControllerManager.PrioritizeOnlineRepository = true; + WebXRMotionControllerManager.UseOnlineRepository = true; + WebXRMotionControllerManager.DisableControllerCache = true; + WebXRMotionControllerManager.RegisterController(WebXRGenericTriggerMotionController.ProfileId, (xrInput, scene21) => { + return new WebXRGenericTriggerMotionController(scene21, xrInput.gamepad, xrInput.handedness); + }); + WebXRMotionControllerManager.DefaultFallbacks(); }); -WebXRMotionControllerManager.DefaultFallbacks(); // node_modules/@babylonjs/core/XR/webXRInputSource.js -var idCount = 0; - class WebXRInputSource { constructor(_scene, inputSource, _options = {}) { this._scene = _scene; @@ -111934,6 +120786,15 @@ class WebXRInputSource { } } } +var idCount; +var init_webXRInputSource = __esm(() => { + init_observable(); + init_abstractMesh(); + init_math_vector(); + init_webXRMotionControllerManager(); + init_tools(); + idCount = 0; +}); // node_modules/@babylonjs/core/XR/webXRInput.js class WebXRInput { @@ -112012,6 +120873,11 @@ class WebXRInput { WebXRMotionControllerManager.ClearControllerCache(); } } +var init_webXRInput = __esm(() => { + init_observable(); + init_webXRInputSource(); + init_webXRMotionControllerManager(); +}); // node_modules/@babylonjs/core/XR/features/WebXRControllerPointerSelection.js class WebXRControllerPointerSelection extends WebXRAbstractFeature { @@ -112545,102 +121411,108 @@ class WebXRControllerPointerSelection extends WebXRAbstractFeature { return this.laserPointerDefaultColor; } } -WebXRControllerPointerSelection._IdCounter = 200; -WebXRControllerPointerSelection.Name = WebXRFeatureName.POINTER_SELECTION; -WebXRControllerPointerSelection.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRControllerPointerSelection.Name, (xrSessionManager, options) => { - return () => new WebXRControllerPointerSelection(xrSessionManager, options); -}, WebXRControllerPointerSelection.Version, true); +var init_WebXRControllerPointerSelection = __esm(() => { + init_webXRFeaturesManager(); + init_math_vector(); + init_math_color(); + init_math_axis(); + init_standardMaterial(); + init_cylinderBuilder(); + init_torusBuilder(); + init_ray(); + init_pickingInfo(); + init_WebXRAbstractFeature(); + init_utilityLayerRenderer(); + init_math_viewport(); + init_tools(); + WebXRControllerPointerSelection._IdCounter = 200; + WebXRControllerPointerSelection.Name = WebXRFeatureName.POINTER_SELECTION; + WebXRControllerPointerSelection.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRControllerPointerSelection.Name, (xrSessionManager, options) => { + return () => new WebXRControllerPointerSelection(xrSessionManager, options); + }, WebXRControllerPointerSelection.Version, true); +}); // node_modules/@babylonjs/core/Meshes/subMesh.project.js -SubMesh.prototype._projectOnTrianglesToRef = function(vector, positions, indices, step, checkStopper, ref) { - const proj = TmpVectors.Vector3[0]; - const tmp = TmpVectors.Vector3[1]; - let distance = Infinity; - for (let index = this.indexStart;index < this.indexStart + this.indexCount - (3 - step); index += step) { - const indexA = indices[index]; - const indexB = indices[index + 1]; - const indexC = indices[index + 2]; - if (checkStopper && indexC === 4294967295) { - index += 2; - continue; +var init_subMesh_project = __esm(() => { + init_math_vector(); + init_subMesh(); + SubMesh.prototype._projectOnTrianglesToRef = function(vector, positions, indices, step, checkStopper, ref) { + const proj = TmpVectors.Vector3[0]; + const tmp = TmpVectors.Vector3[1]; + let distance = Infinity; + for (let index = this.indexStart;index < this.indexStart + this.indexCount - (3 - step); index += step) { + const indexA = indices[index]; + const indexB = indices[index + 1]; + const indexC = indices[index + 2]; + if (checkStopper && indexC === 4294967295) { + index += 2; + continue; + } + const p0 = positions[indexA]; + const p1 = positions[indexB]; + const p2 = positions[indexC]; + if (!p0 || !p1 || !p2) { + continue; + } + const tmpDist = Vector3.ProjectOnTriangleToRef(vector, p0, p1, p2, tmp); + if (tmpDist < distance) { + proj.copyFrom(tmp); + distance = tmpDist; + } } - const p0 = positions[indexA]; - const p1 = positions[indexB]; - const p2 = positions[indexC]; - if (!p0 || !p1 || !p2) { - continue; + ref.copyFrom(proj); + return distance; + }; + SubMesh.prototype._projectOnUnIndexedTrianglesToRef = function(vector, positions, indices, ref) { + const proj = TmpVectors.Vector3[0]; + const tmp = TmpVectors.Vector3[1]; + let distance = Infinity; + for (let index = this.verticesStart;index < this.verticesStart + this.verticesCount; index += 3) { + const p0 = positions[index]; + const p1 = positions[index + 1]; + const p2 = positions[index + 2]; + const tmpDist = Vector3.ProjectOnTriangleToRef(vector, p0, p1, p2, tmp); + if (tmpDist < distance) { + proj.copyFrom(tmp); + distance = tmpDist; + } } - const tmpDist = Vector3.ProjectOnTriangleToRef(vector, p0, p1, p2, tmp); - if (tmpDist < distance) { - proj.copyFrom(tmp); - distance = tmpDist; + ref.copyFrom(proj); + return distance; + }; + SubMesh.prototype.projectToRef = function(vector, positions, indices, ref) { + const material13 = this.getMaterial(); + if (!material13) { + return -1; } - } - ref.copyFrom(proj); - return distance; -}; -SubMesh.prototype._projectOnUnIndexedTrianglesToRef = function(vector, positions, indices, ref) { - const proj = TmpVectors.Vector3[0]; - const tmp = TmpVectors.Vector3[1]; - let distance = Infinity; - for (let index = this.verticesStart;index < this.verticesStart + this.verticesCount; index += 3) { - const p0 = positions[index]; - const p1 = positions[index + 1]; - const p2 = positions[index + 2]; - const tmpDist = Vector3.ProjectOnTriangleToRef(vector, p0, p1, p2, tmp); - if (tmpDist < distance) { - proj.copyFrom(tmp); - distance = tmpDist; - } - } - ref.copyFrom(proj); - return distance; -}; -SubMesh.prototype.projectToRef = function(vector, positions, indices, ref) { - const material13 = this.getMaterial(); - if (!material13) { - return -1; - } - let step = 3; - let checkStopper = false; - switch (material13.fillMode) { - case 3: - case 5: - case 6: - case 8: + let step = 3; + let checkStopper = false; + switch (material13.fillMode) { + case 3: + case 5: + case 6: + case 8: + return -1; + case 7: + step = 1; + checkStopper = true; + break; + default: + break; + } + if (material13.fillMode === 4) { return -1; - case 7: - step = 1; - checkStopper = true; - break; - default: - break; - } - if (material13.fillMode === 4) { - return -1; - } else { - if (!indices.length && this._mesh._unIndexed) { - return this._projectOnUnIndexedTrianglesToRef(vector, positions, indices, ref); + } else { + if (!indices.length && this._mesh._unIndexed) { + return this._projectOnUnIndexedTrianglesToRef(vector, positions, indices, ref); + } + return this._projectOnTrianglesToRef(vector, positions, indices, step, checkStopper, ref); } - return this._projectOnTrianglesToRef(vector, positions, indices, step, checkStopper, ref); - } -}; + }; +}); // node_modules/@babylonjs/core/XR/features/WebXRNearInteraction.js -var ControllerOrbAnimationState; -(function(ControllerOrbAnimationState2) { - ControllerOrbAnimationState2[ControllerOrbAnimationState2["DEHYDRATED"] = 0] = "DEHYDRATED"; - ControllerOrbAnimationState2[ControllerOrbAnimationState2["HOVER"] = 1] = "HOVER"; - ControllerOrbAnimationState2[ControllerOrbAnimationState2["TOUCH"] = 2] = "TOUCH"; -})(ControllerOrbAnimationState || (ControllerOrbAnimationState = {})); -var WebXRNearControllerMode; -(function(WebXRNearControllerMode2) { - WebXRNearControllerMode2[WebXRNearControllerMode2["DISABLED"] = 0] = "DISABLED"; - WebXRNearControllerMode2[WebXRNearControllerMode2["CENTERED_ON_CONTROLLER"] = 1] = "CENTERED_ON_CONTROLLER"; - WebXRNearControllerMode2[WebXRNearControllerMode2["CENTERED_IN_FRONT"] = 2] = "CENTERED_IN_FRONT"; -})(WebXRNearControllerMode || (WebXRNearControllerMode = {})); - class WebXRNearInteraction extends WebXRAbstractFeature { constructor(_xrSessionManager, _options) { super(_xrSessionManager); @@ -113232,12 +122104,39 @@ class WebXRNearInteraction extends WebXRAbstractFeature { return pi; } } -WebXRNearInteraction._IdCounter = 200; -WebXRNearInteraction.Name = WebXRFeatureName.NEAR_INTERACTION; -WebXRNearInteraction.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRNearInteraction.Name, (xrSessionManager, options) => { - return () => new WebXRNearInteraction(xrSessionManager, options); -}, WebXRNearInteraction.Version, true); +var ControllerOrbAnimationState, WebXRNearControllerMode; +var init_WebXRNearInteraction = __esm(() => { + init_webXRFeaturesManager(); + init_sphereBuilder(); + init_math_vector(); + init_ray(); + init_pickingInfo(); + init_WebXRAbstractFeature(); + init_utilityLayerRenderer(); + init_boundingSphere(); + init_standardMaterial(); + init_math_color(); + init_nodeMaterial(); + init_animation(); + init_easing(); + init_subMesh_project(); + (function(ControllerOrbAnimationState2) { + ControllerOrbAnimationState2[ControllerOrbAnimationState2["DEHYDRATED"] = 0] = "DEHYDRATED"; + ControllerOrbAnimationState2[ControllerOrbAnimationState2["HOVER"] = 1] = "HOVER"; + ControllerOrbAnimationState2[ControllerOrbAnimationState2["TOUCH"] = 2] = "TOUCH"; + })(ControllerOrbAnimationState || (ControllerOrbAnimationState = {})); + (function(WebXRNearControllerMode2) { + WebXRNearControllerMode2[WebXRNearControllerMode2["DISABLED"] = 0] = "DISABLED"; + WebXRNearControllerMode2[WebXRNearControllerMode2["CENTERED_ON_CONTROLLER"] = 1] = "CENTERED_ON_CONTROLLER"; + WebXRNearControllerMode2[WebXRNearControllerMode2["CENTERED_IN_FRONT"] = 2] = "CENTERED_IN_FRONT"; + })(WebXRNearControllerMode || (WebXRNearControllerMode = {})); + WebXRNearInteraction._IdCounter = 200; + WebXRNearInteraction.Name = WebXRFeatureName.NEAR_INTERACTION; + WebXRNearInteraction.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRNearInteraction.Name, (xrSessionManager, options) => { + return () => new WebXRNearInteraction(xrSessionManager, options); + }, WebXRNearInteraction.Version, true); +}); // node_modules/@babylonjs/core/XR/webXREnterExitUI.js class WebXREnterExitUIButton { @@ -113249,6 +122148,10 @@ class WebXREnterExitUIButton { update(activeButton) { } } + +class WebXREnterExitUIOptions { +} + class WebXREnterExitUI { constructor(_scene, options) { this._scene = _scene; @@ -113367,6 +122270,11 @@ class WebXREnterExitUI { this.activeButtonChangedObservable.notifyObservers(this._activeButton); } } +var init_webXREnterExitUI = __esm(() => { + init_observable(); + init_webXRTypes(); + init_tools(); +}); // node_modules/@babylonjs/core/Misc/timer.js function setAndStartTimer(options) { @@ -113396,12 +122304,6 @@ function setAndStartTimer(options) { }, options.observableParameters.mask, options.observableParameters.insertFirst, options.observableParameters.scope); return observer2; } -var TimerState; -(function(TimerState2) { - TimerState2[TimerState2["INIT"] = 0] = "INIT"; - TimerState2[TimerState2["STARTED"] = 1] = "STARTED"; - TimerState2[TimerState2["ENDED"] = 2] = "ENDED"; -})(TimerState || (TimerState = {})); class AdvancedTimer { constructor(options) { @@ -113489,6 +122391,15 @@ class AdvancedTimer { } } } +var TimerState; +var init_timer = __esm(() => { + init_observable(); + (function(TimerState2) { + TimerState2[TimerState2["INIT"] = 0] = "INIT"; + TimerState2[TimerState2["STARTED"] = 1] = "STARTED"; + TimerState2[TimerState2["ENDED"] = 2] = "ENDED"; + })(TimerState || (TimerState = {})); +}); // node_modules/@babylonjs/core/XR/features/WebXRControllerTeleportation.js class WebXRMotionControllerTeleportation extends WebXRAbstractFeature { @@ -113743,8 +122654,8 @@ class WebXRMotionControllerTeleportation extends WebXRAbstractFeature { this._options.pickBlockerMeshes.splice(index, 1); } } - removeFloorMeshByName(name147) { - const mesh47 = this._xrSessionManager.scene.getMeshByName(name147); + removeFloorMeshByName(name148) { + const mesh47 = this._xrSessionManager.scene.getMeshByName(name148); if (mesh47) { this.removeFloorMesh(mesh47); } @@ -114054,13 +122965,38 @@ class WebXRMotionControllerTeleportation extends WebXRAbstractFeature { } } } -WebXRMotionControllerTeleportation.Name = WebXRFeatureName.TELEPORTATION; -WebXRMotionControllerTeleportation.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRMotionControllerTeleportation.Name, (xrSessionManager, options) => { - return () => new WebXRMotionControllerTeleportation(xrSessionManager, options); -}, WebXRMotionControllerTeleportation.Version, true); +var init_WebXRControllerTeleportation = __esm(() => { + init_webXRFeaturesManager(); + init_observable(); + init_webXRControllerComponent(); + init_math_vector(); + init_ray(); + init_dynamicTexture(); + init_cylinderBuilder(); + init_easing(); + init_animation(); + init_math_axis(); + init_standardMaterial(); + init_groundBuilder(); + init_torusBuilder(); + init_math_path(); + init_linesBuilder(); + init_WebXRAbstractFeature(); + init_math_color(); + init_utilityLayerRenderer(); + init_pointerEvents(); + init_timer(); + WebXRMotionControllerTeleportation.Name = WebXRFeatureName.TELEPORTATION; + WebXRMotionControllerTeleportation.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRMotionControllerTeleportation.Name, (xrSessionManager, options) => { + return () => new WebXRMotionControllerTeleportation(xrSessionManager, options); + }, WebXRMotionControllerTeleportation.Version, true); +}); // node_modules/@babylonjs/core/XR/webXRDefaultExperience.js +class WebXRDefaultExperienceOptions { +} + class WebXRDefaultExperience { constructor() { } @@ -114128,121 +123064,142 @@ class WebXRDefaultExperience { } } } +var init_webXRDefaultExperience = __esm(() => { + init_webXRExperienceHelper(); + init_webXRInput(); + init_WebXRControllerPointerSelection(); + init_WebXRNearInteraction(); + init_webXREnterExitUI(); + init_WebXRControllerTeleportation(); + init_logger(); +}); // node_modules/@babylonjs/core/Helpers/sceneHelpers.js -Scene.prototype.createDefaultLight = function(replace = false) { - if (replace) { - if (this.lights) { - for (let i = 0;i < this.lights.length; i++) { - this.lights[i].dispose(); +var _forceSceneHelpersToBundle; +var init_sceneHelpers = __esm(() => { + init_logger(); + init_scene(); + init_math_vector(); + init_texture(); + init_standardMaterial(); + init_pbrMaterial(); + init_hemisphericLight(); + init_environmentHelper(); + init_freeCamera(); + init_arcRotateCamera(); + init_vrExperienceHelper(); + init_ddsTextureLoader(); + init_envTextureLoader(); + init_ktxTextureLoader(); + init_boxBuilder(); + init_webXRDefaultExperience(); + _forceSceneHelpersToBundle = true; + Scene.prototype.createDefaultLight = function(replace = false) { + if (replace) { + if (this.lights) { + for (let i = 0;i < this.lights.length; i++) { + this.lights[i].dispose(); + } + } + } + if (this.lights.length === 0) { + new HemisphericLight("default light", Vector3.Up(), this); + } + }; + Scene.prototype.createDefaultCamera = function(createArcRotateCamera = false, replace = false, attachCameraControls = false) { + if (replace) { + if (this.activeCamera) { + this.activeCamera.dispose(); + this.activeCamera = null; } } - } - if (this.lights.length === 0) { - new HemisphericLight("default light", Vector3.Up(), this); - } -}; -Scene.prototype.createDefaultCamera = function(createArcRotateCamera = false, replace = false, attachCameraControls = false) { - if (replace) { - if (this.activeCamera) { - this.activeCamera.dispose(); - this.activeCamera = null; + if (!this.activeCamera) { + const worldExtends = this.getWorldExtends((mesh47) => mesh47.isVisible && mesh47.isEnabled()); + const worldSize = worldExtends.max.subtract(worldExtends.min); + const worldCenter = worldExtends.min.add(worldSize.scale(0.5)); + let camera26; + let radius = worldSize.length() * 1.5; + if (!isFinite(radius)) { + radius = 1; + worldCenter.copyFromFloats(0, 0, 0); + } + if (createArcRotateCamera) { + const arcRotateCamera7 = new ArcRotateCamera("default camera", -(Math.PI / 2), Math.PI / 2, radius, worldCenter, this); + arcRotateCamera7.lowerRadiusLimit = radius * 0.01; + arcRotateCamera7.wheelPrecision = 100 / radius; + camera26 = arcRotateCamera7; + } else { + const freeCamera10 = new FreeCamera("default camera", new Vector3(worldCenter.x, worldCenter.y, -radius), this); + freeCamera10.setTarget(worldCenter); + camera26 = freeCamera10; + } + camera26.minZ = radius * 0.01; + camera26.maxZ = radius * 1000; + camera26.speed = radius * 0.2; + this.activeCamera = camera26; + if (attachCameraControls) { + camera26.attachControl(); + } } - } - if (!this.activeCamera) { - const worldExtends = this.getWorldExtends((mesh47) => mesh47.isVisible && mesh47.isEnabled()); - const worldSize = worldExtends.max.subtract(worldExtends.min); - const worldCenter = worldExtends.min.add(worldSize.scale(0.5)); - let camera26; - let radius = worldSize.length() * 1.5; - if (!isFinite(radius)) { - radius = 1; - worldCenter.copyFromFloats(0, 0, 0); + }; + Scene.prototype.createDefaultCameraOrLight = function(createArcRotateCamera = false, replace = false, attachCameraControls = false) { + this.createDefaultLight(replace); + this.createDefaultCamera(createArcRotateCamera, replace, attachCameraControls); + }; + Scene.prototype.createDefaultSkybox = function(environmentTexture, pbr = false, scale = 1000, blur = 0, setGlobalEnvTexture = true) { + if (!environmentTexture) { + Logger.Warn("Can not create default skybox without environment texture."); + return null; } - if (createArcRotateCamera) { - const arcRotateCamera7 = new ArcRotateCamera("default camera", -(Math.PI / 2), Math.PI / 2, radius, worldCenter, this); - arcRotateCamera7.lowerRadiusLimit = radius * 0.01; - arcRotateCamera7.wheelPrecision = 100 / radius; - camera26 = arcRotateCamera7; - } else { - const freeCamera10 = new FreeCamera("default camera", new Vector3(worldCenter.x, worldCenter.y, -radius), this); - freeCamera10.setTarget(worldCenter); - camera26 = freeCamera10; + if (setGlobalEnvTexture) { + if (environmentTexture) { + this.environmentTexture = environmentTexture; + } } - camera26.minZ = radius * 0.01; - camera26.maxZ = radius * 1000; - camera26.speed = radius * 0.2; - this.activeCamera = camera26; - if (attachCameraControls) { - camera26.attachControl(); + const hdrSkybox = CreateBox("hdrSkyBox", { size: scale }, this); + if (pbr) { + const hdrSkyboxMaterial = new PBRMaterial("skyBox", this); + hdrSkyboxMaterial.backFaceCulling = false; + hdrSkyboxMaterial.reflectionTexture = environmentTexture.clone(); + if (hdrSkyboxMaterial.reflectionTexture) { + hdrSkyboxMaterial.reflectionTexture.coordinatesMode = Texture.SKYBOX_MODE; + } + hdrSkyboxMaterial.microSurface = 1 - blur; + hdrSkyboxMaterial.disableLighting = true; + hdrSkyboxMaterial.twoSidedLighting = true; + hdrSkybox.material = hdrSkyboxMaterial; + } else { + const skyboxMaterial = new StandardMaterial("skyBox", this); + skyboxMaterial.backFaceCulling = false; + skyboxMaterial.reflectionTexture = environmentTexture.clone(); + if (skyboxMaterial.reflectionTexture) { + skyboxMaterial.reflectionTexture.coordinatesMode = Texture.SKYBOX_MODE; + } + skyboxMaterial.disableLighting = true; + hdrSkybox.material = skyboxMaterial; + } + hdrSkybox.isPickable = false; + hdrSkybox.infiniteDistance = true; + hdrSkybox.ignoreCameraMaxZ = true; + return hdrSkybox; + }; + Scene.prototype.createDefaultEnvironment = function(options) { + if (EnvironmentHelper) { + return new EnvironmentHelper(options, this); } - } -}; -Scene.prototype.createDefaultCameraOrLight = function(createArcRotateCamera = false, replace = false, attachCameraControls = false) { - this.createDefaultLight(replace); - this.createDefaultCamera(createArcRotateCamera, replace, attachCameraControls); -}; -Scene.prototype.createDefaultSkybox = function(environmentTexture, pbr = false, scale = 1000, blur = 0, setGlobalEnvTexture = true) { - if (!environmentTexture) { - Logger.Warn("Can not create default skybox without environment texture."); return null; - } - if (setGlobalEnvTexture) { - if (environmentTexture) { - this.environmentTexture = environmentTexture; - } - } - const hdrSkybox = CreateBox("hdrSkyBox", { size: scale }, this); - if (pbr) { - const hdrSkyboxMaterial = new PBRMaterial("skyBox", this); - hdrSkyboxMaterial.backFaceCulling = false; - hdrSkyboxMaterial.reflectionTexture = environmentTexture.clone(); - if (hdrSkyboxMaterial.reflectionTexture) { - hdrSkyboxMaterial.reflectionTexture.coordinatesMode = Texture.SKYBOX_MODE; - } - hdrSkyboxMaterial.microSurface = 1 - blur; - hdrSkyboxMaterial.disableLighting = true; - hdrSkyboxMaterial.twoSidedLighting = true; - hdrSkybox.material = hdrSkyboxMaterial; - } else { - const skyboxMaterial = new StandardMaterial("skyBox", this); - skyboxMaterial.backFaceCulling = false; - skyboxMaterial.reflectionTexture = environmentTexture.clone(); - if (skyboxMaterial.reflectionTexture) { - skyboxMaterial.reflectionTexture.coordinatesMode = Texture.SKYBOX_MODE; - } - skyboxMaterial.disableLighting = true; - hdrSkybox.material = skyboxMaterial; - } - hdrSkybox.isPickable = false; - hdrSkybox.infiniteDistance = true; - hdrSkybox.ignoreCameraMaxZ = true; - return hdrSkybox; -}; -Scene.prototype.createDefaultEnvironment = function(options) { - if (EnvironmentHelper) { - return new EnvironmentHelper(options, this); - } - return null; -}; -Scene.prototype.createDefaultVRExperience = function(webVROptions = {}) { - return new VRExperienceHelper(this, webVROptions); -}; -Scene.prototype.createDefaultXRExperienceAsync = function(options = {}) { - return WebXRDefaultExperience.CreateAsync(this, options).then((helper) => { - return helper; - }); -}; -// node_modules/@babylonjs/core/Materials/Textures/videoTexture.js -var removeSource = function(video) { - while (video.firstChild) { - video.removeChild(video.firstChild); - } - video.srcObject = null; - video.src = ""; - video.removeAttribute("src"); -}; + }; + Scene.prototype.createDefaultVRExperience = function(webVROptions = {}) { + return new VRExperienceHelper(this, webVROptions); + }; + Scene.prototype.createDefaultXRExperienceAsync = function(options = {}) { + return WebXRDefaultExperience.CreateAsync(this, options).then((helper) => { + return helper; + }); + }; +}); +// node_modules/@babylonjs/core/Materials/Textures/videoTexture.js class VideoTexture extends Texture { get onUserActionRequestedObservable() { if (!this._onUserActionRequestedObservable) { @@ -114278,7 +123235,7 @@ class VideoTexture extends Texture { this._processError(reason); }); } - constructor(name147, src, scene22, generateMipMaps = false, invertY = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, settings = {}, onError, format = 5) { + constructor(name148, src, scene22, generateMipMaps = false, invertY = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, settings = {}, onError, format = 5) { var _a, _b; super(null, scene22, !generateMipMaps, invertY); this._onUserActionRequestedObservable = null; @@ -114371,7 +123328,7 @@ class VideoTexture extends Texture { this._initialSamplingMode = samplingMode; this.autoUpdateTexture = this._settings.autoUpdateTexture; this._currentSrc = src; - this.name = name147 || this._getName(src); + this.name = name148 || this._getName(src); this.video = this._getVideo(src); this._externalTexture = (_b = (_a = this._engine) === null || _a === undefined ? undefined : _a.createExternalTexture(this.video)) !== null && _b !== undefined ? _b : null; if (!this._settings.independentVideoSource) { @@ -114558,19 +123515,39 @@ class VideoTexture extends Texture { }); } } -__decorate2([ - serialize("settings") -], VideoTexture.prototype, "_settings", undefined); -__decorate2([ - serialize("src") -], VideoTexture.prototype, "_currentSrc", undefined); -__decorate2([ - serialize() -], VideoTexture.prototype, "isVideo", undefined); -Texture._CreateVideoTexture = (name147, src, scene22, generateMipMaps = false, invertY = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, settings = {}, onError, format = 5) => { - return new VideoTexture(name147, src, scene22, generateMipMaps, invertY, samplingMode, settings, onError, format); -}; -RegisterClass("BABYLON.VideoTexture", VideoTexture); +var removeSource; +var init_videoTexture = __esm(() => { + init_tslib_es62(); + init_observable(); + init_tools(); + init_logger(); + init_texture(); + init_engine_videoTexture(); + init_engine_dynamicTexture(); + init_decorators(); + init_typeStore(); + removeSource = function(video) { + while (video.firstChild) { + video.removeChild(video.firstChild); + } + video.srcObject = null; + video.src = ""; + video.removeAttribute("src"); + }; + __decorate2([ + serialize("settings") + ], VideoTexture.prototype, "_settings", undefined); + __decorate2([ + serialize("src") + ], VideoTexture.prototype, "_currentSrc", undefined); + __decorate2([ + serialize() + ], VideoTexture.prototype, "isVideo", undefined); + Texture._CreateVideoTexture = (name148, src, scene22, generateMipMaps = false, invertY = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, settings = {}, onError, format = 5) => { + return new VideoTexture(name148, src, scene22, generateMipMaps, invertY, samplingMode, settings, onError, format); + }; + RegisterClass("BABYLON.VideoTexture", VideoTexture); +}); // node_modules/@babylonjs/core/Helpers/videoDome.js class VideoDome extends TextureDome { @@ -114603,12 +123580,497 @@ class VideoDome extends TextureDome { super.dispose(doNotRecurse, disposeMaterialAndTextures); } } -VideoDome.MODE_MONOSCOPIC = TextureDome.MODE_MONOSCOPIC; -VideoDome.MODE_TOPBOTTOM = TextureDome.MODE_TOPBOTTOM; -VideoDome.MODE_SIDEBYSIDE = TextureDome.MODE_SIDEBYSIDE; +var init_videoDome = __esm(() => { + init_texture(); + init_videoTexture(); + init_textureDome(); + init_pointerEvents(); + VideoDome.MODE_MONOSCOPIC = TextureDome.MODE_MONOSCOPIC; + VideoDome.MODE_TOPBOTTOM = TextureDome.MODE_TOPBOTTOM; + VideoDome.MODE_SIDEBYSIDE = TextureDome.MODE_SIDEBYSIDE; +}); + +// node_modules/@babylonjs/core/Helpers/index.js +var init_Helpers = __esm(() => { + init_environmentHelper(); + init_photoDome(); + init_sceneHelpers(); + init_videoDome(); +}); + +// node_modules/@babylonjs/core/Instrumentation/engineInstrumentation.js +class EngineInstrumentation { + get gpuFrameTimeCounter() { + return this.engine.getGPUFrameTimeCounter(); + } + get captureGPUFrameTime() { + return this._captureGPUFrameTime; + } + set captureGPUFrameTime(value) { + if (value === this._captureGPUFrameTime) { + return; + } + this._captureGPUFrameTime = value; + this.engine.captureGPUFrameTime(value); + } + get shaderCompilationTimeCounter() { + return this._shaderCompilationTime; + } + get captureShaderCompilationTime() { + return this._captureShaderCompilationTime; + } + set captureShaderCompilationTime(value) { + if (value === this._captureShaderCompilationTime) { + return; + } + this._captureShaderCompilationTime = value; + if (value) { + this._onBeforeShaderCompilationObserver = this.engine.onBeforeShaderCompilationObservable.add(() => { + this._shaderCompilationTime.fetchNewFrame(); + this._shaderCompilationTime.beginMonitoring(); + }); + this._onAfterShaderCompilationObserver = this.engine.onAfterShaderCompilationObservable.add(() => { + this._shaderCompilationTime.endMonitoring(); + }); + } else { + this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver); + this._onBeforeShaderCompilationObserver = null; + this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver); + this._onAfterShaderCompilationObserver = null; + } + } + constructor(engine32) { + this.engine = engine32; + this._captureGPUFrameTime = false; + this._captureShaderCompilationTime = false; + this._shaderCompilationTime = new PerfCounter; + this._onBeginFrameObserver = null; + this._onEndFrameObserver = null; + this._onBeforeShaderCompilationObserver = null; + this._onAfterShaderCompilationObserver = null; + } + dispose() { + this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver); + this._onBeginFrameObserver = null; + this.engine.onEndFrameObservable.remove(this._onEndFrameObserver); + this._onEndFrameObserver = null; + this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver); + this._onBeforeShaderCompilationObserver = null; + this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver); + this._onAfterShaderCompilationObserver = null; + this.engine = null; + } +} +var init_engineInstrumentation = __esm(() => { + init_perfCounter(); +}); + +// node_modules/@babylonjs/core/Instrumentation/sceneInstrumentation.js +class SceneInstrumentation { + get activeMeshesEvaluationTimeCounter() { + return this._activeMeshesEvaluationTime; + } + get captureActiveMeshesEvaluationTime() { + return this._captureActiveMeshesEvaluationTime; + } + set captureActiveMeshesEvaluationTime(value) { + if (value === this._captureActiveMeshesEvaluationTime) { + return; + } + this._captureActiveMeshesEvaluationTime = value; + if (value) { + this._onBeforeActiveMeshesEvaluationObserver = this.scene.onBeforeActiveMeshesEvaluationObservable.add(() => { + Tools.StartPerformanceCounter("Active meshes evaluation"); + this._activeMeshesEvaluationTime.beginMonitoring(); + }); + this._onAfterActiveMeshesEvaluationObserver = this.scene.onAfterActiveMeshesEvaluationObservable.add(() => { + Tools.EndPerformanceCounter("Active meshes evaluation"); + this._activeMeshesEvaluationTime.endMonitoring(false); + }); + } else { + this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver); + this._onBeforeActiveMeshesEvaluationObserver = null; + this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver); + this._onAfterActiveMeshesEvaluationObserver = null; + } + } + get renderTargetsRenderTimeCounter() { + return this._renderTargetsRenderTime; + } + get captureRenderTargetsRenderTime() { + return this._captureRenderTargetsRenderTime; + } + set captureRenderTargetsRenderTime(value) { + if (value === this._captureRenderTargetsRenderTime) { + return; + } + this._captureRenderTargetsRenderTime = value; + if (value) { + this._onBeforeRenderTargetsRenderObserver = this.scene.onBeforeRenderTargetsRenderObservable.add(() => { + Tools.StartPerformanceCounter("Render targets rendering"); + this._renderTargetsRenderTime.beginMonitoring(); + }); + this._onAfterRenderTargetsRenderObserver = this.scene.onAfterRenderTargetsRenderObservable.add(() => { + Tools.EndPerformanceCounter("Render targets rendering"); + this._renderTargetsRenderTime.endMonitoring(false); + }); + } else { + this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver); + this._onBeforeRenderTargetsRenderObserver = null; + this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver); + this._onAfterRenderTargetsRenderObserver = null; + } + } + get particlesRenderTimeCounter() { + return this._particlesRenderTime; + } + get captureParticlesRenderTime() { + return this._captureParticlesRenderTime; + } + set captureParticlesRenderTime(value) { + if (value === this._captureParticlesRenderTime) { + return; + } + this._captureParticlesRenderTime = value; + if (value) { + this._onBeforeParticlesRenderingObserver = this.scene.onBeforeParticlesRenderingObservable.add(() => { + Tools.StartPerformanceCounter("Particles"); + this._particlesRenderTime.beginMonitoring(); + }); + this._onAfterParticlesRenderingObserver = this.scene.onAfterParticlesRenderingObservable.add(() => { + Tools.EndPerformanceCounter("Particles"); + this._particlesRenderTime.endMonitoring(false); + }); + } else { + this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver); + this._onBeforeParticlesRenderingObserver = null; + this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver); + this._onAfterParticlesRenderingObserver = null; + } + } + get spritesRenderTimeCounter() { + return this._spritesRenderTime; + } + get captureSpritesRenderTime() { + return this._captureSpritesRenderTime; + } + set captureSpritesRenderTime(value) { + if (value === this._captureSpritesRenderTime) { + return; + } + this._captureSpritesRenderTime = value; + if (!this.scene.spriteManagers) { + return; + } + if (value) { + this._onBeforeSpritesRenderingObserver = this.scene.onBeforeSpritesRenderingObservable.add(() => { + Tools.StartPerformanceCounter("Sprites"); + this._spritesRenderTime.beginMonitoring(); + }); + this._onAfterSpritesRenderingObserver = this.scene.onAfterSpritesRenderingObservable.add(() => { + Tools.EndPerformanceCounter("Sprites"); + this._spritesRenderTime.endMonitoring(false); + }); + } else { + this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver); + this._onBeforeSpritesRenderingObserver = null; + this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver); + this._onAfterSpritesRenderingObserver = null; + } + } + get physicsTimeCounter() { + return this._physicsTime; + } + get capturePhysicsTime() { + return this._capturePhysicsTime; + } + set capturePhysicsTime(value) { + if (value === this._capturePhysicsTime) { + return; + } + if (!this.scene.onBeforePhysicsObservable) { + return; + } + this._capturePhysicsTime = value; + if (value) { + this._onBeforePhysicsObserver = this.scene.onBeforePhysicsObservable.add(() => { + Tools.StartPerformanceCounter("Physics"); + this._physicsTime.beginMonitoring(); + }); + this._onAfterPhysicsObserver = this.scene.onAfterPhysicsObservable.add(() => { + Tools.EndPerformanceCounter("Physics"); + this._physicsTime.endMonitoring(); + }); + } else { + this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver); + this._onBeforePhysicsObserver = null; + this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver); + this._onAfterPhysicsObserver = null; + } + } + get animationsTimeCounter() { + return this._animationsTime; + } + get captureAnimationsTime() { + return this._captureAnimationsTime; + } + set captureAnimationsTime(value) { + if (value === this._captureAnimationsTime) { + return; + } + this._captureAnimationsTime = value; + if (value) { + this._onAfterAnimationsObserver = this.scene.onAfterAnimationsObservable.add(() => { + this._animationsTime.endMonitoring(); + }); + } else { + this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver); + this._onAfterAnimationsObserver = null; + } + } + get frameTimeCounter() { + return this._frameTime; + } + get captureFrameTime() { + return this._captureFrameTime; + } + set captureFrameTime(value) { + this._captureFrameTime = value; + } + get interFrameTimeCounter() { + return this._interFrameTime; + } + get captureInterFrameTime() { + return this._captureInterFrameTime; + } + set captureInterFrameTime(value) { + this._captureInterFrameTime = value; + } + get renderTimeCounter() { + return this._renderTime; + } + get captureRenderTime() { + return this._captureRenderTime; + } + set captureRenderTime(value) { + if (value === this._captureRenderTime) { + return; + } + this._captureRenderTime = value; + if (value) { + this._onBeforeDrawPhaseObserver = this.scene.onBeforeDrawPhaseObservable.add(() => { + this._renderTime.beginMonitoring(); + Tools.StartPerformanceCounter("Main render"); + }); + this._onAfterDrawPhaseObserver = this.scene.onAfterDrawPhaseObservable.add(() => { + this._renderTime.endMonitoring(false); + Tools.EndPerformanceCounter("Main render"); + }); + } else { + this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver); + this._onBeforeDrawPhaseObserver = null; + this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver); + this._onAfterDrawPhaseObserver = null; + } + } + get cameraRenderTimeCounter() { + return this._cameraRenderTime; + } + get captureCameraRenderTime() { + return this._captureCameraRenderTime; + } + set captureCameraRenderTime(value) { + if (value === this._captureCameraRenderTime) { + return; + } + this._captureCameraRenderTime = value; + if (value) { + this._onBeforeCameraRenderObserver = this.scene.onBeforeCameraRenderObservable.add((camera26) => { + this._cameraRenderTime.beginMonitoring(); + Tools.StartPerformanceCounter(`Rendering camera ${camera26.name}`); + }); + this._onAfterCameraRenderObserver = this.scene.onAfterCameraRenderObservable.add((camera26) => { + this._cameraRenderTime.endMonitoring(false); + Tools.EndPerformanceCounter(`Rendering camera ${camera26.name}`); + }); + } else { + this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver); + this._onBeforeCameraRenderObserver = null; + this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver); + this._onAfterCameraRenderObserver = null; + } + } + get drawCallsCounter() { + return this.scene.getEngine()._drawCalls; + } + constructor(scene22) { + this.scene = scene22; + this._captureActiveMeshesEvaluationTime = false; + this._activeMeshesEvaluationTime = new PerfCounter; + this._captureRenderTargetsRenderTime = false; + this._renderTargetsRenderTime = new PerfCounter; + this._captureFrameTime = false; + this._frameTime = new PerfCounter; + this._captureRenderTime = false; + this._renderTime = new PerfCounter; + this._captureInterFrameTime = false; + this._interFrameTime = new PerfCounter; + this._captureParticlesRenderTime = false; + this._particlesRenderTime = new PerfCounter; + this._captureSpritesRenderTime = false; + this._spritesRenderTime = new PerfCounter; + this._capturePhysicsTime = false; + this._physicsTime = new PerfCounter; + this._captureAnimationsTime = false; + this._animationsTime = new PerfCounter; + this._captureCameraRenderTime = false; + this._cameraRenderTime = new PerfCounter; + this._onBeforeActiveMeshesEvaluationObserver = null; + this._onAfterActiveMeshesEvaluationObserver = null; + this._onBeforeRenderTargetsRenderObserver = null; + this._onAfterRenderTargetsRenderObserver = null; + this._onAfterRenderObserver = null; + this._onBeforeDrawPhaseObserver = null; + this._onAfterDrawPhaseObserver = null; + this._onBeforeAnimationsObserver = null; + this._onBeforeParticlesRenderingObserver = null; + this._onAfterParticlesRenderingObserver = null; + this._onBeforeSpritesRenderingObserver = null; + this._onAfterSpritesRenderingObserver = null; + this._onBeforePhysicsObserver = null; + this._onAfterPhysicsObserver = null; + this._onAfterAnimationsObserver = null; + this._onBeforeCameraRenderObserver = null; + this._onAfterCameraRenderObserver = null; + this._onBeforeAnimationsObserver = scene22.onBeforeAnimationsObservable.add(() => { + if (this._captureActiveMeshesEvaluationTime) { + this._activeMeshesEvaluationTime.fetchNewFrame(); + } + if (this._captureRenderTargetsRenderTime) { + this._renderTargetsRenderTime.fetchNewFrame(); + } + if (this._captureFrameTime) { + Tools.StartPerformanceCounter("Scene rendering"); + this._frameTime.beginMonitoring(); + } + if (this._captureInterFrameTime) { + this._interFrameTime.endMonitoring(); + } + if (this._captureParticlesRenderTime) { + this._particlesRenderTime.fetchNewFrame(); + } + if (this._captureSpritesRenderTime) { + this._spritesRenderTime.fetchNewFrame(); + } + if (this._captureAnimationsTime) { + this._animationsTime.beginMonitoring(); + } + if (this._captureRenderTime) { + this._renderTime.fetchNewFrame(); + } + if (this._captureCameraRenderTime) { + this._cameraRenderTime.fetchNewFrame(); + } + this.scene.getEngine()._drawCalls.fetchNewFrame(); + }); + this._onAfterRenderObserver = scene22.onAfterRenderObservable.add(() => { + if (this._captureFrameTime) { + Tools.EndPerformanceCounter("Scene rendering"); + this._frameTime.endMonitoring(); + } + if (this._captureRenderTime) { + this._renderTime.endMonitoring(false); + } + if (this._captureInterFrameTime) { + this._interFrameTime.beginMonitoring(); + } + if (this._captureActiveMeshesEvaluationTime) { + this._activeMeshesEvaluationTime.endFrame(); + } + if (this._captureRenderTargetsRenderTime) { + this._renderTargetsRenderTime.endFrame(); + } + if (this._captureParticlesRenderTime) { + this._particlesRenderTime.endFrame(); + } + if (this._captureSpritesRenderTime) { + this._spritesRenderTime.endFrame(); + } + if (this._captureRenderTime) { + this._renderTime.endFrame(); + } + if (this._captureCameraRenderTime) { + this._cameraRenderTime.endFrame(); + } + }); + } + dispose() { + this.scene.onAfterRenderObservable.remove(this._onAfterRenderObserver); + this._onAfterRenderObserver = null; + this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver); + this._onBeforeActiveMeshesEvaluationObserver = null; + this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver); + this._onAfterActiveMeshesEvaluationObserver = null; + this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver); + this._onBeforeRenderTargetsRenderObserver = null; + this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver); + this._onAfterRenderTargetsRenderObserver = null; + this.scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver); + this._onBeforeAnimationsObserver = null; + this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver); + this._onBeforeParticlesRenderingObserver = null; + this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver); + this._onAfterParticlesRenderingObserver = null; + if (this._onBeforeSpritesRenderingObserver) { + this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver); + this._onBeforeSpritesRenderingObserver = null; + } + if (this._onAfterSpritesRenderingObserver) { + this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver); + this._onAfterSpritesRenderingObserver = null; + } + this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver); + this._onBeforeDrawPhaseObserver = null; + this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver); + this._onAfterDrawPhaseObserver = null; + if (this._onBeforePhysicsObserver) { + this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver); + this._onBeforePhysicsObserver = null; + } + if (this._onAfterPhysicsObserver) { + this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver); + this._onAfterPhysicsObserver = null; + } + this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver); + this._onAfterAnimationsObserver = null; + this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver); + this._onBeforeCameraRenderObserver = null; + this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver); + this._onAfterCameraRenderObserver = null; + this.scene = null; + } +} +var init_sceneInstrumentation = __esm(() => { + init_tools(); + init_perfCounter(); +}); + +// node_modules/@babylonjs/core/Instrumentation/index.js +var init_Instrumentation = __esm(() => { + init_engineInstrumentation(); + init_sceneInstrumentation(); + init_timeToken(); +}); + // node_modules/@babylonjs/core/Shaders/glowMapGeneration.fragment.js -var name147 = "glowMapGenerationPixelShader"; -var shader147 = `#if defined(DIFFUSE_ISLINEAR) || defined(EMISSIVE_ISLINEAR) +var name148, shader147; +var init_glowMapGeneration_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + init_clipPlaneFragmentDeclaration(); + init_clipPlaneFragment(); + name148 = "glowMapGenerationPixelShader"; + shader147 = `#if defined(DIFFUSE_ISLINEAR) || defined(EMISSIVE_ISLINEAR) #include #endif #ifdef DIFFUSE @@ -114671,11 +124133,27 @@ gl_FragColor=finalColor*glowIntensity; gl_FragColor.a=glowColor.a; #endif }`; -ShaderStore.ShadersStore[name147] = shader147; + ShaderStore.ShadersStore[name148] = shader147; +}); // node_modules/@babylonjs/core/Shaders/glowMapGeneration.vertex.js -var name148 = "glowMapGenerationVertexShader"; -var shader148 = `attribute vec3 position; +var name149, shader148; +var init_glowMapGeneration_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_morphTargetsVertexGlobalDeclaration(); + init_morphTargetsVertexDeclaration(); + init_clipPlaneVertexDeclaration(); + init_instancesDeclaration(); + init_morphTargetsVertexGlobal(); + init_morphTargetsVertex(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + name149 = "glowMapGenerationVertexShader"; + shader148 = `attribute vec3 position; #include #include #include @@ -114747,7 +124225,8 @@ vColor=color; #endif #include }`; -ShaderStore.ShadersStore[name148] = shader148; + ShaderStore.ShadersStore[name149] = shader148; +}); // node_modules/@babylonjs/core/Layers/effectLayer.js class EffectLayer { @@ -114789,7 +124268,7 @@ class EffectLayer { setEffectIntensity(mesh47, intensity) { this._effectIntensity[mesh47.uniqueId] = intensity; } - constructor(name149, scene22) { + constructor(name150, scene22) { this._vertexBuffers = {}; this._maxSize = 0; this._mainTextureDesiredSize = { width: 0, height: 0 }; @@ -114809,7 +124288,7 @@ class EffectLayer { this.onAfterComposeObservable = new Observable; this.onSizeChangedObservable = new Observable; this._materialForRendering = {}; - this.name = name149; + this.name = name150; this._scene = scene22 || EngineStore.LastCreatedScene; EffectLayer._SceneComponentInitialization(this._scene); this._engine = this._scene.getEngine(); @@ -115310,50 +124789,49 @@ class EffectLayer { return effectLayerType.Parse(parsedEffectLayer, scene22, rootUrl); } } -EffectLayer._SceneComponentInitialization = (_) => { - throw _WarnImport("EffectLayerSceneComponent"); -}; -__decorate2([ - serialize() -], EffectLayer.prototype, "name", undefined); -__decorate2([ - serializeAsColor4() -], EffectLayer.prototype, "neutralColor", undefined); -__decorate2([ - serialize() -], EffectLayer.prototype, "isEnabled", undefined); -__decorate2([ - serializeAsCameraReference() -], EffectLayer.prototype, "camera", null); -__decorate2([ - serialize() -], EffectLayer.prototype, "renderingGroupId", null); -__decorate2([ - serialize() -], EffectLayer.prototype, "disableBoundingBoxesFromEffectLayer", undefined); -// node_modules/@babylonjs/core/Layers/effectLayerSceneComponent.js -AbstractScene.AddParser(SceneComponentConstants.NAME_EFFECTLAYER, (parsedData, scene22, container, rootUrl) => { - if (parsedData.effectLayers) { - if (!container.effectLayers) { - container.effectLayers = []; - } - for (let index = 0;index < parsedData.effectLayers.length; index++) { - const effectLayer2 = EffectLayer.Parse(parsedData.effectLayers[index], scene22, rootUrl); - container.effectLayers.push(effectLayer2); - } - } +var init_effectLayer = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_tools(); + init_observable(); + init_math_color(); + init_engine(); + init_engineStore(); + init_buffer(); + init_texture(); + init_renderTargetTexture(); + init_material(); + init_materialHelper(); + init_glowMapGeneration_fragment(); + init_glowMapGeneration_vertex(); + init_devTools(); + init_effectFallbacks(); + init_drawWrapper(); + init_clipPlaneMaterialHelper(); + EffectLayer._SceneComponentInitialization = (_) => { + throw _WarnImport("EffectLayerSceneComponent"); + }; + __decorate2([ + serialize() + ], EffectLayer.prototype, "name", undefined); + __decorate2([ + serializeAsColor4() + ], EffectLayer.prototype, "neutralColor", undefined); + __decorate2([ + serialize() + ], EffectLayer.prototype, "isEnabled", undefined); + __decorate2([ + serializeAsCameraReference() + ], EffectLayer.prototype, "camera", null); + __decorate2([ + serialize() + ], EffectLayer.prototype, "renderingGroupId", null); + __decorate2([ + serialize() + ], EffectLayer.prototype, "disableBoundingBoxesFromEffectLayer", undefined); }); -AbstractScene.prototype.removeEffectLayer = function(toRemove) { - const index = this.effectLayers.indexOf(toRemove); - if (index !== -1) { - this.effectLayers.splice(index, 1); - } - return index; -}; -AbstractScene.prototype.addEffectLayer = function(newEffectLayer) { - this.effectLayers.push(newEffectLayer); -}; +// node_modules/@babylonjs/core/Layers/effectLayerSceneComponent.js class EffectLayerSceneComponent { constructor(scene22) { this.name = SceneComponentConstants.NAME_EFFECTLAYER; @@ -115493,16 +124971,48 @@ class EffectLayerSceneComponent { } } } -EffectLayer._SceneComponentInitialization = (scene22) => { - let component = scene22._getComponent(SceneComponentConstants.NAME_EFFECTLAYER); - if (!component) { - component = new EffectLayerSceneComponent(scene22); - scene22._addComponent(component); - } -}; +var init_effectLayerSceneComponent = __esm(() => { + init_camera(); + init_sceneComponent(); + init_effectLayer(); + init_abstractScene(); + init_engineStore(); + AbstractScene.AddParser(SceneComponentConstants.NAME_EFFECTLAYER, (parsedData, scene22, container, rootUrl) => { + if (parsedData.effectLayers) { + if (!container.effectLayers) { + container.effectLayers = []; + } + for (let index = 0;index < parsedData.effectLayers.length; index++) { + const effectLayer2 = EffectLayer.Parse(parsedData.effectLayers[index], scene22, rootUrl); + container.effectLayers.push(effectLayer2); + } + } + }); + AbstractScene.prototype.removeEffectLayer = function(toRemove) { + const index = this.effectLayers.indexOf(toRemove); + if (index !== -1) { + this.effectLayers.splice(index, 1); + } + return index; + }; + AbstractScene.prototype.addEffectLayer = function(newEffectLayer) { + this.effectLayers.push(newEffectLayer); + }; + EffectLayer._SceneComponentInitialization = (scene22) => { + let component = scene22._getComponent(SceneComponentConstants.NAME_EFFECTLAYER); + if (!component) { + component = new EffectLayerSceneComponent(scene22); + scene22._addComponent(component); + } + }; +}); + // node_modules/@babylonjs/core/Shaders/glowMapMerge.fragment.js -var name149 = "glowMapMergePixelShader"; -var shader149 = `varying vec2 vUV;uniform sampler2D textureSampler; +var name150, shader149; +var init_glowMapMerge_fragment = __esm(() => { + init_shaderStore(); + name150 = "glowMapMergePixelShader"; + shader149 = `varying vec2 vUV;uniform sampler2D textureSampler; #ifdef EMISSIVE uniform sampler2D textureSampler2; #endif @@ -115525,30 +125035,25 @@ baseColor=clamp(baseColor,0.,1.0); gl_FragColor=baseColor; #define CUSTOM_FRAGMENT_MAIN_END }`; -ShaderStore.ShadersStore[name149] = shader149; + ShaderStore.ShadersStore[name150] = shader149; +}); // node_modules/@babylonjs/core/Shaders/glowMapMerge.vertex.js -var name150 = "glowMapMergeVertexShader"; -var shader150 = `attribute vec2 position;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5); +var name151, shader150; +var init_glowMapMerge_vertex = __esm(() => { + init_shaderStore(); + name151 = "glowMapMergeVertexShader"; + shader150 = `attribute vec2 position;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5); #define CUSTOM_VERTEX_DEFINITIONS void main(void) { #define CUSTOM_VERTEX_MAIN_BEGIN vUV=position*madd+madd;gl_Position=vec4(position,0.0,1.0); #define CUSTOM_VERTEX_MAIN_END }`; -ShaderStore.ShadersStore[name150] = shader150; + ShaderStore.ShadersStore[name151] = shader150; +}); // node_modules/@babylonjs/core/Layers/glowLayer.js -AbstractScene.prototype.getGlowLayerByName = function(name151) { - var _a; - for (let index = 0;index < ((_a = this.effectLayers) === null || _a === undefined ? undefined : _a.length); index++) { - if (this.effectLayers[index].name === name151 && this.effectLayers[index].getEffectName() === GlowLayer.EffectName) { - return this.effectLayers[index]; - } - } - return null; -}; - class GlowLayer extends EffectLayer { set blurKernelSize(value) { if (value === this._options.blurKernelSize) { @@ -115570,8 +125075,8 @@ class GlowLayer extends EffectLayer { get intensity() { return this._intensity; } - constructor(name151, scene22, options) { - super(name151, scene22); + constructor(name152, scene22, options) { + super(name152, scene22); this._intensity = 1; this._includedOnlyMeshes = []; this._excludedMeshes = []; @@ -115843,44 +125348,66 @@ class GlowLayer extends EffectLayer { return gl; } } -GlowLayer.EffectName = "GlowLayer"; -GlowLayer.DefaultBlurKernelSize = 32; -GlowLayer.DefaultTextureRatio = 0.5; -__decorate2([ - serialize() -], GlowLayer.prototype, "blurKernelSize", null); -__decorate2([ - serialize() -], GlowLayer.prototype, "intensity", null); -__decorate2([ - serialize("options") -], GlowLayer.prototype, "_options", undefined); -RegisterClass("BABYLON.GlowLayer", GlowLayer); +var init_glowLayer = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_buffer(); + init_texture(); + init_renderTargetTexture(); + init_material(); + init_blurPostProcess(); + init_effectLayer(); + init_abstractScene(); + init_typeStore(); + init_engine(); + init_math_color(); + init_glowMapMerge_fragment(); + init_glowMapMerge_vertex(); + init_effectLayerSceneComponent(); + AbstractScene.prototype.getGlowLayerByName = function(name152) { + var _a; + for (let index = 0;index < ((_a = this.effectLayers) === null || _a === undefined ? undefined : _a.length); index++) { + if (this.effectLayers[index].name === name152 && this.effectLayers[index].getEffectName() === GlowLayer.EffectName) { + return this.effectLayers[index]; + } + } + return null; + }; + GlowLayer.EffectName = "GlowLayer"; + GlowLayer.DefaultBlurKernelSize = 32; + GlowLayer.DefaultTextureRatio = 0.5; + __decorate2([ + serialize() + ], GlowLayer.prototype, "blurKernelSize", null); + __decorate2([ + serialize() + ], GlowLayer.prototype, "intensity", null); + __decorate2([ + serialize("options") + ], GlowLayer.prototype, "_options", undefined); + RegisterClass("BABYLON.GlowLayer", GlowLayer); +}); + // node_modules/@babylonjs/core/Shaders/glowBlurPostProcess.fragment.js -var name151 = "glowBlurPostProcessPixelShader"; -var shader151 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform vec2 direction;uniform float blurWidth;float getLuminance(vec3 color) +var name152, shader151; +var init_glowBlurPostProcess_fragment = __esm(() => { + init_shaderStore(); + name152 = "glowBlurPostProcessPixelShader"; + shader151 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform vec2 direction;uniform float blurWidth;float getLuminance(vec3 color) {return dot(color,vec3(0.2126,0.7152,0.0722));} #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {float weights[7];weights[0]=0.05;weights[1]=0.1;weights[2]=0.2;weights[3]=0.3;weights[4]=0.2;weights[5]=0.1;weights[6]=0.05;vec2 texelSize=vec2(1.0/screenSize.x,1.0/screenSize.y);vec2 texelStep=texelSize*direction*blurWidth;vec2 start=vUV-3.0*texelStep;vec4 baseColor=vec4(0.,0.,0.,0.);vec2 texelOffset=vec2(0.,0.);for (int i=0; i<7; i++) {vec4 texel=texture2D(textureSampler,start+texelOffset);baseColor.a+=texel.a*weights[i];float luminance=getLuminance(baseColor.rgb);float luminanceTexel=getLuminance(texel.rgb);float choice=step(luminanceTexel,luminance);baseColor.rgb=choice*baseColor.rgb+(1.0-choice)*texel.rgb;texelOffset+=texelStep;} gl_FragColor=baseColor;}`; -ShaderStore.ShadersStore[name151] = shader151; + ShaderStore.ShadersStore[name152] = shader151; +}); // node_modules/@babylonjs/core/Layers/highlightLayer.js -AbstractScene.prototype.getHighlightLayerByName = function(name152) { - var _a; - for (let index = 0;index < ((_a = this.effectLayers) === null || _a === undefined ? undefined : _a.length); index++) { - if (this.effectLayers[index].name === name152 && this.effectLayers[index].getEffectName() === HighlightLayer.EffectName) { - return this.effectLayers[index]; - } - } - return null; -}; - class GlowBlurPostProcess extends PostProcess { - constructor(name152, direction, kernel, options, camera27, samplingMode = Texture.BILINEAR_SAMPLINGMODE, engine35, reusable) { - super(name152, "glowBlurPostProcess", ["screenSize", "direction", "blurWidth"], null, options, camera27, samplingMode, engine35, reusable); + constructor(name153, direction, kernel, options, camera27, samplingMode = Texture.BILINEAR_SAMPLINGMODE, engine35, reusable) { + super(name153, "glowBlurPostProcess", ["screenSize", "direction", "blurWidth"], null, options, camera27, samplingMode, engine35, reusable); this.direction = direction; this.kernel = kernel; this.onApplyObservable.add((effect11) => { @@ -115906,9 +125433,9 @@ class HighlightLayer extends EffectLayer { get blurVerticalSize() { return this._verticalBlurPostprocess.kernel; } - constructor(name152, scene22, options) { - super(name152, scene22); - this.name = name152; + constructor(name153, scene22, options) { + super(name153, scene22); + this.name = name153; this.innerGlow = true; this.outerGlow = true; this.onBeforeBlurObservable = new Observable; @@ -116281,26 +125808,59 @@ class HighlightLayer extends EffectLayer { return hl; } } -HighlightLayer.EffectName = "HighlightLayer"; -HighlightLayer.NeutralColor = new Color4(0, 0, 0, 0); -HighlightLayer.GlowingMeshStencilReference = 2; -HighlightLayer.NormalMeshStencilReference = 1; -__decorate2([ - serialize() -], HighlightLayer.prototype, "innerGlow", undefined); -__decorate2([ - serialize() -], HighlightLayer.prototype, "outerGlow", undefined); -__decorate2([ - serialize() -], HighlightLayer.prototype, "blurHorizontalSize", null); -__decorate2([ - serialize() -], HighlightLayer.prototype, "blurVerticalSize", null); -__decorate2([ - serialize("options") -], HighlightLayer.prototype, "_options", undefined); -RegisterClass("BABYLON.HighlightLayer", HighlightLayer); +var init_highlightLayer = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_observable(); + init_math_vector(); + init_engine(); + init_buffer(); + init_material(); + init_texture(); + init_renderTargetTexture(); + init_postProcess(); + init_passPostProcess(); + init_blurPostProcess(); + init_effectLayer(); + init_abstractScene(); + init_logger(); + init_typeStore(); + init_math_color(); + init_glowMapMerge_fragment(); + init_glowMapMerge_vertex(); + init_glowBlurPostProcess_fragment(); + init_effectLayerSceneComponent(); + AbstractScene.prototype.getHighlightLayerByName = function(name153) { + var _a; + for (let index = 0;index < ((_a = this.effectLayers) === null || _a === undefined ? undefined : _a.length); index++) { + if (this.effectLayers[index].name === name153 && this.effectLayers[index].getEffectName() === HighlightLayer.EffectName) { + return this.effectLayers[index]; + } + } + return null; + }; + HighlightLayer.EffectName = "HighlightLayer"; + HighlightLayer.NeutralColor = new Color4(0, 0, 0, 0); + HighlightLayer.GlowingMeshStencilReference = 2; + HighlightLayer.NormalMeshStencilReference = 1; + __decorate2([ + serialize() + ], HighlightLayer.prototype, "innerGlow", undefined); + __decorate2([ + serialize() + ], HighlightLayer.prototype, "outerGlow", undefined); + __decorate2([ + serialize() + ], HighlightLayer.prototype, "blurHorizontalSize", null); + __decorate2([ + serialize() + ], HighlightLayer.prototype, "blurVerticalSize", null); + __decorate2([ + serialize("options") + ], HighlightLayer.prototype, "_options", undefined); + RegisterClass("BABYLON.HighlightLayer", HighlightLayer); +}); + // node_modules/@babylonjs/core/Layers/layerSceneComponent.js class LayerSceneComponent { constructor(scene22) { @@ -116403,10 +125963,18 @@ class LayerSceneComponent { }); } } +var init_layerSceneComponent = __esm(() => { + init_sceneComponent(); + init_engineStore(); +}); // node_modules/@babylonjs/core/Shaders/layer.fragment.js -var name152 = "layerPixelShader"; -var shader152 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec4 color; +var name153, shader152; +var init_layer_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + name153 = "layerPixelShader"; + shader152 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec4 color; #include #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) { @@ -116422,18 +125990,23 @@ discard; gl_FragColor=baseColor*color; #define CUSTOM_FRAGMENT_MAIN_END }`; -ShaderStore.ShadersStore[name152] = shader152; + ShaderStore.ShadersStore[name153] = shader152; +}); // node_modules/@babylonjs/core/Shaders/layer.vertex.js -var name153 = "layerVertexShader"; -var shader153 = `attribute vec2 position;uniform vec2 scale;uniform vec2 offset;uniform mat4 textureMatrix;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5); +var name154, shader153; +var init_layer_vertex = __esm(() => { + init_shaderStore(); + name154 = "layerVertexShader"; + shader153 = `attribute vec2 position;uniform vec2 scale;uniform vec2 offset;uniform mat4 textureMatrix;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5); #define CUSTOM_VERTEX_DEFINITIONS void main(void) { #define CUSTOM_VERTEX_MAIN_BEGIN vec2 shiftedPosition=position*scale+offset;vUV=vec2(textureMatrix*vec4(shiftedPosition*madd+madd,1.0,0.0));gl_Position=vec4(shiftedPosition,0.0,1.0); #define CUSTOM_VERTEX_MAIN_END }`; -ShaderStore.ShadersStore[name153] = shader153; + ShaderStore.ShadersStore[name154] = shader153; +}); // node_modules/@babylonjs/core/Layers/layer.js class Layer { @@ -116461,8 +126034,8 @@ class Layer { } this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback); } - constructor(name154, imgUrl, scene22, isBackground, color) { - this.name = name154; + constructor(name155, imgUrl, scene22, isBackground, color) { + this.name = name155; this._applyPostProcess = true; this.scale = new Vector2(1, 1); this.offset = new Vector2(0, 0); @@ -116581,6 +126154,31 @@ class Layer { this.onBeforeRenderObservable.clear(); } } +var init_layer = __esm(() => { + init_observable(); + init_math_vector(); + init_math_color(); + init_engineStore(); + init_buffer(); + init_material(); + init_texture(); + init_sceneComponent(); + init_layerSceneComponent(); + init_drawWrapper(); + init_layer_fragment(); + init_layer_vertex(); +}); + +// node_modules/@babylonjs/core/Layers/index.js +var init_Layers = __esm(() => { + init_effectLayer(); + init_effectLayerSceneComponent(); + init_glowLayer(); + init_highlightLayer(); + init_layer(); + init_layerSceneComponent(); +}); + // node_modules/@babylonjs/core/LensFlares/lensFlare.js class LensFlare { static AddFlare(size, position, color, imgUrl, system) { @@ -116606,35 +126204,50 @@ class LensFlare { this._system.lensFlares.splice(index, 1); } } +var init_lensFlare = __esm(() => { + init_math_color(); + init_texture(); + init_drawWrapper(); + init_buffer(); +}); + // node_modules/@babylonjs/core/Shaders/lensFlare.fragment.js -var name154 = "lensFlarePixelShader"; -var shader154 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec4 color; +var name155, shader154; +var init_lensFlare_fragment = __esm(() => { + init_shaderStore(); + name155 = "lensFlarePixelShader"; + shader154 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec4 color; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) { #define CUSTOM_FRAGMENT_MAIN_BEGIN vec4 baseColor=texture2D(textureSampler,vUV);gl_FragColor=baseColor*color; #define CUSTOM_FRAGMENT_MAIN_END }`; -ShaderStore.ShadersStore[name154] = shader154; + ShaderStore.ShadersStore[name155] = shader154; +}); // node_modules/@babylonjs/core/Shaders/lensFlare.vertex.js -var name155 = "lensFlareVertexShader"; -var shader155 = `attribute vec2 position;uniform mat4 viewportMatrix;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5); +var name156, shader155; +var init_lensFlare_vertex = __esm(() => { + init_shaderStore(); + name156 = "lensFlareVertexShader"; + shader155 = `attribute vec2 position;uniform mat4 viewportMatrix;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5); #define CUSTOM_VERTEX_DEFINITIONS void main(void) { #define CUSTOM_VERTEX_MAIN_BEGIN vUV=position*madd+madd;gl_Position=viewportMatrix*vec4(position,0.0,1.0); #define CUSTOM_VERTEX_MAIN_END }`; -ShaderStore.ShadersStore[name155] = shader155; + ShaderStore.ShadersStore[name156] = shader155; +}); // node_modules/@babylonjs/core/LensFlares/lensFlareSystem.js class LensFlareSystem { get scene() { return this._scene; } - constructor(name156, emitter, scene22) { - this.name = name156; + constructor(name157, emitter, scene22) { + this.name = name157; this.lensFlares = []; this.borderLimit = 300; this.viewportBorder = 0; @@ -116644,7 +126257,7 @@ class LensFlareSystem { this._scene = scene22 || EngineStore.LastCreatedScene; LensFlareSystem._SceneComponentInitialization(this._scene); this._emitter = emitter; - this.id = name156; + this.id = name157; scene22.lensFlareSystems.push(this); this.meshesSelectionPredicate = (m) => scene22.activeCamera && m.material && m.isVisible && m.isEnabled() && m.isBlocker && (m.layerMask & scene22.activeCamera.layerMask) != 0; const engine35 = scene22.getEngine(); @@ -116828,9 +126441,9 @@ class LensFlareSystem { } static Parse(parsedLensFlareSystem, scene22, rootUrl) { const emitter = scene22.getLastEntryById(parsedLensFlareSystem.emitterId); - const name156 = parsedLensFlareSystem.name || "lensFlareSystem#" + parsedLensFlareSystem.emitterId; - const lensFlareSystem = new LensFlareSystem(name156, emitter, scene22); - lensFlareSystem.id = parsedLensFlareSystem.id || name156; + const name157 = parsedLensFlareSystem.name || "lensFlareSystem#" + parsedLensFlareSystem.emitterId; + const lensFlareSystem = new LensFlareSystem(name157, emitter, scene22); + lensFlareSystem.id = parsedLensFlareSystem.id || name157; lensFlareSystem.borderLimit = parsedLensFlareSystem.borderLimit; for (let index = 0;index < parsedLensFlareSystem.flares.length; index++) { const parsedFlare = parsedLensFlareSystem.flares[index]; @@ -116857,52 +126470,25 @@ class LensFlareSystem { return serializationObject; } } -LensFlareSystem._SceneComponentInitialization = (_) => { - throw _WarnImport("LensFlareSystemSceneComponent"); -}; -// node_modules/@babylonjs/core/LensFlares/lensFlareSystemSceneComponent.js -AbstractScene.AddParser(SceneComponentConstants.NAME_LENSFLARESYSTEM, (parsedData, scene22, container, rootUrl) => { - if (parsedData.lensFlareSystems !== undefined && parsedData.lensFlareSystems !== null) { - if (!container.lensFlareSystems) { - container.lensFlareSystems = []; - } - for (let index = 0, cache = parsedData.lensFlareSystems.length;index < cache; index++) { - const parsedLensFlareSystem = parsedData.lensFlareSystems[index]; - const lf = LensFlareSystem.Parse(parsedLensFlareSystem, scene22, rootUrl); - container.lensFlareSystems.push(lf); - } - } +var init_lensFlareSystem = __esm(() => { + init_tools(); + init_math_vector(); + init_math_scalar(); + init_engineStore(); + init_buffer(); + init_ray(); + init_material(); + init_lensFlare(); + init_lensFlare_fragment(); + init_lensFlare_vertex(); + init_devTools(); + init_math_color(); + LensFlareSystem._SceneComponentInitialization = (_) => { + throw _WarnImport("LensFlareSystemSceneComponent"); + }; }); -AbstractScene.prototype.getLensFlareSystemByName = function(name156) { - for (let index = 0;index < this.lensFlareSystems.length; index++) { - if (this.lensFlareSystems[index].name === name156) { - return this.lensFlareSystems[index]; - } - } - return null; -}; -AbstractScene.prototype.getLensFlareSystemById = function(id) { - for (let index = 0;index < this.lensFlareSystems.length; index++) { - if (this.lensFlareSystems[index].id === id) { - return this.lensFlareSystems[index]; - } - } - return null; -}; -AbstractScene.prototype.getLensFlareSystemByID = function(id) { - return this.getLensFlareSystemById(id); -}; -AbstractScene.prototype.removeLensFlareSystem = function(toRemove) { - const index = this.lensFlareSystems.indexOf(toRemove); - if (index !== -1) { - this.lensFlareSystems.splice(index, 1); - } - return index; -}; -AbstractScene.prototype.addLensFlareSystem = function(newLensFlareSystem) { - this.lensFlareSystems.push(newLensFlareSystem); -}; +// node_modules/@babylonjs/core/LensFlares/lensFlareSystemSceneComponent.js class LensFlareSystemSceneComponent { constructor(scene22) { this.name = SceneComponentConstants.NAME_LENSFLARESYSTEM; @@ -116962,16 +126548,74 @@ class LensFlareSystemSceneComponent { } } } -LensFlareSystem._SceneComponentInitialization = (scene22) => { - let component = scene22._getComponent(SceneComponentConstants.NAME_LENSFLARESYSTEM); - if (!component) { - component = new LensFlareSystemSceneComponent(scene22); - scene22._addComponent(component); - } -}; +var init_lensFlareSystemSceneComponent = __esm(() => { + init_tools(); + init_sceneComponent(); + init_abstractScene(); + init_lensFlareSystem(); + AbstractScene.AddParser(SceneComponentConstants.NAME_LENSFLARESYSTEM, (parsedData, scene22, container, rootUrl) => { + if (parsedData.lensFlareSystems !== undefined && parsedData.lensFlareSystems !== null) { + if (!container.lensFlareSystems) { + container.lensFlareSystems = []; + } + for (let index = 0, cache = parsedData.lensFlareSystems.length;index < cache; index++) { + const parsedLensFlareSystem = parsedData.lensFlareSystems[index]; + const lf = LensFlareSystem.Parse(parsedLensFlareSystem, scene22, rootUrl); + container.lensFlareSystems.push(lf); + } + } + }); + AbstractScene.prototype.getLensFlareSystemByName = function(name157) { + for (let index = 0;index < this.lensFlareSystems.length; index++) { + if (this.lensFlareSystems[index].name === name157) { + return this.lensFlareSystems[index]; + } + } + return null; + }; + AbstractScene.prototype.getLensFlareSystemById = function(id) { + for (let index = 0;index < this.lensFlareSystems.length; index++) { + if (this.lensFlareSystems[index].id === id) { + return this.lensFlareSystems[index]; + } + } + return null; + }; + AbstractScene.prototype.getLensFlareSystemByID = function(id) { + return this.getLensFlareSystemById(id); + }; + AbstractScene.prototype.removeLensFlareSystem = function(toRemove) { + const index = this.lensFlareSystems.indexOf(toRemove); + if (index !== -1) { + this.lensFlareSystems.splice(index, 1); + } + return index; + }; + AbstractScene.prototype.addLensFlareSystem = function(newLensFlareSystem) { + this.lensFlareSystems.push(newLensFlareSystem); + }; + LensFlareSystem._SceneComponentInitialization = (scene22) => { + let component = scene22._getComponent(SceneComponentConstants.NAME_LENSFLARESYSTEM); + if (!component) { + component = new LensFlareSystemSceneComponent(scene22); + scene22._addComponent(component); + } + }; +}); + +// node_modules/@babylonjs/core/LensFlares/index.js +var init_LensFlares = __esm(() => { + init_lensFlare(); + init_lensFlareSystem(); + init_lensFlareSystemSceneComponent(); +}); + // node_modules/@babylonjs/core/Shaders/ShadersInclude/bayerDitherFunctions.js -var name156 = "bayerDitherFunctions"; -var shader156 = `float bayerDither2(vec2 _P) {return mod(2.0*_P.y+_P.x+1.0,4.0);} +var name157, shader156; +var init_bayerDitherFunctions = __esm(() => { + init_shaderStore(); + name157 = "bayerDitherFunctions"; + shader156 = `float bayerDither2(vec2 _P) {return mod(2.0*_P.y+_P.x+1.0,4.0);} float bayerDither4(vec2 _P) {vec2 P1=mod(_P,2.0); vec2 P2=floor(0.5*mod(_P,4.0)); return 4.0*bayerDither2(P1)+bayerDither2(P2);} @@ -116980,11 +126624,17 @@ vec2 P2=floor(0.5 *mod(_P,4.0)); vec2 P4=floor(0.25*mod(_P,8.0)); return 4.0*(4.0*bayerDither2(P1)+bayerDither2(P2))+bayerDither2(P4);} `; -ShaderStore.IncludesShadersStore[name156] = shader156; + ShaderStore.IncludesShadersStore[name157] = shader156; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapFragmentExtraDeclaration.js -var name157 = "shadowMapFragmentExtraDeclaration"; -var shader157 = `#if SM_FLOAT==0 +var name158, shader157; +var init_shadowMapFragmentExtraDeclaration = __esm(() => { + init_shaderStore(); + init_packingFunctions(); + init_bayerDitherFunctions(); + name158 = "shadowMapFragmentExtraDeclaration"; + shader157 = `#if SM_FLOAT==0 #include #endif #if SM_SOFTTRANSPARENTSHADOW==1 @@ -117000,11 +126650,15 @@ uniform vec3 biasAndScaleSM;uniform vec2 depthValuesSM; varying float zSM; #endif `; -ShaderStore.IncludesShadersStore[name157] = shader157; + ShaderStore.IncludesShadersStore[name158] = shader157; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapFragment.js -var name158 = "shadowMapFragment"; -var shader158 = `float depthSM=vDepthMetricSM; +var name159, shader158; +var init_shadowMapFragment = __esm(() => { + init_shaderStore(); + name159 = "shadowMapFragment"; + shader158 = `float depthSM=vDepthMetricSM; #if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP==1 #if SM_USEDISTANCE==1 depthSM=(length(vPositionWSM-lightDataSM)+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x; @@ -117032,11 +126686,19 @@ gl_FragColor=vec4(depthSM,1.0,1.0,1.0); gl_FragColor=pack(depthSM); #endif return;`; -ShaderStore.IncludesShadersStore[name158] = shader158; + ShaderStore.IncludesShadersStore[name159] = shader158; +}); // node_modules/@babylonjs/core/Shaders/shadowMap.fragment.js -var name159 = "shadowMapPixelShader"; -var shader159 = `#include +var name160, shader159; +var init_shadowMap_fragment = __esm(() => { + init_shaderStore(); + init_shadowMapFragmentExtraDeclaration(); + init_clipPlaneFragmentDeclaration(); + init_clipPlaneFragment(); + init_shadowMapFragment(); + name160 = "shadowMapPixelShader"; + shader159 = `#include #ifdef ALPHATEXTURE varying vec2 vUV;uniform sampler2D diffuseSampler; #endif @@ -117061,42 +126723,66 @@ if ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowS #endif #include }`; -ShaderStore.ShadersStore[name159] = shader159; + ShaderStore.ShadersStore[name160] = shader159; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/sceneVertexDeclaration.js -var name160 = "sceneVertexDeclaration"; -var shader160 = `uniform mat4 viewProjection; +var name161, shader160; +var init_sceneVertexDeclaration = __esm(() => { + init_shaderStore(); + name161 = "sceneVertexDeclaration"; + shader160 = `uniform mat4 viewProjection; #ifdef MULTIVIEW uniform mat4 viewProjectionR; #endif uniform mat4 view;uniform mat4 projection;uniform vec4 vEyePosition; `; -ShaderStore.IncludesShadersStore[name160] = shader160; + ShaderStore.IncludesShadersStore[name161] = shader160; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/meshVertexDeclaration.js -var name161 = "meshVertexDeclaration"; -var shader161 = `uniform mat4 world;uniform float visibility; +var name162, shader161; +var init_meshVertexDeclaration = __esm(() => { + init_shaderStore(); + name162 = "meshVertexDeclaration"; + shader161 = `uniform mat4 world;uniform float visibility; `; -ShaderStore.IncludesShadersStore[name161] = shader161; + ShaderStore.IncludesShadersStore[name162] = shader161; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapVertexDeclaration.js -var name162 = "shadowMapVertexDeclaration"; -var shader162 = `#include +var name163, shader162; +var init_shadowMapVertexDeclaration = __esm(() => { + init_shaderStore(); + init_sceneVertexDeclaration(); + init_meshVertexDeclaration(); + name163 = "shadowMapVertexDeclaration"; + shader162 = `#include #include `; -ShaderStore.IncludesShadersStore[name162] = shader162; + ShaderStore.IncludesShadersStore[name163] = shader162; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapUboDeclaration.js -var name163 = "shadowMapUboDeclaration"; -var shader163 = `layout(std140,column_major) uniform; +var name164, shader163; +var init_shadowMapUboDeclaration = __esm(() => { + init_shaderStore(); + init_sceneUboDeclaration(); + init_meshUboDeclaration(); + name164 = "shadowMapUboDeclaration"; + shader163 = `layout(std140,column_major) uniform; #include #include `; -ShaderStore.IncludesShadersStore[name163] = shader163; + ShaderStore.IncludesShadersStore[name164] = shader163; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapVertexExtraDeclaration.js -var name164 = "shadowMapVertexExtraDeclaration"; -var shader164 = `#if SM_NORMALBIAS==1 +var name165, shader164; +var init_shadowMapVertexExtraDeclaration = __esm(() => { + init_shaderStore(); + name165 = "shadowMapVertexExtraDeclaration"; + shader164 = `#if SM_NORMALBIAS==1 uniform vec3 lightDataSM; #endif uniform vec3 biasAndScaleSM;uniform vec2 depthValuesSM;varying float vDepthMetricSM; @@ -117107,11 +126793,15 @@ varying vec3 vPositionWSM; varying float zSM; #endif `; -ShaderStore.IncludesShadersStore[name164] = shader164; + ShaderStore.IncludesShadersStore[name165] = shader164; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapVertexNormalBias.js -var name165 = "shadowMapVertexNormalBias"; -var shader165 = `#if SM_NORMALBIAS==1 +var name166, shader165; +var init_shadowMapVertexNormalBias = __esm(() => { + init_shaderStore(); + name166 = "shadowMapVertexNormalBias"; + shader165 = `#if SM_NORMALBIAS==1 #if SM_DIRECTIONINLIGHTDATA==1 vec3 worldLightDirSM=normalize(-lightDataSM.xyz); #else @@ -117120,11 +126810,15 @@ vec3 directionToLightSM=lightDataSM.xyz-worldPos.xyz;vec3 worldLightDirSM=normal float ndlSM=dot(vNormalW,worldLightDirSM);float sinNLSM=sqrt(1.0-ndlSM*ndlSM);float normalBiasSM=biasAndScaleSM.y*sinNLSM;worldPos.xyz-=vNormalW*normalBiasSM; #endif `; -ShaderStore.IncludesShadersStore[name165] = shader165; + ShaderStore.IncludesShadersStore[name166] = shader165; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapVertexMetric.js -var name166 = "shadowMapVertexMetric"; -var shader166 = `#if SM_USEDISTANCE==1 +var name167, shader166; +var init_shadowMapVertexMetric = __esm(() => { + init_shaderStore(); + name167 = "shadowMapVertexMetric"; + shader166 = `#if SM_USEDISTANCE==1 vPositionWSM=worldPos.xyz; #endif #if SM_DEPTHTEXTURE==1 @@ -117149,11 +126843,32 @@ vDepthMetricSM=(gl_Position.z+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x; #endif #endif `; -ShaderStore.IncludesShadersStore[name166] = shader166; + ShaderStore.IncludesShadersStore[name167] = shader166; +}); // node_modules/@babylonjs/core/Shaders/shadowMap.vertex.js -var name167 = "shadowMapVertexShader"; -var shader167 = `attribute vec3 position; +var name168, shader167; +var init_shadowMap_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_morphTargetsVertexGlobalDeclaration(); + init_morphTargetsVertexDeclaration(); + init_helperFunctions(); + init_shadowMapVertexDeclaration(); + init_shadowMapUboDeclaration(); + init_shadowMapVertexExtraDeclaration(); + init_clipPlaneVertexDeclaration(); + init_morphTargetsVertexGlobal(); + init_morphTargetsVertex(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_shadowMapVertexNormalBias(); + init_shadowMapVertexMetric(); + init_clipPlaneVertex(); + name168 = "shadowMapVertexShader"; + shader167 = `attribute vec3 position; #ifdef NORMAL attribute vec3 normal; #endif @@ -117216,25 +126931,34 @@ vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0)); #endif #include }`; -ShaderStore.ShadersStore[name167] = shader167; + ShaderStore.ShadersStore[name168] = shader167; +}); // node_modules/@babylonjs/core/Shaders/depthBoxBlur.fragment.js -var name168 = "depthBoxBlurPixelShader"; -var shader168 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize; +var name169, shader168; +var init_depthBoxBlur_fragment = __esm(() => { + init_shaderStore(); + name169 = "depthBoxBlurPixelShader"; + shader168 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {vec4 colorDepth=vec4(0.0);for (int x=-OFFSET; x<=OFFSET; x++) for (int y=-OFFSET; y<=OFFSET; y++) colorDepth+=texture2D(textureSampler,vUV+vec2(x,y)/screenSize);gl_FragColor=(colorDepth/float((OFFSET*2+1)*(OFFSET*2+1)));}`; -ShaderStore.ShadersStore[name168] = shader168; + ShaderStore.ShadersStore[name169] = shader168; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/shadowMapFragmentSoftTransparentShadow.js -var name169 = "shadowMapFragmentSoftTransparentShadow"; -var shader169 = `#if SM_SOFTTRANSPARENTSHADOW==1 +var name170, shader169; +var init_shadowMapFragmentSoftTransparentShadow = __esm(() => { + init_shaderStore(); + name170 = "shadowMapFragmentSoftTransparentShadow"; + shader169 = `#if SM_SOFTTRANSPARENTSHADOW==1 if ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM*alpha) discard; #endif `; -ShaderStore.IncludesShadersStore[name169] = shader169; + ShaderStore.IncludesShadersStore[name170] = shader169; +}); // node_modules/@babylonjs/core/Lights/Shadows/shadowGenerator.js class ShadowGenerator { @@ -118022,9 +127746,9 @@ class ShadowGenerator { } if (this.customShaderOptions) { if (this.customShaderOptions.defines) { - for (const define of this.customShaderOptions.defines) { - if (defines.indexOf(define) === -1) { - defines.push(define); + for (const define2 of this.customShaderOptions.defines) { + if (defines.indexOf(define2) === -1) { + defines.push(define2); } } } @@ -118404,25 +128128,53 @@ class ShadowGenerator { return shadowGenerator; } } -ShadowGenerator.CLASSNAME = "ShadowGenerator"; -ShadowGenerator.FILTER_NONE = 0; -ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP = 1; -ShadowGenerator.FILTER_POISSONSAMPLING = 2; -ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP = 3; -ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP = 4; -ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP = 5; -ShadowGenerator.FILTER_PCF = 6; -ShadowGenerator.FILTER_PCSS = 7; -ShadowGenerator.QUALITY_HIGH = 0; -ShadowGenerator.QUALITY_MEDIUM = 1; -ShadowGenerator.QUALITY_LOW = 2; -ShadowGenerator.DEFAULT_ALPHA_CUTOFF = 0.5; -ShadowGenerator._SceneComponentInitialization = (_) => { - throw _WarnImport("ShadowGeneratorSceneComponent"); -}; +var init_shadowGenerator = __esm(() => { + init_math_vector(); + init_math_color(); + init_buffer(); + init_light(); + init_materialHelper(); + init_texture(); + init_renderTargetTexture(); + init_postProcess(); + init_blurPostProcess(); + init_observable(); + init_devTools(); + init_effectFallbacks(); + init_renderingManager(); + init_drawWrapper(); + init_shadowMap_fragment(); + init_shadowMap_vertex(); + init_depthBoxBlur_fragment(); + init_shadowMapFragmentSoftTransparentShadow(); + init_clipPlaneMaterialHelper(); + ShadowGenerator.CLASSNAME = "ShadowGenerator"; + ShadowGenerator.FILTER_NONE = 0; + ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP = 1; + ShadowGenerator.FILTER_POISSONSAMPLING = 2; + ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP = 3; + ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP = 4; + ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP = 5; + ShadowGenerator.FILTER_PCF = 6; + ShadowGenerator.FILTER_PCSS = 7; + ShadowGenerator.QUALITY_HIGH = 0; + ShadowGenerator.QUALITY_MEDIUM = 1; + ShadowGenerator.QUALITY_LOW = 2; + ShadowGenerator.DEFAULT_ALPHA_CUTOFF = 0.5; + ShadowGenerator._SceneComponentInitialization = (_) => { + throw _WarnImport("ShadowGeneratorSceneComponent"); + }; +}); + // node_modules/@babylonjs/core/Shaders/depth.fragment.js -var name170 = "depthPixelShader"; -var shader170 = `#ifdef ALPHATEST +var name171, shader170; +var init_depth_fragment = __esm(() => { + init_shaderStore(); + init_clipPlaneFragmentDeclaration(); + init_packingFunctions(); + init_clipPlaneFragment(); + name171 = "depthPixelShader"; + shader170 = `#ifdef ALPHATEST varying vec2 vUV;uniform sampler2D diffuseSampler; #endif #include @@ -118463,19 +128215,41 @@ gl_FragColor=vec4(vDepthMetric,0.0,0.0,1.0); #endif #endif }`; -ShaderStore.ShadersStore[name170] = shader170; + ShaderStore.ShadersStore[name171] = shader170; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/pointCloudVertexDeclaration.js -var name171 = "pointCloudVertexDeclaration"; -var shader171 = `#ifdef POINTSIZE +var name172, shader171; +var init_pointCloudVertexDeclaration = __esm(() => { + init_shaderStore(); + name172 = "pointCloudVertexDeclaration"; + shader171 = `#ifdef POINTSIZE uniform float pointSize; #endif `; -ShaderStore.IncludesShadersStore[name171] = shader171; + ShaderStore.IncludesShadersStore[name172] = shader171; +}); // node_modules/@babylonjs/core/Shaders/depth.vertex.js -var name172 = "depthVertexShader"; -var shader172 = `attribute vec3 position; +var name173, shader172; +var init_depth_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_morphTargetsVertexGlobalDeclaration(); + init_morphTargetsVertexDeclaration(); + init_clipPlaneVertexDeclaration(); + init_instancesDeclaration(); + init_pointCloudVertexDeclaration(); + init_morphTargetsVertexGlobal(); + init_morphTargetsVertex(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + init_pointCloudVertex(); + name173 = "depthVertexShader"; + shader172 = `attribute vec3 position; #include #include #include @@ -118531,14 +128305,15 @@ vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0)); #include } `; -ShaderStore.ShadersStore[name172] = shader172; + ShaderStore.ShadersStore[name173] = shader172; +}); // node_modules/@babylonjs/core/Rendering/depthRenderer.js class DepthRenderer { setMaterialForRendering(mesh47, material18) { this._depthMap.setMaterialForRendering(mesh47, material18); } - constructor(scene22, type = 1, camera28 = null, storeNonLinearDepth = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, storeCameraSpaceZ = false, name173) { + constructor(scene22, type = 1, camera28 = null, storeNonLinearDepth = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, storeCameraSpaceZ = false, name174) { this.enabled = true; this.forceDepthWriteTransparentMeshes = false; this.useOnlyInActiveCamera = false; @@ -118564,7 +128339,7 @@ class DepthRenderer { } } const format = this.isPacked || !engine35._features.supportExtendedTextureFormats ? 5 : 6; - this._depthMap = new RenderTargetTexture(name173 !== null && name173 !== undefined ? name173 : "DepthRenderer", { width: engine35.getRenderWidth(), height: engine35.getRenderHeight() }, this._scene, false, true, type, false, samplingMode, undefined, undefined, undefined, format); + this._depthMap = new RenderTargetTexture(name174 !== null && name174 !== undefined ? name174 : "DepthRenderer", { width: engine35.getRenderWidth(), height: engine35.getRenderHeight() }, this._scene, false, true, type, false, samplingMode, undefined, undefined, undefined, format); this._depthMap.wrapU = Texture.CLAMP_ADDRESSMODE; this._depthMap.wrapV = Texture.CLAMP_ADDRESSMODE; this._depthMap.refreshRate = 1; @@ -118832,13 +128607,28 @@ class DepthRenderer { } } } -DepthRenderer._SceneComponentInitialization = (_) => { - throw _WarnImport("DepthRendererSceneComponent"); -}; +var init_depthRenderer = __esm(() => { + init_math_color(); + init_buffer(); + init_texture(); + init_renderTargetTexture(); + init_materialHelper(); + init_camera(); + init_depth_fragment(); + init_depth_vertex(); + init_devTools(); + init_clipPlaneMaterialHelper(); + DepthRenderer._SceneComponentInitialization = (_) => { + throw _WarnImport("DepthRendererSceneComponent"); + }; +}); // node_modules/@babylonjs/core/Shaders/minmaxRedux.fragment.js -var name173 = "minmaxReduxPixelShader"; -var shader173 = `varying vec2 vUV;uniform sampler2D textureSampler; +var name174, shader173; +var init_minmaxRedux_fragment = __esm(() => { + init_shaderStore(); + name174 = "minmaxReduxPixelShader"; + shader173 = `varying vec2 vUV;uniform sampler2D textureSampler; #if defined(INITIAL) uniform sampler2D sourceTexture;uniform vec2 texSize;void main(void) {ivec2 coord=ivec2(vUV*(texSize-1.0));float f1=texelFetch(sourceTexture,coord,0).r;float f2=texelFetch(sourceTexture,coord+ivec2(1,0),0).r;float f3=texelFetch(sourceTexture,coord+ivec2(1,1),0).r;float f4=texelFetch(sourceTexture,coord+ivec2(0,1),0).r;float minz=min(min(min(f1,f2),f3),f4); @@ -118860,7 +128650,8 @@ void main(void) discard;}} #endif `; -ShaderStore.ShadersStore[name173] = shader173; + ShaderStore.ShadersStore[name174] = shader173; +}); // node_modules/@babylonjs/core/Misc/minMaxReducer.js class MinMaxReducer { @@ -118984,6 +128775,12 @@ class MinMaxReducer { this._sourceTexture = null; } } +var init_minMaxReducer = __esm(() => { + init_observable(); + init_postProcess(); + init_postProcessManager(); + init_minmaxRedux_fragment(); +}); // node_modules/@babylonjs/core/Misc/depthReducer.js class DepthReducer extends MinMaxReducer { @@ -119038,14 +128835,12 @@ class DepthReducer extends MinMaxReducer { } } } +var init_depthReducer = __esm(() => { + init_depthRenderer(); + init_minMaxReducer(); +}); // node_modules/@babylonjs/core/Lights/Shadows/cascadedShadowGenerator.js -var UpDir = Vector3.Up(); -var ZeroVec = Vector3.Zero(); -var tmpv1 = new Vector3; -var tmpv2 = new Vector3; -var tmpMatrix = new Matrix; - class CascadedShadowGenerator extends ShadowGenerator { _validateFilter(filter) { if (filter === ShadowGenerator.FILTER_NONE || filter === ShadowGenerator.FILTER_PCF || filter === ShadowGenerator.FILTER_PCSS) { @@ -119646,37 +129441,44 @@ class CascadedShadowGenerator extends ShadowGenerator { return shadowGenerator2; } } -CascadedShadowGenerator._FrustumCornersNDCSpace = [ - new Vector3(-1, 1, -1), - new Vector3(1, 1, -1), - new Vector3(1, -1, -1), - new Vector3(-1, -1, -1), - new Vector3(-1, 1, 1), - new Vector3(1, 1, 1), - new Vector3(1, -1, 1), - new Vector3(-1, -1, 1) -]; -CascadedShadowGenerator.CLASSNAME = "CascadedShadowGenerator"; -CascadedShadowGenerator.DEFAULT_CASCADES_COUNT = 4; -CascadedShadowGenerator.MIN_CASCADES_COUNT = 2; -CascadedShadowGenerator.MAX_CASCADES_COUNT = 4; -CascadedShadowGenerator._SceneComponentInitialization = (_) => { - throw _WarnImport("ShadowGeneratorSceneComponent"); -}; -// node_modules/@babylonjs/core/Lights/Shadows/shadowGeneratorSceneComponent.js -AbstractScene.AddParser(SceneComponentConstants.NAME_SHADOWGENERATOR, (parsedData, scene22) => { - if (parsedData.shadowGenerators !== undefined && parsedData.shadowGenerators !== null) { - for (let index = 0, cache = parsedData.shadowGenerators.length;index < cache; index++) { - const parsedShadowGenerator = parsedData.shadowGenerators[index]; - if (parsedShadowGenerator.className === CascadedShadowGenerator.CLASSNAME) { - CascadedShadowGenerator.Parse(parsedShadowGenerator, scene22); - } else { - ShadowGenerator.Parse(parsedShadowGenerator, scene22); - } - } - } +var UpDir, ZeroVec, tmpv1, tmpv2, tmpMatrix; +var init_cascadedShadowGenerator = __esm(() => { + init_math_vector(); + init_renderTargetTexture(); + init_shadowMap_fragment(); + init_shadowMap_vertex(); + init_depthBoxBlur_fragment(); + init_devTools(); + init_shadowGenerator(); + init_boundingInfo(); + init_depthReducer(); + init_logger(); + init_engineStore(); + UpDir = Vector3.Up(); + ZeroVec = Vector3.Zero(); + tmpv1 = new Vector3; + tmpv2 = new Vector3; + tmpMatrix = new Matrix; + CascadedShadowGenerator._FrustumCornersNDCSpace = [ + new Vector3(-1, 1, -1), + new Vector3(1, 1, -1), + new Vector3(1, -1, -1), + new Vector3(-1, -1, -1), + new Vector3(-1, 1, 1), + new Vector3(1, 1, 1), + new Vector3(1, -1, 1), + new Vector3(-1, -1, 1) + ]; + CascadedShadowGenerator.CLASSNAME = "CascadedShadowGenerator"; + CascadedShadowGenerator.DEFAULT_CASCADES_COUNT = 4; + CascadedShadowGenerator.MIN_CASCADES_COUNT = 2; + CascadedShadowGenerator.MAX_CASCADES_COUNT = 4; + CascadedShadowGenerator._SceneComponentInitialization = (_) => { + throw _WarnImport("ShadowGeneratorSceneComponent"); + }; }); +// node_modules/@babylonjs/core/Lights/Shadows/shadowGeneratorSceneComponent.js class ShadowGeneratorSceneComponent { constructor(scene22) { this.name = SceneComponentConstants.NAME_SHADOWGENERATOR; @@ -119727,18 +129529,40 @@ class ShadowGeneratorSceneComponent { } } } -ShadowGenerator._SceneComponentInitialization = (scene22) => { - let component = scene22._getComponent(SceneComponentConstants.NAME_SHADOWGENERATOR); - if (!component) { - component = new ShadowGeneratorSceneComponent(scene22); - scene22._addComponent(component); - } -}; -// node_modules/@babylonjs/core/Lights/pointLight.js -Node2.AddNodeConstructor("Light_Type_0", (name174, scene22) => { - return () => new PointLight(name174, Vector3.Zero(), scene22); +var init_shadowGeneratorSceneComponent = __esm(() => { + init_shadowGenerator(); + init_cascadedShadowGenerator(); + init_sceneComponent(); + init_abstractScene(); + AbstractScene.AddParser(SceneComponentConstants.NAME_SHADOWGENERATOR, (parsedData, scene22) => { + if (parsedData.shadowGenerators !== undefined && parsedData.shadowGenerators !== null) { + for (let index = 0, cache = parsedData.shadowGenerators.length;index < cache; index++) { + const parsedShadowGenerator = parsedData.shadowGenerators[index]; + if (parsedShadowGenerator.className === CascadedShadowGenerator.CLASSNAME) { + CascadedShadowGenerator.Parse(parsedShadowGenerator, scene22); + } else { + ShadowGenerator.Parse(parsedShadowGenerator, scene22); + } + } + } + }); + ShadowGenerator._SceneComponentInitialization = (scene22) => { + let component = scene22._getComponent(SceneComponentConstants.NAME_SHADOWGENERATOR); + if (!component) { + component = new ShadowGeneratorSceneComponent(scene22); + scene22._addComponent(component); + } + }; +}); + +// node_modules/@babylonjs/core/Lights/Shadows/index.js +var init_Shadows = __esm(() => { + init_shadowGenerator(); + init_cascadedShadowGenerator(); + init_shadowGeneratorSceneComponent(); }); +// node_modules/@babylonjs/core/Lights/pointLight.js class PointLight extends ShadowLight { get shadowAngle() { return this._shadowAngle; @@ -119761,8 +129585,8 @@ class PointLight extends ShadowLight { } } } - constructor(name174, position, scene22) { - super(name174, scene22); + constructor(name175, position, scene22) { + super(name175, scene22); this._shadowAngle = Math.PI / 2; this.position = position; } @@ -119836,9 +129660,32 @@ class PointLight extends ShadowLight { defines["POINTLIGHT" + lightIndex] = true; } } -__decorate2([ - serialize() -], PointLight.prototype, "shadowAngle", null); +var init_pointLight = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_node(); + init_light(); + init_shadowLight(); + Node2.AddNodeConstructor("Light_Type_0", (name175, scene22) => { + return () => new PointLight(name175, Vector3.Zero(), scene22); + }); + __decorate2([ + serialize() + ], PointLight.prototype, "shadowAngle", null); +}); + +// node_modules/@babylonjs/core/Lights/index.js +var init_Lights = __esm(() => { + init_light(); + init_shadowLight(); + init_Shadows(); + init_directionalLight(); + init_hemisphericLight(); + init_pointLight(); + init_spotLight(); +}); + // node_modules/@babylonjs/core/Loading/loadingScreen.js class DefaultLoadingScreen { constructor(_renderingCanvas, _loadingText = "", _loadingDivBackgroundColor = "black") { @@ -119991,11 +129838,15 @@ class DefaultLoadingScreen { this._loadingDiv.style.backgroundColor = this._loadingDivBackgroundColor; } } -DefaultLoadingScreen.DefaultLogoUrl = ""; -DefaultLoadingScreen.DefaultSpinnerUrl = ""; -Engine2.DefaultLoadingScreenFactory = (canvas) => { - return new DefaultLoadingScreen(canvas); -}; +var init_loadingScreen = __esm(() => { + init_engine(); + DefaultLoadingScreen.DefaultLogoUrl = ""; + DefaultLoadingScreen.DefaultSpinnerUrl = ""; + Engine2.DefaultLoadingScreenFactory = (canvas) => { + return new DefaultLoadingScreen(canvas); + }; +}); + // node_modules/@babylonjs/core/Misc/HighDynamicRange/panoramaToCubemap.js class PanoramaToCubeMapTools { static ConvertPanoramaToCubemap(float32Array, inputWidth, inputHeight, size, supersample = false) { @@ -120090,12 +129941,15 @@ class PanoramaToCubeMapTools { }; } } -PanoramaToCubeMapTools.FACE_LEFT = [new Vector3(-1, -1, -1), new Vector3(1, -1, -1), new Vector3(-1, 1, -1), new Vector3(1, 1, -1)]; -PanoramaToCubeMapTools.FACE_RIGHT = [new Vector3(1, -1, 1), new Vector3(-1, -1, 1), new Vector3(1, 1, 1), new Vector3(-1, 1, 1)]; -PanoramaToCubeMapTools.FACE_FRONT = [new Vector3(1, -1, -1), new Vector3(1, -1, 1), new Vector3(1, 1, -1), new Vector3(1, 1, 1)]; -PanoramaToCubeMapTools.FACE_BACK = [new Vector3(-1, -1, 1), new Vector3(-1, -1, -1), new Vector3(-1, 1, 1), new Vector3(-1, 1, -1)]; -PanoramaToCubeMapTools.FACE_DOWN = [new Vector3(1, 1, -1), new Vector3(1, 1, 1), new Vector3(-1, 1, -1), new Vector3(-1, 1, 1)]; -PanoramaToCubeMapTools.FACE_UP = [new Vector3(-1, -1, -1), new Vector3(-1, -1, 1), new Vector3(1, -1, -1), new Vector3(1, -1, 1)]; +var init_panoramaToCubemap = __esm(() => { + init_math_vector(); + PanoramaToCubeMapTools.FACE_LEFT = [new Vector3(-1, -1, -1), new Vector3(1, -1, -1), new Vector3(-1, 1, -1), new Vector3(1, 1, -1)]; + PanoramaToCubeMapTools.FACE_RIGHT = [new Vector3(1, -1, 1), new Vector3(-1, -1, 1), new Vector3(1, 1, 1), new Vector3(-1, 1, 1)]; + PanoramaToCubeMapTools.FACE_FRONT = [new Vector3(1, -1, -1), new Vector3(1, -1, 1), new Vector3(1, 1, -1), new Vector3(1, 1, 1)]; + PanoramaToCubeMapTools.FACE_BACK = [new Vector3(-1, -1, 1), new Vector3(-1, -1, -1), new Vector3(-1, 1, 1), new Vector3(-1, 1, -1)]; + PanoramaToCubeMapTools.FACE_DOWN = [new Vector3(1, 1, -1), new Vector3(1, 1, 1), new Vector3(-1, 1, -1), new Vector3(-1, 1, 1)]; + PanoramaToCubeMapTools.FACE_UP = [new Vector3(-1, -1, -1), new Vector3(-1, -1, 1), new Vector3(1, -1, -1), new Vector3(1, -1, 1)]; +}); // node_modules/@babylonjs/core/Misc/HighDynamicRange/hdr.js class HDRTools { @@ -120263,26 +130117,41 @@ class HDRTools { return resultArray; } } +var init_hdr = __esm(() => { + init_panoramaToCubemap(); +}); // node_modules/@babylonjs/core/Shaders/hdrFiltering.vertex.js -var name174 = "hdrFilteringVertexShader"; -var shader174 = `attribute vec2 position;varying vec3 direction;uniform vec3 up;uniform vec3 right;uniform vec3 front; +var name175, shader174; +var init_hdrFiltering_vertex = __esm(() => { + init_shaderStore(); + name175 = "hdrFilteringVertexShader"; + shader174 = `attribute vec2 position;varying vec3 direction;uniform vec3 up;uniform vec3 right;uniform vec3 front; #define CUSTOM_VERTEX_DEFINITIONS void main(void) { #define CUSTOM_VERTEX_MAIN_BEGIN mat3 view=mat3(up,right,front);direction=view*vec3(position,1.0);gl_Position=vec4(position,0.0,1.0); #define CUSTOM_VERTEX_MAIN_END }`; -ShaderStore.ShadersStore[name174] = shader174; + ShaderStore.ShadersStore[name175] = shader174; +}); // node_modules/@babylonjs/core/Shaders/hdrFiltering.fragment.js -var name175 = "hdrFilteringPixelShader"; -var shader175 = `#include +var name176, shader175; +var init_hdrFiltering_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + init_importanceSampling(); + init_pbrBRDFFunctions(); + init_hdrFilteringFunctions(); + name176 = "hdrFilteringPixelShader"; + shader175 = `#include #include #include #include uniform float alphaG;uniform samplerCube inputTexture;uniform vec2 vFilteringInfo;uniform float hdrScale;varying vec3 direction;void main() {vec3 color=radiance(alphaG,inputTexture,direction,vFilteringInfo);gl_FragColor=vec4(color*hdrScale,1.0);}`; -ShaderStore.ShadersStore[name175] = shader175; + ShaderStore.ShadersStore[name176] = shader175; +}); // node_modules/@babylonjs/core/Materials/Textures/Filtering/hdrFiltering.js class HDRFiltering { @@ -120409,6 +130278,14 @@ class HDRFiltering { }); } } +var init_hdrFiltering = __esm(() => { + init_math(); + init_math_scalar(); + init_effectRenderer(); + init_hdrFiltering_vertex(); + init_hdrFiltering_fragment(); + init_logger(); +}); // node_modules/@babylonjs/core/Materials/Textures/hdrCubeTexture.js class HDRCubeTexture extends BaseTexture { @@ -120641,8 +130518,23 @@ class HDRCubeTexture extends BaseTexture { return serializationObject; } } -HDRCubeTexture._FacesMapping = ["right", "left", "up", "down", "front", "back"]; -RegisterClass("BABYLON.HDRCubeTexture", HDRCubeTexture); +var init_hdrCubeTexture = __esm(() => { + init_math_vector(); + init_baseTexture(); + init_texture(); + init_hdr(); + init_cubemapToSphericalPolynomial(); + init_typeStore(); + init_observable(); + init_tools(); + init_math_constants(); + init_hdrFiltering(); + init_textureTools(); + init_engine_rawTexture(); + init_baseTexture_polynomial(); + HDRCubeTexture._FacesMapping = ["right", "left", "up", "down", "front", "back"]; + RegisterClass("BABYLON.HDRCubeTexture", HDRCubeTexture); +}); // node_modules/@babylonjs/core/Morph/morphTarget.js class MorphTarget { @@ -120668,8 +130560,8 @@ class MorphTarget { set animationPropertiesOverride(value) { this._animationPropertiesOverride = value; } - constructor(name176, influence = 0, scene22 = null) { - this.name = name176; + constructor(name177, influence = 0, scene22 = null) { + this.name = name177; this.animations = []; this._positions = null; this._normals = null; @@ -120800,11 +130692,11 @@ class MorphTarget { } return result; } - static FromMesh(mesh47, name176, influence) { - if (!name176) { - name176 = mesh47.name; + static FromMesh(mesh47, name177, influence) { + if (!name177) { + name177 = mesh47.name; } - const result = new MorphTarget(name176, influence, mesh47.getScene()); + const result = new MorphTarget(name177, influence, mesh47.getScene()); result.setPositions(mesh47.getVerticesData(VertexBuffer.PositionKind)); if (mesh47.isVerticesDataPresent(VertexBuffer.NormalKind)) { result.setNormals(mesh47.getVerticesData(VertexBuffer.NormalKind)); @@ -120818,9 +130710,17 @@ class MorphTarget { return result; } } -__decorate2([ - serialize() -], MorphTarget.prototype, "id", undefined); +var init_morphTarget = __esm(() => { + init_tslib_es62(); + init_observable(); + init_engineStore(); + init_buffer(); + init_decorators(); + init_typeStore(); + __decorate2([ + serialize() + ], MorphTarget.prototype, "id", undefined); +}); // node_modules/@babylonjs/core/Materials/Textures/rawTexture2DArray.js class RawTexture2DArray extends Texture { @@ -120844,6 +130744,10 @@ class RawTexture2DArray extends Texture { return new RawTexture2DArray(data, width, height, depth, 5, scene22, generateMipMaps, invertY, samplingMode, type); } } +var init_rawTexture2DArray = __esm(() => { + init_texture(); + init_engine_rawTexture(); +}); // node_modules/@babylonjs/core/Morph/morphTargetManager.js class MorphTargetManager { @@ -121145,8 +131049,15 @@ class MorphTargetManager { return result; } } -MorphTargetManager.EnableTextureStorage = true; -MorphTargetManager.MaxActiveMorphTargetsInVertexAttributeMode = 8; +var init_morphTargetManager = __esm(() => { + init_smartArray(); + init_logger(); + init_engineStore(); + init_morphTarget(); + init_rawTexture2DArray(); + MorphTargetManager.EnableTextureStorage = true; + MorphTargetManager.MaxActiveMorphTargetsInVertexAttributeMode = 8; +}); // node_modules/@babylonjs/core/Physics/physicsRaycastResult.js class PhysicsRaycastResult { @@ -121204,6 +131115,9 @@ class PhysicsRaycastResult { this.bodyIndex = undefined; } } +var init_physicsRaycastResult = __esm(() => { + init_math_vector(); +}); // node_modules/@babylonjs/core/Physics/v1/physicsEngine.js class PhysicsEngine { @@ -121327,6 +131241,10 @@ class PhysicsEngine { return this._physicsPlugin.raycastToRef(from, to, result); } } +var init_physicsEngine = __esm(() => { + init_math_vector(); + init_devTools(); +}); // node_modules/@babylonjs/core/Physics/v1/Plugins/cannonJSPlugin.js class CannonJSPlugin { @@ -121556,7 +131474,7 @@ class CannonJSPlugin { impostorJoint.mainImpostor.unregisterAfterPhysicsStep(impostorJoint.joint.jointData.forceApplicationCallback); } } - _addMaterial(name176, friction, restitution) { + _addMaterial(name177, friction, restitution) { let index; let mat; for (index = 0;index < this._physicsMaterials.length; index++) { @@ -121565,7 +131483,7 @@ class CannonJSPlugin { return mat; } } - const currentMat = new this.BJSCANNON.Material(name176); + const currentMat = new this.BJSCANNON.Material(name177); currentMat.friction = friction; currentMat.restitution = restitution; this._physicsMaterials.push(currentMat); @@ -121924,9 +131842,19 @@ class CannonJSPlugin { } } } -PhysicsEngine.DefaultPluginFactory = () => { - return new CannonJSPlugin; -}; +var init_cannonJSPlugin = __esm(() => { + init_logger(); + init_math_vector(); + init_buffer(); + init_physicsImpostor(); + init_physicsJoint(); + init_physicsRaycastResult(); + init_physicsEngine(); + init_math_constants(); + PhysicsEngine.DefaultPluginFactory = () => { + return new CannonJSPlugin; + }; +}); // node_modules/@babylonjs/core/Physics/v1/Plugins/oimoJSPlugin.js class OimoJSPlugin { @@ -122302,6 +132230,14 @@ class OimoJSPlugin { result.reset(from, to); } } +var init_oimoJSPlugin = __esm(() => { + init_physicsImpostor(); + init_physicsJoint(); + init_math_vector(); + init_logger(); + init_physicsRaycastResult(); + init_math_constants(); +}); // node_modules/@babylonjs/core/Physics/v1/Plugins/ammoJSPlugin.js class AmmoJSPlugin { @@ -123329,31 +133265,27 @@ class AmmoJSPlugin { this.bjsAMMO.destroy(this._tmpAmmoVectorRCB); } } -AmmoJSPlugin._DISABLE_COLLISION_FLAG = 4; -AmmoJSPlugin._KINEMATIC_FLAG = 2; -AmmoJSPlugin._DISABLE_DEACTIVATION_FLAG = 4; +var init_ammoJSPlugin = __esm(() => { + init_math_vector(); + init_logger(); + init_physicsImpostor(); + init_physicsJoint(); + init_buffer(); + init_mesh_vertexData(); + init_shapeBuilder(); + init_linesBuilder(); + init_physicsRaycastResult(); + init_math_scalar(); + init_math_constants(); + AmmoJSPlugin._DISABLE_COLLISION_FLAG = 4; + AmmoJSPlugin._KINEMATIC_FLAG = 2; + AmmoJSPlugin._DISABLE_DEACTIVATION_FLAG = 4; +}); // node_modules/@babylonjs/core/Probes/reflectionProbe.js -AbstractScene.prototype.removeReflectionProbe = function(toRemove) { - if (!this.reflectionProbes) { - return -1; - } - const index = this.reflectionProbes.indexOf(toRemove); - if (index !== -1) { - this.reflectionProbes.splice(index, 1); - } - return index; -}; -AbstractScene.prototype.addReflectionProbe = function(newReflectionProbe) { - if (!this.reflectionProbes) { - this.reflectionProbes = []; - } - this.reflectionProbes.push(newReflectionProbe); -}; - class ReflectionProbe { - constructor(name176, size, scene22, generateMipMaps = true, useFloat = false, linearSpace = false) { - this.name = name176; + constructor(name177, size, scene22, generateMipMaps = true, useFloat = false, linearSpace = false) { + this.name = name177; this._viewMatrix = Matrix.Identity(); this._target = Vector3.Zero(); this._add = Vector3.Zero(); @@ -123365,7 +133297,7 @@ class ReflectionProbe { if (scene22.getEngine().supportsUniformBuffers) { this._sceneUBOs = []; for (let i = 0;i < 6; ++i) { - this._sceneUBOs.push(scene22.createSceneUniformBuffer(`Scene for Reflection Probe (name "${name176}") face #${i}`)); + this._sceneUBOs.push(scene22.createSceneUniformBuffer(`Scene for Reflection Probe (name "${name177}") face #${i}`)); } } if (!this._scene.reflectionProbes) { @@ -123381,7 +133313,7 @@ class ReflectionProbe { textureType = 1; } } - this._renderTargetTexture = new RenderTargetTexture(name176, size, scene22, generateMipMaps, true, textureType, true); + this._renderTargetTexture = new RenderTargetTexture(name177, size, scene22, generateMipMaps, true, textureType, true); this._renderTargetTexture.gammaSpace = !linearSpace; this._renderTargetTexture.invertZ = scene22.useRightHandedSystem; const useReverseDepthBuffer = scene22.getEngine().useReverseDepthBuffer; @@ -123430,7 +133362,7 @@ class ReflectionProbe { this._renderTargetTexture.onBeforeBindObservable.add(() => { var _a, _b; this._currentSceneUBO = scene22.getSceneUniformBuffer(); - (_b = (_a = scene22.getEngine())._debugPushGroup) === null || _b === undefined || _b.call(_a, `reflection probe generation for ${name176}`, 1); + (_b = (_a = scene22.getEngine())._debugPushGroup) === null || _b === undefined || _b.call(_a, `reflection probe generation for ${name177}`, 1); currentApplyByPostProcess = this._scene.imageProcessingConfiguration.applyByPostProcess; if (linearSpace) { scene22.imageProcessingConfiguration.applyByPostProcess = true; @@ -123541,196 +133473,268 @@ class ReflectionProbe { return reflectionProbe; } } -__decorate2([ - serializeAsMeshReference() -], ReflectionProbe.prototype, "_attachedMesh", undefined); -__decorate2([ - serializeAsVector3() -], ReflectionProbe.prototype, "position", undefined); +var init_reflectionProbe = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_renderTargetTexture(); + init_math_vector(); + init_abstractScene(); + AbstractScene.prototype.removeReflectionProbe = function(toRemove) { + if (!this.reflectionProbes) { + return -1; + } + const index = this.reflectionProbes.indexOf(toRemove); + if (index !== -1) { + this.reflectionProbes.splice(index, 1); + } + return index; + }; + AbstractScene.prototype.addReflectionProbe = function(newReflectionProbe) { + if (!this.reflectionProbes) { + this.reflectionProbes = []; + } + this.reflectionProbes.push(newReflectionProbe); + }; + __decorate2([ + serializeAsMeshReference() + ], ReflectionProbe.prototype, "_attachedMesh", undefined); + __decorate2([ + serializeAsVector3() + ], ReflectionProbe.prototype, "position", undefined); +}); // node_modules/@babylonjs/core/Loading/Plugins/babylonFileLoader.js class BabylonFileLoaderConfiguration { } -BabylonFileLoaderConfiguration.LoaderInjectedPhysicsEngine = undefined; -var tempIndexContainer = {}; -var tempMaterialIndexContainer = {}; -var parseMaterialByPredicate = (predicate, parsedData, scene22, rootUrl) => { - if (!parsedData.materials) { +var _BabylonLoaderRegistered, tempIndexContainer, tempMaterialIndexContainer, parseMaterialByPredicate, isDescendantOf, logOperation, loadDetailLevels, findParent, findMaterial, loadAssetContainer; +var init_babylonFileLoader = __esm(() => { + init_logger(); + init_camera(); + init_math_vector(); + init_math_color(); + init_mesh(); + init_geometry(); + init_transformNode(); + init_material(); + init_multiMaterial(); + init_cubeTexture(); + init_hdrCubeTexture(); + init_animationGroup(); + init_light(); + init_sceneComponent(); + init_sceneLoader(); + init_abstractScene(); + init_assetContainer(); + init_actionManager(); + init_skeleton(); + init_morphTargetManager(); + init_cannonJSPlugin(); + init_oimoJSPlugin(); + init_ammoJSPlugin(); + init_reflectionProbe(); + init_typeStore(); + init_tools(); + init_postProcess(); + _BabylonLoaderRegistered = true; + BabylonFileLoaderConfiguration.LoaderInjectedPhysicsEngine = undefined; + tempIndexContainer = {}; + tempMaterialIndexContainer = {}; + parseMaterialByPredicate = (predicate, parsedData, scene22, rootUrl) => { + if (!parsedData.materials) { + return null; + } + for (let index = 0, cache = parsedData.materials.length;index < cache; index++) { + const parsedMaterial = parsedData.materials[index]; + if (predicate(parsedMaterial)) { + return { parsedMaterial, material: Material.Parse(parsedMaterial, scene22, rootUrl) }; + } + } return null; - } - for (let index = 0, cache = parsedData.materials.length;index < cache; index++) { - const parsedMaterial = parsedData.materials[index]; - if (predicate(parsedMaterial)) { - return { parsedMaterial, material: Material.Parse(parsedMaterial, scene22, rootUrl) }; + }; + isDescendantOf = (mesh48, names, hierarchyIds) => { + for (const i in names) { + if (mesh48.name === names[i]) { + hierarchyIds.push(mesh48.id); + return true; + } } - } - return null; -}; -var isDescendantOf = (mesh48, names, hierarchyIds) => { - for (const i in names) { - if (mesh48.name === names[i]) { + if (mesh48.parentId !== undefined && hierarchyIds.indexOf(mesh48.parentId) !== -1) { hierarchyIds.push(mesh48.id); return true; } - } - if (mesh48.parentId !== undefined && hierarchyIds.indexOf(mesh48.parentId) !== -1) { - hierarchyIds.push(mesh48.id); - return true; - } - return false; -}; -var logOperation = (operation, producer) => { - return operation + " of " + (producer ? producer.file + " from " + producer.name + " version: " + producer.version + ", exporter version: " + producer.exporter_version : "unknown"); -}; -var loadDetailLevels = (scene22, mesh48) => { - const mastermesh = mesh48; - if (mesh48._waitingData.lods) { - if (mesh48._waitingData.lods.ids && mesh48._waitingData.lods.ids.length > 0) { - const lodmeshes = mesh48._waitingData.lods.ids; - const wasenabled = mastermesh.isEnabled(false); - if (mesh48._waitingData.lods.distances) { - const distances = mesh48._waitingData.lods.distances; - if (distances.length >= lodmeshes.length) { - const culling = distances.length > lodmeshes.length ? distances[distances.length - 1] : 0; - mastermesh.setEnabled(false); - for (let index = 0;index < lodmeshes.length; index++) { - const lodid = lodmeshes[index]; - const lodmesh = scene22.getMeshById(lodid); - if (lodmesh != null) { - mastermesh.addLODLevel(distances[index], lodmesh); + return false; + }; + logOperation = (operation, producer) => { + return operation + " of " + (producer ? producer.file + " from " + producer.name + " version: " + producer.version + ", exporter version: " + producer.exporter_version : "unknown"); + }; + loadDetailLevels = (scene22, mesh48) => { + const mastermesh = mesh48; + if (mesh48._waitingData.lods) { + if (mesh48._waitingData.lods.ids && mesh48._waitingData.lods.ids.length > 0) { + const lodmeshes = mesh48._waitingData.lods.ids; + const wasenabled = mastermesh.isEnabled(false); + if (mesh48._waitingData.lods.distances) { + const distances = mesh48._waitingData.lods.distances; + if (distances.length >= lodmeshes.length) { + const culling = distances.length > lodmeshes.length ? distances[distances.length - 1] : 0; + mastermesh.setEnabled(false); + for (let index = 0;index < lodmeshes.length; index++) { + const lodid = lodmeshes[index]; + const lodmesh = scene22.getMeshById(lodid); + if (lodmesh != null) { + mastermesh.addLODLevel(distances[index], lodmesh); + } } + if (culling > 0) { + mastermesh.addLODLevel(culling, null); + } + if (wasenabled === true) { + mastermesh.setEnabled(true); + } + } else { + Tools.Warn("Invalid level of detail distances for " + mesh48.name); } - if (culling > 0) { - mastermesh.addLODLevel(culling, null); - } - if (wasenabled === true) { - mastermesh.setEnabled(true); - } - } else { - Tools.Warn("Invalid level of detail distances for " + mesh48.name); } } + mesh48._waitingData.lods = null; } - mesh48._waitingData.lods = null; - } -}; -var findParent = (parentId, parentInstanceIndex, scene22) => { - if (typeof parentId !== "number") { - const parentEntry = scene22.getLastEntryById(parentId); - if (parentEntry && parentInstanceIndex !== undefined && parentInstanceIndex !== null) { - const instance = parentEntry.instances[parseInt(parentInstanceIndex)]; + }; + findParent = (parentId, parentInstanceIndex, scene22) => { + if (typeof parentId !== "number") { + const parentEntry = scene22.getLastEntryById(parentId); + if (parentEntry && parentInstanceIndex !== undefined && parentInstanceIndex !== null) { + const instance = parentEntry.instances[parseInt(parentInstanceIndex)]; + return instance; + } + return parentEntry; + } + const parent = tempIndexContainer[parentId]; + if (parent && parentInstanceIndex !== undefined && parentInstanceIndex !== null) { + const instance = parent.instances[parseInt(parentInstanceIndex)]; return instance; } - return parentEntry; - } - const parent = tempIndexContainer[parentId]; - if (parent && parentInstanceIndex !== undefined && parentInstanceIndex !== null) { - const instance = parent.instances[parseInt(parentInstanceIndex)]; - return instance; - } - return parent; -}; -var findMaterial = (materialId, scene22) => { - if (typeof materialId !== "number") { - return scene22.getLastMaterialById(materialId, true); - } - return tempMaterialIndexContainer[materialId]; -}; -var loadAssetContainer = (scene22, data, rootUrl, onError, addToScene = false) => { - const container = new AssetContainer(scene22); - let log = "importScene has failed JSON parse"; - try { - var parsedData = JSON.parse(data); - log = ""; - const fullDetails = SceneLoader.loggingLevel === SceneLoader.DETAILED_LOGGING; - let index; - let cache; - if (parsedData.environmentTexture !== undefined && parsedData.environmentTexture !== null) { - const isPBR = parsedData.isPBR !== undefined ? parsedData.isPBR : true; - if (parsedData.environmentTextureType && parsedData.environmentTextureType === "BABYLON.HDRCubeTexture") { - const hdrSize = parsedData.environmentTextureSize ? parsedData.environmentTextureSize : 128; - const hdrTexture = new HDRCubeTexture((parsedData.environmentTexture.match(/https?:\/\//g) ? "" : rootUrl) + parsedData.environmentTexture, scene22, hdrSize, true, !isPBR, undefined, parsedData.environmentTexturePrefilterOnLoad); - if (parsedData.environmentTextureRotationY) { - hdrTexture.rotationY = parsedData.environmentTextureRotationY; - } - scene22.environmentTexture = hdrTexture; - } else { - if (typeof parsedData.environmentTexture === "object") { - const environmentTexture = CubeTexture.Parse(parsedData.environmentTexture, scene22, rootUrl); - scene22.environmentTexture = environmentTexture; - } else if (parsedData.environmentTexture.endsWith(".env")) { - const compressedTexture = new CubeTexture((parsedData.environmentTexture.match(/https?:\/\//g) ? "" : rootUrl) + parsedData.environmentTexture, scene22, parsedData.environmentTextureForcedExtension); + return parent; + }; + findMaterial = (materialId, scene22) => { + if (typeof materialId !== "number") { + return scene22.getLastMaterialById(materialId, true); + } + return tempMaterialIndexContainer[materialId]; + }; + loadAssetContainer = (scene22, data, rootUrl, onError, addToScene = false) => { + const container = new AssetContainer(scene22); + let log = "importScene has failed JSON parse"; + try { + var parsedData = JSON.parse(data); + log = ""; + const fullDetails = SceneLoader.loggingLevel === SceneLoader.DETAILED_LOGGING; + let index; + let cache; + if (parsedData.environmentTexture !== undefined && parsedData.environmentTexture !== null) { + const isPBR = parsedData.isPBR !== undefined ? parsedData.isPBR : true; + if (parsedData.environmentTextureType && parsedData.environmentTextureType === "BABYLON.HDRCubeTexture") { + const hdrSize = parsedData.environmentTextureSize ? parsedData.environmentTextureSize : 128; + const hdrTexture = new HDRCubeTexture((parsedData.environmentTexture.match(/https?:\/\//g) ? "" : rootUrl) + parsedData.environmentTexture, scene22, hdrSize, true, !isPBR, undefined, parsedData.environmentTexturePrefilterOnLoad); if (parsedData.environmentTextureRotationY) { - compressedTexture.rotationY = parsedData.environmentTextureRotationY; + hdrTexture.rotationY = parsedData.environmentTextureRotationY; } - scene22.environmentTexture = compressedTexture; + scene22.environmentTexture = hdrTexture; } else { - const cubeTexture3 = CubeTexture.CreateFromPrefilteredData((parsedData.environmentTexture.match(/https?:\/\//g) ? "" : rootUrl) + parsedData.environmentTexture, scene22, parsedData.environmentTextureForcedExtension); - if (parsedData.environmentTextureRotationY) { - cubeTexture3.rotationY = parsedData.environmentTextureRotationY; + if (typeof parsedData.environmentTexture === "object") { + const environmentTexture = CubeTexture.Parse(parsedData.environmentTexture, scene22, rootUrl); + scene22.environmentTexture = environmentTexture; + } else if (parsedData.environmentTexture.endsWith(".env")) { + const compressedTexture = new CubeTexture((parsedData.environmentTexture.match(/https?:\/\//g) ? "" : rootUrl) + parsedData.environmentTexture, scene22, parsedData.environmentTextureForcedExtension); + if (parsedData.environmentTextureRotationY) { + compressedTexture.rotationY = parsedData.environmentTextureRotationY; + } + scene22.environmentTexture = compressedTexture; + } else { + const cubeTexture3 = CubeTexture.CreateFromPrefilteredData((parsedData.environmentTexture.match(/https?:\/\//g) ? "" : rootUrl) + parsedData.environmentTexture, scene22, parsedData.environmentTextureForcedExtension); + if (parsedData.environmentTextureRotationY) { + cubeTexture3.rotationY = parsedData.environmentTextureRotationY; + } + scene22.environmentTexture = cubeTexture3; + } + } + if (parsedData.createDefaultSkybox === true) { + const skyboxScale = scene22.activeCamera !== undefined && scene22.activeCamera !== null ? (scene22.activeCamera.maxZ - scene22.activeCamera.minZ) / 2 : 1000; + const skyboxBlurLevel = parsedData.skyboxBlurLevel || 0; + scene22.createDefaultSkybox(scene22.environmentTexture, isPBR, skyboxScale, skyboxBlurLevel); + } + container.environmentTexture = scene22.environmentTexture; + } + if (parsedData.environmentIntensity !== undefined && parsedData.environmentIntensity !== null) { + scene22.environmentIntensity = parsedData.environmentIntensity; + } + if (parsedData.lights !== undefined && parsedData.lights !== null) { + for (index = 0, cache = parsedData.lights.length;index < cache; index++) { + const parsedLight = parsedData.lights[index]; + const light11 = Light.Parse(parsedLight, scene22); + if (light11) { + tempIndexContainer[parsedLight.uniqueId] = light11; + container.lights.push(light11); + light11._parentContainer = container; + log += index === 0 ? "\n\tLights:" : ""; + log += "\n\t\t" + light11.toString(fullDetails); } - scene22.environmentTexture = cubeTexture3; } } - if (parsedData.createDefaultSkybox === true) { - const skyboxScale = scene22.activeCamera !== undefined && scene22.activeCamera !== null ? (scene22.activeCamera.maxZ - scene22.activeCamera.minZ) / 2 : 1000; - const skyboxBlurLevel = parsedData.skyboxBlurLevel || 0; - scene22.createDefaultSkybox(scene22.environmentTexture, isPBR, skyboxScale, skyboxBlurLevel); - } - container.environmentTexture = scene22.environmentTexture; - } - if (parsedData.environmentIntensity !== undefined && parsedData.environmentIntensity !== null) { - scene22.environmentIntensity = parsedData.environmentIntensity; - } - if (parsedData.lights !== undefined && parsedData.lights !== null) { - for (index = 0, cache = parsedData.lights.length;index < cache; index++) { - const parsedLight = parsedData.lights[index]; - const light11 = Light.Parse(parsedLight, scene22); - if (light11) { - tempIndexContainer[parsedLight.uniqueId] = light11; - container.lights.push(light11); - light11._parentContainer = container; - log += index === 0 ? "\n\tLights:" : ""; - log += "\n\t\t" + light11.toString(fullDetails); + if (parsedData.reflectionProbes !== undefined && parsedData.reflectionProbes !== null) { + for (index = 0, cache = parsedData.reflectionProbes.length;index < cache; index++) { + const parsedReflectionProbe = parsedData.reflectionProbes[index]; + const reflectionProbe2 = ReflectionProbe.Parse(parsedReflectionProbe, scene22, rootUrl); + if (reflectionProbe2) { + container.reflectionProbes.push(reflectionProbe2); + reflectionProbe2._parentContainer = container; + log += index === 0 ? "\n\tReflection Probes:" : ""; + log += "\n\t\t" + reflectionProbe2.toString(fullDetails); + } } } - } - if (parsedData.reflectionProbes !== undefined && parsedData.reflectionProbes !== null) { - for (index = 0, cache = parsedData.reflectionProbes.length;index < cache; index++) { - const parsedReflectionProbe = parsedData.reflectionProbes[index]; - const reflectionProbe2 = ReflectionProbe.Parse(parsedReflectionProbe, scene22, rootUrl); - if (reflectionProbe2) { - container.reflectionProbes.push(reflectionProbe2); - reflectionProbe2._parentContainer = container; - log += index === 0 ? "\n\tReflection Probes:" : ""; - log += "\n\t\t" + reflectionProbe2.toString(fullDetails); + if (parsedData.animations !== undefined && parsedData.animations !== null) { + for (index = 0, cache = parsedData.animations.length;index < cache; index++) { + const parsedAnimation = parsedData.animations[index]; + const internalClass = GetClass("BABYLON.Animation"); + if (internalClass) { + const animation13 = internalClass.Parse(parsedAnimation); + scene22.animations.push(animation13); + container.animations.push(animation13); + log += index === 0 ? "\n\tAnimations:" : ""; + log += "\n\t\t" + animation13.toString(fullDetails); + } } } - } - if (parsedData.animations !== undefined && parsedData.animations !== null) { - for (index = 0, cache = parsedData.animations.length;index < cache; index++) { - const parsedAnimation = parsedData.animations[index]; - const internalClass = GetClass("BABYLON.Animation"); - if (internalClass) { - const animation13 = internalClass.Parse(parsedAnimation); - scene22.animations.push(animation13); - container.animations.push(animation13); - log += index === 0 ? "\n\tAnimations:" : ""; - log += "\n\t\t" + animation13.toString(fullDetails); + if (parsedData.materials !== undefined && parsedData.materials !== null) { + for (index = 0, cache = parsedData.materials.length;index < cache; index++) { + const parsedMaterial = parsedData.materials[index]; + const mat = Material.Parse(parsedMaterial, scene22, rootUrl); + if (mat) { + tempMaterialIndexContainer[parsedMaterial.uniqueId || parsedMaterial.id] = mat; + container.materials.push(mat); + mat._parentContainer = container; + log += index === 0 ? "\n\tMaterials:" : ""; + log += "\n\t\t" + mat.toString(fullDetails); + const textures = mat.getActiveTextures(); + textures.forEach((t) => { + if (container.textures.indexOf(t) == -1) { + container.textures.push(t); + t._parentContainer = container; + } + }); + } } } - } - if (parsedData.materials !== undefined && parsedData.materials !== null) { - for (index = 0, cache = parsedData.materials.length;index < cache; index++) { - const parsedMaterial = parsedData.materials[index]; - const mat = Material.Parse(parsedMaterial, scene22, rootUrl); - if (mat) { - tempMaterialIndexContainer[parsedMaterial.uniqueId || parsedMaterial.id] = mat; - container.materials.push(mat); - mat._parentContainer = container; - log += index === 0 ? "\n\tMaterials:" : ""; - log += "\n\t\t" + mat.toString(fullDetails); - const textures = mat.getActiveTextures(); + if (parsedData.multiMaterials !== undefined && parsedData.multiMaterials !== null) { + for (index = 0, cache = parsedData.multiMaterials.length;index < cache; index++) { + const parsedMultiMaterial = parsedData.multiMaterials[index]; + const mmat = MultiMaterial.ParseMultiMaterial(parsedMultiMaterial, scene22); + tempMaterialIndexContainer[parsedMultiMaterial.uniqueId || parsedMultiMaterial.id] = mmat; + container.multiMaterials.push(mmat); + mmat._parentContainer = container; + log += index === 0 ? "\n\tMultiMaterials:" : ""; + log += "\n\t\t" + mmat.toString(fullDetails); + const textures = mmat.getActiveTextures(); textures.forEach((t) => { if (container.textures.indexOf(t) == -1) { container.textures.push(t); @@ -123739,597 +133743,602 @@ var loadAssetContainer = (scene22, data, rootUrl, onError, addToScene = false) = }); } } - } - if (parsedData.multiMaterials !== undefined && parsedData.multiMaterials !== null) { - for (index = 0, cache = parsedData.multiMaterials.length;index < cache; index++) { - const parsedMultiMaterial = parsedData.multiMaterials[index]; - const mmat = MultiMaterial.ParseMultiMaterial(parsedMultiMaterial, scene22); - tempMaterialIndexContainer[parsedMultiMaterial.uniqueId || parsedMultiMaterial.id] = mmat; - container.multiMaterials.push(mmat); - mmat._parentContainer = container; - log += index === 0 ? "\n\tMultiMaterials:" : ""; - log += "\n\t\t" + mmat.toString(fullDetails); - const textures = mmat.getActiveTextures(); - textures.forEach((t) => { - if (container.textures.indexOf(t) == -1) { - container.textures.push(t); - t._parentContainer = container; - } - }); - } - } - if (parsedData.morphTargetManagers !== undefined && parsedData.morphTargetManagers !== null) { - for (const managerData of parsedData.morphTargetManagers) { - const manager = MorphTargetManager.Parse(managerData, scene22); - container.morphTargetManagers.push(manager); - manager._parentContainer = container; - } - } - if (parsedData.skeletons !== undefined && parsedData.skeletons !== null) { - for (index = 0, cache = parsedData.skeletons.length;index < cache; index++) { - const parsedSkeleton = parsedData.skeletons[index]; - const skeleton3 = Skeleton.Parse(parsedSkeleton, scene22); - container.skeletons.push(skeleton3); - skeleton3._parentContainer = container; - log += index === 0 ? "\n\tSkeletons:" : ""; - log += "\n\t\t" + skeleton3.toString(fullDetails); - } - } - const geometries = parsedData.geometries; - if (geometries !== undefined && geometries !== null) { - const addedGeometry = new Array; - const vertexData = geometries.vertexData; - if (vertexData !== undefined && vertexData !== null) { - for (index = 0, cache = vertexData.length;index < cache; index++) { - const parsedVertexData = vertexData[index]; - addedGeometry.push(Geometry.Parse(parsedVertexData, scene22, rootUrl)); - } + if (parsedData.morphTargetManagers !== undefined && parsedData.morphTargetManagers !== null) { + for (const managerData of parsedData.morphTargetManagers) { + const manager = MorphTargetManager.Parse(managerData, scene22); + container.morphTargetManagers.push(manager); + manager._parentContainer = container; + } } - addedGeometry.forEach((g) => { - if (g) { - container.geometries.push(g); - g._parentContainer = container; + if (parsedData.skeletons !== undefined && parsedData.skeletons !== null) { + for (index = 0, cache = parsedData.skeletons.length;index < cache; index++) { + const parsedSkeleton = parsedData.skeletons[index]; + const skeleton3 = Skeleton.Parse(parsedSkeleton, scene22); + container.skeletons.push(skeleton3); + skeleton3._parentContainer = container; + log += index === 0 ? "\n\tSkeletons:" : ""; + log += "\n\t\t" + skeleton3.toString(fullDetails); } - }); - } - if (parsedData.transformNodes !== undefined && parsedData.transformNodes !== null) { - for (index = 0, cache = parsedData.transformNodes.length;index < cache; index++) { - const parsedTransformNode = parsedData.transformNodes[index]; - const node29 = TransformNode.Parse(parsedTransformNode, scene22, rootUrl); - tempIndexContainer[parsedTransformNode.uniqueId] = node29; - container.transformNodes.push(node29); - node29._parentContainer = container; } - } - if (parsedData.meshes !== undefined && parsedData.meshes !== null) { - for (index = 0, cache = parsedData.meshes.length;index < cache; index++) { - const parsedMesh = parsedData.meshes[index]; - const mesh48 = Mesh.Parse(parsedMesh, scene22, rootUrl); - tempIndexContainer[parsedMesh.uniqueId] = mesh48; - container.meshes.push(mesh48); - mesh48._parentContainer = container; - if (mesh48.hasInstances) { - for (const instance of mesh48.instances) { - container.meshes.push(instance); - instance._parentContainer = container; + const geometries = parsedData.geometries; + if (geometries !== undefined && geometries !== null) { + const addedGeometry = new Array; + const vertexData = geometries.vertexData; + if (vertexData !== undefined && vertexData !== null) { + for (index = 0, cache = vertexData.length;index < cache; index++) { + const parsedVertexData = vertexData[index]; + addedGeometry.push(Geometry.Parse(parsedVertexData, scene22, rootUrl)); } } - log += index === 0 ? "\n\tMeshes:" : ""; - log += "\n\t\t" + mesh48.toString(fullDetails); - } - } - if (parsedData.cameras !== undefined && parsedData.cameras !== null) { - for (index = 0, cache = parsedData.cameras.length;index < cache; index++) { - const parsedCamera = parsedData.cameras[index]; - const camera29 = Camera.Parse(parsedCamera, scene22); - tempIndexContainer[parsedCamera.uniqueId] = camera29; - container.cameras.push(camera29); - camera29._parentContainer = container; - log += index === 0 ? "\n\tCameras:" : ""; - log += "\n\t\t" + camera29.toString(fullDetails); + addedGeometry.forEach((g) => { + if (g) { + container.geometries.push(g); + g._parentContainer = container; + } + }); } - } - if (parsedData.postProcesses !== undefined && parsedData.postProcesses !== null) { - for (index = 0, cache = parsedData.postProcesses.length;index < cache; index++) { - const parsedPostProcess = parsedData.postProcesses[index]; - const postProcess15 = PostProcess.Parse(parsedPostProcess, scene22, rootUrl); - if (postProcess15) { - container.postProcesses.push(postProcess15); - postProcess15._parentContainer = container; - log += index === 0 ? "\nPostprocesses:" : ""; - log += "\n\t\t" + postProcess15.toString(); + if (parsedData.transformNodes !== undefined && parsedData.transformNodes !== null) { + for (index = 0, cache = parsedData.transformNodes.length;index < cache; index++) { + const parsedTransformNode = parsedData.transformNodes[index]; + const node29 = TransformNode.Parse(parsedTransformNode, scene22, rootUrl); + tempIndexContainer[parsedTransformNode.uniqueId] = node29; + container.transformNodes.push(node29); + node29._parentContainer = container; } } - } - if (parsedData.animationGroups !== undefined && parsedData.animationGroups !== null) { - for (index = 0, cache = parsedData.animationGroups.length;index < cache; index++) { - const parsedAnimationGroup = parsedData.animationGroups[index]; - const animationGroup3 = AnimationGroup.Parse(parsedAnimationGroup, scene22); - container.animationGroups.push(animationGroup3); - animationGroup3._parentContainer = container; - log += index === 0 ? "\n\tAnimationGroups:" : ""; - log += "\n\t\t" + animationGroup3.toString(fullDetails); + if (parsedData.meshes !== undefined && parsedData.meshes !== null) { + for (index = 0, cache = parsedData.meshes.length;index < cache; index++) { + const parsedMesh = parsedData.meshes[index]; + const mesh48 = Mesh.Parse(parsedMesh, scene22, rootUrl); + tempIndexContainer[parsedMesh.uniqueId] = mesh48; + container.meshes.push(mesh48); + mesh48._parentContainer = container; + if (mesh48.hasInstances) { + for (const instance of mesh48.instances) { + container.meshes.push(instance); + instance._parentContainer = container; + } + } + log += index === 0 ? "\n\tMeshes:" : ""; + log += "\n\t\t" + mesh48.toString(fullDetails); + } + } + if (parsedData.cameras !== undefined && parsedData.cameras !== null) { + for (index = 0, cache = parsedData.cameras.length;index < cache; index++) { + const parsedCamera = parsedData.cameras[index]; + const camera29 = Camera.Parse(parsedCamera, scene22); + tempIndexContainer[parsedCamera.uniqueId] = camera29; + container.cameras.push(camera29); + camera29._parentContainer = container; + log += index === 0 ? "\n\tCameras:" : ""; + log += "\n\t\t" + camera29.toString(fullDetails); + } + } + if (parsedData.postProcesses !== undefined && parsedData.postProcesses !== null) { + for (index = 0, cache = parsedData.postProcesses.length;index < cache; index++) { + const parsedPostProcess = parsedData.postProcesses[index]; + const postProcess15 = PostProcess.Parse(parsedPostProcess, scene22, rootUrl); + if (postProcess15) { + container.postProcesses.push(postProcess15); + postProcess15._parentContainer = container; + log += index === 0 ? "\nPostprocesses:" : ""; + log += "\n\t\t" + postProcess15.toString(); + } + } } - } - for (index = 0, cache = scene22.cameras.length;index < cache; index++) { - const camera29 = scene22.cameras[index]; - if (camera29._waitingParentId !== null) { - camera29.parent = findParent(camera29._waitingParentId, camera29._waitingParentInstanceIndex, scene22); - camera29._waitingParentId = null; - camera29._waitingParentInstanceIndex = null; + if (parsedData.animationGroups !== undefined && parsedData.animationGroups !== null) { + for (index = 0, cache = parsedData.animationGroups.length;index < cache; index++) { + const parsedAnimationGroup = parsedData.animationGroups[index]; + const animationGroup3 = AnimationGroup.Parse(parsedAnimationGroup, scene22); + container.animationGroups.push(animationGroup3); + animationGroup3._parentContainer = container; + log += index === 0 ? "\n\tAnimationGroups:" : ""; + log += "\n\t\t" + animationGroup3.toString(fullDetails); + } } - } - for (index = 0, cache = scene22.lights.length;index < cache; index++) { - const light11 = scene22.lights[index]; - if (light11 && light11._waitingParentId !== null) { - light11.parent = findParent(light11._waitingParentId, light11._waitingParentInstanceIndex, scene22); - light11._waitingParentId = null; - light11._waitingParentInstanceIndex = null; + for (index = 0, cache = scene22.cameras.length;index < cache; index++) { + const camera29 = scene22.cameras[index]; + if (camera29._waitingParentId !== null) { + camera29.parent = findParent(camera29._waitingParentId, camera29._waitingParentInstanceIndex, scene22); + camera29._waitingParentId = null; + camera29._waitingParentInstanceIndex = null; + } } - } - for (index = 0, cache = scene22.transformNodes.length;index < cache; index++) { - const transformNode16 = scene22.transformNodes[index]; - if (transformNode16._waitingParentId !== null) { - transformNode16.parent = findParent(transformNode16._waitingParentId, transformNode16._waitingParentInstanceIndex, scene22); - transformNode16._waitingParentId = null; - transformNode16._waitingParentInstanceIndex = null; + for (index = 0, cache = scene22.lights.length;index < cache; index++) { + const light11 = scene22.lights[index]; + if (light11 && light11._waitingParentId !== null) { + light11.parent = findParent(light11._waitingParentId, light11._waitingParentInstanceIndex, scene22); + light11._waitingParentId = null; + light11._waitingParentInstanceIndex = null; + } } - } - for (index = 0, cache = scene22.meshes.length;index < cache; index++) { - const mesh48 = scene22.meshes[index]; - if (mesh48._waitingParentId !== null) { - mesh48.parent = findParent(mesh48._waitingParentId, mesh48._waitingParentInstanceIndex, scene22); - mesh48._waitingParentId = null; - mesh48._waitingParentInstanceIndex = null; + for (index = 0, cache = scene22.transformNodes.length;index < cache; index++) { + const transformNode16 = scene22.transformNodes[index]; + if (transformNode16._waitingParentId !== null) { + transformNode16.parent = findParent(transformNode16._waitingParentId, transformNode16._waitingParentInstanceIndex, scene22); + transformNode16._waitingParentId = null; + transformNode16._waitingParentInstanceIndex = null; + } } - if (mesh48._waitingData.lods) { - loadDetailLevels(scene22, mesh48); + for (index = 0, cache = scene22.meshes.length;index < cache; index++) { + const mesh48 = scene22.meshes[index]; + if (mesh48._waitingParentId !== null) { + mesh48.parent = findParent(mesh48._waitingParentId, mesh48._waitingParentInstanceIndex, scene22); + mesh48._waitingParentId = null; + mesh48._waitingParentInstanceIndex = null; + } + if (mesh48._waitingData.lods) { + loadDetailLevels(scene22, mesh48); + } } - } - scene22.multiMaterials.forEach((multimat) => { - multimat._waitingSubMaterialsUniqueIds.forEach((subMaterial) => { - multimat.subMaterials.push(findMaterial(subMaterial, scene22)); + scene22.multiMaterials.forEach((multimat) => { + multimat._waitingSubMaterialsUniqueIds.forEach((subMaterial) => { + multimat.subMaterials.push(findMaterial(subMaterial, scene22)); + }); + multimat._waitingSubMaterialsUniqueIds = []; }); - multimat._waitingSubMaterialsUniqueIds = []; - }); - scene22.meshes.forEach((mesh48) => { - if (mesh48._waitingMaterialId !== null) { - mesh48.material = findMaterial(mesh48._waitingMaterialId, scene22); - mesh48._waitingMaterialId = null; - } - }); - for (index = 0, cache = scene22.skeletons.length;index < cache; index++) { - const skeleton3 = scene22.skeletons[index]; - if (skeleton3._hasWaitingData) { - if (skeleton3.bones != null) { - skeleton3.bones.forEach((bone4) => { - if (bone4._waitingTransformNodeId) { - const linkTransformNode = scene22.getLastEntryById(bone4._waitingTransformNodeId); - if (linkTransformNode) { - bone4.linkTransformNode(linkTransformNode); + scene22.meshes.forEach((mesh48) => { + if (mesh48._waitingMaterialId !== null) { + mesh48.material = findMaterial(mesh48._waitingMaterialId, scene22); + mesh48._waitingMaterialId = null; + } + }); + for (index = 0, cache = scene22.skeletons.length;index < cache; index++) { + const skeleton3 = scene22.skeletons[index]; + if (skeleton3._hasWaitingData) { + if (skeleton3.bones != null) { + skeleton3.bones.forEach((bone4) => { + if (bone4._waitingTransformNodeId) { + const linkTransformNode = scene22.getLastEntryById(bone4._waitingTransformNodeId); + if (linkTransformNode) { + bone4.linkTransformNode(linkTransformNode); + } + bone4._waitingTransformNodeId = null; } - bone4._waitingTransformNodeId = null; - } - }); + }); + } + skeleton3._hasWaitingData = null; } - skeleton3._hasWaitingData = null; } - } - for (index = 0, cache = scene22.meshes.length;index < cache; index++) { - const currentMesh = scene22.meshes[index]; - if (currentMesh._waitingData.freezeWorldMatrix) { - currentMesh.freezeWorldMatrix(); - currentMesh._waitingData.freezeWorldMatrix = null; - } else { - currentMesh.computeWorldMatrix(true); + for (index = 0, cache = scene22.meshes.length;index < cache; index++) { + const currentMesh = scene22.meshes[index]; + if (currentMesh._waitingData.freezeWorldMatrix) { + currentMesh.freezeWorldMatrix(); + currentMesh._waitingData.freezeWorldMatrix = null; + } else { + currentMesh.computeWorldMatrix(true); + } } - } - for (index = 0, cache = scene22.lights.length;index < cache; index++) { - const light11 = scene22.lights[index]; - if (light11._excludedMeshesIds.length > 0) { - for (let excludedIndex = 0;excludedIndex < light11._excludedMeshesIds.length; excludedIndex++) { - const excludedMesh = scene22.getMeshById(light11._excludedMeshesIds[excludedIndex]); - if (excludedMesh) { - light11.excludedMeshes.push(excludedMesh); + for (index = 0, cache = scene22.lights.length;index < cache; index++) { + const light11 = scene22.lights[index]; + if (light11._excludedMeshesIds.length > 0) { + for (let excludedIndex = 0;excludedIndex < light11._excludedMeshesIds.length; excludedIndex++) { + const excludedMesh = scene22.getMeshById(light11._excludedMeshesIds[excludedIndex]); + if (excludedMesh) { + light11.excludedMeshes.push(excludedMesh); + } } + light11._excludedMeshesIds = []; } - light11._excludedMeshesIds = []; - } - if (light11._includedOnlyMeshesIds.length > 0) { - for (let includedOnlyIndex = 0;includedOnlyIndex < light11._includedOnlyMeshesIds.length; includedOnlyIndex++) { - const includedOnlyMesh = scene22.getMeshById(light11._includedOnlyMeshesIds[includedOnlyIndex]); - if (includedOnlyMesh) { - light11.includedOnlyMeshes.push(includedOnlyMesh); + if (light11._includedOnlyMeshesIds.length > 0) { + for (let includedOnlyIndex = 0;includedOnlyIndex < light11._includedOnlyMeshesIds.length; includedOnlyIndex++) { + const includedOnlyMesh = scene22.getMeshById(light11._includedOnlyMeshesIds[includedOnlyIndex]); + if (includedOnlyMesh) { + light11.includedOnlyMeshes.push(includedOnlyMesh); + } } + light11._includedOnlyMeshesIds = []; } - light11._includedOnlyMeshesIds = []; } - } - scene22.geometries.forEach((g) => { - g._loadedUniqueId = ""; - }); - AbstractScene.Parse(parsedData, scene22, container, rootUrl); - for (index = 0, cache = scene22.meshes.length;index < cache; index++) { - const mesh48 = scene22.meshes[index]; - if (mesh48._waitingData.actions) { - ActionManager.Parse(mesh48._waitingData.actions, mesh48, scene22); - mesh48._waitingData.actions = null; + scene22.geometries.forEach((g) => { + g._loadedUniqueId = ""; + }); + AbstractScene.Parse(parsedData, scene22, container, rootUrl); + for (index = 0, cache = scene22.meshes.length;index < cache; index++) { + const mesh48 = scene22.meshes[index]; + if (mesh48._waitingData.actions) { + ActionManager.Parse(mesh48._waitingData.actions, mesh48, scene22); + mesh48._waitingData.actions = null; + } + } + if (parsedData.actions !== undefined && parsedData.actions !== null) { + ActionManager.Parse(parsedData.actions, null, scene22); + } + } catch (err) { + const msg = logOperation("loadAssets", parsedData ? parsedData.producer : "Unknown") + log; + if (onError) { + onError(msg, err); + } else { + Logger.Log(msg); + throw err; + } + } finally { + tempIndexContainer = {}; + tempMaterialIndexContainer = {}; + if (!addToScene) { + container.removeAllFromScene(); + } + if (log !== null && SceneLoader.loggingLevel !== SceneLoader.NO_LOGGING) { + Logger.Log(logOperation("loadAssets", parsedData ? parsedData.producer : "Unknown") + (SceneLoader.loggingLevel !== SceneLoader.MINIMAL_LOGGING ? log : "")); } } - if (parsedData.actions !== undefined && parsedData.actions !== null) { - ActionManager.Parse(parsedData.actions, null, scene22); - } - } catch (err) { - const msg = logOperation("loadAssets", parsedData ? parsedData.producer : "Unknown") + log; - if (onError) { - onError(msg, err); - } else { - Logger.Log(msg); - throw err; - } - } finally { - tempIndexContainer = {}; - tempMaterialIndexContainer = {}; - if (!addToScene) { - container.removeAllFromScene(); - } - if (log !== null && SceneLoader.loggingLevel !== SceneLoader.NO_LOGGING) { - Logger.Log(logOperation("loadAssets", parsedData ? parsedData.producer : "Unknown") + (SceneLoader.loggingLevel !== SceneLoader.MINIMAL_LOGGING ? log : "")); - } - } - return container; -}; -SceneLoader.RegisterPlugin({ - name: "babylon.js", - extensions: ".babylon", - canDirectLoad: (data) => { - if (data.indexOf("babylon") !== -1) { - return true; - } - return false; - }, - importMesh: (meshesNames, scene22, data, rootUrl, meshes, particleSystems, skeletons, onError) => { - var _a; - let log = "importMesh has failed JSON parse"; - try { - var parsedData = JSON.parse(data); - log = ""; - const fullDetails = SceneLoader.loggingLevel === SceneLoader.DETAILED_LOGGING; - if (!meshesNames) { - meshesNames = null; - } else if (!Array.isArray(meshesNames)) { - meshesNames = [meshesNames]; - } - const hierarchyIds = []; - const parsedIdToNodeMap = new Map; - const loadedTransformNodes = []; - if (parsedData.transformNodes !== undefined && parsedData.transformNodes !== null) { - for (let index = 0, cache = parsedData.transformNodes.length;index < cache; index++) { - const parsedJSONTransformNode = parsedData.transformNodes[index]; - const parsedTransformNode = TransformNode.Parse(parsedJSONTransformNode, scene22, rootUrl); - loadedTransformNodes.push(parsedTransformNode); - parsedIdToNodeMap.set(parsedTransformNode._waitingParsedUniqueId, parsedTransformNode); - parsedTransformNode._waitingParsedUniqueId = null; - } + return container; + }; + SceneLoader.RegisterPlugin({ + name: "babylon.js", + extensions: ".babylon", + canDirectLoad: (data) => { + if (data.indexOf("babylon") !== -1) { + return true; } - if (parsedData.meshes !== undefined && parsedData.meshes !== null) { - const loadedSkeletonsIds = []; - const loadedMaterialsIds = []; - const loadedMaterialsUniqueIds = []; - const loadedMorphTargetsIds = []; - for (let index = 0, cache = parsedData.meshes.length;index < cache; index++) { - const parsedMesh = parsedData.meshes[index]; - if (meshesNames === null || isDescendantOf(parsedMesh, meshesNames, hierarchyIds)) { - if (meshesNames !== null) { - delete meshesNames[meshesNames.indexOf(parsedMesh.name)]; - } - if (parsedMesh.geometryId !== undefined && parsedMesh.geometryId !== null) { - if (parsedData.geometries !== undefined && parsedData.geometries !== null) { - let found = false; - ["boxes", "spheres", "cylinders", "toruses", "grounds", "planes", "torusKnots", "vertexData"].forEach((geometryType) => { - if (found === true || !parsedData.geometries[geometryType] || !Array.isArray(parsedData.geometries[geometryType])) { - return; - } else { - parsedData.geometries[geometryType].forEach((parsedGeometryData) => { - if (parsedGeometryData.id === parsedMesh.geometryId) { - switch (geometryType) { - case "vertexData": - Geometry.Parse(parsedGeometryData, scene22, rootUrl); - break; + return false; + }, + importMesh: (meshesNames, scene22, data, rootUrl, meshes, particleSystems, skeletons, onError) => { + var _a; + let log = "importMesh has failed JSON parse"; + try { + var parsedData = JSON.parse(data); + log = ""; + const fullDetails = SceneLoader.loggingLevel === SceneLoader.DETAILED_LOGGING; + if (!meshesNames) { + meshesNames = null; + } else if (!Array.isArray(meshesNames)) { + meshesNames = [meshesNames]; + } + const hierarchyIds = []; + const parsedIdToNodeMap = new Map; + const loadedTransformNodes = []; + if (parsedData.transformNodes !== undefined && parsedData.transformNodes !== null) { + for (let index = 0, cache = parsedData.transformNodes.length;index < cache; index++) { + const parsedJSONTransformNode = parsedData.transformNodes[index]; + const parsedTransformNode = TransformNode.Parse(parsedJSONTransformNode, scene22, rootUrl); + loadedTransformNodes.push(parsedTransformNode); + parsedIdToNodeMap.set(parsedTransformNode._waitingParsedUniqueId, parsedTransformNode); + parsedTransformNode._waitingParsedUniqueId = null; + } + } + if (parsedData.meshes !== undefined && parsedData.meshes !== null) { + const loadedSkeletonsIds = []; + const loadedMaterialsIds = []; + const loadedMaterialsUniqueIds = []; + const loadedMorphTargetsIds = []; + for (let index = 0, cache = parsedData.meshes.length;index < cache; index++) { + const parsedMesh = parsedData.meshes[index]; + if (meshesNames === null || isDescendantOf(parsedMesh, meshesNames, hierarchyIds)) { + if (meshesNames !== null) { + delete meshesNames[meshesNames.indexOf(parsedMesh.name)]; + } + if (parsedMesh.geometryId !== undefined && parsedMesh.geometryId !== null) { + if (parsedData.geometries !== undefined && parsedData.geometries !== null) { + let found = false; + ["boxes", "spheres", "cylinders", "toruses", "grounds", "planes", "torusKnots", "vertexData"].forEach((geometryType) => { + if (found === true || !parsedData.geometries[geometryType] || !Array.isArray(parsedData.geometries[geometryType])) { + return; + } else { + parsedData.geometries[geometryType].forEach((parsedGeometryData) => { + if (parsedGeometryData.id === parsedMesh.geometryId) { + switch (geometryType) { + case "vertexData": + Geometry.Parse(parsedGeometryData, scene22, rootUrl); + break; + } + found = true; } - found = true; - } - }); + }); + } + }); + if (found === false) { + Logger.Warn("Geometry not found for mesh " + parsedMesh.id); } - }); - if (found === false) { - Logger.Warn("Geometry not found for mesh " + parsedMesh.id); } } - } - if (parsedMesh.materialUniqueId || parsedMesh.materialId) { - const materialArray = parsedMesh.materialUniqueId ? loadedMaterialsUniqueIds : loadedMaterialsIds; - let materialFound = materialArray.indexOf(parsedMesh.materialUniqueId || parsedMesh.materialId) !== -1; - if (materialFound === false && parsedData.multiMaterials !== undefined && parsedData.multiMaterials !== null) { - const loadSubMaterial = (subMatId, predicate) => { - materialArray.push(subMatId); - const mat = parseMaterialByPredicate(predicate, parsedData, scene22, rootUrl); - if (mat && mat.material) { - tempMaterialIndexContainer[mat.parsedMaterial.uniqueId || mat.parsedMaterial.id] = mat.material; - log += "\n\tMaterial " + mat.material.toString(fullDetails); - } - }; - for (let multimatIndex = 0, multimatCache = parsedData.multiMaterials.length;multimatIndex < multimatCache; multimatIndex++) { - const parsedMultiMaterial = parsedData.multiMaterials[multimatIndex]; - if (parsedMesh.materialUniqueId && parsedMultiMaterial.uniqueId === parsedMesh.materialUniqueId || parsedMultiMaterial.id === parsedMesh.materialId) { - if (parsedMultiMaterial.materialsUniqueIds) { - parsedMultiMaterial.materialsUniqueIds.forEach((subMatId) => loadSubMaterial(subMatId, (parsedMaterial) => parsedMaterial.uniqueId === subMatId)); - } else { - parsedMultiMaterial.materials.forEach((subMatId) => loadSubMaterial(subMatId, (parsedMaterial) => parsedMaterial.id === subMatId)); + if (parsedMesh.materialUniqueId || parsedMesh.materialId) { + const materialArray = parsedMesh.materialUniqueId ? loadedMaterialsUniqueIds : loadedMaterialsIds; + let materialFound = materialArray.indexOf(parsedMesh.materialUniqueId || parsedMesh.materialId) !== -1; + if (materialFound === false && parsedData.multiMaterials !== undefined && parsedData.multiMaterials !== null) { + const loadSubMaterial = (subMatId, predicate) => { + materialArray.push(subMatId); + const mat = parseMaterialByPredicate(predicate, parsedData, scene22, rootUrl); + if (mat && mat.material) { + tempMaterialIndexContainer[mat.parsedMaterial.uniqueId || mat.parsedMaterial.id] = mat.material; + log += "\n\tMaterial " + mat.material.toString(fullDetails); } - materialArray.push(parsedMultiMaterial.uniqueId || parsedMultiMaterial.id); - const mmat = MultiMaterial.ParseMultiMaterial(parsedMultiMaterial, scene22); - tempMaterialIndexContainer[parsedMultiMaterial.uniqueId || parsedMultiMaterial.id] = mmat; - if (mmat) { - materialFound = true; - log += "\n\tMulti-Material " + mmat.toString(fullDetails); + }; + for (let multimatIndex = 0, multimatCache = parsedData.multiMaterials.length;multimatIndex < multimatCache; multimatIndex++) { + const parsedMultiMaterial = parsedData.multiMaterials[multimatIndex]; + if (parsedMesh.materialUniqueId && parsedMultiMaterial.uniqueId === parsedMesh.materialUniqueId || parsedMultiMaterial.id === parsedMesh.materialId) { + if (parsedMultiMaterial.materialsUniqueIds) { + parsedMultiMaterial.materialsUniqueIds.forEach((subMatId) => loadSubMaterial(subMatId, (parsedMaterial) => parsedMaterial.uniqueId === subMatId)); + } else { + parsedMultiMaterial.materials.forEach((subMatId) => loadSubMaterial(subMatId, (parsedMaterial) => parsedMaterial.id === subMatId)); + } + materialArray.push(parsedMultiMaterial.uniqueId || parsedMultiMaterial.id); + const mmat = MultiMaterial.ParseMultiMaterial(parsedMultiMaterial, scene22); + tempMaterialIndexContainer[parsedMultiMaterial.uniqueId || parsedMultiMaterial.id] = mmat; + if (mmat) { + materialFound = true; + log += "\n\tMulti-Material " + mmat.toString(fullDetails); + } + break; } - break; } } - } - if (materialFound === false) { - materialArray.push(parsedMesh.materialUniqueId || parsedMesh.materialId); - const mat = parseMaterialByPredicate((parsedMaterial) => parsedMesh.materialUniqueId && parsedMaterial.uniqueId === parsedMesh.materialUniqueId || parsedMaterial.id === parsedMesh.materialId, parsedData, scene22, rootUrl); - if (!mat || !mat.material) { - Logger.Warn("Material not found for mesh " + parsedMesh.id); - } else { - tempMaterialIndexContainer[mat.parsedMaterial.uniqueId || mat.parsedMaterial.id] = mat.material; - log += "\n\tMaterial " + mat.material.toString(fullDetails); + if (materialFound === false) { + materialArray.push(parsedMesh.materialUniqueId || parsedMesh.materialId); + const mat = parseMaterialByPredicate((parsedMaterial) => parsedMesh.materialUniqueId && parsedMaterial.uniqueId === parsedMesh.materialUniqueId || parsedMaterial.id === parsedMesh.materialId, parsedData, scene22, rootUrl); + if (!mat || !mat.material) { + Logger.Warn("Material not found for mesh " + parsedMesh.id); + } else { + tempMaterialIndexContainer[mat.parsedMaterial.uniqueId || mat.parsedMaterial.id] = mat.material; + log += "\n\tMaterial " + mat.material.toString(fullDetails); + } } } - } - if (parsedMesh.skeletonId !== null && parsedMesh.skeletonId !== undefined && parsedData.skeletonId !== -1 && parsedData.skeletons !== undefined && parsedData.skeletons !== null) { - const skeletonAlreadyLoaded = loadedSkeletonsIds.indexOf(parsedMesh.skeletonId) > -1; - if (!skeletonAlreadyLoaded) { - for (let skeletonIndex = 0, skeletonCache = parsedData.skeletons.length;skeletonIndex < skeletonCache; skeletonIndex++) { - const parsedSkeleton = parsedData.skeletons[skeletonIndex]; - if (parsedSkeleton.id === parsedMesh.skeletonId) { - const skeleton3 = Skeleton.Parse(parsedSkeleton, scene22); - skeletons.push(skeleton3); - loadedSkeletonsIds.push(parsedSkeleton.id); - log += "\n\tSkeleton " + skeleton3.toString(fullDetails); + if (parsedMesh.skeletonId !== null && parsedMesh.skeletonId !== undefined && parsedData.skeletonId !== -1 && parsedData.skeletons !== undefined && parsedData.skeletons !== null) { + const skeletonAlreadyLoaded = loadedSkeletonsIds.indexOf(parsedMesh.skeletonId) > -1; + if (!skeletonAlreadyLoaded) { + for (let skeletonIndex = 0, skeletonCache = parsedData.skeletons.length;skeletonIndex < skeletonCache; skeletonIndex++) { + const parsedSkeleton = parsedData.skeletons[skeletonIndex]; + if (parsedSkeleton.id === parsedMesh.skeletonId) { + const skeleton3 = Skeleton.Parse(parsedSkeleton, scene22); + skeletons.push(skeleton3); + loadedSkeletonsIds.push(parsedSkeleton.id); + log += "\n\tSkeleton " + skeleton3.toString(fullDetails); + } } } } - } - if (parsedMesh.morphTargetManagerId > -1 && parsedData.morphTargetManagers !== undefined && parsedData.morphTargetManagers !== null) { - const morphTargetAlreadyLoaded = loadedMorphTargetsIds.indexOf(parsedMesh.morphTargetManagerId) > -1; - if (!morphTargetAlreadyLoaded) { - for (let morphTargetIndex = 0, morphTargetCache = parsedData.morphTargetManagers.length;morphTargetIndex < morphTargetCache; morphTargetIndex++) { - const parsedMorphTarget = parsedData.morphTargetManagers[morphTargetIndex]; - if (parsedMorphTarget.id === parsedMesh.morphTargetManagerId) { - const morphTarget2 = MorphTargetManager.Parse(parsedMorphTarget, scene22); - loadedMorphTargetsIds.push(morphTarget2.uniqueId); - log += "\nMorph target " + morphTarget2.toString(); + if (parsedMesh.morphTargetManagerId > -1 && parsedData.morphTargetManagers !== undefined && parsedData.morphTargetManagers !== null) { + const morphTargetAlreadyLoaded = loadedMorphTargetsIds.indexOf(parsedMesh.morphTargetManagerId) > -1; + if (!morphTargetAlreadyLoaded) { + for (let morphTargetIndex = 0, morphTargetCache = parsedData.morphTargetManagers.length;morphTargetIndex < morphTargetCache; morphTargetIndex++) { + const parsedMorphTarget = parsedData.morphTargetManagers[morphTargetIndex]; + if (parsedMorphTarget.id === parsedMesh.morphTargetManagerId) { + const morphTarget2 = MorphTargetManager.Parse(parsedMorphTarget, scene22); + loadedMorphTargetsIds.push(morphTarget2.uniqueId); + log += "\nMorph target " + morphTarget2.toString(); + } } } } + const mesh48 = Mesh.Parse(parsedMesh, scene22, rootUrl); + meshes.push(mesh48); + parsedIdToNodeMap.set(mesh48._waitingParsedUniqueId, mesh48); + mesh48._waitingParsedUniqueId = null; + log += "\n\tMesh " + mesh48.toString(fullDetails); } - const mesh48 = Mesh.Parse(parsedMesh, scene22, rootUrl); - meshes.push(mesh48); - parsedIdToNodeMap.set(mesh48._waitingParsedUniqueId, mesh48); - mesh48._waitingParsedUniqueId = null; - log += "\n\tMesh " + mesh48.toString(fullDetails); } - } - scene22.multiMaterials.forEach((multimat) => { - multimat._waitingSubMaterialsUniqueIds.forEach((subMaterial) => { - multimat.subMaterials.push(findMaterial(subMaterial, scene22)); + scene22.multiMaterials.forEach((multimat) => { + multimat._waitingSubMaterialsUniqueIds.forEach((subMaterial) => { + multimat.subMaterials.push(findMaterial(subMaterial, scene22)); + }); + multimat._waitingSubMaterialsUniqueIds = []; }); - multimat._waitingSubMaterialsUniqueIds = []; - }); - scene22.meshes.forEach((mesh48) => { - if (mesh48._waitingMaterialId !== null) { - mesh48.material = findMaterial(mesh48._waitingMaterialId, scene22); - mesh48._waitingMaterialId = null; - } - }); - for (let index = 0, cache = scene22.transformNodes.length;index < cache; index++) { - const transformNode16 = scene22.transformNodes[index]; - if (transformNode16._waitingParentId !== null) { - let parent = parsedIdToNodeMap.get(parseInt(transformNode16._waitingParentId)) || null; - if (parent === null) { - parent = scene22.getLastEntryById(transformNode16._waitingParentId); + scene22.meshes.forEach((mesh48) => { + if (mesh48._waitingMaterialId !== null) { + mesh48.material = findMaterial(mesh48._waitingMaterialId, scene22); + mesh48._waitingMaterialId = null; } - let parentNode = parent; - if (transformNode16._waitingParentInstanceIndex) { - parentNode = parent.instances[parseInt(transformNode16._waitingParentInstanceIndex)]; - transformNode16._waitingParentInstanceIndex = null; + }); + for (let index = 0, cache = scene22.transformNodes.length;index < cache; index++) { + const transformNode16 = scene22.transformNodes[index]; + if (transformNode16._waitingParentId !== null) { + let parent = parsedIdToNodeMap.get(parseInt(transformNode16._waitingParentId)) || null; + if (parent === null) { + parent = scene22.getLastEntryById(transformNode16._waitingParentId); + } + let parentNode = parent; + if (transformNode16._waitingParentInstanceIndex) { + parentNode = parent.instances[parseInt(transformNode16._waitingParentInstanceIndex)]; + transformNode16._waitingParentInstanceIndex = null; + } + transformNode16.parent = parentNode; + transformNode16._waitingParentId = null; } - transformNode16.parent = parentNode; - transformNode16._waitingParentId = null; } - } - let currentMesh; - for (let index = 0, cache = scene22.meshes.length;index < cache; index++) { - currentMesh = scene22.meshes[index]; - if (currentMesh._waitingParentId) { - let parent = parsedIdToNodeMap.get(parseInt(currentMesh._waitingParentId)) || null; - if (parent === null) { - parent = scene22.getLastEntryById(currentMesh._waitingParentId); + let currentMesh; + for (let index = 0, cache = scene22.meshes.length;index < cache; index++) { + currentMesh = scene22.meshes[index]; + if (currentMesh._waitingParentId) { + let parent = parsedIdToNodeMap.get(parseInt(currentMesh._waitingParentId)) || null; + if (parent === null) { + parent = scene22.getLastEntryById(currentMesh._waitingParentId); + } + let parentNode = parent; + if (currentMesh._waitingParentInstanceIndex) { + parentNode = parent.instances[parseInt(currentMesh._waitingParentInstanceIndex)]; + currentMesh._waitingParentInstanceIndex = null; + } + currentMesh.parent = parentNode; + if (((_a = currentMesh.parent) === null || _a === undefined ? undefined : _a.getClassName()) === "TransformNode") { + const loadedTransformNodeIndex = loadedTransformNodes.indexOf(currentMesh.parent); + if (loadedTransformNodeIndex > -1) { + loadedTransformNodes.splice(loadedTransformNodeIndex, 1); + } + } + currentMesh._waitingParentId = null; } - let parentNode = parent; - if (currentMesh._waitingParentInstanceIndex) { - parentNode = parent.instances[parseInt(currentMesh._waitingParentInstanceIndex)]; - currentMesh._waitingParentInstanceIndex = null; + if (currentMesh._waitingData.lods) { + loadDetailLevels(scene22, currentMesh); } - currentMesh.parent = parentNode; - if (((_a = currentMesh.parent) === null || _a === undefined ? undefined : _a.getClassName()) === "TransformNode") { - const loadedTransformNodeIndex = loadedTransformNodes.indexOf(currentMesh.parent); - if (loadedTransformNodeIndex > -1) { - loadedTransformNodes.splice(loadedTransformNodeIndex, 1); + } + for (const transformNode16 of loadedTransformNodes) { + transformNode16.dispose(); + } + for (let index = 0, cache = scene22.skeletons.length;index < cache; index++) { + const skeleton3 = scene22.skeletons[index]; + if (skeleton3._hasWaitingData) { + if (skeleton3.bones != null) { + skeleton3.bones.forEach((bone4) => { + if (bone4._waitingTransformNodeId) { + const linkTransformNode = scene22.getLastEntryById(bone4._waitingTransformNodeId); + if (linkTransformNode) { + bone4.linkTransformNode(linkTransformNode); + } + bone4._waitingTransformNodeId = null; + } + }); } + skeleton3._hasWaitingData = null; } - currentMesh._waitingParentId = null; } - if (currentMesh._waitingData.lods) { - loadDetailLevels(scene22, currentMesh); + for (let index = 0, cache = scene22.meshes.length;index < cache; index++) { + currentMesh = scene22.meshes[index]; + if (currentMesh._waitingData.freezeWorldMatrix) { + currentMesh.freezeWorldMatrix(); + currentMesh._waitingData.freezeWorldMatrix = null; + } else { + currentMesh.computeWorldMatrix(true); + } } } - for (const transformNode16 of loadedTransformNodes) { - transformNode16.dispose(); - } - for (let index = 0, cache = scene22.skeletons.length;index < cache; index++) { - const skeleton3 = scene22.skeletons[index]; - if (skeleton3._hasWaitingData) { - if (skeleton3.bones != null) { - skeleton3.bones.forEach((bone4) => { - if (bone4._waitingTransformNodeId) { - const linkTransformNode = scene22.getLastEntryById(bone4._waitingTransformNodeId); - if (linkTransformNode) { - bone4.linkTransformNode(linkTransformNode); - } - bone4._waitingTransformNodeId = null; - } - }); + if (parsedData.particleSystems !== undefined && parsedData.particleSystems !== null) { + const parser = AbstractScene.GetIndividualParser(SceneComponentConstants.NAME_PARTICLESYSTEM); + if (parser) { + for (let index = 0, cache = parsedData.particleSystems.length;index < cache; index++) { + const parsedParticleSystem = parsedData.particleSystems[index]; + if (hierarchyIds.indexOf(parsedParticleSystem.emitterId) !== -1) { + particleSystems.push(parser(parsedParticleSystem, scene22, rootUrl)); + } } - skeleton3._hasWaitingData = null; } } - for (let index = 0, cache = scene22.meshes.length;index < cache; index++) { - currentMesh = scene22.meshes[index]; - if (currentMesh._waitingData.freezeWorldMatrix) { - currentMesh.freezeWorldMatrix(); - currentMesh._waitingData.freezeWorldMatrix = null; - } else { - currentMesh.computeWorldMatrix(true); - } + scene22.geometries.forEach((g) => { + g._loadedUniqueId = ""; + }); + return true; + } catch (err) { + const msg = logOperation("importMesh", parsedData ? parsedData.producer : "Unknown") + log; + if (onError) { + onError(msg, err); + } else { + Logger.Log(msg); + throw err; + } + } finally { + if (log !== null && SceneLoader.loggingLevel !== SceneLoader.NO_LOGGING) { + Logger.Log(logOperation("importMesh", parsedData ? parsedData.producer : "Unknown") + (SceneLoader.loggingLevel !== SceneLoader.MINIMAL_LOGGING ? log : "")); } + tempMaterialIndexContainer = {}; } - if (parsedData.particleSystems !== undefined && parsedData.particleSystems !== null) { - const parser = AbstractScene.GetIndividualParser(SceneComponentConstants.NAME_PARTICLESYSTEM); - if (parser) { - for (let index = 0, cache = parsedData.particleSystems.length;index < cache; index++) { - const parsedParticleSystem = parsedData.particleSystems[index]; - if (hierarchyIds.indexOf(parsedParticleSystem.emitterId) !== -1) { - particleSystems.push(parser(parsedParticleSystem, scene22, rootUrl)); - } + return false; + }, + load: (scene22, data, rootUrl, onError) => { + let log = "importScene has failed JSON parse"; + try { + var parsedData = JSON.parse(data); + log = ""; + if (parsedData.useDelayedTextureLoading !== undefined && parsedData.useDelayedTextureLoading !== null) { + scene22.useDelayedTextureLoading = parsedData.useDelayedTextureLoading && !SceneLoader.ForceFullSceneLoadingForIncremental; + } + if (parsedData.autoClear !== undefined && parsedData.autoClear !== null) { + scene22.autoClear = parsedData.autoClear; + } + if (parsedData.clearColor !== undefined && parsedData.clearColor !== null) { + scene22.clearColor = Color4.FromArray(parsedData.clearColor); + } + if (parsedData.ambientColor !== undefined && parsedData.ambientColor !== null) { + scene22.ambientColor = Color3.FromArray(parsedData.ambientColor); + } + if (parsedData.gravity !== undefined && parsedData.gravity !== null) { + scene22.gravity = Vector3.FromArray(parsedData.gravity); + } + if (parsedData.useRightHandedSystem !== undefined) { + scene22.useRightHandedSystem = !!parsedData.useRightHandedSystem; + } + if (parsedData.fogMode && parsedData.fogMode !== 0) { + scene22.fogMode = parsedData.fogMode; + scene22.fogColor = Color3.FromArray(parsedData.fogColor); + scene22.fogStart = parsedData.fogStart; + scene22.fogEnd = parsedData.fogEnd; + scene22.fogDensity = parsedData.fogDensity; + log += "\tFog mode for scene: "; + switch (scene22.fogMode) { + case 1: + log += "exp\n"; + break; + case 2: + log += "exp2\n"; + break; + case 3: + log += "linear\n"; + break; } } - } - scene22.geometries.forEach((g) => { - g._loadedUniqueId = ""; - }); - return true; - } catch (err) { - const msg = logOperation("importMesh", parsedData ? parsedData.producer : "Unknown") + log; - if (onError) { - onError(msg, err); - } else { - Logger.Log(msg); - throw err; - } - } finally { - if (log !== null && SceneLoader.loggingLevel !== SceneLoader.NO_LOGGING) { - Logger.Log(logOperation("importMesh", parsedData ? parsedData.producer : "Unknown") + (SceneLoader.loggingLevel !== SceneLoader.MINIMAL_LOGGING ? log : "")); - } - tempMaterialIndexContainer = {}; - } - return false; - }, - load: (scene22, data, rootUrl, onError) => { - let log = "importScene has failed JSON parse"; - try { - var parsedData = JSON.parse(data); - log = ""; - if (parsedData.useDelayedTextureLoading !== undefined && parsedData.useDelayedTextureLoading !== null) { - scene22.useDelayedTextureLoading = parsedData.useDelayedTextureLoading && !SceneLoader.ForceFullSceneLoadingForIncremental; - } - if (parsedData.autoClear !== undefined && parsedData.autoClear !== null) { - scene22.autoClear = parsedData.autoClear; - } - if (parsedData.clearColor !== undefined && parsedData.clearColor !== null) { - scene22.clearColor = Color4.FromArray(parsedData.clearColor); - } - if (parsedData.ambientColor !== undefined && parsedData.ambientColor !== null) { - scene22.ambientColor = Color3.FromArray(parsedData.ambientColor); - } - if (parsedData.gravity !== undefined && parsedData.gravity !== null) { - scene22.gravity = Vector3.FromArray(parsedData.gravity); - } - if (parsedData.useRightHandedSystem !== undefined) { - scene22.useRightHandedSystem = !!parsedData.useRightHandedSystem; - } - if (parsedData.fogMode && parsedData.fogMode !== 0) { - scene22.fogMode = parsedData.fogMode; - scene22.fogColor = Color3.FromArray(parsedData.fogColor); - scene22.fogStart = parsedData.fogStart; - scene22.fogEnd = parsedData.fogEnd; - scene22.fogDensity = parsedData.fogDensity; - log += "\tFog mode for scene: "; - switch (scene22.fogMode) { - case 1: - log += "exp\n"; - break; - case 2: - log += "exp2\n"; - break; - case 3: - log += "linear\n"; - break; + if (parsedData.physicsEnabled) { + let physicsPlugin; + if (parsedData.physicsEngine === "cannon" || parsedData.physicsEngine === CannonJSPlugin.name) { + physicsPlugin = new CannonJSPlugin(undefined, undefined, BabylonFileLoaderConfiguration.LoaderInjectedPhysicsEngine); + } else if (parsedData.physicsEngine === "oimo" || parsedData.physicsEngine === OimoJSPlugin.name) { + physicsPlugin = new OimoJSPlugin(undefined, BabylonFileLoaderConfiguration.LoaderInjectedPhysicsEngine); + } else if (parsedData.physicsEngine === "ammo" || parsedData.physicsEngine === AmmoJSPlugin.name) { + physicsPlugin = new AmmoJSPlugin(undefined, BabylonFileLoaderConfiguration.LoaderInjectedPhysicsEngine, undefined); + } + log = "\tPhysics engine " + (parsedData.physicsEngine ? parsedData.physicsEngine : "oimo") + " enabled\n"; + const physicsGravity = parsedData.physicsGravity ? Vector3.FromArray(parsedData.physicsGravity) : null; + scene22.enablePhysics(physicsGravity, physicsPlugin); } - } - if (parsedData.physicsEnabled) { - let physicsPlugin; - if (parsedData.physicsEngine === "cannon" || parsedData.physicsEngine === CannonJSPlugin.name) { - physicsPlugin = new CannonJSPlugin(undefined, undefined, BabylonFileLoaderConfiguration.LoaderInjectedPhysicsEngine); - } else if (parsedData.physicsEngine === "oimo" || parsedData.physicsEngine === OimoJSPlugin.name) { - physicsPlugin = new OimoJSPlugin(undefined, BabylonFileLoaderConfiguration.LoaderInjectedPhysicsEngine); - } else if (parsedData.physicsEngine === "ammo" || parsedData.physicsEngine === AmmoJSPlugin.name) { - physicsPlugin = new AmmoJSPlugin(undefined, BabylonFileLoaderConfiguration.LoaderInjectedPhysicsEngine, undefined); + if (parsedData.metadata !== undefined && parsedData.metadata !== null) { + scene22.metadata = parsedData.metadata; + } + if (parsedData.collisionsEnabled !== undefined && parsedData.collisionsEnabled !== null) { + scene22.collisionsEnabled = parsedData.collisionsEnabled; + } + const container = loadAssetContainer(scene22, data, rootUrl, onError, true); + if (!container) { + return false; + } + if (parsedData.autoAnimate) { + scene22.beginAnimation(scene22, parsedData.autoAnimateFrom, parsedData.autoAnimateTo, parsedData.autoAnimateLoop, parsedData.autoAnimateSpeed || 1); + } + if (parsedData.activeCameraID !== undefined && parsedData.activeCameraID !== null) { + scene22.setActiveCameraById(parsedData.activeCameraID); + } + return true; + } catch (err) { + const msg = logOperation("importScene", parsedData ? parsedData.producer : "Unknown") + log; + if (onError) { + onError(msg, err); + } else { + Logger.Log(msg); + throw err; + } + } finally { + if (log !== null && SceneLoader.loggingLevel !== SceneLoader.NO_LOGGING) { + Logger.Log(logOperation("importScene", parsedData ? parsedData.producer : "Unknown") + (SceneLoader.loggingLevel !== SceneLoader.MINIMAL_LOGGING ? log : "")); } - log = "\tPhysics engine " + (parsedData.physicsEngine ? parsedData.physicsEngine : "oimo") + " enabled\n"; - const physicsGravity = parsedData.physicsGravity ? Vector3.FromArray(parsedData.physicsGravity) : null; - scene22.enablePhysics(physicsGravity, physicsPlugin); - } - if (parsedData.metadata !== undefined && parsedData.metadata !== null) { - scene22.metadata = parsedData.metadata; - } - if (parsedData.collisionsEnabled !== undefined && parsedData.collisionsEnabled !== null) { - scene22.collisionsEnabled = parsedData.collisionsEnabled; - } - const container = loadAssetContainer(scene22, data, rootUrl, onError, true); - if (!container) { - return false; - } - if (parsedData.autoAnimate) { - scene22.beginAnimation(scene22, parsedData.autoAnimateFrom, parsedData.autoAnimateTo, parsedData.autoAnimateLoop, parsedData.autoAnimateSpeed || 1); - } - if (parsedData.activeCameraID !== undefined && parsedData.activeCameraID !== null) { - scene22.setActiveCameraById(parsedData.activeCameraID); - } - return true; - } catch (err) { - const msg = logOperation("importScene", parsedData ? parsedData.producer : "Unknown") + log; - if (onError) { - onError(msg, err); - } else { - Logger.Log(msg); - throw err; - } - } finally { - if (log !== null && SceneLoader.loggingLevel !== SceneLoader.NO_LOGGING) { - Logger.Log(logOperation("importScene", parsedData ? parsedData.producer : "Unknown") + (SceneLoader.loggingLevel !== SceneLoader.MINIMAL_LOGGING ? log : "")); } + return false; + }, + loadAssetContainer: (scene22, data, rootUrl, onError) => { + const container = loadAssetContainer(scene22, data, rootUrl, onError); + return container; } - return false; - }, - loadAssetContainer: (scene22, data, rootUrl, onError) => { - const container = loadAssetContainer(scene22, data, rootUrl, onError); - return container; - } + }); }); + +// node_modules/@babylonjs/core/Loading/Plugins/index.js +var init_Plugins = __esm(() => { + init_babylonFileLoader(); +}); + +// node_modules/@babylonjs/core/Loading/index.js +var init_Loading = __esm(() => { + init_loadingScreen(); + init_Plugins(); + init_sceneLoader(); + init_sceneLoaderFlags(); +}); + +// node_modules/@babylonjs/core/Materials/Background/index.js +var init_Background = __esm(() => { + init_backgroundMaterial(); +}); + +// node_modules/@babylonjs/core/Materials/iEffectFallbacks.js +var init_iEffectFallbacks = __esm(() => { +}); + // node_modules/@babylonjs/core/Materials/fresnelParameters.js class FresnelParameters { get isEnabled() { @@ -124379,7 +134388,38 @@ class FresnelParameters { }); } } -SerializationHelper._FresnelParametersParser = FresnelParameters.Parse; +var init_fresnelParameters = __esm(() => { + init_deepCopier(); + init_math_color(); + init_engine(); + init_decorators(); + SerializationHelper._FresnelParametersParser = FresnelParameters.Parse; +}); + +// node_modules/@babylonjs/core/Materials/Occlusion/occlusionMaterial.js +class OcclusionMaterial extends ShaderMaterial { + constructor(name177, scene22) { + super(name177, scene22, "color", { + attributes: ["position"], + uniforms: ["world", "viewProjection", "color"] + }); + this.disableColorWrite = true; + this.forceDepthWrite = true; + this.setColor4("color", new Color4(0, 0, 0, 1)); + } +} +var init_occlusionMaterial = __esm(() => { + init_math_color(); + init_shaderMaterial(); + init_color_fragment(); + init_color_vertex(); +}); + +// node_modules/@babylonjs/core/Materials/Occlusion/index.js +var init_Occlusion = __esm(() => { + init_occlusionMaterial(); +}); + // node_modules/@babylonjs/core/Materials/PBR/pbrBaseSimpleMaterial.js class PBRBaseSimpleMaterial extends PBRBaseMaterial { get doubleSided() { @@ -124393,8 +134433,8 @@ class PBRBaseSimpleMaterial extends PBRBaseMaterial { this.backFaceCulling = !value; this._markAllSubMeshesAsTexturesDirty(); } - constructor(name176, scene22) { - super(name176, scene22); + constructor(name177, scene22) { + super(name177, scene22); this.maxSimultaneousLights = 4; this.disableLighting = false; this.invertNormalMapX = false; @@ -124409,65 +134449,72 @@ class PBRBaseSimpleMaterial extends PBRBaseMaterial { return "PBRBaseSimpleMaterial"; } } -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsLightsDirty") -], PBRBaseSimpleMaterial.prototype, "maxSimultaneousLights", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsLightsDirty") -], PBRBaseSimpleMaterial.prototype, "disableLighting", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty", "_reflectionTexture") -], PBRBaseSimpleMaterial.prototype, "environmentTexture", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRBaseSimpleMaterial.prototype, "invertNormalMapX", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRBaseSimpleMaterial.prototype, "invertNormalMapY", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty", "_bumpTexture") -], PBRBaseSimpleMaterial.prototype, "normalTexture", undefined); -__decorate2([ - serializeAsColor3("emissive"), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRBaseSimpleMaterial.prototype, "emissiveColor", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRBaseSimpleMaterial.prototype, "emissiveTexture", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty", "_ambientTextureStrength") -], PBRBaseSimpleMaterial.prototype, "occlusionStrength", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty", "_ambientTexture") -], PBRBaseSimpleMaterial.prototype, "occlusionTexture", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty", "_alphaCutOff") -], PBRBaseSimpleMaterial.prototype, "alphaCutOff", undefined); -__decorate2([ - serialize() -], PBRBaseSimpleMaterial.prototype, "doubleSided", null); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty", null) -], PBRBaseSimpleMaterial.prototype, "lightmapTexture", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRBaseSimpleMaterial.prototype, "useLightmapAsShadowmap", undefined); +var init_pbrBaseSimpleMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_color(); + init_pbrBaseMaterial(); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], PBRBaseSimpleMaterial.prototype, "maxSimultaneousLights", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], PBRBaseSimpleMaterial.prototype, "disableLighting", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty", "_reflectionTexture") + ], PBRBaseSimpleMaterial.prototype, "environmentTexture", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRBaseSimpleMaterial.prototype, "invertNormalMapX", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRBaseSimpleMaterial.prototype, "invertNormalMapY", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty", "_bumpTexture") + ], PBRBaseSimpleMaterial.prototype, "normalTexture", undefined); + __decorate2([ + serializeAsColor3("emissive"), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRBaseSimpleMaterial.prototype, "emissiveColor", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRBaseSimpleMaterial.prototype, "emissiveTexture", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty", "_ambientTextureStrength") + ], PBRBaseSimpleMaterial.prototype, "occlusionStrength", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty", "_ambientTexture") + ], PBRBaseSimpleMaterial.prototype, "occlusionTexture", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty", "_alphaCutOff") + ], PBRBaseSimpleMaterial.prototype, "alphaCutOff", undefined); + __decorate2([ + serialize() + ], PBRBaseSimpleMaterial.prototype, "doubleSided", null); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty", null) + ], PBRBaseSimpleMaterial.prototype, "lightmapTexture", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRBaseSimpleMaterial.prototype, "useLightmapAsShadowmap", undefined); +}); + // node_modules/@babylonjs/core/Materials/PBR/pbrMetallicRoughnessMaterial.js class PBRMetallicRoughnessMaterial extends PBRBaseSimpleMaterial { - constructor(name176, scene22) { - super(name176, scene22); + constructor(name177, scene22) { + super(name177, scene22); this._useRoughnessFromMetallicTextureAlpha = false; this._useRoughnessFromMetallicTextureGreen = true; this._useMetallnessFromMetallicTextureBlue = true; @@ -124477,10 +134524,10 @@ class PBRMetallicRoughnessMaterial extends PBRBaseSimpleMaterial { getClassName() { return "PBRMetallicRoughnessMaterial"; } - clone(name176) { - const clone = SerializationHelper.Clone(() => new PBRMetallicRoughnessMaterial(name176, this.getScene()), this); - clone.id = name176; - clone.name = name176; + clone(name177) { + const clone = SerializationHelper.Clone(() => new PBRMetallicRoughnessMaterial(name177, this.getScene()), this); + clone.id = name177; + clone.name = name177; this.clearCoat.copyTo(clone.clearCoat); this.anisotropy.copyTo(clone.anisotropy); this.brdf.copyTo(clone.brdf); @@ -124522,43 +134569,50 @@ class PBRMetallicRoughnessMaterial extends PBRBaseSimpleMaterial { return material19; } } -__decorate2([ - serializeAsColor3(), - expandToProperty("_markAllSubMeshesAsTexturesDirty", "_albedoColor") -], PBRMetallicRoughnessMaterial.prototype, "baseColor", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty", "_albedoTexture") -], PBRMetallicRoughnessMaterial.prototype, "baseTexture", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMetallicRoughnessMaterial.prototype, "metallic", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], PBRMetallicRoughnessMaterial.prototype, "roughness", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty", "_metallicTexture") -], PBRMetallicRoughnessMaterial.prototype, "metallicRoughnessTexture", undefined); -RegisterClass("BABYLON.PBRMetallicRoughnessMaterial", PBRMetallicRoughnessMaterial); +var init_pbrMetallicRoughnessMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_pbrBaseSimpleMaterial(); + init_typeStore(); + __decorate2([ + serializeAsColor3(), + expandToProperty("_markAllSubMeshesAsTexturesDirty", "_albedoColor") + ], PBRMetallicRoughnessMaterial.prototype, "baseColor", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty", "_albedoTexture") + ], PBRMetallicRoughnessMaterial.prototype, "baseTexture", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMetallicRoughnessMaterial.prototype, "metallic", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], PBRMetallicRoughnessMaterial.prototype, "roughness", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty", "_metallicTexture") + ], PBRMetallicRoughnessMaterial.prototype, "metallicRoughnessTexture", undefined); + RegisterClass("BABYLON.PBRMetallicRoughnessMaterial", PBRMetallicRoughnessMaterial); +}); + // node_modules/@babylonjs/core/Materials/PBR/pbrSpecularGlossinessMaterial.js class PBRSpecularGlossinessMaterial extends PBRBaseSimpleMaterial { get useMicroSurfaceFromReflectivityMapAlpha() { return this._useMicroSurfaceFromReflectivityMapAlpha; } - constructor(name176, scene22) { - super(name176, scene22); + constructor(name177, scene22) { + super(name177, scene22); this._useMicroSurfaceFromReflectivityMapAlpha = true; } getClassName() { return "PBRSpecularGlossinessMaterial"; } - clone(name176) { - const clone = SerializationHelper.Clone(() => new PBRSpecularGlossinessMaterial(name176, this.getScene()), this); - clone.id = name176; - clone.name = name176; + clone(name177) { + const clone = SerializationHelper.Clone(() => new PBRSpecularGlossinessMaterial(name177, this.getScene()), this); + clone.id = name177; + clone.name = name177; this.clearCoat.copyTo(clone.clearCoat); this.anisotropy.copyTo(clone.anisotropy); this.brdf.copyTo(clone.brdf); @@ -124600,27 +134654,48 @@ class PBRSpecularGlossinessMaterial extends PBRBaseSimpleMaterial { return material19; } } -__decorate2([ - serializeAsColor3("diffuse"), - expandToProperty("_markAllSubMeshesAsTexturesDirty", "_albedoColor") -], PBRSpecularGlossinessMaterial.prototype, "diffuseColor", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty", "_albedoTexture") -], PBRSpecularGlossinessMaterial.prototype, "diffuseTexture", undefined); -__decorate2([ - serializeAsColor3("specular"), - expandToProperty("_markAllSubMeshesAsTexturesDirty", "_reflectivityColor") -], PBRSpecularGlossinessMaterial.prototype, "specularColor", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty", "_microSurface") -], PBRSpecularGlossinessMaterial.prototype, "glossiness", undefined); -__decorate2([ - serializeAsTexture(), - expandToProperty("_markAllSubMeshesAsTexturesDirty", "_reflectivityTexture") -], PBRSpecularGlossinessMaterial.prototype, "specularGlossinessTexture", undefined); -RegisterClass("BABYLON.PBRSpecularGlossinessMaterial", PBRSpecularGlossinessMaterial); +var init_pbrSpecularGlossinessMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_pbrBaseSimpleMaterial(); + init_typeStore(); + __decorate2([ + serializeAsColor3("diffuse"), + expandToProperty("_markAllSubMeshesAsTexturesDirty", "_albedoColor") + ], PBRSpecularGlossinessMaterial.prototype, "diffuseColor", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty", "_albedoTexture") + ], PBRSpecularGlossinessMaterial.prototype, "diffuseTexture", undefined); + __decorate2([ + serializeAsColor3("specular"), + expandToProperty("_markAllSubMeshesAsTexturesDirty", "_reflectivityColor") + ], PBRSpecularGlossinessMaterial.prototype, "specularColor", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty", "_microSurface") + ], PBRSpecularGlossinessMaterial.prototype, "glossiness", undefined); + __decorate2([ + serializeAsTexture(), + expandToProperty("_markAllSubMeshesAsTexturesDirty", "_reflectivityTexture") + ], PBRSpecularGlossinessMaterial.prototype, "specularGlossinessTexture", undefined); + RegisterClass("BABYLON.PBRSpecularGlossinessMaterial", PBRSpecularGlossinessMaterial); +}); + +// node_modules/@babylonjs/core/Materials/PBR/index.js +var init_PBR = __esm(() => { + init_pbrAnisotropicConfiguration(); + init_pbrBaseMaterial(); + init_pbrBaseSimpleMaterial(); + init_pbrClearCoatConfiguration(); + init_pbrIridescenceConfiguration(); + init_pbrMaterial(); + init_pbrMetallicRoughnessMaterial(); + init_pbrSpecularGlossinessMaterial(); + init_pbrSheenConfiguration(); + init_pbrSubSurfaceConfiguration(); +}); + // node_modules/@babylonjs/core/Materials/Textures/colorGradingTexture.js class ColorGradingTexture extends BaseTexture { constructor(url, sceneOrEngine, onLoad = null) { @@ -124789,8 +134864,15 @@ class ColorGradingTexture extends BaseTexture { return serializationObject; } } -ColorGradingTexture._NoneEmptyLineRegex = /\S+/; -RegisterClass("BABYLON.ColorGradingTexture", ColorGradingTexture); +var init_colorGradingTexture = __esm(() => { + init_math_vector(); + init_baseTexture(); + init_typeStore(); + init_engine_rawTexture(); + ColorGradingTexture._NoneEmptyLineRegex = /\S+/; + RegisterClass("BABYLON.ColorGradingTexture", ColorGradingTexture); +}); + // node_modules/@babylonjs/core/Materials/Textures/equiRectangularCubeTexture.js class EquiRectangularCubeTexture extends BaseTexture { constructor(url, scene22, size, noMipmap = false, gammaSpace = true, onLoad = null, onError = null, supersample = false) { @@ -124911,10 +134993,19 @@ class EquiRectangularCubeTexture extends BaseTexture { return newTexture; } } -EquiRectangularCubeTexture._FacesMapping = ["right", "left", "up", "down", "front", "back"]; +var init_equiRectangularCubeTexture = __esm(() => { + init_panoramaToCubemap(); + init_baseTexture(); + init_texture(); + init_tools(); + init_engine_rawTexture(); + init_fileTools(); + EquiRectangularCubeTexture._FacesMapping = ["right", "left", "up", "down", "front", "back"]; +}); + // node_modules/@babylonjs/core/Materials/Textures/htmlElementTexture.js class HtmlElementTexture extends BaseTexture { - constructor(name176, element, options) { + constructor(name177, element, options) { var _a, _b; super(options.scene || options.engine); this.onLoadObservable = new Observable; @@ -124926,7 +135017,7 @@ class HtmlElementTexture extends BaseTexture { this._samplingMode = options.samplingMode; this._textureMatrix = Matrix.Identity(); this._format = options.format; - this.name = name176; + this.name = name177; this.element = element; this._isVideo = !!element.getVideoPlaybackQuality; this._externalTexture = this._isVideo ? (_b = (_a = this._engine) === null || _a === undefined ? undefined : _a.createExternalTexture(element)) !== null && _b !== undefined ? _b : null : null; @@ -124978,13 +135069,26 @@ class HtmlElementTexture extends BaseTexture { super.dispose(); } } -HtmlElementTexture._DefaultOptions = { - generateMipMaps: false, - samplingMode: 2, - format: 5, - engine: null, - scene: null -}; +var init_htmlElementTexture = __esm(() => { + init_baseTexture(); + init_math_vector(); + init_observable(); + init_engine_dynamicTexture(); + init_engine_videoTexture(); + init_engine_externalTexture(); + HtmlElementTexture._DefaultOptions = { + generateMipMaps: false, + samplingMode: 2, + format: 5, + engine: null, + scene: null + }; +}); + +// node_modules/@babylonjs/core/Materials/Textures/internalTextureLoader.js +var init_internalTextureLoader = __esm(() => { +}); + // node_modules/@babylonjs/core/Misc/tga.js function GetTGAHeader(data) { let offset = 0; @@ -125109,124 +135213,128 @@ function UploadContent(texture39, data) { const engine37 = texture39.getEngine(); engine37._uploadDataToTextureDirectly(texture39, imageData); } -var _getImageData8bits = function(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { - const image = pixel_data, colormap = palettes; - const { width, height } = header; - let color, i = 0, x, y; - const imageData = new Uint8Array(width * height * 4); - for (y = y_start;y !== y_end; y += y_step) { - for (x = x_start;x !== x_end; x += x_step, i++) { - color = image[i]; - imageData[(x + width * y) * 4 + 3] = 255; - imageData[(x + width * y) * 4 + 2] = colormap[color * 3 + 0]; - imageData[(x + width * y) * 4 + 1] = colormap[color * 3 + 1]; - imageData[(x + width * y) * 4 + 0] = colormap[color * 3 + 2]; - } - } - return imageData; -}; -var _getImageData16bits = function(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { - const image = pixel_data; - const { width, height } = header; - let color, i = 0, x, y; - const imageData = new Uint8Array(width * height * 4); - for (y = y_start;y !== y_end; y += y_step) { - for (x = x_start;x !== x_end; x += x_step, i += 2) { - color = image[i + 0] + (image[i + 1] << 8); - const r = ((color & 31744) >> 10) * 255 / 31 | 0; - const g = ((color & 992) >> 5) * 255 / 31 | 0; - const b = (color & 31) * 255 / 31 | 0; - imageData[(x + width * y) * 4 + 0] = r; - imageData[(x + width * y) * 4 + 1] = g; - imageData[(x + width * y) * 4 + 2] = b; - imageData[(x + width * y) * 4 + 3] = color & 32768 ? 0 : 255; - } - } - return imageData; -}; -var _getImageData24bits = function(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { - const image = pixel_data; - const { width, height } = header; - let i = 0, x, y; - const imageData = new Uint8Array(width * height * 4); - for (y = y_start;y !== y_end; y += y_step) { - for (x = x_start;x !== x_end; x += x_step, i += 3) { - imageData[(x + width * y) * 4 + 3] = 255; - imageData[(x + width * y) * 4 + 2] = image[i + 0]; - imageData[(x + width * y) * 4 + 1] = image[i + 1]; - imageData[(x + width * y) * 4 + 0] = image[i + 2]; - } - } - return imageData; -}; -var _getImageData32bits = function(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { - const image = pixel_data; - const { width, height } = header; - let i = 0, x, y; - const imageData = new Uint8Array(width * height * 4); - for (y = y_start;y !== y_end; y += y_step) { - for (x = x_start;x !== x_end; x += x_step, i += 4) { - imageData[(x + width * y) * 4 + 2] = image[i + 0]; - imageData[(x + width * y) * 4 + 1] = image[i + 1]; - imageData[(x + width * y) * 4 + 0] = image[i + 2]; - imageData[(x + width * y) * 4 + 3] = image[i + 3]; - } - } - return imageData; -}; -var _getImageDataGrey8bits = function(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { - const image = pixel_data; - const { width, height } = header; - let color, i = 0, x, y; - const imageData = new Uint8Array(width * height * 4); - for (y = y_start;y !== y_end; y += y_step) { - for (x = x_start;x !== x_end; x += x_step, i++) { - color = image[i]; - imageData[(x + width * y) * 4 + 0] = color; - imageData[(x + width * y) * 4 + 1] = color; - imageData[(x + width * y) * 4 + 2] = color; - imageData[(x + width * y) * 4 + 3] = 255; - } - } - return imageData; -}; -var _getImageDataGrey16bits = function(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { - const image = pixel_data; - const { width, height } = header; - let i = 0, x, y; - const imageData = new Uint8Array(width * height * 4); - for (y = y_start;y !== y_end; y += y_step) { - for (x = x_start;x !== x_end; x += x_step, i += 2) { - imageData[(x + width * y) * 4 + 0] = image[i + 0]; - imageData[(x + width * y) * 4 + 1] = image[i + 0]; - imageData[(x + width * y) * 4 + 2] = image[i + 0]; - imageData[(x + width * y) * 4 + 3] = image[i + 1]; - } - } - return imageData; -}; -var _TYPE_INDEXED = 1; -var _TYPE_RGB = 2; -var _TYPE_GREY = 3; -var _TYPE_RLE_INDEXED = 9; -var _TYPE_RLE_RGB = 10; -var _TYPE_RLE_GREY = 11; -var _ORIGIN_MASK = 48; -var _ORIGIN_SHIFT = 4; -var _ORIGIN_BL = 0; -var _ORIGIN_BR = 1; -var _ORIGIN_UL = 2; -var _ORIGIN_UR = 3; -var TGATools = { - GetTGAHeader, - UploadContent, - _getImageData8bits, - _getImageData16bits, - _getImageData24bits, - _getImageData32bits, - _getImageDataGrey8bits, - _getImageDataGrey16bits -}; +var _getImageData8bits, _getImageData16bits, _getImageData24bits, _getImageData32bits, _getImageDataGrey8bits, _getImageDataGrey16bits, _TYPE_INDEXED, _TYPE_RGB, _TYPE_GREY, _TYPE_RLE_INDEXED, _TYPE_RLE_RGB, _TYPE_RLE_GREY, _ORIGIN_MASK, _ORIGIN_SHIFT, _ORIGIN_BL, _ORIGIN_BR, _ORIGIN_UL, _ORIGIN_UR, TGATools; +var init_tga = __esm(() => { + init_logger(); + _getImageData8bits = function(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { + const image = pixel_data, colormap = palettes; + const { width, height } = header; + let color, i = 0, x, y; + const imageData = new Uint8Array(width * height * 4); + for (y = y_start;y !== y_end; y += y_step) { + for (x = x_start;x !== x_end; x += x_step, i++) { + color = image[i]; + imageData[(x + width * y) * 4 + 3] = 255; + imageData[(x + width * y) * 4 + 2] = colormap[color * 3 + 0]; + imageData[(x + width * y) * 4 + 1] = colormap[color * 3 + 1]; + imageData[(x + width * y) * 4 + 0] = colormap[color * 3 + 2]; + } + } + return imageData; + }; + _getImageData16bits = function(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { + const image = pixel_data; + const { width, height } = header; + let color, i = 0, x, y; + const imageData = new Uint8Array(width * height * 4); + for (y = y_start;y !== y_end; y += y_step) { + for (x = x_start;x !== x_end; x += x_step, i += 2) { + color = image[i + 0] + (image[i + 1] << 8); + const r = ((color & 31744) >> 10) * 255 / 31 | 0; + const g = ((color & 992) >> 5) * 255 / 31 | 0; + const b = (color & 31) * 255 / 31 | 0; + imageData[(x + width * y) * 4 + 0] = r; + imageData[(x + width * y) * 4 + 1] = g; + imageData[(x + width * y) * 4 + 2] = b; + imageData[(x + width * y) * 4 + 3] = color & 32768 ? 0 : 255; + } + } + return imageData; + }; + _getImageData24bits = function(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { + const image = pixel_data; + const { width, height } = header; + let i = 0, x, y; + const imageData = new Uint8Array(width * height * 4); + for (y = y_start;y !== y_end; y += y_step) { + for (x = x_start;x !== x_end; x += x_step, i += 3) { + imageData[(x + width * y) * 4 + 3] = 255; + imageData[(x + width * y) * 4 + 2] = image[i + 0]; + imageData[(x + width * y) * 4 + 1] = image[i + 1]; + imageData[(x + width * y) * 4 + 0] = image[i + 2]; + } + } + return imageData; + }; + _getImageData32bits = function(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { + const image = pixel_data; + const { width, height } = header; + let i = 0, x, y; + const imageData = new Uint8Array(width * height * 4); + for (y = y_start;y !== y_end; y += y_step) { + for (x = x_start;x !== x_end; x += x_step, i += 4) { + imageData[(x + width * y) * 4 + 2] = image[i + 0]; + imageData[(x + width * y) * 4 + 1] = image[i + 1]; + imageData[(x + width * y) * 4 + 0] = image[i + 2]; + imageData[(x + width * y) * 4 + 3] = image[i + 3]; + } + } + return imageData; + }; + _getImageDataGrey8bits = function(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { + const image = pixel_data; + const { width, height } = header; + let color, i = 0, x, y; + const imageData = new Uint8Array(width * height * 4); + for (y = y_start;y !== y_end; y += y_step) { + for (x = x_start;x !== x_end; x += x_step, i++) { + color = image[i]; + imageData[(x + width * y) * 4 + 0] = color; + imageData[(x + width * y) * 4 + 1] = color; + imageData[(x + width * y) * 4 + 2] = color; + imageData[(x + width * y) * 4 + 3] = 255; + } + } + return imageData; + }; + _getImageDataGrey16bits = function(header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end) { + const image = pixel_data; + const { width, height } = header; + let i = 0, x, y; + const imageData = new Uint8Array(width * height * 4); + for (y = y_start;y !== y_end; y += y_step) { + for (x = x_start;x !== x_end; x += x_step, i += 2) { + imageData[(x + width * y) * 4 + 0] = image[i + 0]; + imageData[(x + width * y) * 4 + 1] = image[i + 0]; + imageData[(x + width * y) * 4 + 2] = image[i + 0]; + imageData[(x + width * y) * 4 + 3] = image[i + 1]; + } + } + return imageData; + }; + _TYPE_INDEXED = 1; + _TYPE_RGB = 2; + _TYPE_GREY = 3; + _TYPE_RLE_INDEXED = 9; + _TYPE_RLE_RGB = 10; + _TYPE_RLE_GREY = 11; + _ORIGIN_MASK = 48; + _ORIGIN_SHIFT = 4; + _ORIGIN_BL = 0; + _ORIGIN_BR = 1; + _ORIGIN_UL = 2; + _ORIGIN_UR = 3; + TGATools = { + GetTGAHeader, + UploadContent, + _getImageData8bits, + _getImageData16bits, + _getImageData24bits, + _getImageData32bits, + _getImageDataGrey8bits, + _getImageDataGrey16bits + }; +}); // node_modules/@babylonjs/core/Materials/Textures/Loaders/tgaTextureLoader.js class _TGATextureLoader { @@ -125247,7 +135355,12 @@ class _TGATextureLoader { }); } } -Engine2._TextureLoaders.push(new _TGATextureLoader); +var init_tgaTextureLoader = __esm(() => { + init_tga(); + init_engine(); + Engine2._TextureLoaders.push(new _TGATextureLoader); +}); + // node_modules/@babylonjs/core/Materials/Textures/Loaders/hdrTextureLoader.js class _HDRTextureLoader { constructor() { @@ -125280,372 +135393,385 @@ class _HDRTextureLoader { }); } } -Engine2._TextureLoaders.push(new _HDRTextureLoader); +var init_hdrTextureLoader = __esm(() => { + init_hdr(); + init_engine(); + Engine2._TextureLoaders.push(new _HDRTextureLoader); +}); + // node_modules/@babylonjs/core/Misc/basis.js -var workerFunc2 = function() { - const _BASIS_FORMAT = { - cTFETC1: 0, - cTFETC2: 1, - cTFBC1: 2, - cTFBC3: 3, - cTFBC4: 4, - cTFBC5: 5, - cTFBC7: 6, - cTFPVRTC1_4_RGB: 8, - cTFPVRTC1_4_RGBA: 9, - cTFASTC_4x4: 10, - cTFATC_RGB: 11, - cTFATC_RGBA_INTERPOLATED_ALPHA: 12, - cTFRGBA32: 13, - cTFRGB565: 14, - cTFBGR565: 15, - cTFRGBA4444: 16, - cTFFXT1_RGB: 17, - cTFPVRTC2_4_RGB: 18, - cTFPVRTC2_4_RGBA: 19, - cTFETC2_EAC_R11: 20, - cTFETC2_EAC_RG11: 21 - }; - let transcoderModulePromise = null; - onmessage = (event) => { - if (event.data.action === "init") { - if (!transcoderModulePromise) { - try { - importScripts(event.data.url); - } catch (e) { - postMessage({ action: "error", error: e }); +class BasisTranscodeConfiguration { +} +var workerFunc2, BASIS_FORMATS, BasisToolsOptions, GetInternalFormatFromBasisFormat, _WorkerPromise, _Worker, _actionId, _IgnoreSupportedFormats, _CreateWorkerAsync, TranscodeAsync, BindTexture, LoadTextureFromTranscodeResult, BasisTools; +var init_basis = __esm(() => { + init_tools(); + init_texture(); + init_internalTexture(); + init_math_scalar(); + workerFunc2 = function() { + const _BASIS_FORMAT = { + cTFETC1: 0, + cTFETC2: 1, + cTFBC1: 2, + cTFBC3: 3, + cTFBC4: 4, + cTFBC5: 5, + cTFBC7: 6, + cTFPVRTC1_4_RGB: 8, + cTFPVRTC1_4_RGBA: 9, + cTFASTC_4x4: 10, + cTFATC_RGB: 11, + cTFATC_RGBA_INTERPOLATED_ALPHA: 12, + cTFRGBA32: 13, + cTFRGB565: 14, + cTFBGR565: 15, + cTFRGBA4444: 16, + cTFFXT1_RGB: 17, + cTFPVRTC2_4_RGB: 18, + cTFPVRTC2_4_RGBA: 19, + cTFETC2_EAC_R11: 20, + cTFETC2_EAC_RG11: 21 + }; + let transcoderModulePromise = null; + onmessage = (event) => { + if (event.data.action === "init") { + if (!transcoderModulePromise) { + try { + importScripts(event.data.url); + } catch (e) { + postMessage({ action: "error", error: e }); + } + transcoderModulePromise = BASIS({ + wasmBinary: event.data.wasmBinary + }); } - transcoderModulePromise = BASIS({ - wasmBinary: event.data.wasmBinary - }); - } - if (transcoderModulePromise !== null) { - transcoderModulePromise.then((m) => { - BASIS = m; - m.initializeBasis(); - postMessage({ action: "init" }); - }); - } - } else if (event.data.action === "transcode") { - const config = event.data.config; - const imgData = event.data.imageData; - const loadedFile = new BASIS.BasisFile(imgData); - const fileInfo = GetFileInfo(loadedFile); - let format = event.data.ignoreSupportedFormats ? null : GetSupportedTranscodeFormat(event.data.config, fileInfo); - let needsConversion = false; - if (format === null) { - needsConversion = true; - format = fileInfo.hasAlpha ? _BASIS_FORMAT.cTFBC3 : _BASIS_FORMAT.cTFBC1; - } - let success = true; - if (!loadedFile.startTranscoding()) { - success = false; - } - const buffers = []; - for (let imageIndex = 0;imageIndex < fileInfo.images.length; imageIndex++) { - if (!success) { - break; + if (transcoderModulePromise !== null) { + transcoderModulePromise.then((m) => { + BASIS = m; + m.initializeBasis(); + postMessage({ action: "init" }); + }); } - const image = fileInfo.images[imageIndex]; - if (config.loadSingleImage === undefined || config.loadSingleImage === imageIndex) { - let mipCount = image.levels.length; - if (config.loadMipmapLevels === false) { - mipCount = 1; - } - for (let levelIndex = 0;levelIndex < mipCount; levelIndex++) { - const levelInfo = image.levels[levelIndex]; - const pixels = TranscodeLevel(loadedFile, imageIndex, levelIndex, format, needsConversion); - if (!pixels) { - success = false; - break; + } else if (event.data.action === "transcode") { + const config = event.data.config; + const imgData = event.data.imageData; + const loadedFile = new BASIS.BasisFile(imgData); + const fileInfo = GetFileInfo(loadedFile); + let format = event.data.ignoreSupportedFormats ? null : GetSupportedTranscodeFormat(event.data.config, fileInfo); + let needsConversion = false; + if (format === null) { + needsConversion = true; + format = fileInfo.hasAlpha ? _BASIS_FORMAT.cTFBC3 : _BASIS_FORMAT.cTFBC1; + } + let success = true; + if (!loadedFile.startTranscoding()) { + success = false; + } + const buffers = []; + for (let imageIndex = 0;imageIndex < fileInfo.images.length; imageIndex++) { + if (!success) { + break; + } + const image = fileInfo.images[imageIndex]; + if (config.loadSingleImage === undefined || config.loadSingleImage === imageIndex) { + let mipCount = image.levels.length; + if (config.loadMipmapLevels === false) { + mipCount = 1; + } + for (let levelIndex = 0;levelIndex < mipCount; levelIndex++) { + const levelInfo = image.levels[levelIndex]; + const pixels = TranscodeLevel(loadedFile, imageIndex, levelIndex, format, needsConversion); + if (!pixels) { + success = false; + break; + } + levelInfo.transcodedPixels = pixels; + buffers.push(levelInfo.transcodedPixels.buffer); } - levelInfo.transcodedPixels = pixels; - buffers.push(levelInfo.transcodedPixels.buffer); } } + loadedFile.close(); + loadedFile.delete(); + if (needsConversion) { + format = -1; + } + if (!success) { + postMessage({ action: "transcode", success, id: event.data.id }); + } else { + postMessage({ action: "transcode", success, id: event.data.id, fileInfo, format }, buffers); + } } - loadedFile.close(); - loadedFile.delete(); - if (needsConversion) { - format = -1; - } - if (!success) { - postMessage({ action: "transcode", success, id: event.data.id }); - } else { - postMessage({ action: "transcode", success, id: event.data.id, fileInfo, format }, buffers); + }; + function GetSupportedTranscodeFormat(config, fileInfo) { + let format = null; + if (config.supportedCompressionFormats) { + if (config.supportedCompressionFormats.astc) { + format = _BASIS_FORMAT.cTFASTC_4x4; + } else if (config.supportedCompressionFormats.bc7) { + format = _BASIS_FORMAT.cTFBC7; + } else if (config.supportedCompressionFormats.s3tc) { + format = fileInfo.hasAlpha ? _BASIS_FORMAT.cTFBC3 : _BASIS_FORMAT.cTFBC1; + } else if (config.supportedCompressionFormats.pvrtc) { + format = fileInfo.hasAlpha ? _BASIS_FORMAT.cTFPVRTC1_4_RGBA : _BASIS_FORMAT.cTFPVRTC1_4_RGB; + } else if (config.supportedCompressionFormats.etc2) { + format = _BASIS_FORMAT.cTFETC2; + } else if (config.supportedCompressionFormats.etc1) { + format = _BASIS_FORMAT.cTFETC1; + } else { + format = _BASIS_FORMAT.cTFRGB565; + } } + return format; } - }; - function GetSupportedTranscodeFormat(config, fileInfo) { - let format = null; - if (config.supportedCompressionFormats) { - if (config.supportedCompressionFormats.astc) { - format = _BASIS_FORMAT.cTFASTC_4x4; - } else if (config.supportedCompressionFormats.bc7) { - format = _BASIS_FORMAT.cTFBC7; - } else if (config.supportedCompressionFormats.s3tc) { - format = fileInfo.hasAlpha ? _BASIS_FORMAT.cTFBC3 : _BASIS_FORMAT.cTFBC1; - } else if (config.supportedCompressionFormats.pvrtc) { - format = fileInfo.hasAlpha ? _BASIS_FORMAT.cTFPVRTC1_4_RGBA : _BASIS_FORMAT.cTFPVRTC1_4_RGB; - } else if (config.supportedCompressionFormats.etc2) { - format = _BASIS_FORMAT.cTFETC2; - } else if (config.supportedCompressionFormats.etc1) { - format = _BASIS_FORMAT.cTFETC1; - } else { - format = _BASIS_FORMAT.cTFRGB565; + function GetFileInfo(basisFile) { + const hasAlpha = basisFile.getHasAlpha(); + const imageCount = basisFile.getNumImages(); + const images = []; + for (let i = 0;i < imageCount; i++) { + const imageInfo = { + levels: [] + }; + const levelCount = basisFile.getNumLevels(i); + for (let level = 0;level < levelCount; level++) { + const levelInfo = { + width: basisFile.getImageWidth(i, level), + height: basisFile.getImageHeight(i, level) + }; + imageInfo.levels.push(levelInfo); + } + images.push(imageInfo); } + const info = { hasAlpha, images }; + return info; } - return format; - } - function GetFileInfo(basisFile) { - const hasAlpha = basisFile.getHasAlpha(); - const imageCount = basisFile.getNumImages(); - const images = []; - for (let i = 0;i < imageCount; i++) { - const imageInfo = { - levels: [] - }; - const levelCount = basisFile.getNumLevels(i); - for (let level = 0;level < levelCount; level++) { - const levelInfo = { - width: basisFile.getImageWidth(i, level), - height: basisFile.getImageHeight(i, level) - }; - imageInfo.levels.push(levelInfo); + function TranscodeLevel(loadedFile, imageIndex, levelIndex, format, convertToRgb565) { + const dstSize = loadedFile.getImageTranscodedSizeInBytes(imageIndex, levelIndex, format); + let dst = new Uint8Array(dstSize); + if (!loadedFile.transcodeImage(dst, imageIndex, levelIndex, format, 1, 0)) { + return null; } - images.push(imageInfo); + if (convertToRgb565) { + const alignedWidth = loadedFile.getImageWidth(imageIndex, levelIndex) + 3 & ~3; + const alignedHeight = loadedFile.getImageHeight(imageIndex, levelIndex) + 3 & ~3; + dst = ConvertDxtToRgb565(dst, 0, alignedWidth, alignedHeight); + } + return dst; + } + function ConvertDxtToRgb565(src, srcByteOffset, width, height) { + const c = new Uint16Array(4); + const dst = new Uint16Array(width * height); + const blockWidth = width / 4; + const blockHeight = height / 4; + for (let blockY = 0;blockY < blockHeight; blockY++) { + for (let blockX = 0;blockX < blockWidth; blockX++) { + const i = srcByteOffset + 8 * (blockY * blockWidth + blockX); + c[0] = src[i] | src[i + 1] << 8; + c[1] = src[i + 2] | src[i + 3] << 8; + c[2] = (2 * (c[0] & 31) + 1 * (c[1] & 31)) / 3 | (2 * (c[0] & 2016) + 1 * (c[1] & 2016)) / 3 & 2016 | (2 * (c[0] & 63488) + 1 * (c[1] & 63488)) / 3 & 63488; + c[3] = (2 * (c[1] & 31) + 1 * (c[0] & 31)) / 3 | (2 * (c[1] & 2016) + 1 * (c[0] & 2016)) / 3 & 2016 | (2 * (c[1] & 63488) + 1 * (c[0] & 63488)) / 3 & 63488; + for (let row = 0;row < 4; row++) { + const m = src[i + 4 + row]; + let dstI = (blockY * 4 + row) * width + blockX * 4; + dst[dstI++] = c[m & 3]; + dst[dstI++] = c[m >> 2 & 3]; + dst[dstI++] = c[m >> 4 & 3]; + dst[dstI++] = c[m >> 6 & 3]; + } + } + } + return dst; } - const info = { hasAlpha, images }; - return info; - } - function TranscodeLevel(loadedFile, imageIndex, levelIndex, format, convertToRgb565) { - const dstSize = loadedFile.getImageTranscodedSizeInBytes(imageIndex, levelIndex, format); - let dst = new Uint8Array(dstSize); - if (!loadedFile.transcodeImage(dst, imageIndex, levelIndex, format, 1, 0)) { - return null; + }; + (function(BASIS_FORMATS2) { + BASIS_FORMATS2[BASIS_FORMATS2["cTFETC1"] = 0] = "cTFETC1"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFETC2"] = 1] = "cTFETC2"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFBC1"] = 2] = "cTFBC1"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFBC3"] = 3] = "cTFBC3"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFBC4"] = 4] = "cTFBC4"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFBC5"] = 5] = "cTFBC5"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFBC7"] = 6] = "cTFBC7"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFPVRTC1_4_RGB"] = 8] = "cTFPVRTC1_4_RGB"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFPVRTC1_4_RGBA"] = 9] = "cTFPVRTC1_4_RGBA"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFASTC_4x4"] = 10] = "cTFASTC_4x4"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFATC_RGB"] = 11] = "cTFATC_RGB"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFATC_RGBA_INTERPOLATED_ALPHA"] = 12] = "cTFATC_RGBA_INTERPOLATED_ALPHA"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFRGBA32"] = 13] = "cTFRGBA32"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFRGB565"] = 14] = "cTFRGB565"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFBGR565"] = 15] = "cTFBGR565"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFRGBA4444"] = 16] = "cTFRGBA4444"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFFXT1_RGB"] = 17] = "cTFFXT1_RGB"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFPVRTC2_4_RGB"] = 18] = "cTFPVRTC2_4_RGB"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFPVRTC2_4_RGBA"] = 19] = "cTFPVRTC2_4_RGBA"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFETC2_EAC_R11"] = 20] = "cTFETC2_EAC_R11"; + BASIS_FORMATS2[BASIS_FORMATS2["cTFETC2_EAC_RG11"] = 21] = "cTFETC2_EAC_RG11"; + })(BASIS_FORMATS || (BASIS_FORMATS = {})); + BasisToolsOptions = { + JSModuleURL: `${Tools._DefaultCdnUrl}/basisTranscoder/1/basis_transcoder.js`, + WasmModuleURL: `${Tools._DefaultCdnUrl}/basisTranscoder/1/basis_transcoder.wasm` + }; + GetInternalFormatFromBasisFormat = (basisFormat, engine39) => { + let format; + switch (basisFormat) { + case BASIS_FORMATS.cTFETC1: + format = 36196; + break; + case BASIS_FORMATS.cTFBC1: + format = 33776; + break; + case BASIS_FORMATS.cTFBC4: + format = 33779; + break; + case BASIS_FORMATS.cTFASTC_4x4: + format = 37808; + break; + case BASIS_FORMATS.cTFETC2: + format = 37496; + break; + case BASIS_FORMATS.cTFBC7: + format = 36492; + break; } - if (convertToRgb565) { - const alignedWidth = loadedFile.getImageWidth(imageIndex, levelIndex) + 3 & ~3; - const alignedHeight = loadedFile.getImageHeight(imageIndex, levelIndex) + 3 & ~3; - dst = ConvertDxtToRgb565(dst, 0, alignedWidth, alignedHeight); - } - return dst; - } - function ConvertDxtToRgb565(src, srcByteOffset, width, height) { - const c = new Uint16Array(4); - const dst = new Uint16Array(width * height); - const blockWidth = width / 4; - const blockHeight = height / 4; - for (let blockY = 0;blockY < blockHeight; blockY++) { - for (let blockX = 0;blockX < blockWidth; blockX++) { - const i = srcByteOffset + 8 * (blockY * blockWidth + blockX); - c[0] = src[i] | src[i + 1] << 8; - c[1] = src[i + 2] | src[i + 3] << 8; - c[2] = (2 * (c[0] & 31) + 1 * (c[1] & 31)) / 3 | (2 * (c[0] & 2016) + 1 * (c[1] & 2016)) / 3 & 2016 | (2 * (c[0] & 63488) + 1 * (c[1] & 63488)) / 3 & 63488; - c[3] = (2 * (c[1] & 31) + 1 * (c[0] & 31)) / 3 | (2 * (c[1] & 2016) + 1 * (c[0] & 2016)) / 3 & 2016 | (2 * (c[1] & 63488) + 1 * (c[0] & 63488)) / 3 & 63488; - for (let row = 0;row < 4; row++) { - const m = src[i + 4 + row]; - let dstI = (blockY * 4 + row) * width + blockX * 4; - dst[dstI++] = c[m & 3]; - dst[dstI++] = c[m >> 2 & 3]; - dst[dstI++] = c[m >> 4 & 3]; - dst[dstI++] = c[m >> 6 & 3]; - } - } - } - return dst; - } -}; -var BASIS_FORMATS; -(function(BASIS_FORMATS2) { - BASIS_FORMATS2[BASIS_FORMATS2["cTFETC1"] = 0] = "cTFETC1"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFETC2"] = 1] = "cTFETC2"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFBC1"] = 2] = "cTFBC1"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFBC3"] = 3] = "cTFBC3"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFBC4"] = 4] = "cTFBC4"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFBC5"] = 5] = "cTFBC5"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFBC7"] = 6] = "cTFBC7"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFPVRTC1_4_RGB"] = 8] = "cTFPVRTC1_4_RGB"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFPVRTC1_4_RGBA"] = 9] = "cTFPVRTC1_4_RGBA"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFASTC_4x4"] = 10] = "cTFASTC_4x4"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFATC_RGB"] = 11] = "cTFATC_RGB"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFATC_RGBA_INTERPOLATED_ALPHA"] = 12] = "cTFATC_RGBA_INTERPOLATED_ALPHA"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFRGBA32"] = 13] = "cTFRGBA32"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFRGB565"] = 14] = "cTFRGB565"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFBGR565"] = 15] = "cTFBGR565"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFRGBA4444"] = 16] = "cTFRGBA4444"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFFXT1_RGB"] = 17] = "cTFFXT1_RGB"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFPVRTC2_4_RGB"] = 18] = "cTFPVRTC2_4_RGB"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFPVRTC2_4_RGBA"] = 19] = "cTFPVRTC2_4_RGBA"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFETC2_EAC_R11"] = 20] = "cTFETC2_EAC_R11"; - BASIS_FORMATS2[BASIS_FORMATS2["cTFETC2_EAC_RG11"] = 21] = "cTFETC2_EAC_RG11"; -})(BASIS_FORMATS || (BASIS_FORMATS = {})); -var BasisToolsOptions = { - JSModuleURL: `${Tools._DefaultCdnUrl}/basisTranscoder/1/basis_transcoder.js`, - WasmModuleURL: `${Tools._DefaultCdnUrl}/basisTranscoder/1/basis_transcoder.wasm` -}; -var GetInternalFormatFromBasisFormat = (basisFormat, engine39) => { - let format; - switch (basisFormat) { - case BASIS_FORMATS.cTFETC1: - format = 36196; - break; - case BASIS_FORMATS.cTFBC1: - format = 33776; - break; - case BASIS_FORMATS.cTFBC4: - format = 33779; - break; - case BASIS_FORMATS.cTFASTC_4x4: - format = 37808; - break; - case BASIS_FORMATS.cTFETC2: - format = 37496; - break; - case BASIS_FORMATS.cTFBC7: - format = 36492; - break; - } - if (format === undefined) { - throw "The chosen Basis transcoder format is not currently supported"; - } - return format; -}; -var _WorkerPromise = null; -var _Worker = null; -var _actionId = 0; -var _IgnoreSupportedFormats = false; -var _CreateWorkerAsync = () => { - if (!_WorkerPromise) { - _WorkerPromise = new Promise((res, reject) => { - if (_Worker) { - res(_Worker); - } else { - Tools.LoadFileAsync(Tools.GetBabylonScriptURL(BasisToolsOptions.WasmModuleURL)).then((wasmBinary) => { - if (typeof URL !== "function") { - return reject("Basis transcoder requires an environment with a URL constructor"); - } - const workerBlobUrl = URL.createObjectURL(new Blob([`(${workerFunc2})()`], { type: "application/javascript" })); - _Worker = new Worker(workerBlobUrl); - const initHandler = (msg) => { - if (msg.data.action === "init") { - _Worker.removeEventListener("message", initHandler); - res(_Worker); - } else if (msg.data.action === "error") { - reject(msg.data.error || "error initializing worker"); + if (format === undefined) { + throw "The chosen Basis transcoder format is not currently supported"; + } + return format; + }; + _WorkerPromise = null; + _Worker = null; + _actionId = 0; + _IgnoreSupportedFormats = false; + _CreateWorkerAsync = () => { + if (!_WorkerPromise) { + _WorkerPromise = new Promise((res, reject) => { + if (_Worker) { + res(_Worker); + } else { + Tools.LoadFileAsync(Tools.GetBabylonScriptURL(BasisToolsOptions.WasmModuleURL)).then((wasmBinary) => { + if (typeof URL !== "function") { + return reject("Basis transcoder requires an environment with a URL constructor"); } - }; - _Worker.addEventListener("message", initHandler); - _Worker.postMessage({ action: "init", url: Tools.GetBabylonScriptURL(BasisToolsOptions.JSModuleURL), wasmBinary }); - }).catch(reject); - } - }); - } - return _WorkerPromise; -}; -var TranscodeAsync = (data, config) => { - const dataView = data instanceof ArrayBuffer ? new Uint8Array(data) : data; - return new Promise((res, rej) => { - _CreateWorkerAsync().then(() => { - const actionId = _actionId++; - const messageHandler = (msg) => { - if (msg.data.action === "transcode" && msg.data.id === actionId) { - _Worker.removeEventListener("message", messageHandler); - if (!msg.data.success) { - rej("Transcode is not supported on this device"); - } else { - res(msg.data); - } + const workerBlobUrl = URL.createObjectURL(new Blob([`(${workerFunc2})()`], { type: "application/javascript" })); + _Worker = new Worker(workerBlobUrl); + const initHandler = (msg) => { + if (msg.data.action === "init") { + _Worker.removeEventListener("message", initHandler); + res(_Worker); + } else if (msg.data.action === "error") { + reject(msg.data.error || "error initializing worker"); + } + }; + _Worker.addEventListener("message", initHandler); + _Worker.postMessage({ action: "init", url: Tools.GetBabylonScriptURL(BasisToolsOptions.JSModuleURL), wasmBinary }); + }).catch(reject); } - }; - _Worker.addEventListener("message", messageHandler); - const dataViewCopy = new Uint8Array(dataView.byteLength); - dataViewCopy.set(new Uint8Array(dataView.buffer, dataView.byteOffset, dataView.byteLength)); - _Worker.postMessage({ action: "transcode", id: actionId, imageData: dataViewCopy, config, ignoreSupportedFormats: _IgnoreSupportedFormats }, [ - dataViewCopy.buffer - ]); - }, (error5) => { - rej(error5); + }); + } + return _WorkerPromise; + }; + TranscodeAsync = (data, config) => { + const dataView = data instanceof ArrayBuffer ? new Uint8Array(data) : data; + return new Promise((res, rej) => { + _CreateWorkerAsync().then(() => { + const actionId = _actionId++; + const messageHandler = (msg) => { + if (msg.data.action === "transcode" && msg.data.id === actionId) { + _Worker.removeEventListener("message", messageHandler); + if (!msg.data.success) { + rej("Transcode is not supported on this device"); + } else { + res(msg.data); + } + } + }; + _Worker.addEventListener("message", messageHandler); + const dataViewCopy = new Uint8Array(dataView.byteLength); + dataViewCopy.set(new Uint8Array(dataView.buffer, dataView.byteOffset, dataView.byteLength)); + _Worker.postMessage({ action: "transcode", id: actionId, imageData: dataViewCopy, config, ignoreSupportedFormats: _IgnoreSupportedFormats }, [ + dataViewCopy.buffer + ]); + }, (error5) => { + rej(error5); + }); }); - }); -}; -var BindTexture = (texture40, engine39) => { - var _a, _b; - let target = (_a = engine39._gl) === null || _a === undefined ? undefined : _a.TEXTURE_2D; - if (texture40.isCube) { - target = (_b = engine39._gl) === null || _b === undefined ? undefined : _b.TEXTURE_CUBE_MAP; - } - engine39._bindTextureDirectly(target, texture40, true); -}; -var LoadTextureFromTranscodeResult = (texture40, transcodeResult) => { - const engine39 = texture40.getEngine(); - for (let i = 0;i < transcodeResult.fileInfo.images.length; i++) { - const rootImage = transcodeResult.fileInfo.images[i].levels[0]; - texture40._invertVScale = texture40.invertY; - if (transcodeResult.format === -1 || transcodeResult.format === BASIS_FORMATS.cTFRGB565) { - texture40.type = 10; - texture40.format = 4; - if (engine39._features.basisNeedsPOT && (Scalar.Log2(rootImage.width) % 1 !== 0 || Scalar.Log2(rootImage.height) % 1 !== 0)) { - const source = new InternalTexture(engine39, InternalTextureSource.Temp); - texture40._invertVScale = texture40.invertY; - source.type = 10; - source.format = 4; - source.width = rootImage.width + 3 & ~3; - source.height = rootImage.height + 3 & ~3; - BindTexture(source, engine39); - engine39._uploadDataToTextureDirectly(source, new Uint16Array(rootImage.transcodedPixels.buffer), i, 0, 4, true); - engine39._rescaleTexture(source, texture40, engine39.scenes[0], engine39._getInternalFormat(4), () => { - engine39._releaseTexture(source); + }; + BindTexture = (texture40, engine39) => { + var _a, _b; + let target = (_a = engine39._gl) === null || _a === undefined ? undefined : _a.TEXTURE_2D; + if (texture40.isCube) { + target = (_b = engine39._gl) === null || _b === undefined ? undefined : _b.TEXTURE_CUBE_MAP; + } + engine39._bindTextureDirectly(target, texture40, true); + }; + LoadTextureFromTranscodeResult = (texture40, transcodeResult) => { + const engine39 = texture40.getEngine(); + for (let i = 0;i < transcodeResult.fileInfo.images.length; i++) { + const rootImage = transcodeResult.fileInfo.images[i].levels[0]; + texture40._invertVScale = texture40.invertY; + if (transcodeResult.format === -1 || transcodeResult.format === BASIS_FORMATS.cTFRGB565) { + texture40.type = 10; + texture40.format = 4; + if (engine39._features.basisNeedsPOT && (Scalar.Log2(rootImage.width) % 1 !== 0 || Scalar.Log2(rootImage.height) % 1 !== 0)) { + const source = new InternalTexture(engine39, InternalTextureSource.Temp); + texture40._invertVScale = texture40.invertY; + source.type = 10; + source.format = 4; + source.width = rootImage.width + 3 & ~3; + source.height = rootImage.height + 3 & ~3; + BindTexture(source, engine39); + engine39._uploadDataToTextureDirectly(source, new Uint16Array(rootImage.transcodedPixels.buffer), i, 0, 4, true); + engine39._rescaleTexture(source, texture40, engine39.scenes[0], engine39._getInternalFormat(4), () => { + engine39._releaseTexture(source); + BindTexture(texture40, engine39); + }); + } else { + texture40._invertVScale = !texture40.invertY; + texture40.width = rootImage.width + 3 & ~3; + texture40.height = rootImage.height + 3 & ~3; + texture40.samplingMode = 2; BindTexture(texture40, engine39); - }); + engine39._uploadDataToTextureDirectly(texture40, new Uint16Array(rootImage.transcodedPixels.buffer), i, 0, 4, true); + } } else { - texture40._invertVScale = !texture40.invertY; - texture40.width = rootImage.width + 3 & ~3; - texture40.height = rootImage.height + 3 & ~3; - texture40.samplingMode = 2; + texture40.width = rootImage.width; + texture40.height = rootImage.height; + texture40.generateMipMaps = transcodeResult.fileInfo.images[i].levels.length > 1; + const format = BasisTools.GetInternalFormatFromBasisFormat(transcodeResult.format, engine39); + texture40.format = format; BindTexture(texture40, engine39); - engine39._uploadDataToTextureDirectly(texture40, new Uint16Array(rootImage.transcodedPixels.buffer), i, 0, 4, true); - } - } else { - texture40.width = rootImage.width; - texture40.height = rootImage.height; - texture40.generateMipMaps = transcodeResult.fileInfo.images[i].levels.length > 1; - const format = BasisTools.GetInternalFormatFromBasisFormat(transcodeResult.format, engine39); - texture40.format = format; - BindTexture(texture40, engine39); - transcodeResult.fileInfo.images[i].levels.forEach((level, index) => { - engine39._uploadCompressedDataToTextureDirectly(texture40, format, level.width, level.height, level.transcodedPixels, i, index); - }); - if (engine39._features.basisNeedsPOT && (Scalar.Log2(texture40.width) % 1 !== 0 || Scalar.Log2(texture40.height) % 1 !== 0)) { - Tools.Warn("Loaded .basis texture width and height are not a power of two. Texture wrapping will be set to Texture.CLAMP_ADDRESSMODE as other modes are not supported with non power of two dimensions in webGL 1."); - texture40._cachedWrapU = Texture.CLAMP_ADDRESSMODE; - texture40._cachedWrapV = Texture.CLAMP_ADDRESSMODE; + transcodeResult.fileInfo.images[i].levels.forEach((level, index) => { + engine39._uploadCompressedDataToTextureDirectly(texture40, format, level.width, level.height, level.transcodedPixels, i, index); + }); + if (engine39._features.basisNeedsPOT && (Scalar.Log2(texture40.width) % 1 !== 0 || Scalar.Log2(texture40.height) % 1 !== 0)) { + Tools.Warn("Loaded .basis texture width and height are not a power of two. Texture wrapping will be set to Texture.CLAMP_ADDRESSMODE as other modes are not supported with non power of two dimensions in webGL 1."); + texture40._cachedWrapU = Texture.CLAMP_ADDRESSMODE; + texture40._cachedWrapV = Texture.CLAMP_ADDRESSMODE; + } } } - } -}; -var BasisTools = { - JSModuleURL: BasisToolsOptions.JSModuleURL, - WasmModuleURL: BasisToolsOptions.WasmModuleURL, - GetInternalFormatFromBasisFormat, - TranscodeAsync, - LoadTextureFromTranscodeResult -}; -Object.defineProperty(BasisTools, "JSModuleURL", { - get: function() { - return BasisToolsOptions.JSModuleURL; - }, - set: function(value) { - BasisToolsOptions.JSModuleURL = value; - } -}); -Object.defineProperty(BasisTools, "WasmModuleURL", { - get: function() { - return BasisToolsOptions.WasmModuleURL; - }, - set: function(value) { - BasisToolsOptions.WasmModuleURL = value; - } + }; + BasisTools = { + JSModuleURL: BasisToolsOptions.JSModuleURL, + WasmModuleURL: BasisToolsOptions.WasmModuleURL, + GetInternalFormatFromBasisFormat, + TranscodeAsync, + LoadTextureFromTranscodeResult + }; + Object.defineProperty(BasisTools, "JSModuleURL", { + get: function() { + return BasisToolsOptions.JSModuleURL; + }, + set: function(value) { + BasisToolsOptions.JSModuleURL = value; + } + }); + Object.defineProperty(BasisTools, "WasmModuleURL", { + get: function() { + return BasisToolsOptions.WasmModuleURL; + }, + set: function(value) { + BasisToolsOptions.WasmModuleURL = value; + } + }); }); // node_modules/@babylonjs/core/Materials/Textures/Loaders/basisTextureLoader.js @@ -125716,7 +135842,23 @@ class _BasisTextureLoader { }); } } -Engine2._TextureLoaders.push(new _BasisTextureLoader); +var init_basisTextureLoader = __esm(() => { + init_engine(); + init_basis(); + init_tools(); + Engine2._TextureLoaders.push(new _BasisTextureLoader); +}); + +// node_modules/@babylonjs/core/Materials/Textures/Loaders/index.js +var init_Loaders = __esm(() => { + init_ddsTextureLoader(); + init_envTextureLoader(); + init_ktxTextureLoader(); + init_tgaTextureLoader(); + init_hdrTextureLoader(); + init_basisTextureLoader(); +}); + // node_modules/@babylonjs/core/Materials/Textures/multiRenderTarget.js class MultiRenderTarget extends RenderTargetTexture { get isSupported() { @@ -125746,13 +135888,13 @@ class MultiRenderTarget extends RenderTargetTexture { } } } - constructor(name176, size, count, scene22, options, textureNames) { + constructor(name177, size, count, scene22, options, textureNames) { const generateMipMaps = options && options.generateMipMaps ? options.generateMipMaps : false; const generateDepthTexture = options && options.generateDepthTexture ? options.generateDepthTexture : false; const depthTextureFormat = options && options.depthTextureFormat ? options.depthTextureFormat : 15; const doNotChangeAspectRatio = !options || options.doNotChangeAspectRatio === undefined ? true : options.doNotChangeAspectRatio; const drawOnlyOnFirstAttachmentByDefault = options && options.drawOnlyOnFirstAttachmentByDefault ? options.drawOnlyOnFirstAttachmentByDefault : false; - super(name176, size, scene22, generateMipMaps, doNotChangeAspectRatio, undefined, undefined, undefined, undefined, undefined, undefined, undefined, true); + super(name177, size, scene22, generateMipMaps, doNotChangeAspectRatio, undefined, undefined, undefined, undefined, undefined, undefined, undefined, true); if (!this.isSupported) { this.dispose(); return; @@ -126040,6 +136182,12 @@ class MultiRenderTarget extends RenderTargetTexture { this._renderTarget = null; } } +var init_multiRenderTarget = __esm(() => { + init_texture(); + init_renderTargetTexture(); + init_engine_multiRender(); +}); + // node_modules/@babylonjs/core/Materials/Textures/Packer/frame.js class TexturePackerFrame { constructor(id, scale, offset) { @@ -126048,12 +136196,14 @@ class TexturePackerFrame { this.offset = offset; } } +var init_frame = __esm(() => { +}); // node_modules/@babylonjs/core/Materials/Textures/Packer/packer.js class TexturePacker { - constructor(name176, meshes, options, scene22) { + constructor(name177, meshes, options, scene22) { var _b, _c, _d, _e, _g, _h, _j, _k, _l, _m, _o, _p, _q; - this.name = name176; + this.name = name177; this.meshes = meshes; this.scene = scene22; this.options = options; @@ -126410,15 +136560,152 @@ class TexturePacker { } } } -TexturePacker.LAYOUT_STRIP = 0; -TexturePacker.LAYOUT_POWER2 = 1; -TexturePacker.LAYOUT_COLNUM = 2; -TexturePacker.SUBUV_WRAP = 0; -TexturePacker.SUBUV_EXTEND = 1; -TexturePacker.SUBUV_COLOR = 2; +var init_packer = __esm(() => { + init_engine(); + init_buffer(); + init_texture(); + init_dynamicTexture(); + init_math_vector(); + init_math_color(); + init_frame(); + init_logger(); + init_tools(); + TexturePacker.LAYOUT_STRIP = 0; + TexturePacker.LAYOUT_POWER2 = 1; + TexturePacker.LAYOUT_COLNUM = 2; + TexturePacker.SUBUV_WRAP = 0; + TexturePacker.SUBUV_EXTEND = 1; + TexturePacker.SUBUV_COLOR = 2; +}); + +// node_modules/@babylonjs/core/Materials/Textures/Packer/index.js +var init_Packer = __esm(() => { + init_packer(); + init_frame(); +}); + +// node_modules/@babylonjs/core/Materials/Textures/Procedurals/customProceduralTexture.js +class CustomProceduralTexture extends ProceduralTexture { + constructor(name177, texturePath, size, scene22, fallbackTexture, generateMipMaps, skipJson) { + super(name177, size, null, scene22, fallbackTexture, generateMipMaps); + this._animate = true; + this._time = 0; + this._texturePath = texturePath; + if (!skipJson) { + this._loadJson(texturePath); + } else { + this.setFragment(this._texturePath); + } + this.refreshRate = 1; + } + _loadJson(jsonUrl) { + const noConfigFile = () => { + try { + this.setFragment(this._texturePath); + } catch (ex) { + Logger.Log("No json or ShaderStore or DOM element found for CustomProceduralTexture"); + } + }; + const configFileUrl = jsonUrl + "/config.json"; + const xhr = new WebRequest; + xhr.open("GET", configFileUrl); + xhr.addEventListener("load", () => { + if (xhr.status === 200 || xhr.responseText && xhr.responseText.length > 0) { + try { + this._config = JSON.parse(xhr.response); + this.updateShaderUniforms(); + this.updateTextures(); + this.setFragment(this._texturePath + "/custom"); + this._animate = this._config.animate; + this.refreshRate = this._config.refreshrate; + } catch (ex) { + noConfigFile(); + } + } else { + noConfigFile(); + } + }, false); + xhr.addEventListener("error", () => { + noConfigFile(); + }, false); + try { + xhr.send(); + } catch (ex) { + Logger.Error("CustomProceduralTexture: Error on XHR send request."); + } + } + isReady() { + if (!super.isReady()) { + return false; + } + for (const name177 in this._textures) { + const texture43 = this._textures[name177]; + if (!texture43.isReady()) { + return false; + } + } + return true; + } + render(useCameraPostProcess) { + const scene22 = this.getScene(); + if (this._animate && scene22) { + this._time += scene22.getAnimationRatio() * 0.03; + this.updateShaderUniforms(); + } + super.render(useCameraPostProcess); + } + updateTextures() { + for (let i = 0;i < this._config.sampler2Ds.length; i++) { + this.setTexture(this._config.sampler2Ds[i].sample2Dname, new Texture(this._texturePath + "/" + this._config.sampler2Ds[i].textureRelativeUrl, this.getScene())); + } + } + updateShaderUniforms() { + if (this._config) { + for (let j = 0;j < this._config.uniforms.length; j++) { + const uniform = this._config.uniforms[j]; + switch (uniform.type) { + case "float": + this.setFloat(uniform.name, uniform.value); + break; + case "color3": + this.setColor3(uniform.name, new Color3(uniform.r, uniform.g, uniform.b)); + break; + case "color4": + this.setColor4(uniform.name, new Color4(uniform.r, uniform.g, uniform.b, uniform.a)); + break; + case "vector2": + this.setVector2(uniform.name, new Vector2(uniform.x, uniform.y)); + break; + case "vector3": + this.setVector3(uniform.name, new Vector3(uniform.x, uniform.y, uniform.z)); + break; + } + } + } + this.setFloat("time", this._time); + } + get animate() { + return this._animate; + } + set animate(value) { + this._animate = value; + } +} +var init_customProceduralTexture = __esm(() => { + init_logger(); + init_math_vector(); + init_math_color(); + init_texture(); + init_proceduralTexture(); + init_webRequest(); +}); + // node_modules/@babylonjs/core/Shaders/noise.fragment.js -var name176 = "noisePixelShader"; -var shader176 = `uniform float brightness;uniform float persistence;uniform float timeScale;varying vec2 vUV;vec2 hash22(vec2 p) +var name177, shader176; +var init_noise_fragment = __esm(() => { + init_shaderStore(); + name177 = "noisePixelShader"; + shader176 = `uniform float brightness;uniform float persistence;uniform float timeScale;varying vec2 vUV;vec2 hash22(vec2 p) {p=p*mat2(127.1,311.7,269.5,183.3);p=-1.0+2.0*fract(sin(p)*43758.5453123);return sin(p*6.283+timeScale);} float interpolationNoise(vec2 p) {vec2 pi=floor(p);vec2 pf=p-pi;vec2 w=pf*pf*(3.-2.*pf);float f00=dot(hash22(pi+vec2(.0,.0)),pf-vec2(.0,.0));float f01=dot(hash22(pi+vec2(.0,1.)),pf-vec2(.0,1.));float f10=dot(hash22(pi+vec2(1.0,0.)),pf-vec2(1.0,0.));float f11=dot(hash22(pi+vec2(1.0,1.)),pf-vec2(1.0,1.));float xm1=mix(f00,f10,w.x);float xm2=mix(f01,f11,w.x);float ym=mix(xm1,xm2,w.y); @@ -126431,12 +136718,13 @@ return sum;} void main(void) {float x=abs(vUV.x);float y=abs(vUV.y);float noise=brightness+(1.0-brightness)*perlinNoise2D(x,y);gl_FragColor=vec4(noise,noise,noise,1.0);} `; -ShaderStore.ShadersStore[name176] = shader176; + ShaderStore.ShadersStore[name177] = shader176; +}); // node_modules/@babylonjs/core/Materials/Textures/Procedurals/noiseProceduralTexture.js class NoiseProceduralTexture extends ProceduralTexture { - constructor(name177, size = 256, scene22 = EngineStore.LastCreatedScene, fallbackTexture, generateMipMaps) { - super(name177, size, "noise", scene22, fallbackTexture, generateMipMaps); + constructor(name178, size = 256, scene22 = EngineStore.LastCreatedScene, fallbackTexture, generateMipMaps) { + super(name178, size, "noise", scene22, fallbackTexture, generateMipMaps); this.time = 0; this.brightness = 0.2; this.octaves = 3; @@ -126498,7 +136786,22 @@ class NoiseProceduralTexture extends ProceduralTexture { return texture43; } } -RegisterClass("BABYLON.NoiseProceduralTexture", NoiseProceduralTexture); +var init_noiseProceduralTexture = __esm(() => { + init_engineStore(); + init_proceduralTexture(); + init_typeStore(); + init_noise_fragment(); + RegisterClass("BABYLON.NoiseProceduralTexture", NoiseProceduralTexture); +}); + +// node_modules/@babylonjs/core/Materials/Textures/Procedurals/index.js +var init_Procedurals = __esm(() => { + init_customProceduralTexture(); + init_noiseProceduralTexture(); + init_proceduralTexture(); + init_proceduralTextureSceneComponent(); +}); + // node_modules/@babylonjs/core/Materials/Textures/rawCubeTexture.js class RawCubeTexture extends CubeTexture { constructor(scene22, data, size, format = 5, type = 0, generateMipMaps = false, invertY = false, samplingMode = 3, compression = null) { @@ -126524,10 +136827,166 @@ class RawCubeTexture extends CubeTexture { }, this); } } +var init_rawCubeTexture = __esm(() => { + init_decorators(); + init_environmentTextureTools(); + init_internalTexture(); + init_cubeTexture(); + init_engine_rawTexture(); +}); + +// node_modules/@babylonjs/core/Materials/Textures/rawTexture3D.js +class RawTexture3D extends Texture { + constructor(data, width, height, depth, format, scene22, generateMipMaps = true, invertY = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, textureType = 0, creationFlags) { + super(null, scene22, !generateMipMaps, invertY); + this.format = format; + this._texture = scene22.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, null, textureType, creationFlags); + this.is3D = true; + } + update(data) { + if (!this._texture) { + return; + } + this._getEngine().updateRawTexture3D(this._texture, data, this._texture.format, this._texture.invertY, null, this._texture.type); + } +} +var init_rawTexture3D = __esm(() => { + init_texture(); + init_engine_rawTexture(); +}); + +// node_modules/@babylonjs/core/Materials/Textures/refractionTexture.js +class RefractionTexture extends RenderTargetTexture { + constructor(name178, size, scene22, generateMipMaps) { + super(name178, size, scene22, generateMipMaps, true); + this.refractionPlane = new Plane(0, 1, 0, 1); + this.depth = 2; + this.onBeforeRenderObservable.add(() => { + this.getScene().clipPlane = this.refractionPlane; + }); + this.onAfterRenderObservable.add(() => { + this.getScene().clipPlane = null; + }); + } + clone() { + const scene22 = this.getScene(); + if (!scene22) { + return this; + } + const textureSize = this.getSize(); + const newTexture = new RefractionTexture(this.name, textureSize.width, scene22, this._generateMipMaps); + newTexture.hasAlpha = this.hasAlpha; + newTexture.level = this.level; + newTexture.refractionPlane = this.refractionPlane.clone(); + if (this.renderList) { + newTexture.renderList = this.renderList.slice(0); + } + newTexture.depth = this.depth; + return newTexture; + } + serialize() { + if (!this.name) { + return null; + } + const serializationObject = super.serialize(); + serializationObject.mirrorPlane = this.refractionPlane.asArray(); + serializationObject.depth = this.depth; + return serializationObject; + } +} +var init_refractionTexture = __esm(() => { + init_math_plane(); + init_renderTargetTexture(); +}); + +// node_modules/@babylonjs/core/Materials/Textures/thinRenderTargetTexture.js +class ThinRenderTargetTexture extends ThinTexture { + get renderTarget() { + return this._renderTarget; + } + constructor(engine41, size, options) { + super(null); + this._renderTarget = null; + this._engine = engine41; + this._renderTargetOptions = options; + this.resize(size); + } + resize(size) { + var _a; + (_a = this._renderTarget) === null || _a === undefined || _a.dispose(); + this._renderTarget = null; + this._texture = null; + this._size = size; + if (this._engine) { + this._renderTarget = this._engine.createRenderTargetTexture(this._size, this._renderTargetOptions); + } + this._texture = this.renderTarget.texture; + } + getInternalTexture() { + return this._texture; + } + getClassName() { + return "ThinRenderTargetTexture"; + } + dispose(disposeOnlyFramebuffers = false) { + var _a; + (_a = this._renderTarget) === null || _a === undefined || _a.dispose(true); + this._renderTarget = null; + if (!disposeOnlyFramebuffers) { + super.dispose(); + } + } +} +var init_thinRenderTargetTexture = __esm(() => { + init_thinTexture(); +}); + +// node_modules/@babylonjs/core/Materials/Textures/index.js +var init_Textures = __esm(() => { + init_baseTexture(); + init_baseTexture_polynomial(); + init_colorGradingTexture(); + init_cubeTexture(); + init_dynamicTexture(); + init_equiRectangularCubeTexture(); + init_externalTexture(); + init_hdrFiltering(); + init_hdrCubeTexture(); + init_htmlElementTexture(); + init_internalTexture(); + init_internalTextureLoader(); + init_Loaders(); + init_mirrorTexture(); + init_multiRenderTarget(); + init_Packer(); + init_Procedurals(); + init_rawCubeTexture(); + init_rawTexture(); + init_rawTexture2DArray(); + init_rawTexture3D(); + init_refractionTexture(); + init_renderTargetTexture(); + init_textureSampler(); + init_texture(); + init_thinTexture(); + init_thinRenderTargetTexture(); + init_videoTexture(); + init_ktx2decoderTypes(); +}); + +// node_modules/@babylonjs/core/Materials/Node/Enums/index.js +var init_Enums = __esm(() => { + init_nodeMaterialBlockTargets(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockConnectionPointMode(); + init_nodeMaterialSystemValues(); + init_nodeMaterialModes(); +}); + // node_modules/@babylonjs/core/Materials/Node/nodeMaterialConnectionPointCustomObject.js class NodeMaterialConnectionPointCustomObject extends NodeMaterialConnectionPoint { - constructor(name177, ownerBlock, direction, _blockType, _blockName) { - super(name177, ownerBlock, direction); + constructor(name178, ownerBlock, direction, _blockType, _blockName) { + super(name178, ownerBlock, direction); this._blockType = _blockType; this._blockName = _blockName; this.needDualDirectionValidation = true; @@ -126539,10 +136998,14 @@ class NodeMaterialConnectionPointCustomObject extends NodeMaterialConnectionPoin return [new this._blockType(this._blockName), this.name]; } } +var init_nodeMaterialConnectionPointCustomObject = __esm(() => { + init_nodeMaterialBlockConnectionPoint(); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/bonesBlock.js class BonesBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Vertex); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Vertex); this.registerInput("matricesIndices", NodeMaterialBlockConnectionPointTypes.Vector4); this.registerInput("matricesWeights", NodeMaterialBlockConnectionPointTypes.Vector4); this.registerInput("matricesIndicesExtra", NodeMaterialBlockConnectionPointTypes.Vector4, true); @@ -126655,11 +137118,23 @@ class BonesBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.BonesBlock", BonesBlock); +var init_bonesBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialSystemValues(); + init_nodeMaterialBlockTargets(); + init_materialHelper(); + init_inputBlock(); + init_typeStore(); + init_bonesDeclaration(); + init_bonesVertex(); + RegisterClass("BABYLON.BonesBlock", BonesBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/instancesBlock.js class InstancesBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Vertex); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Vertex); this.registerInput("world0", NodeMaterialBlockConnectionPointTypes.Vector4); this.registerInput("world1", NodeMaterialBlockConnectionPointTypes.Vector4); this.registerInput("world2", NodeMaterialBlockConnectionPointTypes.Vector4); @@ -126776,11 +137251,20 @@ class InstancesBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.InstancesBlock", InstancesBlock); +var init_instancesBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockTargets(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialSystemValues(); + init_inputBlock(); + init_typeStore(); + RegisterClass("BABYLON.InstancesBlock", InstancesBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/morphTargetsBlock.js class MorphTargetsBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Vertex); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Vertex); this.registerInput("position", NodeMaterialBlockConnectionPointTypes.Vector3); this.registerInput("normal", NodeMaterialBlockConnectionPointTypes.Vector3); this.registerInput("tangent", NodeMaterialBlockConnectionPointTypes.AutoDetect); @@ -126998,11 +137482,23 @@ class MorphTargetsBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.MorphTargetsBlock", MorphTargetsBlock); +var init_morphTargetsBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_materialHelper(); + init_buffer(); + init_inputBlock(); + init_typeStore(); + init_morphTargetsVertexDeclaration(); + init_morphTargetsVertexGlobalDeclaration(); + RegisterClass("BABYLON.MorphTargetsBlock", MorphTargetsBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/lightInformationBlock.js class LightInformationBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Vertex); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Vertex); this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, false, NodeMaterialBlockTargets.Vertex); this.registerOutput("direction", NodeMaterialBlockConnectionPointTypes.Vector3); this.registerOutput("color", NodeMaterialBlockConnectionPointTypes.Color3); @@ -127141,11 +137637,28 @@ class LightInformationBlock extends NodeMaterialBlock { } } } -RegisterClass("BABYLON.LightInformationBlock", LightInformationBlock); +var init_lightInformationBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_pointLight(); + RegisterClass("BABYLON.LightInformationBlock", LightInformationBlock); +}); + +// node_modules/@babylonjs/core/Materials/Node/Blocks/Vertex/index.js +var init_Vertex = __esm(() => { + init_vertexOutputBlock(); + init_bonesBlock(); + init_instancesBlock(); + init_morphTargetsBlock(); + init_lightInformationBlock(); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/imageProcessingBlock.js class ImageProcessingBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment); this.convertInputToLinearSpace = true; this.registerInput("color", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Color4); @@ -127262,14 +137775,26 @@ class ImageProcessingBlock extends NodeMaterialBlock { this.convertInputToLinearSpace = (_a = serializationObject.convertInputToLinearSpace) !== null && _a !== undefined ? _a : true; } } -__decorate2([ - editableInPropertyPage("Convert input to linear space", PropertyTypeForEdition.Boolean, "ADVANCED") -], ImageProcessingBlock.prototype, "convertInputToLinearSpace", undefined); -RegisterClass("BABYLON.ImageProcessingBlock", ImageProcessingBlock); +var init_imageProcessingBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_nodeDecorator(); + init_helperFunctions(); + init_imageProcessingDeclaration(); + init_imageProcessingFunctions(); + __decorate2([ + editableInPropertyPage("Convert input to linear space", PropertyTypeForEdition.Boolean, "ADVANCED") + ], ImageProcessingBlock.prototype, "convertInputToLinearSpace", undefined); + RegisterClass("BABYLON.ImageProcessingBlock", ImageProcessingBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/TBNBlock.js class TBNBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment, true); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment, true); this.registerInput("normal", NodeMaterialBlockConnectionPointTypes.AutoDetect, false); this.normal.addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Color4 | NodeMaterialBlockConnectionPointTypes.Vector4 | NodeMaterialBlockConnectionPointTypes.Vector3); this.registerInput("tangent", NodeMaterialBlockConnectionPointTypes.Vector4, false); @@ -127386,12 +137911,22 @@ class TBNBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.TBNBlock", TBNBlock); +var init_TBNBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_nodeMaterialBlockConnectionPoint(); + init_typeStore(); + init_nodeMaterialConnectionPointCustomObject(); + init_nodeMaterialSystemValues(); + init_inputBlock(); + RegisterClass("BABYLON.TBNBlock", TBNBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/perturbNormalBlock.js class PerturbNormalBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment); this._tangentSpaceParameterName = ""; this._tangentCorrectionFactorName = ""; this._worldMatrixName = ""; @@ -127602,23 +138137,39 @@ class PerturbNormalBlock extends NodeMaterialBlock { this.useObjectSpaceNormalMap = !!serializationObject.useObjectSpaceNormalMap; } } -__decorate2([ - editableInPropertyPage("Invert X axis", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: false } }) -], PerturbNormalBlock.prototype, "invertX", undefined); -__decorate2([ - editableInPropertyPage("Invert Y axis", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: false } }) -], PerturbNormalBlock.prototype, "invertY", undefined); -__decorate2([ - editableInPropertyPage("Use parallax occlusion", PropertyTypeForEdition.Boolean) -], PerturbNormalBlock.prototype, "useParallaxOcclusion", undefined); -__decorate2([ - editableInPropertyPage("Object Space Mode", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: false } }) -], PerturbNormalBlock.prototype, "useObjectSpaceNormalMap", undefined); -RegisterClass("BABYLON.PerturbNormalBlock", PerturbNormalBlock); +var init_perturbNormalBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_nodeMaterialBlockConnectionPoint(); + init_typeStore(); + init_inputBlock(); + init_nodeDecorator(); + init_nodeMaterialConnectionPointCustomObject(); + init_TBNBlock(); + init_bumpFragmentMainFunctions(); + init_bumpFragmentFunctions(); + init_bumpFragment(); + __decorate2([ + editableInPropertyPage("Invert X axis", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: false } }) + ], PerturbNormalBlock.prototype, "invertX", undefined); + __decorate2([ + editableInPropertyPage("Invert Y axis", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: false } }) + ], PerturbNormalBlock.prototype, "invertY", undefined); + __decorate2([ + editableInPropertyPage("Use parallax occlusion", PropertyTypeForEdition.Boolean) + ], PerturbNormalBlock.prototype, "useParallaxOcclusion", undefined); + __decorate2([ + editableInPropertyPage("Object Space Mode", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: false } }) + ], PerturbNormalBlock.prototype, "useObjectSpaceNormalMap", undefined); + RegisterClass("BABYLON.PerturbNormalBlock", PerturbNormalBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/discardBlock.js class DiscardBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment, true); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment, true); this.registerInput("value", NodeMaterialBlockConnectionPointTypes.Float, true); this.registerInput("cutoff", NodeMaterialBlockConnectionPointTypes.Float, true); } @@ -127641,11 +138192,18 @@ class DiscardBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.DiscardBlock", DiscardBlock); +var init_discardBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.DiscardBlock", DiscardBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/frontFacingBlock.js class FrontFacingBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment); } getClassName() { @@ -127664,11 +138222,18 @@ class FrontFacingBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.FrontFacingBlock", FrontFacingBlock); +var init_frontFacingBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.FrontFacingBlock", FrontFacingBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/derivativeBlock.js class DerivativeBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment); this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect, false); this.registerOutput("dx", NodeMaterialBlockConnectionPointTypes.BasedOnInput); this.registerOutput("dy", NodeMaterialBlockConnectionPointTypes.BasedOnInput); @@ -127701,11 +138266,18 @@ class DerivativeBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.DerivativeBlock", DerivativeBlock); +var init_derivativeBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.DerivativeBlock", DerivativeBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/fragCoordBlock.js class FragCoordBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment); this.registerOutput("xy", NodeMaterialBlockConnectionPointTypes.Vector2, NodeMaterialBlockTargets.Fragment); this.registerOutput("xyz", NodeMaterialBlockConnectionPointTypes.Vector3, NodeMaterialBlockTargets.Fragment); this.registerOutput("xyzw", NodeMaterialBlockConnectionPointTypes.Vector4, NodeMaterialBlockTargets.Fragment); @@ -127756,11 +138328,18 @@ class FragCoordBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.FragCoordBlock", FragCoordBlock); +var init_fragCoordBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.FragCoordBlock", FragCoordBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/screenSizeBlock.js class ScreenSizeBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment); this.registerOutput("xy", NodeMaterialBlockConnectionPointTypes.Vector2, NodeMaterialBlockTargets.Fragment); this.registerOutput("x", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment); this.registerOutput("y", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment); @@ -127803,11 +138382,18 @@ class ScreenSizeBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.ScreenSizeBlock", ScreenSizeBlock); +var init_screenSizeBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.ScreenSizeBlock", ScreenSizeBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/screenSpaceBlock.js class ScreenSpaceBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment); this.registerInput("vector", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("worldViewProjection", NodeMaterialBlockConnectionPointTypes.Matrix); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector2); @@ -127874,11 +138460,20 @@ class ScreenSpaceBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.ScreenSpaceBlock", ScreenSpaceBlock); +var init_screenSpaceBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_nodeMaterialSystemValues(); + init_inputBlock(); + RegisterClass("BABYLON.ScreenSpaceBlock", ScreenSpaceBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/twirlBlock.js class TwirlBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment); this.registerInput("input", NodeMaterialBlockConnectionPointTypes.Vector2); this.registerInput("strength", NodeMaterialBlockConnectionPointTypes.Float); this.registerInput("center", NodeMaterialBlockConnectionPointTypes.Vector2); @@ -127954,11 +138549,20 @@ class TwirlBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.TwirlBlock", TwirlBlock); +var init_twirlBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_inputBlock(); + init_math_vector(); + RegisterClass("BABYLON.TwirlBlock", TwirlBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/heightToNormalBlock.js class HeightToNormalBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment); this.generateInWorldSpace = false; this.automaticNormalizationNormal = true; this.automaticNormalizationTangent = true; @@ -128050,20 +138654,29 @@ class HeightToNormalBlock extends NodeMaterialBlock { this.automaticNormalizationTangent = serializationObject.automaticNormalizationTangent; } } -__decorate2([ - editableInPropertyPage("Generate in world space instead of tangent space", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: true } }) -], HeightToNormalBlock.prototype, "generateInWorldSpace", undefined); -__decorate2([ - editableInPropertyPage("Force normalization for the worldNormal input", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: true } }) -], HeightToNormalBlock.prototype, "automaticNormalizationNormal", undefined); -__decorate2([ - editableInPropertyPage("Force normalization for the worldTangent input", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: true } }) -], HeightToNormalBlock.prototype, "automaticNormalizationTangent", undefined); -RegisterClass("BABYLON.HeightToNormalBlock", HeightToNormalBlock); +var init_heightToNormalBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Generate in world space instead of tangent space", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: true } }) + ], HeightToNormalBlock.prototype, "generateInWorldSpace", undefined); + __decorate2([ + editableInPropertyPage("Force normalization for the worldNormal input", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: true } }) + ], HeightToNormalBlock.prototype, "automaticNormalizationNormal", undefined); + __decorate2([ + editableInPropertyPage("Force normalization for the worldTangent input", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: true } }) + ], HeightToNormalBlock.prototype, "automaticNormalizationTangent", undefined); + RegisterClass("BABYLON.HeightToNormalBlock", HeightToNormalBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/fragDepthBlock.js class FragDepthBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment, true); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment, true); this.registerInput("depth", NodeMaterialBlockConnectionPointTypes.Float, true); this.registerInput("worldPos", NodeMaterialBlockConnectionPointTypes.Vector4, true); this.registerInput("viewProjection", NodeMaterialBlockConnectionPointTypes.Matrix, true); @@ -128100,11 +138713,18 @@ class FragDepthBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.FragDepthBlock", FragDepthBlock); +var init_fragDepthBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.FragDepthBlock", FragDepthBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/shadowMapBlock.js class ShadowMapBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment); this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, false); this.registerInput("viewProjection", NodeMaterialBlockConnectionPointTypes.Matrix, false); this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.AutoDetect, true); @@ -128180,11 +138800,18 @@ class ShadowMapBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.ShadowMapBlock", ShadowMapBlock); +var init_shadowMapBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.ShadowMapBlock", ShadowMapBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/prePassOutputBlock.js class PrePassOutputBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment, true); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment, true); this.registerInput("viewDepth", NodeMaterialBlockConnectionPointTypes.Float, true); this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.AutoDetect, true); this.registerInput("viewNormal", NodeMaterialBlockConnectionPointTypes.AutoDetect, true); @@ -128250,11 +138877,37 @@ class PrePassOutputBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.PrePassOutputBlock", PrePassOutputBlock); +var init_prePassOutputBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.PrePassOutputBlock", PrePassOutputBlock); +}); + +// node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/index.js +var init_Fragment = __esm(() => { + init_fragmentOutputBlock(); + init_imageProcessingBlock(); + init_perturbNormalBlock(); + init_discardBlock(); + init_frontFacingBlock(); + init_derivativeBlock(); + init_fragCoordBlock(); + init_screenSizeBlock(); + init_screenSpaceBlock(); + init_twirlBlock(); + init_TBNBlock(); + init_heightToNormalBlock(); + init_fragDepthBlock(); + init_shadowMapBlock(); + init_prePassOutputBlock(); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/fogBlock.js class FogBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.VertexAndFragment, false); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.VertexAndFragment, false); this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, false, NodeMaterialBlockTargets.Vertex); this.registerInput("view", NodeMaterialBlockConnectionPointTypes.Matrix, false, NodeMaterialBlockTargets.Vertex); this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect, false, NodeMaterialBlockTargets.Fragment); @@ -128342,7 +138995,18 @@ class FogBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.FogBlock", FogBlock); +var init_fogBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialSystemValues(); + init_nodeMaterialBlockTargets(); + init_materialHelper(); + init_inputBlock(); + init_typeStore(); + init_fogFragmentDeclaration(); + RegisterClass("BABYLON.FogBlock", FogBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/lightBlock.js class LightBlock extends NodeMaterialBlock { static _OnGenerateOnlyFragmentCodeChanged(block, _propertyName) { @@ -128359,8 +139023,8 @@ class LightBlock extends NodeMaterialBlock { this._setInitialTarget(this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.VertexAndFragment); this.getInputByName("worldPosition").target = this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.Vertex; } - constructor(name177) { - super(name177, NodeMaterialBlockTargets.VertexAndFragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.VertexAndFragment); this._lightId = 0; this.generateOnlyFragmentCode = false; this._isUnique = true; @@ -128599,12 +139263,33 @@ class LightBlock extends NodeMaterialBlock { this._setTarget(); } } -__decorate2([ - editableInPropertyPage("Generate only fragment code", PropertyTypeForEdition.Boolean, "ADVANCED", { - notifiers: { rebuild: true, update: true, onValidation: LightBlock._OnGenerateOnlyFragmentCodeChanged } - }) -], LightBlock.prototype, "generateOnlyFragmentCode", undefined); -RegisterClass("BABYLON.LightBlock", LightBlock); +var init_lightBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlock(); + init_nodeMaterialBlockTargets(); + init_nodeMaterialBlockConnectionPointTypes(); + init_materialHelper(); + init_nodeMaterialSystemValues(); + init_inputBlock(); + init_typeStore(); + init_nodeDecorator(); + init_lightFragmentDeclaration(); + init_lightVxFragmentDeclaration(); + init_lightUboDeclaration(); + init_lightVxUboDeclaration(); + init_lightFragment(); + init_helperFunctions(); + init_lightsFragmentFunctions(); + init_shadowsFragmentFunctions(); + init_shadowsVertex(); + __decorate2([ + editableInPropertyPage("Generate only fragment code", PropertyTypeForEdition.Boolean, "ADVANCED", { + notifiers: { rebuild: true, update: true, onValidation: LightBlock._OnGenerateOnlyFragmentCodeChanged } + }) + ], LightBlock.prototype, "generateOnlyFragmentCode", undefined); + RegisterClass("BABYLON.LightBlock", LightBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/imageSourceBlock.js class ImageSourceBlock extends NodeMaterialBlock { get texture() { @@ -128631,8 +139316,8 @@ class ImageSourceBlock extends NodeMaterialBlock { get samplerName() { return this._samplerName; } - constructor(name177) { - super(name177, NodeMaterialBlockTargets.VertexAndFragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.VertexAndFragment); this.registerOutput("source", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("source", this, NodeMaterialConnectionPointDirection.Output, ImageSourceBlock, "ImageSourceBlock")); } bind(effect11) { @@ -128697,7 +139382,18 @@ class ImageSourceBlock extends NodeMaterialBlock { } } } -RegisterClass("BABYLON.ImageSourceBlock", ImageSourceBlock); +var init_imageSourceBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockConnectionPoint(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_texture(); + init_nodeMaterial(); + init_nodeMaterialConnectionPointCustomObject(); + init_engineStore(); + RegisterClass("BABYLON.ImageSourceBlock", ImageSourceBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/textureBlock.js class TextureBlock extends NodeMaterialBlock { @@ -128778,8 +139474,8 @@ class TextureBlock extends NodeMaterialBlock { get convertToLinearSpace() { return this._convertToLinearSpace; } - constructor(name177, fragmentOnly = false) { - super(name177, fragmentOnly ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.VertexAndFragment); + constructor(name178, fragmentOnly = false) { + super(name178, fragmentOnly ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.VertexAndFragment); this._convertToGammaSpace = false; this._convertToLinearSpace = false; this.disableLevelMultiplication = false; @@ -129149,7 +139845,23 @@ class TextureBlock extends NodeMaterialBlock { } } } -RegisterClass("BABYLON.TextureBlock", TextureBlock); +var init_textureBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_nodeMaterialBlockConnectionPoint(); + init_nodeMaterial(); + init_inputBlock(); + init_typeStore(); + init_texture(); + init_nodeMaterialModes(); + init_helperFunctions(); + init_imageSourceBlock(); + init_nodeMaterialConnectionPointCustomObject(); + init_engineStore(); + RegisterClass("BABYLON.TextureBlock", TextureBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js class ReflectionTextureBaseBlock extends NodeMaterialBlock { get texture() { @@ -129184,8 +139896,8 @@ class ReflectionTextureBaseBlock extends NodeMaterialBlock { _setTarget() { this._setInitialTarget(this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.VertexAndFragment); } - constructor(name177) { - super(name177, NodeMaterialBlockTargets.VertexAndFragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.VertexAndFragment); this.generateOnlyFragmentCode = false; } getClassName() { @@ -129473,12 +140185,26 @@ class ReflectionTextureBaseBlock extends NodeMaterialBlock { this._setTarget(); } } -__decorate2([ - editableInPropertyPage("Generate only fragment code", PropertyTypeForEdition.Boolean, "ADVANCED", { - notifiers: { rebuild: true, update: true, onValidation: ReflectionTextureBaseBlock._OnGenerateOnlyFragmentCodeChanged } - }) -], ReflectionTextureBaseBlock.prototype, "generateOnlyFragmentCode", undefined); -RegisterClass("BABYLON.ReflectionTextureBaseBlock", ReflectionTextureBaseBlock); +var init_reflectionTextureBaseBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlock(); + init_nodeMaterialBlockTargets(); + init_nodeMaterial(); + init_typeStore(); + init_inputBlock(); + init_nodeMaterialSystemValues(); + init_reflectionFunction(); + init_cubeTexture(); + init_texture(); + init_engineStore(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Generate only fragment code", PropertyTypeForEdition.Boolean, "ADVANCED", { + notifiers: { rebuild: true, update: true, onValidation: ReflectionTextureBaseBlock._OnGenerateOnlyFragmentCodeChanged } + }) + ], ReflectionTextureBaseBlock.prototype, "generateOnlyFragmentCode", undefined); + RegisterClass("BABYLON.ReflectionTextureBaseBlock", ReflectionTextureBaseBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/reflectionTextureBlock.js class ReflectionTextureBlock extends ReflectionTextureBaseBlock { @@ -129501,8 +140227,8 @@ class ReflectionTextureBlock extends ReflectionTextureBaseBlock { this.getInputByName("position").target = this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.Vertex; this.getInputByName("worldPosition").target = this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.Vertex; } - constructor(name177) { - super(name177); + constructor(name178) { + super(name178); this.registerInput("position", NodeMaterialBlockConnectionPointTypes.AutoDetect, false, NodeMaterialBlockTargets.Vertex); this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, false, NodeMaterialBlockTargets.Vertex); this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.Vector4, false, NodeMaterialBlockTargets.Fragment); @@ -129589,11 +140315,20 @@ class ReflectionTextureBlock extends ReflectionTextureBaseBlock { return this; } } -RegisterClass("BABYLON.ReflectionTextureBlock", ReflectionTextureBlock); +var init_reflectionTextureBlock = __esm(() => { + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_inputBlock(); + init_nodeMaterialSystemValues(); + init_reflectionTextureBaseBlock(); + RegisterClass("BABYLON.ReflectionTextureBlock", ReflectionTextureBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/sceneDepthBlock.js class SceneDepthBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.VertexAndFragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.VertexAndFragment); this.useNonLinearDepth = false; this.storeCameraSpaceZ = false; this.force32itsFloat = false; @@ -129720,54 +140455,63 @@ class SceneDepthBlock extends NodeMaterialBlock { this.force32itsFloat = serializationObject.force32itsFloat; } } -__decorate2([ - editableInPropertyPage("Use non linear depth", PropertyTypeForEdition.Boolean, "ADVANCED", { - notifiers: { - activatePreviewCommand: true, - callback: (scene22, block) => { - const sceneDepthBlock = block; - let retVal = false; - if (sceneDepthBlock.useNonLinearDepth) { - sceneDepthBlock.storeCameraSpaceZ = false; - retVal = true; - } - if (scene22) { - scene22.disableDepthRenderer(); - } - return retVal; - } - } - }) -], SceneDepthBlock.prototype, "useNonLinearDepth", undefined); -__decorate2([ - editableInPropertyPage("Store Camera space Z", PropertyTypeForEdition.Boolean, "ADVANCED", { - notifiers: { - activatePreviewCommand: true, - callback: (scene22, block) => { - const sceneDepthBlock = block; - let retVal = false; - if (sceneDepthBlock.storeCameraSpaceZ) { - sceneDepthBlock.useNonLinearDepth = false; - retVal = true; - } - if (scene22) { - scene22.disableDepthRenderer(); +var init_sceneDepthBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Use non linear depth", PropertyTypeForEdition.Boolean, "ADVANCED", { + notifiers: { + activatePreviewCommand: true, + callback: (scene22, block) => { + const sceneDepthBlock = block; + let retVal = false; + if (sceneDepthBlock.useNonLinearDepth) { + sceneDepthBlock.storeCameraSpaceZ = false; + retVal = true; + } + if (scene22) { + scene22.disableDepthRenderer(); + } + return retVal; + } + } + }) + ], SceneDepthBlock.prototype, "useNonLinearDepth", undefined); + __decorate2([ + editableInPropertyPage("Store Camera space Z", PropertyTypeForEdition.Boolean, "ADVANCED", { + notifiers: { + activatePreviewCommand: true, + callback: (scene22, block) => { + const sceneDepthBlock = block; + let retVal = false; + if (sceneDepthBlock.storeCameraSpaceZ) { + sceneDepthBlock.useNonLinearDepth = false; + retVal = true; + } + if (scene22) { + scene22.disableDepthRenderer(); + } + return retVal; } - return retVal; } - } - }) -], SceneDepthBlock.prototype, "storeCameraSpaceZ", undefined); -__decorate2([ - editableInPropertyPage("Force 32 bits float", PropertyTypeForEdition.Boolean, "ADVANCED", { - notifiers: { activatePreviewCommand: true, callback: (scene22) => scene22 === null || scene22 === undefined ? undefined : scene22.disableDepthRenderer() } - }) -], SceneDepthBlock.prototype, "force32itsFloat", undefined); -RegisterClass("BABYLON.SceneDepthBlock", SceneDepthBlock); + }) + ], SceneDepthBlock.prototype, "storeCameraSpaceZ", undefined); + __decorate2([ + editableInPropertyPage("Force 32 bits float", PropertyTypeForEdition.Boolean, "ADVANCED", { + notifiers: { activatePreviewCommand: true, callback: (scene22) => scene22 === null || scene22 === undefined ? undefined : scene22.disableDepthRenderer() } + }) + ], SceneDepthBlock.prototype, "force32itsFloat", undefined); + RegisterClass("BABYLON.SceneDepthBlock", SceneDepthBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/clipPlanesBlock.js class ClipPlanesBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.VertexAndFragment, true); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.VertexAndFragment, true); this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4, false); } getClassName() { @@ -129844,7 +140588,27 @@ class ClipPlanesBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.ClipPlanesBlock", ClipPlanesBlock); +var init_clipPlanesBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_clipPlaneMaterialHelper(); + RegisterClass("BABYLON.ClipPlanesBlock", ClipPlanesBlock); +}); + +// node_modules/@babylonjs/core/Materials/Node/Blocks/Dual/index.js +var init_Dual = __esm(() => { + init_fogBlock(); + init_lightBlock(); + init_textureBlock(); + init_reflectionTextureBlock(); + init_currentScreenBlock(); + init_sceneDepthBlock(); + init_imageSourceBlock(); + init_clipPlanesBlock(); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Input/prePassTextureBlock.js class PrePassTextureBlock extends NodeMaterialBlock { get texture() { @@ -129853,8 +140617,8 @@ class PrePassTextureBlock extends NodeMaterialBlock { set texture(value) { return; } - constructor(name177, target = NodeMaterialBlockTargets.VertexAndFragment) { - super(name177, target, false); + constructor(name178, target = NodeMaterialBlockTargets.VertexAndFragment) { + super(name178, target, false); this.registerOutput("position", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("position", this, NodeMaterialConnectionPointDirection.Output, ImageSourceBlock, "ImageSourceBlock")); this.registerOutput("depth", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("depth", this, NodeMaterialConnectionPointDirection.Output, ImageSourceBlock, "ImageSourceBlock")); this.registerOutput("normal", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.VertexAndFragment, new NodeMaterialConnectionPointCustomObject("normal", this, NodeMaterialConnectionPointDirection.Output, ImageSourceBlock, "ImageSourceBlock")); @@ -129931,7 +140695,24 @@ class PrePassTextureBlock extends NodeMaterialBlock { } } } -RegisterClass("BABYLON.PrePassTextureBlock", PrePassTextureBlock); +var init_prePassTextureBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockConnectionPoint(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_nodeMaterialConnectionPointCustomObject(); + init_imageSourceBlock(); + RegisterClass("BABYLON.PrePassTextureBlock", PrePassTextureBlock); +}); + +// node_modules/@babylonjs/core/Materials/Node/Blocks/Input/index.js +var init_Input = __esm(() => { + init_inputBlock(); + init_animatedInputBlockTypes(); + init_prePassTextureBlock(); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Teleport/teleportInBlock.js class NodeMaterialTeleportInBlock extends NodeMaterialBlock { get endpoints() { @@ -129956,8 +140737,8 @@ class NodeMaterialTeleportInBlock extends NodeMaterialBlock { } this._target = value; } - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this._endpoints = []; this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect); } @@ -130014,11 +140795,18 @@ class NodeMaterialTeleportInBlock extends NodeMaterialBlock { this._endpoints = []; } } -RegisterClass("BABYLON.NodeMaterialTeleportInBlock", NodeMaterialTeleportInBlock); +var init_teleportInBlock = __esm(() => { + init_typeStore(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_nodeMaterialBlock(); + RegisterClass("BABYLON.NodeMaterialTeleportInBlock", NodeMaterialTeleportInBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/Teleport/teleportOutBlock.js class NodeMaterialTeleportOutBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this._entryPoint = null; this._tempEntryPointUniqueId = null; this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); @@ -130099,11 +140887,24 @@ class NodeMaterialTeleportOutBlock extends NodeMaterialBlock { this._tempEntryPointUniqueId = serializationObject.entryPoint; } } -RegisterClass("BABYLON.NodeMaterialTeleportOutBlock", NodeMaterialTeleportOutBlock); +var init_teleportOutBlock = __esm(() => { + init_typeStore(); + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + RegisterClass("BABYLON.NodeMaterialTeleportOutBlock", NodeMaterialTeleportOutBlock); +}); + +// node_modules/@babylonjs/core/Materials/Node/Blocks/Teleport/index.js +var init_Teleport = __esm(() => { + init_teleportInBlock(); + init_teleportOutBlock(); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/addBlock.js class AddBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); @@ -130131,11 +140932,18 @@ class AddBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.AddBlock", AddBlock); +var init_addBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.AddBlock", AddBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/scaleBlock.js class ScaleBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("factor", NodeMaterialBlockConnectionPointTypes.Float); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); @@ -130160,11 +140968,18 @@ class ScaleBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.ScaleBlock", ScaleBlock); +var init_scaleBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.ScaleBlock", ScaleBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/clampBlock.js class ClampBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.minimum = 0; this.maximum = 1; this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect); @@ -130203,17 +141018,26 @@ class ClampBlock extends NodeMaterialBlock { this.maximum = serializationObject.maximum; } } -__decorate2([ - editableInPropertyPage("Minimum", PropertyTypeForEdition.Float) -], ClampBlock.prototype, "minimum", undefined); -__decorate2([ - editableInPropertyPage("Maximum", PropertyTypeForEdition.Float) -], ClampBlock.prototype, "maximum", undefined); -RegisterClass("BABYLON.ClampBlock", ClampBlock); +var init_clampBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Minimum", PropertyTypeForEdition.Float) + ], ClampBlock.prototype, "minimum", undefined); + __decorate2([ + editableInPropertyPage("Maximum", PropertyTypeForEdition.Float) + ], ClampBlock.prototype, "maximum", undefined); + RegisterClass("BABYLON.ClampBlock", ClampBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/crossBlock.js class CrossBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector3); @@ -130244,7 +141068,14 @@ class CrossBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.CrossBlock", CrossBlock); +var init_crossBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.CrossBlock", CrossBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/customBlock.js class CustomBlock extends NodeMaterialBlock { get options() { @@ -130253,8 +141084,8 @@ class CustomBlock extends NodeMaterialBlock { set options(options) { this._deserializeOptions(options); } - constructor(name177) { - super(name177); + constructor(name178) { + super(name178); } getClassName() { return "CustomBlock"; @@ -130356,23 +141187,33 @@ class CustomBlock extends NodeMaterialBlock { this._linkConnectionTypes(this._findInputByName(connection.input1)[1], this._findInputByName(connection.input2)[1]); }); } - _findInputByName(name177) { - if (!name177) { + _findInputByName(name178) { + if (!name178) { return null; } for (let i = 0;i < this._inputs.length; i++) { - if (this._inputs[i].name === name177) { + if (this._inputs[i].name === name178) { return [this._inputs[i], i]; } } return null; } } -RegisterClass("BABYLON.CustomBlock", CustomBlock); +var init_customBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_nodeMaterialBlockConnectionPoint(); + init_imageSourceBlock(); + init_nodeMaterialConnectionPointCustomObject(); + RegisterClass("BABYLON.CustomBlock", CustomBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/dotBlock.js class DotBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float); @@ -130401,11 +141242,18 @@ class DotBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.DotBlock", DotBlock); +var init_dotBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.DotBlock", DotBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/normalizeBlock.js class NormalizeBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); this._outputs[0]._typeConnectionSource = this._inputs[0]; @@ -130429,11 +141277,18 @@ class NormalizeBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.NormalizeBlock", NormalizeBlock); +var init_normalizeBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.NormalizeBlock", NormalizeBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/colorMergerBlock.js class ColorMergerBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.rSwizzle = "r"; this.gSwizzle = "g"; this.bSwizzle = "b"; @@ -130473,11 +141328,11 @@ class ColorMergerBlock extends NodeMaterialBlock { get rgb() { return this.rgbOut; } - _inputRename(name177) { - if (name177 === "rgb ") { + _inputRename(name178) { + if (name178 === "rgb ") { return "rgbIn"; } - return name177; + return name178; } _buildSwizzle(len) { const swizzle = this.rSwizzle + this.gSwizzle + this.bSwizzle + this.aSwizzle; @@ -130534,11 +141389,18 @@ class ColorMergerBlock extends NodeMaterialBlock { return codeString; } } -RegisterClass("BABYLON.ColorMergerBlock", ColorMergerBlock); +var init_colorMergerBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.ColorMergerBlock", ColorMergerBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/vectorSplitterBlock.js class VectorSplitterBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("xyzw", NodeMaterialBlockConnectionPointTypes.Vector4, true); this.registerInput("xyz ", NodeMaterialBlockConnectionPointTypes.Vector3, true); this.registerInput("xy ", NodeMaterialBlockConnectionPointTypes.Vector2, true); @@ -130584,24 +141446,24 @@ class VectorSplitterBlock extends NodeMaterialBlock { get w() { return this._outputs[6]; } - _inputRename(name177) { - switch (name177) { + _inputRename(name178) { + switch (name178) { case "xy ": return "xyIn"; case "xyz ": return "xyzIn"; default: - return name177; + return name178; } } - _outputRename(name177) { - switch (name177) { + _outputRename(name178) { + switch (name178) { case "xy": return "xyOut"; case "xyz": return "xyzOut"; default: - return name177; + return name178; } } _buildBlock(state) { @@ -130642,11 +141504,18 @@ class VectorSplitterBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.VectorSplitterBlock", VectorSplitterBlock); +var init_vectorSplitterBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.VectorSplitterBlock", VectorSplitterBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/lerpBlock.js class LerpBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("gradient", NodeMaterialBlockConnectionPointTypes.AutoDetect); @@ -130678,11 +141547,18 @@ class LerpBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.LerpBlock", LerpBlock); +var init_lerpBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.LerpBlock", LerpBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/divideBlock.js class DivideBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); @@ -130710,11 +141586,18 @@ class DivideBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.DivideBlock", DivideBlock); +var init_divideBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.DivideBlock", DivideBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/subtractBlock.js class SubtractBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); @@ -130742,11 +141625,18 @@ class SubtractBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.SubtractBlock", SubtractBlock); +var init_subtractBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.SubtractBlock", SubtractBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/stepBlock.js class StepBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("value", NodeMaterialBlockConnectionPointTypes.Float); this.registerInput("edge", NodeMaterialBlockConnectionPointTypes.Float); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float); @@ -130770,11 +141660,18 @@ class StepBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.StepBlock", StepBlock); +var init_stepBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.StepBlock", StepBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/oneMinusBlock.js class OneMinusBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); this._outputs[0]._typeConnectionSource = this._inputs[0]; @@ -130796,12 +141693,19 @@ class OneMinusBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.OneMinusBlock", OneMinusBlock); -RegisterClass("BABYLON.OppositeBlock", OneMinusBlock); +var init_oneMinusBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.OneMinusBlock", OneMinusBlock); + RegisterClass("BABYLON.OppositeBlock", OneMinusBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/viewDirectionBlock.js class ViewDirectionBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("worldPosition", NodeMaterialBlockConnectionPointTypes.Vector4); this.registerInput("cameraPosition", NodeMaterialBlockConnectionPointTypes.Vector3); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector3); @@ -130835,11 +141739,20 @@ class ViewDirectionBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.ViewDirectionBlock", ViewDirectionBlock); +var init_viewDirectionBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_nodeMaterialSystemValues(); + init_inputBlock(); + RegisterClass("BABYLON.ViewDirectionBlock", ViewDirectionBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/fresnelBlock.js class FresnelBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.Vector4); this.registerInput("viewDirection", NodeMaterialBlockConnectionPointTypes.Vector3); this.registerInput("bias", NodeMaterialBlockConnectionPointTypes.Float); @@ -130889,11 +141802,21 @@ class FresnelBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.FresnelBlock", FresnelBlock); +var init_fresnelBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockTargets(); + init_nodeMaterialBlockConnectionPointTypes(); + init_typeStore(); + init_inputBlock(); + init_fresnelFunction(); + init_viewDirectionBlock(); + RegisterClass("BABYLON.FresnelBlock", FresnelBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/maxBlock.js class MaxBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); @@ -130919,11 +141842,18 @@ class MaxBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.MaxBlock", MaxBlock); +var init_maxBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.MaxBlock", MaxBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/minBlock.js class MinBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); @@ -130949,11 +141879,18 @@ class MinBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.MinBlock", MinBlock); +var init_minBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.MinBlock", MinBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/distanceBlock.js class DistanceBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float); @@ -130982,11 +141919,18 @@ class DistanceBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.DistanceBlock", DistanceBlock); +var init_distanceBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.DistanceBlock", DistanceBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/lengthBlock.js class LengthBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float); this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float); @@ -131008,11 +141952,18 @@ class LengthBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.LengthBlock", LengthBlock); +var init_lengthBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.LengthBlock", LengthBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/negateBlock.js class NegateBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); this._outputs[0]._typeConnectionSource = this._inputs[0]; @@ -131033,11 +141984,18 @@ class NegateBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.NegateBlock", NegateBlock); +var init_negateBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.NegateBlock", NegateBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/powBlock.js class PowBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("power", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); @@ -131063,11 +142021,18 @@ class PowBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.PowBlock", PowBlock); +var init_powBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.PowBlock", PowBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/randomNumberBlock.js class RandomNumberBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("seed", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float); this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector2 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4 | NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Color4); @@ -131090,11 +142055,19 @@ class RandomNumberBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.RandomNumberBlock", RandomNumberBlock); +var init_randomNumberBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_helperFunctions(); + RegisterClass("BABYLON.RandomNumberBlock", RandomNumberBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/arcTan2Block.js class ArcTan2Block extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("x", NodeMaterialBlockConnectionPointTypes.Float); this.registerInput("y", NodeMaterialBlockConnectionPointTypes.Float); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float); @@ -131118,11 +142091,18 @@ class ArcTan2Block extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.ArcTan2Block", ArcTan2Block); +var init_arcTan2Block = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.ArcTan2Block", ArcTan2Block); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/smoothStepBlock.js class SmoothStepBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("edge0", NodeMaterialBlockConnectionPointTypes.Float); this.registerInput("edge1", NodeMaterialBlockConnectionPointTypes.Float); @@ -131151,11 +142131,18 @@ class SmoothStepBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.SmoothStepBlock", SmoothStepBlock); +var init_smoothStepBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.SmoothStepBlock", SmoothStepBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/reciprocalBlock.js class ReciprocalBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); this._outputs[0]._typeConnectionSource = this._inputs[0]; @@ -131180,11 +142167,18 @@ class ReciprocalBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.ReciprocalBlock", ReciprocalBlock); +var init_reciprocalBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.ReciprocalBlock", ReciprocalBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/replaceColorBlock.js class ReplaceColorBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("reference", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("distance", NodeMaterialBlockConnectionPointTypes.Float); @@ -131230,11 +142224,18 @@ class ReplaceColorBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.ReplaceColorBlock", ReplaceColorBlock); +var init_replaceColorBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.ReplaceColorBlock", ReplaceColorBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/posterizeBlock.js class PosterizeBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("steps", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); @@ -131262,18 +142263,18 @@ class PosterizeBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.PosterizeBlock", PosterizeBlock); -// node_modules/@babylonjs/core/Materials/Node/Blocks/waveBlock.js -var WaveBlockKind; -(function(WaveBlockKind2) { - WaveBlockKind2[WaveBlockKind2["SawTooth"] = 0] = "SawTooth"; - WaveBlockKind2[WaveBlockKind2["Square"] = 1] = "Square"; - WaveBlockKind2[WaveBlockKind2["Triangle"] = 2] = "Triangle"; -})(WaveBlockKind || (WaveBlockKind = {})); +var init_posterizeBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.PosterizeBlock", PosterizeBlock); +}); +// node_modules/@babylonjs/core/Materials/Node/Blocks/waveBlock.js class WaveBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.kind = WaveBlockKind.SawTooth; this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); @@ -131318,7 +142319,20 @@ class WaveBlock extends NodeMaterialBlock { this.kind = serializationObject.kind; } } -RegisterClass("BABYLON.WaveBlock", WaveBlock); +var WaveBlockKind; +var init_waveBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + (function(WaveBlockKind2) { + WaveBlockKind2[WaveBlockKind2["SawTooth"] = 0] = "SawTooth"; + WaveBlockKind2[WaveBlockKind2["Square"] = 1] = "Square"; + WaveBlockKind2[WaveBlockKind2["Triangle"] = 2] = "Triangle"; + })(WaveBlockKind || (WaveBlockKind = {})); + RegisterClass("BABYLON.WaveBlock", WaveBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/gradientBlock.js class GradientBlockColorStep { get step() { @@ -131343,8 +142357,8 @@ class GradientBlock extends NodeMaterialBlock { colorStepsUpdated() { this.onValueChangedObservable.notifyObservers(this); } - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.colorSteps = [new GradientBlockColorStep(0, Color3.Black()), new GradientBlockColorStep(1, Color3.White())]; this.onValueChangedObservable = new Observable; this.registerInput("gradient", NodeMaterialBlockConnectionPointTypes.AutoDetect); @@ -131419,11 +142433,20 @@ class GradientBlock extends NodeMaterialBlock { return codeString; } } -RegisterClass("BABYLON.GradientBlock", GradientBlock); +var init_gradientBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_math_color(); + init_observable(); + RegisterClass("BABYLON.GradientBlock", GradientBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/nLerpBlock.js class NLerpBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("gradient", NodeMaterialBlockConnectionPointTypes.AutoDetect); @@ -131455,11 +142478,18 @@ class NLerpBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.NLerpBlock", NLerpBlock); +var init_nLerpBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.NLerpBlock", NLerpBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/worleyNoise3DBlock.js class WorleyNoise3DBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.manhattanDistance = false; this.registerInput("seed", NodeMaterialBlockConnectionPointTypes.Vector3); this.registerInput("jitter", NodeMaterialBlockConnectionPointTypes.Float); @@ -131670,14 +142700,23 @@ class WorleyNoise3DBlock extends NodeMaterialBlock { this.manhattanDistance = serializationObject.manhattanDistance; } } -__decorate2([ - editableInPropertyPage("Use Manhattan Distance", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: false } }) -], WorleyNoise3DBlock.prototype, "manhattanDistance", undefined); -RegisterClass("BABYLON.WorleyNoise3DBlock", WorleyNoise3DBlock); +var init_worleyNoise3DBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Use Manhattan Distance", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: false } }) + ], WorleyNoise3DBlock.prototype, "manhattanDistance", undefined); + RegisterClass("BABYLON.WorleyNoise3DBlock", WorleyNoise3DBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/simplexPerlin3DBlock.js class SimplexPerlin3DBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("seed", NodeMaterialBlockConnectionPointTypes.Vector3); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float); } @@ -131744,11 +142783,18 @@ class SimplexPerlin3DBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.SimplexPerlin3DBlock", SimplexPerlin3DBlock); +var init_simplexPerlin3DBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.SimplexPerlin3DBlock", SimplexPerlin3DBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/normalBlendBlock.js class NormalBlendBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("normalMap0", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("normalMap1", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector3); @@ -131783,11 +142829,18 @@ class NormalBlendBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.NormalBlendBlock", NormalBlendBlock); +var init_normalBlendBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.NormalBlendBlock", NormalBlendBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/rotate2dBlock.js class Rotate2dBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("input", NodeMaterialBlockConnectionPointTypes.Vector2); this.registerInput("angle", NodeMaterialBlockConnectionPointTypes.Float); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector2); @@ -131820,11 +142873,19 @@ class Rotate2dBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.Rotate2dBlock", Rotate2dBlock); +var init_rotate2dBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_inputBlock(); + RegisterClass("BABYLON.Rotate2dBlock", Rotate2dBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/reflectBlock.js class ReflectBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("incident", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("normal", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Vector3); @@ -131850,11 +142911,18 @@ class ReflectBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.ReflectBlock", ReflectBlock); +var init_reflectBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.ReflectBlock", ReflectBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/refractBlock.js class RefractBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("incident", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("normal", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("ior", NodeMaterialBlockConnectionPointTypes.Float); @@ -131884,11 +142952,18 @@ class RefractBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.RefractBlock", RefractBlock); +var init_refractBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.RefractBlock", RefractBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/desaturateBlock.js class DesaturateBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("color", NodeMaterialBlockConnectionPointTypes.Color3); this.registerInput("level", NodeMaterialBlockConnectionPointTypes.Float); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Color3); @@ -131920,11 +142995,18 @@ class DesaturateBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.DesaturateBlock", DesaturateBlock); +var init_desaturateBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.DesaturateBlock", DesaturateBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/sheenBlock.js class SheenBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment); this.albedoScaling = false; this.linkSheenWithAlbedo = false; this._isUnique = true; @@ -132055,18 +143137,28 @@ class SheenBlock extends NodeMaterialBlock { this.linkSheenWithAlbedo = serializationObject.linkSheenWithAlbedo; } } -__decorate2([ - editableInPropertyPage("Albedo scaling", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: true } }) -], SheenBlock.prototype, "albedoScaling", undefined); -__decorate2([ - editableInPropertyPage("Link sheen with albedo", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: true } }) -], SheenBlock.prototype, "linkSheenWithAlbedo", undefined); -RegisterClass("BABYLON.SheenBlock", SheenBlock); +var init_sheenBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockConnectionPoint(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_nodeDecorator(); + init_nodeMaterialConnectionPointCustomObject(); + __decorate2([ + editableInPropertyPage("Albedo scaling", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: true } }) + ], SheenBlock.prototype, "albedoScaling", undefined); + __decorate2([ + editableInPropertyPage("Link sheen with albedo", PropertyTypeForEdition.Boolean, "PROPERTIES", { notifiers: { update: true } }) + ], SheenBlock.prototype, "linkSheenWithAlbedo", undefined); + RegisterClass("BABYLON.SheenBlock", SheenBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/anisotropyBlock.js class AnisotropyBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment); this._tangentCorrectionFactorName = ""; this._isUnique = true; this.registerInput("intensity", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment); @@ -132187,7 +143279,16 @@ class AnisotropyBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.AnisotropyBlock", AnisotropyBlock); +var init_anisotropyBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockConnectionPoint(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_nodeMaterialConnectionPointCustomObject(); + init_TBNBlock(); + RegisterClass("BABYLON.AnisotropyBlock", AnisotropyBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/reflectionBlock.js class ReflectionBlock extends ReflectionTextureBaseBlock { @@ -132207,8 +143308,8 @@ class ReflectionBlock extends ReflectionTextureBaseBlock { this.forceIrradianceInFragment = true; } } - constructor(name177) { - super(name177); + constructor(name178) { + super(name178); this.useSphericalHarmonics = true; this.forceIrradianceInFragment = false; this._isUnique = true; @@ -132487,18 +143588,30 @@ class ReflectionBlock extends ReflectionTextureBaseBlock { } } } -__decorate2([ - editableInPropertyPage("Spherical Harmonics", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) -], ReflectionBlock.prototype, "useSphericalHarmonics", undefined); -__decorate2([ - editableInPropertyPage("Force irradiance in fragment", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) -], ReflectionBlock.prototype, "forceIrradianceInFragment", undefined); -RegisterClass("BABYLON.ReflectionBlock", ReflectionBlock); +var init_reflectionBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockConnectionPoint(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_nodeMaterialConnectionPointCustomObject(); + init_reflectionTextureBaseBlock(); + init_texture(); + init_nodeDecorator(); + init_math_scalar(); + __decorate2([ + editableInPropertyPage("Spherical Harmonics", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) + ], ReflectionBlock.prototype, "useSphericalHarmonics", undefined); + __decorate2([ + editableInPropertyPage("Force irradiance in fragment", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) + ], ReflectionBlock.prototype, "forceIrradianceInFragment", undefined); + RegisterClass("BABYLON.ReflectionBlock", ReflectionBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/clearCoatBlock.js class ClearCoatBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment); this._tangentCorrectionFactorName = ""; this.remapF0OnInterfaceChange = true; this._isUnique = true; @@ -132747,15 +143860,28 @@ class ClearCoatBlock extends NodeMaterialBlock { this.remapF0OnInterfaceChange = (_a = serializationObject.remapF0OnInterfaceChange) !== null && _a !== undefined ? _a : true; } } -__decorate2([ - editableInPropertyPage("Remap F0 on interface change", PropertyTypeForEdition.Boolean, "ADVANCED") -], ClearCoatBlock.prototype, "remapF0OnInterfaceChange", undefined); -RegisterClass("BABYLON.ClearCoatBlock", ClearCoatBlock); +var init_clearCoatBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockConnectionPoint(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_inputBlock(); + init_nodeMaterialConnectionPointCustomObject(); + init_pbrClearCoatConfiguration(); + init_nodeDecorator(); + init_TBNBlock(); + __decorate2([ + editableInPropertyPage("Remap F0 on interface change", PropertyTypeForEdition.Boolean, "ADVANCED") + ], ClearCoatBlock.prototype, "remapF0OnInterfaceChange", undefined); + RegisterClass("BABYLON.ClearCoatBlock", ClearCoatBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/iridescenceBlock.js class IridescenceBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment); this._isUnique = true; this.registerInput("intensity", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment); this.registerInput("indexOfRefraction", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment); @@ -132839,12 +143965,22 @@ class IridescenceBlock extends NodeMaterialBlock { super._deserialize(serializationObject, scene22, rootUrl); } } -RegisterClass("BABYLON.IridescenceBlock", IridescenceBlock); +var init_iridescenceBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockConnectionPoint(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_inputBlock(); + init_nodeMaterialConnectionPointCustomObject(); + init_pbrIridescenceConfiguration(); + RegisterClass("BABYLON.IridescenceBlock", IridescenceBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/refractionBlock.js class RefractionBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment); this.linkRefractionWithTransparency = false; this.invertRefractionY = false; this.useThicknessAsDepth = false; @@ -133044,21 +144180,36 @@ class RefractionBlock extends NodeMaterialBlock { this.useThicknessAsDepth = !!serializationObject.useThicknessAsDepth; } } -__decorate2([ - editableInPropertyPage("Link refraction to transparency", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) -], RefractionBlock.prototype, "linkRefractionWithTransparency", undefined); -__decorate2([ - editableInPropertyPage("Invert refraction Y", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) -], RefractionBlock.prototype, "invertRefractionY", undefined); -__decorate2([ - editableInPropertyPage("Use thickness as depth", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) -], RefractionBlock.prototype, "useThicknessAsDepth", undefined); -RegisterClass("BABYLON.RefractionBlock", RefractionBlock); +var init_refractionBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockConnectionPoint(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_inputBlock(); + init_nodeMaterialConnectionPointCustomObject(); + init_nodeDecorator(); + init_nodeMaterialBlock(); + init_cubeTexture(); + init_texture(); + init_nodeMaterialSystemValues(); + init_math_scalar(); + __decorate2([ + editableInPropertyPage("Link refraction to transparency", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) + ], RefractionBlock.prototype, "linkRefractionWithTransparency", undefined); + __decorate2([ + editableInPropertyPage("Invert refraction Y", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) + ], RefractionBlock.prototype, "invertRefractionY", undefined); + __decorate2([ + editableInPropertyPage("Use thickness as depth", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) + ], RefractionBlock.prototype, "useThicknessAsDepth", undefined); + RegisterClass("BABYLON.RefractionBlock", RefractionBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/subSurfaceBlock.js class SubSurfaceBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Fragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Fragment); this._isUnique = true; this.registerInput("thickness", NodeMaterialBlockConnectionPointTypes.Float, false, NodeMaterialBlockTargets.Fragment); this.registerInput("tintColor", NodeMaterialBlockConnectionPointTypes.Color3, true, NodeMaterialBlockTargets.Fragment); @@ -133238,25 +144389,19 @@ class SubSurfaceBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.SubSurfaceBlock", SubSurfaceBlock); +var init_subSurfaceBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockConnectionPoint(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_inputBlock(); + init_nodeMaterialConnectionPointCustomObject(); + init_refractionBlock(); + RegisterClass("BABYLON.SubSurfaceBlock", SubSurfaceBlock); +}); // node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js -var mapOutputToVariable = { - ambientClr: ["finalAmbient", ""], - diffuseDir: ["finalDiffuse", ""], - specularDir: ["finalSpecularScaled", "!defined(UNLIT) && defined(SPECULARTERM)"], - clearcoatDir: ["finalClearCoatScaled", "!defined(UNLIT) && defined(CLEARCOAT)"], - sheenDir: ["finalSheenScaled", "!defined(UNLIT) && defined(SHEEN)"], - diffuseInd: ["finalIrradiance", "!defined(UNLIT) && defined(REFLECTION)"], - specularInd: ["finalRadianceScaled", "!defined(UNLIT) && defined(REFLECTION)"], - clearcoatInd: ["clearcoatOut.finalClearCoatRadianceScaled", "!defined(UNLIT) && defined(REFLECTION) && defined(CLEARCOAT)"], - sheenInd: ["sheenOut.finalSheenRadianceScaled", "!defined(UNLIT) && defined(REFLECTION) && defined(SHEEN) && defined(ENVIRONMENTBRDF)"], - refraction: ["subSurfaceOut.finalRefraction", "!defined(UNLIT) && defined(SS_REFRACTION)"], - lighting: ["finalColor.rgb", ""], - shadow: ["aggShadow", ""], - alpha: ["alpha", ""] -}; - class PBRMetallicRoughnessBlock extends NodeMaterialBlock { static _OnGenerateOnlyFragmentCodeChanged(block, _propertyName) { const that = block; @@ -133272,8 +144417,8 @@ class PBRMetallicRoughnessBlock extends NodeMaterialBlock { this._setInitialTarget(this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.VertexAndFragment); this.getInputByName("worldPosition").target = this.generateOnlyFragmentCode ? NodeMaterialBlockTargets.Fragment : NodeMaterialBlockTargets.Vertex; } - constructor(name177) { - super(name177, NodeMaterialBlockTargets.VertexAndFragment); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.VertexAndFragment); this._environmentBRDFTexture = null; this._metallicReflectanceColor = Color3.White(); this._metallicF0Factor = 1; @@ -134081,134 +145226,192 @@ class PBRMetallicRoughnessBlock extends NodeMaterialBlock { this._setTarget(); } } -__decorate2([ - editableInPropertyPage("Direct lights", PropertyTypeForEdition.Float, "INTENSITY", { min: 0, max: 1, notifiers: { update: true } }) -], PBRMetallicRoughnessBlock.prototype, "directIntensity", undefined); -__decorate2([ - editableInPropertyPage("Environment lights", PropertyTypeForEdition.Float, "INTENSITY", { min: 0, max: 1, notifiers: { update: true } }) -], PBRMetallicRoughnessBlock.prototype, "environmentIntensity", undefined); -__decorate2([ - editableInPropertyPage("Specular highlights", PropertyTypeForEdition.Float, "INTENSITY", { min: 0, max: 1, notifiers: { update: true } }) -], PBRMetallicRoughnessBlock.prototype, "specularIntensity", undefined); -__decorate2([ - editableInPropertyPage("Light falloff", PropertyTypeForEdition.List, "LIGHTING & COLORS", { - notifiers: { update: true }, - options: [ - { label: "Physical", value: PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL }, - { label: "GLTF", value: PBRBaseMaterial.LIGHTFALLOFF_GLTF }, - { label: "Standard", value: PBRBaseMaterial.LIGHTFALLOFF_STANDARD } - ] - }) -], PBRMetallicRoughnessBlock.prototype, "lightFalloff", undefined); -__decorate2([ - editableInPropertyPage("Alpha Testing", PropertyTypeForEdition.Boolean, "OPACITY") -], PBRMetallicRoughnessBlock.prototype, "useAlphaTest", undefined); -__decorate2([ - editableInPropertyPage("Alpha CutOff", PropertyTypeForEdition.Float, "OPACITY", { min: 0, max: 1, notifiers: { update: true } }) -], PBRMetallicRoughnessBlock.prototype, "alphaTestCutoff", undefined); -__decorate2([ - editableInPropertyPage("Alpha blending", PropertyTypeForEdition.Boolean, "OPACITY") -], PBRMetallicRoughnessBlock.prototype, "useAlphaBlending", undefined); -__decorate2([ - editableInPropertyPage("Radiance over alpha", PropertyTypeForEdition.Boolean, "RENDERING", { notifiers: { update: true } }) -], PBRMetallicRoughnessBlock.prototype, "useRadianceOverAlpha", undefined); -__decorate2([ - editableInPropertyPage("Specular over alpha", PropertyTypeForEdition.Boolean, "RENDERING", { notifiers: { update: true } }) -], PBRMetallicRoughnessBlock.prototype, "useSpecularOverAlpha", undefined); -__decorate2([ - editableInPropertyPage("Specular anti-aliasing", PropertyTypeForEdition.Boolean, "RENDERING", { notifiers: { update: true } }) -], PBRMetallicRoughnessBlock.prototype, "enableSpecularAntiAliasing", undefined); -__decorate2([ - editableInPropertyPage("Realtime filtering", PropertyTypeForEdition.Boolean, "RENDERING", { notifiers: { update: true } }) -], PBRMetallicRoughnessBlock.prototype, "realTimeFiltering", undefined); -__decorate2([ - editableInPropertyPage("Realtime filtering quality", PropertyTypeForEdition.List, "RENDERING", { - notifiers: { update: true }, - options: [ - { label: "Low", value: 8 }, - { label: "Medium", value: 16 }, - { label: "High", value: 64 } - ] - }) -], PBRMetallicRoughnessBlock.prototype, "realTimeFilteringQuality", undefined); -__decorate2([ - editableInPropertyPage("Energy Conservation", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) -], PBRMetallicRoughnessBlock.prototype, "useEnergyConservation", undefined); -__decorate2([ - editableInPropertyPage("Radiance occlusion", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) -], PBRMetallicRoughnessBlock.prototype, "useRadianceOcclusion", undefined); -__decorate2([ - editableInPropertyPage("Horizon occlusion", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) -], PBRMetallicRoughnessBlock.prototype, "useHorizonOcclusion", undefined); -__decorate2([ - editableInPropertyPage("Unlit", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) -], PBRMetallicRoughnessBlock.prototype, "unlit", undefined); -__decorate2([ - editableInPropertyPage("Force normal forward", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) -], PBRMetallicRoughnessBlock.prototype, "forceNormalForward", undefined); -__decorate2([ - editableInPropertyPage("Generate only fragment code", PropertyTypeForEdition.Boolean, "ADVANCED", { - notifiers: { rebuild: true, update: true, onValidation: PBRMetallicRoughnessBlock._OnGenerateOnlyFragmentCodeChanged } - }) -], PBRMetallicRoughnessBlock.prototype, "generateOnlyFragmentCode", undefined); -__decorate2([ - editableInPropertyPage("Debug mode", PropertyTypeForEdition.List, "DEBUG", { - notifiers: { update: true }, - options: [ - { label: "None", value: 0 }, - { label: "Normalized position", value: 1 }, - { label: "Normals", value: 2 }, - { label: "Tangents", value: 3 }, - { label: "Bitangents", value: 4 }, - { label: "Bump Normals", value: 5 }, - { label: "ClearCoat Normals", value: 8 }, - { label: "ClearCoat Tangents", value: 9 }, - { label: "ClearCoat Bitangents", value: 10 }, - { label: "Anisotropic Normals", value: 11 }, - { label: "Anisotropic Tangents", value: 12 }, - { label: "Anisotropic Bitangents", value: 13 }, - { label: "Env Refraction", value: 40 }, - { label: "Env Reflection", value: 41 }, - { label: "Env Clear Coat", value: 42 }, - { label: "Direct Diffuse", value: 50 }, - { label: "Direct Specular", value: 51 }, - { label: "Direct Clear Coat", value: 52 }, - { label: "Direct Sheen", value: 53 }, - { label: "Env Irradiance", value: 54 }, - { label: "Surface Albedo", value: 60 }, - { label: "Reflectance 0", value: 61 }, - { label: "Metallic", value: 62 }, - { label: "Metallic F0", value: 71 }, - { label: "Roughness", value: 63 }, - { label: "AlphaG", value: 64 }, - { label: "NdotV", value: 65 }, - { label: "ClearCoat Color", value: 66 }, - { label: "ClearCoat Roughness", value: 67 }, - { label: "ClearCoat NdotV", value: 68 }, - { label: "Transmittance", value: 69 }, - { label: "Refraction Transmittance", value: 70 }, - { label: "SEO", value: 80 }, - { label: "EHO", value: 81 }, - { label: "Energy Factor", value: 82 }, - { label: "Specular Reflectance", value: 83 }, - { label: "Clear Coat Reflectance", value: 84 }, - { label: "Sheen Reflectance", value: 85 }, - { label: "Luminance Over Alpha", value: 86 }, - { label: "Alpha", value: 87 } - ] - }) -], PBRMetallicRoughnessBlock.prototype, "debugMode", undefined); -__decorate2([ - editableInPropertyPage("Split position", PropertyTypeForEdition.Float, "DEBUG", { min: -1, max: 1, notifiers: { update: true } }) -], PBRMetallicRoughnessBlock.prototype, "debugLimit", undefined); -__decorate2([ - editableInPropertyPage("Output factor", PropertyTypeForEdition.Float, "DEBUG", { min: 0, max: 5, notifiers: { update: true } }) -], PBRMetallicRoughnessBlock.prototype, "debugFactor", undefined); -RegisterClass("BABYLON.PBRMetallicRoughnessBlock", PBRMetallicRoughnessBlock); +var mapOutputToVariable; +var init_pbrMetallicRoughnessBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockConnectionPoint(); + init_materialHelper(); + init_nodeMaterialBlockTargets(); + init_nodeMaterialSystemValues(); + init_inputBlock(); + init_typeStore(); + init_pbrBaseMaterial(); + init_nodeDecorator(); + init_nodeMaterialConnectionPointCustomObject(); + init_sheenBlock(); + init_brdfTextureTools(); + init_materialFlags(); + init_anisotropyBlock(); + init_reflectionBlock(); + init_clearCoatBlock(); + init_iridescenceBlock(); + init_subSurfaceBlock(); + init_math_color(); + mapOutputToVariable = { + ambientClr: ["finalAmbient", ""], + diffuseDir: ["finalDiffuse", ""], + specularDir: ["finalSpecularScaled", "!defined(UNLIT) && defined(SPECULARTERM)"], + clearcoatDir: ["finalClearCoatScaled", "!defined(UNLIT) && defined(CLEARCOAT)"], + sheenDir: ["finalSheenScaled", "!defined(UNLIT) && defined(SHEEN)"], + diffuseInd: ["finalIrradiance", "!defined(UNLIT) && defined(REFLECTION)"], + specularInd: ["finalRadianceScaled", "!defined(UNLIT) && defined(REFLECTION)"], + clearcoatInd: ["clearcoatOut.finalClearCoatRadianceScaled", "!defined(UNLIT) && defined(REFLECTION) && defined(CLEARCOAT)"], + sheenInd: ["sheenOut.finalSheenRadianceScaled", "!defined(UNLIT) && defined(REFLECTION) && defined(SHEEN) && defined(ENVIRONMENTBRDF)"], + refraction: ["subSurfaceOut.finalRefraction", "!defined(UNLIT) && defined(SS_REFRACTION)"], + lighting: ["finalColor.rgb", ""], + shadow: ["aggShadow", ""], + alpha: ["alpha", ""] + }; + __decorate2([ + editableInPropertyPage("Direct lights", PropertyTypeForEdition.Float, "INTENSITY", { min: 0, max: 1, notifiers: { update: true } }) + ], PBRMetallicRoughnessBlock.prototype, "directIntensity", undefined); + __decorate2([ + editableInPropertyPage("Environment lights", PropertyTypeForEdition.Float, "INTENSITY", { min: 0, max: 1, notifiers: { update: true } }) + ], PBRMetallicRoughnessBlock.prototype, "environmentIntensity", undefined); + __decorate2([ + editableInPropertyPage("Specular highlights", PropertyTypeForEdition.Float, "INTENSITY", { min: 0, max: 1, notifiers: { update: true } }) + ], PBRMetallicRoughnessBlock.prototype, "specularIntensity", undefined); + __decorate2([ + editableInPropertyPage("Light falloff", PropertyTypeForEdition.List, "LIGHTING & COLORS", { + notifiers: { update: true }, + options: [ + { label: "Physical", value: PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL }, + { label: "GLTF", value: PBRBaseMaterial.LIGHTFALLOFF_GLTF }, + { label: "Standard", value: PBRBaseMaterial.LIGHTFALLOFF_STANDARD } + ] + }) + ], PBRMetallicRoughnessBlock.prototype, "lightFalloff", undefined); + __decorate2([ + editableInPropertyPage("Alpha Testing", PropertyTypeForEdition.Boolean, "OPACITY") + ], PBRMetallicRoughnessBlock.prototype, "useAlphaTest", undefined); + __decorate2([ + editableInPropertyPage("Alpha CutOff", PropertyTypeForEdition.Float, "OPACITY", { min: 0, max: 1, notifiers: { update: true } }) + ], PBRMetallicRoughnessBlock.prototype, "alphaTestCutoff", undefined); + __decorate2([ + editableInPropertyPage("Alpha blending", PropertyTypeForEdition.Boolean, "OPACITY") + ], PBRMetallicRoughnessBlock.prototype, "useAlphaBlending", undefined); + __decorate2([ + editableInPropertyPage("Radiance over alpha", PropertyTypeForEdition.Boolean, "RENDERING", { notifiers: { update: true } }) + ], PBRMetallicRoughnessBlock.prototype, "useRadianceOverAlpha", undefined); + __decorate2([ + editableInPropertyPage("Specular over alpha", PropertyTypeForEdition.Boolean, "RENDERING", { notifiers: { update: true } }) + ], PBRMetallicRoughnessBlock.prototype, "useSpecularOverAlpha", undefined); + __decorate2([ + editableInPropertyPage("Specular anti-aliasing", PropertyTypeForEdition.Boolean, "RENDERING", { notifiers: { update: true } }) + ], PBRMetallicRoughnessBlock.prototype, "enableSpecularAntiAliasing", undefined); + __decorate2([ + editableInPropertyPage("Realtime filtering", PropertyTypeForEdition.Boolean, "RENDERING", { notifiers: { update: true } }) + ], PBRMetallicRoughnessBlock.prototype, "realTimeFiltering", undefined); + __decorate2([ + editableInPropertyPage("Realtime filtering quality", PropertyTypeForEdition.List, "RENDERING", { + notifiers: { update: true }, + options: [ + { label: "Low", value: 8 }, + { label: "Medium", value: 16 }, + { label: "High", value: 64 } + ] + }) + ], PBRMetallicRoughnessBlock.prototype, "realTimeFilteringQuality", undefined); + __decorate2([ + editableInPropertyPage("Energy Conservation", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) + ], PBRMetallicRoughnessBlock.prototype, "useEnergyConservation", undefined); + __decorate2([ + editableInPropertyPage("Radiance occlusion", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) + ], PBRMetallicRoughnessBlock.prototype, "useRadianceOcclusion", undefined); + __decorate2([ + editableInPropertyPage("Horizon occlusion", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) + ], PBRMetallicRoughnessBlock.prototype, "useHorizonOcclusion", undefined); + __decorate2([ + editableInPropertyPage("Unlit", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) + ], PBRMetallicRoughnessBlock.prototype, "unlit", undefined); + __decorate2([ + editableInPropertyPage("Force normal forward", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) + ], PBRMetallicRoughnessBlock.prototype, "forceNormalForward", undefined); + __decorate2([ + editableInPropertyPage("Generate only fragment code", PropertyTypeForEdition.Boolean, "ADVANCED", { + notifiers: { rebuild: true, update: true, onValidation: PBRMetallicRoughnessBlock._OnGenerateOnlyFragmentCodeChanged } + }) + ], PBRMetallicRoughnessBlock.prototype, "generateOnlyFragmentCode", undefined); + __decorate2([ + editableInPropertyPage("Debug mode", PropertyTypeForEdition.List, "DEBUG", { + notifiers: { update: true }, + options: [ + { label: "None", value: 0 }, + { label: "Normalized position", value: 1 }, + { label: "Normals", value: 2 }, + { label: "Tangents", value: 3 }, + { label: "Bitangents", value: 4 }, + { label: "Bump Normals", value: 5 }, + { label: "ClearCoat Normals", value: 8 }, + { label: "ClearCoat Tangents", value: 9 }, + { label: "ClearCoat Bitangents", value: 10 }, + { label: "Anisotropic Normals", value: 11 }, + { label: "Anisotropic Tangents", value: 12 }, + { label: "Anisotropic Bitangents", value: 13 }, + { label: "Env Refraction", value: 40 }, + { label: "Env Reflection", value: 41 }, + { label: "Env Clear Coat", value: 42 }, + { label: "Direct Diffuse", value: 50 }, + { label: "Direct Specular", value: 51 }, + { label: "Direct Clear Coat", value: 52 }, + { label: "Direct Sheen", value: 53 }, + { label: "Env Irradiance", value: 54 }, + { label: "Surface Albedo", value: 60 }, + { label: "Reflectance 0", value: 61 }, + { label: "Metallic", value: 62 }, + { label: "Metallic F0", value: 71 }, + { label: "Roughness", value: 63 }, + { label: "AlphaG", value: 64 }, + { label: "NdotV", value: 65 }, + { label: "ClearCoat Color", value: 66 }, + { label: "ClearCoat Roughness", value: 67 }, + { label: "ClearCoat NdotV", value: 68 }, + { label: "Transmittance", value: 69 }, + { label: "Refraction Transmittance", value: 70 }, + { label: "SEO", value: 80 }, + { label: "EHO", value: 81 }, + { label: "Energy Factor", value: 82 }, + { label: "Specular Reflectance", value: 83 }, + { label: "Clear Coat Reflectance", value: 84 }, + { label: "Sheen Reflectance", value: 85 }, + { label: "Luminance Over Alpha", value: 86 }, + { label: "Alpha", value: 87 } + ] + }) + ], PBRMetallicRoughnessBlock.prototype, "debugMode", undefined); + __decorate2([ + editableInPropertyPage("Split position", PropertyTypeForEdition.Float, "DEBUG", { min: -1, max: 1, notifiers: { update: true } }) + ], PBRMetallicRoughnessBlock.prototype, "debugLimit", undefined); + __decorate2([ + editableInPropertyPage("Output factor", PropertyTypeForEdition.Float, "DEBUG", { min: 0, max: 5, notifiers: { update: true } }) + ], PBRMetallicRoughnessBlock.prototype, "debugFactor", undefined); + RegisterClass("BABYLON.PBRMetallicRoughnessBlock", PBRMetallicRoughnessBlock); +}); + +// node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/index.js +var init_PBR2 = __esm(() => { + init_pbrMetallicRoughnessBlock(); + init_sheenBlock(); + init_anisotropyBlock(); + init_reflectionBlock(); + init_clearCoatBlock(); + init_refractionBlock(); + init_subSurfaceBlock(); +}); + +// node_modules/@babylonjs/core/Materials/Node/Blocks/Particle/index.js +var init_Particle = __esm(() => { + init_particleTextureBlock(); + init_particleRampGradientBlock(); + init_particleBlendMultiplyBlock(); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/modBlock.js class ModBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); @@ -134235,11 +145438,18 @@ class ModBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.ModBlock", ModBlock); +var init_modBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.ModBlock", ModBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/matrixBuilderBlock.js class MatrixBuilderBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("row0", NodeMaterialBlockConnectionPointTypes.Vector4); this.registerInput("row1", NodeMaterialBlockConnectionPointTypes.Vector4); this.registerInput("row2", NodeMaterialBlockConnectionPointTypes.Vector4); @@ -134297,24 +145507,20 @@ class MatrixBuilderBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.MatrixBuilder", MatrixBuilderBlock); -// node_modules/@babylonjs/core/Materials/Node/Blocks/conditionalBlock.js -var ConditionalBlockConditions; -(function(ConditionalBlockConditions2) { - ConditionalBlockConditions2[ConditionalBlockConditions2["Equal"] = 0] = "Equal"; - ConditionalBlockConditions2[ConditionalBlockConditions2["NotEqual"] = 1] = "NotEqual"; - ConditionalBlockConditions2[ConditionalBlockConditions2["LessThan"] = 2] = "LessThan"; - ConditionalBlockConditions2[ConditionalBlockConditions2["GreaterThan"] = 3] = "GreaterThan"; - ConditionalBlockConditions2[ConditionalBlockConditions2["LessOrEqual"] = 4] = "LessOrEqual"; - ConditionalBlockConditions2[ConditionalBlockConditions2["GreaterOrEqual"] = 5] = "GreaterOrEqual"; - ConditionalBlockConditions2[ConditionalBlockConditions2["Xor"] = 6] = "Xor"; - ConditionalBlockConditions2[ConditionalBlockConditions2["Or"] = 7] = "Or"; - ConditionalBlockConditions2[ConditionalBlockConditions2["And"] = 8] = "And"; -})(ConditionalBlockConditions || (ConditionalBlockConditions = {})); +var init_matrixBuilderBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_inputBlock(); + init_math_vector(); + RegisterClass("BABYLON.MatrixBuilder", MatrixBuilderBlock); +}); +// node_modules/@babylonjs/core/Materials/Node/Blocks/conditionalBlock.js class ConditionalBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.condition = ConditionalBlockConditions.LessThan; this.registerInput("a", NodeMaterialBlockConnectionPointTypes.Float); this.registerInput("b", NodeMaterialBlockConnectionPointTypes.Float); @@ -134402,11 +145608,30 @@ class ConditionalBlock extends NodeMaterialBlock { return codeString; } } -RegisterClass("BABYLON.ConditionalBlock", ConditionalBlock); +var ConditionalBlockConditions; +var init_conditionalBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + (function(ConditionalBlockConditions2) { + ConditionalBlockConditions2[ConditionalBlockConditions2["Equal"] = 0] = "Equal"; + ConditionalBlockConditions2[ConditionalBlockConditions2["NotEqual"] = 1] = "NotEqual"; + ConditionalBlockConditions2[ConditionalBlockConditions2["LessThan"] = 2] = "LessThan"; + ConditionalBlockConditions2[ConditionalBlockConditions2["GreaterThan"] = 3] = "GreaterThan"; + ConditionalBlockConditions2[ConditionalBlockConditions2["LessOrEqual"] = 4] = "LessOrEqual"; + ConditionalBlockConditions2[ConditionalBlockConditions2["GreaterOrEqual"] = 5] = "GreaterOrEqual"; + ConditionalBlockConditions2[ConditionalBlockConditions2["Xor"] = 6] = "Xor"; + ConditionalBlockConditions2[ConditionalBlockConditions2["Or"] = 7] = "Or"; + ConditionalBlockConditions2[ConditionalBlockConditions2["And"] = 8] = "And"; + })(ConditionalBlockConditions || (ConditionalBlockConditions = {})); + RegisterClass("BABYLON.ConditionalBlock", ConditionalBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/cloudBlock.js class CloudBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.octaves = 6; this.registerInput("seed", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("chaos", NodeMaterialBlockConnectionPointTypes.AutoDetect, true); @@ -134549,14 +145774,23 @@ class CloudBlock extends NodeMaterialBlock { this.octaves = serializationObject.octaves; } } -__decorate2([ - editableInPropertyPage("Octaves", PropertyTypeForEdition.Int) -], CloudBlock.prototype, "octaves", undefined); -RegisterClass("BABYLON.CloudBlock", CloudBlock); +var init_cloudBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Octaves", PropertyTypeForEdition.Int) + ], CloudBlock.prototype, "octaves", undefined); + RegisterClass("BABYLON.CloudBlock", CloudBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/voronoiNoiseBlock.js class VoronoiNoiseBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("seed", NodeMaterialBlockConnectionPointTypes.Vector2); this.registerInput("offset", NodeMaterialBlockConnectionPointTypes.Float); this.registerInput("density", NodeMaterialBlockConnectionPointTypes.Float); @@ -134631,11 +145865,18 @@ class VoronoiNoiseBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.VoronoiNoiseBlock", VoronoiNoiseBlock); +var init_voronoiNoiseBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.VoronoiNoiseBlock", VoronoiNoiseBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/elbowBlock.js class ElbowBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); this._outputs[0]._typeConnectionSource = this._inputs[0]; @@ -134676,7 +145917,14 @@ class ElbowBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.ElbowBlock", ElbowBlock); +var init_elbowBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.ElbowBlock", ElbowBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/triPlanarBlock.js class TriPlanarBlock extends NodeMaterialBlock { get texture() { @@ -134771,8 +146019,8 @@ class TriPlanarBlock extends NodeMaterialBlock { get convertToLinearSpace() { return this._convertToLinearSpace; } - constructor(name177, hideSourceZ = false) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178, hideSourceZ = false) { + super(name178, NodeMaterialBlockTargets.Neutral); this.projectAsCube = false; this._convertToGammaSpace = false; this._convertToLinearSpace = false; @@ -135007,14 +146255,30 @@ class TriPlanarBlock extends NodeMaterialBlock { } } } -__decorate2([ - editableInPropertyPage("Project as cube", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) -], TriPlanarBlock.prototype, "projectAsCube", undefined); -RegisterClass("BABYLON.TriPlanarBlock", TriPlanarBlock); +var init_triPlanarBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_nodeMaterialBlockConnectionPoint(); + init_nodeMaterial(); + init_typeStore(); + init_texture(); + init_helperFunctions(); + init_imageSourceBlock(); + init_nodeMaterialConnectionPointCustomObject(); + init_engineStore(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Project as cube", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) + ], TriPlanarBlock.prototype, "projectAsCube", undefined); + RegisterClass("BABYLON.TriPlanarBlock", TriPlanarBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/biPlanarBlock.js class BiPlanarBlock extends TriPlanarBlock { - constructor(name177) { - super(name177, true); + constructor(name178) { + super(name178, true); } getClassName() { return "BiPlanarBlock"; @@ -135069,11 +146333,16 @@ class BiPlanarBlock extends TriPlanarBlock { `; } } -RegisterClass("BABYLON.BiPlanarBlock", BiPlanarBlock); +var init_biPlanarBlock = __esm(() => { + init_typeStore(); + init_triPlanarBlock(); + RegisterClass("BABYLON.BiPlanarBlock", BiPlanarBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/matrixDeterminantBlock.js class MatrixDeterminantBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("input", NodeMaterialBlockConnectionPointTypes.Matrix); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float); } @@ -135094,11 +146363,18 @@ class MatrixDeterminantBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.MatrixDeterminantBlock", MatrixDeterminantBlock); +var init_matrixDeterminantBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.MatrixDeterminantBlock", MatrixDeterminantBlock); +}); + // node_modules/@babylonjs/core/Materials/Node/Blocks/matrixTransposeBlock.js class MatrixTransposeBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.registerInput("input", NodeMaterialBlockConnectionPointTypes.Matrix); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Matrix); } @@ -135119,25 +146395,18 @@ class MatrixTransposeBlock extends NodeMaterialBlock { return this; } } -RegisterClass("BABYLON.MatrixTransposeBlock", MatrixTransposeBlock); -// node_modules/@babylonjs/core/Materials/Node/Blocks/meshAttributeExistsBlock.js -var MeshAttributeExistsBlockTypes; -(function(MeshAttributeExistsBlockTypes2) { - MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["None"] = 0] = "None"; - MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["Normal"] = 1] = "Normal"; - MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["Tangent"] = 2] = "Tangent"; - MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["VertexColor"] = 3] = "VertexColor"; - MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["UV1"] = 4] = "UV1"; - MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["UV2"] = 5] = "UV2"; - MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["UV3"] = 6] = "UV3"; - MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["UV4"] = 7] = "UV4"; - MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["UV5"] = 8] = "UV5"; - MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["UV6"] = 9] = "UV6"; -})(MeshAttributeExistsBlockTypes || (MeshAttributeExistsBlockTypes = {})); +var init_matrixTransposeBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + RegisterClass("BABYLON.MatrixTransposeBlock", MatrixTransposeBlock); +}); +// node_modules/@babylonjs/core/Materials/Node/Blocks/meshAttributeExistsBlock.js class MeshAttributeExistsBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.attributeType = MeshAttributeExistsBlockTypes.None; this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerInput("fallback", NodeMaterialBlockConnectionPointTypes.AutoDetect); @@ -135267,59 +146536,52 @@ class MeshAttributeExistsBlock extends NodeMaterialBlock { return codeString; } } -__decorate2([ - editableInPropertyPage("Attribute lookup", PropertyTypeForEdition.List, undefined, { - notifiers: { update: true }, - options: [ - { label: "(None)", value: MeshAttributeExistsBlockTypes.None }, - { label: "Normal", value: MeshAttributeExistsBlockTypes.Normal }, - { label: "Tangent", value: MeshAttributeExistsBlockTypes.Tangent }, - { label: "Vertex Color", value: MeshAttributeExistsBlockTypes.VertexColor }, - { label: "UV1", value: MeshAttributeExistsBlockTypes.UV1 }, - { label: "UV2", value: MeshAttributeExistsBlockTypes.UV2 }, - { label: "UV3", value: MeshAttributeExistsBlockTypes.UV3 }, - { label: "UV4", value: MeshAttributeExistsBlockTypes.UV4 }, - { label: "UV5", value: MeshAttributeExistsBlockTypes.UV5 }, - { label: "UV6", value: MeshAttributeExistsBlockTypes.UV6 } - ] - }) -], MeshAttributeExistsBlock.prototype, "attributeType", undefined); -RegisterClass("BABYLON.MeshAttributeExistsBlock", MeshAttributeExistsBlock); -// node_modules/@babylonjs/core/Materials/Node/Blocks/curveBlock.js -var CurveBlockTypes; -(function(CurveBlockTypes2) { - CurveBlockTypes2[CurveBlockTypes2["EaseInSine"] = 0] = "EaseInSine"; - CurveBlockTypes2[CurveBlockTypes2["EaseOutSine"] = 1] = "EaseOutSine"; - CurveBlockTypes2[CurveBlockTypes2["EaseInOutSine"] = 2] = "EaseInOutSine"; - CurveBlockTypes2[CurveBlockTypes2["EaseInQuad"] = 3] = "EaseInQuad"; - CurveBlockTypes2[CurveBlockTypes2["EaseOutQuad"] = 4] = "EaseOutQuad"; - CurveBlockTypes2[CurveBlockTypes2["EaseInOutQuad"] = 5] = "EaseInOutQuad"; - CurveBlockTypes2[CurveBlockTypes2["EaseInCubic"] = 6] = "EaseInCubic"; - CurveBlockTypes2[CurveBlockTypes2["EaseOutCubic"] = 7] = "EaseOutCubic"; - CurveBlockTypes2[CurveBlockTypes2["EaseInOutCubic"] = 8] = "EaseInOutCubic"; - CurveBlockTypes2[CurveBlockTypes2["EaseInQuart"] = 9] = "EaseInQuart"; - CurveBlockTypes2[CurveBlockTypes2["EaseOutQuart"] = 10] = "EaseOutQuart"; - CurveBlockTypes2[CurveBlockTypes2["EaseInOutQuart"] = 11] = "EaseInOutQuart"; - CurveBlockTypes2[CurveBlockTypes2["EaseInQuint"] = 12] = "EaseInQuint"; - CurveBlockTypes2[CurveBlockTypes2["EaseOutQuint"] = 13] = "EaseOutQuint"; - CurveBlockTypes2[CurveBlockTypes2["EaseInOutQuint"] = 14] = "EaseInOutQuint"; - CurveBlockTypes2[CurveBlockTypes2["EaseInExpo"] = 15] = "EaseInExpo"; - CurveBlockTypes2[CurveBlockTypes2["EaseOutExpo"] = 16] = "EaseOutExpo"; - CurveBlockTypes2[CurveBlockTypes2["EaseInOutExpo"] = 17] = "EaseInOutExpo"; - CurveBlockTypes2[CurveBlockTypes2["EaseInCirc"] = 18] = "EaseInCirc"; - CurveBlockTypes2[CurveBlockTypes2["EaseOutCirc"] = 19] = "EaseOutCirc"; - CurveBlockTypes2[CurveBlockTypes2["EaseInOutCirc"] = 20] = "EaseInOutCirc"; - CurveBlockTypes2[CurveBlockTypes2["EaseInBack"] = 21] = "EaseInBack"; - CurveBlockTypes2[CurveBlockTypes2["EaseOutBack"] = 22] = "EaseOutBack"; - CurveBlockTypes2[CurveBlockTypes2["EaseInOutBack"] = 23] = "EaseInOutBack"; - CurveBlockTypes2[CurveBlockTypes2["EaseInElastic"] = 24] = "EaseInElastic"; - CurveBlockTypes2[CurveBlockTypes2["EaseOutElastic"] = 25] = "EaseOutElastic"; - CurveBlockTypes2[CurveBlockTypes2["EaseInOutElastic"] = 26] = "EaseInOutElastic"; -})(CurveBlockTypes || (CurveBlockTypes = {})); +var MeshAttributeExistsBlockTypes; +var init_meshAttributeExistsBlock = __esm(() => { + init_tslib_es62(); + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + init_inputBlock(); + init_morphTargetsBlock(); + init_nodeDecorator(); + (function(MeshAttributeExistsBlockTypes2) { + MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["None"] = 0] = "None"; + MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["Normal"] = 1] = "Normal"; + MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["Tangent"] = 2] = "Tangent"; + MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["VertexColor"] = 3] = "VertexColor"; + MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["UV1"] = 4] = "UV1"; + MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["UV2"] = 5] = "UV2"; + MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["UV3"] = 6] = "UV3"; + MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["UV4"] = 7] = "UV4"; + MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["UV5"] = 8] = "UV5"; + MeshAttributeExistsBlockTypes2[MeshAttributeExistsBlockTypes2["UV6"] = 9] = "UV6"; + })(MeshAttributeExistsBlockTypes || (MeshAttributeExistsBlockTypes = {})); + __decorate2([ + editableInPropertyPage("Attribute lookup", PropertyTypeForEdition.List, undefined, { + notifiers: { update: true }, + options: [ + { label: "(None)", value: MeshAttributeExistsBlockTypes.None }, + { label: "Normal", value: MeshAttributeExistsBlockTypes.Normal }, + { label: "Tangent", value: MeshAttributeExistsBlockTypes.Tangent }, + { label: "Vertex Color", value: MeshAttributeExistsBlockTypes.VertexColor }, + { label: "UV1", value: MeshAttributeExistsBlockTypes.UV1 }, + { label: "UV2", value: MeshAttributeExistsBlockTypes.UV2 }, + { label: "UV3", value: MeshAttributeExistsBlockTypes.UV3 }, + { label: "UV4", value: MeshAttributeExistsBlockTypes.UV4 }, + { label: "UV5", value: MeshAttributeExistsBlockTypes.UV5 }, + { label: "UV6", value: MeshAttributeExistsBlockTypes.UV6 } + ] + }) + ], MeshAttributeExistsBlock.prototype, "attributeType", undefined); + RegisterClass("BABYLON.MeshAttributeExistsBlock", MeshAttributeExistsBlock); +}); +// node_modules/@babylonjs/core/Materials/Node/Blocks/curveBlock.js class CurveBlock extends NodeMaterialBlock { - constructor(name177) { - super(name177, NodeMaterialBlockTargets.Neutral); + constructor(name178) { + super(name178, NodeMaterialBlockTargets.Neutral); this.type = CurveBlockTypes.EaseInOutSine; this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput); @@ -135518,7 +146780,325 @@ class CurveBlock extends NodeMaterialBlock { return codeString; } } -RegisterClass("BABYLON.CurveBlock", CurveBlock); +var CurveBlockTypes; +var init_curveBlock = __esm(() => { + init_nodeMaterialBlock(); + init_nodeMaterialBlockConnectionPointTypes(); + init_nodeMaterialBlockTargets(); + init_typeStore(); + (function(CurveBlockTypes2) { + CurveBlockTypes2[CurveBlockTypes2["EaseInSine"] = 0] = "EaseInSine"; + CurveBlockTypes2[CurveBlockTypes2["EaseOutSine"] = 1] = "EaseOutSine"; + CurveBlockTypes2[CurveBlockTypes2["EaseInOutSine"] = 2] = "EaseInOutSine"; + CurveBlockTypes2[CurveBlockTypes2["EaseInQuad"] = 3] = "EaseInQuad"; + CurveBlockTypes2[CurveBlockTypes2["EaseOutQuad"] = 4] = "EaseOutQuad"; + CurveBlockTypes2[CurveBlockTypes2["EaseInOutQuad"] = 5] = "EaseInOutQuad"; + CurveBlockTypes2[CurveBlockTypes2["EaseInCubic"] = 6] = "EaseInCubic"; + CurveBlockTypes2[CurveBlockTypes2["EaseOutCubic"] = 7] = "EaseOutCubic"; + CurveBlockTypes2[CurveBlockTypes2["EaseInOutCubic"] = 8] = "EaseInOutCubic"; + CurveBlockTypes2[CurveBlockTypes2["EaseInQuart"] = 9] = "EaseInQuart"; + CurveBlockTypes2[CurveBlockTypes2["EaseOutQuart"] = 10] = "EaseOutQuart"; + CurveBlockTypes2[CurveBlockTypes2["EaseInOutQuart"] = 11] = "EaseInOutQuart"; + CurveBlockTypes2[CurveBlockTypes2["EaseInQuint"] = 12] = "EaseInQuint"; + CurveBlockTypes2[CurveBlockTypes2["EaseOutQuint"] = 13] = "EaseOutQuint"; + CurveBlockTypes2[CurveBlockTypes2["EaseInOutQuint"] = 14] = "EaseInOutQuint"; + CurveBlockTypes2[CurveBlockTypes2["EaseInExpo"] = 15] = "EaseInExpo"; + CurveBlockTypes2[CurveBlockTypes2["EaseOutExpo"] = 16] = "EaseOutExpo"; + CurveBlockTypes2[CurveBlockTypes2["EaseInOutExpo"] = 17] = "EaseInOutExpo"; + CurveBlockTypes2[CurveBlockTypes2["EaseInCirc"] = 18] = "EaseInCirc"; + CurveBlockTypes2[CurveBlockTypes2["EaseOutCirc"] = 19] = "EaseOutCirc"; + CurveBlockTypes2[CurveBlockTypes2["EaseInOutCirc"] = 20] = "EaseInOutCirc"; + CurveBlockTypes2[CurveBlockTypes2["EaseInBack"] = 21] = "EaseInBack"; + CurveBlockTypes2[CurveBlockTypes2["EaseOutBack"] = 22] = "EaseOutBack"; + CurveBlockTypes2[CurveBlockTypes2["EaseInOutBack"] = 23] = "EaseInOutBack"; + CurveBlockTypes2[CurveBlockTypes2["EaseInElastic"] = 24] = "EaseInElastic"; + CurveBlockTypes2[CurveBlockTypes2["EaseOutElastic"] = 25] = "EaseOutElastic"; + CurveBlockTypes2[CurveBlockTypes2["EaseInOutElastic"] = 26] = "EaseInOutElastic"; + })(CurveBlockTypes || (CurveBlockTypes = {})); + RegisterClass("BABYLON.CurveBlock", CurveBlock); +}); + +// node_modules/@babylonjs/core/Materials/Node/Blocks/index.js +var init_Blocks = __esm(() => { + init_Vertex(); + init_Fragment(); + init_Dual(); + init_Input(); + init_Teleport(); + init_multiplyBlock(); + init_addBlock(); + init_scaleBlock(); + init_clampBlock(); + init_crossBlock(); + init_customBlock(); + init_dotBlock(); + init_transformBlock(); + init_remapBlock(); + init_normalizeBlock(); + init_trigonometryBlock(); + init_colorMergerBlock(); + init_vectorMergerBlock(); + init_colorSplitterBlock(); + init_vectorSplitterBlock(); + init_lerpBlock(); + init_divideBlock(); + init_subtractBlock(); + init_stepBlock(); + init_oneMinusBlock(); + init_viewDirectionBlock(); + init_fresnelBlock(); + init_maxBlock(); + init_minBlock(); + init_distanceBlock(); + init_lengthBlock(); + init_negateBlock(); + init_powBlock(); + init_randomNumberBlock(); + init_arcTan2Block(); + init_smoothStepBlock(); + init_reciprocalBlock(); + init_replaceColorBlock(); + init_posterizeBlock(); + init_waveBlock(); + init_gradientBlock(); + init_nLerpBlock(); + init_worleyNoise3DBlock(); + init_simplexPerlin3DBlock(); + init_normalBlendBlock(); + init_rotate2dBlock(); + init_reflectBlock(); + init_refractBlock(); + init_desaturateBlock(); + init_PBR2(); + init_Particle(); + init_modBlock(); + init_matrixBuilderBlock(); + init_conditionalBlock(); + init_cloudBlock(); + init_voronoiNoiseBlock(); + init_elbowBlock(); + init_triPlanarBlock(); + init_biPlanarBlock(); + init_matrixDeterminantBlock(); + init_matrixTransposeBlock(); + init_meshAttributeExistsBlock(); + init_curveBlock(); +}); + +// node_modules/@babylonjs/core/Materials/Node/Optimizers/nodeMaterialOptimizer.js +class NodeMaterialOptimizer { + optimize(_vertexOutputNodes, _fragmentOutputNodes) { + } +} +var init_nodeMaterialOptimizer = __esm(() => { +}); + +// node_modules/@babylonjs/core/Materials/Node/Optimizers/index.js +var init_Optimizers = __esm(() => { + init_nodeMaterialOptimizer(); +}); + +// node_modules/@babylonjs/core/Materials/Node/index.js +var init_Node = __esm(() => { + init_Enums(); + init_nodeMaterialConnectionPointCustomObject(); + init_nodeMaterialBlockConnectionPoint(); + init_nodeMaterialBlock(); + init_nodeMaterial(); + init_Blocks(); + init_Optimizers(); + init_nodeDecorator(); +}); + +// node_modules/@babylonjs/core/Materials/shadowDepthWrapper.js +class MapMap { + constructor() { + this.mm = new Map; + } + get(a, b) { + const m = this.mm.get(a); + if (m !== undefined) { + return m.get(b); + } + return; + } + set(a, b, v) { + let m = this.mm.get(a); + if (m === undefined) { + this.mm.set(a, m = new Map); + } + m.set(b, v); + } +} + +class ShadowDepthWrapper { + get standalone() { + var _a, _b; + return (_b = (_a = this._options) === null || _a === undefined ? undefined : _a.standalone) !== null && _b !== undefined ? _b : false; + } + get baseMaterial() { + return this._baseMaterial; + } + get doNotInjectCode() { + var _a, _b; + return (_b = (_a = this._options) === null || _a === undefined ? undefined : _a.doNotInjectCode) !== null && _b !== undefined ? _b : false; + } + constructor(baseMaterial, scene22, options) { + this._baseMaterial = baseMaterial; + this._scene = scene22 !== null && scene22 !== undefined ? scene22 : EngineStore.LastCreatedScene; + this._options = options; + this._subMeshToEffect = new Map; + this._subMeshToDepthWrapper = new MapMap; + this._meshes = new Map; + this._onEffectCreatedObserver = this._baseMaterial.onEffectCreatedObservable.add((params) => { + var _a, _b; + const mesh48 = (_a = params.subMesh) === null || _a === undefined ? undefined : _a.getMesh(); + if (mesh48 && !this._meshes.has(mesh48)) { + this._meshes.set(mesh48, mesh48.onDisposeObservable.add((mesh49) => { + const iterator = this._subMeshToEffect.keys(); + for (let key = iterator.next();key.done !== true; key = iterator.next()) { + const subMesh6 = key.value; + if ((subMesh6 === null || subMesh6 === undefined ? undefined : subMesh6.getMesh()) === mesh49) { + this._subMeshToEffect.delete(subMesh6); + this._deleteDepthWrapperEffect(subMesh6); + } + } + })); + } + if (((_b = this._subMeshToEffect.get(params.subMesh)) === null || _b === undefined ? undefined : _b[0]) !== params.effect) { + this._subMeshToEffect.set(params.subMesh, [params.effect, this._scene.getEngine().currentRenderPassId]); + this._deleteDepthWrapperEffect(params.subMesh); + } + }); + } + _deleteDepthWrapperEffect(subMesh6) { + const depthWrapperEntries = this._subMeshToDepthWrapper.mm.get(subMesh6); + if (depthWrapperEntries) { + depthWrapperEntries.forEach((depthWrapper) => { + var _a; + (_a = depthWrapper.mainDrawWrapper.effect) === null || _a === undefined || _a.dispose(); + }); + this._subMeshToDepthWrapper.mm.delete(subMesh6); + } + } + getEffect(subMesh6, shadowGenerator4, passIdForDrawWrapper) { + var _a; + const entry = (_a = this._subMeshToDepthWrapper.mm.get(subMesh6)) === null || _a === undefined ? undefined : _a.get(shadowGenerator4); + if (!entry) { + return null; + } + let drawWrapper14 = entry.drawWrapper[passIdForDrawWrapper]; + if (!drawWrapper14) { + drawWrapper14 = entry.drawWrapper[passIdForDrawWrapper] = new DrawWrapper(this._scene.getEngine()); + drawWrapper14.setEffect(entry.mainDrawWrapper.effect, entry.mainDrawWrapper.defines); + } + return drawWrapper14; + } + isReadyForSubMesh(subMesh6, defines, shadowGenerator4, useInstances, passIdForDrawWrapper) { + var _a, _b; + if (this.standalone) { + if (!this._baseMaterial.isReadyForSubMesh(subMesh6.getMesh(), subMesh6, useInstances)) { + return false; + } + } + return (_b = (_a = this._makeEffect(subMesh6, defines, shadowGenerator4, passIdForDrawWrapper)) === null || _a === undefined ? undefined : _a.isReady()) !== null && _b !== undefined ? _b : false; + } + dispose() { + this._baseMaterial.onEffectCreatedObservable.remove(this._onEffectCreatedObserver); + this._onEffectCreatedObserver = null; + const iterator = this._meshes.entries(); + for (let entry = iterator.next();entry.done !== true; entry = iterator.next()) { + const [mesh48, observer2] = entry.value; + mesh48.onDisposeObservable.remove(observer2); + } + } + _makeEffect(subMesh6, defines, shadowGenerator4, passIdForDrawWrapper) { + var _a, _b, _c; + const engine41 = this._scene.getEngine(); + const origEffectAndRenderPassId = this._subMeshToEffect.get(subMesh6); + if (!origEffectAndRenderPassId) { + return null; + } + const [origEffect, origRenderPassId] = origEffectAndRenderPassId; + let params = this._subMeshToDepthWrapper.get(subMesh6, shadowGenerator4); + if (!params) { + const mainDrawWrapper = new DrawWrapper(engine41); + mainDrawWrapper.defines = (_b = (_a = subMesh6._getDrawWrapper(origRenderPassId)) === null || _a === undefined ? undefined : _a.defines) !== null && _b !== undefined ? _b : null; + params = { + drawWrapper: [], + mainDrawWrapper, + depthDefines: "", + token: RandomGUID() + }; + params.drawWrapper[passIdForDrawWrapper] = mainDrawWrapper; + this._subMeshToDepthWrapper.set(subMesh6, shadowGenerator4, params); + } + const join = defines.join("\n"); + if (params.mainDrawWrapper.effect) { + if (join === params.depthDefines) { + return params.mainDrawWrapper.effect; + } + } + params.depthDefines = join; + const uniforms = origEffect.getUniformNames().slice(); + let { vertexSourceCodeBeforeMigration: vertexCode, fragmentSourceCodeBeforeMigration: fragmentCode } = origEffect; + if (!this.doNotInjectCode) { + const vertexNormalBiasCode = this._options && this._options.remappedVariables ? `#include(${this._options.remappedVariables.join(",")})` : Effect.IncludesShadersStore["shadowMapVertexNormalBias"], vertexMetricCode = this._options && this._options.remappedVariables ? `#include(${this._options.remappedVariables.join(",")})` : Effect.IncludesShadersStore["shadowMapVertexMetric"], fragmentSoftTransparentShadow = this._options && this._options.remappedVariables ? `#include(${this._options.remappedVariables.join(",")})` : Effect.IncludesShadersStore["shadowMapFragmentSoftTransparentShadow"], fragmentBlockCode = Effect.IncludesShadersStore["shadowMapFragment"]; + vertexCode = vertexCode.replace(/void\s+?main/g, Effect.IncludesShadersStore["shadowMapVertexExtraDeclaration"] + "\nvoid main"); + vertexCode = vertexCode.replace(/#define SHADOWDEPTH_NORMALBIAS|#define CUSTOM_VERTEX_UPDATE_WORLDPOS/g, vertexNormalBiasCode); + if (vertexCode.indexOf("#define SHADOWDEPTH_METRIC") !== -1) { + vertexCode = vertexCode.replace(/#define SHADOWDEPTH_METRIC/g, vertexMetricCode); + } else { + vertexCode = vertexCode.replace(/}\s*$/g, vertexMetricCode + "\n}"); + } + vertexCode = vertexCode.replace(/#define SHADER_NAME.*?\n|out vec4 glFragColor;\n/g, ""); + const hasLocationForSoftTransparentShadow = fragmentCode.indexOf("#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW") >= 0 || fragmentCode.indexOf("#define CUSTOM_FRAGMENT_BEFORE_FOG") >= 0; + const hasLocationForFragment = fragmentCode.indexOf("#define SHADOWDEPTH_FRAGMENT") !== -1; + let fragmentCodeToInjectAtEnd = ""; + if (!hasLocationForSoftTransparentShadow) { + fragmentCodeToInjectAtEnd = fragmentSoftTransparentShadow + "\n"; + } else { + fragmentCode = fragmentCode.replace(/#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW|#define CUSTOM_FRAGMENT_BEFORE_FOG/g, fragmentSoftTransparentShadow); + } + fragmentCode = fragmentCode.replace(/void\s+?main/g, Effect.IncludesShadersStore["shadowMapFragmentExtraDeclaration"] + "\nvoid main"); + if (hasLocationForFragment) { + fragmentCode = fragmentCode.replace(/#define SHADOWDEPTH_FRAGMENT/g, fragmentBlockCode); + } else { + fragmentCodeToInjectAtEnd += fragmentBlockCode + "\n"; + } + if (fragmentCodeToInjectAtEnd) { + fragmentCode = fragmentCode.replace(/}\s*$/g, fragmentCodeToInjectAtEnd + "}"); + } + uniforms.push("biasAndScaleSM", "depthValuesSM", "lightDataSM", "softTransparentShadowSM"); + } + params.mainDrawWrapper.effect = engine41.createEffect({ + vertexSource: vertexCode, + fragmentSource: fragmentCode, + vertexToken: params.token, + fragmentToken: params.token + }, { + attributes: origEffect.getAttributesNames(), + uniformsNames: uniforms, + uniformBuffersNames: origEffect.getUniformBuffersNames(), + samplers: origEffect.getSamplers(), + defines: join + "\n" + origEffect.defines.replace("#define SHADOWS", "").replace(/#define SHADOW\d/g, ""), + indexParameters: origEffect.getIndexParameters() + }, engine41); + for (let id = 0;id < params.drawWrapper.length; ++id) { + if (id !== passIdForDrawWrapper) { + (_c = params.drawWrapper[id]) === null || _c === undefined || _c.setEffect(params.mainDrawWrapper.effect, params.mainDrawWrapper.defines); + } + } + return params.mainDrawWrapper.effect; + } +} +var init_shadowDepthWrapper = __esm(() => { + init_effect(); + init_guid(); + init_drawWrapper(); + init_engineStore(); +}); + // node_modules/@babylonjs/core/Materials/material.decalMapConfiguration.js class DecalMapDefines extends MaterialDefines { constructor() { @@ -135598,40 +147178,108 @@ class DecalMapConfiguration extends MaterialPluginBase { }; } } -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], DecalMapConfiguration.prototype, "isEnabled", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], DecalMapConfiguration.prototype, "smoothAlpha", undefined); -RegisterClass("BABYLON.DecalMapConfiguration", DecalMapConfiguration); +var init_material_decalMapConfiguration = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_materialDefines(); + init_materialPluginBase(); + init_materialFlags(); + init_materialHelper(); + init_typeStore(); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], DecalMapConfiguration.prototype, "isEnabled", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], DecalMapConfiguration.prototype, "smoothAlpha", undefined); + RegisterClass("BABYLON.DecalMapConfiguration", DecalMapConfiguration); +}); + +// node_modules/@babylonjs/core/Materials/materialPluginFactoryExport.js +function createPBRAnisotropicPlugin(material19) { + if (material19 instanceof PBRBaseMaterial) { + return new PBRAnisotropicConfiguration(material19); + } + return null; +} +function createPBRBRDFPlugin(material19) { + if (material19 instanceof PBRBaseMaterial) { + return new PBRBRDFConfiguration(material19); + } + return null; +} +function createPBRClearCoatPlugin(material19) { + if (material19 instanceof PBRBaseMaterial) { + return new PBRClearCoatConfiguration(material19); + } + return null; +} +function createPBRIridescencePlugin(material19) { + if (material19 instanceof PBRBaseMaterial) { + return new PBRIridescenceConfiguration(material19); + } + return null; +} +function createPBRSheenPlugin(material19) { + if (material19 instanceof PBRBaseMaterial) { + return new PBRSheenConfiguration(material19); + } + return null; +} +function createPBRSubSurfacePlugin(material19) { + if (material19 instanceof PBRBaseMaterial) { + return new PBRSubSurfaceConfiguration(material19); + } + return null; +} +function createDetailMapPlugin(material19) { + if (material19 instanceof PBRBaseMaterial || material19 instanceof StandardMaterial) { + return new DetailMapConfiguration(material19); + } + return null; +} +var init_materialPluginFactoryExport = __esm(() => { + init_material_detailMapConfiguration(); + init_pbrAnisotropicConfiguration(); + init_pbrBaseMaterial(); + init_pbrBRDFConfiguration(); + init_pbrClearCoatConfiguration(); + init_pbrIridescenceConfiguration(); + init_pbrSheenConfiguration(); + init_pbrSubSurfaceConfiguration(); + init_standardMaterial(); +}); + // node_modules/@babylonjs/core/Materials/GreasedLine/greasedLineMaterialInterfaces.js -var GreasedLineMeshMaterialType; -(function(GreasedLineMeshMaterialType2) { - GreasedLineMeshMaterialType2[GreasedLineMeshMaterialType2["MATERIAL_TYPE_STANDARD"] = 0] = "MATERIAL_TYPE_STANDARD"; - GreasedLineMeshMaterialType2[GreasedLineMeshMaterialType2["MATERIAL_TYPE_PBR"] = 1] = "MATERIAL_TYPE_PBR"; - GreasedLineMeshMaterialType2[GreasedLineMeshMaterialType2["MATERIAL_TYPE_SIMPLE"] = 2] = "MATERIAL_TYPE_SIMPLE"; -})(GreasedLineMeshMaterialType || (GreasedLineMeshMaterialType = {})); -var GreasedLineMeshColorMode; -(function(GreasedLineMeshColorMode2) { - GreasedLineMeshColorMode2[GreasedLineMeshColorMode2["COLOR_MODE_SET"] = 0] = "COLOR_MODE_SET"; - GreasedLineMeshColorMode2[GreasedLineMeshColorMode2["COLOR_MODE_ADD"] = 1] = "COLOR_MODE_ADD"; - GreasedLineMeshColorMode2[GreasedLineMeshColorMode2["COLOR_MODE_MULTIPLY"] = 2] = "COLOR_MODE_MULTIPLY"; -})(GreasedLineMeshColorMode || (GreasedLineMeshColorMode = {})); -var GreasedLineMeshColorDistributionType; -(function(GreasedLineMeshColorDistributionType2) { - GreasedLineMeshColorDistributionType2[GreasedLineMeshColorDistributionType2["COLOR_DISTRIBUTION_TYPE_SEGMENT"] = 0] = "COLOR_DISTRIBUTION_TYPE_SEGMENT"; - GreasedLineMeshColorDistributionType2[GreasedLineMeshColorDistributionType2["COLOR_DISTRIBUTION_TYPE_LINE"] = 1] = "COLOR_DISTRIBUTION_TYPE_LINE"; -})(GreasedLineMeshColorDistributionType || (GreasedLineMeshColorDistributionType = {})); +var GreasedLineMeshMaterialType, GreasedLineMeshColorMode, GreasedLineMeshColorDistributionType; +var init_greasedLineMaterialInterfaces = __esm(() => { + (function(GreasedLineMeshMaterialType2) { + GreasedLineMeshMaterialType2[GreasedLineMeshMaterialType2["MATERIAL_TYPE_STANDARD"] = 0] = "MATERIAL_TYPE_STANDARD"; + GreasedLineMeshMaterialType2[GreasedLineMeshMaterialType2["MATERIAL_TYPE_PBR"] = 1] = "MATERIAL_TYPE_PBR"; + GreasedLineMeshMaterialType2[GreasedLineMeshMaterialType2["MATERIAL_TYPE_SIMPLE"] = 2] = "MATERIAL_TYPE_SIMPLE"; + })(GreasedLineMeshMaterialType || (GreasedLineMeshMaterialType = {})); + (function(GreasedLineMeshColorMode2) { + GreasedLineMeshColorMode2[GreasedLineMeshColorMode2["COLOR_MODE_SET"] = 0] = "COLOR_MODE_SET"; + GreasedLineMeshColorMode2[GreasedLineMeshColorMode2["COLOR_MODE_ADD"] = 1] = "COLOR_MODE_ADD"; + GreasedLineMeshColorMode2[GreasedLineMeshColorMode2["COLOR_MODE_MULTIPLY"] = 2] = "COLOR_MODE_MULTIPLY"; + })(GreasedLineMeshColorMode || (GreasedLineMeshColorMode = {})); + (function(GreasedLineMeshColorDistributionType2) { + GreasedLineMeshColorDistributionType2[GreasedLineMeshColorDistributionType2["COLOR_DISTRIBUTION_TYPE_SEGMENT"] = 0] = "COLOR_DISTRIBUTION_TYPE_SEGMENT"; + GreasedLineMeshColorDistributionType2[GreasedLineMeshColorDistributionType2["COLOR_DISTRIBUTION_TYPE_LINE"] = 1] = "COLOR_DISTRIBUTION_TYPE_LINE"; + })(GreasedLineMeshColorDistributionType || (GreasedLineMeshColorDistributionType = {})); +}); // node_modules/@babylonjs/core/Materials/GreasedLine/greasedLineMaterialDefaults.js class GreasedLineMaterialDefaults { } -GreasedLineMaterialDefaults.DEFAULT_COLOR = Color3.White(); -GreasedLineMaterialDefaults.DEFAULT_WIDTH_ATTENUATED = 1; -GreasedLineMaterialDefaults.DEFAULT_WIDTH = 0.1; +var init_greasedLineMaterialDefaults = __esm(() => { + init_math_color(); + GreasedLineMaterialDefaults.DEFAULT_COLOR = Color3.White(); + GreasedLineMaterialDefaults.DEFAULT_WIDTH_ATTENUATED = 1; + GreasedLineMaterialDefaults.DEFAULT_WIDTH = 0.1; +}); // node_modules/@babylonjs/core/Misc/greasedLineTools.js class GreasedLineTools { @@ -135910,10 +147558,10 @@ class GreasedLineTools { } return colorTable; } - static CreateColorsTexture(name177, colors, colorsSampling, scene22) { + static CreateColorsTexture(name178, colors, colorsSampling, scene22) { const colorsArray = GreasedLineTools.Color3toRGBAUint8(colors); const colorsTexture = new RawTexture(colorsArray, colors.length, 1, Engine2.TEXTUREFORMAT_RGBA, scene22, false, true, colorsSampling); - colorsTexture.name = name177; + colorsTexture.name = name178; return colorsTexture; } static PrepareEmptyColorsTexture(scene22) { @@ -135933,6 +147581,15 @@ class GreasedLineTools { return bool ? 1 : 0; } } +var init_greasedLineTools = __esm(() => { + init_math_path(); + init_buffer(); + init_math_vector(); + init_textBuilder(); + init_rawTexture(); + init_engine(); + init_greasedLineMaterialDefaults(); +}); // node_modules/@babylonjs/core/Materials/GreasedLine/greasedLinePluginMaterial.js class MaterialGreasedLineDefines extends MaterialDefines { @@ -136377,20 +148034,40 @@ class GreasedLinePluginMaterial extends MaterialPluginBase { dest.markAllDefinesAsDirty(); } } -GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME = "GreasedLinePluginMaterial"; -RegisterClass(`BABYLON.${GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME}`, GreasedLinePluginMaterial); +var init_greasedLinePluginMaterial = __esm(() => { + init_rawTexture(); + init_materialPluginBase(); + init_math_vector(); + init_materialDefines(); + init_typeStore(); + init_greasedLineMaterialInterfaces(); + init_greasedLineMaterialDefaults(); + init_greasedLineTools(); + GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME = "GreasedLinePluginMaterial"; + RegisterClass(`BABYLON.${GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME}`, GreasedLinePluginMaterial); +}); + // node_modules/@babylonjs/core/Shaders/greasedLine.fragment.js -var name177 = "greasedLinePixelShader"; -var shader177 = `precision highp float;uniform sampler2D grlColors;uniform float grlUseColors;uniform float grlUseDash;uniform float grlDashArray;uniform float grlDashOffset;uniform float grlDashRatio;uniform float grlVisibility;uniform float grlColorsWidth;uniform vec2 grl_colorModeAndColorDistributionType;uniform vec3 grlColor;varying float grlCounters;varying float grlColorPointer;void main() {float grlColorMode=grl_colorModeAndColorDistributionType.x;float grlColorDistributionType=grl_colorModeAndColorDistributionType.y;gl_FragColor=vec4(grlColor,1.);gl_FragColor.a=step(grlCounters,grlVisibility);if (gl_FragColor.a==0.) discard;if( grlUseDash==1. ){gl_FragColor.a=ceil(mod(grlCounters+grlDashOffset,grlDashArray)-(grlDashArray*grlDashRatio));if (gl_FragColor.a==0.) discard;} +var name178, shader177; +var init_greasedLine_fragment = __esm(() => { + init_shaderStore(); + name178 = "greasedLinePixelShader"; + shader177 = `precision highp float;uniform sampler2D grlColors;uniform float grlUseColors;uniform float grlUseDash;uniform float grlDashArray;uniform float grlDashOffset;uniform float grlDashRatio;uniform float grlVisibility;uniform float grlColorsWidth;uniform vec2 grl_colorModeAndColorDistributionType;uniform vec3 grlColor;varying float grlCounters;varying float grlColorPointer;void main() {float grlColorMode=grl_colorModeAndColorDistributionType.x;float grlColorDistributionType=grl_colorModeAndColorDistributionType.y;gl_FragColor=vec4(grlColor,1.);gl_FragColor.a=step(grlCounters,grlVisibility);if (gl_FragColor.a==0.) discard;if( grlUseDash==1. ){gl_FragColor.a=ceil(mod(grlCounters+grlDashOffset,grlDashArray)-(grlDashArray*grlDashRatio));if (gl_FragColor.a==0.) discard;} if (grlUseColors==1.) {vec4 textureColor;if (grlColorDistributionType==COLOR_DISTRIBUTION_TYPE_LINE) { textureColor=texture2D(grlColors,vec2(grlCounters,0.),0.);} else {textureColor=texture2D(grlColors,vec2(grlColorPointer/grlColorsWidth,0.),0.);} if (grlColorMode==COLOR_MODE_SET) {gl_FragColor=textureColor;} else if (grlColorMode==COLOR_MODE_ADD) {gl_FragColor+=textureColor;} else if (grlColorMode==COLOR_MODE_MULTIPLY) {gl_FragColor*=textureColor;}}} `; -ShaderStore.ShadersStore[name177] = shader177; + ShaderStore.ShadersStore[name178] = shader177; +}); // node_modules/@babylonjs/core/Shaders/greasedLine.vertex.js -var name178 = "greasedLineVertexShader"; -var shader178 = `precision highp float; +var name179, shader178; +var init_greasedLine_vertex = __esm(() => { + init_shaderStore(); + init_instancesDeclaration(); + init_instancesVertex(); + name179 = "greasedLineVertexShader"; + shader178 = `precision highp float; #include attribute float grl_widths;attribute vec3 grl_offsets;attribute float grl_colorPointers;attribute vec3 position;uniform mat4 viewProjection;uniform mat4 projection;varying float grlCounters;varying float grlColorPointer; #ifdef GREASED_LINE_CAMERA_FACING @@ -136416,11 +148093,12 @@ grlCounters=grl_counters;vec4 grlFinalPosition=worldViewProjection*vec4( (positi #endif } `; -ShaderStore.ShadersStore[name178] = shader178; + ShaderStore.ShadersStore[name179] = shader178; +}); // node_modules/@babylonjs/core/Materials/GreasedLine/greasedLineSimpleMaterial.js class GreasedLineSimpleMaterial extends ShaderMaterial { - constructor(name179, scene22, options) { + constructor(name180, scene22, options) { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p; const defines = [ `COLOR_DISTRIBUTION_TYPE_LINE ${GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_LINE}.`, @@ -136438,7 +148116,7 @@ class GreasedLineSimpleMaterial extends ShaderMaterial { attributes.push("grl_slopes"); attributes.push("grl_counters"); } - super(name179, scene22, { + super(name180, scene22, { vertex: "greasedLine", fragment: "greasedLine" }, { @@ -136690,170 +148368,19 @@ class GreasedLineSimpleMaterial extends ShaderMaterial { this.setDefine("GREASED_LINE_CAMERA_FACING", this._cameraFacing); } } -// node_modules/@babylonjs/core/Materials/meshDebugPluginMaterial.js -var vertexDefinitions = `#if defined(DBG_ENABLED) -attribute float dbg_initialPass; -varying vec3 dbg_vBarycentric; -flat varying vec3 dbg_vVertexWorldPos; -flat varying float dbg_vPass; -#endif`; -var vertexMainEnd = `#if defined(DBG_ENABLED) -float dbg_vertexIndex = mod(float(gl_VertexID), 3.); -if (dbg_vertexIndex == 0.0) { - dbg_vBarycentric = vec3(1.,0.,0.); -} -else if (dbg_vertexIndex == 1.0) { - dbg_vBarycentric = vec3(0.,1.,0.); -} -else { - dbg_vBarycentric = vec3(0.,0.,1.); -} - -dbg_vVertexWorldPos = vPositionW; -dbg_vPass = dbg_initialPass; -#endif`; -var fragmentUniforms = `#if defined(DBG_ENABLED) -uniform vec3 dbg_shadedDiffuseColor; -uniform vec4 dbg_shadedSpecularColorPower; -uniform vec3 dbg_thicknessRadiusScale; - -#if DBG_MODE == 2 || DBG_MODE == 3 - uniform vec3 dbg_vertexColor; -#endif - -#if DBG_MODE == 1 - uniform vec3 dbg_wireframeTrianglesColor; -#elif DBG_MODE == 3 - uniform vec3 dbg_wireframeVerticesColor; -#elif DBG_MODE == 4 || DBG_MODE == 5 - uniform vec3 dbg_uvPrimaryColor; - uniform vec3 dbg_uvSecondaryColor; -#elif DBG_MODE == 7 - uniform vec3 dbg_materialColor; -#endif -#endif`; -var fragmentDefinitions = `#if defined(DBG_ENABLED) -varying vec3 dbg_vBarycentric; -flat varying vec3 dbg_vVertexWorldPos; -flat varying float dbg_vPass; - -#if !defined(DBG_MULTIPLY) - vec3 dbg_applyShading(vec3 color) { - vec3 N = vNormalW.xyz; - vec3 L = normalize(vEyePosition.xyz - vPositionW.xyz); - vec3 H = normalize(L + L); - float LdotN = clamp(dot(L,N), 0., 1.); - float HdotN = clamp(dot(H,N), 0., 1.); - float specTerm = pow(HdotN, dbg_shadedSpecularColorPower.w); - color *= (LdotN / PI); - color += dbg_shadedSpecularColorPower.rgb * (specTerm / PI); - return color; - } -#endif - -#if DBG_MODE == 1 || DBG_MODE == 3 - float dbg_edgeFactor() { - vec3 d = fwidth(dbg_vBarycentric); - vec3 a3 = smoothstep(vec3(0.), d * dbg_thicknessRadiusScale.x, dbg_vBarycentric); - return min(min(a3.x, a3.y), a3.z); - } -#endif - -#if DBG_MODE == 2 || DBG_MODE == 3 - float dbg_cornerFactor() { - vec3 worldPos = vPositionW; - float dist = length(worldPos - dbg_vVertexWorldPos); - float camDist = length(worldPos - vEyePosition.xyz); - float d = sqrt(camDist) * .001; - return smoothstep((dbg_thicknessRadiusScale.y * d), ((dbg_thicknessRadiusScale.y * 1.01) * d), dist); - } -#endif - -#if (DBG_MODE == 4 && defined(UV1)) || (DBG_MODE == 5 && defined(UV2)) - float dbg_checkerboardFactor(vec2 uv) { - vec2 f = fract(uv * dbg_thicknessRadiusScale.z); - f -= .5; - return (f.x * f.y) > 0. ? 1. : 0.; - } -#endif -#endif`; -var fragmentMainEnd = `#if defined(DBG_ENABLED) -vec3 dbg_color = vec3(1.); -#if DBG_MODE == 1 - dbg_color = mix(dbg_wireframeTrianglesColor, vec3(1.), dbg_edgeFactor()); -#elif DBG_MODE == 2 || DBG_MODE == 3 - float dbg_cornerFactor = dbg_cornerFactor(); - if (dbg_vPass == 0. && dbg_cornerFactor == 1.) discard; - dbg_color = mix(dbg_vertexColor, vec3(1.), dbg_cornerFactor); - #if DBG_MODE == 3 - dbg_color *= mix(dbg_wireframeVerticesColor, vec3(1.), dbg_edgeFactor()); - #endif -#elif DBG_MODE == 4 && defined(UV1) - dbg_color = mix(dbg_uvPrimaryColor, dbg_uvSecondaryColor, dbg_checkerboardFactor(vMainUV1)); -#elif DBG_MODE == 5 && defined(UV2) - dbg_color = mix(dbg_uvPrimaryColor, dbg_uvSecondaryColor, dbg_checkerboardFactor(vMainUV2)); -#elif DBG_MODE == 6 && defined(VERTEXCOLOR) - dbg_color = vColor.rgb; -#elif DBG_MODE == 7 - dbg_color = dbg_materialColor; -#endif - -#if defined(DBG_MULTIPLY) - gl_FragColor *= vec4(dbg_color, 1.); -#else - #if DBG_MODE != 6 - gl_FragColor = vec4(dbg_applyShading(dbg_shadedDiffuseColor) * dbg_color, 1.); - #else - gl_FragColor = vec4(dbg_color, 1.); - #endif -#endif -#endif`; -var defaultMaterialColors = [ - new Color3(0.98, 0.26, 0.38), - new Color3(0.47, 0.75, 0.3), - new Color3(0, 0.26, 0.77), - new Color3(0.97, 0.6, 0.76), - new Color3(0.19, 0.63, 0.78), - new Color3(0.98, 0.8, 0.6), - new Color3(0.65, 0.43, 0.15), - new Color3(0.15, 0.47, 0.22), - new Color3(0.67, 0.71, 0.86), - new Color3(0.09, 0.46, 0.56), - new Color3(0.8, 0.98, 0.02), - new Color3(0.39, 0.29, 0.13), - new Color3(0.53, 0.63, 0.06), - new Color3(0.95, 0.96, 0.41), - new Color3(1, 0.72, 0.94), - new Color3(0.63, 0.08, 0.31), - new Color3(0.66, 0.96, 0.95), - new Color3(0.22, 0.14, 0.19), - new Color3(0.14, 0.65, 0.59), - new Color3(0.93, 1, 0.68), - new Color3(0.93, 0.14, 0.44), - new Color3(0.47, 0.86, 0.67), - new Color3(0.85, 0.07, 0.78), - new Color3(0.53, 0.64, 0.98), - new Color3(0.43, 0.37, 0.56), - new Color3(0.71, 0.65, 0.25), - new Color3(0.66, 0.19, 0.01), - new Color3(0.94, 0.53, 0.12), - new Color3(0.41, 0.44, 0.44), - new Color3(0.24, 0.71, 0.96), - new Color3(0.57, 0.28, 0.56), - new Color3(0.44, 0.98, 0.42) -]; -var MeshDebugMode; -(function(MeshDebugMode2) { - MeshDebugMode2[MeshDebugMode2["NONE"] = 0] = "NONE"; - MeshDebugMode2[MeshDebugMode2["TRIANGLES"] = 1] = "TRIANGLES"; - MeshDebugMode2[MeshDebugMode2["VERTICES"] = 2] = "VERTICES"; - MeshDebugMode2[MeshDebugMode2["TRIANGLES_VERTICES"] = 3] = "TRIANGLES_VERTICES"; - MeshDebugMode2[MeshDebugMode2["UV0"] = 4] = "UV0"; - MeshDebugMode2[MeshDebugMode2["UV1"] = 5] = "UV1"; - MeshDebugMode2[MeshDebugMode2["VERTEXCOLORS"] = 6] = "VERTEXCOLORS"; - MeshDebugMode2[MeshDebugMode2["MATERIALIDS"] = 7] = "MATERIALIDS"; -})(MeshDebugMode || (MeshDebugMode = {})); +var init_greasedLineSimpleMaterial = __esm(() => { + init_rawTexture(); + init_shaderMaterial(); + init_math_color(); + init_math_vector(); + init_greasedLine_fragment(); + init_greasedLine_vertex(); + init_greasedLineMaterialInterfaces(); + init_greasedLineTools(); + init_greasedLineMaterialDefaults(); +}); +// node_modules/@babylonjs/core/Materials/meshDebugPluginMaterial.js class MeshDebugDefines extends MaterialDefines { constructor() { super(...arguments); @@ -137004,247 +148531,654 @@ class MeshDebugPluginMaterial extends MaterialPluginBase { return rollback; } } -MeshDebugPluginMaterial._PluginCount = 0; -MeshDebugPluginMaterial.MaterialColors = defaultMaterialColors; -__decorate2([ - serializeAsColor3() -], MeshDebugPluginMaterial.prototype, "_materialColor", undefined); -__decorate2([ - serialize() -], MeshDebugPluginMaterial.prototype, "_isEnabled", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllDefinesAsDirty") -], MeshDebugPluginMaterial.prototype, "mode", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllDefinesAsDirty") -], MeshDebugPluginMaterial.prototype, "multiply", undefined); -__decorate2([ - serializeAsColor3() -], MeshDebugPluginMaterial.prototype, "shadedDiffuseColor", undefined); -__decorate2([ - serializeAsColor3() -], MeshDebugPluginMaterial.prototype, "shadedSpecularColor", undefined); -__decorate2([ - serialize() -], MeshDebugPluginMaterial.prototype, "shadedSpecularPower", undefined); -__decorate2([ - serialize() -], MeshDebugPluginMaterial.prototype, "wireframeThickness", undefined); -__decorate2([ - serializeAsColor3() -], MeshDebugPluginMaterial.prototype, "wireframeTrianglesColor", undefined); -__decorate2([ - serializeAsColor3() -], MeshDebugPluginMaterial.prototype, "wireframeVerticesColor", undefined); -__decorate2([ - serializeAsColor3() -], MeshDebugPluginMaterial.prototype, "vertexColor", undefined); -__decorate2([ - serialize() -], MeshDebugPluginMaterial.prototype, "vertexRadius", undefined); -__decorate2([ - serialize() -], MeshDebugPluginMaterial.prototype, "uvScale", undefined); -__decorate2([ - serializeAsColor3() -], MeshDebugPluginMaterial.prototype, "uvPrimaryColor", undefined); -__decorate2([ - serializeAsColor3() -], MeshDebugPluginMaterial.prototype, "uvSecondaryColor", undefined); -RegisterClass("BABYLON.MeshDebugPluginMaterial", MeshDebugPluginMaterial); +var vertexDefinitions, vertexMainEnd, fragmentUniforms, fragmentDefinitions, fragmentMainEnd, defaultMaterialColors, MeshDebugMode; +var init_meshDebugPluginMaterial = __esm(() => { + init_tslib_es62(); + init_materialPluginBase(); + init_materialDefines(); + init_typeStore(); + init_math(); + init_logger(); + init_decorators(); + vertexDefinitions = `#if defined(DBG_ENABLED) +attribute float dbg_initialPass; +varying vec3 dbg_vBarycentric; +flat varying vec3 dbg_vVertexWorldPos; +flat varying float dbg_vPass; +#endif`; + vertexMainEnd = `#if defined(DBG_ENABLED) +float dbg_vertexIndex = mod(float(gl_VertexID), 3.); +if (dbg_vertexIndex == 0.0) { + dbg_vBarycentric = vec3(1.,0.,0.); +} +else if (dbg_vertexIndex == 1.0) { + dbg_vBarycentric = vec3(0.,1.,0.); +} +else { + dbg_vBarycentric = vec3(0.,0.,1.); +} + +dbg_vVertexWorldPos = vPositionW; +dbg_vPass = dbg_initialPass; +#endif`; + fragmentUniforms = `#if defined(DBG_ENABLED) +uniform vec3 dbg_shadedDiffuseColor; +uniform vec4 dbg_shadedSpecularColorPower; +uniform vec3 dbg_thicknessRadiusScale; + +#if DBG_MODE == 2 || DBG_MODE == 3 + uniform vec3 dbg_vertexColor; +#endif + +#if DBG_MODE == 1 + uniform vec3 dbg_wireframeTrianglesColor; +#elif DBG_MODE == 3 + uniform vec3 dbg_wireframeVerticesColor; +#elif DBG_MODE == 4 || DBG_MODE == 5 + uniform vec3 dbg_uvPrimaryColor; + uniform vec3 dbg_uvSecondaryColor; +#elif DBG_MODE == 7 + uniform vec3 dbg_materialColor; +#endif +#endif`; + fragmentDefinitions = `#if defined(DBG_ENABLED) +varying vec3 dbg_vBarycentric; +flat varying vec3 dbg_vVertexWorldPos; +flat varying float dbg_vPass; + +#if !defined(DBG_MULTIPLY) + vec3 dbg_applyShading(vec3 color) { + vec3 N = vNormalW.xyz; + vec3 L = normalize(vEyePosition.xyz - vPositionW.xyz); + vec3 H = normalize(L + L); + float LdotN = clamp(dot(L,N), 0., 1.); + float HdotN = clamp(dot(H,N), 0., 1.); + float specTerm = pow(HdotN, dbg_shadedSpecularColorPower.w); + color *= (LdotN / PI); + color += dbg_shadedSpecularColorPower.rgb * (specTerm / PI); + return color; + } +#endif + +#if DBG_MODE == 1 || DBG_MODE == 3 + float dbg_edgeFactor() { + vec3 d = fwidth(dbg_vBarycentric); + vec3 a3 = smoothstep(vec3(0.), d * dbg_thicknessRadiusScale.x, dbg_vBarycentric); + return min(min(a3.x, a3.y), a3.z); + } +#endif + +#if DBG_MODE == 2 || DBG_MODE == 3 + float dbg_cornerFactor() { + vec3 worldPos = vPositionW; + float dist = length(worldPos - dbg_vVertexWorldPos); + float camDist = length(worldPos - vEyePosition.xyz); + float d = sqrt(camDist) * .001; + return smoothstep((dbg_thicknessRadiusScale.y * d), ((dbg_thicknessRadiusScale.y * 1.01) * d), dist); + } +#endif + +#if (DBG_MODE == 4 && defined(UV1)) || (DBG_MODE == 5 && defined(UV2)) + float dbg_checkerboardFactor(vec2 uv) { + vec2 f = fract(uv * dbg_thicknessRadiusScale.z); + f -= .5; + return (f.x * f.y) > 0. ? 1. : 0.; + } +#endif +#endif`; + fragmentMainEnd = `#if defined(DBG_ENABLED) +vec3 dbg_color = vec3(1.); +#if DBG_MODE == 1 + dbg_color = mix(dbg_wireframeTrianglesColor, vec3(1.), dbg_edgeFactor()); +#elif DBG_MODE == 2 || DBG_MODE == 3 + float dbg_cornerFactor = dbg_cornerFactor(); + if (dbg_vPass == 0. && dbg_cornerFactor == 1.) discard; + dbg_color = mix(dbg_vertexColor, vec3(1.), dbg_cornerFactor); + #if DBG_MODE == 3 + dbg_color *= mix(dbg_wireframeVerticesColor, vec3(1.), dbg_edgeFactor()); + #endif +#elif DBG_MODE == 4 && defined(UV1) + dbg_color = mix(dbg_uvPrimaryColor, dbg_uvSecondaryColor, dbg_checkerboardFactor(vMainUV1)); +#elif DBG_MODE == 5 && defined(UV2) + dbg_color = mix(dbg_uvPrimaryColor, dbg_uvSecondaryColor, dbg_checkerboardFactor(vMainUV2)); +#elif DBG_MODE == 6 && defined(VERTEXCOLOR) + dbg_color = vColor.rgb; +#elif DBG_MODE == 7 + dbg_color = dbg_materialColor; +#endif + +#if defined(DBG_MULTIPLY) + gl_FragColor *= vec4(dbg_color, 1.); +#else + #if DBG_MODE != 6 + gl_FragColor = vec4(dbg_applyShading(dbg_shadedDiffuseColor) * dbg_color, 1.); + #else + gl_FragColor = vec4(dbg_color, 1.); + #endif +#endif +#endif`; + defaultMaterialColors = [ + new Color3(0.98, 0.26, 0.38), + new Color3(0.47, 0.75, 0.3), + new Color3(0, 0.26, 0.77), + new Color3(0.97, 0.6, 0.76), + new Color3(0.19, 0.63, 0.78), + new Color3(0.98, 0.8, 0.6), + new Color3(0.65, 0.43, 0.15), + new Color3(0.15, 0.47, 0.22), + new Color3(0.67, 0.71, 0.86), + new Color3(0.09, 0.46, 0.56), + new Color3(0.8, 0.98, 0.02), + new Color3(0.39, 0.29, 0.13), + new Color3(0.53, 0.63, 0.06), + new Color3(0.95, 0.96, 0.41), + new Color3(1, 0.72, 0.94), + new Color3(0.63, 0.08, 0.31), + new Color3(0.66, 0.96, 0.95), + new Color3(0.22, 0.14, 0.19), + new Color3(0.14, 0.65, 0.59), + new Color3(0.93, 1, 0.68), + new Color3(0.93, 0.14, 0.44), + new Color3(0.47, 0.86, 0.67), + new Color3(0.85, 0.07, 0.78), + new Color3(0.53, 0.64, 0.98), + new Color3(0.43, 0.37, 0.56), + new Color3(0.71, 0.65, 0.25), + new Color3(0.66, 0.19, 0.01), + new Color3(0.94, 0.53, 0.12), + new Color3(0.41, 0.44, 0.44), + new Color3(0.24, 0.71, 0.96), + new Color3(0.57, 0.28, 0.56), + new Color3(0.44, 0.98, 0.42) + ]; + (function(MeshDebugMode2) { + MeshDebugMode2[MeshDebugMode2["NONE"] = 0] = "NONE"; + MeshDebugMode2[MeshDebugMode2["TRIANGLES"] = 1] = "TRIANGLES"; + MeshDebugMode2[MeshDebugMode2["VERTICES"] = 2] = "VERTICES"; + MeshDebugMode2[MeshDebugMode2["TRIANGLES_VERTICES"] = 3] = "TRIANGLES_VERTICES"; + MeshDebugMode2[MeshDebugMode2["UV0"] = 4] = "UV0"; + MeshDebugMode2[MeshDebugMode2["UV1"] = 5] = "UV1"; + MeshDebugMode2[MeshDebugMode2["VERTEXCOLORS"] = 6] = "VERTEXCOLORS"; + MeshDebugMode2[MeshDebugMode2["MATERIALIDS"] = 7] = "MATERIALIDS"; + })(MeshDebugMode || (MeshDebugMode = {})); + MeshDebugPluginMaterial._PluginCount = 0; + MeshDebugPluginMaterial.MaterialColors = defaultMaterialColors; + __decorate2([ + serializeAsColor3() + ], MeshDebugPluginMaterial.prototype, "_materialColor", undefined); + __decorate2([ + serialize() + ], MeshDebugPluginMaterial.prototype, "_isEnabled", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllDefinesAsDirty") + ], MeshDebugPluginMaterial.prototype, "mode", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllDefinesAsDirty") + ], MeshDebugPluginMaterial.prototype, "multiply", undefined); + __decorate2([ + serializeAsColor3() + ], MeshDebugPluginMaterial.prototype, "shadedDiffuseColor", undefined); + __decorate2([ + serializeAsColor3() + ], MeshDebugPluginMaterial.prototype, "shadedSpecularColor", undefined); + __decorate2([ + serialize() + ], MeshDebugPluginMaterial.prototype, "shadedSpecularPower", undefined); + __decorate2([ + serialize() + ], MeshDebugPluginMaterial.prototype, "wireframeThickness", undefined); + __decorate2([ + serializeAsColor3() + ], MeshDebugPluginMaterial.prototype, "wireframeTrianglesColor", undefined); + __decorate2([ + serializeAsColor3() + ], MeshDebugPluginMaterial.prototype, "wireframeVerticesColor", undefined); + __decorate2([ + serializeAsColor3() + ], MeshDebugPluginMaterial.prototype, "vertexColor", undefined); + __decorate2([ + serialize() + ], MeshDebugPluginMaterial.prototype, "vertexRadius", undefined); + __decorate2([ + serialize() + ], MeshDebugPluginMaterial.prototype, "uvScale", undefined); + __decorate2([ + serializeAsColor3() + ], MeshDebugPluginMaterial.prototype, "uvPrimaryColor", undefined); + __decorate2([ + serializeAsColor3() + ], MeshDebugPluginMaterial.prototype, "uvSecondaryColor", undefined); + RegisterClass("BABYLON.MeshDebugPluginMaterial", MeshDebugPluginMaterial); +}); + // node_modules/@babylonjs/core/Materials/standardMaterial.decalMap.js -Object.defineProperty(StandardMaterial.prototype, "decalMap", { - get: function() { - if (!this._decalMap) { - if (this._uniformBufferLayoutBuilt) { - return null; +var init_standardMaterial_decalMap = __esm(() => { + init_material_decalMapConfiguration(); + init_standardMaterial(); + Object.defineProperty(StandardMaterial.prototype, "decalMap", { + get: function() { + if (!this._decalMap) { + if (this._uniformBufferLayoutBuilt) { + return null; + } + this._decalMap = new DecalMapConfiguration(this); } - this._decalMap = new DecalMapConfiguration(this); - } - return this._decalMap; - }, - enumerable: true, - configurable: true + return this._decalMap; + }, + enumerable: true, + configurable: true + }); }); // node_modules/@babylonjs/core/Materials/PBR/pbrMaterial.decalMap.js -Object.defineProperty(PBRBaseMaterial.prototype, "decalMap", { - get: function() { - if (!this._decalMap) { - if (this._uniformBufferLayoutBuilt) { - return null; +var init_pbrMaterial_decalMap = __esm(() => { + init_material_decalMapConfiguration(); + init_pbrBaseMaterial(); + Object.defineProperty(PBRBaseMaterial.prototype, "decalMap", { + get: function() { + if (!this._decalMap) { + if (this._uniformBufferLayoutBuilt) { + return null; + } + this._decalMap = new DecalMapConfiguration(this); } - this._decalMap = new DecalMapConfiguration(this); - } - return this._decalMap; - }, - enumerable: true, - configurable: true + return this._decalMap; + }, + enumerable: true, + configurable: true + }); }); // node_modules/@babylonjs/core/Meshes/abstractMesh.decalMap.js -Object.defineProperty(AbstractMesh.prototype, "decalMap", { - get: function() { - return this._decalMap; - }, - set: function(decalMap) { - this._decalMap = decalMap; - }, - enumerable: true, - configurable: true -}); -// node_modules/@babylonjs/core/Meshes/Compression/dracoCompression.js -var createDecoderAsync = function(wasmBinary) { - return new Promise((resolve) => { - DracoDecoderModule({ wasmBinary }).then((module) => { - resolve({ module }); - }); +var init_abstractMesh_decalMap = __esm(() => { + init_abstractMesh(); + Object.defineProperty(AbstractMesh.prototype, "decalMap", { + get: function() { + return this._decalMap; + }, + set: function(decalMap) { + this._decalMap = decalMap; + }, + enumerable: true, + configurable: true }); -}; -var decodeMesh = function(decoderModule, data, attributes, onIndicesData, onAttributeData) { - let decoder = null; - let buffer48 = null; - let geometry4 = null; - try { - decoder = new decoderModule.Decoder; - buffer48 = new decoderModule.DecoderBuffer; - buffer48.Init(data, data.byteLength); - let status; - const type = decoder.GetEncodedGeometryType(buffer48); - switch (type) { - case decoderModule.TRIANGULAR_MESH: { - const mesh48 = new decoderModule.Mesh; - status = decoder.DecodeBufferToMesh(buffer48, mesh48); - if (!status.ok() || mesh48.ptr === 0) { - throw new Error(status.error_msg()); - } - const numFaces = mesh48.num_faces(); - const numIndices = numFaces * 3; - const byteLength = numIndices * 4; - const ptr = decoderModule._malloc(byteLength); - try { - decoder.GetTrianglesUInt32Array(mesh48, byteLength, ptr); - const indices = new Uint32Array(numIndices); - indices.set(new Uint32Array(decoderModule.HEAPF32.buffer, ptr, numIndices)); - onIndicesData(indices); - } finally { - decoderModule._free(ptr); - } - geometry4 = mesh48; - break; - } - case decoderModule.POINT_CLOUD: { - const pointCloud = new decoderModule.PointCloud; - status = decoder.DecodeBufferToPointCloud(buffer48, pointCloud); - if (!status.ok() || !pointCloud.ptr) { - throw new Error(status.error_msg()); - } - geometry4 = pointCloud; - break; - } - default: { - throw new Error(`Invalid geometry type ${type}`); - } - } - const numPoints = geometry4.num_points(); - const processAttribute = (decoder2, geometry5, kind, attribute) => { - const dataType = attribute.data_type(); - const numComponents = attribute.num_components(); - const normalized = attribute.normalized(); - const byteStride = attribute.byte_stride(); - const byteOffset = attribute.byte_offset(); - const dataTypeInfo = { - [decoderModule.DT_FLOAT32]: { typedArrayConstructor: Float32Array, heap: decoderModule.HEAPF32 }, - [decoderModule.DT_INT8]: { typedArrayConstructor: Int8Array, heap: decoderModule.HEAP8 }, - [decoderModule.DT_INT16]: { typedArrayConstructor: Int16Array, heap: decoderModule.HEAP16 }, - [decoderModule.DT_INT32]: { typedArrayConstructor: Int32Array, heap: decoderModule.HEAP32 }, - [decoderModule.DT_UINT8]: { typedArrayConstructor: Uint8Array, heap: decoderModule.HEAPU8 }, - [decoderModule.DT_UINT16]: { typedArrayConstructor: Uint16Array, heap: decoderModule.HEAPU16 }, - [decoderModule.DT_UINT32]: { typedArrayConstructor: Uint32Array, heap: decoderModule.HEAPU32 } - }; - const info = dataTypeInfo[dataType]; - if (!info) { - throw new Error(`Invalid data type ${dataType}`); - } - const numValues = numPoints * numComponents; - const byteLength = numValues * info.typedArrayConstructor.BYTES_PER_ELEMENT; - const ptr = decoderModule._malloc(byteLength); - try { - decoder2.GetAttributeDataArrayForAllPoints(geometry5, attribute, dataType, byteLength, ptr); - const data2 = new info.typedArrayConstructor(info.heap.buffer, ptr, numValues); - onAttributeData(kind, data2.slice(), numComponents, byteOffset, byteStride, normalized); - } finally { - decoderModule._free(ptr); - } - }; - if (attributes) { - for (const kind in attributes) { - const id = attributes[kind]; - const attribute = decoder.GetAttributeByUniqueId(geometry4, id); - processAttribute(decoder, geometry4, kind, attribute); - } - } else { - const dracoAttributeTypes = { - position: decoderModule.POSITION, - normal: decoderModule.NORMAL, - color: decoderModule.COLOR, - uv: decoderModule.TEX_COORD - }; - for (const kind in dracoAttributeTypes) { - const id = decoder.GetAttributeId(geometry4, dracoAttributeTypes[kind]); - if (id !== -1) { - const attribute = decoder.GetAttribute(geometry4, id); - processAttribute(decoder, geometry4, kind, attribute); - } - } - } - return numPoints; - } finally { - if (geometry4) { - decoderModule.destroy(geometry4); - } - if (buffer48) { - decoderModule.destroy(buffer48); - } - if (decoder) { - decoderModule.destroy(decoder); - } +}); + +// node_modules/@babylonjs/core/Materials/material.decalMap.js +var init_material_decalMap = __esm(() => { + init_standardMaterial_decalMap(); + init_pbrMaterial_decalMap(); + init_abstractMesh_decalMap(); +}); + +// node_modules/@babylonjs/core/Materials/index.js +var init_Materials = __esm(() => { + init_Background(); + init_colorCurves(); + init_iEffectFallbacks(); + init_effectFallbacks(); + init_effect(); + init_fresnelParameters(); + init_imageProcessingConfiguration(); + init_material(); + init_materialDefines(); + init_clipPlaneMaterialHelper(); + init_materialHelper(); + init_multiMaterial(); + init_Occlusion(); + init_PBR(); + init_pushMaterial(); + init_shaderLanguage(); + init_shaderMaterial(); + init_standardMaterial(); + init_Textures(); + init_uniformBuffer(); + init_materialFlags(); + init_Node(); + init_effectRenderer(); + init_shadowDepthWrapper(); + init_drawWrapper(); + init_materialPluginBase(); + init_materialPluginManager(); + init_materialPluginEvent(); + init_material_detailMapConfiguration(); + init_material_decalMapConfiguration(); + init_materialPluginFactoryExport(); + init_greasedLinePluginMaterial(); + init_greasedLineSimpleMaterial(); + init_greasedLineMaterialInterfaces(); + init_greasedLineMaterialDefaults(); + init_meshDebugPluginMaterial(); + init_material_decalMap(); +}); + +// node_modules/@babylonjs/core/Maths/math.polar.js +class Polar { + constructor(radius, theta) { + this.radius = radius; + this.theta = theta; } -}; -var worker = function() { - let decoderPromise; - onmessage = (event) => { - const message = event.data; - switch (message.id) { - case "init": { - const decoder = message.decoder; - if (decoder.url) { - importScripts(decoder.url); - decoderPromise = DracoDecoderModule({ wasmBinary: decoder.wasmBinary }); - } - postMessage({ id: "initDone" }); - break; - } - case "decodeMesh": { - if (!decoderPromise) { - throw new Error("Draco decoder module is not available"); - } - decoderPromise.then((decoder) => { - const numPoints = decodeMesh(decoder, message.dataView, message.attributes, (indices) => { - postMessage({ id: "indices", data: indices }, [indices.buffer]); - }, (kind, data, size, offset, stride, normalized) => { - postMessage({ id: "attribute", kind, data, size, byteOffset: offset, byteStride: stride, normalized }, [data.buffer]); - }); - postMessage({ id: "decodeMeshDone", totalVertices: numPoints }); - }); - break; - } - } - }; -}; + getClassName() { + return "Polar"; + } + toString() { + return JSON.stringify(this); + } + asArray() { + return [this.radius, this.theta]; + } + addToRef(polar, ref) { + ref.radius = this.radius + polar.radius; + ref.theta = this.theta + polar.theta; + return ref; + } + add(polar) { + const ref = new Polar(0, 0); + this.addToRef(polar, ref); + return ref; + } + addInPlace(polar) { + this.addToRef(polar, this); + return this; + } + addInPlaceFromFloats(radius, theta) { + this.radius += radius; + this.theta += theta; + return this; + } + subtractToRef(polar, ref) { + ref.radius = this.radius - polar.radius; + ref.theta = this.theta - polar.theta; + return ref; + } + subtract(polar) { + const ref = new Polar(0, 0); + this.subtractToRef(polar, ref); + return ref; + } + subtractInPlace(polar) { + this.subtractToRef(polar, this); + return this; + } + subtractFromFloatsToRef(radius, theta, ref) { + ref.radius = this.radius - radius; + ref.theta = this.theta - theta; + return ref; + } + subtractFromFloats(radius, theta) { + const ref = new Polar(0, 0); + this.subtractFromFloatsToRef(radius, theta, ref); + return ref; + } + multiplyToRef(polar, ref) { + ref.radius = this.radius * polar.radius; + ref.theta = this.theta * polar.theta; + return ref; + } + multiply(polar) { + const ref = new Polar(0, 0); + this.multiplyToRef(polar, ref); + return ref; + } + multiplyInPlace(polar) { + this.multiplyToRef(polar, this); + return this; + } + divideToRef(polar, ref) { + ref.radius = this.radius / polar.radius; + ref.theta = this.theta / polar.theta; + return ref; + } + divide(polar) { + const ref = new Polar(0, 0); + this.divideToRef(polar, ref); + return ref; + } + divideInPlace(polar) { + this.divideToRef(polar, this); + return this; + } + clone() { + return new Polar(this.radius, this.theta); + } + copyFrom(source) { + this.radius = source.radius; + this.theta = source.theta; + return this; + } + copyFromFloats(radius, theta) { + this.radius = radius; + this.theta = theta; + return this; + } + scaleToRef(scale, ref) { + ref.radius = this.radius * scale; + ref.theta = this.theta * scale; + return ref; + } + scale(scale) { + const ref = new Polar(0, 0); + this.scaleToRef(scale, ref); + return ref; + } + scaleInPlace(scale) { + this.scaleToRef(scale, this); + return this; + } + set(radius, theta) { + this.radius = radius; + this.theta = theta; + return this; + } + setAll(value) { + this.set(value, value); + return this; + } + toVector2ToRef(ref) { + const x = this.radius * Math.cos(this.theta); + const y = this.radius * Math.sin(this.theta); + ref.set(x, y); + return ref; + } + toVector2() { + const ref = new Vector2(0, 0); + return this.toVector2ToRef(ref); + } + static FromVector2ToRef(v, ref) { + const theta = Math.sign(v.y) * Math.acos(v.x / v.length()); + ref.radius = v.length(); + ref.theta = theta; + return ref; + } + static FromVector2(v) { + const polar = new Polar(0, 0); + Polar.FromVector2ToRef(v, polar); + return polar; + } + static FromArray(array) { + return new Polar(array[0], array[1]); + } +} +class Spherical { + constructor(radius, theta, phi) { + this.radius = radius; + this.theta = theta; + this.phi = phi; + } + getClassName() { + return "Spherical"; + } + toString() { + return JSON.stringify(this); + } + asArray() { + return [this.radius, this.theta, this.phi]; + } + addToRef(spherical, ref) { + ref.radius = this.radius + spherical.radius; + ref.theta = this.theta + spherical.theta; + ref.phi = this.phi + spherical.phi; + return ref; + } + add(spherical) { + const ref = new Spherical(0, 0, 0); + this.addToRef(spherical, ref); + return ref; + } + addInPlace(spherical) { + this.addToRef(spherical, this); + return this; + } + addInPlaceFromFloats(radius, theta, phi) { + this.radius += radius; + this.theta += theta; + this.phi += phi; + return this; + } + subtractToRef(spherical, ref) { + ref.radius = this.radius - spherical.radius; + ref.theta = this.theta - spherical.theta; + ref.phi = this.phi - spherical.phi; + return ref; + } + subtract(spherical) { + const ref = new Spherical(0, 0, 0); + this.subtractToRef(spherical, ref); + return ref; + } + subtractInPlace(spherical) { + this.subtractToRef(spherical, this); + return this; + } + subtractFromFloatsToRef(radius, theta, phi, ref) { + ref.radius = this.radius - radius; + ref.theta = this.theta - theta; + ref.phi = this.phi - phi; + return ref; + } + subtractFromFloats(radius, theta, phi) { + const ref = new Spherical(0, 0, 0); + this.subtractFromFloatsToRef(radius, theta, phi, ref); + return ref; + } + multiplyToRef(spherical, ref) { + ref.radius = this.radius * spherical.radius; + ref.theta = this.theta * spherical.theta; + ref.phi = this.phi * spherical.phi; + return ref; + } + multiply(spherical) { + const ref = new Spherical(0, 0, 0); + this.multiplyToRef(spherical, ref); + return ref; + } + multiplyInPlace(spherical) { + this.multiplyToRef(spherical, this); + return this; + } + divideToRef(spherical, ref) { + ref.radius = this.radius / spherical.radius; + ref.theta = this.theta / spherical.theta; + ref.phi = this.phi / spherical.phi; + return ref; + } + divide(spherical) { + const ref = new Spherical(0, 0, 0); + this.divideToRef(spherical, ref); + return ref; + } + divideInPlace(spherical) { + this.divideToRef(spherical, this); + return this; + } + clone() { + return new Spherical(this.radius, this.theta, this.phi); + } + copyFrom(source) { + this.radius = source.radius; + this.theta = source.theta; + this.phi = source.phi; + return this; + } + copyFromFloats(radius, theta, phi) { + this.radius = radius; + this.theta = theta; + this.phi = phi; + return this; + } + scaleToRef(scale, ref) { + ref.radius = this.radius * scale; + ref.theta = this.theta * scale; + ref.phi = this.phi * scale; + return ref; + } + scale(scale) { + const ref = new Spherical(0, 0, 0); + this.scaleToRef(scale, ref); + return ref; + } + scaleInPlace(scale) { + this.scaleToRef(scale, this); + return this; + } + set(radius, theta, phi) { + this.radius = radius; + this.theta = theta; + this.phi = phi; + return this; + } + setAll(value) { + this.set(value, value, value); + return this; + } + toVector3ToRef(ref) { + const x = this.radius * Math.sin(this.theta) * Math.cos(this.phi); + const y = this.radius * Math.cos(this.theta); + const z = this.radius * Math.sin(this.theta) * Math.sin(this.phi); + ref.set(x, y, z); + return ref; + } + toVector3() { + const ref = new Vector3(0, 0, 0); + return this.toVector3ToRef(ref); + } + static FromVector3ToRef(vector, ref) { + ref.radius = vector.length(); + ref.theta = Math.acos(vector.y / ref.radius); + ref.phi = Math.atan2(vector.z, vector.x); + return ref; + } + static FromVector3(vector) { + const spherical = new Spherical(0, 0, 0); + Spherical.FromVector3ToRef(vector, spherical); + return spherical; + } + static FromArray(array) { + return new Spherical(array[0], array[1], array[2]); + } +} +var init_math_polar = __esm(() => { + init_math_vector(); +}); + +// node_modules/@babylonjs/core/Maths/index.js +var init_Maths = __esm(() => { + init_math_scalar(); + init_math_functions(); + init_math_polar(); + init_math(); + init_sphericalPolynomial(); +}); + +// node_modules/@babylonjs/core/Meshes/buffer.js +var init_buffer2 = __esm(() => { + init_buffer(); +}); + +// node_modules/@babylonjs/core/Meshes/Compression/dracoCompression.js class DracoCompression { static get DecoderAvailable() { const decoder = DracoCompression.Configuration.decoder; @@ -137413,9 +149347,9 @@ class DracoCompression { } throw new Error("Draco decoder module is not available"); } - decodeMeshToGeometryAsync(name179, scene22, data, attributes) { + decodeMeshToGeometryAsync(name180, scene22, data, attributes) { return this._decodeMeshAsync(data, attributes).then((meshData) => { - const geometry4 = new Geometry(name179, scene22); + const geometry4 = new Geometry(name180, scene22); if (meshData.indices) { geometry4.setIndices(meshData.indices); } @@ -137425,9 +149359,9 @@ class DracoCompression { return geometry4; }); } - _decodeMeshToGeometryForGltfAsync(name179, scene22, data, attributes, gltfNormalizedOverride) { + _decodeMeshToGeometryForGltfAsync(name180, scene22, data, attributes, gltfNormalizedOverride) { return this._decodeMeshAsync(data, attributes, gltfNormalizedOverride).then((meshData) => { - const geometry4 = new Geometry(name179, scene22); + const geometry4 = new Geometry(name180, scene22); if (meshData.indices) { geometry4.setIndices(meshData.indices); } @@ -137451,15 +149385,173 @@ class DracoCompression { }); } } -DracoCompression.Configuration = { - decoder: { - wasmUrl: `${Tools._DefaultCdnUrl}/draco_wasm_wrapper_gltf.js`, - wasmBinaryUrl: `${Tools._DefaultCdnUrl}/draco_decoder_gltf.wasm`, - fallbackUrl: `${Tools._DefaultCdnUrl}/draco_decoder_gltf.js` - } -}; -DracoCompression.DefaultNumWorkers = DracoCompression.GetDefaultNumWorkers(); -DracoCompression._Default = null; +var createDecoderAsync, decodeMesh, worker; +var init_dracoCompression = __esm(() => { + init_tools(); + init_workerPool(); + init_geometry(); + init_buffer2(); + init_mesh_vertexData(); + init_logger(); + createDecoderAsync = function(wasmBinary) { + return new Promise((resolve) => { + DracoDecoderModule({ wasmBinary }).then((module) => { + resolve({ module }); + }); + }); + }; + decodeMesh = function(decoderModule, data, attributes, onIndicesData, onAttributeData) { + let decoder = null; + let buffer48 = null; + let geometry4 = null; + try { + decoder = new decoderModule.Decoder; + buffer48 = new decoderModule.DecoderBuffer; + buffer48.Init(data, data.byteLength); + let status; + const type = decoder.GetEncodedGeometryType(buffer48); + switch (type) { + case decoderModule.TRIANGULAR_MESH: { + const mesh48 = new decoderModule.Mesh; + status = decoder.DecodeBufferToMesh(buffer48, mesh48); + if (!status.ok() || mesh48.ptr === 0) { + throw new Error(status.error_msg()); + } + const numFaces = mesh48.num_faces(); + const numIndices = numFaces * 3; + const byteLength = numIndices * 4; + const ptr = decoderModule._malloc(byteLength); + try { + decoder.GetTrianglesUInt32Array(mesh48, byteLength, ptr); + const indices = new Uint32Array(numIndices); + indices.set(new Uint32Array(decoderModule.HEAPF32.buffer, ptr, numIndices)); + onIndicesData(indices); + } finally { + decoderModule._free(ptr); + } + geometry4 = mesh48; + break; + } + case decoderModule.POINT_CLOUD: { + const pointCloud = new decoderModule.PointCloud; + status = decoder.DecodeBufferToPointCloud(buffer48, pointCloud); + if (!status.ok() || !pointCloud.ptr) { + throw new Error(status.error_msg()); + } + geometry4 = pointCloud; + break; + } + default: { + throw new Error(`Invalid geometry type ${type}`); + } + } + const numPoints = geometry4.num_points(); + const processAttribute = (decoder2, geometry5, kind, attribute) => { + const dataType = attribute.data_type(); + const numComponents = attribute.num_components(); + const normalized = attribute.normalized(); + const byteStride = attribute.byte_stride(); + const byteOffset = attribute.byte_offset(); + const dataTypeInfo = { + [decoderModule.DT_FLOAT32]: { typedArrayConstructor: Float32Array, heap: decoderModule.HEAPF32 }, + [decoderModule.DT_INT8]: { typedArrayConstructor: Int8Array, heap: decoderModule.HEAP8 }, + [decoderModule.DT_INT16]: { typedArrayConstructor: Int16Array, heap: decoderModule.HEAP16 }, + [decoderModule.DT_INT32]: { typedArrayConstructor: Int32Array, heap: decoderModule.HEAP32 }, + [decoderModule.DT_UINT8]: { typedArrayConstructor: Uint8Array, heap: decoderModule.HEAPU8 }, + [decoderModule.DT_UINT16]: { typedArrayConstructor: Uint16Array, heap: decoderModule.HEAPU16 }, + [decoderModule.DT_UINT32]: { typedArrayConstructor: Uint32Array, heap: decoderModule.HEAPU32 } + }; + const info = dataTypeInfo[dataType]; + if (!info) { + throw new Error(`Invalid data type ${dataType}`); + } + const numValues = numPoints * numComponents; + const byteLength = numValues * info.typedArrayConstructor.BYTES_PER_ELEMENT; + const ptr = decoderModule._malloc(byteLength); + try { + decoder2.GetAttributeDataArrayForAllPoints(geometry5, attribute, dataType, byteLength, ptr); + const data2 = new info.typedArrayConstructor(info.heap.buffer, ptr, numValues); + onAttributeData(kind, data2.slice(), numComponents, byteOffset, byteStride, normalized); + } finally { + decoderModule._free(ptr); + } + }; + if (attributes) { + for (const kind in attributes) { + const id = attributes[kind]; + const attribute = decoder.GetAttributeByUniqueId(geometry4, id); + processAttribute(decoder, geometry4, kind, attribute); + } + } else { + const dracoAttributeTypes = { + position: decoderModule.POSITION, + normal: decoderModule.NORMAL, + color: decoderModule.COLOR, + uv: decoderModule.TEX_COORD + }; + for (const kind in dracoAttributeTypes) { + const id = decoder.GetAttributeId(geometry4, dracoAttributeTypes[kind]); + if (id !== -1) { + const attribute = decoder.GetAttribute(geometry4, id); + processAttribute(decoder, geometry4, kind, attribute); + } + } + } + return numPoints; + } finally { + if (geometry4) { + decoderModule.destroy(geometry4); + } + if (buffer48) { + decoderModule.destroy(buffer48); + } + if (decoder) { + decoderModule.destroy(decoder); + } + } + }; + worker = function() { + let decoderPromise; + onmessage = (event) => { + const message = event.data; + switch (message.id) { + case "init": { + const decoder = message.decoder; + if (decoder.url) { + importScripts(decoder.url); + decoderPromise = DracoDecoderModule({ wasmBinary: decoder.wasmBinary }); + } + postMessage({ id: "initDone" }); + break; + } + case "decodeMesh": { + if (!decoderPromise) { + throw new Error("Draco decoder module is not available"); + } + decoderPromise.then((decoder) => { + const numPoints = decodeMesh(decoder, message.dataView, message.attributes, (indices) => { + postMessage({ id: "indices", data: indices }, [indices.buffer]); + }, (kind, data, size, offset, stride, normalized) => { + postMessage({ id: "attribute", kind, data, size, byteOffset: offset, byteStride: stride, normalized }, [data.buffer]); + }); + postMessage({ id: "decodeMeshDone", totalVertices: numPoints }); + }); + break; + } + } + }; + }; + DracoCompression.Configuration = { + decoder: { + wasmUrl: `${Tools._DefaultCdnUrl}/draco_wasm_wrapper_gltf.js`, + wasmBinaryUrl: `${Tools._DefaultCdnUrl}/draco_decoder_gltf.wasm`, + fallbackUrl: `${Tools._DefaultCdnUrl}/draco_decoder_gltf.js` + } + }; + DracoCompression.DefaultNumWorkers = DracoCompression.GetDefaultNumWorkers(); + DracoCompression._Default = null; +}); + // node_modules/@babylonjs/core/Meshes/Compression/meshoptCompression.js class MeshoptCompression { static get Default() { @@ -137485,15 +149577,23 @@ class MeshoptCompression { }); } } -MeshoptCompression.Configuration = { - decoder: { - url: `${Tools._DefaultCdnUrl}/meshopt_decoder.js` - } -}; -MeshoptCompression._Default = null; -// node_modules/@babylonjs/core/Meshes/csg.js -var currentCSGMeshId = 0; +var init_meshoptCompression = __esm(() => { + init_tools(); + MeshoptCompression.Configuration = { + decoder: { + url: `${Tools._DefaultCdnUrl}/meshopt_decoder.js` + } + }; + MeshoptCompression._Default = null; +}); +// node_modules/@babylonjs/core/Meshes/Compression/index.js +var init_Compression = __esm(() => { + init_dracoCompression(); + init_meshoptCompression(); +}); + +// node_modules/@babylonjs/core/Meshes/csg.js class Vertex2 { constructor(pos, normal, uv, vertColor) { this.pos = pos; @@ -137596,7 +149696,6 @@ class CSGPlane { } } } -CSGPlane.EPSILON = 0.00001; class CSGPolygon { constructor(vertices, shared) { @@ -137992,8 +150091,8 @@ class CSG { result.indices = indices; return result; } - buildMeshGeometry(name179, scene22, keepSubMeshes) { - const mesh49 = new Mesh(name179, scene22); + buildMeshGeometry(name180, scene22, keepSubMeshes) { + const mesh49 = new Mesh(name180, scene22); const polygons = this._polygons; let currentIndex = 0; const subMeshDict = {}; @@ -138040,8 +150139,8 @@ class CSG { } return mesh49; } - toMesh(name179, material20 = null, scene22, keepSubMeshes) { - const mesh49 = this.buildMeshGeometry(name179, scene22, keepSubMeshes); + toMesh(name180, material20 = null, scene22, keepSubMeshes) { + const mesh49 = this.buildMeshGeometry(name180, scene22, keepSubMeshes); mesh49.material = material20; mesh49.position.copyFrom(this.position); mesh49.rotation.copyFrom(this.rotation); @@ -138053,9 +150152,34 @@ class CSG { return mesh49; } } +var currentCSGMeshId; +var init_csg = __esm(() => { + init_math_vector(); + init_buffer(); + init_subMesh(); + init_mesh(); + init_math_color(); + init_mesh_vertexData(); + currentCSGMeshId = 0; + CSGPlane.EPSILON = 0.00001; +}); + // node_modules/@babylonjs/core/Shaders/meshUVSpaceRenderer.vertex.js -var name179 = "meshUVSpaceRendererVertexShader"; -var shader179 = `precision highp float;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;uniform mat4 projMatrix;varying vec2 vDecalTC; +var name180, shader179; +var init_meshUVSpaceRenderer_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_morphTargetsVertexGlobalDeclaration(); + init_morphTargetsVertexDeclaration(); + init_instancesDeclaration(); + init_morphTargetsVertexGlobal(); + init_morphTargetsVertex(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + name180 = "meshUVSpaceRendererVertexShader"; + shader179 = `precision highp float;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;uniform mat4 projMatrix;varying vec2 vDecalTC; #include #include #include @@ -138077,49 +150201,260 @@ normWorldSM=transposeMat3(inverseMat3(normWorldSM)); vNormalW=normalize(normWorldSM*normalUpdated); #endif vec3 normalView=normalize((projMatrix*vec4(vNormalW,0.0)).xyz);vec3 decalTC=(projMatrix*worldPos).xyz;vDecalTC=decalTC.xy;gl_Position=vec4(uv*2.0-1.0,normalView.z>0.0 ? 2. : decalTC.z,1.0);}`; -ShaderStore.ShadersStore[name179] = shader179; + ShaderStore.ShadersStore[name180] = shader179; +}); // node_modules/@babylonjs/core/Shaders/meshUVSpaceRenderer.fragment.js -var name180 = "meshUVSpaceRendererPixelShader"; -var shader180 = `precision highp float;varying vec2 vDecalTC;uniform sampler2D textureSampler;void main(void) {if (vDecalTC.x<0. || vDecalTC.x>1. || vDecalTC.y<0. || vDecalTC.y>1.) {discard;} +var name181, shader180; +var init_meshUVSpaceRenderer_fragment = __esm(() => { + init_shaderStore(); + name181 = "meshUVSpaceRendererPixelShader"; + shader180 = `precision highp float;varying vec2 vDecalTC;uniform sampler2D textureSampler;void main(void) {if (vDecalTC.x<0. || vDecalTC.x>1. || vDecalTC.y<0. || vDecalTC.y>1.) {discard;} gl_FragColor=texture2D(textureSampler,vDecalTC);} `; -ShaderStore.ShadersStore[name180] = shader180; + ShaderStore.ShadersStore[name181] = shader180; +}); // node_modules/@babylonjs/core/Shaders/meshUVSpaceRendererMasker.vertex.js -var name181 = "meshUVSpaceRendererMaskerVertexShader"; -var shader181 = `attribute vec2 uv;varying vec2 vUV;void main(void) {gl_Position=vec4(vec2(uv.x,uv.y)*2.0-1.0,0.,1.0);vUV=uv;}`; -ShaderStore.ShadersStore[name181] = shader181; +var name182, shader181; +var init_meshUVSpaceRendererMasker_vertex = __esm(() => { + init_shaderStore(); + name182 = "meshUVSpaceRendererMaskerVertexShader"; + shader181 = `attribute vec2 uv;varying vec2 vUV;void main(void) {gl_Position=vec4(vec2(uv.x,uv.y)*2.0-1.0,0.,1.0);vUV=uv;}`; + ShaderStore.ShadersStore[name182] = shader181; +}); // node_modules/@babylonjs/core/Shaders/meshUVSpaceRendererMasker.fragment.js -var name182 = "meshUVSpaceRendererMaskerPixelShader"; -var shader182 = `varying vec2 vUV;void main(void) {gl_FragColor=vec4(1.0,1.0,1.0,1.0);} +var name183, shader182; +var init_meshUVSpaceRendererMasker_fragment = __esm(() => { + init_shaderStore(); + name183 = "meshUVSpaceRendererMaskerPixelShader"; + shader182 = `varying vec2 vUV;void main(void) {gl_FragColor=vec4(1.0,1.0,1.0,1.0);} `; -ShaderStore.ShadersStore[name182] = shader182; + ShaderStore.ShadersStore[name183] = shader182; +}); // node_modules/@babylonjs/core/Shaders/meshUVSpaceRendererFinaliser.fragment.js -var name183 = "meshUVSpaceRendererFinaliserPixelShader"; -var shader183 = `precision highp float;varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D maskTextureSampler;uniform vec2 textureSize;void main() {vec4 mask=texture2D(maskTextureSampler,vUV).rgba;if (mask.r>0.5) {gl_FragColor=texture2D(textureSampler,vUV);} else {vec2 texelSize=4.0/textureSize;vec2 uv_p01=vUV+vec2(-1.0,0.0)*texelSize;vec2 uv_p21=vUV+vec2(1.0,0.0)*texelSize;vec2 uv_p10=vUV+vec2(0.0,-1.0)*texelSize;vec2 uv_p12=vUV+vec2(0.0,1.0)*texelSize;float mask_p01=texture2D(maskTextureSampler,uv_p01).r;float mask_p21=texture2D(maskTextureSampler,uv_p21).r;float mask_p10=texture2D(maskTextureSampler,uv_p10).r;float mask_p12=texture2D(maskTextureSampler,uv_p12).r;vec4 col=vec4(0.0,0.0,0.0,0.0);float total_weight=0.0;if (mask_p01>0.5) {col+=texture2D(textureSampler,uv_p01);total_weight+=1.0;} +var name184, shader183; +var init_meshUVSpaceRendererFinaliser_fragment = __esm(() => { + init_shaderStore(); + name184 = "meshUVSpaceRendererFinaliserPixelShader"; + shader183 = `precision highp float;varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D maskTextureSampler;uniform vec2 textureSize;void main() {vec4 mask=texture2D(maskTextureSampler,vUV).rgba;if (mask.r>0.5) {gl_FragColor=texture2D(textureSampler,vUV);} else {vec2 texelSize=4.0/textureSize;vec2 uv_p01=vUV+vec2(-1.0,0.0)*texelSize;vec2 uv_p21=vUV+vec2(1.0,0.0)*texelSize;vec2 uv_p10=vUV+vec2(0.0,-1.0)*texelSize;vec2 uv_p12=vUV+vec2(0.0,1.0)*texelSize;float mask_p01=texture2D(maskTextureSampler,uv_p01).r;float mask_p21=texture2D(maskTextureSampler,uv_p21).r;float mask_p10=texture2D(maskTextureSampler,uv_p10).r;float mask_p12=texture2D(maskTextureSampler,uv_p12).r;vec4 col=vec4(0.0,0.0,0.0,0.0);float total_weight=0.0;if (mask_p01>0.5) {col+=texture2D(textureSampler,uv_p01);total_weight+=1.0;} if (mask_p21>0.5) {col+=texture2D(textureSampler,uv_p21);total_weight+=1.0;} if (mask_p10>0.5) {col+=texture2D(textureSampler,uv_p10);total_weight+=1.0;} if (mask_p12>0.5) {col+=texture2D(textureSampler,uv_p12);total_weight+=1.0;} if (total_weight>0.0) {gl_FragColor=col/total_weight;} else {gl_FragColor=col;}}} `; -ShaderStore.ShadersStore[name183] = shader183; + ShaderStore.ShadersStore[name184] = shader183; +}); // node_modules/@babylonjs/core/Shaders/meshUVSpaceRendererFinaliser.vertex.js -var name184 = "meshUVSpaceRendererFinaliserVertexShader"; -var shader184 = `precision highp float;attribute vec3 position;attribute vec2 uv;uniform mat4 worldViewProjection;varying vec2 vUV;void main() {gl_Position=worldViewProjection*vec4(position,1.0);vUV=uv;} +var name185, shader184; +var init_meshUVSpaceRendererFinaliser_vertex = __esm(() => { + init_shaderStore(); + name185 = "meshUVSpaceRendererFinaliserVertexShader"; + shader184 = `precision highp float;attribute vec3 position;attribute vec2 uv;uniform mat4 worldViewProjection;varying vec2 vUV;void main() {gl_Position=worldViewProjection*vec4(position,1.0);vUV=uv;} `; -ShaderStore.ShadersStore[name184] = shader184; -// node_modules/@babylonjs/core/Meshes/trailMesh.js -Mesh._TrailMeshParser = (parsedMesh, scene22) => { - return TrailMesh.Parse(parsedMesh, scene22); -}; + ShaderStore.ShadersStore[name185] = shader184; +}); + +// node_modules/@babylonjs/core/Meshes/meshUVSpaceRenderer.js +class MeshUVSpaceRenderer { + static _GetShader(scene22) { + if (!scene22._meshUVSpaceRendererShader) { + const shader185 = new ShaderMaterial("meshUVSpaceRendererShader", scene22, { + vertex: "meshUVSpaceRenderer", + fragment: "meshUVSpaceRenderer" + }, { + attributes: ["position", "normal", "uv"], + uniforms: ["world", "projMatrix"], + samplers: ["textureSampler"], + needAlphaBlending: true + }); + shader185.backFaceCulling = false; + shader185.alphaMode = 2; + scene22.onDisposeObservable.add(() => { + var _a; + (_a = scene22._meshUVSpaceRendererShader) === null || _a === undefined || _a.dispose(); + scene22._meshUVSpaceRendererShader = null; + }); + scene22._meshUVSpaceRendererShader = shader185; + } + return scene22._meshUVSpaceRendererShader; + } + static _GetMaskShader(scene22) { + if (!scene22._meshUVSpaceRendererMaskShader) { + const shader185 = new ShaderMaterial("meshUVSpaceRendererMaskShader", scene22, { + vertex: "meshUVSpaceRendererMasker", + fragment: "meshUVSpaceRendererMasker" + }, { + attributes: ["position", "uv"], + uniforms: ["worldViewProjection"] + }); + shader185.backFaceCulling = false; + shader185.alphaMode = 2; + scene22.onDisposeObservable.add(() => { + var _a; + (_a = scene22._meshUVSpaceRendererMaskShader) === null || _a === undefined || _a.dispose(); + scene22._meshUVSpaceRendererMaskShader = null; + }); + scene22._meshUVSpaceRendererMaskShader = shader185; + } + return scene22._meshUVSpaceRendererMaskShader; + } + static _IsRenderTargetTexture(texture51) { + return texture51.renderList !== undefined; + } + constructor(mesh49, scene22, options) { + this._textureCreatedInternally = false; + this._configureUserCreatedTexture = true; + this._maskTexture = null; + this._finalPostProcess = null; + this.clearColor = new Color4(0, 0, 0, 0); + this._mesh = mesh49; + this._scene = scene22; + this._options = Object.assign({ width: 1024, height: 1024, textureType: 0, generateMipMaps: true, optimizeUVAllocation: true, uvEdgeBlending: false }, options); + } + isReady() { + var _a, _b, _c, _d; + if (!this.texture) { + this._createDiffuseRTT(); + } + const textureIsReady = MeshUVSpaceRenderer._IsRenderTargetTexture(this.texture) ? this.texture.isReadyForRendering() : this.texture.isReady(); + const maskIsReady = (_b = (_a = this._maskTexture) === null || _a === undefined ? undefined : _a.isReadyForRendering()) !== null && _b !== undefined ? _b : true; + const postProcessIsReady = (_d = (_c = this._finalPostProcess) === null || _c === undefined ? undefined : _c.isReady()) !== null && _d !== undefined ? _d : true; + return textureIsReady && maskIsReady && postProcessIsReady; + } + renderTexture(texture51, position, normal, size, angle = 0) { + if (!this.texture) { + this._createDiffuseRTT(); + } else if (this._configureUserCreatedTexture) { + this._configureUserCreatedRTT(); + } + if (MeshUVSpaceRenderer._IsRenderTargetTexture(this.texture)) { + const matrix = this._createProjectionMatrix(position, normal, size, angle); + const shader185 = MeshUVSpaceRenderer._GetShader(this._scene); + shader185.setTexture("textureSampler", texture51); + shader185.setMatrix("projMatrix", matrix); + this.texture.render(); + } + } + clear() { + var _a, _b, _c; + if (MeshUVSpaceRenderer._IsRenderTargetTexture(this.texture) && this.texture.renderTarget) { + const engine42 = this._scene.getEngine(); + engine42.bindFramebuffer(this.texture.renderTarget); + engine42.clear(this.clearColor, true, true, true); + engine42.unBindFramebuffer(this.texture.renderTarget); + } + if ((_a = this._finalPostProcess) === null || _a === undefined ? undefined : _a.inputTexture) { + const engine42 = this._scene.getEngine(); + engine42.bindFramebuffer((_b = this._finalPostProcess) === null || _b === undefined ? undefined : _b.inputTexture); + engine42.clear(this.clearColor, true, true, true); + engine42.unBindFramebuffer((_c = this._finalPostProcess) === null || _c === undefined ? undefined : _c.inputTexture); + } + } + dispose() { + var _a, _b; + if (this._textureCreatedInternally) { + this.texture.dispose(); + this._textureCreatedInternally = false; + } + this._configureUserCreatedTexture = true; + (_a = this._maskTexture) === null || _a === undefined || _a.dispose(); + this._maskTexture = null; + (_b = this._finalPostProcess) === null || _b === undefined || _b.dispose(); + this._finalPostProcess = null; + } + _configureUserCreatedRTT() { + this._configureUserCreatedTexture = false; + if (MeshUVSpaceRenderer._IsRenderTargetTexture(this.texture)) { + this.texture.setMaterialForRendering(this._mesh, MeshUVSpaceRenderer._GetShader(this._scene)); + this.texture.onClearObservable.add(() => { + }); + this.texture.renderList = [this._mesh]; + if (this._options.uvEdgeBlending) { + this._createMaskTexture(); + this._createPostProcess(); + this.texture.addPostProcess(this._finalPostProcess); + } + } + } + _createDiffuseRTT() { + this._textureCreatedInternally = true; + const texture51 = this._createRenderTargetTexture(this._options.width, this._options.height); + texture51.setMaterialForRendering(this._mesh, MeshUVSpaceRenderer._GetShader(this._scene)); + this.texture = texture51; + this._configureUserCreatedTexture = false; + if (this._options.uvEdgeBlending) { + this._createMaskTexture(); + this._createPostProcess(); + texture51.addPostProcess(this._finalPostProcess); + } + } + _createMaskTexture() { + if (this._maskTexture) { + return; + } + this._maskTexture = new RenderTargetTexture(this._mesh.name + "_maskTexture", { width: this._options.width, height: this._options.height }, this._scene, false, true, 0, false, 2, undefined, undefined, undefined, 6); + this._maskTexture.clearColor = new Color4(0, 0, 0, 0); + this._maskTexture.renderList.push(this._mesh); + this._maskTexture.setMaterialForRendering(this._mesh, MeshUVSpaceRenderer._GetMaskShader(this._scene)); + this._maskTexture.refreshRate = RenderTargetTexture.REFRESHRATE_RENDER_ONCE; + this._scene.customRenderTargets.push(this._maskTexture); + } + _createPostProcess() { + if (this._finalPostProcess) { + return; + } + this._finalPostProcess = new PostProcess(this._mesh.name + "_fixSeamsPostProcess", "meshUVSpaceRendererFinaliser", ["textureSize"], ["textureSampler", "maskTextureSampler"], 1, null, 1, this._scene.getEngine(), false, null, this._options.textureType); + this._finalPostProcess.onApplyObservable.add((effect13) => { + effect13.setTexture("maskTextureSampler", this._maskTexture); + effect13.setFloat2("textureSize", this._options.width, this._options.height); + }); + } + _createRenderTargetTexture(width, height) { + const rtt = new RenderTargetTexture(this._mesh.name + "_uvspaceTexture", { width, height }, this._scene, this._options.generateMipMaps, true, this._options.textureType, false, this._options.generateMipMaps ? 3 : 2, false, false, false, 5); + rtt.renderParticles = false; + rtt.optimizeUVAllocation = !!this._options.optimizeUVAllocation; + rtt.onClearObservable.addOnce(() => { + this._scene.getEngine().clear(this.clearColor, true, true, true); + rtt.onClearObservable.add(() => { + }); + }); + rtt.renderList = [this._mesh]; + return rtt; + } + _createProjectionMatrix(position, normal, size, angle = 0) { + const yaw = -Math.atan2(normal.z, normal.x) - Math.PI / 2; + const len = Math.sqrt(normal.x * normal.x + normal.z * normal.z); + const pitch = Math.atan2(normal.y, len); + const p = position.add(normal.scale(size.z * 0.5)); + const projWorldMatrix = Matrix.RotationYawPitchRoll(yaw, pitch, angle).multiply(Matrix.Translation(p.x, p.y, p.z)); + const inverseProjWorldMatrix = Matrix.Invert(projWorldMatrix); + const projMatrix = Matrix.FromArray([2 / size.x, 0, 0, 0, 0, 2 / size.y, 0, 0, 0, 0, 1 / size.z, 0, 0, 0, 0, 1]); + const screenMatrix = Matrix.FromArray([0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 1, 0, 0.5, 0.5, 0, 1]); + return inverseProjWorldMatrix.multiply(projMatrix).multiply(screenMatrix); + } +} +var init_meshUVSpaceRenderer = __esm(() => { + init_math_vector(); + init_shaderMaterial(); + init_renderTargetTexture(); + init_math_color(); + init_postProcess(); + init_meshUVSpaceRenderer_vertex(); + init_meshUVSpaceRenderer_fragment(); + init_meshUVSpaceRendererMasker_vertex(); + init_meshUVSpaceRendererMasker_fragment(); + init_meshUVSpaceRendererFinaliser_fragment(); + init_meshUVSpaceRendererFinaliser_vertex(); +}); +// node_modules/@babylonjs/core/Meshes/trailMesh.js class TrailMesh extends Mesh { - constructor(name185, generator, scene22, diameter = 1, length = 60, autoStart = true) { - super(name185, scene22); + constructor(name186, generator, scene22, diameter = 1, length = 60, autoStart = true) { + super(name186, scene22); this._sectionPolygonPointsCount = 4; this._running = false; this._autoStart = autoStart; @@ -138218,8 +150553,8 @@ class TrailMesh extends Mesh { this.updateVerticesData(VertexBuffer.NormalKind, normals, true, false); } } - clone(name185 = "", newGenerator) { - return new TrailMesh(name185, newGenerator === undefined ? this._generator : newGenerator, this.getScene(), this.diameter, this._length, this._autoStart); + clone(name186 = "", newGenerator) { + return new TrailMesh(name186, newGenerator === undefined ? this._generator : newGenerator, this.getScene(), this.diameter, this._length, this._autoStart); } serialize(serializationObject) { super.serialize(serializationObject); @@ -138234,7 +150569,26 @@ class TrailMesh extends Mesh { return new TrailMesh(parsedMesh.name, generator, scene22, (_b = parsedMesh.diameter) !== null && _b !== undefined ? _b : parsedMesh._diameter, parsedMesh._length, parsedMesh._autoStart); } } +var init_trailMesh = __esm(() => { + init_abstractMesh(); + init_mesh(); + init_math_vector(); + init_buffer(); + init_mesh_vertexData(); + Mesh._TrailMeshParser = (parsedMesh, scene22) => { + return TrailMesh.Parse(parsedMesh, scene22); + }; +}); + // node_modules/@babylonjs/core/Meshes/meshSimplification.js +class SimplificationSettings { + constructor(quality, distance, optimizeMesh) { + this.quality = quality; + this.distance = distance; + this.optimizeMesh = optimizeMesh; + } +} + class SimplificationQueue { constructor() { this.running = false; @@ -138298,10 +150652,6 @@ class SimplificationQueue { } } } -var SimplificationType; -(function(SimplificationType2) { - SimplificationType2[SimplificationType2["QUADRATIC"] = 0] = "QUADRATIC"; -})(SimplificationType || (SimplificationType = {})); class DecimationTriangle { constructor(_vertices) { @@ -138834,36 +151184,20 @@ class QuadraticErrorSimplification { return error5; } } -// node_modules/@babylonjs/core/Meshes/meshSimplificationSceneComponent.js -Object.defineProperty(Scene.prototype, "simplificationQueue", { - get: function() { - if (!this._simplificationQueue) { - this._simplificationQueue = new SimplificationQueue; - let component = this._getComponent(SceneComponentConstants.NAME_SIMPLIFICATIONQUEUE); - if (!component) { - component = new SimplicationQueueSceneComponent(this); - this._addComponent(component); - } - } - return this._simplificationQueue; - }, - set: function(value) { - this._simplificationQueue = value; - }, - enumerable: true, - configurable: true -}); -Mesh.prototype.simplify = function(settings, parallelProcessing = true, simplificationType = SimplificationType.QUADRATIC, successCallback) { - this.getScene().simplificationQueue.addTask({ - settings, - parallelProcessing, - mesh: this, - simplificationType, - successCallback - }); - return this; -}; +var SimplificationType; +var init_meshSimplification = __esm(() => { + init_math_vector(); + init_buffer(); + init_subMesh(); + init_mesh(); + init_tools(); + init_math_constants(); + (function(SimplificationType2) { + SimplificationType2[SimplificationType2["QUADRATIC"] = 0] = "QUADRATIC"; + })(SimplificationType || (SimplificationType = {})); +}); +// node_modules/@babylonjs/core/Meshes/meshSimplificationSceneComponent.js class SimplicationQueueSceneComponent { constructor(scene23) { this.name = SceneComponentConstants.NAME_SIMPLIFICATIONQUEUE; @@ -138882,31 +151216,47 @@ class SimplicationQueueSceneComponent { } } } -// node_modules/@babylonjs/core/Meshes/GreasedLine/greasedLineBaseMesh.js -var GreasedLineRibbonPointsMode; -(function(GreasedLineRibbonPointsMode2) { - GreasedLineRibbonPointsMode2[GreasedLineRibbonPointsMode2["POINTS_MODE_POINTS"] = 0] = "POINTS_MODE_POINTS"; - GreasedLineRibbonPointsMode2[GreasedLineRibbonPointsMode2["POINTS_MODE_PATHS"] = 1] = "POINTS_MODE_PATHS"; -})(GreasedLineRibbonPointsMode || (GreasedLineRibbonPointsMode = {})); -var GreasedLineRibbonFacesMode; -(function(GreasedLineRibbonFacesMode2) { - GreasedLineRibbonFacesMode2[GreasedLineRibbonFacesMode2["FACES_MODE_SINGLE_SIDED"] = 0] = "FACES_MODE_SINGLE_SIDED"; - GreasedLineRibbonFacesMode2[GreasedLineRibbonFacesMode2["FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING"] = 1] = "FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING"; - GreasedLineRibbonFacesMode2[GreasedLineRibbonFacesMode2["FACES_MODE_DOUBLE_SIDED"] = 2] = "FACES_MODE_DOUBLE_SIDED"; -})(GreasedLineRibbonFacesMode || (GreasedLineRibbonFacesMode = {})); -var GreasedLineRibbonAutoDirectionMode; -(function(GreasedLineRibbonAutoDirectionMode2) { - GreasedLineRibbonAutoDirectionMode2[GreasedLineRibbonAutoDirectionMode2["AUTO_DIRECTIONS_FROM_FIRST_SEGMENT"] = 0] = "AUTO_DIRECTIONS_FROM_FIRST_SEGMENT"; - GreasedLineRibbonAutoDirectionMode2[GreasedLineRibbonAutoDirectionMode2["AUTO_DIRECTIONS_FROM_ALL_SEGMENTS"] = 1] = "AUTO_DIRECTIONS_FROM_ALL_SEGMENTS"; - GreasedLineRibbonAutoDirectionMode2[GreasedLineRibbonAutoDirectionMode2["AUTO_DIRECTIONS_ENHANCED"] = 2] = "AUTO_DIRECTIONS_ENHANCED"; - GreasedLineRibbonAutoDirectionMode2[GreasedLineRibbonAutoDirectionMode2["AUTO_DIRECTIONS_NONE"] = 99] = "AUTO_DIRECTIONS_NONE"; -})(GreasedLineRibbonAutoDirectionMode || (GreasedLineRibbonAutoDirectionMode = {})); +var init_meshSimplificationSceneComponent = __esm(() => { + init_scene(); + init_mesh(); + init_meshSimplification(); + init_sceneComponent(); + Object.defineProperty(Scene.prototype, "simplificationQueue", { + get: function() { + if (!this._simplificationQueue) { + this._simplificationQueue = new SimplificationQueue; + let component = this._getComponent(SceneComponentConstants.NAME_SIMPLIFICATIONQUEUE); + if (!component) { + component = new SimplicationQueueSceneComponent(this); + this._addComponent(component); + } + } + return this._simplificationQueue; + }, + set: function(value) { + this._simplificationQueue = value; + }, + enumerable: true, + configurable: true + }); + Mesh.prototype.simplify = function(settings, parallelProcessing = true, simplificationType = SimplificationType.QUADRATIC, successCallback) { + this.getScene().simplificationQueue.addTask({ + settings, + parallelProcessing, + mesh: this, + simplificationType, + successCallback + }); + return this; + }; +}); +// node_modules/@babylonjs/core/Meshes/GreasedLine/greasedLineBaseMesh.js class GreasedLineBaseMesh extends Mesh { - constructor(name185, scene23, _options) { + constructor(name186, scene23, _options) { var _a, _b, _c, _d; - super(name185, scene23, null, null, false, false); - this.name = name185; + super(name186, scene23, null, null, false, false); + this.name = name186; this._options = _options; this._lazy = false; this._updatable = false; @@ -139051,16 +151401,36 @@ class GreasedLineBaseMesh extends Mesh { this._offsetsBuffer = offsetBuffer; } } +var GreasedLineRibbonPointsMode, GreasedLineRibbonFacesMode, GreasedLineRibbonAutoDirectionMode; +var init_greasedLineBaseMesh = __esm(() => { + init_greasedLinePluginMaterial(); + init_mesh(); + init_buffer(); + init_mesh_vertexData(); + init_deepCopier(); + init_greasedLineSimpleMaterial(); + (function(GreasedLineRibbonPointsMode2) { + GreasedLineRibbonPointsMode2[GreasedLineRibbonPointsMode2["POINTS_MODE_POINTS"] = 0] = "POINTS_MODE_POINTS"; + GreasedLineRibbonPointsMode2[GreasedLineRibbonPointsMode2["POINTS_MODE_PATHS"] = 1] = "POINTS_MODE_PATHS"; + })(GreasedLineRibbonPointsMode || (GreasedLineRibbonPointsMode = {})); + (function(GreasedLineRibbonFacesMode2) { + GreasedLineRibbonFacesMode2[GreasedLineRibbonFacesMode2["FACES_MODE_SINGLE_SIDED"] = 0] = "FACES_MODE_SINGLE_SIDED"; + GreasedLineRibbonFacesMode2[GreasedLineRibbonFacesMode2["FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING"] = 1] = "FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING"; + GreasedLineRibbonFacesMode2[GreasedLineRibbonFacesMode2["FACES_MODE_DOUBLE_SIDED"] = 2] = "FACES_MODE_DOUBLE_SIDED"; + })(GreasedLineRibbonFacesMode || (GreasedLineRibbonFacesMode = {})); + (function(GreasedLineRibbonAutoDirectionMode2) { + GreasedLineRibbonAutoDirectionMode2[GreasedLineRibbonAutoDirectionMode2["AUTO_DIRECTIONS_FROM_FIRST_SEGMENT"] = 0] = "AUTO_DIRECTIONS_FROM_FIRST_SEGMENT"; + GreasedLineRibbonAutoDirectionMode2[GreasedLineRibbonAutoDirectionMode2["AUTO_DIRECTIONS_FROM_ALL_SEGMENTS"] = 1] = "AUTO_DIRECTIONS_FROM_ALL_SEGMENTS"; + GreasedLineRibbonAutoDirectionMode2[GreasedLineRibbonAutoDirectionMode2["AUTO_DIRECTIONS_ENHANCED"] = 2] = "AUTO_DIRECTIONS_ENHANCED"; + GreasedLineRibbonAutoDirectionMode2[GreasedLineRibbonAutoDirectionMode2["AUTO_DIRECTIONS_NONE"] = 99] = "AUTO_DIRECTIONS_NONE"; + })(GreasedLineRibbonAutoDirectionMode || (GreasedLineRibbonAutoDirectionMode = {})); +}); // node_modules/@babylonjs/core/Meshes/GreasedLine/greasedLineMesh.js -Mesh._GreasedLineMeshParser = (parsedMesh, scene23) => { - return GreasedLineMesh.Parse(parsedMesh, scene23); -}; - class GreasedLineMesh extends GreasedLineBaseMesh { - constructor(name185, scene23, _options) { - super(name185, scene23, _options); - this.name = name185; + constructor(name186, scene23, _options) { + super(name186, scene23, _options); + this.name = name186; this.intersectionThreshold = 0.1; this._previousAndSide = []; this._nextAndCounters = []; @@ -139141,11 +151511,11 @@ class GreasedLineMesh extends GreasedLineBaseMesh { this.refreshBoundingInfo(); } } - clone(name185 = `${this.name}-cloned`, newParent) { + clone(name186 = `${this.name}-cloned`, newParent) { const lineOptions = this._createLineOptions(); const deepCopiedLineOptions = {}; DeepCopier.DeepCopy(lineOptions, deepCopiedLineOptions, ["instance"], undefined, true); - const cloned = new GreasedLineMesh(name185, this._scene, deepCopiedLineOptions); + const cloned = new GreasedLineMesh(name186, this._scene, deepCopiedLineOptions); if (newParent) { cloned.parent = newParent; } @@ -139159,8 +151529,8 @@ class GreasedLineMesh extends GreasedLineBaseMesh { } static Parse(parsedMesh, scene23) { const lineOptions = parsedMesh.lineOptions; - const name185 = parsedMesh.name; - const result = new GreasedLineMesh(name185, scene23, lineOptions); + const name186 = parsedMesh.name; + const result = new GreasedLineMesh(name186, scene23, lineOptions); return result; } _initGreasedLine() { @@ -139292,21 +151662,29 @@ class GreasedLineMesh extends GreasedLineBaseMesh { return vertexData; } } -GreasedLineMesh._V_START = new Vector3; -GreasedLineMesh._V_END = new Vector3; -GreasedLineMesh._V_OFFSET_START = new Vector3; -GreasedLineMesh._V_OFFSET_END = new Vector3; +var init_greasedLineMesh = __esm(() => { + init_math_vector(); + init_mesh(); + init_buffer(); + init_pickingInfo(); + init_deepCopier(); + init_greasedLineTools(); + init_greasedLineBaseMesh(); + Mesh._GreasedLineMeshParser = (parsedMesh, scene23) => { + return GreasedLineMesh.Parse(parsedMesh, scene23); + }; + GreasedLineMesh._V_START = new Vector3; + GreasedLineMesh._V_END = new Vector3; + GreasedLineMesh._V_OFFSET_START = new Vector3; + GreasedLineMesh._V_OFFSET_END = new Vector3; +}); // node_modules/@babylonjs/core/Meshes/GreasedLine/greasedLineRibbonMesh.js -Mesh._GreasedLineRibbonMeshParser = (parsedMesh, scene23) => { - return GreasedLineRibbonMesh.Parse(parsedMesh, scene23); -}; - class GreasedLineRibbonMesh extends GreasedLineBaseMesh { - constructor(name185, scene23, _options, _pathOptions) { + constructor(name186, scene23, _options, _pathOptions) { var _a; - super(name185, scene23, _options); - this.name = name185; + super(name186, scene23, _options); + this.name = name186; if (!_options.ribbonOptions) { throw "'GreasedLineMeshOptions.ribbonOptions' is not set."; } @@ -139577,13 +151955,13 @@ class GreasedLineRibbonMesh extends GreasedLineBaseMesh { } return GreasedLineRibbonMesh.DIRECTION_XZ; } - clone(name185 = `${this.name}-cloned`, newParent) { + clone(name186 = `${this.name}-cloned`, newParent) { const lineOptions = this._createLineOptions(); const deepCopiedLineOptions = {}; const pathOptionsCloned = []; DeepCopier.DeepCopy(this._pathsOptions, pathOptionsCloned, undefined, undefined, true); DeepCopier.DeepCopy(lineOptions, deepCopiedLineOptions, ["instance"], undefined, true); - const cloned = new GreasedLineRibbonMesh(name185, this._scene, deepCopiedLineOptions, pathOptionsCloned); + const cloned = new GreasedLineRibbonMesh(name186, this._scene, deepCopiedLineOptions, pathOptionsCloned); if (newParent) { cloned.parent = newParent; } @@ -139598,9 +151976,9 @@ class GreasedLineRibbonMesh extends GreasedLineBaseMesh { } static Parse(parsedMesh, scene23) { const lineOptions = parsedMesh.lineOptions; - const name185 = parsedMesh.name; + const name186 = parsedMesh.name; const pathOptions = parsedMesh.pathOptions; - const result = new GreasedLineRibbonMesh(name185, scene23, lineOptions, pathOptions); + const result = new GreasedLineRibbonMesh(name186, scene23, lineOptions, pathOptions); return result; } _initGreasedLine() { @@ -139675,335 +152053,634 @@ class GreasedLineRibbonMesh extends GreasedLineBaseMesh { return vertexData; } } -GreasedLineRibbonMesh.DEFAULT_WIDTH = 0.1; -GreasedLineRibbonMesh._RightHandedForwardReadOnlyQuaternion = Quaternion.RotationAxis(Vector3.RightHandedForwardReadOnly, Math.PI / 2); -GreasedLineRibbonMesh._LeftHandedForwardReadOnlyQuaternion = Quaternion.RotationAxis(Vector3.LeftHandedForwardReadOnly, Math.PI / 2); -GreasedLineRibbonMesh._LeftReadOnlyQuaternion = Quaternion.RotationAxis(Vector3.LeftReadOnly, Math.PI / 2); -GreasedLineRibbonMesh.DIRECTION_XY = Vector3.LeftHandedForwardReadOnly; -GreasedLineRibbonMesh.DIRECTION_XZ = Vector3.UpReadOnly; -GreasedLineRibbonMesh.DIRECTION_YZ = Vector3.LeftReadOnly; +var init_greasedLineRibbonMesh = __esm(() => { + init_math_vector(); + init_mesh(); + init_buffer(); + init_deepCopier(); + init_greasedLineTools(); + init_greasedLineBaseMesh(); + Mesh._GreasedLineRibbonMeshParser = (parsedMesh, scene23) => { + return GreasedLineRibbonMesh.Parse(parsedMesh, scene23); + }; + GreasedLineRibbonMesh.DEFAULT_WIDTH = 0.1; + GreasedLineRibbonMesh._RightHandedForwardReadOnlyQuaternion = Quaternion.RotationAxis(Vector3.RightHandedForwardReadOnly, Math.PI / 2); + GreasedLineRibbonMesh._LeftHandedForwardReadOnlyQuaternion = Quaternion.RotationAxis(Vector3.LeftHandedForwardReadOnly, Math.PI / 2); + GreasedLineRibbonMesh._LeftReadOnlyQuaternion = Quaternion.RotationAxis(Vector3.LeftReadOnly, Math.PI / 2); + GreasedLineRibbonMesh.DIRECTION_XY = Vector3.LeftHandedForwardReadOnly; + GreasedLineRibbonMesh.DIRECTION_XZ = Vector3.UpReadOnly; + GreasedLineRibbonMesh.DIRECTION_YZ = Vector3.LeftReadOnly; +}); // node_modules/@babylonjs/core/Meshes/Builders/greasedLineBuilder.js -var GreasedLineMeshColorDistribution; -(function(GreasedLineMeshColorDistribution2) { - GreasedLineMeshColorDistribution2[GreasedLineMeshColorDistribution2["COLOR_DISTRIBUTION_NONE"] = 0] = "COLOR_DISTRIBUTION_NONE"; - GreasedLineMeshColorDistribution2[GreasedLineMeshColorDistribution2["COLOR_DISTRIBUTION_REPEAT"] = 1] = "COLOR_DISTRIBUTION_REPEAT"; - GreasedLineMeshColorDistribution2[GreasedLineMeshColorDistribution2["COLOR_DISTRIBUTION_EVEN"] = 2] = "COLOR_DISTRIBUTION_EVEN"; - GreasedLineMeshColorDistribution2[GreasedLineMeshColorDistribution2["COLOR_DISTRIBUTION_START"] = 3] = "COLOR_DISTRIBUTION_START"; - GreasedLineMeshColorDistribution2[GreasedLineMeshColorDistribution2["COLOR_DISTRIBUTION_END"] = 4] = "COLOR_DISTRIBUTION_END"; - GreasedLineMeshColorDistribution2[GreasedLineMeshColorDistribution2["COLOR_DISTRIBUTION_START_END"] = 5] = "COLOR_DISTRIBUTION_START_END"; -})(GreasedLineMeshColorDistribution || (GreasedLineMeshColorDistribution = {})); -var GreasedLineMeshWidthDistribution; -(function(GreasedLineMeshWidthDistribution2) { - GreasedLineMeshWidthDistribution2[GreasedLineMeshWidthDistribution2["WIDTH_DISTRIBUTION_NONE"] = 0] = "WIDTH_DISTRIBUTION_NONE"; - GreasedLineMeshWidthDistribution2[GreasedLineMeshWidthDistribution2["WIDTH_DISTRIBUTION_REPEAT"] = 1] = "WIDTH_DISTRIBUTION_REPEAT"; - GreasedLineMeshWidthDistribution2[GreasedLineMeshWidthDistribution2["WIDTH_DISTRIBUTION_EVEN"] = 2] = "WIDTH_DISTRIBUTION_EVEN"; - GreasedLineMeshWidthDistribution2[GreasedLineMeshWidthDistribution2["WIDTH_DISTRIBUTION_START"] = 3] = "WIDTH_DISTRIBUTION_START"; - GreasedLineMeshWidthDistribution2[GreasedLineMeshWidthDistribution2["WIDTH_DISTRIBUTION_END"] = 4] = "WIDTH_DISTRIBUTION_END"; - GreasedLineMeshWidthDistribution2[GreasedLineMeshWidthDistribution2["WIDTH_DISTRIBUTION_START_END"] = 5] = "WIDTH_DISTRIBUTION_START_END"; -})(GreasedLineMeshWidthDistribution || (GreasedLineMeshWidthDistribution = {})); -// node_modules/@babylonjs/core/Meshes/thinInstanceMesh.js -Mesh.prototype.thinInstanceAdd = function(matrix, refresh = true) { - if (!this.getScene().getEngine().getCaps().instancedArrays) { - Logger.Error("Thin Instances are not supported on this device as Instanced Array extension not supported"); - return -1; +function CreateGreasedLineMaterial(name186, options, scene23) { + scene23 = scene23 !== null && scene23 !== undefined ? scene23 : EngineStore.LastCreatedScene; + let material20; + switch (options.materialType) { + case GreasedLineMeshMaterialType.MATERIAL_TYPE_PBR: + material20 = new PBRMaterial(name186, scene23); + new GreasedLinePluginMaterial(material20, scene23, options); + break; + case GreasedLineMeshMaterialType.MATERIAL_TYPE_SIMPLE: + material20 = new GreasedLineSimpleMaterial(name186, scene23, options); + break; + default: + material20 = new StandardMaterial(name186, scene23); + new GreasedLinePluginMaterial(material20, scene23, options); + break; } - this._thinInstanceUpdateBufferSize("matrix", Array.isArray(matrix) ? matrix.length : 1); - const index = this._thinInstanceDataStorage.instancesCount; - if (Array.isArray(matrix)) { - for (let i = 0;i < matrix.length; ++i) { - this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, matrix[i], i === matrix.length - 1 && refresh); + return material20; +} +function CreateGreasedLine(name186, options, materialOptions, scene23) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; + scene23 = scene23 !== null && scene23 !== undefined ? scene23 : EngineStore.LastCreatedScene; + let instance; + const allPoints = GreasedLineTools.ConvertPoints(options.points); + options.widthDistribution = (_a = options.widthDistribution) !== null && _a !== undefined ? _a : GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START; + if (options.ribbonOptions) { + options.ribbonOptions.facesMode = (_b = options.ribbonOptions.facesMode) !== null && _b !== undefined ? _b : GreasedLineRibbonFacesMode.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING; + options.ribbonOptions.pointsMode = (_c = options.ribbonOptions.pointsMode) !== null && _c !== undefined ? _c : GreasedLineRibbonPointsMode.POINTS_MODE_POINTS; + options.ribbonOptions.directionsAutoMode = (_d = options.ribbonOptions.directionsAutoMode) !== null && _d !== undefined ? _d : options.ribbonOptions.directions ? GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_NONE : GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_FROM_FIRST_SEGMENT; + } + materialOptions = materialOptions !== null && materialOptions !== undefined ? materialOptions : { + color: GreasedLineMaterialDefaults.DEFAULT_COLOR + }; + materialOptions.createAndAssignMaterial = (_e = materialOptions.createAndAssignMaterial) !== null && _e !== undefined ? _e : true; + materialOptions.colorDistribution = (_f = materialOptions === null || materialOptions === undefined ? undefined : materialOptions.colorDistribution) !== null && _f !== undefined ? _f : GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START; + materialOptions.materialType = (_g = materialOptions.materialType) !== null && _g !== undefined ? _g : GreasedLineMeshMaterialType.MATERIAL_TYPE_STANDARD; + let length = 0; + if (Array.isArray(allPoints[0])) { + allPoints.forEach((points) => { + length += points.length / 3; + }); + } + const widths = CompleteGreasedLineWidthTable(length, (_h = options.widths) !== null && _h !== undefined ? _h : [], options.widthDistribution); + const colors = (materialOptions === null || materialOptions === undefined ? undefined : materialOptions.colors) ? CompleteGreasedLineColorTable(length, materialOptions.colors, materialOptions.colorDistribution, (_j = materialOptions.color) !== null && _j !== undefined ? _j : GreasedLineMaterialDefaults.DEFAULT_COLOR) : undefined; + const initialGreasedLineOptions = { + points: allPoints, + updatable: options.updatable, + widths, + lazy: options.lazy, + ribbonOptions: options.ribbonOptions, + uvs: options.uvs, + colorPointers: options.colorPointers + }; + if (initialGreasedLineOptions.ribbonOptions) { + if (initialGreasedLineOptions.ribbonOptions.pointsMode === GreasedLineRibbonPointsMode.POINTS_MODE_POINTS) { + initialGreasedLineOptions.ribbonOptions.width = (_l = (_k = materialOptions.width) !== null && _k !== undefined ? _k : initialGreasedLineOptions.ribbonOptions.width) !== null && _l !== undefined ? _l : GreasedLineMaterialDefaults.DEFAULT_WIDTH; + } + } + if (!options.instance) { + instance = initialGreasedLineOptions.ribbonOptions ? new GreasedLineRibbonMesh(name186, scene23, initialGreasedLineOptions) : new GreasedLineMesh(name186, scene23, initialGreasedLineOptions); + if (materialOptions) { + const initialMaterialOptions = { + materialType: materialOptions.materialType, + dashCount: materialOptions.dashCount, + dashOffset: materialOptions.dashOffset, + dashRatio: materialOptions.dashRatio, + resolution: materialOptions.resolution, + sizeAttenuation: materialOptions.sizeAttenuation, + useColors: materialOptions.useColors, + useDash: materialOptions.useDash, + visibility: materialOptions.visibility, + width: materialOptions.width, + color: materialOptions.color, + colorMode: materialOptions.colorMode, + colorsSampling: materialOptions.colorsSampling, + colorDistributionType: materialOptions.colorDistributionType, + colors, + cameraFacing: !options.ribbonOptions, + colorsTexture: materialOptions.colorsTexture + }; + if (materialOptions.createAndAssignMaterial) { + const material20 = CreateGreasedLineMaterial(name186, initialMaterialOptions, scene23); + instance.material = material20; + if (((_m = options.ribbonOptions) === null || _m === undefined ? undefined : _m.facesMode) === GreasedLineRibbonFacesMode.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING) { + material20.backFaceCulling = false; + } + } } } else { - this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, matrix, refresh); - } - return index; -}; -Mesh.prototype.thinInstanceAddSelf = function(refresh = true) { - return this.thinInstanceAdd(Matrix.IdentityReadOnly, refresh); -}; -Mesh.prototype.thinInstanceRegisterAttribute = function(kind, stride) { - if (kind === VertexBuffer.ColorKind) { - kind = VertexBuffer.ColorInstanceKind; - } - this.removeVerticesData(kind); - this._thinInstanceInitializeUserStorage(); - this._userThinInstanceBuffersStorage.strides[kind] = stride; - this._userThinInstanceBuffersStorage.sizes[kind] = stride * Math.max(32, this._thinInstanceDataStorage.instancesCount); - this._userThinInstanceBuffersStorage.data[kind] = new Float32Array(this._userThinInstanceBuffersStorage.sizes[kind]); - this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), this._userThinInstanceBuffersStorage.data[kind], kind, true, false, stride, true); - this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]); -}; -Mesh.prototype.thinInstanceSetMatrixAt = function(index, matrix, refresh = true) { - if (!this._thinInstanceDataStorage.matrixData || index >= this._thinInstanceDataStorage.instancesCount) { - return false; - } - const matrixData = this._thinInstanceDataStorage.matrixData; - matrix.copyToArray(matrixData, index * 16); - if (this._thinInstanceDataStorage.worldMatrices) { - this._thinInstanceDataStorage.worldMatrices[index] = matrix; - } - if (refresh) { - this.thinInstanceBufferUpdated("matrix"); - if (!this.doNotSyncBoundingInfo) { - this.thinInstanceRefreshBoundingInfo(false); + instance = options.instance; + if (instance instanceof GreasedLineRibbonMesh) { + instance.addPoints(allPoints, initialGreasedLineOptions); + } else { + const currentWidths = instance.widths; + if (currentWidths) { + const newWidths = currentWidths.slice(); + for (const w of widths) { + newWidths.push(w); + } + instance.widths = newWidths; + } else { + instance.widths = widths; + } + instance.addPoints(allPoints); } } - return true; -}; -Mesh.prototype.thinInstanceSetAttributeAt = function(kind, index, value, refresh = true) { - if (kind === VertexBuffer.ColorKind) { - kind = VertexBuffer.ColorInstanceKind; - } - if (!this._userThinInstanceBuffersStorage || !this._userThinInstanceBuffersStorage.data[kind] || index >= this._thinInstanceDataStorage.instancesCount) { - return false; - } - this._thinInstanceUpdateBufferSize(kind, 0); - this._userThinInstanceBuffersStorage.data[kind].set(value, index * this._userThinInstanceBuffersStorage.strides[kind]); - if (refresh) { - this.thinInstanceBufferUpdated(kind); + if (colors && options.instance) { + if (options.instance.greasedLineMaterial) { + const currentColors = options.instance.greasedLineMaterial.colors; + if (currentColors) { + const newColors = currentColors.concat(colors); + options.instance.greasedLineMaterial.setColors(newColors, instance.isLazy()); + } + } } - return true; -}; -Object.defineProperty(Mesh.prototype, "thinInstanceCount", { - get: function() { - return this._thinInstanceDataStorage.instancesCount; - }, - set: function(value) { - var _a, _b; - const matrixData = (_a = this._thinInstanceDataStorage.matrixData) !== null && _a !== undefined ? _a : (_b = this.source) === null || _b === undefined ? undefined : _b._thinInstanceDataStorage.matrixData; - const numMaxInstances = matrixData ? matrixData.length / 16 : 0; - if (value <= numMaxInstances) { - this._thinInstanceDataStorage.instancesCount = value; + return instance; +} +function CompleteGreasedLineWidthTable(pointCount, widths, widthsDistribution, defaultWidthUpper = 1, defaultWidthLower = 1) { + const missingCount = pointCount - widths.length / 2; + const widthsData = []; + if (missingCount < 0) { + return widths.slice(0, pointCount * 2); + } + if (missingCount > 0) { + if (widths.length % 2 != 0) { + widths.push(defaultWidthUpper); + } + if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START_END) { + const halfCount = Math.floor(widths.length / 2); + for (let i = 0, j = 0;i < halfCount - 1; i++) { + widthsData.push(widths[j++]); + widthsData.push(widths[j++]); + } + const widthL = widths[halfCount / 2]; + const widthU = widths[halfCount / 2 + 1]; + for (let i = 0;i < missingCount; i++) { + widthsData.push(widthU); + widthsData.push(widthL); + } + for (let i = halfCount;i < widths.length; i += 2) { + widthsData.push(widths[i]); + widthsData.push(widths[i + 1]); + } + } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START) { + for (let i = 0;i < widths.length; i += 2) { + widthsData.push(widths[i]); + widthsData.push(widths[i + 1]); + } + for (let i = 0;i < missingCount; i++) { + widthsData.push(defaultWidthUpper); + widthsData.push(defaultWidthLower); + } + } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_END) { + for (let i = 0;i < missingCount; i++) { + widthsData.push(defaultWidthUpper); + widthsData.push(defaultWidthLower); + } + for (let i = 0;i < widths.length; i += 2) { + widthsData.push(widths[i]); + widthsData.push(widths[i + 1]); + } + } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_REPEAT) { + let i = 0; + for (let x = 0;x < pointCount; x++) { + widthsData.push(widths[i++]); + widthsData.push(widths[i++]); + if (i === widths.length) { + i = 0; + } + } + } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_EVEN) { + let j = 0; + const widthsectorLength = widths.length / ((pointCount - 1) * 2); + for (let x = 0;x < pointCount; x++) { + const i = Math.floor(j); + widthsData.push(widths[i]); + widthsData.push(widths[i + 1]); + j += widthsectorLength; + } + } + } else { + for (let i = 0;i < widths.length; i++) { + widthsData.push(widths[i]); } - }, - enumerable: true, - configurable: true -}); -Mesh.prototype._thinInstanceCreateMatrixBuffer = function(kind, buffer55, staticBuffer = false) { - if (kind === VertexBuffer.ColorKind) { - kind = VertexBuffer.ColorInstanceKind; } - const matrixBuffer = new Buffer(this.getEngine(), buffer55, !staticBuffer, 16, false, true); - for (let i = 0;i < 4; i++) { - this.setVerticesBuffer(matrixBuffer.createVertexBuffer(kind + i, i * 4, 4)); + return widthsData; +} +function CompleteGreasedLineColorTable(pointCount, colors, colorDistribution, defaultColor) { + pointCount = Math.max(colors.length, pointCount); + const missingCount = pointCount - colors.length; + if (missingCount < 0) { + return colors.slice(0, pointCount); } - return matrixBuffer; -}; -Mesh.prototype.thinInstanceSetBuffer = function(kind, buffer55, stride = 0, staticBuffer = false) { - var _a, _b, _c; - stride = stride || 16; - if (kind === "matrix") { - (_a = this._thinInstanceDataStorage.matrixBuffer) === null || _a === undefined || _a.dispose(); - this._thinInstanceDataStorage.matrixBuffer = null; - this._thinInstanceDataStorage.matrixBufferSize = buffer55 ? buffer55.length : 32 * stride; - this._thinInstanceDataStorage.matrixData = buffer55; - this._thinInstanceDataStorage.worldMatrices = null; - if (buffer55 !== null) { - this._thinInstanceDataStorage.instancesCount = buffer55.length / stride; - this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer("world", buffer55, staticBuffer); - if (!this.doNotSyncBoundingInfo) { - this.thinInstanceRefreshBoundingInfo(false); + const colorsData = []; + if (missingCount > 0) { + if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START_END) { + const halfCount = Math.floor(colors.length / 2); + for (let i = 0;i < halfCount; i++) { + colorsData.push(colors[i]); } - } else { - this._thinInstanceDataStorage.instancesCount = 0; - if (!this.doNotSyncBoundingInfo) { - this.refreshBoundingInfo(); + for (let i = 0;i < missingCount - 1; i++) { + colorsData.push(defaultColor); + } + for (let i = halfCount;i < colors.length; i++) { + colorsData.push(colors[i]); + } + } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START) { + for (let i = 0;i < colors.length; i++) { + colorsData.push(colors[i]); + } + for (let i = 0;i < missingCount; i++) { + colorsData.push(defaultColor); + } + } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_END) { + for (let i = 0;i < missingCount - 1; i++) { + colorsData.push(defaultColor); + } + for (let i = 0;i < colors.length; i++) { + colorsData.push(colors[i]); + } + } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_REPEAT) { + let i = 0; + for (let x = 0;x < pointCount; x++) { + colorsData.push(colors[i]); + i++; + if (i === colors.length) { + i = 0; + } + } + } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_EVEN) { + let j = 0; + const colorSectorLength = colors.length / (pointCount - 1); + for (let x = 0;x < pointCount - 1; x++) { + const i = Math.floor(j); + colorsData.push(colors[i]); + j += colorSectorLength; + } + } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_NONE) { + for (let i = 0;i < colors.length; i++) { + colorsData.push(colors[i]); } - } - } else if (kind === "previousMatrix") { - (_b = this._thinInstanceDataStorage.previousMatrixBuffer) === null || _b === undefined || _b.dispose(); - this._thinInstanceDataStorage.previousMatrixBuffer = null; - this._thinInstanceDataStorage.previousMatrixData = buffer55; - if (buffer55 !== null) { - this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer("previousWorld", buffer55, staticBuffer); } } else { - if (kind === VertexBuffer.ColorKind) { - kind = VertexBuffer.ColorInstanceKind; + for (let i = 0;i < pointCount; i++) { + colorsData.push(colors[i]); + } + } + return colorsData; +} +var GreasedLineMeshColorDistribution, GreasedLineMeshWidthDistribution; +var init_greasedLineBuilder = __esm(() => { + init_standardMaterial(); + init_pbrMaterial(); + init_greasedLineMesh(); + init_engineStore(); + init_greasedLineSimpleMaterial(); + init_greasedLineTools(); + init_greasedLineBaseMesh(); + init_greasedLineRibbonMesh(); + init_greasedLineMaterialInterfaces(); + init_greasedLinePluginMaterial(); + init_greasedLineMaterialDefaults(); + (function(GreasedLineMeshColorDistribution2) { + GreasedLineMeshColorDistribution2[GreasedLineMeshColorDistribution2["COLOR_DISTRIBUTION_NONE"] = 0] = "COLOR_DISTRIBUTION_NONE"; + GreasedLineMeshColorDistribution2[GreasedLineMeshColorDistribution2["COLOR_DISTRIBUTION_REPEAT"] = 1] = "COLOR_DISTRIBUTION_REPEAT"; + GreasedLineMeshColorDistribution2[GreasedLineMeshColorDistribution2["COLOR_DISTRIBUTION_EVEN"] = 2] = "COLOR_DISTRIBUTION_EVEN"; + GreasedLineMeshColorDistribution2[GreasedLineMeshColorDistribution2["COLOR_DISTRIBUTION_START"] = 3] = "COLOR_DISTRIBUTION_START"; + GreasedLineMeshColorDistribution2[GreasedLineMeshColorDistribution2["COLOR_DISTRIBUTION_END"] = 4] = "COLOR_DISTRIBUTION_END"; + GreasedLineMeshColorDistribution2[GreasedLineMeshColorDistribution2["COLOR_DISTRIBUTION_START_END"] = 5] = "COLOR_DISTRIBUTION_START_END"; + })(GreasedLineMeshColorDistribution || (GreasedLineMeshColorDistribution = {})); + (function(GreasedLineMeshWidthDistribution2) { + GreasedLineMeshWidthDistribution2[GreasedLineMeshWidthDistribution2["WIDTH_DISTRIBUTION_NONE"] = 0] = "WIDTH_DISTRIBUTION_NONE"; + GreasedLineMeshWidthDistribution2[GreasedLineMeshWidthDistribution2["WIDTH_DISTRIBUTION_REPEAT"] = 1] = "WIDTH_DISTRIBUTION_REPEAT"; + GreasedLineMeshWidthDistribution2[GreasedLineMeshWidthDistribution2["WIDTH_DISTRIBUTION_EVEN"] = 2] = "WIDTH_DISTRIBUTION_EVEN"; + GreasedLineMeshWidthDistribution2[GreasedLineMeshWidthDistribution2["WIDTH_DISTRIBUTION_START"] = 3] = "WIDTH_DISTRIBUTION_START"; + GreasedLineMeshWidthDistribution2[GreasedLineMeshWidthDistribution2["WIDTH_DISTRIBUTION_END"] = 4] = "WIDTH_DISTRIBUTION_END"; + GreasedLineMeshWidthDistribution2[GreasedLineMeshWidthDistribution2["WIDTH_DISTRIBUTION_START_END"] = 5] = "WIDTH_DISTRIBUTION_START_END"; + })(GreasedLineMeshWidthDistribution || (GreasedLineMeshWidthDistribution = {})); +}); + +// node_modules/@babylonjs/core/Meshes/Builders/index.js +var init_Builders = __esm(() => { + init_boxBuilder(); + init_tiledBoxBuilder(); + init_discBuilder(); + init_ribbonBuilder(); + init_sphereBuilder(); + init_hemisphereBuilder(); + init_cylinderBuilder(); + init_torusBuilder(); + init_torusKnotBuilder(); + init_linesBuilder(); + init_polygonBuilder(); + init_shapeBuilder(); + init_latheBuilder(); + init_planeBuilder(); + init_tiledPlaneBuilder(); + init_groundBuilder(); + init_tubeBuilder(); + init_polyhedronBuilder(); + init_geodesicBuilder(); + init_goldbergBuilder(); + init_decalBuilder(); + init_icoSphereBuilder(); + init_capsuleBuilder(); + init_textBuilder(); + init_greasedLineBuilder(); +}); + +// node_modules/@babylonjs/core/Meshes/thinInstanceMesh.js +var init_thinInstanceMesh = __esm(() => { + init_mesh(); + init_buffer(); + init_math_vector(); + init_logger(); + init_boundingInfo(); + Mesh.prototype.thinInstanceAdd = function(matrix, refresh = true) { + if (!this.getScene().getEngine().getCaps().instancedArrays) { + Logger.Error("Thin Instances are not supported on this device as Instanced Array extension not supported"); + return -1; } - if (buffer55 === null) { - if ((_c = this._userThinInstanceBuffersStorage) === null || _c === undefined ? undefined : _c.data[kind]) { - this.removeVerticesData(kind); - delete this._userThinInstanceBuffersStorage.data[kind]; - delete this._userThinInstanceBuffersStorage.strides[kind]; - delete this._userThinInstanceBuffersStorage.sizes[kind]; - delete this._userThinInstanceBuffersStorage.vertexBuffers[kind]; + this._thinInstanceUpdateBufferSize("matrix", Array.isArray(matrix) ? matrix.length : 1); + const index = this._thinInstanceDataStorage.instancesCount; + if (Array.isArray(matrix)) { + for (let i = 0;i < matrix.length; ++i) { + this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, matrix[i], i === matrix.length - 1 && refresh); } } else { - this._thinInstanceInitializeUserStorage(); - this._userThinInstanceBuffersStorage.data[kind] = buffer55; - this._userThinInstanceBuffersStorage.strides[kind] = stride; - this._userThinInstanceBuffersStorage.sizes[kind] = buffer55.length; - this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), buffer55, kind, !staticBuffer, false, stride, true); - this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]); + this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, matrix, refresh); } - } -}; -Mesh.prototype.thinInstanceBufferUpdated = function(kind) { - var _a, _b, _c; - if (kind === "matrix") { - (_a = this._thinInstanceDataStorage.matrixBuffer) === null || _a === undefined || _a.updateDirectly(this._thinInstanceDataStorage.matrixData, 0, this._thinInstanceDataStorage.instancesCount); - } else if (kind === "previousMatrix") { - (_b = this._thinInstanceDataStorage.previousMatrixBuffer) === null || _b === undefined || _b.updateDirectly(this._thinInstanceDataStorage.previousMatrixData, 0, this._thinInstanceDataStorage.instancesCount); - } else { + return index; + }; + Mesh.prototype.thinInstanceAddSelf = function(refresh = true) { + return this.thinInstanceAdd(Matrix.IdentityReadOnly, refresh); + }; + Mesh.prototype.thinInstanceRegisterAttribute = function(kind, stride) { if (kind === VertexBuffer.ColorKind) { kind = VertexBuffer.ColorInstanceKind; } - if ((_c = this._userThinInstanceBuffersStorage) === null || _c === undefined ? undefined : _c.vertexBuffers[kind]) { - this._userThinInstanceBuffersStorage.vertexBuffers[kind].updateDirectly(this._userThinInstanceBuffersStorage.data[kind], 0); + this.removeVerticesData(kind); + this._thinInstanceInitializeUserStorage(); + this._userThinInstanceBuffersStorage.strides[kind] = stride; + this._userThinInstanceBuffersStorage.sizes[kind] = stride * Math.max(32, this._thinInstanceDataStorage.instancesCount); + this._userThinInstanceBuffersStorage.data[kind] = new Float32Array(this._userThinInstanceBuffersStorage.sizes[kind]); + this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), this._userThinInstanceBuffersStorage.data[kind], kind, true, false, stride, true); + this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]); + }; + Mesh.prototype.thinInstanceSetMatrixAt = function(index, matrix, refresh = true) { + if (!this._thinInstanceDataStorage.matrixData || index >= this._thinInstanceDataStorage.instancesCount) { + return false; } - } -}; -Mesh.prototype.thinInstancePartialBufferUpdate = function(kind, data, offset) { - var _a; - if (kind === "matrix") { - if (this._thinInstanceDataStorage.matrixBuffer) { - this._thinInstanceDataStorage.matrixBuffer.updateDirectly(data, offset); + const matrixData = this._thinInstanceDataStorage.matrixData; + matrix.copyToArray(matrixData, index * 16); + if (this._thinInstanceDataStorage.worldMatrices) { + this._thinInstanceDataStorage.worldMatrices[index] = matrix; } - } else { + if (refresh) { + this.thinInstanceBufferUpdated("matrix"); + if (!this.doNotSyncBoundingInfo) { + this.thinInstanceRefreshBoundingInfo(false); + } + } + return true; + }; + Mesh.prototype.thinInstanceSetAttributeAt = function(kind, index, value, refresh = true) { if (kind === VertexBuffer.ColorKind) { kind = VertexBuffer.ColorInstanceKind; } - if ((_a = this._userThinInstanceBuffersStorage) === null || _a === undefined ? undefined : _a.vertexBuffers[kind]) { - this._userThinInstanceBuffersStorage.vertexBuffers[kind].updateDirectly(data, offset); + if (!this._userThinInstanceBuffersStorage || !this._userThinInstanceBuffersStorage.data[kind] || index >= this._thinInstanceDataStorage.instancesCount) { + return false; } - } -}; -Mesh.prototype.thinInstanceGetWorldMatrices = function() { - if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer) { - return []; - } - const matrixData = this._thinInstanceDataStorage.matrixData; - if (!this._thinInstanceDataStorage.worldMatrices) { - this._thinInstanceDataStorage.worldMatrices = []; - for (let i = 0;i < this._thinInstanceDataStorage.instancesCount; ++i) { - this._thinInstanceDataStorage.worldMatrices[i] = Matrix.FromArray(matrixData, i * 16); + this._thinInstanceUpdateBufferSize(kind, 0); + this._userThinInstanceBuffersStorage.data[kind].set(value, index * this._userThinInstanceBuffersStorage.strides[kind]); + if (refresh) { + this.thinInstanceBufferUpdated(kind); } - } - return this._thinInstanceDataStorage.worldMatrices; -}; -Mesh.prototype.thinInstanceRefreshBoundingInfo = function(forceRefreshParentInfo = false, applySkeleton = false, applyMorph = false) { - if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer) { - return; - } - const vectors = this._thinInstanceDataStorage.boundingVectors; - if (forceRefreshParentInfo || !this.rawBoundingInfo) { - vectors.length = 0; - this.refreshBoundingInfo(applySkeleton, applyMorph); - const boundingInfo8 = this.getBoundingInfo(); - this.rawBoundingInfo = new BoundingInfo(boundingInfo8.minimum, boundingInfo8.maximum); - } - const boundingInfo7 = this.getBoundingInfo(); - const matrixData = this._thinInstanceDataStorage.matrixData; - if (vectors.length === 0) { - for (let v = 0;v < boundingInfo7.boundingBox.vectors.length; ++v) { - vectors.push(boundingInfo7.boundingBox.vectors[v].clone()); + return true; + }; + Object.defineProperty(Mesh.prototype, "thinInstanceCount", { + get: function() { + return this._thinInstanceDataStorage.instancesCount; + }, + set: function(value) { + var _a, _b; + const matrixData = (_a = this._thinInstanceDataStorage.matrixData) !== null && _a !== undefined ? _a : (_b = this.source) === null || _b === undefined ? undefined : _b._thinInstanceDataStorage.matrixData; + const numMaxInstances = matrixData ? matrixData.length / 16 : 0; + if (value <= numMaxInstances) { + this._thinInstanceDataStorage.instancesCount = value; + } + }, + enumerable: true, + configurable: true + }); + Mesh.prototype._thinInstanceCreateMatrixBuffer = function(kind, buffer55, staticBuffer = false) { + if (kind === VertexBuffer.ColorKind) { + kind = VertexBuffer.ColorInstanceKind; } - } - TmpVectors.Vector3[0].setAll(Number.POSITIVE_INFINITY); - TmpVectors.Vector3[1].setAll(Number.NEGATIVE_INFINITY); - for (let i = 0;i < this._thinInstanceDataStorage.instancesCount; ++i) { - Matrix.FromArrayToRef(matrixData, i * 16, TmpVectors.Matrix[0]); - for (let v = 0;v < vectors.length; ++v) { - Vector3.TransformCoordinatesToRef(vectors[v], TmpVectors.Matrix[0], TmpVectors.Vector3[2]); - TmpVectors.Vector3[0].minimizeInPlace(TmpVectors.Vector3[2]); - TmpVectors.Vector3[1].maximizeInPlace(TmpVectors.Vector3[2]); + const matrixBuffer = new Buffer(this.getEngine(), buffer55, !staticBuffer, 16, false, true); + for (let i = 0;i < 4; i++) { + this.setVerticesBuffer(matrixBuffer.createVertexBuffer(kind + i, i * 4, 4)); } - } - boundingInfo7.reConstruct(TmpVectors.Vector3[0], TmpVectors.Vector3[1]); - this._updateBoundingInfo(); -}; -Mesh.prototype._thinInstanceUpdateBufferSize = function(kind, numInstances = 1) { - var _a, _b, _c; - if (kind === VertexBuffer.ColorKind) { - kind = VertexBuffer.ColorInstanceKind; - } - const kindIsMatrix = kind === "matrix"; - if (!kindIsMatrix && (!this._userThinInstanceBuffersStorage || !this._userThinInstanceBuffersStorage.strides[kind])) { - return; - } - const stride = kindIsMatrix ? 16 : this._userThinInstanceBuffersStorage.strides[kind]; - const currentSize = kindIsMatrix ? this._thinInstanceDataStorage.matrixBufferSize : this._userThinInstanceBuffersStorage.sizes[kind]; - let data = kindIsMatrix ? this._thinInstanceDataStorage.matrixData : this._userThinInstanceBuffersStorage.data[kind]; - const bufferSize = (this._thinInstanceDataStorage.instancesCount + numInstances) * stride; - let newSize = currentSize; - while (newSize < bufferSize) { - newSize *= 2; - } - if (!data || currentSize != newSize) { - if (!data) { - data = new Float32Array(newSize); + return matrixBuffer; + }; + Mesh.prototype.thinInstanceSetBuffer = function(kind, buffer55, stride = 0, staticBuffer = false) { + var _a, _b, _c; + stride = stride || 16; + if (kind === "matrix") { + (_a = this._thinInstanceDataStorage.matrixBuffer) === null || _a === undefined || _a.dispose(); + this._thinInstanceDataStorage.matrixBuffer = null; + this._thinInstanceDataStorage.matrixBufferSize = buffer55 ? buffer55.length : 32 * stride; + this._thinInstanceDataStorage.matrixData = buffer55; + this._thinInstanceDataStorage.worldMatrices = null; + if (buffer55 !== null) { + this._thinInstanceDataStorage.instancesCount = buffer55.length / stride; + this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer("world", buffer55, staticBuffer); + if (!this.doNotSyncBoundingInfo) { + this.thinInstanceRefreshBoundingInfo(false); + } + } else { + this._thinInstanceDataStorage.instancesCount = 0; + if (!this.doNotSyncBoundingInfo) { + this.refreshBoundingInfo(); + } + } + } else if (kind === "previousMatrix") { + (_b = this._thinInstanceDataStorage.previousMatrixBuffer) === null || _b === undefined || _b.dispose(); + this._thinInstanceDataStorage.previousMatrixBuffer = null; + this._thinInstanceDataStorage.previousMatrixData = buffer55; + if (buffer55 !== null) { + this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer("previousWorld", buffer55, staticBuffer); + } } else { - const newData = new Float32Array(newSize); - newData.set(data, 0); - data = newData; + if (kind === VertexBuffer.ColorKind) { + kind = VertexBuffer.ColorInstanceKind; + } + if (buffer55 === null) { + if ((_c = this._userThinInstanceBuffersStorage) === null || _c === undefined ? undefined : _c.data[kind]) { + this.removeVerticesData(kind); + delete this._userThinInstanceBuffersStorage.data[kind]; + delete this._userThinInstanceBuffersStorage.strides[kind]; + delete this._userThinInstanceBuffersStorage.sizes[kind]; + delete this._userThinInstanceBuffersStorage.vertexBuffers[kind]; + } + } else { + this._thinInstanceInitializeUserStorage(); + this._userThinInstanceBuffersStorage.data[kind] = buffer55; + this._userThinInstanceBuffersStorage.strides[kind] = stride; + this._userThinInstanceBuffersStorage.sizes[kind] = buffer55.length; + this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), buffer55, kind, !staticBuffer, false, stride, true); + this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]); + } } - if (kindIsMatrix) { - (_a = this._thinInstanceDataStorage.matrixBuffer) === null || _a === undefined || _a.dispose(); - this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer("world", data, false); - this._thinInstanceDataStorage.matrixData = data; - this._thinInstanceDataStorage.matrixBufferSize = newSize; - if (this._scene.needsPreviousWorldMatrices && !this._thinInstanceDataStorage.previousMatrixData) { - (_b = this._thinInstanceDataStorage.previousMatrixBuffer) === null || _b === undefined || _b.dispose(); - this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer("previousWorld", data, false); + }; + Mesh.prototype.thinInstanceBufferUpdated = function(kind) { + var _a, _b, _c; + if (kind === "matrix") { + (_a = this._thinInstanceDataStorage.matrixBuffer) === null || _a === undefined || _a.updateDirectly(this._thinInstanceDataStorage.matrixData, 0, this._thinInstanceDataStorage.instancesCount); + } else if (kind === "previousMatrix") { + (_b = this._thinInstanceDataStorage.previousMatrixBuffer) === null || _b === undefined || _b.updateDirectly(this._thinInstanceDataStorage.previousMatrixData, 0, this._thinInstanceDataStorage.instancesCount); + } else { + if (kind === VertexBuffer.ColorKind) { + kind = VertexBuffer.ColorInstanceKind; + } + if ((_c = this._userThinInstanceBuffersStorage) === null || _c === undefined ? undefined : _c.vertexBuffers[kind]) { + this._userThinInstanceBuffersStorage.vertexBuffers[kind].updateDirectly(this._userThinInstanceBuffersStorage.data[kind], 0); + } + } + }; + Mesh.prototype.thinInstancePartialBufferUpdate = function(kind, data, offset) { + var _a; + if (kind === "matrix") { + if (this._thinInstanceDataStorage.matrixBuffer) { + this._thinInstanceDataStorage.matrixBuffer.updateDirectly(data, offset); } } else { - (_c = this._userThinInstanceBuffersStorage.vertexBuffers[kind]) === null || _c === undefined || _c.dispose(); - this._userThinInstanceBuffersStorage.data[kind] = data; - this._userThinInstanceBuffersStorage.sizes[kind] = newSize; - this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), data, kind, true, false, stride, true); - this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]); + if (kind === VertexBuffer.ColorKind) { + kind = VertexBuffer.ColorInstanceKind; + } + if ((_a = this._userThinInstanceBuffersStorage) === null || _a === undefined ? undefined : _a.vertexBuffers[kind]) { + this._userThinInstanceBuffersStorage.vertexBuffers[kind].updateDirectly(data, offset); + } } - } -}; -Mesh.prototype._thinInstanceInitializeUserStorage = function() { - if (!this._userThinInstanceBuffersStorage) { - this._userThinInstanceBuffersStorage = { - data: {}, - sizes: {}, - vertexBuffers: {}, - strides: {} - }; - } -}; -Mesh.prototype._disposeThinInstanceSpecificData = function() { - var _a; - if ((_a = this._thinInstanceDataStorage) === null || _a === undefined ? undefined : _a.matrixBuffer) { - this._thinInstanceDataStorage.matrixBuffer.dispose(); - this._thinInstanceDataStorage.matrixBuffer = null; - } -}; + }; + Mesh.prototype.thinInstanceGetWorldMatrices = function() { + if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer) { + return []; + } + const matrixData = this._thinInstanceDataStorage.matrixData; + if (!this._thinInstanceDataStorage.worldMatrices) { + this._thinInstanceDataStorage.worldMatrices = []; + for (let i = 0;i < this._thinInstanceDataStorage.instancesCount; ++i) { + this._thinInstanceDataStorage.worldMatrices[i] = Matrix.FromArray(matrixData, i * 16); + } + } + return this._thinInstanceDataStorage.worldMatrices; + }; + Mesh.prototype.thinInstanceRefreshBoundingInfo = function(forceRefreshParentInfo = false, applySkeleton = false, applyMorph = false) { + if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer) { + return; + } + const vectors = this._thinInstanceDataStorage.boundingVectors; + if (forceRefreshParentInfo || !this.rawBoundingInfo) { + vectors.length = 0; + this.refreshBoundingInfo(applySkeleton, applyMorph); + const boundingInfo8 = this.getBoundingInfo(); + this.rawBoundingInfo = new BoundingInfo(boundingInfo8.minimum, boundingInfo8.maximum); + } + const boundingInfo7 = this.getBoundingInfo(); + const matrixData = this._thinInstanceDataStorage.matrixData; + if (vectors.length === 0) { + for (let v = 0;v < boundingInfo7.boundingBox.vectors.length; ++v) { + vectors.push(boundingInfo7.boundingBox.vectors[v].clone()); + } + } + TmpVectors.Vector3[0].setAll(Number.POSITIVE_INFINITY); + TmpVectors.Vector3[1].setAll(Number.NEGATIVE_INFINITY); + for (let i = 0;i < this._thinInstanceDataStorage.instancesCount; ++i) { + Matrix.FromArrayToRef(matrixData, i * 16, TmpVectors.Matrix[0]); + for (let v = 0;v < vectors.length; ++v) { + Vector3.TransformCoordinatesToRef(vectors[v], TmpVectors.Matrix[0], TmpVectors.Vector3[2]); + TmpVectors.Vector3[0].minimizeInPlace(TmpVectors.Vector3[2]); + TmpVectors.Vector3[1].maximizeInPlace(TmpVectors.Vector3[2]); + } + } + boundingInfo7.reConstruct(TmpVectors.Vector3[0], TmpVectors.Vector3[1]); + this._updateBoundingInfo(); + }; + Mesh.prototype._thinInstanceUpdateBufferSize = function(kind, numInstances = 1) { + var _a, _b, _c; + if (kind === VertexBuffer.ColorKind) { + kind = VertexBuffer.ColorInstanceKind; + } + const kindIsMatrix = kind === "matrix"; + if (!kindIsMatrix && (!this._userThinInstanceBuffersStorage || !this._userThinInstanceBuffersStorage.strides[kind])) { + return; + } + const stride = kindIsMatrix ? 16 : this._userThinInstanceBuffersStorage.strides[kind]; + const currentSize = kindIsMatrix ? this._thinInstanceDataStorage.matrixBufferSize : this._userThinInstanceBuffersStorage.sizes[kind]; + let data = kindIsMatrix ? this._thinInstanceDataStorage.matrixData : this._userThinInstanceBuffersStorage.data[kind]; + const bufferSize = (this._thinInstanceDataStorage.instancesCount + numInstances) * stride; + let newSize = currentSize; + while (newSize < bufferSize) { + newSize *= 2; + } + if (!data || currentSize != newSize) { + if (!data) { + data = new Float32Array(newSize); + } else { + const newData = new Float32Array(newSize); + newData.set(data, 0); + data = newData; + } + if (kindIsMatrix) { + (_a = this._thinInstanceDataStorage.matrixBuffer) === null || _a === undefined || _a.dispose(); + this._thinInstanceDataStorage.matrixBuffer = this._thinInstanceCreateMatrixBuffer("world", data, false); + this._thinInstanceDataStorage.matrixData = data; + this._thinInstanceDataStorage.matrixBufferSize = newSize; + if (this._scene.needsPreviousWorldMatrices && !this._thinInstanceDataStorage.previousMatrixData) { + (_b = this._thinInstanceDataStorage.previousMatrixBuffer) === null || _b === undefined || _b.dispose(); + this._thinInstanceDataStorage.previousMatrixBuffer = this._thinInstanceCreateMatrixBuffer("previousWorld", data, false); + } + } else { + (_c = this._userThinInstanceBuffersStorage.vertexBuffers[kind]) === null || _c === undefined || _c.dispose(); + this._userThinInstanceBuffersStorage.data[kind] = data; + this._userThinInstanceBuffersStorage.sizes[kind] = newSize; + this._userThinInstanceBuffersStorage.vertexBuffers[kind] = new VertexBuffer(this.getEngine(), data, kind, true, false, stride, true); + this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[kind]); + } + } + }; + Mesh.prototype._thinInstanceInitializeUserStorage = function() { + if (!this._userThinInstanceBuffersStorage) { + this._userThinInstanceBuffersStorage = { + data: {}, + sizes: {}, + vertexBuffers: {}, + strides: {} + }; + } + }; + Mesh.prototype._disposeThinInstanceSpecificData = function() { + var _a; + if ((_a = this._thinInstanceDataStorage) === null || _a === undefined ? undefined : _a.matrixBuffer) { + this._thinInstanceDataStorage.matrixBuffer.dispose(); + this._thinInstanceDataStorage.matrixBuffer = null; + } + }; +}); + // node_modules/@babylonjs/core/Meshes/Node/Enums/nodeGeometryConnectionPointTypes.js var NodeGeometryBlockConnectionPointTypes; -(function(NodeGeometryBlockConnectionPointTypes2) { - NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Int"] = 1] = "Int"; - NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Float"] = 2] = "Float"; - NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Vector2"] = 4] = "Vector2"; - NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Vector3"] = 8] = "Vector3"; - NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Vector4"] = 16] = "Vector4"; - NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Matrix"] = 32] = "Matrix"; - NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Geometry"] = 64] = "Geometry"; - NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Texture"] = 128] = "Texture"; - NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["AutoDetect"] = 1024] = "AutoDetect"; - NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["BasedOnInput"] = 2048] = "BasedOnInput"; - NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Undefined"] = 4096] = "Undefined"; - NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["All"] = 4095] = "All"; -})(NodeGeometryBlockConnectionPointTypes || (NodeGeometryBlockConnectionPointTypes = {})); +var init_nodeGeometryConnectionPointTypes = __esm(() => { + (function(NodeGeometryBlockConnectionPointTypes2) { + NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Int"] = 1] = "Int"; + NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Float"] = 2] = "Float"; + NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Vector2"] = 4] = "Vector2"; + NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Vector3"] = 8] = "Vector3"; + NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Vector4"] = 16] = "Vector4"; + NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Matrix"] = 32] = "Matrix"; + NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Geometry"] = 64] = "Geometry"; + NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Texture"] = 128] = "Texture"; + NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["AutoDetect"] = 1024] = "AutoDetect"; + NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["BasedOnInput"] = 2048] = "BasedOnInput"; + NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["Undefined"] = 4096] = "Undefined"; + NodeGeometryBlockConnectionPointTypes2[NodeGeometryBlockConnectionPointTypes2["All"] = 4095] = "All"; + })(NodeGeometryBlockConnectionPointTypes || (NodeGeometryBlockConnectionPointTypes = {})); +}); // node_modules/@babylonjs/core/Meshes/Node/nodeGeometryBlockConnectionPoint.js -var NodeGeometryConnectionPointCompatibilityStates; -(function(NodeGeometryConnectionPointCompatibilityStates2) { - NodeGeometryConnectionPointCompatibilityStates2[NodeGeometryConnectionPointCompatibilityStates2["Compatible"] = 0] = "Compatible"; - NodeGeometryConnectionPointCompatibilityStates2[NodeGeometryConnectionPointCompatibilityStates2["TypeIncompatible"] = 1] = "TypeIncompatible"; - NodeGeometryConnectionPointCompatibilityStates2[NodeGeometryConnectionPointCompatibilityStates2["HierarchyIssue"] = 2] = "HierarchyIssue"; -})(NodeGeometryConnectionPointCompatibilityStates || (NodeGeometryConnectionPointCompatibilityStates = {})); -var NodeGeometryConnectionPointDirection; -(function(NodeGeometryConnectionPointDirection2) { - NodeGeometryConnectionPointDirection2[NodeGeometryConnectionPointDirection2["Input"] = 0] = "Input"; - NodeGeometryConnectionPointDirection2[NodeGeometryConnectionPointDirection2["Output"] = 1] = "Output"; -})(NodeGeometryConnectionPointDirection || (NodeGeometryConnectionPointDirection = {})); - class NodeGeometryConnectionPoint { get direction() { return this._direction; @@ -140094,7 +152771,7 @@ class NodeGeometryConnectionPoint { this._executionCount = 1; return this.value; } - constructor(name185, ownerBlock, direction) { + constructor(name186, ownerBlock, direction) { this._connectedPoint = null; this._storedValue = null; this._storedFunction = null; @@ -140116,7 +152793,7 @@ class NodeGeometryConnectionPoint { this._callCount = 0; this._executionCount = 0; this._ownerBlock = ownerBlock; - this.name = name185; + this.name = name186; this._direction = direction; } getClassName() { @@ -140201,6 +152878,20 @@ class NodeGeometryConnectionPoint { this.onConnectionObservable.clear(); } } +var NodeGeometryConnectionPointCompatibilityStates, NodeGeometryConnectionPointDirection; +var init_nodeGeometryBlockConnectionPoint = __esm(() => { + init_observable(); + init_nodeGeometryConnectionPointTypes(); + (function(NodeGeometryConnectionPointCompatibilityStates2) { + NodeGeometryConnectionPointCompatibilityStates2[NodeGeometryConnectionPointCompatibilityStates2["Compatible"] = 0] = "Compatible"; + NodeGeometryConnectionPointCompatibilityStates2[NodeGeometryConnectionPointCompatibilityStates2["TypeIncompatible"] = 1] = "TypeIncompatible"; + NodeGeometryConnectionPointCompatibilityStates2[NodeGeometryConnectionPointCompatibilityStates2["HierarchyIssue"] = 2] = "HierarchyIssue"; + })(NodeGeometryConnectionPointCompatibilityStates || (NodeGeometryConnectionPointCompatibilityStates = {})); + (function(NodeGeometryConnectionPointDirection2) { + NodeGeometryConnectionPointDirection2[NodeGeometryConnectionPointDirection2["Input"] = 0] = "Input"; + NodeGeometryConnectionPointDirection2[NodeGeometryConnectionPointDirection2["Output"] = 1] = "Output"; + })(NodeGeometryConnectionPointDirection || (NodeGeometryConnectionPointDirection = {})); +}); // node_modules/@babylonjs/core/Meshes/Node/nodeGeometryBlock.js class NodeGeometryBlock { @@ -140237,11 +152928,11 @@ class NodeGeometryBlock { getClassName() { return "NodeGeometryBlock"; } - _inputRename(name185) { - return name185; + _inputRename(name186) { + return name186; } - _outputRename(name185) { - return name185; + _outputRename(name186) { + return name186; } isAnAncestorOf(block) { for (const output of this._outputs) { @@ -140292,7 +152983,7 @@ class NodeGeometryBlock { } return null; } - constructor(name185) { + constructor(name186) { this._name = ""; this._isInput = false; this._isTeleportOut = false; @@ -140305,11 +152996,11 @@ class NodeGeometryBlock { this._outputs = new Array; this._codeVariableName = ""; this.visibleOnFrame = false; - this._name = name185; + this._name = name186; this.uniqueId = UniqueIdGenerator.UniqueId; } - registerInput(name185, type, isOptional = false, value, valueMin, valueMax) { - const point = new NodeGeometryConnectionPoint(name185, this, NodeGeometryConnectionPointDirection.Input); + registerInput(name186, type, isOptional = false, value, valueMin, valueMax) { + const point = new NodeGeometryConnectionPoint(name186, this, NodeGeometryConnectionPointDirection.Input); point.type = type; point.isOptional = isOptional; point.defaultValue = value; @@ -140319,8 +153010,8 @@ class NodeGeometryBlock { this._inputs.push(point); return this; } - registerOutput(name185, type, point) { - point = point !== null && point !== undefined ? point : new NodeGeometryConnectionPoint(name185, this, NodeGeometryConnectionPointDirection.Output); + registerOutput(name186, type, point) { + point = point !== null && point !== undefined ? point : new NodeGeometryConnectionPoint(name186, this, NodeGeometryConnectionPointDirection.Output); point.type = type; this._outputs.push(point); return this; @@ -140382,15 +153073,15 @@ class NodeGeometryBlock { } autoConfigure() { } - getInputByName(name185) { - const filter = this._inputs.filter((e) => e.name === name185); + getInputByName(name186) { + const filter = this._inputs.filter((e) => e.name === name186); if (filter.length) { return filter[0]; } return null; } - getOutputByName(name185) { - const filter = this._outputs.filter((e) => e.name === name185); + getOutputByName(name186) { + const filter = this._outputs.filter((e) => e.name === name186); if (filter.length) { return filter[0]; } @@ -140494,13 +153185,13 @@ class NodeGeometryBlock { if (this.comments) { codeString += `// ${this.comments}\n`; } - const className = this.getClassName(); - if (className === "GeometryInputBlock") { + const className2 = this.getClassName(); + if (className2 === "GeometryInputBlock") { const block = this; const blockType = block.type; codeString += `var ${this._codeVariableName} = new BABYLON.GeometryInputBlock("${this.name}", ${blockType});\n`; } else { - codeString += `var ${this._codeVariableName} = new BABYLON.${className}("${this.name}");\n`; + codeString += `var ${this._codeVariableName} = new BABYLON.${className2}("${this.name}");\n`; } codeString += this._dumpPropertiesCode(); for (const input of this.inputs) { @@ -140546,17 +153237,26 @@ class NodeGeometryBlock { this.onBuildObservable.clear(); } } -__decorate2([ - serialize("comment") -], NodeGeometryBlock.prototype, "comments", undefined); +var init_nodeGeometryBlock = __esm(() => { + init_tslib_es62(); + init_typeStore(); + init_decorators(); + init_uniqueIdGenerator(); + init_nodeGeometryBlockConnectionPoint(); + init_observable(); + init_precisionDate(); + __decorate2([ + serialize("comment") + ], NodeGeometryBlock.prototype, "comments", undefined); +}); // node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryOutputBlock.js class GeometryOutputBlock extends NodeGeometryBlock { get currentVertexData() { return this._vertexData; } - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this._vertexData = null; this._isUnique = true; this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry); @@ -140572,29 +153272,36 @@ class GeometryOutputBlock extends NodeGeometryBlock { this._vertexData = state.vertexData; } } -RegisterClass("BABYLON.GeometryOutputBlock", GeometryOutputBlock); +var init_geometryOutputBlock = __esm(() => { + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + RegisterClass("BABYLON.GeometryOutputBlock", GeometryOutputBlock); +}); // node_modules/@babylonjs/core/Meshes/Node/Enums/nodeGeometryContextualSources.js var NodeGeometryContextualSources; -(function(NodeGeometryContextualSources2) { - NodeGeometryContextualSources2[NodeGeometryContextualSources2["None"] = 0] = "None"; - NodeGeometryContextualSources2[NodeGeometryContextualSources2["Positions"] = 1] = "Positions"; - NodeGeometryContextualSources2[NodeGeometryContextualSources2["Normals"] = 2] = "Normals"; - NodeGeometryContextualSources2[NodeGeometryContextualSources2["Tangents"] = 3] = "Tangents"; - NodeGeometryContextualSources2[NodeGeometryContextualSources2["UV"] = 4] = "UV"; - NodeGeometryContextualSources2[NodeGeometryContextualSources2["UV2"] = 5] = "UV2"; - NodeGeometryContextualSources2[NodeGeometryContextualSources2["UV3"] = 6] = "UV3"; - NodeGeometryContextualSources2[NodeGeometryContextualSources2["UV4"] = 7] = "UV4"; - NodeGeometryContextualSources2[NodeGeometryContextualSources2["UV5"] = 8] = "UV5"; - NodeGeometryContextualSources2[NodeGeometryContextualSources2["UV6"] = 9] = "UV6"; - NodeGeometryContextualSources2[NodeGeometryContextualSources2["Colors"] = 10] = "Colors"; - NodeGeometryContextualSources2[NodeGeometryContextualSources2["VertexID"] = 11] = "VertexID"; - NodeGeometryContextualSources2[NodeGeometryContextualSources2["FaceID"] = 12] = "FaceID"; - NodeGeometryContextualSources2[NodeGeometryContextualSources2["GeometryID"] = 13] = "GeometryID"; - NodeGeometryContextualSources2[NodeGeometryContextualSources2["CollectionID"] = 14] = "CollectionID"; - NodeGeometryContextualSources2[NodeGeometryContextualSources2["LoopID"] = 15] = "LoopID"; - NodeGeometryContextualSources2[NodeGeometryContextualSources2["InstanceID"] = 16] = "InstanceID"; -})(NodeGeometryContextualSources || (NodeGeometryContextualSources = {})); +var init_nodeGeometryContextualSources = __esm(() => { + (function(NodeGeometryContextualSources2) { + NodeGeometryContextualSources2[NodeGeometryContextualSources2["None"] = 0] = "None"; + NodeGeometryContextualSources2[NodeGeometryContextualSources2["Positions"] = 1] = "Positions"; + NodeGeometryContextualSources2[NodeGeometryContextualSources2["Normals"] = 2] = "Normals"; + NodeGeometryContextualSources2[NodeGeometryContextualSources2["Tangents"] = 3] = "Tangents"; + NodeGeometryContextualSources2[NodeGeometryContextualSources2["UV"] = 4] = "UV"; + NodeGeometryContextualSources2[NodeGeometryContextualSources2["UV2"] = 5] = "UV2"; + NodeGeometryContextualSources2[NodeGeometryContextualSources2["UV3"] = 6] = "UV3"; + NodeGeometryContextualSources2[NodeGeometryContextualSources2["UV4"] = 7] = "UV4"; + NodeGeometryContextualSources2[NodeGeometryContextualSources2["UV5"] = 8] = "UV5"; + NodeGeometryContextualSources2[NodeGeometryContextualSources2["UV6"] = 9] = "UV6"; + NodeGeometryContextualSources2[NodeGeometryContextualSources2["Colors"] = 10] = "Colors"; + NodeGeometryContextualSources2[NodeGeometryContextualSources2["VertexID"] = 11] = "VertexID"; + NodeGeometryContextualSources2[NodeGeometryContextualSources2["FaceID"] = 12] = "FaceID"; + NodeGeometryContextualSources2[NodeGeometryContextualSources2["GeometryID"] = 13] = "GeometryID"; + NodeGeometryContextualSources2[NodeGeometryContextualSources2["CollectionID"] = 14] = "CollectionID"; + NodeGeometryContextualSources2[NodeGeometryContextualSources2["LoopID"] = 15] = "LoopID"; + NodeGeometryContextualSources2[NodeGeometryContextualSources2["InstanceID"] = 16] = "InstanceID"; + })(NodeGeometryContextualSources || (NodeGeometryContextualSources = {})); +}); // node_modules/@babylonjs/core/Meshes/Node/nodeGeometryBuildState.js class NodeGeometryBuildState { @@ -140828,6 +153535,11 @@ class NodeGeometryBuildState { additionalVertexData.push(clone); } } +var init_nodeGeometryBuildState = __esm(() => { + init_nodeGeometryContextualSources(); + init_math_vector(); + init_nodeGeometryConnectionPointTypes(); +}); // node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryInputBlock.js class GeometryInputBlock extends NodeGeometryBlock { @@ -140894,8 +153606,8 @@ class GeometryInputBlock extends NodeGeometryBlock { this.output.type = this._type; } } - constructor(name185, type = NodeGeometryBlockConnectionPointTypes.AutoDetect) { - super(name185); + constructor(name186, type = NodeGeometryBlockConnectionPointTypes.AutoDetect) { + super(name186); this._type = NodeGeometryBlockConnectionPointTypes.Undefined; this._contextualSource = NodeGeometryContextualSources.None; this.min = 0; @@ -141036,12 +153748,20 @@ class GeometryInputBlock extends NodeGeometryBlock { } } } -RegisterClass("BABYLON.GeometryInputBlock", GeometryInputBlock); +var init_geometryInputBlock = __esm(() => { + init_observable(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + init_typeStore(); + init_math_vector(); + init_nodeGeometryContextualSources(); + RegisterClass("BABYLON.GeometryInputBlock", GeometryInputBlock); +}); // node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/boxBlock.js class BoxBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = false; this.registerInput("size", NodeGeometryBlockConnectionPointTypes.Float, true, 1); this.registerInput("width", NodeGeometryBlockConnectionPointTypes.Float, true, 0); @@ -141158,10 +153878,19 @@ class BoxBlock extends NodeGeometryBlock { this.evaluateContext = serializationObject.evaluateContext; } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], BoxBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.BoxBlock", BoxBlock); +var init_boxBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + init_geometryInputBlock(); + init_typeStore(); + init_boxBuilder(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], BoxBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.BoxBlock", BoxBlock); +}); // node_modules/@babylonjs/core/Meshes/Node/nodeGeometry.js class NodeGeometry { @@ -141177,7 +153906,7 @@ class NodeGeometry { get buildExecutionTime() { return this._buildExecutionTime; } - constructor(name185) { + constructor(name186) { this._buildId = NodeGeometry._BuildIdGenerator++; this._buildWasSuccessful = false; this._vertexData = null; @@ -141187,19 +153916,19 @@ class NodeGeometry { this.attachedBlocks = []; this.onBuildObservable = new Observable; this.outputBlock = null; - this.name = name185; + this.name = name186; } getClassName() { return "NodeGeometry"; } - getBlockByName(name185) { + getBlockByName(name186) { let result = null; for (const block of this.attachedBlocks) { - if (block.name === name185) { + if (block.name === name186) { if (!result) { result = block; } else { - Tools.Warn("More than one block was found with the name `" + name185 + "`"); + Tools.Warn("More than one block was found with the name `" + name186 + "`"); return result; } } @@ -141263,14 +153992,14 @@ class NodeGeometry { this._vertexData = state.vertexData; this.onBuildObservable.notifyObservers(this); } - createMesh(name185, scene23 = null) { + createMesh(name186, scene23 = null) { if (!this._buildWasSuccessful) { this.build(); } if (!this._vertexData) { return null; } - const mesh57 = new Mesh(name185, scene23); + const mesh57 = new Mesh(name186, scene23); this._vertexData.applyToMesh(mesh57); mesh57._internalMetadata = mesh57._internalMetadata || {}; mesh57._internalMetadata.nodeGeometry = this; @@ -141460,10 +154189,10 @@ class NodeGeometry { dataBlock.geometry.connectTo(output.geometry); this.outputBlock = output; } - clone(name185) { + clone(name186) { const serializationObject = this.serialize(); - const clone = SerializationHelper.Clone(() => new NodeGeometry(name185), this); - clone.name = name185; + const clone = SerializationHelper.Clone(() => new NodeGeometry(name186), this); + clone.name = name186; clone.parseSerializedObject(serializationObject); clone._buildId = this._buildId; clone.build(false); @@ -141502,8 +154231,8 @@ class NodeGeometry { this.attachedBlocks.length = 0; this.onBuildObservable.clear(); } - static CreateDefault(name185) { - const nodeGeometry = new NodeGeometry(name185); + static CreateDefault(name186) { + const nodeGeometry = new NodeGeometry(name186); nodeGeometry.setToDefault(); nodeGeometry.build(); return nodeGeometry; @@ -141548,19 +154277,38 @@ class NodeGeometry { }); } } -NodeGeometry._BuildIdGenerator = 0; -NodeGeometry.EditorURL = `${Tools._DefaultCdnUrl}/v${Engine2.Version}/nodeGeometryEditor/babylon.nodeGeometryEditor.js`; -NodeGeometry.SnippetUrl = `https://snippet.babylonjs.com`; -__decorate2([ - serialize() -], NodeGeometry.prototype, "name", undefined); -__decorate2([ - serialize("comment") -], NodeGeometry.prototype, "comment", undefined); +var init_nodeGeometry = __esm(() => { + init_tslib_es62(); + init_observable(); + init_mesh(); + init_geometryOutputBlock(); + init_nodeGeometryBuildState(); + init_typeStore(); + init_decorators(); + init_webRequest(); + init_boxBlock(); + init_precisionDate(); + init_tools(); + init_engine(); + NodeGeometry._BuildIdGenerator = 0; + NodeGeometry.EditorURL = `${Tools._DefaultCdnUrl}/v${Engine2.Version}/nodeGeometryEditor/babylon.nodeGeometryEditor.js`; + NodeGeometry.SnippetUrl = `https://snippet.babylonjs.com`; + __decorate2([ + serialize() + ], NodeGeometry.prototype, "name", undefined); + __decorate2([ + serialize("comment") + ], NodeGeometry.prototype, "comment", undefined); +}); + +// node_modules/@babylonjs/core/Meshes/Node/Interfaces/nodeGeometryExecutionContext.js +var init_nodeGeometryExecutionContext = __esm(() => { +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryOptimizeBlock.js class GeometryOptimizeBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = true; this.epsilon = Epsilon; this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry); @@ -141629,17 +154377,28 @@ class GeometryOptimizeBlock extends NodeGeometryBlock { this.epsilon = serializationObject.epsilon; } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], GeometryOptimizeBlock.prototype, "evaluateContext", undefined); -__decorate2([ - editableInPropertyPage("Epsilon", PropertyTypeForEdition.Float, "ADVANCED", { notifiers: { rebuild: true } }) -], GeometryOptimizeBlock.prototype, "epsilon", undefined); -RegisterClass("BABYLON.GeometryOptimizeBlock", GeometryOptimizeBlock); +var init_geometryOptimizeBlock = __esm(() => { + init_tslib_es62(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + init_nodeDecorator(); + init_mesh_vertexData(); + init_math_scalar(); + init_math_constants(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], GeometryOptimizeBlock.prototype, "evaluateContext", undefined); + __decorate2([ + editableInPropertyPage("Epsilon", PropertyTypeForEdition.Float, "ADVANCED", { notifiers: { rebuild: true } }) + ], GeometryOptimizeBlock.prototype, "epsilon", undefined); + RegisterClass("BABYLON.GeometryOptimizeBlock", GeometryOptimizeBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/planeBlock.js class PlaneBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = false; this.registerInput("size", NodeGeometryBlockConnectionPointTypes.Float, true, 1); this.registerInput("width", NodeGeometryBlockConnectionPointTypes.Float, true, 0); @@ -141714,10 +154473,20 @@ class PlaneBlock extends NodeGeometryBlock { this.evaluateContext = serializationObject.evaluateContext; } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], PlaneBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.PlaneBlock", PlaneBlock); +var init_planeBlock = __esm(() => { + init_tslib_es62(); + init_planeBuilder(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + init_geometryInputBlock(); + init_typeStore(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], PlaneBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.PlaneBlock", PlaneBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/meshBlock.js class MeshBlock extends NodeGeometryBlock { get mesh() { @@ -141726,8 +154495,8 @@ class MeshBlock extends NodeGeometryBlock { set mesh(value) { this._mesh = value; } - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this._cachedVertexData = null; this.reverseWindingOrder = false; this.serializedCachedData = false; @@ -141790,14 +154559,23 @@ class MeshBlock extends NodeGeometryBlock { this.reverseWindingOrder = serializationObject.reverseWindingOrder; } } -__decorate2([ - editableInPropertyPage("Serialize cached data", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], MeshBlock.prototype, "serializedCachedData", undefined); -RegisterClass("BABYLON.MeshBlock", MeshBlock); +var init_meshBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + init_typeStore(); + init_mesh_vertexData(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Serialize cached data", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], MeshBlock.prototype, "serializedCachedData", undefined); + RegisterClass("BABYLON.MeshBlock", MeshBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/icoSphereBlock.js class IcoSphereBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = false; this.registerInput("radius", NodeGeometryBlockConnectionPointTypes.Float, true, 1); this.registerInput("radiusX", NodeGeometryBlockConnectionPointTypes.Float, true, 0); @@ -141868,14 +154646,24 @@ class IcoSphereBlock extends NodeGeometryBlock { this.evaluateContext = serializationObject.evaluateContext; } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], IcoSphereBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.IcoSphereBlock", IcoSphereBlock); +var init_icoSphereBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + init_geometryInputBlock(); + init_typeStore(); + init_icoSphereBuilder(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], IcoSphereBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.IcoSphereBlock", IcoSphereBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/sphereBlock.js class SphereBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = false; this.registerInput("segments", NodeGeometryBlockConnectionPointTypes.Int, true, 32); this.registerInput("diameter", NodeGeometryBlockConnectionPointTypes.Float, true, 1); @@ -141956,14 +154744,24 @@ class SphereBlock extends NodeGeometryBlock { this.evaluateContext = serializationObject.evaluateContext; } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], SphereBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.SphereBlock", SphereBlock); +var init_sphereBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + init_geometryInputBlock(); + init_typeStore(); + init_sphereBuilder(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], SphereBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.SphereBlock", SphereBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/gridBlock.js class GridBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = false; this.registerInput("width", NodeGeometryBlockConnectionPointTypes.Float, true, 1); this.registerInput("height", NodeGeometryBlockConnectionPointTypes.Float, true, 1); @@ -142039,14 +154837,24 @@ class GridBlock extends NodeGeometryBlock { this.evaluateContext = serializationObject.evaluateContext; } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], GridBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.GridBlock", GridBlock); +var init_gridBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + init_geometryInputBlock(); + init_typeStore(); + init_groundBuilder(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], GridBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.GridBlock", GridBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/torusBlock.js class TorusBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = false; this.registerInput("diameter", NodeGeometryBlockConnectionPointTypes.Float, true, 1); this.registerInput("thickness", NodeGeometryBlockConnectionPointTypes.Float, true, 0.5); @@ -142107,14 +154915,24 @@ class TorusBlock extends NodeGeometryBlock { this.evaluateContext = serializationObject.evaluateContext; } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], TorusBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.TorusBlock", TorusBlock); +var init_torusBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + init_geometryInputBlock(); + init_typeStore(); + init_torusBuilder(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], TorusBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.TorusBlock", TorusBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/cylinderBlock.js class CylinderBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = false; this.registerInput("height", NodeGeometryBlockConnectionPointTypes.Float, true, 25); this.registerInput("diameter", NodeGeometryBlockConnectionPointTypes.Float, true, 1); @@ -142206,14 +155024,24 @@ class CylinderBlock extends NodeGeometryBlock { this.evaluateContext = serializationObject.evaluateContext; } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], CylinderBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.CylinderBlock", CylinderBlock); +var init_cylinderBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + init_geometryInputBlock(); + init_typeStore(); + init_cylinderBuilder(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], CylinderBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.CylinderBlock", CylinderBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/capsuleBlock.js class CapsuleBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = false; this.registerInput("height", NodeGeometryBlockConnectionPointTypes.Float, true, 1); this.registerInput("radius", NodeGeometryBlockConnectionPointTypes.Float, true, 0.25); @@ -142284,14 +155112,24 @@ class CapsuleBlock extends NodeGeometryBlock { this.evaluateContext = serializationObject.evaluateContext; } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], CapsuleBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.CapsuleBlock", CapsuleBlock); +var init_capsuleBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + init_geometryInputBlock(); + init_typeStore(); + init_capsuleBuilder(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], CapsuleBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.CapsuleBlock", CapsuleBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/discBlock.js class DiscBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = false; this.registerInput("radius", NodeGeometryBlockConnectionPointTypes.Float, true, 0.5); this.registerInput("tessellation", NodeGeometryBlockConnectionPointTypes.Int, true, 64); @@ -142352,14 +155190,24 @@ class DiscBlock extends NodeGeometryBlock { this.evaluateContext = serializationObject.evaluateContext; } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], DiscBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.DiscBlock", DiscBlock); +var init_discBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + init_geometryInputBlock(); + init_typeStore(); + init_discBuilder(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], DiscBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.DiscBlock", DiscBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Sources/nullBlock.js class NullBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerOutput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry); } getClassName() { @@ -142372,11 +155220,17 @@ class NullBlock extends NodeGeometryBlock { this.geometry._storedValue = null; } } -RegisterClass("BABYLON.NullBlock", NullBlock); +var init_nullBlock = __esm(() => { + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + init_typeStore(); + RegisterClass("BABYLON.NullBlock", NullBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Set/setPositionsBlock.js class SetPositionsBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = true; this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry); this.registerInput("positions", NodeGeometryBlockConnectionPointTypes.Vector3); @@ -142451,14 +155305,22 @@ class SetPositionsBlock extends NodeGeometryBlock { } } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], SetPositionsBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.SetPositionsBlock", SetPositionsBlock); +var init_setPositionsBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], SetPositionsBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.SetPositionsBlock", SetPositionsBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Set/setNormalsBlock.js class SetNormalsBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = true; this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry); this.registerInput("normals", NodeGeometryBlockConnectionPointTypes.Vector3); @@ -142542,14 +155404,22 @@ class SetNormalsBlock extends NodeGeometryBlock { } } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], SetNormalsBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.SetNormalsBlock", SetNormalsBlock); +var init_setNormalsBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], SetNormalsBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.SetNormalsBlock", SetNormalsBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Set/setUVsBlock.js class SetUVsBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = true; this.textureCoordinateIndex = 0; this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry); @@ -142655,27 +155525,35 @@ class SetUVsBlock extends NodeGeometryBlock { } } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], SetUVsBlock.prototype, "evaluateContext", undefined); -__decorate2([ - editableInPropertyPage("Texture coordinates index", PropertyTypeForEdition.List, "ADVANCED", { - notifiers: { update: true }, - options: [ - { label: "UV1", value: 0 }, - { label: "UV2", value: 1 }, - { label: "UV3", value: 2 }, - { label: "UV4", value: 3 }, - { label: "UV5", value: 4 }, - { label: "UV6", value: 5 } - ] - }) -], SetUVsBlock.prototype, "textureCoordinateIndex", undefined); -RegisterClass("BABYLON.SetUVsBlock", SetUVsBlock); +var init_setUVsBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], SetUVsBlock.prototype, "evaluateContext", undefined); + __decorate2([ + editableInPropertyPage("Texture coordinates index", PropertyTypeForEdition.List, "ADVANCED", { + notifiers: { update: true }, + options: [ + { label: "UV1", value: 0 }, + { label: "UV2", value: 1 }, + { label: "UV3", value: 2 }, + { label: "UV4", value: 3 }, + { label: "UV5", value: 4 }, + { label: "UV6", value: 5 } + ] + }) + ], SetUVsBlock.prototype, "textureCoordinateIndex", undefined); + RegisterClass("BABYLON.SetUVsBlock", SetUVsBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Set/setColorsBlock.js class SetColorsBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = true; this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry); this.registerInput("colors", NodeGeometryBlockConnectionPointTypes.Vector4); @@ -142759,14 +155637,22 @@ class SetColorsBlock extends NodeGeometryBlock { } } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], SetColorsBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.SetColorsBlock", SetColorsBlock); +var init_setColorsBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], SetColorsBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.SetColorsBlock", SetColorsBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Set/setTangentsBlock.js class SetTangentsBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = true; this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry); this.registerInput("tangents", NodeGeometryBlockConnectionPointTypes.Vector4); @@ -142850,24 +155736,22 @@ class SetTangentsBlock extends NodeGeometryBlock { } } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], SetTangentsBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.SetTangentsBlock", SetTangentsBlock); -// node_modules/@babylonjs/core/Meshes/Node/Blocks/mathBlock.js -var MathBlockOperations; -(function(MathBlockOperations2) { - MathBlockOperations2[MathBlockOperations2["Add"] = 0] = "Add"; - MathBlockOperations2[MathBlockOperations2["Subtract"] = 1] = "Subtract"; - MathBlockOperations2[MathBlockOperations2["Multiply"] = 2] = "Multiply"; - MathBlockOperations2[MathBlockOperations2["Divide"] = 3] = "Divide"; - MathBlockOperations2[MathBlockOperations2["Max"] = 4] = "Max"; - MathBlockOperations2[MathBlockOperations2["Min"] = 5] = "Min"; -})(MathBlockOperations || (MathBlockOperations = {})); +var init_setTangentsBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], SetTangentsBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.SetTangentsBlock", SetTangentsBlock); +}); +// node_modules/@babylonjs/core/Meshes/Node/Blocks/mathBlock.js class MathBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.operation = MathBlockOperations.Add; this.registerInput("left", NodeGeometryBlockConnectionPointTypes.AutoDetect); this.registerInput("right", NodeGeometryBlockConnectionPointTypes.AutoDetect); @@ -143033,24 +155917,42 @@ class MathBlock extends NodeGeometryBlock { this.operation = serializationObject.operation; } } -__decorate2([ - editableInPropertyPage("Operation", PropertyTypeForEdition.List, "ADVANCED", { - notifiers: { rebuild: true }, - options: [ - { label: "Add", value: MathBlockOperations.Add }, - { label: "Subtract", value: MathBlockOperations.Subtract }, - { label: "Multiply", value: MathBlockOperations.Multiply }, - { label: "Divide", value: MathBlockOperations.Divide }, - { label: "Max", value: MathBlockOperations.Max }, - { label: "Min", value: MathBlockOperations.Min } - ] - }) -], MathBlock.prototype, "operation", undefined); -RegisterClass("BABYLON.MathBlock", MathBlock); +var MathBlockOperations; +var init_mathBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_math_vector(); + init_nodeDecorator(); + (function(MathBlockOperations2) { + MathBlockOperations2[MathBlockOperations2["Add"] = 0] = "Add"; + MathBlockOperations2[MathBlockOperations2["Subtract"] = 1] = "Subtract"; + MathBlockOperations2[MathBlockOperations2["Multiply"] = 2] = "Multiply"; + MathBlockOperations2[MathBlockOperations2["Divide"] = 3] = "Divide"; + MathBlockOperations2[MathBlockOperations2["Max"] = 4] = "Max"; + MathBlockOperations2[MathBlockOperations2["Min"] = 5] = "Min"; + })(MathBlockOperations || (MathBlockOperations = {})); + __decorate2([ + editableInPropertyPage("Operation", PropertyTypeForEdition.List, "ADVANCED", { + notifiers: { rebuild: true }, + options: [ + { label: "Add", value: MathBlockOperations.Add }, + { label: "Subtract", value: MathBlockOperations.Subtract }, + { label: "Multiply", value: MathBlockOperations.Multiply }, + { label: "Divide", value: MathBlockOperations.Divide }, + { label: "Max", value: MathBlockOperations.Max }, + { label: "Min", value: MathBlockOperations.Min } + ] + }) + ], MathBlock.prototype, "operation", undefined); + RegisterClass("BABYLON.MathBlock", MathBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/mapRangeBlock.js class MapRangeBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect); this.registerInput("fromMin", NodeGeometryBlockConnectionPointTypes.Float, true, 0); this.registerInput("fromMax", NodeGeometryBlockConnectionPointTypes.Float, true, 1); @@ -143106,24 +156008,17 @@ class MapRangeBlock extends NodeGeometryBlock { }; } } -RegisterClass("BABYLON.MapRangeBlock", MapRangeBlock); -// node_modules/@babylonjs/core/Meshes/Node/Blocks/conditionBlock.js -var ConditionBlockTests; -(function(ConditionBlockTests2) { - ConditionBlockTests2[ConditionBlockTests2["Equal"] = 0] = "Equal"; - ConditionBlockTests2[ConditionBlockTests2["NotEqual"] = 1] = "NotEqual"; - ConditionBlockTests2[ConditionBlockTests2["LessThan"] = 2] = "LessThan"; - ConditionBlockTests2[ConditionBlockTests2["GreaterThan"] = 3] = "GreaterThan"; - ConditionBlockTests2[ConditionBlockTests2["LessOrEqual"] = 4] = "LessOrEqual"; - ConditionBlockTests2[ConditionBlockTests2["GreaterOrEqual"] = 5] = "GreaterOrEqual"; - ConditionBlockTests2[ConditionBlockTests2["Xor"] = 6] = "Xor"; - ConditionBlockTests2[ConditionBlockTests2["Or"] = 7] = "Or"; - ConditionBlockTests2[ConditionBlockTests2["And"] = 8] = "And"; -})(ConditionBlockTests || (ConditionBlockTests = {})); +var init_mapRangeBlock = __esm(() => { + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + RegisterClass("BABYLON.MapRangeBlock", MapRangeBlock); +}); +// node_modules/@babylonjs/core/Meshes/Node/Blocks/conditionBlock.js class ConditionBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.test = ConditionBlockTests.Equal; this.registerInput("left", NodeGeometryBlockConnectionPointTypes.Float); this.registerInput("right", NodeGeometryBlockConnectionPointTypes.Float, true, 0); @@ -143216,34 +156111,49 @@ class ConditionBlock extends NodeGeometryBlock { this.test = serializationObject.test; } } -__decorate2([ - editableInPropertyPage("Test", PropertyTypeForEdition.List, "ADVANCED", { - notifiers: { rebuild: true }, - options: [ - { label: "Equal", value: ConditionBlockTests.Equal }, - { label: "NotEqual", value: ConditionBlockTests.NotEqual }, - { label: "LessThan", value: ConditionBlockTests.LessThan }, - { label: "GreaterThan", value: ConditionBlockTests.GreaterThan }, - { label: "LessOrEqual", value: ConditionBlockTests.LessOrEqual }, - { label: "GreaterOrEqual", value: ConditionBlockTests.GreaterOrEqual }, - { label: "Xor", value: ConditionBlockTests.Xor }, - { label: "Or", value: ConditionBlockTests.Or }, - { label: "And", value: ConditionBlockTests.And } - ] - }) -], ConditionBlock.prototype, "test", undefined); -RegisterClass("BABYLON.ConditionBlock", ConditionBlock); -// node_modules/@babylonjs/core/Meshes/Node/Blocks/randomBlock.js -var RandomBlockLocks; -(function(RandomBlockLocks2) { - RandomBlockLocks2[RandomBlockLocks2["None"] = 0] = "None"; - RandomBlockLocks2[RandomBlockLocks2["LoopID"] = 1] = "LoopID"; - RandomBlockLocks2[RandomBlockLocks2["InstanceID"] = 2] = "InstanceID"; -})(RandomBlockLocks || (RandomBlockLocks = {})); +var ConditionBlockTests; +var init_conditionBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeDecorator(); + init_math_scalar(); + init_math_constants(); + (function(ConditionBlockTests2) { + ConditionBlockTests2[ConditionBlockTests2["Equal"] = 0] = "Equal"; + ConditionBlockTests2[ConditionBlockTests2["NotEqual"] = 1] = "NotEqual"; + ConditionBlockTests2[ConditionBlockTests2["LessThan"] = 2] = "LessThan"; + ConditionBlockTests2[ConditionBlockTests2["GreaterThan"] = 3] = "GreaterThan"; + ConditionBlockTests2[ConditionBlockTests2["LessOrEqual"] = 4] = "LessOrEqual"; + ConditionBlockTests2[ConditionBlockTests2["GreaterOrEqual"] = 5] = "GreaterOrEqual"; + ConditionBlockTests2[ConditionBlockTests2["Xor"] = 6] = "Xor"; + ConditionBlockTests2[ConditionBlockTests2["Or"] = 7] = "Or"; + ConditionBlockTests2[ConditionBlockTests2["And"] = 8] = "And"; + })(ConditionBlockTests || (ConditionBlockTests = {})); + __decorate2([ + editableInPropertyPage("Test", PropertyTypeForEdition.List, "ADVANCED", { + notifiers: { rebuild: true }, + options: [ + { label: "Equal", value: ConditionBlockTests.Equal }, + { label: "NotEqual", value: ConditionBlockTests.NotEqual }, + { label: "LessThan", value: ConditionBlockTests.LessThan }, + { label: "GreaterThan", value: ConditionBlockTests.GreaterThan }, + { label: "LessOrEqual", value: ConditionBlockTests.LessOrEqual }, + { label: "GreaterOrEqual", value: ConditionBlockTests.GreaterOrEqual }, + { label: "Xor", value: ConditionBlockTests.Xor }, + { label: "Or", value: ConditionBlockTests.Or }, + { label: "And", value: ConditionBlockTests.And } + ] + }) + ], ConditionBlock.prototype, "test", undefined); + RegisterClass("BABYLON.ConditionBlock", ConditionBlock); +}); +// node_modules/@babylonjs/core/Meshes/Node/Blocks/randomBlock.js class RandomBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this._currentLockId = -1; this.lockMode = RandomBlockLocks.None; this.registerInput("min", NodeGeometryBlockConnectionPointTypes.AutoDetect); @@ -143355,21 +156265,38 @@ class RandomBlock extends NodeGeometryBlock { this.lockMode = serializationObject.lockMode; } } -__decorate2([ - editableInPropertyPage("LockMode", PropertyTypeForEdition.List, "ADVANCED", { - notifiers: { rebuild: true }, - options: [ - { label: "None", value: RandomBlockLocks.None }, - { label: "LoopID", value: RandomBlockLocks.LoopID }, - { label: "InstanceID", value: RandomBlockLocks.InstanceID } - ] - }) -], RandomBlock.prototype, "lockMode", undefined); -RegisterClass("BABYLON.RandomBlock", RandomBlock); +var RandomBlockLocks; +var init_randomBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_geometryInputBlock(); + init_math_vector(); + init_nodeDecorator(); + init_nodeGeometryContextualSources(); + (function(RandomBlockLocks2) { + RandomBlockLocks2[RandomBlockLocks2["None"] = 0] = "None"; + RandomBlockLocks2[RandomBlockLocks2["LoopID"] = 1] = "LoopID"; + RandomBlockLocks2[RandomBlockLocks2["InstanceID"] = 2] = "InstanceID"; + })(RandomBlockLocks || (RandomBlockLocks = {})); + __decorate2([ + editableInPropertyPage("LockMode", PropertyTypeForEdition.List, "ADVANCED", { + notifiers: { rebuild: true }, + options: [ + { label: "None", value: RandomBlockLocks.None }, + { label: "LoopID", value: RandomBlockLocks.LoopID }, + { label: "InstanceID", value: RandomBlockLocks.InstanceID } + ] + }) + ], RandomBlock.prototype, "lockMode", undefined); + RegisterClass("BABYLON.RandomBlock", RandomBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/noiseBlock.js class NoiseBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("offset", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero()); this.registerInput("scale", NodeGeometryBlockConnectionPointTypes.Float, true, 1); this.registerInput("octaves", NodeGeometryBlockConnectionPointTypes.Float, true, 2, 0, 16); @@ -143492,11 +156419,20 @@ class NoiseBlock extends NodeGeometryBlock { }; } } -RegisterClass("BABYLON.NoiseBlock", NoiseBlock); +var init_noiseBlock = __esm(() => { + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_math_vector(); + init_math_scalar(); + init_nodeGeometryContextualSources(); + RegisterClass("BABYLON.NoiseBlock", NoiseBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/mergeGeometryBlock.js class MergeGeometryBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = false; this.registerInput("geometry0", NodeGeometryBlockConnectionPointTypes.Geometry); this.registerInput("geometry1", NodeGeometryBlockConnectionPointTypes.Geometry, true); @@ -143585,14 +156521,22 @@ class MergeGeometryBlock extends NodeGeometryBlock { this.evaluateContext = serializationObject.evaluateContext; } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], MergeGeometryBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.MergeGeometryBlock", MergeGeometryBlock); +var init_mergeGeometryBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], MergeGeometryBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.MergeGeometryBlock", MergeGeometryBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryCollectionBlock.js class GeometryCollectionBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = true; this.registerInput("geometry0", NodeGeometryBlockConnectionPointTypes.Geometry, true); this.registerInput("geometry1", NodeGeometryBlockConnectionPointTypes.Geometry, true); @@ -143694,14 +156638,22 @@ class GeometryCollectionBlock extends NodeGeometryBlock { this.evaluateContext = serializationObject.evaluateContext; } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], GeometryCollectionBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.GeometryCollectionBlock", GeometryCollectionBlock); +var init_geometryCollectionBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], GeometryCollectionBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.GeometryCollectionBlock", GeometryCollectionBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryElbowBlock.js class GeometryElbowBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("input", NodeGeometryBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput); this._outputs[0]._typeConnectionSource = this._inputs[0]; @@ -143727,11 +156679,17 @@ class GeometryElbowBlock extends NodeGeometryBlock { }; } } -RegisterClass("BABYLON.GeometryElbowBlock", GeometryElbowBlock); +var init_geometryElbowBlock = __esm(() => { + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + RegisterClass("BABYLON.GeometryElbowBlock", GeometryElbowBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/computeNormalsBlock.js class ComputeNormalsBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry); this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry); } @@ -143758,11 +156716,18 @@ class ComputeNormalsBlock extends NodeGeometryBlock { }; } } -RegisterClass("BABYLON.ComputeNormalsBlock", ComputeNormalsBlock); +var init_computeNormalsBlock = __esm(() => { + init_mesh_vertexData(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + RegisterClass("BABYLON.ComputeNormalsBlock", ComputeNormalsBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/vectorConverterBlock.js class VectorConverterBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("xyzw ", NodeGeometryBlockConnectionPointTypes.Vector4, true); this.registerInput("xyz ", NodeGeometryBlockConnectionPointTypes.Vector3, true); this.registerInput("xy ", NodeGeometryBlockConnectionPointTypes.Vector2, true); @@ -143831,35 +156796,35 @@ class VectorConverterBlock extends NodeGeometryBlock { get wOut() { return this._outputs[7]; } - _inputRename(name185) { - if (name185 === "xyzw ") { + _inputRename(name186) { + if (name186 === "xyzw ") { return "xyzwIn"; } - if (name185 === "xyz ") { + if (name186 === "xyz ") { return "xyzIn"; } - if (name185 === "xy ") { + if (name186 === "xy ") { return "xyIn"; } - if (name185 === "zw ") { + if (name186 === "zw ") { return "zwIn"; } - if (name185 === "x ") { + if (name186 === "x ") { return "xIn"; } - if (name185 === "y ") { + if (name186 === "y ") { return "yIn"; } - if (name185 === "z ") { + if (name186 === "z ") { return "zIn"; } - if (name185 === "w ") { + if (name186 === "w ") { return "wIn"; } - return name185; + return name186; } - _outputRename(name185) { - switch (name185) { + _outputRename(name186) { + switch (name186) { case "x": return "xOut"; case "y": @@ -143877,7 +156842,7 @@ class VectorConverterBlock extends NodeGeometryBlock { case "xyzw": return "xyzwOut"; default: - return name185; + return name186; } } _buildBlock(state) { @@ -143961,11 +156926,18 @@ class VectorConverterBlock extends NodeGeometryBlock { wOutput._storedFunction = (state2) => getData(state2).w; } } -RegisterClass("BABYLON.VectorConverterBlock", VectorConverterBlock); +var init_vectorConverterBlock = __esm(() => { + init_math_vector(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + RegisterClass("BABYLON.VectorConverterBlock", VectorConverterBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/normalizeVectorBlock.js class NormalizeVectorBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("input", NodeGeometryBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput); this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float); @@ -143993,11 +156965,17 @@ class NormalizeVectorBlock extends NodeGeometryBlock { this.output._storedFunction = (state2) => this.input.getConnectedValue(state2).normalize(); } } -RegisterClass("BABYLON.NormalizeVectorBlock", NormalizeVectorBlock); +var init_normalizeVectorBlock = __esm(() => { + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + RegisterClass("BABYLON.NormalizeVectorBlock", NormalizeVectorBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Set/setMaterialIDBlock.js class SetMaterialIDBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = true; this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry); this.registerInput("id", NodeGeometryBlockConnectionPointTypes.Int, true, 0); @@ -144059,37 +157037,23 @@ class SetMaterialIDBlock extends NodeGeometryBlock { } } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], SetMaterialIDBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.SetMaterialIDBlock", SetMaterialIDBlock); -// node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryTrigonometryBlock.js -var GeometryTrigonometryBlockOperations; -(function(GeometryTrigonometryBlockOperations2) { - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Cos"] = 0] = "Cos"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Sin"] = 1] = "Sin"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Abs"] = 2] = "Abs"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Exp"] = 3] = "Exp"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Round"] = 4] = "Round"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Floor"] = 5] = "Floor"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Ceiling"] = 6] = "Ceiling"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Sqrt"] = 7] = "Sqrt"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Log"] = 8] = "Log"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Tan"] = 9] = "Tan"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["ArcTan"] = 10] = "ArcTan"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["ArcCos"] = 11] = "ArcCos"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["ArcSin"] = 12] = "ArcSin"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Sign"] = 13] = "Sign"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Negate"] = 14] = "Negate"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["OneMinus"] = 15] = "OneMinus"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Reciprocal"] = 16] = "Reciprocal"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["ToDegrees"] = 17] = "ToDegrees"; - GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["ToRadians"] = 18] = "ToRadians"; -})(GeometryTrigonometryBlockOperations || (GeometryTrigonometryBlockOperations = {})); +var init_setMaterialIDBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_mesh_vertexData(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], SetMaterialIDBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.SetMaterialIDBlock", SetMaterialIDBlock); +}); +// node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryTrigonometryBlock.js class GeometryTrigonometryBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.operation = GeometryTrigonometryBlockOperations.Cos; this.registerInput("input", NodeGeometryBlockConnectionPointTypes.AutoDetect); this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput); @@ -144240,37 +157204,68 @@ class GeometryTrigonometryBlock extends NodeGeometryBlock { return codeString; } } -__decorate2([ - editableInPropertyPage("Operation", PropertyTypeForEdition.List, "ADVANCED", { - notifiers: { rebuild: true }, - options: [ - { label: "Cos", value: GeometryTrigonometryBlockOperations.Cos }, - { label: "Sin", value: GeometryTrigonometryBlockOperations.Sin }, - { label: "Abs", value: GeometryTrigonometryBlockOperations.Abs }, - { label: "Exp", value: GeometryTrigonometryBlockOperations.Exp }, - { label: "Round", value: GeometryTrigonometryBlockOperations.Round }, - { label: "Floor", value: GeometryTrigonometryBlockOperations.Floor }, - { label: "Ceiling", value: GeometryTrigonometryBlockOperations.Ceiling }, - { label: "Sqrt", value: GeometryTrigonometryBlockOperations.Sqrt }, - { label: "Log", value: GeometryTrigonometryBlockOperations.Log }, - { label: "Tan", value: GeometryTrigonometryBlockOperations.Tan }, - { label: "ArcTan", value: GeometryTrigonometryBlockOperations.ArcTan }, - { label: "ArcCos", value: GeometryTrigonometryBlockOperations.ArcCos }, - { label: "ArcSin", value: GeometryTrigonometryBlockOperations.ArcSin }, - { label: "Sign", value: GeometryTrigonometryBlockOperations.Sign }, - { label: "Negate", value: GeometryTrigonometryBlockOperations.Negate }, - { label: "OneMinus", value: GeometryTrigonometryBlockOperations.OneMinus }, - { label: "Reciprocal", value: GeometryTrigonometryBlockOperations.Reciprocal }, - { label: "ToDegrees", value: GeometryTrigonometryBlockOperations.ToDegrees }, - { label: "ToRadians", value: GeometryTrigonometryBlockOperations.ToRadians } - ] - }) -], GeometryTrigonometryBlock.prototype, "operation", undefined); -RegisterClass("BABYLON.GeometryTrigonometryBlock", GeometryTrigonometryBlock); +var GeometryTrigonometryBlockOperations; +var init_geometryTrigonometryBlock = __esm(() => { + init_tslib_es62(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + init_math_vector(); + init_nodeDecorator(); + (function(GeometryTrigonometryBlockOperations2) { + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Cos"] = 0] = "Cos"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Sin"] = 1] = "Sin"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Abs"] = 2] = "Abs"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Exp"] = 3] = "Exp"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Round"] = 4] = "Round"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Floor"] = 5] = "Floor"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Ceiling"] = 6] = "Ceiling"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Sqrt"] = 7] = "Sqrt"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Log"] = 8] = "Log"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Tan"] = 9] = "Tan"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["ArcTan"] = 10] = "ArcTan"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["ArcCos"] = 11] = "ArcCos"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["ArcSin"] = 12] = "ArcSin"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Sign"] = 13] = "Sign"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Negate"] = 14] = "Negate"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["OneMinus"] = 15] = "OneMinus"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["Reciprocal"] = 16] = "Reciprocal"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["ToDegrees"] = 17] = "ToDegrees"; + GeometryTrigonometryBlockOperations2[GeometryTrigonometryBlockOperations2["ToRadians"] = 18] = "ToRadians"; + })(GeometryTrigonometryBlockOperations || (GeometryTrigonometryBlockOperations = {})); + __decorate2([ + editableInPropertyPage("Operation", PropertyTypeForEdition.List, "ADVANCED", { + notifiers: { rebuild: true }, + options: [ + { label: "Cos", value: GeometryTrigonometryBlockOperations.Cos }, + { label: "Sin", value: GeometryTrigonometryBlockOperations.Sin }, + { label: "Abs", value: GeometryTrigonometryBlockOperations.Abs }, + { label: "Exp", value: GeometryTrigonometryBlockOperations.Exp }, + { label: "Round", value: GeometryTrigonometryBlockOperations.Round }, + { label: "Floor", value: GeometryTrigonometryBlockOperations.Floor }, + { label: "Ceiling", value: GeometryTrigonometryBlockOperations.Ceiling }, + { label: "Sqrt", value: GeometryTrigonometryBlockOperations.Sqrt }, + { label: "Log", value: GeometryTrigonometryBlockOperations.Log }, + { label: "Tan", value: GeometryTrigonometryBlockOperations.Tan }, + { label: "ArcTan", value: GeometryTrigonometryBlockOperations.ArcTan }, + { label: "ArcCos", value: GeometryTrigonometryBlockOperations.ArcCos }, + { label: "ArcSin", value: GeometryTrigonometryBlockOperations.ArcSin }, + { label: "Sign", value: GeometryTrigonometryBlockOperations.Sign }, + { label: "Negate", value: GeometryTrigonometryBlockOperations.Negate }, + { label: "OneMinus", value: GeometryTrigonometryBlockOperations.OneMinus }, + { label: "Reciprocal", value: GeometryTrigonometryBlockOperations.Reciprocal }, + { label: "ToDegrees", value: GeometryTrigonometryBlockOperations.ToDegrees }, + { label: "ToRadians", value: GeometryTrigonometryBlockOperations.ToRadians } + ] + }) + ], GeometryTrigonometryBlock.prototype, "operation", undefined); + RegisterClass("BABYLON.GeometryTrigonometryBlock", GeometryTrigonometryBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryTransformBlock.js class GeometryTransformBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this._rotationMatrix = new Matrix; this._scalingMatrix = new Matrix; this._translationMatrix = new Matrix; @@ -144372,14 +157367,23 @@ class GeometryTransformBlock extends NodeGeometryBlock { } } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], GeometryTransformBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.GeometryTransformBlock", GeometryTransformBlock); +var init_geometryTransformBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_math_vector(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], GeometryTransformBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.GeometryTransformBlock", GeometryTransformBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Matrices/rotationXBlock.js class RotationXBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("angle", NodeGeometryBlockConnectionPointTypes.Float, false, 0); this.registerOutput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix); } @@ -144406,11 +157410,19 @@ class RotationXBlock extends NodeGeometryBlock { }; } } -RegisterClass("BABYLON.RotationXBlock", RotationXBlock); +var init_rotationXBlock = __esm(() => { + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_geometryInputBlock(); + init_math_vector(); + RegisterClass("BABYLON.RotationXBlock", RotationXBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Matrices/rotationYBlock.js class RotationYBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("angle", NodeGeometryBlockConnectionPointTypes.Float, false, 0); this.registerOutput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix); } @@ -144437,11 +157449,19 @@ class RotationYBlock extends NodeGeometryBlock { }; } } -RegisterClass("BABYLON.RotationYBlock", RotationYBlock); +var init_rotationYBlock = __esm(() => { + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_geometryInputBlock(); + init_math_vector(); + RegisterClass("BABYLON.RotationYBlock", RotationYBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Matrices/rotationZBlock.js class RotationZBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("angle", NodeGeometryBlockConnectionPointTypes.Float, false, 0); this.registerOutput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix); } @@ -144468,11 +157488,19 @@ class RotationZBlock extends NodeGeometryBlock { }; } } -RegisterClass("BABYLON.RotationZBlock", RotationZBlock); +var init_rotationZBlock = __esm(() => { + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_geometryInputBlock(); + init_math_vector(); + RegisterClass("BABYLON.RotationZBlock", RotationZBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Matrices/scalingBlock.js class ScalingBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("scale", NodeGeometryBlockConnectionPointTypes.Vector3, false, Vector3.One()); this.registerOutput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix); } @@ -144500,11 +157528,19 @@ class ScalingBlock extends NodeGeometryBlock { }; } } -RegisterClass("BABYLON.ScalingBlock", ScalingBlock); +var init_scalingBlock = __esm(() => { + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_geometryInputBlock(); + init_math_vector(); + RegisterClass("BABYLON.ScalingBlock", ScalingBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Matrices/alignBlock.js class AlignBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("source", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Up()); this.registerInput("target", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Left()); this.registerOutput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix); @@ -144534,11 +157570,18 @@ class AlignBlock extends NodeGeometryBlock { }; } } -RegisterClass("BABYLON.AlignBlock", AlignBlock); +var init_alignBlock = __esm(() => { + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_math_vector(); + RegisterClass("BABYLON.AlignBlock", AlignBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Matrices/translationBlock.js class TranslationBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("translation", NodeGeometryBlockConnectionPointTypes.Vector3, false, Vector3.Zero()); this.registerOutput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix); } @@ -144566,11 +157609,19 @@ class TranslationBlock extends NodeGeometryBlock { }; } } -RegisterClass("BABYLON.TranslationBlock", TranslationBlock); +var init_translationBlock = __esm(() => { + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_geometryInputBlock(); + init_math_vector(); + RegisterClass("BABYLON.TranslationBlock", TranslationBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js class InstantiateOnVerticesBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this._indexTranslation = null; this.evaluateContext = true; this.removeDuplicatedPositions = true; @@ -144726,17 +157777,27 @@ class InstantiateOnVerticesBlock extends NodeGeometryBlock { } } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], InstantiateOnVerticesBlock.prototype, "evaluateContext", undefined); -__decorate2([ - editableInPropertyPage("Remove duplicated positions", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) -], InstantiateOnVerticesBlock.prototype, "removeDuplicatedPositions", undefined); -RegisterClass("BABYLON.InstantiateOnVerticesBlock", InstantiateOnVerticesBlock); +var init_instantiateOnVerticesBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_math_vector(); + init_nodeDecorator(); + init_math_constants(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], InstantiateOnVerticesBlock.prototype, "evaluateContext", undefined); + __decorate2([ + editableInPropertyPage("Remove duplicated positions", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { update: true } }) + ], InstantiateOnVerticesBlock.prototype, "removeDuplicatedPositions", undefined); + RegisterClass("BABYLON.InstantiateOnVerticesBlock", InstantiateOnVerticesBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js class InstantiateOnFacesBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this._currentPosition = new Vector3; this._currentUV = new Vector2; this._vertex0 = new Vector3; @@ -144916,14 +157977,23 @@ class InstantiateOnFacesBlock extends NodeGeometryBlock { } } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], InstantiateOnFacesBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.InstantiateOnFacesBlock", InstantiateOnFacesBlock); +var init_instantiateOnFacesBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_math_vector(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], InstantiateOnFacesBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.InstantiateOnFacesBlock", InstantiateOnFacesBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js class InstantiateOnVolumeBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this._currentPosition = new Vector3; this._vertex0 = new Vector3; this._vertex1 = new Vector3; @@ -145067,14 +158137,25 @@ class InstantiateOnVolumeBlock extends NodeGeometryBlock { } } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], InstantiateOnVolumeBlock.prototype, "evaluateContext", undefined); -RegisterClass("BABYLON.InstantiateOnVolumeBlock", InstantiateOnVolumeBlock); +var init_instantiateOnVolumeBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_math_vector(); + init_nodeDecorator(); + init_ray(); + init_math_functions(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], InstantiateOnVolumeBlock.prototype, "evaluateContext", undefined); + RegisterClass("BABYLON.InstantiateOnVolumeBlock", InstantiateOnVolumeBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js class InstantiateBaseBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = true; this.registerInput("instance", NodeGeometryBlockConnectionPointTypes.Geometry, true); this.registerInput("count", NodeGeometryBlockConnectionPointTypes.Int, true, 1); @@ -145120,14 +158201,20 @@ class InstantiateBaseBlock extends NodeGeometryBlock { } } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], InstantiateBaseBlock.prototype, "evaluateContext", undefined); +var init_instantiateBaseBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_nodeGeometryConnectionPointTypes(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], InstantiateBaseBlock.prototype, "evaluateContext", undefined); +}); // node_modules/@babylonjs/core/Meshes/Node/Blocks/Instances/instantiateBlock.js class InstantiateBlock extends InstantiateBaseBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("matrix", NodeGeometryBlockConnectionPointTypes.Matrix, true); this.registerInput("position", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero()); this.registerInput("rotation", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero()); @@ -145203,11 +158290,18 @@ class InstantiateBlock extends InstantiateBaseBlock { } } } -RegisterClass("BABYLON.InstantiateBlock", InstantiateBlock); +var init_instantiateBlock = __esm(() => { + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_math_vector(); + init_instantiateBaseBlock(); + RegisterClass("BABYLON.InstantiateBlock", InstantiateBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Instances/instantiateLinearBlock.js class InstantiateLinearBlock extends InstantiateBaseBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("direction", NodeGeometryBlockConnectionPointTypes.Vector3, true, new Vector3(1, 0, 0)); this.registerInput("rotation", NodeGeometryBlockConnectionPointTypes.Vector3, true, new Vector3(0, 0, 0)); this.registerInput("scaling", NodeGeometryBlockConnectionPointTypes.Vector3, true, new Vector3(0, 0, 0)); @@ -145271,11 +158365,18 @@ class InstantiateLinearBlock extends InstantiateBaseBlock { } } } -RegisterClass("BABYLON.InstantiateLinearBlock", InstantiateLinearBlock); +var init_instantiateLinearBlock = __esm(() => { + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_math_vector(); + init_instantiateBaseBlock(); + RegisterClass("BABYLON.InstantiateLinearBlock", InstantiateLinearBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Instances/instantiateRadialBlock.js class InstantiateRadialBlock extends InstantiateBaseBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("radius", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 0); this.registerInput("angleStart", NodeGeometryBlockConnectionPointTypes.Float, true, 0); this.registerInput("angleEnd", NodeGeometryBlockConnectionPointTypes.Float, true, Math.PI * 2); @@ -145364,11 +158465,18 @@ class InstantiateRadialBlock extends InstantiateBaseBlock { } } } -RegisterClass("BABYLON.InstantiateRadialBlock", InstantiateRadialBlock); +var init_instantiateRadialBlock = __esm(() => { + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_math_vector(); + init_instantiateBaseBlock(); + RegisterClass("BABYLON.InstantiateRadialBlock", InstantiateRadialBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/intFloatConverterBlock.js class IntFloatConverterBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("float ", NodeGeometryBlockConnectionPointTypes.Float, true); this.registerInput("int ", NodeGeometryBlockConnectionPointTypes.Int, true); this.registerOutput("float", NodeGeometryBlockConnectionPointTypes.Float); @@ -145389,14 +158497,14 @@ class IntFloatConverterBlock extends NodeGeometryBlock { get intOut() { return this._outputs[1]; } - _inputRename(name185) { - if (name185 === "float ") { + _inputRename(name186) { + if (name186 === "float ") { return "floatIn"; } - if (name185 === "int ") { + if (name186 === "int ") { return "intIn"; } - return name185; + return name186; } _buildBlock() { this.floatOut._storedFunction = (state) => { @@ -145419,11 +158527,17 @@ class IntFloatConverterBlock extends NodeGeometryBlock { }; } } -RegisterClass("BABYLON.IntFloatConverterBlock", IntFloatConverterBlock); +var init_intFloatConverterBlock = __esm(() => { + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + RegisterClass("BABYLON.IntFloatConverterBlock", IntFloatConverterBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/debugBlock.js class DebugBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.log = []; this._isDebug = true; this.registerInput("input", NodeGeometryBlockConnectionPointTypes.AutoDetect); @@ -145467,11 +158581,17 @@ class DebugBlock extends NodeGeometryBlock { } } } -RegisterClass("BABYLON.DebugBlock", DebugBlock); +var init_debugBlock = __esm(() => { + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + RegisterClass("BABYLON.DebugBlock", DebugBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryInfoBlock.js class GeometryInfoBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry); this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry); this.registerOutput("id", NodeGeometryBlockConnectionPointTypes.Int); @@ -145536,18 +158656,17 @@ class GeometryInfoBlock extends NodeGeometryBlock { }; } } -RegisterClass("BABYLON.GeometryInfoBlock", GeometryInfoBlock); -// node_modules/@babylonjs/core/Meshes/Node/Blocks/mappingBlock.js -var MappingTypes; -(function(MappingTypes2) { - MappingTypes2[MappingTypes2["Spherical"] = 0] = "Spherical"; - MappingTypes2[MappingTypes2["Cylindrical"] = 1] = "Cylindrical"; - MappingTypes2[MappingTypes2["Cubic"] = 2] = "Cubic"; -})(MappingTypes || (MappingTypes = {})); +var init_geometryInfoBlock = __esm(() => { + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + RegisterClass("BABYLON.GeometryInfoBlock", GeometryInfoBlock); +}); +// node_modules/@babylonjs/core/Meshes/Node/Blocks/mappingBlock.js class MappingBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.mapping = MappingTypes.Spherical; this.registerInput("position", NodeGeometryBlockConnectionPointTypes.Vector3); this.registerInput("normal", NodeGeometryBlockConnectionPointTypes.Vector3); @@ -145642,21 +158761,36 @@ class MappingBlock extends NodeGeometryBlock { this.mapping = serializationObject.mapping; } } -__decorate2([ - editableInPropertyPage("Mapping", PropertyTypeForEdition.List, "ADVANCED", { - notifiers: { rebuild: true }, - options: [ - { label: "Spherical", value: MappingTypes.Spherical }, - { label: "Cylindrical", value: MappingTypes.Cylindrical }, - { label: "Cubic", value: MappingTypes.Cubic } - ] - }) -], MappingBlock.prototype, "mapping", undefined); -RegisterClass("BABYLON.MappingBlock", MappingBlock); +var MappingTypes; +var init_mappingBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeDecorator(); + init_math_vector(); + (function(MappingTypes2) { + MappingTypes2[MappingTypes2["Spherical"] = 0] = "Spherical"; + MappingTypes2[MappingTypes2["Cylindrical"] = 1] = "Cylindrical"; + MappingTypes2[MappingTypes2["Cubic"] = 2] = "Cubic"; + })(MappingTypes || (MappingTypes = {})); + __decorate2([ + editableInPropertyPage("Mapping", PropertyTypeForEdition.List, "ADVANCED", { + notifiers: { rebuild: true }, + options: [ + { label: "Spherical", value: MappingTypes.Spherical }, + { label: "Cylindrical", value: MappingTypes.Cylindrical }, + { label: "Cubic", value: MappingTypes.Cubic } + ] + }) + ], MappingBlock.prototype, "mapping", undefined); + RegisterClass("BABYLON.MappingBlock", MappingBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/matrixComposeBlock.js class MatrixComposeBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("matrix0", NodeGeometryBlockConnectionPointTypes.Matrix); this.registerInput("matrix1", NodeGeometryBlockConnectionPointTypes.Matrix); this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Matrix); @@ -145687,14 +158821,20 @@ class MatrixComposeBlock extends NodeGeometryBlock { }; } } -RegisterClass("BABYLON.MatrixComposeBlock", MatrixComposeBlock); +var init_matrixComposeBlock = __esm(() => { + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + RegisterClass("BABYLON.MatrixComposeBlock", MatrixComposeBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Teleport/teleportInBlock.js class TeleportInBlock extends NodeGeometryBlock { get endpoints() { return this._endpoints; } - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this._endpoints = []; this._isTeleportIn = true; this.registerInput("input", NodeGeometryBlockConnectionPointTypes.AutoDetect); @@ -145772,11 +158912,17 @@ class TeleportInBlock extends NodeGeometryBlock { } } } -RegisterClass("BABYLON.TeleportInBlock", TeleportInBlock); +var init_teleportInBlock2 = __esm(() => { + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + RegisterClass("BABYLON.TeleportInBlock", TeleportInBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Teleport/teleportOutBlock.js class TeleportOutBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this._entryPoint = null; this._tempEntryPointUniqueId = null; this._isTeleportOut = true; @@ -145845,7 +158991,13 @@ class TeleportOutBlock extends NodeGeometryBlock { this._tempEntryPointUniqueId = serializationObject.entryPoint; } } -RegisterClass("BABYLON.TeleportOutBlock", TeleportOutBlock); +var init_teleportOutBlock2 = __esm(() => { + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + RegisterClass("BABYLON.TeleportOutBlock", TeleportOutBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Textures/geometryTextureBlock.js class GeometryTextureBlock extends NodeGeometryBlock { get textureData() { @@ -145857,8 +159009,8 @@ class GeometryTextureBlock extends NodeGeometryBlock { get textureHeight() { return this._height; } - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this._data = null; this.serializedCachedData = false; this.registerOutput("texture", NodeGeometryBlockConnectionPointTypes.Texture); @@ -145960,14 +159112,23 @@ class GeometryTextureBlock extends NodeGeometryBlock { } } } -__decorate2([ - editableInPropertyPage("Serialize cached data", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], GeometryTextureBlock.prototype, "serializedCachedData", undefined); -RegisterClass("BABYLON.GeometryTextureBlock", GeometryTextureBlock); +var init_geometryTextureBlock = __esm(() => { + init_tslib_es62(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + init_textureTools(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Serialize cached data", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], GeometryTextureBlock.prototype, "serializedCachedData", undefined); + RegisterClass("BABYLON.GeometryTextureBlock", GeometryTextureBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js class GeometryTextureFetchBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.clampCoordinates = true; this.registerInput("texture", NodeGeometryBlockConnectionPointTypes.Texture); this.registerInput("coordinates", NodeGeometryBlockConnectionPointTypes.Vector2); @@ -146067,14 +159228,23 @@ class GeometryTextureFetchBlock extends NodeGeometryBlock { this.clampCoordinates = serializationObject.clampCoordinates; } } -__decorate2([ - editableInPropertyPage("Clamp Coordinates", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], GeometryTextureFetchBlock.prototype, "clampCoordinates", undefined); -RegisterClass("BABYLON.GeometryTextureFetchBlock", GeometryTextureFetchBlock); +var init_geometryTextureFetchBlock = __esm(() => { + init_tslib_es62(); + init_math_vector(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryBlock(); + init_nodeDecorator(); + __decorate2([ + editableInPropertyPage("Clamp Coordinates", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], GeometryTextureFetchBlock.prototype, "clampCoordinates", undefined); + RegisterClass("BABYLON.GeometryTextureFetchBlock", GeometryTextureFetchBlock); +}); + // node_modules/@babylonjs/core/Meshes/Node/Blocks/boundingBlock.js class BoundingBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry); this.registerOutput("min", NodeGeometryBlockConnectionPointTypes.Vector3); this.registerOutput("max", NodeGeometryBlockConnectionPointTypes.Vector3); @@ -146110,18 +159280,18 @@ class BoundingBlock extends NodeGeometryBlock { }; } } -RegisterClass("BABYLON.BoundingBlock", BoundingBlock); -// node_modules/@babylonjs/core/Meshes/Node/Blocks/booleanGeometryBlock.js -var BooleanGeometryOperations; -(function(BooleanGeometryOperations2) { - BooleanGeometryOperations2[BooleanGeometryOperations2["Intersect"] = 0] = "Intersect"; - BooleanGeometryOperations2[BooleanGeometryOperations2["Subtract"] = 1] = "Subtract"; - BooleanGeometryOperations2[BooleanGeometryOperations2["Union"] = 2] = "Union"; -})(BooleanGeometryOperations || (BooleanGeometryOperations = {})); +var init_boundingBlock = __esm(() => { + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_math_functions(); + RegisterClass("BABYLON.BoundingBlock", BoundingBlock); +}); +// node_modules/@babylonjs/core/Meshes/Node/Blocks/booleanGeometryBlock.js class BooleanGeometryBlock extends NodeGeometryBlock { - constructor(name185) { - super(name185); + constructor(name186) { + super(name186); this.evaluateContext = false; this.operation = BooleanGeometryOperations.Intersect; this.registerInput("geometry0", NodeGeometryBlockConnectionPointTypes.Geometry); @@ -146208,25 +159378,635 @@ class BooleanGeometryBlock extends NodeGeometryBlock { } } } -__decorate2([ - editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) -], BooleanGeometryBlock.prototype, "evaluateContext", undefined); -__decorate2([ - editableInPropertyPage("Operation", PropertyTypeForEdition.List, "ADVANCED", { - notifiers: { rebuild: true }, - options: [ - { label: "Intersect", value: BooleanGeometryOperations.Intersect }, - { label: "Subtract", value: BooleanGeometryOperations.Subtract }, - { label: "Union", value: BooleanGeometryOperations.Union } - ] - }) -], BooleanGeometryBlock.prototype, "operation", undefined); -RegisterClass("BABYLON.BooleanGeometryBlock", BooleanGeometryBlock); -// node_modules/@babylonjs/core/Offline/database.js -Engine2.OfflineProviderFactory = (urlToScene, callbackManifestChecked, disableManifestCheck = false) => { - return new Database(urlToScene, callbackManifestChecked, disableManifestCheck); -}; +var BooleanGeometryOperations; +var init_booleanGeometryBlock = __esm(() => { + init_tslib_es62(); + init_nodeGeometryBlock(); + init_typeStore(); + init_nodeGeometryConnectionPointTypes(); + init_nodeDecorator(); + init_csg(); + (function(BooleanGeometryOperations2) { + BooleanGeometryOperations2[BooleanGeometryOperations2["Intersect"] = 0] = "Intersect"; + BooleanGeometryOperations2[BooleanGeometryOperations2["Subtract"] = 1] = "Subtract"; + BooleanGeometryOperations2[BooleanGeometryOperations2["Union"] = 2] = "Union"; + })(BooleanGeometryOperations || (BooleanGeometryOperations = {})); + __decorate2([ + editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } }) + ], BooleanGeometryBlock.prototype, "evaluateContext", undefined); + __decorate2([ + editableInPropertyPage("Operation", PropertyTypeForEdition.List, "ADVANCED", { + notifiers: { rebuild: true }, + options: [ + { label: "Intersect", value: BooleanGeometryOperations.Intersect }, + { label: "Subtract", value: BooleanGeometryOperations.Subtract }, + { label: "Union", value: BooleanGeometryOperations.Union } + ] + }) + ], BooleanGeometryBlock.prototype, "operation", undefined); + RegisterClass("BABYLON.BooleanGeometryBlock", BooleanGeometryBlock); +}); + +// node_modules/@babylonjs/core/Meshes/Node/index.js +var init_Node2 = __esm(() => { + init_nodeGeometry(); + init_nodeGeometryBlock(); + init_nodeGeometryBlockConnectionPoint(); + init_nodeGeometryBuildState(); + init_nodeGeometryExecutionContext(); + init_nodeGeometryConnectionPointTypes(); + init_nodeGeometryContextualSources(); + init_geometryOptimizeBlock(); + init_geometryOutputBlock(); + init_geometryInputBlock(); + init_planeBlock(); + init_boxBlock(); + init_meshBlock(); + init_icoSphereBlock(); + init_sphereBlock(); + init_gridBlock(); + init_torusBlock(); + init_cylinderBlock(); + init_capsuleBlock(); + init_discBlock(); + init_nullBlock(); + init_setPositionsBlock(); + init_setNormalsBlock(); + init_setUVsBlock(); + init_setColorsBlock(); + init_setTangentsBlock(); + init_mathBlock(); + init_mapRangeBlock(); + init_conditionBlock(); + init_randomBlock(); + init_noiseBlock(); + init_mergeGeometryBlock(); + init_geometryCollectionBlock(); + init_geometryElbowBlock(); + init_computeNormalsBlock(); + init_vectorConverterBlock(); + init_normalizeVectorBlock(); + init_setMaterialIDBlock(); + init_geometryTrigonometryBlock(); + init_geometryTransformBlock(); + init_rotationXBlock(); + init_rotationYBlock(); + init_rotationZBlock(); + init_scalingBlock(); + init_alignBlock(); + init_translationBlock(); + init_instantiateOnVerticesBlock(); + init_instantiateOnFacesBlock(); + init_instantiateOnVolumeBlock(); + init_instantiateBlock(); + init_instantiateLinearBlock(); + init_instantiateRadialBlock(); + init_intFloatConverterBlock(); + init_debugBlock(); + init_geometryInfoBlock(); + init_mappingBlock(); + init_matrixComposeBlock(); + init_teleportInBlock2(); + init_teleportOutBlock2(); + init_geometryTextureBlock(); + init_geometryTextureFetchBlock(); + init_boundingBlock(); + init_booleanGeometryBlock(); +}); + +// node_modules/@babylonjs/core/Meshes/index.js +var init_Meshes2 = __esm(() => { + init_abstractMesh(); + init_abstractMesh_decalMap(); + init_Compression(); + init_csg(); + init_meshUVSpaceRenderer(); + init_geometry(); + init_groundMesh(); + init_goldbergMesh(); + init_trailMesh(); + init_instancedMesh(); + init_linesMesh(); + init_mesh(); + init_mesh_vertexData(); + init_meshBuilder(); + init_meshSimplification(); + init_meshSimplificationSceneComponent(); + init_polygonMesh(); + init_geodesicMesh(); + init_subMesh(); + init_subMesh_project(); + init_meshLODLevel(); + init_transformNode(); + init_Builders(); + init_webGLDataBuffer(); + init_webgpuDataBuffer(); + init_greasedLineMesh(); + init_greasedLineRibbonMesh(); + init_greasedLineBaseMesh(); + init_thinInstanceMesh(); + init_thinInstanceMesh(); + init_Node2(); +}); +// node_modules/@babylonjs/core/Morph/index.js +var init_Morph = __esm(() => { + init_morphTarget(); + init_morphTargetManager(); +}); + +// node_modules/@babylonjs/core/Navigation/INavigationEngine.js +var init_INavigationEngine = __esm(() => { +}); + +// node_modules/@babylonjs/core/Navigation/Plugins/recastJSPlugin.js +class RecastJSPlugin { + constructor(recastInjection = Recast) { + this.bjsRECAST = {}; + this.name = "RecastJSPlugin"; + this._maximumSubStepCount = 10; + this._timeStep = 1 / 60; + this._timeFactor = 1; + this._worker = null; + if (typeof recastInjection === "function") { + Logger.Error("RecastJS is not ready. Please make sure you await Recast() before using the plugin."); + } else { + this.bjsRECAST = recastInjection; + } + if (!this.isSupported()) { + Logger.Error("RecastJS is not available. Please make sure you included the js file."); + return; + } + this.setTimeStep(); + this._tempVec1 = new this.bjsRECAST.Vec3; + this._tempVec2 = new this.bjsRECAST.Vec3; + } + setWorkerURL(workerURL) { + if (window && window.Worker) { + this._worker = new Worker(workerURL); + return true; + } + return false; + } + setTimeStep(newTimeStep = 1 / 60) { + this._timeStep = newTimeStep; + } + getTimeStep() { + return this._timeStep; + } + setMaximumSubStepCount(newStepCount = 10) { + this._maximumSubStepCount = newStepCount; + } + getMaximumSubStepCount() { + return this._maximumSubStepCount; + } + set timeFactor(value) { + this._timeFactor = Math.max(value, 0); + } + get timeFactor() { + return this._timeFactor; + } + createNavMesh(meshes, parameters, completion) { + if (this._worker && !completion) { + console.warn("A worker is avaible but no completion callback. Defaulting to blocking navmesh creation"); + } else if (!this._worker && completion) { + console.warn("A completion callback is avaible but no worker. Defaulting to blocking navmesh creation"); + } + this.navMesh = new this.bjsRECAST.NavMesh; + let index; + let tri; + let pt; + const indices = []; + const positions = []; + let offset = 0; + for (index = 0;index < meshes.length; index++) { + if (meshes[index]) { + const mesh59 = meshes[index]; + const meshIndices = mesh59.getIndices(); + if (!meshIndices) { + continue; + } + const meshPositions = mesh59.getVerticesData(VertexBuffer.PositionKind, false, false); + if (!meshPositions) { + continue; + } + const worldMatrices = []; + const worldMatrix = mesh59.computeWorldMatrix(true); + if (mesh59.hasThinInstances) { + const thinMatrices = mesh59.thinInstanceGetWorldMatrices(); + for (let instanceIndex = 0;instanceIndex < thinMatrices.length; instanceIndex++) { + const tmpMatrix2 = new Matrix; + const thinMatrix = thinMatrices[instanceIndex]; + thinMatrix.multiplyToRef(worldMatrix, tmpMatrix2); + worldMatrices.push(tmpMatrix2); + } + } else { + worldMatrices.push(worldMatrix); + } + for (let matrixIndex = 0;matrixIndex < worldMatrices.length; matrixIndex++) { + const wm = worldMatrices[matrixIndex]; + for (tri = 0;tri < meshIndices.length; tri++) { + indices.push(meshIndices[tri] + offset); + } + const transformed = Vector3.Zero(); + const position = Vector3.Zero(); + for (pt = 0;pt < meshPositions.length; pt += 3) { + Vector3.FromArrayToRef(meshPositions, pt, position); + Vector3.TransformCoordinatesToRef(position, wm, transformed); + positions.push(transformed.x, transformed.y, transformed.z); + } + offset += meshPositions.length / 3; + } + } + } + if (this._worker && completion) { + this._worker.postMessage([positions, offset, indices, indices.length, parameters]); + this._worker.onmessage = function(e) { + completion(e.data); + }; + } else { + const rc = new this.bjsRECAST.rcConfig; + rc.cs = parameters.cs; + rc.ch = parameters.ch; + rc.borderSize = parameters.borderSize ? parameters.borderSize : 0; + rc.tileSize = parameters.tileSize ? parameters.tileSize : 0; + rc.walkableSlopeAngle = parameters.walkableSlopeAngle; + rc.walkableHeight = parameters.walkableHeight; + rc.walkableClimb = parameters.walkableClimb; + rc.walkableRadius = parameters.walkableRadius; + rc.maxEdgeLen = parameters.maxEdgeLen; + rc.maxSimplificationError = parameters.maxSimplificationError; + rc.minRegionArea = parameters.minRegionArea; + rc.mergeRegionArea = parameters.mergeRegionArea; + rc.maxVertsPerPoly = parameters.maxVertsPerPoly; + rc.detailSampleDist = parameters.detailSampleDist; + rc.detailSampleMaxError = parameters.detailSampleMaxError; + this.navMesh.build(positions, offset, indices, indices.length, rc); + } + } + createDebugNavMesh(scene23) { + let tri; + let pt; + const debugNavMesh = this.navMesh.getDebugNavMesh(); + const triangleCount = debugNavMesh.getTriangleCount(); + const indices = []; + const positions = []; + for (tri = 0;tri < triangleCount * 3; tri++) { + indices.push(tri); + } + for (tri = 0;tri < triangleCount; tri++) { + for (pt = 0;pt < 3; pt++) { + const point = debugNavMesh.getTriangle(tri).getPoint(pt); + positions.push(point.x, point.y, point.z); + } + } + const mesh59 = new Mesh("NavMeshDebug", scene23); + const vertexData = new VertexData; + vertexData.indices = indices; + vertexData.positions = positions; + vertexData.applyToMesh(mesh59, false); + return mesh59; + } + getClosestPoint(position) { + this._tempVec1.x = position.x; + this._tempVec1.y = position.y; + this._tempVec1.z = position.z; + const ret = this.navMesh.getClosestPoint(this._tempVec1); + const pr = new Vector3(ret.x, ret.y, ret.z); + return pr; + } + getClosestPointToRef(position, result) { + this._tempVec1.x = position.x; + this._tempVec1.y = position.y; + this._tempVec1.z = position.z; + const ret = this.navMesh.getClosestPoint(this._tempVec1); + result.set(ret.x, ret.y, ret.z); + } + getRandomPointAround(position, maxRadius) { + this._tempVec1.x = position.x; + this._tempVec1.y = position.y; + this._tempVec1.z = position.z; + const ret = this.navMesh.getRandomPointAround(this._tempVec1, maxRadius); + const pr = new Vector3(ret.x, ret.y, ret.z); + return pr; + } + getRandomPointAroundToRef(position, maxRadius, result) { + this._tempVec1.x = position.x; + this._tempVec1.y = position.y; + this._tempVec1.z = position.z; + const ret = this.navMesh.getRandomPointAround(this._tempVec1, maxRadius); + result.set(ret.x, ret.y, ret.z); + } + moveAlong(position, destination) { + this._tempVec1.x = position.x; + this._tempVec1.y = position.y; + this._tempVec1.z = position.z; + this._tempVec2.x = destination.x; + this._tempVec2.y = destination.y; + this._tempVec2.z = destination.z; + const ret = this.navMesh.moveAlong(this._tempVec1, this._tempVec2); + const pr = new Vector3(ret.x, ret.y, ret.z); + return pr; + } + moveAlongToRef(position, destination, result) { + this._tempVec1.x = position.x; + this._tempVec1.y = position.y; + this._tempVec1.z = position.z; + this._tempVec2.x = destination.x; + this._tempVec2.y = destination.y; + this._tempVec2.z = destination.z; + const ret = this.navMesh.moveAlong(this._tempVec1, this._tempVec2); + result.set(ret.x, ret.y, ret.z); + } + computePath(start, end) { + let pt; + this._tempVec1.x = start.x; + this._tempVec1.y = start.y; + this._tempVec1.z = start.z; + this._tempVec2.x = end.x; + this._tempVec2.y = end.y; + this._tempVec2.z = end.z; + const navPath = this.navMesh.computePath(this._tempVec1, this._tempVec2); + const pointCount = navPath.getPointCount(); + const positions = []; + for (pt = 0;pt < pointCount; pt++) { + const p = navPath.getPoint(pt); + positions.push(new Vector3(p.x, p.y, p.z)); + } + return positions; + } + createCrowd(maxAgents, maxAgentRadius, scene23) { + const crowd = new RecastJSCrowd(this, maxAgents, maxAgentRadius, scene23); + return crowd; + } + setDefaultQueryExtent(extent) { + this._tempVec1.x = extent.x; + this._tempVec1.y = extent.y; + this._tempVec1.z = extent.z; + this.navMesh.setDefaultQueryExtent(this._tempVec1); + } + getDefaultQueryExtent() { + const p = this.navMesh.getDefaultQueryExtent(); + return new Vector3(p.x, p.y, p.z); + } + buildFromNavmeshData(data) { + const nDataBytes = data.length * data.BYTES_PER_ELEMENT; + const dataPtr = this.bjsRECAST._malloc(nDataBytes); + const dataHeap = new Uint8Array(this.bjsRECAST.HEAPU8.buffer, dataPtr, nDataBytes); + dataHeap.set(data); + const buf = new this.bjsRECAST.NavmeshData; + buf.dataPointer = dataHeap.byteOffset; + buf.size = data.length; + this.navMesh = new this.bjsRECAST.NavMesh; + this.navMesh.buildFromNavmeshData(buf); + this.bjsRECAST._free(dataHeap.byteOffset); + } + getNavmeshData() { + const navmeshData = this.navMesh.getNavmeshData(); + const arrView = new Uint8Array(this.bjsRECAST.HEAPU8.buffer, navmeshData.dataPointer, navmeshData.size); + const ret = new Uint8Array(navmeshData.size); + ret.set(arrView); + this.navMesh.freeNavmeshData(navmeshData); + return ret; + } + getDefaultQueryExtentToRef(result) { + const p = this.navMesh.getDefaultQueryExtent(); + result.set(p.x, p.y, p.z); + } + dispose() { + } + addCylinderObstacle(position, radius, height) { + this._tempVec1.x = position.x; + this._tempVec1.y = position.y; + this._tempVec1.z = position.z; + return this.navMesh.addCylinderObstacle(this._tempVec1, radius, height); + } + addBoxObstacle(position, extent, angle) { + this._tempVec1.x = position.x; + this._tempVec1.y = position.y; + this._tempVec1.z = position.z; + this._tempVec2.x = extent.x; + this._tempVec2.y = extent.y; + this._tempVec2.z = extent.z; + return this.navMesh.addBoxObstacle(this._tempVec1, this._tempVec2, angle); + } + removeObstacle(obstacle) { + this.navMesh.removeObstacle(obstacle); + } + isSupported() { + return this.bjsRECAST !== undefined; + } +} + +class RecastJSCrowd { + constructor(plugin, maxAgents, maxAgentRadius, scene23) { + this.recastCrowd = {}; + this.transforms = new Array; + this.agents = new Array; + this.reachRadii = new Array; + this._agentDestinationArmed = new Array; + this._agentDestination = new Array; + this._onBeforeAnimationsObserver = null; + this.onReachTargetObservable = new Observable; + this.bjsRECASTPlugin = plugin; + this.recastCrowd = new this.bjsRECASTPlugin.bjsRECAST.Crowd(maxAgents, maxAgentRadius, this.bjsRECASTPlugin.navMesh.getNavMesh()); + this._scene = scene23; + this._onBeforeAnimationsObserver = scene23.onBeforeAnimationsObservable.add(() => { + this.update(scene23.getEngine().getDeltaTime() * 0.001 * plugin.timeFactor); + }); + } + addAgent(pos, parameters, transform) { + const agentParams = new this.bjsRECASTPlugin.bjsRECAST.dtCrowdAgentParams; + agentParams.radius = parameters.radius; + agentParams.height = parameters.height; + agentParams.maxAcceleration = parameters.maxAcceleration; + agentParams.maxSpeed = parameters.maxSpeed; + agentParams.collisionQueryRange = parameters.collisionQueryRange; + agentParams.pathOptimizationRange = parameters.pathOptimizationRange; + agentParams.separationWeight = parameters.separationWeight; + agentParams.updateFlags = 7; + agentParams.obstacleAvoidanceType = 0; + agentParams.queryFilterType = 0; + agentParams.userData = 0; + const agentIndex = this.recastCrowd.addAgent(new this.bjsRECASTPlugin.bjsRECAST.Vec3(pos.x, pos.y, pos.z), agentParams); + this.transforms.push(transform); + this.agents.push(agentIndex); + this.reachRadii.push(parameters.reachRadius ? parameters.reachRadius : parameters.radius); + this._agentDestinationArmed.push(false); + this._agentDestination.push(new Vector3(0, 0, 0)); + return agentIndex; + } + getAgentPosition(index) { + const agentPos = this.recastCrowd.getAgentPosition(index); + return new Vector3(agentPos.x, agentPos.y, agentPos.z); + } + getAgentPositionToRef(index, result) { + const agentPos = this.recastCrowd.getAgentPosition(index); + result.set(agentPos.x, agentPos.y, agentPos.z); + } + getAgentVelocity(index) { + const agentVel = this.recastCrowd.getAgentVelocity(index); + return new Vector3(agentVel.x, agentVel.y, agentVel.z); + } + getAgentVelocityToRef(index, result) { + const agentVel = this.recastCrowd.getAgentVelocity(index); + result.set(agentVel.x, agentVel.y, agentVel.z); + } + getAgentNextTargetPath(index) { + const pathTargetPos = this.recastCrowd.getAgentNextTargetPath(index); + return new Vector3(pathTargetPos.x, pathTargetPos.y, pathTargetPos.z); + } + getAgentNextTargetPathToRef(index, result) { + const pathTargetPos = this.recastCrowd.getAgentNextTargetPath(index); + result.set(pathTargetPos.x, pathTargetPos.y, pathTargetPos.z); + } + getAgentState(index) { + return this.recastCrowd.getAgentState(index); + } + overOffmeshConnection(index) { + return this.recastCrowd.overOffmeshConnection(index); + } + agentGoto(index, destination) { + this.recastCrowd.agentGoto(index, new this.bjsRECASTPlugin.bjsRECAST.Vec3(destination.x, destination.y, destination.z)); + const item = this.agents.indexOf(index); + if (item > -1) { + this._agentDestinationArmed[item] = true; + this._agentDestination[item].set(destination.x, destination.y, destination.z); + } + } + agentTeleport(index, destination) { + this.recastCrowd.agentTeleport(index, new this.bjsRECASTPlugin.bjsRECAST.Vec3(destination.x, destination.y, destination.z)); + } + updateAgentParameters(index, parameters) { + const agentParams = this.recastCrowd.getAgentParameters(index); + if (parameters.radius !== undefined) { + agentParams.radius = parameters.radius; + } + if (parameters.height !== undefined) { + agentParams.height = parameters.height; + } + if (parameters.maxAcceleration !== undefined) { + agentParams.maxAcceleration = parameters.maxAcceleration; + } + if (parameters.maxSpeed !== undefined) { + agentParams.maxSpeed = parameters.maxSpeed; + } + if (parameters.collisionQueryRange !== undefined) { + agentParams.collisionQueryRange = parameters.collisionQueryRange; + } + if (parameters.pathOptimizationRange !== undefined) { + agentParams.pathOptimizationRange = parameters.pathOptimizationRange; + } + if (parameters.separationWeight !== undefined) { + agentParams.separationWeight = parameters.separationWeight; + } + this.recastCrowd.setAgentParameters(index, agentParams); + } + removeAgent(index) { + this.recastCrowd.removeAgent(index); + const item = this.agents.indexOf(index); + if (item > -1) { + this.agents.splice(item, 1); + this.transforms.splice(item, 1); + this.reachRadii.splice(item, 1); + this._agentDestinationArmed.splice(item, 1); + this._agentDestination.splice(item, 1); + } + } + getAgents() { + return this.agents; + } + update(deltaTime) { + this.bjsRECASTPlugin.navMesh.update(); + if (deltaTime <= Epsilon) { + return; + } + const timeStep = this.bjsRECASTPlugin.getTimeStep(); + const maxStepCount = this.bjsRECASTPlugin.getMaximumSubStepCount(); + if (timeStep <= Epsilon) { + this.recastCrowd.update(deltaTime); + } else { + let iterationCount = Math.floor(deltaTime / timeStep); + if (maxStepCount && iterationCount > maxStepCount) { + iterationCount = maxStepCount; + } + if (iterationCount < 1) { + iterationCount = 1; + } + const step = deltaTime / iterationCount; + for (let i = 0;i < iterationCount; i++) { + this.recastCrowd.update(step); + } + } + for (let index = 0;index < this.agents.length; index++) { + const agentIndex = this.agents[index]; + const agentPosition = this.getAgentPosition(agentIndex); + this.transforms[index].position = agentPosition; + if (this._agentDestinationArmed[index]) { + const dx = agentPosition.x - this._agentDestination[index].x; + const dz = agentPosition.z - this._agentDestination[index].z; + const radius = this.reachRadii[index]; + const groundY = this._agentDestination[index].y - this.reachRadii[index]; + const ceilingY = this._agentDestination[index].y + this.reachRadii[index]; + const distanceXZSquared = dx * dx + dz * dz; + if (agentPosition.y > groundY && agentPosition.y < ceilingY && distanceXZSquared < radius * radius) { + this.onReachTargetObservable.notifyObservers({ agentIndex, destination: this._agentDestination[index] }); + this._agentDestinationArmed[index] = false; + } + } + } + } + setDefaultQueryExtent(extent) { + const ext = new this.bjsRECASTPlugin.bjsRECAST.Vec3(extent.x, extent.y, extent.z); + this.recastCrowd.setDefaultQueryExtent(ext); + } + getDefaultQueryExtent() { + const p = this.recastCrowd.getDefaultQueryExtent(); + return new Vector3(p.x, p.y, p.z); + } + getDefaultQueryExtentToRef(result) { + const p = this.recastCrowd.getDefaultQueryExtent(); + result.set(p.x, p.y, p.z); + } + getCorners(index) { + let pt; + const navPath = this.recastCrowd.getCorners(index); + const pointCount = navPath.getPointCount(); + const positions = []; + for (pt = 0;pt < pointCount; pt++) { + const p = navPath.getPoint(pt); + positions.push(new Vector3(p.x, p.y, p.z)); + } + return positions; + } + dispose() { + this.recastCrowd.destroy(); + this._scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver); + this._onBeforeAnimationsObserver = null; + this.onReachTargetObservable.clear(); + } +} +var init_recastJSPlugin = __esm(() => { + init_logger(); + init_mesh_vertexData(); + init_mesh(); + init_math(); + init_observable(); + init_buffer(); +}); + +// node_modules/@babylonjs/core/Navigation/Plugins/index.js +var init_Plugins2 = __esm(() => { + init_recastJSPlugin(); +}); + +// node_modules/@babylonjs/core/Navigation/index.js +var init_Navigation = __esm(() => { + init_INavigationEngine(); + init_Plugins2(); +}); + +// node_modules/@babylonjs/core/Offline/database.js class Database { get enableSceneOffline() { return this._enableSceneOffline; @@ -146713,23 +160493,44 @@ class Database { return false; } } -Database._IsUASupportingBlobStorage = true; -Database.IDBStorageEnabled = false; -Database._ParseURL = (url) => { - const a = document.createElement("a"); - a.href = url; - const urlWithoutHash = url.substring(0, url.lastIndexOf("#")); - const fileName = url.substring(urlWithoutHash.lastIndexOf("/") + 1, url.length); - const absLocation = url.substring(0, url.indexOf(fileName, 0)); - return absLocation; -}; -Database._ReturnFullUrlLocation = (url) => { - if (url.indexOf("http:/") === -1 && url.indexOf("https:/") === -1 && typeof window !== "undefined") { - return Database._ParseURL(window.location.href) + url; - } else { - return url; - } -}; +var init_database = __esm(() => { + init_tools(); + init_logger(); + init_tga(); + init_engine(); + init_webRequest(); + Engine2.OfflineProviderFactory = (urlToScene, callbackManifestChecked, disableManifestCheck = false) => { + return new Database(urlToScene, callbackManifestChecked, disableManifestCheck); + }; + Database._IsUASupportingBlobStorage = true; + Database.IDBStorageEnabled = false; + Database._ParseURL = (url) => { + const a = document.createElement("a"); + a.href = url; + const urlWithoutHash = url.substring(0, url.lastIndexOf("#")); + const fileName = url.substring(urlWithoutHash.lastIndexOf("/") + 1, url.length); + const absLocation = url.substring(0, url.indexOf(fileName, 0)); + return absLocation; + }; + Database._ReturnFullUrlLocation = (url) => { + if (url.indexOf("http:/") === -1 && url.indexOf("https:/") === -1 && typeof window !== "undefined") { + return Database._ParseURL(window.location.href) + url; + } else { + return url; + } + }; +}); + +// node_modules/@babylonjs/core/Offline/IOfflineProvider.js +var init_IOfflineProvider = __esm(() => { +}); + +// node_modules/@babylonjs/core/Offline/index.js +var init_Offline = __esm(() => { + init_database(); + init_IOfflineProvider(); +}); + // node_modules/@babylonjs/core/Materials/uniformBufferEffectCommonAccessor.js class UniformBufferEffectCommonAccessor { _isUbo(uboOrEffect) { @@ -146781,17 +160582,26 @@ class UniformBufferEffectCommonAccessor { } } } +var init_uniformBufferEffectCommonAccessor = __esm(() => { +}); // node_modules/@babylonjs/core/Shaders/gpuUpdateParticles.fragment.js -var name185 = "gpuUpdateParticlesPixelShader"; -var shader185 = `#version 300 es +var name186, shader185; +var init_gpuUpdateParticles_fragment = __esm(() => { + init_shaderStore(); + name186 = "gpuUpdateParticlesPixelShader"; + shader185 = `#version 300 es void main() {discard;} `; -ShaderStore.ShadersStore[name185] = shader185; + ShaderStore.ShadersStore[name186] = shader185; +}); // node_modules/@babylonjs/core/Shaders/gpuUpdateParticles.vertex.js -var name186 = "gpuUpdateParticlesVertexShader"; -var shader186 = `#version 300 es +var name187, shader186; +var init_gpuUpdateParticles_vertex = __esm(() => { + init_shaderStore(); + name187 = "gpuUpdateParticlesVertexShader"; + shader186 = `#version 300 es #define PI 3.14159 uniform float currentCount;uniform float timeDelta;uniform float stopFactor; #ifndef LOCAL @@ -147040,7 +160850,8 @@ else {ratio=clamp(cellStartOffset+cellInfos.z*offsetAge/life,0.,1.0);} outCellIndex=float(int(cellInfos.x+ratio*dist)); #endif }}`; -ShaderStore.ShadersStore[name186] = shader186; + ShaderStore.ShadersStore[name187] = shader186; +}); // node_modules/@babylonjs/core/Particles/webgl2ParticleSystem.js class WebGL2ParticleSystem { @@ -147274,10 +161085,22 @@ class WebGL2ParticleSystem { return vao; } } -RegisterClass("BABYLON.WebGL2ParticleSystem", WebGL2ParticleSystem); +var init_webgl2ParticleSystem = __esm(() => { + init_effect(); + init_customParticleEmitter(); + init_uniformBufferEffectCommonAccessor(); + init_typeStore(); + init_gpuUpdateParticles_fragment(); + init_gpuUpdateParticles_vertex(); + RegisterClass("BABYLON.WebGL2ParticleSystem", WebGL2ParticleSystem); +}); + // node_modules/@babylonjs/core/ShadersWGSL/gpuUpdateParticles.compute.js -var name187 = "gpuUpdateParticlesComputeShader"; -var shader187 = `struct Particle {position : vec3, +var name188, shader187; +var init_gpuUpdateParticles_compute = __esm(() => { + init_shaderStore(); + name188 = "gpuUpdateParticlesComputeShader"; + shader187 = `struct Particle {position : vec3, age : f32, size : vec3, life : f32, @@ -147546,7 +161369,8 @@ particlesOut.particles[index].cellIndex=f32(i32(params.cellInfos.x+ratio*dist)); #endif }} `; -ShaderStore.ShadersStoreWGSL[name187] = shader187; + ShaderStore.ShadersStoreWGSL[name188] = shader187; +}); // node_modules/@babylonjs/core/Particles/computeShaderParticleSystem.js class ComputeShaderParticleSystem { @@ -147685,7 +161509,16 @@ class ComputeShaderParticleSystem { this._renderVertexBuffers.length = 0; } } -RegisterClass("BABYLON.ComputeShaderParticleSystem", ComputeShaderParticleSystem); +var init_computeShaderParticleSystem = __esm(() => { + init_storageBuffer(); + init_computeShader(); + init_uniformBuffer(); + init_uniformBufferEffectCommonAccessor(); + init_typeStore(); + init_gpuUpdateParticles_compute(); + RegisterClass("BABYLON.ComputeShaderParticleSystem", ComputeShaderParticleSystem); +}); + // node_modules/@babylonjs/core/Misc/gradients.js class ColorGradient { constructor(gradient, color1, color2) { @@ -147742,6 +161575,9 @@ class GradientHelper { updateFunc(gradients[lastIndex], gradients[lastIndex], 1); } } +var init_gradients = __esm(() => { + init_math_color(); +}); // node_modules/@babylonjs/core/Particles/particle.js class Particle2 { @@ -147923,15 +161759,14 @@ class Particle2 { } } } -Particle2._Count = 0; +var init_particle = __esm(() => { + init_math_vector(); + init_math_color(); + init_math_scalar(); + Particle2._Count = 0; +}); // node_modules/@babylonjs/core/Particles/subEmitter.js -var SubEmitterType; -(function(SubEmitterType2) { - SubEmitterType2[SubEmitterType2["ATTACHED"] = 0] = "ATTACHED"; - SubEmitterType2[SubEmitterType2["END"] = 1] = "END"; -})(SubEmitterType || (SubEmitterType = {})); - class SubEmitter { constructor(particleSystem) { this.particleSystem = particleSystem; @@ -147988,10 +161823,30 @@ class SubEmitter { this.particleSystem.dispose(); } } +var SubEmitterType; +var init_subEmitter = __esm(() => { + init_math_vector(); + init_devTools(); + init_typeStore(); + (function(SubEmitterType2) { + SubEmitterType2[SubEmitterType2["ATTACHED"] = 0] = "ATTACHED"; + SubEmitterType2[SubEmitterType2["END"] = 1] = "END"; + })(SubEmitterType || (SubEmitterType = {})); +}); // node_modules/@babylonjs/core/Shaders/particles.fragment.js -var name188 = "particlesPixelShader"; -var shader188 = `#ifdef LOGARITHMICDEPTH +var name189, shader188; +var init_particles_fragment = __esm(() => { + init_shaderStore(); + init_clipPlaneFragmentDeclaration(); + init_imageProcessingDeclaration(); + init_logDepthDeclaration(); + init_helperFunctions(); + init_imageProcessingFunctions(); + init_clipPlaneFragment(); + init_logDepthFragment(); + name189 = "particlesPixelShader"; + shader188 = `#ifdef LOGARITHMICDEPTH #extension GL_EXT_frag_depth : enable #endif varying vec2 vUV;varying vec4 vColor;uniform vec4 textureMask;uniform sampler2D diffuseSampler; @@ -148025,11 +161880,19 @@ baseColor.rgb=toLinearSpace(baseColor.rgb);baseColor=applyImageProcessing(baseCo gl_FragColor=baseColor; #define CUSTOM_FRAGMENT_MAIN_END }`; -ShaderStore.ShadersStore[name188] = shader188; + ShaderStore.ShadersStore[name189] = shader188; +}); // node_modules/@babylonjs/core/Shaders/particles.vertex.js -var name189 = "particlesVertexShader"; -var shader189 = `attribute vec3 position;attribute vec4 color;attribute float angle;attribute vec2 size; +var name190, shader189; +var init_particles_vertex = __esm(() => { + init_shaderStore(); + init_clipPlaneVertexDeclaration(); + init_logDepthDeclaration(); + init_clipPlaneVertex(); + init_logDepthVertex(); + name190 = "particlesVertexShader"; + shader189 = `attribute vec3 position;attribute vec4 color;attribute float angle;attribute vec2 size; #ifdef ANIMATESHEET attribute float cellIndex; #endif @@ -148101,7 +161964,8 @@ vec4 worldPos=vec4(vPositionW,1.0); #include #define CUSTOM_VERTEX_MAIN_END }`; -ShaderStore.ShadersStore[name189] = shader189; + ShaderStore.ShadersStore[name190] = shader189; +}); // node_modules/@babylonjs/core/Particles/particleSystem.js class ParticleSystem extends BaseParticleSystem { @@ -148163,8 +162027,8 @@ class ParticleSystem extends BaseParticleSystem { get indexBuffer() { return this._indexBuffer; } - constructor(name190, capacity, sceneOrEngine, customEffect = null, isAnimationSheetEnabled = false, epsilon = 0.01) { - super(name190); + constructor(name191, capacity, sceneOrEngine, customEffect = null, isAnimationSheetEnabled = false, epsilon = 0.01) { + super(name191); this._emitterInverseWorldMatrix = Matrix.Identity(); this._inheritedVelocityOffset = new Vector3; this.onDisposeObservable = new Observable; @@ -149496,7 +163360,7 @@ class ParticleSystem extends BaseParticleSystem { this.onStoppedObservable.clear(); this.reset(); } - clone(name190, newEmitter, cloneTexture = false) { + clone(name191, newEmitter, cloneTexture = false) { const custom = Object.assign({}, this._customWrappers); let program = null; const engine44 = this._engine; @@ -149514,7 +163378,7 @@ class ParticleSystem extends BaseParticleSystem { } const serialization = this.serialize(cloneTexture); const result = ParticleSystem.Parse(serialization, this._scene || this._engine, this._rootUrl); - result.name = name190; + result.name = name191; result.customShader = program; result._customWrappers = custom; if (newEmitter === undefined) { @@ -150015,7 +163879,7 @@ class ParticleSystem extends BaseParticleSystem { particleSystem.manualEmitCount = (_c = parsedParticleSystem.manualEmitCount) !== null && _c !== undefined ? _c : -1; } static Parse(parsedParticleSystem, sceneOrEngine, rootUrl, doNotStart = false, capacity) { - const name190 = parsedParticleSystem.name; + const name191 = parsedParticleSystem.name; let custom = null; let program = null; let engine44; @@ -150031,7 +163895,7 @@ class ParticleSystem extends BaseParticleSystem { const defines = program.shaderOptions.defines.length > 0 ? program.shaderOptions.defines.join("\n") : ""; custom = engine44.createEffectForParticles(program.shaderPath.fragmentElement, program.shaderOptions.uniforms, program.shaderOptions.samplers, defines); } - const particleSystem = new ParticleSystem(name190, capacity || parsedParticleSystem.capacity, sceneOrEngine, custom, parsedParticleSystem.isAnimationSheetEnabled); + const particleSystem = new ParticleSystem(name191, capacity || parsedParticleSystem.capacity, sceneOrEngine, custom, parsedParticleSystem.isAnimationSheetEnabled); particleSystem.customShader = program; particleSystem._rootUrl = rootUrl; if (parsedParticleSystem.id) { @@ -150060,15 +163924,42 @@ class ParticleSystem extends BaseParticleSystem { return particleSystem; } } -ParticleSystem.BILLBOARDMODE_Y = 2; -ParticleSystem.BILLBOARDMODE_ALL = 7; -ParticleSystem.BILLBOARDMODE_STRETCHED = 8; -ParticleSystem.BILLBOARDMODE_STRETCHED_LOCAL = 9; -SubEmitter._ParseParticleSystem = ParticleSystem.Parse; +var init_particleSystem = __esm(() => { + init_gradients(); + init_observable(); + init_math_vector(); + init_math_scalar(); + init_buffer(); + init_imageProcessingConfiguration(); + init_rawTexture(); + init_engineStore(); + init_EmitterTypes(); + init_baseParticleSystem(); + init_particle(); + init_subEmitter(); + init_decorators(); + init_typeStore(); + init_drawWrapper(); + init_particles_fragment(); + init_particles_vertex(); + init_math_color(); + init_thinEngine(); + init_materialHelper(); + init_engine_alpha(); + init_clipPlaneMaterialHelper(); + ParticleSystem.BILLBOARDMODE_Y = 2; + ParticleSystem.BILLBOARDMODE_ALL = 7; + ParticleSystem.BILLBOARDMODE_STRETCHED = 8; + ParticleSystem.BILLBOARDMODE_STRETCHED_LOCAL = 9; + SubEmitter._ParseParticleSystem = ParticleSystem.Parse; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration2.js -var name190 = "clipPlaneFragmentDeclaration2"; -var shader190 = `#ifdef CLIPPLANE +var name191, shader190; +var init_clipPlaneFragmentDeclaration22 = __esm(() => { + init_shaderStore(); + name191 = "clipPlaneFragmentDeclaration2"; + shader190 = `#ifdef CLIPPLANE in float fClipDistance; #endif #ifdef CLIPPLANE2 @@ -150087,11 +163978,22 @@ in float fClipDistance5; in float fClipDistance6; #endif `; -ShaderStore.IncludesShadersStore[name190] = shader190; + ShaderStore.IncludesShadersStore[name191] = shader190; +}); // node_modules/@babylonjs/core/Shaders/gpuRenderParticles.fragment.js -var name191 = "gpuRenderParticlesPixelShader"; -var shader191 = `precision highp float; +var name192, shader191; +var init_gpuRenderParticles_fragment = __esm(() => { + init_shaderStore(); + init_clipPlaneFragmentDeclaration22(); + init_imageProcessingDeclaration(); + init_logDepthDeclaration(); + init_helperFunctions(); + init_imageProcessingFunctions(); + init_clipPlaneFragment(); + init_logDepthFragment(); + name192 = "gpuRenderParticlesPixelShader"; + shader191 = `precision highp float; #ifdef LOGARITHMICDEPTH #extension GL_EXT_frag_depth : enable #endif @@ -150117,11 +164019,15 @@ gl_FragColor.rgb=toLinearSpace(gl_FragColor.rgb);gl_FragColor=applyImageProcessi #endif } `; -ShaderStore.ShadersStore[name191] = shader191; + ShaderStore.ShadersStore[name192] = shader191; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration2.js -var name192 = "clipPlaneVertexDeclaration2"; -var shader192 = `#ifdef CLIPPLANE +var name193, shader192; +var init_clipPlaneVertexDeclaration22 = __esm(() => { + init_shaderStore(); + name193 = "clipPlaneVertexDeclaration2"; + shader192 = `#ifdef CLIPPLANE uniform vec4 vClipPlane;out float fClipDistance; #endif #ifdef CLIPPLANE2 @@ -150140,11 +164046,19 @@ uniform vec4 vClipPlane5;out float fClipDistance5; uniform vec4 vClipPlane6;out float fClipDistance6; #endif `; -ShaderStore.IncludesShadersStore[name192] = shader192; + ShaderStore.IncludesShadersStore[name193] = shader192; +}); // node_modules/@babylonjs/core/Shaders/gpuRenderParticles.vertex.js -var name193 = "gpuRenderParticlesVertexShader"; -var shader193 = `precision highp float;uniform mat4 view;uniform mat4 projection;uniform vec2 translationPivot;uniform vec3 worldOffset; +var name194, shader193; +var init_gpuRenderParticles_vertex = __esm(() => { + init_shaderStore(); + init_clipPlaneVertexDeclaration22(); + init_logDepthDeclaration(); + init_clipPlaneVertex(); + init_logDepthVertex(); + name194 = "gpuRenderParticlesVertexShader"; + shader193 = `precision highp float;uniform mat4 view;uniform mat4 projection;uniform vec2 translationPivot;uniform vec3 worldOffset; #ifdef LOCAL uniform mat4 emitterWM; #endif @@ -150230,7 +164144,8 @@ vec4 worldPos=vec4(vPositionW,1.0); #include #include }`; -ShaderStore.ShadersStore[name193] = shader193; + ShaderStore.ShadersStore[name194] = shader193; +}); // node_modules/@babylonjs/core/Particles/gpuParticleSystem.js class GPUParticleSystem extends BaseParticleSystem { @@ -150545,8 +164460,8 @@ class GPUParticleSystem extends BaseParticleSystem { removeLifeTimeGradient() { return this; } - constructor(name194, options, sceneOrEngine, customEffect = null, isAnimationSheetEnabled = false) { - super(name194); + constructor(name195, options, sceneOrEngine, customEffect = null, isAnimationSheetEnabled = false) { + super(name195); this.layerMask = 268435455; this._accumulatedCount = 0; this._renderVertexBuffers = []; @@ -151346,7 +165261,7 @@ class GPUParticleSystem extends BaseParticleSystem { this.onDisposeObservable.notifyObservers(this); this.onDisposeObservable.clear(); } - clone(name194, newEmitter, cloneTexture = false) { + clone(name195, newEmitter, cloneTexture = false) { const custom = Object.assign({}, this._customWrappers); let program = null; const engine44 = this._engine; @@ -151359,7 +165274,7 @@ class GPUParticleSystem extends BaseParticleSystem { } const serialization = this.serialize(cloneTexture); const result = GPUParticleSystem.Parse(serialization, this._scene || this._engine, this._rootUrl); - result.name = name194; + result.name = name195; result.customShader = program; result._customWrappers = custom; if (newEmitter === undefined) { @@ -151380,7 +165295,7 @@ class GPUParticleSystem extends BaseParticleSystem { return serializationObject; } static Parse(parsedParticleSystem, sceneOrEngine, rootUrl, doNotStart = false, capacity) { - const name194 = parsedParticleSystem.name; + const name195 = parsedParticleSystem.name; let engine44; let scene23; if (sceneOrEngine instanceof ThinEngine) { @@ -151389,7 +165304,7 @@ class GPUParticleSystem extends BaseParticleSystem { scene23 = sceneOrEngine; engine44 = scene23.getEngine(); } - const particleSystem2 = new GPUParticleSystem(name194, { capacity: capacity || parsedParticleSystem.capacity, randomTextureSize: parsedParticleSystem.randomTextureSize }, sceneOrEngine, null, parsedParticleSystem.isAnimationSheetEnabled); + const particleSystem2 = new GPUParticleSystem(name195, { capacity: capacity || parsedParticleSystem.capacity, randomTextureSize: parsedParticleSystem.randomTextureSize }, sceneOrEngine, null, parsedParticleSystem.isAnimationSheetEnabled); particleSystem2._rootUrl = rootUrl; if (parsedParticleSystem.customShader && engine44.createEffectForParticles) { const program = parsedParticleSystem.customShader; @@ -151414,6 +165329,34 @@ class GPUParticleSystem extends BaseParticleSystem { return particleSystem2; } } +var init_gpuParticleSystem = __esm(() => { + init_gradients(); + init_observable(); + init_math_vector(); + init_math_color(); + init_math_scalar(); + init_buffer(); + init_baseParticleSystem(); + init_particleSystem(); + init_boxParticleEmitter(); + init_materialHelper(); + init_imageProcessingConfiguration(); + init_rawTexture(); + init_engineStore(); + init_customParticleEmitter(); + init_thinEngine(); + init_drawWrapper(); + init_typeStore(); + init_clipPlaneMaterialHelper(); + init_engine_transformFeedback(); + init_gpuRenderParticles_fragment(); + init_gpuRenderParticles_vertex(); +}); + +// node_modules/@babylonjs/core/Particles/IParticleSystem.js +var init_IParticleSystem = __esm(() => { +}); + // node_modules/@babylonjs/core/Particles/particleSystemSet.js class ParticleSystemSet { constructor() { @@ -151510,7 +165453,15 @@ class ParticleSystemSet { return result; } } -ParticleSystemSet.BaseAssetsUrl = "https://assets.babylonjs.com/particles"; +var init_particleSystemSet = __esm(() => { + init_math_color(); + init_sphereBuilder(); + init_gpuParticleSystem(); + init_engineStore(); + init_particleSystem(); + init_standardMaterial(); + ParticleSystemSet.BaseAssetsUrl = "https://assets.babylonjs.com/particles"; +}); // node_modules/@babylonjs/core/Particles/particleHelper.js class ParticleHelper { @@ -151563,7 +165514,7 @@ class ParticleHelper { } return set; } - static ParseFromFileAsync(name194, url, scene23, gpu = false, rootUrl = "", capacity) { + static ParseFromFileAsync(name195, url, scene23, gpu = false, rootUrl = "", capacity) { return new Promise((resolve, reject) => { const request = new WebRequest; request.addEventListener("readystatechange", () => { @@ -151576,8 +165527,8 @@ class ParticleHelper { } else { output = ParticleSystem.Parse(serializationObject, scene23, rootUrl, false, capacity); } - if (name194) { - output.name = name194; + if (name195) { + output.name = name195; } resolve(output); } else { @@ -151620,136 +165571,2550 @@ class ParticleHelper { }); } } -ParticleHelper.BaseAssetsUrl = ParticleSystemSet.BaseAssetsUrl; -ParticleHelper.SnippetUrl = `https://snippet.babylonjs.com`; -ParticleHelper.CreateFromSnippetAsync = ParticleHelper.ParseFromSnippetAsync; +var init_particleHelper = __esm(() => { + init_tools(); + init_math_color(); + init_texture(); + init_engineStore(); + init_gpuParticleSystem(); + init_particleSystemSet(); + init_particleSystem(); + init_webRequest(); + ParticleHelper.BaseAssetsUrl = ParticleSystemSet.BaseAssetsUrl; + ParticleHelper.SnippetUrl = `https://snippet.babylonjs.com`; + ParticleHelper.CreateFromSnippetAsync = ParticleHelper.ParseFromSnippetAsync; +}); + // node_modules/@babylonjs/core/Particles/particleSystemComponent.js -AbstractScene.AddParser(SceneComponentConstants.NAME_PARTICLESYSTEM, (parsedData, scene23, container, rootUrl) => { - const individualParser = AbstractScene.GetIndividualParser(SceneComponentConstants.NAME_PARTICLESYSTEM); - if (!individualParser) { - return; +var init_particleSystemComponent = __esm(() => { + init_mesh(); + init_gpuParticleSystem(); + init_abstractScene(); + init_engine(); + init_particleSystem(); + init_sceneComponent(); + init_particles_vertex(); + AbstractScene.AddParser(SceneComponentConstants.NAME_PARTICLESYSTEM, (parsedData, scene23, container, rootUrl) => { + const individualParser = AbstractScene.GetIndividualParser(SceneComponentConstants.NAME_PARTICLESYSTEM); + if (!individualParser) { + return; + } + if (parsedData.particleSystems !== undefined && parsedData.particleSystems !== null) { + for (let index = 0, cache = parsedData.particleSystems.length;index < cache; index++) { + const parsedParticleSystem = parsedData.particleSystems[index]; + container.particleSystems.push(individualParser(parsedParticleSystem, scene23, rootUrl)); + } + } + }); + AbstractScene.AddIndividualParser(SceneComponentConstants.NAME_PARTICLESYSTEM, (parsedParticleSystem, scene23, rootUrl) => { + if (parsedParticleSystem.activeParticleCount) { + const ps = GPUParticleSystem.Parse(parsedParticleSystem, scene23, rootUrl); + return ps; + } else { + const ps = ParticleSystem.Parse(parsedParticleSystem, scene23, rootUrl); + return ps; + } + }); + Engine2.prototype.createEffectForParticles = function(fragmentName, uniformsNames = [], samplers = [], defines = "", fallbacks, onCompiled, onError, particleSystem5) { + var _a; + let attributesNamesOrOptions = []; + let effectCreationOption = []; + const allSamplers = []; + if (particleSystem5) { + particleSystem5.fillUniformsAttributesAndSamplerNames(effectCreationOption, attributesNamesOrOptions, allSamplers); + } else { + attributesNamesOrOptions = ParticleSystem._GetAttributeNamesOrOptions(); + effectCreationOption = ParticleSystem._GetEffectCreationOptions(); + } + if (defines.indexOf(" BILLBOARD") === -1) { + defines += "\n#define BILLBOARD\n"; + } + if (particleSystem5 === null || particleSystem5 === undefined ? undefined : particleSystem5.isAnimationSheetEnabled) { + if (defines.indexOf(" ANIMATESHEET") === -1) { + defines += "\n#define ANIMATESHEET\n"; + } + } + if (samplers.indexOf("diffuseSampler") === -1) { + samplers.push("diffuseSampler"); + } + return this.createEffect({ + vertex: (_a = particleSystem5 === null || particleSystem5 === undefined ? undefined : particleSystem5.vertexShaderName) !== null && _a !== undefined ? _a : "particles", + fragmentElement: fragmentName + }, attributesNamesOrOptions, effectCreationOption.concat(uniformsNames), allSamplers.concat(samplers), defines, fallbacks, onCompiled, onError); + }; + Mesh.prototype.getEmittedParticleSystems = function() { + const results = []; + for (let index = 0;index < this.getScene().particleSystems.length; index++) { + const particleSystem5 = this.getScene().particleSystems[index]; + if (particleSystem5.emitter === this) { + results.push(particleSystem5); + } + } + return results; + }; + Mesh.prototype.getHierarchyEmittedParticleSystems = function() { + const results = []; + const descendants = this.getDescendants(); + descendants.push(this); + for (let index = 0;index < this.getScene().particleSystems.length; index++) { + const particleSystem5 = this.getScene().particleSystems[index]; + const emitter = particleSystem5.emitter; + if (emitter.position && descendants.indexOf(emitter) !== -1) { + results.push(particleSystem5); + } + } + return results; + }; +}); + +// node_modules/@babylonjs/core/Particles/solidParticle.js +class SolidParticle { + getBoundingInfo() { + return this._boundingInfo; + } + get hasBoundingInfo() { + return this._boundingInfo !== null; + } + constructor(particleIndex, particleId, positionIndex, indiceIndex, model, shapeId, idxInShape, sps, modelBoundingInfo = null, materialIndex = null) { + this.idx = 0; + this.id = 0; + this.color = new Color4(1, 1, 1, 1); + this.position = Vector3.Zero(); + this.rotation = Vector3.Zero(); + this.scaling = Vector3.One(); + this.uvs = new Vector4(0, 0, 1, 1); + this.velocity = Vector3.Zero(); + this.pivot = Vector3.Zero(); + this.translateFromPivot = false; + this.alive = true; + this.isVisible = true; + this._pos = 0; + this._ind = 0; + this.shapeId = 0; + this.idxInShape = 0; + this._stillInvisible = false; + this._rotationMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; + this.parentId = null; + this.materialIndex = null; + this.props = null; + this.cullingStrategy = AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY; + this._globalPosition = Vector3.Zero(); + this.idx = particleIndex; + this.id = particleId; + this._pos = positionIndex; + this._ind = indiceIndex; + this._model = model; + this.shapeId = shapeId; + this.idxInShape = idxInShape; + this._sps = sps; + if (modelBoundingInfo) { + this._modelBoundingInfo = modelBoundingInfo; + this._boundingInfo = new BoundingInfo(modelBoundingInfo.minimum, modelBoundingInfo.maximum); + } + if (materialIndex !== null) { + this.materialIndex = materialIndex; + } + } + copyToRef(target) { + target.position.copyFrom(this.position); + target.rotation.copyFrom(this.rotation); + if (this.rotationQuaternion) { + if (target.rotationQuaternion) { + target.rotationQuaternion.copyFrom(this.rotationQuaternion); + } else { + target.rotationQuaternion = this.rotationQuaternion.clone(); + } + } + target.scaling.copyFrom(this.scaling); + if (this.color) { + if (target.color) { + target.color.copyFrom(this.color); + } else { + target.color = this.color.clone(); + } + } + target.uvs.copyFrom(this.uvs); + target.velocity.copyFrom(this.velocity); + target.pivot.copyFrom(this.pivot); + target.translateFromPivot = this.translateFromPivot; + target.alive = this.alive; + target.isVisible = this.isVisible; + target.parentId = this.parentId; + target.cullingStrategy = this.cullingStrategy; + if (this.materialIndex !== null) { + target.materialIndex = this.materialIndex; + } + return this; + } + get scale() { + return this.scaling; } - if (parsedData.particleSystems !== undefined && parsedData.particleSystems !== null) { - for (let index = 0, cache = parsedData.particleSystems.length;index < cache; index++) { - const parsedParticleSystem = parsedData.particleSystems[index]; - container.particleSystems.push(individualParser(parsedParticleSystem, scene23, rootUrl)); + set scale(scale) { + this.scaling = scale; + } + get quaternion() { + return this.rotationQuaternion; + } + set quaternion(q) { + this.rotationQuaternion = q; + } + intersectsMesh(target) { + if (!this._boundingInfo || !target.hasBoundingInfo) { + return false; + } + if (this._sps._bSphereOnly) { + return BoundingSphere.Intersects(this._boundingInfo.boundingSphere, target.getBoundingInfo().boundingSphere); } + return this._boundingInfo.intersects(target.getBoundingInfo(), false); } -}); -AbstractScene.AddIndividualParser(SceneComponentConstants.NAME_PARTICLESYSTEM, (parsedParticleSystem, scene23, rootUrl) => { - if (parsedParticleSystem.activeParticleCount) { - const ps = GPUParticleSystem.Parse(parsedParticleSystem, scene23, rootUrl); - return ps; - } else { - const ps = ParticleSystem.Parse(parsedParticleSystem, scene23, rootUrl); - return ps; + isInFrustum(frustumPlanes) { + return this._boundingInfo !== null && this._boundingInfo.isInFrustum(frustumPlanes, this.cullingStrategy); + } + getRotationMatrix(m) { + let quaternion; + if (this.rotationQuaternion) { + quaternion = this.rotationQuaternion; + } else { + quaternion = TmpVectors.Quaternion[0]; + const rotation = this.rotation; + Quaternion.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, quaternion); + } + quaternion.toRotationMatrix(m); + } +} + +class ModelShape { + get shapeID() { + return this.shapeId; + } + set shapeID(shapeID) { + this.shapeId = shapeID; + } + constructor(id, shape, indices, normals, colors, shapeUV, posFunction, vtxFunction, material20) { + this._indicesLength = 0; + this.shapeId = id; + this._shape = shape; + this._indices = indices; + this._indicesLength = indices.length; + this._shapeUV = shapeUV; + this._shapeColors = colors; + this._normals = normals; + this._positionFunction = posFunction; + this._vertexFunction = vtxFunction; + this._material = material20; + } +} + +class DepthSortedParticle { + constructor(idx, ind, indLength, materialIndex) { + this.idx = 0; + this.ind = 0; + this.indicesLength = 0; + this.sqDistance = 0; + this.materialIndex = 0; + this.idx = idx; + this.ind = ind; + this.indicesLength = indLength; + this.materialIndex = materialIndex; + } +} + +class SolidParticleVertex { + constructor() { + this.position = Vector3.Zero(); + this.color = new Color4(1, 1, 1, 1); + this.uv = Vector2.Zero(); + } + get x() { + return this.position.x; } + set x(val) { + this.position.x = val; + } + get y() { + return this.position.y; + } + set y(val) { + this.position.y = val; + } + get z() { + return this.position.z; + } + set z(val) { + this.position.z = val; + } +} +var init_solidParticle = __esm(() => { + init_math_vector(); + init_math_color(); + init_boundingInfo(); + init_boundingSphere(); + init_abstractMesh(); }); -Engine2.prototype.createEffectForParticles = function(fragmentName, uniformsNames = [], samplers = [], defines = "", fallbacks, onCompiled, onError, particleSystem5) { - var _a; - let attributesNamesOrOptions = []; - let effectCreationOption = []; - const allSamplers = []; - if (particleSystem5) { - particleSystem5.fillUniformsAttributesAndSamplerNames(effectCreationOption, attributesNamesOrOptions, allSamplers); - } else { - attributesNamesOrOptions = ParticleSystem._GetAttributeNamesOrOptions(); - effectCreationOption = ParticleSystem._GetEffectCreationOptions(); + +// node_modules/@babylonjs/core/Particles/solidParticleSystem.js +class SolidParticleSystem { + constructor(name195, scene23, options) { + this.particles = new Array; + this.nbParticles = 0; + this.billboard = false; + this.recomputeNormals = false; + this.counter = 0; + this.vars = {}; + this._bSphereOnly = false; + this._bSphereRadiusFactor = 1; + this._positions = new Array; + this._indices = new Array; + this._normals = new Array; + this._colors = new Array; + this._uvs = new Array; + this._index = 0; + this._updatable = true; + this._pickable = false; + this._isVisibilityBoxLocked = false; + this._alwaysVisible = false; + this._depthSort = false; + this._expandable = false; + this._shapeCounter = 0; + this._copy = new SolidParticle(0, 0, 0, 0, null, 0, 0, this); + this._color = new Color4(0, 0, 0, 0); + this._computeParticleColor = true; + this._computeParticleTexture = true; + this._computeParticleRotation = true; + this._computeParticleVertex = false; + this._computeBoundingBox = false; + this._autoFixFaceOrientation = false; + this._depthSortParticles = true; + this._mustUnrotateFixedNormals = false; + this._particlesIntersect = false; + this._needs32Bits = false; + this._isNotBuilt = true; + this._lastParticleId = 0; + this._idxOfId = []; + this._multimaterialEnabled = false; + this._useModelMaterial = false; + this._depthSortFunction = (p1, p2) => p2.sqDistance - p1.sqDistance; + this._materialSortFunction = (p1, p2) => p1.materialIndex - p2.materialIndex; + this._autoUpdateSubMeshes = false; + this._recomputeInvisibles = false; + this.name = name195; + this._scene = scene23 || EngineStore.LastCreatedScene; + this._camera = scene23.activeCamera; + this._pickable = options ? options.isPickable : false; + this._depthSort = options ? options.enableDepthSort : false; + this._multimaterialEnabled = options ? options.enableMultiMaterial : false; + this._useModelMaterial = options ? options.useModelMaterial : false; + this._multimaterialEnabled = this._useModelMaterial ? true : this._multimaterialEnabled; + this._expandable = options ? options.expandable : false; + this._particlesIntersect = options ? options.particleIntersection : false; + this._bSphereOnly = options ? options.boundingSphereOnly : false; + this._bSphereRadiusFactor = options && options.bSphereRadiusFactor ? options.bSphereRadiusFactor : 1; + this._computeBoundingBox = (options === null || options === undefined ? undefined : options.computeBoundingBox) ? options.computeBoundingBox : false; + this._autoFixFaceOrientation = (options === null || options === undefined ? undefined : options.autoFixFaceOrientation) ? options.autoFixFaceOrientation : false; + if (options && options.updatable !== undefined) { + this._updatable = options.updatable; + } else { + this._updatable = true; + } + if (this._pickable) { + this.pickedBySubMesh = [[]]; + this.pickedParticles = this.pickedBySubMesh[0]; + } + if (this._depthSort || this._multimaterialEnabled) { + this.depthSortedParticles = []; + } + if (this._multimaterialEnabled) { + this._multimaterial = new MultiMaterial(this.name + "MultiMaterial", this._scene); + this._materials = []; + this._materialIndexesById = {}; + } + this._tmpVertex = new SolidParticleVertex; } - if (defines.indexOf(" BILLBOARD") === -1) { - defines += "\n#define BILLBOARD\n"; + buildMesh() { + if (!this._isNotBuilt && this.mesh) { + return this.mesh; + } + if (this.nbParticles === 0 && !this.mesh) { + const triangle = CreateDisc("", { radius: 1, tessellation: 3 }, this._scene); + this.addShape(triangle, 1); + triangle.dispose(); + } + this._indices32 = this._needs32Bits ? new Uint32Array(this._indices) : new Uint16Array(this._indices); + this._positions32 = new Float32Array(this._positions); + this._uvs32 = new Float32Array(this._uvs); + this._colors32 = new Float32Array(this._colors); + if (!this.mesh) { + const mesh61 = new Mesh(this.name, this._scene); + this.mesh = mesh61; + } + if (!this._updatable && this._multimaterialEnabled) { + this._sortParticlesByMaterial(); + } + if (this.recomputeNormals) { + VertexData.ComputeNormals(this._positions32, this._indices32, this._normals); + } + this._normals32 = new Float32Array(this._normals); + this._fixedNormal32 = new Float32Array(this._normals); + if (this._mustUnrotateFixedNormals) { + this._unrotateFixedNormals(); + } + const vertexData = new VertexData; + vertexData.indices = this._depthSort ? this._indices : this._indices32; + vertexData.set(this._positions32, VertexBuffer.PositionKind); + vertexData.set(this._normals32, VertexBuffer.NormalKind); + if (this._uvs32.length > 0) { + vertexData.set(this._uvs32, VertexBuffer.UVKind); + } + if (this._colors32.length > 0) { + vertexData.set(this._colors32, VertexBuffer.ColorKind); + } + vertexData.applyToMesh(this.mesh, this._updatable); + this.mesh.isPickable = this._pickable; + if (this._pickable) { + let faceId = 0; + for (let p = 0;p < this.nbParticles; p++) { + const part = this.particles[p]; + const lind = part._model._indicesLength; + for (let i = 0;i < lind; i++) { + const f = i % 3; + if (f == 0) { + const pickedData = { idx: part.idx, faceId }; + this.pickedParticles[faceId] = pickedData; + faceId++; + } + } + } + } + if (this._multimaterialEnabled) { + this.setMultiMaterial(this._materials); + } + if (!this._expandable) { + if (!this._depthSort && !this._multimaterialEnabled && !this._autoFixFaceOrientation) { + this._indices = null; + } + this._positions = null; + this._normals = null; + this._uvs = null; + this._colors = null; + if (!this._updatable) { + this.particles.length = 0; + } + } + this._isNotBuilt = false; + this.recomputeNormals = false; + this._recomputeInvisibles = true; + return this.mesh; } - if (particleSystem5 === null || particleSystem5 === undefined ? undefined : particleSystem5.isAnimationSheetEnabled) { - if (defines.indexOf(" ANIMATESHEET") === -1) { - defines += "\n#define ANIMATESHEET\n"; + _getUVKind(mesh61, uvKind) { + var _a, _b; + if (uvKind === -1) { + if ((_a = mesh61.material) === null || _a === undefined ? undefined : _a.diffuseTexture) { + uvKind = mesh61.material.diffuseTexture.coordinatesIndex; + } else if ((_b = mesh61.material) === null || _b === undefined ? undefined : _b.albedoTexture) { + uvKind = mesh61.material.albedoTexture.coordinatesIndex; + } } + return "uv" + (uvKind ? uvKind + 1 : ""); } - if (samplers.indexOf("diffuseSampler") === -1) { - samplers.push("diffuseSampler"); + digest(mesh61, options) { + var _a; + let size = options && options.facetNb || 1; + let number = options && options.number || 0; + let delta = options && options.delta || 0; + const meshPos = mesh61.getVerticesData(VertexBuffer.PositionKind); + const meshInd = mesh61.getIndices(); + const meshUV = mesh61.getVerticesData(this._getUVKind(mesh61, (_a = options === null || options === undefined ? undefined : options.uvKind) !== null && _a !== undefined ? _a : 0)); + const meshCol = mesh61.getVerticesData(VertexBuffer.ColorKind); + const meshNor = mesh61.getVerticesData(VertexBuffer.NormalKind); + const storage = options && options.storage ? options.storage : null; + let f = 0; + const totalFacets = meshInd.length / 3; + if (number) { + number = number > totalFacets ? totalFacets : number; + size = Math.round(totalFacets / number); + delta = 0; + } else { + size = size > totalFacets ? totalFacets : size; + } + const facetPos = []; + const facetNor = []; + const facetInd = []; + const facetUV = []; + const facetCol = []; + const barycenter = Vector3.Zero(); + const sizeO = size; + while (f < totalFacets) { + size = sizeO + Math.floor((1 + delta) * Math.random()); + if (f > totalFacets - size) { + size = totalFacets - f; + } + facetPos.length = 0; + facetNor.length = 0; + facetInd.length = 0; + facetUV.length = 0; + facetCol.length = 0; + let fi = 0; + for (let j = f * 3;j < (f + size) * 3; j++) { + facetInd.push(fi); + const i = meshInd[j]; + const i3 = i * 3; + facetPos.push(meshPos[i3], meshPos[i3 + 1], meshPos[i3 + 2]); + facetNor.push(meshNor[i3], meshNor[i3 + 1], meshNor[i3 + 2]); + if (meshUV) { + const i2 = i * 2; + facetUV.push(meshUV[i2], meshUV[i2 + 1]); + } + if (meshCol) { + const i4 = i * 4; + facetCol.push(meshCol[i4], meshCol[i4 + 1], meshCol[i4 + 2], meshCol[i4 + 3]); + } + fi++; + } + let idx = this.nbParticles; + const shape = this._posToShape(facetPos); + const shapeUV = this._uvsToShapeUV(facetUV); + const shapeInd = facetInd.slice(); + const shapeCol = facetCol.slice(); + const shapeNor = facetNor.slice(); + barycenter.copyFromFloats(0, 0, 0); + let v; + for (v = 0;v < shape.length; v++) { + barycenter.addInPlace(shape[v]); + } + barycenter.scaleInPlace(1 / shape.length); + const minimum = new Vector3(Infinity, Infinity, Infinity); + const maximum = new Vector3((-Infinity), (-Infinity), (-Infinity)); + for (v = 0;v < shape.length; v++) { + shape[v].subtractInPlace(barycenter); + minimum.minimizeInPlaceFromFloats(shape[v].x, shape[v].y, shape[v].z); + maximum.maximizeInPlaceFromFloats(shape[v].x, shape[v].y, shape[v].z); + } + let bInfo; + if (this._particlesIntersect) { + bInfo = new BoundingInfo(minimum, maximum); + } + let material20 = null; + if (this._useModelMaterial) { + material20 = mesh61.material ? mesh61.material : this._setDefaultMaterial(); + } + const modelShape = new ModelShape(this._shapeCounter, shape, shapeInd, shapeNor, shapeCol, shapeUV, null, null, material20); + const currentPos = this._positions.length; + const currentInd = this._indices.length; + this._meshBuilder(this._index, currentInd, shape, this._positions, shapeInd, this._indices, facetUV, this._uvs, shapeCol, this._colors, shapeNor, this._normals, idx, 0, null, modelShape); + this._addParticle(idx, this._lastParticleId, currentPos, currentInd, modelShape, this._shapeCounter, 0, bInfo, storage); + this.particles[this.nbParticles].position.addInPlace(barycenter); + if (!storage) { + this._index += shape.length; + idx++; + this.nbParticles++; + this._lastParticleId++; + } + this._shapeCounter++; + f += size; + } + this._isNotBuilt = true; + return this; } - return this.createEffect({ - vertex: (_a = particleSystem5 === null || particleSystem5 === undefined ? undefined : particleSystem5.vertexShaderName) !== null && _a !== undefined ? _a : "particles", - fragmentElement: fragmentName - }, attributesNamesOrOptions, effectCreationOption.concat(uniformsNames), allSamplers.concat(samplers), defines, fallbacks, onCompiled, onError); -}; -Mesh.prototype.getEmittedParticleSystems = function() { - const results = []; - for (let index = 0;index < this.getScene().particleSystems.length; index++) { - const particleSystem5 = this.getScene().particleSystems[index]; - if (particleSystem5.emitter === this) { - results.push(particleSystem5); + _unrotateFixedNormals() { + let index = 0; + let idx = 0; + const tmpNormal = TmpVectors.Vector3[0]; + const quaternion = TmpVectors.Quaternion[0]; + const invertedRotMatrix = TmpVectors.Matrix[0]; + for (let p = 0;p < this.particles.length; p++) { + const particle2 = this.particles[p]; + const shape = particle2._model._shape; + if (particle2.rotationQuaternion) { + particle2.rotationQuaternion.conjugateToRef(quaternion); + } else { + const rotation = particle2.rotation; + Quaternion.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, quaternion); + quaternion.conjugateInPlace(); + } + quaternion.toRotationMatrix(invertedRotMatrix); + for (let pt = 0;pt < shape.length; pt++) { + idx = index + pt * 3; + Vector3.TransformNormalFromFloatsToRef(this._normals32[idx], this._normals32[idx + 1], this._normals32[idx + 2], invertedRotMatrix, tmpNormal); + tmpNormal.toArray(this._fixedNormal32, idx); + } + index = idx + 3; + } + } + _resetCopy() { + const copy = this._copy; + copy.position.setAll(0); + copy.rotation.setAll(0); + copy.rotationQuaternion = null; + copy.scaling.setAll(1); + copy.uvs.copyFromFloats(0, 0, 1, 1); + copy.color = null; + copy.translateFromPivot = false; + copy.shapeId = 0; + copy.materialIndex = null; + } + _meshBuilder(p, ind, shape, positions, meshInd, indices, meshUV, uvs, meshCol, colors, meshNor, normals, idx, idxInShape, options, model) { + let i; + let u = 0; + let c = 0; + let n = 0; + this._resetCopy(); + const copy = this._copy; + const storeApart = options && options.storage ? true : false; + copy.idx = idx; + copy.idxInShape = idxInShape; + copy.shapeId = model.shapeId; + if (this._useModelMaterial) { + const materialId = model._material.uniqueId; + const materialIndexesById = this._materialIndexesById; + if (!Object.prototype.hasOwnProperty.call(materialIndexesById, materialId)) { + materialIndexesById[materialId] = this._materials.length; + this._materials.push(model._material); + } + const matIdx = materialIndexesById[materialId]; + copy.materialIndex = matIdx; + } + if (options && options.positionFunction) { + options.positionFunction(copy, idx, idxInShape); + this._mustUnrotateFixedNormals = true; + } + if (storeApart) { + return copy; + } + const rotMatrix = TmpVectors.Matrix[0]; + const tmpVertex = this._tmpVertex; + const tmpVector = tmpVertex.position; + const tmpColor = tmpVertex.color; + const tmpUV = tmpVertex.uv; + const tmpRotated = TmpVectors.Vector3[1]; + const pivotBackTranslation = TmpVectors.Vector3[2]; + const scaledPivot = TmpVectors.Vector3[3]; + Matrix.IdentityToRef(rotMatrix); + copy.getRotationMatrix(rotMatrix); + copy.pivot.multiplyToRef(copy.scaling, scaledPivot); + if (copy.translateFromPivot) { + pivotBackTranslation.setAll(0); + } else { + pivotBackTranslation.copyFrom(scaledPivot); + } + const someVertexFunction = options && options.vertexFunction; + for (i = 0;i < shape.length; i++) { + tmpVector.copyFrom(shape[i]); + if (copy.color) { + tmpColor.copyFrom(copy.color); + } + if (meshUV) { + tmpUV.copyFromFloats(meshUV[u], meshUV[u + 1]); + } + if (someVertexFunction) { + options.vertexFunction(copy, tmpVertex, i); + } + tmpVector.multiplyInPlace(copy.scaling).subtractInPlace(scaledPivot); + Vector3.TransformCoordinatesToRef(tmpVector, rotMatrix, tmpRotated); + tmpRotated.addInPlace(pivotBackTranslation).addInPlace(copy.position); + positions.push(tmpRotated.x, tmpRotated.y, tmpRotated.z); + if (meshUV) { + const copyUvs = copy.uvs; + uvs.push((copyUvs.z - copyUvs.x) * tmpUV.x + copyUvs.x, (copyUvs.w - copyUvs.y) * tmpUV.y + copyUvs.y); + u += 2; + } + if (copy.color) { + this._color.copyFrom(tmpColor); + } else { + const color = this._color; + if (meshCol && meshCol[c] !== undefined) { + color.r = meshCol[c]; + color.g = meshCol[c + 1]; + color.b = meshCol[c + 2]; + color.a = meshCol[c + 3]; + } else { + color.r = 1; + color.g = 1; + color.b = 1; + color.a = 1; + } + } + colors.push(this._color.r, this._color.g, this._color.b, this._color.a); + c += 4; + if (!this.recomputeNormals && meshNor) { + Vector3.TransformNormalFromFloatsToRef(meshNor[n], meshNor[n + 1], meshNor[n + 2], rotMatrix, tmpVector); + normals.push(tmpVector.x, tmpVector.y, tmpVector.z); + n += 3; + } + } + for (i = 0;i < meshInd.length; i++) { + const current_ind = p + meshInd[i]; + indices.push(current_ind); + if (current_ind > 65535) { + this._needs32Bits = true; + } } + if (this._depthSort || this._multimaterialEnabled) { + const matIndex = copy.materialIndex !== null ? copy.materialIndex : 0; + this.depthSortedParticles.push(new DepthSortedParticle(idx, ind, meshInd.length, matIndex)); + } + return copy; } - return results; -}; -Mesh.prototype.getHierarchyEmittedParticleSystems = function() { - const results = []; - const descendants = this.getDescendants(); - descendants.push(this); - for (let index = 0;index < this.getScene().particleSystems.length; index++) { - const particleSystem5 = this.getScene().particleSystems[index]; - const emitter = particleSystem5.emitter; - if (emitter.position && descendants.indexOf(emitter) !== -1) { - results.push(particleSystem5); - } - } - return results; -}; + _posToShape(positions) { + const shape = []; + for (let i = 0;i < positions.length; i += 3) { + shape.push(Vector3.FromArray(positions, i)); + } + return shape; + } + _uvsToShapeUV(uvs) { + const shapeUV = []; + if (uvs) { + for (let i = 0;i < uvs.length; i++) { + shapeUV.push(uvs[i]); + } + } + return shapeUV; + } + _addParticle(idx, id, idxpos, idxind, model, shapeId, idxInShape, bInfo = null, storage = null) { + const sp = new SolidParticle(idx, id, idxpos, idxind, model, shapeId, idxInShape, this, bInfo); + const target = storage ? storage : this.particles; + target.push(sp); + return sp; + } + addShape(mesh61, nb, options) { + const meshPos = mesh61.getVerticesData(VertexBuffer.PositionKind); + const meshInd = mesh61.getIndices(); + const meshUV = mesh61.getVerticesData(VertexBuffer.UVKind); + const meshCol = mesh61.getVerticesData(VertexBuffer.ColorKind); + const meshNor = mesh61.getVerticesData(VertexBuffer.NormalKind); + this.recomputeNormals = meshNor ? false : true; + const indices = Array.from(meshInd); + const shapeNormals = meshNor ? Array.from(meshNor) : []; + const shapeColors = meshCol ? Array.from(meshCol) : []; + const storage = options && options.storage ? options.storage : null; + let bbInfo = null; + if (this._particlesIntersect) { + bbInfo = mesh61.getBoundingInfo(); + } + const shape = this._posToShape(meshPos); + const shapeUV = this._uvsToShapeUV(meshUV); + const posfunc = options ? options.positionFunction : null; + const vtxfunc = options ? options.vertexFunction : null; + let material20 = null; + if (this._useModelMaterial) { + material20 = mesh61.material ? mesh61.material : this._setDefaultMaterial(); + } + const modelShape = new ModelShape(this._shapeCounter, shape, indices, shapeNormals, shapeColors, shapeUV, posfunc, vtxfunc, material20); + for (let i = 0;i < nb; i++) { + this._insertNewParticle(this.nbParticles, i, modelShape, shape, meshInd, meshUV, meshCol, meshNor, bbInfo, storage, options); + } + this._shapeCounter++; + this._isNotBuilt = true; + return this._shapeCounter - 1; + } + _rebuildParticle(particle2, reset = false) { + this._resetCopy(); + const copy = this._copy; + if (particle2._model._positionFunction) { + particle2._model._positionFunction(copy, particle2.idx, particle2.idxInShape); + } + const rotMatrix = TmpVectors.Matrix[0]; + const tmpVertex = TmpVectors.Vector3[0]; + const tmpRotated = TmpVectors.Vector3[1]; + const pivotBackTranslation = TmpVectors.Vector3[2]; + const scaledPivot = TmpVectors.Vector3[3]; + copy.getRotationMatrix(rotMatrix); + particle2.pivot.multiplyToRef(particle2.scaling, scaledPivot); + if (copy.translateFromPivot) { + pivotBackTranslation.copyFromFloats(0, 0, 0); + } else { + pivotBackTranslation.copyFrom(scaledPivot); + } + const shape = particle2._model._shape; + for (let pt = 0;pt < shape.length; pt++) { + tmpVertex.copyFrom(shape[pt]); + if (particle2._model._vertexFunction) { + particle2._model._vertexFunction(copy, tmpVertex, pt); + } + tmpVertex.multiplyInPlace(copy.scaling).subtractInPlace(scaledPivot); + Vector3.TransformCoordinatesToRef(tmpVertex, rotMatrix, tmpRotated); + tmpRotated.addInPlace(pivotBackTranslation).addInPlace(copy.position).toArray(this._positions32, particle2._pos + pt * 3); + } + if (reset) { + particle2.position.setAll(0); + particle2.rotation.setAll(0); + particle2.rotationQuaternion = null; + particle2.scaling.setAll(1); + particle2.uvs.setAll(0); + particle2.pivot.setAll(0); + particle2.translateFromPivot = false; + particle2.parentId = null; + } + } + rebuildMesh(reset = false) { + for (let p = 0;p < this.particles.length; p++) { + this._rebuildParticle(this.particles[p], reset); + } + this.mesh.updateVerticesData(VertexBuffer.PositionKind, this._positions32, false, false); + return this; + } + removeParticles(start, end) { + const nb = end - start + 1; + if (!this._expandable || nb <= 0 || nb >= this.nbParticles || !this._updatable) { + return []; + } + const particles = this.particles; + const currentNb = this.nbParticles; + if (end < currentNb - 1) { + const firstRemaining = end + 1; + const shiftPos = particles[firstRemaining]._pos - particles[start]._pos; + const shifInd = particles[firstRemaining]._ind - particles[start]._ind; + for (let i = firstRemaining;i < currentNb; i++) { + const part = particles[i]; + part._pos -= shiftPos; + part._ind -= shifInd; + } + } + const removed = particles.splice(start, nb); + this._positions.length = 0; + this._indices.length = 0; + this._colors.length = 0; + this._uvs.length = 0; + this._normals.length = 0; + this._index = 0; + this._idxOfId.length = 0; + if (this._depthSort || this._multimaterialEnabled) { + this.depthSortedParticles = []; + } + let ind = 0; + const particlesLength = particles.length; + for (let p = 0;p < particlesLength; p++) { + const particle2 = particles[p]; + const model = particle2._model; + const shape = model._shape; + const modelIndices = model._indices; + const modelNormals = model._normals; + const modelColors = model._shapeColors; + const modelUVs = model._shapeUV; + particle2.idx = p; + this._idxOfId[particle2.id] = p; + this._meshBuilder(this._index, ind, shape, this._positions, modelIndices, this._indices, modelUVs, this._uvs, modelColors, this._colors, modelNormals, this._normals, particle2.idx, particle2.idxInShape, null, model); + this._index += shape.length; + ind += modelIndices.length; + } + this.nbParticles -= nb; + this._isNotBuilt = true; + return removed; + } + insertParticlesFromArray(solidParticleArray) { + if (!this._expandable) { + return this; + } + let idxInShape = 0; + let currentShapeId = solidParticleArray[0].shapeId; + const nb = solidParticleArray.length; + for (let i = 0;i < nb; i++) { + const sp = solidParticleArray[i]; + const model = sp._model; + const shape = model._shape; + const meshInd = model._indices; + const meshUV = model._shapeUV; + const meshCol = model._shapeColors; + const meshNor = model._normals; + const noNor = meshNor ? false : true; + this.recomputeNormals = noNor || this.recomputeNormals; + const bbInfo = sp.getBoundingInfo(); + const newPart = this._insertNewParticle(this.nbParticles, idxInShape, model, shape, meshInd, meshUV, meshCol, meshNor, bbInfo, null, null); + sp.copyToRef(newPart); + idxInShape++; + if (currentShapeId != sp.shapeId) { + currentShapeId = sp.shapeId; + idxInShape = 0; + } + } + this._isNotBuilt = true; + return this; + } + _insertNewParticle(idx, i, modelShape, shape, meshInd, meshUV, meshCol, meshNor, bbInfo, storage, options) { + const currentPos = this._positions.length; + const currentInd = this._indices.length; + const currentCopy = this._meshBuilder(this._index, currentInd, shape, this._positions, meshInd, this._indices, meshUV, this._uvs, meshCol, this._colors, meshNor, this._normals, idx, i, options, modelShape); + let sp = null; + if (this._updatable) { + sp = this._addParticle(this.nbParticles, this._lastParticleId, currentPos, currentInd, modelShape, this._shapeCounter, i, bbInfo, storage); + sp.position.copyFrom(currentCopy.position); + sp.rotation.copyFrom(currentCopy.rotation); + if (currentCopy.rotationQuaternion) { + if (sp.rotationQuaternion) { + sp.rotationQuaternion.copyFrom(currentCopy.rotationQuaternion); + } else { + sp.rotationQuaternion = currentCopy.rotationQuaternion.clone(); + } + } + if (currentCopy.color) { + if (sp.color) { + sp.color.copyFrom(currentCopy.color); + } else { + sp.color = currentCopy.color.clone(); + } + } + sp.scaling.copyFrom(currentCopy.scaling); + sp.uvs.copyFrom(currentCopy.uvs); + if (currentCopy.materialIndex !== null) { + sp.materialIndex = currentCopy.materialIndex; + } + if (this.expandable) { + this._idxOfId[sp.id] = sp.idx; + } + } + if (!storage) { + this._index += shape.length; + this.nbParticles++; + this._lastParticleId++; + } + return sp; + } + setParticles(start = 0, end = this.nbParticles - 1, update = true) { + if (!this._updatable || this._isNotBuilt) { + return this; + } + this.beforeUpdateParticles(start, end, update); + const rotMatrix = TmpVectors.Matrix[0]; + const invertedMatrix = TmpVectors.Matrix[1]; + const mesh61 = this.mesh; + const colors32 = this._colors32; + const positions32 = this._positions32; + const normals32 = this._normals32; + const uvs32 = this._uvs32; + const indices32 = this._indices32; + const indices = this._indices; + const fixedNormal32 = this._fixedNormal32; + const depthSortParticles = this._depthSort && this._depthSortParticles; + const tempVectors = TmpVectors.Vector3; + const camAxisX = tempVectors[5].copyFromFloats(1, 0, 0); + const camAxisY = tempVectors[6].copyFromFloats(0, 1, 0); + const camAxisZ = tempVectors[7].copyFromFloats(0, 0, 1); + const minimum = tempVectors[8].setAll(Number.MAX_VALUE); + const maximum = tempVectors[9].setAll(-Number.MAX_VALUE); + const camInvertedPosition = tempVectors[10].setAll(0); + const tmpVertex = this._tmpVertex; + const tmpVector = tmpVertex.position; + const tmpColor = tmpVertex.color; + const tmpUV = tmpVertex.uv; + if (this.billboard || this._depthSort) { + this.mesh.computeWorldMatrix(true); + this.mesh._worldMatrix.invertToRef(invertedMatrix); + } + if (this.billboard) { + const tmpVector0 = tempVectors[0]; + this._camera.getDirectionToRef(Axis.Z, tmpVector0); + Vector3.TransformNormalToRef(tmpVector0, invertedMatrix, camAxisZ); + camAxisZ.normalize(); + const view = this._camera.getViewMatrix(true); + Vector3.TransformNormalFromFloatsToRef(view.m[1], view.m[5], view.m[9], invertedMatrix, camAxisY); + Vector3.CrossToRef(camAxisY, camAxisZ, camAxisX); + camAxisY.normalize(); + camAxisX.normalize(); + } + if (this._depthSort) { + Vector3.TransformCoordinatesToRef(this._camera.globalPosition, invertedMatrix, camInvertedPosition); + } + Matrix.IdentityToRef(rotMatrix); + let idx = 0; + let index = 0; + let colidx = 0; + let colorIndex = 0; + let uvidx = 0; + let uvIndex = 0; + let pt = 0; + if (this.mesh.isFacetDataEnabled) { + this._computeBoundingBox = true; + } + end = end >= this.nbParticles ? this.nbParticles - 1 : end; + if (this._computeBoundingBox) { + if (start != 0 || end != this.nbParticles - 1) { + const boundingInfo9 = this.mesh.getBoundingInfo(); + if (boundingInfo9) { + minimum.copyFrom(boundingInfo9.minimum); + maximum.copyFrom(boundingInfo9.maximum); + } + } + } + index = this.particles[start]._pos; + const vpos = index / 3 | 0; + colorIndex = vpos * 4; + uvIndex = vpos * 2; + for (let p = start;p <= end; p++) { + const particle2 = this.particles[p]; + this.updateParticle(particle2); + const shape = particle2._model._shape; + const shapeUV = particle2._model._shapeUV; + const particleRotationMatrix = particle2._rotationMatrix; + const particlePosition = particle2.position; + const particleRotation = particle2.rotation; + const particleScaling = particle2.scaling; + const particleGlobalPosition = particle2._globalPosition; + if (depthSortParticles) { + const dsp = this.depthSortedParticles[p]; + dsp.idx = particle2.idx; + dsp.ind = particle2._ind; + dsp.indicesLength = particle2._model._indicesLength; + dsp.sqDistance = Vector3.DistanceSquared(particle2.position, camInvertedPosition); + } + if (!particle2.alive || particle2._stillInvisible && !particle2.isVisible && !this._recomputeInvisibles) { + pt = shape.length; + index += pt * 3; + colorIndex += pt * 4; + uvIndex += pt * 2; + continue; + } + if (particle2.isVisible) { + particle2._stillInvisible = false; + const scaledPivot = tempVectors[12]; + particle2.pivot.multiplyToRef(particleScaling, scaledPivot); + if (this.billboard) { + particleRotation.x = 0; + particleRotation.y = 0; + } + if (this._computeParticleRotation || this.billboard) { + particle2.getRotationMatrix(rotMatrix); + } + const particleHasParent = particle2.parentId !== null; + if (particleHasParent) { + const parent = this.getParticleById(particle2.parentId); + if (parent) { + const parentRotationMatrix = parent._rotationMatrix; + const parentGlobalPosition = parent._globalPosition; + const rotatedY = particlePosition.x * parentRotationMatrix[1] + particlePosition.y * parentRotationMatrix[4] + particlePosition.z * parentRotationMatrix[7]; + const rotatedX = particlePosition.x * parentRotationMatrix[0] + particlePosition.y * parentRotationMatrix[3] + particlePosition.z * parentRotationMatrix[6]; + const rotatedZ = particlePosition.x * parentRotationMatrix[2] + particlePosition.y * parentRotationMatrix[5] + particlePosition.z * parentRotationMatrix[8]; + particleGlobalPosition.x = parentGlobalPosition.x + rotatedX; + particleGlobalPosition.y = parentGlobalPosition.y + rotatedY; + particleGlobalPosition.z = parentGlobalPosition.z + rotatedZ; + if (this._computeParticleRotation || this.billboard) { + const rotMatrixValues = rotMatrix.m; + particleRotationMatrix[0] = rotMatrixValues[0] * parentRotationMatrix[0] + rotMatrixValues[1] * parentRotationMatrix[3] + rotMatrixValues[2] * parentRotationMatrix[6]; + particleRotationMatrix[1] = rotMatrixValues[0] * parentRotationMatrix[1] + rotMatrixValues[1] * parentRotationMatrix[4] + rotMatrixValues[2] * parentRotationMatrix[7]; + particleRotationMatrix[2] = rotMatrixValues[0] * parentRotationMatrix[2] + rotMatrixValues[1] * parentRotationMatrix[5] + rotMatrixValues[2] * parentRotationMatrix[8]; + particleRotationMatrix[3] = rotMatrixValues[4] * parentRotationMatrix[0] + rotMatrixValues[5] * parentRotationMatrix[3] + rotMatrixValues[6] * parentRotationMatrix[6]; + particleRotationMatrix[4] = rotMatrixValues[4] * parentRotationMatrix[1] + rotMatrixValues[5] * parentRotationMatrix[4] + rotMatrixValues[6] * parentRotationMatrix[7]; + particleRotationMatrix[5] = rotMatrixValues[4] * parentRotationMatrix[2] + rotMatrixValues[5] * parentRotationMatrix[5] + rotMatrixValues[6] * parentRotationMatrix[8]; + particleRotationMatrix[6] = rotMatrixValues[8] * parentRotationMatrix[0] + rotMatrixValues[9] * parentRotationMatrix[3] + rotMatrixValues[10] * parentRotationMatrix[6]; + particleRotationMatrix[7] = rotMatrixValues[8] * parentRotationMatrix[1] + rotMatrixValues[9] * parentRotationMatrix[4] + rotMatrixValues[10] * parentRotationMatrix[7]; + particleRotationMatrix[8] = rotMatrixValues[8] * parentRotationMatrix[2] + rotMatrixValues[9] * parentRotationMatrix[5] + rotMatrixValues[10] * parentRotationMatrix[8]; + } + } else { + particle2.parentId = null; + } + } else { + particleGlobalPosition.x = particlePosition.x; + particleGlobalPosition.y = particlePosition.y; + particleGlobalPosition.z = particlePosition.z; + if (this._computeParticleRotation || this.billboard) { + const rotMatrixValues = rotMatrix.m; + particleRotationMatrix[0] = rotMatrixValues[0]; + particleRotationMatrix[1] = rotMatrixValues[1]; + particleRotationMatrix[2] = rotMatrixValues[2]; + particleRotationMatrix[3] = rotMatrixValues[4]; + particleRotationMatrix[4] = rotMatrixValues[5]; + particleRotationMatrix[5] = rotMatrixValues[6]; + particleRotationMatrix[6] = rotMatrixValues[8]; + particleRotationMatrix[7] = rotMatrixValues[9]; + particleRotationMatrix[8] = rotMatrixValues[10]; + } + } + const pivotBackTranslation = tempVectors[11]; + if (particle2.translateFromPivot) { + pivotBackTranslation.setAll(0); + } else { + pivotBackTranslation.copyFrom(scaledPivot); + } + for (pt = 0;pt < shape.length; pt++) { + idx = index + pt * 3; + colidx = colorIndex + pt * 4; + uvidx = uvIndex + pt * 2; + const iu = 2 * pt; + const iv = iu + 1; + tmpVector.copyFrom(shape[pt]); + if (this._computeParticleColor && particle2.color) { + tmpColor.copyFrom(particle2.color); + } + if (this._computeParticleTexture) { + tmpUV.copyFromFloats(shapeUV[iu], shapeUV[iv]); + } + if (this._computeParticleVertex) { + this.updateParticleVertex(particle2, tmpVertex, pt); + } + const vertexX = tmpVector.x * particleScaling.x - scaledPivot.x; + const vertexY = tmpVector.y * particleScaling.y - scaledPivot.y; + const vertexZ = tmpVector.z * particleScaling.z - scaledPivot.z; + let rotatedX = vertexX * particleRotationMatrix[0] + vertexY * particleRotationMatrix[3] + vertexZ * particleRotationMatrix[6]; + let rotatedY = vertexX * particleRotationMatrix[1] + vertexY * particleRotationMatrix[4] + vertexZ * particleRotationMatrix[7]; + let rotatedZ = vertexX * particleRotationMatrix[2] + vertexY * particleRotationMatrix[5] + vertexZ * particleRotationMatrix[8]; + rotatedX += pivotBackTranslation.x; + rotatedY += pivotBackTranslation.y; + rotatedZ += pivotBackTranslation.z; + const px = positions32[idx] = particleGlobalPosition.x + camAxisX.x * rotatedX + camAxisY.x * rotatedY + camAxisZ.x * rotatedZ; + const py = positions32[idx + 1] = particleGlobalPosition.y + camAxisX.y * rotatedX + camAxisY.y * rotatedY + camAxisZ.y * rotatedZ; + const pz = positions32[idx + 2] = particleGlobalPosition.z + camAxisX.z * rotatedX + camAxisY.z * rotatedY + camAxisZ.z * rotatedZ; + if (this._computeBoundingBox) { + minimum.minimizeInPlaceFromFloats(px, py, pz); + maximum.maximizeInPlaceFromFloats(px, py, pz); + } + if (!this._computeParticleVertex) { + const normalx = fixedNormal32[idx]; + const normaly = fixedNormal32[idx + 1]; + const normalz = fixedNormal32[idx + 2]; + const rotatedx = normalx * particleRotationMatrix[0] + normaly * particleRotationMatrix[3] + normalz * particleRotationMatrix[6]; + const rotatedy = normalx * particleRotationMatrix[1] + normaly * particleRotationMatrix[4] + normalz * particleRotationMatrix[7]; + const rotatedz = normalx * particleRotationMatrix[2] + normaly * particleRotationMatrix[5] + normalz * particleRotationMatrix[8]; + normals32[idx] = camAxisX.x * rotatedx + camAxisY.x * rotatedy + camAxisZ.x * rotatedz; + normals32[idx + 1] = camAxisX.y * rotatedx + camAxisY.y * rotatedy + camAxisZ.y * rotatedz; + normals32[idx + 2] = camAxisX.z * rotatedx + camAxisY.z * rotatedy + camAxisZ.z * rotatedz; + } + if (this._computeParticleColor && particle2.color) { + const colors322 = this._colors32; + colors322[colidx] = tmpColor.r; + colors322[colidx + 1] = tmpColor.g; + colors322[colidx + 2] = tmpColor.b; + colors322[colidx + 3] = tmpColor.a; + } + if (this._computeParticleTexture) { + const uvs = particle2.uvs; + uvs32[uvidx] = tmpUV.x * (uvs.z - uvs.x) + uvs.x; + uvs32[uvidx + 1] = tmpUV.y * (uvs.w - uvs.y) + uvs.y; + } + } + } else { + particle2._stillInvisible = true; + for (pt = 0;pt < shape.length; pt++) { + idx = index + pt * 3; + colidx = colorIndex + pt * 4; + uvidx = uvIndex + pt * 2; + positions32[idx] = positions32[idx + 1] = positions32[idx + 2] = 0; + normals32[idx] = normals32[idx + 1] = normals32[idx + 2] = 0; + if (this._computeParticleColor && particle2.color) { + const color = particle2.color; + colors32[colidx] = color.r; + colors32[colidx + 1] = color.g; + colors32[colidx + 2] = color.b; + colors32[colidx + 3] = color.a; + } + if (this._computeParticleTexture) { + const uvs = particle2.uvs; + uvs32[uvidx] = shapeUV[pt * 2] * (uvs.z - uvs.x) + uvs.x; + uvs32[uvidx + 1] = shapeUV[pt * 2 + 1] * (uvs.w - uvs.y) + uvs.y; + } + } + } + if (this._particlesIntersect) { + const bInfo = particle2.getBoundingInfo(); + const bBox = bInfo.boundingBox; + const bSphere = bInfo.boundingSphere; + const modelBoundingInfo = particle2._modelBoundingInfo; + if (!this._bSphereOnly) { + const modelBoundingInfoVectors = modelBoundingInfo.boundingBox.vectors; + const tempMin = tempVectors[1]; + const tempMax = tempVectors[2]; + tempMin.setAll(Number.MAX_VALUE); + tempMax.setAll(-Number.MAX_VALUE); + for (let b = 0;b < 8; b++) { + const scaledX = modelBoundingInfoVectors[b].x * particleScaling.x; + const scaledY = modelBoundingInfoVectors[b].y * particleScaling.y; + const scaledZ = modelBoundingInfoVectors[b].z * particleScaling.z; + const rotatedX = scaledX * particleRotationMatrix[0] + scaledY * particleRotationMatrix[3] + scaledZ * particleRotationMatrix[6]; + const rotatedY = scaledX * particleRotationMatrix[1] + scaledY * particleRotationMatrix[4] + scaledZ * particleRotationMatrix[7]; + const rotatedZ = scaledX * particleRotationMatrix[2] + scaledY * particleRotationMatrix[5] + scaledZ * particleRotationMatrix[8]; + const x = particlePosition.x + camAxisX.x * rotatedX + camAxisY.x * rotatedY + camAxisZ.x * rotatedZ; + const y = particlePosition.y + camAxisX.y * rotatedX + camAxisY.y * rotatedY + camAxisZ.y * rotatedZ; + const z = particlePosition.z + camAxisX.z * rotatedX + camAxisY.z * rotatedY + camAxisZ.z * rotatedZ; + tempMin.minimizeInPlaceFromFloats(x, y, z); + tempMax.maximizeInPlaceFromFloats(x, y, z); + } + bBox.reConstruct(tempMin, tempMax, mesh61._worldMatrix); + } + const minBbox = modelBoundingInfo.minimum.multiplyToRef(particleScaling, tempVectors[1]); + const maxBbox = modelBoundingInfo.maximum.multiplyToRef(particleScaling, tempVectors[2]); + const bSphereCenter = maxBbox.addToRef(minBbox, tempVectors[3]).scaleInPlace(0.5).addInPlace(particleGlobalPosition); + const halfDiag = maxBbox.subtractToRef(minBbox, tempVectors[4]).scaleInPlace(0.5 * this._bSphereRadiusFactor); + const bSphereMinBbox = bSphereCenter.subtractToRef(halfDiag, tempVectors[1]); + const bSphereMaxBbox = bSphereCenter.addToRef(halfDiag, tempVectors[2]); + bSphere.reConstruct(bSphereMinBbox, bSphereMaxBbox, mesh61._worldMatrix); + } + index = idx + 3; + colorIndex = colidx + 4; + uvIndex = uvidx + 2; + } + if (update) { + if (this._computeParticleColor) { + const vb = mesh61.getVertexBuffer(VertexBuffer.ColorKind); + if (vb && !mesh61.isPickable) { + vb.updateDirectly(colors32, 0); + } else { + mesh61.updateVerticesData(VertexBuffer.ColorKind, colors32, false, false); + } + } + if (this._computeParticleTexture) { + const vb = mesh61.getVertexBuffer(VertexBuffer.UVKind); + if (vb && !mesh61.isPickable) { + vb.updateDirectly(uvs32, 0); + } else { + mesh61.updateVerticesData(VertexBuffer.UVKind, uvs32, false, false); + } + } + const vbp = mesh61.getVertexBuffer(VertexBuffer.PositionKind); + if (vbp && !mesh61.isPickable) { + vbp.updateDirectly(positions32, 0); + } else { + mesh61.updateVerticesData(VertexBuffer.PositionKind, positions32, false, false); + } + if (!mesh61.areNormalsFrozen || mesh61.isFacetDataEnabled) { + if (this._computeParticleVertex || mesh61.isFacetDataEnabled) { + const params = mesh61.isFacetDataEnabled ? mesh61.getFacetDataParameters() : null; + VertexData.ComputeNormals(positions32, indices32, normals32, params); + for (let i = 0;i < normals32.length; i++) { + fixedNormal32[i] = normals32[i]; + } + } + if (!mesh61.areNormalsFrozen) { + const vb = mesh61.getVertexBuffer(VertexBuffer.NormalKind); + if (vb && !mesh61.isPickable) { + vb.updateDirectly(normals32, 0); + } else { + mesh61.updateVerticesData(VertexBuffer.NormalKind, normals32, false, false); + } + } + } + if (depthSortParticles) { + const depthSortedParticles = this.depthSortedParticles; + depthSortedParticles.sort(this._depthSortFunction); + const dspl = depthSortedParticles.length; + let sid = 0; + let faceId = 0; + for (let sorted = 0;sorted < dspl; sorted++) { + const sortedParticle = depthSortedParticles[sorted]; + const lind = sortedParticle.indicesLength; + const sind = sortedParticle.ind; + for (let i = 0;i < lind; i++) { + indices32[sid] = indices[sind + i]; + sid++; + if (this._pickable) { + const f = i % 3; + if (f == 0) { + const pickedData = this.pickedParticles[faceId]; + pickedData.idx = sortedParticle.idx; + pickedData.faceId = faceId; + faceId++; + } + } + } + } + } + if (this._autoFixFaceOrientation) { + let particleInd = 0; + for (let particleIdx = 0;particleIdx < this.particles.length; particleIdx++) { + const particle2 = depthSortParticles ? this.particles[this.depthSortedParticles[particleIdx].idx] : this.particles[particleIdx]; + const flipFaces = particle2.scale.x * particle2.scale.y * particle2.scale.z < 0; + if (flipFaces) { + for (let faceInd = 0;faceInd < particle2._model._indicesLength; faceInd += 3) { + const tmp = indices[particle2._ind + faceInd]; + indices32[particleInd + faceInd] = indices[particle2._ind + faceInd + 1]; + indices32[particleInd + faceInd + 1] = tmp; + } + } + particleInd += particle2._model._indicesLength; + } + } + if (depthSortParticles || this._autoFixFaceOrientation) { + mesh61.updateIndices(indices32); + } + } + if (this._computeBoundingBox) { + if (mesh61.hasBoundingInfo) { + mesh61.getBoundingInfo().reConstruct(minimum, maximum, mesh61._worldMatrix); + } else { + mesh61.buildBoundingInfo(minimum, maximum, mesh61._worldMatrix); + } + } + if (this._autoUpdateSubMeshes) { + this.computeSubMeshes(); + } + this._recomputeInvisibles = false; + this.afterUpdateParticles(start, end, update); + return this; + } + dispose() { + this.mesh.dispose(); + this.vars = null; + this._positions = null; + this._indices = null; + this._normals = null; + this._uvs = null; + this._colors = null; + this._indices32 = null; + this._positions32 = null; + this._normals32 = null; + this._fixedNormal32 = null; + this._uvs32 = null; + this._colors32 = null; + this.pickedParticles = null; + this.pickedBySubMesh = null; + this._materials = null; + this._materialIndexes = null; + this._indicesByMaterial = null; + this._idxOfId = null; + } + pickedParticle(pickingInfo10) { + if (pickingInfo10.hit) { + const subMesh10 = pickingInfo10.subMeshId; + const faceId = pickingInfo10.faceId - this.mesh.subMeshes[subMesh10].indexStart / 3; + const picked = this.pickedBySubMesh; + if (picked[subMesh10] && picked[subMesh10][faceId]) { + return picked[subMesh10][faceId]; + } + } + return null; + } + getParticleById(id) { + const p = this.particles[id]; + if (p && p.id == id) { + return p; + } + const particles = this.particles; + const idx = this._idxOfId[id]; + if (idx !== undefined) { + return particles[idx]; + } + let i = 0; + const nb = this.nbParticles; + while (i < nb) { + const particle2 = particles[i]; + if (particle2.id == id) { + return particle2; + } + i++; + } + return null; + } + getParticlesByShapeId(shapeId) { + const ref = []; + this.getParticlesByShapeIdToRef(shapeId, ref); + return ref; + } + getParticlesByShapeIdToRef(shapeId, ref) { + ref.length = 0; + for (let i = 0;i < this.nbParticles; i++) { + const p = this.particles[i]; + if (p.shapeId == shapeId) { + ref.push(p); + } + } + return this; + } + computeSubMeshes() { + if (!this.mesh || !this._multimaterialEnabled) { + return this; + } + const depthSortedParticles = this.depthSortedParticles; + if (this.particles.length > 0) { + for (let p = 0;p < this.particles.length; p++) { + const part = this.particles[p]; + if (!part.materialIndex) { + part.materialIndex = 0; + } + const sortedPart = depthSortedParticles[p]; + sortedPart.materialIndex = part.materialIndex; + sortedPart.ind = part._ind; + sortedPart.indicesLength = part._model._indicesLength; + sortedPart.idx = part.idx; + } + } + this._sortParticlesByMaterial(); + const indicesByMaterial = this._indicesByMaterial; + const materialIndexes = this._materialIndexes; + const mesh61 = this.mesh; + mesh61.subMeshes = []; + const vcount = mesh61.getTotalVertices(); + for (let m = 0;m < materialIndexes.length; m++) { + const start = indicesByMaterial[m]; + const count = indicesByMaterial[m + 1] - start; + const matIndex = materialIndexes[m]; + new SubMesh(matIndex, 0, vcount, start, count, mesh61); + } + return this; + } + _sortParticlesByMaterial() { + const indicesByMaterial = [0]; + this._indicesByMaterial = indicesByMaterial; + const materialIndexes = []; + this._materialIndexes = materialIndexes; + const depthSortedParticles = this.depthSortedParticles; + depthSortedParticles.sort(this._materialSortFunction); + const length = depthSortedParticles.length; + const indices32 = this._indices32; + const indices = this._indices; + let subMeshIndex = 0; + let subMeshFaceId = 0; + let sid = 0; + let lastMatIndex = depthSortedParticles[0].materialIndex; + materialIndexes.push(lastMatIndex); + if (this._pickable) { + this.pickedBySubMesh = [[]]; + this.pickedParticles = this.pickedBySubMesh[0]; + } + for (let sorted = 0;sorted < length; sorted++) { + const sortedPart = depthSortedParticles[sorted]; + const lind = sortedPart.indicesLength; + const sind = sortedPart.ind; + if (sortedPart.materialIndex !== lastMatIndex) { + lastMatIndex = sortedPart.materialIndex; + indicesByMaterial.push(sid); + materialIndexes.push(lastMatIndex); + if (this._pickable) { + subMeshIndex++; + this.pickedBySubMesh[subMeshIndex] = []; + subMeshFaceId = 0; + } + } + let faceId = 0; + for (let i = 0;i < lind; i++) { + indices32[sid] = indices[sind + i]; + if (this._pickable) { + const f = i % 3; + if (f == 0) { + const pickedData = this.pickedBySubMesh[subMeshIndex][subMeshFaceId]; + if (pickedData) { + pickedData.idx = sortedPart.idx; + pickedData.faceId = faceId; + } else { + this.pickedBySubMesh[subMeshIndex][subMeshFaceId] = { idx: sortedPart.idx, faceId }; + } + subMeshFaceId++; + faceId++; + } + } + sid++; + } + } + indicesByMaterial.push(indices32.length); + if (this._updatable) { + this.mesh.updateIndices(indices32); + } + return this; + } + _setMaterialIndexesById() { + this._materialIndexesById = {}; + for (let i = 0;i < this._materials.length; i++) { + const id = this._materials[i].uniqueId; + this._materialIndexesById[id] = i; + } + } + _filterUniqueMaterialId(array) { + const filtered = array.filter(function(value, index, self2) { + return self2.indexOf(value) === index; + }); + return filtered; + } + _setDefaultMaterial() { + if (!this._defaultMaterial) { + this._defaultMaterial = new StandardMaterial(this.name + "DefaultMaterial", this._scene); + } + return this._defaultMaterial; + } + refreshVisibleSize() { + if (!this._isVisibilityBoxLocked) { + this.mesh.refreshBoundingInfo(); + } + return this; + } + setVisibilityBox(size) { + const vis = size / 2; + this.mesh.buildBoundingInfo(new Vector3(-vis, -vis, -vis), new Vector3(vis, vis, vis)); + } + get isAlwaysVisible() { + return this._alwaysVisible; + } + set isAlwaysVisible(val) { + this._alwaysVisible = val; + this.mesh.alwaysSelectAsActiveMesh = val; + } + set isVisibilityBoxLocked(val) { + this._isVisibilityBoxLocked = val; + const boundingInfo9 = this.mesh.getBoundingInfo(); + boundingInfo9.isLocked = val; + } + get isVisibilityBoxLocked() { + return this._isVisibilityBoxLocked; + } + set computeParticleRotation(val) { + this._computeParticleRotation = val; + } + set computeParticleColor(val) { + this._computeParticleColor = val; + } + set computeParticleTexture(val) { + this._computeParticleTexture = val; + } + set computeParticleVertex(val) { + this._computeParticleVertex = val; + } + set computeBoundingBox(val) { + this._computeBoundingBox = val; + } + set depthSortParticles(val) { + this._depthSortParticles = val; + } + get computeParticleRotation() { + return this._computeParticleRotation; + } + get computeParticleColor() { + return this._computeParticleColor; + } + get computeParticleTexture() { + return this._computeParticleTexture; + } + get computeParticleVertex() { + return this._computeParticleVertex; + } + get computeBoundingBox() { + return this._computeBoundingBox; + } + get depthSortParticles() { + return this._depthSortParticles; + } + get expandable() { + return this._expandable; + } + get multimaterialEnabled() { + return this._multimaterialEnabled; + } + get useModelMaterial() { + return this._useModelMaterial; + } + get materials() { + return this._materials; + } + setMultiMaterial(materials) { + this._materials = this._filterUniqueMaterialId(materials); + this._setMaterialIndexesById(); + if (this._multimaterial) { + this._multimaterial.dispose(); + } + this._multimaterial = new MultiMaterial(this.name + "MultiMaterial", this._scene); + for (let m = 0;m < this._materials.length; m++) { + this._multimaterial.subMaterials.push(this._materials[m]); + } + this.computeSubMeshes(); + this.mesh.material = this._multimaterial; + } + get multimaterial() { + return this._multimaterial; + } + set multimaterial(mm) { + this._multimaterial = mm; + } + get autoUpdateSubMeshes() { + return this._autoUpdateSubMeshes; + } + set autoUpdateSubMeshes(val) { + this._autoUpdateSubMeshes = val; + } + initParticles() { + } + recycleParticle(particle2) { + return particle2; + } + updateParticle(particle2) { + return particle2; + } + updateParticleVertex(particle2, vertex, pt) { + return this; + } + beforeUpdateParticles(start, stop, update) { + } + afterUpdateParticles(start, stop, update) { + } +} +var init_solidParticleSystem = __esm(() => { + init_math_vector(); + init_math_color(); + init_buffer(); + init_mesh_vertexData(); + init_mesh(); + init_discBuilder(); + init_engineStore(); + init_solidParticle(); + init_boundingInfo(); + init_math_axis(); + init_subMesh(); + init_standardMaterial(); + init_multiMaterial(); +}); + +// node_modules/@babylonjs/core/Particles/cloudPoint.js +class CloudPoint { + constructor(particleIndex, group, groupId, idxInGroup, pcs) { + this.idx = 0; + this.color = new Color4(1, 1, 1, 1); + this.position = Vector3.Zero(); + this.rotation = Vector3.Zero(); + this.uv = new Vector2(0, 0); + this.velocity = Vector3.Zero(); + this.pivot = Vector3.Zero(); + this.translateFromPivot = false; + this._pos = 0; + this._ind = 0; + this.groupId = 0; + this.idxInGroup = 0; + this._stillInvisible = false; + this._rotationMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; + this.parentId = null; + this._globalPosition = Vector3.Zero(); + this.idx = particleIndex; + this._group = group; + this.groupId = groupId; + this.idxInGroup = idxInGroup; + this._pcs = pcs; + } + get size() { + return this.size; + } + set size(scale) { + this.size = scale; + } + get quaternion() { + return this.rotationQuaternion; + } + set quaternion(q) { + this.rotationQuaternion = q; + } + intersectsMesh(target, isSphere) { + if (!target.hasBoundingInfo) { + return false; + } + if (!this._pcs.mesh) { + throw new Error("Point Cloud System doesnt contain the Mesh"); + } + if (isSphere) { + return target.getBoundingInfo().boundingSphere.intersectsPoint(this.position.add(this._pcs.mesh.position)); + } + const bbox = target.getBoundingInfo().boundingBox; + const maxX = bbox.maximumWorld.x; + const minX = bbox.minimumWorld.x; + const maxY = bbox.maximumWorld.y; + const minY = bbox.minimumWorld.y; + const maxZ = bbox.maximumWorld.z; + const minZ = bbox.minimumWorld.z; + const x = this.position.x + this._pcs.mesh.position.x; + const y = this.position.y + this._pcs.mesh.position.y; + const z = this.position.z + this._pcs.mesh.position.z; + return minX <= x && x <= maxX && minY <= y && y <= maxY && minZ <= z && z <= maxZ; + } + getRotationMatrix(m) { + let quaternion; + if (this.rotationQuaternion) { + quaternion = this.rotationQuaternion; + } else { + quaternion = TmpVectors.Quaternion[0]; + const rotation = this.rotation; + Quaternion.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, quaternion); + } + quaternion.toRotationMatrix(m); + } +} + +class PointsGroup { + get groupID() { + return this.groupId; + } + set groupID(groupID) { + this.groupId = groupID; + } + constructor(id, posFunction) { + this.groupId = id; + this._positionFunction = posFunction; + } +} +var init_cloudPoint = __esm(() => { + init_math(); +}); + // node_modules/@babylonjs/core/Particles/pointsCloudSystem.js -var PointColor; -(function(PointColor2) { - PointColor2[PointColor2["Color"] = 2] = "Color"; - PointColor2[PointColor2["UV"] = 1] = "UV"; - PointColor2[PointColor2["Random"] = 0] = "Random"; - PointColor2[PointColor2["Stated"] = 3] = "Stated"; -})(PointColor || (PointColor = {})); -// node_modules/@babylonjs/core/Physics/v1/physicsEngineComponent.js -Object.defineProperty(AbstractMesh.prototype, "physicsImpostor", { - get: function() { - return this._physicsImpostor; - }, - set: function(value) { - if (this._physicsImpostor === value) { +class PointsCloudSystem { + get positions() { + return this._positions32; + } + get colors() { + return this._colors32; + } + get uvs() { + return this._uvs32; + } + constructor(name195, pointSize, scene23, options) { + this.particles = new Array; + this.nbParticles = 0; + this.counter = 0; + this.vars = {}; + this._promises = []; + this._positions = new Array; + this._indices = new Array; + this._normals = new Array; + this._colors = new Array; + this._uvs = new Array; + this._updatable = true; + this._isVisibilityBoxLocked = false; + this._alwaysVisible = false; + this._groups = new Array; + this._groupCounter = 0; + this._computeParticleColor = true; + this._computeParticleTexture = true; + this._computeParticleRotation = true; + this._computeBoundingBox = false; + this._isReady = false; + this.name = name195; + this._size = pointSize; + this._scene = scene23 || EngineStore.LastCreatedScene; + if (options && options.updatable !== undefined) { + this._updatable = options.updatable; + } else { + this._updatable = true; + } + } + buildMeshAsync(material20) { + return Promise.all(this._promises).then(() => { + this._isReady = true; + return this._buildMesh(material20); + }); + } + _buildMesh(material20) { + if (this.nbParticles === 0) { + this.addPoints(1); + } + this._positions32 = new Float32Array(this._positions); + this._uvs32 = new Float32Array(this._uvs); + this._colors32 = new Float32Array(this._colors); + const vertexData = new VertexData; + vertexData.set(this._positions32, VertexBuffer.PositionKind); + if (this._uvs32.length > 0) { + vertexData.set(this._uvs32, VertexBuffer.UVKind); + } + let ec = 0; + if (this._colors32.length > 0) { + ec = 1; + vertexData.set(this._colors32, VertexBuffer.ColorKind); + } + const mesh62 = new Mesh(this.name, this._scene); + vertexData.applyToMesh(mesh62, this._updatable); + this.mesh = mesh62; + this._positions = null; + this._uvs = null; + this._colors = null; + if (!this._updatable) { + this.particles.length = 0; + } + let mat = material20; + if (!mat) { + mat = new StandardMaterial("point cloud material", this._scene); + mat.emissiveColor = new Color3(ec, ec, ec); + mat.disableLighting = true; + mat.pointsCloud = true; + mat.pointSize = this._size; + } + mesh62.material = mat; + return new Promise((resolve) => resolve(mesh62)); + } + _addParticle(idx, group, groupId, idxInGroup) { + const cp = new CloudPoint(idx, group, groupId, idxInGroup, this); + this.particles.push(cp); + return cp; + } + _randomUnitVector(particle2) { + particle2.position = new Vector3(Math.random(), Math.random(), Math.random()); + particle2.color = new Color4(1, 1, 1, 1); + } + _getColorIndicesForCoord(pointsGroup, x, y, width) { + const imageData = pointsGroup._groupImageData; + const color = y * (width * 4) + x * 4; + const colorIndices = [color, color + 1, color + 2, color + 3]; + const redIndex = colorIndices[0]; + const greenIndex = colorIndices[1]; + const blueIndex = colorIndices[2]; + const alphaIndex = colorIndices[3]; + const redForCoord = imageData[redIndex]; + const greenForCoord = imageData[greenIndex]; + const blueForCoord = imageData[blueIndex]; + const alphaForCoord = imageData[alphaIndex]; + return new Color4(redForCoord / 255, greenForCoord / 255, blueForCoord / 255, alphaForCoord); + } + _setPointsColorOrUV(mesh62, pointsGroup, isVolume, colorFromTexture, hasTexture, color, range, uvSetIndex) { + uvSetIndex = uvSetIndex !== null && uvSetIndex !== undefined ? uvSetIndex : 0; + if (isVolume) { + mesh62.updateFacetData(); + } + const boundInfo = mesh62.getBoundingInfo(); + const diameter = 2 * boundInfo.boundingSphere.radius; + let meshPos = mesh62.getVerticesData(VertexBuffer.PositionKind); + const meshInd = mesh62.getIndices(); + const meshUV = mesh62.getVerticesData(VertexBuffer.UVKind + (uvSetIndex ? uvSetIndex + 1 : "")); + const meshCol = mesh62.getVerticesData(VertexBuffer.ColorKind); + const place = Vector3.Zero(); + mesh62.computeWorldMatrix(); + const meshMatrix = mesh62.getWorldMatrix(); + if (!meshMatrix.isIdentity()) { + meshPos = meshPos.slice(0); + for (let p = 0;p < meshPos.length / 3; p++) { + Vector3.TransformCoordinatesFromFloatsToRef(meshPos[3 * p], meshPos[3 * p + 1], meshPos[3 * p + 2], meshMatrix, place); + meshPos[3 * p] = place.x; + meshPos[3 * p + 1] = place.y; + meshPos[3 * p + 2] = place.z; + } + } + let idxPoints = 0; + let id0 = 0; + let id1 = 0; + let id2 = 0; + let v0X = 0; + let v0Y = 0; + let v0Z = 0; + let v1X = 0; + let v1Y = 0; + let v1Z = 0; + let v2X = 0; + let v2Y = 0; + let v2Z = 0; + const vertex0 = Vector3.Zero(); + const vertex1 = Vector3.Zero(); + const vertex2 = Vector3.Zero(); + const vec0 = Vector3.Zero(); + const vec1 = Vector3.Zero(); + let uv0X = 0; + let uv0Y = 0; + let uv1X = 0; + let uv1Y = 0; + let uv2X = 0; + let uv2Y = 0; + const uv0 = Vector2.Zero(); + const uv1 = Vector2.Zero(); + const uv2 = Vector2.Zero(); + const uvec0 = Vector2.Zero(); + const uvec1 = Vector2.Zero(); + let col0X = 0; + let col0Y = 0; + let col0Z = 0; + let col0A = 0; + let col1X = 0; + let col1Y = 0; + let col1Z = 0; + let col1A = 0; + let col2X = 0; + let col2Y = 0; + let col2Z = 0; + let col2A = 0; + const col0 = Vector4.Zero(); + const col1 = Vector4.Zero(); + const col2 = Vector4.Zero(); + const colvec0 = Vector4.Zero(); + const colvec1 = Vector4.Zero(); + let lamda = 0; + let mu = 0; + range = range ? range : 0; + let facetPoint; + let uvPoint; + let colPoint = new Vector4(0, 0, 0, 0); + let norm = Vector3.Zero(); + let tang = Vector3.Zero(); + let biNorm = Vector3.Zero(); + let angle = 0; + let facetPlaneVec = Vector3.Zero(); + let gap = 0; + let distance = 0; + const ray11 = new Ray(Vector3.Zero(), new Vector3(1, 0, 0)); + let pickInfo; + let direction = Vector3.Zero(); + for (let index = 0;index < meshInd.length / 3; index++) { + id0 = meshInd[3 * index]; + id1 = meshInd[3 * index + 1]; + id2 = meshInd[3 * index + 2]; + v0X = meshPos[3 * id0]; + v0Y = meshPos[3 * id0 + 1]; + v0Z = meshPos[3 * id0 + 2]; + v1X = meshPos[3 * id1]; + v1Y = meshPos[3 * id1 + 1]; + v1Z = meshPos[3 * id1 + 2]; + v2X = meshPos[3 * id2]; + v2Y = meshPos[3 * id2 + 1]; + v2Z = meshPos[3 * id2 + 2]; + vertex0.set(v0X, v0Y, v0Z); + vertex1.set(v1X, v1Y, v1Z); + vertex2.set(v2X, v2Y, v2Z); + vertex1.subtractToRef(vertex0, vec0); + vertex2.subtractToRef(vertex1, vec1); + if (meshUV) { + uv0X = meshUV[2 * id0]; + uv0Y = meshUV[2 * id0 + 1]; + uv1X = meshUV[2 * id1]; + uv1Y = meshUV[2 * id1 + 1]; + uv2X = meshUV[2 * id2]; + uv2Y = meshUV[2 * id2 + 1]; + uv0.set(uv0X, uv0Y); + uv1.set(uv1X, uv1Y); + uv2.set(uv2X, uv2Y); + uv1.subtractToRef(uv0, uvec0); + uv2.subtractToRef(uv1, uvec1); + } + if (meshCol && colorFromTexture) { + col0X = meshCol[4 * id0]; + col0Y = meshCol[4 * id0 + 1]; + col0Z = meshCol[4 * id0 + 2]; + col0A = meshCol[4 * id0 + 3]; + col1X = meshCol[4 * id1]; + col1Y = meshCol[4 * id1 + 1]; + col1Z = meshCol[4 * id1 + 2]; + col1A = meshCol[4 * id1 + 3]; + col2X = meshCol[4 * id2]; + col2Y = meshCol[4 * id2 + 1]; + col2Z = meshCol[4 * id2 + 2]; + col2A = meshCol[4 * id2 + 3]; + col0.set(col0X, col0Y, col0Z, col0A); + col1.set(col1X, col1Y, col1Z, col1A); + col2.set(col2X, col2Y, col2Z, col2A); + col1.subtractToRef(col0, colvec0); + col2.subtractToRef(col1, colvec1); + } + let width; + let height; + let deltaS; + let deltaV; + let h; + let s; + let v; + let hsvCol; + const statedColor = new Color3(0, 0, 0); + const colPoint3 = new Color3(0, 0, 0); + let pointColors; + let particle2; + for (let i = 0;i < pointsGroup._groupDensity[index]; i++) { + idxPoints = this.particles.length; + this._addParticle(idxPoints, pointsGroup, this._groupCounter, index + i); + particle2 = this.particles[idxPoints]; + lamda = Scalar.RandomRange(0, 1); + mu = Scalar.RandomRange(0, 1); + facetPoint = vertex0.add(vec0.scale(lamda)).add(vec1.scale(lamda * mu)); + if (isVolume) { + norm = mesh62.getFacetNormal(index).normalize().scale(-1); + tang = vec0.clone().normalize(); + biNorm = Vector3.Cross(norm, tang); + angle = Scalar.RandomRange(0, 2 * Math.PI); + facetPlaneVec = tang.scale(Math.cos(angle)).add(biNorm.scale(Math.sin(angle))); + angle = Scalar.RandomRange(0.1, Math.PI / 2); + direction = facetPlaneVec.scale(Math.cos(angle)).add(norm.scale(Math.sin(angle))); + ray11.origin = facetPoint.add(direction.scale(0.00001)); + ray11.direction = direction; + ray11.length = diameter; + pickInfo = ray11.intersectsMesh(mesh62); + if (pickInfo.hit) { + distance = pickInfo.pickedPoint.subtract(facetPoint).length(); + gap = Scalar.RandomRange(0, 1) * distance; + facetPoint.addInPlace(direction.scale(gap)); + } + } + particle2.position = facetPoint.clone(); + this._positions.push(particle2.position.x, particle2.position.y, particle2.position.z); + if (colorFromTexture !== undefined) { + if (meshUV) { + uvPoint = uv0.add(uvec0.scale(lamda)).add(uvec1.scale(lamda * mu)); + if (colorFromTexture) { + if (hasTexture && pointsGroup._groupImageData !== null) { + width = pointsGroup._groupImgWidth; + height = pointsGroup._groupImgHeight; + pointColors = this._getColorIndicesForCoord(pointsGroup, Math.round(uvPoint.x * width), Math.round(uvPoint.y * height), width); + particle2.color = pointColors; + this._colors.push(pointColors.r, pointColors.g, pointColors.b, pointColors.a); + } else { + if (meshCol) { + colPoint = col0.add(colvec0.scale(lamda)).add(colvec1.scale(lamda * mu)); + particle2.color = new Color4(colPoint.x, colPoint.y, colPoint.z, colPoint.w); + this._colors.push(colPoint.x, colPoint.y, colPoint.z, colPoint.w); + } else { + colPoint = col0.set(Math.random(), Math.random(), Math.random(), 1); + particle2.color = new Color4(colPoint.x, colPoint.y, colPoint.z, colPoint.w); + this._colors.push(colPoint.x, colPoint.y, colPoint.z, colPoint.w); + } + } + } else { + particle2.uv = uvPoint.clone(); + this._uvs.push(particle2.uv.x, particle2.uv.y); + } + } + } else { + if (color) { + statedColor.set(color.r, color.g, color.b); + deltaS = Scalar.RandomRange(-range, range); + deltaV = Scalar.RandomRange(-range, range); + hsvCol = statedColor.toHSV(); + h = hsvCol.r; + s = hsvCol.g + deltaS; + v = hsvCol.b + deltaV; + if (s < 0) { + s = 0; + } + if (s > 1) { + s = 1; + } + if (v < 0) { + v = 0; + } + if (v > 1) { + v = 1; + } + Color3.HSVtoRGBToRef(h, s, v, colPoint3); + colPoint.set(colPoint3.r, colPoint3.g, colPoint3.b, 1); + } else { + colPoint = col0.set(Math.random(), Math.random(), Math.random(), 1); + } + particle2.color = new Color4(colPoint.x, colPoint.y, colPoint.z, colPoint.w); + this._colors.push(colPoint.x, colPoint.y, colPoint.z, colPoint.w); + } + } + } + } + _colorFromTexture(mesh62, pointsGroup, isVolume) { + if (mesh62.material === null) { + Logger.Warn(mesh62.name + "has no material."); + pointsGroup._groupImageData = null; + this._setPointsColorOrUV(mesh62, pointsGroup, isVolume, true, false); return; } - if (this._disposePhysicsObserver) { - this.onDisposeObservable.remove(this._disposePhysicsObserver); + const mat = mesh62.material; + const textureList = mat.getActiveTextures(); + if (textureList.length === 0) { + Logger.Warn(mesh62.name + "has no usable texture."); + pointsGroup._groupImageData = null; + this._setPointsColorOrUV(mesh62, pointsGroup, isVolume, true, false); + return; } - this._physicsImpostor = value; - if (value) { - this._disposePhysicsObserver = this.onDisposeObservable.add(() => { - if (this.physicsImpostor) { - this.physicsImpostor.dispose(); - /*!doNotRecurse*/ - this.physicsImpostor = null; + const clone = mesh62.clone(); + clone.setEnabled(false); + this._promises.push(new Promise((resolve) => { + BaseTexture.WhenAllReady(textureList, () => { + let n = pointsGroup._textureNb; + if (n < 0) { + n = 0; + } + if (n > textureList.length - 1) { + n = textureList.length - 1; + } + const finalize = () => { + pointsGroup._groupImgWidth = textureList[n].getSize().width; + pointsGroup._groupImgHeight = textureList[n].getSize().height; + this._setPointsColorOrUV(clone, pointsGroup, isVolume, true, true, undefined, undefined, textureList[n].coordinatesIndex); + clone.dispose(); + resolve(); + }; + pointsGroup._groupImageData = null; + const dataPromise = textureList[n].readPixels(); + if (!dataPromise) { + finalize(); + } else { + dataPromise.then((data) => { + pointsGroup._groupImageData = data; + finalize(); + }); } }); + })); + } + _calculateDensity(nbPoints, positions, indices) { + let density = new Array; + let id0; + let id1; + let id2; + let v0X; + let v0Y; + let v0Z; + let v1X; + let v1Y; + let v1Z; + let v2X; + let v2Y; + let v2Z; + const vertex0 = Vector3.Zero(); + const vertex1 = Vector3.Zero(); + const vertex2 = Vector3.Zero(); + const vec0 = Vector3.Zero(); + const vec1 = Vector3.Zero(); + const vec2 = Vector3.Zero(); + let a; + let b; + let c; + let p; + let area; + const areas = new Array; + let surfaceArea = 0; + const nbFacets = indices.length / 3; + for (let index = 0;index < nbFacets; index++) { + id0 = indices[3 * index]; + id1 = indices[3 * index + 1]; + id2 = indices[3 * index + 2]; + v0X = positions[3 * id0]; + v0Y = positions[3 * id0 + 1]; + v0Z = positions[3 * id0 + 2]; + v1X = positions[3 * id1]; + v1Y = positions[3 * id1 + 1]; + v1Z = positions[3 * id1 + 2]; + v2X = positions[3 * id2]; + v2Y = positions[3 * id2 + 1]; + v2Z = positions[3 * id2 + 2]; + vertex0.set(v0X, v0Y, v0Z); + vertex1.set(v1X, v1Y, v1Z); + vertex2.set(v2X, v2Y, v2Z); + vertex1.subtractToRef(vertex0, vec0); + vertex2.subtractToRef(vertex1, vec1); + vertex2.subtractToRef(vertex0, vec2); + a = vec0.length(); + b = vec1.length(); + c = vec2.length(); + p = (a + b + c) / 2; + area = Math.sqrt(p * (p - a) * (p - b) * (p - c)); + surfaceArea += area; + areas[index] = area; } - }, - enumerable: true, - configurable: true -}); -AbstractMesh.prototype.getPhysicsImpostor = function() { - return this.physicsImpostor; -}; -AbstractMesh.prototype.applyImpulse = function(force, contactPoint) { - if (!this.physicsImpostor) { + let pointCount = 0; + for (let index = 0;index < nbFacets; index++) { + density[index] = Math.floor(nbPoints * areas[index] / surfaceArea); + pointCount += density[index]; + } + const diff = nbPoints - pointCount; + const pointsPerFacet = Math.floor(diff / nbFacets); + const extraPoints = diff % nbFacets; + if (pointsPerFacet > 0) { + density = density.map((x) => x + pointsPerFacet); + } + for (let index = 0;index < extraPoints; index++) { + density[index] += 1; + } + return density; + } + addPoints(nb, pointFunction = this._randomUnitVector) { + const pointsGroup = new PointsGroup(this._groupCounter, pointFunction); + let cp; + let idx = this.nbParticles; + for (let i = 0;i < nb; i++) { + cp = this._addParticle(idx, pointsGroup, this._groupCounter, i); + if (pointsGroup && pointsGroup._positionFunction) { + pointsGroup._positionFunction(cp, idx, i); + } + this._positions.push(cp.position.x, cp.position.y, cp.position.z); + if (cp.color) { + this._colors.push(cp.color.r, cp.color.g, cp.color.b, cp.color.a); + } + if (cp.uv) { + this._uvs.push(cp.uv.x, cp.uv.y); + } + idx++; + } + this.nbParticles += nb; + this._groupCounter++; + return this._groupCounter; + } + addSurfacePoints(mesh62, nb, colorWith, color, range) { + let colored = colorWith ? colorWith : PointColor.Random; + if (isNaN(colored) || colored < 0 || colored > 3) { + colored = PointColor.Random; + } + const meshPos = mesh62.getVerticesData(VertexBuffer.PositionKind); + const meshInd = mesh62.getIndices(); + this._groups.push(this._groupCounter); + const pointsGroup = new PointsGroup(this._groupCounter, null); + pointsGroup._groupDensity = this._calculateDensity(nb, meshPos, meshInd); + if (colored === PointColor.Color) { + pointsGroup._textureNb = color ? color : 0; + } else { + color = color ? color : new Color4(1, 1, 1, 1); + } + switch (colored) { + case PointColor.Color: + this._colorFromTexture(mesh62, pointsGroup, false); + break; + case PointColor.UV: + this._setPointsColorOrUV(mesh62, pointsGroup, false, false, false); + break; + case PointColor.Random: + this._setPointsColorOrUV(mesh62, pointsGroup, false); + break; + case PointColor.Stated: + this._setPointsColorOrUV(mesh62, pointsGroup, false, undefined, undefined, color, range); + break; + } + this.nbParticles += nb; + this._groupCounter++; + return this._groupCounter - 1; + } + addVolumePoints(mesh62, nb, colorWith, color, range) { + let colored = colorWith ? colorWith : PointColor.Random; + if (isNaN(colored) || colored < 0 || colored > 3) { + colored = PointColor.Random; + } + const meshPos = mesh62.getVerticesData(VertexBuffer.PositionKind); + const meshInd = mesh62.getIndices(); + this._groups.push(this._groupCounter); + const pointsGroup = new PointsGroup(this._groupCounter, null); + pointsGroup._groupDensity = this._calculateDensity(nb, meshPos, meshInd); + if (colored === PointColor.Color) { + pointsGroup._textureNb = color ? color : 0; + } else { + color = color ? color : new Color4(1, 1, 1, 1); + } + switch (colored) { + case PointColor.Color: + this._colorFromTexture(mesh62, pointsGroup, true); + break; + case PointColor.UV: + this._setPointsColorOrUV(mesh62, pointsGroup, true, false, false); + break; + case PointColor.Random: + this._setPointsColorOrUV(mesh62, pointsGroup, true); + break; + case PointColor.Stated: + this._setPointsColorOrUV(mesh62, pointsGroup, true, undefined, undefined, color, range); + break; + } + this.nbParticles += nb; + this._groupCounter++; + return this._groupCounter - 1; + } + setParticles(start = 0, end = this.nbParticles - 1, update = true) { + var _a, _b; + if (!this._updatable || !this._isReady) { + return this; + } + this.beforeUpdateParticles(start, end, update); + const rotMatrix = TmpVectors.Matrix[0]; + const mesh62 = this.mesh; + const colors32 = this._colors32; + const positions32 = this._positions32; + const uvs32 = this._uvs32; + const tempVectors = TmpVectors.Vector3; + const camAxisX = tempVectors[5].copyFromFloats(1, 0, 0); + const camAxisY = tempVectors[6].copyFromFloats(0, 1, 0); + const camAxisZ = tempVectors[7].copyFromFloats(0, 0, 1); + const minimum = tempVectors[8].setAll(Number.MAX_VALUE); + const maximum = tempVectors[9].setAll(-Number.MAX_VALUE); + Matrix.IdentityToRef(rotMatrix); + let idx = 0; + if ((_a = this.mesh) === null || _a === undefined ? undefined : _a.isFacetDataEnabled) { + this._computeBoundingBox = true; + } + end = end >= this.nbParticles ? this.nbParticles - 1 : end; + if (this._computeBoundingBox) { + if (start != 0 || end != this.nbParticles - 1) { + const boundingInfo9 = (_b = this.mesh) === null || _b === undefined ? undefined : _b.getBoundingInfo(); + if (boundingInfo9) { + minimum.copyFrom(boundingInfo9.minimum); + maximum.copyFrom(boundingInfo9.maximum); + } + } + } + idx = 0; + let pindex = 0; + let cindex = 0; + let uindex = 0; + for (let p = start;p <= end; p++) { + const particle2 = this.particles[p]; + idx = particle2.idx; + pindex = 3 * idx; + cindex = 4 * idx; + uindex = 2 * idx; + this.updateParticle(particle2); + const particleRotationMatrix = particle2._rotationMatrix; + const particlePosition = particle2.position; + const particleGlobalPosition = particle2._globalPosition; + if (this._computeParticleRotation) { + particle2.getRotationMatrix(rotMatrix); + } + const particleHasParent = particle2.parentId !== null; + if (particleHasParent) { + const parent = this.particles[particle2.parentId]; + const parentRotationMatrix = parent._rotationMatrix; + const parentGlobalPosition = parent._globalPosition; + const rotatedY2 = particlePosition.x * parentRotationMatrix[1] + particlePosition.y * parentRotationMatrix[4] + particlePosition.z * parentRotationMatrix[7]; + const rotatedX2 = particlePosition.x * parentRotationMatrix[0] + particlePosition.y * parentRotationMatrix[3] + particlePosition.z * parentRotationMatrix[6]; + const rotatedZ2 = particlePosition.x * parentRotationMatrix[2] + particlePosition.y * parentRotationMatrix[5] + particlePosition.z * parentRotationMatrix[8]; + particleGlobalPosition.x = parentGlobalPosition.x + rotatedX2; + particleGlobalPosition.y = parentGlobalPosition.y + rotatedY2; + particleGlobalPosition.z = parentGlobalPosition.z + rotatedZ2; + if (this._computeParticleRotation) { + const rotMatrixValues = rotMatrix.m; + particleRotationMatrix[0] = rotMatrixValues[0] * parentRotationMatrix[0] + rotMatrixValues[1] * parentRotationMatrix[3] + rotMatrixValues[2] * parentRotationMatrix[6]; + particleRotationMatrix[1] = rotMatrixValues[0] * parentRotationMatrix[1] + rotMatrixValues[1] * parentRotationMatrix[4] + rotMatrixValues[2] * parentRotationMatrix[7]; + particleRotationMatrix[2] = rotMatrixValues[0] * parentRotationMatrix[2] + rotMatrixValues[1] * parentRotationMatrix[5] + rotMatrixValues[2] * parentRotationMatrix[8]; + particleRotationMatrix[3] = rotMatrixValues[4] * parentRotationMatrix[0] + rotMatrixValues[5] * parentRotationMatrix[3] + rotMatrixValues[6] * parentRotationMatrix[6]; + particleRotationMatrix[4] = rotMatrixValues[4] * parentRotationMatrix[1] + rotMatrixValues[5] * parentRotationMatrix[4] + rotMatrixValues[6] * parentRotationMatrix[7]; + particleRotationMatrix[5] = rotMatrixValues[4] * parentRotationMatrix[2] + rotMatrixValues[5] * parentRotationMatrix[5] + rotMatrixValues[6] * parentRotationMatrix[8]; + particleRotationMatrix[6] = rotMatrixValues[8] * parentRotationMatrix[0] + rotMatrixValues[9] * parentRotationMatrix[3] + rotMatrixValues[10] * parentRotationMatrix[6]; + particleRotationMatrix[7] = rotMatrixValues[8] * parentRotationMatrix[1] + rotMatrixValues[9] * parentRotationMatrix[4] + rotMatrixValues[10] * parentRotationMatrix[7]; + particleRotationMatrix[8] = rotMatrixValues[8] * parentRotationMatrix[2] + rotMatrixValues[9] * parentRotationMatrix[5] + rotMatrixValues[10] * parentRotationMatrix[8]; + } + } else { + particleGlobalPosition.x = 0; + particleGlobalPosition.y = 0; + particleGlobalPosition.z = 0; + if (this._computeParticleRotation) { + const rotMatrixValues = rotMatrix.m; + particleRotationMatrix[0] = rotMatrixValues[0]; + particleRotationMatrix[1] = rotMatrixValues[1]; + particleRotationMatrix[2] = rotMatrixValues[2]; + particleRotationMatrix[3] = rotMatrixValues[4]; + particleRotationMatrix[4] = rotMatrixValues[5]; + particleRotationMatrix[5] = rotMatrixValues[6]; + particleRotationMatrix[6] = rotMatrixValues[8]; + particleRotationMatrix[7] = rotMatrixValues[9]; + particleRotationMatrix[8] = rotMatrixValues[10]; + } + } + const pivotBackTranslation = tempVectors[11]; + if (particle2.translateFromPivot) { + pivotBackTranslation.setAll(0); + } else { + pivotBackTranslation.copyFrom(particle2.pivot); + } + const tmpVertex = tempVectors[0]; + tmpVertex.copyFrom(particle2.position); + const vertexX = tmpVertex.x - particle2.pivot.x; + const vertexY = tmpVertex.y - particle2.pivot.y; + const vertexZ = tmpVertex.z - particle2.pivot.z; + let rotatedX = vertexX * particleRotationMatrix[0] + vertexY * particleRotationMatrix[3] + vertexZ * particleRotationMatrix[6]; + let rotatedY = vertexX * particleRotationMatrix[1] + vertexY * particleRotationMatrix[4] + vertexZ * particleRotationMatrix[7]; + let rotatedZ = vertexX * particleRotationMatrix[2] + vertexY * particleRotationMatrix[5] + vertexZ * particleRotationMatrix[8]; + rotatedX += pivotBackTranslation.x; + rotatedY += pivotBackTranslation.y; + rotatedZ += pivotBackTranslation.z; + const px = positions32[pindex] = particleGlobalPosition.x + camAxisX.x * rotatedX + camAxisY.x * rotatedY + camAxisZ.x * rotatedZ; + const py = positions32[pindex + 1] = particleGlobalPosition.y + camAxisX.y * rotatedX + camAxisY.y * rotatedY + camAxisZ.y * rotatedZ; + const pz = positions32[pindex + 2] = particleGlobalPosition.z + camAxisX.z * rotatedX + camAxisY.z * rotatedY + camAxisZ.z * rotatedZ; + if (this._computeBoundingBox) { + minimum.minimizeInPlaceFromFloats(px, py, pz); + maximum.maximizeInPlaceFromFloats(px, py, pz); + } + if (this._computeParticleColor && particle2.color) { + const color = particle2.color; + const colors322 = this._colors32; + colors322[cindex] = color.r; + colors322[cindex + 1] = color.g; + colors322[cindex + 2] = color.b; + colors322[cindex + 3] = color.a; + } + if (this._computeParticleTexture && particle2.uv) { + const uv = particle2.uv; + const uvs322 = this._uvs32; + uvs322[uindex] = uv.x; + uvs322[uindex + 1] = uv.y; + } + } + if (mesh62) { + if (update) { + if (this._computeParticleColor) { + mesh62.updateVerticesData(VertexBuffer.ColorKind, colors32, false, false); + } + if (this._computeParticleTexture) { + mesh62.updateVerticesData(VertexBuffer.UVKind, uvs32, false, false); + } + mesh62.updateVerticesData(VertexBuffer.PositionKind, positions32, false, false); + } + if (this._computeBoundingBox) { + if (mesh62.hasBoundingInfo) { + mesh62.getBoundingInfo().reConstruct(minimum, maximum, mesh62._worldMatrix); + } else { + mesh62.buildBoundingInfo(minimum, maximum, mesh62._worldMatrix); + } + } + } + this.afterUpdateParticles(start, end, update); return this; } - this.physicsImpostor.applyImpulse(force, contactPoint); - return this; -}; -AbstractMesh.prototype.setPhysicsLinkWith = function(otherMesh, pivot1, pivot2, options) { - if (!this.physicsImpostor || !otherMesh.physicsImpostor) { + dispose() { + var _a; + (_a = this.mesh) === null || _a === undefined || _a.dispose(); + this.vars = null; + this._positions = null; + this._indices = null; + this._normals = null; + this._uvs = null; + this._colors = null; + this._indices32 = null; + this._positions32 = null; + this._uvs32 = null; + this._colors32 = null; + } + refreshVisibleSize() { + var _a; + if (!this._isVisibilityBoxLocked) { + (_a = this.mesh) === null || _a === undefined || _a.refreshBoundingInfo(); + } return this; } - this.physicsImpostor.createJoint(otherMesh.physicsImpostor, PhysicsJoint.HingeJoint, { - mainPivot: pivot1, - connectedPivot: pivot2, - nativeParams: options + setVisibilityBox(size) { + if (!this.mesh) { + return; + } + const vis = size / 2; + this.mesh.buildBoundingInfo(new Vector3(-vis, -vis, -vis), new Vector3(vis, vis, vis)); + } + get isAlwaysVisible() { + return this._alwaysVisible; + } + set isAlwaysVisible(val) { + if (!this.mesh) { + return; + } + this._alwaysVisible = val; + this.mesh.alwaysSelectAsActiveMesh = val; + } + set computeParticleRotation(val) { + this._computeParticleRotation = val; + } + set computeParticleColor(val) { + this._computeParticleColor = val; + } + set computeParticleTexture(val) { + this._computeParticleTexture = val; + } + get computeParticleColor() { + return this._computeParticleColor; + } + get computeParticleTexture() { + return this._computeParticleTexture; + } + set computeBoundingBox(val) { + this._computeBoundingBox = val; + } + get computeBoundingBox() { + return this._computeBoundingBox; + } + initParticles() { + } + recycleParticle(particle2) { + return particle2; + } + updateParticle(particle2) { + return particle2; + } + beforeUpdateParticles(start, stop, update) { + } + afterUpdateParticles(start, stop, update) { + } +} +var PointColor; +var init_pointsCloudSystem = __esm(() => { + init_math(); + init_math_vector(); + init_logger(); + init_buffer(); + init_mesh_vertexData(); + init_mesh(); + init_engineStore(); + init_cloudPoint(); + init_ray(); + init_standardMaterial(); + init_baseTexture(); + init_math_scalar(); + (function(PointColor2) { + PointColor2[PointColor2["Color"] = 2] = "Color"; + PointColor2[PointColor2["UV"] = 1] = "UV"; + PointColor2[PointColor2["Random"] = 0] = "Random"; + PointColor2[PointColor2["Stated"] = 3] = "Stated"; + })(PointColor || (PointColor = {})); +}); + +// node_modules/@babylonjs/core/Particles/index.js +var init_Particles = __esm(() => { + init_baseParticleSystem(); + init_EmitterTypes(); + init_webgl2ParticleSystem(); + init_computeShaderParticleSystem(); + init_gpuParticleSystem(); + init_IParticleSystem(); + init_particle(); + init_particleHelper(); + init_particleSystem(); + init_particleSystemComponent(); + init_particleSystemComponent(); + init_particleSystemSet(); + init_solidParticle(); + init_solidParticleSystem(); + init_cloudPoint(); + init_pointsCloudSystem(); + init_subEmitter(); +}); + +// node_modules/@babylonjs/core/Physics/v1/IPhysicsEnginePlugin.js +var init_IPhysicsEnginePlugin = __esm(() => { +}); + +// node_modules/@babylonjs/core/Physics/v1/physicsEngineComponent.js +var init_physicsEngineComponent = __esm(() => { + init_abstractMesh(); + init_physicsJoint(); + Object.defineProperty(AbstractMesh.prototype, "physicsImpostor", { + get: function() { + return this._physicsImpostor; + }, + set: function(value) { + if (this._physicsImpostor === value) { + return; + } + if (this._disposePhysicsObserver) { + this.onDisposeObservable.remove(this._disposePhysicsObserver); + } + this._physicsImpostor = value; + if (value) { + this._disposePhysicsObserver = this.onDisposeObservable.add(() => { + if (this.physicsImpostor) { + this.physicsImpostor.dispose(); + /*!doNotRecurse*/ + this.physicsImpostor = null; + } + }); + } + }, + enumerable: true, + configurable: true }); - return this; -}; + AbstractMesh.prototype.getPhysicsImpostor = function() { + return this.physicsImpostor; + }; + AbstractMesh.prototype.applyImpulse = function(force, contactPoint) { + if (!this.physicsImpostor) { + return this; + } + this.physicsImpostor.applyImpulse(force, contactPoint); + return this; + }; + AbstractMesh.prototype.setPhysicsLinkWith = function(otherMesh, pivot1, pivot2, options) { + if (!this.physicsImpostor || !otherMesh.physicsImpostor) { + return this; + } + this.physicsImpostor.createJoint(otherMesh.physicsImpostor, PhysicsJoint.HingeJoint, { + mainPivot: pivot1, + connectedPivot: pivot2, + nativeParams: options + }); + return this; + }; +}); + +// node_modules/@babylonjs/core/Physics/v1/Plugins/index.js +var init_Plugins3 = __esm(() => { + init_cannonJSPlugin(); + init_ammoJSPlugin(); + init_oimoJSPlugin(); +}); + +// node_modules/@babylonjs/core/Physics/v1/index.js +var init_v1 = __esm(() => { + init_IPhysicsEnginePlugin(); + init_physicsEngine(); + init_physicsEngineComponent(); + init_physicsImpostor(); + init_physicsJoint(); + init_Plugins3(); +}); + // node_modules/@babylonjs/core/Physics/v2/physicsEngine.js class PhysicsEngine2 { getPluginVersion() { @@ -151820,137 +168185,2231 @@ class PhysicsEngine2 { return result; } } +var init_physicsEngine2 = __esm(() => { + init_math_vector(); + init_physicsRaycastResult(); + init_devTools(); +}); + +// node_modules/@babylonjs/core/Physics/v2/physicsBody.js +class PhysicsBody { + constructor(transformNode17, motionType, startsAsleep, scene23) { + this._pluginData = undefined; + this._pluginDataInstances = []; + this._collisionCBEnabled = false; + this._collisionEndedCBEnabled = false; + this.disablePreStep = true; + this._isDisposed = false; + if (!scene23) { + return; + } + const physicsEngine3 = scene23.getPhysicsEngine(); + if (!physicsEngine3) { + throw new Error("No Physics Engine available."); + } + this._physicsEngine = physicsEngine3; + if (physicsEngine3.getPluginVersion() != 2) { + throw new Error("Plugin version is incorrect. Expected version 2."); + } + const physicsPlugin = physicsEngine3.getPhysicsPlugin(); + if (!physicsPlugin) { + throw new Error("No Physics Plugin available."); + } + this._physicsPlugin = physicsPlugin; + if (!transformNode17.rotationQuaternion) { + transformNode17.rotationQuaternion = Quaternion.FromEulerAngles(transformNode17.rotation.x, transformNode17.rotation.y, transformNode17.rotation.z); + } + this.startAsleep = startsAsleep; + const m = transformNode17; + if (m.hasThinInstances) { + this._physicsPlugin.initBodyInstances(this, motionType, m); + } else { + if (transformNode17.parent) { + transformNode17.computeWorldMatrix(true); + } + this._physicsPlugin.initBody(this, motionType, transformNode17.absolutePosition, transformNode17.absoluteRotationQuaternion); + } + this.transformNode = transformNode17; + transformNode17.physicsBody = this; + physicsEngine3.addBody(this); + this._nodeDisposeObserver = transformNode17.onDisposeObservable.add(() => { + this.dispose(); + }); + } + getClassName() { + return "PhysicsBody"; + } + clone(transformNode17) { + const clonedBody = new PhysicsBody(transformNode17, this.getMotionType(), this.startAsleep, this.transformNode.getScene()); + clonedBody.shape = this.shape; + clonedBody.setMassProperties(this.getMassProperties()); + clonedBody.setLinearDamping(this.getLinearDamping()); + clonedBody.setAngularDamping(this.getAngularDamping()); + return clonedBody; + } + updateBodyInstances() { + const m = this.transformNode; + if (m.hasThinInstances) { + this._physicsPlugin.updateBodyInstances(this, m); + } + } + get numInstances() { + return this._pluginDataInstances.length; + } + set shape(shape) { + this._physicsPlugin.setShape(this, shape); + } + get shape() { + return this._physicsPlugin.getShape(this); + } + setEventMask(eventMask, instanceIndex) { + this._physicsPlugin.setEventMask(this, eventMask, instanceIndex); + } + getEventMask(instanceIndex) { + return this._physicsPlugin.getEventMask(this, instanceIndex); + } + setMotionType(motionType, instanceIndex) { + this._physicsPlugin.setMotionType(this, motionType, instanceIndex); + } + getMotionType(instanceIndex) { + return this._physicsPlugin.getMotionType(this, instanceIndex); + } + computeMassProperties(instanceIndex) { + return this._physicsPlugin.computeMassProperties(this, instanceIndex); + } + setMassProperties(massProps, instanceIndex) { + this._physicsPlugin.setMassProperties(this, massProps, instanceIndex); + } + getMassProperties(instanceIndex) { + return this._physicsPlugin.getMassProperties(this, instanceIndex); + } + setLinearDamping(damping, instanceIndex) { + this._physicsPlugin.setLinearDamping(this, damping, instanceIndex); + } + getLinearDamping(instanceIndex) { + return this._physicsPlugin.getLinearDamping(this, instanceIndex); + } + setAngularDamping(damping, instanceIndex) { + this._physicsPlugin.setAngularDamping(this, damping, instanceIndex); + } + getAngularDamping(instanceIndex) { + return this._physicsPlugin.getAngularDamping(this, instanceIndex); + } + setLinearVelocity(linVel, instanceIndex) { + this._physicsPlugin.setLinearVelocity(this, linVel, instanceIndex); + } + getLinearVelocityToRef(linVel, instanceIndex) { + return this._physicsPlugin.getLinearVelocityToRef(this, linVel, instanceIndex); + } + getLinearVelocity(instanceIndex) { + const ref = new Vector3; + this.getLinearVelocityToRef(ref, instanceIndex); + return ref; + } + setAngularVelocity(angVel, instanceIndex) { + this._physicsPlugin.setAngularVelocity(this, angVel, instanceIndex); + } + getAngularVelocityToRef(angVel, instanceIndex) { + return this._physicsPlugin.getAngularVelocityToRef(this, angVel, instanceIndex); + } + getAngularVelocity(instanceIndex) { + const ref = new Vector3; + this.getAngularVelocityToRef(ref, instanceIndex); + return ref; + } + applyImpulse(impulse, location2, instanceIndex) { + this._physicsPlugin.applyImpulse(this, impulse, location2, instanceIndex); + } + applyForce(force, location2, instanceIndex) { + this._physicsPlugin.applyForce(this, force, location2, instanceIndex); + } + getGeometry() { + return this._physicsPlugin.getBodyGeometry(this); + } + getCollisionObservable() { + return this._physicsPlugin.getCollisionObservable(this); + } + getCollisionEndedObservable() { + return this._physicsPlugin.getCollisionEndedObservable(this); + } + setCollisionCallbackEnabled(enabled) { + this._collisionCBEnabled = enabled; + this._physicsPlugin.setCollisionCallbackEnabled(this, enabled); + } + setCollisionEndedCallbackEnabled(enabled) { + this._collisionEndedCBEnabled = enabled; + this._physicsPlugin.setCollisionEndedCallbackEnabled(this, enabled); + } + getObjectCenterWorld(instanceIndex) { + const ref = new Vector3; + return this.getObjectCenterWorldToRef(ref, instanceIndex); + } + getObjectCenterWorldToRef(ref, instanceIndex) { + var _a; + if (((_a = this._pluginDataInstances) === null || _a === undefined ? undefined : _a.length) > 0) { + const index = instanceIndex || 0; + const matrixData = this.transformNode._thinInstanceDataStorage.matrixData; + if (matrixData) { + ref.set(matrixData[index * 16 + 12], matrixData[index * 16 + 13], matrixData[index * 16 + 14]); + } + } else { + ref.copyFrom(this.transformNode.position); + } + return ref; + } + addConstraint(childBody, constraint, instanceIndex, childInstanceIndex) { + this._physicsPlugin.addConstraint(this, childBody, constraint, instanceIndex, childInstanceIndex); + } + syncWithBone(bone4, boneMesh, jointPivot, distToJoint, adjustRotation, boneAxis) { + const mesh62 = this.transformNode; + if (mesh62.rotationQuaternion) { + if (adjustRotation) { + const tempQuat = TmpVectors.Quaternion[0]; + bone4.getRotationQuaternionToRef(Space.WORLD, boneMesh, tempQuat); + tempQuat.multiplyToRef(adjustRotation, mesh62.rotationQuaternion); + } else { + bone4.getRotationQuaternionToRef(Space.WORLD, boneMesh, mesh62.rotationQuaternion); + } + } + const pos = TmpVectors.Vector3[0]; + const boneDir = TmpVectors.Vector3[1]; + if (!boneAxis) { + boneAxis = TmpVectors.Vector3[2]; + boneAxis.x = 0; + boneAxis.y = 1; + boneAxis.z = 0; + } + bone4.getDirectionToRef(boneAxis, boneMesh, boneDir); + bone4.getAbsolutePositionToRef(boneMesh, pos); + if ((distToJoint === undefined || distToJoint === null) && jointPivot) { + distToJoint = jointPivot.length(); + } + if (distToJoint !== undefined && distToJoint !== null) { + pos.x += boneDir.x * distToJoint; + pos.y += boneDir.y * distToJoint; + pos.z += boneDir.z * distToJoint; + } + mesh62.setAbsolutePosition(pos); + } + iterateOverAllInstances(callback) { + var _a; + if (((_a = this._pluginDataInstances) === null || _a === undefined ? undefined : _a.length) > 0) { + for (let i = 0;i < this._pluginDataInstances.length; i++) { + callback(this, i); + } + } else { + callback(this, undefined); + } + } + setGravityFactor(factor, instanceIndex) { + this._physicsPlugin.setGravityFactor(this, factor, instanceIndex); + } + getGravityFactor(instanceIndex) { + return this._physicsPlugin.getGravityFactor(this, instanceIndex); + } + setTargetTransform(position, rotation, instanceIndex) { + this._physicsPlugin.setTargetTransform(this, position, rotation, instanceIndex); + } + dispose() { + if (this._isDisposed) { + return; + } + if (this._collisionCBEnabled) { + this.setCollisionCallbackEnabled(false); + } + if (this._collisionEndedCBEnabled) { + this.setCollisionEndedCallbackEnabled(false); + } + if (this._nodeDisposeObserver) { + this.transformNode.onDisposeObservable.remove(this._nodeDisposeObserver); + this._nodeDisposeObserver = null; + } + this._physicsEngine.removeBody(this); + this._physicsPlugin.removeBody(this); + this._physicsPlugin.disposeBody(this); + this.transformNode.physicsBody = null; + this._pluginData = null; + this._pluginDataInstances.length = 0; + this._isDisposed = true; + } +} +var init_physicsBody = __esm(() => { + init_math_vector(); + init_math_axis(); +}); + // node_modules/@babylonjs/core/Physics/v2/IPhysicsEnginePlugin.js -var PhysicsConstraintAxisLimitMode; -(function(PhysicsConstraintAxisLimitMode2) { - PhysicsConstraintAxisLimitMode2[PhysicsConstraintAxisLimitMode2["FREE"] = 0] = "FREE"; - PhysicsConstraintAxisLimitMode2[PhysicsConstraintAxisLimitMode2["LIMITED"] = 1] = "LIMITED"; - PhysicsConstraintAxisLimitMode2[PhysicsConstraintAxisLimitMode2["LOCKED"] = 2] = "LOCKED"; -})(PhysicsConstraintAxisLimitMode || (PhysicsConstraintAxisLimitMode = {})); -var PhysicsConstraintAxis; -(function(PhysicsConstraintAxis2) { - PhysicsConstraintAxis2[PhysicsConstraintAxis2["LINEAR_X"] = 0] = "LINEAR_X"; - PhysicsConstraintAxis2[PhysicsConstraintAxis2["LINEAR_Y"] = 1] = "LINEAR_Y"; - PhysicsConstraintAxis2[PhysicsConstraintAxis2["LINEAR_Z"] = 2] = "LINEAR_Z"; - PhysicsConstraintAxis2[PhysicsConstraintAxis2["ANGULAR_X"] = 3] = "ANGULAR_X"; - PhysicsConstraintAxis2[PhysicsConstraintAxis2["ANGULAR_Y"] = 4] = "ANGULAR_Y"; - PhysicsConstraintAxis2[PhysicsConstraintAxis2["ANGULAR_Z"] = 5] = "ANGULAR_Z"; - PhysicsConstraintAxis2[PhysicsConstraintAxis2["LINEAR_DISTANCE"] = 6] = "LINEAR_DISTANCE"; -})(PhysicsConstraintAxis || (PhysicsConstraintAxis = {})); -var PhysicsConstraintType; -(function(PhysicsConstraintType2) { - PhysicsConstraintType2[PhysicsConstraintType2["BALL_AND_SOCKET"] = 1] = "BALL_AND_SOCKET"; - PhysicsConstraintType2[PhysicsConstraintType2["DISTANCE"] = 2] = "DISTANCE"; - PhysicsConstraintType2[PhysicsConstraintType2["HINGE"] = 3] = "HINGE"; - PhysicsConstraintType2[PhysicsConstraintType2["SLIDER"] = 4] = "SLIDER"; - PhysicsConstraintType2[PhysicsConstraintType2["LOCK"] = 5] = "LOCK"; - PhysicsConstraintType2[PhysicsConstraintType2["PRISMATIC"] = 6] = "PRISMATIC"; - PhysicsConstraintType2[PhysicsConstraintType2["SIX_DOF"] = 7] = "SIX_DOF"; -})(PhysicsConstraintType || (PhysicsConstraintType = {})); -var PhysicsShapeType; -(function(PhysicsShapeType2) { - PhysicsShapeType2[PhysicsShapeType2["SPHERE"] = 0] = "SPHERE"; - PhysicsShapeType2[PhysicsShapeType2["CAPSULE"] = 1] = "CAPSULE"; - PhysicsShapeType2[PhysicsShapeType2["CYLINDER"] = 2] = "CYLINDER"; - PhysicsShapeType2[PhysicsShapeType2["BOX"] = 3] = "BOX"; - PhysicsShapeType2[PhysicsShapeType2["CONVEX_HULL"] = 4] = "CONVEX_HULL"; - PhysicsShapeType2[PhysicsShapeType2["CONTAINER"] = 5] = "CONTAINER"; - PhysicsShapeType2[PhysicsShapeType2["MESH"] = 6] = "MESH"; - PhysicsShapeType2[PhysicsShapeType2["HEIGHTFIELD"] = 7] = "HEIGHTFIELD"; -})(PhysicsShapeType || (PhysicsShapeType = {})); -var PhysicsConstraintMotorType; -(function(PhysicsConstraintMotorType2) { - PhysicsConstraintMotorType2[PhysicsConstraintMotorType2["NONE"] = 0] = "NONE"; - PhysicsConstraintMotorType2[PhysicsConstraintMotorType2["VELOCITY"] = 1] = "VELOCITY"; - PhysicsConstraintMotorType2[PhysicsConstraintMotorType2["POSITION"] = 2] = "POSITION"; -})(PhysicsConstraintMotorType || (PhysicsConstraintMotorType = {})); -var PhysicsEventType; -(function(PhysicsEventType2) { - PhysicsEventType2["COLLISION_STARTED"] = "COLLISION_STARTED"; - PhysicsEventType2["COLLISION_CONTINUED"] = "COLLISION_CONTINUED"; - PhysicsEventType2["COLLISION_FINISHED"] = "COLLISION_FINISHED"; - PhysicsEventType2["TRIGGER_ENTERED"] = "TRIGGER_ENTERED"; - PhysicsEventType2["TRIGGER_EXITED"] = "TRIGGER_EXITED"; -})(PhysicsEventType || (PhysicsEventType = {})); -var PhysicsMotionType; -(function(PhysicsMotionType2) { - PhysicsMotionType2[PhysicsMotionType2["STATIC"] = 0] = "STATIC"; - PhysicsMotionType2[PhysicsMotionType2["ANIMATED"] = 1] = "ANIMATED"; - PhysicsMotionType2[PhysicsMotionType2["DYNAMIC"] = 2] = "DYNAMIC"; -})(PhysicsMotionType || (PhysicsMotionType = {})); +var PhysicsConstraintAxisLimitMode, PhysicsConstraintAxis, PhysicsConstraintType, PhysicsShapeType, PhysicsConstraintMotorType, PhysicsEventType, PhysicsMotionType; +var init_IPhysicsEnginePlugin2 = __esm(() => { + (function(PhysicsConstraintAxisLimitMode2) { + PhysicsConstraintAxisLimitMode2[PhysicsConstraintAxisLimitMode2["FREE"] = 0] = "FREE"; + PhysicsConstraintAxisLimitMode2[PhysicsConstraintAxisLimitMode2["LIMITED"] = 1] = "LIMITED"; + PhysicsConstraintAxisLimitMode2[PhysicsConstraintAxisLimitMode2["LOCKED"] = 2] = "LOCKED"; + })(PhysicsConstraintAxisLimitMode || (PhysicsConstraintAxisLimitMode = {})); + (function(PhysicsConstraintAxis2) { + PhysicsConstraintAxis2[PhysicsConstraintAxis2["LINEAR_X"] = 0] = "LINEAR_X"; + PhysicsConstraintAxis2[PhysicsConstraintAxis2["LINEAR_Y"] = 1] = "LINEAR_Y"; + PhysicsConstraintAxis2[PhysicsConstraintAxis2["LINEAR_Z"] = 2] = "LINEAR_Z"; + PhysicsConstraintAxis2[PhysicsConstraintAxis2["ANGULAR_X"] = 3] = "ANGULAR_X"; + PhysicsConstraintAxis2[PhysicsConstraintAxis2["ANGULAR_Y"] = 4] = "ANGULAR_Y"; + PhysicsConstraintAxis2[PhysicsConstraintAxis2["ANGULAR_Z"] = 5] = "ANGULAR_Z"; + PhysicsConstraintAxis2[PhysicsConstraintAxis2["LINEAR_DISTANCE"] = 6] = "LINEAR_DISTANCE"; + })(PhysicsConstraintAxis || (PhysicsConstraintAxis = {})); + (function(PhysicsConstraintType2) { + PhysicsConstraintType2[PhysicsConstraintType2["BALL_AND_SOCKET"] = 1] = "BALL_AND_SOCKET"; + PhysicsConstraintType2[PhysicsConstraintType2["DISTANCE"] = 2] = "DISTANCE"; + PhysicsConstraintType2[PhysicsConstraintType2["HINGE"] = 3] = "HINGE"; + PhysicsConstraintType2[PhysicsConstraintType2["SLIDER"] = 4] = "SLIDER"; + PhysicsConstraintType2[PhysicsConstraintType2["LOCK"] = 5] = "LOCK"; + PhysicsConstraintType2[PhysicsConstraintType2["PRISMATIC"] = 6] = "PRISMATIC"; + PhysicsConstraintType2[PhysicsConstraintType2["SIX_DOF"] = 7] = "SIX_DOF"; + })(PhysicsConstraintType || (PhysicsConstraintType = {})); + (function(PhysicsShapeType2) { + PhysicsShapeType2[PhysicsShapeType2["SPHERE"] = 0] = "SPHERE"; + PhysicsShapeType2[PhysicsShapeType2["CAPSULE"] = 1] = "CAPSULE"; + PhysicsShapeType2[PhysicsShapeType2["CYLINDER"] = 2] = "CYLINDER"; + PhysicsShapeType2[PhysicsShapeType2["BOX"] = 3] = "BOX"; + PhysicsShapeType2[PhysicsShapeType2["CONVEX_HULL"] = 4] = "CONVEX_HULL"; + PhysicsShapeType2[PhysicsShapeType2["CONTAINER"] = 5] = "CONTAINER"; + PhysicsShapeType2[PhysicsShapeType2["MESH"] = 6] = "MESH"; + PhysicsShapeType2[PhysicsShapeType2["HEIGHTFIELD"] = 7] = "HEIGHTFIELD"; + })(PhysicsShapeType || (PhysicsShapeType = {})); + (function(PhysicsConstraintMotorType2) { + PhysicsConstraintMotorType2[PhysicsConstraintMotorType2["NONE"] = 0] = "NONE"; + PhysicsConstraintMotorType2[PhysicsConstraintMotorType2["VELOCITY"] = 1] = "VELOCITY"; + PhysicsConstraintMotorType2[PhysicsConstraintMotorType2["POSITION"] = 2] = "POSITION"; + })(PhysicsConstraintMotorType || (PhysicsConstraintMotorType = {})); + (function(PhysicsEventType2) { + PhysicsEventType2["COLLISION_STARTED"] = "COLLISION_STARTED"; + PhysicsEventType2["COLLISION_CONTINUED"] = "COLLISION_CONTINUED"; + PhysicsEventType2["COLLISION_FINISHED"] = "COLLISION_FINISHED"; + PhysicsEventType2["TRIGGER_ENTERED"] = "TRIGGER_ENTERED"; + PhysicsEventType2["TRIGGER_EXITED"] = "TRIGGER_EXITED"; + })(PhysicsEventType || (PhysicsEventType = {})); + (function(PhysicsMotionType2) { + PhysicsMotionType2[PhysicsMotionType2["STATIC"] = 0] = "STATIC"; + PhysicsMotionType2[PhysicsMotionType2["ANIMATED"] = 1] = "ANIMATED"; + PhysicsMotionType2[PhysicsMotionType2["DYNAMIC"] = 2] = "DYNAMIC"; + })(PhysicsMotionType || (PhysicsMotionType = {})); +}); + +// node_modules/@babylonjs/core/Physics/v2/physicsShape.js +class PhysicsShape { + constructor(options, scene23) { + var _a; + this._pluginData = undefined; + this._isTrigger = false; + this._isDisposed = false; + if (!scene23) { + return; + } + const physicsEngine3 = scene23.getPhysicsEngine(); + if (!physicsEngine3) { + throw new Error("No Physics Engine available."); + } + if (physicsEngine3.getPluginVersion() != 2) { + throw new Error("Plugin version is incorrect. Expected version 2."); + } + const physicsPlugin = physicsEngine3.getPhysicsPlugin(); + if (!physicsPlugin) { + throw new Error("No Physics Plugin available."); + } + this._physicsPlugin = physicsPlugin; + if (options.pluginData !== undefined && options.pluginData !== null) { + this._pluginData = options.pluginData; + this._type = this._physicsPlugin.getShapeType(this); + } else if (options.type !== undefined && options.type !== null) { + this._type = options.type; + const parameters = (_a = options.parameters) !== null && _a !== undefined ? _a : {}; + this._physicsPlugin.initShape(this, options.type, parameters); + } + } + getClassName() { + return "PhysicsShape"; + } + get type() { + return this._type; + } + set filterMembershipMask(membershipMask) { + this._physicsPlugin.setShapeFilterMembershipMask(this, membershipMask); + } + get filterMembershipMask() { + return this._physicsPlugin.getShapeFilterMembershipMask(this); + } + set filterCollideMask(collideMask) { + this._physicsPlugin.setShapeFilterCollideMask(this, collideMask); + } + get filterCollideMask() { + return this._physicsPlugin.getShapeFilterCollideMask(this); + } + set material(material20) { + this._physicsPlugin.setMaterial(this, material20); + this._material = material20; + } + get material() { + return this._material; + } + set density(density) { + this._physicsPlugin.setDensity(this, density); + } + get density() { + return this._physicsPlugin.getDensity(this); + } + addChildFromParent(parentTransform, newChild, childTransform) { + const childToWorld = childTransform.computeWorldMatrix(true); + const parentToWorld = parentTransform.computeWorldMatrix(true); + const childToParent = TmpVectors.Matrix[0]; + childToWorld.multiplyToRef(Matrix.Invert(parentToWorld), childToParent); + const translation = TmpVectors.Vector3[0]; + const rotation = TmpVectors.Quaternion[0]; + const scale = TmpVectors.Vector3[1]; + childToParent.decompose(scale, rotation, translation); + this._physicsPlugin.addChild(this, newChild, translation, rotation, scale); + } + addChild(newChild, translation, rotation, scale) { + this._physicsPlugin.addChild(this, newChild, translation, rotation, scale); + } + removeChild(childIndex) { + this._physicsPlugin.removeChild(this, childIndex); + } + getNumChildren() { + return this._physicsPlugin.getNumChildren(this); + } + getBoundingBox() { + return this._physicsPlugin.getBoundingBox(this); + } + set isTrigger(isTrigger) { + if (this._isTrigger === isTrigger) { + return; + } + this._isTrigger = isTrigger; + this._physicsPlugin.setTrigger(this, isTrigger); + } + get isTrigger() { + return this._isTrigger; + } + dispose() { + if (this._isDisposed) { + return; + } + this._physicsPlugin.disposeShape(this); + this._isDisposed = true; + } +} + +class PhysicsShapeSphere extends PhysicsShape { + constructor(center, radius, scene23) { + super({ type: PhysicsShapeType.SPHERE, parameters: { center, radius } }, scene23); + } + static FromMesh(mesh62) { + const bounds = mesh62.getBoundingInfo(); + const centerLocal = bounds.boundingSphere.center; + const he = bounds.boundingBox.extendSize; + const radius = Math.max(he.x, he.y, he.z); + return new PhysicsShapeSphere(centerLocal, radius, mesh62.getScene()); + } +} + +class PhysicsShapeCapsule extends PhysicsShape { + constructor(pointA, pointB, radius, scene23) { + super({ type: PhysicsShapeType.CAPSULE, parameters: { pointA, pointB, radius } }, scene23); + } + static FromMesh(mesh62) { + const boundsLocal = mesh62.getBoundingInfo(); + const radius = boundsLocal.boundingBox.extendSize.x; + const pointFromCenter = new Vector3(0, boundsLocal.boundingBox.extendSize.y - radius, 0); + const pointA = boundsLocal.boundingBox.center.add(pointFromCenter); + const pointB = boundsLocal.boundingBox.center.subtract(pointFromCenter); + return new PhysicsShapeCapsule(pointA, pointB, radius, mesh62.getScene()); + } +} + +class PhysicsShapeCylinder extends PhysicsShape { + constructor(pointA, pointB, radius, scene23) { + super({ type: PhysicsShapeType.CYLINDER, parameters: { pointA, pointB, radius } }, scene23); + } + static FromMesh(mesh62) { + const boundsLocal = mesh62.getBoundingInfo(); + const radius = boundsLocal.boundingBox.extendSize.x; + const pointFromCenter = new Vector3(0, boundsLocal.boundingBox.extendSize.y, 0); + const pointA = boundsLocal.boundingBox.center.add(pointFromCenter); + const pointB = boundsLocal.boundingBox.center.subtract(pointFromCenter); + return new PhysicsShapeCylinder(pointA, pointB, radius, mesh62.getScene()); + } +} + +class PhysicsShapeBox extends PhysicsShape { + constructor(center, rotation, extents, scene23) { + super({ type: PhysicsShapeType.BOX, parameters: { center, rotation, extents } }, scene23); + } + static FromMesh(mesh62) { + const bounds = mesh62.getBoundingInfo(); + const centerLocal = bounds.boundingBox.center; + const extents = bounds.boundingBox.extendSize.scale(2); + return new PhysicsShapeBox(centerLocal, Quaternion.Identity(), extents, mesh62.getScene()); + } +} + +class PhysicsShapeConvexHull extends PhysicsShape { + constructor(mesh62, scene23) { + super({ type: PhysicsShapeType.CONVEX_HULL, parameters: { mesh: mesh62 } }, scene23); + } +} + +class PhysicsShapeMesh extends PhysicsShape { + constructor(mesh62, scene23) { + super({ type: PhysicsShapeType.MESH, parameters: { mesh: mesh62 } }, scene23); + } +} + +class PhysicsShapeContainer extends PhysicsShape { + constructor(scene23) { + super({ type: PhysicsShapeType.CONTAINER, parameters: {} }, scene23); + } +} +var init_physicsShape = __esm(() => { + init_IPhysicsEnginePlugin2(); + init_math_vector(); +}); + +// node_modules/@babylonjs/core/Physics/v2/physicsConstraint.js +class PhysicsConstraint { + constructor(type, options, scene23) { + this._pluginData = undefined; + if (!scene23) { + throw new Error("Missing scene parameter for constraint constructor."); + } + const physicsEngine3 = scene23.getPhysicsEngine(); + if (!physicsEngine3) { + throw new Error("No Physics Engine available."); + } + if (physicsEngine3.getPluginVersion() != 2) { + throw new Error("Plugin version is incorrect. Expected version 2."); + } + const physicsPlugin = physicsEngine3.getPhysicsPlugin(); + if (!physicsPlugin) { + throw new Error("No Physics Plugin available."); + } + this._physicsPlugin = physicsPlugin; + this._options = options; + this._type = type; + } + get type() { + return this._type; + } + get options() { + return this._options; + } + set isEnabled(isEnabled) { + this._physicsPlugin.setEnabled(this, isEnabled); + } + get isEnabled() { + return this._physicsPlugin.getEnabled(this); + } + set isCollisionsEnabled(isEnabled) { + this._physicsPlugin.setCollisionsEnabled(this, isEnabled); + } + get isCollisionsEnabled() { + return this._physicsPlugin.getCollisionsEnabled(this); + } + getBodiesUsingConstraint() { + return this._physicsPlugin.getBodiesUsingConstraint(this); + } + dispose() { + this._physicsPlugin.disposeConstraint(this); + } +} + +class Physics6DoFLimit { +} + +class Physics6DoFConstraint extends PhysicsConstraint { + constructor(constraintParams, limits, scene23) { + super(PhysicsConstraintType.SIX_DOF, constraintParams, scene23); + this.limits = limits; + } + setAxisFriction(axis, friction) { + this._physicsPlugin.setAxisFriction(this, axis, friction); + } + getAxisFriction(axis) { + return this._physicsPlugin.getAxisFriction(this, axis); + } + setAxisMode(axis, limitMode) { + this._physicsPlugin.setAxisMode(this, axis, limitMode); + } + getAxisMode(axis) { + return this._physicsPlugin.getAxisMode(this, axis); + } + setAxisMinLimit(axis, minLimit) { + this._physicsPlugin.setAxisMinLimit(this, axis, minLimit); + } + getAxisMinLimit(axis) { + return this._physicsPlugin.getAxisMinLimit(this, axis); + } + setAxisMaxLimit(axis, limit) { + this._physicsPlugin.setAxisMaxLimit(this, axis, limit); + } + getAxisMaxLimit(axis) { + return this._physicsPlugin.getAxisMaxLimit(this, axis); + } + setAxisMotorType(axis, motorType) { + this._physicsPlugin.setAxisMotorType(this, axis, motorType); + } + getAxisMotorType(axis) { + return this._physicsPlugin.getAxisMotorType(this, axis); + } + setAxisMotorTarget(axis, target) { + this._physicsPlugin.setAxisMotorTarget(this, axis, target); + } + getAxisMotorTarget(axis) { + return this._physicsPlugin.getAxisMotorTarget(this, axis); + } + setAxisMotorMaxForce(axis, maxForce) { + this._physicsPlugin.setAxisMotorMaxForce(this, axis, maxForce); + } + getAxisMotorMaxForce(axis) { + return this._physicsPlugin.getAxisMotorMaxForce(this, axis); + } +} + +class BallAndSocketConstraint extends PhysicsConstraint { + constructor(pivotA, pivotB, axisA, axisB, scene23) { + super(PhysicsConstraintType.BALL_AND_SOCKET, { pivotA, pivotB, axisA, axisB }, scene23); + } +} + +class DistanceConstraint extends PhysicsConstraint { + constructor(maxDistance, scene23) { + super(PhysicsConstraintType.DISTANCE, { maxDistance }, scene23); + } +} + +class HingeConstraint extends PhysicsConstraint { + constructor(pivotA, pivotB, axisA, axisB, scene23) { + super(PhysicsConstraintType.HINGE, { pivotA, pivotB, axisA, axisB }, scene23); + } +} + +class SliderConstraint extends PhysicsConstraint { + constructor(pivotA, pivotB, axisA, axisB, scene23) { + super(PhysicsConstraintType.SLIDER, { pivotA, pivotB, axisA, axisB }, scene23); + } +} + +class LockConstraint extends PhysicsConstraint { + constructor(pivotA, pivotB, axisA, axisB, scene23) { + super(PhysicsConstraintType.LOCK, { pivotA, pivotB, axisA, axisB }, scene23); + } +} + +class PrismaticConstraint extends PhysicsConstraint { + constructor(pivotA, pivotB, axisA, axisB, scene23) { + super(PhysicsConstraintType.PRISMATIC, { pivotA, pivotB, axisA, axisB }, scene23); + } +} + +class SpringConstraint extends Physics6DoFConstraint { + constructor(pivotA, pivotB, axisA, axisB, minDistance, maxDistance, stiffness, damping, scene23) { + super({ pivotA, pivotB, axisA, axisB }, [{ axis: PhysicsConstraintAxis.LINEAR_DISTANCE, minLimit: minDistance, maxLimit: maxDistance, stiffness, damping }], scene23); + } +} +var init_physicsConstraint = __esm(() => { + init_IPhysicsEnginePlugin2(); +}); + // node_modules/@babylonjs/core/Physics/v2/physicsMaterial.js var PhysicsMaterialCombineMode; -(function(PhysicsMaterialCombineMode2) { - PhysicsMaterialCombineMode2[PhysicsMaterialCombineMode2["GEOMETRIC_MEAN"] = 0] = "GEOMETRIC_MEAN"; - PhysicsMaterialCombineMode2[PhysicsMaterialCombineMode2["MINIMUM"] = 1] = "MINIMUM"; - PhysicsMaterialCombineMode2[PhysicsMaterialCombineMode2["MAXIMUM"] = 2] = "MAXIMUM"; - PhysicsMaterialCombineMode2[PhysicsMaterialCombineMode2["ARITHMETIC_MEAN"] = 3] = "ARITHMETIC_MEAN"; - PhysicsMaterialCombineMode2[PhysicsMaterialCombineMode2["MULTIPLY"] = 4] = "MULTIPLY"; -})(PhysicsMaterialCombineMode || (PhysicsMaterialCombineMode = {})); -// node_modules/@babylonjs/core/Physics/joinedPhysicsEngineComponent.js -Scene.prototype.getPhysicsEngine = function() { - return this._physicsEngine; -}; -Scene.prototype.enablePhysics = function(gravity = null, plugin) { - if (this._physicsEngine) { +var init_physicsMaterial = __esm(() => { + (function(PhysicsMaterialCombineMode2) { + PhysicsMaterialCombineMode2[PhysicsMaterialCombineMode2["GEOMETRIC_MEAN"] = 0] = "GEOMETRIC_MEAN"; + PhysicsMaterialCombineMode2[PhysicsMaterialCombineMode2["MINIMUM"] = 1] = "MINIMUM"; + PhysicsMaterialCombineMode2[PhysicsMaterialCombineMode2["MAXIMUM"] = 2] = "MAXIMUM"; + PhysicsMaterialCombineMode2[PhysicsMaterialCombineMode2["ARITHMETIC_MEAN"] = 3] = "ARITHMETIC_MEAN"; + PhysicsMaterialCombineMode2[PhysicsMaterialCombineMode2["MULTIPLY"] = 4] = "MULTIPLY"; + })(PhysicsMaterialCombineMode || (PhysicsMaterialCombineMode = {})); +}); + +// node_modules/@babylonjs/core/Physics/v2/physicsAggregate.js +class PhysicsAggregate { + constructor(transformNode17, type, _options = { mass: 0 }, _scene) { + var _a; + this.transformNode = transformNode17; + this.type = type; + this._options = _options; + this._scene = _scene; + this._disposeShapeWhenDisposed = true; + if (!this.transformNode) { + Logger.Error("No object was provided. A physics object is obligatory"); + return; + } + const m = transformNode17; + if (this.transformNode.parent && this._options.mass !== 0 && m.hasThinInstances) { + Logger.Warn("A physics body has been created for an object which has a parent and thin instances. Babylon physics currently works in local space so unexpected issues may occur."); + } + if (!this._scene && transformNode17.getScene) { + this._scene = transformNode17.getScene(); + } + if (!this._scene) { + return; + } + this._options.mass = _options.mass === undefined ? 0 : _options.mass; + this._options.friction = _options.friction === undefined ? 0.2 : _options.friction; + this._options.restitution = _options.restitution === undefined ? 0.2 : _options.restitution; + const motionType = this._options.mass === 0 ? PhysicsMotionType.STATIC : PhysicsMotionType.DYNAMIC; + const startAsleep = (_a = this._options.startAsleep) !== null && _a !== undefined ? _a : false; + this.body = new PhysicsBody(transformNode17, motionType, startAsleep, this._scene); + this._addSizeOptions(); + if (type.getClassName && type.getClassName() === "PhysicsShape") { + this.shape = type; + this._disposeShapeWhenDisposed = false; + } else { + this.shape = new PhysicsShape({ type, parameters: this._options }, this._scene); + } + if (this._options.isTriggerShape) { + this.shape.isTrigger = true; + } + this.material = { friction: this._options.friction, restitution: this._options.restitution }; + this.body.shape = this.shape; + this.shape.material = this.material; + this.body.setMassProperties({ mass: this._options.mass }); + this._nodeDisposeObserver = this.transformNode.onDisposeObservable.add(() => { + this.dispose(); + }); + } + _getObjectBoundingBox() { + if (this.transformNode.getRawBoundingInfo) { + return this.transformNode.getRawBoundingInfo().boundingBox; + } else { + return new BoundingBox(new Vector3(-0.5, -0.5, -0.5), new Vector3(0.5, 0.5, 0.5)); + } + } + _hasVertices(node29) { + return (node29 === null || node29 === undefined ? undefined : node29.getTotalVertices()) > 0; + } + _addSizeOptions() { + var _a, _b, _c, _d, _e, _f, _g, _h; + this.transformNode.computeWorldMatrix(true); + const bb = this._getObjectBoundingBox(); + const extents = TmpVectors.Vector3[0]; + extents.copyFrom(bb.extendSize); + extents.scaleInPlace(2); + extents.multiplyInPlace(this.transformNode.scaling); + extents.x = Math.abs(extents.x); + extents.y = Math.abs(extents.y); + extents.z = Math.abs(extents.z); + const min = TmpVectors.Vector3[1]; + min.copyFrom(bb.minimum); + min.multiplyInPlace(this.transformNode.scaling); + if (!this._options.center) { + const center = new Vector3; + center.copyFrom(bb.center); + center.multiplyInPlace(this.transformNode.scaling); + this._options.center = center; + } + switch (this.type) { + case PhysicsShapeType.SPHERE: + if (!this._options.radius && Scalar.WithinEpsilon(extents.x, extents.y, 0.0001) && Scalar.WithinEpsilon(extents.x, extents.z, 0.0001)) { + this._options.radius = extents.x / 2; + } else if (!this._options.radius) { + Logger.Warn("Non uniform scaling is unsupported for sphere shapes. Setting the radius to the biggest bounding box extent."); + this._options.radius = Math.max(extents.x, extents.y, extents.z) / 2; + } + break; + case PhysicsShapeType.CAPSULE: + { + const capRadius = extents.x / 2; + this._options.radius = (_a = this._options.radius) !== null && _a !== undefined ? _a : capRadius; + this._options.pointA = (_b = this._options.pointA) !== null && _b !== undefined ? _b : new Vector3(0, min.y + capRadius, 0); + this._options.pointB = (_c = this._options.pointB) !== null && _c !== undefined ? _c : new Vector3(0, min.y + extents.y - capRadius, 0); + } + break; + case PhysicsShapeType.CYLINDER: + { + const capRadius = extents.x / 2; + this._options.radius = (_d = this._options.radius) !== null && _d !== undefined ? _d : capRadius; + this._options.pointA = (_e = this._options.pointA) !== null && _e !== undefined ? _e : new Vector3(0, min.y, 0); + this._options.pointB = (_f = this._options.pointB) !== null && _f !== undefined ? _f : new Vector3(0, min.y + extents.y, 0); + } + break; + case PhysicsShapeType.MESH: + case PhysicsShapeType.CONVEX_HULL: + if (!this._options.mesh && this._hasVertices(this.transformNode)) { + this._options.mesh = this.transformNode; + } else if (!this._options.mesh || !this._hasVertices(this._options.mesh)) { + throw new Error("No valid mesh was provided for mesh or convex hull shape parameter. Please provide a mesh with valid geometry (number of vertices greater than 0)."); + } + break; + case PhysicsShapeType.BOX: + this._options.extents = (_g = this._options.extents) !== null && _g !== undefined ? _g : new Vector3(extents.x, extents.y, extents.z); + this._options.rotation = (_h = this._options.rotation) !== null && _h !== undefined ? _h : Quaternion.Identity(); + break; + } + } + dispose() { + if (this._nodeDisposeObserver) { + this.body.transformNode.onDisposeObservable.remove(this._nodeDisposeObserver); + this._nodeDisposeObserver = null; + } + this.body.dispose(); + if (this._disposeShapeWhenDisposed) { + this.shape.dispose(); + } + } +} +var init_physicsAggregate = __esm(() => { + init_physicsBody(); + init_physicsShape(); + init_logger(); + init_math_vector(); + init_math_scalar(); + init_IPhysicsEnginePlugin2(); + init_boundingBox(); +}); + +// node_modules/@babylonjs/core/Physics/v2/ragdoll.js +class RagdollBoneProperties { +} + +class Ragdoll { + constructor(skeleton3, mesh62, config) { + this.boxVisibility = 0.6; + this._boxConfigs = new Array; + this._bones = new Array; + this._initialRotation = new Array; + this._boneNames = []; + this._boxes = new Array; + this._aggregates = new Array; + this._ragdollMode = false; + this._rootBoneName = ""; + this._rootBoneIndex = -1; + this._mass = 10; + this._restitution = 0; + this._pauseSync = false; + this._defaultJoint = PhysicsConstraintType.HINGE; + this._defaultJointMin = -90; + this._defaultJointMax = 90; + this._skeleton = skeleton3; + this._scene = skeleton3.getScene(); + this._mesh = mesh62; + this._config = config; + this._boxConfigs = []; + this._putBoxesInBoneCenter = false; + this._defaultJoint = PhysicsConstraintType.HINGE; + this._boneOffsetAxis = Axis.Y; + } + set boxesVisibility(visible) { + for (const box of this._boxes) { + box.visibility = visible ? this.boxVisibility : 0; + } + } + _createColliders() { + this._mesh.computeWorldMatrix(); + const config = this._config; + for (let i = 0;i < config.length; i++) { + const boneNames = config[i].bone !== undefined ? [config[i].bone] : config[i].bones; + for (let ii = 0;ii < boneNames.length; ii++) { + const currentBone = this._skeleton.bones[this._skeleton.getBoneIndexByName(boneNames[ii])]; + if (currentBone == undefined) { + return; + } + const currentRagdollBoneProperties = { + width: this._config[i].width, + depth: this._config[i].depth, + height: this._config[i].height, + size: this._config[i].size + }; + const box = MeshBuilder.CreateBox(boneNames[ii] + "_box", currentRagdollBoneProperties, this._scene); + box.visibility = 0; + currentRagdollBoneProperties.joint = config[i].joint !== undefined ? config[i].joint : this._defaultJoint; + currentRagdollBoneProperties.rotationAxis = config[i].rotationAxis !== undefined ? config[i].rotationAxis : Axis.X; + currentRagdollBoneProperties.min = config[i].min !== undefined ? config[i].min : this._defaultJointMin; + currentRagdollBoneProperties.max = config[i].max !== undefined ? config[i].max : this._defaultJointMax; + let boxOffset = 0; + if (config[i].putBoxInBoneCenter !== undefined && config[i].putBoxInBoneCenter || this._putBoxesInBoneCenter) { + if (currentBone.length === undefined) { + Logger.Log("The length property is not defined for bone " + currentBone.name); + } + boxOffset = currentBone.length / 2; + } else if (config[i].boxOffset !== undefined) { + boxOffset = config[i].boxOffset; + } + currentRagdollBoneProperties.boxOffset = boxOffset; + const boneOffsetAxis = config[i].boneOffsetAxis !== undefined ? config[i].boneOffsetAxis : this._boneOffsetAxis; + const boneDir = currentBone.getDirection(boneOffsetAxis, this._mesh); + currentRagdollBoneProperties.boneOffsetAxis = boneOffsetAxis; + box.position = currentBone.getAbsolutePosition(this._mesh).add(boneDir.scale(boxOffset)); + const mass = config[i].mass !== undefined ? config[i].mass : this._mass; + const restitution = config[i].restitution !== undefined ? config[i].restitution : this._restitution; + const aggregate = new PhysicsAggregate(box, PhysicsShapeType.BOX, { + mass, + restitution, + friction: 0.6 + }, this._scene); + aggregate.body.setCollisionCallbackEnabled(true); + aggregate.body.disablePreStep = false; + this._aggregates.push(aggregate); + this._bones.push(currentBone); + this._boneNames.push(currentBone.name); + this._boxes.push(box); + this._boxConfigs.push(currentRagdollBoneProperties); + this._initialRotation.push(currentBone.getRotationQuaternion(Space.WORLD, this._mesh)); + } + } + } + _initJoints() { + this._mesh.computeWorldMatrix(); + for (let i = 0;i < this._bones.length; i++) { + if (i == this._rootBoneIndex) + continue; + const nearestParent = this._findNearestParent(i); + if (nearestParent == null) { + Logger.Warn("Couldn't find a nearest parent bone in the configs for bone called " + this._boneNames[i]); + return; + } + const boneParentIndex = this._boneNames.indexOf(nearestParent.name); + let distanceFromParentBoxToBone = this._bones[i].getAbsolutePosition(this._mesh).subtract(this._boxes[boneParentIndex].position); + const wmat = this._boxes[boneParentIndex].computeWorldMatrix(); + const invertedWorldMat = Matrix.Invert(wmat); + distanceFromParentBoxToBone = Vector3.TransformCoordinates(this._bones[i].getAbsolutePosition(this._mesh), invertedWorldMat); + const boneAbsPos = this._bones[i].getAbsolutePosition(this._mesh); + const boxAbsPos = this._boxes[i].position.clone(); + const myConnectedPivot = boneAbsPos.subtract(boxAbsPos); + const joint = new BallAndSocketConstraint(distanceFromParentBoxToBone, myConnectedPivot, this._boxConfigs[i].rotationAxis, this._boxConfigs[i].rotationAxis, this._scene); + this._aggregates[boneParentIndex].body.addConstraint(this._aggregates[i].body, joint); + } + } + _syncBonesAndBoxes() { + if (this._pauseSync) { + return; + } + if (this._ragdollMode) { + const rootBoneDirection = this._bones[this._rootBoneIndex].getDirection(this._boxConfigs[this._rootBoneIndex].boneOffsetAxis, this._mesh); + const rootBoneOffsetPosition = this._bones[this._rootBoneIndex].getAbsolutePosition(this._mesh).add(rootBoneDirection.scale(this._boxConfigs[this._rootBoneIndex].boxOffset)); + this._bones[this._rootBoneIndex].setAbsolutePosition(this._boxes[this._rootBoneIndex].position, this._mesh); + this._addImpostorRotationToBone(this._rootBoneIndex); + const rootPos = this._aggregates[this._rootBoneIndex].body.transformNode.position; + const dist = rootBoneOffsetPosition.subtract(rootPos); + this._mesh.position = this._mesh.position.subtract(dist); + for (let i = 0;i < this._bones.length; i++) { + if (i == this._rootBoneIndex) + continue; + this._addImpostorRotationToBone(i); + } + } + } + _addImpostorRotationToBone(boneIndex) { + var _a, _b, _c; + const newRotQuat = (_c = (_b = (_a = this._aggregates[boneIndex].body) === null || _a === undefined ? undefined : _a.transformNode) === null || _b === undefined ? undefined : _b.rotationQuaternion) === null || _c === undefined ? undefined : _c.multiply(this._initialRotation[boneIndex]); + if (newRotQuat) { + this._bones[boneIndex].setRotationQuaternion(newRotQuat, Space.WORLD, this._mesh); + } + } + _defineRootBone() { + const skeletonRoots = this._skeleton.getChildren(); + if (skeletonRoots.length != 1) { + Logger.Log("Ragdoll creation failed: there can only be one root in the skeleton."); + return false; + } + this._rootBoneName = skeletonRoots[0].name; + this._rootBoneIndex = this._boneNames.indexOf(this._rootBoneName); + if (this._rootBoneIndex == -1) { + Logger.Log("Ragdoll creation failed: the array boneNames doesn't have the root bone. The root bone is " + this._skeleton.getChildren()); + return false; + } return true; } - let component = this._getComponent(SceneComponentConstants.NAME_PHYSICSENGINE); - if (!component) { - component = new PhysicsEngineSceneComponent(this); - this._addComponent(component); + _findNearestParent(boneIndex) { + let nearestParent = this._bones[boneIndex].getParent(); + do { + if (nearestParent != null && this._boneNames.includes(nearestParent.name)) { + break; + } + nearestParent = nearestParent === null || nearestParent === undefined ? undefined : nearestParent.getParent(); + } while (nearestParent != null); + return nearestParent; } - try { - if (!plugin || (plugin === null || plugin === undefined ? undefined : plugin.getPluginVersion()) === 1) { - this._physicsEngine = new PhysicsEngine(gravity, plugin); - } else if ((plugin === null || plugin === undefined ? undefined : plugin.getPluginVersion()) === 2) { - this._physicsEngine = new PhysicsEngine2(gravity, plugin); + _init() { + this._createColliders(); + if (!this._defineRootBone()) { + return; + } + this._initJoints(); + this._scene.registerBeforeRender(() => { + this._syncBonesAndBoxes(); + }); + } + ragdoll() { + if (!this._ragdollMode) { + this._ragdollMode = true; + this._init(); + } + } + dispose() { + this._aggregates.forEach((aggregate) => { + aggregate.dispose(); + }); + } +} +var init_ragdoll = __esm(() => { + init_meshBuilder(); + init_math_vector(); + init_physicsAggregate(); + init_physicsConstraint(); + init_math_axis(); + init_IPhysicsEnginePlugin2(); + init_logger(); +}); + +// node_modules/@babylonjs/core/Physics/v2/Plugins/havokPlugin.js +class MeshAccumulator { + constructor(mesh63, collectIndices, scene23) { + this._vertices = []; + this._indices = []; + this._isRightHanded = scene23.useRightHandedSystem; + this._collectIndices = collectIndices; + } + addNodeMeshes(mesh63, includeChildren) { + mesh63.computeWorldMatrix(true); + const rootScaled = TmpVectors.Matrix[0]; + Matrix.ScalingToRef(mesh63.absoluteScaling.x, mesh63.absoluteScaling.y, mesh63.absoluteScaling.z, rootScaled); + if (mesh63 instanceof Mesh) { + this._addMesh(mesh63, rootScaled); + } else if (mesh63 instanceof InstancedMesh) { + this._addMesh(mesh63.sourceMesh, rootScaled); + } + if (includeChildren) { + const worldToRoot = TmpVectors.Matrix[1]; + mesh63.computeWorldMatrix().invertToRef(worldToRoot); + const worldToRootScaled = TmpVectors.Matrix[2]; + worldToRoot.multiplyToRef(rootScaled, worldToRootScaled); + const children = mesh63.getChildMeshes(false); + children.filter((m) => !m.physicsBody).forEach((m) => { + const childToWorld = m.computeWorldMatrix(); + const childToRootScaled = TmpVectors.Matrix[3]; + childToWorld.multiplyToRef(worldToRootScaled, childToRootScaled); + if (m instanceof Mesh) { + this._addMesh(m, childToRootScaled); + } else if (m instanceof InstancedMesh) { + this._addMesh(m.sourceMesh, childToRootScaled); + } + }); + } + } + _addMesh(mesh63, meshToRoot) { + const vertexData = mesh63.getVerticesData(VertexBuffer.PositionKind) || []; + const numVerts = vertexData.length / 3; + const indexOffset = this._vertices.length; + for (let v = 0;v < numVerts; v++) { + const pos = new Vector3(vertexData[v * 3 + 0], vertexData[v * 3 + 1], vertexData[v * 3 + 2]); + this._vertices.push(Vector3.TransformCoordinates(pos, meshToRoot)); + } + if (this._collectIndices) { + const meshIndices = mesh63.getIndices(); + if (meshIndices) { + for (let i = 0;i < meshIndices.length; i += 3) { + if (this._isRightHanded) { + this._indices.push(meshIndices[i + 0] + indexOffset); + this._indices.push(meshIndices[i + 1] + indexOffset); + this._indices.push(meshIndices[i + 2] + indexOffset); + } else { + this._indices.push(meshIndices[i + 2] + indexOffset); + this._indices.push(meshIndices[i + 1] + indexOffset); + this._indices.push(meshIndices[i + 0] + indexOffset); + } + } + } + } + } + getVertices(plugin) { + const nFloats = this._vertices.length * 3; + const bytesPerFloat = 4; + const nBytes = nFloats * bytesPerFloat; + const bufferBegin = plugin._malloc(nBytes); + const ret = new Float32Array(plugin.HEAPU8.buffer, bufferBegin, nFloats); + for (let i = 0;i < this._vertices.length; i++) { + ret[i * 3 + 0] = this._vertices[i].x; + ret[i * 3 + 1] = this._vertices[i].y; + ret[i * 3 + 2] = this._vertices[i].z; + } + return { offset: bufferBegin, numObjects: nFloats }; + } + freeBuffer(plugin, arr) { + plugin._free(arr.offset); + } + getTriangles(plugin) { + const bytesPerInt = 4; + const nBytes = this._indices.length * bytesPerInt; + const bufferBegin = plugin._malloc(nBytes); + const ret = new Int32Array(plugin.HEAPU8.buffer, bufferBegin, this._indices.length); + for (let i = 0;i < this._indices.length; i++) { + ret[i] = this._indices[i]; + } + return { offset: bufferBegin, numObjects: this._indices.length }; + } +} + +class BodyPluginData { + constructor(bodyId) { + this.hpBodyId = bodyId; + this.userMassProps = { centerOfMass: undefined, mass: undefined, inertia: undefined, inertiaOrientation: undefined }; + } +} + +class ContactPoint { + constructor() { + this.bodyId = BigInt(0); + this.position = new Vector3; + this.normal = new Vector3; + } +} + +class CollisionEvent { + constructor() { + this.contactOnA = new ContactPoint; + this.contactOnB = new ContactPoint; + this.impulseApplied = 0; + this.type = 0; + } + static readToRef(buffer61, offset, eventOut) { + const intBuf = new Int32Array(buffer61, offset); + const floatBuf = new Float32Array(buffer61, offset); + const offA = 2; + eventOut.contactOnA.bodyId = BigInt(intBuf[offA]); + eventOut.contactOnA.position.set(floatBuf[offA + 8], floatBuf[offA + 9], floatBuf[offA + 10]); + eventOut.contactOnA.normal.set(floatBuf[offA + 11], floatBuf[offA + 12], floatBuf[offA + 13]); + const offB = 18; + eventOut.contactOnB.bodyId = BigInt(intBuf[offB]); + eventOut.contactOnB.position.set(floatBuf[offB + 8], floatBuf[offB + 9], floatBuf[offB + 10]); + eventOut.contactOnB.normal.set(floatBuf[offB + 11], floatBuf[offB + 12], floatBuf[offB + 13]); + eventOut.impulseApplied = floatBuf[offB + 13 + 3]; + eventOut.type = intBuf[0]; + } +} + +class TriggerEvent { + constructor() { + this.bodyIdA = BigInt(0); + this.bodyIdB = BigInt(0); + this.type = 0; + } + static readToRef(buffer61, offset, eventOut) { + const intBuf = new Int32Array(buffer61, offset); + eventOut.type = intBuf[0]; + eventOut.bodyIdA = BigInt(intBuf[2]); + eventOut.bodyIdB = BigInt(intBuf[6]); + } +} + +class HavokPlugin { + constructor(_useDeltaForWorldStep = true, hpInjection = HK) { + this._useDeltaForWorldStep = _useDeltaForWorldStep; + this._hknp = {}; + this.name = "HavokPlugin"; + this._fixedTimeStep = 1 / 60; + this._timeStep = 1 / 60; + this._tmpVec3 = ArrayTools.BuildArray(3, Vector3.Zero); + this._bodies = new Map; + this._bodyCollisionObservable = new Map; + this._constraintToBodyIdPair = new Map; + this._bodyCollisionEndedObservable = new Map; + this.onCollisionObservable = new Observable; + this.onCollisionEndedObservable = new Observable; + this.onTriggerCollisionObservable = new Observable; + if (typeof hpInjection === "function") { + Logger.Error("Havok is not ready. Please make sure you await HK() before using the plugin."); + return; } else { - throw new Error("Unsupported Physics plugin version."); + this._hknp = hpInjection; } - this._physicsTimeAccumulator = 0; - return true; - } catch (e) { - Logger.Error(e.message); - return false; + if (!this.isSupported()) { + Logger.Error("Havok is not available. Please make sure you included the js file."); + return; + } + this.world = this._hknp.HP_World_Create()[1]; + this._queryCollector = this._hknp.HP_QueryCollector_Create(1)[1]; } -}; -Scene.prototype.disablePhysicsEngine = function() { - if (!this._physicsEngine) { - return; + isSupported() { + return this._hknp !== undefined; } - this._physicsEngine.dispose(); - this._physicsEngine = null; -}; -Scene.prototype.isPhysicsEnabled = function() { - return this._physicsEngine !== undefined; -}; -Scene.prototype.deleteCompoundImpostor = function(compound) { - const mesh63 = compound.parts[0].mesh; - if (mesh63.physicsImpostor) { - mesh63.physicsImpostor.dispose(); - mesh63.physicsImpostor = null; + setGravity(gravity) { + this._hknp.HP_World_SetGravity(this.world, this._bVecToV3(gravity)); } -}; -Scene.prototype._advancePhysicsEngineStep = function(step) { - if (this._physicsEngine) { - const subTime = this._physicsEngine.getSubTimeStep(); - if (subTime > 0) { - this._physicsTimeAccumulator += step; - while (this._physicsTimeAccumulator > subTime) { - this.onBeforePhysicsObservable.notifyObservers(this); - this._physicsEngine._step(subTime / 1000); - this.onAfterPhysicsObservable.notifyObservers(this); - this._physicsTimeAccumulator -= subTime; + setTimeStep(timeStep) { + this._fixedTimeStep = timeStep; + } + getTimeStep() { + return this._fixedTimeStep; + } + executeStep(delta, physicsBodies) { + for (const physicsBody2 of physicsBodies) { + if (physicsBody2.disablePreStep) { + continue; + } + this.setPhysicsBodyTransformation(physicsBody2, physicsBody2.transformNode); + } + this._hknp.HP_World_Step(this.world, this._useDeltaForWorldStep ? delta : this._timeStep); + this._bodyBuffer = this._hknp.HP_World_GetBodyBuffer(this.world)[1]; + for (const physicsBody2 of physicsBodies) { + this.sync(physicsBody2); + } + this._notifyCollisions(); + this._notifyTriggers(); + } + getPluginVersion() { + return 2; + } + initBody(body, motionType, position, orientation) { + body._pluginData = new BodyPluginData(this._hknp.HP_Body_Create()[1]); + this._internalSetMotionType(body._pluginData, motionType); + const transform = [this._bVecToV3(position), this._bQuatToV4(orientation)]; + this._hknp.HP_Body_SetQTransform(body._pluginData.hpBodyId, transform); + this._hknp.HP_World_AddBody(this.world, body._pluginData.hpBodyId, body.startAsleep); + this._bodies.set(body._pluginData.hpBodyId[0], { body, index: 0 }); + } + removeBody(body) { + if (body._pluginDataInstances && body._pluginDataInstances.length > 0) { + for (const instance of body._pluginDataInstances) { + this._bodyCollisionObservable.delete(instance.hpBodyId[0]); + this._hknp.HP_World_RemoveBody(this.world, instance.hpBodyId); + this._bodies.delete(instance.hpBodyId[0]); + } + } + if (body._pluginData) { + this._bodyCollisionObservable.delete(body._pluginData.hpBodyId[0]); + this._hknp.HP_World_RemoveBody(this.world, body._pluginData.hpBodyId); + this._bodies.delete(body._pluginData.hpBodyId[0]); + } + } + initBodyInstances(body, motionType, mesh63) { + var _a, _b; + const instancesCount = (_b = (_a = mesh63._thinInstanceDataStorage) === null || _a === undefined ? undefined : _a.instancesCount) !== null && _b !== undefined ? _b : 0; + const matrixData = mesh63._thinInstanceDataStorage.matrixData; + if (!matrixData) { + return; + } + this._createOrUpdateBodyInstances(body, motionType, matrixData, 0, instancesCount, false); + body._pluginDataInstances.forEach((bodyId, index) => { + this._bodies.set(bodyId.hpBodyId[0], { body, index }); + }); + } + _createOrUpdateBodyInstances(body, motionType, matrixData, startIndex, endIndex, update) { + const rotation = TmpVectors.Quaternion[0]; + const rotationMatrix = Matrix.Identity(); + for (let i = startIndex;i < endIndex; i++) { + const position = [matrixData[i * 16 + 12], matrixData[i * 16 + 13], matrixData[i * 16 + 14]]; + let hkbody; + if (!update) { + hkbody = this._hknp.HP_Body_Create()[1]; + } else { + hkbody = body._pluginDataInstances[i].hpBodyId; + } + rotationMatrix.setRowFromFloats(0, matrixData[i * 16 + 0], matrixData[i * 16 + 1], matrixData[i * 16 + 2], 0); + rotationMatrix.setRowFromFloats(1, matrixData[i * 16 + 4], matrixData[i * 16 + 5], matrixData[i * 16 + 6], 0); + rotationMatrix.setRowFromFloats(2, matrixData[i * 16 + 8], matrixData[i * 16 + 9], matrixData[i * 16 + 10], 0); + Quaternion.FromRotationMatrixToRef(rotationMatrix, rotation); + const transform = [position, [rotation.x, rotation.y, rotation.z, rotation.w]]; + this._hknp.HP_Body_SetQTransform(hkbody, transform); + if (!update) { + const pluginData = new BodyPluginData(hkbody); + if (body._pluginDataInstances.length) { + pluginData.userMassProps = body._pluginDataInstances[0].userMassProps; + } + this._internalSetMotionType(pluginData, motionType); + this._internalUpdateMassProperties(pluginData); + body._pluginDataInstances.push(pluginData); + this._hknp.HP_World_AddBody(this.world, hkbody, body.startAsleep); + pluginData.worldTransformOffset = this._hknp.HP_Body_GetWorldTransformOffset(hkbody)[1]; + } + } + } + updateBodyInstances(body, mesh63) { + var _a, _b; + const instancesCount = (_b = (_a = mesh63._thinInstanceDataStorage) === null || _a === undefined ? undefined : _a.instancesCount) !== null && _b !== undefined ? _b : 0; + const matrixData = mesh63._thinInstanceDataStorage.matrixData; + if (!matrixData) { + return; + } + const pluginInstancesCount = body._pluginDataInstances.length; + const motionType = this.getMotionType(body); + if (instancesCount > pluginInstancesCount) { + this._createOrUpdateBodyInstances(body, motionType, matrixData, pluginInstancesCount, instancesCount, false); + const firstBodyShape = this._hknp.HP_Body_GetShape(body._pluginDataInstances[0].hpBodyId)[1]; + for (let i = pluginInstancesCount;i < instancesCount; i++) { + this._hknp.HP_Body_SetShape(body._pluginDataInstances[i].hpBodyId, firstBodyShape); + this._internalUpdateMassProperties(body._pluginDataInstances[i]); + this._bodies.set(body._pluginDataInstances[i].hpBodyId[0], { body, index: i }); } + } else if (instancesCount < pluginInstancesCount) { + const instancesToRemove = pluginInstancesCount - instancesCount; + for (let i = 0;i < instancesToRemove; i++) { + const hkbody = body._pluginDataInstances.pop(); + this._bodies.delete(hkbody.hpBodyId[0]); + this._hknp.HP_World_RemoveBody(this.world, hkbody.hpBodyId); + this._hknp.HP_Body_Release(hkbody.hpBodyId); + } + this._createOrUpdateBodyInstances(body, motionType, matrixData, 0, instancesCount, true); + } + } + sync(body) { + this.syncTransform(body, body.transformNode); + } + syncTransform(body, transformNode17) { + var _a; + if (body._pluginDataInstances.length) { + const m = transformNode17; + const matrixData = m._thinInstanceDataStorage.matrixData; + if (!matrixData) { + return; + } + const instancesCount = body._pluginDataInstances.length; + for (let i = 0;i < instancesCount; i++) { + const bufOffset = body._pluginDataInstances[i].worldTransformOffset; + const transformBuffer = new Float32Array(this._hknp.HEAPU8.buffer, this._bodyBuffer + bufOffset, 16); + const index = i * 16; + for (let mi = 0;mi < 15; mi++) { + if ((mi & 3) != 3) { + matrixData[index + mi] = transformBuffer[mi]; + } + } + matrixData[index + 15] = 1; + } + m.thinInstanceBufferUpdated("matrix"); } else { - this.onBeforePhysicsObservable.notifyObservers(this); - this._physicsEngine._step(step / 1000); - this.onAfterPhysicsObservable.notifyObservers(this); + try { + const bodyTransform = this._hknp.HP_Body_GetQTransform(body._pluginData.hpBodyId)[1]; + const bodyTranslation = bodyTransform[0]; + const bodyOrientation = bodyTransform[1]; + const quat = TmpVectors.Quaternion[0]; + quat.set(bodyOrientation[0], bodyOrientation[1], bodyOrientation[2], bodyOrientation[3]); + const parent = transformNode17.parent; + if (parent && !parent.getWorldMatrix().isIdentity()) { + parent.computeWorldMatrix(true); + quat.normalize(); + const finalTransform = TmpVectors.Matrix[0]; + const finalTranslation = TmpVectors.Vector3[0]; + finalTranslation.copyFromFloats(bodyTranslation[0], bodyTranslation[1], bodyTranslation[2]); + Matrix.ComposeToRef(transformNode17.absoluteScaling, quat, finalTranslation, finalTransform); + const parentInverseTransform = TmpVectors.Matrix[1]; + parent.getWorldMatrix().invertToRef(parentInverseTransform); + const localTransform = TmpVectors.Matrix[2]; + finalTransform.multiplyToRef(parentInverseTransform, localTransform); + localTransform.decomposeToTransformNode(transformNode17); + (_a = transformNode17.rotationQuaternion) === null || _a === undefined || _a.normalize(); + } else { + transformNode17.position.set(bodyTranslation[0], bodyTranslation[1], bodyTranslation[2]); + if (transformNode17.rotationQuaternion) { + transformNode17.rotationQuaternion.copyFrom(quat); + } else { + quat.toEulerAnglesToRef(transformNode17.rotation); + } + } + } catch (e) { + console.log(`Syncing transform failed for node ${transformNode17.name}: ${e.message}...`); + } } } -}; + setShape(body, shape) { + var _a, _b, _c; + const shapeHandle = shape && shape._pluginData ? shape._pluginData : BigInt(0); + if (!(body.transformNode instanceof Mesh) || !((_a = body.transformNode._thinInstanceDataStorage) === null || _a === undefined ? undefined : _a.matrixData)) { + this._hknp.HP_Body_SetShape(body._pluginData.hpBodyId, shapeHandle); + this._internalUpdateMassProperties(body._pluginData); + return; + } + const m = body.transformNode; + const instancesCount = (_c = (_b = m._thinInstanceDataStorage) === null || _b === undefined ? undefined : _b.instancesCount) !== null && _c !== undefined ? _c : 0; + for (let i = 0;i < instancesCount; i++) { + this._hknp.HP_Body_SetShape(body._pluginDataInstances[i].hpBodyId, shapeHandle); + this._internalUpdateMassProperties(body._pluginDataInstances[i]); + } + } + _getPluginReference(body, instanceIndex) { + var _a; + return ((_a = body._pluginDataInstances) === null || _a === undefined ? undefined : _a.length) ? body._pluginDataInstances[instanceIndex !== null && instanceIndex !== undefined ? instanceIndex : 0] : body._pluginData; + } + getShape(body) { + const pluginRef = this._getPluginReference(body); + const shapePluginData = this._hknp.HP_Body_GetShape(pluginRef.hpBodyId)[1]; + if (shapePluginData != 0) { + const scene23 = body.transformNode.getScene(); + return new PhysicsShape({ pluginData: shapePluginData }, scene23); + } + return null; + } + getShapeType(shape) { + if (shape.type) { + return shape.type; + } else { + return this._hknp.HP_Shape_GetType(shape._pluginData); + } + } + setEventMask(body, eventMask, instanceIndex) { + this._applyToBodyOrInstances(body, (bodyPluginData) => { + this._hknp.HP_Body_SetEventMask(bodyPluginData.hpBodyId, eventMask); + }, instanceIndex); + } + getEventMask(body, instanceIndex) { + const pluginRef = this._getPluginReference(body, instanceIndex); + return this._hknp.HP_Body_GetEventMask(pluginRef.hpBodyId)[1]; + } + _fromMassPropertiesTuple(massPropsTuple) { + return { + centerOfMass: Vector3.FromArray(massPropsTuple[0]), + mass: massPropsTuple[1], + inertia: Vector3.FromArray(massPropsTuple[2]), + inertiaOrientation: Quaternion.FromArray(massPropsTuple[3]) + }; + } + _internalUpdateMassProperties(pluginData) { + const newProps = this._internalComputeMassProperties(pluginData); + const massProps = pluginData.userMassProps; + if (massProps.centerOfMass) { + newProps[0] = massProps.centerOfMass.asArray(); + } + if (massProps.mass != null) { + newProps[1] = massProps.mass; + } + if (massProps.inertia) { + newProps[2] = massProps.inertia.asArray(); + } + if (massProps.inertiaOrientation) { + newProps[3] = massProps.inertiaOrientation.asArray(); + } + this._hknp.HP_Body_SetMassProperties(pluginData.hpBodyId, newProps); + } + _internalSetMotionType(pluginData, motionType) { + switch (motionType) { + case PhysicsMotionType.STATIC: + this._hknp.HP_Body_SetMotionType(pluginData.hpBodyId, this._hknp.MotionType.STATIC); + break; + case PhysicsMotionType.ANIMATED: + this._hknp.HP_Body_SetMotionType(pluginData.hpBodyId, this._hknp.MotionType.KINEMATIC); + break; + case PhysicsMotionType.DYNAMIC: + this._hknp.HP_Body_SetMotionType(pluginData.hpBodyId, this._hknp.MotionType.DYNAMIC); + break; + } + } + setMotionType(body, motionType, instanceIndex) { + this._applyToBodyOrInstances(body, (pluginData) => { + this._internalSetMotionType(pluginData, motionType); + }, instanceIndex); + } + getMotionType(body, instanceIndex) { + const pluginRef = this._getPluginReference(body, instanceIndex); + const type = this._hknp.HP_Body_GetMotionType(pluginRef.hpBodyId)[1]; + switch (type) { + case this._hknp.MotionType.STATIC: + return PhysicsMotionType.STATIC; + case this._hknp.MotionType.KINEMATIC: + return PhysicsMotionType.ANIMATED; + case this._hknp.MotionType.DYNAMIC: + return PhysicsMotionType.DYNAMIC; + } + throw new Error("Unknown motion type: " + type); + } + _internalComputeMassProperties(pluginData) { + const shapeRes = this._hknp.HP_Body_GetShape(pluginData.hpBodyId); + if (shapeRes[0] == this._hknp.Result.RESULT_OK) { + const shapeMass = this._hknp.HP_Shape_BuildMassProperties(shapeRes[1]); + if (shapeMass[0] == this._hknp.Result.RESULT_OK) { + return shapeMass[1]; + } + } + return [[0, 0, 0], 1, [1, 1, 1], [0, 0, 0, 1]]; + } + computeMassProperties(body, instanceIndex) { + const pluginRef = this._getPluginReference(body, instanceIndex); + const computed = this._internalComputeMassProperties(pluginRef); + return this._fromMassPropertiesTuple(computed); + } + setMassProperties(body, massProps, instanceIndex) { + this._applyToBodyOrInstances(body, (pluginData) => { + pluginData.userMassProps = massProps; + this._internalUpdateMassProperties(pluginData); + }, instanceIndex); + } + getMassProperties(body, instanceIndex) { + const pluginRef = this._getPluginReference(body, instanceIndex); + const massPropsTuple = this._hknp.HP_Body_GetMassProperties(pluginRef.hpBodyId)[1]; + return this._fromMassPropertiesTuple(massPropsTuple); + } + setLinearDamping(body, damping, instanceIndex) { + this._applyToBodyOrInstances(body, (pluginData) => { + this._hknp.HP_Body_SetLinearDamping(pluginData.hpBodyId, damping); + }, instanceIndex); + } + getLinearDamping(body, instanceIndex) { + const pluginRef = this._getPluginReference(body, instanceIndex); + return this._hknp.HP_Body_GetLinearDamping(pluginRef.hpBodyId)[1]; + } + setAngularDamping(body, damping, instanceIndex) { + this._applyToBodyOrInstances(body, (pluginData) => { + this._hknp.HP_Body_SetAngularDamping(pluginData.hpBodyId, damping); + }, instanceIndex); + } + getAngularDamping(body, instanceIndex) { + const pluginRef = this._getPluginReference(body, instanceIndex); + return this._hknp.HP_Body_GetAngularDamping(pluginRef.hpBodyId)[1]; + } + setLinearVelocity(body, linVel, instanceIndex) { + this._applyToBodyOrInstances(body, (pluginData) => { + this._hknp.HP_Body_SetLinearVelocity(pluginData.hpBodyId, this._bVecToV3(linVel)); + }, instanceIndex); + } + getLinearVelocityToRef(body, linVel, instanceIndex) { + const pluginRef = this._getPluginReference(body, instanceIndex); + const lv = this._hknp.HP_Body_GetLinearVelocity(pluginRef.hpBodyId)[1]; + this._v3ToBvecRef(lv, linVel); + } + _applyToBodyOrInstances(body, fnToApply, instanceIndex) { + var _a; + if (((_a = body._pluginDataInstances) === null || _a === undefined ? undefined : _a.length) > 0 && instanceIndex === undefined) { + for (let i = 0;i < body._pluginDataInstances.length; i++) { + fnToApply(body._pluginDataInstances[i]); + } + } else { + fnToApply(this._getPluginReference(body, instanceIndex)); + } + } + applyImpulse(body, impulse, location2, instanceIndex) { + this._applyToBodyOrInstances(body, (pluginRef) => { + this._hknp.HP_Body_ApplyImpulse(pluginRef.hpBodyId, this._bVecToV3(location2), this._bVecToV3(impulse)); + }, instanceIndex); + } + applyForce(body, force, location2, instanceIndex) { + force.scaleToRef(this.getTimeStep(), this._tmpVec3[0]); + this.applyImpulse(body, this._tmpVec3[0], location2, instanceIndex); + } + setAngularVelocity(body, angVel, instanceIndex) { + this._applyToBodyOrInstances(body, (pluginRef) => { + this._hknp.HP_Body_SetAngularVelocity(pluginRef.hpBodyId, this._bVecToV3(angVel)); + }, instanceIndex); + } + getAngularVelocityToRef(body, angVel, instanceIndex) { + const pluginRef = this._getPluginReference(body, instanceIndex); + const av = this._hknp.HP_Body_GetAngularVelocity(pluginRef.hpBodyId)[1]; + this._v3ToBvecRef(av, angVel); + } + setPhysicsBodyTransformation(body, node29) { + const transformNode17 = body.transformNode; + if (body.numInstances > 0) { + const m = transformNode17; + const matrixData = m._thinInstanceDataStorage.matrixData; + if (!matrixData) { + return; + } + const instancesCount = body.numInstances; + this._createOrUpdateBodyInstances(body, body.getMotionType(), matrixData, 0, instancesCount, true); + } else { + this._hknp.HP_Body_SetQTransform(body._pluginData.hpBodyId, this._getTransformInfos(node29)); + } + } + setTargetTransform(body, position, rotation, instanceIndex) { + this._applyToBodyOrInstances(body, (pluginRef) => { + this._hknp.HP_Body_SetTargetQTransform(pluginRef.hpBodyId, [this._bVecToV3(position), this._bQuatToV4(rotation)]); + }, instanceIndex); + } + setGravityFactor(body, factor, instanceIndex) { + this._applyToBodyOrInstances(body, (pluginRef) => { + this._hknp.HP_Body_SetGravityFactor(pluginRef.hpBodyId, factor); + }, instanceIndex); + } + getGravityFactor(body, instanceIndex) { + const pluginRef = this._getPluginReference(body, instanceIndex); + return this._hknp.HP_Body_GetGravityFactor(pluginRef.hpBodyId)[1]; + } + disposeBody(body) { + if (body._pluginDataInstances && body._pluginDataInstances.length > 0) { + for (const instance of body._pluginDataInstances) { + this._hknp.HP_Body_Release(instance.hpBodyId); + instance.hpBodyId = undefined; + } + } + if (body._pluginData) { + this._hknp.HP_Body_Release(body._pluginData.hpBodyId); + body._pluginData.hpBodyId = undefined; + } + } + initShape(shape, type, options) { + switch (type) { + case PhysicsShapeType.SPHERE: + { + const radius = options.radius || 1; + const center = options.center ? this._bVecToV3(options.center) : [0, 0, 0]; + shape._pluginData = this._hknp.HP_Shape_CreateSphere(center, radius)[1]; + } + break; + case PhysicsShapeType.BOX: + { + const rotation = options.rotation ? this._bQuatToV4(options.rotation) : [0, 0, 0, 1]; + const extent = options.extents ? this._bVecToV3(options.extents) : [1, 1, 1]; + const center = options.center ? this._bVecToV3(options.center) : [0, 0, 0]; + shape._pluginData = this._hknp.HP_Shape_CreateBox(center, rotation, extent)[1]; + } + break; + case PhysicsShapeType.CAPSULE: + { + const pointA = options.pointA ? this._bVecToV3(options.pointA) : [0, 0, 0]; + const pointB = options.pointB ? this._bVecToV3(options.pointB) : [0, 1, 0]; + const radius = options.radius || 0; + shape._pluginData = this._hknp.HP_Shape_CreateCapsule(pointA, pointB, radius)[1]; + } + break; + case PhysicsShapeType.CONTAINER: + { + shape._pluginData = this._hknp.HP_Shape_CreateContainer()[1]; + } + break; + case PhysicsShapeType.CYLINDER: + { + const pointA = options.pointA ? this._bVecToV3(options.pointA) : [0, 0, 0]; + const pointB = options.pointB ? this._bVecToV3(options.pointB) : [0, 1, 0]; + const radius = options.radius || 0; + shape._pluginData = this._hknp.HP_Shape_CreateCylinder(pointA, pointB, radius)[1]; + } + break; + case PhysicsShapeType.CONVEX_HULL: + case PhysicsShapeType.MESH: + { + const mesh63 = options.mesh; + if (mesh63) { + const includeChildMeshes = !!options.includeChildMeshes; + const needIndices = type != PhysicsShapeType.CONVEX_HULL; + const accum = new MeshAccumulator(mesh63, needIndices, mesh63 === null || mesh63 === undefined ? undefined : mesh63.getScene()); + accum.addNodeMeshes(mesh63, includeChildMeshes); + const positions = accum.getVertices(this._hknp); + const numVec3s = positions.numObjects / 3; + if (type == PhysicsShapeType.CONVEX_HULL) { + shape._pluginData = this._hknp.HP_Shape_CreateConvexHull(positions.offset, numVec3s)[1]; + } else { + const triangles = accum.getTriangles(this._hknp); + const numTriangles = triangles.numObjects / 3; + shape._pluginData = this._hknp.HP_Shape_CreateMesh(positions.offset, numVec3s, triangles.offset, numTriangles)[1]; + accum.freeBuffer(this._hknp, triangles); + } + accum.freeBuffer(this._hknp, positions); + } else { + throw new Error("No mesh provided to create physics shape."); + } + } + break; + default: + throw new Error("Unsupported Shape Type."); + break; + } + } + setShapeFilterMembershipMask(shape, membershipMask) { + const collideWith = this._hknp.HP_Shape_GetFilterInfo(shape._pluginData)[1][1]; + this._hknp.HP_Shape_SetFilterInfo(shape._pluginData, [membershipMask, collideWith]); + } + getShapeFilterMembershipMask(shape) { + return this._hknp.HP_Shape_GetFilterInfo(shape._pluginData)[1][0]; + } + setShapeFilterCollideMask(shape, collideMask) { + const membership = this._hknp.HP_Shape_GetFilterInfo(shape._pluginData)[1][0]; + this._hknp.HP_Shape_SetFilterInfo(shape._pluginData, [membership, collideMask]); + } + getShapeFilterCollideMask(shape) { + return this._hknp.HP_Shape_GetFilterInfo(shape._pluginData)[1][1]; + } + setMaterial(shape, material20) { + var _a, _b, _c, _d, _e; + const dynamicFriction = (_a = material20.friction) !== null && _a !== undefined ? _a : 0.5; + const staticFriction = (_b = material20.staticFriction) !== null && _b !== undefined ? _b : dynamicFriction; + const restitution = (_c = material20.restitution) !== null && _c !== undefined ? _c : 0; + const frictionCombine = (_d = material20.frictionCombine) !== null && _d !== undefined ? _d : PhysicsMaterialCombineMode.MINIMUM; + const restitutionCombine = (_e = material20.restitutionCombine) !== null && _e !== undefined ? _e : PhysicsMaterialCombineMode.MAXIMUM; + const hpMaterial = [staticFriction, dynamicFriction, restitution, this._materialCombineToNative(frictionCombine), this._materialCombineToNative(restitutionCombine)]; + this._hknp.HP_Shape_SetMaterial(shape._pluginData, hpMaterial); + } + setDensity(shape, density) { + this._hknp.HP_Shape_SetDensity(shape._pluginData, density); + } + getDensity(shape) { + return this._hknp.HP_Shape_GetDensity(shape._pluginData)[1]; + } + _getTransformInfos(node29) { + if (node29.parent) { + node29.computeWorldMatrix(true); + return [this._bVecToV3(node29.absolutePosition), this._bQuatToV4(node29.absoluteRotationQuaternion)]; + } + let orientation = TmpVectors.Quaternion[0]; + if (node29.rotationQuaternion) { + orientation = node29.rotationQuaternion; + } else { + const r = node29.rotation; + Quaternion.FromEulerAnglesToRef(r.x, r.y, r.z, orientation); + } + const transform = [this._bVecToV3(node29.position), this._bQuatToV4(orientation)]; + return transform; + } + addChild(shape, newChild, translation, rotation, scale) { + const transformNative = [ + translation ? this._bVecToV3(translation) : [0, 0, 0], + rotation ? this._bQuatToV4(rotation) : [0, 0, 0, 1], + scale ? this._bVecToV3(scale) : [1, 1, 1] + ]; + this._hknp.HP_Shape_AddChild(shape._pluginData, newChild._pluginData, transformNative); + } + removeChild(shape, childIndex) { + this._hknp.HP_Shape_RemoveChild(shape._pluginData, childIndex); + } + getNumChildren(shape) { + return this._hknp.HP_Shape_GetNumChildren(shape._pluginData)[1]; + } + setTrigger(shape, isTrigger) { + this._hknp.HP_Shape_SetTrigger(shape._pluginData, isTrigger); + } + getBoundingBox(_shape) { + return {}; + } + getBodyGeometry(body) { + var _a; + const dataInfo = ((_a = body._pluginDataInstances) === null || _a === undefined ? undefined : _a.length) > 0 ? body._pluginDataInstances[0] : body._pluginData; + const shape = this._hknp.HP_Body_GetShape(dataInfo.hpBodyId)[1]; + const geometryRes = this._hknp.HP_Shape_CreateDebugDisplayGeometry(shape); + if (geometryRes[0] != this._hknp.Result.RESULT_OK) { + return { positions: [], indices: [] }; + } + const geometryInfo = this._hknp.HP_DebugGeometry_GetInfo(geometryRes[1])[1]; + const positionsInPlugin = new Float32Array(this._hknp.HEAPU8.buffer, geometryInfo[0], geometryInfo[1] * 3); + const indicesInPlugin = new Uint32Array(this._hknp.HEAPU8.buffer, geometryInfo[2], geometryInfo[3] * 3); + const positions = positionsInPlugin.slice(0); + const indices = indicesInPlugin.slice(0); + this._hknp.HP_DebugGeometry_Release(geometryRes[1]); + return { positions, indices }; + } + disposeShape(shape) { + this._hknp.HP_Shape_Release(shape._pluginData); + shape._pluginData = undefined; + } + initConstraint(constraint, body, childBody, instanceIndex, childInstanceIndex) { + var _a, _b, _c, _d, _e; + const type = constraint.type; + const options = constraint.options; + if (!type || !options) { + Logger.Warn("No constraint type or options. Constraint is invalid."); + return; + } + if (body._pluginDataInstances.length > 0 && instanceIndex === undefined || childBody._pluginDataInstances.length > 0 && childInstanceIndex === undefined) { + Logger.Warn("Body is instanced but no instance index was specified. Constraint will not be applied."); + return; + } + constraint._pluginData = (_a = constraint._pluginData) !== null && _a !== undefined ? _a : []; + const jointId = this._hknp.HP_Constraint_Create()[1]; + constraint._pluginData.push(jointId); + const bodyA = this._getPluginReference(body, instanceIndex).hpBodyId; + const bodyB = this._getPluginReference(childBody, childInstanceIndex).hpBodyId; + this._hknp.HP_Constraint_SetParentBody(jointId, bodyA); + this._hknp.HP_Constraint_SetChildBody(jointId, bodyB); + this._constraintToBodyIdPair.set(jointId[0], [bodyA[0], bodyB[0]]); + const pivotA = options.pivotA ? this._bVecToV3(options.pivotA) : this._bVecToV3(Vector3.Zero()); + const axisA = (_b = options.axisA) !== null && _b !== undefined ? _b : new Vector3(1, 0, 0); + const perpAxisA = this._tmpVec3[0]; + if (options.perpAxisA) { + perpAxisA.copyFrom(options.perpAxisA); + } else { + axisA.getNormalToRef(perpAxisA); + } + this._hknp.HP_Constraint_SetAnchorInParent(jointId, pivotA, this._bVecToV3(axisA), this._bVecToV3(perpAxisA)); + const pivotB = options.pivotB ? this._bVecToV3(options.pivotB) : this._bVecToV3(Vector3.Zero()); + const axisB = (_c = options.axisB) !== null && _c !== undefined ? _c : new Vector3(1, 0, 0); + const perpAxisB = this._tmpVec3[0]; + if (options.perpAxisB) { + perpAxisB.copyFrom(options.perpAxisB); + } else { + axisB.getNormalToRef(perpAxisB); + } + this._hknp.HP_Constraint_SetAnchorInChild(jointId, pivotB, this._bVecToV3(axisB), this._bVecToV3(perpAxisB)); + if (!constraint._initOptions) { + constraint._initOptions = { + axisA: axisA.clone(), + axisB: axisB.clone(), + perpAxisA: perpAxisA.clone(), + perpAxisB: perpAxisB.clone(), + pivotA: new Vector3(pivotA[0], pivotA[1], pivotA[2]), + pivotB: new Vector3(pivotB[0], pivotB[1], pivotB[2]) + }; + } + if (type == PhysicsConstraintType.LOCK) { + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_X, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_X, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED); + } else if (type == PhysicsConstraintType.DISTANCE) { + const distance = options.maxDistance || 0; + const dist3d = this._hknp.ConstraintAxis.LINEAR_DISTANCE; + this._hknp.HP_Constraint_SetAxisMode(jointId, dist3d, this._hknp.ConstraintAxisLimitMode.LIMITED); + this._hknp.HP_Constraint_SetAxisMinLimit(jointId, dist3d, distance); + this._hknp.HP_Constraint_SetAxisMaxLimit(jointId, dist3d, distance); + } else if (type == PhysicsConstraintType.HINGE) { + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_X, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED); + } else if (type == PhysicsConstraintType.PRISMATIC) { + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_X, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED); + } else if (type == PhysicsConstraintType.SLIDER) { + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.ANGULAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED); + } else if (type == PhysicsConstraintType.BALL_AND_SOCKET) { + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_X, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Y, this._hknp.ConstraintAxisLimitMode.LOCKED); + this._hknp.HP_Constraint_SetAxisMode(jointId, this._hknp.ConstraintAxis.LINEAR_Z, this._hknp.ConstraintAxisLimitMode.LOCKED); + } else if (type == PhysicsConstraintType.SIX_DOF) { + const sixdofData = constraint; + for (const l of sixdofData.limits) { + const axId = this._constraintAxisToNative(l.axis); + if (((_d = l.minLimit) !== null && _d !== undefined ? _d : -1) == 0 && ((_e = l.maxLimit) !== null && _e !== undefined ? _e : -1) == 0) { + this._hknp.HP_Constraint_SetAxisMode(jointId, axId, this._hknp.ConstraintAxisLimitMode.LOCKED); + } else { + if (l.minLimit != null) { + this._hknp.HP_Constraint_SetAxisMode(jointId, axId, this._hknp.ConstraintAxisLimitMode.LIMITED); + this._hknp.HP_Constraint_SetAxisMinLimit(jointId, axId, l.minLimit); + } + if (l.maxLimit != null) { + this._hknp.HP_Constraint_SetAxisMode(jointId, axId, this._hknp.ConstraintAxisLimitMode.LIMITED); + this._hknp.HP_Constraint_SetAxisMaxLimit(jointId, axId, l.maxLimit); + } + } + if (l.stiffness) { + this._hknp.HP_Constraint_SetAxisStiffness(jointId, axId, l.stiffness); + } + if (l.damping) { + this._hknp.HP_Constraint_SetAxisDamping(jointId, axId, l.damping); + } + } + } else { + throw new Error("Unsupported Constraint Type."); + } + const collisionEnabled = !!options.collision; + this._hknp.HP_Constraint_SetCollisionsEnabled(jointId, collisionEnabled); + this._hknp.HP_Constraint_SetEnabled(jointId, true); + } + getBodiesUsingConstraint(constraint) { + const pairs = []; + for (const jointId of constraint._pluginData) { + const bodyIds = this._constraintToBodyIdPair.get(jointId[0]); + if (bodyIds) { + const parentBodyInfo = this._bodies.get(bodyIds[0]); + const childBodyInfo = this._bodies.get(bodyIds[1]); + if (parentBodyInfo && childBodyInfo) { + pairs.push({ parentBody: parentBodyInfo.body, parentBodyIndex: parentBodyInfo.index, childBody: childBodyInfo.body, childBodyIndex: childBodyInfo.index }); + } + } + } + return pairs; + } + addConstraint(body, childBody, constraint, instanceIndex, childInstanceIndex) { + this.initConstraint(constraint, body, childBody, instanceIndex, childInstanceIndex); + } + setEnabled(constraint, isEnabled) { + for (const jointId of constraint._pluginData) { + this._hknp.HP_Constraint_SetEnabled(jointId, isEnabled); + } + } + getEnabled(constraint) { + const firstId = constraint._pluginData && constraint._pluginData[0]; + if (firstId) { + return this._hknp.HP_Constraint_GetEnabled(firstId)[1]; + } + return false; + } + setCollisionsEnabled(constraint, isEnabled) { + for (const jointId of constraint._pluginData) { + this._hknp.HP_Constraint_SetCollisionsEnabled(jointId, isEnabled); + } + } + getCollisionsEnabled(constraint) { + const firstId = constraint._pluginData && constraint._pluginData[0]; + if (firstId) { + return this._hknp.HP_Constraint_GetCollisionsEnabled(firstId)[1]; + } + return false; + } + setAxisFriction(constraint, axis, friction) { + for (const jointId of constraint._pluginData) { + this._hknp.HP_Constraint_SetAxisFriction(jointId, this._constraintAxisToNative(axis), friction); + } + } + getAxisFriction(constraint, axis) { + const firstId = constraint._pluginData && constraint._pluginData[0]; + if (firstId) { + return this._hknp.HP_Constraint_GetAxisFriction(firstId, this._constraintAxisToNative(axis))[1]; + } + return null; + } + setAxisMode(constraint, axis, limitMode) { + for (const jointId of constraint._pluginData) { + this._hknp.HP_Constraint_SetAxisMode(jointId, this._constraintAxisToNative(axis), this._limitModeToNative(limitMode)); + } + } + getAxisMode(constraint, axis) { + const firstId = constraint._pluginData && constraint._pluginData[0]; + if (firstId) { + const mode = this._hknp.HP_Constraint_GetAxisMode(firstId, this._constraintAxisToNative(axis))[1]; + return this._nativeToLimitMode(mode); + } + return null; + } + setAxisMinLimit(constraint, axis, limit) { + for (const jointId of constraint._pluginData) { + this._hknp.HP_Constraint_SetAxisMinLimit(jointId, this._constraintAxisToNative(axis), limit); + } + } + getAxisMinLimit(constraint, axis) { + const firstId = constraint._pluginData && constraint._pluginData[0]; + if (firstId) { + return this._hknp.HP_Constraint_GetAxisMinLimit(firstId, this._constraintAxisToNative(axis))[1]; + } + return null; + } + setAxisMaxLimit(constraint, axis, limit) { + for (const jointId of constraint._pluginData) { + this._hknp.HP_Constraint_SetAxisMaxLimit(jointId, this._constraintAxisToNative(axis), limit); + } + } + getAxisMaxLimit(constraint, axis) { + const firstId = constraint._pluginData && constraint._pluginData[0]; + if (firstId) { + return this._hknp.HP_Constraint_GetAxisMaxLimit(firstId, this._constraintAxisToNative(axis))[1]; + } + return null; + } + setAxisMotorType(constraint, axis, motorType) { + for (const jointId of constraint._pluginData) { + this._hknp.HP_Constraint_SetAxisMotorType(jointId, this._constraintAxisToNative(axis), this._constraintMotorTypeToNative(motorType)); + } + } + getAxisMotorType(constraint, axis) { + const firstId = constraint._pluginData && constraint._pluginData[0]; + if (firstId) { + return this._nativeToMotorType(this._hknp.HP_Constraint_GetAxisMotorType(firstId, this._constraintAxisToNative(axis))[1]); + } + return null; + } + setAxisMotorTarget(constraint, axis, target) { + for (const jointId of constraint._pluginData) { + this._hknp.HP_Constraint_SetAxisMotorTarget(jointId, this._constraintAxisToNative(axis), target); + } + } + getAxisMotorTarget(constraint, axis) { + const firstId = constraint._pluginData && constraint._pluginData[0]; + if (firstId) { + return this._hknp.HP_Constraint_GetAxisMotorTarget(constraint._pluginData, this._constraintAxisToNative(axis))[1]; + } + return null; + } + setAxisMotorMaxForce(constraint, axis, maxForce) { + for (const jointId of constraint._pluginData) { + this._hknp.HP_Constraint_SetAxisMotorMaxForce(jointId, this._constraintAxisToNative(axis), maxForce); + } + } + getAxisMotorMaxForce(constraint, axis) { + const firstId = constraint._pluginData && constraint._pluginData[0]; + if (firstId) { + return this._hknp.HP_Constraint_GetAxisMotorMaxForce(firstId, this._constraintAxisToNative(axis))[1]; + } + return null; + } + disposeConstraint(constraint) { + for (const jointId of constraint._pluginData) { + this._hknp.HP_Constraint_SetEnabled(jointId, false); + this._hknp.HP_Constraint_Release(jointId); + } + constraint._pluginData.length = 0; + } + raycast(from, to, result, query) { + var _a, _b; + const queryMembership = (_a = query === null || query === undefined ? undefined : query.membership) !== null && _a !== undefined ? _a : ~0; + const queryCollideWith = (_b = query === null || query === undefined ? undefined : query.collideWith) !== null && _b !== undefined ? _b : ~0; + result.reset(from, to); + const shouldHitTriggers = false; + const bodyToIgnore = [BigInt(0)]; + const hkQuery = [this._bVecToV3(from), this._bVecToV3(to), [queryMembership, queryCollideWith], shouldHitTriggers, bodyToIgnore]; + this._hknp.HP_World_CastRayWithCollector(this.world, this._queryCollector, hkQuery); + if (this._hknp.HP_QueryCollector_GetNumHits(this._queryCollector)[1] > 0) { + const hitData = this._hknp.HP_QueryCollector_GetCastRayResult(this._queryCollector, 0)[1]; + const hitPos = hitData[1][3]; + const hitNormal = hitData[1][4]; + const hitTriangle = hitData[1][5]; + result.setHitData({ x: hitNormal[0], y: hitNormal[1], z: hitNormal[2] }, { x: hitPos[0], y: hitPos[1], z: hitPos[2] }, hitTriangle); + result.calculateHitDistance(); + const hitBody = this._bodies.get(hitData[1][0][0]); + result.body = hitBody === null || hitBody === undefined ? undefined : hitBody.body; + result.bodyIndex = hitBody === null || hitBody === undefined ? undefined : hitBody.index; + } + } + getCollisionObservable(body) { + const bodyId = body._pluginData.hpBodyId[0]; + let observable98 = this._bodyCollisionObservable.get(bodyId); + if (!observable98) { + observable98 = new Observable; + this._bodyCollisionObservable.set(bodyId, observable98); + } + return observable98; + } + getCollisionEndedObservable(body) { + const bodyId = body._pluginData.hpBodyId[0]; + let observable98 = this._bodyCollisionEndedObservable.get(bodyId); + if (!observable98) { + observable98 = new Observable; + this._bodyCollisionEndedObservable.set(bodyId, observable98); + } + return observable98; + } + setCollisionCallbackEnabled(body, enabled) { + const collideEvents = this._hknp.EventType.COLLISION_STARTED.value | this._hknp.EventType.COLLISION_CONTINUED.value | this._hknp.EventType.COLLISION_FINISHED.value; + if (body._pluginDataInstances && body._pluginDataInstances.length) { + body._pluginDataInstances.forEach((bodyId) => { + this._hknp.HP_Body_SetEventMask(bodyId.hpBodyId, enabled ? collideEvents : 0); + }); + } else if (body._pluginData) { + this._hknp.HP_Body_SetEventMask(body._pluginData.hpBodyId, enabled ? collideEvents : 0); + } + } + setCollisionEndedCallbackEnabled(body, enabled) { + const pluginRef = this._getPluginReference(body); + let currentCollideEvents = this._hknp.HP_Body_GetEventMask(pluginRef.hpBodyId)[1]; + currentCollideEvents = enabled ? currentCollideEvents | this._hknp.EventType.COLLISION_FINISHED.value : currentCollideEvents & ~this._hknp.EventType.COLLISION_FINISHED.value; + if (body._pluginDataInstances && body._pluginDataInstances.length) { + body._pluginDataInstances.forEach((bodyId) => { + this._hknp.HP_Body_SetEventMask(bodyId.hpBodyId, currentCollideEvents); + }); + } else if (body._pluginData) { + this._hknp.HP_Body_SetEventMask(body._pluginData.hpBodyId, currentCollideEvents); + } + } + _notifyTriggers() { + let eventAddress = this._hknp.HP_World_GetTriggerEvents(this.world)[1]; + const event = new TriggerEvent; + while (eventAddress) { + TriggerEvent.readToRef(this._hknp.HEAPU8.buffer, eventAddress, event); + const bodyInfoA = this._bodies.get(event.bodyIdA); + const bodyInfoB = this._bodies.get(event.bodyIdB); + if (bodyInfoA && bodyInfoB) { + const triggerCollisionInfo = { + collider: bodyInfoA.body, + colliderIndex: bodyInfoA.index, + collidedAgainst: bodyInfoB.body, + collidedAgainstIndex: bodyInfoB.index, + type: this._nativeTriggerCollisionValueToCollisionType(event.type) + }; + this.onTriggerCollisionObservable.notifyObservers(triggerCollisionInfo); + } + eventAddress = this._hknp.HP_World_GetNextTriggerEvent(this.world, eventAddress); + } + } + _notifyCollisions() { + let eventAddress = this._hknp.HP_World_GetCollisionEvents(this.world)[1]; + const event = new CollisionEvent; + const worldAddr = Number(this.world); + while (eventAddress) { + CollisionEvent.readToRef(this._hknp.HEAPU8.buffer, eventAddress, event); + const bodyInfoA = this._bodies.get(event.contactOnA.bodyId); + const bodyInfoB = this._bodies.get(event.contactOnB.bodyId); + if (bodyInfoA && bodyInfoB) { + const collisionInfo = { + collider: bodyInfoA.body, + colliderIndex: bodyInfoA.index, + collidedAgainst: bodyInfoB.body, + collidedAgainstIndex: bodyInfoB.index, + type: this._nativeCollisionValueToCollisionType(event.type) + }; + if (collisionInfo.type === PhysicsEventType.COLLISION_FINISHED) { + this.onCollisionEndedObservable.notifyObservers(collisionInfo); + } else { + event.contactOnB.position.subtractToRef(event.contactOnA.position, this._tmpVec3[0]); + const distance = Vector3.Dot(this._tmpVec3[0], event.contactOnA.normal); + collisionInfo.point = event.contactOnA.position; + collisionInfo.distance = distance; + collisionInfo.impulse = event.impulseApplied; + collisionInfo.normal = event.contactOnA.normal; + this.onCollisionObservable.notifyObservers(collisionInfo); + } + if (this._bodyCollisionObservable.size && collisionInfo.type !== PhysicsEventType.COLLISION_FINISHED) { + const observableA = this._bodyCollisionObservable.get(event.contactOnA.bodyId); + const observableB = this._bodyCollisionObservable.get(event.contactOnB.bodyId); + if (observableA) { + observableA.notifyObservers(collisionInfo); + } else if (observableB) { + collisionInfo.collider = bodyInfoB.body; + collisionInfo.colliderIndex = bodyInfoB.index; + collisionInfo.collidedAgainst = bodyInfoA.body; + collisionInfo.collidedAgainstIndex = bodyInfoA.index; + collisionInfo.normal = event.contactOnB.normal; + observableB.notifyObservers(collisionInfo); + } + } else if (this._bodyCollisionEndedObservable.size) { + const observableA = this._bodyCollisionEndedObservable.get(event.contactOnA.bodyId); + const observableB = this._bodyCollisionEndedObservable.get(event.contactOnB.bodyId); + if (observableA) { + observableA.notifyObservers(collisionInfo); + } else if (observableB) { + collisionInfo.collider = bodyInfoB.body; + collisionInfo.colliderIndex = bodyInfoB.index; + collisionInfo.collidedAgainst = bodyInfoA.body; + collisionInfo.collidedAgainstIndex = bodyInfoA.index; + collisionInfo.normal = event.contactOnB.normal; + observableB.notifyObservers(collisionInfo); + } + } + } + eventAddress = this._hknp.HP_World_GetNextCollisionEvent(worldAddr, eventAddress); + } + } + get numBodies() { + return this._hknp.HP_World_GetNumBodies(this.world)[1]; + } + dispose() { + this._hknp.HP_QueryCollector_Release(this._queryCollector); + this._queryCollector = BigInt(0); + this._hknp.HP_World_Release(this.world); + this.world = undefined; + } + _v3ToBvecRef(v, vec3) { + vec3.set(v[0], v[1], v[2]); + } + _bVecToV3(v) { + return [v._x, v._y, v._z]; + } + _bQuatToV4(q) { + return [q._x, q._y, q._z, q._w]; + } + _constraintMotorTypeToNative(motorType) { + switch (motorType) { + case PhysicsConstraintMotorType.POSITION: + return this._hknp.ConstraintMotorType.POSITION; + case PhysicsConstraintMotorType.VELOCITY: + return this._hknp.ConstraintMotorType.VELOCITY; + } + return this._hknp.ConstraintMotorType.NONE; + } + _nativeToMotorType(motorType) { + switch (motorType) { + case this._hknp.ConstraintMotorType.POSITION: + return PhysicsConstraintMotorType.POSITION; + case this._hknp.ConstraintMotorType.VELOCITY: + return PhysicsConstraintMotorType.VELOCITY; + } + return PhysicsConstraintMotorType.NONE; + } + _materialCombineToNative(mat) { + switch (mat) { + case PhysicsMaterialCombineMode.GEOMETRIC_MEAN: + return this._hknp.MaterialCombine.GEOMETRIC_MEAN; + case PhysicsMaterialCombineMode.MINIMUM: + return this._hknp.MaterialCombine.MINIMUM; + case PhysicsMaterialCombineMode.MAXIMUM: + return this._hknp.MaterialCombine.MAXIMUM; + case PhysicsMaterialCombineMode.ARITHMETIC_MEAN: + return this._hknp.MaterialCombine.ARITHMETIC_MEAN; + case PhysicsMaterialCombineMode.MULTIPLY: + return this._hknp.MaterialCombine.MULTIPLY; + } + } + _constraintAxisToNative(axId) { + switch (axId) { + case PhysicsConstraintAxis.LINEAR_X: + return this._hknp.ConstraintAxis.LINEAR_X; + case PhysicsConstraintAxis.LINEAR_Y: + return this._hknp.ConstraintAxis.LINEAR_Y; + case PhysicsConstraintAxis.LINEAR_Z: + return this._hknp.ConstraintAxis.LINEAR_Z; + case PhysicsConstraintAxis.ANGULAR_X: + return this._hknp.ConstraintAxis.ANGULAR_X; + case PhysicsConstraintAxis.ANGULAR_Y: + return this._hknp.ConstraintAxis.ANGULAR_Y; + case PhysicsConstraintAxis.ANGULAR_Z: + return this._hknp.ConstraintAxis.ANGULAR_Z; + case PhysicsConstraintAxis.LINEAR_DISTANCE: + return this._hknp.ConstraintAxis.LINEAR_DISTANCE; + } + } + _nativeToLimitMode(mode) { + switch (mode) { + case this._hknp.ConstraintAxisLimitMode.FREE: + return PhysicsConstraintAxisLimitMode.FREE; + case this._hknp.ConstraintAxisLimitMode.LIMITED: + return PhysicsConstraintAxisLimitMode.LIMITED; + case this._hknp.ConstraintAxisLimitMode.LOCKED: + return PhysicsConstraintAxisLimitMode.LOCKED; + } + return PhysicsConstraintAxisLimitMode.FREE; + } + _limitModeToNative(mode) { + switch (mode) { + case PhysicsConstraintAxisLimitMode.FREE: + return this._hknp.ConstraintAxisLimitMode.FREE; + case PhysicsConstraintAxisLimitMode.LIMITED: + return this._hknp.ConstraintAxisLimitMode.LIMITED; + case PhysicsConstraintAxisLimitMode.LOCKED: + return this._hknp.ConstraintAxisLimitMode.LOCKED; + } + } + _nativeCollisionValueToCollisionType(type) { + switch (type) { + case this._hknp.EventType.COLLISION_STARTED.value: + return PhysicsEventType.COLLISION_STARTED; + case this._hknp.EventType.COLLISION_FINISHED.value: + return PhysicsEventType.COLLISION_FINISHED; + case this._hknp.EventType.COLLISION_CONTINUED.value: + return PhysicsEventType.COLLISION_CONTINUED; + } + return PhysicsEventType.COLLISION_STARTED; + } + _nativeTriggerCollisionValueToCollisionType(type) { + switch (type) { + case 8: + return PhysicsEventType.TRIGGER_ENTERED; + case 16: + return PhysicsEventType.TRIGGER_EXITED; + } + return PhysicsEventType.TRIGGER_ENTERED; + } +} +var init_havokPlugin = __esm(() => { + init_math_vector(); + init_IPhysicsEnginePlugin2(); + init_logger(); + init_physicsMaterial(); + init_physicsShape(); + init_mesh(); + init_instancedMesh(); + init_buffer(); + init_arrayTools(); + init_observable(); +}); + +// node_modules/@babylonjs/core/Physics/v2/Plugins/index.js +var init_Plugins4 = __esm(() => { + init_havokPlugin(); +}); + +// node_modules/@babylonjs/core/Physics/v2/index.js +var init_v2 = __esm(() => { + init_physicsEngine2(); + init_physicsBody(); + init_physicsShape(); + init_physicsConstraint(); + init_physicsMaterial(); + init_physicsAggregate(); + init_ragdoll(); + init_IPhysicsEnginePlugin2(); + init_Plugins4(); +}); +// node_modules/@babylonjs/core/Physics/joinedPhysicsEngineComponent.js class PhysicsEngineSceneComponent { constructor(scene24) { this.name = SceneComponentConstants.NAME_PHYSICSENGINE; @@ -151976,43 +170435,125 @@ class PhysicsEngineSceneComponent { } } } - -// node_modules/@babylonjs/core/Physics/v2/physicsEngineComponent.js -Object.defineProperty(TransformNode.prototype, "physicsBody", { - get: function() { - return this._physicsBody; - }, - set: function(value) { - if (this._physicsBody === value) { +var init_joinedPhysicsEngineComponent = __esm(() => { + init_logger(); + init_observable(); + init_sceneComponent(); + init_scene(); + init_physicsEngine(); + init_physicsEngine2(); + Scene.prototype.getPhysicsEngine = function() { + return this._physicsEngine; + }; + Scene.prototype.enablePhysics = function(gravity = null, plugin) { + if (this._physicsEngine) { + return true; + } + let component = this._getComponent(SceneComponentConstants.NAME_PHYSICSENGINE); + if (!component) { + component = new PhysicsEngineSceneComponent(this); + this._addComponent(component); + } + try { + if (!plugin || (plugin === null || plugin === undefined ? undefined : plugin.getPluginVersion()) === 1) { + this._physicsEngine = new PhysicsEngine(gravity, plugin); + } else if ((plugin === null || plugin === undefined ? undefined : plugin.getPluginVersion()) === 2) { + this._physicsEngine = new PhysicsEngine2(gravity, plugin); + } else { + throw new Error("Unsupported Physics plugin version."); + } + this._physicsTimeAccumulator = 0; + return true; + } catch (e) { + Logger.Error(e.message); + return false; + } + }; + Scene.prototype.disablePhysicsEngine = function() { + if (!this._physicsEngine) { return; } - if (this._disposePhysicsObserver) { - this.onDisposeObservable.remove(this._disposePhysicsObserver); + this._physicsEngine.dispose(); + this._physicsEngine = null; + }; + Scene.prototype.isPhysicsEnabled = function() { + return this._physicsEngine !== undefined; + }; + Scene.prototype.deleteCompoundImpostor = function(compound) { + const mesh63 = compound.parts[0].mesh; + if (mesh63.physicsImpostor) { + mesh63.physicsImpostor.dispose(); + mesh63.physicsImpostor = null; } - this._physicsBody = value; - if (value) { - this._disposePhysicsObserver = this.onDisposeObservable.add(() => { - if (this.physicsBody) { - this.physicsBody.dispose(); - /*!doNotRecurse*/ - this.physicsBody = null; + }; + Scene.prototype._advancePhysicsEngineStep = function(step) { + if (this._physicsEngine) { + const subTime = this._physicsEngine.getSubTimeStep(); + if (subTime > 0) { + this._physicsTimeAccumulator += step; + while (this._physicsTimeAccumulator > subTime) { + this.onBeforePhysicsObservable.notifyObservers(this); + this._physicsEngine._step(subTime / 1000); + this.onAfterPhysicsObservable.notifyObservers(this); + this._physicsTimeAccumulator -= subTime; } - }); + } else { + this.onBeforePhysicsObservable.notifyObservers(this); + this._physicsEngine._step(step / 1000); + this.onAfterPhysicsObservable.notifyObservers(this); + } } - }, - enumerable: true, - configurable: true + }; }); -TransformNode.prototype.getPhysicsBody = function() { - return this.physicsBody; -}; -TransformNode.prototype.applyImpulse = function(force, contactPoint) { - if (!this.physicsBody) { - throw new Error("No Physics Body for TransformNode"); - } - this.physicsBody.applyImpulse(force, contactPoint); - return this; -}; + +// node_modules/@babylonjs/core/Physics/v2/physicsEngineComponent.js +var init_physicsEngineComponent2 = __esm(() => { + init_transformNode(); + init_joinedPhysicsEngineComponent(); + Object.defineProperty(TransformNode.prototype, "physicsBody", { + get: function() { + return this._physicsBody; + }, + set: function(value) { + if (this._physicsBody === value) { + return; + } + if (this._disposePhysicsObserver) { + this.onDisposeObservable.remove(this._disposePhysicsObserver); + } + this._physicsBody = value; + if (value) { + this._disposePhysicsObserver = this.onDisposeObservable.add(() => { + if (this.physicsBody) { + this.physicsBody.dispose(); + /*!doNotRecurse*/ + this.physicsBody = null; + } + }); + } + }, + enumerable: true, + configurable: true + }); + TransformNode.prototype.getPhysicsBody = function() { + return this.physicsBody; + }; + TransformNode.prototype.applyImpulse = function(force, contactPoint) { + if (!this.physicsBody) { + throw new Error("No Physics Body for TransformNode"); + } + this.physicsBody.applyImpulse(force, contactPoint); + return this; + }; +}); + +// node_modules/@babylonjs/core/Physics/physicsEngineComponent.js +var init_physicsEngineComponent3 = __esm(() => { + init_joinedPhysicsEngineComponent(); + init_physicsEngineComponent(); + init_physicsEngineComponent2(); +}); + // node_modules/@babylonjs/core/Physics/physicsHelper.js class HelperTools { static GetContactPointToRef(mesh63, origin, direction, result, instanceIndex) { @@ -152041,6 +170582,348 @@ class HelperTools { return Math.abs(distance.x) <= radius && Math.abs(distance.z) <= radius && distance.y >= 0 && distance.y <= height; } } + +class PhysicsHelper { + constructor(scene24) { + this._hitData = { force: new Vector3, contactPoint: new Vector3, distanceFromOrigin: 0 }; + this._scene = scene24; + this._physicsEngine = this._scene.getPhysicsEngine(); + if (!this._physicsEngine) { + Logger.Warn("Physics engine not enabled. Please enable the physics before you can use the methods."); + return; + } + } + applyRadialExplosionImpulse(origin, radiusOrEventOptions, strength, falloff) { + if (!this._physicsEngine) { + Logger.Warn("Physics engine not enabled. Please enable the physics before you call this method."); + return null; + } + if (this._physicsEngine.getPluginVersion() === 1 && this._physicsEngine.getImpostors().length === 0) { + return null; + } + if (this._physicsEngine.getPluginVersion() === 2 && this._physicsEngine.getBodies().length === 0) { + return null; + } + let useCallback = false; + if (typeof radiusOrEventOptions === "number") { + const r = radiusOrEventOptions; + radiusOrEventOptions = new PhysicsRadialExplosionEventOptions; + radiusOrEventOptions.radius = r; + radiusOrEventOptions.strength = strength !== null && strength !== undefined ? strength : radiusOrEventOptions.strength; + radiusOrEventOptions.falloff = falloff !== null && falloff !== undefined ? falloff : radiusOrEventOptions.falloff; + } else { + useCallback = !!(radiusOrEventOptions.affectedImpostorsCallback || radiusOrEventOptions.affectedBodiesCallback); + } + const event = new PhysicsRadialExplosionEvent(this._scene, radiusOrEventOptions); + const hitData = this._hitData; + if (this._physicsEngine.getPluginVersion() === 1) { + const affectedImpostorsWithData = Array(); + const impostors = this._physicsEngine.getImpostors(); + impostors.forEach((impostor) => { + if (!event.getImpostorHitData(impostor, origin, hitData)) { + return; + } + impostor.applyImpulse(hitData.force, hitData.contactPoint); + if (useCallback) { + affectedImpostorsWithData.push({ + impostor, + hitData: this._copyPhysicsHitData(hitData) + }); + } + }); + event.triggerAffectedImpostorsCallback(affectedImpostorsWithData); + } else { + this._applicationForBodies(event, origin, hitData, useCallback, (body, hitData2) => { + body.applyImpulse(hitData2.force, hitData2.contactPoint, hitData2.instanceIndex); + }); + } + event.dispose(false); + return event; + } + applyRadialExplosionForce(origin, radiusOrEventOptions, strength, falloff) { + if (!this._physicsEngine) { + Logger.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."); + return null; + } + if (this._physicsEngine.getPluginVersion() === 1 && this._physicsEngine.getImpostors().length === 0) { + return null; + } + if (this._physicsEngine.getPluginVersion() === 2 && this._physicsEngine.getBodies().length === 0) { + return null; + } + let useCallback = false; + if (typeof radiusOrEventOptions === "number") { + const r = radiusOrEventOptions; + radiusOrEventOptions = new PhysicsRadialExplosionEventOptions; + radiusOrEventOptions.radius = r; + radiusOrEventOptions.strength = strength !== null && strength !== undefined ? strength : radiusOrEventOptions.strength; + radiusOrEventOptions.falloff = falloff !== null && falloff !== undefined ? falloff : radiusOrEventOptions.falloff; + } else { + useCallback = !!(radiusOrEventOptions.affectedImpostorsCallback || radiusOrEventOptions.affectedBodiesCallback); + } + const event = new PhysicsRadialExplosionEvent(this._scene, radiusOrEventOptions); + const hitData = this._hitData; + if (this._physicsEngine.getPluginVersion() === 1) { + const affectedImpostorsWithData = Array(); + const impostors = this._physicsEngine.getImpostors(); + impostors.forEach((impostor) => { + if (!event.getImpostorHitData(impostor, origin, hitData)) { + return; + } + impostor.applyForce(hitData.force, hitData.contactPoint); + if (useCallback) { + affectedImpostorsWithData.push({ + impostor, + hitData: this._copyPhysicsHitData(hitData) + }); + } + }); + event.triggerAffectedImpostorsCallback(affectedImpostorsWithData); + } else { + this._applicationForBodies(event, origin, hitData, useCallback, (body, hitData2) => { + body.applyForce(hitData2.force, hitData2.contactPoint, hitData2.instanceIndex); + }); + } + event.dispose(false); + return event; + } + _applicationForBodies(event, origin, hitData, useCallback, fnApplication) { + const affectedBodiesWithData = Array(); + const bodies = this._physicsEngine.getBodies(); + for (const body of bodies) { + body.iterateOverAllInstances((body2, instanceIndex) => { + if (!event.getBodyHitData(body2, origin, hitData, instanceIndex)) { + return; + } + fnApplication(body2, hitData); + if (useCallback) { + affectedBodiesWithData.push({ + body: body2, + hitData: this._copyPhysicsHitData(hitData) + }); + } + }); + } + event.triggerAffectedBodiesCallback(affectedBodiesWithData); + } + gravitationalField(origin, radiusOrEventOptions, strength, falloff) { + if (!this._physicsEngine) { + Logger.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."); + return null; + } + if (this._physicsEngine.getPluginVersion() === 1 && this._physicsEngine.getImpostors().length === 0) { + return null; + } + if (this._physicsEngine.getPluginVersion() === 2 && this._physicsEngine.getBodies().length === 0) { + return null; + } + if (typeof radiusOrEventOptions === "number") { + const r = radiusOrEventOptions; + radiusOrEventOptions = new PhysicsRadialExplosionEventOptions; + radiusOrEventOptions.radius = r; + radiusOrEventOptions.strength = strength !== null && strength !== undefined ? strength : radiusOrEventOptions.strength; + radiusOrEventOptions.falloff = falloff !== null && falloff !== undefined ? falloff : radiusOrEventOptions.falloff; + } + const event = new PhysicsGravitationalFieldEvent(this, this._scene, origin, radiusOrEventOptions); + event.dispose(false); + return event; + } + updraft(origin, radiusOrEventOptions, strength, height, updraftMode) { + if (!this._physicsEngine) { + Logger.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."); + return null; + } + if (this._physicsEngine.getPluginVersion() === 1 && this._physicsEngine.getImpostors().length === 0) { + return null; + } + if (this._physicsEngine.getPluginVersion() === 2 && this._physicsEngine.getBodies().length === 0) { + return null; + } + if (typeof radiusOrEventOptions === "number") { + const r = radiusOrEventOptions; + radiusOrEventOptions = new PhysicsUpdraftEventOptions; + radiusOrEventOptions.radius = r; + radiusOrEventOptions.strength = strength !== null && strength !== undefined ? strength : radiusOrEventOptions.strength; + radiusOrEventOptions.height = height !== null && height !== undefined ? height : radiusOrEventOptions.height; + radiusOrEventOptions.updraftMode = updraftMode !== null && updraftMode !== undefined ? updraftMode : radiusOrEventOptions.updraftMode; + } + const event = new PhysicsUpdraftEvent(this._scene, origin, radiusOrEventOptions); + event.dispose(false); + return event; + } + vortex(origin, radiusOrEventOptions, strength, height) { + if (!this._physicsEngine) { + Logger.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."); + return null; + } + if (this._physicsEngine.getPluginVersion() === 1 && this._physicsEngine.getImpostors().length === 0) { + return null; + } + if (this._physicsEngine.getPluginVersion() === 2 && this._physicsEngine.getBodies().length === 0) { + return null; + } + if (typeof radiusOrEventOptions === "number") { + const r = radiusOrEventOptions; + radiusOrEventOptions = new PhysicsVortexEventOptions; + radiusOrEventOptions.radius = r; + radiusOrEventOptions.strength = strength !== null && strength !== undefined ? strength : radiusOrEventOptions.strength; + radiusOrEventOptions.height = height !== null && height !== undefined ? height : radiusOrEventOptions.height; + } + const event = new PhysicsVortexEvent(this._scene, origin, radiusOrEventOptions); + event.dispose(false); + return event; + } + _copyPhysicsHitData(data) { + return { force: data.force.clone(), contactPoint: data.contactPoint.clone(), distanceFromOrigin: data.distanceFromOrigin, instanceIndex: data.instanceIndex }; + } +} + +class PhysicsRadialExplosionEvent { + constructor(_scene, _options) { + this._scene = _scene; + this._options = _options; + this._dataFetched = false; + this._options = Object.assign(Object.assign({}, new PhysicsRadialExplosionEventOptions), this._options); + } + getData() { + this._dataFetched = true; + return { + sphere: this._sphere + }; + } + _getHitData(mesh63, center, origin, data) { + const direction = TmpVectors.Vector3[0]; + direction.copyFrom(center).subtractInPlace(origin); + const contactPoint = TmpVectors.Vector3[1]; + const hasContactPoint = HelperTools.GetContactPointToRef(mesh63, origin, direction, contactPoint, data.instanceIndex); + if (!hasContactPoint) { + return false; + } + const distanceFromOrigin = Vector3.Distance(origin, contactPoint); + if (distanceFromOrigin > this._options.radius) { + return false; + } + const multiplier = this._options.falloff === PhysicsRadialImpulseFalloff.Constant ? this._options.strength : this._options.strength * (1 - distanceFromOrigin / this._options.radius); + direction.scaleInPlace(multiplier); + data.force.copyFrom(direction); + data.contactPoint.copyFrom(contactPoint); + data.distanceFromOrigin = distanceFromOrigin; + return true; + } + getBodyHitData(body, origin, data, instanceIndex) { + if (HelperTools.HasAppliedForces(body, instanceIndex)) { + return false; + } + const mesh63 = body.transformNode; + const bodyObjectCenter = body.getObjectCenterWorld(instanceIndex); + data.instanceIndex = instanceIndex; + return this._getHitData(mesh63, bodyObjectCenter, origin, data); + } + getImpostorHitData(impostor, origin, data) { + if (impostor.mass === 0) { + return false; + } + if (impostor.object.getClassName() !== "Mesh" && impostor.object.getClassName() !== "InstancedMesh") { + return false; + } + const mesh63 = impostor.object; + if (!this._intersectsWithSphere(mesh63, origin, this._options.radius)) { + return false; + } + const impostorObjectCenter = impostor.getObjectCenter(); + this._getHitData(mesh63, impostorObjectCenter, origin, data); + return true; + } + triggerAffectedImpostorsCallback(affectedImpostorsWithData) { + if (this._options.affectedImpostorsCallback) { + this._options.affectedImpostorsCallback(affectedImpostorsWithData); + } + } + triggerAffectedBodiesCallback(affectedBodiesWithData) { + if (this._options.affectedBodiesCallback) { + this._options.affectedBodiesCallback(affectedBodiesWithData); + } + } + dispose(force = true) { + if (this._sphere) { + if (force) { + this._sphere.dispose(); + } else { + setTimeout(() => { + if (!this._dataFetched) { + this._sphere.dispose(); + } + }, 0); + } + } + } + _prepareSphere() { + if (!this._sphere) { + this._sphere = CreateSphere("radialExplosionEventSphere", this._options.sphere, this._scene); + this._sphere.isVisible = false; + } + } + _intersectsWithSphere(mesh63, origin, radius) { + this._prepareSphere(); + this._sphere.position = origin; + this._sphere.scaling.setAll(radius * 2); + this._sphere._updateBoundingInfo(); + this._sphere.computeWorldMatrix(true); + return this._sphere.intersectsMesh(mesh63, true); + } +} + +class PhysicsGravitationalFieldEvent { + constructor(_physicsHelper, _scene, _origin, _options) { + this._physicsHelper = _physicsHelper; + this._scene = _scene; + this._origin = _origin; + this._options = _options; + this._dataFetched = false; + this._options = Object.assign(Object.assign({}, new PhysicsRadialExplosionEventOptions), this._options); + this._tickCallback = () => this._tick(); + this._options.strength = this._options.strength * -1; + } + getData() { + this._dataFetched = true; + return { + sphere: this._sphere + }; + } + enable() { + this._tickCallback.call(this); + this._scene.registerBeforeRender(this._tickCallback); + } + disable() { + this._scene.unregisterBeforeRender(this._tickCallback); + } + dispose(force = true) { + if (!this._sphere) { + return; + } + if (force) { + this._sphere.dispose(); + } else { + setTimeout(() => { + if (!this._dataFetched) { + this._sphere.dispose(); + } + }, 0); + } + } + _tick() { + var _a; + if (this._sphere) { + this._physicsHelper.applyRadialExplosionForce(this._origin, this._options); + } else { + const radialExplosionEvent = this._physicsHelper.applyRadialExplosionForce(this._origin, this._options); + if (radialExplosionEvent) { + this._sphere = (_a = radialExplosionEvent.getData().sphere) === null || _a === undefined ? undefined : _a.clone("radialExplosionEventSphereClone"); + } + } + } +} + class PhysicsUpdraftEvent { constructor(_scene, _origin, _options) { this._scene = _scene; @@ -152166,7 +171049,6 @@ class PhysicsUpdraftEvent { return this._cylinder.intersectsMesh(mesh63, true); } } -PhysicsUpdraftEvent._HitData = { force: new Vector3, contactPoint: new Vector3, distanceFromOrigin: 0 }; class PhysicsVortexEvent { constructor(_scene, _origin, _options) { @@ -152311,8 +171193,16 @@ class PhysicsVortexEvent { return this._cylinder.intersectsMesh(mesh63, true); } } -PhysicsVortexEvent.originOnPlane = Vector3.Zero(); -PhysicsVortexEvent.hitData = { force: new Vector3, contactPoint: new Vector3, distanceFromOrigin: 0 }; + +class PhysicsRadialExplosionEventOptions { + constructor() { + this.radius = 5; + this.strength = 10; + this.falloff = PhysicsRadialImpulseFalloff.Constant; + this.sphere = { segments: 32, diameter: 1 }; + } +} + class PhysicsUpdraftEventOptions { constructor() { this.radius = 5; @@ -152333,32 +171223,57 @@ class PhysicsVortexEventOptions { this.updraftForceMultiplier = 0.02; } } -var PhysicsRadialImpulseFalloff; -(function(PhysicsRadialImpulseFalloff2) { - PhysicsRadialImpulseFalloff2[PhysicsRadialImpulseFalloff2["Constant"] = 0] = "Constant"; - PhysicsRadialImpulseFalloff2[PhysicsRadialImpulseFalloff2["Linear"] = 1] = "Linear"; -})(PhysicsRadialImpulseFalloff || (PhysicsRadialImpulseFalloff = {})); -var PhysicsUpdraftMode; -(function(PhysicsUpdraftMode2) { - PhysicsUpdraftMode2[PhysicsUpdraftMode2["Center"] = 0] = "Center"; - PhysicsUpdraftMode2[PhysicsUpdraftMode2["Perpendicular"] = 1] = "Perpendicular"; -})(PhysicsUpdraftMode || (PhysicsUpdraftMode = {})); +var PhysicsRadialImpulseFalloff, PhysicsUpdraftMode; +var init_physicsHelper = __esm(() => { + init_logger(); + init_math_vector(); + init_sphereBuilder(); + init_cylinderBuilder(); + init_ray(); + init_IPhysicsEnginePlugin2(); + PhysicsUpdraftEvent._HitData = { force: new Vector3, contactPoint: new Vector3, distanceFromOrigin: 0 }; + PhysicsVortexEvent.originOnPlane = Vector3.Zero(); + PhysicsVortexEvent.hitData = { force: new Vector3, contactPoint: new Vector3, distanceFromOrigin: 0 }; + (function(PhysicsRadialImpulseFalloff2) { + PhysicsRadialImpulseFalloff2[PhysicsRadialImpulseFalloff2["Constant"] = 0] = "Constant"; + PhysicsRadialImpulseFalloff2[PhysicsRadialImpulseFalloff2["Linear"] = 1] = "Linear"; + })(PhysicsRadialImpulseFalloff || (PhysicsRadialImpulseFalloff = {})); + (function(PhysicsUpdraftMode2) { + PhysicsUpdraftMode2[PhysicsUpdraftMode2["Center"] = 0] = "Center"; + PhysicsUpdraftMode2[PhysicsUpdraftMode2["Perpendicular"] = 1] = "Perpendicular"; + })(PhysicsUpdraftMode || (PhysicsUpdraftMode = {})); +}); + +// node_modules/@babylonjs/core/Physics/index.js +var init_Physics = __esm(() => { + init_v1(); + init_v2(); + init_physicsEngineComponent3(); + init_physicsEngineComponent(); + init_physicsHelper(); + init_physicsRaycastResult(); +}); + // node_modules/@babylonjs/core/Shaders/blackAndWhite.fragment.js -var name194 = "blackAndWhitePixelShader"; -var shader194 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform float degree; +var name195, shader194; +var init_blackAndWhite_fragment = __esm(() => { + init_shaderStore(); + name195 = "blackAndWhitePixelShader"; + shader194 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform float degree; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {vec3 color=texture2D(textureSampler,vUV).rgb;float luminance=dot(color,vec3(0.3,0.59,0.11)); vec3 blackAndWhite=vec3(luminance,luminance,luminance);gl_FragColor=vec4(color-((color-blackAndWhite)*degree),1.0);}`; -ShaderStore.ShadersStore[name194] = shader194; + ShaderStore.ShadersStore[name195] = shader194; +}); // node_modules/@babylonjs/core/PostProcesses/blackAndWhitePostProcess.js class BlackAndWhitePostProcess extends PostProcess { getClassName() { return "BlackAndWhitePostProcess"; } - constructor(name195, options, camera29, samplingMode, engine45, reusable) { - super(name195, "blackAndWhite", ["degree"], null, options, camera29, samplingMode, engine45, reusable); + constructor(name196, options, camera29, samplingMode, engine45, reusable) { + super(name196, "blackAndWhite", ["degree"], null, options, camera29, samplingMode, engine45, reusable); this.degree = 1; this.onApplyObservable.add((effect14) => { effect14.setFloat("degree", this.degree); @@ -152370,14 +171285,22 @@ class BlackAndWhitePostProcess extends PostProcess { }, parsedPostProcess, scene24, rootUrl); } } -__decorate2([ - serialize() -], BlackAndWhitePostProcess.prototype, "degree", undefined); -RegisterClass("BABYLON.BlackAndWhitePostProcess", BlackAndWhitePostProcess); +var init_blackAndWhitePostProcess = __esm(() => { + init_tslib_es62(); + init_postProcess(); + init_blackAndWhite_fragment(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], BlackAndWhitePostProcess.prototype, "degree", undefined); + RegisterClass("BABYLON.BlackAndWhitePostProcess", BlackAndWhitePostProcess); +}); + // node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderEffect.js class PostProcessRenderEffect { - constructor(engine45, name195, getPostProcesses, singleInstance) { - this._name = name195; + constructor(engine45, name196, getPostProcesses, singleInstance) { + this._name = name196; this._singleInstance = singleInstance || true; this._getPostProcesses = getPostProcesses; this._cameras = {}; @@ -152496,23 +171419,31 @@ class PostProcessRenderEffect { } } } +var init_postProcessRenderEffect = __esm(() => { + init_tools(); +}); // node_modules/@babylonjs/core/Shaders/extractHighlights.fragment.js -var name195 = "extractHighlightsPixelShader"; -var shader195 = `#include +var name196, shader195; +var init_extractHighlights_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + name196 = "extractHighlightsPixelShader"; + shader195 = `#include varying vec2 vUV;uniform sampler2D textureSampler;uniform float threshold;uniform float exposure; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {gl_FragColor=texture2D(textureSampler,vUV);float luma=dot(LuminanceEncodeApprox,gl_FragColor.rgb*exposure);gl_FragColor.rgb=step(threshold,luma)*gl_FragColor.rgb;}`; -ShaderStore.ShadersStore[name195] = shader195; + ShaderStore.ShadersStore[name196] = shader195; +}); // node_modules/@babylonjs/core/PostProcesses/extractHighlightsPostProcess.js class ExtractHighlightsPostProcess extends PostProcess { getClassName() { return "ExtractHighlightsPostProcess"; } - constructor(name196, options, camera29, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false) { - super(name196, "extractHighlights", ["threshold", "exposure"], null, options, camera29, samplingMode, engine45, reusable, null, textureType, undefined, null, blockCompilation); + constructor(name197, options, camera29, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false) { + super(name197, "extractHighlights", ["threshold", "exposure"], null, options, camera29, samplingMode, engine45, reusable, null, textureType, undefined, null, blockCompilation); this.threshold = 0.9; this._exposure = 1; this._inputPostProcess = null; @@ -152526,27 +171457,39 @@ class ExtractHighlightsPostProcess extends PostProcess { }); } } -__decorate2([ - serialize() -], ExtractHighlightsPostProcess.prototype, "threshold", undefined); -RegisterClass("BABYLON.ExtractHighlightsPostProcess", ExtractHighlightsPostProcess); +var init_extractHighlightsPostProcess = __esm(() => { + init_tslib_es62(); + init_postProcess(); + init_math_constants(); + init_extractHighlights_fragment(); + init_decorators(); + init_typeStore(); + __decorate2([ + serialize() + ], ExtractHighlightsPostProcess.prototype, "threshold", undefined); + RegisterClass("BABYLON.ExtractHighlightsPostProcess", ExtractHighlightsPostProcess); +}); // node_modules/@babylonjs/core/Shaders/bloomMerge.fragment.js -var name196 = "bloomMergePixelShader"; -var shader196 = `uniform sampler2D textureSampler;uniform sampler2D bloomBlur;varying vec2 vUV;uniform float bloomWeight; +var name197, shader196; +var init_bloomMerge_fragment = __esm(() => { + init_shaderStore(); + name197 = "bloomMergePixelShader"; + shader196 = `uniform sampler2D textureSampler;uniform sampler2D bloomBlur;varying vec2 vUV;uniform float bloomWeight; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {gl_FragColor=texture2D(textureSampler,vUV);vec3 blurred=texture2D(bloomBlur,vUV).rgb;gl_FragColor.rgb=gl_FragColor.rgb+(blurred.rgb*bloomWeight); } `; -ShaderStore.ShadersStore[name196] = shader196; + ShaderStore.ShadersStore[name197] = shader196; +}); // node_modules/@babylonjs/core/PostProcesses/bloomMergePostProcess.js class BloomMergePostProcess extends PostProcess { getClassName() { return "BloomMergePostProcess"; } - constructor(name197, originalFromInput, blurred, weight, options, camera29, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false) { - super(name197, "bloomMerge", ["bloomWeight"], ["bloomBlur"], options, camera29, samplingMode, engine45, reusable, null, textureType, undefined, null, true); + constructor(name198, originalFromInput, blurred, weight, options, camera29, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false) { + super(name198, "bloomMerge", ["bloomWeight"], ["bloomBlur"], options, camera29, samplingMode, engine45, reusable, null, textureType, undefined, null, true); this.weight = 1; this.weight = weight; this.externalTextureSamplerBinding = true; @@ -152560,10 +171503,17 @@ class BloomMergePostProcess extends PostProcess { } } } -__decorate2([ - serialize() -], BloomMergePostProcess.prototype, "weight", undefined); -RegisterClass("BABYLON.BloomMergePostProcess", BloomMergePostProcess); +var init_bloomMergePostProcess = __esm(() => { + init_tslib_es62(); + init_postProcess(); + init_bloomMerge_fragment(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], BloomMergePostProcess.prototype, "weight", undefined); + RegisterClass("BABYLON.BloomMergePostProcess", BloomMergePostProcess); +}); // node_modules/@babylonjs/core/PostProcesses/bloomEffect.js class BloomEffect extends PostProcessRenderEffect { @@ -152624,24 +171574,37 @@ class BloomEffect extends PostProcessRenderEffect { return true; } } +var init_bloomEffect = __esm(() => { + init_postProcessRenderEffect(); + init_extractHighlightsPostProcess(); + init_blurPostProcess(); + init_bloomMergePostProcess(); + init_math_vector(); + init_texture(); +}); + // node_modules/@babylonjs/core/Shaders/chromaticAberration.fragment.js -var name197 = "chromaticAberrationPixelShader"; -var shader197 = `uniform sampler2D textureSampler; +var name198, shader197; +var init_chromaticAberration_fragment = __esm(() => { + init_shaderStore(); + name198 = "chromaticAberrationPixelShader"; + shader197 = `uniform sampler2D textureSampler; uniform float chromatic_aberration;uniform float radialIntensity;uniform vec2 direction;uniform vec2 centerPosition;uniform float screen_width;uniform float screen_height;varying vec2 vUV; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {vec2 centered_screen_pos=vec2(vUV.x-centerPosition.x,vUV.y-centerPosition.y);vec2 directionOfEffect=direction;if(directionOfEffect.x==0. && directionOfEffect.y==0.){directionOfEffect=normalize(centered_screen_pos);} float radius2=centered_screen_pos.x*centered_screen_pos.x + centered_screen_pos.y*centered_screen_pos.y;float radius=sqrt(radius2);vec4 original=texture2D(textureSampler,vUV);vec3 ref_indices=vec3(-0.3,0.0,0.3);float ref_shiftX=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.x/screen_width;float ref_shiftY=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.y/screen_height;vec2 ref_coords_r=vec2(vUV.x+ref_indices.r*ref_shiftX,vUV.y+ref_indices.r*ref_shiftY*0.5);vec2 ref_coords_g=vec2(vUV.x+ref_indices.g*ref_shiftX,vUV.y+ref_indices.g*ref_shiftY*0.5);vec2 ref_coords_b=vec2(vUV.x+ref_indices.b*ref_shiftX,vUV.y+ref_indices.b*ref_shiftY*0.5);original.r=texture2D(textureSampler,ref_coords_r).r;original.g=texture2D(textureSampler,ref_coords_g).g;original.b=texture2D(textureSampler,ref_coords_b).b;original.a=clamp(texture2D(textureSampler,ref_coords_r).a+texture2D(textureSampler,ref_coords_g).a+texture2D(textureSampler,ref_coords_b).a,0.,1.);gl_FragColor=original;}`; -ShaderStore.ShadersStore[name197] = shader197; + ShaderStore.ShadersStore[name198] = shader197; +}); // node_modules/@babylonjs/core/PostProcesses/chromaticAberrationPostProcess.js class ChromaticAberrationPostProcess extends PostProcess { getClassName() { return "ChromaticAberrationPostProcess"; } - constructor(name198, screenWidth, screenHeight, options, camera29, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false) { - super(name198, "chromaticAberration", ["chromatic_aberration", "screen_width", "screen_height", "direction", "radialIntensity", "centerPosition"], [], options, camera29, samplingMode, engine45, reusable, null, textureType, undefined, null, blockCompilation); + constructor(name199, screenWidth, screenHeight, options, camera29, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false) { + super(name199, "chromaticAberration", ["chromatic_aberration", "screen_width", "screen_height", "direction", "radialIntensity", "centerPosition"], [], options, camera29, samplingMode, engine45, reusable, null, textureType, undefined, null, blockCompilation); this.aberrationAmount = 30; this.radialIntensity = 0; this.direction = new Vector2(0.707, 0.707); @@ -152663,28 +171626,40 @@ class ChromaticAberrationPostProcess extends PostProcess { }, parsedPostProcess, scene24, rootUrl); } } -__decorate2([ - serialize() -], ChromaticAberrationPostProcess.prototype, "aberrationAmount", undefined); -__decorate2([ - serialize() -], ChromaticAberrationPostProcess.prototype, "radialIntensity", undefined); -__decorate2([ - serialize() -], ChromaticAberrationPostProcess.prototype, "direction", undefined); -__decorate2([ - serialize() -], ChromaticAberrationPostProcess.prototype, "centerPosition", undefined); -__decorate2([ - serialize() -], ChromaticAberrationPostProcess.prototype, "screenWidth", undefined); -__decorate2([ - serialize() -], ChromaticAberrationPostProcess.prototype, "screenHeight", undefined); -RegisterClass("BABYLON.ChromaticAberrationPostProcess", ChromaticAberrationPostProcess); +var init_chromaticAberrationPostProcess = __esm(() => { + init_tslib_es62(); + init_math_vector(); + init_postProcess(); + init_chromaticAberration_fragment(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], ChromaticAberrationPostProcess.prototype, "aberrationAmount", undefined); + __decorate2([ + serialize() + ], ChromaticAberrationPostProcess.prototype, "radialIntensity", undefined); + __decorate2([ + serialize() + ], ChromaticAberrationPostProcess.prototype, "direction", undefined); + __decorate2([ + serialize() + ], ChromaticAberrationPostProcess.prototype, "centerPosition", undefined); + __decorate2([ + serialize() + ], ChromaticAberrationPostProcess.prototype, "screenWidth", undefined); + __decorate2([ + serialize() + ], ChromaticAberrationPostProcess.prototype, "screenHeight", undefined); + RegisterClass("BABYLON.ChromaticAberrationPostProcess", ChromaticAberrationPostProcess); +}); + // node_modules/@babylonjs/core/Shaders/circleOfConfusion.fragment.js -var name198 = "circleOfConfusionPixelShader"; -var shader198 = `uniform sampler2D depthSampler;varying vec2 vUV;uniform vec2 cameraMinMaxZ;uniform float focusDistance;uniform float cocPrecalculation; +var name199, shader198; +var init_circleOfConfusion_fragment = __esm(() => { + init_shaderStore(); + name199 = "circleOfConfusionPixelShader"; + shader198 = `uniform sampler2D depthSampler;varying vec2 vUV;uniform vec2 cameraMinMaxZ;uniform float focusDistance;uniform float cocPrecalculation; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {float depth=texture2D(depthSampler,vUV).r; @@ -152693,15 +171668,16 @@ float pixelDistance=(cameraMinMaxZ.x+cameraMinMaxZ.y*depth)*1000.0; #define CUSTOM_COC_PIXELDISTANCE float coc=abs(cocPrecalculation*((focusDistance-pixelDistance)/pixelDistance));coc=clamp(coc,0.0,1.0);gl_FragColor=vec4(coc,coc,coc,1.0);} `; -ShaderStore.ShadersStore[name198] = shader198; + ShaderStore.ShadersStore[name199] = shader198; +}); // node_modules/@babylonjs/core/PostProcesses/circleOfConfusionPostProcess.js class CircleOfConfusionPostProcess extends PostProcess { getClassName() { return "CircleOfConfusionPostProcess"; } - constructor(name199, depthTexture, options, camera29, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false) { - super(name199, "circleOfConfusion", ["cameraMinMaxZ", "focusDistance", "cocPrecalculation"], ["depthSampler"], options, camera29, samplingMode, engine45, reusable, null, textureType, undefined, null, blockCompilation); + constructor(name200, depthTexture, options, camera29, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false) { + super(name200, "circleOfConfusion", ["cameraMinMaxZ", "focusDistance", "cocPrecalculation"], ["depthSampler"], options, camera29, samplingMode, engine45, reusable, null, textureType, undefined, null, blockCompilation); this.lensSize = 50; this.fStop = 1.4; this.focusDistance = 2000; @@ -152726,22 +171702,34 @@ class CircleOfConfusionPostProcess extends PostProcess { this._depthTexture = value; } } -__decorate2([ - serialize() -], CircleOfConfusionPostProcess.prototype, "lensSize", undefined); -__decorate2([ - serialize() -], CircleOfConfusionPostProcess.prototype, "fStop", undefined); -__decorate2([ - serialize() -], CircleOfConfusionPostProcess.prototype, "focusDistance", undefined); -__decorate2([ - serialize() -], CircleOfConfusionPostProcess.prototype, "focalLength", undefined); -RegisterClass("BABYLON.CircleOfConfusionPostProcess", CircleOfConfusionPostProcess); +var init_circleOfConfusionPostProcess = __esm(() => { + init_tslib_es62(); + init_postProcess(); + init_logger(); + init_circleOfConfusion_fragment(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], CircleOfConfusionPostProcess.prototype, "lensSize", undefined); + __decorate2([ + serialize() + ], CircleOfConfusionPostProcess.prototype, "fStop", undefined); + __decorate2([ + serialize() + ], CircleOfConfusionPostProcess.prototype, "focusDistance", undefined); + __decorate2([ + serialize() + ], CircleOfConfusionPostProcess.prototype, "focalLength", undefined); + RegisterClass("BABYLON.CircleOfConfusionPostProcess", CircleOfConfusionPostProcess); +}); + // node_modules/@babylonjs/core/Shaders/colorCorrection.fragment.js -var name199 = "colorCorrectionPixelShader"; -var shader199 = `uniform sampler2D textureSampler; +var name200, shader199; +var init_colorCorrection_fragment = __esm(() => { + init_shaderStore(); + name200 = "colorCorrectionPixelShader"; + shader199 = `uniform sampler2D textureSampler; uniform sampler2D colorTable; varying vec2 vUV;const float SLICE_COUNT=16.0; vec4 sampleAs3DTexture(sampler2D textureSampler,vec3 uv,float width) {float sliceSize=1.0/width; @@ -152751,15 +171739,16 @@ float zSlice0=min(floor(uv.z*width),width-1.0);float zSlice1=min(zSlice0+1.0,wid #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {vec4 screen_color=texture2D(textureSampler,vUV);gl_FragColor=sampleAs3DTexture(colorTable,screen_color.rgb,SLICE_COUNT);}`; -ShaderStore.ShadersStore[name199] = shader199; + ShaderStore.ShadersStore[name200] = shader199; +}); // node_modules/@babylonjs/core/PostProcesses/colorCorrectionPostProcess.js class ColorCorrectionPostProcess extends PostProcess { getClassName() { return "ColorCorrectionPostProcess"; } - constructor(name200, colorTableUrl, options, camera29, samplingMode, engine45, reusable) { - super(name200, "colorCorrection", null, ["colorTable"], options, camera29, samplingMode, engine45, reusable); + constructor(name201, colorTableUrl, options, camera29, samplingMode, engine45, reusable) { + super(name201, "colorCorrection", null, ["colorTable"], options, camera29, samplingMode, engine45, reusable); const scene24 = (camera29 === null || camera29 === undefined ? undefined : camera29.getScene()) || null; this._colorTableTexture = new Texture(colorTableUrl, scene24, true, false, Texture.TRILINEAR_SAMPLINGMODE); this._colorTableTexture.anisotropicFilteringLevel = 1; @@ -152776,13 +171765,25 @@ class ColorCorrectionPostProcess extends PostProcess { }, parsedPostProcess, scene24, rootUrl); } } -__decorate2([ - serialize() -], ColorCorrectionPostProcess.prototype, "colorTableUrl", undefined); -RegisterClass("BABYLON.ColorCorrectionPostProcess", ColorCorrectionPostProcess); +var init_colorCorrectionPostProcess = __esm(() => { + init_tslib_es62(); + init_postProcess(); + init_texture(); + init_colorCorrection_fragment(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], ColorCorrectionPostProcess.prototype, "colorTableUrl", undefined); + RegisterClass("BABYLON.ColorCorrectionPostProcess", ColorCorrectionPostProcess); +}); + // node_modules/@babylonjs/core/Shaders/convolution.fragment.js -var name200 = "convolutionPixelShader"; -var shader200 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform float kernel[9]; +var name201, shader200; +var init_convolution_fragment = __esm(() => { + init_shaderStore(); + name201 = "convolutionPixelShader"; + shader200 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform float kernel[9]; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {vec2 onePixel=vec2(1.0,1.0)/screenSize;vec4 colorSum = @@ -152805,15 +171806,16 @@ kernel[6] + kernel[7] + kernel[8];if (kernelWeight<=0.0) {kernelWeight=1.0;} gl_FragColor=vec4((colorSum/kernelWeight).rgb,1);}`; -ShaderStore.ShadersStore[name200] = shader200; + ShaderStore.ShadersStore[name201] = shader200; +}); // node_modules/@babylonjs/core/PostProcesses/convolutionPostProcess.js class ConvolutionPostProcess extends PostProcess { getClassName() { return "ConvolutionPostProcess"; } - constructor(name201, kernel, options, camera29, samplingMode, engine45, reusable, textureType = 0) { - super(name201, "convolution", ["kernel", "screenSize"], null, options, camera29, samplingMode, engine45, reusable, null, textureType); + constructor(name202, kernel, options, camera29, samplingMode, engine45, reusable, textureType = 0) { + super(name202, "convolution", ["kernel", "screenSize"], null, options, camera29, samplingMode, engine45, reusable, null, textureType); this.kernel = kernel; this.onApply = (effect14) => { effect14.setFloat2("screenSize", this.width, this.height); @@ -152826,23 +171828,31 @@ class ConvolutionPostProcess extends PostProcess { }, parsedPostProcess, scene24, rootUrl); } } -ConvolutionPostProcess.EdgeDetect0Kernel = [1, 0, -1, 0, 0, 0, -1, 0, 1]; -ConvolutionPostProcess.EdgeDetect1Kernel = [0, 1, 0, 1, -4, 1, 0, 1, 0]; -ConvolutionPostProcess.EdgeDetect2Kernel = [-1, -1, -1, -1, 8, -1, -1, -1, -1]; -ConvolutionPostProcess.SharpenKernel = [0, -1, 0, -1, 5, -1, 0, -1, 0]; -ConvolutionPostProcess.EmbossKernel = [-2, -1, 0, -1, 1, 1, 0, 1, 2]; -ConvolutionPostProcess.GaussianKernel = [0, 1, 0, 1, 1, 1, 0, 1, 0]; -__decorate2([ - serialize() -], ConvolutionPostProcess.prototype, "kernel", undefined); -RegisterClass("BABYLON.ConvolutionPostProcess", ConvolutionPostProcess); +var init_convolutionPostProcess = __esm(() => { + init_tslib_es62(); + init_postProcess(); + init_convolution_fragment(); + init_typeStore(); + init_decorators(); + ConvolutionPostProcess.EdgeDetect0Kernel = [1, 0, -1, 0, 0, 0, -1, 0, 1]; + ConvolutionPostProcess.EdgeDetect1Kernel = [0, 1, 0, 1, -4, 1, 0, 1, 0]; + ConvolutionPostProcess.EdgeDetect2Kernel = [-1, -1, -1, -1, 8, -1, -1, -1, -1]; + ConvolutionPostProcess.SharpenKernel = [0, -1, 0, -1, 5, -1, 0, -1, 0]; + ConvolutionPostProcess.EmbossKernel = [-2, -1, 0, -1, 1, 1, 0, 1, 2]; + ConvolutionPostProcess.GaussianKernel = [0, 1, 0, 1, 1, 1, 0, 1, 0]; + __decorate2([ + serialize() + ], ConvolutionPostProcess.prototype, "kernel", undefined); + RegisterClass("BABYLON.ConvolutionPostProcess", ConvolutionPostProcess); +}); + // node_modules/@babylonjs/core/PostProcesses/depthOfFieldBlurPostProcess.js class DepthOfFieldBlurPostProcess extends BlurPostProcess { getClassName() { return "DepthOfFieldBlurPostProcess"; } - constructor(name201, scene24, direction, kernel, options, camera29, circleOfConfusion, imageToBlur = null, samplingMode = Texture.BILINEAR_SAMPLINGMODE, engine45, reusable, textureType = 0, blockCompilation = false, textureFormat = 5) { - super(name201, direction, kernel, options, camera29, samplingMode = 2, engine45, reusable, textureType, `#define DOF 1\n`, blockCompilation, textureFormat); + constructor(name202, scene24, direction, kernel, options, camera29, circleOfConfusion, imageToBlur = null, samplingMode = Texture.BILINEAR_SAMPLINGMODE, engine45, reusable, textureType = 0, blockCompilation = false, textureFormat = 5) { + super(name202, direction, kernel, options, camera29, samplingMode = 2, engine45, reusable, textureType, `#define DOF 1\n`, blockCompilation, textureFormat); this.direction = direction; this.externalTextureSamplerBinding = !!imageToBlur; this.onApplyObservable.add((effect14) => { @@ -152853,13 +171863,24 @@ class DepthOfFieldBlurPostProcess extends BlurPostProcess { }); } } -__decorate2([ - serialize() -], DepthOfFieldBlurPostProcess.prototype, "direction", undefined); -RegisterClass("BABYLON.DepthOfFieldBlurPostProcess", DepthOfFieldBlurPostProcess); +var init_depthOfFieldBlurPostProcess = __esm(() => { + init_tslib_es62(); + init_texture(); + init_blurPostProcess(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], DepthOfFieldBlurPostProcess.prototype, "direction", undefined); + RegisterClass("BABYLON.DepthOfFieldBlurPostProcess", DepthOfFieldBlurPostProcess); +}); + // node_modules/@babylonjs/core/Shaders/depthOfFieldMerge.fragment.js -var name201 = "depthOfFieldMergePixelShader"; -var shader201 = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) +var name202, shader201; +var init_depthOfFieldMerge_fragment = __esm(() => { + init_shaderStore(); + name202 = "depthOfFieldMergePixelShader"; + shader201 = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) #define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod) #else #define TEXTUREFUNC(s,c,bias) texture2D(s,c,bias) @@ -152885,15 +171906,16 @@ if(coc<0.33){vec4 original=TEXTUREFUNC(textureSampler,vUV,0.0);vec4 blurred2=TEX #endif } `; -ShaderStore.ShadersStore[name201] = shader201; + ShaderStore.ShadersStore[name202] = shader201; +}); // node_modules/@babylonjs/core/PostProcesses/depthOfFieldMergePostProcess.js class DepthOfFieldMergePostProcess extends PostProcess { getClassName() { return "DepthOfFieldMergePostProcess"; } - constructor(name202, originalFromInput, circleOfConfusion, _blurSteps, options, camera29, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false) { - super(name202, "depthOfFieldMerge", [], ["circleOfConfusionSampler", "blurStep0", "blurStep1", "blurStep2"], options, camera29, samplingMode, engine45, reusable, null, textureType, undefined, null, true); + constructor(name203, originalFromInput, circleOfConfusion, _blurSteps, options, camera29, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false) { + super(name203, "depthOfFieldMerge", [], ["circleOfConfusionSampler", "blurStep0", "blurStep1", "blurStep2"], options, camera29, samplingMode, engine45, reusable, null, textureType, undefined, null, true); this._blurSteps = _blurSteps; this.externalTextureSamplerBinding = true; this.onApplyObservable.add((effect14) => { @@ -152915,15 +171937,12 @@ class DepthOfFieldMergePostProcess extends PostProcess { super.updateEffect(defines, uniforms, samplers, indexParameters, onCompiled, onError); } } +var init_depthOfFieldMergePostProcess = __esm(() => { + init_postProcess(); + init_depthOfFieldMerge_fragment(); +}); // node_modules/@babylonjs/core/PostProcesses/depthOfFieldEffect.js -var DepthOfFieldEffectBlurLevel; -(function(DepthOfFieldEffectBlurLevel2) { - DepthOfFieldEffectBlurLevel2[DepthOfFieldEffectBlurLevel2["Low"] = 0] = "Low"; - DepthOfFieldEffectBlurLevel2[DepthOfFieldEffectBlurLevel2["Medium"] = 1] = "Medium"; - DepthOfFieldEffectBlurLevel2[DepthOfFieldEffectBlurLevel2["High"] = 2] = "High"; -})(DepthOfFieldEffectBlurLevel || (DepthOfFieldEffectBlurLevel = {})); - class DepthOfFieldEffect extends PostProcessRenderEffect { set focalLength(value) { this._circleOfConfusion.focalLength = value; @@ -153023,21 +172042,40 @@ class DepthOfFieldEffect extends PostProcessRenderEffect { return true; } } +var DepthOfFieldEffectBlurLevel; +var init_depthOfFieldEffect = __esm(() => { + init_math_vector(); + init_texture(); + init_postProcessRenderEffect(); + init_circleOfConfusionPostProcess(); + init_depthOfFieldBlurPostProcess(); + init_depthOfFieldMergePostProcess(); + (function(DepthOfFieldEffectBlurLevel2) { + DepthOfFieldEffectBlurLevel2[DepthOfFieldEffectBlurLevel2["Low"] = 0] = "Low"; + DepthOfFieldEffectBlurLevel2[DepthOfFieldEffectBlurLevel2["Medium"] = 1] = "Medium"; + DepthOfFieldEffectBlurLevel2[DepthOfFieldEffectBlurLevel2["High"] = 2] = "High"; + })(DepthOfFieldEffectBlurLevel || (DepthOfFieldEffectBlurLevel = {})); +}); + // node_modules/@babylonjs/core/Shaders/displayPass.fragment.js -var name202 = "displayPassPixelShader"; -var shader202 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D passSampler; +var name203, shader202; +var init_displayPass_fragment = __esm(() => { + init_shaderStore(); + name203 = "displayPassPixelShader"; + shader202 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D passSampler; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {gl_FragColor=texture2D(passSampler,vUV);}`; -ShaderStore.ShadersStore[name202] = shader202; + ShaderStore.ShadersStore[name203] = shader202; +}); // node_modules/@babylonjs/core/PostProcesses/displayPassPostProcess.js class DisplayPassPostProcess extends PostProcess { getClassName() { return "DisplayPassPostProcess"; } - constructor(name203, options, camera29, samplingMode, engine45, reusable) { - super(name203, "displayPass", ["passSampler"], ["passSampler"], options, camera29, samplingMode, engine45, reusable); + constructor(name204, options, camera29, samplingMode, engine45, reusable) { + super(name204, "displayPass", ["passSampler"], ["passSampler"], options, camera29, samplingMode, engine45, reusable); } static _Parse(parsedPostProcess, targetCamera9, scene24, rootUrl) { return SerializationHelper.Parse(() => { @@ -153045,22 +172083,33 @@ class DisplayPassPostProcess extends PostProcess { }, parsedPostProcess, scene24, rootUrl); } } -RegisterClass("BABYLON.DisplayPassPostProcess", DisplayPassPostProcess); +var init_displayPassPostProcess = __esm(() => { + init_postProcess(); + init_displayPass_fragment(); + init_typeStore(); + init_decorators(); + RegisterClass("BABYLON.DisplayPassPostProcess", DisplayPassPostProcess); +}); + // node_modules/@babylonjs/core/Shaders/filter.fragment.js -var name203 = "filterPixelShader"; -var shader203 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform mat4 kernelMatrix; +var name204, shader203; +var init_filter_fragment = __esm(() => { + init_shaderStore(); + name204 = "filterPixelShader"; + shader203 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform mat4 kernelMatrix; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {vec3 baseColor=texture2D(textureSampler,vUV).rgb;vec3 updatedColor=(kernelMatrix*vec4(baseColor,1.0)).rgb;gl_FragColor=vec4(updatedColor,1.0);}`; -ShaderStore.ShadersStore[name203] = shader203; + ShaderStore.ShadersStore[name204] = shader203; +}); // node_modules/@babylonjs/core/PostProcesses/filterPostProcess.js class FilterPostProcess extends PostProcess { getClassName() { return "FilterPostProcess"; } - constructor(name204, kernelMatrix, options, camera29, samplingMode, engine45, reusable) { - super(name204, "filter", ["kernelMatrix"], null, options, camera29, samplingMode, engine45, reusable); + constructor(name205, kernelMatrix, options, camera29, samplingMode, engine45, reusable) { + super(name205, "filter", ["kernelMatrix"], null, options, camera29, samplingMode, engine45, reusable); this.kernelMatrix = kernelMatrix; this.onApply = (effect14) => { effect14.setMatrix("kernelMatrix", this.kernelMatrix); @@ -153072,13 +172121,24 @@ class FilterPostProcess extends PostProcess { }, parsedPostProcess, scene24, rootUrl); } } -__decorate2([ - serializeAsMatrix() -], FilterPostProcess.prototype, "kernelMatrix", undefined); -RegisterClass("BABYLON.FilterPostProcess", FilterPostProcess); +var init_filterPostProcess = __esm(() => { + init_tslib_es62(); + init_postProcess(); + init_filter_fragment(); + init_typeStore(); + init_decorators(); + __decorate2([ + serializeAsMatrix() + ], FilterPostProcess.prototype, "kernelMatrix", undefined); + RegisterClass("BABYLON.FilterPostProcess", FilterPostProcess); +}); + // node_modules/@babylonjs/core/Shaders/fxaa.fragment.js -var name204 = "fxaaPixelShader"; -var shader204 = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) +var name205, shader204; +var init_fxaa_fragment = __esm(() => { + init_shaderStore(); + name205 = "fxaaPixelShader"; + shader204 = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) #define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l) #else #define TEXTUREFUNC(s,c,b) texture2D(s,c,b) @@ -153131,26 +172191,31 @@ else gl_FragColor=TEXTUREFUNC(textureSampler,posM,0.0); #endif }`; -ShaderStore.ShadersStore[name204] = shader204; + ShaderStore.ShadersStore[name205] = shader204; +}); // node_modules/@babylonjs/core/Shaders/fxaa.vertex.js -var name205 = "fxaaVertexShader"; -var shader205 = `attribute vec2 position;uniform vec2 texelSize;varying vec2 vUV;varying vec2 sampleCoordS;varying vec2 sampleCoordE;varying vec2 sampleCoordN;varying vec2 sampleCoordW;varying vec2 sampleCoordNW;varying vec2 sampleCoordSE;varying vec2 sampleCoordNE;varying vec2 sampleCoordSW;const vec2 madd=vec2(0.5,0.5); +var name206, shader205; +var init_fxaa_vertex = __esm(() => { + init_shaderStore(); + name206 = "fxaaVertexShader"; + shader205 = `attribute vec2 position;uniform vec2 texelSize;varying vec2 vUV;varying vec2 sampleCoordS;varying vec2 sampleCoordE;varying vec2 sampleCoordN;varying vec2 sampleCoordW;varying vec2 sampleCoordNW;varying vec2 sampleCoordSE;varying vec2 sampleCoordNE;varying vec2 sampleCoordSW;const vec2 madd=vec2(0.5,0.5); #define CUSTOM_VERTEX_DEFINITIONS void main(void) { #define CUSTOM_VERTEX_MAIN_BEGIN vUV=(position*madd+madd);sampleCoordS=vUV+vec2( 0.0,1.0)*texelSize;sampleCoordE=vUV+vec2( 1.0,0.0)*texelSize;sampleCoordN=vUV+vec2( 0.0,-1.0)*texelSize;sampleCoordW=vUV+vec2(-1.0,0.0)*texelSize;sampleCoordNW=vUV+vec2(-1.0,-1.0)*texelSize;sampleCoordSE=vUV+vec2( 1.0,1.0)*texelSize;sampleCoordNE=vUV+vec2( 1.0,-1.0)*texelSize;sampleCoordSW=vUV+vec2(-1.0,1.0)*texelSize;gl_Position=vec4(position,0.0,1.0); #define CUSTOM_VERTEX_MAIN_END }`; -ShaderStore.ShadersStore[name205] = shader205; + ShaderStore.ShadersStore[name206] = shader205; +}); // node_modules/@babylonjs/core/PostProcesses/fxaaPostProcess.js class FxaaPostProcess extends PostProcess { getClassName() { return "FxaaPostProcess"; } - constructor(name206, options, camera29 = null, samplingMode, engine45, reusable, textureType = 0) { - super(name206, "fxaa", ["texelSize"], null, options, camera29, samplingMode || Texture.BILINEAR_SAMPLINGMODE, engine45, reusable, null, textureType, "fxaa", undefined, true); + constructor(name207, options, camera29 = null, samplingMode, engine45, reusable, textureType = 0) { + super(name207, "fxaa", ["texelSize"], null, options, camera29, samplingMode || Texture.BILINEAR_SAMPLINGMODE, engine45, reusable, null, textureType, "fxaa", undefined, true); const defines = this._getDefines(); this.updateEffect(defines); this.onApplyObservable.add((effect14) => { @@ -153175,24 +172240,38 @@ class FxaaPostProcess extends PostProcess { }, parsedPostProcess, scene24, rootUrl); } } -RegisterClass("BABYLON.FxaaPostProcess", FxaaPostProcess); +var init_fxaaPostProcess = __esm(() => { + init_texture(); + init_postProcess(); + init_fxaa_fragment(); + init_fxaa_vertex(); + init_typeStore(); + init_decorators(); + RegisterClass("BABYLON.FxaaPostProcess", FxaaPostProcess); +}); + // node_modules/@babylonjs/core/Shaders/grain.fragment.js -var name206 = "grainPixelShader"; -var shader206 = `#include +var name207, shader206; +var init_grain_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + name207 = "grainPixelShader"; + shader206 = `#include uniform sampler2D textureSampler; uniform float intensity;uniform float animatedSeed;varying vec2 vUV; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {gl_FragColor=texture2D(textureSampler,vUV);vec2 seed=vUV*(animatedSeed);float grain=dither(seed,intensity);float lum=getLuminance(gl_FragColor.rgb);float grainAmount=(cos(-PI+(lum*PI*2.))+1.)/2.;gl_FragColor.rgb+=grain*grainAmount;gl_FragColor.rgb=max(gl_FragColor.rgb,0.0);}`; -ShaderStore.ShadersStore[name206] = shader206; + ShaderStore.ShadersStore[name207] = shader206; +}); // node_modules/@babylonjs/core/PostProcesses/grainPostProcess.js class GrainPostProcess extends PostProcess { getClassName() { return "GrainPostProcess"; } - constructor(name207, options, camera29, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false) { - super(name207, "grain", ["intensity", "animatedSeed"], [], options, camera29, samplingMode, engine45, reusable, null, textureType, undefined, null, blockCompilation); + constructor(name208, options, camera29, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false) { + super(name208, "grain", ["intensity", "animatedSeed"], [], options, camera29, samplingMode, engine45, reusable, null, textureType, undefined, null, blockCompilation); this.intensity = 30; this.animated = false; this.onApplyObservable.add((effect14) => { @@ -153206,23 +172285,56 @@ class GrainPostProcess extends PostProcess { }, parsedPostProcess, scene24, rootUrl); } } -__decorate2([ - serialize() -], GrainPostProcess.prototype, "intensity", undefined); -__decorate2([ - serialize() -], GrainPostProcess.prototype, "animated", undefined); -RegisterClass("BABYLON.GrainPostProcess", GrainPostProcess); +var init_grainPostProcess = __esm(() => { + init_tslib_es62(); + init_postProcess(); + init_grain_fragment(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], GrainPostProcess.prototype, "intensity", undefined); + __decorate2([ + serialize() + ], GrainPostProcess.prototype, "animated", undefined); + RegisterClass("BABYLON.GrainPostProcess", GrainPostProcess); +}); + // node_modules/@babylonjs/core/Shaders/highlights.fragment.js -var name207 = "highlightsPixelShader"; -var shader207 = `varying vec2 vUV;uniform sampler2D textureSampler;const vec3 RGBLuminanceCoefficients=vec3(0.2126,0.7152,0.0722); +var name208, shader207; +var init_highlights_fragment = __esm(() => { + init_shaderStore(); + name208 = "highlightsPixelShader"; + shader207 = `varying vec2 vUV;uniform sampler2D textureSampler;const vec3 RGBLuminanceCoefficients=vec3(0.2126,0.7152,0.0722); #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {vec4 tex=texture2D(textureSampler,vUV);vec3 c=tex.rgb;float luma=dot(c.rgb,RGBLuminanceCoefficients);gl_FragColor=vec4(pow(c,vec3(25.0-luma*15.0)),tex.a); }`; -ShaderStore.ShadersStore[name207] = shader207; + ShaderStore.ShadersStore[name208] = shader207; +}); + +// node_modules/@babylonjs/core/PostProcesses/highlightsPostProcess.js +class HighlightsPostProcess extends PostProcess { + getClassName() { + return "HighlightsPostProcess"; + } + constructor(name209, options, camera29, samplingMode, engine45, reusable, textureType = 0) { + super(name209, "highlights", null, null, options, camera29, samplingMode, engine45, reusable, null, textureType); + } +} +var init_highlightsPostProcess = __esm(() => { + init_postProcess(); + init_highlights_fragment(); +}); + // node_modules/@babylonjs/core/Shaders/imageProcessing.fragment.js -var name208 = "imageProcessingPixelShader"; -var shader208 = `varying vec2 vUV;uniform sampler2D textureSampler; +var name209, shader208; +var init_imageProcessing_fragment = __esm(() => { + init_shaderStore(); + init_imageProcessingDeclaration(); + init_helperFunctions(); + init_imageProcessingFunctions(); + name209 = "imageProcessingPixelShader"; + shader208 = `varying vec2 vUV;uniform sampler2D textureSampler; #include #include #include @@ -153240,7 +172352,8 @@ result=applyImageProcessing(result); #endif #endif gl_FragColor=result;}`; -ShaderStore.ShadersStore[name208] = shader208; + ShaderStore.ShadersStore[name209] = shader208; +}); // node_modules/@babylonjs/core/PostProcesses/imageProcessingPostProcess.js class ImageProcessingPostProcess extends PostProcess { @@ -153421,8 +172534,8 @@ class ImageProcessingPostProcess extends PostProcess { this._fromLinearSpace = value; this._updateParameters(); } - constructor(name209, options, camera29 = null, samplingMode, engine45, reusable, textureType = 0, imageProcessingConfiguration11) { - super(name209, "imageProcessing", [], [], options, camera29, samplingMode, engine45, reusable, null, textureType, "postprocess", null, true); + constructor(name210, options, camera29 = null, samplingMode, engine45, reusable, textureType = 0, imageProcessingConfiguration11) { + super(name210, "imageProcessing", [], [], options, camera29, samplingMode, engine45, reusable, null, textureType, "postprocess", null, true); this._fromLinearSpace = true; this._defines = { IMAGEPROCESSING: false, @@ -153462,9 +172575,9 @@ class ImageProcessingPostProcess extends PostProcess { this._defines.FROMLINEARSPACE = this._fromLinearSpace; this.imageProcessingConfiguration.prepareDefines(this._defines, true); let defines = ""; - for (const define in this._defines) { - if (this._defines[define]) { - defines += `#define ${define};\n`; + for (const define2 in this._defines) { + if (this._defines[define2]) { + defines += `#define ${define2};\n`; } } const samplers = ["textureSampler"]; @@ -153485,20 +172598,44 @@ class ImageProcessingPostProcess extends PostProcess { } } } -__decorate2([ - serialize() -], ImageProcessingPostProcess.prototype, "_fromLinearSpace", undefined); +var init_imageProcessingPostProcess = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_imageProcessingConfiguration(); + init_postProcess(); + init_engineStore(); + init_imageProcessing_fragment(); + init_postprocess_vertex(); + __decorate2([ + serialize() + ], ImageProcessingPostProcess.prototype, "_fromLinearSpace", undefined); +}); + // node_modules/@babylonjs/core/Shaders/ShadersInclude/mrtFragmentDeclaration.js -var name209 = "mrtFragmentDeclaration"; -var shader209 = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) +var name210, shader209; +var init_mrtFragmentDeclaration = __esm(() => { + init_shaderStore(); + name210 = "mrtFragmentDeclaration"; + shader209 = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) layout(location=0) out vec4 glFragData[{X}]; #endif `; -ShaderStore.IncludesShadersStore[name209] = shader209; + ShaderStore.IncludesShadersStore[name210] = shader209; +}); // node_modules/@babylonjs/core/Shaders/geometry.fragment.js -var name210 = "geometryPixelShader"; -var shader210 = `#extension GL_EXT_draw_buffers : require +var name211, shader210; +var init_geometry_fragment = __esm(() => { + init_shaderStore(); + init_clipPlaneFragmentDeclaration(); + init_mrtFragmentDeclaration(); + init_bumpFragmentMainFunctions(); + init_bumpFragmentFunctions(); + init_helperFunctions(); + init_clipPlaneFragment(); + init_bumpFragment(); + name211 = "geometryPixelShader"; + shader210 = `#extension GL_EXT_draw_buffers : require #if defined(BUMP) || !defined(NORMAL) #extension GL_OES_standard_derivatives : enable #endif @@ -153626,22 +172763,50 @@ gl_FragData[REFLECTIVITY_INDEX]=reflectivity; #endif } `; -ShaderStore.ShadersStore[name210] = shader210; + ShaderStore.ShadersStore[name211] = shader210; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/geometryVertexDeclaration.js -var name211 = "geometryVertexDeclaration"; -var shader211 = `uniform mat4 viewProjection;uniform mat4 view;`; -ShaderStore.IncludesShadersStore[name211] = shader211; +var name212, shader211; +var init_geometryVertexDeclaration = __esm(() => { + init_shaderStore(); + name212 = "geometryVertexDeclaration"; + shader211 = `uniform mat4 viewProjection;uniform mat4 view;`; + ShaderStore.IncludesShadersStore[name212] = shader211; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/geometryUboDeclaration.js -var name212 = "geometryUboDeclaration"; -var shader212 = `#include +var name213, shader212; +var init_geometryUboDeclaration = __esm(() => { + init_shaderStore(); + init_sceneUboDeclaration(); + name213 = "geometryUboDeclaration"; + shader212 = `#include `; -ShaderStore.IncludesShadersStore[name212] = shader212; + ShaderStore.IncludesShadersStore[name213] = shader212; +}); // node_modules/@babylonjs/core/Shaders/geometry.vertex.js -var name213 = "geometryVertexShader"; -var shader213 = `precision highp float; +var name214, shader213; +var init_geometry_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_morphTargetsVertexGlobalDeclaration(); + init_morphTargetsVertexDeclaration(); + init_instancesDeclaration(); + init_geometryVertexDeclaration(); + init_geometryUboDeclaration(); + init_clipPlaneVertexDeclaration(); + init_morphTargetsVertexGlobal(); + init_morphTargetsVertex(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + init_bumpVertex(); + name214 = "geometryVertexShader"; + shader213 = `precision highp float; #include #include #include @@ -153780,34 +172945,10 @@ vAlbedoUV=vec2(albedoMatrix*vec4(uv2,1.0,0.0)); #include } `; -ShaderStore.ShadersStore[name213] = shader213; + ShaderStore.ShadersStore[name214] = shader213; +}); // node_modules/@babylonjs/core/Rendering/geometryBufferRenderer.js -var uniforms = [ - "world", - "mBones", - "viewProjection", - "diffuseMatrix", - "view", - "previousWorld", - "previousViewProjection", - "mPreviousBones", - "bumpMatrix", - "reflectivityMatrix", - "albedoMatrix", - "reflectivityColor", - "albedoColor", - "metallic", - "glossiness", - "vTangentSpaceParams", - "vBumpInfos", - "morphTargetInfluences", - "morphTargetTextureInfo", - "morphTargetTextureIndices", - "boneTextureWidth" -]; -addClipPlaneUniforms(uniforms); - class GeometryBufferRenderer { _linkPrePassRenderer(prePassRenderer) { this._linkedWithPrePass = true; @@ -154489,14 +173630,53 @@ class GeometryBufferRenderer { return target; } } -GeometryBufferRenderer.DEPTH_TEXTURE_TYPE = 0; -GeometryBufferRenderer.NORMAL_TEXTURE_TYPE = 1; -GeometryBufferRenderer.POSITION_TEXTURE_TYPE = 2; -GeometryBufferRenderer.VELOCITY_TEXTURE_TYPE = 3; -GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE = 4; -GeometryBufferRenderer._SceneComponentInitialization = (_) => { - throw _WarnImport("GeometryBufferRendererSceneComponent"); -}; +var uniforms; +var init_geometryBufferRenderer = __esm(() => { + init_math_vector(); + init_buffer(); + init_texture(); + init_multiRenderTarget(); + init_materialHelper(); + init_math_color(); + init_devTools(); + init_material(); + init_geometry_fragment(); + init_geometry_vertex(); + init_materialFlags(); + init_clipPlaneMaterialHelper(); + uniforms = [ + "world", + "mBones", + "viewProjection", + "diffuseMatrix", + "view", + "previousWorld", + "previousViewProjection", + "mPreviousBones", + "bumpMatrix", + "reflectivityMatrix", + "albedoMatrix", + "reflectivityColor", + "albedoColor", + "metallic", + "glossiness", + "vTangentSpaceParams", + "vBumpInfos", + "morphTargetInfluences", + "morphTargetTextureInfo", + "morphTargetTextureIndices", + "boneTextureWidth" + ]; + addClipPlaneUniforms(uniforms); + GeometryBufferRenderer.DEPTH_TEXTURE_TYPE = 0; + GeometryBufferRenderer.NORMAL_TEXTURE_TYPE = 1; + GeometryBufferRenderer.POSITION_TEXTURE_TYPE = 2; + GeometryBufferRenderer.VELOCITY_TEXTURE_TYPE = 3; + GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE = 4; + GeometryBufferRenderer._SceneComponentInitialization = (_) => { + throw _WarnImport("GeometryBufferRendererSceneComponent"); + }; +}); // node_modules/@babylonjs/core/Rendering/motionBlurConfiguration.js class MotionBlurConfiguration { @@ -154506,38 +173686,10 @@ class MotionBlurConfiguration { this.texturesRequired = [2]; } } - -// node_modules/@babylonjs/core/Rendering/geometryBufferRendererSceneComponent.js -Object.defineProperty(Scene.prototype, "geometryBufferRenderer", { - get: function() { - return this._geometryBufferRenderer; - }, - set: function(value) { - if (value && value.isSupported) { - this._geometryBufferRenderer = value; - } - }, - enumerable: true, - configurable: true +var init_motionBlurConfiguration = __esm(() => { }); -Scene.prototype.enableGeometryBufferRenderer = function(ratio = 1, depthFormat = 15) { - if (this._geometryBufferRenderer) { - return this._geometryBufferRenderer; - } - this._geometryBufferRenderer = new GeometryBufferRenderer(this, ratio, depthFormat); - if (!this._geometryBufferRenderer.isSupported) { - this._geometryBufferRenderer = null; - } - return this._geometryBufferRenderer; -}; -Scene.prototype.disableGeometryBufferRenderer = function() { - if (!this._geometryBufferRenderer) { - return; - } - this._geometryBufferRenderer.dispose(); - this._geometryBufferRenderer = null; -}; +// node_modules/@babylonjs/core/Rendering/geometryBufferRendererSceneComponent.js class GeometryBufferRendererSceneComponent { constructor(scene25) { this.name = SceneComponentConstants.NAME_GEOMETRYBUFFERRENDERER; @@ -154556,17 +173708,54 @@ class GeometryBufferRendererSceneComponent { } } } -GeometryBufferRenderer._SceneComponentInitialization = (scene25) => { - let component = scene25._getComponent(SceneComponentConstants.NAME_GEOMETRYBUFFERRENDERER); - if (!component) { - component = new GeometryBufferRendererSceneComponent(scene25); - scene25._addComponent(component); - } -}; +var init_geometryBufferRendererSceneComponent = __esm(() => { + init_scene(); + init_sceneComponent(); + init_geometryBufferRenderer(); + Object.defineProperty(Scene.prototype, "geometryBufferRenderer", { + get: function() { + return this._geometryBufferRenderer; + }, + set: function(value) { + if (value && value.isSupported) { + this._geometryBufferRenderer = value; + } + }, + enumerable: true, + configurable: true + }); + Scene.prototype.enableGeometryBufferRenderer = function(ratio = 1, depthFormat = 15) { + if (this._geometryBufferRenderer) { + return this._geometryBufferRenderer; + } + this._geometryBufferRenderer = new GeometryBufferRenderer(this, ratio, depthFormat); + if (!this._geometryBufferRenderer.isSupported) { + this._geometryBufferRenderer = null; + } + return this._geometryBufferRenderer; + }; + Scene.prototype.disableGeometryBufferRenderer = function() { + if (!this._geometryBufferRenderer) { + return; + } + this._geometryBufferRenderer.dispose(); + this._geometryBufferRenderer = null; + }; + GeometryBufferRenderer._SceneComponentInitialization = (scene25) => { + let component = scene25._getComponent(SceneComponentConstants.NAME_GEOMETRYBUFFERRENDERER); + if (!component) { + component = new GeometryBufferRendererSceneComponent(scene25); + scene25._addComponent(component); + } + }; +}); // node_modules/@babylonjs/core/Shaders/motionBlur.fragment.js -var name214 = "motionBlurPixelShader"; -var shader214 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform float motionStrength;uniform float motionScale;uniform vec2 screenSize; +var name215, shader214; +var init_motionBlur_fragment = __esm(() => { + init_shaderStore(); + name215 = "motionBlurPixelShader"; + shader214 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform float motionStrength;uniform float motionScale;uniform vec2 screenSize; #ifdef OBJECT_BASED uniform sampler2D velocitySampler; #else @@ -154604,7 +173793,8 @@ gl_FragColor=texture2D(textureSampler,vUV); #endif } `; -ShaderStore.ShadersStore[name214] = shader214; + ShaderStore.ShadersStore[name215] = shader214; +}); // node_modules/@babylonjs/core/PostProcesses/motionBlurPostProcess.js class MotionBlurPostProcess extends PostProcess { @@ -154640,8 +173830,8 @@ class MotionBlurPostProcess extends PostProcess { getClassName() { return "MotionBlurPostProcess"; } - constructor(name215, scene25, options, camera29, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false, forceGeometryBuffer = false) { - super(name215, "motionBlur", ["motionStrength", "motionScale", "screenSize", "inverseViewProjection", "prevViewProjection", "projection"], ["velocitySampler", "depthSampler"], options, camera29, samplingMode, engine45, reusable, "#define GEOMETRY_SUPPORTED\n#define SAMPLES 64.0\n#define OBJECT_BASED", textureType, undefined, null, blockCompilation); + constructor(name216, scene25, options, camera29, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false, forceGeometryBuffer = false) { + super(name216, "motionBlur", ["motionStrength", "motionScale", "screenSize", "inverseViewProjection", "prevViewProjection", "projection"], ["velocitySampler", "depthSampler"], options, camera29, samplingMode, engine45, reusable, "#define GEOMETRY_SUPPORTED\n#define SAMPLES 64.0\n#define OBJECT_BASED", textureType, undefined, null, blockCompilation); this.motionStrength = 1; this._motionBlurSamples = 32; this._isObjectBased = true; @@ -154772,20 +173962,38 @@ class MotionBlurPostProcess extends PostProcess { }, parsedPostProcess, scene25, rootUrl); } } -__decorate2([ - serialize() -], MotionBlurPostProcess.prototype, "motionStrength", undefined); -__decorate2([ - serialize() -], MotionBlurPostProcess.prototype, "motionBlurSamples", null); -__decorate2([ - serialize() -], MotionBlurPostProcess.prototype, "isObjectBased", null); -RegisterClass("BABYLON.MotionBlurPostProcess", MotionBlurPostProcess); +var init_motionBlurPostProcess = __esm(() => { + init_tslib_es62(); + init_logger(); + init_math_vector(); + init_postProcess(); + init_geometryBufferRenderer(); + init_motionBlurConfiguration(); + init_animatable(); + init_geometryBufferRendererSceneComponent(); + init_motionBlur_fragment(); + init_decorators(); + init_typeStore(); + __decorate2([ + serialize() + ], MotionBlurPostProcess.prototype, "motionStrength", undefined); + __decorate2([ + serialize() + ], MotionBlurPostProcess.prototype, "motionBlurSamples", null); + __decorate2([ + serialize() + ], MotionBlurPostProcess.prototype, "isObjectBased", null); + RegisterClass("BABYLON.MotionBlurPostProcess", MotionBlurPostProcess); +}); + // node_modules/@babylonjs/core/Shaders/refraction.fragment.js -var name215 = "refractionPixelShader"; -var shader215 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D refractionSampler;uniform vec3 baseColor;uniform float depth;uniform float colorLevel;void main() {float ref=1.0-texture2D(refractionSampler,vUV).r;vec2 uv=vUV-vec2(0.5);vec2 offset=uv*depth*ref;vec3 sourceColor=texture2D(textureSampler,vUV-offset).rgb;gl_FragColor=vec4(sourceColor+sourceColor*ref*colorLevel,1.0);}`; -ShaderStore.ShadersStore[name215] = shader215; +var name216, shader215; +var init_refraction_fragment = __esm(() => { + init_shaderStore(); + name216 = "refractionPixelShader"; + shader215 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D refractionSampler;uniform vec3 baseColor;uniform float depth;uniform float colorLevel;void main() {float ref=1.0-texture2D(refractionSampler,vUV).r;vec2 uv=vUV-vec2(0.5);vec2 offset=uv*depth*ref;vec3 sourceColor=texture2D(textureSampler,vUV-offset).rgb;gl_FragColor=vec4(sourceColor+sourceColor*ref*colorLevel,1.0);}`; + ShaderStore.ShadersStore[name216] = shader215; +}); // node_modules/@babylonjs/core/PostProcesses/refractionPostProcess.js class RefractionPostProcess extends PostProcess { @@ -154802,8 +174010,8 @@ class RefractionPostProcess extends PostProcess { getClassName() { return "RefractionPostProcess"; } - constructor(name216, refractionTextureUrl, color, depth, colorLevel, options, camera29, samplingMode, engine45, reusable) { - super(name216, "refraction", ["baseColor", "depth", "colorLevel"], ["refractionSampler"], options, camera29, samplingMode, engine45, reusable); + constructor(name217, refractionTextureUrl, color, depth, colorLevel, options, camera29, samplingMode, engine45, reusable) { + super(name217, "refraction", ["baseColor", "depth", "colorLevel"], ["refractionSampler"], options, camera29, samplingMode, engine45, reusable); this._ownRefractionTexture = true; this.color = color; this.depth = depth; @@ -154832,22 +174040,34 @@ class RefractionPostProcess extends PostProcess { }, parsedPostProcess, scene25, rootUrl); } } -__decorate2([ - serialize() -], RefractionPostProcess.prototype, "color", undefined); -__decorate2([ - serialize() -], RefractionPostProcess.prototype, "depth", undefined); -__decorate2([ - serialize() -], RefractionPostProcess.prototype, "colorLevel", undefined); -__decorate2([ - serialize() -], RefractionPostProcess.prototype, "refractionTextureUrl", undefined); -RegisterClass("BABYLON.RefractionPostProcess", RefractionPostProcess); +var init_refractionPostProcess = __esm(() => { + init_tslib_es62(); + init_texture(); + init_postProcess(); + init_refraction_fragment(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], RefractionPostProcess.prototype, "color", undefined); + __decorate2([ + serialize() + ], RefractionPostProcess.prototype, "depth", undefined); + __decorate2([ + serialize() + ], RefractionPostProcess.prototype, "colorLevel", undefined); + __decorate2([ + serialize() + ], RefractionPostProcess.prototype, "refractionTextureUrl", undefined); + RegisterClass("BABYLON.RefractionPostProcess", RefractionPostProcess); +}); + // node_modules/@babylonjs/core/Shaders/sharpen.fragment.js -var name216 = "sharpenPixelShader"; -var shader216 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform vec2 sharpnessAmounts; +var name217, shader216; +var init_sharpen_fragment = __esm(() => { + init_shaderStore(); + name217 = "sharpenPixelShader"; + shader216 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform vec2 screenSize;uniform vec2 sharpnessAmounts; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {vec2 onePixel=vec2(1.0,1.0)/screenSize;vec4 color=texture2D(textureSampler,vUV);vec4 edgeDetection=texture2D(textureSampler,vUV+onePixel*vec2(0,-1)) + @@ -154855,15 +174075,16 @@ texture2D(textureSampler,vUV+onePixel*vec2(-1,0)) + texture2D(textureSampler,vUV+onePixel*vec2(1,0)) + texture2D(textureSampler,vUV+onePixel*vec2(0,1)) - color*4.0;gl_FragColor=max(vec4(color.rgb*sharpnessAmounts.y,color.a)-(sharpnessAmounts.x*vec4(edgeDetection.rgb,0)),0.);}`; -ShaderStore.ShadersStore[name216] = shader216; + ShaderStore.ShadersStore[name217] = shader216; +}); // node_modules/@babylonjs/core/PostProcesses/sharpenPostProcess.js class SharpenPostProcess extends PostProcess { getClassName() { return "SharpenPostProcess"; } - constructor(name217, options, camera29, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false) { - super(name217, "sharpen", ["sharpnessAmounts", "screenSize"], null, options, camera29, samplingMode, engine45, reusable, null, textureType, undefined, null, blockCompilation); + constructor(name218, options, camera29, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false) { + super(name218, "sharpen", ["sharpnessAmounts", "screenSize"], null, options, camera29, samplingMode, engine45, reusable, null, textureType, undefined, null, blockCompilation); this.colorAmount = 1; this.edgeAmount = 0.3; this.onApply = (effect14) => { @@ -154877,13 +174098,20 @@ class SharpenPostProcess extends PostProcess { }, parsedPostProcess, scene25, rootUrl); } } -__decorate2([ - serialize() -], SharpenPostProcess.prototype, "colorAmount", undefined); -__decorate2([ - serialize() -], SharpenPostProcess.prototype, "edgeAmount", undefined); -RegisterClass("BABYLON.SharpenPostProcess", SharpenPostProcess); +var init_sharpenPostProcess = __esm(() => { + init_tslib_es62(); + init_postProcess(); + init_sharpen_fragment(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], SharpenPostProcess.prototype, "colorAmount", undefined); + __decorate2([ + serialize() + ], SharpenPostProcess.prototype, "edgeAmount", undefined); + RegisterClass("BABYLON.SharpenPostProcess", SharpenPostProcess); +}); // node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipeline.js class PostProcessRenderPipeline { @@ -154893,9 +174121,9 @@ class PostProcessRenderPipeline { get cameras() { return this._cameras; } - constructor(_engine, name217) { + constructor(_engine, name218) { this._engine = _engine; - this._name = name217; + this._name = name218; this._renderEffects = {}; this._renderEffectsForIsolatedPass = new Array; this._cameras = []; @@ -155023,9 +174251,14 @@ class PostProcessRenderPipeline { dispose() { } } -__decorate2([ - serialize() -], PostProcessRenderPipeline.prototype, "_name", undefined); +var init_postProcessRenderPipeline = __esm(() => { + init_tslib_es62(); + init_tools(); + init_decorators(); + __decorate2([ + serialize() + ], PostProcessRenderPipeline.prototype, "_name", undefined); +}); // node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.js class PostProcessRenderPipelineManager { @@ -155108,24 +174341,10 @@ class PostProcessRenderPipelineManager { } } } - -// node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.js -Object.defineProperty(Scene.prototype, "postProcessRenderPipelineManager", { - get: function() { - if (!this._postProcessRenderPipelineManager) { - let component = this._getComponent(SceneComponentConstants.NAME_POSTPROCESSRENDERPIPELINEMANAGER); - if (!component) { - component = new PostProcessRenderPipelineManagerSceneComponent(this); - this._addComponent(component); - } - this._postProcessRenderPipelineManager = new PostProcessRenderPipelineManager; - } - return this._postProcessRenderPipelineManager; - }, - enumerable: true, - configurable: true +var init_postProcessRenderPipelineManager = __esm(() => { }); +// node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.js class PostProcessRenderPipelineManagerSceneComponent { constructor(scene26) { this.name = SceneComponentConstants.NAME_POSTPROCESSRENDERPIPELINEMANAGER; @@ -155150,6 +174369,26 @@ class PostProcessRenderPipelineManagerSceneComponent { } } } +var init_postProcessRenderPipelineManagerSceneComponent = __esm(() => { + init_sceneComponent(); + init_postProcessRenderPipelineManager(); + init_scene(); + Object.defineProperty(Scene.prototype, "postProcessRenderPipelineManager", { + get: function() { + if (!this._postProcessRenderPipelineManager) { + let component = this._getComponent(SceneComponentConstants.NAME_POSTPROCESSRENDERPIPELINEMANAGER); + if (!component) { + component = new PostProcessRenderPipelineManagerSceneComponent(this); + this._addComponent(component); + } + this._postProcessRenderPipelineManager = new PostProcessRenderPipelineManager; + } + return this._postProcessRenderPipelineManager; + }, + enumerable: true, + configurable: true + }); +}); // node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js class DefaultRenderingPipeline extends PostProcessRenderPipeline { @@ -155320,8 +174559,8 @@ class DefaultRenderingPipeline extends PostProcessRenderPipeline { get grainEnabled() { return this._grainEnabled; } - constructor(name217 = "", hdr3 = true, scene26 = EngineStore.LastCreatedScene, cameras, automaticBuild = true) { - super(scene26.getEngine(), name217); + constructor(name218 = "", hdr3 = true, scene26 = EngineStore.LastCreatedScene, cameras, automaticBuild = true) { + super(scene26.getEngine(), name218); this._camerasToBeAttached = []; this.SharpenPostProcessId = "SharpenPostProcessEffect"; this.ImageProcessingPostProcessId = "ImageProcessingPostProcessEffect"; @@ -155633,61 +174872,86 @@ class DefaultRenderingPipeline extends PostProcessRenderPipeline { return SerializationHelper.Parse(() => new DefaultRenderingPipeline(source._name, source._name._hdr, scene26), source, scene26, rootUrl); } } -__decorate2([ - serialize() -], DefaultRenderingPipeline.prototype, "sharpenEnabled", null); -__decorate2([ - serialize() -], DefaultRenderingPipeline.prototype, "bloomKernel", null); -__decorate2([ - serialize() -], DefaultRenderingPipeline.prototype, "_bloomWeight", undefined); -__decorate2([ - serialize() -], DefaultRenderingPipeline.prototype, "_bloomThreshold", undefined); -__decorate2([ - serialize() -], DefaultRenderingPipeline.prototype, "_hdr", undefined); -__decorate2([ - serialize() -], DefaultRenderingPipeline.prototype, "bloomWeight", null); -__decorate2([ - serialize() -], DefaultRenderingPipeline.prototype, "bloomThreshold", null); -__decorate2([ - serialize() -], DefaultRenderingPipeline.prototype, "bloomScale", null); -__decorate2([ - serialize() -], DefaultRenderingPipeline.prototype, "bloomEnabled", null); -__decorate2([ - serialize() -], DefaultRenderingPipeline.prototype, "depthOfFieldEnabled", null); -__decorate2([ - serialize() -], DefaultRenderingPipeline.prototype, "depthOfFieldBlurLevel", null); -__decorate2([ - serialize() -], DefaultRenderingPipeline.prototype, "fxaaEnabled", null); -__decorate2([ - serialize() -], DefaultRenderingPipeline.prototype, "samples", null); -__decorate2([ - serialize() -], DefaultRenderingPipeline.prototype, "imageProcessingEnabled", null); -__decorate2([ - serialize() -], DefaultRenderingPipeline.prototype, "glowLayerEnabled", null); -__decorate2([ - serialize() -], DefaultRenderingPipeline.prototype, "chromaticAberrationEnabled", null); -__decorate2([ - serialize() -], DefaultRenderingPipeline.prototype, "grainEnabled", null); -RegisterClass("BABYLON.DefaultRenderingPipeline", DefaultRenderingPipeline); +var init_defaultRenderingPipeline = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_observable(); + init_logger(); + init_texture(); + init_glowLayer(); + init_sharpenPostProcess(); + init_imageProcessingPostProcess(); + init_chromaticAberrationPostProcess(); + init_grainPostProcess(); + init_fxaaPostProcess(); + init_postProcessRenderPipeline(); + init_postProcessRenderEffect(); + init_depthOfFieldEffect(); + init_bloomEffect(); + init_typeStore(); + init_engineStore(); + init_tools(); + init_postProcessRenderPipelineManagerSceneComponent(); + __decorate2([ + serialize() + ], DefaultRenderingPipeline.prototype, "sharpenEnabled", null); + __decorate2([ + serialize() + ], DefaultRenderingPipeline.prototype, "bloomKernel", null); + __decorate2([ + serialize() + ], DefaultRenderingPipeline.prototype, "_bloomWeight", undefined); + __decorate2([ + serialize() + ], DefaultRenderingPipeline.prototype, "_bloomThreshold", undefined); + __decorate2([ + serialize() + ], DefaultRenderingPipeline.prototype, "_hdr", undefined); + __decorate2([ + serialize() + ], DefaultRenderingPipeline.prototype, "bloomWeight", null); + __decorate2([ + serialize() + ], DefaultRenderingPipeline.prototype, "bloomThreshold", null); + __decorate2([ + serialize() + ], DefaultRenderingPipeline.prototype, "bloomScale", null); + __decorate2([ + serialize() + ], DefaultRenderingPipeline.prototype, "bloomEnabled", null); + __decorate2([ + serialize() + ], DefaultRenderingPipeline.prototype, "depthOfFieldEnabled", null); + __decorate2([ + serialize() + ], DefaultRenderingPipeline.prototype, "depthOfFieldBlurLevel", null); + __decorate2([ + serialize() + ], DefaultRenderingPipeline.prototype, "fxaaEnabled", null); + __decorate2([ + serialize() + ], DefaultRenderingPipeline.prototype, "samples", null); + __decorate2([ + serialize() + ], DefaultRenderingPipeline.prototype, "imageProcessingEnabled", null); + __decorate2([ + serialize() + ], DefaultRenderingPipeline.prototype, "glowLayerEnabled", null); + __decorate2([ + serialize() + ], DefaultRenderingPipeline.prototype, "chromaticAberrationEnabled", null); + __decorate2([ + serialize() + ], DefaultRenderingPipeline.prototype, "grainEnabled", null); + RegisterClass("BABYLON.DefaultRenderingPipeline", DefaultRenderingPipeline); +}); + // node_modules/@babylonjs/core/Shaders/lensHighlights.fragment.js -var name217 = "lensHighlightsPixelShader"; -var shader217 = `uniform sampler2D textureSampler; +var name218, shader217; +var init_lensHighlights_fragment = __esm(() => { + init_shaderStore(); + name218 = "lensHighlightsPixelShader"; + shader217 = `uniform sampler2D textureSampler; uniform float gain;uniform float threshold;uniform float screen_width;uniform float screen_height;varying vec2 vUV;vec4 highlightColor(vec4 color) {vec4 highlight=color;float luminance=dot(highlight.rgb,vec3(0.2125,0.7154,0.0721));float lum_threshold;if (threshold>1.0) { lum_threshold=0.94+0.01*threshold; } else { lum_threshold=0.5+0.44*threshold; } luminance=clamp((luminance-lum_threshold)*(1.0/(1.0-lum_threshold)),0.0,1.0);highlight*=luminance*gain;highlight.a=1.0;return highlight;} @@ -155701,11 +174965,15 @@ blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.84*w,0.43*h)));blur blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.85*w,0.36*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.52*w,-1.14*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.46*w,1.42*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.46*w,-0.83*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.79*w,-0.42*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.11*w,1.62*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.29*w,-2.07*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.69*w,1.39*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.28*w,0.12*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.65*w,-1.69*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.08*w,2.44*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.63*w,-1.90*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.55*w,0.31*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.13*w,1.52*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.56*w,-2.61*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.38*w,2.34*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.64*w,-0.81*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.53*w,-1.21*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.06*w,2.63*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.00*w,-2.69*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.59*w,1.32*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.78*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.57*w,-2.50*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.54*w,2.93*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.39*w,-1.81*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,-0.28*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.04*w,2.25*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.02*w,-3.05*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.09*w,2.25*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.07*w,-0.25*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.44*w,-1.90*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.52*w,3.05*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.68*w,-2.61*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,0.79*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.76*w,1.46*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.05*w,-2.94*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.21*w,2.88*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.84*w,-1.30*h)));blurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.98*w,-0.96*h))); #endif blurred/=39.0;gl_FragColor=blurred;}`; -ShaderStore.ShadersStore[name217] = shader217; + ShaderStore.ShadersStore[name218] = shader217; +}); // node_modules/@babylonjs/core/Shaders/depthOfField.fragment.js -var name218 = "depthOfFieldPixelShader"; -var shader218 = `uniform sampler2D textureSampler;uniform sampler2D highlightsSampler;uniform sampler2D depthSampler;uniform sampler2D grainSampler;uniform float grain_amount;uniform bool blur_noise;uniform float screen_width;uniform float screen_height;uniform float distortion;uniform bool dof_enabled;uniform float screen_distance; +var name219, shader218; +var init_depthOfField_fragment = __esm(() => { + init_shaderStore(); + name219 = "depthOfFieldPixelShader"; + shader218 = `uniform sampler2D textureSampler;uniform sampler2D highlightsSampler;uniform sampler2D depthSampler;uniform sampler2D grainSampler;uniform float grain_amount;uniform bool blur_noise;uniform float screen_width;uniform float screen_height;uniform float distortion;uniform bool dof_enabled;uniform float screen_distance; uniform float aperture;uniform float darken;uniform float edge_blur;uniform bool highlights;uniform float near;uniform float far;varying vec2 vUV; #define PI 3.14159265 #define TWOPI 6.28318530 @@ -155735,7 +175003,294 @@ else {gl_FragColor=getBlurColor(blur_amount*1.7);if (highlights) {gl_FragColor.r if (blur_noise) {vec2 noise=rand(distorted_coords)*0.01*blur_amount;vec2 blurred_coord=vec2(distorted_coords.x+noise.x,distorted_coords.y+noise.y);gl_FragColor=0.04*texture2D(textureSampler,blurred_coord)+0.96*gl_FragColor;}} if (grain_amount>0.0) {vec4 grain_color=texture2D(grainSampler,texels_coords*0.003);gl_FragColor.rgb+=(-0.5+grain_color.rgb)*0.30*grain_amount;}} `; -ShaderStore.ShadersStore[name218] = shader218; + ShaderStore.ShadersStore[name219] = shader218; +}); + +// node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js +class LensRenderingPipeline extends PostProcessRenderPipeline { + constructor(name220, parameters, scene26, ratio = 1, cameras) { + super(scene26.getEngine(), name220); + this.LensChromaticAberrationEffect = "LensChromaticAberrationEffect"; + this.HighlightsEnhancingEffect = "HighlightsEnhancingEffect"; + this.LensDepthOfFieldEffect = "LensDepthOfFieldEffect"; + this._pentagonBokehIsEnabled = false; + this._scene = scene26; + this._depthTexture = scene26.enableDepthRenderer().getDepthMap(); + if (parameters.grain_texture) { + this._grainTexture = parameters.grain_texture; + } else { + this._createGrainTexture(); + } + this._edgeBlur = parameters.edge_blur ? parameters.edge_blur : 0; + this._grainAmount = parameters.grain_amount ? parameters.grain_amount : 0; + this._chromaticAberration = parameters.chromatic_aberration ? parameters.chromatic_aberration : 0; + this._distortion = parameters.distortion ? parameters.distortion : 0; + this._highlightsGain = parameters.dof_gain !== undefined ? parameters.dof_gain : -1; + this._highlightsThreshold = parameters.dof_threshold ? parameters.dof_threshold : 1; + this._dofDistance = parameters.dof_focus_distance !== undefined ? parameters.dof_focus_distance : -1; + this._dofAperture = parameters.dof_aperture ? parameters.dof_aperture : 1; + this._dofDarken = parameters.dof_darken ? parameters.dof_darken : 0; + this._dofPentagon = parameters.dof_pentagon !== undefined ? parameters.dof_pentagon : true; + this._blurNoise = parameters.blur_noise !== undefined ? parameters.blur_noise : true; + this._createChromaticAberrationPostProcess(ratio); + this._createHighlightsPostProcess(ratio); + this._createDepthOfFieldPostProcess(ratio / 4); + this.addEffect(new PostProcessRenderEffect(scene26.getEngine(), this.LensChromaticAberrationEffect, () => { + return this._chromaticAberrationPostProcess; + }, true)); + this.addEffect(new PostProcessRenderEffect(scene26.getEngine(), this.HighlightsEnhancingEffect, () => { + return this._highlightsPostProcess; + }, true)); + this.addEffect(new PostProcessRenderEffect(scene26.getEngine(), this.LensDepthOfFieldEffect, () => { + return this._depthOfFieldPostProcess; + }, true)); + if (this._highlightsGain === -1) { + this._disableEffect(this.HighlightsEnhancingEffect, null); + } + scene26.postProcessRenderPipelineManager.addPipeline(this); + if (cameras) { + scene26.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name220, cameras); + } + } + getClassName() { + return "LensRenderingPipeline"; + } + get scene() { + return this._scene; + } + get edgeBlur() { + return this._edgeBlur; + } + set edgeBlur(value) { + this.setEdgeBlur(value); + } + get grainAmount() { + return this._grainAmount; + } + set grainAmount(value) { + this.setGrainAmount(value); + } + get chromaticAberration() { + return this._chromaticAberration; + } + set chromaticAberration(value) { + this.setChromaticAberration(value); + } + get dofAperture() { + return this._dofAperture; + } + set dofAperture(value) { + this.setAperture(value); + } + get edgeDistortion() { + return this._distortion; + } + set edgeDistortion(value) { + this.setEdgeDistortion(value); + } + get dofDistortion() { + return this._dofDistance; + } + set dofDistortion(value) { + this.setFocusDistance(value); + } + get darkenOutOfFocus() { + return this._dofDarken; + } + set darkenOutOfFocus(value) { + this.setDarkenOutOfFocus(value); + } + get blurNoise() { + return this._blurNoise; + } + set blurNoise(value) { + this._blurNoise = value; + } + get pentagonBokeh() { + return this._pentagonBokehIsEnabled; + } + set pentagonBokeh(value) { + if (value) { + this.enablePentagonBokeh(); + } else { + this.disablePentagonBokeh(); + } + } + get highlightsGain() { + return this._highlightsGain; + } + set highlightsGain(value) { + this.setHighlightsGain(value); + } + get highlightsThreshold() { + return this._highlightsThreshold; + } + set highlightsThreshold(value) { + this.setHighlightsThreshold(value); + } + setEdgeBlur(amount) { + this._edgeBlur = amount; + } + disableEdgeBlur() { + this._edgeBlur = 0; + } + setGrainAmount(amount) { + this._grainAmount = amount; + } + disableGrain() { + this._grainAmount = 0; + } + setChromaticAberration(amount) { + this._chromaticAberration = amount; + } + disableChromaticAberration() { + this._chromaticAberration = 0; + } + setEdgeDistortion(amount) { + this._distortion = amount; + } + disableEdgeDistortion() { + this._distortion = 0; + } + setFocusDistance(amount) { + this._dofDistance = amount; + } + disableDepthOfField() { + this._dofDistance = -1; + } + setAperture(amount) { + this._dofAperture = amount; + } + setDarkenOutOfFocus(amount) { + this._dofDarken = amount; + } + enablePentagonBokeh() { + this._highlightsPostProcess.updateEffect("#define PENTAGON\n"); + this._pentagonBokehIsEnabled = true; + } + disablePentagonBokeh() { + this._pentagonBokehIsEnabled = false; + this._highlightsPostProcess.updateEffect(); + } + enableNoiseBlur() { + this._blurNoise = true; + } + disableNoiseBlur() { + this._blurNoise = false; + } + setHighlightsGain(amount) { + this._highlightsGain = amount; + } + setHighlightsThreshold(amount) { + if (this._highlightsGain === -1) { + this._highlightsGain = 1; + } + this._highlightsThreshold = amount; + } + disableHighlights() { + this._highlightsGain = -1; + } + dispose(disableDepthRender = false) { + this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras); + this._chromaticAberrationPostProcess = null; + this._highlightsPostProcess = null; + this._depthOfFieldPostProcess = null; + this._grainTexture.dispose(); + if (disableDepthRender) { + this._scene.disableDepthRenderer(); + } + } + _createChromaticAberrationPostProcess(ratio) { + this._chromaticAberrationPostProcess = new PostProcess("LensChromaticAberration", "chromaticAberration", ["chromatic_aberration", "screen_width", "screen_height", "direction", "radialIntensity", "centerPosition"], [], ratio, null, Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false); + this._chromaticAberrationPostProcess.onApply = (effect14) => { + effect14.setFloat("chromatic_aberration", this._chromaticAberration); + effect14.setFloat("screen_width", this._scene.getEngine().getRenderWidth()); + effect14.setFloat("screen_height", this._scene.getEngine().getRenderHeight()); + effect14.setFloat("radialIntensity", 1); + effect14.setFloat2("direction", 17, 17); + effect14.setFloat2("centerPosition", 0.5, 0.5); + }; + } + _createHighlightsPostProcess(ratio) { + this._highlightsPostProcess = new PostProcess("LensHighlights", "lensHighlights", ["gain", "threshold", "screen_width", "screen_height"], [], ratio, null, Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, this._dofPentagon ? "#define PENTAGON\n" : ""); + this._highlightsPostProcess.externalTextureSamplerBinding = true; + this._highlightsPostProcess.onApply = (effect14) => { + effect14.setFloat("gain", this._highlightsGain); + effect14.setFloat("threshold", this._highlightsThreshold); + effect14.setTextureFromPostProcess("textureSampler", this._chromaticAberrationPostProcess); + effect14.setFloat("screen_width", this._scene.getEngine().getRenderWidth()); + effect14.setFloat("screen_height", this._scene.getEngine().getRenderHeight()); + }; + } + _createDepthOfFieldPostProcess(ratio) { + this._depthOfFieldPostProcess = new PostProcess("LensDepthOfField", "depthOfField", [ + "grain_amount", + "blur_noise", + "screen_width", + "screen_height", + "distortion", + "dof_enabled", + "screen_distance", + "aperture", + "darken", + "edge_blur", + "highlights", + "near", + "far" + ], ["depthSampler", "grainSampler", "highlightsSampler"], ratio, null, Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false); + this._depthOfFieldPostProcess.externalTextureSamplerBinding = true; + this._depthOfFieldPostProcess.onApply = (effect14) => { + effect14.setTexture("depthSampler", this._depthTexture); + effect14.setTexture("grainSampler", this._grainTexture); + effect14.setTextureFromPostProcess("textureSampler", this._highlightsPostProcess); + effect14.setTextureFromPostProcess("highlightsSampler", this._depthOfFieldPostProcess); + effect14.setFloat("grain_amount", this._grainAmount); + effect14.setBool("blur_noise", this._blurNoise); + effect14.setFloat("screen_width", this._scene.getEngine().getRenderWidth()); + effect14.setFloat("screen_height", this._scene.getEngine().getRenderHeight()); + effect14.setFloat("distortion", this._distortion); + effect14.setBool("dof_enabled", this._dofDistance !== -1); + effect14.setFloat("screen_distance", 1 / (0.1 - 1 / this._dofDistance)); + effect14.setFloat("aperture", this._dofAperture); + effect14.setFloat("darken", this._dofDarken); + effect14.setFloat("edge_blur", this._edgeBlur); + effect14.setBool("highlights", this._highlightsGain !== -1); + if (this._scene.activeCamera) { + effect14.setFloat("near", this._scene.activeCamera.minZ); + effect14.setFloat("far", this._scene.activeCamera.maxZ); + } + }; + } + _createGrainTexture() { + const size = 512; + const data = new Uint8Array(size * size * 4); + for (let index = 0;index < data.length; ) { + const value = Math.floor(Scalar.RandomRange(0.42, 0.58) * 255); + data[index++] = value; + data[index++] = value; + data[index++] = value; + data[index++] = 255; + } + const texture61 = RawTexture.CreateRGBATexture(data, size, size, this._scene, false, false, 2); + texture61.name = "LensNoiseTexture"; + texture61.wrapU = Texture.WRAP_ADDRESSMODE; + texture61.wrapV = Texture.WRAP_ADDRESSMODE; + this._grainTexture = texture61; + } +} +var init_lensRenderingPipeline = __esm(() => { + init_texture(); + init_postProcess(); + init_postProcessRenderPipeline(); + init_postProcessRenderEffect(); + init_rawTexture(); + init_postProcessRenderPipelineManagerSceneComponent(); + init_chromaticAberration_fragment(); + init_lensHighlights_fragment(); + init_depthOfField_fragment(); + init_math_scalar(); +}); + // node_modules/@babylonjs/core/Rendering/ssao2Configuration.js class SSAO2Configuration { constructor() { @@ -155744,10 +175299,15 @@ class SSAO2Configuration { this.texturesRequired = [6, 5]; } } +var init_ssao2Configuration = __esm(() => { +}); // node_modules/@babylonjs/core/Shaders/ssao2.fragment.js -var name219 = "ssao2PixelShader"; -var shader219 = `precision highp float;uniform sampler2D textureSampler;varying vec2 vUV; +var name220, shader219; +var init_ssao2_fragment = __esm(() => { + init_shaderStore(); + name220 = "ssao2PixelShader"; + shader219 = `precision highp float;uniform sampler2D textureSampler;varying vec2 vUV; #ifdef SSAO float scales[16]=float[16]( 0.1, @@ -155803,11 +175363,15 @@ result/=weightSum; gl_FragColor.rgb=vec3(result);gl_FragColor.a=1.0;} #endif `; -ShaderStore.ShadersStore[name219] = shader219; + ShaderStore.ShadersStore[name220] = shader219; +}); // node_modules/@babylonjs/core/Shaders/ssaoCombine.fragment.js -var name220 = "ssaoCombinePixelShader"; -var shader220 = `uniform sampler2D textureSampler;uniform sampler2D originalColor;uniform vec4 viewport;varying vec2 vUV; +var name221, shader220; +var init_ssaoCombine_fragment = __esm(() => { + init_shaderStore(); + name221 = "ssaoCombinePixelShader"; + shader220 = `uniform sampler2D textureSampler;uniform sampler2D originalColor;uniform vec4 viewport;varying vec2 vUV; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) { #define CUSTOM_FRAGMENT_MAIN_BEGIN @@ -155815,7 +175379,8 @@ vec4 ssaoColor=texture2D(textureSampler,viewport.xy+vUV*viewport.zw);vec4 sceneC #define CUSTOM_FRAGMENT_MAIN_END } `; -ShaderStore.ShadersStore[name220] = shader220; + ShaderStore.ShadersStore[name221] = shader220; +}); // node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js class SSAO2RenderingPipeline extends PostProcessRenderPipeline { @@ -155886,9 +175451,9 @@ class SSAO2RenderingPipeline extends PostProcessRenderPipeline { get scene() { return this._scene; } - constructor(name221, scene26, ratio, cameras, forceGeometryBuffer = false, textureType = 0) { + constructor(name222, scene26, ratio, cameras, forceGeometryBuffer = false, textureType = 0) { var _a, _b; - super(scene26.getEngine(), name221); + super(scene26.getEngine(), name222); this.SSAOOriginalSceneColorEffect = "SSAOOriginalSceneColorEffect"; this.SSAORenderEffect = "SSAORenderEffect"; this.SSAOBlurHRenderEffect = "SSAOBlurHRenderEffect"; @@ -155953,7 +175518,7 @@ class SSAO2RenderingPipeline extends PostProcessRenderPipeline { }, true)); scene26.postProcessRenderPipelineManager.addPipeline(this); if (cameras) { - scene26.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name221, cameras); + scene26.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name222, cameras); } } getClassName() { @@ -155982,14 +175547,14 @@ class SSAO2RenderingPipeline extends PostProcessRenderPipeline { return disabled ? ["textureSampler"] : ["textureSampler", "depthSampler"]; } _getDefinesForBlur(bilateral, disabled) { - let define = "#define BLUR\n"; + let define2 = "#define BLUR\n"; if (disabled) { - define += "#define BLUR_BYPASS\n"; + define2 += "#define BLUR_BYPASS\n"; } if (!bilateral) { - define += "#define BLUR_LEGACY\n"; + define2 += "#define BLUR_LEGACY\n"; } - return { h: define + "#define BLUR_H\n", v: define }; + return { h: define2 + "#define BLUR_H\n", v: define2 }; } _createBlurPostProcess(ssaoRatio, blurRatio, textureType) { const defines = this._getDefinesForBlur(this.expensiveBlur, this.bypassBlur); @@ -155997,8 +175562,8 @@ class SSAO2RenderingPipeline extends PostProcessRenderPipeline { this._blurHPostProcess = this._createBlurFilter("BlurH", samplers, ssaoRatio, defines.h, textureType, true); this._blurVPostProcess = this._createBlurFilter("BlurV", samplers, blurRatio, defines.v, textureType, false); } - _createBlurFilter(name221, samplers, ratio, defines, textureType, horizontal) { - const blurFilter = new PostProcess(name221, "ssao2", ["outSize", "samples", "soften", "tolerance"], samplers, ratio, null, Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, defines, textureType); + _createBlurFilter(name222, samplers, ratio, defines, textureType, horizontal) { + const blurFilter = new PostProcess(name222, "ssao2", ["outSize", "samples", "soften", "tolerance"], samplers, ratio, null, Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, defines, textureType); blurFilter.onApply = (effect14) => { if (!this._scene.activeCamera) { return; @@ -156158,60 +175723,84 @@ class SSAO2RenderingPipeline extends PostProcessRenderPipeline { return SerializationHelper.Parse(() => new SSAO2RenderingPipeline(source._name, scene26, source._ratio, undefined, source._forceGeometryBuffer, source._textureType), source, scene26, rootUrl); } } -SSAO2RenderingPipeline.ORTHO_DEPTH_PROJECTION = [1, 0, 0, 0, 1, 0, 0, 0, 1]; -SSAO2RenderingPipeline.PERSPECTIVE_DEPTH_PROJECTION = [0, 0, 0, 0, 0, 0, 1, 1, 1]; -__decorate2([ - serialize() -], SSAO2RenderingPipeline.prototype, "totalStrength", undefined); -__decorate2([ - serialize() -], SSAO2RenderingPipeline.prototype, "maxZ", undefined); -__decorate2([ - serialize() -], SSAO2RenderingPipeline.prototype, "minZAspect", undefined); -__decorate2([ - serialize("epsilon") -], SSAO2RenderingPipeline.prototype, "_epsilon", undefined); -__decorate2([ - serialize("samples") -], SSAO2RenderingPipeline.prototype, "_samples", undefined); -__decorate2([ - serialize("textureSamples") -], SSAO2RenderingPipeline.prototype, "_textureSamples", undefined); -__decorate2([ - serialize() -], SSAO2RenderingPipeline.prototype, "_forceGeometryBuffer", undefined); -__decorate2([ - serialize() -], SSAO2RenderingPipeline.prototype, "_ratio", undefined); -__decorate2([ - serialize() -], SSAO2RenderingPipeline.prototype, "_textureType", undefined); -__decorate2([ - serialize() -], SSAO2RenderingPipeline.prototype, "radius", undefined); -__decorate2([ - serialize() -], SSAO2RenderingPipeline.prototype, "base", undefined); -__decorate2([ - serialize("bypassBlur") -], SSAO2RenderingPipeline.prototype, "_bypassBlur", undefined); -__decorate2([ - serialize("expensiveBlur") -], SSAO2RenderingPipeline.prototype, "_expensiveBlur", undefined); -__decorate2([ - serialize() -], SSAO2RenderingPipeline.prototype, "bilateralSamples", undefined); -__decorate2([ - serialize() -], SSAO2RenderingPipeline.prototype, "bilateralSoften", undefined); -__decorate2([ - serialize() -], SSAO2RenderingPipeline.prototype, "bilateralTolerance", undefined); -RegisterClass("BABYLON.SSAO2RenderingPipeline", SSAO2RenderingPipeline); +var init_ssao2RenderingPipeline = __esm(() => { + init_tslib_es62(); + init_logger(); + init_decorators(); + init_math_vector(); + init_camera(); + init_texture(); + init_postProcess(); + init_postProcessRenderPipeline(); + init_postProcessRenderEffect(); + init_passPostProcess(); + init_typeStore(); + init_engineStore(); + init_ssao2Configuration(); + init_math_scalar(); + init_rawTexture(); + init_postProcessRenderPipelineManagerSceneComponent(); + init_ssao2_fragment(); + init_ssaoCombine_fragment(); + SSAO2RenderingPipeline.ORTHO_DEPTH_PROJECTION = [1, 0, 0, 0, 1, 0, 0, 0, 1]; + SSAO2RenderingPipeline.PERSPECTIVE_DEPTH_PROJECTION = [0, 0, 0, 0, 0, 0, 1, 1, 1]; + __decorate2([ + serialize() + ], SSAO2RenderingPipeline.prototype, "totalStrength", undefined); + __decorate2([ + serialize() + ], SSAO2RenderingPipeline.prototype, "maxZ", undefined); + __decorate2([ + serialize() + ], SSAO2RenderingPipeline.prototype, "minZAspect", undefined); + __decorate2([ + serialize("epsilon") + ], SSAO2RenderingPipeline.prototype, "_epsilon", undefined); + __decorate2([ + serialize("samples") + ], SSAO2RenderingPipeline.prototype, "_samples", undefined); + __decorate2([ + serialize("textureSamples") + ], SSAO2RenderingPipeline.prototype, "_textureSamples", undefined); + __decorate2([ + serialize() + ], SSAO2RenderingPipeline.prototype, "_forceGeometryBuffer", undefined); + __decorate2([ + serialize() + ], SSAO2RenderingPipeline.prototype, "_ratio", undefined); + __decorate2([ + serialize() + ], SSAO2RenderingPipeline.prototype, "_textureType", undefined); + __decorate2([ + serialize() + ], SSAO2RenderingPipeline.prototype, "radius", undefined); + __decorate2([ + serialize() + ], SSAO2RenderingPipeline.prototype, "base", undefined); + __decorate2([ + serialize("bypassBlur") + ], SSAO2RenderingPipeline.prototype, "_bypassBlur", undefined); + __decorate2([ + serialize("expensiveBlur") + ], SSAO2RenderingPipeline.prototype, "_expensiveBlur", undefined); + __decorate2([ + serialize() + ], SSAO2RenderingPipeline.prototype, "bilateralSamples", undefined); + __decorate2([ + serialize() + ], SSAO2RenderingPipeline.prototype, "bilateralSoften", undefined); + __decorate2([ + serialize() + ], SSAO2RenderingPipeline.prototype, "bilateralTolerance", undefined); + RegisterClass("BABYLON.SSAO2RenderingPipeline", SSAO2RenderingPipeline); +}); + // node_modules/@babylonjs/core/Shaders/ssao.fragment.js -var name221 = "ssaoPixelShader"; -var shader221 = `uniform sampler2D textureSampler;varying vec2 vUV; +var name222, shader221; +var init_ssao_fragment = __esm(() => { + init_shaderStore(); + name222 = "ssaoPixelShader"; + shader221 = `uniform sampler2D textureSampler;varying vec2 vUV; #ifdef SSAO uniform sampler2D randomSampler;uniform float randTextureTiles;uniform float samplesFactor;uniform vec3 sampleSphere[SAMPLES];uniform float totalStrength;uniform float radius;uniform float area;uniform float fallOff;uniform float base;vec3 normalFromDepth(float depth,vec2 coords) {vec2 offset1=vec2(0.0,radius);vec2 offset2=vec2(radius,0.0);float depth1=texture2D(textureSampler,coords+offset1).r;float depth2=texture2D(textureSampler,coords+offset2).r;vec3 p1=vec3(offset1,depth1-depth);vec3 p2=vec3(offset2,depth2-depth);vec3 normal=cross(p1,p2);normal.z=-normal.z;return normalize(normal);} @@ -156221,15 +175810,16 @@ void main() float ao=1.0-totalStrength*occlusion*samplesFactor;float result=clamp(ao+base,0.0,1.0);gl_FragColor.r=result;gl_FragColor.g=result;gl_FragColor.b=result;gl_FragColor.a=1.0;} #endif `; -ShaderStore.ShadersStore[name221] = shader221; + ShaderStore.ShadersStore[name222] = shader221; +}); // node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js class SSAORenderingPipeline extends PostProcessRenderPipeline { get scene() { return this._scene; } - constructor(name222, scene26, ratio, cameras) { - super(scene26.getEngine(), name222); + constructor(name223, scene26, ratio, cameras) { + super(scene26.getEngine(), name223); this.SSAOOriginalSceneColorEffect = "SSAOOriginalSceneColorEffect"; this.SSAORenderEffect = "SSAORenderEffect"; this.SSAOBlurHRenderEffect = "SSAOBlurHRenderEffect"; @@ -156266,7 +175856,7 @@ class SSAORenderingPipeline extends PostProcessRenderPipeline { }, true)); scene26.postProcessRenderPipelineManager.addPipeline(this); if (cameras) { - scene26.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name222, cameras); + scene26.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name223, cameras); } } _attachCameras(cameras, unique) { @@ -156404,21 +175994,38 @@ class SSAORenderingPipeline extends PostProcessRenderPipeline { this._randomTexture = texture63; } } -__decorate2([ - serialize() -], SSAORenderingPipeline.prototype, "totalStrength", undefined); -__decorate2([ - serialize() -], SSAORenderingPipeline.prototype, "radius", undefined); -__decorate2([ - serialize() -], SSAORenderingPipeline.prototype, "area", undefined); -__decorate2([ - serialize() -], SSAORenderingPipeline.prototype, "fallOff", undefined); -__decorate2([ - serialize() -], SSAORenderingPipeline.prototype, "base", undefined); +var init_ssaoRenderingPipeline = __esm(() => { + init_tslib_es62(); + init_math_vector(); + init_texture(); + init_postProcess(); + init_postProcessRenderPipeline(); + init_postProcessRenderEffect(); + init_passPostProcess(); + init_blurPostProcess(); + init_decorators(); + init_rawTexture(); + init_math_scalar(); + init_postProcessRenderPipelineManagerSceneComponent(); + init_ssao_fragment(); + init_ssaoCombine_fragment(); + __decorate2([ + serialize() + ], SSAORenderingPipeline.prototype, "totalStrength", undefined); + __decorate2([ + serialize() + ], SSAORenderingPipeline.prototype, "radius", undefined); + __decorate2([ + serialize() + ], SSAORenderingPipeline.prototype, "area", undefined); + __decorate2([ + serialize() + ], SSAORenderingPipeline.prototype, "fallOff", undefined); + __decorate2([ + serialize() + ], SSAORenderingPipeline.prototype, "base", undefined); +}); + // node_modules/@babylonjs/core/Rendering/screenSpaceReflectionsConfiguration.js class ScreenSpaceReflectionsConfiguration { constructor() { @@ -156427,10 +176034,15 @@ class ScreenSpaceReflectionsConfiguration { this.texturesRequired = [6, 3, 1]; } } +var init_screenSpaceReflectionsConfiguration = __esm(() => { +}); // node_modules/@babylonjs/core/Shaders/screenSpaceReflection.fragment.js -var name222 = "screenSpaceReflectionPixelShader"; -var shader222 = `uniform sampler2D textureSampler; +var name223, shader222; +var init_screenSpaceReflection_fragment = __esm(() => { + init_shaderStore(); + name223 = "screenSpaceReflectionPixelShader"; + shader222 = `uniform sampler2D textureSampler; #ifdef SSR_SUPPORTED uniform sampler2D reflectivitySampler;uniform sampler2D normalSampler;uniform sampler2D positionSampler; #endif @@ -156487,7 +176099,8 @@ gl_FragColor=texture2D(textureSampler,vUV); #endif } `; -ShaderStore.ShadersStore[name222] = shader222; + ShaderStore.ShadersStore[name223] = shader222; +}); // node_modules/@babylonjs/core/PostProcesses/screenSpaceReflectionPostProcess.js class ScreenSpaceReflectionPostProcess extends PostProcess { @@ -156506,8 +176119,8 @@ class ScreenSpaceReflectionPostProcess extends PostProcess { getClassName() { return "ScreenSpaceReflectionPostProcess"; } - constructor(name223, scene26, options, camera30, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false, forceGeometryBuffer = false) { - super(name223, "screenSpaceReflection", ["projection", "view", "threshold", "reflectionSpecularFalloffExponent", "strength", "stepSize", "roughnessFactor"], ["textureSampler", "normalSampler", "positionSampler", "reflectivitySampler"], options, camera30, samplingMode, engine45, reusable, "#define SSR_SUPPORTED\n#define REFLECTION_SAMPLES 64\n#define SMOOTH_STEPS 5\n", textureType, undefined, null, blockCompilation); + constructor(name224, scene26, options, camera30, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false, forceGeometryBuffer = false) { + super(name224, "screenSpaceReflection", ["projection", "view", "threshold", "reflectionSpecularFalloffExponent", "strength", "stepSize", "roughnessFactor"], ["textureSampler", "normalSampler", "positionSampler", "reflectivitySampler"], options, camera30, samplingMode, engine45, reusable, "#define SSR_SUPPORTED\n#define REFLECTION_SAMPLES 64\n#define SMOOTH_STEPS 5\n", textureType, undefined, null, blockCompilation); this.threshold = 1.2; this.strength = 1; this.reflectionSpecularFalloffExponent = 3; @@ -156625,35 +176238,48 @@ class ScreenSpaceReflectionPostProcess extends PostProcess { }, parsedPostProcess, scene26, rootUrl); } } -__decorate2([ - serialize() -], ScreenSpaceReflectionPostProcess.prototype, "threshold", undefined); -__decorate2([ - serialize() -], ScreenSpaceReflectionPostProcess.prototype, "strength", undefined); -__decorate2([ - serialize() -], ScreenSpaceReflectionPostProcess.prototype, "reflectionSpecularFalloffExponent", undefined); -__decorate2([ - serialize() -], ScreenSpaceReflectionPostProcess.prototype, "step", undefined); -__decorate2([ - serialize() -], ScreenSpaceReflectionPostProcess.prototype, "roughnessFactor", undefined); -__decorate2([ - serialize() -], ScreenSpaceReflectionPostProcess.prototype, "enableSmoothReflections", null); -__decorate2([ - serialize() -], ScreenSpaceReflectionPostProcess.prototype, "reflectionSamples", null); -__decorate2([ - serialize() -], ScreenSpaceReflectionPostProcess.prototype, "smoothSteps", null); -RegisterClass("BABYLON.ScreenSpaceReflectionPostProcess", ScreenSpaceReflectionPostProcess); +var init_screenSpaceReflectionPostProcess = __esm(() => { + init_tslib_es62(); + init_postProcess(); + init_geometryBufferRenderer(); + init_decorators(); + init_screenSpaceReflectionsConfiguration(); + init_screenSpaceReflection_fragment(); + init_typeStore(); + __decorate2([ + serialize() + ], ScreenSpaceReflectionPostProcess.prototype, "threshold", undefined); + __decorate2([ + serialize() + ], ScreenSpaceReflectionPostProcess.prototype, "strength", undefined); + __decorate2([ + serialize() + ], ScreenSpaceReflectionPostProcess.prototype, "reflectionSpecularFalloffExponent", undefined); + __decorate2([ + serialize() + ], ScreenSpaceReflectionPostProcess.prototype, "step", undefined); + __decorate2([ + serialize() + ], ScreenSpaceReflectionPostProcess.prototype, "roughnessFactor", undefined); + __decorate2([ + serialize() + ], ScreenSpaceReflectionPostProcess.prototype, "enableSmoothReflections", null); + __decorate2([ + serialize() + ], ScreenSpaceReflectionPostProcess.prototype, "reflectionSamples", null); + __decorate2([ + serialize() + ], ScreenSpaceReflectionPostProcess.prototype, "smoothSteps", null); + RegisterClass("BABYLON.ScreenSpaceReflectionPostProcess", ScreenSpaceReflectionPostProcess); +}); // node_modules/@babylonjs/core/Shaders/standard.fragment.js -var name223 = "standardPixelShader"; -var shader223 = `uniform sampler2D textureSampler;varying vec2 vUV; +var name224, shader223; +var init_standard_fragment = __esm(() => { + init_shaderStore(); + init_packingFunctions(); + name224 = "standardPixelShader"; + shader223 = `uniform sampler2D textureSampler;varying vec2 vUV; #define CUSTOM_FRAGMENT_DEFINITIONS #if defined(PASS_POST_PROCESS) void main(void) @@ -156775,7 +176401,8 @@ break;vec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);result+=texture gl_FragColor=result/float(nSamples);} #endif `; -ShaderStore.ShadersStore[name223] = shader223; + ShaderStore.ShadersStore[name224] = shader223; +}); // node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js class StandardRenderingPipeline extends PostProcessRenderPipeline { @@ -156937,8 +176564,8 @@ class StandardRenderingPipeline extends PostProcessRenderPipeline { this._samples = sampleCount; this._buildPipeline(); } - constructor(name224, scene26, ratio, originalPostProcess = null, cameras) { - super(scene26.getEngine(), name224); + constructor(name225, scene26, ratio, originalPostProcess = null, cameras) { + super(scene26.getEngine(), name225); this.downSampleX4PostProcess = null; this.brightPassPostProcess = null; this.blurHPostProcesses = []; @@ -157512,116 +177139,135 @@ class StandardRenderingPipeline extends PostProcessRenderPipeline { return p; } } -StandardRenderingPipeline.LuminanceSteps = 6; -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "brightThreshold", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "blurWidth", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "horizontalBlur", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "exposure", null); -__decorate2([ - serializeAsTexture("lensTexture") -], StandardRenderingPipeline.prototype, "lensTexture", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "volumetricLightCoefficient", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "volumetricLightPower", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "volumetricLightBlurScale", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "hdrMinimumLuminance", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "hdrDecreaseRate", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "hdrIncreaseRate", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "hdrAutoExposure", null); -__decorate2([ - serializeAsTexture("lensColorTexture") -], StandardRenderingPipeline.prototype, "lensColorTexture", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "lensFlareStrength", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "lensFlareGhostDispersal", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "lensFlareHaloWidth", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "lensFlareDistortionStrength", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "lensFlareBlurWidth", undefined); -__decorate2([ - serializeAsTexture("lensStarTexture") -], StandardRenderingPipeline.prototype, "lensStarTexture", undefined); -__decorate2([ - serializeAsTexture("lensFlareDirtTexture") -], StandardRenderingPipeline.prototype, "lensFlareDirtTexture", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "depthOfFieldDistance", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "depthOfFieldBlurWidth", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "motionStrength", null); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "objectBasedMotionBlur", null); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "_ratio", undefined); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "BloomEnabled", null); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "DepthOfFieldEnabled", null); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "LensFlareEnabled", null); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "HDREnabled", null); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "VLSEnabled", null); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "MotionBlurEnabled", null); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "fxaaEnabled", null); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "screenSpaceReflectionsEnabled", null); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "volumetricLightStepsCount", null); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "motionBlurSamples", null); -__decorate2([ - serialize() -], StandardRenderingPipeline.prototype, "samples", null); -RegisterClass("BABYLON.StandardRenderingPipeline", StandardRenderingPipeline); +var init_standardRenderingPipeline = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_logger(); + init_math_vector(); + init_math_scalar(); + init_texture(); + init_postProcess(); + init_postProcessRenderPipeline(); + init_postProcessRenderEffect(); + init_blurPostProcess(); + init_fxaaPostProcess(); + init_typeStore(); + init_motionBlurPostProcess(); + init_screenSpaceReflectionPostProcess(); + init_postProcessRenderPipelineManagerSceneComponent(); + init_standard_fragment(); + StandardRenderingPipeline.LuminanceSteps = 6; + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "brightThreshold", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "blurWidth", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "horizontalBlur", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "exposure", null); + __decorate2([ + serializeAsTexture("lensTexture") + ], StandardRenderingPipeline.prototype, "lensTexture", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "volumetricLightCoefficient", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "volumetricLightPower", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "volumetricLightBlurScale", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "hdrMinimumLuminance", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "hdrDecreaseRate", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "hdrIncreaseRate", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "hdrAutoExposure", null); + __decorate2([ + serializeAsTexture("lensColorTexture") + ], StandardRenderingPipeline.prototype, "lensColorTexture", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "lensFlareStrength", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "lensFlareGhostDispersal", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "lensFlareHaloWidth", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "lensFlareDistortionStrength", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "lensFlareBlurWidth", undefined); + __decorate2([ + serializeAsTexture("lensStarTexture") + ], StandardRenderingPipeline.prototype, "lensStarTexture", undefined); + __decorate2([ + serializeAsTexture("lensFlareDirtTexture") + ], StandardRenderingPipeline.prototype, "lensFlareDirtTexture", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "depthOfFieldDistance", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "depthOfFieldBlurWidth", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "motionStrength", null); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "objectBasedMotionBlur", null); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "_ratio", undefined); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "BloomEnabled", null); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "DepthOfFieldEnabled", null); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "LensFlareEnabled", null); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "HDREnabled", null); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "VLSEnabled", null); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "MotionBlurEnabled", null); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "fxaaEnabled", null); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "screenSpaceReflectionsEnabled", null); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "volumetricLightStepsCount", null); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "motionBlurSamples", null); + __decorate2([ + serialize() + ], StandardRenderingPipeline.prototype, "samples", null); + RegisterClass("BABYLON.StandardRenderingPipeline", StandardRenderingPipeline); +}); + // node_modules/@babylonjs/core/Rendering/screenSpaceReflections2Configuration.js class ScreenSpaceReflections2Configuration { constructor() { @@ -157630,10 +177276,15 @@ class ScreenSpaceReflections2Configuration { this.texturesRequired = [6, 3, 5]; } } +var init_screenSpaceReflections2Configuration = __esm(() => { +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/screenSpaceRayTrace.js -var name224 = "screenSpaceRayTrace"; -var shader224 = `float distanceSquared(vec2 a,vec2 b) { a-=b; return dot(a,a); } +var name225, shader224; +var init_screenSpaceRayTrace = __esm(() => { + init_shaderStore(); + name225 = "screenSpaceRayTrace"; + shader224 = `float distanceSquared(vec2 a,vec2 b) { a-=b; return dot(a,a); } /** param csOrigin Camera-space ray origin,which must be within the view volume and must have z>0.01 and project within the valid screen rectangle @@ -157745,11 +177396,18 @@ ndc.z=projection[2].z+projection[3].z/depth; #endif ndc.w=1.0;vec4 eyePos=invProjectionMatrix*ndc;eyePos.xyz/=eyePos.w;return eyePos.xyz;} `; -ShaderStore.IncludesShadersStore[name224] = shader224; + ShaderStore.IncludesShadersStore[name225] = shader224; +}); // node_modules/@babylonjs/core/Shaders/screenSpaceReflection2.fragment.js -var name225 = "screenSpaceReflection2PixelShader"; -var shader225 = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) +var name226, shader225; +var init_screenSpaceReflection2_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + init_pbrBRDFFunctions(); + init_screenSpaceRayTrace(); + name226 = "screenSpaceReflection2PixelShader"; + shader225 = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) #define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod) #define TEXTURECUBEFUNC(s,c,lod) textureLod(s,c,lod) #else @@ -157896,11 +177554,15 @@ gl_FragColor=TEXTUREFUNC(textureSampler,vUV,0.0); #endif } `; -ShaderStore.ShadersStore[name225] = shader225; + ShaderStore.ShadersStore[name226] = shader225; +}); // node_modules/@babylonjs/core/Shaders/screenSpaceReflection2Blur.fragment.js -var name226 = "screenSpaceReflection2BlurPixelShader"; -var shader226 = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) +var name227, shader226; +var init_screenSpaceReflection2Blur_fragment = __esm(() => { + init_shaderStore(); + name227 = "screenSpaceReflection2BlurPixelShader"; + shader226 = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) #define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod) #else #define TEXTUREFUNC(s,c,bias) texture2D(s,c,bias) @@ -157912,11 +177574,18 @@ void main() float blurRadius=colorFull.a*255.0; vec2 stepSize=texelOffsetScale.xy*blurRadius;vec4 accumulator=TEXTUREFUNC(textureSampler,vUV,0.0)*0.214607;float denominator=0.214607;processSample(vUV,1.0,stepSize,accumulator,denominator);processSample(vUV,1.0*0.2,stepSize,accumulator,denominator);processSample(vUV,1.0*0.4,stepSize,accumulator,denominator);processSample(vUV,1.0*0.6,stepSize,accumulator,denominator);processSample(vUV,1.0*0.8,stepSize,accumulator,denominator);processSample(vUV,1.0*1.2,stepSize,accumulator,denominator);processSample(vUV,1.0*1.4,stepSize,accumulator,denominator);processSample(vUV,1.0*1.6,stepSize,accumulator,denominator);processSample(vUV,1.0*1.8,stepSize,accumulator,denominator);processSample(vUV,1.0*2.0,stepSize,accumulator,denominator);processSample(vUV,-1.0,stepSize,accumulator,denominator);processSample(vUV,-1.0*0.2,stepSize,accumulator,denominator);processSample(vUV,-1.0*0.4,stepSize,accumulator,denominator);processSample(vUV,-1.0*0.6,stepSize,accumulator,denominator);processSample(vUV,-1.0*0.8,stepSize,accumulator,denominator);processSample(vUV,-1.0*1.2,stepSize,accumulator,denominator);processSample(vUV,-1.0*1.4,stepSize,accumulator,denominator);processSample(vUV,-1.0*1.6,stepSize,accumulator,denominator);processSample(vUV,-1.0*1.8,stepSize,accumulator,denominator);processSample(vUV,-1.0*2.0,stepSize,accumulator,denominator);gl_FragColor=vec4(accumulator.rgb/denominator,colorFull.a);} `; -ShaderStore.ShadersStore[name226] = shader226; + ShaderStore.ShadersStore[name227] = shader226; +}); // node_modules/@babylonjs/core/Shaders/screenSpaceReflection2BlurCombiner.fragment.js -var name227 = "screenSpaceReflection2BlurCombinerPixelShader"; -var shader227 = `uniform sampler2D textureSampler; +var name228, shader227; +var init_screenSpaceReflection2BlurCombiner_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + init_pbrBRDFFunctions(); + init_screenSpaceRayTrace(); + name228 = "screenSpaceReflection2BlurCombinerPixelShader"; + shader227 = `uniform sampler2D textureSampler; uniform sampler2D mainSampler;uniform sampler2D reflectivitySampler;uniform float strength;uniform float reflectionSpecularFalloffExponent;uniform float reflectivityThreshold;varying vec2 vUV; #include #ifdef SSR_BLEND_WITH_FRESNEL @@ -157949,12 +177618,10 @@ gl_FragColor=vec4(finalColor,color.a); #endif } `; -ShaderStore.ShadersStore[name227] = shader227; + ShaderStore.ShadersStore[name228] = shader227; +}); // node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js -var trs = Matrix.Compose(new Vector3(0.5, 0.5, 0.5), Quaternion.Identity(), new Vector3(0.5, 0.5, 0.5)); -var trsWebGPU = Matrix.Compose(new Vector3(0.5, 0.5, 1), Quaternion.Identity(), new Vector3(0.5, 0.5, 0)); - class SSRRenderingPipeline extends PostProcessRenderPipeline { set samples(sampleCount) { if (this._samples === sampleCount) { @@ -158220,8 +177887,8 @@ class SSRRenderingPipeline extends PostProcessRenderPipeline { const caps = this._scene.getEngine().getCaps(); return caps.drawBuffersExtension && caps.texelFetch; } - constructor(name228, scene26, cameras, forceGeometryBuffer = false, textureType = 0) { - super(scene26.getEngine(), name228); + constructor(name229, scene26, cameras, forceGeometryBuffer = false, textureType = 0) { + super(scene26.getEngine(), name229); this.SSRRenderEffect = "SSRRenderEffect"; this.SSRBlurRenderEffect = "SSRBlurRenderEffect"; this.SSRCombineRenderEffect = "SSRCombineRenderEffect"; @@ -158655,103 +178322,145 @@ class SSRRenderingPipeline extends PostProcessRenderPipeline { return SerializationHelper.Parse(() => new SSRRenderingPipeline(source._name, scene26, source._ratio), source, scene26, rootUrl); } } -__decorate2([ - serialize() -], SSRRenderingPipeline.prototype, "samples", null); -__decorate2([ - serialize() -], SSRRenderingPipeline.prototype, "maxDistance", undefined); -__decorate2([ - serialize() -], SSRRenderingPipeline.prototype, "step", undefined); -__decorate2([ - serialize() -], SSRRenderingPipeline.prototype, "thickness", undefined); -__decorate2([ - serialize() -], SSRRenderingPipeline.prototype, "strength", undefined); -__decorate2([ - serialize() -], SSRRenderingPipeline.prototype, "reflectionSpecularFalloffExponent", undefined); -__decorate2([ - serialize() -], SSRRenderingPipeline.prototype, "maxSteps", undefined); -__decorate2([ - serialize() -], SSRRenderingPipeline.prototype, "roughnessFactor", undefined); -__decorate2([ - serialize() -], SSRRenderingPipeline.prototype, "selfCollisionNumSkip", undefined); -__decorate2([ - serialize() -], SSRRenderingPipeline.prototype, "_reflectivityThreshold", undefined); -__decorate2([ - serialize("_ssrDownsample") -], SSRRenderingPipeline.prototype, "_ssrDownsample", undefined); -__decorate2([ - serialize() -], SSRRenderingPipeline.prototype, "ssrDownsample", null); -__decorate2([ - serialize("blurDispersionStrength") -], SSRRenderingPipeline.prototype, "_blurDispersionStrength", undefined); -__decorate2([ - serialize("blurDownsample") -], SSRRenderingPipeline.prototype, "_blurDownsample", undefined); -__decorate2([ - serialize("enableSmoothReflections") -], SSRRenderingPipeline.prototype, "_enableSmoothReflections", undefined); -__decorate2([ - serialize("environmentTexture") -], SSRRenderingPipeline.prototype, "_environmentTexture", undefined); -__decorate2([ - serialize("environmentTextureIsProbe") -], SSRRenderingPipeline.prototype, "_environmentTextureIsProbe", undefined); -__decorate2([ - serialize("attenuateScreenBorders") -], SSRRenderingPipeline.prototype, "_attenuateScreenBorders", undefined); -__decorate2([ - serialize("attenuateIntersectionDistance") -], SSRRenderingPipeline.prototype, "_attenuateIntersectionDistance", undefined); -__decorate2([ - serialize("attenuateIntersectionIterations") -], SSRRenderingPipeline.prototype, "_attenuateIntersectionIterations", undefined); -__decorate2([ - serialize("attenuateFacingCamera") -], SSRRenderingPipeline.prototype, "_attenuateFacingCamera", undefined); -__decorate2([ - serialize("attenuateBackfaceReflection") -], SSRRenderingPipeline.prototype, "_attenuateBackfaceReflection", undefined); -__decorate2([ - serialize("clipToFrustum") -], SSRRenderingPipeline.prototype, "_clipToFrustum", undefined); -__decorate2([ - serialize("useFresnel") -], SSRRenderingPipeline.prototype, "_useFresnel", undefined); -__decorate2([ - serialize("enableAutomaticThicknessComputation") -], SSRRenderingPipeline.prototype, "_enableAutomaticThicknessComputation", undefined); -__decorate2([ - serialize("backfaceDepthTextureDownsample") -], SSRRenderingPipeline.prototype, "_backfaceDepthTextureDownsample", undefined); -__decorate2([ - serialize("backfaceForceDepthWriteTransparentMeshes") -], SSRRenderingPipeline.prototype, "_backfaceForceDepthWriteTransparentMeshes", undefined); -__decorate2([ - serialize("isEnabled") -], SSRRenderingPipeline.prototype, "_isEnabled", undefined); -__decorate2([ - serialize("inputTextureColorIsInGammaSpace") -], SSRRenderingPipeline.prototype, "_inputTextureColorIsInGammaSpace", undefined); -__decorate2([ - serialize("generateOutputInGammaSpace") -], SSRRenderingPipeline.prototype, "_generateOutputInGammaSpace", undefined); -__decorate2([ - serialize("debug") -], SSRRenderingPipeline.prototype, "_debug", undefined); -RegisterClass("BABYLON.SSRRenderingPipeline", SSRRenderingPipeline); +var trs, trsWebGPU; +var init_ssrRenderingPipeline = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_postProcess(); + init_postProcessRenderPipeline(); + init_postProcessRenderEffect(); + init_typeStore(); + init_screenSpaceReflections2Configuration(); + init_geometryBufferRenderer(); + init_depthRenderer(); + init_postProcessRenderPipelineManagerSceneComponent(); + init_screenSpaceReflection2_fragment(); + init_screenSpaceReflection2Blur_fragment(); + init_screenSpaceReflection2BlurCombiner_fragment(); + trs = Matrix.Compose(new Vector3(0.5, 0.5, 0.5), Quaternion.Identity(), new Vector3(0.5, 0.5, 0.5)); + trsWebGPU = Matrix.Compose(new Vector3(0.5, 0.5, 1), Quaternion.Identity(), new Vector3(0.5, 0.5, 0)); + __decorate2([ + serialize() + ], SSRRenderingPipeline.prototype, "samples", null); + __decorate2([ + serialize() + ], SSRRenderingPipeline.prototype, "maxDistance", undefined); + __decorate2([ + serialize() + ], SSRRenderingPipeline.prototype, "step", undefined); + __decorate2([ + serialize() + ], SSRRenderingPipeline.prototype, "thickness", undefined); + __decorate2([ + serialize() + ], SSRRenderingPipeline.prototype, "strength", undefined); + __decorate2([ + serialize() + ], SSRRenderingPipeline.prototype, "reflectionSpecularFalloffExponent", undefined); + __decorate2([ + serialize() + ], SSRRenderingPipeline.prototype, "maxSteps", undefined); + __decorate2([ + serialize() + ], SSRRenderingPipeline.prototype, "roughnessFactor", undefined); + __decorate2([ + serialize() + ], SSRRenderingPipeline.prototype, "selfCollisionNumSkip", undefined); + __decorate2([ + serialize() + ], SSRRenderingPipeline.prototype, "_reflectivityThreshold", undefined); + __decorate2([ + serialize("_ssrDownsample") + ], SSRRenderingPipeline.prototype, "_ssrDownsample", undefined); + __decorate2([ + serialize() + ], SSRRenderingPipeline.prototype, "ssrDownsample", null); + __decorate2([ + serialize("blurDispersionStrength") + ], SSRRenderingPipeline.prototype, "_blurDispersionStrength", undefined); + __decorate2([ + serialize("blurDownsample") + ], SSRRenderingPipeline.prototype, "_blurDownsample", undefined); + __decorate2([ + serialize("enableSmoothReflections") + ], SSRRenderingPipeline.prototype, "_enableSmoothReflections", undefined); + __decorate2([ + serialize("environmentTexture") + ], SSRRenderingPipeline.prototype, "_environmentTexture", undefined); + __decorate2([ + serialize("environmentTextureIsProbe") + ], SSRRenderingPipeline.prototype, "_environmentTextureIsProbe", undefined); + __decorate2([ + serialize("attenuateScreenBorders") + ], SSRRenderingPipeline.prototype, "_attenuateScreenBorders", undefined); + __decorate2([ + serialize("attenuateIntersectionDistance") + ], SSRRenderingPipeline.prototype, "_attenuateIntersectionDistance", undefined); + __decorate2([ + serialize("attenuateIntersectionIterations") + ], SSRRenderingPipeline.prototype, "_attenuateIntersectionIterations", undefined); + __decorate2([ + serialize("attenuateFacingCamera") + ], SSRRenderingPipeline.prototype, "_attenuateFacingCamera", undefined); + __decorate2([ + serialize("attenuateBackfaceReflection") + ], SSRRenderingPipeline.prototype, "_attenuateBackfaceReflection", undefined); + __decorate2([ + serialize("clipToFrustum") + ], SSRRenderingPipeline.prototype, "_clipToFrustum", undefined); + __decorate2([ + serialize("useFresnel") + ], SSRRenderingPipeline.prototype, "_useFresnel", undefined); + __decorate2([ + serialize("enableAutomaticThicknessComputation") + ], SSRRenderingPipeline.prototype, "_enableAutomaticThicknessComputation", undefined); + __decorate2([ + serialize("backfaceDepthTextureDownsample") + ], SSRRenderingPipeline.prototype, "_backfaceDepthTextureDownsample", undefined); + __decorate2([ + serialize("backfaceForceDepthWriteTransparentMeshes") + ], SSRRenderingPipeline.prototype, "_backfaceForceDepthWriteTransparentMeshes", undefined); + __decorate2([ + serialize("isEnabled") + ], SSRRenderingPipeline.prototype, "_isEnabled", undefined); + __decorate2([ + serialize("inputTextureColorIsInGammaSpace") + ], SSRRenderingPipeline.prototype, "_inputTextureColorIsInGammaSpace", undefined); + __decorate2([ + serialize("generateOutputInGammaSpace") + ], SSRRenderingPipeline.prototype, "_generateOutputInGammaSpace", undefined); + __decorate2([ + serialize("debug") + ], SSRRenderingPipeline.prototype, "_debug", undefined); + RegisterClass("BABYLON.SSRRenderingPipeline", SSRRenderingPipeline); +}); + +// node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/index.js +var init_Pipelines = __esm(() => { + init_defaultRenderingPipeline(); + init_lensRenderingPipeline(); + init_ssao2RenderingPipeline(); + init_ssaoRenderingPipeline(); + init_standardRenderingPipeline(); + init_ssrRenderingPipeline(); +}); + +// node_modules/@babylonjs/core/PostProcesses/RenderPipeline/index.js +var init_RenderPipeline = __esm(() => { + init_Pipelines(); + init_postProcessRenderEffect(); + init_postProcessRenderPipeline(); + init_postProcessRenderPipelineManager(); + init_postProcessRenderPipelineManagerSceneComponent(); +}); + // node_modules/@babylonjs/core/Shaders/tonemap.fragment.js -var name228 = "tonemapPixelShader"; -var shader228 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform float _ExposureAdjustment; +var name229, shader228; +var init_tonemap_fragment = __esm(() => { + init_shaderStore(); + name229 = "tonemapPixelShader"; + shader228 = `varying vec2 vUV;uniform sampler2D textureSampler;uniform float _ExposureAdjustment; #if defined(HABLE_TONEMAPPING) const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;const float W=11.2; #endif @@ -158772,19 +178481,52 @@ colour*=_ExposureAdjustment;vec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);vec3 retC colour= vec3(1.0,1.0,1.0)-exp2(-_ExposureAdjustment*colour); #endif gl_FragColor=vec4(colour.rgb,1.0);}`; -ShaderStore.ShadersStore[name228] = shader228; + ShaderStore.ShadersStore[name229] = shader228; +}); // node_modules/@babylonjs/core/PostProcesses/tonemapPostProcess.js +class TonemapPostProcess extends PostProcess { + getClassName() { + return "TonemapPostProcess"; + } + constructor(name230, _operator, exposureAdjustment, camera30, samplingMode = 2, engine45, textureFormat = 0, reusable) { + super(name230, "tonemap", ["_ExposureAdjustment"], null, 1, camera30, samplingMode, engine45, reusable, null, textureFormat); + this._operator = _operator; + this.exposureAdjustment = exposureAdjustment; + let defines = "#define "; + if (this._operator === TonemappingOperator.Hable) { + defines += "HABLE_TONEMAPPING"; + } else if (this._operator === TonemappingOperator.Reinhard) { + defines += "REINHARD_TONEMAPPING"; + } else if (this._operator === TonemappingOperator.HejiDawson) { + defines += "OPTIMIZED_HEJIDAWSON_TONEMAPPING"; + } else if (this._operator === TonemappingOperator.Photographic) { + defines += "PHOTOGRAPHIC_TONEMAPPING"; + } + this.updateEffect(defines); + this.onApply = (effect14) => { + effect14.setFloat("_ExposureAdjustment", this.exposureAdjustment); + }; + } +} var TonemappingOperator; -(function(TonemappingOperator2) { - TonemappingOperator2[TonemappingOperator2["Hable"] = 0] = "Hable"; - TonemappingOperator2[TonemappingOperator2["Reinhard"] = 1] = "Reinhard"; - TonemappingOperator2[TonemappingOperator2["HejiDawson"] = 2] = "HejiDawson"; - TonemappingOperator2[TonemappingOperator2["Photographic"] = 3] = "Photographic"; -})(TonemappingOperator || (TonemappingOperator = {})); +var init_tonemapPostProcess = __esm(() => { + init_postProcess(); + init_tonemap_fragment(); + (function(TonemappingOperator2) { + TonemappingOperator2[TonemappingOperator2["Hable"] = 0] = "Hable"; + TonemappingOperator2[TonemappingOperator2["Reinhard"] = 1] = "Reinhard"; + TonemappingOperator2[TonemappingOperator2["HejiDawson"] = 2] = "HejiDawson"; + TonemappingOperator2[TonemappingOperator2["Photographic"] = 3] = "Photographic"; + })(TonemappingOperator || (TonemappingOperator = {})); +}); + // node_modules/@babylonjs/core/Shaders/volumetricLightScattering.fragment.js -var name229 = "volumetricLightScatteringPixelShader"; -var shader229 = `uniform sampler2D textureSampler;uniform sampler2D lightScatteringSampler;uniform float decay;uniform float exposure;uniform float weight;uniform float density;uniform vec2 meshPositionOnScreen;varying vec2 vUV; +var name230, shader229; +var init_volumetricLightScattering_fragment = __esm(() => { + init_shaderStore(); + name230 = "volumetricLightScatteringPixelShader"; + shader229 = `uniform sampler2D textureSampler;uniform sampler2D lightScatteringSampler;uniform float decay;uniform float exposure;uniform float weight;uniform float density;uniform vec2 meshPositionOnScreen;varying vec2 vUV; #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) { #define CUSTOM_FRAGMENT_MAIN_BEGIN @@ -158793,11 +178535,25 @@ vec4 realColor=texture2D(textureSampler,vUV);gl_FragColor=((vec4((vec3(color.r,c #define CUSTOM_FRAGMENT_MAIN_END } `; -ShaderStore.ShadersStore[name229] = shader229; + ShaderStore.ShadersStore[name230] = shader229; +}); // node_modules/@babylonjs/core/Shaders/volumetricLightScatteringPass.vertex.js -var name230 = "volumetricLightScatteringPassVertexShader"; -var shader230 = `attribute vec3 position; +var name231, shader230; +var init_volumetricLightScatteringPass_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_morphTargetsVertexGlobalDeclaration(); + init_morphTargetsVertexDeclaration(); + init_instancesDeclaration(); + init_morphTargetsVertexGlobal(); + init_morphTargetsVertex(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + name231 = "volumetricLightScatteringPassVertexShader"; + shader230 = `attribute vec3 position; #include #include #include @@ -158835,11 +178591,15 @@ vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0)); #endif } `; -ShaderStore.ShadersStore[name230] = shader230; + ShaderStore.ShadersStore[name231] = shader230; +}); // node_modules/@babylonjs/core/Shaders/volumetricLightScatteringPass.fragment.js -var name231 = "volumetricLightScatteringPassPixelShader"; -var shader231 = `#if defined(ALPHATEST) || defined(NEED_UV) +var name232, shader231; +var init_volumetricLightScatteringPass_fragment = __esm(() => { + init_shaderStore(); + name232 = "volumetricLightScatteringPassPixelShader"; + shader231 = `#if defined(ALPHATEST) || defined(NEED_UV) varying vec2 vUV; #endif #if defined(ALPHATEST) @@ -158854,7 +178614,8 @@ discard; #endif gl_FragColor=vec4(0.0,0.0,0.0,1.0);} `; -ShaderStore.ShadersStore[name231] = shader231; + ShaderStore.ShadersStore[name232] = shader231; +}); // node_modules/@babylonjs/core/PostProcesses/volumetricLightScatteringPostProcess.js class VolumetricLightScatteringPostProcess extends PostProcess { @@ -158865,9 +178626,9 @@ class VolumetricLightScatteringPostProcess extends PostProcess { set useDiffuseColor(useDiffuseColor) { Logger.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead"); } - constructor(name232, ratio, camera30, mesh63, samples = 100, samplingMode = Texture.BILINEAR_SAMPLINGMODE, engine45, reusable, scene26) { + constructor(name233, ratio, camera30, mesh63, samples = 100, samplingMode = Texture.BILINEAR_SAMPLINGMODE, engine45, reusable, scene26) { var _a, _b; - super(name232, "volumetricLightScattering", ["decay", "exposure", "weight", "meshPositionOnScreen", "density"], ["lightScatteringSampler"], ratio.postProcessRatio || ratio, camera30, samplingMode, engine45, reusable, "#define NUM_SAMPLES " + samples); + super(name233, "volumetricLightScattering", ["decay", "exposure", "weight", "meshPositionOnScreen", "density"], ["lightScatteringSampler"], ratio.postProcessRatio || ratio, camera30, samplingMode, engine45, reusable, "#define NUM_SAMPLES " + samples); this._screenCoordinates = Vector2.Zero(); this.customMeshPosition = Vector3.Zero(); this.useCustomMeshPosition = false; @@ -159142,49 +178903,75 @@ class VolumetricLightScatteringPostProcess extends PostProcess { this._screenCoordinates.y = 1 - this._screenCoordinates.y; } } - static CreateDefaultMesh(name232, scene26) { - const mesh63 = CreatePlane(name232, { size: 1 }, scene26); + static CreateDefaultMesh(name233, scene26) { + const mesh63 = CreatePlane(name233, { size: 1 }, scene26); mesh63.billboardMode = AbstractMesh.BILLBOARDMODE_ALL; - const material22 = new StandardMaterial(name232 + "Material", scene26); + const material22 = new StandardMaterial(name233 + "Material", scene26); material22.emissiveColor = new Color3(1, 1, 1); mesh63.material = material22; return mesh63; } } -__decorate2([ - serializeAsVector3() -], VolumetricLightScatteringPostProcess.prototype, "customMeshPosition", undefined); -__decorate2([ - serialize() -], VolumetricLightScatteringPostProcess.prototype, "useCustomMeshPosition", undefined); -__decorate2([ - serialize() -], VolumetricLightScatteringPostProcess.prototype, "invert", undefined); -__decorate2([ - serializeAsMeshReference() -], VolumetricLightScatteringPostProcess.prototype, "mesh", undefined); -__decorate2([ - serialize() -], VolumetricLightScatteringPostProcess.prototype, "excludedMeshes", undefined); -__decorate2([ - serialize() -], VolumetricLightScatteringPostProcess.prototype, "includedMeshes", undefined); -__decorate2([ - serialize() -], VolumetricLightScatteringPostProcess.prototype, "exposure", undefined); -__decorate2([ - serialize() -], VolumetricLightScatteringPostProcess.prototype, "decay", undefined); -__decorate2([ - serialize() -], VolumetricLightScatteringPostProcess.prototype, "weight", undefined); -__decorate2([ - serialize() -], VolumetricLightScatteringPostProcess.prototype, "density", undefined); -RegisterClass("BABYLON.VolumetricLightScatteringPostProcess", VolumetricLightScatteringPostProcess); +var init_volumetricLightScatteringPostProcess = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_logger(); + init_math_vector(); + init_buffer(); + init_abstractMesh(); + init_material(); + init_materialHelper(); + init_standardMaterial(); + init_texture(); + init_renderTargetTexture(); + init_postProcess(); + init_planeBuilder(); + init_depth_vertex(); + init_volumetricLightScattering_fragment(); + init_volumetricLightScatteringPass_vertex(); + init_volumetricLightScatteringPass_fragment(); + init_math_color(); + init_math_viewport(); + init_typeStore(); + __decorate2([ + serializeAsVector3() + ], VolumetricLightScatteringPostProcess.prototype, "customMeshPosition", undefined); + __decorate2([ + serialize() + ], VolumetricLightScatteringPostProcess.prototype, "useCustomMeshPosition", undefined); + __decorate2([ + serialize() + ], VolumetricLightScatteringPostProcess.prototype, "invert", undefined); + __decorate2([ + serializeAsMeshReference() + ], VolumetricLightScatteringPostProcess.prototype, "mesh", undefined); + __decorate2([ + serialize() + ], VolumetricLightScatteringPostProcess.prototype, "excludedMeshes", undefined); + __decorate2([ + serialize() + ], VolumetricLightScatteringPostProcess.prototype, "includedMeshes", undefined); + __decorate2([ + serialize() + ], VolumetricLightScatteringPostProcess.prototype, "exposure", undefined); + __decorate2([ + serialize() + ], VolumetricLightScatteringPostProcess.prototype, "decay", undefined); + __decorate2([ + serialize() + ], VolumetricLightScatteringPostProcess.prototype, "weight", undefined); + __decorate2([ + serialize() + ], VolumetricLightScatteringPostProcess.prototype, "density", undefined); + RegisterClass("BABYLON.VolumetricLightScatteringPostProcess", VolumetricLightScatteringPostProcess); +}); + // node_modules/@babylonjs/core/Shaders/screenSpaceCurvature.fragment.js -var name232 = "screenSpaceCurvaturePixelShader"; -var shader232 = `precision highp float;varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D normalSampler;uniform float curvature_ridge;uniform float curvature_valley; +var name233, shader232; +var init_screenSpaceCurvature_fragment = __esm(() => { + init_shaderStore(); + name233 = "screenSpaceCurvaturePixelShader"; + shader232 = `precision highp float;varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D normalSampler;uniform float curvature_ridge;uniform float curvature_valley; #ifndef CURVATURE_OFFSET #define CURVATURE_OFFSET 1 #endif @@ -159197,15 +178984,16 @@ return -2.0*curvature_soft_clamp(-normal_diff,valley);return 2.0*curvature_soft_ #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {ivec2 texel=ivec2(gl_FragCoord.xy);vec4 baseColor=texture2D(textureSampler,vUV);float curvature=calculate_curvature(texel,curvature_ridge,curvature_valley);baseColor.rgb*=curvature+1.0;gl_FragColor=baseColor;}`; -ShaderStore.ShadersStore[name232] = shader232; + ShaderStore.ShadersStore[name233] = shader232; +}); // node_modules/@babylonjs/core/PostProcesses/screenSpaceCurvaturePostProcess.js class ScreenSpaceCurvaturePostProcess extends PostProcess { getClassName() { return "ScreenSpaceCurvaturePostProcess"; } - constructor(name233, scene26, options, camera30, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false) { - super(name233, "screenSpaceCurvature", ["curvature_ridge", "curvature_valley"], ["textureSampler", "normalSampler"], options, camera30, samplingMode, engine45, reusable, undefined, textureType, undefined, null, blockCompilation); + constructor(name234, scene26, options, camera30, samplingMode, engine45, reusable, textureType = 0, blockCompilation = false) { + super(name234, "screenSpaceCurvature", ["curvature_ridge", "curvature_valley"], ["textureSampler", "normalSampler"], options, camera30, samplingMode, engine45, reusable, undefined, textureType, undefined, null, blockCompilation); this.ridge = 1; this.valley = 1; this._geometryBufferRenderer = scene26.enableGeometryBufferRenderer(); @@ -159236,22 +179024,82 @@ class ScreenSpaceCurvaturePostProcess extends PostProcess { }, parsedPostProcess, scene26, rootUrl); } } -__decorate2([ - serialize() -], ScreenSpaceCurvaturePostProcess.prototype, "ridge", undefined); -__decorate2([ - serialize() -], ScreenSpaceCurvaturePostProcess.prototype, "valley", undefined); -RegisterClass("BABYLON.ScreenSpaceCurvaturePostProcess", ScreenSpaceCurvaturePostProcess); +var init_screenSpaceCurvaturePostProcess = __esm(() => { + init_tslib_es62(); + init_logger(); + init_postProcess(); + init_geometryBufferRendererSceneComponent(); + init_screenSpaceCurvature_fragment(); + init_engineStore(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], ScreenSpaceCurvaturePostProcess.prototype, "ridge", undefined); + __decorate2([ + serialize() + ], ScreenSpaceCurvaturePostProcess.prototype, "valley", undefined); + RegisterClass("BABYLON.ScreenSpaceCurvaturePostProcess", ScreenSpaceCurvaturePostProcess); +}); + +// node_modules/@babylonjs/core/PostProcesses/index.js +var init_PostProcesses = __esm(() => { + init_anaglyphPostProcess(); + init_blackAndWhitePostProcess(); + init_bloomEffect(); + init_bloomMergePostProcess(); + init_blurPostProcess(); + init_chromaticAberrationPostProcess(); + init_circleOfConfusionPostProcess(); + init_colorCorrectionPostProcess(); + init_convolutionPostProcess(); + init_depthOfFieldBlurPostProcess(); + init_depthOfFieldEffect(); + init_depthOfFieldMergePostProcess(); + init_displayPassPostProcess(); + init_extractHighlightsPostProcess(); + init_filterPostProcess(); + init_fxaaPostProcess(); + init_grainPostProcess(); + init_highlightsPostProcess(); + init_imageProcessingPostProcess(); + init_motionBlurPostProcess(); + init_passPostProcess(); + init_postProcess(); + init_postProcessManager(); + init_refractionPostProcess(); + init_RenderPipeline(); + init_sharpenPostProcess(); + init_stereoscopicInterlacePostProcess(); + init_tonemapPostProcess(); + init_volumetricLightScatteringPostProcess(); + init_vrDistortionCorrectionPostProcess(); + init_vrMultiviewToSingleviewPostProcess(); + init_screenSpaceReflectionPostProcess(); + init_screenSpaceCurvaturePostProcess(); +}); + +// node_modules/@babylonjs/core/Probes/index.js +var init_Probes = __esm(() => { + init_reflectionProbe(); +}); + // node_modules/@babylonjs/core/Shaders/ShadersInclude/boundingBoxRendererFragmentDeclaration.js -var name233 = "boundingBoxRendererFragmentDeclaration"; -var shader233 = `uniform vec4 color; +var name234, shader233; +var init_boundingBoxRendererFragmentDeclaration = __esm(() => { + init_shaderStore(); + name234 = "boundingBoxRendererFragmentDeclaration"; + shader233 = `uniform vec4 color; `; -ShaderStore.IncludesShadersStore[name233] = shader233; + ShaderStore.IncludesShadersStore[name234] = shader233; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/boundingBoxRendererUboDeclaration.js -var name234 = "boundingBoxRendererUboDeclaration"; -var shader234 = `#ifdef WEBGL2 +var name235, shader234; +var init_boundingBoxRendererUboDeclaration = __esm(() => { + init_shaderStore(); + name235 = "boundingBoxRendererUboDeclaration"; + shader234 = `#ifdef WEBGL2 uniform vec4 color;uniform mat4 world;uniform mat4 viewProjection; #ifdef MULTIVIEW uniform mat4 viewProjectionR; @@ -159260,31 +179108,47 @@ uniform mat4 viewProjectionR; layout(std140,column_major) uniform;uniform BoundingBoxRenderer {vec4 color;mat4 world;mat4 viewProjection;mat4 viewProjectionR;}; #endif `; -ShaderStore.IncludesShadersStore[name234] = shader234; + ShaderStore.IncludesShadersStore[name235] = shader234; +}); // node_modules/@babylonjs/core/Shaders/boundingBoxRenderer.fragment.js -var name235 = "boundingBoxRendererPixelShader"; -var shader235 = `#include<__decl__boundingBoxRendererFragment> +var name236, shader235; +var init_boundingBoxRenderer_fragment = __esm(() => { + init_shaderStore(); + init_boundingBoxRendererFragmentDeclaration(); + init_boundingBoxRendererUboDeclaration(); + name236 = "boundingBoxRendererPixelShader"; + shader235 = `#include<__decl__boundingBoxRendererFragment> #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) { #define CUSTOM_FRAGMENT_MAIN_BEGIN gl_FragColor=color; #define CUSTOM_FRAGMENT_MAIN_END }`; -ShaderStore.ShadersStore[name235] = shader235; + ShaderStore.ShadersStore[name236] = shader235; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/boundingBoxRendererVertexDeclaration.js -var name236 = "boundingBoxRendererVertexDeclaration"; -var shader236 = `uniform mat4 world;uniform mat4 viewProjection; +var name237, shader236; +var init_boundingBoxRendererVertexDeclaration = __esm(() => { + init_shaderStore(); + name237 = "boundingBoxRendererVertexDeclaration"; + shader236 = `uniform mat4 world;uniform mat4 viewProjection; #ifdef MULTIVIEW uniform mat4 viewProjectionR; #endif `; -ShaderStore.IncludesShadersStore[name236] = shader236; + ShaderStore.IncludesShadersStore[name237] = shader236; +}); // node_modules/@babylonjs/core/Shaders/boundingBoxRenderer.vertex.js -var name237 = "boundingBoxRendererVertexShader"; -var shader237 = `attribute vec3 position; +var name238, shader237; +var init_boundingBoxRenderer_vertex = __esm(() => { + init_shaderStore(); + init_boundingBoxRendererVertexDeclaration(); + init_boundingBoxRendererUboDeclaration(); + name238 = "boundingBoxRendererVertexShader"; + shader237 = `attribute vec3 position; #include<__decl__boundingBoxRendererVertex> #define CUSTOM_VERTEX_DEFINITIONS void main(void) { @@ -159298,42 +179162,10 @@ gl_Position=viewProjection*worldPos; #define CUSTOM_VERTEX_MAIN_END } `; -ShaderStore.ShadersStore[name237] = shader237; - -// node_modules/@babylonjs/core/Rendering/boundingBoxRenderer.js -Object.defineProperty(Scene.prototype, "forceShowBoundingBoxes", { - get: function() { - return this._forceShowBoundingBoxes || false; - }, - set: function(value) { - this._forceShowBoundingBoxes = value; - if (value) { - this.getBoundingBoxRenderer(); - } - }, - enumerable: true, - configurable: true -}); -Scene.prototype.getBoundingBoxRenderer = function() { - if (!this._boundingBoxRenderer) { - this._boundingBoxRenderer = new BoundingBoxRenderer(this); - } - return this._boundingBoxRenderer; -}; -Object.defineProperty(AbstractMesh.prototype, "showBoundingBox", { - get: function() { - return this._showBoundingBox || false; - }, - set: function(value) { - this._showBoundingBox = value; - if (value) { - this.getScene().getBoundingBoxRenderer(); - } - }, - enumerable: true, - configurable: true + ShaderStore.ShadersStore[name238] = shader237; }); +// node_modules/@babylonjs/core/Rendering/boundingBoxRenderer.js class BoundingBoxRenderer { constructor(scene27) { this.name = SceneComponentConstants.NAME_BOUNDINGBOXRENDERER; @@ -159570,37 +179402,57 @@ class BoundingBoxRenderer { } } } -// node_modules/@babylonjs/core/Rendering/depthRendererSceneComponent.js -Scene.prototype.enableDepthRenderer = function(camera30, storeNonLinearDepth = false, force32bitsFloat = false, samplingMode = 3, storeCameraSpaceZ = false) { - camera30 = camera30 || this.activeCamera; - if (!camera30) { - throw "No camera available to enable depth renderer"; - } - if (!this._depthRenderer) { - this._depthRenderer = {}; - } - if (!this._depthRenderer[camera30.id]) { - const supportFullfloat = !!this.getEngine().getCaps().textureFloatRender; - let textureType = 0; - if (this.getEngine().getCaps().textureHalfFloatRender && (!force32bitsFloat || !supportFullfloat)) { - textureType = 2; - } else if (supportFullfloat) { - textureType = 1; - } else { - textureType = 0; +var init_boundingBoxRenderer = __esm(() => { + init_scene(); + init_buffer(); + init_abstractMesh(); + init_math_vector(); + init_smartArray(); + init_sceneComponent(); + init_material(); + init_shaderMaterial(); + init_math_color(); + init_observable(); + init_drawWrapper(); + init_uniformBuffer(); + init_boxBuilder(); + init_boundingBoxRenderer_fragment(); + init_boundingBoxRenderer_vertex(); + Object.defineProperty(Scene.prototype, "forceShowBoundingBoxes", { + get: function() { + return this._forceShowBoundingBoxes || false; + }, + set: function(value) { + this._forceShowBoundingBoxes = value; + if (value) { + this.getBoundingBoxRenderer(); + } + }, + enumerable: true, + configurable: true + }); + Scene.prototype.getBoundingBoxRenderer = function() { + if (!this._boundingBoxRenderer) { + this._boundingBoxRenderer = new BoundingBoxRenderer(this); } - this._depthRenderer[camera30.id] = new DepthRenderer(this, textureType, camera30, storeNonLinearDepth, samplingMode, storeCameraSpaceZ); - } - return this._depthRenderer[camera30.id]; -}; -Scene.prototype.disableDepthRenderer = function(camera30) { - camera30 = camera30 || this.activeCamera; - if (!camera30 || !this._depthRenderer || !this._depthRenderer[camera30.id]) { - return; - } - this._depthRenderer[camera30.id].dispose(); -}; + return this._boundingBoxRenderer; + }; + Object.defineProperty(AbstractMesh.prototype, "showBoundingBox", { + get: function() { + return this._showBoundingBox || false; + }, + set: function(value) { + this._showBoundingBox = value; + if (value) { + this.getScene().getBoundingBoxRenderer(); + } + }, + enumerable: true, + configurable: true + }); +}); +// node_modules/@babylonjs/core/Rendering/depthRendererSceneComponent.js class DepthRendererSceneComponent { constructor(scene28) { this.name = SceneComponentConstants.NAME_DEPTHRENDERER; @@ -159638,26 +179490,69 @@ class DepthRendererSceneComponent { } } } -DepthRenderer._SceneComponentInitialization = (scene28) => { - let component = scene28._getComponent(SceneComponentConstants.NAME_DEPTHRENDERER); - if (!component) { - component = new DepthRendererSceneComponent(scene28); - scene28._addComponent(component); - } -}; +var init_depthRendererSceneComponent = __esm(() => { + init_scene(); + init_depthRenderer(); + init_sceneComponent(); + Scene.prototype.enableDepthRenderer = function(camera30, storeNonLinearDepth = false, force32bitsFloat = false, samplingMode = 3, storeCameraSpaceZ = false) { + camera30 = camera30 || this.activeCamera; + if (!camera30) { + throw "No camera available to enable depth renderer"; + } + if (!this._depthRenderer) { + this._depthRenderer = {}; + } + if (!this._depthRenderer[camera30.id]) { + const supportFullfloat = !!this.getEngine().getCaps().textureFloatRender; + let textureType = 0; + if (this.getEngine().getCaps().textureHalfFloatRender && (!force32bitsFloat || !supportFullfloat)) { + textureType = 2; + } else if (supportFullfloat) { + textureType = 1; + } else { + textureType = 0; + } + this._depthRenderer[camera30.id] = new DepthRenderer(this, textureType, camera30, storeNonLinearDepth, samplingMode, storeCameraSpaceZ); + } + return this._depthRenderer[camera30.id]; + }; + Scene.prototype.disableDepthRenderer = function(camera30) { + camera30 = camera30 || this.activeCamera; + if (!camera30 || !this._depthRenderer || !this._depthRenderer[camera30.id]) { + return; + } + this._depthRenderer[camera30.id].dispose(); + }; + DepthRenderer._SceneComponentInitialization = (scene28) => { + let component = scene28._getComponent(SceneComponentConstants.NAME_DEPTHRENDERER); + if (!component) { + component = new DepthRendererSceneComponent(scene28); + scene28._addComponent(component); + } + }; +}); + // node_modules/@babylonjs/core/Shaders/oitFinal.fragment.js -var name238 = "oitFinalPixelShader"; -var shader238 = `precision highp float;uniform sampler2D uFrontColor;uniform sampler2D uBackColor;void main() {ivec2 fragCoord=ivec2(gl_FragCoord.xy);vec4 frontColor=texelFetch(uFrontColor,fragCoord,0);vec4 backColor=texelFetch(uBackColor,fragCoord,0);float alphaMultiplier=1.0-frontColor.a;glFragColor=vec4( +var name239, shader238; +var init_oitFinal_fragment = __esm(() => { + init_shaderStore(); + name239 = "oitFinalPixelShader"; + shader238 = `precision highp float;uniform sampler2D uFrontColor;uniform sampler2D uBackColor;void main() {ivec2 fragCoord=ivec2(gl_FragCoord.xy);vec4 frontColor=texelFetch(uFrontColor,fragCoord,0);vec4 backColor=texelFetch(uBackColor,fragCoord,0);float alphaMultiplier=1.0-frontColor.a;glFragColor=vec4( frontColor.rgb+alphaMultiplier*backColor.rgb, frontColor.a+backColor.a );}`; -ShaderStore.ShadersStore[name238] = shader238; + ShaderStore.ShadersStore[name239] = shader238; +}); // node_modules/@babylonjs/core/Shaders/oitBackBlend.fragment.js -var name239 = "oitBackBlendPixelShader"; -var shader239 = `precision highp float;uniform sampler2D uBackColor;void main() {glFragColor=texelFetch(uBackColor,ivec2(gl_FragCoord.xy),0);if (glFragColor.a==0.0) { +var name240, shader239; +var init_oitBackBlend_fragment = __esm(() => { + init_shaderStore(); + name240 = "oitBackBlendPixelShader"; + shader239 = `precision highp float;uniform sampler2D uBackColor;void main() {glFragColor=texelFetch(uBackColor,ivec2(gl_FragCoord.xy),0);if (glFragColor.a==0.0) { discard;}}`; -ShaderStore.ShadersStore[name239] = shader239; + ShaderStore.ShadersStore[name240] = shader239; +}); // node_modules/@babylonjs/core/Rendering/depthPeelingRenderer.js class DepthPeelingEffectConfiguration { @@ -160048,44 +179943,24 @@ class DepthPeelingRenderer { this._releaseRenderPassIds(); } } -DepthPeelingRenderer._DEPTH_CLEAR_VALUE = -99999; -DepthPeelingRenderer._MIN_DEPTH = 0; -DepthPeelingRenderer._MAX_DEPTH = 1; -// node_modules/@babylonjs/core/Rendering/depthPeelingSceneComponent.js -Object.defineProperty(Scene.prototype, "depthPeelingRenderer", { - get: function() { - if (!this._depthPeelingRenderer) { - let component = this._getComponent(SceneComponentConstants.NAME_DEPTHPEELINGRENDERER); - if (!component) { - component = new DepthPeelingSceneComponent(this); - this._addComponent(component); - } - } - return this._depthPeelingRenderer; - }, - set: function(value) { - this._depthPeelingRenderer = value; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(Scene.prototype, "useOrderIndependentTransparency", { - get: function() { - return this._useOrderIndependentTransparency; - }, - set: function(value) { - var _a; - if (this._useOrderIndependentTransparency === value) { - return; - } - this._useOrderIndependentTransparency = value; - this.markAllMaterialsAsDirty(63); - (_a = this.prePassRenderer) === null || _a === undefined || _a.markAsDirty(); - }, - enumerable: true, - configurable: true +var init_depthPeelingRenderer = __esm(() => { + init_multiRenderTarget(); + init_math_color(); + init_smartArray(); + init_thinTexture(); + init_effectRenderer(); + init_renderTargetTexture(); + init_logger(); + init_material(); + init_postprocess_vertex(); + init_oitFinal_fragment(); + init_oitBackBlend_fragment(); + DepthPeelingRenderer._DEPTH_CLEAR_VALUE = -99999; + DepthPeelingRenderer._MIN_DEPTH = 0; + DepthPeelingRenderer._MAX_DEPTH = 1; }); +// node_modules/@babylonjs/core/Rendering/depthPeelingSceneComponent.js class DepthPeelingSceneComponent { constructor(scene29) { this.name = SceneComponentConstants.NAME_DEPTHPEELINGRENDERER; @@ -160102,9 +179977,55 @@ class DepthPeelingSceneComponent { this.scene.depthPeelingRenderer = null; } } +var init_depthPeelingSceneComponent = __esm(() => { + init_scene(); + init_sceneComponent(); + init_depthPeelingRenderer(); + Object.defineProperty(Scene.prototype, "depthPeelingRenderer", { + get: function() { + if (!this._depthPeelingRenderer) { + let component = this._getComponent(SceneComponentConstants.NAME_DEPTHPEELINGRENDERER); + if (!component) { + component = new DepthPeelingSceneComponent(this); + this._addComponent(component); + } + } + return this._depthPeelingRenderer; + }, + set: function(value) { + this._depthPeelingRenderer = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Scene.prototype, "useOrderIndependentTransparency", { + get: function() { + return this._useOrderIndependentTransparency; + }, + set: function(value) { + var _a; + if (this._useOrderIndependentTransparency === value) { + return; + } + this._useOrderIndependentTransparency = value; + this.markAllMaterialsAsDirty(63); + (_a = this.prePassRenderer) === null || _a === undefined || _a.markAsDirty(); + }, + enumerable: true, + configurable: true + }); +}); + // node_modules/@babylonjs/core/Shaders/line.fragment.js -var name240 = "linePixelShader"; -var shader240 = `#include +var name241, shader240; +var init_line_fragment = __esm(() => { + init_shaderStore(); + init_clipPlaneFragmentDeclaration(); + init_logDepthDeclaration(); + init_logDepthFragment(); + init_clipPlaneFragment(); + name241 = "linePixelShader"; + shader240 = `#include uniform vec4 color; #ifdef LOGARITHMICDEPTH #extension GL_EXT_frag_depth : enable @@ -160118,11 +180039,21 @@ void main(void) { gl_FragColor=color; #define CUSTOM_FRAGMENT_MAIN_END }`; -ShaderStore.ShadersStore[name240] = shader240; + ShaderStore.ShadersStore[name241] = shader240; +}); // node_modules/@babylonjs/core/Shaders/line.vertex.js -var name241 = "lineVertexShader"; -var shader241 = `#include +var name242, shader241; +var init_line_vertex = __esm(() => { + init_shaderStore(); + init_instancesDeclaration(); + init_clipPlaneVertexDeclaration(); + init_logDepthDeclaration(); + init_instancesVertex(); + init_clipPlaneVertex(); + init_logDepthVertex(); + name242 = "lineVertexShader"; + shader241 = `#include #include attribute vec3 position;attribute vec4 normal;uniform mat4 viewProjection;uniform float width;uniform float aspectRatio; #include @@ -160138,38 +180069,10 @@ vec4 worldPos=finalWorld*vec4(position,1.0); #include #define CUSTOM_VERTEX_MAIN_END }`; -ShaderStore.ShadersStore[name241] = shader241; - -// node_modules/@babylonjs/core/Rendering/edgesRenderer.js -AbstractMesh.prototype.disableEdgesRendering = function() { - if (this._edgesRenderer) { - this._edgesRenderer.dispose(); - this._edgesRenderer = null; - } - return this; -}; -AbstractMesh.prototype.enableEdgesRendering = function(epsilon = 0.95, checkVerticesInsteadOfIndices = false, options) { - this.disableEdgesRendering(); - this._edgesRenderer = new EdgesRenderer(this, epsilon, checkVerticesInsteadOfIndices, true, options); - return this; -}; -Object.defineProperty(AbstractMesh.prototype, "edgesRenderer", { - get: function() { - return this._edgesRenderer; - }, - enumerable: true, - configurable: true + ShaderStore.ShadersStore[name242] = shader241; }); -LinesMesh.prototype.enableEdgesRendering = function(epsilon = 0.95, checkVerticesInsteadOfIndices = false) { - this.disableEdgesRendering(); - this._edgesRenderer = new LineEdgesRenderer(this, epsilon, checkVerticesInsteadOfIndices); - return this; -}; -InstancedLinesMesh.prototype.enableEdgesRendering = function(epsilon = 0.95, checkVerticesInsteadOfIndices = false) { - LinesMesh.prototype.enableEdgesRendering.apply(this, arguments); - return this; -}; +// node_modules/@babylonjs/core/Rendering/edgesRenderer.js class FaceAdjacencies { constructor() { this.edges = []; @@ -160719,10 +180622,52 @@ class LineEdgesRenderer extends EdgesRenderer { this._indicesCount = this._linesIndices.length; } } +var init_edgesRenderer = __esm(() => { + init_buffer(); + init_abstractMesh(); + init_linesMesh(); + init_math_vector(); + init_material(); + init_shaderMaterial(); + init_camera(); + init_line_fragment(); + init_line_vertex(); + init_smartArray(); + init_drawWrapper(); + AbstractMesh.prototype.disableEdgesRendering = function() { + if (this._edgesRenderer) { + this._edgesRenderer.dispose(); + this._edgesRenderer = null; + } + return this; + }; + AbstractMesh.prototype.enableEdgesRendering = function(epsilon = 0.95, checkVerticesInsteadOfIndices = false, options) { + this.disableEdgesRendering(); + this._edgesRenderer = new EdgesRenderer(this, epsilon, checkVerticesInsteadOfIndices, true, options); + return this; + }; + Object.defineProperty(AbstractMesh.prototype, "edgesRenderer", { + get: function() { + return this._edgesRenderer; + }, + enumerable: true, + configurable: true + }); + LinesMesh.prototype.enableEdgesRendering = function(epsilon = 0.95, checkVerticesInsteadOfIndices = false) { + this.disableEdgesRendering(); + this._edgesRenderer = new LineEdgesRenderer(this, epsilon, checkVerticesInsteadOfIndices); + return this; + }; + InstancedLinesMesh.prototype.enableEdgesRendering = function(epsilon = 0.95, checkVerticesInsteadOfIndices = false) { + LinesMesh.prototype.enableEdgesRendering.apply(this, arguments); + return this; + }; +}); + // node_modules/@babylonjs/core/Materials/Textures/prePassRenderTarget.js class PrePassRenderTarget extends MultiRenderTarget { - constructor(name242, renderTargetTexture19, size, count, scene29, options) { - super(name242, size, count, scene29, options); + constructor(name243, renderTargetTexture19, size, count, scene29, options) { + super(name243, size, count, scene29, options); this._beforeCompositionPostProcesses = []; this._internalTextureDirty = false; this.enabled = false; @@ -160771,6 +180716,10 @@ class PrePassRenderTarget extends MultiRenderTarget { } } } +var init_prePassRenderTarget = __esm(() => { + init_multiRenderTarget(); + init_imageProcessingPostProcess(); +}); // node_modules/@babylonjs/core/Rendering/prePassRenderer.js class PrePassRenderer { @@ -160878,8 +180827,8 @@ class PrePassRenderer { this.defaultRT = this._createRenderTarget("sceneprePassRT", null); this._currentTarget = this.defaultRT; } - _createRenderTarget(name242, renderTargetTexture19) { - const rt = new PrePassRenderTarget(name242, renderTargetTexture19, { width: this._engine.getRenderWidth(), height: this._engine.getRenderHeight() }, 0, this._scene, { + _createRenderTarget(name243, renderTargetTexture19) { + const rt = new PrePassRenderTarget(name243, renderTargetTexture19, { width: this._engine.getRenderWidth(), height: this._engine.getRenderHeight() }, 0, this._scene, { generateMipMaps: false, generateStencilBuffer: this._engine.isStencilEnable, defaultType: 0, @@ -161085,9 +181034,9 @@ class PrePassRenderer { this._effectConfigurations.push(cfg); return cfg; } - getEffectConfiguration(name242) { + getEffectConfiguration(name243) { for (let i = 0;i < this._effectConfigurations.length; i++) { - if (this._effectConfigurations[i].name === name242) { + if (this._effectConfigurations[i].name === name243) { return this._effectConfigurations[i]; } } @@ -161317,91 +181266,68 @@ class PrePassRenderer { } } } -PrePassRenderer._SceneComponentInitialization = (_) => { - throw _WarnImport("PrePassRendererSceneComponent"); -}; -PrePassRenderer.TextureFormats = [ - { - purpose: 0, - type: 2, - format: 5, - name: "prePass_Irradiance" - }, - { - purpose: 1, - type: 2, - format: 5, - name: "prePass_Position" - }, - { - purpose: 2, - type: 0, - format: 5, - name: "prePass_Velocity" - }, - { - purpose: 3, - type: 0, - format: 5, - name: "prePass_Reflectivity" - }, - { - purpose: 4, - type: 2, - format: 5, - name: "prePass_Color" - }, - { - purpose: 5, - type: 1, - format: 6, - name: "prePass_Depth" - }, - { - purpose: 6, - type: 2, - format: 5, - name: "prePass_Normal" - }, - { - purpose: 7, - type: 0, - format: 5, - name: "prePass_Albedo" - } -]; -// node_modules/@babylonjs/core/Rendering/prePassRendererSceneComponent.js -Object.defineProperty(Scene.prototype, "prePassRenderer", { - get: function() { - return this._prePassRenderer; - }, - set: function(value) { - if (value && value.isSupported) { - this._prePassRenderer = value; +var init_prePassRenderer = __esm(() => { + init_prePassRenderTarget(); + init_devTools(); + init_math_color(); + init_material(); + init_geometryBufferRenderer(); + PrePassRenderer._SceneComponentInitialization = (_) => { + throw _WarnImport("PrePassRendererSceneComponent"); + }; + PrePassRenderer.TextureFormats = [ + { + purpose: 0, + type: 2, + format: 5, + name: "prePass_Irradiance" + }, + { + purpose: 1, + type: 2, + format: 5, + name: "prePass_Position" + }, + { + purpose: 2, + type: 0, + format: 5, + name: "prePass_Velocity" + }, + { + purpose: 3, + type: 0, + format: 5, + name: "prePass_Reflectivity" + }, + { + purpose: 4, + type: 2, + format: 5, + name: "prePass_Color" + }, + { + purpose: 5, + type: 1, + format: 6, + name: "prePass_Depth" + }, + { + purpose: 6, + type: 2, + format: 5, + name: "prePass_Normal" + }, + { + purpose: 7, + type: 0, + format: 5, + name: "prePass_Albedo" } - }, - enumerable: true, - configurable: true + ]; }); -Scene.prototype.enablePrePassRenderer = function() { - if (this._prePassRenderer) { - return this._prePassRenderer; - } - this._prePassRenderer = new PrePassRenderer(this); - if (!this._prePassRenderer.isSupported) { - this._prePassRenderer = null; - Logger.Error("PrePassRenderer needs WebGL 2 support.\nMaybe you tried to use the following features that need the PrePassRenderer :\n + Subsurface Scattering"); - } - return this._prePassRenderer; -}; -Scene.prototype.disablePrePassRenderer = function() { - if (!this._prePassRenderer) { - return; - } - this._prePassRenderer.dispose(); - this._prePassRenderer = null; -}; +// node_modules/@babylonjs/core/Rendering/prePassRendererSceneComponent.js class PrePassRendererSceneComponent { constructor(scene30) { this.name = SceneComponentConstants.NAME_PREPASSRENDERER; @@ -161477,32 +181403,84 @@ class PrePassRendererSceneComponent { this.scene.disablePrePassRenderer(); } } -PrePassRenderer._SceneComponentInitialization = (scene30) => { - let component = scene30._getComponent(SceneComponentConstants.NAME_PREPASSRENDERER); - if (!component) { - component = new PrePassRendererSceneComponent(scene30); - scene30._addComponent(component); - } -}; +var init_prePassRendererSceneComponent = __esm(() => { + init_scene(); + init_sceneComponent(); + init_prePassRenderer(); + init_logger(); + Object.defineProperty(Scene.prototype, "prePassRenderer", { + get: function() { + return this._prePassRenderer; + }, + set: function(value) { + if (value && value.isSupported) { + this._prePassRenderer = value; + } + }, + enumerable: true, + configurable: true + }); + Scene.prototype.enablePrePassRenderer = function() { + if (this._prePassRenderer) { + return this._prePassRenderer; + } + this._prePassRenderer = new PrePassRenderer(this); + if (!this._prePassRenderer.isSupported) { + this._prePassRenderer = null; + Logger.Error("PrePassRenderer needs WebGL 2 support.\nMaybe you tried to use the following features that need the PrePassRenderer :\n + Subsurface Scattering"); + } + return this._prePassRenderer; + }; + Scene.prototype.disablePrePassRenderer = function() { + if (!this._prePassRenderer) { + return; + } + this._prePassRenderer.dispose(); + this._prePassRenderer = null; + }; + PrePassRenderer._SceneComponentInitialization = (scene30) => { + let component = scene30._getComponent(SceneComponentConstants.NAME_PREPASSRENDERER); + if (!component) { + component = new PrePassRendererSceneComponent(scene30); + scene30._addComponent(component); + } + }; +}); + // node_modules/@babylonjs/core/Shaders/ShadersInclude/fibonacci.js -var name242 = "fibonacci"; -var shader242 = `#define rcp(x) 1./x +var name243, shader242; +var init_fibonacci = __esm(() => { + init_shaderStore(); + name243 = "fibonacci"; + shader242 = `#define rcp(x) 1./x #define GOLDEN_RATIO 1.618033988749895 #define TWO_PI 6.2831855 vec2 Golden2dSeq(int i,float n) {return vec2(float(i)/n+(0.5/n),fract(float(i)*rcp(GOLDEN_RATIO)));} vec2 SampleDiskGolden(int i,int sampleCount) {vec2 f=Golden2dSeq(i,float(sampleCount));return vec2(sqrt(f.x),TWO_PI*f.y);}`; -ShaderStore.IncludesShadersStore[name242] = shader242; + ShaderStore.IncludesShadersStore[name243] = shader242; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/diffusionProfile.js -var name243 = "diffusionProfile"; -var shader243 = `uniform vec3 diffusionS[5];uniform float diffusionD[5];uniform float filterRadii[5];`; -ShaderStore.IncludesShadersStore[name243] = shader243; +var name244, shader243; +var init_diffusionProfile = __esm(() => { + init_shaderStore(); + name244 = "diffusionProfile"; + shader243 = `uniform vec3 diffusionS[5];uniform float diffusionD[5];uniform float filterRadii[5];`; + ShaderStore.IncludesShadersStore[name244] = shader243; +}); // node_modules/@babylonjs/core/Shaders/subSurfaceScattering.fragment.js -var name244 = "subSurfaceScatteringPixelShader"; -var shader244 = `#include +var name245, shader244; +var init_subSurfaceScattering_fragment = __esm(() => { + init_shaderStore(); + init_fibonacci(); + init_helperFunctions(); + init_subSurfaceScatteringFunctions(); + init_diffusionProfile(); + name245 = "subSurfaceScatteringPixelShader"; + shader244 = `#include #include #include #include @@ -161566,15 +181544,16 @@ vec3 totalIrradiance=vec3(0.);vec3 totalWeight =vec3(0.);for (int i=0; i { @@ -161595,6 +181574,14 @@ class SubSurfaceScatteringPostProcess extends PostProcess { }); } } +var init_subSurfaceScatteringPostProcess = __esm(() => { + init_texture(); + init_postProcess(); + init_logger(); + init_imageProcessing_fragment(); + init_subSurfaceScattering_fragment(); + init_postprocess_vertex(); +}); // node_modules/@babylonjs/core/Rendering/subSurfaceConfiguration.js class SubSurfaceConfiguration { @@ -161674,56 +181661,18 @@ class SubSurfaceConfiguration { return x * rcpS; } } -SubSurfaceConfiguration._SceneComponentInitialization = (_) => { - throw _WarnImport("SubSurfaceSceneComponent"); -}; - -// node_modules/@babylonjs/core/Rendering/subSurfaceSceneComponent.js -AbstractScene.AddParser(SceneComponentConstants.NAME_SUBSURFACE, (parsedData, scene31) => { - if (parsedData.ssDiffusionProfileColors !== undefined && parsedData.ssDiffusionProfileColors !== null) { - scene31.enableSubSurfaceForPrePass(); - if (scene31.subSurfaceConfiguration) { - for (let index = 0, cache = parsedData.ssDiffusionProfileColors.length;index < cache; index++) { - const color = parsedData.ssDiffusionProfileColors[index]; - scene31.subSurfaceConfiguration.addDiffusionProfile(new Color3(color.r, color.g, color.b)); - } - } - } -}); -Object.defineProperty(Scene.prototype, "subSurfaceConfiguration", { - get: function() { - return this._subSurfaceConfiguration; - }, - set: function(value) { - if (value) { - if (this.enablePrePassRenderer()) { - this._subSurfaceConfiguration = value; - } - } - }, - enumerable: true, - configurable: true +var init_subSurfaceConfiguration = __esm(() => { + init_logger(); + init_math_color(); + init_subSurfaceScatteringPostProcess(); + init_sceneComponent(); + init_devTools(); + SubSurfaceConfiguration._SceneComponentInitialization = (_) => { + throw _WarnImport("SubSurfaceSceneComponent"); + }; }); -Scene.prototype.enableSubSurfaceForPrePass = function() { - if (this._subSurfaceConfiguration) { - return this._subSurfaceConfiguration; - } - const prePassRenderer2 = this.enablePrePassRenderer(); - if (prePassRenderer2) { - this._subSurfaceConfiguration = new SubSurfaceConfiguration(this); - prePassRenderer2.addEffectConfiguration(this._subSurfaceConfiguration); - return this._subSurfaceConfiguration; - } - return null; -}; -Scene.prototype.disableSubSurfaceForPrePass = function() { - if (!this._subSurfaceConfiguration) { - return; - } - this._subSurfaceConfiguration.dispose(); - this._subSurfaceConfiguration = null; -}; +// node_modules/@babylonjs/core/Rendering/subSurfaceSceneComponent.js class SubSurfaceSceneComponent { constructor(scene31) { this.name = SceneComponentConstants.NAME_PREPASSRENDERER; @@ -161760,16 +181709,75 @@ class SubSurfaceSceneComponent { dispose() { } } -SubSurfaceConfiguration._SceneComponentInitialization = (scene31) => { - let component = scene31._getComponent(SceneComponentConstants.NAME_SUBSURFACE); - if (!component) { - component = new SubSurfaceSceneComponent(scene31); - scene31._addComponent(component); - } -}; +var init_subSurfaceSceneComponent = __esm(() => { + init_scene(); + init_sceneComponent(); + init_subSurfaceConfiguration(); + init_abstractScene(); + init_math_color(); + AbstractScene.AddParser(SceneComponentConstants.NAME_SUBSURFACE, (parsedData, scene31) => { + if (parsedData.ssDiffusionProfileColors !== undefined && parsedData.ssDiffusionProfileColors !== null) { + scene31.enableSubSurfaceForPrePass(); + if (scene31.subSurfaceConfiguration) { + for (let index = 0, cache = parsedData.ssDiffusionProfileColors.length;index < cache; index++) { + const color = parsedData.ssDiffusionProfileColors[index]; + scene31.subSurfaceConfiguration.addDiffusionProfile(new Color3(color.r, color.g, color.b)); + } + } + } + }); + Object.defineProperty(Scene.prototype, "subSurfaceConfiguration", { + get: function() { + return this._subSurfaceConfiguration; + }, + set: function(value) { + if (value) { + if (this.enablePrePassRenderer()) { + this._subSurfaceConfiguration = value; + } + } + }, + enumerable: true, + configurable: true + }); + Scene.prototype.enableSubSurfaceForPrePass = function() { + if (this._subSurfaceConfiguration) { + return this._subSurfaceConfiguration; + } + const prePassRenderer2 = this.enablePrePassRenderer(); + if (prePassRenderer2) { + this._subSurfaceConfiguration = new SubSurfaceConfiguration(this); + prePassRenderer2.addEffectConfiguration(this._subSurfaceConfiguration); + return this._subSurfaceConfiguration; + } + return null; + }; + Scene.prototype.disableSubSurfaceForPrePass = function() { + if (!this._subSurfaceConfiguration) { + return; + } + this._subSurfaceConfiguration.dispose(); + this._subSurfaceConfiguration = null; + }; + SubSurfaceConfiguration._SceneComponentInitialization = (scene31) => { + let component = scene31._getComponent(SceneComponentConstants.NAME_SUBSURFACE); + if (!component) { + component = new SubSurfaceSceneComponent(scene31); + scene31._addComponent(component); + } + }; +}); + // node_modules/@babylonjs/core/Shaders/outline.fragment.js -var name245 = "outlinePixelShader"; -var shader245 = `#ifdef LOGARITHMICDEPTH +var name246, shader245; +var init_outline_fragment = __esm(() => { + init_shaderStore(); + init_clipPlaneFragmentDeclaration(); + init_logDepthDeclaration(); + init_clipPlaneFragment(); + init_logDepthFragment(); + name246 = "outlinePixelShader"; + shader245 = `#ifdef LOGARITHMICDEPTH #extension GL_EXT_frag_depth : enable #endif uniform vec4 color; @@ -161790,11 +181798,29 @@ discard; gl_FragColor=color; #define CUSTOM_FRAGMENT_MAIN_END }`; -ShaderStore.ShadersStore[name245] = shader245; + ShaderStore.ShadersStore[name246] = shader245; +}); // node_modules/@babylonjs/core/Shaders/outline.vertex.js -var name246 = "outlineVertexShader"; -var shader246 = `attribute vec3 position;attribute vec3 normal; +var name247, shader246; +var init_outline_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_morphTargetsVertexGlobalDeclaration(); + init_morphTargetsVertexDeclaration(); + init_clipPlaneVertexDeclaration(); + init_instancesDeclaration(); + init_logDepthDeclaration(); + init_morphTargetsVertexGlobal(); + init_morphTargetsVertex(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + init_logDepthVertex(); + name247 = "outlineVertexShader"; + shader246 = `attribute vec3 position;attribute vec3 normal; #include #include #include @@ -161838,42 +181864,10 @@ vUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0)); #include } `; -ShaderStore.ShadersStore[name246] = shader246; - -// node_modules/@babylonjs/core/Rendering/outlineRenderer.js -Scene.prototype.getOutlineRenderer = function() { - if (!this._outlineRenderer) { - this._outlineRenderer = new OutlineRenderer(this); - } - return this._outlineRenderer; -}; -Object.defineProperty(Mesh.prototype, "renderOutline", { - get: function() { - return this._renderOutline; - }, - set: function(value) { - if (value) { - this.getScene().getOutlineRenderer(); - } - this._renderOutline = value; - }, - enumerable: true, - configurable: true -}); -Object.defineProperty(Mesh.prototype, "renderOverlay", { - get: function() { - return this._renderOverlay; - }, - set: function(value) { - if (value) { - this.getScene().getOutlineRenderer(); - } - this._renderOverlay = value; - }, - enumerable: true, - configurable: true + ShaderStore.ShadersStore[name247] = shader246; }); +// node_modules/@babylonjs/core/Rendering/outlineRenderer.js class OutlineRenderer { constructor(scene32) { this.name = SceneComponentConstants.NAME_OUTLINERENDERER; @@ -162075,7 +182069,51 @@ class OutlineRenderer { } } } -OutlineRenderer._StencilReference = 4; +var init_outlineRenderer = __esm(() => { + init_buffer(); + init_mesh(); + init_scene(); + init_sceneComponent(); + init_drawWrapper(); + init_materialHelper(); + init_outline_fragment(); + init_outline_vertex(); + init_clipPlaneMaterialHelper(); + Scene.prototype.getOutlineRenderer = function() { + if (!this._outlineRenderer) { + this._outlineRenderer = new OutlineRenderer(this); + } + return this._outlineRenderer; + }; + Object.defineProperty(Mesh.prototype, "renderOutline", { + get: function() { + return this._renderOutline; + }, + set: function(value) { + if (value) { + this.getScene().getOutlineRenderer(); + } + this._renderOutline = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Mesh.prototype, "renderOverlay", { + get: function() { + return this._renderOverlay; + }, + set: function(value) { + if (value) { + this.getScene().getOutlineRenderer(); + } + this._renderOverlay = value; + }, + enumerable: true, + configurable: true + }); + OutlineRenderer._StencilReference = 4; +}); + // node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingObject.js class FluidRenderingObject { get particleSize() { @@ -162217,6 +182255,10 @@ class FluidRenderingObject { (_b = this._thicknessEffectWrapper) === null || _b === undefined || _b.dispose(); } } +var init_fluidRenderingObject = __esm(() => { + init_effectRenderer(); + init_observable(); +}); // node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js class FluidRenderingObjectParticleSystem extends FluidRenderingObject { @@ -162282,6 +182324,9 @@ class FluidRenderingObjectParticleSystem extends FluidRenderingObject { this._particleSystem.updateInAnimate = this._updateInAnimate; } } +var init_fluidRenderingObjectParticleSystem = __esm(() => { + init_fluidRenderingObject(); +}); // node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingTextures.js class FluidRenderingTextures { @@ -162314,7 +182359,7 @@ class FluidRenderingTextures { get textureBlur() { return this._textureBlurred; } - constructor(name247, scene32, width, height, blurTextureSizeX, blurTextureSizeY, textureType = 1, textureFormat = 6, blurTextureType = 1, blurTextureFormat = 6, useStandardBlur = false, camera31 = null, generateDepthBuffer = true, samples = 1) { + constructor(name248, scene32, width, height, blurTextureSizeX, blurTextureSizeY, textureType = 1, textureFormat = 6, blurTextureType = 1, blurTextureFormat = 6, useStandardBlur = false, camera31 = null, generateDepthBuffer = true, samples = 1) { this.enableBlur = true; this.blurSizeDivisor = 1; this.blurFilterSize = 7; @@ -162323,7 +182368,7 @@ class FluidRenderingTextures { this.blurDepthScale = 10; this.particleSize = 0.02; this.onDisposeObservable = new Observable; - this._name = name247; + this._name = name248; this._scene = scene32; this._camera = camera31; this._engine = scene32.getEngine(); @@ -162534,19 +182579,14 @@ class FluidRenderingTextures { this._blurPostProcesses = null; } } +var init_fluidRenderingTextures = __esm(() => { + init_texture(); + init_math_vector(); + init_postProcess(); + init_observable(); +}); // node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js -var FluidRenderingDebug; -(function(FluidRenderingDebug2) { - FluidRenderingDebug2[FluidRenderingDebug2["DepthTexture"] = 0] = "DepthTexture"; - FluidRenderingDebug2[FluidRenderingDebug2["DepthBlurredTexture"] = 1] = "DepthBlurredTexture"; - FluidRenderingDebug2[FluidRenderingDebug2["ThicknessTexture"] = 2] = "ThicknessTexture"; - FluidRenderingDebug2[FluidRenderingDebug2["ThicknessBlurredTexture"] = 3] = "ThicknessBlurredTexture"; - FluidRenderingDebug2[FluidRenderingDebug2["DiffuseTexture"] = 4] = "DiffuseTexture"; - FluidRenderingDebug2[FluidRenderingDebug2["Normals"] = 5] = "Normals"; - FluidRenderingDebug2[FluidRenderingDebug2["DiffuseRendering"] = 6] = "DiffuseRendering"; -})(FluidRenderingDebug || (FluidRenderingDebug = {})); - class FluidRenderingTargetRenderer { get needInitialization() { return this._needInitialization; @@ -163091,6 +183131,23 @@ class FluidRenderingTargetRenderer { this._needInitialization = false; } } +var FluidRenderingDebug; +var init_fluidRenderingTargetRenderer = __esm(() => { + init_math_color(); + init_math_vector(); + init_observable(); + init_postProcess(); + init_fluidRenderingTextures(); + (function(FluidRenderingDebug2) { + FluidRenderingDebug2[FluidRenderingDebug2["DepthTexture"] = 0] = "DepthTexture"; + FluidRenderingDebug2[FluidRenderingDebug2["DepthBlurredTexture"] = 1] = "DepthBlurredTexture"; + FluidRenderingDebug2[FluidRenderingDebug2["ThicknessTexture"] = 2] = "ThicknessTexture"; + FluidRenderingDebug2[FluidRenderingDebug2["ThicknessBlurredTexture"] = 3] = "ThicknessBlurredTexture"; + FluidRenderingDebug2[FluidRenderingDebug2["DiffuseTexture"] = 4] = "DiffuseTexture"; + FluidRenderingDebug2[FluidRenderingDebug2["Normals"] = 5] = "Normals"; + FluidRenderingDebug2[FluidRenderingDebug2["DiffuseRendering"] = 6] = "DiffuseRendering"; + })(FluidRenderingDebug || (FluidRenderingDebug = {})); +}); // node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js class FluidRenderingObjectCustomParticles extends FluidRenderingObject { @@ -163108,10 +183165,10 @@ class FluidRenderingObjectCustomParticles extends FluidRenderingObject { this.addBuffers(buffers); } addBuffers(buffers) { - for (const name247 in buffers) { + for (const name248 in buffers) { let stride; let instanced = true; - switch (name247) { + switch (name248) { case "velocity": stride = 3; break; @@ -163119,7 +183176,7 @@ class FluidRenderingObjectCustomParticles extends FluidRenderingObject { instanced = false; break; } - this._vertexBuffers[name247] = new VertexBuffer(this._engine, buffers[name247], name247, true, false, stride, instanced); + this._vertexBuffers[name248] = new VertexBuffer(this._engine, buffers[name248], name248, true, false, stride, instanced); } } _createEffects() { @@ -163173,16 +183230,25 @@ class FluidRenderingObjectCustomParticles extends FluidRenderingObject { var _a; super.dispose(); (_a = this._diffuseEffectWrapper) === null || _a === undefined || _a.dispose(); - for (const name247 in this._vertexBuffers) { - this._vertexBuffers[name247].dispose(); + for (const name248 in this._vertexBuffers) { + this._vertexBuffers[name248].dispose(); } this._vertexBuffers = {}; } } +var init_fluidRenderingObjectCustomParticles = __esm(() => { + init_buffer(); + init_effectRenderer(); + init_fluidRenderingObject(); +}); // node_modules/@babylonjs/core/Shaders/copyTextureToTexture.fragment.js -var name247 = "copyTextureToTexturePixelShader"; -var shader247 = `uniform float conversion;uniform sampler2D textureSampler;varying vec2 vUV; +var name248, shader247; +var init_copyTextureToTexture_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + name248 = "copyTextureToTexturePixelShader"; + shader247 = `uniform float conversion;uniform sampler2D textureSampler;varying vec2 vUV; #include void main(void) {vec4 color=texture2D(textureSampler,vUV); @@ -163194,16 +183260,10 @@ gl_FragColor=color; #endif } `; -ShaderStore.ShadersStore[name247] = shader247; + ShaderStore.ShadersStore[name248] = shader247; +}); // node_modules/@babylonjs/core/Misc/copyTextureToTexture.js -var ConversionMode; -(function(ConversionMode2) { - ConversionMode2[ConversionMode2["None"] = 0] = "None"; - ConversionMode2[ConversionMode2["ToLinearSpace"] = 1] = "ToLinearSpace"; - ConversionMode2[ConversionMode2["ToGammaSpace"] = 2] = "ToGammaSpace"; -})(ConversionMode || (ConversionMode = {})); - class CopyTextureToTexture { _textureIsInternal(texture67) { return texture67.getInternalTexture === undefined; @@ -163257,6 +183317,16 @@ class CopyTextureToTexture { this._renderer.dispose(); } } +var ConversionMode; +var init_copyTextureToTexture = __esm(() => { + init_effectRenderer(); + init_copyTextureToTexture_fragment(); + (function(ConversionMode2) { + ConversionMode2[ConversionMode2["None"] = 0] = "None"; + ConversionMode2[ConversionMode2["ToLinearSpace"] = 1] = "ToLinearSpace"; + ConversionMode2[ConversionMode2["ToGammaSpace"] = 2] = "ToGammaSpace"; + })(ConversionMode || (ConversionMode = {})); +}); // node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js class FluidRenderingDepthTextureCopy { @@ -163288,10 +183358,16 @@ class FluidRenderingDepthTextureCopy { this._copyTextureToTexture.dispose(); } } +var init_fluidRenderingDepthTextureCopy = __esm(() => { + init_copyTextureToTexture(); +}); // node_modules/@babylonjs/core/Shaders/fluidRenderingParticleDepth.vertex.js -var name248 = "fluidRenderingParticleDepthVertexShader"; -var shader248 = `attribute vec3 position;attribute vec2 offset;uniform mat4 view;uniform mat4 projection;uniform vec2 size;varying vec2 uv;varying vec3 viewPos;varying float sphereRadius; +var name249, shader248; +var init_fluidRenderingParticleDepth_vertex = __esm(() => { + init_shaderStore(); + name249 = "fluidRenderingParticleDepthVertexShader"; + shader248 = `attribute vec3 position;attribute vec2 offset;uniform mat4 view;uniform mat4 projection;uniform vec2 size;varying vec2 uv;varying vec3 viewPos;varying float sphereRadius; #ifdef FLUIDRENDERING_VELOCITY attribute vec3 velocity;varying float velocityNorm; #endif @@ -163301,11 +183377,15 @@ velocityNorm=length(velocity); #endif } `; -ShaderStore.ShadersStore[name248] = shader248; + ShaderStore.ShadersStore[name249] = shader248; +}); // node_modules/@babylonjs/core/Shaders/fluidRenderingParticleDepth.fragment.js -var name249 = "fluidRenderingParticleDepthPixelShader"; -var shader249 = `uniform mat4 projection;varying vec2 uv;varying vec3 viewPos;varying float sphereRadius; +var name250, shader249; +var init_fluidRenderingParticleDepth_fragment = __esm(() => { + init_shaderStore(); + name250 = "fluidRenderingParticleDepthPixelShader"; + shader249 = `uniform mat4 projection;varying vec2 uv;varying vec3 viewPos;varying float sphereRadius; #ifdef FLUIDRENDERING_VELOCITY varying float velocityNorm; #endif @@ -163329,51 +183409,79 @@ glFragColor=vec4(realViewPos.z,0.,0.,1.); #endif } `; -ShaderStore.ShadersStore[name249] = shader249; + ShaderStore.ShadersStore[name250] = shader249; +}); // node_modules/@babylonjs/core/Shaders/fluidRenderingParticleThickness.vertex.js -var name250 = "fluidRenderingParticleThicknessVertexShader"; -var shader250 = `attribute vec3 position;attribute vec2 offset;uniform mat4 view;uniform mat4 projection;uniform vec2 size;varying vec2 uv;void main(void) {vec3 cornerPos;cornerPos.xy=vec2(offset.x-0.5,offset.y-0.5)*size;cornerPos.z=0.0;vec3 viewPos=(view*vec4(position,1.0)).xyz+cornerPos;gl_Position=projection*vec4(viewPos,1.0);uv=offset;} +var name251, shader250; +var init_fluidRenderingParticleThickness_vertex = __esm(() => { + init_shaderStore(); + name251 = "fluidRenderingParticleThicknessVertexShader"; + shader250 = `attribute vec3 position;attribute vec2 offset;uniform mat4 view;uniform mat4 projection;uniform vec2 size;varying vec2 uv;void main(void) {vec3 cornerPos;cornerPos.xy=vec2(offset.x-0.5,offset.y-0.5)*size;cornerPos.z=0.0;vec3 viewPos=(view*vec4(position,1.0)).xyz+cornerPos;gl_Position=projection*vec4(viewPos,1.0);uv=offset;} `; -ShaderStore.ShadersStore[name250] = shader250; + ShaderStore.ShadersStore[name251] = shader250; +}); // node_modules/@babylonjs/core/Shaders/fluidRenderingParticleThickness.fragment.js -var name251 = "fluidRenderingParticleThicknessPixelShader"; -var shader251 = `uniform float particleAlpha;varying vec2 uv;void main(void) {vec3 normal;normal.xy=uv*2.0-1.0;float r2=dot(normal.xy,normal.xy);if (r2>1.0) discard;float thickness=sqrt(1.0-r2);glFragColor=vec4(vec3(particleAlpha*thickness),1.0);} +var name252, shader251; +var init_fluidRenderingParticleThickness_fragment = __esm(() => { + init_shaderStore(); + name252 = "fluidRenderingParticleThicknessPixelShader"; + shader251 = `uniform float particleAlpha;varying vec2 uv;void main(void) {vec3 normal;normal.xy=uv*2.0-1.0;float r2=dot(normal.xy,normal.xy);if (r2>1.0) discard;float thickness=sqrt(1.0-r2);glFragColor=vec4(vec3(particleAlpha*thickness),1.0);} `; -ShaderStore.ShadersStore[name251] = shader251; + ShaderStore.ShadersStore[name252] = shader251; +}); // node_modules/@babylonjs/core/Shaders/fluidRenderingParticleDiffuse.vertex.js -var name252 = "fluidRenderingParticleDiffuseVertexShader"; -var shader252 = `attribute vec3 position;attribute vec2 offset;attribute vec4 color;uniform mat4 view;uniform mat4 projection;uniform vec2 size;varying vec2 uv;varying vec3 diffuseColor;void main(void) {vec3 cornerPos;cornerPos.xy=vec2(offset.x-0.5,offset.y-0.5)*size;cornerPos.z=0.0;vec3 viewPos=(view*vec4(position,1.0)).xyz+cornerPos;gl_Position=projection*vec4(viewPos,1.0);uv=offset;diffuseColor=color.rgb;} +var name253, shader252; +var init_fluidRenderingParticleDiffuse_vertex = __esm(() => { + init_shaderStore(); + name253 = "fluidRenderingParticleDiffuseVertexShader"; + shader252 = `attribute vec3 position;attribute vec2 offset;attribute vec4 color;uniform mat4 view;uniform mat4 projection;uniform vec2 size;varying vec2 uv;varying vec3 diffuseColor;void main(void) {vec3 cornerPos;cornerPos.xy=vec2(offset.x-0.5,offset.y-0.5)*size;cornerPos.z=0.0;vec3 viewPos=(view*vec4(position,1.0)).xyz+cornerPos;gl_Position=projection*vec4(viewPos,1.0);uv=offset;diffuseColor=color.rgb;} `; -ShaderStore.ShadersStore[name252] = shader252; + ShaderStore.ShadersStore[name253] = shader252; +}); // node_modules/@babylonjs/core/Shaders/fluidRenderingParticleDiffuse.fragment.js -var name253 = "fluidRenderingParticleDiffusePixelShader"; -var shader253 = `uniform float particleAlpha;varying vec2 uv;varying vec3 diffuseColor;void main(void) {vec3 normal;normal.xy=uv*2.0-1.0;float r2=dot(normal.xy,normal.xy);if (r2>1.0) discard;glFragColor=vec4(diffuseColor,1.0);} +var name254, shader253; +var init_fluidRenderingParticleDiffuse_fragment = __esm(() => { + init_shaderStore(); + name254 = "fluidRenderingParticleDiffusePixelShader"; + shader253 = `uniform float particleAlpha;varying vec2 uv;varying vec3 diffuseColor;void main(void) {vec3 normal;normal.xy=uv*2.0-1.0;float r2=dot(normal.xy,normal.xy);if (r2>1.0) discard;glFragColor=vec4(diffuseColor,1.0);} `; -ShaderStore.ShadersStore[name253] = shader253; + ShaderStore.ShadersStore[name254] = shader253; +}); // node_modules/@babylonjs/core/Shaders/fluidRenderingBilateralBlur.fragment.js -var name254 = "fluidRenderingBilateralBlurPixelShader"; -var shader254 = `uniform sampler2D textureSampler;uniform int maxFilterSize;uniform vec2 blurDir;uniform float projectedParticleConstant;uniform float depthThreshold;varying vec2 vUV;void main(void) {float depth=textureLod(textureSampler,vUV,0.).x;if (depth>=1e6 || depth<=0.) {glFragColor=vec4(vec3(depth),1.);return;} +var name255, shader254; +var init_fluidRenderingBilateralBlur_fragment = __esm(() => { + init_shaderStore(); + name255 = "fluidRenderingBilateralBlurPixelShader"; + shader254 = `uniform sampler2D textureSampler;uniform int maxFilterSize;uniform vec2 blurDir;uniform float projectedParticleConstant;uniform float depthThreshold;varying vec2 vUV;void main(void) {float depth=textureLod(textureSampler,vUV,0.).x;if (depth>=1e6 || depth<=0.) {glFragColor=vec4(vec3(depth),1.);return;} int filterSize=min(maxFilterSize,int(ceil(projectedParticleConstant/depth)));float sigma=float(filterSize)/3.0;float two_sigma2=2.0*sigma*sigma;float sigmaDepth=depthThreshold/3.0;float two_sigmaDepth2=2.0*sigmaDepth*sigmaDepth;float sum=0.;float wsum=0.;float sumVel=0.;for (int x=-filterSize; x<=filterSize; ++x) {vec2 coords=vec2(x);vec2 sampleDepthVel=textureLod(textureSampler,vUV+coords*blurDir,0.).rg;float r=dot(coords,coords);float w=exp(-r/two_sigma2);float rDepth=sampleDepthVel.r-depth;float wd=exp(-rDepth*rDepth/two_sigmaDepth2);sum+=sampleDepthVel.r*w*wd;sumVel+=sampleDepthVel.g*w*wd;wsum+=w*wd;} glFragColor=vec4(sum/wsum,sumVel/wsum,0.,1.);} `; -ShaderStore.ShadersStore[name254] = shader254; + ShaderStore.ShadersStore[name255] = shader254; +}); // node_modules/@babylonjs/core/Shaders/fluidRenderingStandardBlur.fragment.js -var name255 = "fluidRenderingStandardBlurPixelShader"; -var shader255 = `uniform sampler2D textureSampler;uniform int filterSize;uniform vec2 blurDir;varying vec2 vUV;void main(void) {vec4 s=textureLod(textureSampler,vUV,0.);if (s.r==0.) {glFragColor=vec4(0.,0.,0.,1.);return;} +var name256, shader255; +var init_fluidRenderingStandardBlur_fragment = __esm(() => { + init_shaderStore(); + name256 = "fluidRenderingStandardBlurPixelShader"; + shader255 = `uniform sampler2D textureSampler;uniform int filterSize;uniform vec2 blurDir;varying vec2 vUV;void main(void) {vec4 s=textureLod(textureSampler,vUV,0.);if (s.r==0.) {glFragColor=vec4(0.,0.,0.,1.);return;} float sigma=float(filterSize)/3.0;float twoSigma2=2.0*sigma*sigma;vec4 sum=vec4(0.);float wsum=0.;for (int x=-filterSize; x<=filterSize; ++x) {vec2 coords=vec2(x);vec4 sampl=textureLod(textureSampler,vUV+coords*blurDir,0.);float w=exp(-coords.x*coords.x/twoSigma2);sum+=sampl*w;wsum+=w;} sum/=wsum;glFragColor=vec4(sum.rgb,1.);} `; -ShaderStore.ShadersStore[name255] = shader255; + ShaderStore.ShadersStore[name256] = shader255; +}); // node_modules/@babylonjs/core/Shaders/fluidRenderingRender.fragment.js -var name256 = "fluidRenderingRenderPixelShader"; -var shader256 = `/* disable_uniformity_analysis */ +var name257, shader256; +var init_fluidRenderingRender_fragment = __esm(() => { + init_shaderStore(); + name257 = "fluidRenderingRenderPixelShader"; + shader256 = `/* disable_uniformity_analysis */ #define IOR 1.333 #define ETA 1.0/IOR #define F0 0.02 @@ -163457,35 +183565,10 @@ float velocity=depthVel.g;finalColor=mix(finalColor,vec3(1.0),smoothstep(0.3,1.0 #endif glFragColor=vec4(finalColor,transmitted.a);} `; -ShaderStore.ShadersStore[name256] = shader256; - -// node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderer.js -var IsParticleSystemObject = function(obj) { - return !!obj.particleSystem; -}; -Object.defineProperty(Scene.prototype, "fluidRenderer", { - get: function() { - return this._fluidRenderer; - }, - set: function(value) { - this._fluidRenderer = value; - }, - enumerable: true, - configurable: true + ShaderStore.ShadersStore[name257] = shader256; }); -Scene.prototype.enableFluidRenderer = function() { - if (this._fluidRenderer) { - return this._fluidRenderer; - } - this._fluidRenderer = new FluidRenderer(this); - return this._fluidRenderer; -}; -Scene.prototype.disableFluidRenderer = function() { - var _a; - (_a = this._fluidRenderer) === null || _a === undefined || _a.dispose(); - this._fluidRenderer = null; -}; +// node_modules/@babylonjs/core/Rendering/fluidRenderer/fluidRenderer.js class FluidRendererSceneComponent { constructor(scene33) { this.name = SceneComponentConstants.NAME_FLUIDRENDERER; @@ -163783,6 +183866,59 @@ class FluidRenderer { this._cameras.clear(); } } +var IsParticleSystemObject; +var init_fluidRenderer = __esm(() => { + init_scene(); + init_sceneComponent(); + init_fluidRenderingObjectParticleSystem(); + init_fluidRenderingTargetRenderer(); + init_fluidRenderingObjectCustomParticles(); + init_fluidRenderingDepthTextureCopy(); + init_fluidRenderingParticleDepth_vertex(); + init_fluidRenderingParticleDepth_fragment(); + init_fluidRenderingParticleThickness_vertex(); + init_fluidRenderingParticleThickness_fragment(); + init_fluidRenderingParticleDiffuse_vertex(); + init_fluidRenderingParticleDiffuse_fragment(); + init_fluidRenderingBilateralBlur_fragment(); + init_fluidRenderingStandardBlur_fragment(); + init_fluidRenderingRender_fragment(); + IsParticleSystemObject = function(obj) { + return !!obj.particleSystem; + }; + Object.defineProperty(Scene.prototype, "fluidRenderer", { + get: function() { + return this._fluidRenderer; + }, + set: function(value) { + this._fluidRenderer = value; + }, + enumerable: true, + configurable: true + }); + Scene.prototype.enableFluidRenderer = function() { + if (this._fluidRenderer) { + return this._fluidRenderer; + } + this._fluidRenderer = new FluidRenderer(this); + return this._fluidRenderer; + }; + Scene.prototype.disableFluidRenderer = function() { + var _a; + (_a = this._fluidRenderer) === null || _a === undefined || _a.dispose(); + this._fluidRenderer = null; + }; +}); + +// node_modules/@babylonjs/core/Rendering/fluidRenderer/index.js +var init_fluidRenderer2 = __esm(() => { + init_fluidRenderer(); + init_fluidRenderingObject(); + init_fluidRenderingObjectParticleSystem(); + init_fluidRenderingObjectCustomParticles(); + init_fluidRenderingTargetRenderer(); +}); + // node_modules/@babylonjs/core/Rendering/GaussianSplatting/gaussianSplatting.js class GaussianSplatting { get vertexCount() { @@ -163850,7 +183986,7 @@ class GaussianSplatting { this._covB[i * 3 + 2] = M[8] * M[8] + M[9] * M[9] + M[10] * M[10]; } } - constructor(name257, scene33) { + constructor(name258, scene33) { var _a; this._vertexCount = 0; this._modelViewMatrix = Matrix.Identity(); @@ -163859,7 +183995,7 @@ class GaussianSplatting { this.name = "GaussianSplatting"; this._worker = null; this.scene = scene33; - this.name = name257; + this.name = name258; this._createMaterial(scene33); (_a = this._worker) === null || _a === undefined || _a.terminate(); this._worker = null; @@ -163936,7 +184072,14 @@ class GaussianSplatting { this.mesh = null; } } -GaussianSplatting._VertexShaderSource = ` +var init_gaussianSplatting = __esm(() => { + init_effect(); + init_shaderMaterial(); + init_math_vector(); + init_mesh(); + init_mesh_vertexData(); + init_tools(); + GaussianSplatting._VertexShaderSource = ` precision mediump float; attribute vec2 position; @@ -164000,7 +184143,7 @@ GaussianSplatting._VertexShaderSource = ` + (position.x * majorAxis * 1. / viewport + position.y * minorAxis * 1. / viewport) * pos2d.w, pos2d.zw); }`; -GaussianSplatting._FragmentShaderSource = ` + GaussianSplatting._FragmentShaderSource = ` precision highp float; varying vec4 vColor; varying vec2 vPosition; @@ -164010,50 +184153,78 @@ GaussianSplatting._FragmentShaderSource = ` float B = exp(A) * vColor.a; gl_FragColor = vec4(vColor.rgb, B); }`; -GaussianSplatting._CreateWorker = function(self2) { - let viewProj; - let lastProj = []; - let vertexCount = 0; - let positions; - const runSort = (viewProj2) => { - vertexCount = positions.length; - const depthMix = new BigInt64Array(vertexCount); - const indices = new Uint32Array(depthMix.buffer); - for (let j = 0;j < vertexCount; j++) { - indices[2 * j] = j; - } - const floatMix = new Float32Array(depthMix.buffer); - for (let j = 0;j < vertexCount; j++) { - floatMix[2 * j + 1] = 1e4 - (viewProj2[2] * positions[3 * j + 0] + viewProj2[6] * positions[3 * j + 1] + viewProj2[10] * positions[3 * j + 2]); - } - lastProj = viewProj2; - depthMix.sort(); - self2.postMessage({ depthMix }, [depthMix.buffer]); - }; - let sortRunning = false; - const throttledSort = () => { - if (!sortRunning) { - sortRunning = true; - const lastView = viewProj; - runSort(lastView); - setTimeout(() => { - sortRunning = false; - if (lastView !== viewProj) { - throttledSort(); - } - }, 0); - } - }; - self2.onmessage = (e) => { - viewProj = e.data.view; - const dot = lastProj[2] * viewProj[2] + lastProj[6] * viewProj[6] + lastProj[10] * viewProj[10]; - if (Math.abs(dot - 1) < 0.01) { - return; - } - positions = e.data.positions; - throttledSort(); + GaussianSplatting._CreateWorker = function(self2) { + let viewProj; + let lastProj = []; + let vertexCount = 0; + let positions; + const runSort = (viewProj2) => { + vertexCount = positions.length; + const depthMix = new BigInt64Array(vertexCount); + const indices = new Uint32Array(depthMix.buffer); + for (let j = 0;j < vertexCount; j++) { + indices[2 * j] = j; + } + const floatMix = new Float32Array(depthMix.buffer); + for (let j = 0;j < vertexCount; j++) { + floatMix[2 * j + 1] = 1e4 - (viewProj2[2] * positions[3 * j + 0] + viewProj2[6] * positions[3 * j + 1] + viewProj2[10] * positions[3 * j + 2]); + } + lastProj = viewProj2; + depthMix.sort(); + self2.postMessage({ depthMix }, [depthMix.buffer]); + }; + let sortRunning = false; + const throttledSort = () => { + if (!sortRunning) { + sortRunning = true; + const lastView = viewProj; + runSort(lastView); + setTimeout(() => { + sortRunning = false; + if (lastView !== viewProj) { + throttledSort(); + } + }, 0); + } + }; + self2.onmessage = (e) => { + viewProj = e.data.view; + const dot = lastProj[2] * viewProj[2] + lastProj[6] * viewProj[6] + lastProj[10] * viewProj[10]; + if (Math.abs(dot - 1) < 0.01) { + return; + } + positions = e.data.positions; + throttledSort(); + }; }; -}; +}); + +// node_modules/@babylonjs/core/Rendering/GaussianSplatting/index.js +var init_GaussianSplatting = __esm(() => { + init_gaussianSplatting(); +}); + +// node_modules/@babylonjs/core/Rendering/index.js +var init_Rendering = __esm(() => { + init_boundingBoxRenderer(); + init_depthRenderer(); + init_depthRendererSceneComponent(); + init_depthPeelingRenderer(); + init_depthPeelingSceneComponent(); + init_edgesRenderer(); + init_geometryBufferRenderer(); + init_geometryBufferRendererSceneComponent(); + init_prePassRenderer(); + init_prePassRendererSceneComponent(); + init_subSurfaceSceneComponent(); + init_outlineRenderer(); + init_renderingGroup(); + init_renderingManager(); + init_utilityLayerRenderer(); + init_fluidRenderer2(); + init_GaussianSplatting(); +}); + // node_modules/@babylonjs/core/Sprites/thinSprite.js class ThinSprite { get animationStarted() { @@ -164131,6 +184302,8 @@ class ThinSprite { } } } +var init_thinSprite = __esm(() => { +}); // node_modules/@babylonjs/core/Sprites/sprite.js class Sprite extends ThinSprite { @@ -164144,9 +184317,9 @@ class Sprite extends ThinSprite { get manager() { return this._manager; } - constructor(name257, manager) { + constructor(name258, manager) { super(); - this.name = name257; + this.name = name258; this.animations = new Array; this.isPickable = false; this.useAlphaForPicking = false; @@ -164254,125 +184427,18 @@ class Sprite extends ThinSprite { return sprite; } } -// node_modules/@babylonjs/core/Sprites/spriteSceneComponent.js -Scene.prototype._internalPickSprites = function(ray13, predicate, fastCheck, camera31) { - if (!PickingInfo) { - return null; - } - let pickingInfo11 = null; - if (!camera31) { - if (!this.activeCamera) { - return null; - } - camera31 = this.activeCamera; - } - if (this.spriteManagers && this.spriteManagers.length > 0) { - for (let spriteIndex = 0;spriteIndex < this.spriteManagers.length; spriteIndex++) { - const spriteManager = this.spriteManagers[spriteIndex]; - if (!spriteManager.isPickable) { - continue; - } - const result = spriteManager.intersects(ray13, camera31, predicate, fastCheck); - if (!result || !result.hit) { - continue; - } - if (!fastCheck && pickingInfo11 != null && result.distance >= pickingInfo11.distance) { - continue; - } - pickingInfo11 = result; - if (fastCheck) { - break; - } - } - } - return pickingInfo11 || new PickingInfo; -}; -Scene.prototype._internalMultiPickSprites = function(ray13, predicate, camera31) { - if (!PickingInfo) { - return null; - } - let pickingInfos = []; - if (!camera31) { - if (!this.activeCamera) { - return null; - } - camera31 = this.activeCamera; - } - if (this.spriteManagers && this.spriteManagers.length > 0) { - for (let spriteIndex = 0;spriteIndex < this.spriteManagers.length; spriteIndex++) { - const spriteManager = this.spriteManagers[spriteIndex]; - if (!spriteManager.isPickable) { - continue; - } - const results = spriteManager.multiIntersects(ray13, camera31, predicate); - if (results !== null) { - pickingInfos = pickingInfos.concat(results); - } - } - } - return pickingInfos; -}; -Scene.prototype.pickSprite = function(x, y, predicate, fastCheck, camera31) { - if (!this._tempSpritePickingRay) { - return null; - } - this.createPickingRayInCameraSpaceToRef(x, y, this._tempSpritePickingRay, camera31); - const result = this._internalPickSprites(this._tempSpritePickingRay, predicate, fastCheck, camera31); - if (result) { - result.ray = this.createPickingRayInCameraSpace(x, y, camera31); - } - return result; -}; -Scene.prototype.pickSpriteWithRay = function(ray13, predicate, fastCheck, camera31) { - if (!this._tempSpritePickingRay) { - return null; - } - if (!camera31) { - if (!this.activeCamera) { - return null; - } - camera31 = this.activeCamera; - } - Ray.TransformToRef(ray13, camera31.getViewMatrix(), this._tempSpritePickingRay); - const result = this._internalPickSprites(this._tempSpritePickingRay, predicate, fastCheck, camera31); - if (result) { - result.ray = ray13; - } - return result; -}; -Scene.prototype.multiPickSprite = function(x, y, predicate, camera31) { - this.createPickingRayInCameraSpaceToRef(x, y, this._tempSpritePickingRay, camera31); - return this._internalMultiPickSprites(this._tempSpritePickingRay, predicate, camera31); -}; -Scene.prototype.multiPickSpriteWithRay = function(ray13, predicate, camera31) { - if (!this._tempSpritePickingRay) { - return null; - } - if (!camera31) { - if (!this.activeCamera) { - return null; - } - camera31 = this.activeCamera; - } - Ray.TransformToRef(ray13, camera31.getViewMatrix(), this._tempSpritePickingRay); - return this._internalMultiPickSprites(this._tempSpritePickingRay, predicate, camera31); -}; -Scene.prototype.setPointerOverSprite = function(sprite) { - if (this._pointerOverSprite === sprite) { - return; - } - if (this._pointerOverSprite && this._pointerOverSprite.actionManager) { - this._pointerOverSprite.actionManager.processTrigger(10, ActionEvent.CreateNewFromSprite(this._pointerOverSprite, this)); - } - this._pointerOverSprite = sprite; - if (this._pointerOverSprite && this._pointerOverSprite.actionManager) { - this._pointerOverSprite.actionManager.processTrigger(9, ActionEvent.CreateNewFromSprite(this._pointerOverSprite, this)); - } -}; -Scene.prototype.getPointerOverSprite = function() { - return this._pointerOverSprite; -}; +var init_sprite = __esm(() => { + init_math_vector(); + init_math_color(); + init_observable(); + init_thinSprite(); +}); + +// node_modules/@babylonjs/core/Sprites/ISprites.js +var init_ISprites = __esm(() => { +}); +// node_modules/@babylonjs/core/Sprites/spriteSceneComponent.js class SpriteSceneComponent { constructor(scene34) { this.name = SceneComponentConstants.NAME_SPRITE; @@ -164487,18 +184553,153 @@ class SpriteSceneComponent { return pickResult; } } +var init_spriteSceneComponent = __esm(() => { + init_observable(); + init_scene(); + init_ray(); + init_pickingInfo(); + init_sceneComponent(); + init_actionEvent(); + Scene.prototype._internalPickSprites = function(ray13, predicate, fastCheck, camera31) { + if (!PickingInfo) { + return null; + } + let pickingInfo11 = null; + if (!camera31) { + if (!this.activeCamera) { + return null; + } + camera31 = this.activeCamera; + } + if (this.spriteManagers && this.spriteManagers.length > 0) { + for (let spriteIndex = 0;spriteIndex < this.spriteManagers.length; spriteIndex++) { + const spriteManager = this.spriteManagers[spriteIndex]; + if (!spriteManager.isPickable) { + continue; + } + const result = spriteManager.intersects(ray13, camera31, predicate, fastCheck); + if (!result || !result.hit) { + continue; + } + if (!fastCheck && pickingInfo11 != null && result.distance >= pickingInfo11.distance) { + continue; + } + pickingInfo11 = result; + if (fastCheck) { + break; + } + } + } + return pickingInfo11 || new PickingInfo; + }; + Scene.prototype._internalMultiPickSprites = function(ray13, predicate, camera31) { + if (!PickingInfo) { + return null; + } + let pickingInfos = []; + if (!camera31) { + if (!this.activeCamera) { + return null; + } + camera31 = this.activeCamera; + } + if (this.spriteManagers && this.spriteManagers.length > 0) { + for (let spriteIndex = 0;spriteIndex < this.spriteManagers.length; spriteIndex++) { + const spriteManager = this.spriteManagers[spriteIndex]; + if (!spriteManager.isPickable) { + continue; + } + const results = spriteManager.multiIntersects(ray13, camera31, predicate); + if (results !== null) { + pickingInfos = pickingInfos.concat(results); + } + } + } + return pickingInfos; + }; + Scene.prototype.pickSprite = function(x, y, predicate, fastCheck, camera31) { + if (!this._tempSpritePickingRay) { + return null; + } + this.createPickingRayInCameraSpaceToRef(x, y, this._tempSpritePickingRay, camera31); + const result = this._internalPickSprites(this._tempSpritePickingRay, predicate, fastCheck, camera31); + if (result) { + result.ray = this.createPickingRayInCameraSpace(x, y, camera31); + } + return result; + }; + Scene.prototype.pickSpriteWithRay = function(ray13, predicate, fastCheck, camera31) { + if (!this._tempSpritePickingRay) { + return null; + } + if (!camera31) { + if (!this.activeCamera) { + return null; + } + camera31 = this.activeCamera; + } + Ray.TransformToRef(ray13, camera31.getViewMatrix(), this._tempSpritePickingRay); + const result = this._internalPickSprites(this._tempSpritePickingRay, predicate, fastCheck, camera31); + if (result) { + result.ray = ray13; + } + return result; + }; + Scene.prototype.multiPickSprite = function(x, y, predicate, camera31) { + this.createPickingRayInCameraSpaceToRef(x, y, this._tempSpritePickingRay, camera31); + return this._internalMultiPickSprites(this._tempSpritePickingRay, predicate, camera31); + }; + Scene.prototype.multiPickSpriteWithRay = function(ray13, predicate, camera31) { + if (!this._tempSpritePickingRay) { + return null; + } + if (!camera31) { + if (!this.activeCamera) { + return null; + } + camera31 = this.activeCamera; + } + Ray.TransformToRef(ray13, camera31.getViewMatrix(), this._tempSpritePickingRay); + return this._internalMultiPickSprites(this._tempSpritePickingRay, predicate, camera31); + }; + Scene.prototype.setPointerOverSprite = function(sprite) { + if (this._pointerOverSprite === sprite) { + return; + } + if (this._pointerOverSprite && this._pointerOverSprite.actionManager) { + this._pointerOverSprite.actionManager.processTrigger(10, ActionEvent.CreateNewFromSprite(this._pointerOverSprite, this)); + } + this._pointerOverSprite = sprite; + if (this._pointerOverSprite && this._pointerOverSprite.actionManager) { + this._pointerOverSprite.actionManager.processTrigger(9, ActionEvent.CreateNewFromSprite(this._pointerOverSprite, this)); + } + }; + Scene.prototype.getPointerOverSprite = function() { + return this._pointerOverSprite; + }; +}); // node_modules/@babylonjs/core/Shaders/ShadersInclude/imageProcessingCompatibility.js -var name257 = "imageProcessingCompatibility"; -var shader257 = `#ifdef IMAGEPROCESSINGPOSTPROCESS +var name258, shader257; +var init_imageProcessingCompatibility = __esm(() => { + init_shaderStore(); + name258 = "imageProcessingCompatibility"; + shader257 = `#ifdef IMAGEPROCESSINGPOSTPROCESS gl_FragColor.rgb=pow(gl_FragColor.rgb,vec3(2.2)); #endif `; -ShaderStore.IncludesShadersStore[name257] = shader257; + ShaderStore.IncludesShadersStore[name258] = shader257; +}); // node_modules/@babylonjs/core/Shaders/sprites.fragment.js -var name258 = "spritesPixelShader"; -var shader258 = `uniform bool alphaTest;varying vec4 vColor;varying vec2 vUV;uniform sampler2D diffuseSampler; +var name259, shader258; +var init_sprites_fragment = __esm(() => { + init_shaderStore(); + init_fogFragmentDeclaration(); + init_fogFragment(); + init_imageProcessingCompatibility(); + name259 = "spritesPixelShader"; + shader258 = `uniform bool alphaTest;varying vec4 vColor;varying vec2 vUV;uniform sampler2D diffuseSampler; #include #define CUSTOM_FRAGMENT_DEFINITIONS #ifdef PIXEL_PERFECT @@ -164520,11 +184721,16 @@ gl_FragColor=color; #include #define CUSTOM_FRAGMENT_MAIN_END }`; -ShaderStore.ShadersStore[name258] = shader258; + ShaderStore.ShadersStore[name259] = shader258; +}); // node_modules/@babylonjs/core/Shaders/sprites.vertex.js -var name259 = "spritesVertexShader"; -var shader259 = `attribute vec4 position;attribute vec2 options;attribute vec2 offsets;attribute vec2 inverts;attribute vec4 cellInfo;attribute vec4 color;uniform mat4 view;uniform mat4 projection;varying vec2 vUV;varying vec4 vColor; +var name260, shader259; +var init_sprites_vertex = __esm(() => { + init_shaderStore(); + init_fogVertexDeclaration(); + name260 = "spritesVertexShader"; + shader259 = `attribute vec4 position;attribute vec2 options;attribute vec2 offsets;attribute vec2 inverts;attribute vec4 cellInfo;attribute vec4 color;uniform mat4 view;uniform mat4 projection;varying vec2 vUV;varying vec4 vColor; #include #define CUSTOM_VERTEX_DEFINITIONS void main(void) { @@ -164537,7 +184743,8 @@ vFogDistance=viewPos; #endif #define CUSTOM_VERTEX_MAIN_END }`; -ShaderStore.ShadersStore[name259] = shader259; + ShaderStore.ShadersStore[name260] = shader259; +}); // node_modules/@babylonjs/core/Sprites/spriteRenderer.js class SpriteRenderer { @@ -164827,6 +185034,14 @@ class SpriteRenderer { this._drawWrapperFogDepth.dispose(); } } +var init_spriteRenderer = __esm(() => { + init_buffer(); + init_drawWrapper(); + init_engine_alpha(); + init_engine_dynamicBuffer(); + init_sprites_fragment(); + init_sprites_vertex(); +}); // node_modules/@babylonjs/core/Sprites/spriteManager.js class SpriteManager { @@ -164894,8 +185109,8 @@ class SpriteManager { this.texture.updateSamplingMode(3); } } - constructor(name260, imgUrl, capacity, cellSize, scene34, epsilon = 0.01, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, fromPacked = false, spriteJSON = null) { - this.name = name260; + constructor(name261, imgUrl, capacity, cellSize, scene34, epsilon = 0.01, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, fromPacked = false, spriteJSON = null) { + this.name = name261; this.sprites = []; this.renderingGroupId = 0; this.layerMask = 268435455; @@ -164966,8 +185181,8 @@ class SpriteManager { if (typeof Object.keys(_f)[0] !== "string") { throw new Error("Invalid JSON Format. Check the frame values and make sure the name is the first parameter."); } - const name260 = _f[Object.keys(_f)[0]]; - frametemp[name260] = _f; + const name261 = _f[Object.keys(_f)[0]]; + frametemp[name261] = _f; } celldata.frames = frametemp; } @@ -165229,7 +185444,7 @@ class SpriteManager { } return manager; } - static ParseFromFileAsync(name260, url, scene34, rootUrl = "") { + static ParseFromFileAsync(name261, url, scene34, rootUrl = "") { return new Promise((resolve, reject) => { const request = new WebRequest; request.addEventListener("readystatechange", () => { @@ -165237,8 +185452,8 @@ class SpriteManager { if (request.status == 200) { const serializationObject = JSON.parse(request.responseText); const output = SpriteManager.Parse(serializationObject, scene34 || EngineStore.LastCreatedScene, rootUrl); - if (name260) { - output.name = name260; + if (name261) { + output.name = name261; } resolve(output); } else { @@ -165274,11 +185489,29 @@ class SpriteManager { }); } } -SpriteManager.SnippetUrl = `https://snippet.babylonjs.com`; -SpriteManager.CreateFromSnippetAsync = SpriteManager.ParseFromSnippetAsync; +var init_spriteManager = __esm(() => { + init_observable(); + init_math_vector(); + init_sprite(); + init_spriteSceneComponent(); + init_pickingInfo(); + init_texture(); + init_sceneComponent(); + init_logger(); + init_tools(); + init_webRequest(); + init_spriteRenderer(); + init_engineStore(); + SpriteManager.SnippetUrl = `https://snippet.babylonjs.com`; + SpriteManager.CreateFromSnippetAsync = SpriteManager.ParseFromSnippetAsync; +}); + // node_modules/@babylonjs/core/Shaders/spriteMap.fragment.js -var name260 = "spriteMapPixelShader"; -var shader260 = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) +var name261, shader260; +var init_spriteMap_fragment = __esm(() => { + init_shaderStore(); + name261 = "spriteMapPixelShader"; + shader260 = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE) #define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l) #else #define TEXTUREFUNC(s,c,b) texture2D(s,c,b) @@ -165300,21 +185533,840 @@ animationData=TEXTUREFUNC(animationMap,vec2((frameID+0.5)/spriteCount,aFrameStep mat4 frameData=getFrameData(frameID+0.5);vec2 frameSize=(frameData[0].zw)/spriteMapSize;vec2 offset=frameData[0].xy*sheetUnits;vec2 ratio=frameData[2].xy/frameData[0].zw;if (frameData[2].z==1.){tileUV.xy=tileUV.yx;} vec4 nc=texture2D(spriteSheet,tileUV*frameSize+offset);if (i==0){color=nc;} else {float alpha=min(color.a+nc.a,1.0);vec3 mixed=mix(color.xyz,nc.xyz,nc.a);color=vec4(mixed,alpha);}} color.xyz*=colorMul;gl_FragColor=color;}`; -ShaderStore.ShadersStore[name260] = shader260; + ShaderStore.ShadersStore[name261] = shader260; +}); // node_modules/@babylonjs/core/Shaders/spriteMap.vertex.js -var name261 = "spriteMapVertexShader"; -var shader261 = `precision highp float;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;varying vec3 vPosition;varying vec2 vUV;varying vec2 tUV;varying vec2 stageUnits;varying vec2 levelUnits;varying vec2 tileID;uniform float time;uniform mat4 worldViewProjection;uniform vec2 outputSize;uniform vec2 stageSize;uniform vec2 spriteMapSize;uniform float stageScale;void main() {vec4 p=vec4( position,1. );vPosition=p.xyz;vUV=uv;tUV=uv*stageSize; +var name262, shader261; +var init_spriteMap_vertex = __esm(() => { + init_shaderStore(); + name262 = "spriteMapVertexShader"; + shader261 = `precision highp float;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;varying vec3 vPosition;varying vec2 vUV;varying vec2 tUV;varying vec2 stageUnits;varying vec2 levelUnits;varying vec2 tileID;uniform float time;uniform mat4 worldViewProjection;uniform vec2 outputSize;uniform vec2 stageSize;uniform vec2 spriteMapSize;uniform float stageScale;void main() {vec4 p=vec4( position,1. );vPosition=p.xyz;vUV=uv;tUV=uv*stageSize; gl_Position=worldViewProjection*p;}`; -ShaderStore.ShadersStore[name261] = shader261; + ShaderStore.ShadersStore[name262] = shader261; +}); + +// node_modules/@babylonjs/core/Sprites/spriteMap.js +class SpriteMap { + get spriteCount() { + return this.sprites.length; + } + get position() { + return this._output.position; + } + set position(v) { + this._output.position = v; + } + get rotation() { + return this._output.rotation; + } + set rotation(v) { + this._output.rotation = v; + } + get animationMap() { + return this._animationMap; + } + set animationMap(v) { + const buffer68 = v._texture._bufferView; + const am = this._createTileAnimationBuffer(buffer68); + this._animationMap.dispose(); + this._animationMap = am; + this._material.setTexture("animationMap", this._animationMap); + } + constructor(name263, atlasJSON, spriteSheet, options, scene34) { + this.name = name263; + this.sprites = []; + this.atlasJSON = atlasJSON; + this.sprites = this.atlasJSON["frames"]; + this.spriteSheet = spriteSheet; + this.options = options; + options.stageSize = options.stageSize || new Vector2(1, 1); + options.outputSize = options.outputSize || options.stageSize; + options.outputPosition = options.outputPosition || Vector3.Zero(); + options.outputRotation = options.outputRotation || Vector3.Zero(); + options.layerCount = options.layerCount || 1; + options.maxAnimationFrames = options.maxAnimationFrames || 0; + options.baseTile = options.baseTile || 0; + options.flipU = options.flipU || false; + options.colorMultiply = options.colorMultiply || new Vector3(1, 1, 1); + this._scene = scene34; + this._frameMap = this._createFrameBuffer(); + this._tileMaps = new Array; + for (let i = 0;i < options.layerCount; i++) { + this._tileMaps.push(this._createTileBuffer(null, i)); + } + this._animationMap = this._createTileAnimationBuffer(null); + const defines = []; + defines.push("#define LAYERS " + options.layerCount); + if (options.flipU) { + defines.push("#define FLIPU"); + } + defines.push(`#define MAX_ANIMATION_FRAMES ${options.maxAnimationFrames}.0`); + const shaderString = Effect.ShadersStore["spriteMapPixelShader"]; + let layerSampleString; + if (!scene34.getEngine()._features.supportSwitchCaseInShader) { + layerSampleString = ""; + for (let i = 0;i < options.layerCount; i++) { + layerSampleString += `if (${i} == i) { frameID = texture2D(tileMaps[${i}], (tileID + 0.5) / stageSize, 0.).x; }`; + } + } else { + layerSampleString = "switch(i) {"; + for (let i = 0;i < options.layerCount; i++) { + layerSampleString += "case " + i + " : frameID = texture(tileMaps[" + i + "], (tileID + 0.5) / stageSize, 0.).x;"; + layerSampleString += "break;"; + } + layerSampleString += "}"; + } + Effect.ShadersStore["spriteMap" + this.name + "PixelShader"] = shaderString.replace("#define LAYER_ID_SWITCH", layerSampleString); + this._material = new ShaderMaterial("spriteMap:" + this.name, this._scene, { + vertex: "spriteMap", + fragment: "spriteMap" + this.name + }, { + defines, + attributes: ["position", "normal", "uv"], + uniforms: ["worldViewProjection", "time", "stageSize", "outputSize", "spriteMapSize", "spriteCount", "time", "colorMul", "mousePosition", "curTile", "flipU"], + samplers: ["spriteSheet", "frameMap", "tileMaps", "animationMap"], + needAlphaBlending: true + }); + this._time = 0; + this._material.setFloat("spriteCount", this.spriteCount); + this._material.setVector2("stageSize", options.stageSize); + this._material.setVector2("outputSize", options.outputSize); + this._material.setTexture("spriteSheet", this.spriteSheet); + this._material.setVector2("spriteMapSize", new Vector2(1, 1)); + this._material.setVector3("colorMul", options.colorMultiply); + let tickSave = 0; + const bindSpriteTexture = () => { + if (this.spriteSheet && this.spriteSheet.isReady()) { + if (this.spriteSheet._texture) { + this._material.setVector2("spriteMapSize", new Vector2(this.spriteSheet._texture.baseWidth || 1, this.spriteSheet._texture.baseHeight || 1)); + return; + } + } + if (tickSave < 100) { + setTimeout(() => { + tickSave++; + bindSpriteTexture(); + }, 100); + } + }; + bindSpriteTexture(); + this._material.setVector3("colorMul", options.colorMultiply); + this._material.setTexture("frameMap", this._frameMap); + this._material.setTextureArray("tileMaps", this._tileMaps); + this._material.setTexture("animationMap", this._animationMap); + this._material.setFloat("time", this._time); + this._output = CreatePlane(name263 + ":output", { size: 1, updatable: true }, scene34); + this._output.scaling.x = options.outputSize.x; + this._output.scaling.y = options.outputSize.y; + this.position = options.outputPosition; + this.rotation = options.outputRotation; + const obfunction = () => { + this._time += this._scene.getEngine().getDeltaTime(); + this._material.setFloat("time", this._time); + }; + this._scene.onBeforeRenderObservable.add(obfunction); + this._output.material = this._material; + } + getTileID() { + const p = this.getMousePosition(); + p.multiplyInPlace(this.options.stageSize || Vector2.Zero()); + p.x = Math.floor(p.x); + p.y = Math.floor(p.y); + return p; + } + getMousePosition() { + const out = this._output; + const pickinfo = this._scene.pick(this._scene.pointerX, this._scene.pointerY, (mesh65) => { + if (mesh65 !== out) { + return false; + } + return true; + }); + if (!pickinfo || !pickinfo.hit || !pickinfo.getTextureCoordinates) { + return new Vector2(-1, -1); + } + const coords = pickinfo.getTextureCoordinates(); + if (coords) { + return coords; + } + return new Vector2(-1, -1); + } + _createFrameBuffer() { + const data = []; + for (let i = 0;i < this.spriteCount; i++) { + data.push(0, 0, 0, 0); + data.push(0, 0, 0, 0); + data.push(0, 0, 0, 0); + data.push(0, 0, 0, 0); + } + for (let i = 0;i < this.spriteCount; i++) { + const f = this.sprites[i]["frame"]; + const sss = this.sprites[i]["spriteSourceSize"]; + const ss = this.sprites[i]["sourceSize"]; + const r = this.sprites[i]["rotated"] ? 1 : 0; + const t2 = this.sprites[i]["trimmed"] ? 1 : 0; + data[i * 4] = f.x; + data[i * 4 + 1] = f.y; + data[i * 4 + 2] = f.w; + data[i * 4 + 3] = f.h; + data[i * 4 + this.spriteCount * 4] = sss.x; + data[i * 4 + 1 + this.spriteCount * 4] = sss.y; + data[i * 4 + 3 + this.spriteCount * 4] = sss.h; + data[i * 4 + this.spriteCount * 8] = ss.w; + data[i * 4 + 1 + this.spriteCount * 8] = ss.h; + data[i * 4 + 2 + this.spriteCount * 8] = r; + data[i * 4 + 3 + this.spriteCount * 8] = t2; + } + const floatArray = new Float32Array(data); + const t = RawTexture.CreateRGBATexture(floatArray, this.spriteCount, 4, this._scene, false, false, Texture.NEAREST_NEAREST, Engine2.TEXTURETYPE_FLOAT); + return t; + } + _createTileBuffer(buffer68, _layer = 0) { + let data = []; + const _ty = this.options.stageSize.y || 0; + const _tx = this.options.stageSize.x || 0; + if (!buffer68) { + let bt = this.options.baseTile; + if (_layer != 0) { + bt = 0; + } + for (let y = 0;y < _ty; y++) { + for (let x = 0;x < _tx * 4; x += 4) { + data.push(bt, 0, 0, 0); + } + } + } else { + data = buffer68; + } + const floatArray = new Float32Array(data); + const t = RawTexture.CreateRGBATexture(floatArray, _tx, _ty, this._scene, false, false, Texture.NEAREST_NEAREST, Engine2.TEXTURETYPE_FLOAT); + return t; + } + changeTiles(_layer = 0, pos, tile = 0) { + const buffer68 = this._tileMaps[_layer]._texture._bufferView; + if (buffer68 === null) { + return; + } + let p = []; + if (pos instanceof Vector2) { + p.push(pos); + } else { + p = pos; + } + const _tx = this.options.stageSize.x || 0; + for (let i = 0;i < p.length; i++) { + const _p = p[i]; + _p.x = Math.floor(_p.x); + _p.y = Math.floor(_p.y); + const id = _p.x * 4 + _p.y * (_tx * 4); + buffer68[id] = tile; + } + const t = this._createTileBuffer(buffer68); + this._tileMaps[_layer].dispose(); + this._tileMaps[_layer] = t; + this._material.setTextureArray("tileMap", this._tileMaps); + } + _createTileAnimationBuffer(buffer68) { + const data = []; + let floatArray; + if (!buffer68) { + for (let i = 0;i < this.spriteCount; i++) { + data.push(0, 0, 0, 0); + let count = 1; + while (count < (this.options.maxAnimationFrames || 4)) { + data.push(0, 0, 0, 0); + count++; + } + } + floatArray = new Float32Array(data); + } else { + floatArray = buffer68; + } + const t = RawTexture.CreateRGBATexture(floatArray, this.spriteCount, this.options.maxAnimationFrames || 4, this._scene, false, false, Texture.NEAREST_NEAREST, Engine2.TEXTURETYPE_FLOAT); + return t; + } + addAnimationToTile(cellID = 0, _frame = 0, toCell = 0, time = 0, speed = 1) { + const buffer68 = this._animationMap._texture._bufferView; + const id = cellID * 4 + this.spriteCount * 4 * _frame; + if (!buffer68) { + return; + } + buffer68[id] = toCell; + buffer68[id + 1] = time; + buffer68[id + 2] = speed; + const t = this._createTileAnimationBuffer(buffer68); + this._animationMap.dispose(); + this._animationMap = t; + this._material.setTexture("animationMap", this._animationMap); + } + saveTileMaps() { + let maps = ""; + for (let i = 0;i < this._tileMaps.length; i++) { + if (i > 0) { + maps += "\n\r"; + } + maps += this._tileMaps[i]._texture._bufferView.toString(); + } + const hiddenElement = document.createElement("a"); + hiddenElement.href = "data:octet/stream;charset=utf-8," + encodeURI(maps); + hiddenElement.target = "_blank"; + hiddenElement.download = this.name + ".tilemaps"; + hiddenElement.click(); + hiddenElement.remove(); + } + loadTileMaps(url) { + const xhr = new XMLHttpRequest; + xhr.open("GET", url); + const _lc = this.options.layerCount || 0; + xhr.onload = () => { + const data = xhr.response.split("\n\r"); + for (let i = 0;i < _lc; i++) { + const d = data[i].split(",").map(Number); + const t = this._createTileBuffer(d); + this._tileMaps[i].dispose(); + this._tileMaps[i] = t; + } + this._material.setTextureArray("tileMap", this._tileMaps); + }; + xhr.send(); + } + dispose() { + this._output.dispose(); + this._material.dispose(); + this._animationMap.dispose(); + this._tileMaps.forEach((tm) => { + tm.dispose(); + }); + this._frameMap.dispose(); + } +} +var init_spriteMap = __esm(() => { + init_engine(); + init_math_vector(); + init_texture(); + init_rawTexture(); + init_shaderMaterial(); + init_effect(); + init_planeBuilder(); + init_spriteMap_fragment(); + init_spriteMap_vertex(); +}); + +// node_modules/@babylonjs/core/Sprites/spritePackedManager.js +class SpritePackedManager extends SpriteManager { + constructor(name263, imgUrl, capacity, scene34, spriteJSON = null, epsilon = 0.01, samplingMode = Texture.TRILINEAR_SAMPLINGMODE) { + super(name263, imgUrl, capacity, 64, scene34, epsilon, samplingMode, true, spriteJSON); + this.name = name263; + } +} +var init_spritePackedManager = __esm(() => { + init_spriteManager(); + init_texture(); +}); + +// node_modules/@babylonjs/core/Sprites/index.js +var init_Sprites = __esm(() => { + init_sprite(); + init_ISprites(); + init_spriteManager(); + init_spriteMap(); + init_spritePackedManager(); + init_spriteSceneComponent(); +}); + +// node_modules/@babylonjs/core/States/index.js +var init_States = __esm(() => { + init_alphaCullingState(); + init_depthCullingState(); + init_stencilState(); + init_stencilStateComposer(); +}); + // node_modules/@babylonjs/core/Misc/assetsManager.js +class AbstractAssetTask { + constructor(name263) { + this.name = name263; + this._isCompleted = false; + this._taskState = AssetTaskState.INIT; + } + get isCompleted() { + return this._isCompleted; + } + get taskState() { + return this._taskState; + } + get errorObject() { + return this._errorObject; + } + _setErrorObject(message, exception) { + if (this._errorObject) { + return; + } + this._errorObject = { + message, + exception + }; + } + run(scene34, onSuccess, onError) { + this._taskState = AssetTaskState.RUNNING; + this.runTask(scene34, () => { + this._onDoneCallback(onSuccess, onError); + }, (msg, exception) => { + this._onErrorCallback(onError, msg, exception); + }); + } + runTask(scene34, onSuccess, onError) { + throw new Error("runTask is not implemented"); + } + reset() { + this._taskState = AssetTaskState.INIT; + } + _onErrorCallback(onError, message, exception) { + this._taskState = AssetTaskState.ERROR; + this._errorObject = { + message, + exception + }; + if (this.onError) { + this.onError(this, message, exception); + } + onError(); + } + _onDoneCallback(onSuccess, onError) { + try { + this._taskState = AssetTaskState.DONE; + this._isCompleted = true; + if (this.onSuccess) { + this.onSuccess(this); + } + onSuccess(); + } catch (e) { + this._onErrorCallback(onError, "Task is done, error executing success callback(s)", e); + } + } +} + +class AssetsProgressEvent { + constructor(remainingCount, totalCount, task) { + this.remainingCount = remainingCount; + this.totalCount = totalCount; + this.task = task; + } +} + +class ContainerAssetTask extends AbstractAssetTask { + constructor(name263, meshesNames, rootUrl, sceneFilename, extension) { + super(name263); + this.name = name263; + this.meshesNames = meshesNames; + this.rootUrl = rootUrl; + this.sceneFilename = sceneFilename; + this.extension = extension; + } + runTask(scene34, onSuccess, onError) { + SceneLoader.LoadAssetContainer(this.rootUrl, this.sceneFilename, scene34, (container) => { + this.loadedContainer = container; + this.loadedMeshes = container.meshes; + this.loadedTransformNodes = container.transformNodes; + this.loadedParticleSystems = container.particleSystems; + this.loadedSkeletons = container.skeletons; + this.loadedAnimationGroups = container.animationGroups; + onSuccess(); + }, null, (scene35, message, exception) => { + onError(message, exception); + }, this.extension); + } +} + +class MeshAssetTask extends AbstractAssetTask { + constructor(name263, meshesNames, rootUrl, sceneFilename, extension) { + super(name263); + this.name = name263; + this.meshesNames = meshesNames; + this.rootUrl = rootUrl; + this.sceneFilename = sceneFilename; + this.extension = extension; + } + runTask(scene34, onSuccess, onError) { + SceneLoader.ImportMesh(this.meshesNames, this.rootUrl, this.sceneFilename, scene34, (meshes, particleSystems, skeletons, animationGroups, transformNodes) => { + this.loadedMeshes = meshes; + this.loadedTransformNodes = transformNodes; + this.loadedParticleSystems = particleSystems; + this.loadedSkeletons = skeletons; + this.loadedAnimationGroups = animationGroups; + onSuccess(); + }, null, (scene35, message, exception) => { + onError(message, exception); + }, this.extension); + } +} + +class AnimationAssetTask extends AbstractAssetTask { + constructor(name263, rootUrl, filename, targetConverter, extension) { + super(name263); + this.name = name263; + this.rootUrl = rootUrl; + this.filename = filename; + this.targetConverter = targetConverter; + this.extension = extension; + } + runTask(scene34, onSuccess, onError) { + const startingIndexForNewAnimatables = scene34.animatables.length; + const startingIndexForNewAnimationGroups = scene34.animationGroups.length; + this.loadedAnimatables = []; + this.loadedAnimationGroups = []; + SceneLoader.ImportAnimations(this.rootUrl, this.filename, scene34, false, SceneLoaderAnimationGroupLoadingMode.NoSync, this.targetConverter, () => { + this.loadedAnimatables = scene34.animatables.slice(startingIndexForNewAnimatables); + this.loadedAnimationGroups = scene34.animationGroups.slice(startingIndexForNewAnimationGroups); + onSuccess(); + }, null, (scene35, message, exception) => { + onError(message, exception); + }, this.extension); + } +} + +class TextFileAssetTask extends AbstractAssetTask { + constructor(name263, url) { + super(name263); + this.name = name263; + this.url = url; + } + runTask(scene34, onSuccess, onError) { + scene34._loadFile(this.url, (data) => { + this.text = data; + onSuccess(); + }, undefined, false, false, (request, exception) => { + if (request) { + onError(request.status + " " + request.statusText, exception); + } + }); + } +} + +class BinaryFileAssetTask extends AbstractAssetTask { + constructor(name263, url) { + super(name263); + this.name = name263; + this.url = url; + } + runTask(scene34, onSuccess, onError) { + scene34._loadFile(this.url, (data) => { + this.data = data; + onSuccess(); + }, undefined, true, true, (request, exception) => { + if (request) { + onError(request.status + " " + request.statusText, exception); + } + }); + } +} + +class ImageAssetTask extends AbstractAssetTask { + constructor(name263, url) { + super(name263); + this.name = name263; + this.url = url; + } + runTask(scene34, onSuccess, onError) { + const img = new Image; + Tools.SetCorsBehavior(this.url, img); + img.onload = () => { + this.image = img; + onSuccess(); + }; + img.onerror = (err) => { + onError("Error loading image", err); + }; + img.src = this.url; + } +} + +class TextureAssetTask extends AbstractAssetTask { + constructor(name263, url, noMipmap, invertY = true, samplingMode = Texture.TRILINEAR_SAMPLINGMODE) { + super(name263); + this.name = name263; + this.url = url; + this.noMipmap = noMipmap; + this.invertY = invertY; + this.samplingMode = samplingMode; + } + runTask(scene34, onSuccess, onError) { + const onload = () => { + onSuccess(); + }; + const onerror = (message, exception) => { + onError(message, exception); + }; + this.texture = new Texture(this.url, scene34, this.noMipmap, this.invertY, this.samplingMode, onload, onerror); + } +} + +class CubeTextureAssetTask extends AbstractAssetTask { + constructor(name263, url, extensions, noMipmap, files, prefiltered) { + super(name263); + this.name = name263; + this.url = url; + this.extensions = extensions; + this.noMipmap = noMipmap; + this.files = files; + this.prefiltered = prefiltered; + } + runTask(scene34, onSuccess, onError) { + const onload = () => { + onSuccess(); + }; + const onerror = (message, exception) => { + onError(message, exception); + }; + this.texture = new CubeTexture(this.url, scene34, this.extensions, this.noMipmap, this.files, onload, onerror, undefined, this.prefiltered); + } +} + +class HDRCubeTextureAssetTask extends AbstractAssetTask { + constructor(name263, url, size, noMipmap = false, generateHarmonics = true, gammaSpace = false, reserved = false) { + super(name263); + this.name = name263; + this.url = url; + this.size = size; + this.noMipmap = noMipmap; + this.generateHarmonics = generateHarmonics; + this.gammaSpace = gammaSpace; + this.reserved = reserved; + } + runTask(scene34, onSuccess, onError) { + const onload = () => { + onSuccess(); + }; + const onerror = (message, exception) => { + onError(message, exception); + }; + this.texture = new HDRCubeTexture(this.url, scene34, this.size, this.noMipmap, this.generateHarmonics, this.gammaSpace, this.reserved, onload, onerror); + } +} + +class EquiRectangularCubeTextureAssetTask extends AbstractAssetTask { + constructor(name263, url, size, noMipmap = false, gammaSpace = true) { + super(name263); + this.name = name263; + this.url = url; + this.size = size; + this.noMipmap = noMipmap; + this.gammaSpace = gammaSpace; + } + runTask(scene34, onSuccess, onError) { + const onload = () => { + onSuccess(); + }; + const onerror = (message, exception) => { + onError(message, exception); + }; + this.texture = new EquiRectangularCubeTexture(this.url, scene34, this.size, this.noMipmap, this.gammaSpace, onload, onerror); + } +} + +class AssetsManager { + constructor(scene34) { + this._isLoading = false; + this._tasks = new Array; + this._waitingTasksCount = 0; + this._totalTasksCount = 0; + this.onTaskSuccessObservable = new Observable; + this.onTaskErrorObservable = new Observable; + this.onTasksDoneObservable = new Observable; + this.onProgressObservable = new Observable; + this.useDefaultLoadingScreen = true; + this.autoHideLoadingUI = true; + this._scene = scene34 || EngineStore.LastCreatedScene; + } + addContainerTask(taskName, meshesNames, rootUrl, sceneFilename, extension) { + const task = new ContainerAssetTask(taskName, meshesNames, rootUrl, sceneFilename, extension); + this._tasks.push(task); + return task; + } + addMeshTask(taskName, meshesNames, rootUrl, sceneFilename, extension) { + const task = new MeshAssetTask(taskName, meshesNames, rootUrl, sceneFilename, extension); + this._tasks.push(task); + return task; + } + addTextFileTask(taskName, url) { + const task = new TextFileAssetTask(taskName, url); + this._tasks.push(task); + return task; + } + addBinaryFileTask(taskName, url) { + const task = new BinaryFileAssetTask(taskName, url); + this._tasks.push(task); + return task; + } + addImageTask(taskName, url) { + const task = new ImageAssetTask(taskName, url); + this._tasks.push(task); + return task; + } + addTextureTask(taskName, url, noMipmap, invertY, samplingMode = Texture.TRILINEAR_SAMPLINGMODE) { + const task = new TextureAssetTask(taskName, url, noMipmap, invertY, samplingMode); + this._tasks.push(task); + return task; + } + addCubeTextureTask(taskName, url, extensions, noMipmap, files, prefiltered) { + const task = new CubeTextureAssetTask(taskName, url, extensions, noMipmap, files, prefiltered); + this._tasks.push(task); + return task; + } + addHDRCubeTextureTask(taskName, url, size, noMipmap = false, generateHarmonics = true, gammaSpace = false, reserved = false) { + const task = new HDRCubeTextureAssetTask(taskName, url, size, noMipmap, generateHarmonics, gammaSpace, reserved); + this._tasks.push(task); + return task; + } + addEquiRectangularCubeTextureAssetTask(taskName, url, size, noMipmap = false, gammaSpace = true) { + const task = new EquiRectangularCubeTextureAssetTask(taskName, url, size, noMipmap, gammaSpace); + this._tasks.push(task); + return task; + } + removeTask(task) { + const index = this._tasks.indexOf(task); + if (index > -1) { + this._tasks.splice(index, 1); + } + } + _decreaseWaitingTasksCount(task) { + this._waitingTasksCount--; + try { + if (this.onProgress) { + this.onProgress(this._waitingTasksCount, this._totalTasksCount, task); + } + this.onProgressObservable.notifyObservers(new AssetsProgressEvent(this._waitingTasksCount, this._totalTasksCount, task)); + } catch (e) { + Logger.Error("Error running progress callbacks."); + console.log(e); + } + if (this._waitingTasksCount === 0) { + try { + const currentTasks = this._tasks.slice(); + if (this.onFinish) { + this.onFinish(currentTasks); + } + for (const task2 of currentTasks) { + if (task2.taskState === AssetTaskState.DONE) { + const index = this._tasks.indexOf(task2); + if (index > -1) { + this._tasks.splice(index, 1); + } + } + } + this.onTasksDoneObservable.notifyObservers(this._tasks); + } catch (e) { + Logger.Error("Error running tasks-done callbacks."); + console.log(e); + } + this._isLoading = false; + if (this.autoHideLoadingUI) { + this._scene.getEngine().hideLoadingUI(); + } + } + } + _runTask(task) { + const done = () => { + try { + if (this.onTaskSuccess) { + this.onTaskSuccess(task); + } + this.onTaskSuccessObservable.notifyObservers(task); + this._decreaseWaitingTasksCount(task); + } catch (e) { + error5("Error executing task success callbacks", e); + } + }; + const error5 = (message, exception) => { + task._setErrorObject(message, exception); + if (this.onTaskError) { + this.onTaskError(task); + } else if (!task.onError) { + Logger.Error(this._formatTaskErrorMessage(task)); + } + this.onTaskErrorObservable.notifyObservers(task); + this._decreaseWaitingTasksCount(task); + }; + task.run(this._scene, done, error5); + } + _formatTaskErrorMessage(task) { + let errorMessage = "Unable to complete task " + task.name; + if (task.errorObject.message) { + errorMessage += `: ${task.errorObject.message}`; + } + if (task.errorObject.exception) { + errorMessage += `: ${task.errorObject.exception}`; + } + return errorMessage; + } + reset() { + this._isLoading = false; + this._tasks = new Array; + return this; + } + load() { + if (this._isLoading) { + return this; + } + this._isLoading = true; + this._waitingTasksCount = this._tasks.length; + this._totalTasksCount = this._tasks.length; + if (this._waitingTasksCount === 0) { + this._isLoading = false; + if (this.onFinish) { + this.onFinish(this._tasks); + } + this.onTasksDoneObservable.notifyObservers(this._tasks); + return this; + } + if (this.useDefaultLoadingScreen) { + this._scene.getEngine().displayLoadingUI(); + } + for (let index = 0;index < this._tasks.length; index++) { + const task = this._tasks[index]; + if (task.taskState === AssetTaskState.INIT) { + this._runTask(task); + } + } + return this; + } + loadAsync() { + return new Promise((resolve, reject) => { + if (this._isLoading) { + resolve(); + return; + } + this.onTasksDoneObservable.addOnce((remainingTasks) => { + if (remainingTasks && remainingTasks.length) { + reject(remainingTasks); + } else { + resolve(); + } + }); + this.load(); + }); + } +} var AssetTaskState; -(function(AssetTaskState2) { - AssetTaskState2[AssetTaskState2["INIT"] = 0] = "INIT"; - AssetTaskState2[AssetTaskState2["RUNNING"] = 1] = "RUNNING"; - AssetTaskState2[AssetTaskState2["DONE"] = 2] = "DONE"; - AssetTaskState2[AssetTaskState2["ERROR"] = 3] = "ERROR"; -})(AssetTaskState || (AssetTaskState = {})); +var init_assetsManager = __esm(() => { + init_sceneLoader(); + init_tools(); + init_observable(); + init_texture(); + init_cubeTexture(); + init_hdrCubeTexture(); + init_equiRectangularCubeTexture(); + init_logger(); + init_engineStore(); + (function(AssetTaskState2) { + AssetTaskState2[AssetTaskState2["INIT"] = 0] = "INIT"; + AssetTaskState2[AssetTaskState2["RUNNING"] = 1] = "RUNNING"; + AssetTaskState2[AssetTaskState2["DONE"] = 2] = "DONE"; + AssetTaskState2[AssetTaskState2["ERROR"] = 3] = "ERROR"; + })(AssetTaskState || (AssetTaskState = {})); +}); + // node_modules/@babylonjs/core/Misc/deferred.js class Deferred { get resolve() { @@ -165330,45 +186382,392 @@ class Deferred { }); } } -// node_modules/@babylonjs/core/Misc/observable.extensions.js -Observable.prototype.notifyObserversWithPromise = async function(eventData, mask = -1, target, currentTarget, userInfo) { - let p = Promise.resolve(eventData); - if (!this.observers.length) { - return p; +var init_deferred = __esm(() => { +}); + +// node_modules/@babylonjs/core/Misc/meshExploder.js +class MeshExploder { + constructor(meshes, centerMesh) { + this._meshesOrigins = []; + this._toCenterVectors = []; + this._scaledDirection = new Vector3(1, 1, 1); + this._newPosition = Vector3.Zero(); + this._centerPosition = Vector3.Zero(); + this._meshes = meshes.slice(); + if (centerMesh) { + this._centerMesh = centerMesh; + } else { + this._setCenterMesh(); + } + this._centerMesh.computeWorldMatrix(true); + const centerMeshIndex = this._meshes.indexOf(this._centerMesh); + if (centerMeshIndex >= 0) { + this._meshes.splice(centerMeshIndex, 1); + } + this._centerPosition = this._centerMesh.getAbsolutePosition().clone(); + for (let index = 0;index < this._meshes.length; index++) { + if (this._meshes[index]) { + const mesh65 = this._meshes[index]; + this._meshesOrigins[index] = mesh65.getAbsolutePosition().clone(); + this._toCenterVectors[index] = Vector3.Zero(); + if (mesh65.hasBoundingInfo && this._centerMesh.hasBoundingInfo) { + mesh65.computeWorldMatrix(true); + mesh65.getBoundingInfo().boundingBox.centerWorld.subtractToRef(this._centerMesh.getBoundingInfo().boundingBox.centerWorld, this._toCenterVectors[index]); + } + } + } + } + _setCenterMesh() { + let averageCenter = Vector3.Zero(); + const totalCenters = Vector3.Zero(); + let shortestToCenter = Number.MAX_VALUE; + for (let index = 0;index < this._meshes.length; index++) { + if (this._meshes[index]) { + const mesh65 = this._meshes[index]; + const boundingInfo9 = mesh65.getBoundingInfo(); + if (boundingInfo9) { + totalCenters.addInPlace(boundingInfo9.boundingBox.centerWorld); + } + } + } + averageCenter = totalCenters.scale(1 / this._meshes.length); + for (let index = 0;index < this._meshes.length; index++) { + if (this._meshes[index]) { + const mesh65 = this._meshes[index]; + const boundingInfo9 = mesh65.getBoundingInfo(); + if (boundingInfo9) { + const distanceToCenter = boundingInfo9.boundingBox.centerWorld.subtract(averageCenter).lengthSquared(); + if (distanceToCenter < shortestToCenter) { + this._centerMesh = mesh65; + shortestToCenter = distanceToCenter; + } + } + } + } + } + getClassName() { + return "MeshExploder"; + } + getMeshes() { + const meshArray = this._meshes.slice(); + meshArray.unshift(this._centerMesh); + return meshArray; + } + explode(direction = 1) { + for (let index = 0;index < this._meshes.length; index++) { + if (this._meshes[index] && this._meshesOrigins[index] && this._toCenterVectors[index]) { + this._toCenterVectors[index].scaleToRef(direction, this._scaledDirection); + this._meshesOrigins[index].addToRef(this._scaledDirection, this._newPosition); + this._meshes[index].setAbsolutePosition(this._newPosition); + } + } + this._centerMesh.setAbsolutePosition(this._centerPosition); + } +} +var init_meshExploder = __esm(() => { + init_math_vector(); +}); + +// node_modules/@babylonjs/core/Misc/filesInput.js +class FilesInput { + static get FilesToLoad() { + return FilesInputStore.FilesToLoad; + } + constructor(engine46, scene34, sceneLoadedCallback, progressCallback, additionalRenderLoopLogicCallback, textureLoadingCallback, startingProcessingFilesCallback, onReloadCallback, errorCallback, useAppend = false) { + this.useAppend = useAppend; + this.onProcessFileCallback = () => { + return true; + }; + this.displayLoadingUI = true; + this.loadAsync = (sceneFile, onProgress) => this.useAppend ? SceneLoader.AppendAsync("file:", sceneFile, this._currentScene, onProgress) : SceneLoader.LoadAsync("file:", sceneFile, this._engine, onProgress); + this._engine = engine46; + this._currentScene = scene34; + this._sceneLoadedCallback = sceneLoadedCallback; + this._progressCallback = progressCallback; + this._additionalRenderLoopLogicCallback = additionalRenderLoopLogicCallback; + this._textureLoadingCallback = textureLoadingCallback; + this._startingProcessingFilesCallback = startingProcessingFilesCallback; + this._onReloadCallback = onReloadCallback; + this._errorCallback = errorCallback; + } + monitorElementForDragNDrop(elementToMonitor) { + if (elementToMonitor) { + this._elementToMonitor = elementToMonitor; + this._dragEnterHandler = (e) => { + this._drag(e); + }; + this._dragOverHandler = (e) => { + this._drag(e); + }; + this._dropHandler = (e) => { + this._drop(e); + }; + this._elementToMonitor.addEventListener("dragenter", this._dragEnterHandler, false); + this._elementToMonitor.addEventListener("dragover", this._dragOverHandler, false); + this._elementToMonitor.addEventListener("drop", this._dropHandler, false); + } } - const state = this._eventState; - state.mask = mask; - state.target = target; - state.currentTarget = currentTarget; - state.skipNextObservers = false; - state.userInfo = userInfo; - this.observers.forEach((obs) => { - if (state.skipNextObservers) { + get filesToLoad() { + return this._filesToLoad; + } + dispose() { + if (!this._elementToMonitor) { return; } - if (obs._willBeUnregistered) { + this._elementToMonitor.removeEventListener("dragenter", this._dragEnterHandler); + this._elementToMonitor.removeEventListener("dragover", this._dragOverHandler); + this._elementToMonitor.removeEventListener("drop", this._dropHandler); + } + _renderFunction() { + if (this._additionalRenderLoopLogicCallback) { + this._additionalRenderLoopLogicCallback(); + } + if (this._currentScene) { + if (this._textureLoadingCallback) { + const remaining = this._currentScene.getWaitingItemsCount(); + if (remaining > 0) { + this._textureLoadingCallback(remaining); + } + } + this._currentScene.render(); + } + } + _drag(e) { + e.stopPropagation(); + e.preventDefault(); + } + _drop(eventDrop) { + eventDrop.stopPropagation(); + eventDrop.preventDefault(); + this.loadFiles(eventDrop); + } + _traverseFolder(folder, files, remaining, callback) { + const reader = folder.createReader(); + const relativePath = folder.fullPath.replace(/^\//, "").replace(/(.+?)\/?$/, "$1/"); + reader.readEntries((entries) => { + remaining.count += entries.length; + for (const entry of entries) { + if (entry.isFile) { + entry.file((file) => { + file.correctName = relativePath + file.name; + files.push(file); + if (--remaining.count === 0) { + callback(); + } + }); + } else if (entry.isDirectory) { + this._traverseFolder(entry, files, remaining, callback); + } + } + if (--remaining.count === 0) { + callback(); + } + }); + } + _processFiles(files) { + for (let i = 0;i < files.length; i++) { + const name263 = files[i].correctName.toLowerCase(); + const extension = name263.split(".").pop(); + if (!this.onProcessFileCallback(files[i], name263, extension, (sceneFile) => this._sceneFileToLoad = sceneFile)) { + continue; + } + if (SceneLoader.IsPluginForExtensionAvailable("." + extension)) { + this._sceneFileToLoad = files[i]; + } + FilesInput.FilesToLoad[name263] = files[i]; + } + } + loadFiles(event) { + if (event && event.dataTransfer && event.dataTransfer.files) { + this._filesToLoad = event.dataTransfer.files; + } + if (event && event.target && event.target.files) { + this._filesToLoad = event.target.files; + } + if (!this._filesToLoad || this._filesToLoad.length === 0) { return; } - if (obs.mask & mask) { - if (obs.scope) { - p = p.then((lastReturnedValue) => { - state.lastReturnValue = lastReturnedValue; - return obs.callback.apply(obs.scope, [eventData, state]); - }); + if (this._startingProcessingFilesCallback) { + this._startingProcessingFilesCallback(this._filesToLoad); + } + if (this._filesToLoad && this._filesToLoad.length > 0) { + const files = []; + const folders = []; + const items = event.dataTransfer ? event.dataTransfer.items : null; + for (let i = 0;i < this._filesToLoad.length; i++) { + const fileToLoad = this._filesToLoad[i]; + const name263 = fileToLoad.name.toLowerCase(); + let entry; + fileToLoad.correctName = name263; + if (items) { + const item = items[i]; + if (item.getAsEntry) { + entry = item.getAsEntry(); + } else if (item.webkitGetAsEntry) { + entry = item.webkitGetAsEntry(); + } + } + if (!entry) { + files.push(fileToLoad); + } else { + if (entry.isDirectory) { + folders.push(entry); + } else { + files.push(fileToLoad); + } + } + } + if (folders.length === 0) { + this._processFiles(files); + this._processReload(); } else { - p = p.then((lastReturnedValue) => { - state.lastReturnValue = lastReturnedValue; - return obs.callback(eventData, state); - }); + const remaining = { count: folders.length }; + for (const folder of folders) { + this._traverseFolder(folder, files, remaining, () => { + this._processFiles(files); + if (remaining.count === 0) { + this._processReload(); + } + }); + } } - if (obs.unregisterOnNextCall) { - this._deferUnregister(obs); + } + } + _processReload() { + if (this._onReloadCallback) { + this._onReloadCallback(this._sceneFileToLoad); + } else { + this.reload(); + } + } + reload() { + if (this._sceneFileToLoad) { + if (!this.useAppend) { + if (this._currentScene) { + if (Logger.errorsCount > 0) { + Logger.ClearLogCache(); + } + this._engine.stopRenderLoop(); + } + } + SceneLoader.ShowLoadingScreen = false; + if (this.displayLoadingUI) { + this._engine.displayLoadingUI(); + } + this.loadAsync(this._sceneFileToLoad, this._progressCallback).then((scene34) => { + if (!this.useAppend) { + if (this._currentScene) { + this._currentScene.dispose(); + } + this._currentScene = scene34; + this._currentScene.executeWhenReady(() => { + if (this.displayLoadingUI) { + this._engine.hideLoadingUI(); + } + this._engine.runRenderLoop(() => { + this._renderFunction(); + }); + }); + } else { + if (this.displayLoadingUI) { + this._engine.hideLoadingUI(); + } + } + if (this._sceneLoadedCallback && this._currentScene) { + this._sceneLoadedCallback(this._sceneFileToLoad, this._currentScene); + } + }).catch((error5) => { + if (this.displayLoadingUI) { + this._engine.hideLoadingUI(); + } + if (this._errorCallback) { + this._errorCallback(this._sceneFileToLoad, this._currentScene, error5.message); + } + }); + } else { + Logger.Error("Please provide a valid .babylon file."); + } + } +} +var init_filesInput = __esm(() => { + init_sceneLoader(); + init_logger(); + init_filesInputStore(); +}); + +// node_modules/@babylonjs/core/Misc/HighDynamicRange/index.js +var init_HighDynamicRange = __esm(() => { + init_cubemapToSphericalPolynomial(); + init_hdr(); + init_panoramaToCubemap(); +}); + +// node_modules/@babylonjs/core/Misc/observable.extensions.js +class MultiObserver { + dispose() { + if (this._observers && this._observables) { + for (let index = 0;index < this._observers.length; index++) { + this._observables[index].remove(this._observers[index]); } } - }); - await p; - return eventData; -}; + this._observers = null; + this._observables = null; + } + static Watch(observables, callback, mask = -1, scope = null) { + const result = new MultiObserver; + result._observers = new Array; + result._observables = observables; + for (const observable109 of observables) { + const observer2 = observable109.add(callback, mask, false, scope); + if (observer2) { + result._observers.push(observer2); + } + } + return result; + } +} +var init_observable_extensions = __esm(() => { + init_observable(); + Observable.prototype.notifyObserversWithPromise = async function(eventData, mask = -1, target, currentTarget, userInfo) { + let p = Promise.resolve(eventData); + if (!this.observers.length) { + return p; + } + const state = this._eventState; + state.mask = mask; + state.target = target; + state.currentTarget = currentTarget; + state.skipNextObservers = false; + state.userInfo = userInfo; + this.observers.forEach((obs) => { + if (state.skipNextObservers) { + return; + } + if (obs._willBeUnregistered) { + return; + } + if (obs.mask & mask) { + if (obs.scope) { + p = p.then((lastReturnedValue) => { + state.lastReturnValue = lastReturnedValue; + return obs.callback.apply(obs.scope, [eventData, state]); + }); + } else { + p = p.then((lastReturnedValue) => { + state.lastReturnValue = lastReturnedValue; + return obs.callback(eventData, state); + }); + } + if (obs.unregisterOnNextCall) { + this._deferUnregister(obs); + } + } + }); + await p; + return eventData; + }; +}); + // node_modules/@babylonjs/core/Misc/sceneOptimizer.js class SceneOptimization { getDescription() { @@ -165381,6 +186780,125 @@ class SceneOptimization { this.priority = priority; } } + +class TextureOptimization extends SceneOptimization { + getDescription() { + return "Reducing render target texture size to " + this.maximumSize; + } + constructor(priority = 0, maximumSize = 1024, step = 0.5) { + super(priority); + this.priority = priority; + this.maximumSize = maximumSize; + this.step = step; + } + apply(scene34, optimizer) { + let allDone = true; + for (let index = 0;index < scene34.textures.length; index++) { + const texture71 = scene34.textures[index]; + if (!texture71.canRescale || texture71.getContext) { + continue; + } + const currentSize = texture71.getSize(); + const maxDimension = Math.max(currentSize.width, currentSize.height); + if (maxDimension > this.maximumSize) { + texture71.scale(this.step); + allDone = false; + } + } + return allDone; + } +} + +class HardwareScalingOptimization extends SceneOptimization { + getDescription() { + return "Setting hardware scaling level to " + this._currentScale; + } + constructor(priority = 0, maximumScale = 2, step = 0.25) { + super(priority); + this.priority = priority; + this.maximumScale = maximumScale; + this.step = step; + this._currentScale = -1; + this._directionOffset = 1; + } + apply(scene34, optimizer) { + if (this._currentScale === -1) { + this._currentScale = scene34.getEngine().getHardwareScalingLevel(); + if (this._currentScale > this.maximumScale) { + this._directionOffset = -1; + } + } + this._currentScale += this._directionOffset * this.step; + scene34.getEngine().setHardwareScalingLevel(this._currentScale); + return this._directionOffset === 1 ? this._currentScale >= this.maximumScale : this._currentScale <= this.maximumScale; + } +} + +class ShadowsOptimization extends SceneOptimization { + getDescription() { + return "Turning shadows on/off"; + } + apply(scene34, optimizer) { + scene34.shadowsEnabled = optimizer.isInImprovementMode; + return true; + } +} + +class PostProcessesOptimization extends SceneOptimization { + getDescription() { + return "Turning post-processes on/off"; + } + apply(scene34, optimizer) { + scene34.postProcessesEnabled = optimizer.isInImprovementMode; + return true; + } +} + +class LensFlaresOptimization extends SceneOptimization { + getDescription() { + return "Turning lens flares on/off"; + } + apply(scene34, optimizer) { + scene34.lensFlaresEnabled = optimizer.isInImprovementMode; + return true; + } +} + +class CustomOptimization extends SceneOptimization { + getDescription() { + if (this.onGetDescription) { + return this.onGetDescription(); + } + return "Running user defined callback"; + } + apply(scene34, optimizer) { + if (this.onApply) { + return this.onApply(scene34, optimizer); + } + return true; + } +} + +class ParticlesOptimization extends SceneOptimization { + getDescription() { + return "Turning particles on/off"; + } + apply(scene34, optimizer) { + scene34.particlesEnabled = optimizer.isInImprovementMode; + return true; + } +} + +class RenderTargetsOptimization extends SceneOptimization { + getDescription() { + return "Turning render targets off"; + } + apply(scene34, optimizer) { + scene34.renderTargetsEnabled = optimizer.isInImprovementMode; + return true; + } +} + class MergeMeshesOptimization extends SceneOptimization { constructor() { super(...arguments); @@ -165460,90 +186978,221 @@ class MergeMeshesOptimization extends SceneOptimization { return true; } } -MergeMeshesOptimization._UpdateSelectionTree = false; -// node_modules/@babylonjs/core/Misc/sceneSerializer.js -var serializedGeometries = []; -var SerializeGeometry = (geometry5, serializationGeometries) => { - if (geometry5.doNotSerialize) { - return; + +class SceneOptimizerOptions { + constructor(targetFrameRate = 60, trackerDuration = 2000) { + this.targetFrameRate = targetFrameRate; + this.trackerDuration = trackerDuration; + this.optimizations = []; } - serializationGeometries.vertexData.push(geometry5.serializeVerticeData()); - serializedGeometries[geometry5.id] = true; -}; -var SerializeMesh = (mesh67, serializationScene) => { - const serializationObject = {}; - const geometry5 = mesh67._geometry; - if (geometry5) { - if (!mesh67.getScene().getGeometryById(geometry5.id)) { - SerializeGeometry(geometry5, serializationScene.geometries); - } + addOptimization(optimization) { + this.optimizations.push(optimization); + return this; } - if (mesh67.serialize) { - mesh67.serialize(serializationObject); + addCustomOptimization(onApply, onGetDescription, priority = 0) { + const optimization = new CustomOptimization(priority); + optimization.onApply = onApply; + optimization.onGetDescription = onGetDescription; + this.optimizations.push(optimization); + return this; } - return serializationObject; -}; -var FinalizeSingleNode = (node29, serializationObject) => { - if (node29._isMesh) { - const mesh67 = node29; - if (mesh67.delayLoadState === 1 || mesh67.delayLoadState === 0) { - const serializeMaterial = (material26) => { - serializationObject.materials = serializationObject.materials || []; - if (mesh67.material && !serializationObject.materials.some((mat) => mat.id === mesh67.material.id)) { - serializationObject.materials.push(material26.serialize()); - } - }; - if (mesh67.material && !mesh67.material.doNotSerialize) { - if (mesh67.material instanceof MultiMaterial) { - serializationObject.multiMaterials = serializationObject.multiMaterials || []; - if (!serializationObject.multiMaterials.some((mat) => mat.id === mesh67.material.id)) { - serializationObject.multiMaterials.push(mesh67.material.serialize()); - for (const submaterial of mesh67.material.subMaterials) { - if (submaterial) { - serializeMaterial(submaterial); - } - } - } - } else { - serializeMaterial(mesh67.material); - } - } else if (!mesh67.material) { - serializeMaterial(mesh67.getScene().defaultMaterial); - } - const geometry5 = mesh67._geometry; - if (geometry5) { - if (!serializationObject.geometries) { - serializationObject.geometries = {}; - serializationObject.geometries.boxes = []; - serializationObject.geometries.spheres = []; - serializationObject.geometries.cylinders = []; - serializationObject.geometries.toruses = []; - serializationObject.geometries.grounds = []; - serializationObject.geometries.planes = []; - serializationObject.geometries.torusKnots = []; - serializationObject.geometries.vertexData = []; - } - SerializeGeometry(geometry5, serializationObject.geometries); + static LowDegradationAllowed(targetFrameRate) { + const result = new SceneOptimizerOptions(targetFrameRate); + let priority = 0; + result.addOptimization(new MergeMeshesOptimization(priority)); + result.addOptimization(new ShadowsOptimization(priority)); + result.addOptimization(new LensFlaresOptimization(priority)); + priority++; + result.addOptimization(new PostProcessesOptimization(priority)); + result.addOptimization(new ParticlesOptimization(priority)); + priority++; + result.addOptimization(new TextureOptimization(priority, 1024)); + return result; + } + static ModerateDegradationAllowed(targetFrameRate) { + const result = new SceneOptimizerOptions(targetFrameRate); + let priority = 0; + result.addOptimization(new MergeMeshesOptimization(priority)); + result.addOptimization(new ShadowsOptimization(priority)); + result.addOptimization(new LensFlaresOptimization(priority)); + priority++; + result.addOptimization(new PostProcessesOptimization(priority)); + result.addOptimization(new ParticlesOptimization(priority)); + priority++; + result.addOptimization(new TextureOptimization(priority, 512)); + priority++; + result.addOptimization(new RenderTargetsOptimization(priority)); + priority++; + result.addOptimization(new HardwareScalingOptimization(priority, 2)); + return result; + } + static HighDegradationAllowed(targetFrameRate) { + const result = new SceneOptimizerOptions(targetFrameRate); + let priority = 0; + result.addOptimization(new MergeMeshesOptimization(priority)); + result.addOptimization(new ShadowsOptimization(priority)); + result.addOptimization(new LensFlaresOptimization(priority)); + priority++; + result.addOptimization(new PostProcessesOptimization(priority)); + result.addOptimization(new ParticlesOptimization(priority)); + priority++; + result.addOptimization(new TextureOptimization(priority, 256)); + priority++; + result.addOptimization(new RenderTargetsOptimization(priority)); + priority++; + result.addOptimization(new HardwareScalingOptimization(priority, 4)); + return result; + } +} + +class SceneOptimizer { + get isInImprovementMode() { + return this._improvementMode; + } + set isInImprovementMode(value) { + this._improvementMode = value; + } + get currentPriorityLevel() { + return this._currentPriorityLevel; + } + get currentFrameRate() { + return this._currentFrameRate; + } + get targetFrameRate() { + return this._targetFrameRate; + } + set targetFrameRate(value) { + this._targetFrameRate = value; + } + get trackerDuration() { + return this._trackerDuration; + } + set trackerDuration(value) { + this._trackerDuration = value; + } + get optimizations() { + return this._options.optimizations; + } + constructor(scene34, options, autoGeneratePriorities = true, improvementMode = false) { + this._isRunning = false; + this._currentPriorityLevel = 0; + this._targetFrameRate = 60; + this._trackerDuration = 2000; + this._currentFrameRate = 0; + this._improvementMode = false; + this.onSuccessObservable = new Observable; + this.onNewOptimizationAppliedObservable = new Observable; + this.onFailureObservable = new Observable; + if (!options) { + this._options = new SceneOptimizerOptions; + } else { + this._options = options; + } + if (this._options.targetFrameRate) { + this._targetFrameRate = this._options.targetFrameRate; + } + if (this._options.trackerDuration) { + this._trackerDuration = this._options.trackerDuration; + } + if (autoGeneratePriorities) { + let priority = 0; + for (const optim of this._options.optimizations) { + optim.priority = priority++; } - if (mesh67.skeleton && !mesh67.skeleton.doNotSerialize) { - serializationObject.skeletons = serializationObject.skeletons || []; - serializationObject.skeletons.push(mesh67.skeleton.serialize()); + } + this._improvementMode = improvementMode; + this._scene = scene34 || EngineStore.LastCreatedScene; + this._sceneDisposeObserver = this._scene.onDisposeObservable.add(() => { + this._sceneDisposeObserver = null; + this.dispose(); + }); + } + stop() { + this._isRunning = false; + } + reset() { + this._currentPriorityLevel = 0; + } + start() { + if (this._isRunning) { + return; + } + this._isRunning = true; + this._scene.executeWhenReady(() => { + setTimeout(() => { + this._checkCurrentState(); + }, this._trackerDuration); + }); + } + _checkCurrentState() { + if (!this._isRunning) { + return; + } + const scene34 = this._scene; + const options = this._options; + this._currentFrameRate = Math.round(scene34.getEngine().getFps()); + if (this._improvementMode && this._currentFrameRate <= this._targetFrameRate || !this._improvementMode && this._currentFrameRate >= this._targetFrameRate) { + this._isRunning = false; + this.onSuccessObservable.notifyObservers(this); + return; + } + let allDone = true; + let noOptimizationApplied = true; + for (let index = 0;index < options.optimizations.length; index++) { + const optimization = options.optimizations[index]; + if (optimization.priority === this._currentPriorityLevel) { + noOptimizationApplied = false; + allDone = allDone && optimization.apply(scene34, this); + this.onNewOptimizationAppliedObservable.notifyObservers(optimization); } - serializationObject.meshes = serializationObject.meshes || []; - serializationObject.meshes.push(SerializeMesh(mesh67, serializationObject)); } - } else if (node29.getClassName() === "TransformNode") { - const transformNode18 = node29; - serializationObject.transformNodes.push(transformNode18.serialize()); - } else if (node29.getClassName().indexOf("Camera") !== -1) { - const camera31 = node29; - serializationObject.cameras.push(camera31.serialize()); - } else if (node29.getClassName().indexOf("Light") !== -1) { - const light11 = node29; - serializationObject.lights.push(light11.serialize()); + if (noOptimizationApplied) { + this._isRunning = false; + this.onFailureObservable.notifyObservers(this); + return; + } + if (allDone) { + this._currentPriorityLevel++; + } + scene34.executeWhenReady(() => { + setTimeout(() => { + this._checkCurrentState(); + }, this._trackerDuration); + }); } -}; + dispose() { + this.stop(); + this.onSuccessObservable.clear(); + this.onFailureObservable.clear(); + this.onNewOptimizationAppliedObservable.clear(); + if (this._sceneDisposeObserver) { + this._scene.onDisposeObservable.remove(this._sceneDisposeObserver); + } + } + static OptimizeAsync(scene34, options, onSuccess, onFailure) { + const optimizer = new SceneOptimizer(scene34, options || SceneOptimizerOptions.ModerateDegradationAllowed(), false); + if (onSuccess) { + optimizer.onSuccessObservable.add(() => { + onSuccess(); + }); + } + if (onFailure) { + optimizer.onFailureObservable.add(() => { + onFailure(); + }); + } + optimizer.start(); + return optimizer; + } +} +var init_sceneOptimizer = __esm(() => { + init_engineStore(); + init_mesh(); + init_observable(); + MergeMeshesOptimization._UpdateSelectionTree = false; +}); +// node_modules/@babylonjs/core/Misc/sceneSerializer.js class SceneSerializer { static ClearCache() { serializedGeometries = []; @@ -165721,11 +187370,11 @@ class SceneSerializer { } } } else if (obj instanceof Object) { - for (const name262 in obj) { - if (Object.prototype.hasOwnProperty.call(obj, name262)) { - const o = obj[name262]; + for (const name263 in obj) { + if (Object.prototype.hasOwnProperty.call(obj, name263)) { + const o = obj[name263]; if (o instanceof Promise) { - promises.push(o.then((res) => obj[name262] = res)); + promises.push(o.then((res) => obj[name263] = res)); } else if (o instanceof Object || Array.isArray(o)) { this._CollectPromises(o, promises); } @@ -165761,6 +187410,95 @@ class SceneSerializer { return serializationObject; } } +var serializedGeometries, SerializeGeometry, SerializeMesh, FinalizeSingleNode; +var init_sceneSerializer = __esm(() => { + init_mesh(); + init_multiMaterial(); + init_decorators(); + init_texture(); + serializedGeometries = []; + SerializeGeometry = (geometry5, serializationGeometries) => { + if (geometry5.doNotSerialize) { + return; + } + serializationGeometries.vertexData.push(geometry5.serializeVerticeData()); + serializedGeometries[geometry5.id] = true; + }; + SerializeMesh = (mesh67, serializationScene) => { + const serializationObject = {}; + const geometry5 = mesh67._geometry; + if (geometry5) { + if (!mesh67.getScene().getGeometryById(geometry5.id)) { + SerializeGeometry(geometry5, serializationScene.geometries); + } + } + if (mesh67.serialize) { + mesh67.serialize(serializationObject); + } + return serializationObject; + }; + FinalizeSingleNode = (node29, serializationObject) => { + if (node29._isMesh) { + const mesh67 = node29; + if (mesh67.delayLoadState === 1 || mesh67.delayLoadState === 0) { + const serializeMaterial = (material26) => { + serializationObject.materials = serializationObject.materials || []; + if (mesh67.material && !serializationObject.materials.some((mat) => mat.id === mesh67.material.id)) { + serializationObject.materials.push(material26.serialize()); + } + }; + if (mesh67.material && !mesh67.material.doNotSerialize) { + if (mesh67.material instanceof MultiMaterial) { + serializationObject.multiMaterials = serializationObject.multiMaterials || []; + if (!serializationObject.multiMaterials.some((mat) => mat.id === mesh67.material.id)) { + serializationObject.multiMaterials.push(mesh67.material.serialize()); + for (const submaterial of mesh67.material.subMaterials) { + if (submaterial) { + serializeMaterial(submaterial); + } + } + } + } else { + serializeMaterial(mesh67.material); + } + } else if (!mesh67.material) { + serializeMaterial(mesh67.getScene().defaultMaterial); + } + const geometry5 = mesh67._geometry; + if (geometry5) { + if (!serializationObject.geometries) { + serializationObject.geometries = {}; + serializationObject.geometries.boxes = []; + serializationObject.geometries.spheres = []; + serializationObject.geometries.cylinders = []; + serializationObject.geometries.toruses = []; + serializationObject.geometries.grounds = []; + serializationObject.geometries.planes = []; + serializationObject.geometries.torusKnots = []; + serializationObject.geometries.vertexData = []; + } + SerializeGeometry(geometry5, serializationObject.geometries); + } + if (mesh67.skeleton && !mesh67.skeleton.doNotSerialize) { + serializationObject.skeletons = serializationObject.skeletons || []; + serializationObject.skeletons.push(mesh67.skeleton.serialize()); + } + serializationObject.meshes = serializationObject.meshes || []; + serializationObject.meshes.push(SerializeMesh(mesh67, serializationObject)); + } + } else if (node29.getClassName() === "TransformNode") { + const transformNode18 = node29; + serializationObject.transformNodes.push(transformNode18.serialize()); + } else if (node29.getClassName().indexOf("Camera") !== -1) { + const camera31 = node29; + serializationObject.cameras.push(camera31.serialize()); + } else if (node29.getClassName().indexOf("Light") !== -1) { + const light11 = node29; + serializationObject.lights.push(light11.serialize()); + } + }; +}); + // node_modules/@babylonjs/core/Misc/videoRecorder.js class VideoRecorder { static IsSupported(engine46) { @@ -165858,11 +187596,15 @@ class VideoRecorder { } } } -VideoRecorder._DefaultOptions = { - mimeType: "video/webm", - fps: 25, - recordChunckSize: 3000 -}; +var init_videoRecorder = __esm(() => { + init_tools(); + VideoRecorder._DefaultOptions = { + mimeType: "video/webm", + fps: 25, + recordChunckSize: 3000 + }; +}); + // node_modules/@babylonjs/core/Misc/screenshotTools.js function CreateScreenshot(engine46, camera31, size, successCallback, mimeType = "image/png", forceDownload = false, quality) { const { height, width } = _GetScreenshotSize(engine46, camera31, size); @@ -165928,6 +187670,13 @@ function CreateScreenshotAsync(engine46, camera31, size, mimeType = "image/png", }, mimeType, undefined, quality); }); } +function CreateScreenshotWithResizeAsync(engine46, camera31, width, height, mimeType = "image/png", quality) { + return new Promise((resolve) => { + CreateScreenshot(engine46, camera31, { width, height }, () => { + resolve(); + }, mimeType, true, quality); + }); +} function CreateScreenshotUsingRenderTarget(engine46, camera31, size, successCallback, mimeType = "image/png", samples = 1, antialiasing = false, fileName, renderSprites = false, enableStencilBuffer = false, useLayerMask = true, quality, customizeTexture) { const { height, width, finalWidth, finalHeight } = _GetScreenshotSize(engine46, camera31, size); const targetTextureSize = { width, height }; @@ -166002,82 +187751,119 @@ function CreateScreenshotUsingRenderTargetAsync(engine46, camera31, size, mimeTy }, mimeType, samples, antialiasing, fileName, renderSprites, enableStencilBuffer, useLayerMask, quality); }); } -var _GetScreenshotSize = function(engine46, camera31, size) { - let height = 0; - let width = 0; - let finalWidth = 0; - let finalHeight = 0; - if (typeof size === "object") { - const precision = size.precision ? Math.abs(size.precision) : 1; - if (size.width && size.height) { - height = size.height * precision; - width = size.width * precision; - } else if (size.width && !size.height) { - width = size.width * precision; - height = Math.round(width / engine46.getAspectRatio(camera31)); - } else if (size.height && !size.width) { - height = size.height * precision; - width = Math.round(height * engine46.getAspectRatio(camera31)); - } else { - width = Math.round(engine46.getRenderWidth() * precision); - height = Math.round(width / engine46.getAspectRatio(camera31)); - } - if (size.finalWidth && size.finalHeight) { - finalHeight = size.finalHeight; - finalWidth = size.finalWidth; - } else if (size.finalWidth && !size.finalHeight) { - finalWidth = size.finalWidth; - finalHeight = Math.round(finalWidth / engine46.getAspectRatio(camera31)); - } else if (size.finalHeight && !size.finalWidth) { - finalHeight = size.finalHeight; - finalWidth = Math.round(finalHeight * engine46.getAspectRatio(camera31)); - } else { - finalWidth = width; - finalHeight = height; - } - } else if (!isNaN(size)) { - height = size; - width = size; - finalWidth = size; - finalHeight = size; - } - if (width) { - width = Math.floor(width); - } - if (height) { - height = Math.floor(height); - } - if (finalWidth) { - finalWidth = Math.floor(finalWidth); - } - if (finalHeight) { - finalHeight = Math.floor(finalHeight); - } - return { height: height | 0, width: width | 0, finalWidth: finalWidth | 0, finalHeight: finalHeight | 0 }; -}; -var screenshotCanvas = null; -var initSideEffects3 = () => { - Tools.CreateScreenshot = CreateScreenshot; - Tools.CreateScreenshotAsync = CreateScreenshotAsync; - Tools.CreateScreenshotUsingRenderTarget = CreateScreenshotUsingRenderTarget; - Tools.CreateScreenshotUsingRenderTargetAsync = CreateScreenshotUsingRenderTargetAsync; -}; -initSideEffects3(); +var _GetScreenshotSize, screenshotCanvas, ScreenshotTools, initSideEffects3; +var init_screenshotTools = __esm(() => { + init_texture(); + init_renderTargetTexture(); + init_fxaaPostProcess(); + init_logger(); + init_tools(); + init_dumpTools(); + init_textureTools(); + _GetScreenshotSize = function(engine46, camera31, size) { + let height = 0; + let width = 0; + let finalWidth = 0; + let finalHeight = 0; + if (typeof size === "object") { + const precision = size.precision ? Math.abs(size.precision) : 1; + if (size.width && size.height) { + height = size.height * precision; + width = size.width * precision; + } else if (size.width && !size.height) { + width = size.width * precision; + height = Math.round(width / engine46.getAspectRatio(camera31)); + } else if (size.height && !size.width) { + height = size.height * precision; + width = Math.round(height * engine46.getAspectRatio(camera31)); + } else { + width = Math.round(engine46.getRenderWidth() * precision); + height = Math.round(width / engine46.getAspectRatio(camera31)); + } + if (size.finalWidth && size.finalHeight) { + finalHeight = size.finalHeight; + finalWidth = size.finalWidth; + } else if (size.finalWidth && !size.finalHeight) { + finalWidth = size.finalWidth; + finalHeight = Math.round(finalWidth / engine46.getAspectRatio(camera31)); + } else if (size.finalHeight && !size.finalWidth) { + finalHeight = size.finalHeight; + finalWidth = Math.round(finalHeight * engine46.getAspectRatio(camera31)); + } else { + finalWidth = width; + finalHeight = height; + } + } else if (!isNaN(size)) { + height = size; + width = size; + finalWidth = size; + finalHeight = size; + } + if (width) { + width = Math.floor(width); + } + if (height) { + height = Math.floor(height); + } + if (finalWidth) { + finalWidth = Math.floor(finalWidth); + } + if (finalHeight) { + finalHeight = Math.floor(finalHeight); + } + return { height: height | 0, width: width | 0, finalWidth: finalWidth | 0, finalHeight: finalHeight | 0 }; + }; + screenshotCanvas = null; + ScreenshotTools = { + CreateScreenshot, + CreateScreenshotAsync, + CreateScreenshotWithResizeAsync, + CreateScreenshotUsingRenderTarget, + CreateScreenshotUsingRenderTargetAsync + }; + initSideEffects3 = () => { + Tools.CreateScreenshot = CreateScreenshot; + Tools.CreateScreenshotAsync = CreateScreenshotAsync; + Tools.CreateScreenshotUsingRenderTarget = CreateScreenshotUsingRenderTarget; + Tools.CreateScreenshotUsingRenderTargetAsync = CreateScreenshotUsingRenderTargetAsync; + }; + initSideEffects3(); +}); + // node_modules/@babylonjs/core/Misc/iInspectable.js var InspectableType; -(function(InspectableType2) { - InspectableType2[InspectableType2["Checkbox"] = 0] = "Checkbox"; - InspectableType2[InspectableType2["Slider"] = 1] = "Slider"; - InspectableType2[InspectableType2["Vector3"] = 2] = "Vector3"; - InspectableType2[InspectableType2["Quaternion"] = 3] = "Quaternion"; - InspectableType2[InspectableType2["Color3"] = 4] = "Color3"; - InspectableType2[InspectableType2["String"] = 5] = "String"; - InspectableType2[InspectableType2["Button"] = 6] = "Button"; - InspectableType2[InspectableType2["Options"] = 7] = "Options"; - InspectableType2[InspectableType2["Tab"] = 8] = "Tab"; - InspectableType2[InspectableType2["FileButton"] = 9] = "FileButton"; - InspectableType2[InspectableType2["Vector2"] = 10] = "Vector2"; -})(InspectableType || (InspectableType = {})); +var init_iInspectable = __esm(() => { + (function(InspectableType2) { + InspectableType2[InspectableType2["Checkbox"] = 0] = "Checkbox"; + InspectableType2[InspectableType2["Slider"] = 1] = "Slider"; + InspectableType2[InspectableType2["Vector3"] = 2] = "Vector3"; + InspectableType2[InspectableType2["Quaternion"] = 3] = "Quaternion"; + InspectableType2[InspectableType2["Color3"] = 4] = "Color3"; + InspectableType2[InspectableType2["String"] = 5] = "String"; + InspectableType2[InspectableType2["Button"] = 6] = "Button"; + InspectableType2[InspectableType2["Options"] = 7] = "Options"; + InspectableType2[InspectableType2["Tab"] = 8] = "Tab"; + InspectableType2[InspectableType2["FileButton"] = 9] = "FileButton"; + InspectableType2[InspectableType2["Vector2"] = 10] = "Vector2"; + })(InspectableType || (InspectableType = {})); +}); + +// node_modules/@babylonjs/core/Misc/fileRequest.js +var init_fileRequest = __esm(() => { +}); + +// node_modules/@babylonjs/core/Misc/customAnimationFrameRequester.js +var init_customAnimationFrameRequester = __esm(() => { +}); + +// node_modules/@babylonjs/core/Misc/interfaces/screenshotSize.js +var init_screenshotSize = __esm(() => { +}); + +// node_modules/@babylonjs/core/Misc/interfaces/iPerfViewer.js +var init_iPerfViewer = __esm(() => { +}); + // node_modules/@babylonjs/core/Misc/dataReader.js class DataReader { constructor(buffer68) { @@ -166110,6 +187896,10 @@ class DataReader { this.byteOffset += byteLength; } } +var init_dataReader = __esm(() => { + init_stringTools(); +}); + // node_modules/@babylonjs/core/Misc/dataStorage.js class DataStorage { static _GetStorage() { @@ -166152,121 +187942,260 @@ class DataStorage { this._Storage.setItem(key, value.toString()); } } -DataStorage._Storage = DataStorage._GetStorage(); -// node_modules/@babylonjs/core/Misc/trajectoryClassifier.js -var Levenshtein; -(function(Levenshtein2) { - - class Alphabet { - serialize() { - const jsonObject = {}; - const characters = new Array(this._characterToIdx.size); - this._characterToIdx.forEach((v, k) => { - characters[v] = k; - }); - jsonObject["characters"] = characters; - jsonObject["insertionCosts"] = this._insertionCosts; - jsonObject["deletionCosts"] = this._deletionCosts; - jsonObject["substitutionCosts"] = this._substitutionCosts; - return JSON.stringify(jsonObject); - } - static Deserialize(json) { - const jsonObject = JSON.parse(json); - const alphabet = new Alphabet(jsonObject["characters"]); - alphabet._insertionCosts = jsonObject["insertionCosts"]; - alphabet._deletionCosts = jsonObject["deletionCosts"]; - alphabet._substitutionCosts = jsonObject["substitutionCosts"]; - return alphabet; - } - constructor(characters, charToInsertionCost = null, charToDeletionCost = null, charsToSubstitutionCost = null) { - charToInsertionCost = charToInsertionCost !== null && charToInsertionCost !== undefined ? charToInsertionCost : () => 1; - charToDeletionCost = charToDeletionCost !== null && charToDeletionCost !== undefined ? charToDeletionCost : () => 1; - charsToSubstitutionCost = charsToSubstitutionCost !== null && charsToSubstitutionCost !== undefined ? charsToSubstitutionCost : (a, b) => a === b ? 0 : 1; - this._characterToIdx = new Map; - this._insertionCosts = new Array(characters.length); - this._deletionCosts = new Array(characters.length); - this._substitutionCosts = new Array(characters.length); - let c; - for (let outerIdx = 0;outerIdx < characters.length; ++outerIdx) { - c = characters[outerIdx]; - this._characterToIdx.set(c, outerIdx); - this._insertionCosts[outerIdx] = charToInsertionCost(c); - this._deletionCosts[outerIdx] = charToDeletionCost(c); - this._substitutionCosts[outerIdx] = new Array(characters.length); - for (let innerIdx = outerIdx;innerIdx < characters.length; ++innerIdx) { - this._substitutionCosts[outerIdx][innerIdx] = charsToSubstitutionCost(c, characters[innerIdx]); - } - } - } - getCharacterIdx(char) { - return this._characterToIdx.get(char); - } - getInsertionCost(idx) { - return this._insertionCosts[idx]; - } - getDeletionCost(idx) { - return this._deletionCosts[idx]; - } - getSubstitutionCost(idx1, idx2) { - const min = Math.min(idx1, idx2); - const max = Math.max(idx1, idx2); - return this._substitutionCosts[min][max]; - } - } - Levenshtein2.Alphabet = Alphabet; - - class Sequence { - serialize() { - return JSON.stringify(this._characters); - } - static Deserialize(json, alphabet) { - const sequence = new Sequence([], alphabet); - sequence._characters = JSON.parse(json); - return sequence; - } - constructor(characters, alphabet) { - if (characters.length > Sequence._MAX_SEQUENCE_LENGTH) { - throw new Error("Sequences longer than " + Sequence._MAX_SEQUENCE_LENGTH + " not supported."); - } - this._alphabet = alphabet; - this._characters = characters.map((c) => this._alphabet.getCharacterIdx(c)); - } - distance(other) { - return Sequence._Distance(this, other); - } - static _Distance(a, b) { - const alphabet = a._alphabet; - if (alphabet !== b._alphabet) { - throw new Error("Cannot Levenshtein compare Sequences built from different alphabets."); - } - const aChars = a._characters; - const bChars = b._characters; - const aLength = aChars.length; - const bLength = bChars.length; - const costMatrix = Sequence._CostMatrix; - costMatrix[0][0] = 0; - for (let idx = 0;idx < aLength; ++idx) { - costMatrix[idx + 1][0] = costMatrix[idx][0] + alphabet.getInsertionCost(aChars[idx]); - } - for (let idx = 0;idx < bLength; ++idx) { - costMatrix[0][idx + 1] = costMatrix[0][idx] + alphabet.getInsertionCost(bChars[idx]); - } - for (let aIdx = 0;aIdx < aLength; ++aIdx) { - for (let bIdx = 0;bIdx < bLength; ++bIdx) { - Sequence._InsertionCost = costMatrix[aIdx + 1][bIdx] + alphabet.getInsertionCost(bChars[bIdx]); - Sequence._DeletionCost = costMatrix[aIdx][bIdx + 1] + alphabet.getDeletionCost(aChars[aIdx]); - Sequence._SubstitutionCost = costMatrix[aIdx][bIdx] + alphabet.getSubstitutionCost(aChars[aIdx], bChars[bIdx]); - costMatrix[aIdx + 1][bIdx + 1] = Math.min(Sequence._InsertionCost, Sequence._DeletionCost, Sequence._SubstitutionCost); - } - } - return costMatrix[aLength][bLength]; - } - } - Sequence._MAX_SEQUENCE_LENGTH = 256; - Sequence._CostMatrix = [...Array(Sequence._MAX_SEQUENCE_LENGTH + 1)].map(() => new Array(Sequence._MAX_SEQUENCE_LENGTH + 1)); - Levenshtein2.Sequence = Sequence; -})(Levenshtein || (Levenshtein = {})); +var init_dataStorage = __esm(() => { + DataStorage._Storage = DataStorage._GetStorage(); +}); + +// node_modules/@babylonjs/core/Misc/sceneRecorder.js +class SceneRecorder { + constructor() { + this._trackedScene = null; + } + track(scene34) { + this._trackedScene = scene34; + SerializationHelper.AllowLoadingUniqueId = true; + this._savedJSON = SceneSerializer.Serialize(scene34); + SerializationHelper.AllowLoadingUniqueId = false; + } + getDelta() { + if (!this._trackedScene) { + return null; + } + const currentForceSerializeBuffers = Texture.ForceSerializeBuffers; + Texture.ForceSerializeBuffers = false; + SerializationHelper.AllowLoadingUniqueId = true; + const newJSON = SceneSerializer.Serialize(this._trackedScene); + SerializationHelper.AllowLoadingUniqueId = false; + const deltaJSON = {}; + for (const node29 in newJSON) { + this._compareCollections(node29, this._savedJSON[node29], newJSON[node29], deltaJSON); + } + Texture.ForceSerializeBuffers = currentForceSerializeBuffers; + return deltaJSON; + } + _compareArray(key, original, current, deltaJSON) { + if (original.length === 0 && current.length === 0) { + return true; + } + if (original.length && !isNaN(original[0]) || current.length && !isNaN(current[0])) { + if (original.length !== current.length) { + return false; + } + if (original.length === 0) { + return true; + } + for (let index = 0;index < original.length; index++) { + if (original[index] !== current[index]) { + deltaJSON[key] = current; + return false; + } + } + return true; + } + const originalUniqueIds = []; + for (let index = 0;index < original.length; index++) { + const originalObject = original[index]; + const originalUniqueId = originalObject.uniqueId; + originalUniqueIds.push(originalUniqueId); + const currentObjects = current.filter((c) => c.uniqueId === originalUniqueId); + if (currentObjects.length) { + const currentObject = currentObjects[0]; + const newObject = {}; + if (!this._compareObjects(originalObject, currentObject, newObject)) { + if (!deltaJSON[key]) { + deltaJSON[key] = []; + } + newObject.__state = { + id: currentObject.id || currentObject.name + }; + deltaJSON[key].push(newObject); + } + } else { + const newObject = { + __state: { + deleteId: originalObject.id || originalObject.name + } + }; + if (!deltaJSON[key]) { + deltaJSON[key] = []; + } + deltaJSON[key].push(newObject); + } + } + for (let index = 0;index < current.length; index++) { + const currentObject = current[index]; + const currentUniqueId = currentObject.uniqueId; + if (originalUniqueIds.indexOf(currentUniqueId) === -1) { + if (!deltaJSON[key]) { + deltaJSON[key] = []; + } + deltaJSON[key].push(currentObject); + } + } + return true; + } + _compareObjects(originalObjet, currentObject, deltaJSON) { + let aDifferenceWasFound = false; + for (const prop in originalObjet) { + if (!Object.prototype.hasOwnProperty.call(originalObjet, prop)) { + continue; + } + const originalValue = originalObjet[prop]; + const currentValue = currentObject[prop]; + let diffFound = false; + if (Array.isArray(originalValue)) { + diffFound = JSON.stringify(originalValue) !== JSON.stringify(currentValue); + } else if (!isNaN(originalValue) || Object.prototype.toString.call(originalValue) == "[object String]") { + diffFound = originalValue !== currentValue; + } else if (typeof originalValue === "object" && typeof currentValue === "object") { + const newObject = {}; + if (!this._compareObjects(originalValue, currentValue, newObject)) { + deltaJSON[prop] = newObject; + aDifferenceWasFound = true; + } + } + if (diffFound) { + aDifferenceWasFound = true; + deltaJSON[prop] = currentValue; + } + } + return !aDifferenceWasFound; + } + _compareCollections(key, original, current, deltaJSON) { + if (original === current) { + return; + } + if (original && current) { + if (Array.isArray(original) && Array.isArray(current)) { + if (this._compareArray(key, original, current, deltaJSON)) { + return; + } + } else if (typeof original === "object" && typeof current === "object") { + const newObject = {}; + if (!this._compareObjects(original, current, newObject)) { + deltaJSON[key] = newObject; + } + return; + } + } + } + static GetShadowGeneratorById(scene34, id) { + const allGenerators = scene34.lights.map((l) => l.getShadowGenerators()); + for (const generators of allGenerators) { + if (generators) { + const iterator = generators.values(); + for (let key = iterator.next();key.done !== true; key = iterator.next()) { + const generator = key.value; + if (generator && generator.id === id) { + return generator; + } + } + } + } + return null; + } + static ApplyDelta(deltaJSON, scene34) { + if (typeof deltaJSON === "string") { + deltaJSON = JSON.parse(deltaJSON); + } + const anyScene = scene34; + for (const prop in deltaJSON) { + const source = deltaJSON[prop]; + const property = anyScene[prop]; + if (Array.isArray(property) || prop === "shadowGenerators") { + switch (prop) { + case "cameras": + this._ApplyDeltaForEntity(source, scene34, scene34.getCameraById.bind(scene34), (data) => Camera.Parse(data, scene34)); + break; + case "lights": + this._ApplyDeltaForEntity(source, scene34, scene34.getLightById.bind(scene34), (data) => Light.Parse(data, scene34)); + break; + case "shadowGenerators": + this._ApplyDeltaForEntity(source, scene34, (id) => this.GetShadowGeneratorById(scene34, id), (data) => ShadowGenerator.Parse(data, scene34)); + break; + case "meshes": + this._ApplyDeltaForEntity(source, scene34, scene34.getMeshById.bind(scene34), (data) => Mesh.Parse(data, scene34, "")); + break; + case "skeletons": + this._ApplyDeltaForEntity(source, scene34, scene34.getSkeletonById.bind(scene34), (data) => Skeleton.Parse(data, scene34)); + break; + case "materials": + this._ApplyDeltaForEntity(source, scene34, scene34.getMaterialById.bind(scene34), (data) => Material.Parse(data, scene34, "")); + break; + case "multiMaterials": + this._ApplyDeltaForEntity(source, scene34, scene34.getMaterialById.bind(scene34), (data) => MultiMaterial.Parse(data, scene34, "")); + break; + case "transformNodes": + this._ApplyDeltaForEntity(source, scene34, scene34.getTransformNodeById.bind(scene34), (data) => TransformNode.Parse(data, scene34, "")); + break; + case "particleSystems": + this._ApplyDeltaForEntity(source, scene34, scene34.getParticleSystemById.bind(scene34), (data) => ParticleSystem.Parse(data, scene34, "")); + break; + case "morphTargetManagers": + this._ApplyDeltaForEntity(source, scene34, scene34.getMorphTargetById.bind(scene34), (data) => MorphTargetManager.Parse(data, scene34)); + break; + case "postProcesses": + this._ApplyDeltaForEntity(source, scene34, scene34.getPostProcessByName.bind(scene34), (data) => PostProcess.Parse(data, scene34, "")); + break; + } + } else if (!isNaN(property)) { + anyScene[prop] = source; + } else if (property.fromArray) { + property.fromArray(source); + } + } + } + static _ApplyPropertiesToEntity(deltaJSON, entity) { + for (const prop in deltaJSON) { + const source = deltaJSON[prop]; + const property = entity[prop]; + if (property === undefined) { + continue; + } + if (!isNaN(property) || Array.isArray(property)) { + entity[prop] = source; + } else if (property.fromArray) { + property.fromArray(source); + } else if (typeof property === "object" && property !== null) { + this._ApplyPropertiesToEntity(source, property); + } + } + } + static _ApplyDeltaForEntity(sources, scene34, finder, addNew) { + for (const source of sources) { + if (source.__state && source.__state.id !== undefined) { + const targetEntity = finder(source.__state.id); + if (targetEntity) { + this._ApplyPropertiesToEntity(source, targetEntity); + SerializationHelper.ParseProperties(source, targetEntity, scene34, null); + } + } else if (source.__state && source.__state.deleteId !== undefined) { + const target = finder(source.__state.deleteId); + target === null || target === undefined || target.dispose(); + } else { + addNew(source); + } + } + } +} +var init_sceneRecorder = __esm(() => { + init_sceneSerializer(); + init_mesh(); + init_light(); + init_camera(); + init_skeleton(); + init_material(); + init_multiMaterial(); + init_transformNode(); + init_particleSystem(); + init_morphTargetManager(); + init_shadowGenerator(); + init_postProcess(); + init_texture(); + init_decorators(); +}); +// node_modules/@babylonjs/core/Misc/trajectoryClassifier.js class Trajectory { serialize() { return JSON.stringify(this); @@ -166348,11 +188277,58 @@ class Trajectory { return Trajectory._BestMatch; } } -Trajectory._ForwardDir = new Vector3; -Trajectory._InverseFromVec = new Vector3; -Trajectory._UpDir = new Vector3; -Trajectory._FromToVec = new Vector3; -Trajectory._LookMatrix = new Matrix; + +class Vector3Alphabet { + static Generate(alphabetSize = 64, iterations = 256, startingStepSize = 0.1, endingStepSize = 0.001, fixedValues = []) { + const EPSILON = 0.001; + const EPSILON_SQUARED = EPSILON * EPSILON; + const alphabet = new Vector3Alphabet(alphabetSize); + for (let idx = 0;idx < alphabetSize; ++idx) { + alphabet.chars[idx] = new Vector3(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5); + alphabet.chars[idx].normalize(); + } + for (let idx = 0;idx < fixedValues.length; ++idx) { + alphabet.chars[idx].copyFrom(fixedValues[idx]); + } + let stepSize; + let distSq; + const force = new Vector3; + const scratch = new Vector3; + const lerp = (l, r, t) => (1 - t) * l + t * r; + for (let iteration = 0;iteration < iterations; ++iteration) { + stepSize = lerp(startingStepSize, endingStepSize, iteration / (iterations - 1)); + for (let idx = fixedValues.length;idx < alphabet.chars.length; ++idx) { + force.copyFromFloats(0, 0, 0); + alphabet.chars.forEach((pt) => { + alphabet.chars[idx].subtractToRef(pt, scratch); + distSq = scratch.lengthSquared(); + if (distSq > EPSILON_SQUARED) { + scratch.scaleAndAddToRef(1 / (scratch.lengthSquared() * distSq), force); + } + }); + force.scaleInPlace(stepSize); + alphabet.chars[idx].addInPlace(force); + alphabet.chars[idx].normalize(); + } + } + return alphabet; + } + serialize() { + return JSON.stringify(this.chars); + } + static Deserialize(json) { + const jsonObject = JSON.parse(json); + const alphabet = new Vector3Alphabet(jsonObject.length); + for (let idx = 0;idx < jsonObject.length; ++idx) { + alphabet.chars[idx] = new Vector3(jsonObject[idx]["_x"], jsonObject[idx]["_y"], jsonObject[idx]["_z"]); + } + return alphabet; + } + constructor(size) { + this.chars = new Array(size); + } +} + class TrajectoryDescriptor { serialize() { return JSON.stringify(this._sequences.map((sequence) => sequence.serialize())); @@ -166390,7 +188366,6 @@ class TrajectoryDescriptor { return totalDistance; } } -TrajectoryDescriptor._FINEST_DESCRIPTOR_RESOLUTION = 32; class TrajectoryClass { serialize() { @@ -166448,7 +188423,203 @@ class TrajectoryClass { } } } -TrajectoryClass._MIN_AVERAGE_DISTANCE = 1; + +class TrajectoryClassifier { + serialize() { + const jsonObject = {}; + jsonObject.maximumAllowableMatchCost = this._maximumAllowableMatchCost; + jsonObject.vector3Alphabet = this._vector3Alphabet.serialize(); + jsonObject.levenshteinAlphabet = this._levenshteinAlphabet.serialize(); + jsonObject.nameToDescribedTrajectory = []; + this._nameToDescribedTrajectory.forEach((described, name263) => { + jsonObject.nameToDescribedTrajectory.push(name263); + jsonObject.nameToDescribedTrajectory.push(described.serialize()); + }); + return JSON.stringify(jsonObject); + } + static Deserialize(json) { + const jsonObject = JSON.parse(json); + const classifier = new TrajectoryClassifier; + classifier._maximumAllowableMatchCost = jsonObject.maximumAllowableMatchCost; + classifier._vector3Alphabet = Vector3Alphabet.Deserialize(jsonObject.vector3Alphabet); + classifier._levenshteinAlphabet = Levenshtein.Alphabet.Deserialize(jsonObject.levenshteinAlphabet); + for (let idx = 0;idx < jsonObject.nameToDescribedTrajectory.length; idx += 2) { + classifier._nameToDescribedTrajectory.set(jsonObject.nameToDescribedTrajectory[idx], TrajectoryClass.Deserialize(jsonObject.nameToDescribedTrajectory[idx + 1], classifier._levenshteinAlphabet)); + } + return classifier; + } + static Generate() { + const vecs = Vector3Alphabet.Generate(64, 256, 0.1, 0.001, [Vector3.Forward()]); + const charIdxs = new Array(vecs.chars.length); + for (let idx = 0;idx < charIdxs.length; ++idx) { + charIdxs[idx] = idx; + } + const alphabet = new Levenshtein.Alphabet(charIdxs, (idx) => idx === 0 ? 0 : 1, (idx) => idx === 0 ? 0 : 1, (a, b) => Math.min(1 - Vector3.Dot(vecs.chars[a], vecs.chars[b]), 1)); + const trajectorySet = new TrajectoryClassifier; + trajectorySet._vector3Alphabet = vecs; + trajectorySet._levenshteinAlphabet = alphabet; + return trajectorySet; + } + constructor() { + this._maximumAllowableMatchCost = 4; + this._nameToDescribedTrajectory = new Map; + } + addTrajectoryToClassification(trajectory, classification) { + if (!this._nameToDescribedTrajectory.has(classification)) { + this._nameToDescribedTrajectory.set(classification, new TrajectoryClass); + } + this._nameToDescribedTrajectory.get(classification).add(TrajectoryDescriptor.CreateFromTrajectory(trajectory, this._vector3Alphabet, this._levenshteinAlphabet)); + } + deleteClassification(classification) { + return this._nameToDescribedTrajectory.delete(classification); + } + classifyTrajectory(trajectory) { + const descriptor = TrajectoryDescriptor.CreateFromTrajectory(trajectory, this._vector3Alphabet, this._levenshteinAlphabet); + const allowableMatches = []; + this._nameToDescribedTrajectory.forEach((trajectoryClass, classification) => { + if (trajectoryClass.getMatchCost(descriptor) < this._maximumAllowableMatchCost) { + allowableMatches.push(classification); + } + }); + if (allowableMatches.length === 0) { + return null; + } + let bestIdx = 0; + let bestMatch = this._nameToDescribedTrajectory.get(allowableMatches[bestIdx]).getMatchMinimumDistance(descriptor); + let match; + for (let idx = 0;idx < allowableMatches.length; ++idx) { + match = this._nameToDescribedTrajectory.get(allowableMatches[idx]).getMatchMinimumDistance(descriptor); + if (match < bestMatch) { + bestMatch = match; + bestIdx = idx; + } + } + return allowableMatches[bestIdx]; + } +} +var Levenshtein; +var init_trajectoryClassifier = __esm(() => { + init_math_vector(); + (function(Levenshtein2) { + + class Alphabet { + serialize() { + const jsonObject = {}; + const characters = new Array(this._characterToIdx.size); + this._characterToIdx.forEach((v, k) => { + characters[v] = k; + }); + jsonObject["characters"] = characters; + jsonObject["insertionCosts"] = this._insertionCosts; + jsonObject["deletionCosts"] = this._deletionCosts; + jsonObject["substitutionCosts"] = this._substitutionCosts; + return JSON.stringify(jsonObject); + } + static Deserialize(json) { + const jsonObject = JSON.parse(json); + const alphabet = new Alphabet(jsonObject["characters"]); + alphabet._insertionCosts = jsonObject["insertionCosts"]; + alphabet._deletionCosts = jsonObject["deletionCosts"]; + alphabet._substitutionCosts = jsonObject["substitutionCosts"]; + return alphabet; + } + constructor(characters, charToInsertionCost = null, charToDeletionCost = null, charsToSubstitutionCost = null) { + charToInsertionCost = charToInsertionCost !== null && charToInsertionCost !== undefined ? charToInsertionCost : () => 1; + charToDeletionCost = charToDeletionCost !== null && charToDeletionCost !== undefined ? charToDeletionCost : () => 1; + charsToSubstitutionCost = charsToSubstitutionCost !== null && charsToSubstitutionCost !== undefined ? charsToSubstitutionCost : (a, b) => a === b ? 0 : 1; + this._characterToIdx = new Map; + this._insertionCosts = new Array(characters.length); + this._deletionCosts = new Array(characters.length); + this._substitutionCosts = new Array(characters.length); + let c; + for (let outerIdx = 0;outerIdx < characters.length; ++outerIdx) { + c = characters[outerIdx]; + this._characterToIdx.set(c, outerIdx); + this._insertionCosts[outerIdx] = charToInsertionCost(c); + this._deletionCosts[outerIdx] = charToDeletionCost(c); + this._substitutionCosts[outerIdx] = new Array(characters.length); + for (let innerIdx = outerIdx;innerIdx < characters.length; ++innerIdx) { + this._substitutionCosts[outerIdx][innerIdx] = charsToSubstitutionCost(c, characters[innerIdx]); + } + } + } + getCharacterIdx(char) { + return this._characterToIdx.get(char); + } + getInsertionCost(idx) { + return this._insertionCosts[idx]; + } + getDeletionCost(idx) { + return this._deletionCosts[idx]; + } + getSubstitutionCost(idx1, idx2) { + const min = Math.min(idx1, idx2); + const max = Math.max(idx1, idx2); + return this._substitutionCosts[min][max]; + } + } + Levenshtein2.Alphabet = Alphabet; + + class Sequence { + serialize() { + return JSON.stringify(this._characters); + } + static Deserialize(json, alphabet) { + const sequence = new Sequence([], alphabet); + sequence._characters = JSON.parse(json); + return sequence; + } + constructor(characters, alphabet) { + if (characters.length > Sequence._MAX_SEQUENCE_LENGTH) { + throw new Error("Sequences longer than " + Sequence._MAX_SEQUENCE_LENGTH + " not supported."); + } + this._alphabet = alphabet; + this._characters = characters.map((c) => this._alphabet.getCharacterIdx(c)); + } + distance(other) { + return Sequence._Distance(this, other); + } + static _Distance(a, b) { + const alphabet = a._alphabet; + if (alphabet !== b._alphabet) { + throw new Error("Cannot Levenshtein compare Sequences built from different alphabets."); + } + const aChars = a._characters; + const bChars = b._characters; + const aLength = aChars.length; + const bLength = bChars.length; + const costMatrix = Sequence._CostMatrix; + costMatrix[0][0] = 0; + for (let idx = 0;idx < aLength; ++idx) { + costMatrix[idx + 1][0] = costMatrix[idx][0] + alphabet.getInsertionCost(aChars[idx]); + } + for (let idx = 0;idx < bLength; ++idx) { + costMatrix[0][idx + 1] = costMatrix[0][idx] + alphabet.getInsertionCost(bChars[idx]); + } + for (let aIdx = 0;aIdx < aLength; ++aIdx) { + for (let bIdx = 0;bIdx < bLength; ++bIdx) { + Sequence._InsertionCost = costMatrix[aIdx + 1][bIdx] + alphabet.getInsertionCost(bChars[bIdx]); + Sequence._DeletionCost = costMatrix[aIdx][bIdx + 1] + alphabet.getDeletionCost(aChars[aIdx]); + Sequence._SubstitutionCost = costMatrix[aIdx][bIdx] + alphabet.getSubstitutionCost(aChars[aIdx], bChars[bIdx]); + costMatrix[aIdx + 1][bIdx + 1] = Math.min(Sequence._InsertionCost, Sequence._DeletionCost, Sequence._SubstitutionCost); + } + } + return costMatrix[aLength][bLength]; + } + } + Sequence._MAX_SEQUENCE_LENGTH = 256; + Sequence._CostMatrix = [...Array(Sequence._MAX_SEQUENCE_LENGTH + 1)].map(() => new Array(Sequence._MAX_SEQUENCE_LENGTH + 1)); + Levenshtein2.Sequence = Sequence; + })(Levenshtein || (Levenshtein = {})); + Trajectory._ForwardDir = new Vector3; + Trajectory._InverseFromVec = new Vector3; + Trajectory._UpDir = new Vector3; + Trajectory._FromToVec = new Vector3; + Trajectory._LookMatrix = new Matrix; + TrajectoryDescriptor._FINEST_DESCRIPTOR_RESOLUTION = 32; + TrajectoryClass._MIN_AVERAGE_DISTANCE = 1; +}); + // node_modules/@babylonjs/core/Misc/reflector.js class Reflector { constructor(scene34, hostname, port) { @@ -166487,10 +188658,55 @@ class Reflector { _handleClientMessage() { } } -Reflector._SERVER_PREFIX = "$$"; -// node_modules/@babylonjs/core/Misc/PerformanceViewer/dynamicFloat32Array.js -var growthFactor = 1.5; +var init_reflector = __esm(() => { + init_logger(); + init_sceneSerializer(); + Reflector._SERVER_PREFIX = "$$"; +}); +// node_modules/@babylonjs/core/Misc/pressureObserverWrapper.js +class PressureObserverWrapper { + constructor(options) { + this._observer = null; + this._currentState = []; + this.onPressureChanged = new Observable; + if (PressureObserverWrapper.IsAvailable) { + this._observer = new PressureObserver((update) => { + this._currentState = update; + this.onPressureChanged.notifyObservers(update); + }, options); + } + } + static get IsAvailable() { + return typeof PressureObserver !== "undefined" && PressureObserver.supportedSources.includes("cpu"); + } + observe(source) { + var _a; + try { + (_a = this._observer) === null || _a === undefined || _a.observe(source); + this.onPressureChanged.notifyObservers(this._currentState); + } catch (_b) { + } + } + unobserve(source) { + var _a; + try { + (_a = this._observer) === null || _a === undefined || _a.unobserve(source); + } catch (_b) { + } + } + dispose() { + var _a; + (_a = this._observer) === null || _a === undefined || _a.disconnect(); + this._observer = null; + this.onPressureChanged.clear(); + } +} +var init_pressureObserverWrapper = __esm(() => { + init_observable(); +}); + +// node_modules/@babylonjs/core/Misc/PerformanceViewer/dynamicFloat32Array.js class DynamicFloat32Array { constructor(itemCapacity) { this._view = new Float32Array(itemCapacity); @@ -166528,16 +188744,12 @@ class DynamicFloat32Array { this._view = view; } } +var growthFactor; +var init_dynamicFloat32Array = __esm(() => { + growthFactor = 1.5; +}); // node_modules/@babylonjs/core/Misc/PerformanceViewer/performanceViewerCollector.js -var InitialArraySize = 1800; -var NumberOfBitsInHexcode = 24; -var HexPadding = "0"; -var TimestampColHeader = "timestamp"; -var NumPointsColHeader = "numPoints"; -var CarriageReturnRegex = /\r/g; -var ExportedDataSeparator = "@"; - class PerformanceViewerCollector { static get SliceDataOffset() { return 2; @@ -166589,14 +188801,14 @@ class PerformanceViewerCollector { this.addCollectionStrategies(..._enabledStrategyCallbacks); } } - registerEvent(name262, forceUpdate, category) { + registerEvent(name263, forceUpdate, category) { var _a; - if (this._strategies.has(name262) && !forceUpdate) { + if (this._strategies.has(name263) && !forceUpdate) { return; } - if (this._strategies.has(name262) && forceUpdate) { - (_a = this._strategies.get(name262)) === null || _a === undefined || _a.dispose(); - this._strategies.delete(name262); + if (this._strategies.has(name263) && forceUpdate) { + (_a = this._strategies.get(name263)) === null || _a === undefined || _a.dispose(); + this._strategies.delete(name263); } const strategy = (scene34) => { let counter = 0; @@ -166606,7 +188818,7 @@ class PerformanceViewerCollector { counter = 0; }); const stringObserver = this._customEventObservable.add((eventVal) => { - if (name262 !== eventVal.name) { + if (name263 !== eventVal.name) { return; } if (eventVal.value !== undefined) { @@ -166616,7 +188828,7 @@ class PerformanceViewerCollector { } }); return { - id: name262, + id: name263, getData: () => value, dispose: () => { scene34.onAfterRenderObservable.remove(afterRenderObserver); @@ -166625,9 +188837,9 @@ class PerformanceViewerCollector { }; }; const event = { - name: name262 + name: name263 }; - this._eventRestoreSet.add(name262); + this._eventRestoreSet.add(name263); this.addCollectionStrategies({ strategyCallback: strategy, category }); return event; } @@ -166838,54 +189050,475 @@ class PerformanceViewerCollector { this.datasets = null; } } -// node_modules/@babylonjs/core/Misc/PerformanceViewer/performanceViewerSceneExtension.js -Scene.prototype.getPerfCollector = function() { - if (!this._perfCollector) { - this._perfCollector = new PerformanceViewerCollector(this); +var InitialArraySize, NumberOfBitsInHexcode, HexPadding, TimestampColHeader, NumPointsColHeader, CarriageReturnRegex, ExportedDataSeparator; +var init_performanceViewerCollector = __esm(() => { + init_observable(); + init_precisionDate(); + init_tools(); + init_dynamicFloat32Array(); + InitialArraySize = 1800; + NumberOfBitsInHexcode = 24; + HexPadding = "0"; + TimestampColHeader = "timestamp"; + NumPointsColHeader = "numPoints"; + CarriageReturnRegex = /\r/g; + ExportedDataSeparator = "@"; +}); + +// node_modules/@babylonjs/core/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js +class PerfCollectionStrategy { + static FpsStrategy() { + return (scene34) => { + const engine46 = scene34.getEngine(); + return { + id: "FPS", + getData: () => engine46.getFps(), + dispose: defaultDisposeImpl + }; + }; } - return this._perfCollector; -}; + static ThermalStrategy() { + return this._PressureStrategy("Thermal utilization", "thermal"); + } + static PowerSupplyStrategy() { + return this._PressureStrategy("Power supply utilization", "power-supply"); + } + static PressureStrategy() { + return this._PressureStrategy("Pressure"); + } + static _PressureStrategy(name263, factor = null) { + return () => { + let value = 0; + const wrapper = new PressureObserverWrapper; + wrapper.observe("cpu"); + wrapper.onPressureChanged.add((update) => { + var _a, _b; + for (const record of update) { + if (factor && record.factors.includes(factor) || !factor && ((_b = (_a = record.factors) === null || _a === undefined ? undefined : _a.length) !== null && _b !== undefined ? _b : 0) === 0) { + switch (record.state) { + case "nominal": + value = 0; + break; + case "fair": + value = 0.25; + break; + case "serious": + value = 0.5; + break; + case "critical": + value = 1; + break; + } + } + } + }); + return { + id: name263, + getData: () => value, + dispose: () => wrapper.dispose() + }; + }; + } + static TotalMeshesStrategy() { + return (scene34) => { + return { + id: "Total meshes", + getData: () => scene34.meshes.length, + dispose: defaultDisposeImpl + }; + }; + } + static ActiveMeshesStrategy() { + return (scene34) => { + return { + id: "Active meshes", + getData: () => scene34.getActiveMeshes().length, + dispose: defaultDisposeImpl + }; + }; + } + static ActiveIndicesStrategy() { + return (scene34) => { + return { + id: "Active indices", + getData: () => scene34.getActiveIndices(), + dispose: defaultDisposeImpl + }; + }; + } + static ActiveFacesStrategy() { + return (scene34) => { + return { + id: "Active faces", + getData: () => scene34.getActiveIndices() / 3, + dispose: defaultDisposeImpl + }; + }; + } + static ActiveBonesStrategy() { + return (scene34) => { + return { + id: "Active bones", + getData: () => scene34.getActiveBones(), + dispose: defaultDisposeImpl + }; + }; + } + static ActiveParticlesStrategy() { + return (scene34) => { + return { + id: "Active particles", + getData: () => scene34.getActiveParticles(), + dispose: defaultDisposeImpl + }; + }; + } + static DrawCallsStrategy() { + return (scene34) => { + let drawCalls = 0; + const onBeforeAnimationsObserver = scene34.onBeforeAnimationsObservable.add(() => { + scene34.getEngine()._drawCalls.fetchNewFrame(); + }); + const onAfterRenderObserver = scene34.onAfterRenderObservable.add(() => { + drawCalls = scene34.getEngine()._drawCalls.current; + }); + return { + id: "Draw calls", + getData: () => drawCalls, + dispose: () => { + scene34.onBeforeAnimationsObservable.remove(onBeforeAnimationsObserver); + scene34.onAfterRenderObservable.remove(onAfterRenderObserver); + } + }; + }; + } + static TotalLightsStrategy() { + return (scene34) => { + return { + id: "Total lights", + getData: () => scene34.lights.length, + dispose: defaultDisposeImpl + }; + }; + } + static TotalVerticesStrategy() { + return (scene34) => { + return { + id: "Total vertices", + getData: () => scene34.getTotalVertices(), + dispose: defaultDisposeImpl + }; + }; + } + static TotalMaterialsStrategy() { + return (scene34) => { + return { + id: "Total materials", + getData: () => scene34.materials.length, + dispose: defaultDisposeImpl + }; + }; + } + static TotalTexturesStrategy() { + return (scene34) => { + return { + id: "Total textures", + getData: () => scene34.textures.length, + dispose: defaultDisposeImpl + }; + }; + } + static AbsoluteFpsStrategy() { + return (scene34) => { + const sceneInstrumentation3 = new SceneInstrumentation(scene34); + sceneInstrumentation3.captureFrameTime = true; + return { + id: "Absolute FPS", + getData: () => { + return 1000 / sceneInstrumentation3.frameTimeCounter.lastSecAverage; + }, + dispose: defaultDisposeImpl + }; + }; + } + static MeshesSelectionStrategy() { + return (scene34) => { + let startTime = PrecisionDate.Now; + let timeTaken = 0; + const onBeforeActiveMeshesObserver = scene34.onBeforeActiveMeshesEvaluationObservable.add(() => { + startTime = PrecisionDate.Now; + }); + const onAfterActiveMeshesObserver = scene34.onAfterActiveMeshesEvaluationObservable.add(() => { + timeTaken = PrecisionDate.Now - startTime; + }); + return { + id: "Meshes Selection", + getData: () => timeTaken, + dispose: () => { + scene34.onBeforeActiveMeshesEvaluationObservable.remove(onBeforeActiveMeshesObserver); + scene34.onAfterActiveMeshesEvaluationObservable.remove(onAfterActiveMeshesObserver); + } + }; + }; + } + static RenderTargetsStrategy() { + return (scene34) => { + let startTime = PrecisionDate.Now; + let timeTaken = 0; + const onBeforeRenderTargetsObserver = scene34.onBeforeRenderTargetsRenderObservable.add(() => { + startTime = PrecisionDate.Now; + }); + const onAfterRenderTargetsObserver = scene34.onAfterRenderTargetsRenderObservable.add(() => { + timeTaken = PrecisionDate.Now - startTime; + }); + return { + id: "Render Targets", + getData: () => timeTaken, + dispose: () => { + scene34.onBeforeRenderTargetsRenderObservable.remove(onBeforeRenderTargetsObserver); + scene34.onAfterRenderTargetsRenderObservable.remove(onAfterRenderTargetsObserver); + } + }; + }; + } + static ParticlesStrategy() { + return (scene34) => { + let startTime = PrecisionDate.Now; + let timeTaken = 0; + const onBeforeParticlesObserver = scene34.onBeforeParticlesRenderingObservable.add(() => { + startTime = PrecisionDate.Now; + }); + const onAfterParticlesObserver = scene34.onAfterParticlesRenderingObservable.add(() => { + timeTaken = PrecisionDate.Now - startTime; + }); + return { + id: "Particles", + getData: () => timeTaken, + dispose: () => { + scene34.onBeforeParticlesRenderingObservable.remove(onBeforeParticlesObserver); + scene34.onAfterParticlesRenderingObservable.remove(onAfterParticlesObserver); + } + }; + }; + } + static SpritesStrategy() { + return (scene34) => { + var _a, _b; + let startTime = PrecisionDate.Now; + let timeTaken = 0; + const onBeforeSpritesObserver = (_a = scene34.onBeforeSpritesRenderingObservable) === null || _a === undefined ? undefined : _a.add(() => { + startTime = PrecisionDate.Now; + }); + const onAfterSpritesObserver = (_b = scene34.onAfterSpritesRenderingObservable) === null || _b === undefined ? undefined : _b.add(() => { + timeTaken = PrecisionDate.Now - startTime; + }); + return { + id: "Sprites", + getData: () => timeTaken, + dispose: () => { + var _a2, _b2; + (_a2 = scene34.onBeforeSpritesRenderingObservable) === null || _a2 === undefined || _a2.remove(onBeforeSpritesObserver); + (_b2 = scene34.onAfterSpritesRenderingObservable) === null || _b2 === undefined || _b2.remove(onAfterSpritesObserver); + } + }; + }; + } + static AnimationsStrategy() { + return (scene34) => { + let startTime = PrecisionDate.Now; + let timeTaken = 0; + const onBeforeAnimationsObserver = scene34.onBeforeAnimationsObservable.add(() => { + startTime = PrecisionDate.Now; + }); + const onAfterAnimationsObserver = scene34.onAfterAnimationsObservable.add(() => { + timeTaken = PrecisionDate.Now - startTime; + }); + return { + id: "Animations", + getData: () => timeTaken, + dispose: () => { + scene34.onBeforeAnimationsObservable.remove(onBeforeAnimationsObserver); + scene34.onAfterAnimationsObservable.remove(onAfterAnimationsObserver); + } + }; + }; + } + static PhysicsStrategy() { + return (scene34) => { + var _a, _b; + let startTime = PrecisionDate.Now; + let timeTaken = 0; + const onBeforePhysicsObserver = (_a = scene34.onBeforePhysicsObservable) === null || _a === undefined ? undefined : _a.add(() => { + startTime = PrecisionDate.Now; + }); + const onAfterPhysicsObserver = (_b = scene34.onAfterPhysicsObservable) === null || _b === undefined ? undefined : _b.add(() => { + timeTaken = PrecisionDate.Now - startTime; + }); + return { + id: "Physics", + getData: () => timeTaken, + dispose: () => { + var _a2, _b2; + (_a2 = scene34.onBeforePhysicsObservable) === null || _a2 === undefined || _a2.remove(onBeforePhysicsObserver); + (_b2 = scene34.onAfterPhysicsObservable) === null || _b2 === undefined || _b2.remove(onAfterPhysicsObserver); + } + }; + }; + } + static RenderStrategy() { + return (scene34) => { + let startTime = PrecisionDate.Now; + let timeTaken = 0; + const onBeforeDrawPhaseObserver = scene34.onBeforeDrawPhaseObservable.add(() => { + startTime = PrecisionDate.Now; + }); + const onAfterDrawPhaseObserver = scene34.onAfterDrawPhaseObservable.add(() => { + timeTaken = PrecisionDate.Now - startTime; + }); + return { + id: "Render", + getData: () => timeTaken, + dispose: () => { + scene34.onBeforeDrawPhaseObservable.remove(onBeforeDrawPhaseObserver); + scene34.onAfterDrawPhaseObservable.remove(onAfterDrawPhaseObserver); + } + }; + }; + } + static FrameTotalStrategy() { + return (scene34) => { + let startTime = PrecisionDate.Now; + let timeTaken = 0; + const onBeforeAnimationsObserver = scene34.onBeforeAnimationsObservable.add(() => { + startTime = PrecisionDate.Now; + }); + const onAfterRenderObserver = scene34.onAfterRenderObservable.add(() => { + timeTaken = PrecisionDate.Now - startTime; + }); + return { + id: "Frame Total", + getData: () => timeTaken, + dispose: () => { + scene34.onBeforeAnimationsObservable.remove(onBeforeAnimationsObserver); + scene34.onAfterRenderObservable.remove(onAfterRenderObserver); + } + }; + }; + } + static InterFrameStrategy() { + return (scene34) => { + let startTime = PrecisionDate.Now; + let timeTaken = 0; + const onBeforeAnimationsObserver = scene34.onBeforeAnimationsObservable.add(() => { + timeTaken = PrecisionDate.Now - startTime; + }); + const onAfterRenderObserver = scene34.onAfterRenderObservable.add(() => { + startTime = PrecisionDate.Now; + }); + return { + id: "Inter-frame", + getData: () => timeTaken, + dispose: () => { + scene34.onBeforeAnimationsObservable.remove(onBeforeAnimationsObserver); + scene34.onAfterRenderObservable.remove(onAfterRenderObserver); + } + }; + }; + } + static GpuFrameTimeStrategy() { + return (scene34) => { + const engineInstrumentation3 = new EngineInstrumentation(scene34.getEngine()); + engineInstrumentation3.captureGPUFrameTime = true; + return { + id: "GPU frame time", + getData: () => Math.max(engineInstrumentation3.gpuFrameTimeCounter.current * 0.000001, 0), + dispose: () => { + engineInstrumentation3.dispose(); + } + }; + }; + } +} +var defaultDisposeImpl; +var init_performanceViewerCollectionStrategies = __esm(() => { + init_engineInstrumentation(); + init_precisionDate(); + init_sceneInstrumentation(); + init_pressureObserverWrapper(); + defaultDisposeImpl = () => { + }; +}); + +// node_modules/@babylonjs/core/Misc/PerformanceViewer/performanceViewerSceneExtension.js +var init_performanceViewerSceneExtension = __esm(() => { + init_scene(); + init_performanceViewerCollector(); + Scene.prototype.getPerfCollector = function() { + if (!this._perfCollector) { + this._perfCollector = new PerformanceViewerCollector(this); + } + return this._perfCollector; + }; +}); + +// node_modules/@babylonjs/core/Misc/PerformanceViewer/index.js +var init_PerformanceViewer = __esm(() => { + init_performanceViewerCollector(); + init_performanceViewerCollectionStrategies(); + init_dynamicFloat32Array(); + init_performanceViewerSceneExtension(); +}); + // node_modules/@babylonjs/core/Misc/observableCoroutine.js -var CreateObservableScheduler = function(observable113) { - const coroutines = new Array; - const onSteps = new Array; - const onErrors = new Array; - const observer2 = observable113.add(() => { - const count = coroutines.length; - for (let i = 0;i < count; i++) { - inlineScheduler(coroutines.shift(), onSteps.shift(), onErrors.shift()); +var CreateObservableScheduler; +var init_observableCoroutine = __esm(() => { + init_observable(); + init_coroutine(); + CreateObservableScheduler = function(observable113) { + const coroutines = new Array; + const onSteps = new Array; + const onErrors = new Array; + const observer2 = observable113.add(() => { + const count = coroutines.length; + for (let i = 0;i < count; i++) { + inlineScheduler(coroutines.shift(), onSteps.shift(), onErrors.shift()); + } + }); + const scheduler = (coroutine4, onStep, onError) => { + coroutines.push(coroutine4); + onSteps.push(onStep); + onErrors.push(onError); + }; + return { + scheduler, + dispose: () => { + observable113.remove(observer2); + } + }; + }; + Observable.prototype.runCoroutineAsync = function(coroutine4) { + if (!this._coroutineScheduler) { + const schedulerAndDispose = CreateObservableScheduler(this); + this._coroutineScheduler = schedulerAndDispose.scheduler; + this._coroutineSchedulerDispose = schedulerAndDispose.dispose; } - }); - const scheduler = (coroutine4, onStep, onError) => { - coroutines.push(coroutine4); - onSteps.push(onStep); - onErrors.push(onError); + return runCoroutineAsync(coroutine4, this._coroutineScheduler); }; - return { - scheduler, - dispose: () => { - observable113.remove(observer2); + Observable.prototype.cancelAllCoroutines = function() { + if (this._coroutineSchedulerDispose) { + this._coroutineSchedulerDispose(); } + this._coroutineScheduler = undefined; + this._coroutineSchedulerDispose = undefined; }; -}; -Observable.prototype.runCoroutineAsync = function(coroutine4) { - if (!this._coroutineScheduler) { - const schedulerAndDispose = CreateObservableScheduler(this); - this._coroutineScheduler = schedulerAndDispose.scheduler; - this._coroutineSchedulerDispose = schedulerAndDispose.dispose; - } - return runCoroutineAsync(coroutine4, this._coroutineScheduler); -}; -Observable.prototype.cancelAllCoroutines = function() { - if (this._coroutineSchedulerDispose) { - this._coroutineSchedulerDispose(); - } - this._coroutineScheduler = undefined; - this._coroutineSchedulerDispose = undefined; -}; +}); + // node_modules/@babylonjs/core/Shaders/equirectangularPanorama.fragment.js -var name262 = "equirectangularPanoramaPixelShader"; -var shader262 = `#ifdef GL_ES +var name263, shader262; +var init_equirectangularPanorama_fragment = __esm(() => { + init_shaderStore(); + name263 = "equirectangularPanoramaPixelShader"; + shader262 = `#ifdef GL_ES precision highp float; #endif #define M_PI 3.1415926535897932384626433832795 @@ -166894,7 +189527,131 @@ varying vec2 vUV;uniform samplerCube cubeMap;void main(void) {vec2 uv=vUV;float cos( latitude ), - cos( longitude )*sin( latitude ) );normalize( dir );gl_FragColor=textureCube( cubeMap,dir );}`; -ShaderStore.ShadersStore[name262] = shader262; + ShaderStore.ShadersStore[name263] = shader262; +}); + +// node_modules/@babylonjs/core/Misc/equirectangularCapture.js +async function captureEquirectangularFromScene(scene35, options) { + var _a, _b; + const probe = (_a = options.probe) !== null && _a !== undefined ? _a : new ReflectionProbe("tempProbe", options.size, scene35); + const wasProbeProvided = !!options.probe; + if (!wasProbeProvided) { + if (options.position) { + probe.position = options.position.clone(); + } else if (scene35.activeCamera) { + probe.position = scene35.activeCamera.position.clone(); + } + } + const meshesToConsider = options.meshesFilter ? scene35.meshes.filter(options.meshesFilter) : scene35.meshes; + (_b = probe.renderList) === null || _b === undefined || _b.push(...meshesToConsider); + probe.refreshRate = RenderTargetTexture.REFRESHRATE_RENDER_ONCE; + probe.cubeTexture.render(); + const dumpTexture = new CustomProceduralTexture("tempProceduralTexture", "equirectangularPanorama", { width: options.size * 2, height: options.size }, scene35); + dumpTexture.setTexture("cubeMap", probe.cubeTexture); + return new Promise((resolve, reject) => { + dumpTexture.onGeneratedObservable.addOnce(() => { + const pixelDataPromise = dumpTexture.readPixels(); + if (!pixelDataPromise) { + reject(new Error("No Pixel Data found on procedural texture")); + dumpTexture.dispose(); + if (!wasProbeProvided) { + probe.dispose(); + } + return; + } + pixelDataPromise.then((pixelData) => { + dumpTexture.dispose(); + if (!wasProbeProvided) { + probe.dispose(); + } + if (options.filename) { + DumpTools.DumpData(options.size * 2, options.size, pixelData, undefined, "image/png", options.filename); + resolve(null); + } else { + resolve(pixelData); + } + }); + }); + }); +} +var init_equirectangularCapture = __esm(() => { + init_reflectionProbe(); + init_renderTargetTexture(); + init_customProceduralTexture(); + init_dumpTools(); + init_equirectangularPanorama_fragment(); +}); + +// node_modules/@babylonjs/core/Misc/index.js +var init_Misc = __esm(() => { + init_andOrNotEvaluator(); + init_assetsManager(); + init_basis(); + init_dds(); + init_decorators(); + init_deferred(); + init_environmentTextureTools(); + init_meshExploder(); + init_filesInput(); + init_HighDynamicRange(); + init_khronosTextureContainer(); + init_observable(); + init_observable_extensions(); + init_performanceMonitor(); + init_sceneOptimizer(); + init_sceneSerializer(); + init_smartArray(); + init_stringDictionary(); + init_tags(); + init_textureTools(); + init_tga(); + init_tools(); + init_videoRecorder(); + init_virtualJoystick(); + init_workerPool(); + init_logger(); + init_typeStore(); + init_filesInputStore(); + init_deepCopier(); + init_pivotTools(); + init_precisionDate(); + init_screenshotTools(); + init_webRequest(); + init_iInspectable(); + init_brdfTextureTools(); + init_rgbdTextureTools(); + init_gradients(); + init_perfCounter(); + init_fileRequest(); + init_customAnimationFrameRequester(); + init_retryStrategy(); + init_screenshotSize(); + init_iPerfViewer(); + init_fileTools(); + init_stringTools(); + init_dataReader(); + init_minMaxReducer(); + init_depthReducer(); + init_dataStorage(); + init_sceneRecorder(); + init_khronosTextureContainer2(); + init_trajectoryClassifier(); + init_timer(); + init_copyTools(); + init_reflector(); + init_domManagement(); + init_pressureObserverWrapper(); + init_PerformanceViewer(); + init_coroutine(); + init_guid(); + init_error(); + init_observableCoroutine(); + init_copyTextureToTexture(); + init_dumpTools(); + init_greasedLineTools(); + init_equirectangularCapture(); +}); + // node_modules/@babylonjs/core/XR/features/WebXRHitTestLegacy.js class WebXRHitTestLegacy extends WebXRAbstractFeature { constructor(_xrSessionManager, options = {}) { @@ -166984,14 +189741,20 @@ class WebXRHitTestLegacy extends WebXRAbstractFeature { WebXRHitTestLegacy.XRHitTestWithRay(this._xrSessionManager.session, ray13, this._xrSessionManager.referenceSpace).then(this._onHitTestResults); } } -WebXRHitTestLegacy.Name = WebXRFeatureName.HIT_TEST; -WebXRHitTestLegacy.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRHitTestLegacy.Name, (xrSessionManager, options) => { - return () => new WebXRHitTestLegacy(xrSessionManager, options); -}, WebXRHitTestLegacy.Version, false); -// node_modules/@babylonjs/core/XR/features/WebXRAnchorSystem.js -var anchorIdProvider = 0; +var init_WebXRHitTestLegacy = __esm(() => { + init_webXRFeaturesManager(); + init_observable(); + init_math_vector(); + init_WebXRAbstractFeature(); + init_tools(); + WebXRHitTestLegacy.Name = WebXRFeatureName.HIT_TEST; + WebXRHitTestLegacy.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRHitTestLegacy.Name, (xrSessionManager, options) => { + return () => new WebXRHitTestLegacy(xrSessionManager, options); + }, WebXRHitTestLegacy.Version, false); +}); +// node_modules/@babylonjs/core/XR/features/WebXRAnchorSystem.js class WebXRAnchorSystem extends WebXRAbstractFeature { set referenceSpaceForFrameAnchors(referenceSpace) { this._referenceSpaceForFrameAnchors = referenceSpace; @@ -167188,14 +189951,22 @@ class WebXRAnchorSystem extends WebXRAbstractFeature { } } } -WebXRAnchorSystem.Name = WebXRFeatureName.ANCHOR_SYSTEM; -WebXRAnchorSystem.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRAnchorSystem.Name, (xrSessionManager, options) => { - return () => new WebXRAnchorSystem(xrSessionManager, options); -}, WebXRAnchorSystem.Version); -// node_modules/@babylonjs/core/XR/features/WebXRPlaneDetector.js -var planeIdProvider = 0; +var anchorIdProvider; +var init_WebXRAnchorSystem = __esm(() => { + init_webXRFeaturesManager(); + init_observable(); + init_math_vector(); + init_WebXRAbstractFeature(); + init_tools(); + anchorIdProvider = 0; + WebXRAnchorSystem.Name = WebXRFeatureName.ANCHOR_SYSTEM; + WebXRAnchorSystem.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRAnchorSystem.Name, (xrSessionManager, options) => { + return () => new WebXRAnchorSystem(xrSessionManager, options); + }, WebXRAnchorSystem.Version); +}); +// node_modules/@babylonjs/core/XR/features/WebXRPlaneDetector.js class WebXRPlaneDetector extends WebXRAbstractFeature { constructor(_xrSessionManager, _options = {}) { super(_xrSessionManager); @@ -167325,11 +190096,20 @@ class WebXRPlaneDetector extends WebXRAbstractFeature { return -1; } } -WebXRPlaneDetector.Name = WebXRFeatureName.PLANE_DETECTION; -WebXRPlaneDetector.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRPlaneDetector.Name, (xrSessionManager, options) => { - return () => new WebXRPlaneDetector(xrSessionManager, options); -}, WebXRPlaneDetector.Version); +var planeIdProvider; +var init_WebXRPlaneDetector = __esm(() => { + init_webXRFeaturesManager(); + init_observable(); + init_math_vector(); + init_WebXRAbstractFeature(); + planeIdProvider = 0; + WebXRPlaneDetector.Name = WebXRFeatureName.PLANE_DETECTION; + WebXRPlaneDetector.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRPlaneDetector.Name, (xrSessionManager, options) => { + return () => new WebXRPlaneDetector(xrSessionManager, options); + }, WebXRPlaneDetector.Version); +}); + // node_modules/@babylonjs/core/XR/features/WebXRBackgroundRemover.js class WebXRBackgroundRemover extends WebXRAbstractFeature { constructor(_xrSessionManager, options = {}) { @@ -167380,12 +190160,21 @@ class WebXRBackgroundRemover extends WebXRAbstractFeature { this.onBackgroundStateChangedObservable.notifyObservers(newState); } } -WebXRBackgroundRemover.Name = WebXRFeatureName.BACKGROUND_REMOVER; -WebXRBackgroundRemover.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRBackgroundRemover.Name, (xrSessionManager, options) => { - return () => new WebXRBackgroundRemover(xrSessionManager, options); -}, WebXRBackgroundRemover.Version, true); +var init_WebXRBackgroundRemover = __esm(() => { + init_webXRFeaturesManager(); + init_observable(); + init_WebXRAbstractFeature(); + WebXRBackgroundRemover.Name = WebXRFeatureName.BACKGROUND_REMOVER; + WebXRBackgroundRemover.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRBackgroundRemover.Name, (xrSessionManager, options) => { + return () => new WebXRBackgroundRemover(xrSessionManager, options); + }, WebXRBackgroundRemover.Version, true); +}); + // node_modules/@babylonjs/core/XR/features/WebXRControllerPhysics.js +class IWebXRControllerPhysicsOptions { +} + class WebXRControllerPhysics extends WebXRAbstractFeature { _createPhysicsImpostor(xrController) { const impostorType = this._options.physicsProperties.impostorType || PhysicsImpostor.SphereImpostor; @@ -167589,11 +190378,20 @@ class WebXRControllerPhysics extends WebXRAbstractFeature { delete this._controllers[xrControllerUniqueId]; } } -WebXRControllerPhysics.Name = WebXRFeatureName.PHYSICS_CONTROLLERS; -WebXRControllerPhysics.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRControllerPhysics.Name, (xrSessionManager, options) => { - return () => new WebXRControllerPhysics(xrSessionManager, options); -}, WebXRControllerPhysics.Version, true); +var init_WebXRControllerPhysics = __esm(() => { + init_WebXRAbstractFeature(); + init_math_vector(); + init_physicsImpostor(); + init_sphereBuilder(); + init_webXRFeaturesManager(); + init_logger(); + WebXRControllerPhysics.Name = WebXRFeatureName.PHYSICS_CONTROLLERS; + WebXRControllerPhysics.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRControllerPhysics.Name, (xrSessionManager, options) => { + return () => new WebXRControllerPhysics(xrSessionManager, options); + }, WebXRControllerPhysics.Version, true); +}); + // node_modules/@babylonjs/core/XR/features/WebXRHitTest.js class WebXRHitTest extends WebXRAbstractFeature { constructor(_xrSessionManager, options = {}) { @@ -167721,11 +190519,19 @@ class WebXRHitTest extends WebXRAbstractFeature { this.onHitTestResultObservable.notifyObservers(results); } } -WebXRHitTest.Name = WebXRFeatureName.HIT_TEST; -WebXRHitTest.Version = 2; -WebXRFeaturesManager.AddWebXRFeature(WebXRHitTest.Name, (xrSessionManager, options) => { - return () => new WebXRHitTest(xrSessionManager, options); -}, WebXRHitTest.Version, false); +var init_WebXRHitTest = __esm(() => { + init_webXRFeaturesManager(); + init_observable(); + init_math_vector(); + init_WebXRAbstractFeature(); + init_tools(); + WebXRHitTest.Name = WebXRFeatureName.HIT_TEST; + WebXRHitTest.Version = 2; + WebXRFeaturesManager.AddWebXRFeature(WebXRHitTest.Name, (xrSessionManager, options) => { + return () => new WebXRHitTest(xrSessionManager, options); + }, WebXRHitTest.Version, false); +}); + // node_modules/@babylonjs/core/XR/features/WebXRFeaturePointSystem.js class WebXRFeaturePointSystem extends WebXRAbstractFeature { get featurePointCloud() { @@ -167802,14 +190608,19 @@ class WebXRFeaturePointSystem extends WebXRAbstractFeature { this._enabled = true; } } -WebXRFeaturePointSystem.Name = WebXRFeatureName.FEATURE_POINTS; -WebXRFeaturePointSystem.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRFeaturePointSystem.Name, (xrSessionManager) => { - return () => new WebXRFeaturePointSystem(xrSessionManager); -}, WebXRFeaturePointSystem.Version); -// node_modules/@babylonjs/core/XR/features/WebXRMeshDetector.js -var meshIdProvider = 0; +var init_WebXRFeaturePointSystem = __esm(() => { + init_webXRFeaturesManager(); + init_observable(); + init_math_vector(); + init_WebXRAbstractFeature(); + WebXRFeaturePointSystem.Name = WebXRFeatureName.FEATURE_POINTS; + WebXRFeaturePointSystem.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRFeaturePointSystem.Name, (xrSessionManager) => { + return () => new WebXRFeaturePointSystem(xrSessionManager); + }, WebXRFeaturePointSystem.Version); +}); +// node_modules/@babylonjs/core/XR/features/WebXRMeshDetector.js class WebXRMeshDetector extends WebXRAbstractFeature { constructor(_xrSessionManager, _options = {}) { super(_xrSessionManager); @@ -167972,19 +190783,23 @@ class WebXRMeshDetector extends WebXRAbstractFeature { return mesh69; } } -WebXRMeshDetector.Name = WebXRFeatureName.MESH_DETECTION; -WebXRMeshDetector.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRMeshDetector.Name, (xrSessionManager, options) => { - return () => new WebXRMeshDetector(xrSessionManager, options); -}, WebXRMeshDetector.Version, false); -// node_modules/@babylonjs/core/XR/features/WebXRImageTracking.js -var ImageTrackingScoreStatus; -(function(ImageTrackingScoreStatus2) { - ImageTrackingScoreStatus2[ImageTrackingScoreStatus2["NotReceived"] = 0] = "NotReceived"; - ImageTrackingScoreStatus2[ImageTrackingScoreStatus2["Waiting"] = 1] = "Waiting"; - ImageTrackingScoreStatus2[ImageTrackingScoreStatus2["Received"] = 2] = "Received"; -})(ImageTrackingScoreStatus || (ImageTrackingScoreStatus = {})); +var meshIdProvider; +var init_WebXRMeshDetector = __esm(() => { + init_webXRFeaturesManager(); + init_WebXRAbstractFeature(); + init_math(); + init_observable(); + init_mesh(); + init_buffer(); + meshIdProvider = 0; + WebXRMeshDetector.Name = WebXRFeatureName.MESH_DETECTION; + WebXRMeshDetector.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRMeshDetector.Name, (xrSessionManager, options) => { + return () => new WebXRMeshDetector(xrSessionManager, options); + }, WebXRMeshDetector.Version, false); +}); +// node_modules/@babylonjs/core/XR/features/WebXRImageTracking.js class WebXRImageTracking extends WebXRAbstractFeature { constructor(_xrSessionManager, options) { super(_xrSessionManager); @@ -168111,11 +190926,25 @@ class WebXRImageTracking extends WebXRAbstractFeature { this._trackableScoreStatus = imageScores.length > 0 ? ImageTrackingScoreStatus.Received : ImageTrackingScoreStatus.NotReceived; } } -WebXRImageTracking.Name = WebXRFeatureName.IMAGE_TRACKING; -WebXRImageTracking.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRImageTracking.Name, (xrSessionManager, options) => { - return () => new WebXRImageTracking(xrSessionManager, options); -}, WebXRImageTracking.Version, false); +var ImageTrackingScoreStatus; +var init_WebXRImageTracking = __esm(() => { + init_webXRFeaturesManager(); + init_observable(); + init_WebXRAbstractFeature(); + init_math_vector(); + init_tools(); + (function(ImageTrackingScoreStatus2) { + ImageTrackingScoreStatus2[ImageTrackingScoreStatus2["NotReceived"] = 0] = "NotReceived"; + ImageTrackingScoreStatus2[ImageTrackingScoreStatus2["Waiting"] = 1] = "Waiting"; + ImageTrackingScoreStatus2[ImageTrackingScoreStatus2["Received"] = 2] = "Received"; + })(ImageTrackingScoreStatus || (ImageTrackingScoreStatus = {})); + WebXRImageTracking.Name = WebXRFeatureName.IMAGE_TRACKING; + WebXRImageTracking.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRImageTracking.Name, (xrSessionManager, options) => { + return () => new WebXRImageTracking(xrSessionManager, options); + }, WebXRImageTracking.Version, false); +}); + // node_modules/@babylonjs/core/XR/features/WebXRDOMOverlay.js class WebXRDomOverlay extends WebXRAbstractFeature { constructor(_xrSessionManager, options) { @@ -168175,11 +191004,17 @@ class WebXRDomOverlay extends WebXRAbstractFeature { }; } } -WebXRDomOverlay.Name = WebXRFeatureName.DOM_OVERLAY; -WebXRDomOverlay.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRDomOverlay.Name, (xrSessionManager, options) => { - return () => new WebXRDomOverlay(xrSessionManager, options); -}, WebXRDomOverlay.Version, false); +var init_WebXRDOMOverlay = __esm(() => { + init_tools(); + init_webXRFeaturesManager(); + init_WebXRAbstractFeature(); + WebXRDomOverlay.Name = WebXRFeatureName.DOM_OVERLAY; + WebXRDomOverlay.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRDomOverlay.Name, (xrSessionManager, options) => { + return () => new WebXRDomOverlay(xrSessionManager, options); + }, WebXRDomOverlay.Version, false); +}); + // node_modules/@babylonjs/core/XR/features/WebXRControllerMovement.js class WebXRControllerMovement extends WebXRAbstractFeature { get movementDirection() { @@ -168396,31 +191231,39 @@ class WebXRControllerMovement extends WebXRAbstractFeature { delete this._controllers[xrControllerUniqueId]; } } -WebXRControllerMovement.Name = WebXRFeatureName.MOVEMENT; -WebXRControllerMovement.REGISTRATIONS = { - default: [ - { - allowedComponentTypes: [WebXRControllerComponent.THUMBSTICK_TYPE, WebXRControllerComponent.TOUCHPAD_TYPE], - forceHandedness: "left", - axisChangedHandler: (axes, movementState, featureContext) => { - movementState.rotateX = Math.abs(axes.x) > featureContext.rotationThreshold ? axes.x : 0; - movementState.rotateY = Math.abs(axes.y) > featureContext.rotationThreshold ? axes.y : 0; - } - }, - { - allowedComponentTypes: [WebXRControllerComponent.THUMBSTICK_TYPE, WebXRControllerComponent.TOUCHPAD_TYPE], - forceHandedness: "right", - axisChangedHandler: (axes, movementState, featureContext) => { - movementState.moveX = Math.abs(axes.x) > featureContext.movementThreshold ? axes.x : 0; - movementState.moveY = Math.abs(axes.y) > featureContext.movementThreshold ? axes.y : 0; +var init_WebXRControllerMovement = __esm(() => { + init_webXRFeaturesManager(); + init_webXRControllerComponent(); + init_math_vector(); + init_WebXRAbstractFeature(); + init_tools(); + WebXRControllerMovement.Name = WebXRFeatureName.MOVEMENT; + WebXRControllerMovement.REGISTRATIONS = { + default: [ + { + allowedComponentTypes: [WebXRControllerComponent.THUMBSTICK_TYPE, WebXRControllerComponent.TOUCHPAD_TYPE], + forceHandedness: "left", + axisChangedHandler: (axes, movementState, featureContext) => { + movementState.rotateX = Math.abs(axes.x) > featureContext.rotationThreshold ? axes.x : 0; + movementState.rotateY = Math.abs(axes.y) > featureContext.rotationThreshold ? axes.y : 0; + } + }, + { + allowedComponentTypes: [WebXRControllerComponent.THUMBSTICK_TYPE, WebXRControllerComponent.TOUCHPAD_TYPE], + forceHandedness: "right", + axisChangedHandler: (axes, movementState, featureContext) => { + movementState.moveX = Math.abs(axes.x) > featureContext.movementThreshold ? axes.x : 0; + movementState.moveY = Math.abs(axes.y) > featureContext.movementThreshold ? axes.y : 0; + } } - } - ] -}; -WebXRControllerMovement.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRControllerMovement.Name, (xrSessionManager, options) => { - return () => new WebXRControllerMovement(xrSessionManager, options); -}, WebXRControllerMovement.Version, true); + ] + }; + WebXRControllerMovement.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRControllerMovement.Name, (xrSessionManager, options) => { + return () => new WebXRControllerMovement(xrSessionManager, options); + }, WebXRControllerMovement.Version, true); +}); + // node_modules/@babylonjs/core/XR/features/WebXRLightEstimation.js class WebXRLightEstimation extends WebXRAbstractFeature { constructor(_xrSessionManager, options) { @@ -168614,11 +191457,27 @@ class WebXRLightEstimation extends WebXRAbstractFeature { } } } -WebXRLightEstimation.Name = WebXRFeatureName.LIGHT_ESTIMATION; -WebXRLightEstimation.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRLightEstimation.Name, (xrSessionManager, options) => { - return () => new WebXRLightEstimation(xrSessionManager, options); -}, WebXRLightEstimation.Version, false); +var init_WebXRLightEstimation = __esm(() => { + init_webGLHardwareTexture(); + init_internalTexture(); + init_observable(); + init_tools(); + init_webXRFeaturesManager(); + init_WebXRAbstractFeature(); + init_math_color(); + init_math_vector(); + init_directionalLight(); + init_baseTexture(); + init_sphericalPolynomial(); + init_lightConstants(); + init_hdrFiltering(); + WebXRLightEstimation.Name = WebXRFeatureName.LIGHT_ESTIMATION; + WebXRLightEstimation.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRLightEstimation.Name, (xrSessionManager, options) => { + return () => new WebXRLightEstimation(xrSessionManager, options); + }, WebXRLightEstimation.Version, false); +}); + // node_modules/@babylonjs/core/XR/features/WebXREyeTracking.js class WebXREyeTracking extends WebXRAbstractFeature { constructor(_xrSessionManager) { @@ -168688,11 +191547,19 @@ class WebXREyeTracking extends WebXRAbstractFeature { } } } -WebXREyeTracking.Name = WebXRFeatureName.EYE_TRACKING; -WebXREyeTracking.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXREyeTracking.Name, (xrSessionManager) => { - return () => new WebXREyeTracking(xrSessionManager); -}, WebXREyeTracking.Version, false); +var init_WebXREyeTracking = __esm(() => { + init_webXRFeaturesManager(); + init_WebXRAbstractFeature(); + init_observable(); + init_math_vector(); + init_ray(); + WebXREyeTracking.Name = WebXRFeatureName.EYE_TRACKING; + WebXREyeTracking.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXREyeTracking.Name, (xrSessionManager) => { + return () => new WebXREyeTracking(xrSessionManager); + }, WebXREyeTracking.Version, false); +}); + // node_modules/@babylonjs/core/XR/features/WebXRWalkingLocomotion.js class CircleBuffer { constructor(numSamples, initializer) { @@ -169015,9 +191882,17 @@ class WebXRWalkingLocomotion extends WebXRAbstractFeature { this.locomotionTarget.position.addInPlace(this._movement); } } -WebXRFeaturesManager.AddWebXRFeature(WebXRWalkingLocomotion.Name, (xrSessionManager, options) => { - return () => new WebXRWalkingLocomotion(xrSessionManager, options); -}, WebXRWalkingLocomotion.Version, false); +var init_WebXRWalkingLocomotion = __esm(() => { + init_math_vector(); + init_logger(); + init_observable(); + init_webXRFeaturesManager(); + init_WebXRAbstractFeature(); + WebXRFeaturesManager.AddWebXRFeature(WebXRWalkingLocomotion.Name, (xrSessionManager, options) => { + return () => new WebXRWalkingLocomotion(xrSessionManager, options); + }, WebXRWalkingLocomotion.Version, false); +}); + // node_modules/@babylonjs/core/XR/features/WebXRLayers.js class WebXRCompositionLayerWrapper extends WebXRLayerWrapper { constructor(getWidth, getHeight, layer2, layerType, isMultiview, createRTTProvider) { @@ -169134,13 +192009,6 @@ class WebXRProjectionLayerRenderTargetTextureProvider extends WebXRCompositionLa return false; } } -var defaultXRWebGLLayerInit = {}; -var defaultXRProjectionLayerInit = { - textureType: "texture", - colorFormat: 6408, - depthFormat: 35056, - scaleFactor: 1 -}; class WebXRLayers extends WebXRAbstractFeature { constructor(_xrSessionManager, _options = {}) { @@ -169206,11 +192074,27 @@ class WebXRLayers extends WebXRAbstractFeature { _onXRFrame(_xrFrame) { } } -WebXRLayers.Name = WebXRFeatureName.LAYERS; -WebXRLayers.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRLayers.Name, (xrSessionManager, options) => { - return () => new WebXRLayers(xrSessionManager, options); -}, WebXRLayers.Version, false); +var defaultXRWebGLLayerInit, defaultXRProjectionLayerInit; +var init_WebXRLayers = __esm(() => { + init_webXRFeaturesManager(); + init_WebXRAbstractFeature(); + init_webXRRenderTargetTextureProvider(); + init_webXRLayerWrapper(); + init_webXRWebGLLayer(); + defaultXRWebGLLayerInit = {}; + defaultXRProjectionLayerInit = { + textureType: "texture", + colorFormat: 6408, + depthFormat: 35056, + scaleFactor: 1 + }; + WebXRLayers.Name = WebXRFeatureName.LAYERS; + WebXRLayers.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRLayers.Name, (xrSessionManager, options) => { + return () => new WebXRLayers(xrSessionManager, options); + }, WebXRLayers.Version, false); +}); + // node_modules/@babylonjs/core/XR/features/WebXRDepthSensing.js class WebXRDepthSensing extends WebXRAbstractFeature { get width() { @@ -169399,14 +192283,29 @@ class WebXRDepthSensing extends WebXRAbstractFeature { }); } } -WebXRDepthSensing.Name = WebXRFeatureName.DEPTH_SENSING; -WebXRDepthSensing.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRDepthSensing.Name, (xrSessionManager, options) => { - return () => new WebXRDepthSensing(xrSessionManager, options); -}, WebXRDepthSensing.Version, false); +var init_WebXRDepthSensing = __esm(() => { + init_rawTexture(); + init_webXRFeaturesManager(); + init_WebXRAbstractFeature(); + init_tools(); + init_texture(); + init_engine(); + init_observable(); + init_webGLHardwareTexture(); + init_internalTexture(); + WebXRDepthSensing.Name = WebXRFeatureName.DEPTH_SENSING; + WebXRDepthSensing.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRDepthSensing.Name, (xrSessionManager, options) => { + return () => new WebXRDepthSensing(xrSessionManager, options); + }, WebXRDepthSensing.Version, false); +}); + // node_modules/@babylonjs/core/Shaders/velocity.fragment.js -var name263 = "velocityPixelShader"; -var shader263 = `precision highp float; +var name264, shader263; +var init_velocity_fragment = __esm(() => { + init_shaderStore(); + name264 = "velocityPixelShader"; + shader263 = `precision highp float; #define CUSTOM_FRAGMENT_BEGIN varying vec4 clipPos;varying vec4 previousClipPos; #define CUSTOM_FRAGMENT_DEFINITIONS @@ -169415,11 +192314,17 @@ void main(void) { highp vec4 motionVector=( clipPos/clipPos.w-previousClipPos/previousClipPos.w );gl_FragColor=motionVector; #define CUSTOM_FRAGMENT_MAIN_END }`; -ShaderStore.ShadersStore[name263] = shader263; + ShaderStore.ShadersStore[name264] = shader263; +}); // node_modules/@babylonjs/core/Shaders/velocity.vertex.js -var name264 = "velocityVertexShader"; -var shader264 = `#define CUSTOM_VERTEX_BEGIN +var name265, shader264; +var init_velocity_vertex = __esm(() => { + init_shaderStore(); + init_instancesDeclaration(); + init_instancesVertex(); + name265 = "velocityVertexShader"; + shader264 = `#define CUSTOM_VERTEX_BEGIN #define VELOCITY attribute vec3 position; #include @@ -169441,7 +192346,8 @@ clipPos=viewProjection*worldPos;previousClipPos=previousViewProjection*previousW #endif #define CUSTOM_VERTEX_MAIN_END }`; -ShaderStore.ShadersStore[name264] = shader264; + ShaderStore.ShadersStore[name265] = shader264; +}); // node_modules/@babylonjs/core/XR/features/WebXRSpaceWarp.js class XRSpaceWarpRenderTarget extends RenderTargetTexture { @@ -169640,11 +192546,21 @@ class WebXRSpaceWarp extends WebXRAbstractFeature { this.spaceWarpRTTProvider.accessMotionVector(view); } } -WebXRSpaceWarp.Name = WebXRFeatureName.SPACE_WARP; -WebXRSpaceWarp.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRSpaceWarp.Name, (xrSessionManager) => { - return () => new WebXRSpaceWarp(xrSessionManager); -}, WebXRSpaceWarp.Version, false); +var init_WebXRSpaceWarp = __esm(() => { + init_webXRFeaturesManager(); + init_WebXRAbstractFeature(); + init_math_vector(); + init_renderTargetTexture(); + init_shaderMaterial(); + init_velocity_fragment(); + init_velocity_vertex(); + WebXRSpaceWarp.Name = WebXRFeatureName.SPACE_WARP; + WebXRSpaceWarp.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRSpaceWarp.Name, (xrSessionManager) => { + return () => new WebXRSpaceWarp(xrSessionManager); + }, WebXRSpaceWarp.Version, false); +}); + // node_modules/@babylonjs/core/XR/features/WebXRRawCameraAccess.js class WebXRRawCameraAccess extends WebXRAbstractFeature { constructor(_xrSessionManager, options = {}) { @@ -169755,11 +192671,47 @@ class WebXRRawCameraAccess extends WebXRAbstractFeature { } } } -WebXRRawCameraAccess.Name = WebXRFeatureName.RAW_CAMERA_ACCESS; -WebXRRawCameraAccess.Version = 1; -WebXRFeaturesManager.AddWebXRFeature(WebXRRawCameraAccess.Name, (xrSessionManager, options) => { - return () => new WebXRRawCameraAccess(xrSessionManager, options); -}, WebXRRawCameraAccess.Version, false); +var init_WebXRRawCameraAccess = __esm(() => { + init_webXRFeaturesManager(); + init_WebXRAbstractFeature(); + init_observable(); + init_webGLHardwareTexture(); + init_internalTexture(); + init_baseTexture(); + WebXRRawCameraAccess.Name = WebXRFeatureName.RAW_CAMERA_ACCESS; + WebXRRawCameraAccess.Version = 1; + WebXRFeaturesManager.AddWebXRFeature(WebXRRawCameraAccess.Name, (xrSessionManager, options) => { + return () => new WebXRRawCameraAccess(xrSessionManager, options); + }, WebXRRawCameraAccess.Version, false); +}); + +// node_modules/@babylonjs/core/XR/features/index.js +var init_features = __esm(() => { + init_WebXRAbstractFeature(); + init_WebXRHitTestLegacy(); + init_WebXRAnchorSystem(); + init_WebXRPlaneDetector(); + init_WebXRBackgroundRemover(); + init_WebXRControllerTeleportation(); + init_WebXRControllerPointerSelection(); + init_WebXRControllerPhysics(); + init_WebXRHitTest(); + init_WebXRFeaturePointSystem(); + init_WebXRHandTracking(); + init_WebXRMeshDetector(); + init_WebXRImageTracking(); + init_WebXRNearInteraction(); + init_WebXRDOMOverlay(); + init_WebXRControllerMovement(); + init_WebXRLightEstimation(); + init_WebXREyeTracking(); + init_WebXRWalkingLocomotion(); + init_WebXRLayers(); + init_WebXRDepthSensing(); + init_WebXRSpaceWarp(); + init_WebXRRawCameraAccess(); +}); + // node_modules/@babylonjs/core/XR/motionController/webXRGenericHandController.js class WebXRGenericHandController extends WebXRAbstractMotionController { constructor(scene35, gamepadObject, handedness) { @@ -169782,83 +192734,89 @@ class WebXRGenericHandController extends WebXRAbstractMotionController { _updateModel() { } } -WebXRMotionControllerManager.RegisterController("generic-hand-select-grasp", (xrInput, scene35) => { - return new WebXRGenericHandController(scene35, xrInput.gamepad, xrInput.handedness); -}); -var GenericHandSelectGraspProfile = { - left: { - selectComponentId: "xr-standard-trigger", - components: { - "xr-standard-trigger": { - type: "trigger", - gamepadIndices: { - button: 0 +var GenericHandSelectGraspProfile; +var init_webXRGenericHandController = __esm(() => { + init_webXRAbstractMotionController(); + init_webXRMotionControllerManager(); + WebXRMotionControllerManager.RegisterController("generic-hand-select-grasp", (xrInput, scene35) => { + return new WebXRGenericHandController(scene35, xrInput.gamepad, xrInput.handedness); + }); + GenericHandSelectGraspProfile = { + left: { + selectComponentId: "xr-standard-trigger", + components: { + "xr-standard-trigger": { + type: "trigger", + gamepadIndices: { + button: 0 + }, + rootNodeName: "xr-standard-trigger", + visualResponses: {} }, - rootNodeName: "xr-standard-trigger", - visualResponses: {} + grasp: { + type: "trigger", + gamepadIndices: { + button: 4 + }, + rootNodeName: "grasp", + visualResponses: {} + } }, - grasp: { - type: "trigger", - gamepadIndices: { - button: 4 - }, - rootNodeName: "grasp", - visualResponses: {} - } + gamepadMapping: "xr-standard", + rootNodeName: "generic-hand-select-grasp-left", + assetPath: "left.glb" }, - gamepadMapping: "xr-standard", - rootNodeName: "generic-hand-select-grasp-left", - assetPath: "left.glb" - }, - right: { - selectComponentId: "xr-standard-trigger", - components: { - "xr-standard-trigger": { - type: "trigger", - gamepadIndices: { - button: 0 - }, - rootNodeName: "xr-standard-trigger", - visualResponses: {} - }, - grasp: { - type: "trigger", - gamepadIndices: { - button: 4 + right: { + selectComponentId: "xr-standard-trigger", + components: { + "xr-standard-trigger": { + type: "trigger", + gamepadIndices: { + button: 0 + }, + rootNodeName: "xr-standard-trigger", + visualResponses: {} }, - rootNodeName: "grasp", - visualResponses: {} - } - }, - gamepadMapping: "xr-standard", - rootNodeName: "generic-hand-select-grasp-right", - assetPath: "right.glb" - }, - none: { - selectComponentId: "xr-standard-trigger", - components: { - "xr-standard-trigger": { - type: "trigger", - gamepadIndices: { - button: 0 - }, - rootNodeName: "xr-standard-trigger", - visualResponses: {} + grasp: { + type: "trigger", + gamepadIndices: { + button: 4 + }, + rootNodeName: "grasp", + visualResponses: {} + } }, - grasp: { - type: "trigger", - gamepadIndices: { - button: 4 - }, - rootNodeName: "grasp", - visualResponses: {} - } + gamepadMapping: "xr-standard", + rootNodeName: "generic-hand-select-grasp-right", + assetPath: "right.glb" }, - gamepadMapping: "xr-standard", - rootNodeName: "generic-hand-select-grasp-none", - assetPath: "none.glb" - } -}; + none: { + selectComponentId: "xr-standard-trigger", + components: { + "xr-standard-trigger": { + type: "trigger", + gamepadIndices: { + button: 0 + }, + rootNodeName: "xr-standard-trigger", + visualResponses: {} + }, + grasp: { + type: "trigger", + gamepadIndices: { + button: 4 + }, + rootNodeName: "grasp", + visualResponses: {} + } + }, + gamepadMapping: "xr-standard", + rootNodeName: "generic-hand-select-grasp-none", + assetPath: "none.glb" + } + }; +}); + // node_modules/@babylonjs/core/XR/motionController/webXRMicrosoftMixedRealityController.js class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionController { constructor(scene35, gamepadObject, handedness) { @@ -170025,284 +192983,294 @@ class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionController _updateModel() { } } -WebXRMicrosoftMixedRealityController.MODEL_BASE_URL = "https://controllers.babylonjs.com/microsoft/"; -WebXRMicrosoftMixedRealityController.MODEL_LEFT_FILENAME = "left.glb"; -WebXRMicrosoftMixedRealityController.MODEL_RIGHT_FILENAME = "right.glb"; -WebXRMotionControllerManager.RegisterController("windows-mixed-reality", (xrInput, scene35) => { - return new WebXRMicrosoftMixedRealityController(scene35, xrInput.gamepad, xrInput.handedness); -}); -var MixedRealityProfile = { - left: { - selectComponentId: "xr-standard-trigger", - components: { - "xr-standard-trigger": { - type: "trigger", - gamepadIndices: { - button: 0 - }, - rootNodeName: "xr_standard_trigger", - visualResponses: { - xr_standard_trigger_pressed: { - componentProperty: "button", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_trigger_pressed_value", - minNodeName: "xr_standard_trigger_pressed_min", - maxNodeName: "xr_standard_trigger_pressed_max" - } - } - }, - "xr-standard-squeeze": { - type: "squeeze", - gamepadIndices: { - button: 1 - }, - rootNodeName: "xr_standard_squeeze", - visualResponses: { - xr_standard_squeeze_pressed: { - componentProperty: "button", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_squeeze_pressed_value", - minNodeName: "xr_standard_squeeze_pressed_min", - maxNodeName: "xr_standard_squeeze_pressed_max" - } - } - }, - "xr-standard-touchpad": { - type: "touchpad", - gamepadIndices: { - button: 2, - xAxis: 0, - yAxis: 1 - }, - rootNodeName: "xr_standard_touchpad", - visualResponses: { - xr_standard_touchpad_pressed: { - componentProperty: "button", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_touchpad_pressed_value", - minNodeName: "xr_standard_touchpad_pressed_min", - maxNodeName: "xr_standard_touchpad_pressed_max" - }, - xr_standard_touchpad_xaxis_pressed: { - componentProperty: "xAxis", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_touchpad_xaxis_pressed_value", - minNodeName: "xr_standard_touchpad_xaxis_pressed_min", - maxNodeName: "xr_standard_touchpad_xaxis_pressed_max" - }, - xr_standard_touchpad_yaxis_pressed: { - componentProperty: "yAxis", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_touchpad_yaxis_pressed_value", - minNodeName: "xr_standard_touchpad_yaxis_pressed_min", - maxNodeName: "xr_standard_touchpad_yaxis_pressed_max" - }, - xr_standard_touchpad_xaxis_touched: { - componentProperty: "xAxis", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_touchpad_xaxis_touched_value", - minNodeName: "xr_standard_touchpad_xaxis_touched_min", - maxNodeName: "xr_standard_touchpad_xaxis_touched_max" +var MixedRealityProfile; +var init_webXRMicrosoftMixedRealityController = __esm(() => { + init_webXRAbstractMotionController(); + init_webXRMotionControllerManager(); + init_mesh(); + init_math_vector(); + init_sceneLoader(); + init_logger(); + WebXRMicrosoftMixedRealityController.MODEL_BASE_URL = "https://controllers.babylonjs.com/microsoft/"; + WebXRMicrosoftMixedRealityController.MODEL_LEFT_FILENAME = "left.glb"; + WebXRMicrosoftMixedRealityController.MODEL_RIGHT_FILENAME = "right.glb"; + WebXRMotionControllerManager.RegisterController("windows-mixed-reality", (xrInput, scene35) => { + return new WebXRMicrosoftMixedRealityController(scene35, xrInput.gamepad, xrInput.handedness); + }); + MixedRealityProfile = { + left: { + selectComponentId: "xr-standard-trigger", + components: { + "xr-standard-trigger": { + type: "trigger", + gamepadIndices: { + button: 0 }, - xr_standard_touchpad_yaxis_touched: { - componentProperty: "yAxis", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_touchpad_yaxis_touched_value", - minNodeName: "xr_standard_touchpad_yaxis_touched_min", - maxNodeName: "xr_standard_touchpad_yaxis_touched_max" + rootNodeName: "xr_standard_trigger", + visualResponses: { + xr_standard_trigger_pressed: { + componentProperty: "button", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_trigger_pressed_value", + minNodeName: "xr_standard_trigger_pressed_min", + maxNodeName: "xr_standard_trigger_pressed_max" + } + } + }, + "xr-standard-squeeze": { + type: "squeeze", + gamepadIndices: { + button: 1 }, - xr_standard_touchpad_axes_touched: { - componentProperty: "state", - states: ["touched", "pressed"], - valueNodeProperty: "visibility", - valueNodeName: "xr_standard_touchpad_axes_touched_value" + rootNodeName: "xr_standard_squeeze", + visualResponses: { + xr_standard_squeeze_pressed: { + componentProperty: "button", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_squeeze_pressed_value", + minNodeName: "xr_standard_squeeze_pressed_min", + maxNodeName: "xr_standard_squeeze_pressed_max" + } } }, - touchPointNodeName: "xr_standard_touchpad_axes_touched_value" - }, - "xr-standard-thumbstick": { - type: "thumbstick", - gamepadIndices: { - button: 3, - xAxis: 2, - yAxis: 3 - }, - rootNodeName: "xr_standard_thumbstick", - visualResponses: { - xr_standard_thumbstick_pressed: { - componentProperty: "button", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_thumbstick_pressed_value", - minNodeName: "xr_standard_thumbstick_pressed_min", - maxNodeName: "xr_standard_thumbstick_pressed_max" + "xr-standard-touchpad": { + type: "touchpad", + gamepadIndices: { + button: 2, + xAxis: 0, + yAxis: 1 + }, + rootNodeName: "xr_standard_touchpad", + visualResponses: { + xr_standard_touchpad_pressed: { + componentProperty: "button", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_touchpad_pressed_value", + minNodeName: "xr_standard_touchpad_pressed_min", + maxNodeName: "xr_standard_touchpad_pressed_max" + }, + xr_standard_touchpad_xaxis_pressed: { + componentProperty: "xAxis", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_touchpad_xaxis_pressed_value", + minNodeName: "xr_standard_touchpad_xaxis_pressed_min", + maxNodeName: "xr_standard_touchpad_xaxis_pressed_max" + }, + xr_standard_touchpad_yaxis_pressed: { + componentProperty: "yAxis", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_touchpad_yaxis_pressed_value", + minNodeName: "xr_standard_touchpad_yaxis_pressed_min", + maxNodeName: "xr_standard_touchpad_yaxis_pressed_max" + }, + xr_standard_touchpad_xaxis_touched: { + componentProperty: "xAxis", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_touchpad_xaxis_touched_value", + minNodeName: "xr_standard_touchpad_xaxis_touched_min", + maxNodeName: "xr_standard_touchpad_xaxis_touched_max" + }, + xr_standard_touchpad_yaxis_touched: { + componentProperty: "yAxis", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_touchpad_yaxis_touched_value", + minNodeName: "xr_standard_touchpad_yaxis_touched_min", + maxNodeName: "xr_standard_touchpad_yaxis_touched_max" + }, + xr_standard_touchpad_axes_touched: { + componentProperty: "state", + states: ["touched", "pressed"], + valueNodeProperty: "visibility", + valueNodeName: "xr_standard_touchpad_axes_touched_value" + } }, - xr_standard_thumbstick_xaxis_pressed: { - componentProperty: "xAxis", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_thumbstick_xaxis_pressed_value", - minNodeName: "xr_standard_thumbstick_xaxis_pressed_min", - maxNodeName: "xr_standard_thumbstick_xaxis_pressed_max" + touchPointNodeName: "xr_standard_touchpad_axes_touched_value" + }, + "xr-standard-thumbstick": { + type: "thumbstick", + gamepadIndices: { + button: 3, + xAxis: 2, + yAxis: 3 }, - xr_standard_thumbstick_yaxis_pressed: { - componentProperty: "yAxis", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_thumbstick_yaxis_pressed_value", - minNodeName: "xr_standard_thumbstick_yaxis_pressed_min", - maxNodeName: "xr_standard_thumbstick_yaxis_pressed_max" - } - } - } - }, - gamepadMapping: "xr-standard", - rootNodeName: "microsoft-mixed-reality-left", - assetPath: "left.glb" - }, - right: { - selectComponentId: "xr-standard-trigger", - components: { - "xr-standard-trigger": { - type: "trigger", - gamepadIndices: { - button: 0 - }, - rootNodeName: "xr_standard_trigger", - visualResponses: { - xr_standard_trigger_pressed: { - componentProperty: "button", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_trigger_pressed_value", - minNodeName: "xr_standard_trigger_pressed_min", - maxNodeName: "xr_standard_trigger_pressed_max" - } - } - }, - "xr-standard-squeeze": { - type: "squeeze", - gamepadIndices: { - button: 1 - }, - rootNodeName: "xr_standard_squeeze", - visualResponses: { - xr_standard_squeeze_pressed: { - componentProperty: "button", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_squeeze_pressed_value", - minNodeName: "xr_standard_squeeze_pressed_min", - maxNodeName: "xr_standard_squeeze_pressed_max" + rootNodeName: "xr_standard_thumbstick", + visualResponses: { + xr_standard_thumbstick_pressed: { + componentProperty: "button", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_thumbstick_pressed_value", + minNodeName: "xr_standard_thumbstick_pressed_min", + maxNodeName: "xr_standard_thumbstick_pressed_max" + }, + xr_standard_thumbstick_xaxis_pressed: { + componentProperty: "xAxis", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_thumbstick_xaxis_pressed_value", + minNodeName: "xr_standard_thumbstick_xaxis_pressed_min", + maxNodeName: "xr_standard_thumbstick_xaxis_pressed_max" + }, + xr_standard_thumbstick_yaxis_pressed: { + componentProperty: "yAxis", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_thumbstick_yaxis_pressed_value", + minNodeName: "xr_standard_thumbstick_yaxis_pressed_min", + maxNodeName: "xr_standard_thumbstick_yaxis_pressed_max" + } } } }, - "xr-standard-touchpad": { - type: "touchpad", - gamepadIndices: { - button: 2, - xAxis: 0, - yAxis: 1 - }, - rootNodeName: "xr_standard_touchpad", - visualResponses: { - xr_standard_touchpad_pressed: { - componentProperty: "button", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_touchpad_pressed_value", - minNodeName: "xr_standard_touchpad_pressed_min", - maxNodeName: "xr_standard_touchpad_pressed_max" - }, - xr_standard_touchpad_xaxis_pressed: { - componentProperty: "xAxis", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_touchpad_xaxis_pressed_value", - minNodeName: "xr_standard_touchpad_xaxis_pressed_min", - maxNodeName: "xr_standard_touchpad_xaxis_pressed_max" - }, - xr_standard_touchpad_yaxis_pressed: { - componentProperty: "yAxis", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_touchpad_yaxis_pressed_value", - minNodeName: "xr_standard_touchpad_yaxis_pressed_min", - maxNodeName: "xr_standard_touchpad_yaxis_pressed_max" - }, - xr_standard_touchpad_xaxis_touched: { - componentProperty: "xAxis", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_touchpad_xaxis_touched_value", - minNodeName: "xr_standard_touchpad_xaxis_touched_min", - maxNodeName: "xr_standard_touchpad_xaxis_touched_max" + gamepadMapping: "xr-standard", + rootNodeName: "microsoft-mixed-reality-left", + assetPath: "left.glb" + }, + right: { + selectComponentId: "xr-standard-trigger", + components: { + "xr-standard-trigger": { + type: "trigger", + gamepadIndices: { + button: 0 }, - xr_standard_touchpad_yaxis_touched: { - componentProperty: "yAxis", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_touchpad_yaxis_touched_value", - minNodeName: "xr_standard_touchpad_yaxis_touched_min", - maxNodeName: "xr_standard_touchpad_yaxis_touched_max" + rootNodeName: "xr_standard_trigger", + visualResponses: { + xr_standard_trigger_pressed: { + componentProperty: "button", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_trigger_pressed_value", + minNodeName: "xr_standard_trigger_pressed_min", + maxNodeName: "xr_standard_trigger_pressed_max" + } + } + }, + "xr-standard-squeeze": { + type: "squeeze", + gamepadIndices: { + button: 1 }, - xr_standard_touchpad_axes_touched: { - componentProperty: "state", - states: ["touched", "pressed"], - valueNodeProperty: "visibility", - valueNodeName: "xr_standard_touchpad_axes_touched_value" + rootNodeName: "xr_standard_squeeze", + visualResponses: { + xr_standard_squeeze_pressed: { + componentProperty: "button", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_squeeze_pressed_value", + minNodeName: "xr_standard_squeeze_pressed_min", + maxNodeName: "xr_standard_squeeze_pressed_max" + } } }, - touchPointNodeName: "xr_standard_touchpad_axes_touched_value" - }, - "xr-standard-thumbstick": { - type: "thumbstick", - gamepadIndices: { - button: 3, - xAxis: 2, - yAxis: 3 - }, - rootNodeName: "xr_standard_thumbstick", - visualResponses: { - xr_standard_thumbstick_pressed: { - componentProperty: "button", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_thumbstick_pressed_value", - minNodeName: "xr_standard_thumbstick_pressed_min", - maxNodeName: "xr_standard_thumbstick_pressed_max" + "xr-standard-touchpad": { + type: "touchpad", + gamepadIndices: { + button: 2, + xAxis: 0, + yAxis: 1 }, - xr_standard_thumbstick_xaxis_pressed: { - componentProperty: "xAxis", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_thumbstick_xaxis_pressed_value", - minNodeName: "xr_standard_thumbstick_xaxis_pressed_min", - maxNodeName: "xr_standard_thumbstick_xaxis_pressed_max" + rootNodeName: "xr_standard_touchpad", + visualResponses: { + xr_standard_touchpad_pressed: { + componentProperty: "button", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_touchpad_pressed_value", + minNodeName: "xr_standard_touchpad_pressed_min", + maxNodeName: "xr_standard_touchpad_pressed_max" + }, + xr_standard_touchpad_xaxis_pressed: { + componentProperty: "xAxis", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_touchpad_xaxis_pressed_value", + minNodeName: "xr_standard_touchpad_xaxis_pressed_min", + maxNodeName: "xr_standard_touchpad_xaxis_pressed_max" + }, + xr_standard_touchpad_yaxis_pressed: { + componentProperty: "yAxis", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_touchpad_yaxis_pressed_value", + minNodeName: "xr_standard_touchpad_yaxis_pressed_min", + maxNodeName: "xr_standard_touchpad_yaxis_pressed_max" + }, + xr_standard_touchpad_xaxis_touched: { + componentProperty: "xAxis", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_touchpad_xaxis_touched_value", + minNodeName: "xr_standard_touchpad_xaxis_touched_min", + maxNodeName: "xr_standard_touchpad_xaxis_touched_max" + }, + xr_standard_touchpad_yaxis_touched: { + componentProperty: "yAxis", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_touchpad_yaxis_touched_value", + minNodeName: "xr_standard_touchpad_yaxis_touched_min", + maxNodeName: "xr_standard_touchpad_yaxis_touched_max" + }, + xr_standard_touchpad_axes_touched: { + componentProperty: "state", + states: ["touched", "pressed"], + valueNodeProperty: "visibility", + valueNodeName: "xr_standard_touchpad_axes_touched_value" + } }, - xr_standard_thumbstick_yaxis_pressed: { - componentProperty: "yAxis", - states: ["default", "touched", "pressed"], - valueNodeProperty: "transform", - valueNodeName: "xr_standard_thumbstick_yaxis_pressed_value", - minNodeName: "xr_standard_thumbstick_yaxis_pressed_min", - maxNodeName: "xr_standard_thumbstick_yaxis_pressed_max" + touchPointNodeName: "xr_standard_touchpad_axes_touched_value" + }, + "xr-standard-thumbstick": { + type: "thumbstick", + gamepadIndices: { + button: 3, + xAxis: 2, + yAxis: 3 + }, + rootNodeName: "xr_standard_thumbstick", + visualResponses: { + xr_standard_thumbstick_pressed: { + componentProperty: "button", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_thumbstick_pressed_value", + minNodeName: "xr_standard_thumbstick_pressed_min", + maxNodeName: "xr_standard_thumbstick_pressed_max" + }, + xr_standard_thumbstick_xaxis_pressed: { + componentProperty: "xAxis", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_thumbstick_xaxis_pressed_value", + minNodeName: "xr_standard_thumbstick_xaxis_pressed_min", + maxNodeName: "xr_standard_thumbstick_xaxis_pressed_max" + }, + xr_standard_thumbstick_yaxis_pressed: { + componentProperty: "yAxis", + states: ["default", "touched", "pressed"], + valueNodeProperty: "transform", + valueNodeName: "xr_standard_thumbstick_yaxis_pressed_value", + minNodeName: "xr_standard_thumbstick_yaxis_pressed_min", + maxNodeName: "xr_standard_thumbstick_yaxis_pressed_max" + } } } - } - }, - gamepadMapping: "xr-standard", - rootNodeName: "microsoft-mixed-reality-right", - assetPath: "right.glb" - } -}; + }, + gamepadMapping: "xr-standard", + rootNodeName: "microsoft-mixed-reality-right", + assetPath: "right.glb" + } + }; +}); + // node_modules/@babylonjs/core/XR/motionController/webXROculusTouchMotionController.js class WebXROculusTouchMotionController extends WebXRAbstractMotionController { constructor(scene35, gamepadObject, handedness, _legacyMapping = false, _forceLegacyControllers = false) { @@ -170399,134 +193367,142 @@ class WebXROculusTouchMotionController extends WebXRAbstractMotionController { return !!navigator.userAgent.match(/Quest/gi) && !this._forceLegacyControllers; } } -WebXROculusTouchMotionController.MODEL_BASE_URL = "https://controllers.babylonjs.com/oculus/"; -WebXROculusTouchMotionController.MODEL_LEFT_FILENAME = "left.babylon"; -WebXROculusTouchMotionController.MODEL_RIGHT_FILENAME = "right.babylon"; -WebXROculusTouchMotionController.QUEST_MODEL_BASE_URL = "https://controllers.babylonjs.com/oculusQuest/"; -WebXRMotionControllerManager.RegisterController("oculus-touch", (xrInput, scene35) => { - return new WebXROculusTouchMotionController(scene35, xrInput.gamepad, xrInput.handedness); -}); -WebXRMotionControllerManager.RegisterController("oculus-touch-legacy", (xrInput, scene35) => { - return new WebXROculusTouchMotionController(scene35, xrInput.gamepad, xrInput.handedness, true); -}); -var OculusTouchLayouts = { - left: { - selectComponentId: "xr-standard-trigger", - components: { - "xr-standard-trigger": { - type: "trigger", - gamepadIndices: { - button: 0 +var OculusTouchLayouts; +var init_webXROculusTouchMotionController = __esm(() => { + init_webXRAbstractMotionController(); + init_webXRMotionControllerManager(); + init_mesh(); + init_math_vector(); + WebXROculusTouchMotionController.MODEL_BASE_URL = "https://controllers.babylonjs.com/oculus/"; + WebXROculusTouchMotionController.MODEL_LEFT_FILENAME = "left.babylon"; + WebXROculusTouchMotionController.MODEL_RIGHT_FILENAME = "right.babylon"; + WebXROculusTouchMotionController.QUEST_MODEL_BASE_URL = "https://controllers.babylonjs.com/oculusQuest/"; + WebXRMotionControllerManager.RegisterController("oculus-touch", (xrInput, scene35) => { + return new WebXROculusTouchMotionController(scene35, xrInput.gamepad, xrInput.handedness); + }); + WebXRMotionControllerManager.RegisterController("oculus-touch-legacy", (xrInput, scene35) => { + return new WebXROculusTouchMotionController(scene35, xrInput.gamepad, xrInput.handedness, true); + }); + OculusTouchLayouts = { + left: { + selectComponentId: "xr-standard-trigger", + components: { + "xr-standard-trigger": { + type: "trigger", + gamepadIndices: { + button: 0 + }, + rootNodeName: "xr_standard_trigger", + visualResponses: {} }, - rootNodeName: "xr_standard_trigger", - visualResponses: {} - }, - "xr-standard-squeeze": { - type: "squeeze", - gamepadIndices: { - button: 1 + "xr-standard-squeeze": { + type: "squeeze", + gamepadIndices: { + button: 1 + }, + rootNodeName: "xr_standard_squeeze", + visualResponses: {} }, - rootNodeName: "xr_standard_squeeze", - visualResponses: {} - }, - "xr-standard-thumbstick": { - type: "thumbstick", - gamepadIndices: { - button: 3, - xAxis: 2, - yAxis: 3 - }, - rootNodeName: "xr_standard_thumbstick", - visualResponses: {} - }, - "x-button": { - type: "button", - gamepadIndices: { - button: 4 + "xr-standard-thumbstick": { + type: "thumbstick", + gamepadIndices: { + button: 3, + xAxis: 2, + yAxis: 3 + }, + rootNodeName: "xr_standard_thumbstick", + visualResponses: {} }, - rootNodeName: "x_button", - visualResponses: {} - }, - "y-button": { - type: "button", - gamepadIndices: { - button: 5 + "x-button": { + type: "button", + gamepadIndices: { + button: 4 + }, + rootNodeName: "x_button", + visualResponses: {} }, - rootNodeName: "y_button", - visualResponses: {} - }, - thumbrest: { - type: "button", - gamepadIndices: { - button: 6 + "y-button": { + type: "button", + gamepadIndices: { + button: 5 + }, + rootNodeName: "y_button", + visualResponses: {} }, - rootNodeName: "thumbrest", - visualResponses: {} - } - }, - gamepadMapping: "xr-standard", - rootNodeName: "oculus-touch-v2-left", - assetPath: "left.glb" - }, - right: { - selectComponentId: "xr-standard-trigger", - components: { - "xr-standard-trigger": { - type: "trigger", - gamepadIndices: { - button: 0 - }, - rootNodeName: "xr_standard_trigger", - visualResponses: {} + thumbrest: { + type: "button", + gamepadIndices: { + button: 6 + }, + rootNodeName: "thumbrest", + visualResponses: {} + } }, - "xr-standard-squeeze": { - type: "squeeze", - gamepadIndices: { - button: 1 + gamepadMapping: "xr-standard", + rootNodeName: "oculus-touch-v2-left", + assetPath: "left.glb" + }, + right: { + selectComponentId: "xr-standard-trigger", + components: { + "xr-standard-trigger": { + type: "trigger", + gamepadIndices: { + button: 0 + }, + rootNodeName: "xr_standard_trigger", + visualResponses: {} }, - rootNodeName: "xr_standard_squeeze", - visualResponses: {} - }, - "xr-standard-thumbstick": { - type: "thumbstick", - gamepadIndices: { - button: 3, - xAxis: 2, - yAxis: 3 - }, - rootNodeName: "xr_standard_thumbstick", - visualResponses: {} - }, - "a-button": { - type: "button", - gamepadIndices: { - button: 4 + "xr-standard-squeeze": { + type: "squeeze", + gamepadIndices: { + button: 1 + }, + rootNodeName: "xr_standard_squeeze", + visualResponses: {} }, - rootNodeName: "a_button", - visualResponses: {} - }, - "b-button": { - type: "button", - gamepadIndices: { - button: 5 + "xr-standard-thumbstick": { + type: "thumbstick", + gamepadIndices: { + button: 3, + xAxis: 2, + yAxis: 3 + }, + rootNodeName: "xr_standard_thumbstick", + visualResponses: {} }, - rootNodeName: "b_button", - visualResponses: {} - }, - thumbrest: { - type: "button", - gamepadIndices: { - button: 6 + "a-button": { + type: "button", + gamepadIndices: { + button: 4 + }, + rootNodeName: "a_button", + visualResponses: {} }, - rootNodeName: "thumbrest", - visualResponses: {} - } - }, - gamepadMapping: "xr-standard", - rootNodeName: "oculus-touch-v2-right", - assetPath: "right.glb" - } -}; + "b-button": { + type: "button", + gamepadIndices: { + button: 5 + }, + rootNodeName: "b_button", + visualResponses: {} + }, + thumbrest: { + type: "button", + gamepadIndices: { + button: 6 + }, + rootNodeName: "thumbrest", + visualResponses: {} + } + }, + gamepadMapping: "xr-standard", + rootNodeName: "oculus-touch-v2-right", + assetPath: "right.glb" + } + }; +}); + // node_modules/@babylonjs/core/XR/motionController/webXRHTCViveMotionController.js class WebXRHTCViveMotionController extends WebXRAbstractMotionController { constructor(scene35, gamepadObject, handedness) { @@ -170579,139 +193555,160 @@ class WebXRHTCViveMotionController extends WebXRAbstractMotionController { _updateModel() { } } -WebXRHTCViveMotionController.MODEL_BASE_URL = "https://controllers.babylonjs.com/vive/"; -WebXRHTCViveMotionController.MODEL_FILENAME = "wand.babylon"; -WebXRMotionControllerManager.RegisterController("htc-vive", (xrInput, scene35) => { - return new WebXRHTCViveMotionController(scene35, xrInput.gamepad, xrInput.handedness); -}); -var HTCViveLayout = { - left: { - selectComponentId: "xr-standard-trigger", - components: { - "xr-standard-trigger": { - type: "trigger", - gamepadIndices: { - button: 0 +var HTCViveLayout; +var init_webXRHTCViveMotionController = __esm(() => { + init_webXRAbstractMotionController(); + init_mesh(); + init_math_vector(); + init_webXRMotionControllerManager(); + WebXRHTCViveMotionController.MODEL_BASE_URL = "https://controllers.babylonjs.com/vive/"; + WebXRHTCViveMotionController.MODEL_FILENAME = "wand.babylon"; + WebXRMotionControllerManager.RegisterController("htc-vive", (xrInput, scene35) => { + return new WebXRHTCViveMotionController(scene35, xrInput.gamepad, xrInput.handedness); + }); + HTCViveLayout = { + left: { + selectComponentId: "xr-standard-trigger", + components: { + "xr-standard-trigger": { + type: "trigger", + gamepadIndices: { + button: 0 + }, + rootNodeName: "xr_standard_trigger", + visualResponses: {} }, - rootNodeName: "xr_standard_trigger", - visualResponses: {} - }, - "xr-standard-squeeze": { - type: "squeeze", - gamepadIndices: { - button: 1 + "xr-standard-squeeze": { + type: "squeeze", + gamepadIndices: { + button: 1 + }, + rootNodeName: "xr_standard_squeeze", + visualResponses: {} }, - rootNodeName: "xr_standard_squeeze", - visualResponses: {} - }, - "xr-standard-touchpad": { - type: "touchpad", - gamepadIndices: { - button: 2, - xAxis: 0, - yAxis: 1 - }, - rootNodeName: "xr_standard_touchpad", - visualResponses: {} - }, - menu: { - type: "button", - gamepadIndices: { - button: 4 + "xr-standard-touchpad": { + type: "touchpad", + gamepadIndices: { + button: 2, + xAxis: 0, + yAxis: 1 + }, + rootNodeName: "xr_standard_touchpad", + visualResponses: {} }, - rootNodeName: "menu", - visualResponses: {} - } - }, - gamepadMapping: "xr-standard", - rootNodeName: "htc_vive_none", - assetPath: "none.glb" - }, - right: { - selectComponentId: "xr-standard-trigger", - components: { - "xr-standard-trigger": { - type: "trigger", - gamepadIndices: { - button: 0 - }, - rootNodeName: "xr_standard_trigger", - visualResponses: {} + menu: { + type: "button", + gamepadIndices: { + button: 4 + }, + rootNodeName: "menu", + visualResponses: {} + } }, - "xr-standard-squeeze": { - type: "squeeze", - gamepadIndices: { - button: 1 + gamepadMapping: "xr-standard", + rootNodeName: "htc_vive_none", + assetPath: "none.glb" + }, + right: { + selectComponentId: "xr-standard-trigger", + components: { + "xr-standard-trigger": { + type: "trigger", + gamepadIndices: { + button: 0 + }, + rootNodeName: "xr_standard_trigger", + visualResponses: {} }, - rootNodeName: "xr_standard_squeeze", - visualResponses: {} - }, - "xr-standard-touchpad": { - type: "touchpad", - gamepadIndices: { - button: 2, - xAxis: 0, - yAxis: 1 - }, - rootNodeName: "xr_standard_touchpad", - visualResponses: {} - }, - menu: { - type: "button", - gamepadIndices: { - button: 4 + "xr-standard-squeeze": { + type: "squeeze", + gamepadIndices: { + button: 1 + }, + rootNodeName: "xr_standard_squeeze", + visualResponses: {} }, - rootNodeName: "menu", - visualResponses: {} - } - }, - gamepadMapping: "xr-standard", - rootNodeName: "htc_vive_none", - assetPath: "none.glb" - }, - none: { - selectComponentId: "xr-standard-trigger", - components: { - "xr-standard-trigger": { - type: "trigger", - gamepadIndices: { - button: 0 - }, - rootNodeName: "xr_standard_trigger", - visualResponses: {} - }, - "xr-standard-squeeze": { - type: "squeeze", - gamepadIndices: { - button: 1 + "xr-standard-touchpad": { + type: "touchpad", + gamepadIndices: { + button: 2, + xAxis: 0, + yAxis: 1 + }, + rootNodeName: "xr_standard_touchpad", + visualResponses: {} }, - rootNodeName: "xr_standard_squeeze", - visualResponses: {} - }, - "xr-standard-touchpad": { - type: "touchpad", - gamepadIndices: { - button: 2, - xAxis: 0, - yAxis: 1 - }, - rootNodeName: "xr_standard_touchpad", - visualResponses: {} + menu: { + type: "button", + gamepadIndices: { + button: 4 + }, + rootNodeName: "menu", + visualResponses: {} + } }, - menu: { - type: "button", - gamepadIndices: { - button: 4 - }, - rootNodeName: "menu", - visualResponses: {} - } + gamepadMapping: "xr-standard", + rootNodeName: "htc_vive_none", + assetPath: "none.glb" }, - gamepadMapping: "xr-standard", - rootNodeName: "htc-vive-none", - assetPath: "none.glb" - } -}; + none: { + selectComponentId: "xr-standard-trigger", + components: { + "xr-standard-trigger": { + type: "trigger", + gamepadIndices: { + button: 0 + }, + rootNodeName: "xr_standard_trigger", + visualResponses: {} + }, + "xr-standard-squeeze": { + type: "squeeze", + gamepadIndices: { + button: 1 + }, + rootNodeName: "xr_standard_squeeze", + visualResponses: {} + }, + "xr-standard-touchpad": { + type: "touchpad", + gamepadIndices: { + button: 2, + xAxis: 0, + yAxis: 1 + }, + rootNodeName: "xr_standard_touchpad", + visualResponses: {} + }, + menu: { + type: "button", + gamepadIndices: { + button: 4 + }, + rootNodeName: "menu", + visualResponses: {} + } + }, + gamepadMapping: "xr-standard", + rootNodeName: "htc-vive-none", + assetPath: "none.glb" + } + }; +}); + +// node_modules/@babylonjs/core/XR/motionController/index.js +var init_motionController = __esm(() => { + init_webXRAbstractMotionController(); + init_webXRControllerComponent(); + init_webXRGenericHandController(); + init_webXRGenericMotionController(); + init_webXRMicrosoftMixedRealityController(); + init_webXRMotionControllerManager(); + init_webXROculusTouchMotionController(); + init_webXRHTCViveMotionController(); + init_webXRProfiledMotionController(); +}); + // node_modules/@babylonjs/core/XR/native/nativeXRFrame.js class NativeXRFrame { get session() { @@ -170774,21 +193771,51 @@ class NativeXRFrame { throw new Error("This function is not available in Babylon Native"); } } -RegisterNativeTypeAsync("NativeXRFrame", NativeXRFrame); -// node_modules/@babylonjs/core/FlowGraph/flowGraphConnection.js -var FlowGraphConnectionType; -(function(FlowGraphConnectionType2) { - FlowGraphConnectionType2[FlowGraphConnectionType2["Input"] = 0] = "Input"; - FlowGraphConnectionType2[FlowGraphConnectionType2["Output"] = 1] = "Output"; -})(FlowGraphConnectionType || (FlowGraphConnectionType = {})); +var init_nativeXRFrame = __esm(() => { + init_nativeEngine(); + RegisterNativeTypeAsync("NativeXRFrame", NativeXRFrame); +}); + +// node_modules/@babylonjs/core/XR/native/index.js +var init_native = __esm(() => { + init_nativeXRRenderTarget(); + init_nativeXRFrame(); +}); + +// node_modules/@babylonjs/core/XR/index.js +var init_XR = __esm(() => { + init_webXRCamera(); + init_webXREnterExitUI(); + init_webXRExperienceHelper(); + init_webXRInput(); + init_webXRInputSource(); + init_webXRManagedOutputCanvas(); + init_webXRTypes(); + init_webXRSessionManager(); + init_webXRDefaultExperience(); + init_webXRFeaturesManager(); + init_features(); + init_motionController(); + init_native(); +}); + +// node_modules/@babylonjs/core/types.js +var init_types = __esm(() => { +}); + +// node_modules/@babylonjs/core/Compat/index.js +var init_Compat = __esm(() => { + init_compatibilityOptions(); +}); +// node_modules/@babylonjs/core/FlowGraph/flowGraphConnection.js class FlowGraphConnection { - constructor(name265, _connectionType, _ownerBlock) { + constructor(name266, _connectionType, _ownerBlock) { this._ownerBlock = _ownerBlock; this._connectedPoint = []; this.uniqueId = RandomGUID(); this.connectedPointIds = []; - this.name = name265; + this.name = name266; this._connectionType = _connectionType; } get connectionType() { @@ -170836,6 +193863,15 @@ class FlowGraphConnection { return connection; } } +var FlowGraphConnectionType; +var init_flowGraphConnection = __esm(() => { + init_tools(); + init_guid(); + (function(FlowGraphConnectionType2) { + FlowGraphConnectionType2[FlowGraphConnectionType2["Input"] = 0] = "Input"; + FlowGraphConnectionType2[FlowGraphConnectionType2["Output"] = 1] = "Output"; + })(FlowGraphConnectionType || (FlowGraphConnectionType = {})); +}); // node_modules/@babylonjs/core/FlowGraph/flowGraphRichTypes.js function getRichTypeFromValue(value) { @@ -170880,22 +193916,27 @@ class RichType { return new RichType(serializationObject.typeName, serializationObject.defaultValue); } } -var RichTypeAny = new RichType("any", undefined); -var RichTypeString = new RichType("string", ""); -var RichTypeNumber = new RichType("number", 0); -var RichTypeBoolean = new RichType("boolean", false); -var RichTypeVector2 = new RichType("Vector2", Vector2.Zero()); -var RichTypeVector3 = new RichType("Vector3", Vector3.Zero()); -var RichTypeVector4 = new RichType("Vector4", Vector4.Zero()); -var RichTypeMatrix = new RichType("Matrix", Matrix.Identity()); -var RichTypeColor3 = new RichType("Color3", Color3.Black()); -var RichTypeColor4 = new RichType("Color4", new Color4(0, 0, 0, 0)); -var RichTypeQuaternion = new RichType("Quaternion", Quaternion.Identity()); +var RichTypeAny, RichTypeString, RichTypeNumber, RichTypeBoolean, RichTypeVector2, RichTypeVector3, RichTypeVector4, RichTypeMatrix, RichTypeColor3, RichTypeColor4, RichTypeQuaternion; +var init_flowGraphRichTypes = __esm(() => { + init_math_vector(); + init_math_color(); + RichTypeAny = new RichType("any", undefined); + RichTypeString = new RichType("string", ""); + RichTypeNumber = new RichType("number", 0); + RichTypeBoolean = new RichType("boolean", false); + RichTypeVector2 = new RichType("Vector2", Vector2.Zero()); + RichTypeVector3 = new RichType("Vector3", Vector3.Zero()); + RichTypeVector4 = new RichType("Vector4", Vector4.Zero()); + RichTypeMatrix = new RichType("Matrix", Matrix.Identity()); + RichTypeColor3 = new RichType("Color3", Color3.Black()); + RichTypeColor4 = new RichType("Color4", new Color4(0, 0, 0, 0)); + RichTypeQuaternion = new RichType("Quaternion", Quaternion.Identity()); +}); // node_modules/@babylonjs/core/FlowGraph/flowGraphDataConnection.js class FlowGraphDataConnection extends FlowGraphConnection { - constructor(name265, connectionType, ownerBlock, richType) { - super(name265, connectionType, ownerBlock); + constructor(name266, connectionType, ownerBlock, richType) { + super(name266, connectionType, ownerBlock); this.richType = richType; } _isSingularConnection() { @@ -170940,11 +193981,14 @@ class FlowGraphDataConnection extends FlowGraphConnection { return obj; } } -RegisterClass("FGDataConnection", FlowGraphDataConnection); +var init_flowGraphDataConnection = __esm(() => { + init_typeStore(); + init_flowGraphConnection(); + init_flowGraphRichTypes(); + RegisterClass("FGDataConnection", FlowGraphDataConnection); +}); // node_modules/@babylonjs/core/FlowGraph/flowGraphPath.js -var PATH_REGEX = /([./])({?\w+}?)/g; - class FlowGraphPath { constructor(path) { this._templateSubstitutions = {}; @@ -171068,46 +194112,28 @@ class FlowGraphPath { return new FlowGraphPath(serializationObject.path); } } -FlowGraphPath.Extensions = []; -FlowGraphPath.ClassName = "FGPath"; -RegisterClass(FlowGraphPath.ClassName, FlowGraphPath); +var PATH_REGEX; +var init_flowGraphPath = __esm(() => { + init_typeStore(); + PATH_REGEX = /([./])({?\w+}?)/g; + FlowGraphPath.Extensions = []; + FlowGraphPath.ClassName = "FGPath"; + RegisterClass(FlowGraphPath.ClassName, FlowGraphPath); +}); // node_modules/@babylonjs/core/FlowGraph/serialization.js -var isMeshClassName = function(className) { - return className === "Mesh" || className === "AbstractMesh" || className === "GroundMesh" || className === "InstanceMesh" || className === "LinesMesh" || className === "GoldbergMesh" || className === "GreasedLineMesh" || className === "TrailMesh"; -}; -var isVectorClassName = function(className) { - return className === "Vector2" || className === "Vector3" || className === "Vector4" || className === "Quaternion" || className === "Color3" || className === "Color4"; -}; -var parseVector = function(className, value) { - if (className === "Vector2") { - return Vector2.FromArray(value); - } else if (className === "Vector3") { - return Vector3.FromArray(value); - } else if (className === "Vector4") { - return Vector4.FromArray(value); - } else if (className === "Quaternion") { - return Quaternion.FromArray(value); - } else if (className === "Color3") { - return new Color3(value[0], value[1], value[2]); - } else if (className === "Color4") { - return new Color4(value[0], value[1], value[2], value[3]); - } else { - throw new Error(`Unknown vector class name ${className}`); - } -}; function defaultValueSerializationFunction(key, value, serializationObject) { var _a, _b; - const className = (_b = (_a = value === null || value === undefined ? undefined : value.getClassName) === null || _a === undefined ? undefined : _a.call(value)) !== null && _b !== undefined ? _b : ""; - if (isMeshClassName(className)) { + const className2 = (_b = (_a = value === null || value === undefined ? undefined : value.getClassName) === null || _a === undefined ? undefined : _a.call(value)) !== null && _b !== undefined ? _b : ""; + if (isMeshClassName(className2)) { serializationObject[key] = { name: value.name, - className + className: className2 }; - } else if (isVectorClassName(className)) { + } else if (isVectorClassName(className2)) { serializationObject[key] = { value: value.asArray(), - className + className: className2 }; } else { serializationObject[key] = value; @@ -171116,12 +194142,12 @@ function defaultValueSerializationFunction(key, value, serializationObject) { function defaultValueParseFunction(key, serializationObject, scene35) { const intermediateValue = serializationObject[key]; let finalValue; - const className = intermediateValue === null || intermediateValue === undefined ? undefined : intermediateValue.className; - if (isMeshClassName(className)) { + const className2 = intermediateValue === null || intermediateValue === undefined ? undefined : intermediateValue.className; + if (isMeshClassName(className2)) { finalValue = scene35.getMeshByName(intermediateValue.name); - } else if (isVectorClassName(className)) { - finalValue = parseVector(className, intermediateValue.value); - } else if (className === FlowGraphPath.ClassName) { + } else if (isVectorClassName(className2)) { + finalValue = parseVector(className2, intermediateValue.value); + } else if (className2 === FlowGraphPath.ClassName) { finalValue = FlowGraphPath.Parse(intermediateValue); } else if (intermediateValue && intermediateValue.value !== undefined) { finalValue = intermediateValue.value; @@ -171130,6 +194156,35 @@ function defaultValueParseFunction(key, serializationObject, scene35) { } return finalValue; } +var isMeshClassName, isVectorClassName, parseVector; +var init_serialization = __esm(() => { + init_math_color(); + init_math_vector(); + init_flowGraphPath(); + isMeshClassName = function(className2) { + return className2 === "Mesh" || className2 === "AbstractMesh" || className2 === "GroundMesh" || className2 === "InstanceMesh" || className2 === "LinesMesh" || className2 === "GoldbergMesh" || className2 === "GreasedLineMesh" || className2 === "TrailMesh"; + }; + isVectorClassName = function(className2) { + return className2 === "Vector2" || className2 === "Vector3" || className2 === "Vector4" || className2 === "Quaternion" || className2 === "Color3" || className2 === "Color4"; + }; + parseVector = function(className2, value) { + if (className2 === "Vector2") { + return Vector2.FromArray(value); + } else if (className2 === "Vector3") { + return Vector3.FromArray(value); + } else if (className2 === "Vector4") { + return Vector4.FromArray(value); + } else if (className2 === "Quaternion") { + return Quaternion.FromArray(value); + } else if (className2 === "Color3") { + return new Color3(value[0], value[1], value[2]); + } else if (className2 === "Color4") { + return new Color4(value[0], value[1], value[2], value[3]); + } else { + throw new Error(`Unknown vector class name ${className2}`); + } + }; +}); // node_modules/@babylonjs/core/FlowGraph/flowGraphBlock.js class FlowGraphBlock { @@ -171146,21 +194201,21 @@ class FlowGraphBlock { } _updateOutputs(_context) { } - registerDataInput(name265, className) { - const input = new FlowGraphDataConnection(name265, FlowGraphConnectionType.Input, this, className); + registerDataInput(name266, className2) { + const input = new FlowGraphDataConnection(name266, FlowGraphConnectionType.Input, this, className2); this.dataInputs.push(input); return input; } - registerDataOutput(name265, className) { - const output = new FlowGraphDataConnection(name265, FlowGraphConnectionType.Output, this, className); + registerDataOutput(name266, className2) { + const output = new FlowGraphDataConnection(name266, FlowGraphConnectionType.Output, this, className2); this.dataOutputs.push(output); return output; } - getDataInput(name265) { - return this.dataInputs.find((i) => i.name === name265); + getDataInput(name266) { + return this.dataInputs.find((i) => i.name === name266); } - getDataOutput(name265) { - return this.dataOutputs.find((i) => i.name === name265); + getDataOutput(name266) { + return this.dataOutputs.find((i) => i.name === name266); } serialize(serializationObject = {}, _valueSerializeFunction = defaultValueSerializationFunction) { serializationObject.uniqueId = this.uniqueId; @@ -171216,6 +194271,13 @@ class FlowGraphBlock { return obj; } } +var init_flowGraphBlock = __esm(() => { + init_guid(); + init_flowGraphConnection(); + init_flowGraphDataConnection(); + init_tools(); + init_serialization(); +}); // node_modules/@babylonjs/core/FlowGraph/flowGraphSignalConnection.js class FlowGraphSignalConnection extends FlowGraphConnection { @@ -171233,7 +194295,11 @@ class FlowGraphSignalConnection extends FlowGraphConnection { } } } -RegisterClass("FlowGraphSignalConnection", FlowGraphSignalConnection); +var init_flowGraphSignalConnection = __esm(() => { + init_flowGraphConnection(); + init_typeStore(); + RegisterClass("FlowGraphSignalConnection", FlowGraphSignalConnection); +}); // node_modules/@babylonjs/core/FlowGraph/flowGraphExecutionBlock.js class FlowGraphExecutionBlock extends FlowGraphBlock { @@ -171246,21 +194312,21 @@ class FlowGraphExecutionBlock extends FlowGraphBlock { this.signalInputs = []; this.signalOutputs = []; } - _registerSignalInput(name265) { - const input = new FlowGraphSignalConnection(name265, FlowGraphConnectionType.Input, this); + _registerSignalInput(name266) { + const input = new FlowGraphSignalConnection(name266, FlowGraphConnectionType.Input, this); this.signalInputs.push(input); return input; } - _registerSignalOutput(name265) { - const output = new FlowGraphSignalConnection(name265, FlowGraphConnectionType.Output, this); + _registerSignalOutput(name266) { + const output = new FlowGraphSignalConnection(name266, FlowGraphConnectionType.Output, this); this.signalOutputs.push(output); return output; } - getSignalInput(name265) { - return this.signalInputs.find((input) => input.name === name265); + getSignalInput(name266) { + return this.signalInputs.find((input) => input.name === name266); } - getSignalOutput(name265) { - return this.signalOutputs.find((output) => output.name === name265); + getSignalOutput(name266) { + return this.signalOutputs.find((output) => output.name === name266); } serialize(serializationObject = {}) { super.serialize(serializationObject); @@ -171299,6 +194365,11 @@ class FlowGraphExecutionBlock extends FlowGraphBlock { return "FGExecutionBlock"; } } +var init_flowGraphExecutionBlock = __esm(() => { + init_flowGraphBlock(); + init_flowGraphConnection(); + init_flowGraphSignalConnection(); +}); // node_modules/@babylonjs/core/FlowGraph/flowGraphAsyncExecutionBlock.js class FlowGraphAsyncExecutionBlock extends FlowGraphExecutionBlock { @@ -171312,6 +194383,9 @@ class FlowGraphAsyncExecutionBlock extends FlowGraphExecutionBlock { context._addPendingBlock(this); } } +var init_flowGraphAsyncExecutionBlock = __esm(() => { + init_flowGraphExecutionBlock(); +}); // node_modules/@babylonjs/core/FlowGraph/flowGraphEventBlock.js class FlowGraphEventBlock extends FlowGraphAsyncExecutionBlock { @@ -171320,6 +194394,9 @@ class FlowGraphEventBlock extends FlowGraphAsyncExecutionBlock { this.out._activateSignal(context); } } +var init_flowGraphEventBlock = __esm(() => { + init_flowGraphAsyncExecutionBlock(); +}); // node_modules/@babylonjs/core/FlowGraph/flowGraphContext.js class FlowGraphContext { @@ -171333,36 +194410,36 @@ class FlowGraphContext { this.onNodeExecutedObservable = new Observable; this._configuration = params; } - hasVariable(name265) { - return name265 in this._userVariables; + hasVariable(name266) { + return name266 in this._userVariables; } - setVariable(name265, value) { - this._userVariables[name265] = value; + setVariable(name266, value) { + this._userVariables[name266] = value; } - getVariable(name265) { - return this._userVariables[name265]; + getVariable(name266) { + return this._userVariables[name266]; } get userVariables() { return this._userVariables; } - _getUniqueIdPrefixedName(obj, name265) { - return `${obj.uniqueId}_${name265}`; + _getUniqueIdPrefixedName(obj, name266) { + return `${obj.uniqueId}_${name266}`; } - _setExecutionVariable(block, name265, value) { - this._executionVariables[this._getUniqueIdPrefixedName(block, name265)] = value; + _setExecutionVariable(block, name266, value) { + this._executionVariables[this._getUniqueIdPrefixedName(block, name266)] = value; } - _getExecutionVariable(block, name265, defaultValue) { - if (this._hasExecutionVariable(block, name265)) { - return this._executionVariables[this._getUniqueIdPrefixedName(block, name265)]; + _getExecutionVariable(block, name266, defaultValue) { + if (this._hasExecutionVariable(block, name266)) { + return this._executionVariables[this._getUniqueIdPrefixedName(block, name266)]; } else { return defaultValue; } } - _deleteExecutionVariable(block, name265) { - delete this._executionVariables[this._getUniqueIdPrefixedName(block, name265)]; + _deleteExecutionVariable(block, name266) { + delete this._executionVariables[this._getUniqueIdPrefixedName(block, name266)]; } - _hasExecutionVariable(block, name265) { - return this._getUniqueIdPrefixedName(block, name265) in this._executionVariables; + _hasExecutionVariable(block, name266) { + return this._getUniqueIdPrefixedName(block, name266) in this._executionVariables; } _hasConnectionValue(connectionPoint) { return connectionPoint.uniqueId in this._connectionValues; @@ -171428,14 +194505,23 @@ class FlowGraphContext { return result; } } -__decorate2([ - serialize() -], FlowGraphContext.prototype, "uniqueId", undefined); +var init_flowGraphContext = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_guid(); + init_serialization(); + init_observable(); + __decorate2([ + serialize() + ], FlowGraphContext.prototype, "uniqueId", undefined); +}); // node_modules/@babylonjs/core/FlowGraph/utils.js function _isADescendantOf(mesh1, mesh210) { return !!(mesh1.parent && (mesh1.parent === mesh210 || _isADescendantOf(mesh1.parent, mesh210))); } +var init_utils = __esm(() => { +}); // node_modules/@babylonjs/core/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock { @@ -171490,16 +194576,18 @@ class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock { serializationObject.config.path = this.config.path.serialize(); } } -FlowGraphMeshPickEventBlock.ClassName = "FGMeshPickEventBlock"; -RegisterClass(FlowGraphMeshPickEventBlock.ClassName, FlowGraphMeshPickEventBlock); +var init_flowGraphMeshPickEventBlock = __esm(() => { + init_abstractMesh(); + init_flowGraphEventBlock(); + init_pointerEvents(); + init_typeStore(); + init_tools(); + init_utils(); + FlowGraphMeshPickEventBlock.ClassName = "FGMeshPickEventBlock"; + RegisterClass(FlowGraphMeshPickEventBlock.ClassName, FlowGraphMeshPickEventBlock); +}); // node_modules/@babylonjs/core/FlowGraph/flowGraph.js -var FlowGraphState; -(function(FlowGraphState2) { - FlowGraphState2[FlowGraphState2["Stopped"] = 0] = "Stopped"; - FlowGraphState2[FlowGraphState2["Started"] = 1] = "Started"; -})(FlowGraphState || (FlowGraphState = {})); - class FlowGraph { constructor(params) { this._eventBlocks = []; @@ -171666,7 +194754,24 @@ class FlowGraph { return graph; } } +var FlowGraphState; +var init_flowGraph = __esm(() => { + init_flowGraphEventBlock(); + init_flowGraphContext(); + init_flowGraphBlock(); + init_flowGraphExecutionBlock(); + init_flowGraphMeshPickEventBlock(); + init_utils(); + (function(FlowGraphState2) { + FlowGraphState2[FlowGraphState2["Stopped"] = 0] = "Stopped"; + FlowGraphState2[FlowGraphState2["Started"] = 1] = "Started"; + })(FlowGraphState || (FlowGraphState = {})); +}); + // node_modules/@babylonjs/core/FlowGraph/flowGraphCoordinator.js +class IFlowGraphCoordinatorConfiguration { +} + class FlowGraphCoordinator { constructor(config) { var _a; @@ -171738,7 +194843,29 @@ class FlowGraphCoordinator { } } } -FlowGraphCoordinator.SceneCoordinators = new Map; +var init_flowGraphCoordinator = __esm(() => { + init_observable(); + init_flowGraph(); + FlowGraphCoordinator.SceneCoordinators = new Map; +}); + +// node_modules/@babylonjs/core/FlowGraph/typeDefinitions.js +var init_typeDefinitions = __esm(() => { +}); + +// node_modules/@babylonjs/core/FlowGraph/flowGraphContextLogger.js +class FlowGraphContextLogger { + constructor(_context) { + this._context = _context; + this._context.onNodeExecutedObservable.add((node29) => { + Tools.Log(`Node executed: ${node29.getClassName()}`); + }); + } +} +var init_flowGraphContextLogger = __esm(() => { + init_tools(); +}); + // node_modules/@babylonjs/core/FlowGraph/flowGraphWithOnDoneExecutionBlock.js class FlowGraphExecutionBlockWithOutSignal extends FlowGraphExecutionBlock { constructor(config) { @@ -171746,6 +194873,9 @@ class FlowGraphExecutionBlockWithOutSignal extends FlowGraphExecutionBlock { this.out = this._registerSignalOutput("out"); } } +var init_flowGraphWithOnDoneExecutionBlock = __esm(() => { + init_flowGraphExecutionBlock(); +}); // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWithOutSignal { @@ -171762,8 +194892,14 @@ class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWithOutSignal { return FlowGraphConsoleLogBlock.ClassName; } } -FlowGraphConsoleLogBlock.ClassName = "FGConsoleLogBlock"; -RegisterClass(FlowGraphConsoleLogBlock.ClassName, FlowGraphConsoleLogBlock); +var init_flowGraphConsoleLogBlock = __esm(() => { + init_flowGraphWithOnDoneExecutionBlock(); + init_flowGraphRichTypes(); + init_typeStore(); + FlowGraphConsoleLogBlock.ClassName = "FGConsoleLogBlock"; + RegisterClass(FlowGraphConsoleLogBlock.ClassName, FlowGraphConsoleLogBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js class FlowGraphSetVariableBlock extends FlowGraphExecutionBlockWithOutSignal { constructor(config) { @@ -171781,8 +194917,14 @@ class FlowGraphSetVariableBlock extends FlowGraphExecutionBlockWithOutSignal { return FlowGraphSetVariableBlock.ClassName; } } -FlowGraphSetVariableBlock.ClassName = "FGSetVariableBlock"; -RegisterClass(FlowGraphSetVariableBlock.ClassName, FlowGraphSetVariableBlock); +var init_flowGraphSetVariableBlock = __esm(() => { + init_flowGraphRichTypes(); + init_flowGraphWithOnDoneExecutionBlock(); + init_typeStore(); + FlowGraphSetVariableBlock.ClassName = "FGSetVariableBlock"; + RegisterClass(FlowGraphSetVariableBlock.ClassName, FlowGraphSetVariableBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/flowGraphPathComponent.js class FlowGraphPathComponent { constructor(path, ownerBlock) { @@ -171810,6 +194952,9 @@ class FlowGraphPathComponent { this.path.setProperty(context, value); } } +var init_flowGraphPathComponent = __esm(() => { + init_flowGraphRichTypes(); +}); // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js class FlowGraphSetPropertyBlock extends FlowGraphExecutionBlockWithOutSignal { @@ -171832,8 +194977,15 @@ class FlowGraphSetPropertyBlock extends FlowGraphExecutionBlockWithOutSignal { return FlowGraphSetPropertyBlock.ClassName; } } -FlowGraphSetPropertyBlock.ClassName = "FGSetPropertyBlock"; -RegisterClass("FGSetPropertyBlock", FlowGraphSetPropertyBlock); +var init_flowGraphSetPropertyBlock = __esm(() => { + init_flowGraphRichTypes(); + init_flowGraphWithOnDoneExecutionBlock(); + init_typeStore(); + init_flowGraphPathComponent(); + FlowGraphSetPropertyBlock.ClassName = "FGSetPropertyBlock"; + RegisterClass("FGSetPropertyBlock", FlowGraphSetPropertyBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js class FlowGraphSendCustomEventBlock extends FlowGraphExecutionBlockWithOutSignal { constructor(config) { @@ -171857,8 +195009,14 @@ class FlowGraphSendCustomEventBlock extends FlowGraphExecutionBlockWithOutSignal return FlowGraphSendCustomEventBlock.ClassName; } } -FlowGraphSendCustomEventBlock.ClassName = "FGSendCustomEventBlock"; -RegisterClass("FGSendCustomEventBlock", FlowGraphSendCustomEventBlock); +var init_flowGraphSendCustomEventBlock = __esm(() => { + init_flowGraphRichTypes(); + init_flowGraphWithOnDoneExecutionBlock(); + init_typeStore(); + FlowGraphSendCustomEventBlock.ClassName = "FGSendCustomEventBlock"; + RegisterClass("FGSendCustomEventBlock", FlowGraphSendCustomEventBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js class FlowGraphBranchBlock extends FlowGraphExecutionBlock { constructor(config) { @@ -171878,7 +195036,13 @@ class FlowGraphBranchBlock extends FlowGraphExecutionBlock { return "FGBranchBlock"; } } -RegisterClass("FGBranchBlock", FlowGraphBranchBlock); +var init_flowGraphBranchBlock = __esm(() => { + init_flowGraphRichTypes(); + init_flowGraphExecutionBlock(); + init_typeStore(); + RegisterClass("FGBranchBlock", FlowGraphBranchBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js class FlowGraphDoNBlock extends FlowGraphExecutionBlockWithOutSignal { constructor(config = { startIndex: 0 }) { @@ -171903,8 +195067,14 @@ class FlowGraphDoNBlock extends FlowGraphExecutionBlockWithOutSignal { return FlowGraphDoNBlock.ClassName; } } -FlowGraphDoNBlock.ClassName = "FGDoNBlock"; -RegisterClass(FlowGraphDoNBlock.ClassName, FlowGraphDoNBlock); +var init_flowGraphDoNBlock = __esm(() => { + init_flowGraphRichTypes(); + init_flowGraphWithOnDoneExecutionBlock(); + init_typeStore(); + FlowGraphDoNBlock.ClassName = "FGDoNBlock"; + RegisterClass(FlowGraphDoNBlock.ClassName, FlowGraphDoNBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js class FlowGraphForLoopBlock extends FlowGraphExecutionBlockWithOutSignal { constructor(config) { @@ -171942,7 +195112,13 @@ class FlowGraphForLoopBlock extends FlowGraphExecutionBlockWithOutSignal { return "FGForLoopBlock"; } } -RegisterClass("FGForLoopBlock", FlowGraphForLoopBlock); +var init_flowGraphForLoopBlock = __esm(() => { + init_flowGraphWithOnDoneExecutionBlock(); + init_flowGraphRichTypes(); + init_typeStore(); + RegisterClass("FGForLoopBlock", FlowGraphForLoopBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js class FlowGraphThrottleBlock extends FlowGraphExecutionBlockWithOutSignal { constructor(config) { @@ -171968,7 +195144,13 @@ class FlowGraphThrottleBlock extends FlowGraphExecutionBlockWithOutSignal { return "FGThrottleBlock"; } } -RegisterClass("FGThrottleBlock", FlowGraphThrottleBlock); +var init_flowGraphThrottleBlock = __esm(() => { + init_flowGraphRichTypes(); + init_flowGraphWithOnDoneExecutionBlock(); + init_typeStore(); + RegisterClass("FGThrottleBlock", FlowGraphThrottleBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock { constructor(config) { @@ -172016,8 +195198,16 @@ class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock { return FlowGraphTimerBlock.ClassName; } } -FlowGraphTimerBlock.ClassName = "FGTimerBlock"; -RegisterClass("FGTimerBlock", FlowGraphTimerBlock); +var init_flowGraphTimerBlock = __esm(() => { + init_timer(); + init_flowGraphAsyncExecutionBlock(); + init_flowGraphRichTypes(); + init_tools(); + init_typeStore(); + FlowGraphTimerBlock.ClassName = "FGTimerBlock"; + RegisterClass("FGTimerBlock", FlowGraphTimerBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock { constructor(config) { @@ -172096,7 +195286,13 @@ class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock { serializationObject.config.startIndex = this.config.startIndex; } } -RegisterClass("FGMultiGateBlock", FlowGraphMultiGateBlock); +var init_flowGraphMultiGateBlock = __esm(() => { + init_typeStore(); + init_flowGraphExecutionBlock(); + init_flowGraphRichTypes(); + RegisterClass("FGMultiGateBlock", FlowGraphMultiGateBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js class FlowGraphSwitchBlock extends FlowGraphExecutionBlock { constructor(config) { @@ -172129,7 +195325,13 @@ class FlowGraphSwitchBlock extends FlowGraphExecutionBlock { serializationObject.cases = this.config.cases; } } -RegisterClass("FGSwitchBlock", FlowGraphSwitchBlock); +var init_flowGraphSwitchBlock = __esm(() => { + init_flowGraphExecutionBlock(); + init_flowGraphRichTypes(); + init_typeStore(); + RegisterClass("FGSwitchBlock", FlowGraphSwitchBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js class FlowGraphWaitAllBlock extends FlowGraphExecutionBlockWithOutSignal { constructor(config) { @@ -172189,7 +195391,12 @@ class FlowGraphWaitAllBlock extends FlowGraphExecutionBlockWithOutSignal { serializationObject.config.numberInputFlows = this.config.numberInputFlows; } } -RegisterClass("FGWaitAllBlock", FlowGraphWaitAllBlock); +var init_flowGraphWaitAllBlock = __esm(() => { + init_flowGraphWithOnDoneExecutionBlock(); + init_typeStore(); + RegisterClass("FGWaitAllBlock", FlowGraphWaitAllBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js class FlowGraphCounterBlock extends FlowGraphExecutionBlockWithOutSignal { constructor(config) { @@ -172213,7 +195420,13 @@ class FlowGraphCounterBlock extends FlowGraphExecutionBlockWithOutSignal { return "FGCounterBlock"; } } -RegisterClass("FGCounterBlock", FlowGraphCounterBlock); +var init_flowGraphCounterBlock = __esm(() => { + init_flowGraphRichTypes(); + init_flowGraphWithOnDoneExecutionBlock(); + init_typeStore(); + RegisterClass("FGCounterBlock", FlowGraphCounterBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js class FlowGraphWhileLoopBlock extends FlowGraphExecutionBlockWithOutSignal { constructor(config) { @@ -172243,8 +195456,14 @@ class FlowGraphWhileLoopBlock extends FlowGraphExecutionBlockWithOutSignal { serializationObject.isDo = (_a = this.config) === null || _a === undefined ? undefined : _a.isDo; } } -FlowGraphWhileLoopBlock.ClassName = "FGWhileLoopBlock"; -RegisterClass(FlowGraphWhileLoopBlock.ClassName, FlowGraphWhileLoopBlock); +var init_flowGraphWhileLoopBlock = __esm(() => { + init_flowGraphRichTypes(); + init_typeStore(); + init_flowGraphWithOnDoneExecutionBlock(); + FlowGraphWhileLoopBlock.ClassName = "FGWhileLoopBlock"; + RegisterClass(FlowGraphWhileLoopBlock.ClassName, FlowGraphWhileLoopBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js class FlowGraphDebounceBlock extends FlowGraphExecutionBlockWithOutSignal { constructor(config) { @@ -172272,7 +195491,13 @@ class FlowGraphDebounceBlock extends FlowGraphExecutionBlockWithOutSignal { return "FGDebounceBlock"; } } -RegisterClass("FGDebounceBlock", FlowGraphDebounceBlock); +var init_flowGraphDebounceBlock = __esm(() => { + init_flowGraphRichTypes(); + init_flowGraphWithOnDoneExecutionBlock(); + init_typeStore(); + RegisterClass("FGDebounceBlock", FlowGraphDebounceBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js class FlowGraphFlipFlopBlock extends FlowGraphExecutionBlock { constructor(config) { @@ -172296,7 +195521,13 @@ class FlowGraphFlipFlopBlock extends FlowGraphExecutionBlock { return "FGFlipFlopBlock"; } } -RegisterClass("FGFlipFlopBlock", FlowGraphFlipFlopBlock); +var init_flowGraphFlipFlopBlock = __esm(() => { + init_flowGraphExecutionBlock(); + init_flowGraphRichTypes(); + init_typeStore(); + RegisterClass("FGFlipFlopBlock", FlowGraphFlipFlopBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js class FlowGraphSequenceBlock extends FlowGraphExecutionBlock { constructor(config) { @@ -172319,8 +195550,30 @@ class FlowGraphSequenceBlock extends FlowGraphExecutionBlock { return FlowGraphSequenceBlock.ClassName; } } -FlowGraphSequenceBlock.ClassName = "FGSequenceBlock"; -RegisterClass(FlowGraphSequenceBlock.ClassName, FlowGraphSequenceBlock); +var init_flowGraphSequenceBlock = __esm(() => { + init_typeStore(); + init_flowGraphExecutionBlock(); + FlowGraphSequenceBlock.ClassName = "FGSequenceBlock"; + RegisterClass(FlowGraphSequenceBlock.ClassName, FlowGraphSequenceBlock); +}); + +// node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/ControlFlow/index.js +var init_ControlFlow = __esm(() => { + init_flowGraphBranchBlock(); + init_flowGraphDoNBlock(); + init_flowGraphForLoopBlock(); + init_flowGraphThrottleBlock(); + init_flowGraphTimerBlock(); + init_flowGraphMultiGateBlock(); + init_flowGraphSwitchBlock(); + init_flowGraphWaitAllBlock(); + init_flowGraphCounterBlock(); + init_flowGraphWhileLoopBlock(); + init_flowGraphDebounceBlock(); + init_flowGraphFlipFlopBlock(); + init_flowGraphSequenceBlock(); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock { constructor(config) { @@ -172384,7 +195637,14 @@ class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock { serializationObject.config.animationPath = this.config.animationPath.serialize(); } } -RegisterClass("FGPlayAnimationBlock", FlowGraphPlayAnimationBlock); +var init_flowGraphPlayAnimationBlock = __esm(() => { + init_flowGraphAsyncExecutionBlock(); + init_flowGraphRichTypes(); + init_typeStore(); + init_flowGraphPathComponent(); + RegisterClass("FGPlayAnimationBlock", FlowGraphPlayAnimationBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js class FlowGraphStopAnimationBlock extends FlowGraphExecutionBlockWithOutSignal { constructor(config) { @@ -172400,7 +195660,13 @@ class FlowGraphStopAnimationBlock extends FlowGraphExecutionBlockWithOutSignal { return "FGStopAnimationBlock"; } } -RegisterClass("FGStopAnimationBlock", FlowGraphStopAnimationBlock); +var init_flowGraphStopAnimationBlock = __esm(() => { + init_flowGraphWithOnDoneExecutionBlock(); + init_flowGraphRichTypes(); + init_typeStore(); + RegisterClass("FGStopAnimationBlock", FlowGraphStopAnimationBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js class FlowGraphPauseAnimationBlock extends FlowGraphExecutionBlockWithOutSignal { constructor(config) { @@ -172416,7 +195682,30 @@ class FlowGraphPauseAnimationBlock extends FlowGraphExecutionBlockWithOutSignal return "FGPauseAnimationBlock"; } } -RegisterClass("FGPauseAnimationBlock", FlowGraphPauseAnimationBlock); +var init_flowGraphPauseAnimationBlock = __esm(() => { + init_flowGraphWithOnDoneExecutionBlock(); + init_flowGraphRichTypes(); + init_typeStore(); + RegisterClass("FGPauseAnimationBlock", FlowGraphPauseAnimationBlock); +}); + +// node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/Animation/index.js +var init_Animation = __esm(() => { + init_flowGraphPlayAnimationBlock(); + init_flowGraphStopAnimationBlock(); + init_flowGraphPauseAnimationBlock(); +}); + +// node_modules/@babylonjs/core/FlowGraph/Blocks/Execution/index.js +var init_Execution = __esm(() => { + init_flowGraphConsoleLogBlock(); + init_flowGraphSetVariableBlock(); + init_flowGraphSetPropertyBlock(); + init_flowGraphSendCustomEventBlock(); + init_ControlFlow(); + init_Animation(); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js class FlowGraphConditionalDataBlock extends FlowGraphBlock { constructor(config) { @@ -172433,7 +195722,13 @@ class FlowGraphConditionalDataBlock extends FlowGraphBlock { return "FGConditionalDataBlock"; } } -RegisterClass("FGConditionalDataBlock", FlowGraphConditionalDataBlock); +var init_flowGraphConditionalDataBlock = __esm(() => { + init_flowGraphBlock(); + init_flowGraphRichTypes(); + init_typeStore(); + RegisterClass("FGConditionalDataBlock", FlowGraphConditionalDataBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js class FlowGraphGetVariableBlock extends FlowGraphBlock { constructor(config) { @@ -172455,8 +195750,14 @@ class FlowGraphGetVariableBlock extends FlowGraphBlock { serializationObject.config.variableName = this.config.variableName; } } -FlowGraphGetVariableBlock.ClassName = "FGGetVariableBlock"; -RegisterClass(FlowGraphGetVariableBlock.ClassName, FlowGraphGetVariableBlock); +var init_flowGraphGetVariableBlock = __esm(() => { + init_flowGraphBlock(); + init_flowGraphRichTypes(); + init_typeStore(); + FlowGraphGetVariableBlock.ClassName = "FGGetVariableBlock"; + RegisterClass(FlowGraphGetVariableBlock.ClassName, FlowGraphGetVariableBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js class FlowGraphCoordinateTransformBlock extends FlowGraphBlock { constructor(config) { @@ -172483,7 +195784,14 @@ class FlowGraphCoordinateTransformBlock extends FlowGraphBlock { return "FGCoordinateTransformBlock"; } } -RegisterClass("FGCoordinateTransformBlock", FlowGraphCoordinateTransformBlock); +var init_flowGraphCoordinateTransformBlock = __esm(() => { + init_flowGraphBlock(); + init_flowGraphRichTypes(); + init_math_vector(); + init_typeStore(); + RegisterClass("FGCoordinateTransformBlock", FlowGraphCoordinateTransformBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphConstantBlock.js class FlowGraphConstantBlock extends FlowGraphBlock { constructor(config) { @@ -172502,7 +195810,14 @@ class FlowGraphConstantBlock extends FlowGraphBlock { valueSerializeFunction("value", this.config.value, serializationObject.config); } } -RegisterClass("FGConstantBlock", FlowGraphConstantBlock); +var init_flowGraphConstantBlock = __esm(() => { + init_flowGraphBlock(); + init_flowGraphRichTypes(); + init_typeStore(); + init_serialization(); + RegisterClass("FGConstantBlock", FlowGraphConstantBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js class FlowGraphGetPropertyBlock extends FlowGraphBlock { constructor(config) { @@ -172519,12 +195834,16 @@ class FlowGraphGetPropertyBlock extends FlowGraphBlock { return FlowGraphGetPropertyBlock.ClassName; } } -FlowGraphGetPropertyBlock.ClassName = "FGGetPropertyBlock"; -RegisterClass(FlowGraphGetPropertyBlock.ClassName, FlowGraphGetPropertyBlock); -// node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js -var CACHE_NAME = "cachedOperationValue"; -var CACHE_EXEC_ID_NAME = "cachedExecutionId"; +var init_flowGraphGetPropertyBlock = __esm(() => { + init_typeStore(); + init_flowGraphBlock(); + init_flowGraphRichTypes(); + init_flowGraphPathComponent(); + FlowGraphGetPropertyBlock.ClassName = "FGGetPropertyBlock"; + RegisterClass(FlowGraphGetPropertyBlock.ClassName, FlowGraphGetPropertyBlock); +}); +// node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js class FlowGraphCachedOperationBlock extends FlowGraphBlock { constructor(outputRichType, config) { super(config); @@ -172543,6 +195862,12 @@ class FlowGraphCachedOperationBlock extends FlowGraphBlock { } } } +var CACHE_NAME, CACHE_EXEC_ID_NAME; +var init_flowGraphCachedOperationBlock = __esm(() => { + init_flowGraphBlock(); + CACHE_NAME = "cachedOperationValue"; + CACHE_EXEC_ID_NAME = "cachedExecutionId"; +}); // node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js class FlowGraphBinaryOperationBlock extends FlowGraphCachedOperationBlock { @@ -172560,6 +195885,9 @@ class FlowGraphBinaryOperationBlock extends FlowGraphCachedOperationBlock { return this._className; } } +var init_flowGraphBinaryOperationBlock = __esm(() => { + init_flowGraphCachedOperationBlock(); +}); // node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js class FlowGraphUnaryOperationBlock extends FlowGraphCachedOperationBlock { @@ -172576,66 +195904,52 @@ class FlowGraphUnaryOperationBlock extends FlowGraphCachedOperationBlock { return this._className; } } +var init_flowGraphUnaryOperationBlock = __esm(() => { + init_flowGraphCachedOperationBlock(); +}); // node_modules/@babylonjs/core/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.js -var PREFIX = "FGBitwise"; -var AND = "AndBlock"; -var OR = "OrBlock"; -var XOR = "XorBlock"; -var NOT = "NotBlock"; -var LSHIFT = "LeftShiftBlock"; -var RSHIFT = "RightShiftBlock"; -var CLZ = "CountLeadingZerosBlock"; -var CTZ = "CountTrailingZerosBlock"; - class FlowGraphBitwiseAndBlock extends FlowGraphBinaryOperationBlock { constructor(config) { super(RichTypeNumber, RichTypeNumber, RichTypeNumber, (left, right) => left & right, `${PREFIX}${AND}`, config); } } -RegisterClass(`${PREFIX}${AND}`, FlowGraphBitwiseAndBlock); class FlowGraphBitwiseOrBlock extends FlowGraphBinaryOperationBlock { constructor(config) { super(RichTypeNumber, RichTypeNumber, RichTypeNumber, (left, right) => left | right, `${PREFIX}${OR}`, config); } } -RegisterClass(`${PREFIX}${OR}`, FlowGraphBitwiseOrBlock); class FlowGraphBitwiseXorBlock extends FlowGraphBinaryOperationBlock { constructor(config) { super(RichTypeNumber, RichTypeNumber, RichTypeNumber, (left, right) => left ^ right, `${PREFIX}${XOR}`, config); } } -RegisterClass(`${PREFIX}${XOR}`, FlowGraphBitwiseXorBlock); class FlowGraphBitwiseNotBlock extends FlowGraphUnaryOperationBlock { constructor(config) { super(RichTypeNumber, RichTypeNumber, (value) => ~value, `${PREFIX}${NOT}`, config); } } -RegisterClass(`${PREFIX}${NOT}`, FlowGraphBitwiseNotBlock); class FlowGraphBitwiseLeftShiftBlock extends FlowGraphBinaryOperationBlock { constructor(config) { super(RichTypeNumber, RichTypeNumber, RichTypeNumber, (left, right) => left << right, `${PREFIX}${LSHIFT}`, config); } } -RegisterClass(`${PREFIX}${LSHIFT}`, FlowGraphBitwiseLeftShiftBlock); class FlowGraphBitwiseRightShiftBlock extends FlowGraphBinaryOperationBlock { constructor(config) { super(RichTypeNumber, RichTypeNumber, RichTypeNumber, (left, right) => left >> right, `${PREFIX}${RSHIFT}`, config); } } -RegisterClass(`${PREFIX}${RSHIFT}`, FlowGraphBitwiseRightShiftBlock); class FlowGraphCountLeadingZerosBlock extends FlowGraphUnaryOperationBlock { constructor(config) { super(RichTypeNumber, RichTypeNumber, (value) => Math.clz32(value), `${PREFIX}${CLZ}`, config); } } -RegisterClass(`${PREFIX}${CLZ}`, FlowGraphCountLeadingZerosBlock); class FlowGraphCountTrailingZerosBlock extends FlowGraphUnaryOperationBlock { _ctrz(integer) { @@ -172650,33 +195964,70 @@ class FlowGraphCountTrailingZerosBlock extends FlowGraphUnaryOperationBlock { super(RichTypeNumber, RichTypeNumber, (value) => this._ctrz(value), `${PREFIX}${CTZ}`, config); } } -RegisterClass(`${PREFIX}${CTZ}`, FlowGraphCountTrailingZerosBlock); -// node_modules/@babylonjs/core/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js -var PREFIX2 = "FGLogic"; -var AND2 = "AndBlock"; -var OR2 = "OrBlock"; -var NOT2 = "NotBlock"; +var PREFIX, AND, OR, XOR, NOT, LSHIFT, RSHIFT, CLZ, CTZ; +var init_flowGraphBitwiseBlocks = __esm(() => { + init_flowGraphRichTypes(); + init_flowGraphBinaryOperationBlock(); + init_flowGraphUnaryOperationBlock(); + init_typeStore(); + PREFIX = "FGBitwise"; + AND = "AndBlock"; + OR = "OrBlock"; + XOR = "XorBlock"; + NOT = "NotBlock"; + LSHIFT = "LeftShiftBlock"; + RSHIFT = "RightShiftBlock"; + CLZ = "CountLeadingZerosBlock"; + CTZ = "CountTrailingZerosBlock"; + RegisterClass(`${PREFIX}${AND}`, FlowGraphBitwiseAndBlock); + RegisterClass(`${PREFIX}${OR}`, FlowGraphBitwiseOrBlock); + RegisterClass(`${PREFIX}${XOR}`, FlowGraphBitwiseXorBlock); + RegisterClass(`${PREFIX}${NOT}`, FlowGraphBitwiseNotBlock); + RegisterClass(`${PREFIX}${LSHIFT}`, FlowGraphBitwiseLeftShiftBlock); + RegisterClass(`${PREFIX}${RSHIFT}`, FlowGraphBitwiseRightShiftBlock); + RegisterClass(`${PREFIX}${CLZ}`, FlowGraphCountLeadingZerosBlock); + RegisterClass(`${PREFIX}${CTZ}`, FlowGraphCountTrailingZerosBlock); +}); +// node_modules/@babylonjs/core/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js class FlowGraphLogicAndBlock extends FlowGraphBinaryOperationBlock { constructor(config) { super(RichTypeBoolean, RichTypeBoolean, RichTypeBoolean, (left, right) => left && right, `${PREFIX2}${AND2}`, config); } } -RegisterClass(`${PREFIX2}${AND2}`, FlowGraphLogicAndBlock); class FlowGraphLogicOrBlock extends FlowGraphBinaryOperationBlock { constructor(config) { super(RichTypeBoolean, RichTypeBoolean, RichTypeBoolean, (left, right) => left || right, `${PREFIX2}${OR2}`, config); } } -RegisterClass(`${PREFIX2}${OR2}`, FlowGraphLogicOrBlock); class FlowGraphLogicNotBlock extends FlowGraphUnaryOperationBlock { constructor(config) { super(RichTypeBoolean, RichTypeBoolean, (value) => !value, `${PREFIX2}${NOT2}`, config); } } -RegisterClass(`${PREFIX2}${NOT2}`, FlowGraphLogicNotBlock); +var PREFIX2, AND2, OR2, NOT2; +var init_flowGraphLogicBlocks = __esm(() => { + init_flowGraphRichTypes(); + init_flowGraphBinaryOperationBlock(); + init_flowGraphUnaryOperationBlock(); + init_typeStore(); + PREFIX2 = "FGLogic"; + AND2 = "AndBlock"; + OR2 = "OrBlock"; + NOT2 = "NotBlock"; + RegisterClass(`${PREFIX2}${AND2}`, FlowGraphLogicAndBlock); + RegisterClass(`${PREFIX2}${OR2}`, FlowGraphLogicOrBlock); + RegisterClass(`${PREFIX2}${NOT2}`, FlowGraphLogicNotBlock); +}); + +// node_modules/@babylonjs/core/FlowGraph/Blocks/Data/Logic/index.js +var init_Logic = __esm(() => { + init_flowGraphBitwiseBlocks(); + init_flowGraphLogicBlocks(); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js class FlowGraphConstantOperationBlock extends FlowGraphCachedOperationBlock { constructor(richType, _operation, _className, config) { @@ -172691,6 +196042,9 @@ class FlowGraphConstantOperationBlock extends FlowGraphCachedOperationBlock { return this._className; } } +var init_flowGraphConstantOperationBlock = __esm(() => { + init_flowGraphCachedOperationBlock(); +}); // node_modules/@babylonjs/core/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js class FlowGraphTernaryOperationBlock extends FlowGraphCachedOperationBlock { @@ -172709,60 +196063,11 @@ class FlowGraphTernaryOperationBlock extends FlowGraphCachedOperationBlock { return this._className; } } +var init_flowGraphTernaryOperationBlock = __esm(() => { + init_flowGraphCachedOperationBlock(); +}); // node_modules/@babylonjs/core/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js -var _getClassNameOf = function(v) { - if (v.getClassName) { - return v.getClassName(); - } - return ""; -}; -var _areSameVectorClass = function(className, className2) { - return className === "Vector2" && className2 === "Vector2" || className === "Vector3" && className2 === "Vector3" || className === "Vector4" && className2 === "Vector4"; -}; -var _componentWiseUnaryOperation = function(a, op) { - const aClassName = _getClassNameOf(a); - switch (aClassName) { - case "Vector2": - return new Vector2(op(a.x), op(a.y)); - case "Vector3": - return new Vector3(op(a.x), op(a.y), op(a.z)); - case "Vector4": - return new Vector4(op(a.x), op(a.y), op(a.z), op(a.w)); - default: - return op(a); - } -}; -var _componentWiseBinaryOperation = function(a, b, op) { - const aClassName = _getClassNameOf(a); - switch (aClassName) { - case "Vector2": - return new Vector2(op(a.x, b.x), op(a.y, b.y)); - case "Vector3": - return new Vector3(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z)); - case "Vector4": - return new Vector4(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z), op(a.w, b.w)); - default: - return op(a, b); - } -}; -var _clamp = function(a, b, c) { - return Math.min(Math.max(a, b), c); -}; -var _componentWiseTernaryOperation = function(a, b, c, op) { - const aClassName = _getClassNameOf(a); - switch (aClassName) { - case "Vector2": - return new Vector2(op(a.x, b.x, c.x), op(a.y, b.y, c.y)); - case "Vector3": - return new Vector3(op(a.x, b.x, c.x), op(a.y, b.y, c.y), op(a.z, b.z, c.z)); - case "Vector4": - return new Vector4(op(a.x, b.x, c.x), op(a.y, b.y, c.y), op(a.z, b.z, c.z), op(a.w, b.w, c.w)); - default: - return op(a, b, c); - } -}; - class FlowGraphAddBlock extends FlowGraphBinaryOperationBlock { constructor(config) { super(RichTypeAny, RichTypeAny, RichTypeAny, (a, b) => this._polymorphicAdd(a, b), FlowGraphAddBlock.ClassName, config); @@ -172780,8 +196085,6 @@ class FlowGraphAddBlock extends FlowGraphBinaryOperationBlock { return FlowGraphAddBlock.ClassName; } } -FlowGraphAddBlock.ClassName = "FGAddBlock"; -RegisterClass(FlowGraphAddBlock.ClassName, FlowGraphAddBlock); class FlowGraphSubtractBlock extends FlowGraphBinaryOperationBlock { constructor(config) { @@ -172800,8 +196103,6 @@ class FlowGraphSubtractBlock extends FlowGraphBinaryOperationBlock { return FlowGraphSubtractBlock.ClassName; } } -FlowGraphSubtractBlock.ClassName = "FGSubBlock"; -RegisterClass(FlowGraphSubtractBlock.ClassName, FlowGraphSubtractBlock); class FlowGraphMultiplyBlock extends FlowGraphBinaryOperationBlock { constructor(config) { @@ -172817,8 +196118,6 @@ class FlowGraphMultiplyBlock extends FlowGraphBinaryOperationBlock { } } } -FlowGraphMultiplyBlock.ClassName = "FGMultiplyBlock"; -RegisterClass(FlowGraphMultiplyBlock.ClassName, FlowGraphMultiplyBlock); class FlowGraphDivideBlock extends FlowGraphBinaryOperationBlock { constructor(config) { @@ -172834,24 +196133,20 @@ class FlowGraphDivideBlock extends FlowGraphBinaryOperationBlock { } } } -FlowGraphDivideBlock.ClassName = "FGDivideBlock"; -RegisterClass(FlowGraphDivideBlock.ClassName, FlowGraphDivideBlock); class FlowGraphRandomBlock extends FlowGraphConstantOperationBlock { constructor(config) { super(RichTypeNumber, () => Math.random(), FlowGraphRandomBlock.ClassName, config); } } -FlowGraphRandomBlock.ClassName = "FGRandomBlock"; -RegisterClass(FlowGraphRandomBlock.ClassName, FlowGraphRandomBlock); class FlowGraphDotBlock extends FlowGraphBinaryOperationBlock { constructor(config) { super(RichTypeAny, RichTypeAny, RichTypeNumber, (a, b) => this._polymorphicDot(a, b), FlowGraphDotBlock.ClassName, config); } _polymorphicDot(a, b) { - const className = _getClassNameOf(a); - switch (className) { + const className2 = _getClassNameOf(a); + switch (className2) { case "Vector2": return Vector2.Dot(a, b); case "Vector3": @@ -172863,40 +196158,30 @@ class FlowGraphDotBlock extends FlowGraphBinaryOperationBlock { } } } -FlowGraphDotBlock.ClassName = "FGDotBlock"; -RegisterClass(FlowGraphDotBlock.ClassName, FlowGraphDotBlock); class FlowGraphEBlock extends FlowGraphConstantOperationBlock { constructor(config) { super(RichTypeNumber, () => Math.E, FlowGraphEBlock.ClassName, config); } } -FlowGraphEBlock.ClassName = "FGEBlock"; -RegisterClass(FlowGraphEBlock.ClassName, FlowGraphEBlock); class FlowGraphPiBlock extends FlowGraphConstantOperationBlock { constructor(config) { super(RichTypeNumber, () => Math.PI, FlowGraphPiBlock.ClassName, config); } } -FlowGraphPiBlock.ClassName = "FGPIBlock"; -RegisterClass(FlowGraphPiBlock.ClassName, FlowGraphPiBlock); class FlowGraphInfBlock extends FlowGraphConstantOperationBlock { constructor(config) { super(RichTypeNumber, () => Number.POSITIVE_INFINITY, FlowGraphInfBlock.ClassName, config); } } -FlowGraphInfBlock.ClassName = "FGInfBlock"; -RegisterClass(FlowGraphInfBlock.ClassName, FlowGraphInfBlock); class FlowGraphNaNBlock extends FlowGraphConstantOperationBlock { constructor(config) { super(RichTypeNumber, () => Number.NaN, FlowGraphNaNBlock.ClassName, config); } } -FlowGraphNaNBlock.ClassName = "FGNaNBlock"; -RegisterClass(FlowGraphNaNBlock.ClassName, FlowGraphNaNBlock); class FlowGraphAbsBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -172906,8 +196191,6 @@ class FlowGraphAbsBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.abs); } } -FlowGraphAbsBlock.ClassName = "FGAbsBlock"; -RegisterClass(FlowGraphAbsBlock.ClassName, FlowGraphAbsBlock); class FlowGraphSignBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -172917,8 +196200,6 @@ class FlowGraphSignBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.sign); } } -FlowGraphSignBlock.ClassName = "FGSignBlock"; -RegisterClass(FlowGraphSignBlock.ClassName, FlowGraphSignBlock); class FlowGraphTruncBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -172928,8 +196209,6 @@ class FlowGraphTruncBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.trunc); } } -FlowGraphTruncBlock.ClassName = "FGTruncBlock"; -RegisterClass(FlowGraphTruncBlock.ClassName, FlowGraphTruncBlock); class FlowGraphFloorBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -172939,8 +196218,6 @@ class FlowGraphFloorBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.floor); } } -FlowGraphFloorBlock.ClassName = "FGFloorBlock"; -RegisterClass(FlowGraphFloorBlock.ClassName, FlowGraphFloorBlock); class FlowGraphCeilBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -172950,8 +196227,6 @@ class FlowGraphCeilBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.ceil); } } -FlowGraphCeilBlock.ClassName = "FGCeilBlock"; -RegisterClass(FlowGraphCeilBlock.ClassName, FlowGraphCeilBlock); class FlowGraphFractBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -172961,8 +196236,6 @@ class FlowGraphFractBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, (a2) => a2 - Math.floor(a2)); } } -FlowGraphFractBlock.ClassName = "FGFractBlock"; -RegisterClass(FlowGraphFractBlock.ClassName, FlowGraphFractBlock); class FlowGraphNegBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -172972,8 +196245,6 @@ class FlowGraphNegBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, (a2) => -a2); } } -FlowGraphNegBlock.ClassName = "FGNegBlock"; -RegisterClass(FlowGraphNegBlock.ClassName, FlowGraphNegBlock); class FlowGraphRemainderBlock extends FlowGraphBinaryOperationBlock { constructor(config) { @@ -172983,8 +196254,6 @@ class FlowGraphRemainderBlock extends FlowGraphBinaryOperationBlock { return _componentWiseBinaryOperation(a, b, (a2, b2) => a2 % b2); } } -FlowGraphRemainderBlock.ClassName = "FGRemainderBlock"; -RegisterClass(FlowGraphRemainderBlock.ClassName, FlowGraphRemainderBlock); class FlowGraphMinBlock extends FlowGraphBinaryOperationBlock { constructor(config) { @@ -172994,8 +196263,6 @@ class FlowGraphMinBlock extends FlowGraphBinaryOperationBlock { return _componentWiseBinaryOperation(a, b, Math.min); } } -FlowGraphMinBlock.ClassName = "FGMinBlock"; -RegisterClass(FlowGraphMinBlock.ClassName, FlowGraphMinBlock); class FlowGraphMaxBlock extends FlowGraphBinaryOperationBlock { constructor(config) { @@ -173005,8 +196272,6 @@ class FlowGraphMaxBlock extends FlowGraphBinaryOperationBlock { return _componentWiseBinaryOperation(a, b, Math.max); } } -FlowGraphMaxBlock.ClassName = "FGMaxBlock"; -RegisterClass(FlowGraphMaxBlock.ClassName, FlowGraphMaxBlock); class FlowGraphClampBlock extends FlowGraphTernaryOperationBlock { constructor(config) { @@ -173016,8 +196281,6 @@ class FlowGraphClampBlock extends FlowGraphTernaryOperationBlock { return _componentWiseTernaryOperation(a, b, c, _clamp); } } -FlowGraphClampBlock.ClassName = "FGClampBlock"; -RegisterClass(FlowGraphClampBlock.ClassName, FlowGraphClampBlock); class FlowGraphSaturateBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173027,8 +196290,6 @@ class FlowGraphSaturateBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, (a2) => _clamp(a2, 0, 1)); } } -FlowGraphSaturateBlock.ClassName = "FGSaturateBlock"; -RegisterClass(FlowGraphSaturateBlock.ClassName, FlowGraphSaturateBlock); class FlowGraphInterpolateBlock extends FlowGraphTernaryOperationBlock { constructor(config) { @@ -173041,8 +196302,6 @@ class FlowGraphInterpolateBlock extends FlowGraphTernaryOperationBlock { return _componentWiseTernaryOperation(a, b, c, this._interpolate); } } -FlowGraphInterpolateBlock.ClassName = "FGInterpolateBlock"; -RegisterClass(FlowGraphInterpolateBlock.ClassName, FlowGraphInterpolateBlock); class FlowGraphEqBlock extends FlowGraphBinaryOperationBlock { constructor(config) { @@ -173058,8 +196317,6 @@ class FlowGraphEqBlock extends FlowGraphBinaryOperationBlock { } } } -FlowGraphEqBlock.ClassName = "FGEqBlock"; -RegisterClass(FlowGraphEqBlock.ClassName, FlowGraphEqBlock); class FlowGraphLessThanBlock extends FlowGraphBinaryOperationBlock { constructor(config) { @@ -173079,8 +196336,6 @@ class FlowGraphLessThanBlock extends FlowGraphBinaryOperationBlock { } } } -FlowGraphLessThanBlock.ClassName = "FGLessThanBlock"; -RegisterClass(FlowGraphLessThanBlock.ClassName, FlowGraphLessThanBlock); class FlowGraphLessThanOrEqualBlock extends FlowGraphBinaryOperationBlock { constructor(config) { @@ -173100,7 +196355,6 @@ class FlowGraphLessThanOrEqualBlock extends FlowGraphBinaryOperationBlock { } } } -FlowGraphLessThanOrEqualBlock.ClassName = "FGLessThanOrEqualBlock"; class FlowGraphGreaterThanBlock extends FlowGraphBinaryOperationBlock { constructor(config) { @@ -173120,8 +196374,6 @@ class FlowGraphGreaterThanBlock extends FlowGraphBinaryOperationBlock { } } } -FlowGraphGreaterThanBlock.ClassName = "FGGreaterThanBlock"; -RegisterClass(FlowGraphGreaterThanBlock.ClassName, FlowGraphGreaterThanBlock); class FlowGraphGreaterThanOrEqualBlock extends FlowGraphBinaryOperationBlock { constructor(config) { @@ -173141,8 +196393,6 @@ class FlowGraphGreaterThanOrEqualBlock extends FlowGraphBinaryOperationBlock { } } } -FlowGraphGreaterThanOrEqualBlock.ClassName = "FGGreaterThanOrEqualBlock"; -RegisterClass(FlowGraphGreaterThanOrEqualBlock.ClassName, FlowGraphGreaterThanOrEqualBlock); class FlowGraphIsNanBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173162,8 +196412,6 @@ class FlowGraphIsNanBlock extends FlowGraphUnaryOperationBlock { } } } -FlowGraphIsNanBlock.ClassName = "FGIsNanBlock"; -RegisterClass(FlowGraphIsNanBlock.ClassName, FlowGraphIsNanBlock); class FlowGraphIsInfBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173183,7 +196431,6 @@ class FlowGraphIsInfBlock extends FlowGraphUnaryOperationBlock { } } } -FlowGraphIsInfBlock.ClassName = "FGIsInfBlock"; class FlowGraphDegToRadBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173196,8 +196443,6 @@ class FlowGraphDegToRadBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, this._degToRad); } } -FlowGraphDegToRadBlock.ClassName = "FGDegToRadBlock"; -RegisterClass(FlowGraphDegToRadBlock.ClassName, FlowGraphDegToRadBlock); class FlowGraphRadToDegBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173210,8 +196455,6 @@ class FlowGraphRadToDegBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, this._radToDeg); } } -FlowGraphRadToDegBlock.ClassName = "FGRadToDegBlock"; -RegisterClass(FlowGraphRadToDegBlock.ClassName, FlowGraphRadToDegBlock); class FlowGraphSinBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173221,8 +196464,6 @@ class FlowGraphSinBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.sin); } } -FlowGraphSinBlock.ClassName = "FGSinBlock"; -RegisterClass(FlowGraphSinBlock.ClassName, FlowGraphSinBlock); class FlowGraphCosBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173232,8 +196473,6 @@ class FlowGraphCosBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.cos); } } -FlowGraphCosBlock.ClassName = "FGCosBlock"; -RegisterClass(FlowGraphCosBlock.ClassName, FlowGraphCosBlock); class FlowGraphTanBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173243,8 +196482,6 @@ class FlowGraphTanBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.tan); } } -FlowGraphTanBlock.ClassName = "FGTanBlock"; -RegisterClass(FlowGraphTanBlock.ClassName, FlowGraphTanBlock); class FlowGraphAsinBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173254,8 +196491,6 @@ class FlowGraphAsinBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.asin); } } -FlowGraphAsinBlock.ClassName = "FGAsinBlock"; -RegisterClass(FlowGraphAsinBlock.ClassName, FlowGraphAsinBlock); class FlowGraphAcosBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173265,8 +196500,6 @@ class FlowGraphAcosBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.acos); } } -FlowGraphAcosBlock.ClassName = "FGAcosBlock"; -RegisterClass(FlowGraphAcosBlock.ClassName, FlowGraphAcosBlock); class FlowGraphAtanBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173276,8 +196509,6 @@ class FlowGraphAtanBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.atan); } } -FlowGraphAtanBlock.ClassName = "FGAtanBlock"; -RegisterClass(FlowGraphAtanBlock.ClassName, FlowGraphAtanBlock); class FlowGraphAtan2Block extends FlowGraphBinaryOperationBlock { constructor(config) { @@ -173287,8 +196518,6 @@ class FlowGraphAtan2Block extends FlowGraphBinaryOperationBlock { return _componentWiseBinaryOperation(a, b, Math.atan2); } } -FlowGraphAtan2Block.ClassName = "FGAtan2Block"; -RegisterClass(FlowGraphAtan2Block.ClassName, FlowGraphAtan2Block); class FlowGraphSinhBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173298,8 +196527,6 @@ class FlowGraphSinhBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.sinh); } } -FlowGraphSinhBlock.ClassName = "FGSinhBlock"; -RegisterClass(FlowGraphSinhBlock.ClassName, FlowGraphSinhBlock); class FlowGraphCoshBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173309,8 +196536,6 @@ class FlowGraphCoshBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.cosh); } } -FlowGraphCoshBlock.ClassName = "FGCoshBlock"; -RegisterClass(FlowGraphCoshBlock.ClassName, FlowGraphCoshBlock); class FlowGraphTanhBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173320,8 +196545,6 @@ class FlowGraphTanhBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.tanh); } } -FlowGraphTanhBlock.ClassName = "FGTanhBlock"; -RegisterClass(FlowGraphTanhBlock.ClassName, FlowGraphTanhBlock); class FlowGraphAsinhBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173331,8 +196554,6 @@ class FlowGraphAsinhBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.asinh); } } -FlowGraphAsinhBlock.ClassName = "FGAsinhBlock"; -RegisterClass(FlowGraphAsinhBlock.ClassName, FlowGraphAsinhBlock); class FlowGraphAcoshBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173342,8 +196563,6 @@ class FlowGraphAcoshBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.acosh); } } -FlowGraphAcoshBlock.ClassName = "FGAcoshBlock"; -RegisterClass(FlowGraphAcoshBlock.ClassName, FlowGraphAcoshBlock); class FlowGraphAtanhBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173353,8 +196572,6 @@ class FlowGraphAtanhBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.atanh); } } -FlowGraphAtanhBlock.ClassName = "FGAtanhBlock"; -RegisterClass(FlowGraphAtanhBlock.ClassName, FlowGraphAtanhBlock); class FlowGraphExpBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173364,8 +196581,6 @@ class FlowGraphExpBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.exp); } } -FlowGraphExpBlock.ClassName = "FGExpBlock"; -RegisterClass(FlowGraphExpBlock.ClassName, FlowGraphExpBlock); class FlowGraphLogBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173375,8 +196590,6 @@ class FlowGraphLogBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.log); } } -FlowGraphLogBlock.ClassName = "FGLogBlock"; -RegisterClass(FlowGraphLogBlock.ClassName, FlowGraphLogBlock); class FlowGraphLog2Block extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173386,8 +196599,6 @@ class FlowGraphLog2Block extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.log2); } } -FlowGraphLog2Block.ClassName = "FGLog2Block"; -RegisterClass(FlowGraphLog2Block.ClassName, FlowGraphLog2Block); class FlowGraphLog10Block extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173397,8 +196608,6 @@ class FlowGraphLog10Block extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.log10); } } -FlowGraphLog10Block.ClassName = "FGLog10Block"; -RegisterClass(FlowGraphLog10Block.ClassName, FlowGraphLog10Block); class FlowGraphSqrtBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173408,8 +196617,6 @@ class FlowGraphSqrtBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.sqrt); } } -FlowGraphSqrtBlock.ClassName = "FGSqrtBlock"; -RegisterClass(FlowGraphSqrtBlock.ClassName, FlowGraphSqrtBlock); class FlowGraphCubeRootBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173419,8 +196626,6 @@ class FlowGraphCubeRootBlock extends FlowGraphUnaryOperationBlock { return _componentWiseUnaryOperation(a, Math.cbrt); } } -FlowGraphCubeRootBlock.ClassName = "FGCubeRootBlock"; -RegisterClass(FlowGraphCubeRootBlock.ClassName, FlowGraphCubeRootBlock); class FlowGraphPowBlock extends FlowGraphBinaryOperationBlock { constructor(config) { @@ -173430,8 +196635,6 @@ class FlowGraphPowBlock extends FlowGraphBinaryOperationBlock { return _componentWiseBinaryOperation(a, b, Math.pow); } } -FlowGraphPowBlock.ClassName = "FGPowBlock"; -RegisterClass(FlowGraphPowBlock.ClassName, FlowGraphPowBlock); class FlowGraphLengthBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173449,8 +196652,6 @@ class FlowGraphLengthBlock extends FlowGraphUnaryOperationBlock { } } } -FlowGraphLengthBlock.ClassName = "FGLengthBlock"; -RegisterClass(FlowGraphLengthBlock.ClassName, FlowGraphLengthBlock); class FlowGraphNormalizeBlock extends FlowGraphUnaryOperationBlock { constructor(config) { @@ -173468,32 +196669,214 @@ class FlowGraphNormalizeBlock extends FlowGraphUnaryOperationBlock { } } } -FlowGraphNormalizeBlock.ClassName = "FGNormalizeBlock"; -RegisterClass(FlowGraphNormalizeBlock.ClassName, FlowGraphNormalizeBlock); class FlowGraphCrossBlock extends FlowGraphBinaryOperationBlock { constructor(config) { super(RichTypeVector3, RichTypeVector3, RichTypeVector3, (a, b) => Vector3.Cross(a, b), FlowGraphCrossBlock.ClassName, config); } } -FlowGraphCrossBlock.ClassName = "FGCrossBlock"; -RegisterClass(FlowGraphCrossBlock.ClassName, FlowGraphCrossBlock); class FlowGraphRotate2DBlock extends FlowGraphBinaryOperationBlock { constructor(config) { super(RichTypeVector2, RichTypeNumber, RichTypeVector2, (a, b) => Vector2.Transform(a, Matrix.RotationZ(b)), FlowGraphRotate2DBlock.ClassName, config); } } -FlowGraphRotate2DBlock.ClassName = "FGRotate2DBlock"; -RegisterClass(FlowGraphRotate2DBlock.ClassName, FlowGraphRotate2DBlock); class FlowGraphRotate3DBlock extends FlowGraphTernaryOperationBlock { constructor(config) { super(RichTypeVector3, RichTypeVector3, RichTypeNumber, RichTypeVector3, (a, b, c) => Vector3.TransformCoordinates(a, Matrix.RotationAxis(b, c)), FlowGraphRotate3DBlock.ClassName, config); } } -FlowGraphRotate3DBlock.ClassName = "FGRotate3DBlock"; -RegisterClass(FlowGraphRotate3DBlock.ClassName, FlowGraphRotate3DBlock); +var _getClassNameOf, _areSameVectorClass, _componentWiseUnaryOperation, _componentWiseBinaryOperation, _clamp, _componentWiseTernaryOperation; +var init_flowGraphMathBlocks = __esm(() => { + init_typeStore(); + init_flowGraphRichTypes(); + init_flowGraphBinaryOperationBlock(); + init_flowGraphConstantOperationBlock(); + init_math_vector(); + init_flowGraphUnaryOperationBlock(); + init_flowGraphTernaryOperationBlock(); + _getClassNameOf = function(v) { + if (v.getClassName) { + return v.getClassName(); + } + return ""; + }; + _areSameVectorClass = function(className2, className22) { + return className2 === "Vector2" && className22 === "Vector2" || className2 === "Vector3" && className22 === "Vector3" || className2 === "Vector4" && className22 === "Vector4"; + }; + _componentWiseUnaryOperation = function(a, op) { + const aClassName = _getClassNameOf(a); + switch (aClassName) { + case "Vector2": + return new Vector2(op(a.x), op(a.y)); + case "Vector3": + return new Vector3(op(a.x), op(a.y), op(a.z)); + case "Vector4": + return new Vector4(op(a.x), op(a.y), op(a.z), op(a.w)); + default: + return op(a); + } + }; + _componentWiseBinaryOperation = function(a, b, op) { + const aClassName = _getClassNameOf(a); + switch (aClassName) { + case "Vector2": + return new Vector2(op(a.x, b.x), op(a.y, b.y)); + case "Vector3": + return new Vector3(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z)); + case "Vector4": + return new Vector4(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z), op(a.w, b.w)); + default: + return op(a, b); + } + }; + _clamp = function(a, b, c) { + return Math.min(Math.max(a, b), c); + }; + _componentWiseTernaryOperation = function(a, b, c, op) { + const aClassName = _getClassNameOf(a); + switch (aClassName) { + case "Vector2": + return new Vector2(op(a.x, b.x, c.x), op(a.y, b.y, c.y)); + case "Vector3": + return new Vector3(op(a.x, b.x, c.x), op(a.y, b.y, c.y), op(a.z, b.z, c.z)); + case "Vector4": + return new Vector4(op(a.x, b.x, c.x), op(a.y, b.y, c.y), op(a.z, b.z, c.z), op(a.w, b.w, c.w)); + default: + return op(a, b, c); + } + }; + FlowGraphAddBlock.ClassName = "FGAddBlock"; + RegisterClass(FlowGraphAddBlock.ClassName, FlowGraphAddBlock); + FlowGraphSubtractBlock.ClassName = "FGSubBlock"; + RegisterClass(FlowGraphSubtractBlock.ClassName, FlowGraphSubtractBlock); + FlowGraphMultiplyBlock.ClassName = "FGMultiplyBlock"; + RegisterClass(FlowGraphMultiplyBlock.ClassName, FlowGraphMultiplyBlock); + FlowGraphDivideBlock.ClassName = "FGDivideBlock"; + RegisterClass(FlowGraphDivideBlock.ClassName, FlowGraphDivideBlock); + FlowGraphRandomBlock.ClassName = "FGRandomBlock"; + RegisterClass(FlowGraphRandomBlock.ClassName, FlowGraphRandomBlock); + FlowGraphDotBlock.ClassName = "FGDotBlock"; + RegisterClass(FlowGraphDotBlock.ClassName, FlowGraphDotBlock); + FlowGraphEBlock.ClassName = "FGEBlock"; + RegisterClass(FlowGraphEBlock.ClassName, FlowGraphEBlock); + FlowGraphPiBlock.ClassName = "FGPIBlock"; + RegisterClass(FlowGraphPiBlock.ClassName, FlowGraphPiBlock); + FlowGraphInfBlock.ClassName = "FGInfBlock"; + RegisterClass(FlowGraphInfBlock.ClassName, FlowGraphInfBlock); + FlowGraphNaNBlock.ClassName = "FGNaNBlock"; + RegisterClass(FlowGraphNaNBlock.ClassName, FlowGraphNaNBlock); + FlowGraphAbsBlock.ClassName = "FGAbsBlock"; + RegisterClass(FlowGraphAbsBlock.ClassName, FlowGraphAbsBlock); + FlowGraphSignBlock.ClassName = "FGSignBlock"; + RegisterClass(FlowGraphSignBlock.ClassName, FlowGraphSignBlock); + FlowGraphTruncBlock.ClassName = "FGTruncBlock"; + RegisterClass(FlowGraphTruncBlock.ClassName, FlowGraphTruncBlock); + FlowGraphFloorBlock.ClassName = "FGFloorBlock"; + RegisterClass(FlowGraphFloorBlock.ClassName, FlowGraphFloorBlock); + FlowGraphCeilBlock.ClassName = "FGCeilBlock"; + RegisterClass(FlowGraphCeilBlock.ClassName, FlowGraphCeilBlock); + FlowGraphFractBlock.ClassName = "FGFractBlock"; + RegisterClass(FlowGraphFractBlock.ClassName, FlowGraphFractBlock); + FlowGraphNegBlock.ClassName = "FGNegBlock"; + RegisterClass(FlowGraphNegBlock.ClassName, FlowGraphNegBlock); + FlowGraphRemainderBlock.ClassName = "FGRemainderBlock"; + RegisterClass(FlowGraphRemainderBlock.ClassName, FlowGraphRemainderBlock); + FlowGraphMinBlock.ClassName = "FGMinBlock"; + RegisterClass(FlowGraphMinBlock.ClassName, FlowGraphMinBlock); + FlowGraphMaxBlock.ClassName = "FGMaxBlock"; + RegisterClass(FlowGraphMaxBlock.ClassName, FlowGraphMaxBlock); + FlowGraphClampBlock.ClassName = "FGClampBlock"; + RegisterClass(FlowGraphClampBlock.ClassName, FlowGraphClampBlock); + FlowGraphSaturateBlock.ClassName = "FGSaturateBlock"; + RegisterClass(FlowGraphSaturateBlock.ClassName, FlowGraphSaturateBlock); + FlowGraphInterpolateBlock.ClassName = "FGInterpolateBlock"; + RegisterClass(FlowGraphInterpolateBlock.ClassName, FlowGraphInterpolateBlock); + FlowGraphEqBlock.ClassName = "FGEqBlock"; + RegisterClass(FlowGraphEqBlock.ClassName, FlowGraphEqBlock); + FlowGraphLessThanBlock.ClassName = "FGLessThanBlock"; + RegisterClass(FlowGraphLessThanBlock.ClassName, FlowGraphLessThanBlock); + FlowGraphLessThanOrEqualBlock.ClassName = "FGLessThanOrEqualBlock"; + FlowGraphGreaterThanBlock.ClassName = "FGGreaterThanBlock"; + RegisterClass(FlowGraphGreaterThanBlock.ClassName, FlowGraphGreaterThanBlock); + FlowGraphGreaterThanOrEqualBlock.ClassName = "FGGreaterThanOrEqualBlock"; + RegisterClass(FlowGraphGreaterThanOrEqualBlock.ClassName, FlowGraphGreaterThanOrEqualBlock); + FlowGraphIsNanBlock.ClassName = "FGIsNanBlock"; + RegisterClass(FlowGraphIsNanBlock.ClassName, FlowGraphIsNanBlock); + FlowGraphIsInfBlock.ClassName = "FGIsInfBlock"; + FlowGraphDegToRadBlock.ClassName = "FGDegToRadBlock"; + RegisterClass(FlowGraphDegToRadBlock.ClassName, FlowGraphDegToRadBlock); + FlowGraphRadToDegBlock.ClassName = "FGRadToDegBlock"; + RegisterClass(FlowGraphRadToDegBlock.ClassName, FlowGraphRadToDegBlock); + FlowGraphSinBlock.ClassName = "FGSinBlock"; + RegisterClass(FlowGraphSinBlock.ClassName, FlowGraphSinBlock); + FlowGraphCosBlock.ClassName = "FGCosBlock"; + RegisterClass(FlowGraphCosBlock.ClassName, FlowGraphCosBlock); + FlowGraphTanBlock.ClassName = "FGTanBlock"; + RegisterClass(FlowGraphTanBlock.ClassName, FlowGraphTanBlock); + FlowGraphAsinBlock.ClassName = "FGAsinBlock"; + RegisterClass(FlowGraphAsinBlock.ClassName, FlowGraphAsinBlock); + FlowGraphAcosBlock.ClassName = "FGAcosBlock"; + RegisterClass(FlowGraphAcosBlock.ClassName, FlowGraphAcosBlock); + FlowGraphAtanBlock.ClassName = "FGAtanBlock"; + RegisterClass(FlowGraphAtanBlock.ClassName, FlowGraphAtanBlock); + FlowGraphAtan2Block.ClassName = "FGAtan2Block"; + RegisterClass(FlowGraphAtan2Block.ClassName, FlowGraphAtan2Block); + FlowGraphSinhBlock.ClassName = "FGSinhBlock"; + RegisterClass(FlowGraphSinhBlock.ClassName, FlowGraphSinhBlock); + FlowGraphCoshBlock.ClassName = "FGCoshBlock"; + RegisterClass(FlowGraphCoshBlock.ClassName, FlowGraphCoshBlock); + FlowGraphTanhBlock.ClassName = "FGTanhBlock"; + RegisterClass(FlowGraphTanhBlock.ClassName, FlowGraphTanhBlock); + FlowGraphAsinhBlock.ClassName = "FGAsinhBlock"; + RegisterClass(FlowGraphAsinhBlock.ClassName, FlowGraphAsinhBlock); + FlowGraphAcoshBlock.ClassName = "FGAcoshBlock"; + RegisterClass(FlowGraphAcoshBlock.ClassName, FlowGraphAcoshBlock); + FlowGraphAtanhBlock.ClassName = "FGAtanhBlock"; + RegisterClass(FlowGraphAtanhBlock.ClassName, FlowGraphAtanhBlock); + FlowGraphExpBlock.ClassName = "FGExpBlock"; + RegisterClass(FlowGraphExpBlock.ClassName, FlowGraphExpBlock); + FlowGraphLogBlock.ClassName = "FGLogBlock"; + RegisterClass(FlowGraphLogBlock.ClassName, FlowGraphLogBlock); + FlowGraphLog2Block.ClassName = "FGLog2Block"; + RegisterClass(FlowGraphLog2Block.ClassName, FlowGraphLog2Block); + FlowGraphLog10Block.ClassName = "FGLog10Block"; + RegisterClass(FlowGraphLog10Block.ClassName, FlowGraphLog10Block); + FlowGraphSqrtBlock.ClassName = "FGSqrtBlock"; + RegisterClass(FlowGraphSqrtBlock.ClassName, FlowGraphSqrtBlock); + FlowGraphCubeRootBlock.ClassName = "FGCubeRootBlock"; + RegisterClass(FlowGraphCubeRootBlock.ClassName, FlowGraphCubeRootBlock); + FlowGraphPowBlock.ClassName = "FGPowBlock"; + RegisterClass(FlowGraphPowBlock.ClassName, FlowGraphPowBlock); + FlowGraphLengthBlock.ClassName = "FGLengthBlock"; + RegisterClass(FlowGraphLengthBlock.ClassName, FlowGraphLengthBlock); + FlowGraphNormalizeBlock.ClassName = "FGNormalizeBlock"; + RegisterClass(FlowGraphNormalizeBlock.ClassName, FlowGraphNormalizeBlock); + FlowGraphCrossBlock.ClassName = "FGCrossBlock"; + RegisterClass(FlowGraphCrossBlock.ClassName, FlowGraphCrossBlock); + FlowGraphRotate2DBlock.ClassName = "FGRotate2DBlock"; + RegisterClass(FlowGraphRotate2DBlock.ClassName, FlowGraphRotate2DBlock); + FlowGraphRotate3DBlock.ClassName = "FGRotate3DBlock"; + RegisterClass(FlowGraphRotate3DBlock.ClassName, FlowGraphRotate3DBlock); +}); + +// node_modules/@babylonjs/core/FlowGraph/Blocks/Data/Math/index.js +var init_Math = __esm(() => { + init_flowGraphMathBlocks(); +}); + +// node_modules/@babylonjs/core/FlowGraph/Blocks/Data/index.js +var init_Data = __esm(() => { + init_flowGraphConditionalDataBlock(); + init_flowGraphGetVariableBlock(); + init_flowGraphCoordinateTransformBlock(); + init_flowGraphConstantBlock(); + init_flowGraphGetPropertyBlock(); + init_Logic(); + init_Math(); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js class FlowGraphSceneReadyEventBlock extends FlowGraphEventBlock { _preparePendingTasks(context) { @@ -173515,8 +196898,13 @@ class FlowGraphSceneReadyEventBlock extends FlowGraphEventBlock { return FlowGraphSceneReadyEventBlock.ClassName; } } -FlowGraphSceneReadyEventBlock.ClassName = "FGSceneReadyEventBlock"; -RegisterClass("FGSceneReadyEventBlock", FlowGraphSceneReadyEventBlock); +var init_flowGraphSceneReadyEventBlock = __esm(() => { + init_flowGraphEventBlock(); + init_typeStore(); + FlowGraphSceneReadyEventBlock.ClassName = "FGSceneReadyEventBlock"; + RegisterClass("FGSceneReadyEventBlock", FlowGraphSceneReadyEventBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock { constructor(config) { @@ -173556,8 +196944,15 @@ class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock { serializationObject.eventData = this.config.eventData; } } -FlowGraphReceiveCustomEventBlock.ClassName = "FGReceiveCustomEventBlock"; -RegisterClass(FlowGraphReceiveCustomEventBlock.ClassName, FlowGraphReceiveCustomEventBlock); +var init_flowGraphReceiveCustomEventBlock = __esm(() => { + init_flowGraphEventBlock(); + init_tools(); + init_flowGraphRichTypes(); + init_typeStore(); + FlowGraphReceiveCustomEventBlock.ClassName = "FGReceiveCustomEventBlock"; + RegisterClass(FlowGraphReceiveCustomEventBlock.ClassName, FlowGraphReceiveCustomEventBlock); +}); + // node_modules/@babylonjs/core/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js class FlowGraphSceneTickEventBlock extends FlowGraphEventBlock { _preparePendingTasks(context) { @@ -173579,16418 +196974,64515 @@ class FlowGraphSceneTickEventBlock extends FlowGraphEventBlock { return FlowGraphSceneTickEventBlock.ClassName; } } -FlowGraphSceneTickEventBlock.ClassName = "FGSceneTickEventBlock"; -RegisterClass(FlowGraphSceneTickEventBlock.ClassName, FlowGraphSceneTickEventBlock); -// src/systems/track/trackInit.system.ts -class TrackInitSystem extends import_tick_knock2.IterativeSystem { - constructor() { - super((entity) => entity.hasComponent(TrackComponent)); - } - updateEntity(entity) { - const trackComponent = entity.get(TrackComponent); - if (trackComponent.initializationStatus !== InitializationStatus.NotInitialized) { - return; +var init_flowGraphSceneTickEventBlock = __esm(() => { + init_flowGraphEventBlock(); + init_typeStore(); + FlowGraphSceneTickEventBlock.ClassName = "FGSceneTickEventBlock"; + RegisterClass(FlowGraphSceneTickEventBlock.ClassName, FlowGraphSceneTickEventBlock); +}); + +// node_modules/@babylonjs/core/FlowGraph/Blocks/Event/index.js +var init_Event = __esm(() => { + init_flowGraphMeshPickEventBlock(); + init_flowGraphSceneReadyEventBlock(); + init_flowGraphReceiveCustomEventBlock(); + init_flowGraphSceneTickEventBlock(); +}); + +// node_modules/@babylonjs/core/FlowGraph/Blocks/index.js +var init_Blocks2 = __esm(() => { + init_Execution(); + init_Data(); + init_Event(); +}); + +// node_modules/@babylonjs/core/FlowGraph/index.js +var init_FlowGraph = __esm(() => { + init_flowGraph(); + init_flowGraphBlock(); + init_flowGraphSignalConnection(); + init_flowGraphExecutionBlock(); + init_flowGraphEventBlock(); + init_flowGraphRichTypes(); + init_flowGraphContext(); + init_flowGraphCoordinator(); + init_typeDefinitions(); + init_flowGraphContextLogger(); + init_flowGraphPath(); + init_flowGraphConnection(); + init_flowGraphDataConnection(); + init_Blocks2(); +}); + +// node_modules/@babylonjs/core/index.js +var exports_core = {}; +__export(exports_core, { + setVRRigMode: () => { + { + return setVRRigMode; } - trackComponent.initializationStatus = InitializationStatus.Initializing; - const track2 = this.createTrack(trackComponent.points, trackComponent.sections); - this.createMeshes(track2, trackComponent.points); - trackComponent.rotations = track2.rotations.map(Quaternion.FromRotationMatrix); - trackComponent.initializationStatus = InitializationStatus.Initialized; - } - createTrack(points, sections) { - const trackData = { - directions: [], - rotations: [], - carriageRotations: [], - passengerRotations: [] - }; - this.validateAndPrepareSections(sections, points); - sections.forEach((section, i) => { - const nextSection = sections[i + 1] || sections[i]; - this.createSection(points, section, nextSection, trackData); - }); - return trackData; - } - validateAndPrepareSections(sections, points) { - const looped = sections[sections.length - 1].start === 0; - const loopedNum = looped ? 1 : 0; - for (let i = 1;i < sections.length - loopedNum; i++) { - if (sections[i - 1].start > sections[i].start) { - console.error("Sections not in order"); - return; - } + }, + setStereoscopicRigMode: () => { + { + return setStereoscopicRigMode; } - if (sections[sections.length - 1].start > 0 && sections[sections.length - 2].start > sections[sections.length - 1].start) { - console.error("Last section not in order"); - return; + }, + setStereoscopicAnaglyphRigMode: () => { + { + return setStereoscopicAnaglyphRigMode; } - if (sections[0].start > 0) { - sections.unshift(new Section(0)); + }, + setAndStartTimer: () => { + { + return setAndStartTimer; } - } - createSection(points, startSection, endSection, trackData) { - const railsFrom = startSection.start; - let railsTo = endSection.start; - if (endSection.start === 0 || startSection.start === endSection.start) { - railsTo = points.length; + }, + serializeAsVector3: () => { + { + return serializeAsVector3; } - const nbRails = railsTo - railsFrom; - const initialLean = startSection.options.lean; - const initialTurn = startSection.options.turn; - let leanTwists = startSection.options.leanTwists; - let leanWaves = startSection.options.leanWaves; - const leanWaveAngle = startSection.options.leanWaveAngle; - let turnTwists = startSection.options.turnTwists; - let turnWaves = startSection.options.turnWaves; - const turnWaveAngle = startSection.options.turnWaveAngle; - const finalLean = endSection.options.lean; - const finalTurn = endSection.options.turn; - if (leanWaves > 0 && Math.abs(leanTwists) > 0) { - if (leanWaveAngle == 0) { - leanWaves = 0; - } else { - leanTwists = 0; - } + }, + serializeAsVector2: () => { + { + return serializeAsVector2; } - if (turnWaves > 0 && Math.abs(turnTwists) > 0) { - if (turnWaveAngle == 0) { - turnWaves = 0; - } else { - turnTwists = 0; - } + }, + serializeAsTexture: () => { + { + return serializeAsTexture; } - const rotationMatrixY = Matrix.Identity(); - const rotationMatrixZ = Matrix.Identity(); - const rotationMatrix = Matrix.Identity(); - let tilt = 0; - let swivel = 0; - const deltaPhi = (finalLean + 2 * leanTwists * Math.PI - initialLean) / nbRails; - const deltaTheta = (finalTurn + 2 * turnTwists * Math.PI - initialTurn) / nbRails; - let phi = initialLean; - let theta = initialTurn; - const initialRailDirection = Axis.X; - const initialUprightDirection = Axis.Y; - const initialLevelDirection = Axis.Z; - const railDirection = Vector3.Zero(); - const uprightDirection = Vector3.Zero(); - const levelDirection = Vector3.Zero(); - const carriageNormal = Vector3.Zero(); - Vector3.TransformNormalToRef(initialRailDirection, rotationMatrix, railDirection); - const rotationMatrixLean = Matrix.Identity(); - const rotationMatrixTurn = Matrix.Identity(); - const rotationMatrixPassenger = Matrix.Identity(); - const rotation = Matrix.Identity(); - const gradLean = (finalLean - initialLean) / (nbRails - 1); - const gradTurn = (finalTurn - initialTurn) / (nbRails - 1); - let railCount = 0; - for (let i = railsFrom;i < railsTo; i++) { - points[(i + 1) % points.length].subtractToRef(points[i], railDirection); - railDirection.normalize(); - swivel = -Math.atan2(railDirection.z, railDirection.x); - tilt = Math.atan2(Math.abs(railDirection.y), Math.abs(railDirection.x)); - tilt *= Math.sign(railDirection.y); - Matrix.RotationAxisToRef(Axis.Y, swivel, rotationMatrixY); - Matrix.RotationAxisToRef(Axis.Z, tilt, rotationMatrixZ); - rotationMatrixZ.multiplyToRef(rotationMatrixY, rotationMatrix); - Vector3.TransformNormalToRef(initialUprightDirection, rotationMatrix, uprightDirection); - Vector3.TransformNormalToRef(initialLevelDirection, rotationMatrix, levelDirection); - uprightDirection.normalize(); - levelDirection.normalize(); - if (leanWaves > 0) { - phi = initialLean + railCount * gradLean + leanWaveAngle * Math.sin(railCount * leanWaves * Math.PI / (nbRails - 1)); - } else { - phi += deltaPhi; - } - if (turnWaves > 0) { - theta = initialTurn + railCount * gradTurn + turnWaveAngle * Math.sin(railCount * turnWaves * Math.PI / (nbRails - 1)); - } else { - theta += deltaTheta; - } - railCount++; - Matrix.RotationAxisToRef(railDirection, phi, rotationMatrixLean); - Vector3.TransformNormalToRef(uprightDirection, rotationMatrixLean, carriageNormal); - Matrix.RotationAxisToRef(carriageNormal, theta, rotationMatrixTurn); - Matrix.RotationAxisToRef(initialUprightDirection, theta, rotationMatrixPassenger); - trackData.passengerRotations.push(rotationMatrixPassenger.clone()); - rotationMatrix.multiplyToRef(rotationMatrixLean, rotation); - trackData.carriageRotations.push(rotation.clone()); - rotation.multiplyToRef(rotationMatrixTurn, rotation); - trackData.rotations.push(rotation.clone()); - trackData.directions.push(railDirection.clone()); + }, + serializeAsQuaternion: () => { + { + return serializeAsQuaternion; } - return trackData; - } - createMeshes(track2, points) { - if (!track2) { - console.error("no track!"); - return; + }, + serializeAsMeshReference: () => { + { + return serializeAsMeshReference; } - const normal = Vector3.Zero(); - const binormal = Vector3.Zero(); - const offset = 0.9; - const height = -0.35; - const plusPoints = []; - const negPoints = []; - const sleeper = MeshBuilder.CreateBox("sleeper", { width: 0.2286, height: 0.1778, depth: 2.6 }); - sleeper.material = new StandardMaterial(""); - sleeper.position.y = -0.5; - for (let i = 0;i < points.length - 1; i += 1) { - Vector3.TransformNormalToRef(Axis.Y, track2.carriageRotations[i], normal); - Vector3.TransformNormalToRef(Axis.Z, track2.carriageRotations[i], binormal); - plusPoints.push(points[i].add(binormal.scale(offset)).add(normal.scale(height))); - negPoints.push(points[i].subtract(binormal.scale(offset)).add(normal.scale(height))); - const nsleeper = sleeper.createInstance("sleeper" + i); - nsleeper.position.x = points[i].x; - nsleeper.position.y = points[i].y; - nsleeper.position.z = points[i].z; - nsleeper.rotationQuaternion = Quaternion.FromRotationMatrix(track2.carriageRotations[i]); - nsleeper.position.subtractInPlace(normal.scale(0.5)); - nsleeper.freezeWorldMatrix(); + }, + serializeAsMatrix: () => { + { + return serializeAsMatrix; } - const closedLoop = points[0].equals(points[points.length - 1]); - if (closedLoop) { - plusPoints.push(plusPoints[0]); - negPoints.push(negPoints[0]); + }, + serializeAsImageProcessingConfiguration: () => { + { + return serializeAsImageProcessingConfiguration; } - const plusTube = MeshBuilder.CreateTube("tube", { path: plusPoints, radius: 0.1, tessellation: 4 }); - const negTube = MeshBuilder.CreateTube("tube", { path: negPoints, radius: 0.1, tessellation: 4 }); - plusTube.freezeWorldMatrix(); - negTube.freezeWorldMatrix(); - } -} -TrackInitSystem = __legacyDecorateClassTS([ - RegisterSystem() -], TrackInitSystem); -// src/systems/locomotive/locomotive.system.ts -var import_tick_knock3 = __toESM(require_lib(), 1); - -// src/components/locomotive/locomotive.component.ts -class LocomotiveComponent { - initializationStatus = InitializationStatus.NotInitialized; - mesh = null; - positionOnTrack = 0; - speed = 0; - acceleration = 5; - deceleration = 10; - maxSpeed = 26.8224; - width = 16.891; - depth = 3.2258; - height = 3.048; - constructor() { - } -} - -// src/components/locomotive/locomotiveInput.component.ts -class LocomotiveInputComponent { - direction = Direction.Stop; - constructor() { - } -} -var Direction; -(function(Direction2) { - Direction2[Direction2["Forward"] = 0] = "Forward"; - Direction2[Direction2["Backward"] = 1] = "Backward"; - Direction2[Direction2["Stop"] = 2] = "Stop"; - Direction2[Direction2["Neutral"] = 3] = "Neutral"; -})(Direction || (Direction = {})); - -// src/systems/locomotive/locomotive.system.ts -var HEIGHT_ABOVE_TRACK = 1.5; - -class LocomotiveSystem extends import_tick_knock3.IterativeSystem { - constructor() { - super((entity) => entity.hasAll(LocomotiveComponent, TrackComponent, LocomotiveInputComponent)); - } - updateEntity(entity, dt) { - const locomotiveComponent = entity.get(LocomotiveComponent); - const trackComponent = entity.get(TrackComponent); - const locomotiveInputComponent = entity.get(LocomotiveInputComponent); - if (locomotiveComponent.initializationStatus !== InitializationStatus.Initialized || !locomotiveComponent.mesh || trackComponent.initializationStatus !== InitializationStatus.Initialized) { - return; + }, + serializeAsFresnelParameters: () => { + { + return serializeAsFresnelParameters; } - this.setSpeed(locomotiveComponent, locomotiveInputComponent, dt); - this.updatePositionOnTrack(locomotiveComponent, trackComponent, dt); - } - setSpeed(locomotiveComponent, locomotiveInputComponent, dt) { - let speed = locomotiveComponent.speed; - switch (locomotiveInputComponent.direction) { - case Direction.Forward: - speed = Math.min(speed + locomotiveComponent.acceleration * dt, locomotiveComponent.maxSpeed); - break; - case Direction.Backward: - speed = Math.max(speed - locomotiveComponent.acceleration * dt, -locomotiveComponent.maxSpeed); - break; - case Direction.Stop: - if (speed > 0) { - speed = Math.max(speed - locomotiveComponent.deceleration * dt, 0); - } else { - speed = Math.min(speed + locomotiveComponent.deceleration * dt, 0); - } - break; - case Direction.Neutral: - break; + }, + serializeAsColorCurves: () => { + { + return serializeAsColorCurves; } - locomotiveComponent.speed = speed; - } - updatePositionOnTrack(locomotiveComponent, trackComponent, dt) { - const positionOnTrack = locomotiveComponent.positionOnTrack; - const trackLength = trackComponent.points.length; - const newPositionOnTrack = (positionOnTrack + locomotiveComponent.speed * dt) % trackLength; - locomotiveComponent.positionOnTrack = newPositionOnTrack >= 0 ? newPositionOnTrack : newPositionOnTrack + trackLength; - const currentIndex = Math.floor(positionOnTrack); - const nextIndex = (currentIndex + 1) % trackLength; - const interpolationFactor = newPositionOnTrack - currentIndex; - const currentPosition = trackComponent.points[currentIndex]; - const nextPosition = trackComponent.points[nextIndex]; - const interpolatedPosition = { - x: currentPosition.x + (nextPosition.x - currentPosition.x) * interpolationFactor, - y: currentPosition.y + (nextPosition.y - currentPosition.y) * interpolationFactor + HEIGHT_ABOVE_TRACK, - z: currentPosition.z + (nextPosition.z - currentPosition.z) * interpolationFactor - }; - const currentRotation = trackComponent.rotations[currentIndex]; - const nextRotation = trackComponent.rotations[nextIndex]; - const interpolatedRotation = Quaternion.Slerp(currentRotation, nextRotation, interpolationFactor); - const locomotiveMesh = locomotiveComponent.mesh; - locomotiveMesh.position = new Vector3(interpolatedPosition.x, interpolatedPosition.y, interpolatedPosition.z); - locomotiveMesh.rotationQuaternion = interpolatedRotation; - } -} -LocomotiveSystem = __legacyDecorateClassTS([ - RegisterSystem() -], LocomotiveSystem); -// src/systems/locomotive/locomotiveInit.system.ts -var import_tick_knock4 = __toESM(require_lib(), 1); -class LocomotiveInitSystem extends import_tick_knock4.IterativeSystem { - constructor() { - super((entity) => entity.hasComponent(LocomotiveComponent)); - } - updateEntity(entity) { - const locomotiveComponent = entity.get(LocomotiveComponent); - if (locomotiveComponent.initializationStatus === InitializationStatus.Initializing || locomotiveComponent.initializationStatus === InitializationStatus.Initialized) { - return; + }, + serializeAsColor4: () => { + { + return serializeAsColor4; } - locomotiveComponent.initializationStatus = InitializationStatus.Initializing; - const mesh72 = this.createMesh(locomotiveComponent); - scene36.activeCamera.parent = mesh72; - locomotiveComponent.mesh = mesh72; - locomotiveComponent.initializationStatus = InitializationStatus.Initialized; - } - createMesh(loc) { - const mesh72 = MeshBuilder.CreateBox("locomotive", { width: loc.width, depth: loc.depth, height: loc.height }); - const material27 = new StandardMaterial("locomotive-material"); - material27.diffuseColor = new Color3(0.5, 0.5, 0.5); - mesh72.material = material27; - return mesh72; - } -} -LocomotiveInitSystem = __legacyDecorateClassTS([ - RegisterSystem() -], LocomotiveInitSystem); -// src/systems/locomotive/locomotiveInput.system.ts -var IterativeSystem4 = __toESM(require_IterativeSystem(), 1); - -// src/components/keys.component.ts -class KeysComponent { - _keyStates = {}; - constructor() { - } - getKeyState(key) { - return this._keyStates[key] || false; - } - set keyStates(keyStates) { - this._keyStates = keyStates; - } -} - -// src/systems/locomotive/locomotiveInput.system.ts -class LocomotiveInputSystem extends IterativeSystem4.IterativeSystem { - constructor() { - super((entity) => entity.hasAll(LocomotiveInputComponent, KeysComponent)); - } - updateEntity(entity) { - const locomotiveInputComponent = entity.get(LocomotiveInputComponent); - const keysComponent = entity.get(KeysComponent); - this.updateDirection(locomotiveInputComponent, keysComponent); - } - updateDirection(locomotiveInputComponent, keysComponent) { - const forward = keysComponent.getKeyState("w"); - const backward = keysComponent.getKeyState("s"); - const stop = keysComponent.getKeyState(" "); - if (forward) { - locomotiveInputComponent.direction = Direction.Forward; - } else if (backward) { - locomotiveInputComponent.direction = Direction.Backward; - } else if (stop) { - locomotiveInputComponent.direction = Direction.Stop; - } else { - locomotiveInputComponent.direction = Direction.Neutral; + }, + serializeAsColor3: () => { + { + return serializeAsColor3; } - } -} -LocomotiveInputSystem = __legacyDecorateClassTS([ - RegisterSystem() -], LocomotiveInputSystem); -// node_modules/@babylonjs/gui/2D/valueAndUnit.js -class ValueAndUnit { - constructor(value, unit = ValueAndUnit.UNITMODE_PIXEL, negativeValueAllowed = true) { - this.negativeValueAllowed = negativeValueAllowed; - this._value = 1; - this._unit = ValueAndUnit.UNITMODE_PIXEL; - this.ignoreAdaptiveScaling = false; - this.onChangedObservable = new Observable; - this._value = value; - this._unit = unit; - this._originalUnit = unit; - } - get isPercentage() { - return this._unit === ValueAndUnit.UNITMODE_PERCENTAGE; - } - get isPixel() { - return this._unit === ValueAndUnit.UNITMODE_PIXEL; - } - get internalValue() { - return this._value; - } - get value() { - return this._value; - } - set value(value) { - if (value !== this._value) { - this._value = value; - this.onChangedObservable.notifyObservers(); + }, + serializeAsCameraReference: () => { + { + return serializeAsCameraReference; } - } - get unit() { - return this._unit; - } - set unit(value) { - if (value !== this._unit) { - this._unit = value; - this.onChangedObservable.notifyObservers(); + }, + serialize: () => { + { + return serialize; } - } - getValueInPixel(host, refValue) { - if (this.isPixel) { - return this.getValue(host); + }, + runCoroutineSync: () => { + { + return runCoroutineSync; } - return this.getValue(host) * refValue; - } - updateInPlace(value, unit = ValueAndUnit.UNITMODE_PIXEL) { - if (this.value !== value || this.unit !== unit) { - this._value = value; - this._unit = unit; - this.onChangedObservable.notifyObservers(); + }, + runCoroutineAsync: () => { + { + return runCoroutineAsync; } - return this; - } - getValue(host) { - if (host && !this.ignoreAdaptiveScaling && this.unit !== ValueAndUnit.UNITMODE_PERCENTAGE) { - let width = 0; - let height = 0; - if (host.idealWidth) { - width = Math.ceil(this._value * host.getSize().width / host.idealWidth); - } - if (host.idealHeight) { - height = Math.ceil(this._value * host.getSize().height / host.idealHeight); - } - if (host.useSmallestIdeal && host.idealWidth && host.idealHeight) { - return window.innerWidth < window.innerHeight ? width : height; - } - if (host.idealWidth) { - return width; - } - if (host.idealHeight) { - return height; - } + }, + runCoroutine: () => { + { + return runCoroutine; } - return this._value; - } - toString(host, decimals) { - switch (this._unit) { - case ValueAndUnit.UNITMODE_PERCENTAGE: { - const percentage = this.getValue(host) * 100; - return (decimals ? percentage.toFixed(decimals) : percentage) + "%"; - } - case ValueAndUnit.UNITMODE_PIXEL: { - const pixels = this.getValue(host); - return (decimals ? pixels.toFixed(decimals) : pixels) + "px"; - } + }, + prepareStringDefinesForClipPlanes: () => { + { + return prepareStringDefinesForClipPlanes; } - return this._unit.toString(); - } - fromString(source) { - const match = ValueAndUnit._Regex.exec(source.toString()); - if (!match || match.length === 0) { - return false; + }, + prepareDefinesForClipPlanes: () => { + { + return prepareDefinesForClipPlanes; } - let sourceValue = parseFloat(match[1]); - let sourceUnit = this._originalUnit; - if (!this.negativeValueAllowed) { - if (sourceValue < 0) { - sourceValue = 0; - } + }, + normalizeEnvInfo: () => { + { + return normalizeEnvInfo; } - if (match.length === 4) { - switch (match[3]) { - case "px": - sourceUnit = ValueAndUnit.UNITMODE_PIXEL; - break; - case "%": - sourceUnit = ValueAndUnit.UNITMODE_PERCENTAGE; - sourceValue /= 100; - break; - } + }, + nativeOverride: () => { + { + return nativeOverride; } - if (sourceValue === this._value && sourceUnit === this._unit) { - return false; + }, + makeSyncFunction: () => { + { + return makeSyncFunction; } - this._value = sourceValue; - this._unit = sourceUnit; - this.onChangedObservable.notifyObservers(); - return true; - } - static get UNITMODE_PERCENTAGE() { - return ValueAndUnit._UNITMODE_PERCENTAGE; - } - static get UNITMODE_PIXEL() { - return ValueAndUnit._UNITMODE_PIXEL; - } -} -ValueAndUnit._Regex = /(^-?\d*(\.\d+)?)(%|px)?/; -ValueAndUnit._UNITMODE_PERCENTAGE = 0; -ValueAndUnit._UNITMODE_PIXEL = 1; - -// node_modules/@babylonjs/gui/2D/measure.js -var tmpRect = [new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0)]; -var tmpRect2 = [new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0)]; -var tmpV1 = new Vector2(0, 0); -var tmpV2 = new Vector2(0, 0); - -class Measure { - constructor(left, top, width, height) { - this.left = left; - this.top = top; - this.width = width; - this.height = height; - } - copyFrom(other) { - this.left = other.left; - this.top = other.top; - this.width = other.width; - this.height = other.height; - } - copyFromFloats(left, top, width, height) { - this.left = left; - this.top = top; - this.width = width; - this.height = height; - } - static CombineToRef(a, b, result) { - const left = Math.min(a.left, b.left); - const top = Math.min(a.top, b.top); - const right = Math.max(a.left + a.width, b.left + b.width); - const bottom = Math.max(a.top + a.height, b.top + b.height); - result.left = left; - result.top = top; - result.width = right - left; - result.height = bottom - top; - } - addAndTransformToRef(transform, addX, addY, addWidth, addHeight, result) { - const left = this.left + addX; - const top = this.top + addY; - const width = this.width + addWidth; - const height = this.height + addHeight; - tmpRect[0].copyFromFloats(left, top); - tmpRect[1].copyFromFloats(left + width, top); - tmpRect[2].copyFromFloats(left + width, top + height); - tmpRect[3].copyFromFloats(left, top + height); - tmpV1.copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE); - tmpV2.copyFromFloats(0, 0); - for (let i = 0;i < 4; i++) { - transform.transformCoordinates(tmpRect[i].x, tmpRect[i].y, tmpRect2[i]); - tmpV1.x = Math.floor(Math.min(tmpV1.x, tmpRect2[i].x)); - tmpV1.y = Math.floor(Math.min(tmpV1.y, tmpRect2[i].y)); - tmpV2.x = Math.ceil(Math.max(tmpV2.x, tmpRect2[i].x)); - tmpV2.y = Math.ceil(Math.max(tmpV2.y, tmpRect2[i].y)); + }, + makeAsyncFunction: () => { + { + return makeAsyncFunction; } - result.left = tmpV1.x; - result.top = tmpV1.y; - result.width = tmpV2.x - tmpV1.x; - result.height = tmpV2.y - tmpV1.y; - } - transformToRef(transform, result) { - this.addAndTransformToRef(transform, 0, 0, 0, 0, result); - } - isEqualsTo(other) { - if (this.left !== other.left) { - return false; + }, + inlineScheduler: () => { + { + return inlineScheduler; } - if (this.top !== other.top) { - return false; + }, + getRichTypeFromValue: () => { + { + return getRichTypeFromValue; } - if (this.width !== other.width) { - return false; + }, + extractMinAndMaxIndexed: () => { + { + return extractMinAndMaxIndexed; } - if (this.height !== other.height) { - return false; + }, + extractMinAndMax: () => { + { + return extractMinAndMax; } - return true; - } - static Empty() { - return new Measure(0, 0, 0, 0); - } -} - -// node_modules/@babylonjs/gui/2D/math2D.js -class Vector2WithInfo extends Vector2 { - constructor(source, buttonIndex = 0) { - super(source.x, source.y); - this.buttonIndex = buttonIndex; - } -} - -class Matrix2D { - constructor(m00, m01, m10, m11, m20, m21) { - this.m = new Float32Array(6); - this.fromValues(m00, m01, m10, m11, m20, m21); - } - fromValues(m00, m01, m10, m11, m20, m21) { - this.m[0] = m00; - this.m[1] = m01; - this.m[2] = m10; - this.m[3] = m11; - this.m[4] = m20; - this.m[5] = m21; - return this; - } - determinant() { - return this.m[0] * this.m[3] - this.m[1] * this.m[2]; - } - invertToRef(result) { - const l0 = this.m[0]; - const l1 = this.m[1]; - const l2 = this.m[2]; - const l3 = this.m[3]; - const l4 = this.m[4]; - const l5 = this.m[5]; - const det = this.determinant(); - if (det < Epsilon * Epsilon) { - result.m[0] = 0; - result.m[1] = 0; - result.m[2] = 0; - result.m[3] = 0; - result.m[4] = 0; - result.m[5] = 0; - return this; + }, + expandToProperty: () => { + { + return expandToProperty; } - const detDiv = 1 / det; - const det4 = l2 * l5 - l3 * l4; - const det5 = l1 * l4 - l0 * l5; - result.m[0] = l3 * detDiv; - result.m[1] = -l1 * detDiv; - result.m[2] = -l2 * detDiv; - result.m[3] = l0 * detDiv; - result.m[4] = det4 * detDiv; - result.m[5] = det5 * detDiv; - return this; - } - multiplyToRef(other, result) { - const l0 = this.m[0]; - const l1 = this.m[1]; - const l2 = this.m[2]; - const l3 = this.m[3]; - const l4 = this.m[4]; - const l5 = this.m[5]; - const r0 = other.m[0]; - const r1 = other.m[1]; - const r2 = other.m[2]; - const r3 = other.m[3]; - const r4 = other.m[4]; - const r5 = other.m[5]; - result.m[0] = l0 * r0 + l1 * r2; - result.m[1] = l0 * r1 + l1 * r3; - result.m[2] = l2 * r0 + l3 * r2; - result.m[3] = l2 * r1 + l3 * r3; - result.m[4] = l4 * r0 + l5 * r2 + r4; - result.m[5] = l4 * r1 + l5 * r3 + r5; - return this; - } - transformCoordinates(x, y, result) { - result.x = x * this.m[0] + y * this.m[2] + this.m[4]; - result.y = x * this.m[1] + y * this.m[3] + this.m[5]; - return this; - } - static Identity() { - return new Matrix2D(1, 0, 0, 1, 0, 0); - } - static IdentityToRef(result) { - result.m[0] = 1; - result.m[1] = 0; - result.m[2] = 0; - result.m[3] = 1; - result.m[4] = 0; - result.m[5] = 0; - } - static TranslationToRef(x, y, result) { - result.fromValues(1, 0, 0, 1, x, y); - } - static ScalingToRef(x, y, result) { - result.fromValues(x, 0, 0, y, 0, 0); - } - static RotationToRef(angle, result) { - const s = Math.sin(angle); - const c = Math.cos(angle); - result.fromValues(c, s, -s, c, 0, 0); - } - static ComposeToRef(tx, ty, angle, scaleX, scaleY, parentMatrix, result) { - Matrix2D.TranslationToRef(tx, ty, Matrix2D._TempPreTranslationMatrix); - Matrix2D.ScalingToRef(scaleX, scaleY, Matrix2D._TempScalingMatrix); - Matrix2D.RotationToRef(angle, Matrix2D._TempRotationMatrix); - Matrix2D.TranslationToRef(-tx, -ty, Matrix2D._TempPostTranslationMatrix); - Matrix2D._TempPreTranslationMatrix.multiplyToRef(Matrix2D._TempScalingMatrix, Matrix2D._TempCompose0); - Matrix2D._TempCompose0.multiplyToRef(Matrix2D._TempRotationMatrix, Matrix2D._TempCompose1); - if (parentMatrix) { - Matrix2D._TempCompose1.multiplyToRef(Matrix2D._TempPostTranslationMatrix, Matrix2D._TempCompose2); - Matrix2D._TempCompose2.multiplyToRef(parentMatrix, result); - } else { - Matrix2D._TempCompose1.multiplyToRef(Matrix2D._TempPostTranslationMatrix, result); + }, + editableInPropertyPage: () => { + { + return editableInPropertyPage; } - } -} -Matrix2D._TempPreTranslationMatrix = Matrix2D.Identity(); -Matrix2D._TempPostTranslationMatrix = Matrix2D.Identity(); -Matrix2D._TempRotationMatrix = Matrix2D.Identity(); -Matrix2D._TempScalingMatrix = Matrix2D.Identity(); -Matrix2D._TempCompose0 = Matrix2D.Identity(); -Matrix2D._TempCompose1 = Matrix2D.Identity(); -Matrix2D._TempCompose2 = Matrix2D.Identity(); - -class MathTools { - static Round(value, precision = MathTools.DefaultRoundingPrecision) { - return Math.round(value * precision) / precision; - } -} -MathTools.DefaultRoundingPrecision = 100; - -// node_modules/@babylonjs/gui/2D/controls/control.js -class Control { - get isReadOnly() { - return this._isReadOnly; - } - set isReadOnly(value) { - this._isReadOnly = value; - } - get transformedMeasure() { - return this._evaluatedMeasure; - } - set clipChildren(value) { - this._clipChildren = value; - } - get clipChildren() { - return this._clipChildren; - } - set clipContent(value) { - this._clipContent = value; - } - get clipContent() { - return this._clipContent; - } - get shadowOffsetX() { - return this._shadowOffsetX; - } - set shadowOffsetX(value) { - if (this._shadowOffsetX === value) { - return; + }, + createYieldingScheduler: () => { + { + return createYieldingScheduler; } - this._shadowOffsetX = value; - this._markAsDirty(); - } - get shadowOffsetY() { - return this._shadowOffsetY; - } - set shadowOffsetY(value) { - if (this._shadowOffsetY === value) { - return; + }, + createPBRSubSurfacePlugin: () => { + { + return createPBRSubSurfacePlugin; } - this._shadowOffsetY = value; - this._markAsDirty(); - } - get shadowBlur() { - return this._shadowBlur; - } - set shadowBlur(value) { - if (this._shadowBlur === value) { - return; + }, + createPBRSheenPlugin: () => { + { + return createPBRSheenPlugin; } - this._previousShadowBlur = this._shadowBlur; - this._shadowBlur = value; - this._markAsDirty(); - } - get shadowColor() { - return this._shadowColor; - } - set shadowColor(value) { - if (this._shadowColor === value) { - return; + }, + createPBRIridescencePlugin: () => { + { + return createPBRIridescencePlugin; } - this._shadowColor = value; - this._markAsDirty(); - } - get typeName() { - return this._getTypeName(); - } - getClassName() { - return this._getTypeName(); - } - set accessibilityTag(value) { - this._accessibilityTag = value; - this.onAccessibilityTagChangedObservable.notifyObservers(value); - } - get accessibilityTag() { - return this._accessibilityTag; - } - get host() { - return this._host; - } - get fontOffset() { - return this._fontOffset; - } - set fontOffset(offset) { - this._fontOffset = offset; - } - get alpha() { - return this._alpha; - } - set alpha(value) { - if (this._alpha === value) { - return; + }, + createPBRClearCoatPlugin: () => { + { + return createPBRClearCoatPlugin; } - this._alphaSet = true; - this._alpha = value; - this._markAsDirty(); - } - get highlightLineWidth() { - return this._highlightLineWidth; - } - set highlightLineWidth(value) { - if (this._highlightLineWidth === value) { - return; + }, + createPBRBRDFPlugin: () => { + { + return createPBRBRDFPlugin; } - this._highlightLineWidth = value; - this._markAsDirty(); - } - get isHighlighted() { - return this._isHighlighted; - } - set isHighlighted(value) { - if (this._isHighlighted === value) { - return; + }, + createPBRAnisotropicPlugin: () => { + { + return createPBRAnisotropicPlugin; } - this._isHighlighted = value; - this._markAsDirty(); - } - get highlightColor() { - return this._highlightColor; - } - set highlightColor(value) { - if (this._highlightColor === value) { - return; + }, + createDetailMapPlugin: () => { + { + return createDetailMapPlugin; } - this._highlightColor = value; - this._markAsDirty(); - } - get scaleX() { - return this._scaleX; - } - set scaleX(value) { - if (this._scaleX === value) { - return; + }, + className: () => { + { + return className; } - this._scaleX = value; - this._markAsDirty(); - this._markMatrixAsDirty(); - } - get scaleY() { - return this._scaleY; - } - set scaleY(value) { - if (this._scaleY === value) { - return; + }, + captureEquirectangularFromScene: () => { + { + return captureEquirectangularFromScene; } - this._scaleY = value; - this._markAsDirty(); - this._markMatrixAsDirty(); - } - get rotation() { - return this._rotation; - } - set rotation(value) { - if (this._rotation === value) { - return; + }, + bindClipPlane: () => { + { + return bindClipPlane; } - this._rotation = value; - this._markAsDirty(); - this._markMatrixAsDirty(); - } - get transformCenterY() { - return this._transformCenterY; - } - set transformCenterY(value) { - if (this._transformCenterY === value) { - return; + }, + allocateAndCopyTypedBuffer: () => { + { + return allocateAndCopyTypedBuffer; } - this._transformCenterY = value; - this._markAsDirty(); - this._markMatrixAsDirty(); - } - get transformCenterX() { - return this._transformCenterX; - } - set transformCenterX(value) { - if (this._transformCenterX === value) { - return; + }, + addClipPlaneUniforms: () => { + { + return addClipPlaneUniforms; } - this._transformCenterX = value; - this._markAsDirty(); - this._markMatrixAsDirty(); - } - get horizontalAlignment() { - return this._horizontalAlignment; - } - set horizontalAlignment(value) { - if (this._horizontalAlignment === value) { - return; + }, + _staticOffsetValueVector3: () => { + { + return _staticOffsetValueVector3; } - this._horizontalAlignment = value; - this._markAsDirty(); - } - get verticalAlignment() { - return this._verticalAlignment; - } - set verticalAlignment(value) { - if (this._verticalAlignment === value) { - return; + }, + _staticOffsetValueVector2: () => { + { + return _staticOffsetValueVector2; } - this._verticalAlignment = value; - this._markAsDirty(); - } - set fixedRatio(value) { - if (this._fixedRatio === value) { - return; + }, + _staticOffsetValueSize: () => { + { + return _staticOffsetValueSize; } - this._fixedRatio = value; - this._markAsDirty(); - } - get fixedRatio() { - return this._fixedRatio; - } - set fixedRatioMasterIsWidth(value) { - if (this._fixedRatioMasterIsWidth === value) { - return; + }, + _staticOffsetValueQuaternion: () => { + { + return _staticOffsetValueQuaternion; } - this._fixedRatioMasterIsWidth = value; - this._markAsDirty(); - } - get fixedRatioMasterIsWidth() { - return this._fixedRatioMasterIsWidth; - } - get width() { - return this._width.toString(this._host); - } - set width(value) { - this._fixedRatioMasterIsWidth = true; - if (this._width.toString(this._host) === value) { - return; + }, + _staticOffsetValueColor4: () => { + { + return _staticOffsetValueColor4; } - if (this._width.fromString(value)) { - this._markAsDirty(); + }, + _staticOffsetValueColor3: () => { + { + return _staticOffsetValueColor3; } - } - get widthInPixels() { - return this._width.getValueInPixel(this._host, this._cachedParentMeasure.width); - } - set widthInPixels(value) { - if (isNaN(value)) { - return; + }, + _injectLTSFileTools: () => { + { + return _injectLTSFileTools; } - this._fixedRatioMasterIsWidth = true; - this.width = value + "px"; - } - get height() { - return this._height.toString(this._host); - } - set height(value) { - this._fixedRatioMasterIsWidth = false; - if (this._height.toString(this._host) === value) { - return; + }, + _forceTransformFeedbackToBundle: () => { + { + return _forceTransformFeedbackToBundle; } - if (this._height.fromString(value)) { - this._markAsDirty(); + }, + _forceSceneHelpersToBundle: () => { + { + return _forceSceneHelpersToBundle; } - } - get heightInPixels() { - return this._height.getValueInPixel(this._host, this._cachedParentMeasure.height); - } - set heightInPixels(value) { - if (isNaN(value)) { - return; + }, + _UpdateRGBDAsync: () => { + { + return _UpdateRGBDAsync; } - this._fixedRatioMasterIsWidth = false; - this.height = value + "px"; - } - get fontFamily() { - return this._fontFamily; - } - set fontFamily(value) { - if (this._fontFamily === value) { - return; + }, + _TimeToken: () => { + { + return _TimeToken; } - this._fontFamily = value; - this._resetFontCache(); - } - get fontStyle() { - return this._fontStyle; - } - set fontStyle(value) { - if (this._fontStyle === value) { - return; + }, + _TGATextureLoader: () => { + { + return _TGATextureLoader; } - this._fontStyle = value; - this._resetFontCache(); - } - get fontWeight() { - return this._fontWeight; - } - set fontWeight(value) { - if (this._fontWeight === value) { - return; + }, + _PrimaryIsoTriangle: () => { + { + return _PrimaryIsoTriangle; } - this._fontWeight = value; - this._resetFontCache(); - } - get style() { - return this._style; - } - set style(value) { - if (this._style) { - this._style.onChangedObservable.remove(this._styleObserver); - this._styleObserver = null; + }, + _OcclusionDataStorage: () => { + { + return _OcclusionDataStorage; } - this._style = value; - if (this._style) { - this._styleObserver = this._style.onChangedObservable.add(() => { - this._markAsDirty(); - this._resetFontCache(); - }); + }, + _MeshCollisionData: () => { + { + return _MeshCollisionData; } - this._markAsDirty(); - this._resetFontCache(); - } - get _isFontSizeInPercentage() { - return this._fontSize.isPercentage; - } - get fontSizeInPixels() { - const fontSizeToUse = this._style ? this._style._fontSize : this._fontSize; - if (fontSizeToUse.isPixel) { - return fontSizeToUse.getValue(this._host); + }, + _KTXTextureLoader: () => { + { + return _KTXTextureLoader; } - return fontSizeToUse.getValueInPixel(this._host, this._tempParentMeasure.height || this._cachedParentMeasure.height); - } - set fontSizeInPixels(value) { - if (isNaN(value)) { - return; + }, + _InstancesBatch: () => { + { + return _InstancesBatch; } - this.fontSize = value + "px"; - } - get fontSize() { - return this._fontSize.toString(this._host); - } - set fontSize(value) { - if (this._fontSize.toString(this._host) === value) { - return; + }, + _HDRTextureLoader: () => { + { + return _HDRTextureLoader; } - if (this._fontSize.fromString(value)) { - this._markAsDirty(); - this._resetFontCache(); + }, + _ENVTextureLoader: () => { + { + return _ENVTextureLoader; } - } - get color() { - return this._color; - } - set color(value) { - if (this._color === value) { - return; + }, + _DDSTextureLoader: () => { + { + return _DDSTextureLoader; } - this._color = value; - this._markAsDirty(); - } - get gradient() { - return this._gradient; - } - set gradient(value) { - if (this._gradient === value) { - return; + }, + _CreationDataStorage: () => { + { + return _CreationDataStorage; } - this._gradient = value; - this._markAsDirty(); - } - get zIndex() { - return this._zIndex; - } - set zIndex(value) { - if (this.zIndex === value) { - return; + }, + _BasisTextureLoader: () => { + { + return _BasisTextureLoader; } - this._zIndex = value; - if (this.parent) { - this.parent._reOrderControl(this); + }, + _BabylonLoaderRegistered: () => { + { + return _BabylonLoaderRegistered; } - } - get notRenderable() { - return this._doNotRender; - } - set notRenderable(value) { - if (this._doNotRender === value) { - return; + }, + XboxInput: () => { + { + return XboxInput; } - this._doNotRender = value; - this._markAsDirty(); - } - get isVisible() { - return this._isVisible; - } - set isVisible(value) { - if (this._isVisible === value) { - return; + }, + Xbox360Pad: () => { + { + return Xbox360Pad; } - this._isVisible = value; - this._markAsDirty(true); - this.onIsVisibleChangedObservable.notifyObservers(value); - } - get isDirty() { - return this._isDirty; - } - get linkedMesh() { - return this._linkedMesh; - } - get descendantsOnlyPadding() { - return this._descendantsOnlyPadding; - } - set descendantsOnlyPadding(value) { - if (this._descendantsOnlyPadding === value) { - return; + }, + Xbox360Dpad: () => { + { + return Xbox360Dpad; } - this._descendantsOnlyPadding = value; - this._markAsDirty(); - } - get paddingLeft() { - return this._paddingLeft.toString(this._host); - } - set paddingLeft(value) { - if (this._paddingLeft.fromString(value)) { - this._markAsDirty(); + }, + Xbox360Button: () => { + { + return Xbox360Button; } - } - get paddingLeftInPixels() { - return this._paddingLeft.getValueInPixel(this._host, this._cachedParentMeasure.width); - } - set paddingLeftInPixels(value) { - if (isNaN(value)) { - return; + }, + XRSpaceWarpRenderTarget: () => { + { + return XRSpaceWarpRenderTarget; } - this.paddingLeft = value + "px"; - } - get _paddingLeftInPixels() { - if (this._descendantsOnlyPadding) { - return 0; + }, + WorleyNoise3DBlock: () => { + { + return WorleyNoise3DBlock; } - return this.paddingLeftInPixels; - } - get paddingRight() { - return this._paddingRight.toString(this._host); - } - set paddingRight(value) { - if (this._paddingRight.fromString(value)) { - this._markAsDirty(); + }, + WorkerPool: () => { + { + return WorkerPool; } - } - get paddingRightInPixels() { - return this._paddingRight.getValueInPixel(this._host, this._cachedParentMeasure.width); - } - set paddingRightInPixels(value) { - if (isNaN(value)) { - return; + }, + WeightedSound: () => { + { + return WeightedSound; } - this.paddingRight = value + "px"; - } - get _paddingRightInPixels() { - if (this._descendantsOnlyPadding) { - return 0; + }, + WebXRWalkingLocomotion: () => { + { + return WebXRWalkingLocomotion; } - return this.paddingRightInPixels; - } - get paddingTop() { - return this._paddingTop.toString(this._host); - } - set paddingTop(value) { - if (this._paddingTop.fromString(value)) { - this._markAsDirty(); + }, + WebXRTrackingState: () => { + { + return WebXRTrackingState; } - } - get paddingTopInPixels() { - return this._paddingTop.getValueInPixel(this._host, this._cachedParentMeasure.height); - } - set paddingTopInPixels(value) { - if (isNaN(value)) { - return; + }, + WebXRState: () => { + { + return WebXRState; } - this.paddingTop = value + "px"; - } - get _paddingTopInPixels() { - if (this._descendantsOnlyPadding) { - return 0; + }, + WebXRSpaceWarpRenderTargetTextureProvider: () => { + { + return WebXRSpaceWarpRenderTargetTextureProvider; } - return this.paddingTopInPixels; - } - get paddingBottom() { - return this._paddingBottom.toString(this._host); - } - set paddingBottom(value) { - if (this._paddingBottom.fromString(value)) { - this._markAsDirty(); + }, + WebXRSpaceWarp: () => { + { + return WebXRSpaceWarp; } - } - get paddingBottomInPixels() { - return this._paddingBottom.getValueInPixel(this._host, this._cachedParentMeasure.height); - } - set paddingBottomInPixels(value) { - if (isNaN(value)) { - return; + }, + WebXRSessionManager: () => { + { + return WebXRSessionManager; } - this.paddingBottom = value + "px"; - } - get _paddingBottomInPixels() { - if (this._descendantsOnlyPadding) { - return 0; + }, + WebXRRawCameraAccess: () => { + { + return WebXRRawCameraAccess; } - return this.paddingBottomInPixels; - } - get left() { - return this._left.toString(this._host); - } - set left(value) { - if (this._left.fromString(value)) { - this._markAsDirty(); + }, + WebXRProjectionLayerWrapper: () => { + { + return WebXRProjectionLayerWrapper; } - } - get leftInPixels() { - return this._left.getValueInPixel(this._host, this._cachedParentMeasure.width); - } - set leftInPixels(value) { - if (isNaN(value)) { - return; + }, + WebXRProfiledMotionController: () => { + { + return WebXRProfiledMotionController; } - this.left = value + "px"; - } - get top() { - return this._top.toString(this._host); - } - set top(value) { - if (this._top.fromString(value)) { - this._markAsDirty(); + }, + WebXRPlaneDetector: () => { + { + return WebXRPlaneDetector; } - } - get topInPixels() { - return this._top.getValueInPixel(this._host, this._cachedParentMeasure.height); - } - set topInPixels(value) { - if (isNaN(value)) { - return; + }, + WebXROculusTouchMotionController: () => { + { + return WebXROculusTouchMotionController; } - this.top = value + "px"; - } - get linkOffsetX() { - return this._linkOffsetX.toString(this._host); - } - set linkOffsetX(value) { - if (this._linkOffsetX.fromString(value)) { - this._markAsDirty(); + }, + WebXRNearInteraction: () => { + { + return WebXRNearInteraction; } - } - get linkOffsetXInPixels() { - return this._linkOffsetX.getValueInPixel(this._host, this._cachedParentMeasure.width); - } - set linkOffsetXInPixels(value) { - if (isNaN(value)) { - return; + }, + WebXRNearControllerMode: () => { + { + return WebXRNearControllerMode; } - this.linkOffsetX = value + "px"; - } - get linkOffsetY() { - return this._linkOffsetY.toString(this._host); - } - set linkOffsetY(value) { - if (this._linkOffsetY.fromString(value)) { - this._markAsDirty(); + }, + WebXRMotionControllerTeleportation: () => { + { + return WebXRMotionControllerTeleportation; } - } - get linkOffsetYInPixels() { - return this._linkOffsetY.getValueInPixel(this._host, this._cachedParentMeasure.height); - } - set linkOffsetYInPixels(value) { - if (isNaN(value)) { - return; + }, + WebXRMotionControllerManager: () => { + { + return WebXRMotionControllerManager; } - this.linkOffsetY = value + "px"; - } - get centerX() { - return this._currentMeasure.left + this._currentMeasure.width / 2; - } - get centerY() { - return this._currentMeasure.top + this._currentMeasure.height / 2; - } - get isEnabled() { - return this._isEnabled; - } - set isEnabled(value) { - if (this._isEnabled === value) { - return; + }, + WebXRMicrosoftMixedRealityController: () => { + { + return WebXRMicrosoftMixedRealityController; } - this._isEnabled = value; - this._markAsDirty(); - const recursivelyFirePointerOut = (control) => { - if (!control.host) { - return; - } - for (const pointer in control.host._lastControlOver) { - if (control === this.host._lastControlOver[pointer]) { - control._onPointerOut(control, null, true); - delete control.host._lastControlOver[pointer]; - } - } - if (control.children !== undefined) { - control.children.forEach(recursivelyFirePointerOut); - } - }; - recursivelyFirePointerOut(this); - this.onEnabledStateChangedObservable.notifyObservers(value); - } - get disabledColor() { - return this._disabledColor; - } - set disabledColor(value) { - if (this._disabledColor === value) { - return; + }, + WebXRMeshDetector: () => { + { + return WebXRMeshDetector; } - this._disabledColor = value; - this._markAsDirty(); - } - get disabledColorItem() { - return this._disabledColorItem; - } - set disabledColorItem(value) { - if (this._disabledColorItem === value) { - return; + }, + WebXRManagedOutputCanvasOptions: () => { + { + return WebXRManagedOutputCanvasOptions; } - this._disabledColorItem = value; - this._markAsDirty(); - } - constructor(name265) { - this.name = name265; - this._alpha = 1; - this._alphaSet = false; - this._zIndex = 0; - this._currentMeasure = Measure.Empty(); - this._tempPaddingMeasure = Measure.Empty(); - this._fontFamily = ""; - this._fontStyle = ""; - this._fontWeight = ""; - this._fontSize = new ValueAndUnit(18, ValueAndUnit.UNITMODE_PIXEL, false); - this._width = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false); - this._height = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false); - this._color = ""; - this._style = null; - this._horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER; - this._verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER; - this._isDirty = true; - this._wasDirty = false; - this._tempParentMeasure = Measure.Empty(); - this._prevCurrentMeasureTransformedIntoGlobalSpace = Measure.Empty(); - this._cachedParentMeasure = Measure.Empty(); - this._descendantsOnlyPadding = false; - this._paddingLeft = new ValueAndUnit(0); - this._paddingRight = new ValueAndUnit(0); - this._paddingTop = new ValueAndUnit(0); - this._paddingBottom = new ValueAndUnit(0); - this._left = new ValueAndUnit(0); - this._top = new ValueAndUnit(0); - this._scaleX = 1; - this._scaleY = 1; - this._rotation = 0; - this._transformCenterX = 0.5; - this._transformCenterY = 0.5; - this._transformMatrix = Matrix2D.Identity(); - this._invertTransformMatrix = Matrix2D.Identity(); - this._transformedPosition = Vector2.Zero(); - this._isMatrixDirty = true; - this._isVisible = true; - this._isHighlighted = false; - this._highlightColor = "#4affff"; - this._highlightLineWidth = 2; - this._fontSet = false; - this._dummyVector2 = Vector2.Zero(); - this._downCount = 0; - this._enterCount = -1; - this._doNotRender = false; - this._downPointerIds = {}; - this._evaluatedMeasure = new Measure(0, 0, 0, 0); - this._evaluatedParentMeasure = new Measure(0, 0, 0, 0); - this._isEnabled = true; - this._disabledColor = "#9a9a9a"; - this._disabledColorItem = "#6a6a6a"; - this._isReadOnly = false; - this._gradient = null; - this._rebuildLayout = false; - this.onEnabledStateChangedObservable = new Observable; - this._customData = {}; - this._isClipped = false; - this._automaticSize = false; - this.metadata = null; - this.isHitTestVisible = true; - this.isPointerBlocker = false; - this.isFocusInvisible = false; - this._clipChildren = true; - this._clipContent = true; - this.useBitmapCache = false; - this._shadowOffsetX = 0; - this._shadowOffsetY = 0; - this._shadowBlur = 0; - this._previousShadowBlur = 0; - this._shadowColor = "black"; - this.hoverCursor = ""; - this._linkOffsetX = new ValueAndUnit(0); - this._linkOffsetY = new ValueAndUnit(0); - this._accessibilityTag = null; - this.onAccessibilityTagChangedObservable = new Observable; - this.onWheelObservable = new Observable; - this.onPointerMoveObservable = new Observable; - this.onPointerOutObservable = new Observable; - this.onPointerDownObservable = new Observable; - this.onPointerUpObservable = new Observable; - this.onPointerClickObservable = new Observable; - this.onPointerEnterObservable = new Observable; - this.onDirtyObservable = new Observable; - this.onBeforeDrawObservable = new Observable; - this.onAfterDrawObservable = new Observable; - this.onDisposeObservable = new Observable; - this.onIsVisibleChangedObservable = new Observable; - this._fixedRatio = 0; - this._fixedRatioMasterIsWidth = true; - this.animations = null; - this._tmpMeasureA = new Measure(0, 0, 0, 0); - } - _getTypeName() { - return "Control"; - } - getAscendantOfClass(className) { - if (!this.parent) { - return null; + }, + WebXRManagedOutputCanvas: () => { + { + return WebXRManagedOutputCanvas; } - if (this.parent.getClassName() === className) { - return this.parent; + }, + WebXRLightEstimation: () => { + { + return WebXRLightEstimation; } - return this.parent.getAscendantOfClass(className); - } - markAsDirty(force = false) { - this._markAsDirty(force); - } - markAllAsDirty() { - this._markAllAsDirty(); - } - _resetFontCache() { - this._fontSet = true; - this._markAsDirty(); - } - isAscendant(container) { - if (!this.parent) { - return false; + }, + WebXRLayers: () => { + { + return WebXRLayers; } - if (this.parent === container) { - return true; + }, + WebXRInputSource: () => { + { + return WebXRInputSource; } - return this.parent.isAscendant(container); - } - getLocalCoordinates(globalCoordinates) { - const result = Vector2.Zero(); - this.getLocalCoordinatesToRef(globalCoordinates, result); - return result; - } - getLocalCoordinatesToRef(globalCoordinates, result) { - result.x = globalCoordinates.x - this._currentMeasure.left; - result.y = globalCoordinates.y - this._currentMeasure.top; - return this; - } - getParentLocalCoordinates(globalCoordinates) { - const result = Vector2.Zero(); - result.x = globalCoordinates.x - this._cachedParentMeasure.left; - result.y = globalCoordinates.y - this._cachedParentMeasure.top; - return result; - } - moveToVector3(position, scene37) { - if (!this._host || this.parent !== this._host._rootContainer) { - Tools.Error("Cannot move a control to a vector3 if the control is not at root level"); - return; + }, + WebXRInput: () => { + { + return WebXRInput; } - this.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - this.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP; - const globalViewport = this._host._getGlobalViewport(); - const projectedPosition = Vector3.Project(position, Matrix.IdentityReadOnly, scene37.getTransformMatrix(), globalViewport); - this._moveToProjectedPosition(projectedPosition); - if (projectedPosition.z < 0 || projectedPosition.z > 1) { - this.notRenderable = true; - return; + }, + WebXRImageTracking: () => { + { + return WebXRImageTracking; } - this.notRenderable = false; - } - getDescendantsToRef(results, directDescendantsOnly = false, predicate) { - } - getDescendants(directDescendantsOnly, predicate) { - const results = []; - this.getDescendantsToRef(results, directDescendantsOnly, predicate); - return results; - } - linkWithMesh(mesh72) { - if (!this._host || this.parent && this.parent !== this._host._rootContainer) { - if (mesh72) { - Tools.Error("Cannot link a control to a mesh if the control is not at root level"); - } - return; + }, + WebXRHitTestLegacy: () => { + { + return WebXRHitTestLegacy; } - const index = this._host._linkedControls.indexOf(this); - if (index !== -1) { - this._linkedMesh = mesh72; - if (!mesh72) { - this._host._linkedControls.splice(index, 1); - } - return; - } else if (!mesh72) { - return; + }, + WebXRHitTest: () => { + { + return WebXRHitTest; } - this.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - this.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP; - this._linkedMesh = mesh72; - this._host._linkedControls.push(this); - } - setPadding(paddingTop, paddingRight, paddingBottom, paddingLeft) { - const top = paddingTop; - const right = paddingRight !== null && paddingRight !== undefined ? paddingRight : top; - const bottom = paddingBottom !== null && paddingBottom !== undefined ? paddingBottom : top; - const left = paddingLeft !== null && paddingLeft !== undefined ? paddingLeft : right; - this.paddingTop = top; - this.paddingRight = right; - this.paddingBottom = bottom; - this.paddingLeft = left; - } - setPaddingInPixels(paddingTop, paddingRight, paddingBottom, paddingLeft) { - const top = paddingTop; - const right = paddingRight !== null && paddingRight !== undefined ? paddingRight : top; - const bottom = paddingBottom !== null && paddingBottom !== undefined ? paddingBottom : top; - const left = paddingLeft !== null && paddingLeft !== undefined ? paddingLeft : right; - this.paddingTopInPixels = top; - this.paddingRightInPixels = right; - this.paddingBottomInPixels = bottom; - this.paddingLeftInPixels = left; - } - _moveToProjectedPosition(projectedPosition) { - var _a; - const oldLeft = this._left.getValue(this._host); - const oldTop = this._top.getValue(this._host); - const parentMeasure = (_a = this.parent) === null || _a === undefined ? undefined : _a._currentMeasure; - if (parentMeasure) { - this._processMeasures(parentMeasure, this._host.getContext()); + }, + WebXRHandTracking: () => { + { + return WebXRHandTracking; } - let newLeft = projectedPosition.x + this._linkOffsetX.getValue(this._host) - this._currentMeasure.width / 2; - let newTop = projectedPosition.y + this._linkOffsetY.getValue(this._host) - this._currentMeasure.height / 2; - const leftAndTopIgnoreAdaptiveScaling = this._left.ignoreAdaptiveScaling && this._top.ignoreAdaptiveScaling; - if (leftAndTopIgnoreAdaptiveScaling) { - if (Math.abs(newLeft - oldLeft) < 0.5) { - newLeft = oldLeft; - } - if (Math.abs(newTop - oldTop) < 0.5) { - newTop = oldTop; - } + }, + WebXRHandJoint: () => { + { + return WebXRHandJoint; } - if (!leftAndTopIgnoreAdaptiveScaling && oldLeft === newLeft && oldTop === newTop) { - return; + }, + WebXRHand: () => { + { + return WebXRHand; } - this.left = newLeft + "px"; - this.top = newTop + "px"; - this._left.ignoreAdaptiveScaling = true; - this._top.ignoreAdaptiveScaling = true; - this._markAsDirty(); - } - _offsetLeft(offset) { - this._isDirty = true; - this._currentMeasure.left += offset; - } - _offsetTop(offset) { - this._isDirty = true; - this._currentMeasure.top += offset; - } - _markMatrixAsDirty() { - this._isMatrixDirty = true; - this._flagDescendantsAsMatrixDirty(); - } - _flagDescendantsAsMatrixDirty() { - } - _intersectsRect(rect, context) { - this._transform(context); - if (this._evaluatedMeasure.left >= rect.left + rect.width) { - return false; + }, + WebXRHTCViveMotionController: () => { + { + return WebXRHTCViveMotionController; } - if (this._evaluatedMeasure.top >= rect.top + rect.height) { - return false; + }, + WebXRGenericTriggerMotionController: () => { + { + return WebXRGenericTriggerMotionController; } - if (this._evaluatedMeasure.left + this._evaluatedMeasure.width <= rect.left) { - return false; + }, + WebXRGenericHandController: () => { + { + return WebXRGenericHandController; } - if (this._evaluatedMeasure.top + this._evaluatedMeasure.height <= rect.top) { - return false; + }, + WebXRFeaturesManager: () => { + { + return WebXRFeaturesManager; } - return true; - } - _computeAdditionalOffsetX() { - return 0; - } - _computeAdditionalOffsetY() { - return 0; - } - invalidateRect() { - this._transform(); - if (this.host && this.host.useInvalidateRectOptimization) { - this._currentMeasure.transformToRef(this._transformMatrix, this._tmpMeasureA); - Measure.CombineToRef(this._tmpMeasureA, this._prevCurrentMeasureTransformedIntoGlobalSpace, this._tmpMeasureA); - const shadowOffsetX = this.shadowOffsetX; - const shadowOffsetY = this.shadowOffsetY; - const shadowBlur = Math.max(this._previousShadowBlur, this.shadowBlur); - const leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0); - const rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0); - const topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0); - const bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0); - const offsetX = this._computeAdditionalOffsetX(); - const offsetY = this._computeAdditionalOffsetY(); - this.host.invalidateRect(Math.floor(this._tmpMeasureA.left + leftShadowOffset - offsetX), Math.floor(this._tmpMeasureA.top + topShadowOffset - offsetY), Math.ceil(this._tmpMeasureA.left + this._tmpMeasureA.width + rightShadowOffset + offsetX), Math.ceil(this._tmpMeasureA.top + this._tmpMeasureA.height + bottomShadowOffset + offsetY)); + }, + WebXRFeaturePointSystem: () => { + { + return WebXRFeaturePointSystem; } - } - _markAsDirty(force = false) { - if (!this._isVisible && !force) { - return; + }, + WebXRFeatureName: () => { + { + return WebXRFeatureName; } - this._isDirty = true; - this._markMatrixAsDirty(); - if (this._host) { - this._host.markAsDirty(); + }, + WebXREyeTracking: () => { + { + return WebXREyeTracking; } - } - _markAllAsDirty() { - this._markAsDirty(); - if (this._font) { - this._prepareFont(); + }, + WebXRExperienceHelper: () => { + { + return WebXRExperienceHelper; } - } - _link(host) { - this._host = host; - if (this._host) { - this.uniqueId = this._host.getScene().getUniqueId(); + }, + WebXREnterExitUIOptions: () => { + { + return WebXREnterExitUIOptions; } - } - _transform(context) { - if (!this._isMatrixDirty && this._scaleX === 1 && this._scaleY === 1 && this._rotation === 0) { - return; + }, + WebXREnterExitUIButton: () => { + { + return WebXREnterExitUIButton; } - const offsetX = this._currentMeasure.width * this._transformCenterX + this._currentMeasure.left; - const offsetY = this._currentMeasure.height * this._transformCenterY + this._currentMeasure.top; - if (context) { - context.translate(offsetX, offsetY); - context.rotate(this._rotation); - context.scale(this._scaleX, this._scaleY); - context.translate(-offsetX, -offsetY); + }, + WebXREnterExitUI: () => { + { + return WebXREnterExitUI; } - if (this._isMatrixDirty || this._cachedOffsetX !== offsetX || this._cachedOffsetY !== offsetY) { - this._cachedOffsetX = offsetX; - this._cachedOffsetY = offsetY; - this._isMatrixDirty = false; - this._flagDescendantsAsMatrixDirty(); - Matrix2D.ComposeToRef(-offsetX, -offsetY, this._rotation, this._scaleX, this._scaleY, this.parent ? this.parent._transformMatrix : null, this._transformMatrix); - this._transformMatrix.invertToRef(this._invertTransformMatrix); - this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure); + }, + WebXRDomOverlay: () => { + { + return WebXRDomOverlay; } - } - _renderHighlight(context) { - if (!this.isHighlighted) { - return; + }, + WebXRDepthSensing: () => { + { + return WebXRDepthSensing; } - context.save(); - context.strokeStyle = this._highlightColor; - context.lineWidth = this._highlightLineWidth; - this._renderHighlightSpecific(context); - context.restore(); - } - _renderHighlightSpecific(context) { - context.strokeRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); - } - _getColor(context) { - return this.gradient ? this.gradient.getCanvasGradient(context) : this.color; - } - _applyStates(context) { - if (this._isFontSizeInPercentage) { - this._fontSet = true; + }, + WebXRDefaultExperienceOptions: () => { + { + return WebXRDefaultExperienceOptions; } - if (this._host && this._host.useSmallestIdeal && !this._font) { - this._fontSet = true; + }, + WebXRDefaultExperience: () => { + { + return WebXRDefaultExperience; } - if (this._fontSet) { - this._prepareFont(); - this._fontSet = false; + }, + WebXRControllerPointerSelection: () => { + { + return WebXRControllerPointerSelection; } - if (this._font) { - context.font = this._font; + }, + WebXRControllerPhysics: () => { + { + return WebXRControllerPhysics; } - if (this._color || this.gradient) { - context.fillStyle = this._getColor(context); + }, + WebXRControllerMovement: () => { + { + return WebXRControllerMovement; } - if (Control.AllowAlphaInheritance) { - context.globalAlpha *= this._alpha; - } else if (this._alphaSet) { - context.globalAlpha = this.parent && !this.parent.renderToIntermediateTexture ? this.parent.alpha * this._alpha : this._alpha; + }, + WebXRControllerComponent: () => { + { + return WebXRControllerComponent; } - } - _layout(parentMeasure, context) { - if (!this.isDirty && (!this.isVisible || this.notRenderable)) { - return false; + }, + WebXRCompositionLayerWrapper: () => { + { + return WebXRCompositionLayerWrapper; } - if (this._isDirty || !this._cachedParentMeasure.isEqualsTo(parentMeasure)) { - this.host._numLayoutCalls++; - this._currentMeasure.addAndTransformToRef(this._transformMatrix, -this._paddingLeftInPixels | 0, -this._paddingTopInPixels | 0, this._paddingRightInPixels | 0, this._paddingBottomInPixels | 0, this._prevCurrentMeasureTransformedIntoGlobalSpace); - context.save(); - this._applyStates(context); - let rebuildCount = 0; - do { - this._rebuildLayout = false; - this._processMeasures(parentMeasure, context); - rebuildCount++; - } while (this._rebuildLayout && rebuildCount < 3); - if (rebuildCount >= 3) { - Logger.Error(`Layout cycle detected in GUI (Control name=${this.name}, uniqueId=${this.uniqueId})`); - } - context.restore(); - this.invalidateRect(); - this._evaluateClippingState(parentMeasure); + }, + WebXRCamera: () => { + { + return WebXRCamera; } - this._wasDirty = this._isDirty; - this._isDirty = false; - return true; - } - _processMeasures(parentMeasure, context) { - this._tempPaddingMeasure.copyFrom(parentMeasure); - if (this.parent && this.parent.descendantsOnlyPadding) { - this._tempPaddingMeasure.left += this.parent.paddingLeftInPixels; - this._tempPaddingMeasure.top += this.parent.paddingTopInPixels; - this._tempPaddingMeasure.width -= this.parent.paddingLeftInPixels + this.parent.paddingRightInPixels; - this._tempPaddingMeasure.height -= this.parent.paddingTopInPixels + this.parent.paddingBottomInPixels; + }, + WebXRBackgroundRemover: () => { + { + return WebXRBackgroundRemover; } - this._currentMeasure.copyFrom(this._tempPaddingMeasure); - this._preMeasure(this._tempPaddingMeasure, context); - this._measure(); - this._postMeasure(this._tempPaddingMeasure, context); - this._computeAlignment(this._tempPaddingMeasure, context); - this._currentMeasure.left = this._currentMeasure.left | 0; - this._currentMeasure.top = this._currentMeasure.top | 0; - this._currentMeasure.width = this._currentMeasure.width | 0; - this._currentMeasure.height = this._currentMeasure.height | 0; - this._additionalProcessing(this._tempPaddingMeasure, context); - this._cachedParentMeasure.copyFrom(this._tempPaddingMeasure); - this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure); - if (this.onDirtyObservable.hasObservers()) { - this.onDirtyObservable.notifyObservers(this); + }, + WebXRAnchorSystem: () => { + { + return WebXRAnchorSystem; } - } - _evaluateClippingState(parentMeasure) { - this._transform(); - this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure); - if (this.parent && this.parent.clipChildren) { - parentMeasure.transformToRef(this.parent._transformMatrix, this._evaluatedParentMeasure); - if (this._evaluatedMeasure.left > this._evaluatedParentMeasure.left + this._evaluatedParentMeasure.width) { - this._isClipped = true; - return; - } - if (this._evaluatedMeasure.left + this._evaluatedMeasure.width < this._evaluatedParentMeasure.left) { - this._isClipped = true; - return; - } - if (this._evaluatedMeasure.top > this._evaluatedParentMeasure.top + this._evaluatedParentMeasure.height) { - this._isClipped = true; - return; - } - if (this._evaluatedMeasure.top + this._evaluatedMeasure.height < this._evaluatedParentMeasure.top) { - this._isClipped = true; - return; - } + }, + WebXRAbstractMotionController: () => { + { + return WebXRAbstractMotionController; } - this._isClipped = false; - } - _measure() { - if (this._width.isPixel) { - this._currentMeasure.width = this._width.getValue(this._host); - } else { - this._currentMeasure.width *= this._width.getValue(this._host); + }, + WebXRAbstractFeature: () => { + { + return WebXRAbstractFeature; } - if (this._height.isPixel) { - this._currentMeasure.height = this._height.getValue(this._host); - } else { - this._currentMeasure.height *= this._height.getValue(this._host); + }, + WebRequest: () => { + { + return WebRequest; } - if (this._fixedRatio !== 0) { - if (this._fixedRatioMasterIsWidth) { - this._currentMeasure.height = this._currentMeasure.width * this._fixedRatio; - } else { - this._currentMeasure.width = this._currentMeasure.height * this._fixedRatio; - } + }, + WebGPUTintWASM: () => { + { + return WebGPUTintWASM; } - } - _computeAlignment(parentMeasure, context) { - const width = this._currentMeasure.width; - const height = this._currentMeasure.height; - const parentWidth = parentMeasure.width; - const parentHeight = parentMeasure.height; - let x = 0; - let y = 0; - switch (this.horizontalAlignment) { - case Control.HORIZONTAL_ALIGNMENT_LEFT: - x = 0; - break; - case Control.HORIZONTAL_ALIGNMENT_RIGHT: - x = parentWidth - width; - break; - case Control.HORIZONTAL_ALIGNMENT_CENTER: - x = (parentWidth - width) / 2; - break; + }, + WebGPUEngine: () => { + { + return WebGPUEngine; } - switch (this.verticalAlignment) { - case Control.VERTICAL_ALIGNMENT_TOP: - y = 0; - break; - case Control.VERTICAL_ALIGNMENT_BOTTOM: - y = parentHeight - height; - break; - case Control.VERTICAL_ALIGNMENT_CENTER: - y = (parentHeight - height) / 2; - break; + }, + WebGPUDrawContext: () => { + { + return WebGPUDrawContext; } - if (!this.descendantsOnlyPadding) { - if (this._paddingLeft.isPixel) { - this._currentMeasure.left += this._paddingLeft.getValue(this._host); - this._currentMeasure.width -= this._paddingLeft.getValue(this._host); - } else { - this._currentMeasure.left += parentWidth * this._paddingLeft.getValue(this._host); - this._currentMeasure.width -= parentWidth * this._paddingLeft.getValue(this._host); - } - if (this._paddingRight.isPixel) { - this._currentMeasure.width -= this._paddingRight.getValue(this._host); - } else { - this._currentMeasure.width -= parentWidth * this._paddingRight.getValue(this._host); - } - if (this._paddingTop.isPixel) { - this._currentMeasure.top += this._paddingTop.getValue(this._host); - this._currentMeasure.height -= this._paddingTop.getValue(this._host); - } else { - this._currentMeasure.top += parentHeight * this._paddingTop.getValue(this._host); - this._currentMeasure.height -= parentHeight * this._paddingTop.getValue(this._host); - } - if (this._paddingBottom.isPixel) { - this._currentMeasure.height -= this._paddingBottom.getValue(this._host); - } else { - this._currentMeasure.height -= parentHeight * this._paddingBottom.getValue(this._host); - } + }, + WebGPUDataBuffer: () => { + { + return WebGPUDataBuffer; } - if (this._left.isPixel) { - this._currentMeasure.left += this._left.getValue(this._host); - } else { - this._currentMeasure.left += parentWidth * this._left.getValue(this._host); + }, + WebGPUCacheSampler: () => { + { + return WebGPUCacheSampler; } - if (this._top.isPixel) { - this._currentMeasure.top += this._top.getValue(this._host); - } else { - this._currentMeasure.top += parentHeight * this._top.getValue(this._host); + }, + WebGPUCacheRenderPipelineTree: () => { + { + return WebGPUCacheRenderPipelineTree; } - this._currentMeasure.left += x; - this._currentMeasure.top += y; - } - _preMeasure(parentMeasure, context) { - } - _postMeasure(parentMeasure, context) { - } - _additionalProcessing(parentMeasure, context) { - } - _clipForChildren(context) { - } - _clip(context, invalidatedRectangle) { - context.beginPath(); - Control._ClipMeasure.copyFrom(this._currentMeasure); - if (invalidatedRectangle) { - invalidatedRectangle.transformToRef(this._invertTransformMatrix, this._tmpMeasureA); - const intersection = new Measure(0, 0, 0, 0); - intersection.left = Math.max(this._tmpMeasureA.left, this._currentMeasure.left); - intersection.top = Math.max(this._tmpMeasureA.top, this._currentMeasure.top); - intersection.width = Math.min(this._tmpMeasureA.left + this._tmpMeasureA.width, this._currentMeasure.left + this._currentMeasure.width) - intersection.left; - intersection.height = Math.min(this._tmpMeasureA.top + this._tmpMeasureA.height, this._currentMeasure.top + this._currentMeasure.height) - intersection.top; - Control._ClipMeasure.copyFrom(intersection); + }, + WebGPUCacheRenderPipeline: () => { + { + return WebGPUCacheRenderPipeline; } - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - const shadowOffsetX = this.shadowOffsetX; - const shadowOffsetY = this.shadowOffsetY; - const shadowBlur = this.shadowBlur; - const leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0); - const rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0); - const topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0); - const bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0); - context.rect(Control._ClipMeasure.left + leftShadowOffset, Control._ClipMeasure.top + topShadowOffset, Control._ClipMeasure.width + rightShadowOffset - leftShadowOffset, Control._ClipMeasure.height + bottomShadowOffset - topShadowOffset); - } else { - context.rect(Control._ClipMeasure.left, Control._ClipMeasure.top, Control._ClipMeasure.width, Control._ClipMeasure.height); + }, + WebGPUCacheBindGroups: () => { + { + return WebGPUCacheBindGroups; } - context.clip(); - } - _render(context, invalidatedRectangle) { - if (!this.isVisible || this.notRenderable || this._isClipped) { - this._isDirty = false; - return false; + }, + WebGLPipelineContext: () => { + { + return WebGLPipelineContext; } - this.host._numRenderCalls++; - context.save(); - this._applyStates(context); - this._transform(context); - if (this.clipContent) { - this._clip(context, invalidatedRectangle); + }, + WebGLHardwareTexture: () => { + { + return WebGLHardwareTexture; } - if (this.onBeforeDrawObservable.hasObservers()) { - this.onBeforeDrawObservable.notifyObservers(this); + }, + WebGLDataBuffer: () => { + { + return WebGLDataBuffer; } - if (this.useBitmapCache && !this._wasDirty && this._cacheData) { - context.putImageData(this._cacheData, this._currentMeasure.left, this._currentMeasure.top); - } else { - this._draw(context, invalidatedRectangle); + }, + WebGL2ShaderProcessor: () => { + { + return WebGL2ShaderProcessor; } - if (this.useBitmapCache && this._wasDirty) { - this._cacheData = context.getImageData(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + }, + WebGL2ParticleSystem: () => { + { + return WebGL2ParticleSystem; } - this._renderHighlight(context); - if (this.onAfterDrawObservable.hasObservers()) { - this.onAfterDrawObservable.notifyObservers(this); + }, + WaveBlockKind: () => { + { + return WaveBlockKind; } - context.restore(); - return true; - } - _draw(context, invalidatedRectangle) { - } - contains(x, y) { - this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition); - x = this._transformedPosition.x; - y = this._transformedPosition.y; - if (x < this._currentMeasure.left) { - return false; + }, + WaveBlock: () => { + { + return WaveBlock; } - if (x > this._currentMeasure.left + this._currentMeasure.width) { - return false; + }, + VoronoiNoiseBlock: () => { + { + return VoronoiNoiseBlock; } - if (y < this._currentMeasure.top) { - return false; + }, + VolumetricLightScatteringPostProcess: () => { + { + return VolumetricLightScatteringPostProcess; } - if (y > this._currentMeasure.top + this._currentMeasure.height) { - return false; + }, + VirtualJoysticksCamera: () => { + { + return VirtualJoysticksCamera; } - if (this.isPointerBlocker) { - this._host._shouldBlockPointer = true; + }, + VirtualJoystick: () => { + { + return VirtualJoystick; } - return true; - } - _processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) { - if (!this._isEnabled) { - return false; + }, + Viewport: () => { + { + return Viewport; } - if (!this.isHitTestVisible || !this.isVisible || this._doNotRender) { - return false; + }, + ViewDirectionBlock: () => { + { + return ViewDirectionBlock; } - if (!this.contains(x, y)) { - return false; + }, + VideoTexture: () => { + { + return VideoTexture; } - this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY); - return true; - } - _onPointerMove(target, coordinates, pointerId, pi) { - const canNotify = this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this, pi); - if (canNotify && this.parent != null && !this.isPointerBlocker) { - this.parent._onPointerMove(target, coordinates, pointerId, pi); + }, + VideoRecorder: () => { + { + return VideoRecorder; } - } - _onPointerEnter(target, pi) { - if (!this._isEnabled) { - return false; + }, + VideoDome: () => { + { + return VideoDome; } - if (this._enterCount > 0) { - return false; + }, + VertexStepMode: () => { + { + return VertexStepMode; } - if (this._enterCount === -1) { - this._enterCount = 0; + }, + VertexOutputBlock: () => { + { + return VertexOutputBlock; } - this._enterCount++; - const canNotify = this.onPointerEnterObservable.notifyObservers(this, -1, target, this, pi); - if (canNotify && this.parent != null && !this.isPointerBlocker) { - this.parent._onPointerEnter(target, pi); + }, + VertexFormat: () => { + { + return VertexFormat; } - return true; - } - _onPointerOut(target, pi, force = false) { - if (!force && (!this._isEnabled || target === this)) { - return; + }, + VertexDataMaterialInfo: () => { + { + return VertexDataMaterialInfo; } - this._enterCount = 0; - let canNotify = true; - if (!target.isAscendant(this)) { - canNotify = this.onPointerOutObservable.notifyObservers(this, -1, target, this, pi); + }, + VertexData: () => { + { + return VertexData; } - if (canNotify && this.parent != null && !this.isPointerBlocker) { - this.parent._onPointerOut(target, pi, force); + }, + VertexBuffer: () => { + { + return VertexBuffer; } - } - _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { - this._onPointerEnter(this, pi); - if (this._downCount !== 0) { - return false; + }, + VertexAnimationBaker: () => { + { + return VertexAnimationBaker; } - this._downCount++; - this._downPointerIds[pointerId] = true; - const canNotify = this.onPointerDownObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi); - if (canNotify && this.parent != null && !this.isPointerBlocker) { - this.parent._onPointerDown(target, coordinates, pointerId, buttonIndex, pi); + }, + VectorSplitterBlock: () => { + { + return VectorSplitterBlock; } - if (pi && this.uniqueId !== this._host.rootContainer.uniqueId) { - this._host._capturedPointerIds.add(pi.event.pointerId); + }, + VectorMergerBlock: () => { + { + return VectorMergerBlock; } - return true; - } - _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi) { - if (!this._isEnabled) { - return; + }, + VectorConverterBlock: () => { + { + return VectorConverterBlock; } - this._downCount = 0; - delete this._downPointerIds[pointerId]; - let canNotifyClick = notifyClick; - if (notifyClick && (this._enterCount > 0 || this._enterCount === -1)) { - canNotifyClick = this.onPointerClickObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi); + }, + Vector4: () => { + { + return Vector4; } - const canNotify = this.onPointerUpObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi); - if (canNotify && this.parent != null && !this.isPointerBlocker) { - this.parent._onPointerUp(target, coordinates, pointerId, buttonIndex, canNotifyClick, pi); + }, + Vector3: () => { + { + return Vector3; } - if (pi && this.uniqueId !== this._host.rootContainer.uniqueId) { - this._host._capturedPointerIds.delete(pi.event.pointerId); + }, + Vector2: () => { + { + return Vector2; } - } - _forcePointerUp(pointerId = null) { - if (pointerId !== null) { - this._onPointerUp(this, Vector2.Zero(), pointerId, 0, true); - } else { - for (const key in this._downPointerIds) { - this._onPointerUp(this, Vector2.Zero(), +key, 0, true); - } + }, + ValueCondition: () => { + { + return ValueCondition; } - } - _onWheelScroll(deltaX, deltaY) { - if (!this._isEnabled) { - return; + }, + ValidatedNativeDataStream: () => { + { + return ValidatedNativeDataStream; } - const canNotify = this.onWheelObservable.notifyObservers(new Vector2(deltaX, deltaY)); - if (canNotify && this.parent != null) { - this.parent._onWheelScroll(deltaX, deltaY); + }, + VRMultiviewToSingleviewPostProcess: () => { + { + return VRMultiviewToSingleviewPostProcess; } - } - _onCanvasBlur() { - } - _processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY) { - if (!this._isEnabled) { - return false; + }, + VRExperienceHelper: () => { + { + return VRExperienceHelper; } - this._dummyVector2.copyFromFloats(x, y); - if (type === PointerEventTypes.POINTERMOVE) { - this._onPointerMove(this, this._dummyVector2, pointerId, pi); - const previousControlOver = this._host._lastControlOver[pointerId]; - if (previousControlOver && previousControlOver !== this) { - previousControlOver._onPointerOut(this, pi); - } - if (previousControlOver !== this) { - this._onPointerEnter(this, pi); - } - this._host._lastControlOver[pointerId] = this; - return true; + }, + VRDistortionCorrectionPostProcess: () => { + { + return VRDistortionCorrectionPostProcess; } - if (type === PointerEventTypes.POINTERDOWN) { - this._onPointerDown(this, this._dummyVector2, pointerId, buttonIndex, pi); - this._host._registerLastControlDown(this, pointerId); - this._host._lastPickedControl = this; - return true; + }, + VRDeviceOrientationGamepadCamera: () => { + { + return VRDeviceOrientationGamepadCamera; } - if (type === PointerEventTypes.POINTERUP) { - if (this._host._lastControlDown[pointerId]) { - this._host._lastControlDown[pointerId]._onPointerUp(this, this._dummyVector2, pointerId, buttonIndex, true, pi); - } - delete this._host._lastControlDown[pointerId]; - return true; + }, + VRDeviceOrientationFreeCamera: () => { + { + return VRDeviceOrientationFreeCamera; } - if (type === PointerEventTypes.POINTERWHEEL) { - if (this._host._lastControlOver[pointerId]) { - this._host._lastControlOver[pointerId]._onWheelScroll(deltaX, deltaY); - return true; - } + }, + VRDeviceOrientationArcRotateCamera: () => { + { + return VRDeviceOrientationArcRotateCamera; } - return false; - } - _getStyleProperty(propName, defaultValue) { - var _a; - const prop = (_a = this._style && this._style[propName]) !== null && _a !== undefined ? _a : this[propName]; - if (!prop && this.parent) { - return this.parent._getStyleProperty(propName, defaultValue); - } else if (!this.parent) { - return defaultValue; - } else { - return prop; + }, + VRCameraMetrics: () => { + { + return VRCameraMetrics; } - } - _prepareFont() { - if (!this._font && !this._fontSet) { - return; + }, + UtilityLayerRenderer: () => { + { + return UtilityLayerRenderer; } - this._font = this._getStyleProperty("fontStyle", "") + " " + this._getStyleProperty("fontWeight", "") + " " + this.fontSizeInPixels + "px " + this._getStyleProperty("fontFamily", "Arial"); - this._fontOffset = Control._GetFontOffset(this._font); - this.getDescendants().forEach((child) => child._markAllAsDirty()); - } - isDimensionFullyDefined(dim) { - return this.getDimension(dim).isPixel; - } - getDimension(dim) { - if (dim === "width") { - return this._width; - } else { - return this._height; + }, + UploadLevelsAsync: () => { + { + return UploadLevelsAsync; } - } - clone(host) { - const serialization4 = {}; - this.serialize(serialization4); - const controlType = Tools.Instantiate("BABYLON.GUI." + serialization4.className); - const cloned = new controlType; - cloned.parse(serialization4, host); - return cloned; - } - parse(serializedObject, host) { - SerializationHelper.Parse(() => this, serializedObject, null); - this.name = serializedObject.name; - this._parseFromContent(serializedObject, host !== null && host !== undefined ? host : this._host); - return this; - } - serialize(serializationObject) { - SerializationHelper.Serialize(this, serializationObject); - serializationObject.name = this.name; - serializationObject.className = this.getClassName(); - this._prepareFont(); - if (this._font) { - serializationObject.fontFamily = this._fontFamily; - serializationObject.fontSize = this.fontSize; - serializationObject.fontWeight = this.fontWeight; - serializationObject.fontStyle = this.fontStyle; + }, + UploadEnvSpherical: () => { + { + return UploadEnvSpherical; } - if (this._gradient) { - serializationObject.gradient = {}; - this._gradient.serialize(serializationObject.gradient); + }, + UploadEnvLevelsAsync: () => { + { + return UploadEnvLevelsAsync; } - SerializationHelper.AppendSerializedAnimations(this, serializationObject); - } - _parseFromContent(serializedObject, host) { - var _a, _b; - if (serializedObject.fontFamily) { - this.fontFamily = serializedObject.fontFamily; + }, + UploadContent: () => { + { + return UploadContent; } - if (serializedObject.fontSize) { - this.fontSize = serializedObject.fontSize; + }, + UnregisterMaterialPlugin: () => { + { + return UnregisterMaterialPlugin; } - if (serializedObject.fontWeight) { - this.fontWeight = serializedObject.fontWeight; + }, + UnregisterAllMaterialPlugins: () => { + { + return UnregisterAllMaterialPlugins; } - if (serializedObject.fontStyle) { - this.fontStyle = serializedObject.fontStyle; + }, + UniversalCamera: () => { + { + return UniversalCamera; } - if (serializedObject.gradient) { - const className = Tools.Instantiate("BABYLON.GUI." + serializedObject.gradient.className); - this._gradient = new className; - (_a = this._gradient) === null || _a === undefined || _a.parse(serializedObject.gradient); + }, + UniformBuffer: () => { + { + return UniformBuffer; } - if (serializedObject.animations) { - this.animations = []; - for (let animationIndex = 0;animationIndex < serializedObject.animations.length; animationIndex++) { - const parsedAnimation = serializedObject.animations[animationIndex]; - const internalClass = GetClass("BABYLON.Animation"); - if (internalClass) { - this.animations.push(internalClass.Parse(parsedAnimation)); - } - } - if (serializedObject.autoAnimate && this._host && this._host.getScene()) { - this._host.getScene().beginAnimation(this, serializedObject.autoAnimateFrom, serializedObject.autoAnimateTo, serializedObject.autoAnimateLoop, serializedObject.autoAnimateSpeed || 1); - } + }, + TwirlBlock: () => { + { + return TwirlBlock; } - this.fixedRatioMasterIsWidth = (_b = serializedObject.fixedRatioMasterIsWidth) !== null && _b !== undefined ? _b : this.fixedRatioMasterIsWidth; - } - dispose() { - this.onDirtyObservable.clear(); - this.onBeforeDrawObservable.clear(); - this.onAfterDrawObservable.clear(); - this.onPointerDownObservable.clear(); - this.onPointerEnterObservable.clear(); - this.onPointerMoveObservable.clear(); - this.onPointerOutObservable.clear(); - this.onPointerUpObservable.clear(); - this.onPointerClickObservable.clear(); - this.onWheelObservable.clear(); - if (this._styleObserver && this._style) { - this._style.onChangedObservable.remove(this._styleObserver); - this._styleObserver = null; + }, + TubeBuilder: () => { + { + return TubeBuilder; } - if (this.parent) { - this.parent.removeControl(this); - this.parent = null; + }, + TrigonometryBlockOperations: () => { + { + return TrigonometryBlockOperations; } - if (this._host) { - const index = this._host._linkedControls.indexOf(this); - if (index > -1) { - this.linkWithMesh(null); - } + }, + TrigonometryBlock: () => { + { + return TrigonometryBlock; } - this.onDisposeObservable.notifyObservers(this); - this.onDisposeObservable.clear(); - } - static get HORIZONTAL_ALIGNMENT_LEFT() { - return Control._HORIZONTAL_ALIGNMENT_LEFT; - } - static get HORIZONTAL_ALIGNMENT_RIGHT() { - return Control._HORIZONTAL_ALIGNMENT_RIGHT; - } - static get HORIZONTAL_ALIGNMENT_CENTER() { - return Control._HORIZONTAL_ALIGNMENT_CENTER; - } - static get VERTICAL_ALIGNMENT_TOP() { - return Control._VERTICAL_ALIGNMENT_TOP; - } - static get VERTICAL_ALIGNMENT_BOTTOM() { - return Control._VERTICAL_ALIGNMENT_BOTTOM; - } - static get VERTICAL_ALIGNMENT_CENTER() { - return Control._VERTICAL_ALIGNMENT_CENTER; - } - static _GetFontOffset(font) { - if (Control._FontHeightSizes[font]) { - return Control._FontHeightSizes[font]; + }, + TriPlanarBlock: () => { + { + return TriPlanarBlock; } - const engine47 = EngineStore.LastCreatedEngine; - if (!engine47) { - throw new Error("Invalid engine. Unable to create a canvas."); + }, + TranslationBlock: () => { + { + return TranslationBlock; } - const result = engine47.getFontOffset(font); - Control._FontHeightSizes[font] = result; - return result; - } - static Parse(serializedObject, host) { - const controlType = Tools.Instantiate("BABYLON.GUI." + serializedObject.className); - const control = SerializationHelper.Parse(() => new controlType, serializedObject, null); - control.name = serializedObject.name; - control._parseFromContent(serializedObject, host); - return control; - } - static drawEllipse(x, y, width, height, context) { - context.translate(x, y); - context.scale(width, height); - context.beginPath(); - context.arc(0, 0, 1, 0, 2 * Math.PI); - context.closePath(); - context.scale(1 / width, 1 / height); - context.translate(-x, -y); - } - isReady() { - return true; - } -} -Control.AllowAlphaInheritance = false; -Control._ClipMeasure = new Measure(0, 0, 0, 0); -Control._HORIZONTAL_ALIGNMENT_LEFT = 0; -Control._HORIZONTAL_ALIGNMENT_RIGHT = 1; -Control._HORIZONTAL_ALIGNMENT_CENTER = 2; -Control._VERTICAL_ALIGNMENT_TOP = 0; -Control._VERTICAL_ALIGNMENT_BOTTOM = 1; -Control._VERTICAL_ALIGNMENT_CENTER = 2; -Control._FontHeightSizes = {}; -Control.AddHeader = () => { -}; -__decorate2([ - serialize() -], Control.prototype, "metadata", undefined); -__decorate2([ - serialize() -], Control.prototype, "isHitTestVisible", undefined); -__decorate2([ - serialize() -], Control.prototype, "isPointerBlocker", undefined); -__decorate2([ - serialize() -], Control.prototype, "isFocusInvisible", undefined); -__decorate2([ - serialize() -], Control.prototype, "clipChildren", null); -__decorate2([ - serialize() -], Control.prototype, "clipContent", null); -__decorate2([ - serialize() -], Control.prototype, "useBitmapCache", undefined); -__decorate2([ - serialize() -], Control.prototype, "shadowOffsetX", null); -__decorate2([ - serialize() -], Control.prototype, "shadowOffsetY", null); -__decorate2([ - serialize() -], Control.prototype, "shadowBlur", null); -__decorate2([ - serialize() -], Control.prototype, "shadowColor", null); -__decorate2([ - serialize() -], Control.prototype, "hoverCursor", undefined); -__decorate2([ - serialize() -], Control.prototype, "fontOffset", null); -__decorate2([ - serialize() -], Control.prototype, "alpha", null); -__decorate2([ - serialize() -], Control.prototype, "scaleX", null); -__decorate2([ - serialize() -], Control.prototype, "scaleY", null); -__decorate2([ - serialize() -], Control.prototype, "rotation", null); -__decorate2([ - serialize() -], Control.prototype, "transformCenterY", null); -__decorate2([ - serialize() -], Control.prototype, "transformCenterX", null); -__decorate2([ - serialize() -], Control.prototype, "horizontalAlignment", null); -__decorate2([ - serialize() -], Control.prototype, "verticalAlignment", null); -__decorate2([ - serialize() -], Control.prototype, "fixedRatio", null); -__decorate2([ - serialize() -], Control.prototype, "fixedRatioMasterIsWidth", null); -__decorate2([ - serialize() -], Control.prototype, "width", null); -__decorate2([ - serialize() -], Control.prototype, "height", null); -__decorate2([ - serialize() -], Control.prototype, "style", null); -__decorate2([ - serialize() -], Control.prototype, "color", null); -__decorate2([ - serialize() -], Control.prototype, "gradient", null); -__decorate2([ - serialize() -], Control.prototype, "zIndex", null); -__decorate2([ - serialize() -], Control.prototype, "notRenderable", null); -__decorate2([ - serialize() -], Control.prototype, "isVisible", null); -__decorate2([ - serialize() -], Control.prototype, "descendantsOnlyPadding", null); -__decorate2([ - serialize() -], Control.prototype, "paddingLeft", null); -__decorate2([ - serialize() -], Control.prototype, "paddingRight", null); -__decorate2([ - serialize() -], Control.prototype, "paddingTop", null); -__decorate2([ - serialize() -], Control.prototype, "paddingBottom", null); -__decorate2([ - serialize() -], Control.prototype, "left", null); -__decorate2([ - serialize() -], Control.prototype, "top", null); -__decorate2([ - serialize() -], Control.prototype, "linkOffsetX", null); -__decorate2([ - serialize() -], Control.prototype, "linkOffsetY", null); -__decorate2([ - serialize() -], Control.prototype, "isEnabled", null); -__decorate2([ - serialize() -], Control.prototype, "disabledColor", null); -__decorate2([ - serialize() -], Control.prototype, "disabledColorItem", null); -__decorate2([ - serialize() -], Control.prototype, "overlapGroup", undefined); -__decorate2([ - serialize() -], Control.prototype, "overlapDeltaMultiplier", undefined); -RegisterClass("BABYLON.GUI.Control", Control); - -// node_modules/@babylonjs/gui/2D/controls/container.js -class Container extends Control { - get renderToIntermediateTexture() { - return this._renderToIntermediateTexture; - } - set renderToIntermediateTexture(value) { - if (this._renderToIntermediateTexture === value) { - return; + }, + TransformNode: () => { + { + return TransformNode; } - this._renderToIntermediateTexture = value; - this._markAsDirty(); - } - get adaptHeightToChildren() { - return this._adaptHeightToChildren; - } - set adaptHeightToChildren(value) { - if (this._adaptHeightToChildren === value) { - return; + }, + TransformBlock: () => { + { + return TransformBlock; } - this._adaptHeightToChildren = value; - if (value) { - this.height = "100%"; + }, + TranscodeTarget: () => { + { + return TranscodeTarget; } - this._markAsDirty(); - } - get adaptWidthToChildren() { - return this._adaptWidthToChildren; - } - set adaptWidthToChildren(value) { - if (this._adaptWidthToChildren === value) { - return; + }, + TranscodeAsync: () => { + { + return TranscodeAsync; } - this._adaptWidthToChildren = value; - if (value) { - this.width = "100%"; + }, + TrajectoryClassifier: () => { + { + return TrajectoryClassifier; } - this._markAsDirty(); - } - get background() { - return this._background; - } - set background(value) { - if (this._background === value) { - return; + }, + Trajectory: () => { + { + return Trajectory; } - this._background = value; - this._markAsDirty(); - } - get backgroundGradient() { - return this._backgroundGradient; - } - set backgroundGradient(value) { - if (this._backgroundGradient === value) { - return; + }, + TrailMesh: () => { + { + return TrailMesh; } - this._backgroundGradient = value; - this._markAsDirty(); - } - get children() { - return this._children; - } - get isReadOnly() { - return this._isReadOnly; - } - set isReadOnly(value) { - this._isReadOnly = value; - for (const child of this._children) { - child.isReadOnly = value; + }, + TouchCamera: () => { + { + return TouchCamera; } - } - constructor(name265) { - super(name265); - this.name = name265; - this._children = new Array; - this._measureForChildren = Measure.Empty(); - this._background = ""; - this._backgroundGradient = null; - this._adaptWidthToChildren = false; - this._adaptHeightToChildren = false; - this._renderToIntermediateTexture = false; - this._intermediateTexture = null; - this.logLayoutCycleErrors = false; - this.maxLayoutCycle = 3; - this.onControlAddedObservable = new Observable; - this.onControlRemovedObservable = new Observable; - this._inverseTransformMatrix = Matrix2D.Identity(); - this._inverseMeasure = new Measure(0, 0, 0, 0); - } - _getTypeName() { - return "Container"; - } - _flagDescendantsAsMatrixDirty() { - for (const child of this.children) { - child._isClipped = false; - child._markMatrixAsDirty(); + }, + TorusKnotBuilder: () => { + { + return TorusKnotBuilder; } - } - getChildByName(name265) { - for (const child of this.children) { - if (child.name === name265) { - return child; - } + }, + TorusBuilder: () => { + { + return TorusBuilder; } - return null; - } - getChildByType(name265, type) { - for (const child of this.children) { - if (child.typeName === type) { - return child; - } + }, + TorusBlock: () => { + { + return TorusBlock; } - return null; - } - containsControl(control2) { - return this.children.indexOf(control2) !== -1; - } - addControl(control2) { - if (!control2) { - return this; + }, + Tools: () => { + { + return Tools; } - const index = this._children.indexOf(control2); - if (index !== -1) { - return this; + }, + TonemappingOperator: () => { + { + return TonemappingOperator; } - control2._link(this._host); - control2._markAllAsDirty(); - this._reOrderControl(control2); - this._markAsDirty(); - this.onControlAddedObservable.notifyObservers(control2); - return this; - } - clearControls() { - const children = this.children.slice(); - for (const child of children) { - this.removeControl(child); + }, + TonemapPostProcess: () => { + { + return TonemapPostProcess; } - return this; - } - removeControl(control2) { - const index = this._children.indexOf(control2); - if (index !== -1) { - this._children.splice(index, 1); - control2.parent = null; + }, + ToLinearSpace: () => { + { + return ToLinearSpace; } - control2.linkWithMesh(null); - if (this._host) { - this._host._cleanControlAfterRemoval(control2); + }, + ToHalfFloat: () => { + { + return ToHalfFloat; } - this._markAsDirty(); - this.onControlRemovedObservable.notifyObservers(control2); - return this; - } - _reOrderControl(control2) { - const linkedMesh = control2.linkedMesh; - this.removeControl(control2); - let wasAdded = false; - for (let index = 0;index < this._children.length; index++) { - if (this._children[index].zIndex > control2.zIndex) { - this._children.splice(index, 0, control2); - wasAdded = true; - break; - } + }, + ToGammaSpace: () => { + { + return ToGammaSpace; } - if (!wasAdded) { - this._children.push(control2); + }, + TmpVectors: () => { + { + return TmpVectors; } - control2.parent = this; - if (linkedMesh) { - control2.linkWithMesh(linkedMesh); + }, + TmpColors: () => { + { + return TmpColors; } - this._markAsDirty(); - } - _offsetLeft(offset) { - super._offsetLeft(offset); - for (const child of this._children) { - child._offsetLeft(offset); + }, + TimerState: () => { + { + return TimerState; } - } - _offsetTop(offset) { - super._offsetTop(offset); - for (const child of this._children) { - child._offsetTop(offset); + }, + TiledPlaneBuilder: () => { + { + return TiledPlaneBuilder; } - } - _markAllAsDirty() { - super._markAllAsDirty(); - for (let index = 0;index < this._children.length; index++) { - this._children[index]._markAllAsDirty(); + }, + TiledBoxBuilder: () => { + { + return TiledBoxBuilder; } - } - _getBackgroundColor(context) { - return this._backgroundGradient ? this._backgroundGradient.getCanvasGradient(context) : this._background; - } - _localDraw(context) { - if (this._background || this._backgroundGradient) { - context.save(); - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowColor = this.shadowColor; - context.shadowBlur = this.shadowBlur; - context.shadowOffsetX = this.shadowOffsetX; - context.shadowOffsetY = this.shadowOffsetY; - } - context.fillStyle = this._getBackgroundColor(context); - context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); - context.restore(); + }, + ThinTexture: () => { + { + return ThinTexture; } - } - _link(host) { - super._link(host); - for (const child of this._children) { - child._link(host); + }, + ThinRenderTargetTexture: () => { + { + return ThinRenderTargetTexture; } - } - _beforeLayout() { - } - _processMeasures(parentMeasure, context) { - if (this._isDirty || !this._cachedParentMeasure.isEqualsTo(parentMeasure)) { - super._processMeasures(parentMeasure, context); - this._evaluateClippingState(parentMeasure); - if (this._renderToIntermediateTexture) { - if (this._intermediateTexture && this._host.getScene() != this._intermediateTexture.getScene()) { - this._intermediateTexture.dispose(); - this._intermediateTexture = null; - } - if (!this._intermediateTexture) { - this._intermediateTexture = new DynamicTexture("", { width: this._currentMeasure.width, height: this._currentMeasure.height }, this._host.getScene(), false, Texture.NEAREST_SAMPLINGMODE, Constants.TEXTUREFORMAT_RGBA, false); - this._intermediateTexture.hasAlpha = true; - } else { - this._intermediateTexture.scaleTo(this._currentMeasure.width, this._currentMeasure.height); - } - } + }, + ThinEngine: () => { + { + return ThinEngine; } - } - _layout(parentMeasure, context) { - var _a, _b; - if (!this.isDirty && (!this.isVisible || this.notRenderable)) { - return false; + }, + TextureViewDimension: () => { + { + return TextureViewDimension; } - this.host._numLayoutCalls++; - if (this._isDirty) { - this._currentMeasure.transformToRef(this._transformMatrix, this._prevCurrentMeasureTransformedIntoGlobalSpace); + }, + TextureUsage: () => { + { + return TextureUsage; } - let rebuildCount = 0; - context.save(); - this._applyStates(context); - this._beforeLayout(); - do { - let computedWidth = -1; - let computedHeight = -1; - this._rebuildLayout = false; - this._processMeasures(parentMeasure, context); - if (!this._isClipped) { - for (const child of this._children) { - child._tempParentMeasure.copyFrom(this._measureForChildren); - if (child._layout(this._measureForChildren, context)) { - if (child.isVisible && !child.notRenderable) { - if (this.adaptWidthToChildren && child._width.isPixel) { - computedWidth = Math.max(computedWidth, child._currentMeasure.width + child._paddingLeftInPixels + child._paddingRightInPixels); - } - if (this.adaptHeightToChildren && child._height.isPixel) { - computedHeight = Math.max(computedHeight, child._currentMeasure.height + child._paddingTopInPixels + child._paddingBottomInPixels); - } - } - } - } - if (this.adaptWidthToChildren && computedWidth >= 0) { - computedWidth += this.paddingLeftInPixels + this.paddingRightInPixels; - if (this.width !== computedWidth + "px") { - (_a = this.parent) === null || _a === undefined || _a._markAsDirty(); - this.width = computedWidth + "px"; - this._width.ignoreAdaptiveScaling = true; - this._rebuildLayout = true; - } - } - if (this.adaptHeightToChildren && computedHeight >= 0) { - computedHeight += this.paddingTopInPixels + this.paddingBottomInPixels; - if (this.height !== computedHeight + "px") { - (_b = this.parent) === null || _b === undefined || _b._markAsDirty(); - this.height = computedHeight + "px"; - this._height.ignoreAdaptiveScaling = true; - this._rebuildLayout = true; - } - } - this._postMeasure(); - } - rebuildCount++; - } while (this._rebuildLayout && rebuildCount < this.maxLayoutCycle); - if (rebuildCount >= 3 && this.logLayoutCycleErrors) { - Logger.Error(`Layout cycle detected in GUI (Container name=${this.name}, uniqueId=${this.uniqueId})`); + }, + TextureTools: () => { + { + return TextureTools; } - context.restore(); - if (this._isDirty) { - this.invalidateRect(); - this._isDirty = false; + }, + TextureSampler: () => { + { + return TextureSampler; } - return true; - } - _postMeasure() { - } - _draw(context, invalidatedRectangle) { - const renderToIntermediateTextureThisDraw = this._renderToIntermediateTexture && this._intermediateTexture; - const contextToDrawTo = renderToIntermediateTextureThisDraw ? this._intermediateTexture.getContext() : context; - if (renderToIntermediateTextureThisDraw) { - contextToDrawTo.save(); - contextToDrawTo.translate(-this._currentMeasure.left, -this._currentMeasure.top); - if (invalidatedRectangle) { - this._transformMatrix.invertToRef(this._inverseTransformMatrix); - invalidatedRectangle.transformToRef(this._inverseTransformMatrix, this._inverseMeasure); - contextToDrawTo.clearRect(this._inverseMeasure.left, this._inverseMeasure.top, this._inverseMeasure.width, this._inverseMeasure.height); - } else { - contextToDrawTo.clearRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); - } + }, + TextureSampleType: () => { + { + return TextureSampleType; } - this._localDraw(contextToDrawTo); - context.save(); - if (this.clipChildren) { - this._clipForChildren(contextToDrawTo); + }, + TexturePackerFrame: () => { + { + return TexturePackerFrame; } - for (const child of this._children) { - if (invalidatedRectangle) { - if (!child._intersectsRect(invalidatedRectangle)) { - continue; - } - } - child._render(contextToDrawTo, invalidatedRectangle); + }, + TexturePacker: () => { + { + return TexturePacker; } - if (renderToIntermediateTextureThisDraw) { - contextToDrawTo.restore(); - context.save(); - context.globalAlpha = this.alpha; - context.drawImage(contextToDrawTo.canvas, this._currentMeasure.left, this._currentMeasure.top); - context.restore(); + }, + TextureOptimization: () => { + { + return TextureOptimization; } - context.restore(); - } - getDescendantsToRef(results, directDescendantsOnly = false, predicate) { - if (!this.children) { - return; + }, + TextureFormat: () => { + { + return TextureFormat; } - for (let index = 0;index < this.children.length; index++) { - const item = this.children[index]; - if (!predicate || predicate(item)) { - results.push(item); - } - if (!directDescendantsOnly) { - item.getDescendantsToRef(results, false, predicate); - } + }, + TextureDimension: () => { + { + return TextureDimension; } - } - _processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) { - if (!this._isEnabled || !this.isVisible || this.notRenderable) { - return false; + }, + TextureBlock: () => { + { + return TextureBlock; } - const contains = super.contains(x, y); - if (!contains && this.clipChildren) { - return false; + }, + TextureAssetTask: () => { + { + return TextureAssetTask; } - for (let index = this._children.length - 1;index >= 0; index--) { - const child = this._children[index]; - if (child._processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY)) { - if (child.hoverCursor) { - this._host._changeCursor(child.hoverCursor); - } - return true; - } + }, + TextureAspect: () => { + { + return TextureAspect; } - if (!contains) { - return false; + }, + Texture: () => { + { + return Texture; } - if (!this.isHitTestVisible) { - return false; + }, + TextFileAssetTask: () => { + { + return TextFileAssetTask; } - return this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY); - } - _additionalProcessing(parentMeasure, context) { - super._additionalProcessing(parentMeasure, context); - this._measureForChildren.copyFrom(this._currentMeasure); - } - _getAdaptDimTo(dim) { - if (dim === "width") { - return this.adaptWidthToChildren; - } else { - return this.adaptHeightToChildren; + }, + TestBase64DataUrl: () => { + { + return TestBase64DataUrl; } - } - isDimensionFullyDefined(dim) { - if (this._getAdaptDimTo(dim)) { - for (const child of this.children) { - if (!child.isDimensionFullyDefined(dim)) { - return false; - } - } - return true; + }, + TeleportOutBlock: () => { + { + return TeleportOutBlock; } - return super.isDimensionFullyDefined(dim); - } - serialize(serializationObject) { - super.serialize(serializationObject); - if (this.backgroundGradient) { - serializationObject.backgroundGradient = {}; - this.backgroundGradient.serialize(serializationObject.backgroundGradient); + }, + TeleportInBlock: () => { + { + return TeleportInBlock; } - if (!this.children.length) { - return; + }, + TargetedAnimation: () => { + { + return TargetedAnimation; } - serializationObject.children = []; - for (const child of this.children) { - const childSerializationObject = {}; - child.serialize(childSerializationObject); - serializationObject.children.push(childSerializationObject); + }, + TargetCamera: () => { + { + return TargetCamera; } - } - dispose() { - var _a; - super.dispose(); - for (let index = this.children.length - 1;index >= 0; index--) { - this.children[index].dispose(); + }, + Tags: () => { + { + return Tags; } - (_a = this._intermediateTexture) === null || _a === undefined || _a.dispose(); - } - _parseFromContent(serializedObject, host) { - var _a; - super._parseFromContent(serializedObject, host); - this._link(host); - if (serializedObject.backgroundGradient) { - const className = Tools.Instantiate("BABYLON.GUI." + serializedObject.backgroundGradient.className); - this._backgroundGradient = new className; - (_a = this._backgroundGradient) === null || _a === undefined || _a.parse(serializedObject.backgroundGradient); + }, + TGATools: () => { + { + return TGATools; } - if (!serializedObject.children) { - return; + }, + TBNBlock: () => { + { + return TBNBlock; } - for (const childData of serializedObject.children) { - this.addControl(Control.Parse(childData, host)); + }, + SwitchInput: () => { + { + return SwitchInput; } - } - isReady() { - for (const child of this.children) { - if (!child.isReady()) { - return false; - } + }, + SwitchBooleanAction: () => { + { + return SwitchBooleanAction; } - return true; - } -} -__decorate2([ - serialize() -], Container.prototype, "renderToIntermediateTexture", null); -__decorate2([ - serialize() -], Container.prototype, "maxLayoutCycle", undefined); -__decorate2([ - serialize() -], Container.prototype, "adaptHeightToChildren", null); -__decorate2([ - serialize() -], Container.prototype, "adaptWidthToChildren", null); -__decorate2([ - serialize() -], Container.prototype, "background", null); -__decorate2([ - serialize() -], Container.prototype, "backgroundGradient", null); -RegisterClass("BABYLON.GUI.Container", Container); - -// node_modules/@babylonjs/gui/2D/controls/rectangle.js -class Rectangle extends Container { - get thickness() { - return this._thickness; - } - set thickness(value) { - if (this._thickness === value) { - return; + }, + SurfaceMagnetismBehavior: () => { + { + return SurfaceMagnetismBehavior; } - this._thickness = value; - this._markAsDirty(); - } - get cornerRadius() { - return this._cornerRadius[0]; - } - set cornerRadius(value) { - if (value < 0) { - value = 0; + }, + SubtractBlock: () => { + { + return SubtractBlock; } - if (this._cornerRadius[0] === value && this._cornerRadius[1] === value && this._cornerRadius[2] === value && this._cornerRadius[3] === value) { - return; + }, + SubSurfaceSceneComponent: () => { + { + return SubSurfaceSceneComponent; } - this._cornerRadius[0] = this._cornerRadius[1] = this._cornerRadius[2] = this._cornerRadius[3] = value; - this._markAsDirty(); - } - get cornerRadiusX() { - return this._cornerRadius[0]; - } - set cornerRadiusX(value) { - if (this._cornerRadius[0] === value) { - return; + }, + SubSurfaceBlock: () => { + { + return SubSurfaceBlock; } - this._cornerRadius[0] = value; - } - get cornerRadiusY() { - return this._cornerRadius[1]; - } - set cornerRadiusY(value) { - if (this._cornerRadius[1] === value) { - return; + }, + SubMesh: () => { + { + return SubMesh; } - this._cornerRadius[1] = value; - } - get cornerRadiusZ() { - return this._cornerRadius[2]; - } - set cornerRadiusZ(value) { - if (this._cornerRadius[2] === value) { - return; + }, + SubEmitterType: () => { + { + return SubEmitterType; } - this._cornerRadius[2] = value; - } - get cornerRadiusW() { - return this._cornerRadius[3]; - } - set cornerRadiusW(value) { - if (this._cornerRadius[3] === value) { - return; + }, + SubEmitter: () => { + { + return SubEmitter; } - this._cornerRadius[3] = value; - } - constructor(name265) { - super(name265); - this.name = name265; - this._thickness = 1; - this._cornerRadius = [0, 0, 0, 0]; - this._cachedRadius = [0, 0, 0, 0]; - } - _getTypeName() { - return "Rectangle"; - } - _computeAdditionalOffsetX() { - let additionalWidth = 0; - if (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) { - additionalWidth += 1; + }, + StringTools: () => { + { + return StringTools; } - if (this.thickness) { - additionalWidth += this.thickness / 2; + }, + StringDictionary: () => { + { + return StringDictionary; } - return additionalWidth; - } - _computeAdditionalOffsetY() { - let additionalHeight = 0; - if (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) { - additionalHeight += 1; + }, + StoreOp: () => { + { + return StoreOp; } - if (this.thickness) { - additionalHeight += this.thickness / 2; + }, + StorageTextureAccess: () => { + { + return StorageTextureAccess; } - return additionalHeight; - } - _getRectangleFill(context) { - return this._getBackgroundColor(context); - } - _localDraw(context) { - context.save(); - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowColor = this.shadowColor; - context.shadowBlur = this.shadowBlur; - context.shadowOffsetX = this.shadowOffsetX; - context.shadowOffsetY = this.shadowOffsetY; + }, + StorageBuffer: () => { + { + return StorageBuffer; } - if (this._background || this._backgroundGradient) { - context.fillStyle = this._getRectangleFill(context); - if (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) { - this._drawRoundedRect(context, this._thickness / 2); - context.fill(); - } else { - context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); - } + }, + StopSoundAction: () => { + { + return StopSoundAction; } - if (this._thickness) { - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowBlur = 0; - context.shadowOffsetX = 0; - context.shadowOffsetY = 0; - } - if (this.color || this.gradient) { - context.strokeStyle = this.gradient ? this.gradient.getCanvasGradient(context) : this.color; - } - context.lineWidth = this._thickness; - if (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) { - this._drawRoundedRect(context, this._thickness / 2); - context.stroke(); - } else { - context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, this._currentMeasure.width - this._thickness, this._currentMeasure.height - this._thickness); - } + }, + StopAnimationAction: () => { + { + return StopAnimationAction; } - context.restore(); - } - _additionalProcessing(parentMeasure, context) { - super._additionalProcessing(parentMeasure, context); - this._measureForChildren.width -= 2 * this._thickness; - this._measureForChildren.height -= 2 * this._thickness; - this._measureForChildren.left += this._thickness; - this._measureForChildren.top += this._thickness; - } - _drawRoundedRect(context, offset = 0) { - const x = this._currentMeasure.left + offset; - const y = this._currentMeasure.top + offset; - const width = this._currentMeasure.width - offset * 2; - const height = this._currentMeasure.height - offset * 2; - for (let index = 0;index < this._cornerRadius.length; index++) { - this._cachedRadius[index] = Math.abs(Math.min(height / 2, Math.min(width / 2, this._cornerRadius[index]))); + }, + StickValues: () => { + { + return StickValues; } - context.beginPath(); - context.moveTo(x + this._cachedRadius[0], y); - context.lineTo(x + width - this._cachedRadius[1], y); - context.arc(x + width - this._cachedRadius[1], y + this._cachedRadius[1], this._cachedRadius[1], 3 * Math.PI / 2, Math.PI * 2); - context.lineTo(x + width, y + height - this._cachedRadius[2]); - context.arc(x + width - this._cachedRadius[2], y + height - this._cachedRadius[2], this._cachedRadius[2], 0, Math.PI / 2); - context.lineTo(x + this._cachedRadius[3], y + height); - context.arc(x + this._cachedRadius[3], y + height - this._cachedRadius[3], this._cachedRadius[3], Math.PI / 2, Math.PI); - context.lineTo(x, y + this._cachedRadius[0]); - context.arc(x + this._cachedRadius[0], y + this._cachedRadius[0], this._cachedRadius[0], Math.PI, 3 * Math.PI / 2); - context.closePath(); - } - _clipForChildren(context) { - if (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) { - this._drawRoundedRect(context, this._thickness); - context.clip(); + }, + StereoscopicUniversalCamera: () => { + { + return StereoscopicUniversalCamera; } - } -} -__decorate2([ - serialize() -], Rectangle.prototype, "thickness", null); -__decorate2([ - serialize() -], Rectangle.prototype, "cornerRadius", null); -__decorate2([ - serialize() -], Rectangle.prototype, "cornerRadiusX", null); -__decorate2([ - serialize() -], Rectangle.prototype, "cornerRadiusY", null); -__decorate2([ - serialize() -], Rectangle.prototype, "cornerRadiusZ", null); -__decorate2([ - serialize() -], Rectangle.prototype, "cornerRadiusW", null); -RegisterClass("BABYLON.GUI.Rectangle", Rectangle); - -// node_modules/@babylonjs/gui/2D/controls/textBlock.js -var TextWrapping; -(function(TextWrapping2) { - TextWrapping2[TextWrapping2["Clip"] = 0] = "Clip"; - TextWrapping2[TextWrapping2["WordWrap"] = 1] = "WordWrap"; - TextWrapping2[TextWrapping2["Ellipsis"] = 2] = "Ellipsis"; - TextWrapping2[TextWrapping2["WordWrapEllipsis"] = 3] = "WordWrapEllipsis"; -})(TextWrapping || (TextWrapping = {})); - -class TextBlock extends Control { - get lines() { - return this._lines; - } - get resizeToFit() { - return this._resizeToFit; - } - set resizeToFit(value) { - if (this._resizeToFit === value) { - return; + }, + StereoscopicScreenUniversalCamera: () => { + { + return StereoscopicScreenUniversalCamera; } - this._resizeToFit = value; - if (this._resizeToFit) { - this._width.ignoreAdaptiveScaling = true; - this._height.ignoreAdaptiveScaling = true; + }, + StereoscopicInterlacePostProcessI: () => { + { + return StereoscopicInterlacePostProcessI; } - this._markAsDirty(); - } - get textWrapping() { - return this._textWrapping; - } - set textWrapping(value) { - if (this._textWrapping === value) { - return; + }, + StereoscopicInterlacePostProcess: () => { + { + return StereoscopicInterlacePostProcess; } - this._textWrapping = +value; - this._markAsDirty(); - } - get text() { - return this._text; - } - set text(value) { - if (this._text === value) { - return; + }, + StereoscopicGamepadCamera: () => { + { + return StereoscopicGamepadCamera; } - this._text = value + ""; - this._markAsDirty(); - this.onTextChangedObservable.notifyObservers(this); - } - get textHorizontalAlignment() { - return this._textHorizontalAlignment; - } - set textHorizontalAlignment(value) { - if (this._textHorizontalAlignment === value) { - return; + }, + StereoscopicFreeCamera: () => { + { + return StereoscopicFreeCamera; } - this._textHorizontalAlignment = value; - this._markAsDirty(); - } - get textVerticalAlignment() { - return this._textVerticalAlignment; - } - set textVerticalAlignment(value) { - if (this._textVerticalAlignment === value) { - return; + }, + StereoscopicArcRotateCamera: () => { + { + return StereoscopicArcRotateCamera; } - this._textVerticalAlignment = value; - this._markAsDirty(); - } - set lineSpacing(value) { - if (this._lineSpacing.fromString(value)) { - this._markAsDirty(); + }, + StepBlock: () => { + { + return StepBlock; } - } - get lineSpacing() { - return this._lineSpacing.toString(this._host); - } - get outlineWidth() { - return this._outlineWidth; - } - set outlineWidth(value) { - if (this._outlineWidth === value) { - return; + }, + StencilStateComposer: () => { + { + return StencilStateComposer; } - this._outlineWidth = value; - this._markAsDirty(); - } - get underline() { - return this._underline; - } - set underline(value) { - if (this._underline === value) { - return; + }, + StencilState: () => { + { + return StencilState; } - this._underline = value; - this._markAsDirty(); - } - get lineThrough() { - return this._lineThrough; - } - set lineThrough(value) { - if (this._lineThrough === value) { - return; + }, + StencilOperation: () => { + { + return StencilOperation; } - this._lineThrough = value; - this._markAsDirty(); - } - get applyOutlineToUnderline() { - return this._applyOutlineToUnderline; - } - set applyOutlineToUnderline(value) { - if (this._applyOutlineToUnderline === value) { - return; + }, + StateCondition: () => { + { + return StateCondition; } - this._applyOutlineToUnderline = value; - this._markAsDirty(); - } - get outlineColor() { - return this._outlineColor; - } - set outlineColor(value) { - if (this._outlineColor === value) { - return; + }, + StartsWith: () => { + { + return StartsWith; } - this._outlineColor = value; - this._markAsDirty(); - } - get wordDivider() { - return this._wordDivider; - } - set wordDivider(value) { - if (this._wordDivider === value) { - return; + }, + StandardRenderingPipeline: () => { + { + return StandardRenderingPipeline; } - this._wordDivider = value; - this._markAsDirty(); - } - get forceResizeWidth() { - return this._forceResizeWidth; - } - set forceResizeWidth(value) { - if (this._forceResizeWidth === value) { - return; + }, + StandardMaterialDefines: () => { + { + return StandardMaterialDefines; } - this._forceResizeWidth = value; - this._markAsDirty(); - } - constructor(name265, text = "") { - super(name265); - this.name = name265; - this._text = ""; - this._textWrapping = TextWrapping.Clip; - this._textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER; - this._textVerticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER; - this._resizeToFit = false; - this._lineSpacing = new ValueAndUnit(0); - this._outlineWidth = 0; - this._outlineColor = "white"; - this._underline = false; - this._lineThrough = false; - this._wordDivider = " "; - this._forceResizeWidth = false; - this._applyOutlineToUnderline = false; - this.onTextChangedObservable = new Observable; - this.onLinesReadyObservable = new Observable; - this._linesTemp = []; - this.text = text; - } - _getTypeName() { - return "TextBlock"; - } - _processMeasures(parentMeasure, context) { - if (!this._fontOffset || this.isDirty) { - this._fontOffset = Control._GetFontOffset(context.font); + }, + StandardMaterial: () => { + { + return StandardMaterial; } - super._processMeasures(parentMeasure, context); - this._lines = this._breakLines(this._currentMeasure.width, this._currentMeasure.height, context); - this.onLinesReadyObservable.notifyObservers(this); - let maxLineWidth = 0; - for (let i = 0;i < this._lines.length; i++) { - const line = this._lines[i]; - if (line.width > maxLineWidth) { - maxLineWidth = line.width; - } + }, + Stage: () => { + { + return Stage; } - if (this._resizeToFit) { - if (this._textWrapping === TextWrapping.Clip || this._forceResizeWidth) { - const newWidth = Math.ceil(this._paddingLeftInPixels) + Math.ceil(this._paddingRightInPixels) + Math.ceil(maxLineWidth); - if (newWidth !== this._width.getValueInPixel(this._host, this._tempParentMeasure.width)) { - this._width.updateInPlace(newWidth, ValueAndUnit.UNITMODE_PIXEL); - this._rebuildLayout = true; - } - } - let newHeight = this._paddingTopInPixels + this._paddingBottomInPixels + this._fontOffset.height * this._lines.length | 0; - if (this._lines.length > 0 && this._lineSpacing.internalValue !== 0) { - let lineSpacing = 0; - if (this._lineSpacing.isPixel) { - lineSpacing = this._lineSpacing.getValue(this._host); - } else { - lineSpacing = this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height); - } - newHeight += (this._lines.length - 1) * lineSpacing; - } - if (newHeight !== this._height.internalValue) { - this._height.updateInPlace(newHeight, ValueAndUnit.UNITMODE_PIXEL); - this._rebuildLayout = true; - } + }, + SpriteSceneComponent: () => { + { + return SpriteSceneComponent; } - } - _drawText(text, textWidth, y, context) { - const width = this._currentMeasure.width; - let x = 0; - switch (this._textHorizontalAlignment) { - case Control.HORIZONTAL_ALIGNMENT_LEFT: - x = 0; - break; - case Control.HORIZONTAL_ALIGNMENT_RIGHT: - x = width - textWidth; - break; - case Control.HORIZONTAL_ALIGNMENT_CENTER: - x = (width - textWidth) / 2; - break; + }, + SpritePackedManager: () => { + { + return SpritePackedManager; } - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowColor = this.shadowColor; - context.shadowBlur = this.shadowBlur; - context.shadowOffsetX = this.shadowOffsetX; - context.shadowOffsetY = this.shadowOffsetY; + }, + SpriteMap: () => { + { + return SpriteMap; } - if (this.outlineWidth) { - context.strokeText(text, this._currentMeasure.left + x, y); + }, + SpriteManager: () => { + { + return SpriteManager; } - context.fillText(text, this._currentMeasure.left + x, y); - if (this._underline) { - this._drawLine(this._currentMeasure.left + x, y + 3, this._currentMeasure.left + x + textWidth, y + 3, context); + }, + Sprite: () => { + { + return Sprite; } - if (this._lineThrough) { - this._drawLine(this._currentMeasure.left + x, y - this.fontSizeInPixels / 3, this._currentMeasure.left + x + textWidth, y - this.fontSizeInPixels / 3, context); + }, + SpringConstraint: () => { + { + return SpringConstraint; } - } - _drawLine(xFrom, yFrom, xTo, yTo, context) { - context.beginPath(); - context.lineWidth = Math.round(this.fontSizeInPixels * 0.05); - context.moveTo(xFrom, yFrom); - context.lineTo(xTo, yTo); - if (this.outlineWidth && this.applyOutlineToUnderline) { - context.stroke(); - context.fill(); - } else { - const currentStroke = context.strokeStyle; - context.strokeStyle = context.fillStyle; - context.stroke(); - context.strokeStyle = currentStroke; + }, + SpotLight: () => { + { + return SpotLight; } - context.closePath(); - } - _draw(context) { - context.save(); - this._applyStates(context); - this._renderLines(context); - context.restore(); - } - _applyStates(context) { - super._applyStates(context); - if (this.outlineWidth) { - context.lineWidth = this.outlineWidth; - context.strokeStyle = this.outlineColor; - context.lineJoin = "miter"; - context.miterLimit = 2; + }, + SphericalPolynomial: () => { + { + return SphericalPolynomial; } - } - _breakLines(refWidth, refHeight, context) { - this._linesTemp.length = 0; - const _lines = this.text.split("\n"); - if (this._textWrapping === TextWrapping.Ellipsis) { - for (const _line of _lines) { - this._linesTemp.push(this._parseLineEllipsis(_line, refWidth, context)); - } - } else if (this._textWrapping === TextWrapping.WordWrap) { - for (const _line of _lines) { - this._linesTemp.push(...this._parseLineWordWrap(_line, refWidth, context)); - } - } else if (this._textWrapping === TextWrapping.WordWrapEllipsis) { - for (const _line of _lines) { - this._linesTemp.push(...this._parseLineWordWrapEllipsis(_line, refWidth, refHeight, context)); - } - } else { - for (const _line of _lines) { - this._linesTemp.push(this._parseLine(_line, context)); - } + }, + SphericalHarmonics: () => { + { + return SphericalHarmonics; } - return this._linesTemp; - } - _parseLine(line = "", context) { - return { text: line, width: this._getTextMetricsWidth(context.measureText(line)) }; - } - _getCharsToRemove(lineWidth, width, lineLength) { - const diff = lineWidth > width ? lineWidth - width : 0; - const charWidth = lineWidth / lineLength; - const removeChars = Math.max(Math.floor(diff / charWidth), 1); - return removeChars; - } - _parseLineEllipsis(line = "", width, context) { - let lineWidth = this._getTextMetricsWidth(context.measureText(line)); - let removeChars = this._getCharsToRemove(lineWidth, width, line.length); - const characters = Array.from && Array.from(line); - if (!characters) { - while (line.length > 2 && lineWidth > width) { - line = line.slice(0, -removeChars); - lineWidth = this._getTextMetricsWidth(context.measureText(line + "\u2026")); - removeChars = this._getCharsToRemove(lineWidth, width, line.length); - } - line += "\u2026"; - } else { - while (characters.length && lineWidth > width) { - characters.splice(characters.length - removeChars, removeChars); - line = `${characters.join("")}\u2026`; - lineWidth = this._getTextMetricsWidth(context.measureText(line)); - removeChars = this._getCharsToRemove(lineWidth, width, line.length); - } + }, + Spherical: () => { + { + return Spherical; } - return { text: line, width: lineWidth }; - } - _getTextMetricsWidth(textMetrics) { - if (textMetrics.actualBoundingBoxLeft !== undefined) { - return Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight); + }, + SphereParticleEmitter: () => { + { + return SphereParticleEmitter; } - return textMetrics.width; - } - _parseLineWordWrap(line = "", width, context) { - const lines = []; - const words = this.wordSplittingFunction ? this.wordSplittingFunction(line) : line.split(this._wordDivider); - let lineWidth = this._getTextMetricsWidth(context.measureText(line)); - for (let n = 0;n < words.length; n++) { - const testLine = n > 0 ? line + this._wordDivider + words[n] : words[0]; - const testWidth = this._getTextMetricsWidth(context.measureText(testLine)); - if (testWidth > width && n > 0) { - lines.push({ text: line, width: lineWidth }); - line = words[n]; - lineWidth = this._getTextMetricsWidth(context.measureText(line)); - } else { - lineWidth = testWidth; - line = testLine; - } + }, + SphereDirectedParticleEmitter: () => { + { + return SphereDirectedParticleEmitter; } - lines.push({ text: line, width: lineWidth }); - return lines; - } - _parseLineWordWrapEllipsis(line = "", width, height, context) { - const lines = this._parseLineWordWrap(line, width, context); - for (let n = 1;n <= lines.length; n++) { - const currentHeight = this._computeHeightForLinesOf(n); - if (currentHeight > height && n > 1) { - const lastLine = lines[n - 2]; - const currentLine = lines[n - 1]; - lines[n - 2] = this._parseLineEllipsis(lastLine.text + this._wordDivider + currentLine.text, width, context); - const linesToRemove = lines.length - n + 1; - for (let i = 0;i < linesToRemove; i++) { - lines.pop(); - } - return lines; - } + }, + SphereBuilder: () => { + { + return SphereBuilder; } - return lines; - } - _renderLines(context) { - if (!this._fontOffset || !this._lines) { - return; + }, + SphereBlock: () => { + { + return SphereBlock; } - const height = this._currentMeasure.height; - let rootY = 0; - switch (this._textVerticalAlignment) { - case Control.VERTICAL_ALIGNMENT_TOP: - rootY = this._fontOffset.ascent; - break; - case Control.VERTICAL_ALIGNMENT_BOTTOM: - rootY = height - this._fontOffset.height * (this._lines.length - 1) - this._fontOffset.descent; - break; - case Control.VERTICAL_ALIGNMENT_CENTER: - rootY = this._fontOffset.ascent + (height - this._fontOffset.height * this._lines.length) / 2; - break; + }, + Space: () => { + { + return Space; } - rootY += this._currentMeasure.top; - for (let i = 0;i < this._lines.length; i++) { - const line = this._lines[i]; - if (i !== 0 && this._lineSpacing.internalValue !== 0) { - if (this._lineSpacing.isPixel) { - rootY += this._lineSpacing.getValue(this._host); - } else { - rootY = rootY + this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height); - } - } - this._drawText(line.text, line.width, rootY, context); - rootY += this._fontOffset.height; + }, + SourceTextureFormat: () => { + { + return SourceTextureFormat; } - } - _computeHeightForLinesOf(lineCount) { - let newHeight = this._paddingTopInPixels + this._paddingBottomInPixels + this._fontOffset.height * lineCount; - if (lineCount > 0 && this._lineSpacing.internalValue !== 0) { - let lineSpacing = 0; - if (this._lineSpacing.isPixel) { - lineSpacing = this._lineSpacing.getValue(this._host); - } else { - lineSpacing = this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height); - } - newHeight += (lineCount - 1) * lineSpacing; + }, + SoundTrack: () => { + { + return SoundTrack; } - return newHeight; - } - isDimensionFullyDefined(dim) { - if (this.resizeToFit) { - return true; + }, + Sound: () => { + { + return Sound; } - return super.isDimensionFullyDefined(dim); - } - computeExpectedHeight() { - var _a; - if (this.text && this.widthInPixels) { - const context = (_a = EngineStore.LastCreatedEngine) === null || _a === undefined ? undefined : _a.createCanvas(0, 0).getContext("2d"); - if (context) { - this._applyStates(context); - if (!this._fontOffset) { - this._fontOffset = Control._GetFontOffset(context.font); - } - const lines = this._lines ? this._lines : this._breakLines(this.widthInPixels - this._paddingLeftInPixels - this._paddingRightInPixels, this.heightInPixels - this._paddingTopInPixels - this._paddingBottomInPixels, context); - return this._computeHeightForLinesOf(lines.length); - } + }, + SolidParticleVertex: () => { + { + return SolidParticleVertex; } - return 0; - } - dispose() { - super.dispose(); - this.onTextChangedObservable.clear(); - } -} -__decorate2([ - serialize() -], TextBlock.prototype, "resizeToFit", null); -__decorate2([ - serialize() -], TextBlock.prototype, "textWrapping", null); -__decorate2([ - serialize() -], TextBlock.prototype, "text", null); -__decorate2([ - serialize() -], TextBlock.prototype, "textHorizontalAlignment", null); -__decorate2([ - serialize() -], TextBlock.prototype, "textVerticalAlignment", null); -__decorate2([ - serialize() -], TextBlock.prototype, "lineSpacing", null); -__decorate2([ - serialize() -], TextBlock.prototype, "outlineWidth", null); -__decorate2([ - serialize() -], TextBlock.prototype, "underline", null); -__decorate2([ - serialize() -], TextBlock.prototype, "lineThrough", null); -__decorate2([ - serialize() -], TextBlock.prototype, "applyOutlineToUnderline", null); -__decorate2([ - serialize() -], TextBlock.prototype, "outlineColor", null); -__decorate2([ - serialize() -], TextBlock.prototype, "wordDivider", null); -__decorate2([ - serialize() -], TextBlock.prototype, "forceResizeWidth", null); -RegisterClass("BABYLON.GUI.TextBlock", TextBlock); - -// node_modules/@babylonjs/gui/2D/controls/image.js -class Image2 extends Control { - get isLoaded() { - return this._loaded; - } - isReady() { - return this.isLoaded; - } - get detectPointerOnOpaqueOnly() { - return this._detectPointerOnOpaqueOnly; - } - set detectPointerOnOpaqueOnly(value) { - if (this._detectPointerOnOpaqueOnly === value) { - return; + }, + SolidParticleSystem: () => { + { + return SolidParticleSystem; } - this._detectPointerOnOpaqueOnly = value; - } - get sliceLeft() { - return this._sliceLeft; - } - set sliceLeft(value) { - if (this._sliceLeft === value) { - return; + }, + SolidParticle: () => { + { + return SolidParticle; } - this._sliceLeft = value; - this._markAsDirty(); - } - get sliceRight() { - return this._sliceRight; - } - set sliceRight(value) { - if (this._sliceRight === value) { - return; + }, + SmoothStepBlock: () => { + { + return SmoothStepBlock; } - this._sliceRight = value; - this._markAsDirty(); - } - get sliceTop() { - return this._sliceTop; - } - set sliceTop(value) { - if (this._sliceTop === value) { - return; + }, + SmartArrayNoDuplicate: () => { + { + return SmartArrayNoDuplicate; } - this._sliceTop = value; - this._markAsDirty(); - } - get sliceBottom() { - return this._sliceBottom; - } - set sliceBottom(value) { - if (this._sliceBottom === value) { - return; + }, + SmartArray: () => { + { + return SmartArray; } - this._sliceBottom = value; - this._markAsDirty(); - } - get sourceLeft() { - return this._sourceLeft; - } - set sourceLeft(value) { - if (this._sourceLeft === value) { - return; + }, + SliderConstraint: () => { + { + return SliderConstraint; } - this._sourceLeft = value; - this._markAsDirty(); - } - get sourceTop() { - return this._sourceTop; - } - set sourceTop(value) { - if (this._sourceTop === value) { - return; + }, + SkeletonViewer: () => { + { + return SkeletonViewer; } - this._sourceTop = value; - this._markAsDirty(); - } - get sourceWidth() { - return this._sourceWidth; - } - set sourceWidth(value) { - if (this._sourceWidth === value) { - return; + }, + Skeleton: () => { + { + return Skeleton; } - this._sourceWidth = value; - this._markAsDirty(); - } - get sourceHeight() { - return this._sourceHeight; - } - set sourceHeight(value) { - if (this._sourceHeight === value) { - return; + }, + Size: () => { + { + return Size; } - this._sourceHeight = value; - this._markAsDirty(); - } - get imageWidth() { - return this._imageWidth; - } - get imageHeight() { - return this._imageHeight; - } - get populateNinePatchSlicesFromImage() { - return this._populateNinePatchSlicesFromImage; - } - set populateNinePatchSlicesFromImage(value) { - if (this._populateNinePatchSlicesFromImage === value) { - return; + }, + SixDofDragBehavior: () => { + { + return SixDofDragBehavior; } - this._populateNinePatchSlicesFromImage = value; - if (this._populateNinePatchSlicesFromImage && this._loaded) { - this._extractNinePatchSliceDataFromImage(); + }, + SineEase: () => { + { + return SineEase; } - } - get isSVG() { - return this._isSVG; - } - get svgAttributesComputationCompleted() { - return this._svgAttributesComputationCompleted; - } - get autoScale() { - return this._autoScale; - } - set autoScale(value) { - if (this._autoScale === value) { - return; + }, + SimplificationType: () => { + { + return SimplificationType; } - this._autoScale = value; - if (value && this._loaded) { - this.synchronizeSizeWithContent(); + }, + SimplificationSettings: () => { + { + return SimplificationSettings; } - } - get stretch() { - return this._stretch; - } - set stretch(value) { - if (this._stretch === value) { - return; + }, + SimplificationQueue: () => { + { + return SimplificationQueue; } - this._stretch = value; - this._markAsDirty(); - } - _rotate90(n, preserveProperties = false) { - var _a, _b; - const width = this._domImage.width; - const height = this._domImage.height; - const engine47 = ((_b = (_a = this._host) === null || _a === undefined ? undefined : _a.getScene()) === null || _b === undefined ? undefined : _b.getEngine()) || EngineStore.LastCreatedEngine; - if (!engine47) { - throw new Error("Invalid engine. Unable to create a canvas."); + }, + SimplicationQueueSceneComponent: () => { + { + return SimplicationQueueSceneComponent; } - const canvas = engine47.createCanvas(height, width); - const context = canvas.getContext("2d"); - context.translate(canvas.width / 2, canvas.height / 2); - context.rotate(n * Math.PI / 2); - context.drawImage(this._domImage, 0, 0, width, height, -width / 2, -height / 2, width, height); - const dataUrl = canvas.toDataURL("image/jpg"); - const rotatedImage = new Image2(this.name + "rotated", dataUrl); - if (preserveProperties) { - rotatedImage._stretch = this._stretch; - rotatedImage._autoScale = this._autoScale; - rotatedImage._cellId = this._cellId; - rotatedImage._cellWidth = n % 1 ? this._cellHeight : this._cellWidth; - rotatedImage._cellHeight = n % 1 ? this._cellWidth : this._cellHeight; + }, + SimplexPerlin3DBlock: () => { + { + return SimplexPerlin3DBlock; } - this._handleRotationForSVGImage(this, rotatedImage, n); - this._imageDataCache.data = null; - return rotatedImage; - } - _handleRotationForSVGImage(srcImage, dstImage, n) { - if (!srcImage._isSVG) { - return; + }, + SheenBlock: () => { + { + return SheenBlock; } - if (srcImage._svgAttributesComputationCompleted) { - this._rotate90SourceProperties(srcImage, dstImage, n); - this._markAsDirty(); - } else { - srcImage.onSVGAttributesComputedObservable.addOnce(() => { - this._rotate90SourceProperties(srcImage, dstImage, n); - this._markAsDirty(); - }); + }, + SharpenPostProcess: () => { + { + return SharpenPostProcess; } - } - _rotate90SourceProperties(srcImage, dstImage, n) { - let { sourceLeft: srcLeft, sourceTop: srcTop } = srcImage, srcWidth = srcImage.domImage.width, srcHeight = srcImage.domImage.height; - let dstLeft = srcLeft, dstTop = srcTop, dstWidth = srcImage.sourceWidth, dstHeight = srcImage.sourceHeight; - if (n != 0) { - const mult = n < 0 ? -1 : 1; - n = n % 4; - for (let i = 0;i < Math.abs(n); ++i) { - dstLeft = -(srcTop - srcHeight / 2) * mult + srcHeight / 2; - dstTop = (srcLeft - srcWidth / 2) * mult + srcWidth / 2; - [dstWidth, dstHeight] = [dstHeight, dstWidth]; - if (n < 0) { - dstTop -= dstHeight; - } else { - dstLeft -= dstWidth; - } - srcLeft = dstLeft; - srcTop = dstTop; - [srcWidth, srcHeight] = [srcHeight, srcWidth]; - } + }, + ShapeBuilder: () => { + { + return ShapeBuilder; } - dstImage.sourceLeft = dstLeft; - dstImage.sourceTop = dstTop; - dstImage.sourceWidth = dstWidth; - dstImage.sourceHeight = dstHeight; - } - _extractNinePatchSliceDataFromImage() { - var _a, _b; - const width = this._domImage.width; - const height = this._domImage.height; - if (!this._workingCanvas) { - const engine47 = ((_b = (_a = this._host) === null || _a === undefined ? undefined : _a.getScene()) === null || _b === undefined ? undefined : _b.getEngine()) || EngineStore.LastCreatedEngine; - if (!engine47) { - throw new Error("Invalid engine. Unable to create a canvas."); - } - this._workingCanvas = engine47.createCanvas(width, height); + }, + ShadowsOptimization: () => { + { + return ShadowsOptimization; } - const canvas = this._workingCanvas; - const context = canvas.getContext("2d"); - context.drawImage(this._domImage, 0, 0, width, height); - const imageData = context.getImageData(0, 0, width, height); - this._sliceLeft = -1; - this._sliceRight = -1; - for (let x = 0;x < width; x++) { - const alpha = imageData.data[x * 4 + 3]; - if (alpha > 127 && this._sliceLeft === -1) { - this._sliceLeft = x; - continue; - } - if (alpha < 127 && this._sliceLeft > -1) { - this._sliceRight = x; - break; - } + }, + ShadowMapBlock: () => { + { + return ShadowMapBlock; } - this._sliceTop = -1; - this._sliceBottom = -1; - for (let y = 0;y < height; y++) { - const alpha = imageData.data[y * width * 4 + 3]; - if (alpha > 127 && this._sliceTop === -1) { - this._sliceTop = y; - continue; - } - if (alpha < 127 && this._sliceTop > -1) { - this._sliceBottom = y; - break; - } + }, + ShadowLight: () => { + { + return ShadowLight; } - } - set domImage(value) { - this._domImage = value; - this._loaded = false; - this._imageDataCache.data = null; - if (this._domImage.width) { - this._onImageLoaded(); - } else { - this._domImage.onload = () => { - this._onImageLoaded(); - }; + }, + ShadowGeneratorSceneComponent: () => { + { + return ShadowGeneratorSceneComponent; } - } - get domImage() { - return this._domImage; - } - _onImageLoaded() { - this._imageDataCache.data = null; - this._imageWidth = this._domImage.width; - this._imageHeight = this._domImage.height; - this._loaded = true; - if (this._populateNinePatchSlicesFromImage) { - this._extractNinePatchSliceDataFromImage(); + }, + ShadowGenerator: () => { + { + return ShadowGenerator; } - if (this._autoScale) { - this.synchronizeSizeWithContent(); + }, + ShadowDepthWrapper: () => { + { + return ShadowDepthWrapper; } - this.onImageLoadedObservable.notifyObservers(this); - this._markAsDirty(); - } - get source() { - return this._source; - } - static ResetImageCache() { - Image2.SourceImgCache.clear(); - } - _removeCacheUsage(source) { - const value = source && Image2.SourceImgCache.get(source); - if (value) { - value.timesUsed -= 1; - if (value.timesUsed === 0) { - Image2.SourceImgCache.delete(source); - } + }, + ShaderStore: () => { + { + return ShaderStore; } - } - set source(value) { - var _a, _b; - if (this._source === value) { - return; + }, + ShaderStage: () => { + { + return ShaderStage; } - this._removeCacheUsage(this._source); - this._loaded = false; - this._source = value; - this._imageDataCache.data = null; - if (value) { - value = this._svgCheck(value); + }, + ShaderMaterial: () => { + { + return ShaderMaterial; } - const engine47 = ((_b = (_a = this._host) === null || _a === undefined ? undefined : _a.getScene()) === null || _b === undefined ? undefined : _b.getEngine()) || EngineStore.LastCreatedEngine; - if (!engine47) { - throw new Error("Invalid engine. Unable to create a canvas."); + }, + ShaderLanguage: () => { + { + return ShaderLanguage; } - if (value && Image2.SourceImgCache.has(value)) { - const cachedData = Image2.SourceImgCache.get(value); - this._domImage = cachedData.img; - cachedData.timesUsed += 1; - if (cachedData.loaded) { - this._onImageLoaded(); - } else { - cachedData.waitingForLoadCallback.push(this._onImageLoaded.bind(this)); - } - return; + }, + ShaderCodeInliner: () => { + { + return ShaderCodeInliner; } - this._domImage = engine47.createCanvasImage(); - if (value) { - Image2.SourceImgCache.set(value, { img: this._domImage, timesUsed: 1, loaded: false, waitingForLoadCallback: [this._onImageLoaded.bind(this)] }); + }, + SetValueAction: () => { + { + return SetValueAction; } - this._domImage.onload = () => { - if (value) { - const cachedData = Image2.SourceImgCache.get(value); - if (cachedData) { - cachedData.loaded = true; - for (const waitingCallback of cachedData.waitingForLoadCallback) { - waitingCallback(); - } - cachedData.waitingForLoadCallback.length = 0; - return; - } - } - this._onImageLoaded(); - }; - if (value) { - Tools.SetCorsBehavior(value, this._domImage); - Tools.SetReferrerPolicyBehavior(this.referrerPolicy, this._domImage); - this._domImage.src = value; + }, + SetUVsBlock: () => { + { + return SetUVsBlock; } - } - _svgCheck(value) { - if (window.SVGSVGElement && value.search(/.svg#/gi) !== -1 && value.indexOf("#") === value.lastIndexOf("#")) { - this._isSVG = true; - const svgsrc = value.split("#")[0]; - const elemid = value.split("#")[1]; - const svgExist = document.body.querySelector('object[data="' + svgsrc + '"]'); - if (svgExist) { - const svgDoc = svgExist.contentDocument; - if (svgDoc && svgDoc.documentElement) { - const vb = svgDoc.documentElement.getAttribute("viewBox"); - const docwidth = Number(svgDoc.documentElement.getAttribute("width")); - const docheight = Number(svgDoc.documentElement.getAttribute("height")); - const elem = svgDoc.getElementById(elemid); - if (elem && vb && docwidth && docheight) { - this._getSVGAttribs(svgExist, elemid); - return value; - } - } - svgExist.addEventListener("load", () => { - this._getSVGAttribs(svgExist, elemid); - }); - } else { - const svgImage = document.createElement("object"); - svgImage.data = svgsrc; - svgImage.type = "image/svg+xml"; - svgImage.width = "0%"; - svgImage.height = "0%"; - document.body.appendChild(svgImage); - svgImage.onload = () => { - const svgobj = document.body.querySelector('object[data="' + svgsrc + '"]'); - if (svgobj) { - this._getSVGAttribs(svgobj, elemid); - } - }; - } - return svgsrc; - } else { - return value; + }, + SetTangentsBlock: () => { + { + return SetTangentsBlock; } - } - _getSVGAttribs(svgsrc, elemid) { - const svgDoc = svgsrc.contentDocument; - if (svgDoc && svgDoc.documentElement) { - const vb = svgDoc.documentElement.getAttribute("viewBox"); - const docwidth = Number(svgDoc.documentElement.getAttribute("width")); - const docheight = Number(svgDoc.documentElement.getAttribute("height")); - const elem = svgDoc.getElementById(elemid); - if (vb && docwidth && docheight && elem) { - const vb_width = Number(vb.split(" ")[2]); - const vb_height = Number(vb.split(" ")[3]); - const elem_bbox = elem.getBBox(); - let elem_matrix_a = 1; - let elem_matrix_d = 1; - let elem_matrix_e = 0; - let elem_matrix_f = 0; - const mainMatrix = elem.transform.baseVal.consolidate().matrix; - if (elem.transform && elem.transform.baseVal.consolidate()) { - elem_matrix_a = mainMatrix.a; - elem_matrix_d = mainMatrix.d; - elem_matrix_e = mainMatrix.e; - elem_matrix_f = mainMatrix.f; - } - this.sourceLeft = (elem_matrix_a * elem_bbox.x + elem_matrix_e) * docwidth / vb_width; - this.sourceTop = (elem_matrix_d * elem_bbox.y + elem_matrix_f) * docheight / vb_height; - this.sourceWidth = elem_bbox.width * elem_matrix_a * (docwidth / vb_width); - this.sourceHeight = elem_bbox.height * elem_matrix_d * (docheight / vb_height); - this._svgAttributesComputationCompleted = true; - this.onSVGAttributesComputedObservable.notifyObservers(this); - } + }, + SetStateAction: () => { + { + return SetStateAction; } - } - get cellWidth() { - return this._cellWidth; - } - set cellWidth(value) { - if (this._cellWidth === value) { - return; + }, + SetPositionsBlock: () => { + { + return SetPositionsBlock; } - this._cellWidth = value; - this._markAsDirty(); - } - get cellHeight() { - return this._cellHeight; - } - set cellHeight(value) { - if (this._cellHeight === value) { - return; + }, + SetParentAction: () => { + { + return SetParentAction; } - this._cellHeight = value; - this._markAsDirty(); - } - get cellId() { - return this._cellId; - } - set cellId(value) { - if (this._cellId === value) { - return; + }, + SetNormalsBlock: () => { + { + return SetNormalsBlock; } - this._cellId = value; - this._markAsDirty(); - } - constructor(name265, url = null) { - super(name265); - this.name = name265; - this._workingCanvas = null; - this._loaded = false; - this._stretch = Image2.STRETCH_FILL; - this._autoScale = false; - this._sourceLeft = 0; - this._sourceTop = 0; - this._sourceWidth = 0; - this._sourceHeight = 0; - this._svgAttributesComputationCompleted = false; - this._isSVG = false; - this._cellWidth = 0; - this._cellHeight = 0; - this._cellId = -1; - this._populateNinePatchSlicesFromImage = false; - this._imageDataCache = { data: null, key: "" }; - this.onImageLoadedObservable = new Observable; - this.onSVGAttributesComputedObservable = new Observable; - this.source = url; - } - contains(x, y) { - if (!super.contains(x, y)) { - return false; + }, + SetMaterialIDBlock: () => { + { + return SetMaterialIDBlock; } - if (!this._detectPointerOnOpaqueOnly || !this._workingCanvas) { - return true; + }, + SetCorsBehavior: () => { + { + return SetCorsBehavior; } - const width = this._currentMeasure.width | 0; - const height = this._currentMeasure.height | 0; - const key = width + "_" + height; - let imageData = this._imageDataCache.data; - if (!imageData || this._imageDataCache.key !== key) { - const canvas = this._workingCanvas; - const context = canvas.getContext("2d"); - this._imageDataCache.data = imageData = context.getImageData(0, 0, width, height).data; - this._imageDataCache.key = key; + }, + SetColorsBlock: () => { + { + return SetColorsBlock; } - x = x - this._currentMeasure.left | 0; - y = y - this._currentMeasure.top | 0; - const pickedPixel = imageData[(x + y * width) * 4 + 3]; - return pickedPixel > 0; - } - _getTypeName() { - return "Image"; - } - synchronizeSizeWithContent() { - if (!this._loaded) { - return; + }, + SerializationHelper: () => { + { + return SerializationHelper; } - this.width = this._domImage.width + "px"; - this.height = this._domImage.height + "px"; - } - _processMeasures(parentMeasure, context) { - if (this._loaded) { - switch (this._stretch) { - case Image2.STRETCH_NONE: - break; - case Image2.STRETCH_FILL: - break; - case Image2.STRETCH_UNIFORM: - break; - case Image2.STRETCH_NINE_PATCH: - break; - case Image2.STRETCH_EXTEND: - if (this._autoScale) { - this.synchronizeSizeWithContent(); - } - if (this.parent && this.parent.parent) { - this.parent.adaptWidthToChildren = true; - this.parent.adaptHeightToChildren = true; - } - break; - } + }, + ScreenshotTools: () => { + { + return ScreenshotTools; } - super._processMeasures(parentMeasure, context); - } - _prepareWorkingCanvasForOpaqueDetection() { - var _a, _b; - if (!this._detectPointerOnOpaqueOnly) { - return; + }, + ScreenSpaceReflectionPostProcess: () => { + { + return ScreenSpaceReflectionPostProcess; } - const width = this._currentMeasure.width; - const height = this._currentMeasure.height; - if (!this._workingCanvas) { - const engine47 = ((_b = (_a = this._host) === null || _a === undefined ? undefined : _a.getScene()) === null || _b === undefined ? undefined : _b.getEngine()) || EngineStore.LastCreatedEngine; - if (!engine47) { - throw new Error("Invalid engine. Unable to create a canvas."); - } - this._workingCanvas = engine47.createCanvas(width, height); + }, + ScreenSpaceCurvaturePostProcess: () => { + { + return ScreenSpaceCurvaturePostProcess; } - const canvas = this._workingCanvas; - const context = canvas.getContext("2d"); - context.clearRect(0, 0, width, height); - } - _drawImage(context, sx, sy, sw, sh, tx, ty, tw, th) { - context.drawImage(this._domImage, sx, sy, sw, sh, tx, ty, tw, th); - if (!this._detectPointerOnOpaqueOnly) { - return; + }, + ScreenSpaceBlock: () => { + { + return ScreenSpaceBlock; } - const transform = context.getTransform(); - const canvas = this._workingCanvas; - const workingCanvasContext = canvas.getContext("2d"); - workingCanvasContext.save(); - const ttx = tx - this._currentMeasure.left; - const tty = ty - this._currentMeasure.top; - workingCanvasContext.setTransform(transform.a, transform.b, transform.c, transform.d, (ttx + tw) / 2, (tty + th) / 2); - workingCanvasContext.translate(-(ttx + tw) / 2, -(tty + th) / 2); - workingCanvasContext.drawImage(this._domImage, sx, sy, sw, sh, ttx, tty, tw, th); - workingCanvasContext.restore(); - } - _draw(context) { - context.save(); - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowColor = this.shadowColor; - context.shadowBlur = this.shadowBlur; - context.shadowOffsetX = this.shadowOffsetX; - context.shadowOffsetY = this.shadowOffsetY; + }, + ScreenSizeBlock: () => { + { + return ScreenSizeBlock; } - let x, y, width, height; - if (this.cellId == -1) { - x = this._sourceLeft; - y = this._sourceTop; - width = this._sourceWidth ? this._sourceWidth : this._imageWidth; - height = this._sourceHeight ? this._sourceHeight : this._imageHeight; - } else { - const rowCount = this._domImage.naturalWidth / this.cellWidth; - const column = this.cellId / rowCount >> 0; - const row = this.cellId % rowCount; - x = this.cellWidth * row; - y = this.cellHeight * column; - width = this.cellWidth; - height = this.cellHeight; + }, + SceneSerializer: () => { + { + return SceneSerializer; } - this._prepareWorkingCanvasForOpaqueDetection(); - this._applyStates(context); - if (this._loaded) { - switch (this._stretch) { - case Image2.STRETCH_NONE: - this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); - break; - case Image2.STRETCH_FILL: - this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); - break; - case Image2.STRETCH_UNIFORM: { - const hRatio = this._currentMeasure.width / width; - const vRatio = this._currentMeasure.height / height; - const ratio = Math.min(hRatio, vRatio); - const centerX = (this._currentMeasure.width - width * ratio) / 2; - const centerY = (this._currentMeasure.height - height * ratio) / 2; - this._drawImage(context, x, y, width, height, this._currentMeasure.left + centerX, this._currentMeasure.top + centerY, width * ratio, height * ratio); - break; - } - case Image2.STRETCH_EXTEND: - this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); - break; - case Image2.STRETCH_NINE_PATCH: - this._renderNinePatch(context, x, y, width, height); - break; - } + }, + SceneRecorder: () => { + { + return SceneRecorder; } - context.restore(); - } - _renderNinePatch(context, sx, sy, sw, sh) { - const leftWidth = this._sliceLeft; - const topHeight = this._sliceTop; - const bottomHeight = sh - this._sliceBottom; - const rightWidth = sw - this._sliceRight; - const centerWidth = this._sliceRight - this._sliceLeft; - const centerHeight = this._sliceBottom - this._sliceTop; - const targetCenterWidth = this._currentMeasure.width - rightWidth - leftWidth + 2; - const targetCenterHeight = this._currentMeasure.height - bottomHeight - topHeight + 2; - const centerLeftOffset = this._currentMeasure.left + leftWidth - 1; - const centerTopOffset = this._currentMeasure.top + topHeight - 1; - const rightOffset = this._currentMeasure.left + this._currentMeasure.width - rightWidth; - const bottomOffset = this._currentMeasure.top + this._currentMeasure.height - bottomHeight; - this._drawImage(context, sx, sy, leftWidth, topHeight, this._currentMeasure.left, this._currentMeasure.top, leftWidth, topHeight); - this._drawImage(context, sx + this._sliceLeft, sy, centerWidth, topHeight, centerLeftOffset + 1, this._currentMeasure.top, targetCenterWidth - 2, topHeight); - this._drawImage(context, sx + this._sliceRight, sy, rightWidth, topHeight, rightOffset, this._currentMeasure.top, rightWidth, topHeight); - this._drawImage(context, sx, sy + this._sliceTop, leftWidth, centerHeight, this._currentMeasure.left, centerTopOffset + 1, leftWidth, targetCenterHeight - 2); - this._drawImage(context, sx + this._sliceLeft, sy + this._sliceTop, centerWidth, centerHeight, centerLeftOffset, centerTopOffset, targetCenterWidth, targetCenterHeight); - this._drawImage(context, sx + this._sliceRight, sy + this._sliceTop, rightWidth, centerHeight, rightOffset, centerTopOffset + 1, rightWidth, targetCenterHeight - 2); - this._drawImage(context, sx, sy + this._sliceBottom, leftWidth, bottomHeight, this._currentMeasure.left, bottomOffset, leftWidth, bottomHeight); - this._drawImage(context, sx + this.sliceLeft, sy + this._sliceBottom, centerWidth, bottomHeight, centerLeftOffset + 1, bottomOffset, targetCenterWidth - 2, bottomHeight); - this._drawImage(context, sx + this._sliceRight, sy + this._sliceBottom, rightWidth, bottomHeight, rightOffset, bottomOffset, rightWidth, bottomHeight); - } - dispose() { - super.dispose(); - this.onImageLoadedObservable.clear(); - this.onSVGAttributesComputedObservable.clear(); - this._removeCacheUsage(this._source); - } -} -Image2.SourceImgCache = new Map; -Image2.STRETCH_NONE = 0; -Image2.STRETCH_FILL = 1; -Image2.STRETCH_UNIFORM = 2; -Image2.STRETCH_EXTEND = 3; -Image2.STRETCH_NINE_PATCH = 4; -__decorate2([ - serialize() -], Image2.prototype, "detectPointerOnOpaqueOnly", null); -__decorate2([ - serialize() -], Image2.prototype, "sliceLeft", null); -__decorate2([ - serialize() -], Image2.prototype, "sliceRight", null); -__decorate2([ - serialize() -], Image2.prototype, "sliceTop", null); -__decorate2([ - serialize() -], Image2.prototype, "sliceBottom", null); -__decorate2([ - serialize() -], Image2.prototype, "sourceLeft", null); -__decorate2([ - serialize() -], Image2.prototype, "sourceTop", null); -__decorate2([ - serialize() -], Image2.prototype, "sourceWidth", null); -__decorate2([ - serialize() -], Image2.prototype, "sourceHeight", null); -__decorate2([ - serialize() -], Image2.prototype, "populateNinePatchSlicesFromImage", null); -__decorate2([ - serialize() -], Image2.prototype, "autoScale", null); -__decorate2([ - serialize() -], Image2.prototype, "stretch", null); -__decorate2([ - serialize() -], Image2.prototype, "source", null); -__decorate2([ - serialize() -], Image2.prototype, "cellWidth", null); -__decorate2([ - serialize() -], Image2.prototype, "cellHeight", null); -__decorate2([ - serialize() -], Image2.prototype, "cellId", null); -RegisterClass("BABYLON.GUI.Image", Image2); - -// node_modules/@babylonjs/gui/2D/controls/button.js -class Button extends Rectangle { - get image() { - return this._image; - } - get textBlock() { - return this._textBlock; - } - constructor(name265) { - super(name265); - this.name = name265; - this.delegatePickingToChildren = false; - this.thickness = 1; - this.isPointerBlocker = true; - let alphaStore = null; - this.pointerEnterAnimation = () => { - alphaStore = this.alpha; - this.alpha -= 0.1; - }; - this.pointerOutAnimation = () => { - if (alphaStore !== null) { - this.alpha = alphaStore; - } - }; - this.pointerDownAnimation = () => { - this.scaleX -= 0.05; - this.scaleY -= 0.05; - }; - this.pointerUpAnimation = () => { - this.scaleX += 0.05; - this.scaleY += 0.05; - }; - } - _getTypeName() { - return "Button"; - } - _processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) { - if (!this._isEnabled || !this.isHitTestVisible || !this.isVisible || this.notRenderable) { - return false; + }, + ScenePerformancePriority: () => { + { + return ScenePerformancePriority; } - if (!super.contains(x, y)) { - return false; + }, + SceneOptimizerOptions: () => { + { + return SceneOptimizerOptions; } - if (this.delegatePickingToChildren) { - let contains = false; - for (let index = this._children.length - 1;index >= 0; index--) { - const child = this._children[index]; - if (child.isEnabled && child.isHitTestVisible && child.isVisible && !child.notRenderable && child.contains(x, y)) { - contains = true; - break; - } - } - if (!contains) { - return false; - } + }, + SceneOptimizer: () => { + { + return SceneOptimizer; } - this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY); - return true; - } - _onPointerEnter(target, pi) { - if (!super._onPointerEnter(target, pi)) { - return false; + }, + SceneOptimization: () => { + { + return SceneOptimization; } - if (!this.isReadOnly && this.pointerEnterAnimation) { - this.pointerEnterAnimation(); + }, + SceneLoaderFlags: () => { + { + return SceneLoaderFlags; } - return true; - } - _onPointerOut(target, pi, force = false) { - if (!this.isReadOnly && this.pointerOutAnimation) { - this.pointerOutAnimation(); + }, + SceneLoaderAnimationGroupLoadingMode: () => { + { + return SceneLoaderAnimationGroupLoadingMode; } - super._onPointerOut(target, pi, force); - } - _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { - if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { - return false; + }, + SceneLoader: () => { + { + return SceneLoader; } - if (!this.isReadOnly && this.pointerDownAnimation) { - this.pointerDownAnimation(); + }, + SceneInstrumentation: () => { + { + return SceneInstrumentation; } - return true; - } - _getRectangleFill(context) { - if (this.isEnabled) { - return this._getBackgroundColor(context); - } else { - return this._disabledColor; + }, + SceneDepthBlock: () => { + { + return SceneDepthBlock; } - } - _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi) { - if (!this.isReadOnly && this.pointerUpAnimation) { - this.pointerUpAnimation(); + }, + SceneComponentConstants: () => { + { + return SceneComponentConstants; } - super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi); - } - serialize(serializationObject) { - super.serialize(serializationObject); - if (this._textBlock) { - serializationObject.textBlockName = this._textBlock.name; + }, + Scene: () => { + { + return Scene; } - if (this._image) { - serializationObject.imageName = this._image.name; + }, + ScalingBlock: () => { + { + return ScalingBlock; } - } - _parseFromContent(serializedObject, host) { - super._parseFromContent(serializedObject, host); - if (serializedObject.textBlockName) { - this._textBlock = this.getChildByName(serializedObject.textBlockName); + }, + ScaleGizmo: () => { + { + return ScaleGizmo; } - if (serializedObject.imageName) { - this._image = this.getChildByName(serializedObject.imageName); + }, + ScaleBlock: () => { + { + return ScaleBlock; } - } - static CreateImageButton(name265, text, imageUrl) { - const result = new this(name265); - const textBlock2 = new TextBlock(name265 + "_button", text); - textBlock2.textWrapping = true; - textBlock2.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER; - textBlock2.paddingLeft = "20%"; - result.addControl(textBlock2); - const iconImage = new Image2(name265 + "_icon", imageUrl); - iconImage.width = "20%"; - iconImage.stretch = Image2.STRETCH_UNIFORM; - iconImage.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - result.addControl(iconImage); - result._image = iconImage; - result._textBlock = textBlock2; - return result; - } - static CreateImageOnlyButton(name265, imageUrl) { - const result = new this(name265); - const iconImage = new Image2(name265 + "_icon", imageUrl); - iconImage.stretch = Image2.STRETCH_FILL; - iconImage.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - result.addControl(iconImage); - result._image = iconImage; - return result; - } - static CreateSimpleButton(name265, text) { - const result = new this(name265); - const textBlock2 = new TextBlock(name265 + "_button", text); - textBlock2.textWrapping = true; - textBlock2.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER; - result.addControl(textBlock2); - result._textBlock = textBlock2; - return result; - } - static CreateImageWithCenterTextButton(name265, text, imageUrl) { - const result = new this(name265); - const iconImage = new Image2(name265 + "_icon", imageUrl); - iconImage.stretch = Image2.STRETCH_FILL; - result.addControl(iconImage); - const textBlock2 = new TextBlock(name265 + "_button", text); - textBlock2.textWrapping = true; - textBlock2.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER; - result.addControl(textBlock2); - result._image = iconImage; - result._textBlock = textBlock2; - return result; - } -} -RegisterClass("BABYLON.GUI.Button", Button); -// node_modules/@babylonjs/gui/2D/controls/stackPanel.js -class StackPanel extends Container { - get isVertical() { - return this._isVertical; - } - set isVertical(value) { - if (this._isVertical === value) { - return; + }, + Scalar: () => { + { + return Scalar; } - this._isVertical = value; - this._markAsDirty(); - } - get spacing() { - return this._spacing; - } - set spacing(value) { - if (this._spacing === value) { - return; + }, + SamplerBindingType: () => { + { + return SamplerBindingType; } - this._spacing = value; - this._markAsDirty(); - } - set width(value) { - if (!this._doNotTrackManualChanges) { - this._manualWidth = true; + }, + SSRRenderingPipeline: () => { + { + return SSRRenderingPipeline; } - if (this._width.toString(this._host) === value) { - return; + }, + SSAORenderingPipeline: () => { + { + return SSAORenderingPipeline; } - if (this._width.fromString(value)) { - this._markAsDirty(); + }, + SSAO2RenderingPipeline: () => { + { + return SSAO2RenderingPipeline; } - } - get width() { - return this._width.toString(this._host); - } - set height(value) { - if (!this._doNotTrackManualChanges) { - this._manualHeight = true; + }, + RuntimeError: () => { + { + return RuntimeError; } - if (this._height.toString(this._host) === value) { - return; + }, + RuntimeAnimation: () => { + { + return RuntimeAnimation; } - if (this._height.fromString(value)) { - this._markAsDirty(); + }, + RotationZBlock: () => { + { + return RotationZBlock; } - } - get height() { - return this._height.toString(this._host); - } - constructor(name265) { - super(name265); - this.name = name265; - this._isVertical = true; - this._manualWidth = false; - this._manualHeight = false; - this._doNotTrackManualChanges = false; - this._spacing = 0; - this.ignoreLayoutWarnings = false; - } - _getTypeName() { - return "StackPanel"; - } - _preMeasure(parentMeasure, context) { - for (const child of this._children) { - if (this._isVertical) { - child.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP; - } else { - child.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - } + }, + RotationYBlock: () => { + { + return RotationYBlock; } - super._preMeasure(parentMeasure, context); - } - _additionalProcessing(parentMeasure, context) { - super._additionalProcessing(parentMeasure, context); - this._measureForChildren.copyFrom(parentMeasure); - this._measureForChildren.left = this._currentMeasure.left; - this._measureForChildren.top = this._currentMeasure.top; - if (!this.isVertical || this._manualWidth) { - this._measureForChildren.width = this._currentMeasure.width; + }, + RotationXBlock: () => { + { + return RotationXBlock; } - if (this.isVertical || this._manualHeight) { - this._measureForChildren.height = this._currentMeasure.height; + }, + RotationGizmo: () => { + { + return RotationGizmo; } - } - _postMeasure() { - let stackWidth = 0; - let stackHeight = 0; - const childrenCount = this._children.length; - for (let index = 0;index < childrenCount; index++) { - const child = this._children[index]; - if (!child.isVisible || child.notRenderable) { - continue; - } - if (this._isVertical) { - if (child.top !== stackHeight + "px") { - child.top = stackHeight + "px"; - this._rebuildLayout = true; - child._top.ignoreAdaptiveScaling = true; - } - if (!this.ignoreLayoutWarnings && !child.isDimensionFullyDefined("height")) { - Logger.Warn(`Control (Name:${child.name}, UniqueId:${child.uniqueId}) is using height in percentage mode inside a vertical StackPanel`, 1); - } else { - stackHeight += child._currentMeasure.height + child._paddingTopInPixels + child._paddingBottomInPixels + (index < childrenCount - 1 ? this._spacing : 0); - } - } else { - if (child.left !== stackWidth + "px") { - child.left = stackWidth + "px"; - this._rebuildLayout = true; - child._left.ignoreAdaptiveScaling = true; - } - if (!this.ignoreLayoutWarnings && !child.isDimensionFullyDefined("width")) { - Logger.Warn(`Control (Name:${child.name}, UniqueId:${child.uniqueId}) is using width in percentage mode inside a horizontal StackPanel`, 1); - } else { - stackWidth += child._currentMeasure.width + child._paddingLeftInPixels + child._paddingRightInPixels + (index < childrenCount - 1 ? this._spacing : 0); - } - } + }, + Rotate2dBlock: () => { + { + return Rotate2dBlock; } - stackWidth += this._paddingLeftInPixels + this._paddingRightInPixels; - stackHeight += this._paddingTopInPixels + this._paddingBottomInPixels; - this._doNotTrackManualChanges = true; - let panelWidthChanged = false; - let panelHeightChanged = false; - if ((!this._manualHeight || this.adaptHeightToChildren) && this._isVertical) { - const previousHeight = this.height; - this.height = stackHeight + "px"; - panelHeightChanged = previousHeight !== this.height || !this._height.ignoreAdaptiveScaling; + }, + RollingAverage: () => { + { + return RollingAverage; } - if ((!this._manualWidth || this.adaptWidthToChildren) && !this._isVertical) { - const previousWidth = this.width; - this.width = stackWidth + "px"; - panelWidthChanged = previousWidth !== this.width || !this._width.ignoreAdaptiveScaling; + }, + RichTypeVector4: () => { + { + return RichTypeVector4; } - if (panelHeightChanged) { - this._height.ignoreAdaptiveScaling = true; + }, + RichTypeVector3: () => { + { + return RichTypeVector3; } - if (panelWidthChanged) { - this._width.ignoreAdaptiveScaling = true; + }, + RichTypeVector2: () => { + { + return RichTypeVector2; } - this._doNotTrackManualChanges = false; - if (panelWidthChanged || panelHeightChanged) { - this._rebuildLayout = true; + }, + RichTypeString: () => { + { + return RichTypeString; } - super._postMeasure(); - } - _getManualDim(dim) { - if (dim === "width") { - return this._manualWidth; - } else { - return this._manualHeight; + }, + RichTypeQuaternion: () => { + { + return RichTypeQuaternion; } - } - isDimensionFullyDefined(dim) { - if (dim === "height" ? this.isVertical : !this.isVertical && !this._getManualDim(dim)) { - for (const child of this._children) { - if (!child.isDimensionFullyDefined(dim)) { - return false; - } - } - return true; + }, + RichTypeNumber: () => { + { + return RichTypeNumber; } - return this.getDimension(dim).isPixel || this._getAdaptDimTo(dim); - } - serialize(serializationObject) { - super.serialize(serializationObject); - serializationObject.manualWidth = this._manualWidth; - serializationObject.manualHeight = this._manualHeight; - } - _parseFromContent(serializedObject, host) { - this._manualWidth = serializedObject.manualWidth; - this._manualHeight = serializedObject.manualHeight; - super._parseFromContent(serializedObject, host); - } -} -__decorate2([ - serialize() -], StackPanel.prototype, "ignoreLayoutWarnings", undefined); -__decorate2([ - serialize() -], StackPanel.prototype, "isVertical", null); -__decorate2([ - serialize() -], StackPanel.prototype, "spacing", null); -__decorate2([ - serialize() -], StackPanel.prototype, "width", null); -__decorate2([ - serialize() -], StackPanel.prototype, "height", null); -RegisterClass("BABYLON.GUI.StackPanel", StackPanel); - -// node_modules/@babylonjs/gui/2D/controls/checkbox.js -class Checkbox extends Control { - get thickness() { - return this._thickness; - } - set thickness(value) { - if (this._thickness === value) { - return; + }, + RichTypeMatrix: () => { + { + return RichTypeMatrix; } - this._thickness = value; - this._markAsDirty(); - } - get checkSizeRatio() { - return this._checkSizeRatio; - } - set checkSizeRatio(value) { - value = Math.max(Math.min(1, value), 0); - if (this._checkSizeRatio === value) { - return; + }, + RichTypeColor4: () => { + { + return RichTypeColor4; } - this._checkSizeRatio = value; - this._markAsDirty(); - } - get background() { - return this._background; - } - set background(value) { - if (this._background === value) { - return; + }, + RichTypeColor3: () => { + { + return RichTypeColor3; } - this._background = value; - this._markAsDirty(); - } - get isChecked() { - return this._isChecked; - } - set isChecked(value) { - if (this._isChecked === value) { - return; + }, + RichTypeBoolean: () => { + { + return RichTypeBoolean; } - this._isChecked = value; - this._markAsDirty(); - this.onIsCheckedChangedObservable.notifyObservers(value); - } - constructor(name265) { - super(name265); - this.name = name265; - this._isChecked = false; - this._background = "black"; - this._checkSizeRatio = 0.8; - this._thickness = 1; - this.onIsCheckedChangedObservable = new Observable; - this.isPointerBlocker = true; - } - _getTypeName() { - return "Checkbox"; - } - _draw(context) { - context.save(); - this._applyStates(context); - const actualWidth = this._currentMeasure.width - this._thickness; - const actualHeight = this._currentMeasure.height - this._thickness; - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowColor = this.shadowColor; - context.shadowBlur = this.shadowBlur; - context.shadowOffsetX = this.shadowOffsetX; - context.shadowOffsetY = this.shadowOffsetY; + }, + RichTypeAny: () => { + { + return RichTypeAny; } - context.fillStyle = this._isEnabled ? this._background : this._disabledColor; - context.fillRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, actualWidth, actualHeight); - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowBlur = 0; - context.shadowOffsetX = 0; - context.shadowOffsetY = 0; + }, + RichType: () => { + { + return RichType; } - if (this._isChecked) { - context.fillStyle = this._isEnabled ? this.color : this._disabledColorItem; - const offsetWidth = actualWidth * this._checkSizeRatio; - const offsetHeight = actualHeight * this._checkSizeRatio; - context.fillRect(this._currentMeasure.left + this._thickness / 2 + (actualWidth - offsetWidth) / 2, this._currentMeasure.top + this._thickness / 2 + (actualHeight - offsetHeight) / 2, offsetWidth, offsetHeight); + }, + RibbonBuilder: () => { + { + return RibbonBuilder; } - context.strokeStyle = this.color; - context.lineWidth = this._thickness; - context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, actualWidth, actualHeight); - context.restore(); - } - _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { - if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { - return false; + }, + RetryStrategy: () => { + { + return RetryStrategy; } - if (!this.isReadOnly) { - this.isChecked = !this.isChecked; + }, + RequestFileError: () => { + { + return RequestFileError; } - return true; - } - static AddCheckBoxWithHeader(title, onValueChanged) { - const panel = new StackPanel; - panel.isVertical = false; - panel.height = "30px"; - const checkbox = new Checkbox; - checkbox.width = "20px"; - checkbox.height = "20px"; - checkbox.isChecked = true; - checkbox.color = "green"; - checkbox.onIsCheckedChangedObservable.add(onValueChanged); - panel.addControl(checkbox); - const header = new TextBlock; - header.text = title; - header.width = "180px"; - header.paddingLeft = "5px"; - header.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - header.color = "white"; - panel.addControl(header); - return panel; - } -} -__decorate2([ - serialize() -], Checkbox.prototype, "thickness", null); -__decorate2([ - serialize() -], Checkbox.prototype, "checkSizeRatio", null); -__decorate2([ - serialize() -], Checkbox.prototype, "background", null); -__decorate2([ - serialize() -], Checkbox.prototype, "isChecked", null); -RegisterClass("BABYLON.GUI.Checkbox", Checkbox); -// node_modules/@babylonjs/gui/2D/controls/textWrapper.js -class TextWrapper { - get text() { - return this._characters ? this._characters.join("") : this._text; - } - set text(txt) { - this._text = txt; - this._characters = Array.from && Array.from(txt); - } - get length() { - return this._characters ? this._characters.length : this._text.length; - } - removePart(idxStart, idxEnd, insertTxt) { - this._text = this._text.slice(0, idxStart) + (insertTxt ? insertTxt : "") + this._text.slice(idxEnd); - if (this._characters) { - const newCharacters = insertTxt ? Array.from(insertTxt) : []; - this._characters.splice(idxStart, idxEnd - idxStart, ...newCharacters); + }, + RequestFile: () => { + { + return RequestFile; } - } - charAt(idx) { - return this._characters ? this._characters[idx] : this._text.charAt(idx); - } - substr(from, length) { - if (this._characters) { - if (isNaN(from)) { - from = 0; - } else if (from >= 0) { - from = Math.min(from, this._characters.length); - } else { - from = this._characters.length + Math.max(from, -this._characters.length); - } - if (length === undefined) { - length = this._characters.length - from; - } else if (isNaN(length)) { - length = 0; - } else if (length < 0) { - length = 0; - } - const temp = []; - while (--length >= 0) { - temp[length] = this._characters[from + length]; - } - return temp.join(""); + }, + ReplaceColorBlock: () => { + { + return ReplaceColorBlock; } - return this._text.substr(from, length); - } - substring(from, to) { - if (this._characters) { - if (isNaN(from)) { - from = 0; - } else if (from > this._characters.length) { - from = this._characters.length; - } else if (from < 0) { - from = 0; - } - if (to === undefined) { - to = this._characters.length; - } else if (isNaN(to)) { - to = 0; - } else if (to > this._characters.length) { - to = this._characters.length; - } else if (to < 0) { - to = 0; - } - const temp = []; - let idx = 0; - while (from < to) { - temp[idx++] = this._characters[from++]; - } - return temp.join(""); + }, + RenderingManager: () => { + { + return RenderingManager; } - return this._text.substring(from, to); - } - isWord(index) { - const rWord = /\w/g; - return this._characters ? this._characters[index].search(rWord) !== -1 : this._text.search(rWord) !== -1; - } -} - -// node_modules/@babylonjs/gui/2D/controls/inputText.js -class InputText extends Control { - get maxWidth() { - return this._maxWidth.toString(this._host); - } - get maxWidthInPixels() { - return this._maxWidth.getValueInPixel(this._host, this._cachedParentMeasure.width); - } - set maxWidth(value) { - if (this._maxWidth.toString(this._host) === value) { - return; + }, + RenderingGroupInfo: () => { + { + return RenderingGroupInfo; } - if (this._maxWidth.fromString(value)) { - this._markAsDirty(); + }, + RenderingGroup: () => { + { + return RenderingGroup; } - } - get highligherOpacity() { - return this._highligherOpacity; - } - set highligherOpacity(value) { - if (this._highligherOpacity === value) { - return; + }, + RenderTargetsOptimization: () => { + { + return RenderTargetsOptimization; } - this._highligherOpacity = value; - this._markAsDirty(); - } - get onFocusSelectAll() { - return this._onFocusSelectAll; - } - set onFocusSelectAll(value) { - if (this._onFocusSelectAll === value) { - return; + }, + RenderTargetWrapper: () => { + { + return RenderTargetWrapper; } - this._onFocusSelectAll = value; - this._markAsDirty(); - } - get textHighlightColor() { - return this._textHighlightColor; - } - set textHighlightColor(value) { - if (this._textHighlightColor === value) { - return; + }, + RenderTargetTexture: () => { + { + return RenderTargetTexture; } - this._textHighlightColor = value; - this._markAsDirty(); - } - get margin() { - return this._margin.toString(this._host); - } - get marginInPixels() { - return this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width); - } - set margin(value) { - if (this._margin.toString(this._host) === value) { - return; + }, + RenderPassTimestampLocation: () => { + { + return RenderPassTimestampLocation; } - if (this._margin.fromString(value)) { - this._markAsDirty(); + }, + RemapBlock: () => { + { + return RemapBlock; } - } - get autoStretchWidth() { - return this._autoStretchWidth; - } - set autoStretchWidth(value) { - if (this._autoStretchWidth === value) { - return; + }, + RegisterNativeTypeAsync: () => { + { + return RegisterNativeTypeAsync; } - this._autoStretchWidth = value; - this._markAsDirty(); - } - get thickness() { - return this._thickness; - } - set thickness(value) { - if (this._thickness === value) { - return; + }, + RegisterMaterialPlugin: () => { + { + return RegisterMaterialPlugin; } - this._thickness = value; - this._markAsDirty(); - } - get focusedBackground() { - return this._focusedBackground; - } - set focusedBackground(value) { - if (this._focusedBackground === value) { - return; + }, + RegisterClass: () => { + { + return RegisterClass; } - this._focusedBackground = value; - this._markAsDirty(); - } - get focusedColor() { - return this._focusedColor; - } - set focusedColor(value) { - if (this._focusedColor === value) { - return; + }, + RefractionTexture: () => { + { + return RefractionTexture; } - this._focusedColor = value; - this._markAsDirty(); - } - get background() { - return this._background; - } - set background(value) { - if (this._background === value) { - return; + }, + RefractionPostProcess: () => { + { + return RefractionPostProcess; } - this._background = value; - this._markAsDirty(); - } - get placeholderColor() { - return this._placeholderColor; - } - set placeholderColor(value) { - if (this._placeholderColor === value) { - return; + }, + RefractionBlock: () => { + { + return RefractionBlock; } - this._placeholderColor = value; - this._markAsDirty(); - } - get placeholderText() { - return this._placeholderText; - } - set placeholderText(value) { - if (this._placeholderText === value) { - return; + }, + RefractBlock: () => { + { + return RefractBlock; } - this._placeholderText = value; - this._markAsDirty(); - } - get deadKey() { - return this._deadKey; - } - set deadKey(flag) { - this._deadKey = flag; - } - get highlightedText() { - return this._highlightedText; - } - set highlightedText(text) { - if (this._highlightedText === text) { - return; + }, + Reflector: () => { + { + return Reflector; } - this._highlightedText = text; - this._markAsDirty(); - } - get addKey() { - return this._addKey; - } - set addKey(flag) { - this._addKey = flag; - } - get currentKey() { - return this._currentKey; - } - set currentKey(key) { - this._currentKey = key; - } - get text() { - return this._textWrapper.text; - } - set text(value) { - const valueAsString = value.toString(); - if (!this._textWrapper) { - this._textWrapper = new TextWrapper; + }, + ReflectionTextureBlock: () => { + { + return ReflectionTextureBlock; } - if (this._textWrapper.text === valueAsString) { - return; + }, + ReflectionProbe: () => { + { + return ReflectionProbe; } - this._textWrapper.text = valueAsString; - this._textHasChanged(); - } - _textHasChanged() { - this._markAsDirty(); - this.onTextChangedObservable.notifyObservers(this); - } - get width() { - return this._width.toString(this._host); - } - set width(value) { - if (this._width.toString(this._host) === value) { - return; + }, + ReflectionBlock: () => { + { + return ReflectionBlock; } - if (this._width.fromString(value)) { - this._markAsDirty(); + }, + ReflectBlock: () => { + { + return ReflectBlock; } - this.autoStretchWidth = false; - } - constructor(name265, text = "") { - super(name265); - this.name = name265; - this._placeholderText = ""; - this._background = "#222222"; - this._focusedBackground = "#000000"; - this._focusedColor = "white"; - this._placeholderColor = "gray"; - this._thickness = 1; - this._margin = new ValueAndUnit(10, ValueAndUnit.UNITMODE_PIXEL); - this._autoStretchWidth = true; - this._maxWidth = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false); - this._isFocused = false; - this._blinkIsEven = false; - this._cursorOffset = 0; - this._deadKey = false; - this._addKey = true; - this._currentKey = ""; - this._isTextHighlightOn = false; - this._textHighlightColor = "#d5e0ff"; - this._highligherOpacity = 0.4; - this._highlightedText = ""; - this._startHighlightIndex = 0; - this._endHighlightIndex = 0; - this._cursorIndex = -1; - this._onFocusSelectAll = false; - this._isPointerDown = false; - this.promptMessage = "Please enter text:"; - this.disableMobilePrompt = false; - this.onTextChangedObservable = new Observable; - this.onBeforeKeyAddObservable = new Observable; - this.onFocusObservable = new Observable; - this.onBlurObservable = new Observable; - this.onTextHighlightObservable = new Observable; - this.onTextCopyObservable = new Observable; - this.onTextCutObservable = new Observable; - this.onTextPasteObservable = new Observable; - this.onKeyboardEventProcessedObservable = new Observable; - this.text = text; - this.isPointerBlocker = true; - } - onBlur() { - this._isFocused = false; - this._scrollLeft = null; - this._cursorOffset = 0; - clearTimeout(this._blinkTimeout); - this._markAsDirty(); - this.onBlurObservable.notifyObservers(this); - this._host.unRegisterClipboardEvents(); - if (this._onClipboardObserver) { - this._host.onClipboardObservable.remove(this._onClipboardObserver); + }, + ReciprocalBlock: () => { + { + return ReciprocalBlock; } - const scene37 = this._host.getScene(); - if (this._onPointerDblTapObserver && scene37) { - scene37.onPointerObservable.remove(this._onPointerDblTapObserver); + }, + RecastJSPlugin: () => { + { + return RecastJSPlugin; } - } - onFocus() { - if (!this._isEnabled) { - return; + }, + RecastJSCrowd: () => { + { + return RecastJSCrowd; } - this._scrollLeft = null; - this._isFocused = true; - this._blinkIsEven = false; - this._cursorOffset = 0; - this._markAsDirty(); - this.onFocusObservable.notifyObservers(this); - if (this._focusedBy === "touch" && !this.disableMobilePrompt) { - const value = prompt(this.promptMessage); - if (value !== null) { - this.text = value; - } - this._host.focusedControl = null; - return; + }, + ReadFileError: () => { + { + return ReadFileError; } - this._host.registerClipboardEvents(); - this._onClipboardObserver = this._host.onClipboardObservable.add((clipboardInfo) => { - switch (clipboardInfo.type) { - case ClipboardEventTypes.COPY: - this._onCopyText(clipboardInfo.event); - this.onTextCopyObservable.notifyObservers(this); - break; - case ClipboardEventTypes.CUT: - this._onCutText(clipboardInfo.event); - this.onTextCutObservable.notifyObservers(this); - break; - case ClipboardEventTypes.PASTE: - this._onPasteText(clipboardInfo.event); - this.onTextPasteObservable.notifyObservers(this); - break; - default: - return; - } - }); - const scene37 = this._host.getScene(); - if (scene37) { - this._onPointerDblTapObserver = scene37.onPointerObservable.add((pointerInfo) => { - if (!this._isFocused) { - return; - } - if (pointerInfo.type === PointerEventTypes.POINTERDOUBLETAP) { - this._processDblClick(pointerInfo); - } - }); + }, + ReadFile: () => { + { + return ReadFile; } - if (this._onFocusSelectAll) { - this._selectAllText(); + }, + RayHelper: () => { + { + return RayHelper; } - } - focus() { - this._host.moveFocusToControl(this); - } - blur() { - this._host.focusedControl = null; - } - _getTypeName() { - return "InputText"; - } - keepsFocusWith() { - if (!this._connectedVirtualKeyboard) { - return null; + }, + Ray: () => { + { + return Ray; } - return [this._connectedVirtualKeyboard]; - } - processKey(keyCode, key, evt) { - var _a; - if (this.isReadOnly) { - return; + }, + RawTexture3D: () => { + { + return RawTexture3D; } - if (evt && (evt.ctrlKey || evt.metaKey) && (keyCode === 67 || keyCode === 86 || keyCode === 88)) { - return; + }, + RawTexture2DArray: () => { + { + return RawTexture2DArray; } - if (evt && (evt.ctrlKey || evt.metaKey) && keyCode === 65) { - this._selectAllText(); - evt.preventDefault(); - return; + }, + RawTexture: () => { + { + return RawTexture; } - switch (keyCode) { - case 32: - key = " "; - break; - case 191: - if (evt) { - evt.preventDefault(); - } - break; - case 8: - if (this._textWrapper.text && this._textWrapper.length > 0) { - if (this.isTextHighlightOn) { - this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex); - this._textHasChanged(); - this.isTextHighlightOn = false; - this._cursorOffset = this._textWrapper.length - this._startHighlightIndex; - this._blinkIsEven = false; - if (evt) { - evt.preventDefault(); - } - return; - } - if (this._cursorOffset === 0) { - this.text = this._textWrapper.substr(0, this._textWrapper.length - 1); - } else { - const deletePosition = this._textWrapper.length - this._cursorOffset; - if (deletePosition > 0) { - this._textWrapper.removePart(deletePosition - 1, deletePosition); - this._textHasChanged(); - } - } - } - if (evt) { - evt.preventDefault(); - } - return; - case 46: - if (this.isTextHighlightOn) { - this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex); - this._textHasChanged(); - this.isTextHighlightOn = false; - this._cursorOffset = this._textWrapper.length - this._startHighlightIndex; - if (evt) { - evt.preventDefault(); - } - return; - } - if (this._textWrapper.text && this._textWrapper.length > 0 && this._cursorOffset > 0) { - const deletePosition = this._textWrapper.length - this._cursorOffset; - this._textWrapper.removePart(deletePosition, deletePosition + 1); - this._textHasChanged(); - this._cursorOffset--; - } - if (evt) { - evt.preventDefault(); - } - return; - case 13: - this._host.focusedControl = null; - this.isTextHighlightOn = false; - return; - case 35: - this._cursorOffset = 0; - this._blinkIsEven = false; - this.isTextHighlightOn = false; - this._markAsDirty(); - return; - case 36: - this._cursorOffset = this._textWrapper.length; - this._blinkIsEven = false; - this.isTextHighlightOn = false; - this._markAsDirty(); - return; - case 37: - this._cursorOffset++; - if (this._cursorOffset > this._textWrapper.length) { - this._cursorOffset = this._textWrapper.length; - } - if (evt && evt.shiftKey) { - this._blinkIsEven = false; - if (evt.ctrlKey || evt.metaKey) { - if (!this.isTextHighlightOn) { - if (this._textWrapper.length === this._cursorOffset) { - return; - } else { - this._endHighlightIndex = this._textWrapper.length - this._cursorOffset + 1; - } - } - this._startHighlightIndex = 0; - this._cursorIndex = this._textWrapper.length - this._endHighlightIndex; - this._cursorOffset = this._textWrapper.length; - this.isTextHighlightOn = true; - this._markAsDirty(); - return; - } - if (!this.isTextHighlightOn) { - this.isTextHighlightOn = true; - this._cursorIndex = this._cursorOffset >= this._textWrapper.length ? this._textWrapper.length : this._cursorOffset - 1; - } else if (this._cursorIndex === -1) { - this._cursorIndex = this._textWrapper.length - this._endHighlightIndex; - this._cursorOffset = this._startHighlightIndex === 0 ? this._textWrapper.length : this._textWrapper.length - this._startHighlightIndex + 1; - } - if (this._cursorIndex < this._cursorOffset) { - this._endHighlightIndex = this._textWrapper.length - this._cursorIndex; - this._startHighlightIndex = this._textWrapper.length - this._cursorOffset; - } else if (this._cursorIndex > this._cursorOffset) { - this._endHighlightIndex = this._textWrapper.length - this._cursorOffset; - this._startHighlightIndex = this._textWrapper.length - this._cursorIndex; - } else { - this.isTextHighlightOn = false; - } - this._markAsDirty(); - return; - } - if (this.isTextHighlightOn) { - this._cursorOffset = this._textWrapper.length - this._startHighlightIndex; - this.isTextHighlightOn = false; - } - if (evt && (evt.ctrlKey || evt.metaKey)) { - this._cursorOffset = this._textWrapper.length; - evt.preventDefault(); - } - this._blinkIsEven = false; - this.isTextHighlightOn = false; - this._cursorIndex = -1; - this._markAsDirty(); - return; - case 39: - this._cursorOffset--; - if (this._cursorOffset < 0) { - this._cursorOffset = 0; - } - if (evt && evt.shiftKey) { - this._blinkIsEven = false; - if (evt.ctrlKey || evt.metaKey) { - if (!this.isTextHighlightOn) { - if (this._cursorOffset === 0) { - return; - } else { - this._startHighlightIndex = this._textWrapper.length - this._cursorOffset - 1; - } - } - this._endHighlightIndex = this._textWrapper.length; - this.isTextHighlightOn = true; - this._cursorIndex = this._textWrapper.length - this._startHighlightIndex; - this._cursorOffset = 0; - this._markAsDirty(); - return; - } - if (!this.isTextHighlightOn) { - this.isTextHighlightOn = true; - this._cursorIndex = this._cursorOffset <= 0 ? 0 : this._cursorOffset + 1; - } else if (this._cursorIndex === -1) { - this._cursorIndex = this._textWrapper.length - this._startHighlightIndex; - this._cursorOffset = this._textWrapper.length === this._endHighlightIndex ? 0 : this._textWrapper.length - this._endHighlightIndex - 1; - } - if (this._cursorIndex < this._cursorOffset) { - this._endHighlightIndex = this._textWrapper.length - this._cursorIndex; - this._startHighlightIndex = this._textWrapper.length - this._cursorOffset; - } else if (this._cursorIndex > this._cursorOffset) { - this._endHighlightIndex = this._textWrapper.length - this._cursorOffset; - this._startHighlightIndex = this._textWrapper.length - this._cursorIndex; - } else { - this.isTextHighlightOn = false; - } - this._markAsDirty(); - return; - } - if (this.isTextHighlightOn) { - this._cursorOffset = this._textWrapper.length - this._endHighlightIndex; - this.isTextHighlightOn = false; - } - if (evt && (evt.ctrlKey || evt.metaKey)) { - this._cursorOffset = 0; - evt.preventDefault(); - } - this._blinkIsEven = false; - this.isTextHighlightOn = false; - this._cursorIndex = -1; - this._markAsDirty(); - return; + }, + RawCubeTexture: () => { + { + return RawCubeTexture; } - if (keyCode === 32) { - key = (_a = evt === null || evt === undefined ? undefined : evt.key) !== null && _a !== undefined ? _a : " "; + }, + RandomNumberBlock: () => { + { + return RandomNumberBlock; } - this._deadKey = key === "Dead"; - if (key && (keyCode === -1 || keyCode === 32 || keyCode === 34 || keyCode === 39 || keyCode > 47 && keyCode < 64 || keyCode > 64 && keyCode < 91 || keyCode > 159 && keyCode < 193 || keyCode > 218 && keyCode < 223 || keyCode > 95 && keyCode < 112)) { - this._currentKey = key; - this.onBeforeKeyAddObservable.notifyObservers(this); - key = this._currentKey; - if (this._addKey && !this._deadKey) { - if (this.isTextHighlightOn) { - this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex, key); - this._textHasChanged(); - this._cursorOffset = this._textWrapper.length - (this._startHighlightIndex + 1); - this.isTextHighlightOn = false; - this._blinkIsEven = false; - this._markAsDirty(); - } else if (this._cursorOffset === 0) { - this.text += this._deadKey && (evt === null || evt === undefined ? undefined : evt.key) ? evt.key : key; - } else { - const insertPosition = this._textWrapper.length - this._cursorOffset; - this._textWrapper.removePart(insertPosition, insertPosition, key); - this._textHasChanged(); - } - } + }, + RandomGUID: () => { + { + return RandomGUID; } - } - _updateValueFromCursorIndex(offset) { - this._blinkIsEven = false; - if (this._cursorIndex === -1) { - this._cursorIndex = offset; - } else { - if (this._cursorIndex < this._cursorOffset) { - this._endHighlightIndex = this._textWrapper.length - this._cursorIndex; - this._startHighlightIndex = this._textWrapper.length - this._cursorOffset; - } else if (this._cursorIndex > this._cursorOffset) { - this._endHighlightIndex = this._textWrapper.length - this._cursorOffset; - this._startHighlightIndex = this._textWrapper.length - this._cursorIndex; - } else { - this.isTextHighlightOn = false; - this._markAsDirty(); - return; - } + }, + RandomBlockLocks: () => { + { + return RandomBlockLocks; } - this.isTextHighlightOn = true; - this._markAsDirty(); - } - _processDblClick(evt) { - this._startHighlightIndex = this._textWrapper.length - this._cursorOffset; - this._endHighlightIndex = this._startHighlightIndex; - let moveLeft, moveRight; - do { - moveRight = this._endHighlightIndex < this._textWrapper.length && this._textWrapper.isWord(this._endHighlightIndex) ? ++this._endHighlightIndex : 0; - moveLeft = this._startHighlightIndex > 0 && this._textWrapper.isWord(this._startHighlightIndex - 1) ? --this._startHighlightIndex : 0; - } while (moveLeft || moveRight); - this._cursorOffset = this._textWrapper.length - this._startHighlightIndex; - this.isTextHighlightOn = true; - this._clickedCoordinate = null; - this._blinkIsEven = true; - this._cursorIndex = -1; - this._markAsDirty(); - } - _selectAllText() { - this._blinkIsEven = true; - this.isTextHighlightOn = true; - this._startHighlightIndex = 0; - this._endHighlightIndex = this._textWrapper.length; - this._cursorOffset = this._textWrapper.length; - this._cursorIndex = -1; - this._markAsDirty(); - } - processKeyboard(evt) { - this.processKey(evt.keyCode, evt.key, evt); - this.onKeyboardEventProcessedObservable.notifyObservers(evt); - } - _onCopyText(ev) { - this.isTextHighlightOn = false; - try { - ev.clipboardData && ev.clipboardData.setData("text/plain", this._highlightedText); - } catch (_a) { + }, + RandomBlock: () => { + { + return RandomBlock; } - this._host.clipboardData = this._highlightedText; - } - _onCutText(ev) { - if (!this._highlightedText) { - return; + }, + RagdollBoneProperties: () => { + { + return RagdollBoneProperties; } - this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex); - this._textHasChanged(); - this.isTextHighlightOn = false; - this._cursorOffset = this._textWrapper.length - this._startHighlightIndex; - try { - ev.clipboardData && ev.clipboardData.setData("text/plain", this._highlightedText); - } catch (_a) { + }, + Ragdoll: () => { + { + return Ragdoll; } - this._host.clipboardData = this._highlightedText; - this._highlightedText = ""; - } - _onPasteText(ev) { - let data = ""; - if (ev.clipboardData && ev.clipboardData.types.indexOf("text/plain") !== -1) { - data = ev.clipboardData.getData("text/plain"); - } else { - data = this._host.clipboardData; + }, + RGBDTextureTools: () => { + { + return RGBDTextureTools; } - const insertPosition = this._textWrapper.length - this._cursorOffset; - this._textWrapper.removePart(insertPosition, insertPosition, data); - this._textHasChanged(); - } - _draw(context) { - context.save(); - this._applyStates(context); - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowColor = this.shadowColor; - context.shadowBlur = this.shadowBlur; - context.shadowOffsetX = this.shadowOffsetX; - context.shadowOffsetY = this.shadowOffsetY; + }, + QuinticEase: () => { + { + return QuinticEase; } - if (this._isFocused) { - if (this._focusedBackground) { - context.fillStyle = this._isEnabled ? this._focusedBackground : this._disabledColor; - context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); - } - } else if (this._background) { - context.fillStyle = this._isEnabled ? this._background : this._disabledColor; - context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + }, + QueryType: () => { + { + return QueryType; } - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowBlur = 0; - context.shadowOffsetX = 0; - context.shadowOffsetY = 0; + }, + Quaternion: () => { + { + return Quaternion; } - if (!this._fontOffset || this._wasDirty) { - this._fontOffset = Control._GetFontOffset(context.font); + }, + QuarticEase: () => { + { + return QuarticEase; } - const clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, this._tempParentMeasure.width); - if (this.color) { - context.fillStyle = this.color; + }, + QuadraticErrorSimplification: () => { + { + return QuadraticErrorSimplification; } - let text = this._beforeRenderText(this._textWrapper); - if (!this._isFocused && !this._textWrapper.text && this._placeholderText) { - text = new TextWrapper; - text.text = this._placeholderText; - if (this._placeholderColor) { - context.fillStyle = this._placeholderColor; - } + }, + QuadraticEase: () => { + { + return QuadraticEase; } - this._textWidth = context.measureText(text.text).width; - const marginWidth = this._margin.getValueInPixel(this._host, this._tempParentMeasure.width) * 2; - if (this._autoStretchWidth) { - this.width = Math.min(this._maxWidth.getValueInPixel(this._host, this._tempParentMeasure.width), this._textWidth + marginWidth) + "px"; - this._autoStretchWidth = true; + }, + PushMaterial: () => { + { + return PushMaterial; } - const rootY = this._fontOffset.ascent + (this._currentMeasure.height - this._fontOffset.height) / 2; - const availableWidth = this._width.getValueInPixel(this._host, this._tempParentMeasure.width) - marginWidth; - context.save(); - context.beginPath(); - context.rect(clipTextLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, availableWidth + 2, this._currentMeasure.height); - context.clip(); - if (this._isFocused && this._textWidth > availableWidth) { - const textLeft = clipTextLeft - this._textWidth + availableWidth; - if (!this._scrollLeft) { - this._scrollLeft = textLeft; - } - } else { - this._scrollLeft = clipTextLeft; + }, + PropertyTypeForEdition: () => { + { + return PropertyTypeForEdition; } - context.fillText(text.text, this._scrollLeft, this._currentMeasure.top + rootY); - if (this._isFocused) { - if (this._clickedCoordinate) { - const rightPosition = this._scrollLeft + this._textWidth; - const absoluteCursorPosition = rightPosition - this._clickedCoordinate; - let currentSize = 0; - this._cursorOffset = 0; - let previousDist = 0; - do { - if (this._cursorOffset) { - previousDist = Math.abs(absoluteCursorPosition - currentSize); - } - this._cursorOffset++; - currentSize = context.measureText(text.substr(text.length - this._cursorOffset, this._cursorOffset)).width; - } while (currentSize < absoluteCursorPosition && text.length >= this._cursorOffset); - if (Math.abs(absoluteCursorPosition - currentSize) > previousDist) { - this._cursorOffset--; - } - this._blinkIsEven = false; - this._clickedCoordinate = null; - } - if (!this._blinkIsEven) { - const cursorOffsetText = text.substr(text.length - this._cursorOffset); - const cursorOffsetWidth = context.measureText(cursorOffsetText).width; - let cursorLeft = this._scrollLeft + this._textWidth - cursorOffsetWidth; - if (cursorLeft < clipTextLeft) { - this._scrollLeft += clipTextLeft - cursorLeft; - cursorLeft = clipTextLeft; - this._markAsDirty(); - } else if (cursorLeft > clipTextLeft + availableWidth) { - this._scrollLeft += clipTextLeft + availableWidth - cursorLeft; - cursorLeft = clipTextLeft + availableWidth; - this._markAsDirty(); - } - if (!this.isTextHighlightOn) { - context.fillRect(cursorLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, 2, this._fontOffset.height); - } - } - clearTimeout(this._blinkTimeout); - this._blinkTimeout = setTimeout(() => { - this._blinkIsEven = !this._blinkIsEven; - this._markAsDirty(); - }, 500); - if (this.isTextHighlightOn) { - clearTimeout(this._blinkTimeout); - const highlightCursorOffsetWidth = context.measureText(text.substring(this._startHighlightIndex)).width; - let highlightCursorLeft = this._scrollLeft + this._textWidth - highlightCursorOffsetWidth; - this._highlightedText = text.substring(this._startHighlightIndex, this._endHighlightIndex); - let width = context.measureText(text.substring(this._startHighlightIndex, this._endHighlightIndex)).width; - if (highlightCursorLeft < clipTextLeft) { - width = width - (clipTextLeft - highlightCursorLeft); - if (!width) { - width = context.measureText(text.charAt(text.length - this._cursorOffset)).width; - } - highlightCursorLeft = clipTextLeft; - } - context.globalAlpha = this._highligherOpacity; - context.fillStyle = this._textHighlightColor; - context.fillRect(highlightCursorLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, width, this._fontOffset.height); - context.globalAlpha = 1; - } + }, + ProceduralTextureSceneComponent: () => { + { + return ProceduralTextureSceneComponent; } - context.restore(); - if (this._thickness) { - if (this._isFocused) { - if (this.focusedColor) { - context.strokeStyle = this.focusedColor; - } - } else { - if (this.color) { - context.strokeStyle = this.color; - } - } - context.lineWidth = this._thickness; - context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, this._currentMeasure.width - this._thickness, this._currentMeasure.height - this._thickness); + }, + ProceduralTexture: () => { + { + return ProceduralTexture; } - context.restore(); - } - _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { - if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { - return false; + }, + PrismaticConstraint: () => { + { + return PrismaticConstraint; } - if (this.isReadOnly) { - return true; + }, + PrimitiveTopology: () => { + { + return PrimitiveTopology; } - this._clickedCoordinate = coordinates.x; - this.isTextHighlightOn = false; - this._highlightedText = ""; - this._cursorIndex = -1; - this._isPointerDown = true; - this._host._capturingControl[pointerId] = this; - this._focusedBy = pi.event.pointerType; - if (this._host.focusedControl === this) { - clearTimeout(this._blinkTimeout); - this._markAsDirty(); - return true; + }, + PressureObserverWrapper: () => { + { + return PressureObserverWrapper; } - if (!this._isEnabled) { - return false; + }, + PredicateCondition: () => { + { + return PredicateCondition; } - this._host.focusedControl = this; - return true; - } - _onPointerMove(target, coordinates, pointerId, pi) { - if (this._host.focusedControl === this && this._isPointerDown && !this.isReadOnly) { - this._clickedCoordinate = coordinates.x; - this._markAsDirty(); - this._updateValueFromCursorIndex(this._cursorOffset); + }, + PrecisionDate: () => { + { + return PrecisionDate; } - super._onPointerMove(target, coordinates, pointerId, pi); - } - _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick) { - this._isPointerDown = false; - delete this._host._capturingControl[pointerId]; - super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick); - } - _beforeRenderText(textWrapper2) { - return textWrapper2; - } - set isTextHighlightOn(value) { - if (this._isTextHighlightOn === value) { - return; + }, + PrePassTextureBlock: () => { + { + return PrePassTextureBlock; } - if (value) { - this.onTextHighlightObservable.notifyObservers(this); + }, + PrePassRendererSceneComponent: () => { + { + return PrePassRendererSceneComponent; } - this._isTextHighlightOn = value; - } - get isTextHighlightOn() { - return this._isTextHighlightOn; - } - dispose() { - super.dispose(); - this.onBlurObservable.clear(); - this.onFocusObservable.clear(); - this.onTextChangedObservable.clear(); - this.onTextCopyObservable.clear(); - this.onTextCutObservable.clear(); - this.onTextPasteObservable.clear(); - this.onTextHighlightObservable.clear(); - this.onKeyboardEventProcessedObservable.clear(); - } -} -__decorate2([ - serialize() -], InputText.prototype, "promptMessage", undefined); -__decorate2([ - serialize() -], InputText.prototype, "disableMobilePrompt", undefined); -__decorate2([ - serialize() -], InputText.prototype, "maxWidth", null); -__decorate2([ - serialize() -], InputText.prototype, "highligherOpacity", null); -__decorate2([ - serialize() -], InputText.prototype, "onFocusSelectAll", null); -__decorate2([ - serialize() -], InputText.prototype, "textHighlightColor", null); -__decorate2([ - serialize() -], InputText.prototype, "margin", null); -__decorate2([ - serialize() -], InputText.prototype, "autoStretchWidth", null); -__decorate2([ - serialize() -], InputText.prototype, "thickness", null); -__decorate2([ - serialize() -], InputText.prototype, "focusedBackground", null); -__decorate2([ - serialize() -], InputText.prototype, "focusedColor", null); -__decorate2([ - serialize() -], InputText.prototype, "background", null); -__decorate2([ - serialize() -], InputText.prototype, "placeholderColor", null); -__decorate2([ - serialize() -], InputText.prototype, "placeholderText", null); -__decorate2([ - serialize() -], InputText.prototype, "deadKey", null); -__decorate2([ - serialize() -], InputText.prototype, "text", null); -__decorate2([ - serialize() -], InputText.prototype, "width", null); -RegisterClass("BABYLON.GUI.InputText", InputText); - -// node_modules/@babylonjs/gui/2D/controls/grid.js -class Grid extends Container { - set clipContent(value) { - this._clipContent = value; - for (const key in this._cells) { - this._cells[key].clipContent = value; + }, + PrePassRenderer: () => { + { + return PrePassRenderer; } - } - get clipContent() { - return this._clipContent; - } - set clipChildren(value) { - this._clipChildren = value; - for (const key in this._cells) { - this._cells[key].clipChildren = value; + }, + PrePassOutputBlock: () => { + { + return PrePassOutputBlock; } - } - get clipChildren() { - return this._clipChildren; - } - get columnCount() { - return this._columnDefinitions.length; - } - get rowCount() { - return this._rowDefinitions.length; - } - get children() { - return this._childControls; - } - get cells() { - return this._cells; - } - getRowDefinition(index) { - if (index < 0 || index >= this._rowDefinitions.length) { - return null; + }, + PowerPreference: () => { + { + return PowerPreference; } - return this._rowDefinitions[index]; - } - getColumnDefinition(index) { - if (index < 0 || index >= this._columnDefinitions.length) { - return null; + }, + PowerEase: () => { + { + return PowerEase; } - return this._columnDefinitions[index]; - } - addRowDefinition(height, isPixel = false) { - this._rowDefinitions.push(new ValueAndUnit(height, isPixel ? ValueAndUnit.UNITMODE_PIXEL : ValueAndUnit.UNITMODE_PERCENTAGE)); - this._rowDefinitionObservers.push(this._rowDefinitions[this.rowCount - 1].onChangedObservable.add(() => this._markAsDirty())); - this._markAsDirty(); - return this; - } - addColumnDefinition(width, isPixel = false) { - this._columnDefinitions.push(new ValueAndUnit(width, isPixel ? ValueAndUnit.UNITMODE_PIXEL : ValueAndUnit.UNITMODE_PERCENTAGE)); - this._columnDefinitionObservers.push(this._columnDefinitions[this.columnCount - 1].onChangedObservable.add(() => this._markAsDirty())); - this._markAsDirty(); - return this; - } - setRowDefinition(index, height, isPixel = false) { - if (index < 0 || index >= this._rowDefinitions.length) { - return this; + }, + PowBlock: () => { + { + return PowBlock; } - const current = this._rowDefinitions[index]; - if (current && current.isPixel === isPixel && current.value === height) { - return this; + }, + PosterizeBlock: () => { + { + return PosterizeBlock; } - this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]); - this._rowDefinitions[index] = new ValueAndUnit(height, isPixel ? ValueAndUnit.UNITMODE_PIXEL : ValueAndUnit.UNITMODE_PERCENTAGE); - this._rowDefinitionObservers[index] = this._rowDefinitions[index].onChangedObservable.add(() => this._markAsDirty()); - this._markAsDirty(); - return this; - } - setColumnDefinition(index, width, isPixel = false) { - if (index < 0 || index >= this._columnDefinitions.length) { - return this; + }, + PostProcessesOptimization: () => { + { + return PostProcessesOptimization; } - const current = this._columnDefinitions[index]; - if (current && current.isPixel === isPixel && current.value === width) { - return this; + }, + PostProcessRenderPipelineManagerSceneComponent: () => { + { + return PostProcessRenderPipelineManagerSceneComponent; } - this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]); - this._columnDefinitions[index] = new ValueAndUnit(width, isPixel ? ValueAndUnit.UNITMODE_PIXEL : ValueAndUnit.UNITMODE_PERCENTAGE); - this._columnDefinitionObservers[index] = this._columnDefinitions[index].onChangedObservable.add(() => this._markAsDirty()); - this._markAsDirty(); - return this; - } - getChildrenAt(row, column) { - const cell = this._cells[`${row}:${column}`]; - if (!cell) { - return null; + }, + PostProcessRenderPipelineManager: () => { + { + return PostProcessRenderPipelineManager; } - return cell.children; - } - getChildCellInfo(child) { - return child._tag; - } - _removeCell(cell, key) { - if (!cell) { - return; + }, + PostProcessRenderPipeline: () => { + { + return PostProcessRenderPipeline; } - super.removeControl(cell); - for (const control9 of cell.children) { - const childIndex = this._childControls.indexOf(control9); - if (childIndex !== -1) { - this._childControls.splice(childIndex, 1); - } + }, + PostProcessRenderEffect: () => { + { + return PostProcessRenderEffect; } - delete this._cells[key]; - } - _offsetCell(previousKey, key) { - if (!this._cells[key]) { - return; + }, + PostProcessManager: () => { + { + return PostProcessManager; } - this._cells[previousKey] = this._cells[key]; - for (const control9 of this._cells[previousKey].children) { - control9._tag = previousKey; + }, + PostProcess: () => { + { + return PostProcess; } - delete this._cells[key]; - } - removeColumnDefinition(index) { - if (index < 0 || index >= this._columnDefinitions.length) { - return this; + }, + PositionNormalVertex: () => { + { + return PositionNormalVertex; } - for (let x = 0;x < this._rowDefinitions.length; x++) { - const key = `${x}:${index}`; - const cell = this._cells[key]; - this._removeCell(cell, key); + }, + PositionNormalTextureVertex: () => { + { + return PositionNormalTextureVertex; } - for (let x = 0;x < this._rowDefinitions.length; x++) { - for (let y = index + 1;y < this._columnDefinitions.length; y++) { - const previousKey = `${x}:${y - 1}`; - const key = `${x}:${y}`; - this._offsetCell(previousKey, key); - } + }, + PositionGizmo: () => { + { + return PositionGizmo; } - this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]); - this._columnDefinitions.splice(index, 1); - this._columnDefinitionObservers.splice(index, 1); - this._markAsDirty(); - return this; - } - removeRowDefinition(index) { - if (index < 0 || index >= this._rowDefinitions.length) { - return this; + }, + PolyhedronData: () => { + { + return PolyhedronData; } - for (let y = 0;y < this._columnDefinitions.length; y++) { - const key = `${index}:${y}`; - const cell = this._cells[key]; - this._removeCell(cell, key); + }, + PolyhedronBuilder: () => { + { + return PolyhedronBuilder; } - for (let y = 0;y < this._columnDefinitions.length; y++) { - for (let x = index + 1;x < this._rowDefinitions.length; x++) { - const previousKey = `${x - 1}:${y}`; - const key = `${x}:${y}`; - this._offsetCell(previousKey, key); - } + }, + PolygonMeshBuilder: () => { + { + return PolygonMeshBuilder; } - this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]); - this._rowDefinitions.splice(index, 1); - this._rowDefinitionObservers.splice(index, 1); - this._markAsDirty(); - return this; - } - addControl(control9, row = 0, column = 0) { - if (this._rowDefinitions.length === 0) { - this.addRowDefinition(1, false); + }, + PolygonBuilder: () => { + { + return PolygonBuilder; } - if (this._columnDefinitions.length === 0) { - this.addColumnDefinition(1, false); + }, + Polygon: () => { + { + return Polygon; } - if (this._childControls.indexOf(control9) !== -1) { - Tools.Warn(`Control (Name:${control9.name}, UniqueId:${control9.uniqueId}) is already associated with this grid. You must remove it before reattaching it`); - return this; + }, + Polar: () => { + { + return Polar; } - const x = Math.min(row, this._rowDefinitions.length - 1); - const y = Math.min(column, this._columnDefinitions.length - 1); - const key = `${x}:${y}`; - let goodContainer = this._cells[key]; - if (!goodContainer) { - goodContainer = new Container(key); - this._cells[key] = goodContainer; - goodContainer.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - goodContainer.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP; - goodContainer.clipContent = this.clipContent; - goodContainer.clipChildren = this.clipChildren; - super.addControl(goodContainer); + }, + PointsGroup: () => { + { + return PointsGroup; } - goodContainer.addControl(control9); - this._childControls.push(control9); - control9._tag = key; - control9.parent = this; - this._markAsDirty(); - return this; - } - removeControl(control9) { - const index = this._childControls.indexOf(control9); - if (index !== -1) { - this._childControls.splice(index, 1); + }, + PointsCloudSystem: () => { + { + return PointsCloudSystem; } - const cell = this._cells[control9._tag]; - if (cell) { - cell.removeControl(control9); - control9._tag = null; + }, + PointerInput: () => { + { + return PointerInput; } - this._markAsDirty(); - return this; - } - constructor(name265) { - super(name265); - this.name = name265; - this._rowDefinitions = new Array; - this._rowDefinitionObservers = []; - this._columnDefinitions = new Array; - this._columnDefinitionObservers = []; - this._cells = {}; - this._childControls = new Array; - } - _getTypeName() { - return "Grid"; - } - _getGridDefinitions(definitionCallback) { - const widths = []; - const heights = []; - const lefts = []; - const tops = []; - let availableWidth = this._currentMeasure.width; - let globalWidthPercentage = 0; - let availableHeight = this._currentMeasure.height; - let globalHeightPercentage = 0; - let index = 0; - for (const rowDefinition of this._rowDefinitions) { - if (rowDefinition.isPixel) { - const height = rowDefinition.getValue(this._host); - availableHeight -= height; - heights[index] = height; - } else { - globalHeightPercentage += rowDefinition.value; - } - index++; + }, + PointerInfoPre: () => { + { + return PointerInfoPre; } - let top = 0; - index = 0; - for (const rowDefinition of this._rowDefinitions) { - tops.push(top); - if (!rowDefinition.isPixel) { - const height = Math.round(rowDefinition.value / globalHeightPercentage * availableHeight); - top += height; - heights[index] = height; - } else { - top += rowDefinition.getValue(this._host); - } - index++; + }, + PointerInfoBase: () => { + { + return PointerInfoBase; } - index = 0; - for (const columnDefinition of this._columnDefinitions) { - if (columnDefinition.isPixel) { - const width = columnDefinition.getValue(this._host); - availableWidth -= width; - widths[index] = width; - } else { - globalWidthPercentage += columnDefinition.value; - } - index++; + }, + PointerInfo: () => { + { + return PointerInfo; } - let left = 0; - index = 0; - for (const columnDefinition of this._columnDefinitions) { - lefts.push(left); - if (!columnDefinition.isPixel) { - const width = Math.round(columnDefinition.value / globalWidthPercentage * availableWidth); - left += width; - widths[index] = width; - } else { - left += columnDefinition.getValue(this._host); - } - index++; + }, + PointerEventTypes: () => { + { + return PointerEventTypes; } - definitionCallback(lefts, tops, widths, heights); - } - _additionalProcessing(parentMeasure, context) { - this._getGridDefinitions((lefts, tops, widths, heights) => { - for (const key in this._cells) { - if (!Object.prototype.hasOwnProperty.call(this._cells, key)) { - continue; - } - const split = key.split(":"); - const x = parseInt(split[0]); - const y = parseInt(split[1]); - const cell = this._cells[key]; - cell.leftInPixels = lefts[y]; - cell.topInPixels = tops[x]; - cell.widthInPixels = widths[y]; - cell.heightInPixels = heights[x]; - cell._left.ignoreAdaptiveScaling = true; - cell._top.ignoreAdaptiveScaling = true; - cell._width.ignoreAdaptiveScaling = true; - cell._height.ignoreAdaptiveScaling = true; - } - }); - super._additionalProcessing(parentMeasure, context); - } - _flagDescendantsAsMatrixDirty() { - for (const key in this._cells) { - if (!Object.prototype.hasOwnProperty.call(this._cells, key)) { - continue; - } - const child = this._cells[key]; - child._markMatrixAsDirty(); + }, + PointerDragBehavior: () => { + { + return PointerDragBehavior; } - } - _renderHighlightSpecific(context) { - super._renderHighlightSpecific(context); - this._getGridDefinitions((lefts, tops, widths, heights) => { - for (let index = 0;index < lefts.length; index++) { - const left = this._currentMeasure.left + lefts[index] + widths[index]; - context.beginPath(); - context.moveTo(left, this._currentMeasure.top); - context.lineTo(left, this._currentMeasure.top + this._currentMeasure.height); - context.stroke(); - } - for (let index = 0;index < tops.length; index++) { - const top = this._currentMeasure.top + tops[index] + heights[index]; - context.beginPath(); - context.moveTo(this._currentMeasure.left, top); - context.lineTo(this._currentMeasure.left + this._currentMeasure.width, top); - context.stroke(); - } - }); - context.restore(); - } - dispose() { - super.dispose(); - for (const control9 of this._childControls) { - control9.dispose(); + }, + PointParticleEmitter: () => { + { + return PointParticleEmitter; } - for (let index = 0;index < this._rowDefinitions.length; index++) { - this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]); + }, + PointLight: () => { + { + return PointLight; } - for (let index = 0;index < this._columnDefinitions.length; index++) { - this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]); + }, + PointColor: () => { + { + return PointColor; } - this._rowDefinitionObservers.length = 0; - this._rowDefinitions.length = 0; - this._columnDefinitionObservers.length = 0; - this._columnDefinitions.length = 0; - this._cells = {}; - this._childControls.length = 0; - } - serialize(serializationObject) { - super.serialize(serializationObject); - serializationObject.columnCount = this.columnCount; - serializationObject.rowCount = this.rowCount; - serializationObject.columns = []; - serializationObject.rows = []; - serializationObject.tags = []; - for (let i = 0;i < this.columnCount; ++i) { - const cd = this.getColumnDefinition(i); - const childSerializationObject = { value: cd === null || cd === undefined ? undefined : cd.getValue(this.host), unit: cd === null || cd === undefined ? undefined : cd.unit }; - serializationObject.columns.push(childSerializationObject); + }, + PlaySoundAction: () => { + { + return PlaySoundAction; } - for (let i = 0;i < this.rowCount; ++i) { - const rd = this.getRowDefinition(i); - const childSerializationObject = { value: rd === null || rd === undefined ? undefined : rd.getValue(this.host), unit: rd === null || rd === undefined ? undefined : rd.unit }; - serializationObject.rows.push(childSerializationObject); + }, + PlayAnimationAction: () => { + { + return PlayAnimationAction; } - this.children.forEach((child) => { - serializationObject.tags.push(child._tag); - }); - } - _parseFromContent(serializedObject, host) { - super._parseFromContent(serializedObject, host); - const children = []; - this.children.forEach((child) => { - children.push(child); - }); - this.removeRowDefinition(0); - this.removeColumnDefinition(0); - for (let i = 0;i < serializedObject.columnCount; ++i) { - const columnValue = serializedObject.columns[i].value; - const unit = serializedObject.columns[i].unit; - this.addColumnDefinition(columnValue, unit === 1 ? true : false); + }, + PlaneRotationGizmo: () => { + { + return PlaneRotationGizmo; } - for (let i = 0;i < serializedObject.rowCount; ++i) { - const rowValue = serializedObject.rows[i].value; - const unit = serializedObject.rows[i].unit; - this.addRowDefinition(rowValue, unit === 1 ? true : false); + }, + PlaneDragGizmo: () => { + { + return PlaneDragGizmo; } - for (let i = 0;i < children.length; ++i) { - const cellInfo = serializedObject.tags[i]; - let rowNumber = parseInt(cellInfo.substring(0, cellInfo.search(":"))); - if (isNaN(rowNumber)) { - rowNumber = 0; - } - let columnNumber = parseInt(cellInfo.substring(cellInfo.search(":") + 1)); - if (isNaN(columnNumber)) { - columnNumber = 0; - } - this.addControl(children[i], rowNumber, columnNumber); + }, + PlaneBuilder: () => { + { + return PlaneBuilder; } - } -} -__decorate2([ - serialize() -], Grid.prototype, "clipContent", null); -RegisterClass("BABYLON.GUI.Grid", Grid); - -// node_modules/@babylonjs/gui/2D/controls/colorpicker.js -class ColorPicker extends Control { - get value() { - return this._value; - } - set value(value) { - if (this._value.equals(value)) { - return; + }, + PlaneBlock: () => { + { + return PlaneBlock; } - this._value.copyFrom(value); - this._value.toHSVToRef(this._tmpColor); - this._h = this._tmpColor.r; - this._s = Math.max(this._tmpColor.g, 0.00001); - this._v = Math.max(this._tmpColor.b, 0.00001); - this._markAsDirty(); - if (this._value.r <= ColorPicker._Epsilon) { - this._value.r = 0; + }, + Plane: () => { + { + return Plane; } - if (this._value.g <= ColorPicker._Epsilon) { - this._value.g = 0; + }, + PivotTools: () => { + { + return PivotTools; } - if (this._value.b <= ColorPicker._Epsilon) { - this._value.b = 0; + }, + PipelineErrorReason: () => { + { + return PipelineErrorReason; } - if (this._value.r >= 1 - ColorPicker._Epsilon) { - this._value.r = 1; + }, + PickingInfo: () => { + { + return PickingInfo; } - if (this._value.g >= 1 - ColorPicker._Epsilon) { - this._value.g = 1; + }, + PhysicsVortexEventOptions: () => { + { + return PhysicsVortexEventOptions; } - if (this._value.b >= 1 - ColorPicker._Epsilon) { - this._value.b = 1; + }, + PhysicsViewer: () => { + { + return PhysicsViewer; } - this.onValueChangedObservable.notifyObservers(this._value); - } - get width() { - return this._width.toString(this._host); - } - set width(value) { - if (this._width.toString(this._host) === value) { - return; + }, + PhysicsUpdraftMode: () => { + { + return PhysicsUpdraftMode; } - if (this._width.fromString(value)) { - if (this._width.getValue(this._host) === 0) { - value = "1px"; - this._width.fromString(value); - } - this._height.fromString(value); - this._markAsDirty(); + }, + PhysicsUpdraftEventOptions: () => { + { + return PhysicsUpdraftEventOptions; } - } - get height() { - return this._height.toString(this._host); - } - set height(value) { - if (this._height.toString(this._host) === value) { - return; + }, + PhysicsShapeType: () => { + { + return PhysicsShapeType; } - if (this._height.fromString(value)) { - if (this._height.getValue(this._host) === 0) { - value = "1px"; - this._height.fromString(value); - } - this._width.fromString(value); - this._markAsDirty(); + }, + PhysicsShapeSphere: () => { + { + return PhysicsShapeSphere; } - } - get size() { - return this.width; - } - set size(value) { - this.width = value; - } - constructor(name265) { - super(name265); - this.name = name265; - this._value = Color3.Red(); - this._tmpColor = new Color3; - this._pointerStartedOnSquare = false; - this._pointerStartedOnWheel = false; - this._squareLeft = 0; - this._squareTop = 0; - this._squareSize = 0; - this._h = 360; - this._s = 1; - this._v = 1; - this._lastPointerDownId = -1; - this.onValueChangedObservable = new Observable; - this._pointerIsDown = false; - this.value = new Color3(0.88, 0.1, 0.1); - this.size = "200px"; - this.isPointerBlocker = true; - } - _getTypeName() { - return "ColorPicker"; - } - _preMeasure(parentMeasure) { - if (parentMeasure.width < parentMeasure.height) { - this._currentMeasure.height = parentMeasure.width; - } else { - this._currentMeasure.width = parentMeasure.height; + }, + PhysicsShapeMesh: () => { + { + return PhysicsShapeMesh; } - } - _updateSquareProps() { - const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5; - const wheelThickness = radius * 0.2; - const innerDiameter = (radius - wheelThickness) * 2; - const squareSize = innerDiameter / Math.sqrt(2); - const offset = radius - squareSize * 0.5; - this._squareLeft = this._currentMeasure.left + offset; - this._squareTop = this._currentMeasure.top + offset; - this._squareSize = squareSize; - } - _drawGradientSquare(hueValue, left, top, width, height, context) { - const lgh = context.createLinearGradient(left, top, width + left, top); - lgh.addColorStop(0, "#fff"); - lgh.addColorStop(1, "hsl(" + hueValue + ", 100%, 50%)"); - context.fillStyle = lgh; - context.fillRect(left, top, width, height); - const lgv = context.createLinearGradient(left, top, left, height + top); - lgv.addColorStop(0, "rgba(0,0,0,0)"); - lgv.addColorStop(1, "#000"); - context.fillStyle = lgv; - context.fillRect(left, top, width, height); - } - _drawCircle(centerX, centerY, radius, context) { - context.beginPath(); - context.arc(centerX, centerY, radius + 1, 0, 2 * Math.PI, false); - context.lineWidth = 3; - context.strokeStyle = "#333333"; - context.stroke(); - context.beginPath(); - context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false); - context.lineWidth = 3; - context.strokeStyle = "#ffffff"; - context.stroke(); - } - _createColorWheelCanvas(radius, thickness) { - const engine47 = EngineStore.LastCreatedEngine; - if (!engine47) { - throw new Error("Invalid engine. Unable to create a canvas."); + }, + PhysicsShapeCylinder: () => { + { + return PhysicsShapeCylinder; } - const canvas = engine47.createCanvas(radius * 2, radius * 2); - const context = canvas.getContext("2d"); - const image2 = context.getImageData(0, 0, radius * 2, radius * 2); - const data = image2.data; - const color = this._tmpColor; - const maxDistSq = radius * radius; - const innerRadius = radius - thickness; - const minDistSq = innerRadius * innerRadius; - for (let x = -radius;x < radius; x++) { - for (let y = -radius;y < radius; y++) { - const distSq = x * x + y * y; - if (distSq > maxDistSq || distSq < minDistSq) { - continue; - } - const dist = Math.sqrt(distSq); - const ang = Math.atan2(y, x); - Color3.HSVtoRGBToRef(ang * 180 / Math.PI + 180, dist / radius, 1, color); - const index = (x + radius + (y + radius) * 2 * radius) * 4; - data[index] = color.r * 255; - data[index + 1] = color.g * 255; - data[index + 2] = color.b * 255; - let alphaRatio = (dist - innerRadius) / (radius - innerRadius); - let alphaAmount = 0.2; - const maxAlpha = 0.2; - const minAlpha = 0.04; - const lowerRadius = 50; - const upperRadius = 150; - if (radius < lowerRadius) { - alphaAmount = maxAlpha; - } else if (radius > upperRadius) { - alphaAmount = minAlpha; - } else { - alphaAmount = (minAlpha - maxAlpha) * (radius - lowerRadius) / (upperRadius - lowerRadius) + maxAlpha; - } - alphaRatio = (dist - innerRadius) / (radius - innerRadius); - if (alphaRatio < alphaAmount) { - data[index + 3] = 255 * (alphaRatio / alphaAmount); - } else if (alphaRatio > 1 - alphaAmount) { - data[index + 3] = 255 * (1 - (alphaRatio - (1 - alphaAmount)) / alphaAmount); - } else { - data[index + 3] = 255; - } - } + }, + PhysicsShapeConvexHull: () => { + { + return PhysicsShapeConvexHull; } - context.putImageData(image2, 0, 0); - return canvas; - } - _draw(context) { - context.save(); - this._applyStates(context); - const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5; - const wheelThickness = radius * 0.2; - const left = this._currentMeasure.left; - const top = this._currentMeasure.top; - if (!this._colorWheelCanvas || this._colorWheelCanvas.width != radius * 2) { - this._colorWheelCanvas = this._createColorWheelCanvas(radius, wheelThickness); + }, + PhysicsShapeContainer: () => { + { + return PhysicsShapeContainer; } - this._updateSquareProps(); - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowColor = this.shadowColor; - context.shadowBlur = this.shadowBlur; - context.shadowOffsetX = this.shadowOffsetX; - context.shadowOffsetY = this.shadowOffsetY; - context.fillRect(this._squareLeft, this._squareTop, this._squareSize, this._squareSize); + }, + PhysicsShapeCapsule: () => { + { + return PhysicsShapeCapsule; } - context.drawImage(this._colorWheelCanvas, left, top); - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowBlur = 0; - context.shadowOffsetX = 0; - context.shadowOffsetY = 0; + }, + PhysicsShapeBox: () => { + { + return PhysicsShapeBox; } - this._drawGradientSquare(this._h, this._squareLeft, this._squareTop, this._squareSize, this._squareSize, context); - let cx = this._squareLeft + this._squareSize * this._s; - let cy = this._squareTop + this._squareSize * (1 - this._v); - this._drawCircle(cx, cy, radius * 0.04, context); - const dist = radius - wheelThickness * 0.5; - cx = left + radius + Math.cos((this._h - 180) * Math.PI / 180) * dist; - cy = top + radius + Math.sin((this._h - 180) * Math.PI / 180) * dist; - this._drawCircle(cx, cy, wheelThickness * 0.35, context); - context.restore(); - } - _updateValueFromPointer(x, y) { - if (this._pointerStartedOnWheel) { - const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5; - const centerX = radius + this._currentMeasure.left; - const centerY = radius + this._currentMeasure.top; - this._h = Math.atan2(y - centerY, x - centerX) * 180 / Math.PI + 180; - } else if (this._pointerStartedOnSquare) { - this._updateSquareProps(); - this._s = (x - this._squareLeft) / this._squareSize; - this._v = 1 - (y - this._squareTop) / this._squareSize; - this._s = Math.min(this._s, 1); - this._s = Math.max(this._s, ColorPicker._Epsilon); - this._v = Math.min(this._v, 1); - this._v = Math.max(this._v, ColorPicker._Epsilon); + }, + PhysicsShape: () => { + { + return PhysicsShape; } - Color3.HSVtoRGBToRef(this._h, this._s, this._v, this._tmpColor); - this.value = this._tmpColor; - } - _isPointOnSquare(x, y) { - this._updateSquareProps(); - const left = this._squareLeft; - const top = this._squareTop; - const size = this._squareSize; - if (x >= left && x <= left + size && y >= top && y <= top + size) { - return true; + }, + PhysicsRaycastResult: () => { + { + return PhysicsRaycastResult; } - return false; - } - _isPointOnWheel(x, y) { - const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5; - const centerX = radius + this._currentMeasure.left; - const centerY = radius + this._currentMeasure.top; - const wheelThickness = radius * 0.2; - const innerRadius = radius - wheelThickness; - const radiusSq = radius * radius; - const innerRadiusSq = innerRadius * innerRadius; - const dx = x - centerX; - const dy = y - centerY; - const distSq = dx * dx + dy * dy; - if (distSq <= radiusSq && distSq >= innerRadiusSq) { - return true; + }, + PhysicsRadialImpulseFalloff: () => { + { + return PhysicsRadialImpulseFalloff; } - return false; - } - _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { - if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { - return false; + }, + PhysicsRadialExplosionEventOptions: () => { + { + return PhysicsRadialExplosionEventOptions; } - if (this.isReadOnly) { - return true; + }, + PhysicsMotionType: () => { + { + return PhysicsMotionType; } - this._pointerIsDown = true; - this._pointerStartedOnSquare = false; - this._pointerStartedOnWheel = false; - this._invertTransformMatrix.transformCoordinates(coordinates.x, coordinates.y, this._transformedPosition); - const x = this._transformedPosition.x; - const y = this._transformedPosition.y; - if (this._isPointOnSquare(x, y)) { - this._pointerStartedOnSquare = true; - } else if (this._isPointOnWheel(x, y)) { - this._pointerStartedOnWheel = true; + }, + PhysicsMaterialCombineMode: () => { + { + return PhysicsMaterialCombineMode; } - this._updateValueFromPointer(x, y); - this._host._capturingControl[pointerId] = this; - this._lastPointerDownId = pointerId; - return true; - } - _onPointerMove(target, coordinates, pointerId, pi) { - if (pointerId != this._lastPointerDownId) { - return; + }, + PhysicsJoint: () => { + { + return PhysicsJoint; } - if (!this.isReadOnly) { - this._invertTransformMatrix.transformCoordinates(coordinates.x, coordinates.y, this._transformedPosition); - const x = this._transformedPosition.x; - const y = this._transformedPosition.y; - if (this._pointerIsDown) { - this._updateValueFromPointer(x, y); - } + }, + PhysicsImpostor: () => { + { + return PhysicsImpostor; } - super._onPointerMove(target, coordinates, pointerId, pi); - } - _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi) { - this._pointerIsDown = false; - delete this._host._capturingControl[pointerId]; - super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi); - } - _onCanvasBlur() { - this._forcePointerUp(); - super._onCanvasBlur(); - } - static ShowPickerDialogAsync(advancedTexture, options) { - return new Promise((resolve) => { - options.pickerWidth = options.pickerWidth || "640px"; - options.pickerHeight = options.pickerHeight || "400px"; - options.headerHeight = options.headerHeight || "35px"; - options.lastColor = options.lastColor || "#000000"; - options.swatchLimit = options.swatchLimit || 20; - options.numSwatchesPerLine = options.numSwatchesPerLine || 10; - const drawerMaxRows = options.swatchLimit / options.numSwatchesPerLine; - const rawSwatchSize = parseFloat(options.pickerWidth) / options.numSwatchesPerLine; - const gutterSize = Math.floor(rawSwatchSize * 0.25); - const colGutters = gutterSize * (options.numSwatchesPerLine + 1); - const swatchSize = Math.floor((parseFloat(options.pickerWidth) - colGutters) / options.numSwatchesPerLine); - const drawerMaxSize = swatchSize * drawerMaxRows + gutterSize * (drawerMaxRows + 1); - const containerSize = (parseInt(options.pickerHeight) + drawerMaxSize + Math.floor(swatchSize * 0.25)).toString() + "px"; - const buttonColor = "#c0c0c0"; - const buttonBackgroundColor = "#535353"; - const buttonBackgroundHoverColor = "#414141"; - const buttonBackgroundClickColor = "515151"; - const buttonDisabledColor = "#555555"; - const buttonDisabledBackgroundColor = "#454545"; - const currentSwatchesOutlineColor = "#404040"; - const luminanceLimitColor = Color3.FromHexString("#dddddd"); - const luminanceLimit = luminanceLimitColor.r + luminanceLimitColor.g + luminanceLimitColor.b; - const iconColorDark = "#aaaaaa"; - const iconColorLight = "#ffffff"; - let buttonFontSize; - let butEdit; - const inputFieldLabels = ["R", "G", "B"]; - const inputTextBackgroundColor = "#454545"; - const inputTextColor = "#f0f0f0"; - let swatchNumber; - let swatchDrawer; - let editSwatchMode = false; - let butSave; - let lastVal; - let activeField; - const dialogContainer = new Grid; - dialogContainer.name = "Dialog Container"; - dialogContainer.width = options.pickerWidth; - if (options.savedColors) { - dialogContainer.height = containerSize; - const topRow = parseInt(options.pickerHeight) / parseInt(containerSize); - dialogContainer.addRowDefinition(topRow, false); - dialogContainer.addRowDefinition(1 - topRow, false); - } else { - dialogContainer.height = options.pickerHeight; - dialogContainer.addRowDefinition(1, false); - } - advancedTexture.addControl(dialogContainer); - if (options.savedColors) { - swatchDrawer = new Grid; - swatchDrawer.name = "Swatch Drawer"; - swatchDrawer.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP; - swatchDrawer.background = buttonBackgroundColor; - swatchDrawer.width = options.pickerWidth; - const initialRows = options.savedColors.length / options.numSwatchesPerLine; - let gutterCount; - if (initialRows == 0) { - gutterCount = 0; - } else { - gutterCount = initialRows + 1; - } - swatchDrawer.height = (swatchSize * initialRows + gutterCount * gutterSize).toString() + "px"; - swatchDrawer.top = Math.floor(swatchSize * 0.25).toString() + "px"; - for (let i = 0;i < Math.ceil(options.savedColors.length / options.numSwatchesPerLine) * 2 + 1; i++) { - if (i % 2 != 0) { - swatchDrawer.addRowDefinition(swatchSize, true); - } else { - swatchDrawer.addRowDefinition(gutterSize, true); - } - } - for (let i = 0;i < options.numSwatchesPerLine * 2 + 1; i++) { - if (i % 2 != 0) { - swatchDrawer.addColumnDefinition(swatchSize, true); - } else { - swatchDrawer.addColumnDefinition(gutterSize, true); - } - } - dialogContainer.addControl(swatchDrawer, 1, 0); - } - const pickerPanel = new Grid; - pickerPanel.name = "Picker Panel"; - pickerPanel.height = options.pickerHeight; - const panelHead = parseInt(options.headerHeight) / parseInt(options.pickerHeight); - const pickerPanelRows = [panelHead, 1 - panelHead]; - pickerPanel.addRowDefinition(pickerPanelRows[0], false); - pickerPanel.addRowDefinition(pickerPanelRows[1], false); - dialogContainer.addControl(pickerPanel, 0, 0); - const header = new Rectangle; - header.name = "Dialogue Header Bar"; - header.background = "#cccccc"; - header.thickness = 0; - pickerPanel.addControl(header, 0, 0); - const closeButton = Button.CreateSimpleButton("closeButton", "a"); - closeButton.fontFamily = "coreglyphs"; - const headerColor3 = Color3.FromHexString(header.background); - const closeIconColor = new Color3(1 - headerColor3.r, 1 - headerColor3.g, 1 - headerColor3.b); - closeButton.color = closeIconColor.toHexString(); - closeButton.fontSize = Math.floor(parseInt(options.headerHeight) * 0.6); - closeButton.textBlock.textVerticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER; - closeButton.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_RIGHT; - closeButton.height = closeButton.width = options.headerHeight; - closeButton.background = header.background; - closeButton.thickness = 0; - closeButton.pointerDownAnimation = () => { - }; - closeButton.pointerUpAnimation = () => { - closeButton.background = header.background; - }; - closeButton.pointerEnterAnimation = () => { - closeButton.color = header.background; - closeButton.background = "red"; - }; - closeButton.pointerOutAnimation = () => { - closeButton.color = closeIconColor.toHexString(); - closeButton.background = header.background; - }; - closeButton.onPointerClickObservable.add(() => { - closePicker(currentSwatch.background); - }); - pickerPanel.addControl(closeButton, 0, 0); - const dialogBody = new Grid; - dialogBody.name = "Dialogue Body"; - dialogBody.background = buttonBackgroundColor; - const dialogBodyCols = [0.4375, 0.5625]; - dialogBody.addRowDefinition(1, false); - dialogBody.addColumnDefinition(dialogBodyCols[0], false); - dialogBody.addColumnDefinition(dialogBodyCols[1], false); - pickerPanel.addControl(dialogBody, 1, 0); - const pickerGrid = new Grid; - pickerGrid.name = "Picker Grid"; - pickerGrid.addRowDefinition(0.85, false); - pickerGrid.addRowDefinition(0.15, false); - dialogBody.addControl(pickerGrid, 0, 0); - const picker = new ColorPicker; - picker.name = "GUI Color Picker"; - if (options.pickerHeight < options.pickerWidth) { - picker.width = 0.89; - } else { - picker.height = 0.89; - } - picker.value = Color3.FromHexString(options.lastColor); - picker.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER; - picker.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER; - picker.onPointerDownObservable.add(() => { - activeField = picker.name; - lastVal = ""; - editSwatches(false); - }); - picker.onValueChangedObservable.add(function(value) { - if (activeField == picker.name) { - updateValues(value, picker.name); - } - }); - pickerGrid.addControl(picker, 0, 0); - const pickerBodyRight = new Grid; - pickerBodyRight.name = "Dialogue Right Half"; - pickerBodyRight.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - const pickerBodyRightRows = [0.514, 0.486]; - pickerBodyRight.addRowDefinition(pickerBodyRightRows[0], false); - pickerBodyRight.addRowDefinition(pickerBodyRightRows[1], false); - dialogBody.addControl(pickerBodyRight, 1, 1); - const pickerSwatchesButtons = new Grid; - pickerSwatchesButtons.name = "Swatches and Buttons"; - const pickerButtonsCol = [0.417, 0.583]; - pickerSwatchesButtons.addRowDefinition(1, false); - pickerSwatchesButtons.addColumnDefinition(pickerButtonsCol[0], false); - pickerSwatchesButtons.addColumnDefinition(pickerButtonsCol[1], false); - pickerBodyRight.addControl(pickerSwatchesButtons, 0, 0); - const pickerSwatches = new Grid; - pickerSwatches.name = "New and Current Swatches"; - const pickeSwatchesRows = [0.04, 0.16, 0.64, 0.16]; - pickerSwatches.addRowDefinition(pickeSwatchesRows[0], false); - pickerSwatches.addRowDefinition(pickeSwatchesRows[1], false); - pickerSwatches.addRowDefinition(pickeSwatchesRows[2], false); - pickerSwatches.addRowDefinition(pickeSwatchesRows[3], false); - pickerSwatchesButtons.addControl(pickerSwatches, 0, 0); - const activeSwatches = new Grid; - activeSwatches.name = "Active Swatches"; - activeSwatches.width = 0.67; - activeSwatches.addRowDefinition(0.5, false); - activeSwatches.addRowDefinition(0.5, false); - pickerSwatches.addControl(activeSwatches, 2, 0); - const labelWidth = Math.floor(parseInt(options.pickerWidth) * dialogBodyCols[1] * pickerButtonsCol[0] * 0.11); - const labelHeight = Math.floor(parseInt(options.pickerHeight) * pickerPanelRows[1] * pickerBodyRightRows[0] * pickeSwatchesRows[1] * 0.5); - let labelTextSize; - if (options.pickerWidth > options.pickerHeight) { - labelTextSize = labelHeight; - } else { - labelTextSize = labelWidth; - } - const newText = new TextBlock; - newText.text = "new"; - newText.name = "New Color Label"; - newText.color = buttonColor; - newText.fontSize = labelTextSize; - pickerSwatches.addControl(newText, 1, 0); - const newSwatch = new Rectangle; - newSwatch.name = "New Color Swatch"; - newSwatch.background = options.lastColor; - newSwatch.thickness = 0; - activeSwatches.addControl(newSwatch, 0, 0); - const currentSwatch = Button.CreateSimpleButton("currentSwatch", ""); - currentSwatch.background = options.lastColor; - currentSwatch.thickness = 0; - currentSwatch.onPointerClickObservable.add(() => { - const revertColor = Color3.FromHexString(currentSwatch.background); - updateValues(revertColor, currentSwatch.name); - editSwatches(false); - }); - currentSwatch.pointerDownAnimation = () => { - }; - currentSwatch.pointerUpAnimation = () => { - }; - currentSwatch.pointerEnterAnimation = () => { - }; - currentSwatch.pointerOutAnimation = () => { - }; - activeSwatches.addControl(currentSwatch, 1, 0); - const swatchOutline = new Rectangle; - swatchOutline.name = "Swatch Outline"; - swatchOutline.width = 0.67; - swatchOutline.thickness = 2; - swatchOutline.color = currentSwatchesOutlineColor; - swatchOutline.isHitTestVisible = false; - pickerSwatches.addControl(swatchOutline, 2, 0); - const currentText = new TextBlock; - currentText.name = "Current Color Label"; - currentText.text = "current"; - currentText.color = buttonColor; - currentText.fontSize = labelTextSize; - pickerSwatches.addControl(currentText, 3, 0); - const buttonGrid = new Grid; - buttonGrid.name = "Button Grid"; - buttonGrid.height = 0.8; - const buttonGridRows = 1 / 3; - buttonGrid.addRowDefinition(buttonGridRows, false); - buttonGrid.addRowDefinition(buttonGridRows, false); - buttonGrid.addRowDefinition(buttonGridRows, false); - pickerSwatchesButtons.addControl(buttonGrid, 0, 1); - const buttonWidth = Math.floor(parseInt(options.pickerWidth) * dialogBodyCols[1] * pickerButtonsCol[1] * 0.67).toString() + "px"; - const buttonHeight = Math.floor(parseInt(options.pickerHeight) * pickerPanelRows[1] * pickerBodyRightRows[0] * (parseFloat(buttonGrid.height.toString()) / 100) * buttonGridRows * 0.7).toString() + "px"; - if (parseFloat(buttonWidth) > parseFloat(buttonHeight)) { - buttonFontSize = Math.floor(parseFloat(buttonHeight) * 0.45); - } else { - buttonFontSize = Math.floor(parseFloat(buttonWidth) * 0.11); - } - const butOK = Button.CreateSimpleButton("butOK", "OK"); - butOK.width = buttonWidth; - butOK.height = buttonHeight; - butOK.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER; - butOK.thickness = 2; - butOK.color = buttonColor; - butOK.fontSize = buttonFontSize; - butOK.background = buttonBackgroundColor; - butOK.onPointerEnterObservable.add(() => { - butOK.background = buttonBackgroundHoverColor; - }); - butOK.onPointerOutObservable.add(() => { - butOK.background = buttonBackgroundColor; - }); - butOK.pointerDownAnimation = () => { - butOK.background = buttonBackgroundClickColor; - }; - butOK.pointerUpAnimation = () => { - butOK.background = buttonBackgroundHoverColor; - }; - butOK.onPointerClickObservable.add(() => { - editSwatches(false); - closePicker(newSwatch.background); - }); - buttonGrid.addControl(butOK, 0, 0); - const butCancel = Button.CreateSimpleButton("butCancel", "Cancel"); - butCancel.width = buttonWidth; - butCancel.height = buttonHeight; - butCancel.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER; - butCancel.thickness = 2; - butCancel.color = buttonColor; - butCancel.fontSize = buttonFontSize; - butCancel.background = buttonBackgroundColor; - butCancel.onPointerEnterObservable.add(() => { - butCancel.background = buttonBackgroundHoverColor; - }); - butCancel.onPointerOutObservable.add(() => { - butCancel.background = buttonBackgroundColor; - }); - butCancel.pointerDownAnimation = () => { - butCancel.background = buttonBackgroundClickColor; - }; - butCancel.pointerUpAnimation = () => { - butCancel.background = buttonBackgroundHoverColor; - }; - butCancel.onPointerClickObservable.add(() => { - editSwatches(false); - closePicker(currentSwatch.background); - }); - buttonGrid.addControl(butCancel, 1, 0); - if (options.savedColors) { - butSave = Button.CreateSimpleButton("butSave", "Save"); - butSave.width = buttonWidth; - butSave.height = buttonHeight; - butSave.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER; - butSave.thickness = 2; - butSave.fontSize = buttonFontSize; - if (options.savedColors.length < options.swatchLimit) { - butSave.color = buttonColor; - butSave.background = buttonBackgroundColor; - } else { - disableButton(butSave, true); - } - butSave.onPointerEnterObservable.add(() => { - if (options.savedColors) { - if (options.savedColors.length < options.swatchLimit) { - butSave.background = buttonBackgroundHoverColor; - } - } - }); - butSave.onPointerOutObservable.add(() => { - if (options.savedColors) { - if (options.savedColors.length < options.swatchLimit) { - butSave.background = buttonBackgroundColor; - } - } - }); - butSave.pointerDownAnimation = () => { - if (options.savedColors) { - if (options.savedColors.length < options.swatchLimit) { - butSave.background = buttonBackgroundClickColor; - } - } - }; - butSave.pointerUpAnimation = () => { - if (options.savedColors) { - if (options.savedColors.length < options.swatchLimit) { - butSave.background = buttonBackgroundHoverColor; - } - } - }; - butSave.onPointerClickObservable.add(() => { - if (options.savedColors) { - if (options.savedColors.length == 0) { - setEditButtonVisibility(true); - } - if (options.savedColors.length < options.swatchLimit) { - updateSwatches(newSwatch.background, butSave); - } - editSwatches(false); - } - }); - if (options.savedColors.length > 0) { - setEditButtonVisibility(true); - } - buttonGrid.addControl(butSave, 2, 0); - } - const pickerColorValues = new Grid; - pickerColorValues.name = "Dialog Lower Right"; - pickerColorValues.addRowDefinition(0.02, false); - pickerColorValues.addRowDefinition(0.63, false); - pickerColorValues.addRowDefinition(0.21, false); - pickerColorValues.addRowDefinition(0.14, false); - pickerBodyRight.addControl(pickerColorValues, 1, 0); - const currentColor = Color3.FromHexString(options.lastColor); - const rgbValuesQuadrant = new Grid; - rgbValuesQuadrant.name = "RGB Values"; - rgbValuesQuadrant.width = 0.82; - rgbValuesQuadrant.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER; - rgbValuesQuadrant.addRowDefinition(1 / 3, false); - rgbValuesQuadrant.addRowDefinition(1 / 3, false); - rgbValuesQuadrant.addRowDefinition(1 / 3, false); - rgbValuesQuadrant.addColumnDefinition(0.1, false); - rgbValuesQuadrant.addColumnDefinition(0.2, false); - rgbValuesQuadrant.addColumnDefinition(0.7, false); - pickerColorValues.addControl(rgbValuesQuadrant, 1, 0); - for (let i = 0;i < inputFieldLabels.length; i++) { - const labelText2 = new TextBlock; - labelText2.text = inputFieldLabels[i]; - labelText2.color = buttonColor; - labelText2.fontSize = buttonFontSize; - rgbValuesQuadrant.addControl(labelText2, i, 0); - } - const rValInt = new InputText; - rValInt.width = 0.83; - rValInt.height = 0.72; - rValInt.name = "rIntField"; - rValInt.fontSize = buttonFontSize; - rValInt.text = (currentColor.r * 255).toString(); - rValInt.color = inputTextColor; - rValInt.background = inputTextBackgroundColor; - rValInt.onFocusObservable.add(() => { - activeField = rValInt.name; - lastVal = rValInt.text; - editSwatches(false); - }); - rValInt.onBlurObservable.add(() => { - if (rValInt.text == "") { - rValInt.text = "0"; - } - updateInt(rValInt, "r"); - if (activeField == rValInt.name) { - activeField = ""; - } - }); - rValInt.onTextChangedObservable.add(() => { - if (activeField == rValInt.name) { - updateInt(rValInt, "r"); - } - }); - rgbValuesQuadrant.addControl(rValInt, 0, 1); - const gValInt = new InputText; - gValInt.width = 0.83; - gValInt.height = 0.72; - gValInt.name = "gIntField"; - gValInt.fontSize = buttonFontSize; - gValInt.text = (currentColor.g * 255).toString(); - gValInt.color = inputTextColor; - gValInt.background = inputTextBackgroundColor; - gValInt.onFocusObservable.add(() => { - activeField = gValInt.name; - lastVal = gValInt.text; - editSwatches(false); - }); - gValInt.onBlurObservable.add(() => { - if (gValInt.text == "") { - gValInt.text = "0"; - } - updateInt(gValInt, "g"); - if (activeField == gValInt.name) { - activeField = ""; - } - }); - gValInt.onTextChangedObservable.add(() => { - if (activeField == gValInt.name) { - updateInt(gValInt, "g"); - } - }); - rgbValuesQuadrant.addControl(gValInt, 1, 1); - const bValInt = new InputText; - bValInt.width = 0.83; - bValInt.height = 0.72; - bValInt.name = "bIntField"; - bValInt.fontSize = buttonFontSize; - bValInt.text = (currentColor.b * 255).toString(); - bValInt.color = inputTextColor; - bValInt.background = inputTextBackgroundColor; - bValInt.onFocusObservable.add(() => { - activeField = bValInt.name; - lastVal = bValInt.text; - editSwatches(false); - }); - bValInt.onBlurObservable.add(() => { - if (bValInt.text == "") { - bValInt.text = "0"; - } - updateInt(bValInt, "b"); - if (activeField == bValInt.name) { - activeField = ""; - } - }); - bValInt.onTextChangedObservable.add(() => { - if (activeField == bValInt.name) { - updateInt(bValInt, "b"); - } - }); - rgbValuesQuadrant.addControl(bValInt, 2, 1); - const rValDec = new InputText; - rValDec.width = 0.95; - rValDec.height = 0.72; - rValDec.name = "rDecField"; - rValDec.fontSize = buttonFontSize; - rValDec.text = currentColor.r.toString(); - rValDec.color = inputTextColor; - rValDec.background = inputTextBackgroundColor; - rValDec.onFocusObservable.add(() => { - activeField = rValDec.name; - lastVal = rValDec.text; - editSwatches(false); - }); - rValDec.onBlurObservable.add(() => { - if (parseFloat(rValDec.text) == 0 || rValDec.text == "") { - rValDec.text = "0"; - updateFloat(rValDec, "r"); - } - if (activeField == rValDec.name) { - activeField = ""; - } - }); - rValDec.onTextChangedObservable.add(() => { - if (activeField == rValDec.name) { - updateFloat(rValDec, "r"); - } - }); - rgbValuesQuadrant.addControl(rValDec, 0, 2); - const gValDec = new InputText; - gValDec.width = 0.95; - gValDec.height = 0.72; - gValDec.name = "gDecField"; - gValDec.fontSize = buttonFontSize; - gValDec.text = currentColor.g.toString(); - gValDec.color = inputTextColor; - gValDec.background = inputTextBackgroundColor; - gValDec.onFocusObservable.add(() => { - activeField = gValDec.name; - lastVal = gValDec.text; - editSwatches(false); - }); - gValDec.onBlurObservable.add(() => { - if (parseFloat(gValDec.text) == 0 || gValDec.text == "") { - gValDec.text = "0"; - updateFloat(gValDec, "g"); - } - if (activeField == gValDec.name) { - activeField = ""; - } - }); - gValDec.onTextChangedObservable.add(() => { - if (activeField == gValDec.name) { - updateFloat(gValDec, "g"); - } - }); - rgbValuesQuadrant.addControl(gValDec, 1, 2); - const bValDec = new InputText; - bValDec.width = 0.95; - bValDec.height = 0.72; - bValDec.name = "bDecField"; - bValDec.fontSize = buttonFontSize; - bValDec.text = currentColor.b.toString(); - bValDec.color = inputTextColor; - bValDec.background = inputTextBackgroundColor; - bValDec.onFocusObservable.add(() => { - activeField = bValDec.name; - lastVal = bValDec.text; - editSwatches(false); - }); - bValDec.onBlurObservable.add(() => { - if (parseFloat(bValDec.text) == 0 || bValDec.text == "") { - bValDec.text = "0"; - updateFloat(bValDec, "b"); - } - if (activeField == bValDec.name) { - activeField = ""; - } - }); - bValDec.onTextChangedObservable.add(() => { - if (activeField == bValDec.name) { - updateFloat(bValDec, "b"); - } - }); - rgbValuesQuadrant.addControl(bValDec, 2, 2); - const hexValueQuadrant = new Grid; - hexValueQuadrant.name = "Hex Value"; - hexValueQuadrant.width = 0.82; - hexValueQuadrant.addRowDefinition(1, false); - hexValueQuadrant.addColumnDefinition(0.1, false); - hexValueQuadrant.addColumnDefinition(0.9, false); - pickerColorValues.addControl(hexValueQuadrant, 2, 0); - const labelText = new TextBlock; - labelText.text = "#"; - labelText.color = buttonColor; - labelText.fontSize = buttonFontSize; - hexValueQuadrant.addControl(labelText, 0, 0); - const hexVal = new InputText; - hexVal.width = 0.96; - hexVal.height = 0.72; - hexVal.name = "hexField"; - hexVal.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER; - hexVal.fontSize = buttonFontSize; - const minusPound = options.lastColor.split("#"); - hexVal.text = minusPound[1]; - hexVal.color = inputTextColor; - hexVal.background = inputTextBackgroundColor; - hexVal.onFocusObservable.add(() => { - activeField = hexVal.name; - lastVal = hexVal.text; - editSwatches(false); - }); - hexVal.onBlurObservable.add(() => { - if (hexVal.text.length == 3) { - const val = hexVal.text.split(""); - hexVal.text = val[0] + val[0] + val[1] + val[1] + val[2] + val[2]; - } - if (hexVal.text == "") { - hexVal.text = "000000"; - updateValues(Color3.FromHexString(hexVal.text), "b"); - } - if (activeField == hexVal.name) { - activeField = ""; - } - }); - hexVal.onTextChangedObservable.add(() => { - let newHexValue = hexVal.text; - const checkHex = /[^0-9A-F]/i.test(newHexValue); - if ((hexVal.text.length > 6 || checkHex) && activeField == hexVal.name) { - hexVal.text = lastVal; - } else { - if (hexVal.text.length < 6) { - const leadingZero = 6 - hexVal.text.length; - for (let i = 0;i < leadingZero; i++) { - newHexValue = "0" + newHexValue; - } - } - if (hexVal.text.length == 3) { - const val = hexVal.text.split(""); - newHexValue = val[0] + val[0] + val[1] + val[1] + val[2] + val[2]; - } - newHexValue = "#" + newHexValue; - if (activeField == hexVal.name) { - lastVal = hexVal.text; - updateValues(Color3.FromHexString(newHexValue), hexVal.name); - } - } - }); - hexValueQuadrant.addControl(hexVal, 0, 1); - if (options.savedColors && options.savedColors.length > 0) { - updateSwatches("", butSave); - } - function updateValues(value, inputField) { - activeField = inputField; - const pickedColor = value.toHexString(); - newSwatch.background = pickedColor; - if (rValInt.name != activeField) { - rValInt.text = Math.floor(value.r * 255).toString(); - } - if (gValInt.name != activeField) { - gValInt.text = Math.floor(value.g * 255).toString(); - } - if (bValInt.name != activeField) { - bValInt.text = Math.floor(value.b * 255).toString(); - } - if (rValDec.name != activeField) { - rValDec.text = value.r.toString(); - } - if (gValDec.name != activeField) { - gValDec.text = value.g.toString(); - } - if (bValDec.name != activeField) { - bValDec.text = value.b.toString(); - } - if (hexVal.name != activeField) { - const minusPound2 = pickedColor.split("#"); - hexVal.text = minusPound2[1]; - } - if (picker.name != activeField) { - picker.value = value; - } - } - function updateInt(field, channel) { - let newValue = field.text; - const checkVal = /[^0-9]/g.test(newValue); - if (checkVal) { - field.text = lastVal; - return; - } else { - if (newValue != "") { - if (Math.floor(parseInt(newValue)) < 0) { - newValue = "0"; - } else if (Math.floor(parseInt(newValue)) > 255) { - newValue = "255"; - } else if (isNaN(parseInt(newValue))) { - newValue = "0"; - } - } - if (activeField == field.name) { - lastVal = newValue; - } - } - if (newValue != "") { - newValue = parseInt(newValue).toString(); - field.text = newValue; - const newSwatchRGB = Color3.FromHexString(newSwatch.background); - if (activeField == field.name) { - if (channel == "r") { - updateValues(new Color3(parseInt(newValue) / 255, newSwatchRGB.g, newSwatchRGB.b), field.name); - } else if (channel == "g") { - updateValues(new Color3(newSwatchRGB.r, parseInt(newValue) / 255, newSwatchRGB.b), field.name); - } else { - updateValues(new Color3(newSwatchRGB.r, newSwatchRGB.g, parseInt(newValue) / 255), field.name); - } - } - } - } - function updateFloat(field, channel) { - let newValue = field.text; - const checkVal = /[^0-9.]/g.test(newValue); - if (checkVal) { - field.text = lastVal; - return; - } else { - if (newValue != "" && newValue != "." && parseFloat(newValue) != 0) { - if (parseFloat(newValue) < 0) { - newValue = "0.0"; - } else if (parseFloat(newValue) > 1) { - newValue = "1.0"; - } else if (isNaN(parseFloat(newValue))) { - newValue = "0.0"; - } - } - if (activeField == field.name) { - lastVal = newValue; - } - } - if (newValue != "" && newValue != "." && parseFloat(newValue) != 0) { - newValue = parseFloat(newValue).toString(); - field.text = newValue; - } else { - newValue = "0.0"; - } - const newSwatchRGB = Color3.FromHexString(newSwatch.background); - if (activeField == field.name) { - if (channel == "r") { - updateValues(new Color3(parseFloat(newValue), newSwatchRGB.g, newSwatchRGB.b), field.name); - } else if (channel == "g") { - updateValues(new Color3(newSwatchRGB.r, parseFloat(newValue), newSwatchRGB.b), field.name); - } else { - updateValues(new Color3(newSwatchRGB.r, newSwatchRGB.g, parseFloat(newValue)), field.name); - } - } - } - function deleteSwatch(index) { - if (options.savedColors) { - options.savedColors.splice(index, 1); - } - if (options.savedColors && options.savedColors.length == 0) { - setEditButtonVisibility(false); - editSwatchMode = false; - } - } - function createSwatch() { - if (options.savedColors && options.savedColors[swatchNumber]) { - let icon; - if (editSwatchMode) { - icon = "b"; - } else { - icon = ""; - } - const swatch = Button.CreateSimpleButton("Swatch_" + swatchNumber, icon); - swatch.fontFamily = "coreglyphs"; - const swatchColor = Color3.FromHexString(options.savedColors[swatchNumber]); - const swatchLuminence = swatchColor.r + swatchColor.g + swatchColor.b; - if (swatchLuminence > luminanceLimit) { - swatch.color = iconColorDark; - } else { - swatch.color = iconColorLight; - } - swatch.fontSize = Math.floor(swatchSize * 0.7); - swatch.textBlock.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER; - swatch.height = swatch.width = swatchSize.toString() + "px"; - swatch.background = options.savedColors[swatchNumber]; - swatch.thickness = 2; - const metadata = swatchNumber; - swatch.pointerDownAnimation = () => { - swatch.thickness = 4; - }; - swatch.pointerUpAnimation = () => { - swatch.thickness = 3; - }; - swatch.pointerEnterAnimation = () => { - swatch.thickness = 3; - }; - swatch.pointerOutAnimation = () => { - swatch.thickness = 2; - }; - swatch.onPointerClickObservable.add(() => { - if (!editSwatchMode) { - if (options.savedColors) { - updateValues(Color3.FromHexString(options.savedColors[metadata]), swatch.name); - } - } else { - deleteSwatch(metadata); - updateSwatches("", butSave); - } - }); - return swatch; - } else { - return null; - } - } - function editSwatches(mode) { - if (mode !== undefined) { - editSwatchMode = mode; - } - let thisButton; - if (editSwatchMode) { - for (let i = 0;i < swatchDrawer.children.length; i++) { - thisButton = swatchDrawer.children[i]; - thisButton.textBlock.text = "b"; - } - if (butEdit !== undefined) { - butEdit.textBlock.text = "Done"; - } - } else { - for (let i = 0;i < swatchDrawer.children.length; i++) { - thisButton = swatchDrawer.children[i]; - thisButton.textBlock.text = ""; - } - if (butEdit !== undefined) { - butEdit.textBlock.text = "Edit"; - } - } - } - function updateSwatches(color, button2) { - if (options.savedColors) { - if (color != "") { - options.savedColors.push(color); - } - swatchNumber = 0; - swatchDrawer.clearControls(); - const rowCount = Math.ceil(options.savedColors.length / options.numSwatchesPerLine); - let gutterCount; - if (rowCount == 0) { - gutterCount = 0; - } else { - gutterCount = rowCount + 1; - } - if (swatchDrawer.rowCount != rowCount + gutterCount) { - const currentRows = swatchDrawer.rowCount; - for (let i = 0;i < currentRows; i++) { - swatchDrawer.removeRowDefinition(0); - } - for (let i = 0;i < rowCount + gutterCount; i++) { - if (i % 2) { - swatchDrawer.addRowDefinition(swatchSize, true); - } else { - swatchDrawer.addRowDefinition(gutterSize, true); - } - } - } - swatchDrawer.height = (swatchSize * rowCount + gutterCount * gutterSize).toString() + "px"; - for (let y = 1, thisRow = 1;y < rowCount + gutterCount; y += 2, thisRow++) { - let totalButtonsThisRow; - if (options.savedColors.length > thisRow * options.numSwatchesPerLine) { - totalButtonsThisRow = options.numSwatchesPerLine; - } else { - totalButtonsThisRow = options.savedColors.length - (thisRow - 1) * options.numSwatchesPerLine; - } - const buttonIterations = Math.min(Math.max(totalButtonsThisRow, 0), options.numSwatchesPerLine); - for (let x = 0, w = 1;x < buttonIterations; x++) { - if (x > options.numSwatchesPerLine) { - continue; - } - const swatch = createSwatch(); - if (swatch != null) { - swatchDrawer.addControl(swatch, y, w); - w += 2; - swatchNumber++; - } else { - continue; - } - } - } - if (options.savedColors.length >= options.swatchLimit) { - disableButton(button2, true); - } else { - disableButton(button2, false); - } - } - } - function setEditButtonVisibility(enableButton) { - if (enableButton) { - butEdit = Button.CreateSimpleButton("butEdit", "Edit"); - butEdit.width = buttonWidth; - butEdit.height = buttonHeight; - butEdit.left = Math.floor(parseInt(buttonWidth) * 0.1).toString() + "px"; - butEdit.top = (parseFloat(butEdit.left) * -1).toString() + "px"; - butEdit.verticalAlignment = Control.VERTICAL_ALIGNMENT_BOTTOM; - butEdit.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - butEdit.thickness = 2; - butEdit.color = buttonColor; - butEdit.fontSize = buttonFontSize; - butEdit.background = buttonBackgroundColor; - butEdit.onPointerEnterObservable.add(() => { - butEdit.background = buttonBackgroundHoverColor; - }); - butEdit.onPointerOutObservable.add(() => { - butEdit.background = buttonBackgroundColor; - }); - butEdit.pointerDownAnimation = () => { - butEdit.background = buttonBackgroundClickColor; - }; - butEdit.pointerUpAnimation = () => { - butEdit.background = buttonBackgroundHoverColor; - }; - butEdit.onPointerClickObservable.add(() => { - if (editSwatchMode) { - editSwatchMode = false; - } else { - editSwatchMode = true; - } - editSwatches(); - }); - pickerGrid.addControl(butEdit, 1, 0); - } else { - pickerGrid.removeControl(butEdit); - } - } - function disableButton(button2, disabled) { - if (disabled) { - button2.color = buttonDisabledColor; - button2.background = buttonDisabledBackgroundColor; - } else { - button2.color = buttonColor; - button2.background = buttonBackgroundColor; - } - } - function closePicker(color) { - if (options.savedColors && options.savedColors.length > 0) { - resolve({ - savedColors: options.savedColors, - pickedColor: color - }); - } else { - resolve({ - pickedColor: color - }); - } - advancedTexture.removeControl(dialogContainer); - } - }); - } -} -ColorPicker._Epsilon = 0.000001; -__decorate2([ - serialize() -], ColorPicker.prototype, "value", null); -__decorate2([ - serialize() -], ColorPicker.prototype, "width", null); -__decorate2([ - serialize() -], ColorPicker.prototype, "height", null); -__decorate2([ - serialize() -], ColorPicker.prototype, "size", null); -RegisterClass("BABYLON.GUI.ColorPicker", ColorPicker); -// node_modules/@babylonjs/gui/2D/controls/ellipse.js -class Ellipse extends Container { - get thickness() { - return this._thickness; - } - set thickness(value) { - if (this._thickness === value) { - return; + }, + PhysicsHelper: () => { + { + return PhysicsHelper; } - this._thickness = value; - this._markAsDirty(); - } - constructor(name265) { - super(name265); - this.name = name265; - this._thickness = 1; - } - _getTypeName() { - return "Ellipse"; - } - _localDraw(context) { - context.save(); - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowColor = this.shadowColor; - context.shadowBlur = this.shadowBlur; - context.shadowOffsetX = this.shadowOffsetX; - context.shadowOffsetY = this.shadowOffsetY; + }, + PhysicsEventType: () => { + { + return PhysicsEventType; } - Control.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2 - this._thickness / 2, this._currentMeasure.height / 2 - this._thickness / 2, context); - if (this._backgroundGradient || this._background) { - context.fillStyle = this._getBackgroundColor(context); - context.fill(); + }, + PhysicsEngineV2: () => { + { + return PhysicsEngine2; } - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowBlur = 0; - context.shadowOffsetX = 0; - context.shadowOffsetY = 0; + }, + PhysicsEngine: () => { + { + return PhysicsEngine; } - if (this._thickness) { - if (this.color) { - context.strokeStyle = this.color; - } - context.lineWidth = this._thickness; - context.stroke(); + }, + PhysicsConstraintType: () => { + { + return PhysicsConstraintType; } - context.restore(); - } - _additionalProcessing(parentMeasure, context) { - super._additionalProcessing(parentMeasure, context); - this._measureForChildren.width -= 2 * this._thickness; - this._measureForChildren.height -= 2 * this._thickness; - this._measureForChildren.left += this._thickness; - this._measureForChildren.top += this._thickness; - } - _clipForChildren(context) { - Control.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2, this._currentMeasure.height / 2, context); - context.clip(); - } - _renderHighlightSpecific(context) { - Control.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2 - this._highlightLineWidth / 2, this._currentMeasure.height / 2 - this._highlightLineWidth / 2, context); - context.stroke(); - } -} -__decorate2([ - serialize() -], Ellipse.prototype, "thickness", null); -RegisterClass("BABYLON.GUI.Ellipse", Ellipse); -// node_modules/@babylonjs/gui/2D/controls/focusableButton.js -class FocusableButton extends Button { - constructor(name265) { - super(name265); - this.name = name265; - this.focusedColor = null; - this._isFocused = false; - this._unfocusedColor = null; - this.onFocusObservable = new Observable; - this.onBlurObservable = new Observable; - this.onKeyboardEventProcessedObservable = new Observable; - this._unfocusedColor = this.color; - } - onBlur() { - if (this._isFocused) { - this._isFocused = false; - if (this.focusedColor && this._unfocusedColor != null) { - this.color = this._unfocusedColor; - } - this.onBlurObservable.notifyObservers(this); + }, + PhysicsConstraintMotorType: () => { + { + return PhysicsConstraintMotorType; } - } - onFocus() { - this._isFocused = true; - if (this.focusedColor) { - this._unfocusedColor = this.color; - this.color = this.focusedColor; + }, + PhysicsConstraintAxisLimitMode: () => { + { + return PhysicsConstraintAxisLimitMode; } - this.onFocusObservable.notifyObservers(this); - } - keepsFocusWith() { - return null; - } - focus() { - this._host.moveFocusToControl(this); - } - blur() { - this._host.focusedControl = null; - } - processKeyboard(evt) { - this.onKeyboardEventProcessedObservable.notifyObservers(evt, -1, this); - } - _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { - if (!this.isReadOnly) { - this.focus(); + }, + PhysicsConstraintAxis: () => { + { + return PhysicsConstraintAxis; } - return super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi); - } - displose() { - super.dispose(); - this.onBlurObservable.clear(); - this.onFocusObservable.clear(); - this.onKeyboardEventProcessedObservable.clear(); - } -} -RegisterClass("BABYLON.GUI.FocusableButton", FocusableButton); -// node_modules/@babylonjs/gui/2D/controls/inputTextArea.js -class InputTextArea extends InputText { - get outlineWidth() { - return this._outlineWidth; - } - set outlineWidth(value) { - if (this._outlineWidth === value) { - return; + }, + PhysicsConstraint: () => { + { + return PhysicsConstraint; } - this._outlineWidth = value; - this._markAsDirty(); - } - get outlineColor() { - return this._outlineColor; - } - set outlineColor(value) { - if (this._outlineColor === value) { - return; + }, + PhysicsBody: () => { + { + return PhysicsBody; } - this._outlineColor = value; - this._markAsDirty(); - } - get autoStretchHeight() { - return this._autoStretchHeight; - } - set autoStretchHeight(value) { - if (this._autoStretchHeight === value) { - return; + }, + PhysicsAggregate: () => { + { + return PhysicsAggregate; } - this._autoStretchHeight = value; - this._markAsDirty(); - } - set height(value) { - this.fixedRatioMasterIsWidth = false; - if (this._height.toString(this._host) === value) { - return; + }, + Physics6DoFLimit: () => { + { + return Physics6DoFLimit; } - if (this._height.fromString(value)) { - this._markAsDirty(); + }, + Physics6DoFConstraint: () => { + { + return Physics6DoFConstraint; } - this._autoStretchHeight = false; - } - get maxHeight() { - return this._maxHeight.toString(this._host); - } - get maxHeightInPixels() { - return this._maxHeight.getValueInPixel(this._host, this._cachedParentMeasure.height); - } - set maxHeight(value) { - if (this._maxHeight.toString(this._host) === value) { - return; + }, + PhotoDome: () => { + { + return PhotoDome; } - if (this._maxHeight.fromString(value)) { - this._markAsDirty(); + }, + PerturbNormalBlock: () => { + { + return PerturbNormalBlock; } - } - constructor(name265, text = "") { - super(name265); - this.name = name265; - this._textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - this._textVerticalAlignment = Control.VERTICAL_ALIGNMENT_TOP; - this._prevText = this.text; - this._lineSpacing = new ValueAndUnit(0); - this._outlineWidth = 0; - this._outlineColor = "white"; - this._maxHeight = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false); - this.onLinesReadyObservable = new Observable; - this.text = text; - this.isPointerBlocker = true; - this.onLinesReadyObservable.add(() => this._updateCursorPosition()); - this._highlightCursorInfo = { - initialStartIndex: -1, - initialRelativeStartIndex: -1, - initialLineIndex: -1 - }; - this._cursorInfo = { - globalStartIndex: 0, - globalEndIndex: 0, - relativeEndIndex: 0, - relativeStartIndex: 0, - currentLineIndex: 0 - }; - } - _getTypeName() { - return "InputTextArea"; - } - processKeyboard(evt) { - if (this.isReadOnly) { - return; + }, + PerformanceViewerCollector: () => { + { + return PerformanceViewerCollector; } - this.alternativeProcessKey(evt.code, evt.key, evt); - this.onKeyboardEventProcessedObservable.notifyObservers(evt); - } - alternativeProcessKey(code, key, evt) { - if (evt && (evt.ctrlKey || evt.metaKey) && (code === "KeyC" || code === "KeyV" || code === "KeyX")) { - return; + }, + PerformanceMonitor: () => { + { + return PerformanceMonitor; } - switch (code) { - case "KeyA": - if (evt && (evt.ctrlKey || evt.metaKey)) { - this._selectAllText(); - evt.preventDefault(); - return; - } - break; - case "Period": - if (evt && evt.shiftKey) { - evt.preventDefault(); - } - break; - case "Backspace": - if (!this._isTextHighlightOn && this._cursorInfo.globalStartIndex > 0) { - this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; - this._cursorInfo.globalStartIndex--; - } - this._prevText = this._textWrapper.text; - this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex); - this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; - if (evt) { - evt.preventDefault(); - } - this._blinkIsEven = false; - this._isTextHighlightOn = false; - this._textHasChanged(); - break; - case "Delete": - if (!this._isTextHighlightOn && this._cursorInfo.globalEndIndex < this.text.length) { - this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex + 1; - } - this._prevText = this._textWrapper.text; - this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex); - this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; - if (evt) { - evt.preventDefault(); - } - this._blinkIsEven = false; - this._isTextHighlightOn = false; - this._textHasChanged(); - break; - case "Enter": - this._prevText = this._textWrapper.text; - this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, "\n"); - this._cursorInfo.globalStartIndex++; - this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; - this._blinkIsEven = false; - this._isTextHighlightOn = false; - this._textHasChanged(); - return; - case "End": - this._cursorInfo.globalStartIndex = this.text.length; - this._blinkIsEven = false; - this._isTextHighlightOn = false; - this._markAsDirty(); - return; - case "Home": - this._cursorInfo.globalStartIndex = 0; - this._blinkIsEven = false; - this._isTextHighlightOn = false; - this._markAsDirty(); - return; - case "ArrowLeft": - this._markAsDirty(); - if (evt && evt.shiftKey) { - if (evt.ctrlKey || evt.metaKey) { - this._cursorInfo.globalStartIndex -= this._cursorInfo.relativeStartIndex; - this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex; - } - if (!this._isTextHighlightOn) { - this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; - this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; - this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex; - this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; - this._cursorInfo.globalStartIndex--; - this._isTextHighlightOn = true; - } else { - if (this._cursorInfo.globalEndIndex > this._highlightCursorInfo.initialStartIndex) { - this._cursorInfo.globalEndIndex--; - } else { - this._cursorInfo.globalStartIndex--; - } - } - this._blinkIsEven = true; - evt.preventDefault(); - return; - } - if (this._isTextHighlightOn) { - this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; - } else if (evt && (evt.ctrlKey || evt.metaKey)) { - this._cursorInfo.globalStartIndex -= this._cursorInfo.relativeStartIndex; - evt.preventDefault(); - } else if (this._cursorInfo.globalStartIndex > 0) { - this._cursorInfo.globalStartIndex--; - } - this._blinkIsEven = false; - this._isTextHighlightOn = false; - return; - case "ArrowRight": - this._markAsDirty(); - if (evt && evt.shiftKey) { - if (evt.ctrlKey || evt.metaKey) { - const rightDelta = this._lines[this._cursorInfo.currentLineIndex].text.length - this._cursorInfo.relativeEndIndex - 1; - this._cursorInfo.globalEndIndex += rightDelta; - this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex; - } - if (!this._isTextHighlightOn) { - this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; - this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; - this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex; - this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; - this._cursorInfo.globalEndIndex++; - this._isTextHighlightOn = true; - } else { - if (this._cursorInfo.globalStartIndex < this._highlightCursorInfo.initialStartIndex) { - this._cursorInfo.globalStartIndex++; - } else { - this._cursorInfo.globalEndIndex++; - } - } - this._blinkIsEven = true; - evt.preventDefault(); - return; - } - if (this._isTextHighlightOn) { - this._cursorInfo.globalStartIndex = this._cursorInfo.globalEndIndex; - } else if (evt && (evt.ctrlKey || evt.metaKey)) { - const rightDelta = this._lines[this._cursorInfo.currentLineIndex].text.length - this._cursorInfo.relativeEndIndex; - this._cursorInfo.globalStartIndex += rightDelta; - } else if (this._cursorInfo.globalStartIndex < this.text.length) { - this._cursorInfo.globalStartIndex++; - } - this._blinkIsEven = false; - this._isTextHighlightOn = false; - return; - case "ArrowUp": - this._blinkIsEven = false; - if (evt) { - if (evt.shiftKey) { - if (!this._isTextHighlightOn) { - this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; - this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; - this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex; - } - this._isTextHighlightOn = true; - this._blinkIsEven = true; - } else { - this._isTextHighlightOn = false; - } - evt.preventDefault(); - } - if (this._cursorInfo.currentLineIndex === 0) { - this._cursorInfo.globalStartIndex = 0; - } else { - const currentLine = this._lines[this._cursorInfo.currentLineIndex]; - const upperLine = this._lines[this._cursorInfo.currentLineIndex - 1]; - let tmpIndex = 0; - let relativeIndex = 0; - if (!this._isTextHighlightOn || this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex) { - tmpIndex = this._cursorInfo.globalStartIndex; - relativeIndex = this._cursorInfo.relativeStartIndex; - } else { - tmpIndex = this._cursorInfo.globalEndIndex; - relativeIndex = this._cursorInfo.relativeEndIndex; - } - const currentText = currentLine.text.substr(0, relativeIndex); - const currentWidth = this._contextForBreakLines.measureText(currentText).width; - let upperWidth = 0; - let previousWidth = 0; - tmpIndex -= relativeIndex; - tmpIndex -= upperLine.text.length + upperLine.lineEnding.length; - let upperLineRelativeIndex = 0; - while (upperWidth < currentWidth && upperLineRelativeIndex < upperLine.text.length) { - tmpIndex++; - upperLineRelativeIndex++; - previousWidth = Math.abs(currentWidth - upperWidth); - upperWidth = this._contextForBreakLines.measureText(upperLine.text.substr(0, upperLineRelativeIndex)).width; - } - if (Math.abs(currentWidth - upperWidth) > previousWidth && upperLineRelativeIndex > 0) { - tmpIndex--; - } - if (!this._isTextHighlightOn) { - this._cursorInfo.globalStartIndex = tmpIndex; - } else if (this._cursorInfo.currentLineIndex <= this._highlightCursorInfo.initialLineIndex) { - this._cursorInfo.globalStartIndex = tmpIndex; - this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex; - this._cursorInfo.relativeEndIndex = this._highlightCursorInfo.initialRelativeStartIndex; - } else { - this._cursorInfo.globalEndIndex = tmpIndex; - } - } - this._markAsDirty(); - return; - case "ArrowDown": - this._blinkIsEven = false; - if (evt) { - if (evt.shiftKey) { - if (!this._isTextHighlightOn) { - this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; - this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; - this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex; - } - this._isTextHighlightOn = true; - this._blinkIsEven = true; - } else { - this._isTextHighlightOn = false; - } - evt.preventDefault(); - } - if (this._cursorInfo.currentLineIndex === this._lines.length - 1) { - this._cursorInfo.globalStartIndex = this.text.length; - } else { - const currentLine = this._lines[this._cursorInfo.currentLineIndex]; - const underLine = this._lines[this._cursorInfo.currentLineIndex + 1]; - let tmpIndex = 0; - let relativeIndex = 0; - if (!this._isTextHighlightOn || this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex) { - tmpIndex = this._cursorInfo.globalStartIndex; - relativeIndex = this._cursorInfo.relativeStartIndex; - } else { - tmpIndex = this._cursorInfo.globalEndIndex; - relativeIndex = this._cursorInfo.relativeEndIndex; - } - const currentText = currentLine.text.substr(0, relativeIndex); - const currentWidth = this._contextForBreakLines.measureText(currentText).width; - let underWidth = 0; - let previousWidth = 0; - tmpIndex += currentLine.text.length - relativeIndex + currentLine.lineEnding.length; - let underLineRelativeIndex = 0; - while (underWidth < currentWidth && underLineRelativeIndex < underLine.text.length) { - tmpIndex++; - underLineRelativeIndex++; - previousWidth = Math.abs(currentWidth - underWidth); - underWidth = this._contextForBreakLines.measureText(underLine.text.substr(0, underLineRelativeIndex)).width; - } - if (Math.abs(currentWidth - underWidth) > previousWidth && underLineRelativeIndex > 0) { - tmpIndex--; - } - if (!this._isTextHighlightOn) { - this._cursorInfo.globalStartIndex = tmpIndex; - } else if (this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex) { - this._cursorInfo.globalStartIndex = tmpIndex; - if (this._cursorInfo.globalStartIndex > this._cursorInfo.globalEndIndex) { - this._cursorInfo.globalEndIndex += this._cursorInfo.globalStartIndex; - this._cursorInfo.globalStartIndex = this._cursorInfo.globalEndIndex - this._cursorInfo.globalStartIndex; - this._cursorInfo.globalEndIndex -= this._cursorInfo.globalStartIndex; - } - } else { - this._cursorInfo.globalEndIndex = tmpIndex; - this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex; - } - } - this._markAsDirty(); - return; + }, + PerformanceConfigurator: () => { + { + return PerformanceConfigurator; } - if ((key === null || key === undefined ? undefined : key.length) === 1) { - evt === null || evt === undefined || evt.preventDefault(); - this._currentKey = key; - this.onBeforeKeyAddObservable.notifyObservers(this); - key = this._currentKey; - if (this._addKey) { - this._isTextHighlightOn = false; - this._blinkIsEven = false; - this._prevText = this._textWrapper.text; - this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, key); - this._cursorInfo.globalStartIndex += key.length; - this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; - this._textHasChanged(); - } + }, + PerfCounter: () => { + { + return PerfCounter; } - } - _parseLineWordWrap(line = "", width, context) { - const lines = []; - const words = line.split(" "); - let lineWidth = 0; - for (let n = 0;n < words.length; n++) { - const testLine = n > 0 ? line + " " + words[n] : words[0]; - const metrics = context.measureText(testLine); - const testWidth = metrics.width; - if (testWidth > width) { - if (n > 0) { - lineWidth = context.measureText(line).width; - lines.push({ text: line, width: lineWidth, lineEnding: " " }); - } - line = words[n]; - let flushedLine = ""; - line.split("").map((char) => { - if (context.measureText(flushedLine + char).width > width) { - lines.push({ text: flushedLine, width: context.measureText(flushedLine).width, lineEnding: "" }); - flushedLine = ""; - } - flushedLine += char; - }); - line = flushedLine; - lineWidth = context.measureText(line).width; - } else { - lineWidth = testWidth; - line = testLine; - } + }, + PerfCollectionStrategy: () => { + { + return PerfCollectionStrategy; } - lines.push({ text: line, width: lineWidth, lineEnding: " " }); - return lines; - } - _breakLines(refWidth, context) { - const lines = []; - const _lines = (this.text || this.placeholderText).split("\n"); - if (this.clipContent) { - for (const _line of _lines) { - lines.push(...this._parseLineWordWrap(_line, refWidth, context)); - } - } else { - for (const _line of _lines) { - lines.push(this._parseLine(_line, context)); - } + }, + PathCursor: () => { + { + return PathCursor; } - lines[lines.length - 1].lineEnding = "\n"; - return lines; - } - _parseLine(line = "", context) { - return { text: line, width: context.measureText(line).width, lineEnding: " " }; - } - _preMeasure(parentMeasure, context) { - if (!this._fontOffset || this._wasDirty) { - this._fontOffset = Control._GetFontOffset(context.font); + }, + Path3D: () => { + { + return Path3D; } - let text = this._beforeRenderText(this._textWrapper).text; - if (!this.text && this._placeholderText) { - text = this._placeholderText; + }, + Path2: () => { + { + return Path2; } - this._textWidth = context.measureText(text).width; - const marginWidth = this._margin.getValueInPixel(this._host, parentMeasure.width) * 2; - if (this._autoStretchWidth) { - const tmpLines = text.split("\n"); - const longerString = tmpLines.reduce((acc, val) => { - const valueLength = context.measureText(val).width; - const accLength = context.measureText(acc).width; - return valueLength > accLength ? val : acc; - }, ""); - const longerStringWidth = context.measureText(longerString).width; - this.width = Math.min(this._maxWidth.getValueInPixel(this._host, parentMeasure.width), longerStringWidth + marginWidth) + "px"; - this.autoStretchWidth = true; + }, + PassPostProcess: () => { + { + return PassPostProcess; } - this._availableWidth = this._width.getValueInPixel(this._host, parentMeasure.width) - marginWidth; - this._lines = this._breakLines(this._availableWidth, context); - this._contextForBreakLines = context; - if (this._autoStretchHeight) { - const textHeight = this._lines.length * this._fontOffset.height; - const totalHeight = textHeight + this._margin.getValueInPixel(this._host, parentMeasure.height) * 2; - this.height = Math.min(this._maxHeight.getValueInPixel(this._host, parentMeasure.height), totalHeight) + "px"; - this._autoStretchHeight = true; + }, + PassCubePostProcess: () => { + { + return PassCubePostProcess; } - this._availableHeight = this._height.getValueInPixel(this._host, parentMeasure.height) - marginWidth; - if (this._isFocused) { - this._cursorInfo.currentLineIndex = 0; - let lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length; - let tmpLength = 0; - while (tmpLength + lineLength <= this._cursorInfo.globalStartIndex) { - tmpLength += lineLength; - if (this._cursorInfo.currentLineIndex < this._lines.length - 1) { - this._cursorInfo.currentLineIndex++; - lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length; - } - } + }, + ParticlesOptimization: () => { + { + return ParticlesOptimization; } - } - _textHasChanged() { - if (!this._prevText && this._textWrapper.text && this.placeholderText) { - this._cursorInfo.currentLineIndex = 0; - this._cursorInfo.globalStartIndex = 1; - this._cursorInfo.globalEndIndex = 1; - this._cursorInfo.relativeStartIndex = 1; - this._cursorInfo.relativeEndIndex = 1; + }, + ParticleTextureBlock: () => { + { + return ParticleTextureBlock; } - super._textHasChanged(); - } - _computeScroll() { - this._clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width); - this._clipTextTop = this._currentMeasure.top + this._margin.getValueInPixel(this._host, this._cachedParentMeasure.height); - if (this._isFocused && this._lines[this._cursorInfo.currentLineIndex].width > this._availableWidth) { - const textLeft = this._clipTextLeft - this._lines[this._cursorInfo.currentLineIndex].width + this._availableWidth; - if (!this._scrollLeft) { - this._scrollLeft = textLeft; - } - } else { - this._scrollLeft = this._clipTextLeft; + }, + ParticleSystemSet: () => { + { + return ParticleSystemSet; } - if (this._isFocused && !this._autoStretchHeight) { - const selectedHeight = (this._cursorInfo.currentLineIndex + 1) * this._fontOffset.height; - const textTop = this._clipTextTop - selectedHeight; - if (!this._scrollTop) { - this._scrollTop = textTop; - } - } else { - this._scrollTop = this._clipTextTop; + }, + ParticleSystem: () => { + { + return ParticleSystem; } - } - _additionalProcessing() { - this.highlightedText = ""; - this.onLinesReadyObservable.notifyObservers(this); - } - _drawText(text, textWidth, y, context) { - const width = this._currentMeasure.width; - let x = this._scrollLeft; - switch (this._textHorizontalAlignment) { - case Control.HORIZONTAL_ALIGNMENT_LEFT: - x += 0; - break; - case Control.HORIZONTAL_ALIGNMENT_RIGHT: - x += width - textWidth; - break; - case Control.HORIZONTAL_ALIGNMENT_CENTER: - x += (width - textWidth) / 2; - break; + }, + ParticleRampGradientBlock: () => { + { + return ParticleRampGradientBlock; } - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowColor = this.shadowColor; - context.shadowBlur = this.shadowBlur; - context.shadowOffsetX = this.shadowOffsetX; - context.shadowOffsetY = this.shadowOffsetY; + }, + ParticleHelper: () => { + { + return ParticleHelper; } - if (this.outlineWidth) { - context.strokeText(text, this._currentMeasure.left + x, y); + }, + ParticleBlendMultiplyBlock: () => { + { + return ParticleBlendMultiplyBlock; } - context.fillText(text, x, y); - } - _onCopyText(ev) { - this._isTextHighlightOn = false; - try { - ev.clipboardData && ev.clipboardData.setData("text/plain", this._highlightedText); - } catch (_a) { + }, + Particle: () => { + { + return Particle2; } - this._host.clipboardData = this._highlightedText; - } - _onCutText(ev) { - if (!this._highlightedText) { - return; + }, + PanoramaToCubeMapTools: () => { + { + return PanoramaToCubeMapTools; } - try { - ev.clipboardData && ev.clipboardData.setData("text/plain", this._highlightedText); - } catch (_a) { + }, + PadNumber: () => { + { + return PadNumber; } - this._host.clipboardData = this._highlightedText; - this._prevText = this._textWrapper.text; - this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex); - this._textHasChanged(); - } - _onPasteText(ev) { - let data = ""; - if (ev.clipboardData && ev.clipboardData.types.indexOf("text/plain") !== -1) { - data = ev.clipboardData.getData("text/plain"); - } else { - data = this._host.clipboardData; + }, + PHI: () => { + { + return PHI; } - this._isTextHighlightOn = false; - this._prevText = this._textWrapper.text; - this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, data); - const deltaIndex = data.length - (this._cursorInfo.globalEndIndex - this._cursorInfo.globalStartIndex); - this._cursorInfo.globalStartIndex += deltaIndex; - this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; - this._textHasChanged(); - } - _draw(context) { - var _a, _b; - this._computeScroll(); - this._scrollLeft = (_a = this._scrollLeft) !== null && _a !== undefined ? _a : 0; - this._scrollTop = (_b = this._scrollTop) !== null && _b !== undefined ? _b : 0; - context.save(); - this._applyStates(context); - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowColor = this.shadowColor; - context.shadowBlur = this.shadowBlur; - context.shadowOffsetX = this.shadowOffsetX; - context.shadowOffsetY = this.shadowOffsetY; + }, + PBRSubSurfaceConfiguration: () => { + { + return PBRSubSurfaceConfiguration; } - if (this._isFocused) { - if (this._focusedBackground) { - context.fillStyle = this._isEnabled ? this._focusedBackground : this._disabledColor; - context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); - } - } else if (this._background) { - context.fillStyle = this._isEnabled ? this._background : this._disabledColor; - context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + }, + PBRSpecularGlossinessMaterial: () => { + { + return PBRSpecularGlossinessMaterial; } - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowBlur = 0; - context.shadowOffsetX = 0; - context.shadowOffsetY = 0; + }, + PBRSheenConfiguration: () => { + { + return PBRSheenConfiguration; } - if (this.color) { - context.fillStyle = this.color; + }, + PBRMetallicRoughnessMaterial: () => { + { + return PBRMetallicRoughnessMaterial; } - const height = this._currentMeasure.height; - const width = this._currentMeasure.width; - let rootY = 0; - switch (this._textVerticalAlignment) { - case Control.VERTICAL_ALIGNMENT_TOP: - rootY = this._fontOffset.ascent; - break; - case Control.VERTICAL_ALIGNMENT_BOTTOM: - rootY = height - this._fontOffset.height * (this._lines.length - 1) - this._fontOffset.descent; - break; - case Control.VERTICAL_ALIGNMENT_CENTER: - rootY = this._fontOffset.ascent + (height - this._fontOffset.height * this._lines.length) / 2; - break; + }, + PBRMetallicRoughnessBlock: () => { + { + return PBRMetallicRoughnessBlock; } - context.save(); - context.beginPath(); - context.fillStyle = this.fontStyle; - if (!this._textWrapper.text && this.placeholderText) { - context.fillStyle = this._placeholderColor; + }, + PBRMaterialDefines: () => { + { + return PBRMaterialDefines; } - context.rect(this._clipTextLeft, this._clipTextTop, this._availableWidth + 2, this._availableHeight + 2); - context.clip(); - rootY += this._scrollTop; - for (let i = 0;i < this._lines.length; i++) { - const line = this._lines[i]; - if (i !== 0 && this._lineSpacing.internalValue !== 0) { - if (this._lineSpacing.isPixel) { - rootY += this._lineSpacing.getValue(this._host); - } else { - rootY = rootY + this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height); - } - } - this._drawText(line.text, line.width, rootY, context); - rootY += this._fontOffset.height; + }, + PBRMaterial: () => { + { + return PBRMaterial; } - context.restore(); - if (this._isFocused) { - if (!this._blinkIsEven || this._isTextHighlightOn) { - let cursorLeft = this._scrollLeft + context.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0, this._cursorInfo.relativeStartIndex)).width; - if (cursorLeft < this._clipTextLeft) { - this._scrollLeft += this._clipTextLeft - cursorLeft; - cursorLeft = this._clipTextLeft; - this._markAsDirty(); - } else if (cursorLeft > this._clipTextLeft + this._availableWidth) { - this._scrollLeft += this._clipTextLeft + this._availableWidth - cursorLeft; - cursorLeft = this._clipTextLeft + this._availableWidth; - this._markAsDirty(); - } - let cursorTop = this._scrollTop + this._cursorInfo.currentLineIndex * this._fontOffset.height; - if (cursorTop < this._clipTextTop) { - this._scrollTop += this._clipTextTop - cursorTop; - cursorTop = this._clipTextTop; - this._markAsDirty(); - } else if (cursorTop + this._fontOffset.height > this._clipTextTop + this._availableHeight) { - this._scrollTop += this._clipTextTop + this._availableHeight - cursorTop - this._fontOffset.height; - cursorTop = this._clipTextTop + this._availableHeight - this._fontOffset.height; - this._markAsDirty(); - } - if (!this._isTextHighlightOn) { - context.fillRect(cursorLeft, cursorTop, 2, this._fontOffset.height); - } - } - this._resetBlinking(); - if (this._isTextHighlightOn) { - clearTimeout(this._blinkTimeout); - this._highlightedText = this.text.substring(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex); - context.globalAlpha = this._highligherOpacity; - context.fillStyle = this._textHighlightColor; - const startLineIndex = Math.min(this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialLineIndex); - const endLineIndex = Math.max(this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialLineIndex); - let highlightRootY = this._scrollTop + startLineIndex * this._fontOffset.height; - for (let i = startLineIndex;i <= endLineIndex; i++) { - const line = this._lines[i]; - let highlightRootX = this._scrollLeft; - switch (this._textHorizontalAlignment) { - case Control.HORIZONTAL_ALIGNMENT_LEFT: - highlightRootX += 0; - break; - case Control.HORIZONTAL_ALIGNMENT_RIGHT: - highlightRootX += width - line.width; - break; - case Control.HORIZONTAL_ALIGNMENT_CENTER: - highlightRootX += (width - line.width) / 2; - break; - } - const begin = i === startLineIndex ? this._cursorInfo.relativeStartIndex : 0; - const end = i === endLineIndex ? this._cursorInfo.relativeEndIndex : line.text.length; - const leftOffsetWidth = context.measureText(line.text.substr(0, begin)).width; - const selectedText = line.text.substring(begin, end); - const hightlightWidth = context.measureText(selectedText).width; - context.fillRect(highlightRootX + leftOffsetWidth, highlightRootY, hightlightWidth, this._fontOffset.height); - highlightRootY += this._fontOffset.height; - } - if (this._cursorInfo.globalEndIndex === this._cursorInfo.globalStartIndex) { - this._resetBlinking(); - } - } + }, + PBRIridescenceConfiguration: () => { + { + return PBRIridescenceConfiguration; } - context.restore(); - if (this._thickness) { - if (this._isFocused) { - if (this.focusedColor) { - context.strokeStyle = this.focusedColor; - } - } else { - if (this.color) { - context.strokeStyle = this.color; - } - } - context.lineWidth = this._thickness; - context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, this._currentMeasure.width - this._thickness, this._currentMeasure.height - this._thickness); + }, + PBRClearCoatConfiguration: () => { + { + return PBRClearCoatConfiguration; } - } - _resetBlinking() { - clearTimeout(this._blinkTimeout); - this._blinkTimeout = setTimeout(() => { - this._blinkIsEven = !this._blinkIsEven; - this._markAsDirty(); - }, 500); - } - _applyStates(context) { - super._applyStates(context); - if (this.outlineWidth) { - context.lineWidth = this.outlineWidth; - context.strokeStyle = this.outlineColor; + }, + PBRBaseSimpleMaterial: () => { + { + return PBRBaseSimpleMaterial; } - } - _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { - if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { - return false; + }, + PBRBaseMaterial: () => { + { + return PBRBaseMaterial; } - if (this.isReadOnly) { - return true; + }, + PBRAnisotropicConfiguration: () => { + { + return PBRAnisotropicConfiguration; } - this._clickedCoordinateX = coordinates.x; - this._clickedCoordinateY = coordinates.y; - this._isTextHighlightOn = false; - this._highlightedText = ""; - this._isPointerDown = true; - this._host._capturingControl[pointerId] = this; - if (this._host.focusedControl === this) { - clearTimeout(this._blinkTimeout); - this._markAsDirty(); - return true; + }, + OutlineRenderer: () => { + { + return OutlineRenderer; } - if (!this._isEnabled) { - return false; + }, + Orientation: () => { + { + return Orientation; } - this._host.focusedControl = this; - return true; - } - _onPointerMove(target, coordinates, pointerId, pi) { - if (pi.event.movementX === 0 && pi.event.movementY === 0) { - return; + }, + OneMinusBlock: () => { + { + return OneMinusBlock; } - if (this._host.focusedControl === this && this._isPointerDown && !this.isReadOnly) { - this._clickedCoordinateX = coordinates.x; - this._clickedCoordinateY = coordinates.y; - if (!this._isTextHighlightOn) { - this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; - this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; - this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex; - this._isTextHighlightOn = true; - } - this._markAsDirty(); + }, + OnAfterEnteringVRObservableEvent: () => { + { + return OnAfterEnteringVRObservableEvent; } - super._onPointerMove(target, coordinates, pointerId, pi); - } - _updateCursorPosition() { - var _a; - if (!this._isFocused) { - return; + }, + OimoJSPlugin: () => { + { + return OimoJSPlugin; } - if (!this._textWrapper.text && this.placeholderText) { - this._cursorInfo.currentLineIndex = 0; - this._cursorInfo.globalStartIndex = 0; - this._cursorInfo.globalEndIndex = 0; - this._cursorInfo.relativeStartIndex = 0; - this._cursorInfo.relativeEndIndex = 0; - } else { - if (this._clickedCoordinateX && this._clickedCoordinateY) { - if (!this._isTextHighlightOn) { - this._cursorInfo = { - globalStartIndex: 0, - globalEndIndex: 0, - relativeStartIndex: 0, - relativeEndIndex: 0, - currentLineIndex: 0 - }; - } - let globalIndex = 0; - let relativeIndex = 0; - const lastClickedCoordinateY = this._clickedCoordinateY - this._scrollTop; - const relativeCoordinateY = Math.floor(lastClickedCoordinateY / this._fontOffset.height); - this._cursorInfo.currentLineIndex = Math.min(Math.max(relativeCoordinateY, 0), this._lines.length - 1); - let currentSize = 0; - const relativeXPosition = this._clickedCoordinateX - ((_a = this._scrollLeft) !== null && _a !== undefined ? _a : 0); - let previousDist = 0; - for (let index = 0;index < this._cursorInfo.currentLineIndex; index++) { - const line = this._lines[index]; - globalIndex += line.text.length + line.lineEnding.length; - } - while (currentSize < relativeXPosition && this._lines[this._cursorInfo.currentLineIndex].text.length > relativeIndex) { - relativeIndex++; - previousDist = Math.abs(relativeXPosition - currentSize); - currentSize = this._contextForBreakLines.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0, relativeIndex)).width; - } - if (Math.abs(relativeXPosition - currentSize) > previousDist && relativeIndex > 0) { - relativeIndex--; - } - globalIndex += relativeIndex; - if (!this._isTextHighlightOn) { - this._cursorInfo.globalStartIndex = globalIndex; - this._cursorInfo.relativeStartIndex = relativeIndex; - this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; - this._cursorInfo.relativeEndIndex = this._cursorInfo.relativeStartIndex; - } else { - if (globalIndex < this._highlightCursorInfo.initialStartIndex) { - this._cursorInfo.globalStartIndex = globalIndex; - this._cursorInfo.relativeStartIndex = relativeIndex; - this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex; - this._cursorInfo.relativeEndIndex = this._highlightCursorInfo.initialRelativeStartIndex; - } else { - this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex; - this._cursorInfo.relativeStartIndex = this._highlightCursorInfo.initialRelativeStartIndex; - this._cursorInfo.globalEndIndex = globalIndex; - this._cursorInfo.relativeEndIndex = relativeIndex; - } - } - this._blinkIsEven = this._isTextHighlightOn; - this._clickedCoordinateX = null; - this._clickedCoordinateY = null; - } else { - this._cursorInfo.relativeStartIndex = 0; - this._cursorInfo.currentLineIndex = 0; - let lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length; - let tmpLength = 0; - while (tmpLength + lineLength <= this._cursorInfo.globalStartIndex) { - tmpLength += lineLength; - if (this._cursorInfo.currentLineIndex < this._lines.length - 1) { - this._cursorInfo.currentLineIndex++; - lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length; - } - } - this._cursorInfo.relativeStartIndex = this._cursorInfo.globalStartIndex - tmpLength; - if (this._highlightCursorInfo.initialStartIndex !== -1 && this._cursorInfo.globalStartIndex >= this._highlightCursorInfo.initialStartIndex) { - while (tmpLength + lineLength <= this._cursorInfo.globalEndIndex) { - tmpLength += lineLength; - if (this._cursorInfo.currentLineIndex < this._lines.length - 1) { - this._cursorInfo.currentLineIndex++; - lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length; - } - } - this._cursorInfo.relativeEndIndex = this._cursorInfo.globalEndIndex - tmpLength; - } else if (!this._isTextHighlightOn) { - this._cursorInfo.relativeEndIndex = this._cursorInfo.relativeStartIndex; - this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; - } - } + }, + OctreeSceneComponent: () => { + { + return OctreeSceneComponent; } - } - _updateValueFromCursorIndex(offset) { - } - _processDblClick(_evt) { - let moveLeft, moveRight; - do { - moveLeft = this._cursorInfo.globalStartIndex > 0 && this._textWrapper.isWord(this._cursorInfo.globalStartIndex - 1) ? --this._cursorInfo.globalStartIndex : 0; - moveRight = this._cursorInfo.globalEndIndex < this._textWrapper.length && this._textWrapper.isWord(this._cursorInfo.globalEndIndex) ? ++this._cursorInfo.globalEndIndex : 0; - } while (moveLeft || moveRight); - this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; - this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; - this.onTextHighlightObservable.notifyObservers(this); - this._isTextHighlightOn = true; - this._blinkIsEven = true; - this._markAsDirty(); - } - _selectAllText() { - this._isTextHighlightOn = true; - this._blinkIsEven = true; - this._highlightCursorInfo = { - initialStartIndex: 0, - initialRelativeStartIndex: 0, - initialLineIndex: 0 - }; - this._cursorInfo = { - globalStartIndex: 0, - globalEndIndex: this._textWrapper.length, - relativeEndIndex: this._lines[this._lines.length - 1].text.length, - relativeStartIndex: 0, - currentLineIndex: this._lines.length - 1 - }; - this._markAsDirty(); - } - dispose() { - super.dispose(); - this.onLinesReadyObservable.clear(); - } -} -__decorate2([ - serialize() -], InputTextArea.prototype, "autoStretchHeight", null); -__decorate2([ - serialize() -], InputTextArea.prototype, "maxHeight", null); -RegisterClass("BABYLON.GUI.InputTextArea", InputTextArea); -// node_modules/@babylonjs/gui/2D/controls/inputPassword.js -class InputPassword extends InputText { - _getTypeName() { - return "InputPassword"; - } - _beforeRenderText(textWrapper3) { - const pwdTextWrapper = new TextWrapper; - let txt = ""; - for (let i = 0;i < textWrapper3.length; i++) { - txt += "\u2022"; + }, + OctreeBlock: () => { + { + return OctreeBlock; } - pwdTextWrapper.text = txt; - return pwdTextWrapper; - } -} -RegisterClass("BABYLON.GUI.InputPassword", InputPassword); -// node_modules/@babylonjs/gui/2D/controls/line.js -class Line extends Control { - get dash() { - return this._dash; - } - set dash(value) { - if (this._dash === value) { - return; + }, + Octree: () => { + { + return Octree; } - this._dash = value; - this._markAsDirty(); - } - get connectedControl() { - return this._connectedControl; - } - set connectedControl(value) { - if (this._connectedControl === value) { - return; + }, + OcclusionMaterial: () => { + { + return OcclusionMaterial; } - if (this._connectedControlDirtyObserver && this._connectedControl) { - this._connectedControl.onDirtyObservable.remove(this._connectedControlDirtyObserver); - this._connectedControlDirtyObserver = null; + }, + Observer: () => { + { + return Observer; } - if (value) { - this._connectedControlDirtyObserver = value.onDirtyObservable.add(() => this._markAsDirty()); + }, + Observable: () => { + { + return Observable; } - this._connectedControl = value; - this._markAsDirty(); - } - get x1() { - return this._x1.toString(this._host); - } - set x1(value) { - if (this._x1.toString(this._host) === value) { - return; + }, + NullEngineOptions: () => { + { + return NullEngineOptions; } - if (this._x1.fromString(value)) { - this._markAsDirty(); + }, + NullEngine: () => { + { + return NullEngine; } - } - get y1() { - return this._y1.toString(this._host); - } - set y1(value) { - if (this._y1.toString(this._host) === value) { - return; + }, + NullBlock: () => { + { + return NullBlock; } - if (this._y1.fromString(value)) { - this._markAsDirty(); + }, + NormalizeVectorBlock: () => { + { + return NormalizeVectorBlock; } - } - get x2() { - return this._x2.toString(this._host); - } - set x2(value) { - if (this._x2.toString(this._host) === value) { - return; + }, + NormalizeBlock: () => { + { + return NormalizeBlock; } - if (this._x2.fromString(value)) { - this._markAsDirty(); + }, + NormalBlendBlock: () => { + { + return NormalBlendBlock; } - } - get y2() { - return this._y2.toString(this._host); - } - set y2(value) { - if (this._y2.toString(this._host) === value) { - return; + }, + NoiseProceduralTexture: () => { + { + return NoiseProceduralTexture; } - if (this._y2.fromString(value)) { - this._markAsDirty(); + }, + NoiseBlock: () => { + { + return NoiseBlock; } - } - get lineWidth() { - return this._lineWidth; - } - set lineWidth(value) { - if (this._lineWidth === value) { - return; + }, + NodeMaterialTeleportOutBlock: () => { + { + return NodeMaterialTeleportOutBlock; } - this._lineWidth = value; - this._markAsDirty(); - } - set horizontalAlignment(value) { - return; - } - set verticalAlignment(value) { - return; - } - get _effectiveX2() { - return (this._connectedControl ? this._connectedControl.centerX : 0) + this._x2.getValue(this._host); - } - get _effectiveY2() { - return (this._connectedControl ? this._connectedControl.centerY : 0) + this._y2.getValue(this._host); - } - constructor(name265) { - super(name265); - this.name = name265; - this._lineWidth = 1; - this._x1 = new ValueAndUnit(0); - this._y1 = new ValueAndUnit(0); - this._x2 = new ValueAndUnit(0); - this._y2 = new ValueAndUnit(0); - this._dash = new Array; - this._automaticSize = true; - this.isHitTestVisible = false; - this._horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - this._verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP; - } - _getTypeName() { - return "Line"; - } - _draw(context) { - context.save(); - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowColor = this.shadowColor; - context.shadowBlur = this.shadowBlur; - context.shadowOffsetX = this.shadowOffsetX; - context.shadowOffsetY = this.shadowOffsetY; + }, + NodeMaterialTeleportInBlock: () => { + { + return NodeMaterialTeleportInBlock; } - this._applyStates(context); - context.strokeStyle = this._getColor(context); - context.lineWidth = this._lineWidth; - context.setLineDash(this._dash); - context.beginPath(); - context.moveTo(this._cachedParentMeasure.left + this._x1.getValue(this._host), this._cachedParentMeasure.top + this._y1.getValue(this._host)); - context.lineTo(this._cachedParentMeasure.left + this._effectiveX2, this._cachedParentMeasure.top + this._effectiveY2); - context.stroke(); - context.restore(); - } - _measure() { - this._currentMeasure.width = Math.abs(this._x1.getValue(this._host) - this._effectiveX2) + this._lineWidth; - this._currentMeasure.height = Math.abs(this._y1.getValue(this._host) - this._effectiveY2) + this._lineWidth; - } - _computeAlignment(parentMeasure) { - this._currentMeasure.left = parentMeasure.left + Math.min(this._x1.getValue(this._host), this._effectiveX2) - this._lineWidth / 2; - this._currentMeasure.top = parentMeasure.top + Math.min(this._y1.getValue(this._host), this._effectiveY2) - this._lineWidth / 2; - } - moveToVector3(position, scene37, end = false) { - if (!this._host || this.parent !== this._host._rootContainer) { - Tools.Error("Cannot move a control to a vector3 if the control is not at root level"); - return; + }, + NodeMaterialSystemValues: () => { + { + return NodeMaterialSystemValues; } - const globalViewport = this._host._getGlobalViewport(); - const projectedPosition = Vector3.Project(position, Matrix.IdentityReadOnly, scene37.getTransformMatrix(), globalViewport); - this._moveToProjectedPosition(projectedPosition, end); - if (projectedPosition.z < 0 || projectedPosition.z > 1) { - this.notRenderable = true; - return; + }, + NodeMaterialOptimizer: () => { + { + return NodeMaterialOptimizer; } - this.notRenderable = false; - } - _moveToProjectedPosition(projectedPosition, end = false) { - const x = projectedPosition.x + this._linkOffsetX.getValue(this._host) + "px"; - const y = projectedPosition.y + this._linkOffsetY.getValue(this._host) + "px"; - if (end) { - this.x2 = x; - this.y2 = y; - this._x2.ignoreAdaptiveScaling = true; - this._y2.ignoreAdaptiveScaling = true; - } else { - this.x1 = x; - this.y1 = y; - this._x1.ignoreAdaptiveScaling = true; - this._y1.ignoreAdaptiveScaling = true; + }, + NodeMaterialModes: () => { + { + return NodeMaterialModes; } - } -} -__decorate2([ - serialize() -], Line.prototype, "dash", null); -__decorate2([ - serialize() -], Line.prototype, "x1", null); -__decorate2([ - serialize() -], Line.prototype, "y1", null); -__decorate2([ - serialize() -], Line.prototype, "x2", null); -__decorate2([ - serialize() -], Line.prototype, "y2", null); -__decorate2([ - serialize() -], Line.prototype, "lineWidth", null); -RegisterClass("BABYLON.GUI.Line", Line); -// node_modules/@babylonjs/gui/2D/multiLinePoint.js -class MultiLinePoint { - constructor(multiLine) { - this._multiLine = multiLine; - this._x = new ValueAndUnit(0); - this._y = new ValueAndUnit(0); - this._point = new Vector3(0, 0, 0); - } - get x() { - return this._x.toString(this._multiLine._host); - } - set x(value) { - if (this._x.toString(this._multiLine._host) === value) { - return; + }, + NodeMaterialDefines: () => { + { + return NodeMaterialDefines; } - if (this._x.fromString(value)) { - this._multiLine._markAsDirty(); + }, + NodeMaterialConnectionPointDirection: () => { + { + return NodeMaterialConnectionPointDirection; } - } - get y() { - return this._y.toString(this._multiLine._host); - } - set y(value) { - if (this._y.toString(this._multiLine._host) === value) { - return; + }, + NodeMaterialConnectionPointCustomObject: () => { + { + return NodeMaterialConnectionPointCustomObject; } - if (this._y.fromString(value)) { - this._multiLine._markAsDirty(); + }, + NodeMaterialConnectionPointCompatibilityStates: () => { + { + return NodeMaterialConnectionPointCompatibilityStates; } - } - get control() { - return this._control; - } - set control(value) { - if (this._control === value) { - return; + }, + NodeMaterialConnectionPoint: () => { + { + return NodeMaterialConnectionPoint; } - if (this._control && this._controlObserver) { - this._control.onDirtyObservable.remove(this._controlObserver); - this._controlObserver = null; + }, + NodeMaterialBlockTargets: () => { + { + return NodeMaterialBlockTargets; } - this._control = value; - if (this._control) { - this._controlObserver = this._control.onDirtyObservable.add(this._multiLine.onPointUpdate); + }, + NodeMaterialBlockConnectionPointTypes: () => { + { + return NodeMaterialBlockConnectionPointTypes; } - this._multiLine._markAsDirty(); - } - get mesh() { - return this._mesh; - } - set mesh(value) { - if (this._mesh === value) { - return; + }, + NodeMaterialBlockConnectionPointMode: () => { + { + return NodeMaterialBlockConnectionPointMode; } - if (this._mesh && this._meshObserver) { - this._mesh.getScene().onAfterCameraRenderObservable.remove(this._meshObserver); + }, + NodeMaterialBlock: () => { + { + return NodeMaterialBlock; } - this._mesh = value; - if (this._mesh) { - this._meshObserver = this._mesh.getScene().onAfterCameraRenderObservable.add(this._multiLine.onPointUpdate); + }, + NodeMaterial: () => { + { + return NodeMaterial; } - this._multiLine._markAsDirty(); - } - resetLinks() { - this.control = null; - this.mesh = null; - } - translate() { - this._point = this._translatePoint(); - return this._point; - } - _translatePoint() { - if (this._mesh != null) { - return this._multiLine._host.getProjectedPositionWithZ(this._mesh.getBoundingInfo().boundingSphere.center, this._mesh.getWorldMatrix()); - } else if (this._control != null) { - return new Vector3(this._control.centerX, this._control.centerY, 1 - Epsilon); - } else { - const host = this._multiLine._host; - const xValue = this._x.getValueInPixel(host, Number(host._canvas.width)); - const yValue = this._y.getValueInPixel(host, Number(host._canvas.height)); - return new Vector3(xValue, yValue, 1 - Epsilon); + }, + NodeGeometryContextualSources: () => { + { + return NodeGeometryContextualSources; } - } - dispose() { - this.resetLinks(); - } -} - -// node_modules/@babylonjs/gui/2D/controls/multiLine.js -class MultiLine extends Control { - constructor(name265) { - super(name265); - this.name = name265; - this._lineWidth = 1; - this.onPointUpdate = () => { - this._markAsDirty(); - }; - this._automaticSize = true; - this.isHitTestVisible = false; - this._horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - this._verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP; - this._dash = []; - this._points = []; - } - get dash() { - return this._dash; - } - set dash(value) { - if (this._dash === value) { - return; + }, + NodeGeometryConnectionPointDirection: () => { + { + return NodeGeometryConnectionPointDirection; } - this._dash = value; - this._markAsDirty(); - } - getAt(index) { - if (!this._points[index]) { - this._points[index] = new MultiLinePoint(this); + }, + NodeGeometryConnectionPointCompatibilityStates: () => { + { + return NodeGeometryConnectionPointCompatibilityStates; } - return this._points[index]; - } - add(...items) { - return items.map((item) => this.push(item)); - } - push(item) { - const point = this.getAt(this._points.length); - if (item == null) { - return point; + }, + NodeGeometryConnectionPoint: () => { + { + return NodeGeometryConnectionPoint; } - if (item instanceof AbstractMesh) { - point.mesh = item; - } else if (item instanceof Control) { - point.control = item; - } else if (item.x != null && item.y != null) { - point.x = item.x; - point.y = item.y; + }, + NodeGeometryBuildState: () => { + { + return NodeGeometryBuildState; } - return point; - } - remove(value) { - let index; - if (value instanceof MultiLinePoint) { - index = this._points.indexOf(value); - if (index === -1) { - return; - } - } else { - index = value; + }, + NodeGeometryBlockConnectionPointTypes: () => { + { + return NodeGeometryBlockConnectionPointTypes; } - const point = this._points[index]; - if (!point) { - return; + }, + NodeGeometryBlock: () => { + { + return NodeGeometryBlock; } - point.dispose(); - this._points.splice(index, 1); - } - reset() { - while (this._points.length > 0) { - this.remove(this._points.length - 1); + }, + NodeGeometry: () => { + { + return NodeGeometry; } - } - resetLinks() { - this._points.forEach((point) => { - if (point != null) { - point.resetLinks(); - } - }); - } - get lineWidth() { - return this._lineWidth; - } - set lineWidth(value) { - if (this._lineWidth === value) { - return; + }, + Node: () => { + { + return Node2; } - this._lineWidth = value; - this._markAsDirty(); - } - set horizontalAlignment(value) { - return; - } - set verticalAlignment(value) { - return; - } - _getTypeName() { - return "MultiLine"; - } - _draw(context) { - context.save(); - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowColor = this.shadowColor; - context.shadowBlur = this.shadowBlur; - context.shadowOffsetX = this.shadowOffsetX; - context.shadowOffsetY = this.shadowOffsetY; + }, + NegateBlock: () => { + { + return NegateBlock; } - this._applyStates(context); - context.strokeStyle = this.color; - context.lineWidth = this._lineWidth; - context.setLineDash(this._dash); - context.beginPath(); - let first = true; - let previousPoint; - this._points.forEach((point) => { - if (!point) { - return; - } - if (first) { - context.moveTo(point._point.x, point._point.y); - first = false; - } else { - if (point._point.z < 1 && previousPoint.z < 1) { - context.lineTo(point._point.x, point._point.y); - } else { - context.moveTo(point._point.x, point._point.y); - } - } - previousPoint = point._point; - }); - context.stroke(); - context.restore(); - } - _additionalProcessing() { - this._minX = null; - this._minY = null; - this._maxX = null; - this._maxY = null; - this._points.forEach((point) => { - if (!point) { - return; - } - point.translate(); - if (this._minX == null || point._point.x < this._minX) { - this._minX = point._point.x; - } - if (this._minY == null || point._point.y < this._minY) { - this._minY = point._point.y; - } - if (this._maxX == null || point._point.x > this._maxX) { - this._maxX = point._point.x; - } - if (this._maxY == null || point._point.y > this._maxY) { - this._maxY = point._point.y; - } - }); - if (this._minX == null) { - this._minX = 0; + }, + NativeXRRenderTarget: () => { + { + return NativeXRRenderTarget; } - if (this._minY == null) { - this._minY = 0; + }, + NativeXRLayerWrapper: () => { + { + return NativeXRLayerWrapper; } - if (this._maxX == null) { - this._maxX = 0; + }, + NativeXRLayerRenderTargetTextureProvider: () => { + { + return NativeXRLayerRenderTargetTextureProvider; } - if (this._maxY == null) { - this._maxY = 0; + }, + NativeXRFrame: () => { + { + return NativeXRFrame; } - } - _measure() { - if (this._minX == null || this._maxX == null || this._minY == null || this._maxY == null) { - return; + }, + NativePointerInput: () => { + { + return NativePointerInput; } - this._currentMeasure.width = Math.abs(this._maxX - this._minX) + this._lineWidth; - this._currentMeasure.height = Math.abs(this._maxY - this._minY) + this._lineWidth; - } - _computeAlignment() { - if (this._minX == null || this._minY == null) { - return; + }, + NativeEngine: () => { + { + return NativeEngine; } - this._currentMeasure.left = this._minX - this._lineWidth / 2; - this._currentMeasure.top = this._minY - this._lineWidth / 2; - } - dispose() { - this.reset(); - super.dispose(); - } -} -__decorate2([ - serialize() -], MultiLine.prototype, "dash", null); -RegisterClass("BABYLON.GUI.MultiLine", MultiLine); -// node_modules/@babylonjs/gui/2D/controls/radioButton.js -class RadioButton extends Control { - get thickness() { - return this._thickness; - } - set thickness(value) { - if (this._thickness === value) { - return; + }, + NativeDataStream: () => { + { + return NativeDataStream; } - this._thickness = value; - this._markAsDirty(); - } - get checkSizeRatio() { - return this._checkSizeRatio; - } - set checkSizeRatio(value) { - value = Math.max(Math.min(1, value), 0); - if (this._checkSizeRatio === value) { - return; + }, + NLerpBlock: () => { + { + return NLerpBlock; } - this._checkSizeRatio = value; - this._markAsDirty(); - } - get background() { - return this._background; - } - set background(value) { - if (this._background === value) { - return; + }, + MultiplyBlock: () => { + { + return MultiplyBlock; } - this._background = value; - this._markAsDirty(); - } - get isChecked() { - return this._isChecked; - } - set isChecked(value) { - if (this._isChecked === value) { - return; + }, + MultiRenderTarget: () => { + { + return MultiRenderTarget; } - this._isChecked = value; - this._markAsDirty(); - this.onIsCheckedChangedObservable.notifyObservers(value); - if (this._isChecked && this._host) { - this._host.executeOnAllControls((control15) => { - if (control15 === this) { - return; - } - if (control15.group === undefined) { - return; - } - const childRadio = control15; - if (childRadio.group === this.group) { - childRadio.isChecked = false; - } - }); + }, + MultiPointerScaleBehavior: () => { + { + return MultiPointerScaleBehavior; } - } - constructor(name265) { - super(name265); - this.name = name265; - this._isChecked = false; - this._background = "black"; - this._checkSizeRatio = 0.8; - this._thickness = 1; - this.group = ""; - this.onIsCheckedChangedObservable = new Observable; - this.isPointerBlocker = true; - } - _getTypeName() { - return "RadioButton"; - } - _draw(context) { - context.save(); - this._applyStates(context); - const actualWidth = this._currentMeasure.width - this._thickness; - const actualHeight = this._currentMeasure.height - this._thickness; - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowColor = this.shadowColor; - context.shadowBlur = this.shadowBlur; - context.shadowOffsetX = this.shadowOffsetX; - context.shadowOffsetY = this.shadowOffsetY; + }, + MultiObserver: () => { + { + return MultiObserver; } - Control.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2 - this._thickness / 2, this._currentMeasure.height / 2 - this._thickness / 2, context); - context.fillStyle = this._isEnabled ? this._background : this._disabledColor; - context.fill(); - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowBlur = 0; - context.shadowOffsetX = 0; - context.shadowOffsetY = 0; + }, + MultiMaterial: () => { + { + return MultiMaterial; } - context.strokeStyle = this.color; - context.lineWidth = this._thickness; - context.stroke(); - if (this._isChecked) { - context.fillStyle = this._isEnabled ? this.color : this._disabledColor; - const offsetWidth = actualWidth * this._checkSizeRatio; - const offseHeight = actualHeight * this._checkSizeRatio; - Control.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, offsetWidth / 2 - this._thickness / 2, offseHeight / 2 - this._thickness / 2, context); - context.fill(); + }, + MotorEnabledJoint: () => { + { + return MotorEnabledJoint; } - context.restore(); - } - _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { - if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { - return false; + }, + MotionBlurPostProcess: () => { + { + return MotionBlurPostProcess; } - if (this.isReadOnly) { - return true; + }, + MorphTargetsBlock: () => { + { + return MorphTargetsBlock; } - if (!this.isChecked) { - this.isChecked = true; + }, + MorphTargetManager: () => { + { + return MorphTargetManager; } - return true; - } - static AddRadioButtonWithHeader(title, group, isChecked, onValueChanged) { - const panel = new StackPanel; - panel.isVertical = false; - panel.height = "30px"; - const radio = new RadioButton; - radio.width = "20px"; - radio.height = "20px"; - radio.isChecked = isChecked; - radio.color = "green"; - radio.group = group; - radio.onIsCheckedChangedObservable.add((value) => onValueChanged(radio, value)); - panel.addControl(radio); - const header = new TextBlock; - header.text = title; - header.width = "180px"; - header.paddingLeft = "5px"; - header.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - header.color = "white"; - panel.addControl(header); - return panel; - } -} -__decorate2([ - serialize() -], RadioButton.prototype, "thickness", null); -__decorate2([ - serialize() -], RadioButton.prototype, "group", undefined); -__decorate2([ - serialize() -], RadioButton.prototype, "checkSizeRatio", null); -__decorate2([ - serialize() -], RadioButton.prototype, "background", null); -__decorate2([ - serialize() -], RadioButton.prototype, "isChecked", null); -RegisterClass("BABYLON.GUI.RadioButton", RadioButton); -// node_modules/@babylonjs/gui/2D/controls/sliders/baseSlider.js -class BaseSlider extends Control { - get displayThumb() { - return this._displayThumb; - } - set displayThumb(value) { - if (this._displayThumb === value) { - return; + }, + MorphTarget: () => { + { + return MorphTarget; } - this._displayThumb = value; - this._markAsDirty(); - } - get step() { - return this._step; - } - set step(value) { - if (this._step === value) { - return; + }, + ModelShape: () => { + { + return ModelShape; } - this._step = value; - this._markAsDirty(); - } - get barOffset() { - return this._barOffset.toString(this._host); - } - get barOffsetInPixels() { - return this._barOffset.getValueInPixel(this._host, this._cachedParentMeasure.width); - } - set barOffset(value) { - if (this._barOffset.toString(this._host) === value) { - return; + }, + ModBlock: () => { + { + return ModBlock; } - if (this._barOffset.fromString(value)) { - this._markAsDirty(); + }, + MirrorTexture: () => { + { + return MirrorTexture; } - } - get thumbWidth() { - return this._thumbWidth.toString(this._host); - } - get thumbWidthInPixels() { - return this._thumbWidth.getValueInPixel(this._host, this._cachedParentMeasure.width); - } - set thumbWidth(value) { - if (this._thumbWidth.toString(this._host) === value) { - return; + }, + MipmapFilterMode: () => { + { + return MipmapFilterMode; } - if (this._thumbWidth.fromString(value)) { - this._markAsDirty(); + }, + MinMaxReducer: () => { + { + return MinMaxReducer; } - } - get minimum() { - return this._minimum; - } - set minimum(value) { - if (this._minimum === value) { - return; + }, + MinBlock: () => { + { + return MinBlock; } - this._minimum = value; - this._markAsDirty(); - this.value = Math.max(Math.min(this.value, this._maximum), this._minimum); - } - get maximum() { - return this._maximum; - } - set maximum(value) { - if (this._maximum === value) { - return; + }, + MeshoptCompression: () => { + { + return MeshoptCompression; } - this._maximum = value; - this._markAsDirty(); - this.value = Math.max(Math.min(this.value, this._maximum), this._minimum); - } - get value() { - return this._value; - } - set value(value) { - value = Math.max(Math.min(value, this._maximum), this._minimum); - if (this._value === value) { - return; + }, + MeshUVSpaceRenderer: () => { + { + return MeshUVSpaceRenderer; } - this._value = value; - this._markAsDirty(); - this.onValueChangedObservable.notifyObservers(this._value); - } - get isVertical() { - return this._isVertical; - } - set isVertical(value) { - if (this._isVertical === value) { - return; + }, + MeshParticleEmitter: () => { + { + return MeshParticleEmitter; } - this._isVertical = value; - this._markAsDirty(); - } - get isThumbClamped() { - return this._isThumbClamped; - } - set isThumbClamped(value) { - if (this._isThumbClamped === value) { - return; + }, + MeshLODLevel: () => { + { + return MeshLODLevel; } - this._isThumbClamped = value; - this._markAsDirty(); - } - constructor(name265) { - super(name265); - this.name = name265; - this._thumbWidth = new ValueAndUnit(20, ValueAndUnit.UNITMODE_PIXEL, false); - this._minimum = 0; - this._maximum = 100; - this._value = 50; - this._isVertical = false; - this._barOffset = new ValueAndUnit(5, ValueAndUnit.UNITMODE_PIXEL, false); - this._isThumbClamped = false; - this._displayThumb = true; - this._step = 0; - this._lastPointerDownId = -1; - this._effectiveBarOffset = 0; - this.onValueChangedObservable = new Observable; - this._pointerIsDown = false; - this.isPointerBlocker = true; - } - _getTypeName() { - return "BaseSlider"; - } - _getThumbPosition() { - if (this.isVertical) { - return (this.maximum - this.value) / (this.maximum - this.minimum) * this._backgroundBoxLength; + }, + MeshExploder: () => { + { + return MeshExploder; } - return (this.value - this.minimum) / (this.maximum - this.minimum) * this._backgroundBoxLength; - } - _getThumbThickness(type) { - let thumbThickness = 0; - switch (type) { - case "circle": - if (this._thumbWidth.isPixel) { - thumbThickness = Math.max(this._thumbWidth.getValue(this._host), this._backgroundBoxThickness); - } else { - thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host); - } - break; - case "rectangle": - if (this._thumbWidth.isPixel) { - thumbThickness = Math.min(this._thumbWidth.getValue(this._host), this._backgroundBoxThickness); - } else { - thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host); - } + }, + MeshDebugPluginMaterial: () => { + { + return MeshDebugPluginMaterial; } - return thumbThickness; - } - _prepareRenderingData(type) { - this._effectiveBarOffset = 0; - this._renderLeft = this._currentMeasure.left; - this._renderTop = this._currentMeasure.top; - this._renderWidth = this._currentMeasure.width; - this._renderHeight = this._currentMeasure.height; - this._backgroundBoxLength = Math.max(this._currentMeasure.width, this._currentMeasure.height); - this._backgroundBoxThickness = Math.min(this._currentMeasure.width, this._currentMeasure.height); - this._effectiveThumbThickness = this._getThumbThickness(type); - if (this.displayThumb) { - this._backgroundBoxLength -= this._effectiveThumbThickness; + }, + MeshDebugMode: () => { + { + return MeshDebugMode; } - if (this.isVertical && this._currentMeasure.height < this._currentMeasure.width) { - Logger.Error("Height should be greater than width"); - return; + }, + MeshBuilder: () => { + { + return MeshBuilder; } - if (this._barOffset.isPixel) { - this._effectiveBarOffset = Math.min(this._barOffset.getValue(this._host), this._backgroundBoxThickness); - } else { - this._effectiveBarOffset = this._backgroundBoxThickness * this._barOffset.getValue(this._host); + }, + MeshBlock: () => { + { + return MeshBlock; } - this._backgroundBoxThickness -= this._effectiveBarOffset * 2; - if (this.isVertical) { - this._renderLeft += this._effectiveBarOffset; - if (!this.isThumbClamped && this.displayThumb) { - this._renderTop += this._effectiveThumbThickness / 2; - } - this._renderHeight = this._backgroundBoxLength; - this._renderWidth = this._backgroundBoxThickness; - } else { - this._renderTop += this._effectiveBarOffset; - if (!this.isThumbClamped && this.displayThumb) { - this._renderLeft += this._effectiveThumbThickness / 2; - } - this._renderHeight = this._backgroundBoxThickness; - this._renderWidth = this._backgroundBoxLength; + }, + MeshAttributeExistsBlockTypes: () => { + { + return MeshAttributeExistsBlockTypes; } - } - _updateValueFromPointer(x, y) { - if (this.rotation != 0) { - this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition); - x = this._transformedPosition.x; - y = this._transformedPosition.y; + }, + MeshAttributeExistsBlock: () => { + { + return MeshAttributeExistsBlock; } - let value; - if (this._isVertical) { - value = this._minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this._maximum - this._minimum); - } else { - value = this._minimum + (x - this._currentMeasure.left) / this._currentMeasure.width * (this._maximum - this._minimum); + }, + MeshAssetTask: () => { + { + return MeshAssetTask; } - this.value = this._step ? Math.round(value / this._step) * this._step : value; - } - _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { - if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { - return false; + }, + Mesh: () => { + { + return Mesh; } - if (this.isReadOnly) { - return true; + }, + MergeMeshesOptimization: () => { + { + return MergeMeshesOptimization; } - this._pointerIsDown = true; - this._updateValueFromPointer(coordinates.x, coordinates.y); - this._host._capturingControl[pointerId] = this; - this._lastPointerDownId = pointerId; - return true; - } - _onPointerMove(target, coordinates, pointerId, pi) { - if (pointerId != this._lastPointerDownId) { - return; + }, + MergeGeometryBlock: () => { + { + return MergeGeometryBlock; } - if (this._pointerIsDown && !this.isReadOnly) { - this._updateValueFromPointer(coordinates.x, coordinates.y); + }, + MaxBlock: () => { + { + return MaxBlock; } - super._onPointerMove(target, coordinates, pointerId, pi); - } - _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick) { - this._pointerIsDown = false; - delete this._host._capturingControl[pointerId]; - super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick); - } - _onCanvasBlur() { - this._forcePointerUp(); - super._onCanvasBlur(); - } -} -__decorate2([ - serialize() -], BaseSlider.prototype, "displayThumb", null); -__decorate2([ - serialize() -], BaseSlider.prototype, "step", null); -__decorate2([ - serialize() -], BaseSlider.prototype, "barOffset", null); -__decorate2([ - serialize() -], BaseSlider.prototype, "thumbWidth", null); -__decorate2([ - serialize() -], BaseSlider.prototype, "minimum", null); -__decorate2([ - serialize() -], BaseSlider.prototype, "maximum", null); -__decorate2([ - serialize() -], BaseSlider.prototype, "value", null); -__decorate2([ - serialize() -], BaseSlider.prototype, "isVertical", null); -__decorate2([ - serialize() -], BaseSlider.prototype, "isThumbClamped", null); - -// node_modules/@babylonjs/gui/2D/controls/sliders/slider.js -class Slider extends BaseSlider { - get displayValueBar() { - return this._displayValueBar; - } - set displayValueBar(value) { - if (this._displayValueBar === value) { - return; + }, + MatrixTransposeBlock: () => { + { + return MatrixTransposeBlock; } - this._displayValueBar = value; - this._markAsDirty(); - } - get borderColor() { - return this._borderColor; - } - set borderColor(value) { - if (this._borderColor === value) { - return; + }, + MatrixDeterminantBlock: () => { + { + return MatrixDeterminantBlock; } - this._borderColor = value; - this._markAsDirty(); - } - get background() { - return this._background; - } - set background(value) { - if (this._background === value) { - return; + }, + MatrixComposeBlock: () => { + { + return MatrixComposeBlock; } - this._background = value; - this._markAsDirty(); - } - get backgroundGradient() { - return this._backgroundGradient; - } - set backgroundGradient(value) { - if (this._backgroundGradient === value) { - return; + }, + MatrixBuilderBlock: () => { + { + return MatrixBuilderBlock; } - this._backgroundGradient = value; - this._markAsDirty(); - } - get thumbColor() { - return this._thumbColor; - } - set thumbColor(value) { - if (this._thumbColor === value) { - return; + }, + Matrix: () => { + { + return Matrix; } - this._thumbColor = value; - this._markAsDirty(); - } - get isThumbCircle() { - return this._isThumbCircle; - } - set isThumbCircle(value) { - if (this._isThumbCircle === value) { - return; + }, + MathBlockOperations: () => { + { + return MathBlockOperations; } - this._isThumbCircle = value; - this._markAsDirty(); - } - constructor(name265) { - super(name265); - this.name = name265; - this._background = "black"; - this._borderColor = "white"; - this._thumbColor = ""; - this._isThumbCircle = false; - this._displayValueBar = true; - this._backgroundGradient = null; - } - _getTypeName() { - return "Slider"; - } - _getBackgroundColor(context) { - return this._backgroundGradient ? this._backgroundGradient.getCanvasGradient(context) : this._background; - } - _draw(context) { - context.save(); - this._applyStates(context); - this._prepareRenderingData(this.isThumbCircle ? "circle" : "rectangle"); - let left = this._renderLeft; - let top = this._renderTop; - const width = this._renderWidth; - const height = this._renderHeight; - let radius = 0; - if (this.isThumbClamped && this.isThumbCircle) { - if (this.isVertical) { - top += this._effectiveThumbThickness / 2; - } else { - left += this._effectiveThumbThickness / 2; - } - radius = this._backgroundBoxThickness / 2; - } else { - radius = (this._effectiveThumbThickness - this._effectiveBarOffset) / 2; + }, + MathBlock: () => { + { + return MathBlock; } - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowColor = this.shadowColor; - context.shadowBlur = this.shadowBlur; - context.shadowOffsetX = this.shadowOffsetX; - context.shadowOffsetY = this.shadowOffsetY; + }, + MaterialSubSurfaceDefines: () => { + { + return MaterialSubSurfaceDefines; } - const thumbPosition = this._getThumbPosition(); - context.fillStyle = this._getBackgroundColor(context); - if (this.isVertical) { - if (this.isThumbClamped) { - if (this.isThumbCircle) { - context.beginPath(); - context.arc(left + this._backgroundBoxThickness / 2, top, radius, Math.PI, 2 * Math.PI); - context.fill(); - context.fillRect(left, top, width, height); - } else { - context.fillRect(left, top, width, height + this._effectiveThumbThickness); - } - } else { - context.fillRect(left, top, width, height); - } - } else { - if (this.isThumbClamped) { - if (this.isThumbCircle) { - context.beginPath(); - context.arc(left + this._backgroundBoxLength, top + this._backgroundBoxThickness / 2, radius, 0, 2 * Math.PI); - context.fill(); - context.fillRect(left, top, width, height); - } else { - context.fillRect(left, top, width + this._effectiveThumbThickness, height); - } - } else { - context.fillRect(left, top, width, height); - } + }, + MaterialSheenDefines: () => { + { + return MaterialSheenDefines; } - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowBlur = 0; - context.shadowOffsetX = 0; - context.shadowOffsetY = 0; + }, + MaterialPluginManager: () => { + { + return MaterialPluginManager; } - context.fillStyle = this._getColor(context); - if (this._displayValueBar) { - if (this.isVertical) { - if (this.isThumbClamped) { - if (this.isThumbCircle) { - context.beginPath(); - context.arc(left + this._backgroundBoxThickness / 2, top + this._backgroundBoxLength, radius, 0, 2 * Math.PI); - context.fill(); - context.fillRect(left, top + thumbPosition, width, height - thumbPosition); - } else { - context.fillRect(left, top + thumbPosition, width, height - thumbPosition + this._effectiveThumbThickness); - } - } else { - context.fillRect(left, top + thumbPosition, width, height - thumbPosition); - } - } else { - if (this.isThumbClamped) { - if (this.isThumbCircle) { - context.beginPath(); - context.arc(left, top + this._backgroundBoxThickness / 2, radius, 0, 2 * Math.PI); - context.fill(); - context.fillRect(left, top, thumbPosition, height); - } else { - context.fillRect(left, top, thumbPosition, height); - } - } else { - context.fillRect(left, top, thumbPosition, height); - } - } + }, + MaterialPluginEvent: () => { + { + return MaterialPluginEvent; } - context.fillStyle = this._thumbColor || this._getColor(context); - if (this.displayThumb) { - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowColor = this.shadowColor; - context.shadowBlur = this.shadowBlur; - context.shadowOffsetX = this.shadowOffsetX; - context.shadowOffsetY = this.shadowOffsetY; - } - if (this._isThumbCircle) { - context.beginPath(); - if (this.isVertical) { - context.arc(left + this._backgroundBoxThickness / 2, top + thumbPosition, radius, 0, 2 * Math.PI); - } else { - context.arc(left + thumbPosition, top + this._backgroundBoxThickness / 2, radius, 0, 2 * Math.PI); - } - context.fill(); - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowBlur = 0; - context.shadowOffsetX = 0; - context.shadowOffsetY = 0; - } - context.strokeStyle = this._borderColor; - context.stroke(); - } else { - if (this.isVertical) { - context.fillRect(left - this._effectiveBarOffset, this._currentMeasure.top + thumbPosition, this._currentMeasure.width, this._effectiveThumbThickness); - } else { - context.fillRect(this._currentMeasure.left + thumbPosition, this._currentMeasure.top, this._effectiveThumbThickness, this._currentMeasure.height); - } - if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { - context.shadowBlur = 0; - context.shadowOffsetX = 0; - context.shadowOffsetY = 0; - } - context.strokeStyle = this._borderColor; - if (this.isVertical) { - context.strokeRect(left - this._effectiveBarOffset, this._currentMeasure.top + thumbPosition, this._currentMeasure.width, this._effectiveThumbThickness); - } else { - context.strokeRect(this._currentMeasure.left + thumbPosition, this._currentMeasure.top, this._effectiveThumbThickness, this._currentMeasure.height); - } - } + }, + MaterialPluginBase: () => { + { + return MaterialPluginBase; } - context.restore(); - } - serialize(serializationObject) { - super.serialize(serializationObject); - if (this.backgroundGradient) { - serializationObject.backgroundGradient = {}; - this.backgroundGradient.serialize(serializationObject.backgroundGradient); + }, + MaterialIridescenceDefines: () => { + { + return MaterialIridescenceDefines; } - } - _parseFromContent(serializedObject, host) { - super._parseFromContent(serializedObject, host); - if (serializedObject.backgroundGradient) { - const className = Tools.Instantiate("BABYLON.GUI." + serializedObject.backgroundGradient.className); - this.backgroundGradient = new className; - this.backgroundGradient.parse(serializedObject.backgroundGradient); + }, + MaterialHelper: () => { + { + return MaterialHelper; } - } -} -__decorate2([ - serialize() -], Slider.prototype, "displayValueBar", null); -__decorate2([ - serialize() -], Slider.prototype, "borderColor", null); -__decorate2([ - serialize() -], Slider.prototype, "background", null); -__decorate2([ - serialize() -], Slider.prototype, "thumbColor", null); -__decorate2([ - serialize() -], Slider.prototype, "isThumbCircle", null); -RegisterClass("BABYLON.GUI.Slider", Slider); -// node_modules/@babylonjs/gui/2D/controls/scrollViewers/scrollViewerWindow.js -class _ScrollViewerWindow extends Container { - get freezeControls() { - return this._freezeControls; - } - set freezeControls(value) { - if (this._freezeControls === value) { - return; + }, + MaterialGreasedLineDefines: () => { + { + return MaterialGreasedLineDefines; } - if (!value) { - this._restoreMeasures(); + }, + MaterialFlags: () => { + { + return MaterialFlags; } - this._freezeControls = false; - const textureSize = this.host.getSize(); - const renderWidth = textureSize.width; - const renderHeight = textureSize.height; - const context = this.host.getContext(); - const measure4 = new Measure(0, 0, renderWidth, renderHeight); - this.host._numLayoutCalls = 0; - this.host._rootContainer._layout(measure4, context); - if (value) { - this._updateMeasures(); - if (this._useBuckets()) { - this._makeBuckets(); - } + }, + MaterialDetailMapDefines: () => { + { + return MaterialDetailMapDefines; } - this._freezeControls = value; - this.host.markAsDirty(); - } - get bucketWidth() { - return this._bucketWidth; - } - get bucketHeight() { - return this._bucketHeight; - } - setBucketSizes(width, height) { - this._bucketWidth = width; - this._bucketHeight = height; - if (this._useBuckets()) { - if (this._freezeControls) { - this._makeBuckets(); - } - } else { - this._buckets = {}; - } - } - _useBuckets() { - return this._bucketWidth > 0 && this._bucketHeight > 0; - } - _makeBuckets() { - this._buckets = {}; - this._bucketLen = Math.ceil(this.widthInPixels / this._bucketWidth); - this._dispatchInBuckets(this._children); - this._oldLeft = null; - this._oldTop = null; - } - _dispatchInBuckets(children) { - for (let i = 0;i < children.length; ++i) { - const child = children[i]; - const bStartX = Math.max(0, Math.floor((child._customData._origLeft - this._customData.origLeft) / this._bucketWidth)), bEndX = Math.floor((child._customData._origLeft - this._customData.origLeft + child._currentMeasure.width - 1) / this._bucketWidth), bEndY = Math.floor((child._customData._origTop - this._customData.origTop + child._currentMeasure.height - 1) / this._bucketHeight); - let bStartY = Math.max(0, Math.floor((child._customData._origTop - this._customData.origTop) / this._bucketHeight)); - while (bStartY <= bEndY) { - for (let x = bStartX;x <= bEndX; ++x) { - const bucket = bStartY * this._bucketLen + x; - let lstc = this._buckets[bucket]; - if (!lstc) { - lstc = []; - this._buckets[bucket] = lstc; - } - lstc.push(child); - } - bStartY++; - } - if (child instanceof Container && child._children.length > 0) { - this._dispatchInBuckets(child._children); - } + }, + MaterialDefines: () => { + { + return MaterialDefines; } - } - _updateMeasures() { - const left = this.leftInPixels | 0, top = this.topInPixels | 0; - this._measureForChildren.left -= left; - this._measureForChildren.top -= top; - this._currentMeasure.left -= left; - this._currentMeasure.top -= top; - this._customData.origLeftForChildren = this._measureForChildren.left; - this._customData.origTopForChildren = this._measureForChildren.top; - this._customData.origLeft = this._currentMeasure.left; - this._customData.origTop = this._currentMeasure.top; - this._updateChildrenMeasures(this._children, left, top); - } - _updateChildrenMeasures(children, left, top) { - for (let i = 0;i < children.length; ++i) { - const child = children[i]; - child._currentMeasure.left -= left; - child._currentMeasure.top -= top; - child._customData._origLeft = child._currentMeasure.left; - child._customData._origTop = child._currentMeasure.top; - if (child instanceof Container && child._children.length > 0) { - this._updateChildrenMeasures(child._children, left, top); - } + }, + MaterialClearCoatDefines: () => { + { + return MaterialClearCoatDefines; } - } - _restoreMeasures() { - const left = this.leftInPixels | 0, top = this.topInPixels | 0; - this._measureForChildren.left = this._customData.origLeftForChildren + left; - this._measureForChildren.top = this._customData.origTopForChildren + top; - this._currentMeasure.left = this._customData.origLeft + left; - this._currentMeasure.top = this._customData.origTop + top; - } - constructor(name265) { - super(name265); - this._freezeControls = false; - this._bucketWidth = 0; - this._bucketHeight = 0; - this._buckets = {}; - } - _getTypeName() { - return "ScrollViewerWindow"; - } - _additionalProcessing(parentMeasure, context) { - super._additionalProcessing(parentMeasure, context); - this._parentMeasure = parentMeasure; - this._measureForChildren.left = this._currentMeasure.left; - this._measureForChildren.top = this._currentMeasure.top; - this._measureForChildren.width = parentMeasure.width; - this._measureForChildren.height = parentMeasure.height; - } - _layout(parentMeasure, context) { - if (this._freezeControls) { - this.invalidateRect(); - return false; + }, + MaterialAnisotropicDefines: () => { + { + return MaterialAnisotropicDefines; } - return super._layout(parentMeasure, context); - } - _scrollChildren(children, left, top) { - for (let i = 0;i < children.length; ++i) { - const child = children[i]; - child._currentMeasure.left = child._customData._origLeft + left; - child._currentMeasure.top = child._customData._origTop + top; - child._isClipped = false; - if (child instanceof Container && child._children.length > 0) { - this._scrollChildren(child._children, left, top); - } + }, + Material: () => { + { + return Material; } - } - _scrollChildrenWithBuckets(left, top, scrollLeft, scrollTop) { - const bStartX = Math.max(0, Math.floor(-left / this._bucketWidth)), bEndX = Math.floor((-left + this._parentMeasure.width - 1) / this._bucketWidth), bEndY = Math.floor((-top + this._parentMeasure.height - 1) / this._bucketHeight); - let bStartY = Math.max(0, Math.floor(-top / this._bucketHeight)); - while (bStartY <= bEndY) { - for (let x = bStartX;x <= bEndX; ++x) { - const bucket = bStartY * this._bucketLen + x, lstc = this._buckets[bucket]; - if (lstc) { - for (let i = 0;i < lstc.length; ++i) { - const child = lstc[i]; - child._currentMeasure.left = child._customData._origLeft + scrollLeft; - child._currentMeasure.top = child._customData._origTop + scrollTop; - child._isClipped = false; - } - } - } - bStartY++; + }, + MappingTypes: () => { + { + return MappingTypes; } - } - _draw(context, invalidatedRectangle) { - if (!this._freezeControls) { - super._draw(context, invalidatedRectangle); - return; + }, + MappingBlock: () => { + { + return MappingBlock; } - this._localDraw(context); - if (this.clipChildren) { - this._clipForChildren(context); + }, + MapRangeBlock: () => { + { + return MapRangeBlock; } - const left = this.leftInPixels | 0, top = this.topInPixels | 0; - if (this._useBuckets()) { - if (this._oldLeft !== null && this._oldTop !== null) { - this._scrollChildrenWithBuckets(this._oldLeft, this._oldTop, left, top); - this._scrollChildrenWithBuckets(left, top, left, top); - } else { - this._scrollChildren(this._children, left, top); - } - } else { - this._scrollChildren(this._children, left, top); + }, + MapMode: () => { + { + return MapMode; } - this._oldLeft = left; - this._oldTop = top; - for (const child of this._children) { - if (!child._intersectsRect(this._parentMeasure)) { - continue; - } - child._render(context, this._parentMeasure); + }, + Logger: () => { + { + return Logger; } - } - _postMeasure() { - if (this._freezeControls) { - super._postMeasure(); - return; + }, + LockConstraint: () => { + { + return LockConstraint; } - let maxWidth = this.parentClientWidth; - let maxHeight = this.parentClientHeight; - for (const child of this.children) { - if (!child.isVisible || child.notRenderable) { - continue; - } - if (child.horizontalAlignment === Control.HORIZONTAL_ALIGNMENT_CENTER) { - child._offsetLeft(this._currentMeasure.left - child._currentMeasure.left); - } - if (child.verticalAlignment === Control.VERTICAL_ALIGNMENT_CENTER) { - child._offsetTop(this._currentMeasure.top - child._currentMeasure.top); - } - maxWidth = Math.max(maxWidth, child._currentMeasure.left - this._currentMeasure.left + child._currentMeasure.width + child.paddingRightInPixels); - maxHeight = Math.max(maxHeight, child._currentMeasure.top - this._currentMeasure.top + child._currentMeasure.height + child.paddingBottomInPixels); + }, + LoadTextureFromTranscodeResult: () => { + { + return LoadTextureFromTranscodeResult; } - if (this._currentMeasure.width !== maxWidth) { - this._width.updateInPlace(maxWidth, ValueAndUnit.UNITMODE_PIXEL); - this._currentMeasure.width = maxWidth; - this._rebuildLayout = true; - this._isDirty = true; + }, + LoadOp: () => { + { + return LoadOp; } - if (this._currentMeasure.height !== maxHeight) { - this._height.updateInPlace(maxHeight, ValueAndUnit.UNITMODE_PIXEL); - this._currentMeasure.height = maxHeight; - this._rebuildLayout = true; - this._isDirty = true; + }, + LoadImage: () => { + { + return LoadImage; } - super._postMeasure(); - } -} - -// node_modules/@babylonjs/gui/2D/controls/sliders/scrollBar.js -class ScrollBar extends BaseSlider { - get borderColor() { - return this._borderColor; - } - set borderColor(value) { - if (this._borderColor === value) { - return; + }, + LoadFileError: () => { + { + return LoadFileError; } - this._borderColor = value; - this._markAsDirty(); - } - get background() { - return this._background; - } - set background(value) { - if (this._background === value) { - return; + }, + LoadFile: () => { + { + return LoadFile; } - this._background = value; - this._markAsDirty(); - } - get backgroundGradient() { - return this._backgroundGradient; - } - set backgroundGradient(value) { - if (this._backgroundGradient === value) { - return; + }, + LinesMesh: () => { + { + return LinesMesh; } - this._backgroundGradient = value; - this._markAsDirty(); - } - get invertScrollDirection() { - return this._invertScrollDirection; - } - set invertScrollDirection(invert) { - this._invertScrollDirection = invert; - } - constructor(name265) { - super(name265); - this.name = name265; - this._background = "black"; - this._borderColor = "white"; - this._tempMeasure = new Measure(0, 0, 0, 0); - this._invertScrollDirection = false; - this._backgroundGradient = null; - } - _getTypeName() { - return "Scrollbar"; - } - _getThumbThickness() { - let thumbThickness = 0; - if (this._thumbWidth.isPixel) { - thumbThickness = this._thumbWidth.getValue(this._host); - } else { - thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host); + }, + LinesBuilder: () => { + { + return LinesBuilder; } - return thumbThickness; - } - _getBackgroundColor(context) { - return this._backgroundGradient ? this._backgroundGradient.getCanvasGradient(context) : this._background; - } - _draw(context) { - context.save(); - this._applyStates(context); - this._prepareRenderingData("rectangle"); - const left = this._renderLeft; - const thumbPosition = this._getThumbPosition(); - context.fillStyle = this._getBackgroundColor(context); - context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); - context.fillStyle = this._getColor(context); - if (this.isVertical) { - this._tempMeasure.left = left - this._effectiveBarOffset; - this._tempMeasure.top = this._currentMeasure.top + thumbPosition; - this._tempMeasure.width = this._currentMeasure.width; - this._tempMeasure.height = this._effectiveThumbThickness; - } else { - this._tempMeasure.left = this._currentMeasure.left + thumbPosition; - this._tempMeasure.top = this._currentMeasure.top; - this._tempMeasure.width = this._effectiveThumbThickness; - this._tempMeasure.height = this._currentMeasure.height; + }, + LineEdgesRenderer: () => { + { + return LineEdgesRenderer; } - context.fillRect(this._tempMeasure.left, this._tempMeasure.top, this._tempMeasure.width, this._tempMeasure.height); - context.restore(); - } - _updateValueFromPointer(x, y) { - if (this.rotation != 0) { - this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition); - x = this._transformedPosition.x; - y = this._transformedPosition.y; + }, + LightInformationBlock: () => { + { + return LightInformationBlock; } - const sign = this._invertScrollDirection ? -1 : 1; - if (this._first) { - this._first = false; - this._originX = x; - this._originY = y; - if (x < this._tempMeasure.left || x > this._tempMeasure.left + this._tempMeasure.width || y < this._tempMeasure.top || y > this._tempMeasure.top + this._tempMeasure.height) { - if (this.isVertical) { - this.value = this.minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this.maximum - this.minimum); - } else { - this.value = this.minimum + (x - this._currentMeasure.left) / this._currentMeasure.width * (this.maximum - this.minimum); - } - } + }, + LightGizmo: () => { + { + return LightGizmo; } - let delta = 0; - if (this.isVertical) { - delta = -((y - this._originY) / (this._currentMeasure.height - this._effectiveThumbThickness)); - } else { - delta = (x - this._originX) / (this._currentMeasure.width - this._effectiveThumbThickness); + }, + LightBlock: () => { + { + return LightBlock; } - this.value += sign * delta * (this.maximum - this.minimum); - this._originX = x; - this._originY = y; - } - _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { - this._first = true; - return super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi); - } - serialize(serializationObject) { - super.serialize(serializationObject); - if (this.backgroundGradient) { - serializationObject.backgroundGradient = {}; - this.backgroundGradient.serialize(serializationObject.backgroundGradient); + }, + Light: () => { + { + return Light; } - } - _parseFromContent(serializationObject, host) { - super._parseFromContent(serializationObject, host); - if (serializationObject.backgroundGradient) { - const className = Tools.Instantiate("BABYLON.GUI." + serializationObject.backgroundGradient.className); - this.backgroundGradient = new className; - this.backgroundGradient.parse(serializationObject.backgroundGradient); + }, + LerpBlock: () => { + { + return LerpBlock; } - } -} -__decorate2([ - serialize() -], ScrollBar.prototype, "borderColor", null); -__decorate2([ - serialize() -], ScrollBar.prototype, "background", null); -__decorate2([ - serialize() -], ScrollBar.prototype, "invertScrollDirection", null); -RegisterClass("BABYLON.GUI.Scrollbar", ScrollBar); - -// node_modules/@babylonjs/gui/2D/controls/sliders/imageScrollBar.js -class ImageScrollBar extends BaseSlider { - get invertScrollDirection() { - return this._invertScrollDirection; - } - set invertScrollDirection(invert) { - this._invertScrollDirection = invert; - } - get backgroundImage() { - return this._backgroundBaseImage; - } - set backgroundImage(value) { - if (this._backgroundBaseImage === value) { - return; + }, + LensRenderingPipeline: () => { + { + return LensRenderingPipeline; } - this._backgroundBaseImage = value; - if (this.isVertical && this.num90RotationInVerticalMode !== 0) { - if (!value.isLoaded) { - value.onImageLoadedObservable.addOnce(() => { - const rotatedValue = value._rotate90(this.num90RotationInVerticalMode, true); - this._backgroundImage = rotatedValue; - if (!rotatedValue.isLoaded) { - rotatedValue.onImageLoadedObservable.addOnce(() => { - this._markAsDirty(); - }); - } - this._markAsDirty(); - }); - } else { - this._backgroundImage = value._rotate90(this.num90RotationInVerticalMode, true); - this._markAsDirty(); - } - } else { - this._backgroundImage = value; - if (value && !value.isLoaded) { - value.onImageLoadedObservable.addOnce(() => { - this._markAsDirty(); - }); - } - this._markAsDirty(); + }, + LensFlaresOptimization: () => { + { + return LensFlaresOptimization; } - } - get thumbImage() { - return this._thumbBaseImage; - } - set thumbImage(value) { - if (this._thumbBaseImage === value) { - return; + }, + LensFlareSystemSceneComponent: () => { + { + return LensFlareSystemSceneComponent; } - this._thumbBaseImage = value; - if (this.isVertical && this.num90RotationInVerticalMode !== 0) { - if (!value.isLoaded) { - value.onImageLoadedObservable.addOnce(() => { - const rotatedValue = value._rotate90(-this.num90RotationInVerticalMode, true); - this._thumbImage = rotatedValue; - if (!rotatedValue.isLoaded) { - rotatedValue.onImageLoadedObservable.addOnce(() => { - this._markAsDirty(); - }); - } - this._markAsDirty(); - }); - } else { - this._thumbImage = value._rotate90(-this.num90RotationInVerticalMode, true); - this._markAsDirty(); - } - } else { - this._thumbImage = value; - if (value && !value.isLoaded) { - value.onImageLoadedObservable.addOnce(() => { - this._markAsDirty(); - }); - } - this._markAsDirty(); + }, + LensFlareSystem: () => { + { + return LensFlareSystem; } - } - get thumbLength() { - return this._thumbLength; - } - set thumbLength(value) { - if (this._thumbLength === value) { - return; + }, + LensFlare: () => { + { + return LensFlare; } - this._thumbLength = value; - this._markAsDirty(); - } - get thumbHeight() { - return this._thumbHeight; - } - set thumbHeight(value) { - if (this._thumbLength === value) { - return; + }, + LengthBlock: () => { + { + return LengthBlock; } - this._thumbHeight = value; - this._markAsDirty(); - } - get barImageHeight() { - return this._barImageHeight; - } - set barImageHeight(value) { - if (this._barImageHeight === value) { - return; + }, + LayerSceneComponent: () => { + { + return LayerSceneComponent; } - this._barImageHeight = value; - this._markAsDirty(); - } - constructor(name265) { - super(name265); - this.name = name265; - this._thumbLength = 0.5; - this._thumbHeight = 1; - this._barImageHeight = 1; - this._tempMeasure = new Measure(0, 0, 0, 0); - this._invertScrollDirection = false; - this.num90RotationInVerticalMode = 1; - } - _getTypeName() { - return "ImageScrollBar"; - } - _getThumbThickness() { - let thumbThickness = 0; - if (this._thumbWidth.isPixel) { - thumbThickness = this._thumbWidth.getValue(this._host); - } else { - thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host); + }, + Layer: () => { + { + return Layer; } - return thumbThickness; - } - _draw(context) { - context.save(); - this._applyStates(context); - this._prepareRenderingData("rectangle"); - const thumbPosition = this._getThumbPosition(); - const left = this._renderLeft; - const top = this._renderTop; - const width = this._renderWidth; - const height = this._renderHeight; - if (this._backgroundImage) { - this._tempMeasure.copyFromFloats(left, top, width, height); - if (this.isVertical) { - this._tempMeasure.copyFromFloats(left + width * (1 - this._barImageHeight) * 0.5, this._currentMeasure.top, width * this._barImageHeight, height); - this._tempMeasure.height += this._effectiveThumbThickness; - this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure); - } else { - this._tempMeasure.copyFromFloats(this._currentMeasure.left, top + height * (1 - this._barImageHeight) * 0.5, width, height * this._barImageHeight); - this._tempMeasure.width += this._effectiveThumbThickness; - this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure); - } - this._backgroundImage._draw(context); + }, + LatheBuilder: () => { + { + return LatheBuilder; } - if (this.isVertical) { - this._tempMeasure.copyFromFloats(left - this._effectiveBarOffset + this._currentMeasure.width * (1 - this._thumbHeight) * 0.5, this._currentMeasure.top + thumbPosition, this._currentMeasure.width * this._thumbHeight, this._effectiveThumbThickness); - } else { - this._tempMeasure.copyFromFloats(this._currentMeasure.left + thumbPosition, this._currentMeasure.top + this._currentMeasure.height * (1 - this._thumbHeight) * 0.5, this._effectiveThumbThickness, this._currentMeasure.height * this._thumbHeight); + }, + KhronosTextureContainer2: () => { + { + return KhronosTextureContainer2; } - if (this._thumbImage) { - this._thumbImage._currentMeasure.copyFrom(this._tempMeasure); - this._thumbImage._draw(context); + }, + KhronosTextureContainer: () => { + { + return KhronosTextureContainer; } - context.restore(); - } - _updateValueFromPointer(x, y) { - if (this.rotation != 0) { - this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition); - x = this._transformedPosition.x; - y = this._transformedPosition.y; + }, + KeyboardInfoPre: () => { + { + return KeyboardInfoPre; } - const sign = this._invertScrollDirection ? -1 : 1; - if (this._first) { - this._first = false; - this._originX = x; - this._originY = y; - if (x < this._tempMeasure.left || x > this._tempMeasure.left + this._tempMeasure.width || y < this._tempMeasure.top || y > this._tempMeasure.top + this._tempMeasure.height) { - if (this.isVertical) { - this.value = this.minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this.maximum - this.minimum); - } else { - this.value = this.minimum + (x - this._currentMeasure.left) / this._currentMeasure.width * (this.maximum - this.minimum); - } - } + }, + KeyboardInfo: () => { + { + return KeyboardInfo; } - let delta = 0; - if (this.isVertical) { - delta = -((y - this._originY) / (this._currentMeasure.height - this._effectiveThumbThickness)); - } else { - delta = (x - this._originX) / (this._currentMeasure.width - this._effectiveThumbThickness); + }, + KeyboardEventTypes: () => { + { + return KeyboardEventTypes; } - this.value += sign * delta * (this.maximum - this.minimum); - this._originX = x; - this._originY = y; - } - _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { - this._first = true; - return super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi); - } -} -__decorate2([ - serialize() -], ImageScrollBar.prototype, "num90RotationInVerticalMode", undefined); -__decorate2([ - serialize() -], ImageScrollBar.prototype, "invertScrollDirection", null); - -// node_modules/@babylonjs/gui/2D/controls/scrollViewers/scrollViewer.js -class ScrollViewer extends Rectangle { - get horizontalBar() { - return this._horizontalBar; - } - get verticalBar() { - return this._verticalBar; - } - addControl(control19) { - if (!control19) { - return this; + }, + KeepAssets: () => { + { + return KeepAssets; } - this._window.addControl(control19); - return this; - } - removeControl(control19) { - this._window.removeControl(control19); - return this; - } - get children() { - return this._window.children; - } - _flagDescendantsAsMatrixDirty() { - for (const child of this._children) { - child._markMatrixAsDirty(); + }, + JoystickAxis: () => { + { + return JoystickAxis; } - } - get freezeControls() { - return this._window.freezeControls; - } - set freezeControls(value) { - this._window.freezeControls = value; - } - get bucketWidth() { - return this._window.bucketWidth; - } - get bucketHeight() { - return this._window.bucketHeight; - } - setBucketSizes(width, height) { - this._window.setBucketSizes(width, height); - } - get forceHorizontalBar() { - return this._forceHorizontalBar; - } - set forceHorizontalBar(value) { - this._grid.setRowDefinition(1, value ? this._barSize : 0, true); - this._horizontalBar.isVisible = value; - this._forceHorizontalBar = value; - } - get forceVerticalBar() { - return this._forceVerticalBar; - } - set forceVerticalBar(value) { - this._grid.setColumnDefinition(1, value ? this._barSize : 0, true); - this._verticalBar.isVisible = value; - this._forceVerticalBar = value; - } - constructor(name265, isImageBased) { - super(name265); - this._barSize = 20; - this._pointerIsOver = false; - this._wheelPrecision = 0.05; - this._thumbLength = 0.5; - this._thumbHeight = 1; - this._barImageHeight = 1; - this._horizontalBarImageHeight = 1; - this._verticalBarImageHeight = 1; - this._oldWindowContentsWidth = 0; - this._oldWindowContentsHeight = 0; - this._forceHorizontalBar = false; - this._forceVerticalBar = false; - this._useImageBar = isImageBased ? isImageBased : false; - this.onDirtyObservable.add(() => { - this._horizontalBarSpace.color = this.color; - this._verticalBarSpace.color = this.color; - this._dragSpace.color = this.color; - }); - this.onPointerEnterObservable.add(() => { - this._pointerIsOver = true; - }); - this.onPointerOutObservable.add(() => { - this._pointerIsOver = false; - }); - this._grid = new Grid; - if (this._useImageBar) { - this._horizontalBar = new ImageScrollBar; - this._verticalBar = new ImageScrollBar; - } else { - this._horizontalBar = new ScrollBar; - this._verticalBar = new ScrollBar; + }, + IsWindowObjectExist: () => { + { + return IsWindowObjectExist; } - this._window = new _ScrollViewerWindow("scrollViewer_window"); - this._window.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - this._window.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP; - this._grid.addColumnDefinition(1); - this._grid.addColumnDefinition(0, true); - this._grid.addRowDefinition(1); - this._grid.addRowDefinition(0, true); - super.addControl(this._grid); - this._grid.addControl(this._window, 0, 0); - this._verticalBarSpace = new Rectangle; - this._verticalBarSpace.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - this._verticalBarSpace.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP; - this._verticalBarSpace.thickness = 1; - this._grid.addControl(this._verticalBarSpace, 0, 1); - this._addBar(this._verticalBar, this._verticalBarSpace, true, Math.PI); - this._horizontalBarSpace = new Rectangle; - this._horizontalBarSpace.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - this._horizontalBarSpace.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP; - this._horizontalBarSpace.thickness = 1; - this._grid.addControl(this._horizontalBarSpace, 1, 0); - this._addBar(this._horizontalBar, this._horizontalBarSpace, false, 0); - this._dragSpace = new Rectangle; - this._dragSpace.thickness = 1; - this._grid.addControl(this._dragSpace, 1, 1); - if (!this._useImageBar) { - this.barColor = "grey"; - this.barBackground = "transparent"; + }, + IsNavigatorAvailable: () => { + { + return IsNavigatorAvailable; } - } - resetWindow() { - this._window.width = "100%"; - this._window.height = "100%"; - } - _getTypeName() { - return "ScrollViewer"; - } - _buildClientSizes() { - const ratio = this.host.idealRatio; - this._window.parentClientWidth = this._currentMeasure.width - (this._verticalBar.isVisible || this.forceVerticalBar ? this._barSize * ratio : 0) - 2 * this.thickness; - this._window.parentClientHeight = this._currentMeasure.height - (this._horizontalBar.isVisible || this.forceHorizontalBar ? this._barSize * ratio : 0) - 2 * this.thickness; - this._clientWidth = this._window.parentClientWidth; - this._clientHeight = this._window.parentClientHeight; - } - _additionalProcessing(parentMeasure, context) { - super._additionalProcessing(parentMeasure, context); - this._buildClientSizes(); - } - _postMeasure() { - super._postMeasure(); - this._updateScroller(); - this._setWindowPosition(false); - } - get wheelPrecision() { - return this._wheelPrecision; - } - set wheelPrecision(value) { - if (this._wheelPrecision === value) { - return; + }, + IsFileURL: () => { + { + return IsFileURL; } - if (value < 0) { - value = 0; + }, + IsDocumentAvailable: () => { + { + return IsDocumentAvailable; } - if (value > 1) { - value = 1; + }, + IsBase64DataUrl: () => { + { + return IsBase64DataUrl; } - this._wheelPrecision = value; - } - get scrollBackground() { - return this._horizontalBarSpace.background; - } - set scrollBackground(color) { - if (this._horizontalBarSpace.background === color) { - return; + }, + IntersectionInfo: () => { + { + return IntersectionInfo; } - this._horizontalBarSpace.background = color; - this._verticalBarSpace.background = color; - } - get barColor() { - return this._barColor; - } - set barColor(color) { - if (this._barColor === color) { - return; + }, + InterpolateValueAction: () => { + { + return InterpolateValueAction; } - this._barColor = color; - this._horizontalBar.color = color; - this._verticalBar.color = color; - } - get thumbImage() { - return this._barImage; - } - set thumbImage(value) { - if (this._barImage === value) { - return; + }, + InternalTextureSource: () => { + { + return InternalTextureSource; } - this._barImage = value; - const hb = this._horizontalBar; - const vb = this._verticalBar; - hb.thumbImage = value; - vb.thumbImage = value; - } - get horizontalThumbImage() { - return this._horizontalBarImage; - } - set horizontalThumbImage(value) { - if (this._horizontalBarImage === value) { - return; + }, + InternalTexture: () => { + { + return InternalTexture; } - this._horizontalBarImage = value; - const hb = this._horizontalBar; - hb.thumbImage = value; - } - get verticalThumbImage() { - return this._verticalBarImage; - } - set verticalThumbImage(value) { - if (this._verticalBarImage === value) { - return; + }, + IntFloatConverterBlock: () => { + { + return IntFloatConverterBlock; } - this._verticalBarImage = value; - const vb = this._verticalBar; - vb.thumbImage = value; - } - get barSize() { - return this._barSize; - } - set barSize(value) { - if (this._barSize === value) { - return; + }, + InstantiatedEntries: () => { + { + return InstantiatedEntries; } - this._barSize = value; - this._markAsDirty(); - if (this._horizontalBar.isVisible) { - this._grid.setRowDefinition(1, this._barSize, true); + }, + InstantiateRadialBlock: () => { + { + return InstantiateRadialBlock; } - if (this._verticalBar.isVisible) { - this._grid.setColumnDefinition(1, this._barSize, true); + }, + InstantiateOnVolumeBlock: () => { + { + return InstantiateOnVolumeBlock; } - } - get thumbLength() { - return this._thumbLength; - } - set thumbLength(value) { - if (this._thumbLength === value) { - return; + }, + InstantiateOnVerticesBlock: () => { + { + return InstantiateOnVerticesBlock; } - if (value <= 0) { - value = 0.1; + }, + InstantiateOnFacesBlock: () => { + { + return InstantiateOnFacesBlock; } - if (value > 1) { - value = 1; + }, + InstantiateLinearBlock: () => { + { + return InstantiateLinearBlock; } - this._thumbLength = value; - const hb = this._horizontalBar; - const vb = this._verticalBar; - hb.thumbLength = value; - vb.thumbLength = value; - this._markAsDirty(); - } - get thumbHeight() { - return this._thumbHeight; - } - set thumbHeight(value) { - if (this._thumbHeight === value) { - return; + }, + InstantiateBlock: () => { + { + return InstantiateBlock; } - if (value <= 0) { - value = 0.1; + }, + InstancesBlock: () => { + { + return InstancesBlock; } - if (value > 1) { - value = 1; + }, + InstancedMesh: () => { + { + return InstancedMesh; } - this._thumbHeight = value; - const hb = this._horizontalBar; - const vb = this._verticalBar; - hb.thumbHeight = value; - vb.thumbHeight = value; - this._markAsDirty(); - } - get barImageHeight() { - return this._barImageHeight; - } - set barImageHeight(value) { - if (this._barImageHeight === value) { - return; + }, + InstancedLinesMesh: () => { + { + return InstancedLinesMesh; } - if (value <= 0) { - value = 0.1; + }, + InspectableType: () => { + { + return InspectableType; } - if (value > 1) { - value = 1; + }, + InputBlock: () => { + { + return InputBlock; } - this._barImageHeight = value; - const hb = this._horizontalBar; - const vb = this._verticalBar; - hb.barImageHeight = value; - vb.barImageHeight = value; - this._markAsDirty(); - } - get horizontalBarImageHeight() { - return this._horizontalBarImageHeight; - } - set horizontalBarImageHeight(value) { - if (this._horizontalBarImageHeight === value) { - return; + }, + IndexFormat: () => { + { + return IndexFormat; } - if (value <= 0) { - value = 0.1; + }, + IncrementValueAction: () => { + { + return IncrementValueAction; } - if (value > 1) { - value = 1; + }, + ImageSourceBlock: () => { + { + return ImageSourceBlock; } - this._horizontalBarImageHeight = value; - const hb = this._horizontalBar; - hb.barImageHeight = value; - this._markAsDirty(); - } - get verticalBarImageHeight() { - return this._verticalBarImageHeight; - } - set verticalBarImageHeight(value) { - if (this._verticalBarImageHeight === value) { - return; + }, + ImageProcessingPostProcess: () => { + { + return ImageProcessingPostProcess; } - if (value <= 0) { - value = 0.1; + }, + ImageProcessingConfigurationDefines: () => { + { + return ImageProcessingConfigurationDefines; } - if (value > 1) { - value = 1; + }, + ImageProcessingConfiguration: () => { + { + return ImageProcessingConfiguration; } - this._verticalBarImageHeight = value; - const vb = this._verticalBar; - vb.barImageHeight = value; - this._markAsDirty(); - } - get barBackground() { - return this._barBackground; - } - set barBackground(color) { - if (this._barBackground === color) { - return; + }, + ImageProcessingBlock: () => { + { + return ImageProcessingBlock; } - this._barBackground = color; - const hb = this._horizontalBar; - const vb = this._verticalBar; - hb.background = color; - vb.background = color; - this._dragSpace.background = color; - } - get barImage() { - return this._barBackgroundImage; - } - set barImage(value) { - this._barBackgroundImage = value; - const hb = this._horizontalBar; - const vb = this._verticalBar; - hb.backgroundImage = value; - vb.backgroundImage = value; - } - get horizontalBarImage() { - return this._horizontalBarBackgroundImage; - } - set horizontalBarImage(value) { - this._horizontalBarBackgroundImage = value; - const hb = this._horizontalBar; - hb.backgroundImage = value; - } - get verticalBarImage() { - return this._verticalBarBackgroundImage; - } - set verticalBarImage(value) { - this._verticalBarBackgroundImage = value; - const vb = this._verticalBar; - vb.backgroundImage = value; - } - _setWindowPosition(force = true) { - const ratio = this.host.idealRatio; - const windowContentsWidth = this._window._currentMeasure.width; - const windowContentsHeight = this._window._currentMeasure.height; - if (!force && this._oldWindowContentsWidth === windowContentsWidth && this._oldWindowContentsHeight === windowContentsHeight) { - return; + }, + ImageAssetTask: () => { + { + return ImageAssetTask; } - this._oldWindowContentsWidth = windowContentsWidth; - this._oldWindowContentsHeight = windowContentsHeight; - const _endLeft = this._clientWidth - windowContentsWidth; - const _endTop = this._clientHeight - windowContentsHeight; - const newLeft = this._horizontalBar.value / ratio * _endLeft + "px"; - const newTop = this._verticalBar.value / ratio * _endTop + "px"; - if (newLeft !== this._window.left) { - this._window.left = newLeft; - if (!this.freezeControls) { - this._rebuildLayout = true; - } + }, + IcoSphereBuilder: () => { + { + return IcoSphereBuilder; } - if (newTop !== this._window.top) { - this._window.top = newTop; - if (!this.freezeControls) { - this._rebuildLayout = true; - } + }, + IcoSphereBlock: () => { + { + return IcoSphereBlock; } - } - _updateScroller() { - const windowContentsWidth = this._window._currentMeasure.width; - const windowContentsHeight = this._window._currentMeasure.height; - if (this._horizontalBar.isVisible && windowContentsWidth <= this._clientWidth && !this.forceHorizontalBar) { - this._grid.setRowDefinition(1, 0, true); - this._horizontalBar.isVisible = false; - this._horizontalBar.value = 0; - this._rebuildLayout = true; - } else if (!this._horizontalBar.isVisible && (windowContentsWidth > this._clientWidth || this.forceHorizontalBar)) { - this._grid.setRowDefinition(1, this._barSize, true); - this._horizontalBar.isVisible = true; - this._rebuildLayout = true; + }, + IWebXRControllerPhysicsOptions: () => { + { + return IWebXRControllerPhysicsOptions; } - if (this._verticalBar.isVisible && windowContentsHeight <= this._clientHeight && !this.forceVerticalBar) { - this._grid.setColumnDefinition(1, 0, true); - this._verticalBar.isVisible = false; - this._verticalBar.value = 0; - this._rebuildLayout = true; - } else if (!this._verticalBar.isVisible && (windowContentsHeight > this._clientHeight || this.forceVerticalBar)) { - this._grid.setColumnDefinition(1, this._barSize, true); - this._verticalBar.isVisible = true; - this._rebuildLayout = true; + }, + IFlowGraphCoordinatorConfiguration: () => { + { + return IFlowGraphCoordinatorConfiguration; } - this._buildClientSizes(); - const ratio = this.host.idealRatio; - this._horizontalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientWidth / ratio) + "px"; - this._verticalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientHeight / ratio) + "px"; - } - _link(host) { - super._link(host); - this._attachWheel(); - } - _addBar(barControl, barContainer, isVertical, rotation) { - barControl.paddingLeft = 0; - barControl.width = "100%"; - barControl.height = "100%"; - barControl.barOffset = 0; - barControl.value = 0; - barControl.maximum = 1; - barControl.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER; - barControl.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER; - barControl.isVertical = isVertical; - barControl.rotation = rotation; - barControl.isVisible = false; - barContainer.addControl(barControl); - barControl.onValueChangedObservable.add(() => { - this._setWindowPosition(); - }); - } - _attachWheel() { - if (!this._host || this._onWheelObserver) { - return; + }, + HtmlElementTexture: () => { + { + return HtmlElementTexture; } - this._onWheelObserver = this.onWheelObservable.add((pi) => { - if (!this._pointerIsOver || this.isReadOnly) { - return; - } - if (this._verticalBar.isVisible == true) { - if (pi.y < 0 && this._verticalBar.value > 0) { - this._verticalBar.value -= this._wheelPrecision; - } else if (pi.y > 0 && this._verticalBar.value < this._verticalBar.maximum) { - this._verticalBar.value += this._wheelPrecision; - } - } - if (this._horizontalBar.isVisible == true) { - if (pi.x < 0 && this._horizontalBar.value < this._horizontalBar.maximum) { - this._horizontalBar.value += this._wheelPrecision; - } else if (pi.x > 0 && this._horizontalBar.value > 0) { - this._horizontalBar.value -= this._wheelPrecision; - } - } - }); - } - _renderHighlightSpecific(context) { - if (!this.isHighlighted) { - return; + }, + HingeJoint: () => { + { + return HingeJoint; } - super._renderHighlightSpecific(context); - this._grid._renderHighlightSpecific(context); - context.restore(); - } - dispose() { - this.onWheelObservable.remove(this._onWheelObserver); - this._onWheelObserver = null; - super.dispose(); - } -} -__decorate2([ - serialize() -], ScrollViewer.prototype, "wheelPrecision", null); -__decorate2([ - serialize() -], ScrollViewer.prototype, "scrollBackground", null); -__decorate2([ - serialize() -], ScrollViewer.prototype, "barColor", null); -__decorate2([ - serialize() -], ScrollViewer.prototype, "barSize", null); -__decorate2([ - serialize() -], ScrollViewer.prototype, "barBackground", null); -RegisterClass("BABYLON.GUI.ScrollViewer", ScrollViewer); -// node_modules/@babylonjs/gui/2D/controls/toggleButton.js -class ToggleButton extends Rectangle { - get group() { - return this._group; - } - set group(value) { - if (this._group === value) { - return; + }, + HingeConstraint: () => { + { + return HingeConstraint; } - this._group = value; - } - get isActive() { - return this._isActive; - } - set isActive(value) { - var _a, _b; - if (this._isActive === value) { - return; + }, + Hinge2Joint: () => { + { + return Hinge2Joint; } - this._isActive = value; - if (this._isActive) { - (_a = this.toActiveAnimation) === null || _a === undefined || _a.call(this); - } else { - (_b = this.toInactiveAnimation) === null || _b === undefined || _b.call(this); + }, + HighlightsPostProcess: () => { + { + return HighlightsPostProcess; } - this._markAsDirty(); - this.onIsActiveChangedObservable.notifyObservers(value); - if (this._isActive && this._host && this._group) { - this._host.executeOnAllControls((control19) => { - if (control19.typeName === "ToggleButton") { - if (control19 === this) { - return; - } - const childToggle = control19; - if (childToggle.group === this.group) { - childToggle.isActive = false; - } - } - }); + }, + HighlightLayer: () => { + { + return HighlightLayer; } - } - constructor(name265, group) { - super(name265); - this.name = name265; - this.onIsActiveChangedObservable = new Observable; - this.delegatePickingToChildren = false; - this._isActive = false; - this.group = group !== null && group !== undefined ? group : ""; - this.thickness = 0; - this.isPointerBlocker = true; - let alphaStore = null; - this.toActiveAnimation = () => { - this.thickness = 1; - }; - this.toInactiveAnimation = () => { - this.thickness = 0; - }; - this.pointerEnterActiveAnimation = () => { - alphaStore = this.alpha; - this.alpha -= 0.1; - }; - this.pointerOutActiveAnimation = () => { - if (alphaStore !== null) { - this.alpha = alphaStore; - } - }; - this.pointerDownActiveAnimation = () => { - this.scaleX -= 0.05; - this.scaleY -= 0.05; - }; - this.pointerUpActiveAnimation = () => { - this.scaleX += 0.05; - this.scaleY += 0.05; - }; - this.pointerEnterInactiveAnimation = () => { - alphaStore = this.alpha; - this.alpha -= 0.1; - }; - this.pointerOutInactiveAnimation = () => { - if (alphaStore !== null) { - this.alpha = alphaStore; - } - }; - this.pointerDownInactiveAnimation = () => { - this.scaleX -= 0.05; - this.scaleY -= 0.05; - }; - this.pointerUpInactiveAnimation = () => { - this.scaleX += 0.05; - this.scaleY += 0.05; - }; - } - _getTypeName() { - return "ToggleButton"; - } - _processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) { - if (!this._isEnabled || !this.isHitTestVisible || !this.isVisible || this.notRenderable) { - return false; + }, + HemisphericParticleEmitter: () => { + { + return HemisphericParticleEmitter; } - if (!super.contains(x, y)) { - return false; + }, + HemisphericLight: () => { + { + return HemisphericLight; } - if (this.delegatePickingToChildren) { - let contains = false; - for (let index = this._children.length - 1;index >= 0; index--) { - const child = this._children[index]; - if (child.isEnabled && child.isHitTestVisible && child.isVisible && !child.notRenderable && child.contains(x, y)) { - contains = true; - break; - } - } - if (!contains) { - return false; - } + }, + HemisphereBuilder: () => { + { + return HemisphereBuilder; } - this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY); - return true; - } - _onPointerEnter(target, pi) { - if (!super._onPointerEnter(target, pi)) { - return false; + }, + HeightToNormalBlock: () => { + { + return HeightToNormalBlock; } - if (this.isReadOnly) { - return true; + }, + HavokPlugin: () => { + { + return HavokPlugin; } - if (this._isActive) { - if (this.pointerEnterActiveAnimation) { - this.pointerEnterActiveAnimation(); - } - } else { - if (this.pointerEnterInactiveAnimation) { - this.pointerEnterInactiveAnimation(); - } + }, + HardwareScalingOptimization: () => { + { + return HardwareScalingOptimization; } - return true; - } - _onPointerOut(target, pi, force = false) { - if (!this.isReadOnly) { - if (this._isActive) { - if (this.pointerOutActiveAnimation) { - this.pointerOutActiveAnimation(); - } - } else { - if (this.pointerOutInactiveAnimation) { - this.pointerOutInactiveAnimation(); - } - } + }, + HandPart: () => { + { + return HandPart; } - super._onPointerOut(target, pi, force); - } - _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { - if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { - return false; + }, + HandConstraintZone: () => { + { + return HandConstraintZone; } - if (this.isReadOnly) { - return true; + }, + HandConstraintVisibility: () => { + { + return HandConstraintVisibility; } - if (this._isActive) { - if (this.pointerDownActiveAnimation) { - this.pointerDownActiveAnimation(); - } - } else { - if (this.pointerDownInactiveAnimation) { - this.pointerDownInactiveAnimation(); - } + }, + HandConstraintOrientation: () => { + { + return HandConstraintOrientation; } - return true; - } - _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi) { - if (!this.isReadOnly) { - if (this._isActive) { - if (this.pointerUpActiveAnimation) { - this.pointerUpActiveAnimation(); - } - } else { - if (this.pointerUpInactiveAnimation) { - this.pointerUpInactiveAnimation(); - } - } + }, + HandConstraintBehavior: () => { + { + return HandConstraintBehavior; } - super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi); - } -} -RegisterClass("BABYLON.GUI.ToggleButton", ToggleButton); -// node_modules/@babylonjs/gui/2D/controls/virtualKeyboard.js -class VirtualKeyboard extends StackPanel { - constructor() { - super(...arguments); - this.onKeyPressObservable = new Observable; - this.defaultButtonWidth = "40px"; - this.defaultButtonHeight = "40px"; - this.defaultButtonPaddingLeft = "2px"; - this.defaultButtonPaddingRight = "2px"; - this.defaultButtonPaddingTop = "2px"; - this.defaultButtonPaddingBottom = "2px"; - this.defaultButtonColor = "#DDD"; - this.defaultButtonBackground = "#070707"; - this.shiftButtonColor = "#7799FF"; - this.selectedShiftThickness = 1; - this.shiftState = 0; - this._currentlyConnectedInputText = null; - this._connectedInputTexts = []; - this._onKeyPressObserver = null; - } - _getTypeName() { - return "VirtualKeyboard"; - } - _createKey(key, propertySet) { - const button4 = Button.CreateSimpleButton(key, key); - button4.width = propertySet && propertySet.width ? propertySet.width : this.defaultButtonWidth; - button4.height = propertySet && propertySet.height ? propertySet.height : this.defaultButtonHeight; - button4.color = propertySet && propertySet.color ? propertySet.color : this.defaultButtonColor; - button4.background = propertySet && propertySet.background ? propertySet.background : this.defaultButtonBackground; - button4.paddingLeft = propertySet && propertySet.paddingLeft ? propertySet.paddingLeft : this.defaultButtonPaddingLeft; - button4.paddingRight = propertySet && propertySet.paddingRight ? propertySet.paddingRight : this.defaultButtonPaddingRight; - button4.paddingTop = propertySet && propertySet.paddingTop ? propertySet.paddingTop : this.defaultButtonPaddingTop; - button4.paddingBottom = propertySet && propertySet.paddingBottom ? propertySet.paddingBottom : this.defaultButtonPaddingBottom; - button4.thickness = 0; - button4.isFocusInvisible = true; - button4.shadowColor = this.shadowColor; - button4.shadowBlur = this.shadowBlur; - button4.shadowOffsetX = this.shadowOffsetX; - button4.shadowOffsetY = this.shadowOffsetY; - button4.onPointerUpObservable.add(() => { - this.onKeyPressObservable.notifyObservers(key); - }); - return button4; - } - addKeysRow(keys2, propertySets) { - const panel = new StackPanel; - panel.isVertical = false; - panel.isFocusInvisible = true; - let maxKey = null; - for (let i = 0;i < keys2.length; i++) { - let properties = null; - if (propertySets && propertySets.length === keys2.length) { - properties = propertySets[i]; - } - const key = this._createKey(keys2[i], properties); - if (!maxKey || key.heightInPixels > maxKey.heightInPixels) { - maxKey = key; - } - panel.addControl(key); + }, + HDRTools: () => { + { + return HDRTools; } - panel.height = maxKey ? maxKey.height : this.defaultButtonHeight; - this.addControl(panel); - } - applyShiftState(shiftState) { - if (!this.children) { - return; + }, + HDRFiltering: () => { + { + return HDRFiltering; } - for (let i = 0;i < this.children.length; i++) { - const row = this.children[i]; - if (!row || !row.children) { - continue; - } - const rowContainer = row; - for (let j = 0;j < rowContainer.children.length; j++) { - const button4 = rowContainer.children[j]; - if (!button4 || !button4.children[0]) { - continue; - } - const button_tblock = button4.children[0]; - if (button_tblock.text === "\u21E7") { - button4.color = shiftState ? this.shiftButtonColor : this.defaultButtonColor; - button4.thickness = shiftState > 1 ? this.selectedShiftThickness : 0; - } - button_tblock.text = shiftState > 0 ? button_tblock.text.toUpperCase() : button_tblock.text.toLowerCase(); - } + }, + HDRCubeTextureAssetTask: () => { + { + return HDRCubeTextureAssetTask; } - } - get connectedInputText() { - return this._currentlyConnectedInputText; - } - connect(input) { - const inputTextAlreadyConnected = this._connectedInputTexts.some((a) => a.input === input); - if (inputTextAlreadyConnected) { - return; + }, + HDRCubeTexture: () => { + { + return HDRCubeTexture; } - if (this._onKeyPressObserver === null) { - this._onKeyPressObserver = this.onKeyPressObservable.add((key) => { - if (!this._currentlyConnectedInputText) { - return; - } - this._currentlyConnectedInputText._host.focusedControl = this._currentlyConnectedInputText; - switch (key) { - case "\u21E7": - this.shiftState++; - if (this.shiftState > 2) { - this.shiftState = 0; - } - this.applyShiftState(this.shiftState); - return; - case "\u2190": - if (this._currentlyConnectedInputText instanceof InputTextArea) { - this._currentlyConnectedInputText.alternativeProcessKey("Backspace"); - } else { - this._currentlyConnectedInputText.processKey(8); - } - return; - case "\u21B5": - if (this._currentlyConnectedInputText instanceof InputTextArea) { - this._currentlyConnectedInputText.alternativeProcessKey("Enter"); - } else { - this._currentlyConnectedInputText.processKey(13); - } - return; - } - if (this._currentlyConnectedInputText instanceof InputTextArea) { - this._currentlyConnectedInputText.alternativeProcessKey("", this.shiftState ? key.toUpperCase() : key); - } else { - this._currentlyConnectedInputText.processKey(-1, this.shiftState ? key.toUpperCase() : key); - } - if (this.shiftState === 1) { - this.shiftState = 0; - this.applyShiftState(this.shiftState); - } - }); + }, + GroundMesh: () => { + { + return GroundMesh; } - this.isVisible = false; - this._currentlyConnectedInputText = input; - input._connectedVirtualKeyboard = this; - const onFocusObserver = input.onFocusObservable.add(() => { - this._currentlyConnectedInputText = input; - input._connectedVirtualKeyboard = this; - this.isVisible = true; - }); - const onBlurObserver = input.onBlurObservable.add(() => { - input._connectedVirtualKeyboard = null; - this._currentlyConnectedInputText = null; - this.isVisible = false; - }); - this._connectedInputTexts.push({ - input, - onBlurObserver, - onFocusObserver - }); - } - disconnect(input) { - if (input) { - const filtered = this._connectedInputTexts.filter((a) => a.input === input); - if (filtered.length === 1) { - this._removeConnectedInputObservables(filtered[0]); - this._connectedInputTexts = this._connectedInputTexts.filter((a) => a.input !== input); - if (this._currentlyConnectedInputText === input) { - this._currentlyConnectedInputText = null; - } - } - } else { - this._connectedInputTexts.forEach((connectedInputText) => { - this._removeConnectedInputObservables(connectedInputText); - }); - this._connectedInputTexts.length = 0; + }, + GroundBuilder: () => { + { + return GroundBuilder; } - if (this._connectedInputTexts.length === 0) { - this._currentlyConnectedInputText = null; - this.onKeyPressObservable.remove(this._onKeyPressObserver); - this._onKeyPressObserver = null; + }, + GridBlock: () => { + { + return GridBlock; } - } - _removeConnectedInputObservables(connectedInputText) { - connectedInputText.input._connectedVirtualKeyboard = null; - connectedInputText.input.onFocusObservable.remove(connectedInputText.onFocusObserver); - connectedInputText.input.onBlurObservable.remove(connectedInputText.onBlurObserver); - } - dispose() { - super.dispose(); - this.disconnect(); - } - static CreateDefaultLayout(name265) { - const returnValue = new VirtualKeyboard(name265); - returnValue.addKeysRow(["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "\u2190"]); - returnValue.addKeysRow(["q", "w", "e", "r", "t", "y", "u", "i", "o", "p"]); - returnValue.addKeysRow(["a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "\u21B5"]); - returnValue.addKeysRow(["\u21E7", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/"]); - returnValue.addKeysRow([" "], [{ width: "200px" }]); - return returnValue; - } - _parseFromContent(serializedObject, host) { - super._parseFromContent(serializedObject, host); - for (const row of this.children) { - if (row.getClassName() === "StackPanel") { - const stackPanel5 = row; - for (const key of stackPanel5.children) { - if (key.getClassName() === "Button" && key.name) { - key.onPointerUpObservable.add(() => { - this.onKeyPressObservable.notifyObservers(key.name); - }); - } - } - } + }, + GreasedLineTools: () => { + { + return GreasedLineTools; } - } -} -RegisterClass("BABYLON.GUI.VirtualKeyboard", VirtualKeyboard); -// node_modules/@babylonjs/gui/2D/controls/displayGrid.js -class DisplayGrid extends Control { - get displayMinorLines() { - return this._displayMinorLines; - } - set displayMinorLines(value) { - if (this._displayMinorLines === value) { - return; + }, + GreasedLineSimpleMaterial: () => { + { + return GreasedLineSimpleMaterial; } - this._displayMinorLines = value; - this._markAsDirty(); - } - get displayMajorLines() { - return this._displayMajorLines; - } - set displayMajorLines(value) { - if (this._displayMajorLines === value) { - return; + }, + GreasedLineRibbonPointsMode: () => { + { + return GreasedLineRibbonPointsMode; } - this._displayMajorLines = value; - this._markAsDirty(); - } - get background() { - return this._background; - } - set background(value) { - if (this._background === value) { - return; + }, + GreasedLineRibbonMesh: () => { + { + return GreasedLineRibbonMesh; } - this._background = value; - this._markAsDirty(); - } - get cellWidth() { - return this._cellWidth; - } - set cellWidth(value) { - this._cellWidth = value; - this._markAsDirty(); - } - get cellHeight() { - return this._cellHeight; - } - set cellHeight(value) { - this._cellHeight = value; - this._markAsDirty(); - } - get minorLineTickness() { - return this._minorLineTickness; - } - set minorLineTickness(value) { - this._minorLineTickness = value; - this._markAsDirty(); - } - get minorLineColor() { - return this._minorLineColor; - } - set minorLineColor(value) { - this._minorLineColor = value; - this._markAsDirty(); - } - get majorLineTickness() { - return this._majorLineTickness; - } - set majorLineTickness(value) { - this._majorLineTickness = value; - this._markAsDirty(); - } - get majorLineColor() { - return this._majorLineColor; - } - set majorLineColor(value) { - this._majorLineColor = value; - this._markAsDirty(); - } - get majorLineFrequency() { - return this._majorLineFrequency; - } - set majorLineFrequency(value) { - this._majorLineFrequency = value; - this._markAsDirty(); - } - constructor(name265) { - super(name265); - this.name = name265; - this._cellWidth = 20; - this._cellHeight = 20; - this._minorLineTickness = 1; - this._minorLineColor = "DarkGray"; - this._majorLineTickness = 2; - this._majorLineColor = "White"; - this._majorLineFrequency = 5; - this._background = "Black"; - this._displayMajorLines = true; - this._displayMinorLines = true; - } - _draw(context) { - context.save(); - this._applyStates(context); - if (this._isEnabled) { - if (this._background) { - context.fillStyle = this._background; - context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); - } - const cellCountX = this._currentMeasure.width / this._cellWidth; - const cellCountY = this._currentMeasure.height / this._cellHeight; - const left = this._currentMeasure.left + this._currentMeasure.width / 2; - const top = this._currentMeasure.top + this._currentMeasure.height / 2; - if (this._displayMinorLines) { - context.strokeStyle = this._minorLineColor; - context.lineWidth = this._minorLineTickness; - for (let x = -cellCountX / 2 + 1;x < cellCountX / 2; x++) { - const cellX = left + x * this.cellWidth; - context.beginPath(); - context.moveTo(cellX, this._currentMeasure.top); - context.lineTo(cellX, this._currentMeasure.top + this._currentMeasure.height); - context.stroke(); - } - for (let y = -cellCountY / 2 + 1;y < cellCountY / 2; y++) { - const cellY = top + y * this.cellHeight; - context.beginPath(); - context.moveTo(this._currentMeasure.left, cellY); - context.lineTo(this._currentMeasure.left + this._currentMeasure.width, cellY); - context.stroke(); - } - } - if (this._displayMajorLines) { - context.strokeStyle = this._majorLineColor; - context.lineWidth = this._majorLineTickness; - for (let x = -cellCountX / 2 + this._majorLineFrequency;x < cellCountX / 2; x += this._majorLineFrequency) { - const cellX = left + x * this.cellWidth; - context.beginPath(); - context.moveTo(cellX, this._currentMeasure.top); - context.lineTo(cellX, this._currentMeasure.top + this._currentMeasure.height); - context.stroke(); - } - for (let y = -cellCountY / 2 + this._majorLineFrequency;y < cellCountY / 2; y += this._majorLineFrequency) { - const cellY = top + y * this.cellHeight; - context.moveTo(this._currentMeasure.left, cellY); - context.lineTo(this._currentMeasure.left + this._currentMeasure.width, cellY); - context.closePath(); - context.stroke(); - } - } + }, + GreasedLineRibbonFacesMode: () => { + { + return GreasedLineRibbonFacesMode; } - context.restore(); - } - _getTypeName() { - return "DisplayGrid"; - } -} -__decorate2([ - serialize() -], DisplayGrid.prototype, "displayMinorLines", null); -__decorate2([ - serialize() -], DisplayGrid.prototype, "displayMajorLines", null); -__decorate2([ - serialize() -], DisplayGrid.prototype, "background", null); -__decorate2([ - serialize() -], DisplayGrid.prototype, "cellWidth", null); -__decorate2([ - serialize() -], DisplayGrid.prototype, "cellHeight", null); -__decorate2([ - serialize() -], DisplayGrid.prototype, "minorLineTickness", null); -__decorate2([ - serialize() -], DisplayGrid.prototype, "minorLineColor", null); -__decorate2([ - serialize() -], DisplayGrid.prototype, "majorLineTickness", null); -__decorate2([ - serialize() -], DisplayGrid.prototype, "majorLineColor", null); -__decorate2([ - serialize() -], DisplayGrid.prototype, "majorLineFrequency", null); -RegisterClass("BABYLON.GUI.DisplayGrid", DisplayGrid); -// node_modules/@babylonjs/gui/2D/controls/sliders/imageBasedSlider.js -class ImageBasedSlider extends BaseSlider { - get displayThumb() { - return this._displayThumb && this.thumbImage != null; - } - set displayThumb(value) { - if (this._displayThumb === value) { - return; + }, + GreasedLineRibbonAutoDirectionMode: () => { + { + return GreasedLineRibbonAutoDirectionMode; } - this._displayThumb = value; - this._markAsDirty(); - } - get backgroundImage() { - return this._backgroundImage; - } - set backgroundImage(value) { - if (this._backgroundImage === value) { - return; + }, + GreasedLinePluginMaterial: () => { + { + return GreasedLinePluginMaterial; } - this._backgroundImage = value; - if (value && !value.isLoaded) { - value.onImageLoadedObservable.addOnce(() => this._markAsDirty()); + }, + GreasedLineMeshWidthDistribution: () => { + { + return GreasedLineMeshWidthDistribution; } - this._markAsDirty(); - } - get valueBarImage() { - return this._valueBarImage; - } - set valueBarImage(value) { - if (this._valueBarImage === value) { - return; + }, + GreasedLineMeshMaterialType: () => { + { + return GreasedLineMeshMaterialType; } - this._valueBarImage = value; - if (value && !value.isLoaded) { - value.onImageLoadedObservable.addOnce(() => this._markAsDirty()); + }, + GreasedLineMeshColorMode: () => { + { + return GreasedLineMeshColorMode; } - this._markAsDirty(); - } - get thumbImage() { - return this._thumbImage; - } - set thumbImage(value) { - if (this._thumbImage === value) { - return; + }, + GreasedLineMeshColorDistributionType: () => { + { + return GreasedLineMeshColorDistributionType; } - this._thumbImage = value; - if (value && !value.isLoaded) { - value.onImageLoadedObservable.addOnce(() => this._markAsDirty()); + }, + GreasedLineMeshColorDistribution: () => { + { + return GreasedLineMeshColorDistribution; } - this._markAsDirty(); - } - constructor(name265) { - super(name265); - this.name = name265; - this._tempMeasure = new Measure(0, 0, 0, 0); - } - _getTypeName() { - return "ImageBasedSlider"; - } - _draw(context) { - context.save(); - this._applyStates(context); - this._prepareRenderingData("rectangle"); - const thumbPosition = this._getThumbPosition(); - const left = this._renderLeft; - const top = this._renderTop; - const width = this._renderWidth; - const height = this._renderHeight; - if (this._backgroundImage) { - this._tempMeasure.copyFromFloats(left, top, width, height); - if (this.isThumbClamped && this.displayThumb) { - if (this.isVertical) { - this._tempMeasure.height += this._effectiveThumbThickness; - } else { - this._tempMeasure.width += this._effectiveThumbThickness; - } - } - this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure); - this._backgroundImage._draw(context); + }, + GreasedLineMesh: () => { + { + return GreasedLineMesh; } - if (this._valueBarImage) { - if (this.isVertical) { - if (this.isThumbClamped && this.displayThumb) { - this._tempMeasure.copyFromFloats(left, top + thumbPosition, width, height - thumbPosition + this._effectiveThumbThickness); - } else { - this._tempMeasure.copyFromFloats(left, top + thumbPosition, width, height - thumbPosition); - } - } else { - if (this.isThumbClamped && this.displayThumb) { - this._tempMeasure.copyFromFloats(left, top, thumbPosition + this._effectiveThumbThickness / 2, height); - } else { - this._tempMeasure.copyFromFloats(left, top, thumbPosition, height); - } - } - this._valueBarImage._currentMeasure.copyFrom(this._tempMeasure); - this._valueBarImage._draw(context); + }, + GreasedLineMaterialDefaults: () => { + { + return GreasedLineMaterialDefaults; } - if (this.displayThumb) { - if (this.isVertical) { - this._tempMeasure.copyFromFloats(left - this._effectiveBarOffset, this._currentMeasure.top + thumbPosition, this._currentMeasure.width, this._effectiveThumbThickness); - } else { - this._tempMeasure.copyFromFloats(this._currentMeasure.left + thumbPosition, this._currentMeasure.top, this._effectiveThumbThickness, this._currentMeasure.height); - } - this._thumbImage._currentMeasure.copyFrom(this._tempMeasure); - this._thumbImage._draw(context); + }, + GreasedLineBaseMesh: () => { + { + return GreasedLineBaseMesh; } - context.restore(); - } - serialize(serializationObject) { - super.serialize(serializationObject); - const backgroundImage = {}; - const thumbImage = {}; - const valueBarImage = {}; - this.backgroundImage.serialize(backgroundImage); - this.thumbImage.serialize(thumbImage); - this.valueBarImage.serialize(valueBarImage); - serializationObject.backgroundImage = backgroundImage; - serializationObject.thumbImage = thumbImage; - serializationObject.valueBarImage = valueBarImage; - } - _parseFromContent(serializedObject, host) { - super._parseFromContent(serializedObject, host); - this.backgroundImage = Image2.Parse(serializedObject.backgroundImage, host); - this.thumbImage = Image2.Parse(serializedObject.thumbImage, host); - this.valueBarImage = Image2.Parse(serializedObject.valueBarImage, host); - } -} -__decorate2([ - serialize() -], ImageBasedSlider.prototype, "displayThumb", null); -RegisterClass("BABYLON.GUI.ImageBasedSlider", ImageBasedSlider); -// node_modules/@babylonjs/gui/2D/controls/statics.js -Control.AddHeader = function(control21, text, size, options) { - const panel = new StackPanel("panel"); - const isHorizontal = options ? options.isHorizontal : true; - const controlFirst = options ? options.controlFirst : true; - panel.isVertical = !isHorizontal; - const header = new TextBlock("header"); - header.text = text; - header.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - if (isHorizontal) { - header.width = size; - } else { - header.height = size; - } - if (controlFirst) { - panel.addControl(control21); - panel.addControl(header); - header.paddingLeft = "5px"; - } else { - panel.addControl(header); - panel.addControl(control21); - header.paddingRight = "5px"; - } - header.shadowBlur = control21.shadowBlur; - header.shadowColor = control21.shadowColor; - header.shadowOffsetX = control21.shadowOffsetX; - header.shadowOffsetY = control21.shadowOffsetY; - return panel; -}; -// node_modules/@babylonjs/gui/2D/controls/gradient/BaseGradient.js -class BaseGradient { - constructor() { - this._colorStops = []; - this._gradientDirty = true; - } - _addColorStopsToCanvasGradient() { - for (const stop of this._colorStops) { - this._canvasGradient.addColorStop(stop.offset, stop.color); + }, + GrainPostProcess: () => { + { + return GrainPostProcess; } - } - getCanvasGradient(context) { - if (this._gradientDirty || this._context !== context) { - this._context = context; - this._canvasGradient = this._createCanvasGradient(context); - this._addColorStopsToCanvasGradient(); - this._gradientDirty = false; + }, + GradientHelper: () => { + { + return GradientHelper; } - return this._canvasGradient; - } - addColorStop(offset, color) { - this._colorStops.push({ offset, color }); - this._gradientDirty = true; - } - removeColorStop(offset) { - this._colorStops = this._colorStops.filter((colorStop) => colorStop.offset !== offset); - this._gradientDirty = true; - } - clearColorStops() { - this._colorStops = []; - this._gradientDirty = true; - } - get colorStops() { - return this._colorStops; - } - getClassName() { - return "BaseGradient"; - } - serialize(serializationObject) { - serializationObject.colorStops = this._colorStops; - serializationObject.className = this.getClassName(); - } - parse(serializationObject) { - this._colorStops = serializationObject.colorStops; - } -} -// node_modules/@babylonjs/gui/2D/controls/gradient/LinearGradient.js -class LinearGradient extends BaseGradient { - constructor(x0, y0, x1, y1) { - super(); - this._x0 = x0 !== null && x0 !== undefined ? x0 : 0; - this._y0 = y0 !== null && y0 !== undefined ? y0 : 0; - this._x1 = x1 !== null && x1 !== undefined ? x1 : 0; - this._y1 = y1 !== null && y1 !== undefined ? y1 : 0; - } - _createCanvasGradient(context) { - return context.createLinearGradient(this._x0, this._y0, this._x1, this._y1); - } - get x0() { - return this._x0; - } - get x1() { - return this._x1; - } - get y0() { - return this._y0; - } - get y1() { - return this._y1; - } - getClassName() { - return "LinearGradient"; - } - serialize(serializationObject) { - super.serialize(serializationObject); - serializationObject.x0 = this._x0; - serializationObject.y0 = this._y0; - serializationObject.x1 = this._x1; - serializationObject.y1 = this._y1; - } - parse(serializationObject) { - super.parse(serializationObject); - this._x0 = serializationObject.x0; - this._y0 = serializationObject.y0; - this._x1 = serializationObject.x1; - this._y1 = serializationObject.y1; - } -} -RegisterClass("BABYLON.GUI.LinearGradient", LinearGradient); -// node_modules/@babylonjs/gui/2D/controls/gradient/RadialGradient.js -class RadialGradient extends BaseGradient { - constructor(x0, y0, r0, x1, y1, r1) { - super(); - this._x0 = x0 !== null && x0 !== undefined ? x0 : 0; - this._y0 = y0 !== null && y0 !== undefined ? y0 : 0; - this._r0 = r0 !== null && r0 !== undefined ? r0 : 0; - this._x1 = x1 !== null && x1 !== undefined ? x1 : 0; - this._y1 = y1 !== null && y1 !== undefined ? y1 : 0; - this._r1 = r1 !== null && r1 !== undefined ? r1 : 0; - } - _createCanvasGradient(context) { - return context.createRadialGradient(this._x0, this._y0, this._r0, this._x1, this._y1, this._r1); - } - get x0() { - return this._x0; - } - get x1() { - return this._x1; - } - get y0() { - return this._y0; - } - get y1() { - return this._y1; - } - get r0() { - return this._r0; - } - get r1() { - return this._r1; - } - getClassName() { - return "RadialGradient"; - } - serialize(serializationObject) { - super.serialize(serializationObject); - serializationObject.x0 = this._x0; - serializationObject.y0 = this._y0; - serializationObject.r0 = this._r0; - serializationObject.x1 = this._x1; - serializationObject.y1 = this._y1; - serializationObject.r1 = this._r1; - } - parse(serializationObject) { - super.parse(serializationObject); - this._x0 = serializationObject.x0; - this._y0 = serializationObject.y0; - this._r0 = serializationObject.r0; - this._x1 = serializationObject.x1; - this._y1 = serializationObject.y1; - this._r1 = serializationObject.r1; - } -} -RegisterClass("BABYLON.GUI.RadialGradient", RadialGradient); -// node_modules/@babylonjs/gui/2D/style.js -class Style { - constructor(host) { - this._fontFamily = "Arial"; - this._fontStyle = ""; - this._fontWeight = ""; - this._fontSize = new ValueAndUnit(18, ValueAndUnit.UNITMODE_PIXEL, false); - this.onChangedObservable = new Observable; - this._host = host; - } - get fontSize() { - return this._fontSize.toString(this._host); - } - set fontSize(value) { - if (this._fontSize.toString(this._host) === value) { - return; + }, + GradientBlockColorStep: () => { + { + return GradientBlockColorStep; } - if (this._fontSize.fromString(value)) { - this.onChangedObservable.notifyObservers(this); + }, + GradientBlock: () => { + { + return GradientBlock; } - } - get fontFamily() { - return this._fontFamily; - } - set fontFamily(value) { - if (this._fontFamily === value) { - return; + }, + GoldbergMesh: () => { + { + return GoldbergMesh; } - this._fontFamily = value; - this.onChangedObservable.notifyObservers(this); - } - get fontStyle() { - return this._fontStyle; - } - set fontStyle(value) { - if (this._fontStyle === value) { - return; + }, + GlowLayer: () => { + { + return GlowLayer; } - this._fontStyle = value; - this.onChangedObservable.notifyObservers(this); - } - get fontWeight() { - return this._fontWeight; - } - set fontWeight(value) { - if (this._fontWeight === value) { - return; + }, + GizmoManager: () => { + { + return GizmoManager; } - this._fontWeight = value; - this.onChangedObservable.notifyObservers(this); - } - dispose() { - this.onChangedObservable.clear(); - } -} - -// node_modules/@babylonjs/gui/2D/advancedDynamicTexture.js -class AdvancedDynamicTexture extends DynamicTexture { - get numLayoutCalls() { - return this._numLayoutCalls; - } - get numRenderCalls() { - return this._numRenderCalls; - } - get renderScale() { - return this._renderScale; - } - set renderScale(value) { - if (value === this._renderScale) { - return; + }, + GizmoCoordinatesMode: () => { + { + return GizmoCoordinatesMode; } - this._renderScale = value; - this._onResize(); - } - get background() { - return this._background; - } - set background(value) { - if (this._background === value) { - return; + }, + GizmoAnchorPoint: () => { + { + return GizmoAnchorPoint; } - this._background = value; - this.markAsDirty(); - } - get idealWidth() { - return this._idealWidth; - } - set idealWidth(value) { - if (this._idealWidth === value) { - return; + }, + Gizmo: () => { + { + return Gizmo; } - this._idealWidth = value; - this.markAsDirty(); - this._rootContainer._markAllAsDirty(); - } - get idealHeight() { - return this._idealHeight; - } - set idealHeight(value) { - if (this._idealHeight === value) { - return; + }, + GetTextureDataAsync: () => { + { + return GetTextureDataAsync; } - this._idealHeight = value; - this.markAsDirty(); - this._rootContainer._markAllAsDirty(); - } - get useSmallestIdeal() { - return this._useSmallestIdeal; - } - set useSmallestIdeal(value) { - if (this._useSmallestIdeal === value) { - return; + }, + GetTGAHeader: () => { + { + return GetTGAHeader; } - this._useSmallestIdeal = value; - this.markAsDirty(); - this._rootContainer._markAllAsDirty(); - } - get renderAtIdealSize() { - return this._renderAtIdealSize; - } - set renderAtIdealSize(value) { - if (this._renderAtIdealSize === value) { - return; + }, + GetInternalFormatFromBasisFormat: () => { + { + return GetInternalFormatFromBasisFormat; } - this._renderAtIdealSize = value; - this._onResize(); - } - get idealRatio() { - let rwidth = 0; - let rheight = 0; - if (this._idealWidth) { - rwidth = this.getSize().width / this._idealWidth; + }, + GetEnvironmentBRDFTexture: () => { + { + return GetEnvironmentBRDFTexture; } - if (this._idealHeight) { - rheight = this.getSize().height / this._idealHeight; + }, + GetEnvInfo: () => { + { + return GetEnvInfo; } - if (this._useSmallestIdeal && this._idealWidth && this._idealHeight) { - return window.innerWidth < window.innerHeight ? rwidth : rheight; + }, + GetDOMTextContent: () => { + { + return GetDOMTextContent; } - if (this._idealWidth) { - return rwidth; + }, + GetClass: () => { + { + return GetClass; } - if (this._idealHeight) { - return rheight; + }, + GeometryTrigonometryBlockOperations: () => { + { + return GeometryTrigonometryBlockOperations; } - return 1; - } - get layer() { - return this._layerToDispose; - } - get rootContainer() { - return this._rootContainer; - } - getChildren() { - return [this._rootContainer]; - } - getDescendants(directDescendantsOnly, predicate) { - return this._rootContainer.getDescendants(directDescendantsOnly, predicate); - } - getControlsByType(typeName) { - return this._rootContainer.getDescendants(false, (control23) => control23.typeName === typeName); - } - getControlByName(name265) { - return this._getControlByKey("name", name265); - } - _getControlByKey(key, value) { - return this._rootContainer.getDescendants().find((control23) => control23[key] === value) || null; - } - get focusedControl() { - return this._focusedControl; - } - set focusedControl(control23) { - if (this._focusedControl == control23) { - return; + }, + GeometryTrigonometryBlock: () => { + { + return GeometryTrigonometryBlock; } - if (this._focusedControl) { - this._focusedControl.onBlur(); + }, + GeometryTransformBlock: () => { + { + return GeometryTransformBlock; } - if (control23) { - control23.onFocus(); + }, + GeometryTextureFetchBlock: () => { + { + return GeometryTextureFetchBlock; } - this._focusedControl = control23; - } - get isForeground() { - if (!this.layer) { - return true; + }, + GeometryTextureBlock: () => { + { + return GeometryTextureBlock; } - return !this.layer.isBackground; - } - set isForeground(value) { - if (!this.layer) { - return; + }, + GeometryOutputBlock: () => { + { + return GeometryOutputBlock; } - if (this.layer.isBackground === !value) { - return; + }, + GeometryOptimizeBlock: () => { + { + return GeometryOptimizeBlock; } - this.layer.isBackground = !value; - } - get clipboardData() { - return this._clipboardData; - } - set clipboardData(value) { - this._clipboardData = value; - } - constructor(name265, width = 0, height = 0, scene37, generateMipMaps = false, samplingMode = Texture.NEAREST_SAMPLINGMODE, invertY = true) { - super(name265, { width, height }, scene37, generateMipMaps, samplingMode, Constants.TEXTUREFORMAT_RGBA, invertY); - this.onGuiReadyObservable = new Observable; - this._isDirty = false; - this._rootContainer = new Container("root"); - this._lastControlOver = {}; - this._lastControlDown = {}; - this._capturingControl = {}; - this._linkedControls = new Array; - this._isFullscreen = false; - this._fullscreenViewport = new Viewport(0, 0, 1, 1); - this._idealWidth = 0; - this._idealHeight = 0; - this._useSmallestIdeal = false; - this._renderAtIdealSize = false; - this._blockNextFocusCheck = false; - this._renderScale = 1; - this._cursorChanged = false; - this._defaultMousePointerId = 0; - this._rootChildrenHaveChanged = false; - this._capturedPointerIds = new Set; - this._numLayoutCalls = 0; - this._numRenderCalls = 0; - this._clipboardData = ""; - this.onClipboardObservable = new Observable; - this.onControlPickedObservable = new Observable; - this.onBeginLayoutObservable = new Observable; - this.onEndLayoutObservable = new Observable; - this.onBeginRenderObservable = new Observable; - this.onEndRenderObservable = new Observable; - this.premulAlpha = false; - this.applyYInversionOnUpdate = true; - this.skipBlockEvents = 0; - this.checkPointerEveryFrame = false; - this._useInvalidateRectOptimization = true; - this._invalidatedRectangle = null; - this._clearMeasure = new Measure(0, 0, 0, 0); - this._onClipboardCopy = (rawEvt) => { - const evt = rawEvt; - const ev = new ClipboardInfo(ClipboardEventTypes.COPY, evt); - this.onClipboardObservable.notifyObservers(ev); - evt.preventDefault(); - }; - this._onClipboardCut = (rawEvt) => { - const evt = rawEvt; - const ev = new ClipboardInfo(ClipboardEventTypes.CUT, evt); - this.onClipboardObservable.notifyObservers(ev); - evt.preventDefault(); - }; - this._onClipboardPaste = (rawEvt) => { - const evt = rawEvt; - const ev = new ClipboardInfo(ClipboardEventTypes.PASTE, evt); - this.onClipboardObservable.notifyObservers(ev); - evt.preventDefault(); - }; - this.parseContent = this.parseSerializedObject; - scene37 = this.getScene(); - if (!scene37 || !this._texture) { - return; + }, + GeometryInputBlock: () => { + { + return GeometryInputBlock; } - this.applyYInversionOnUpdate = invertY; - this._rootElement = scene37.getEngine().getInputElement(); - this._renderObserver = scene37.onBeforeCameraRenderObservable.add((camera32) => this._checkUpdate(camera32)); - this._controlAddedObserver = this._rootContainer.onControlAddedObservable.add((control23) => { - if (control23) { - this._rootChildrenHaveChanged = true; - } - }); - this._controlRemovedObserver = this._rootContainer.onControlRemovedObservable.add((control23) => { - if (control23) { - this._rootChildrenHaveChanged = true; - } - }); - this._preKeyboardObserver = scene37.onPreKeyboardObservable.add((info) => { - if (!this._focusedControl) { - return; - } - if (info.type === KeyboardEventTypes.KEYDOWN) { - this._focusedControl.processKeyboard(info.event); - } - info.skipOnPointerObservable = true; - }); - this._rootContainer._link(this); - this.hasAlpha = true; - if (!width || !height) { - this._resizeObserver = scene37.getEngine().onResizeObservable.add(() => this._onResize()); - this._onResize(); + }, + GeometryInfoBlock: () => { + { + return GeometryInfoBlock; } - this._texture.isReady = true; - } - getClassName() { - return "AdvancedDynamicTexture"; - } - executeOnAllControls(func, container9) { - if (!container9) { - container9 = this._rootContainer; + }, + GeometryElbowBlock: () => { + { + return GeometryElbowBlock; } - func(container9); - for (const child of container9.children) { - if (child.children) { - this.executeOnAllControls(func, child); - continue; - } - func(child); + }, + GeometryCollectionBlock: () => { + { + return GeometryCollectionBlock; } - } - get useInvalidateRectOptimization() { - return this._useInvalidateRectOptimization; - } - set useInvalidateRectOptimization(value) { - this._useInvalidateRectOptimization = value; - } - invalidateRect(invalidMinX, invalidMinY, invalidMaxX, invalidMaxY) { - if (!this._useInvalidateRectOptimization) { - return; + }, + GeometryBufferRendererSceneComponent: () => { + { + return GeometryBufferRendererSceneComponent; } - if (!this._invalidatedRectangle) { - this._invalidatedRectangle = new Measure(invalidMinX, invalidMinY, invalidMaxX - invalidMinX + 1, invalidMaxY - invalidMinY + 1); - } else { - const maxX = Math.ceil(Math.max(this._invalidatedRectangle.left + this._invalidatedRectangle.width - 1, invalidMaxX)); - const maxY = Math.ceil(Math.max(this._invalidatedRectangle.top + this._invalidatedRectangle.height - 1, invalidMaxY)); - this._invalidatedRectangle.left = Math.floor(Math.min(this._invalidatedRectangle.left, invalidMinX)); - this._invalidatedRectangle.top = Math.floor(Math.min(this._invalidatedRectangle.top, invalidMinY)); - this._invalidatedRectangle.width = maxX - this._invalidatedRectangle.left + 1; - this._invalidatedRectangle.height = maxY - this._invalidatedRectangle.top + 1; + }, + GeometryBufferRenderer: () => { + { + return GeometryBufferRenderer; } - } - markAsDirty() { - this._isDirty = true; - } - createStyle() { - return new Style(this); - } - addControl(control23) { - this._rootContainer.addControl(control23); - return this; - } - removeControl(control23) { - this._rootContainer.removeControl(control23); - return this; - } - moveToNonOverlappedPosition(overlapGroup, deltaStep = 1, repelFactor = 1) { - let controlsForGroup; - if (Array.isArray(overlapGroup)) { - controlsForGroup = overlapGroup; - } else { - const descendants = this.getDescendants(true); - controlsForGroup = overlapGroup === undefined ? descendants.filter((c) => c.overlapGroup !== undefined) : descendants.filter((c) => c.overlapGroup === overlapGroup); + }, + Geometry: () => { + { + return Geometry; } - controlsForGroup.forEach((control1) => { - var _a; - let velocity = Vector2.Zero(); - const center = new Vector2(control1.centerX, control1.centerY); - controlsForGroup.forEach((control23) => { - if (control1 !== control23 && AdvancedDynamicTexture._Overlaps(control1, control23)) { - const diff = center.subtract(new Vector2(control23.centerX, control23.centerY)); - const diffLength = diff.length(); - if (diffLength > 0) { - velocity = velocity.add(diff.normalize().scale(repelFactor / diffLength)); - } - } - }); - if (velocity.length() > 0) { - velocity = velocity.normalize().scale(deltaStep * ((_a = control1.overlapDeltaMultiplier) !== null && _a !== undefined ? _a : 1)); - control1.linkOffsetXInPixels += velocity.x; - control1.linkOffsetYInPixels += velocity.y; - } - }); - } - dispose() { - const scene37 = this.getScene(); - if (!scene37) { - return; + }, + GeodesicData: () => { + { + return GeodesicData; } - this._rootElement = null; - scene37.onBeforeCameraRenderObservable.remove(this._renderObserver); - if (this._resizeObserver) { - scene37.getEngine().onResizeObservable.remove(this._resizeObserver); + }, + GenericPad: () => { + { + return GenericPad; } - if (this._prePointerObserver) { - scene37.onPrePointerObservable.remove(this._prePointerObserver); + }, + GenerateBase64StringFromTextureAsync: () => { + { + return GenerateBase64StringFromTextureAsync; } - if (this._sceneRenderObserver) { - scene37.onBeforeRenderObservable.remove(this._sceneRenderObserver); + }, + GenerateBase64StringFromTexture: () => { + { + return GenerateBase64StringFromTexture; } - if (this._pointerObserver) { - scene37.onPointerObservable.remove(this._pointerObserver); + }, + GenerateBase64StringFromPixelData: () => { + { + return GenerateBase64StringFromPixelData; } - if (this._preKeyboardObserver) { - scene37.onPreKeyboardObservable.remove(this._preKeyboardObserver); + }, + GaussianSplatting: () => { + { + return GaussianSplatting; } - if (this._canvasPointerOutObserver) { - scene37.getEngine().onCanvasPointerOutObservable.remove(this._canvasPointerOutObserver); + }, + GamepadSystemSceneComponent: () => { + { + return GamepadSystemSceneComponent; } - if (this._canvasBlurObserver) { - scene37.getEngine().onCanvasBlurObservable.remove(this._canvasBlurObserver); + }, + GamepadManager: () => { + { + return GamepadManager; } - if (this._controlAddedObserver) { - this._rootContainer.onControlAddedObservable.remove(this._controlAddedObserver); + }, + GamepadCamera: () => { + { + return GamepadCamera; } - if (this._controlRemovedObserver) { - this._rootContainer.onControlRemovedObservable.remove(this._controlRemovedObserver); + }, + Gamepad: () => { + { + return Gamepad; } - if (this._layerToDispose) { - this._layerToDispose.texture = null; - this._layerToDispose.dispose(); - this._layerToDispose = null; + }, + GUID: () => { + { + return GUID; } - this._rootContainer.dispose(); - this.onClipboardObservable.clear(); - this.onControlPickedObservable.clear(); - this.onBeginRenderObservable.clear(); - this.onEndRenderObservable.clear(); - this.onBeginLayoutObservable.clear(); - this.onEndLayoutObservable.clear(); - this.onGuiReadyObservable.clear(); - super.dispose(); - } - _onResize() { - const scene37 = this.getScene(); - if (!scene37) { - return; + }, + GPUParticleSystem: () => { + { + return GPUParticleSystem; } - const engine47 = scene37.getEngine(); - const textureSize = this.getSize(); - let renderWidth = engine47.getRenderWidth() * this._renderScale; - let renderHeight = engine47.getRenderHeight() * this._renderScale; - if (this._renderAtIdealSize) { - if (this._idealWidth) { - renderHeight = renderHeight * this._idealWidth / renderWidth; - renderWidth = this._idealWidth; - } else if (this._idealHeight) { - renderWidth = renderWidth * this._idealHeight / renderHeight; - renderHeight = this._idealHeight; - } + }, + FxaaPostProcess: () => { + { + return FxaaPostProcess; } - if (textureSize.width !== renderWidth || textureSize.height !== renderHeight) { - this.scaleTo(renderWidth, renderHeight); - this.markAsDirty(); - if (this._idealWidth || this._idealHeight) { - this._rootContainer._markAllAsDirty(); - } + }, + Frustum: () => { + { + return Frustum; } - this.invalidateRect(0, 0, textureSize.width - 1, textureSize.height - 1); - } - _getGlobalViewport() { - const size = this.getSize(); - const globalViewPort = this._fullscreenViewport.toGlobal(size.width, size.height); - const targetX = Math.round(globalViewPort.width * (1 / this.rootContainer.scaleX)); - const targetY = Math.round(globalViewPort.height * (1 / this.rootContainer.scaleY)); - globalViewPort.x += (globalViewPort.width - targetX) / 2; - globalViewPort.y += (globalViewPort.height - targetY) / 2; - globalViewPort.width = targetX; - globalViewPort.height = targetY; - return globalViewPort; - } - getProjectedPosition(position, worldMatrix) { - const result = this.getProjectedPositionWithZ(position, worldMatrix); - return new Vector2(result.x, result.y); - } - getProjectedPositionWithZ(position, worldMatrix) { - const scene37 = this.getScene(); - if (!scene37) { - return Vector3.Zero(); + }, + FrontFacingBlock: () => { + { + return FrontFacingBlock; } - const globalViewport = this._getGlobalViewport(); - const projectedPosition = Vector3.Project(position, worldMatrix, scene37.getTransformMatrix(), globalViewport); - return new Vector3(projectedPosition.x, projectedPosition.y, projectedPosition.z); - } - _checkUpdate(camera32, skipUpdate) { - if (this._layerToDispose) { - if ((camera32.layerMask & this._layerToDispose.layerMask) === 0) { - return; - } + }, + FrontFace: () => { + { + return FrontFace; } - if (this._isFullscreen && this._linkedControls.length) { - const scene37 = this.getScene(); - if (!scene37) { - return; - } - const globalViewport = this._getGlobalViewport(); - for (const control23 of this._linkedControls) { - if (!control23.isVisible) { - continue; - } - const mesh72 = control23._linkedMesh; - if (!mesh72 || mesh72.isDisposed()) { - Tools.SetImmediate(() => { - control23.linkWithMesh(null); - }); - continue; - } - const position = mesh72.getBoundingInfo ? mesh72.getBoundingInfo().boundingSphere.center : Vector3.ZeroReadOnly; - const projectedPosition = Vector3.Project(position, mesh72.getWorldMatrix(), scene37.getTransformMatrix(), globalViewport); - if (projectedPosition.z < 0 || projectedPosition.z > 1) { - control23.notRenderable = true; - continue; - } - control23.notRenderable = false; - if (this.useInvalidateRectOptimization) { - control23.invalidateRect(); - } - control23._moveToProjectedPosition(projectedPosition); - } + }, + FromHalfFloat: () => { + { + return FromHalfFloat; } - if (!this._isDirty && !this._rootContainer.isDirty) { - return; + }, + FresnelParameters: () => { + { + return FresnelParameters; } - this._isDirty = false; - this._render(skipUpdate); - if (!skipUpdate) { - this.update(this.applyYInversionOnUpdate, this.premulAlpha, AdvancedDynamicTexture.AllowGPUOptimizations); + }, + FresnelBlock: () => { + { + return FresnelBlock; } - } - _render(skipRender) { - var _a; - const textureSize = this.getSize(); - const renderWidth = textureSize.width; - const renderHeight = textureSize.height; - const context = this.getContext(); - context.font = "18px Arial"; - context.strokeStyle = "white"; - if (this.onGuiReadyObservable.hasObservers()) { - this._checkGuiIsReady(); + }, + FreeCameraVirtualJoystickInput: () => { + { + return FreeCameraVirtualJoystickInput; } - if (this._rootChildrenHaveChanged) { - const camera32 = (_a = this.getScene()) === null || _a === undefined ? undefined : _a.activeCamera; - if (camera32) { - this._rootChildrenHaveChanged = false; - this._checkUpdate(camera32, true); - } + }, + FreeCameraTouchInput: () => { + { + return FreeCameraTouchInput; } - this.onBeginLayoutObservable.notifyObservers(this); - const measure8 = new Measure(0, 0, renderWidth, renderHeight); - this._numLayoutCalls = 0; - this._rootContainer._layout(measure8, context); - this.onEndLayoutObservable.notifyObservers(this); - this._isDirty = false; - if (skipRender) { - return; + }, + FreeCameraMouseWheelInput: () => { + { + return FreeCameraMouseWheelInput; } - if (this._invalidatedRectangle) { - this._clearMeasure.copyFrom(this._invalidatedRectangle); - } else { - this._clearMeasure.copyFromFloats(0, 0, renderWidth, renderHeight); + }, + FreeCameraMouseInput: () => { + { + return FreeCameraMouseInput; } - context.clearRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height); - if (this._background) { - context.save(); - context.fillStyle = this._background; - context.fillRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height); - context.restore(); + }, + FreeCameraKeyboardMoveInput: () => { + { + return FreeCameraKeyboardMoveInput; } - this.onBeginRenderObservable.notifyObservers(this); - this._numRenderCalls = 0; - this._rootContainer._render(context, this._invalidatedRectangle); - this.onEndRenderObservable.notifyObservers(this); - this._invalidatedRectangle = null; - } - _changeCursor(cursor) { - if (this._rootElement) { - this._rootElement.style.cursor = cursor; - this._cursorChanged = true; + }, + FreeCameraInputsManager: () => { + { + return FreeCameraInputsManager; } - } - _registerLastControlDown(control23, pointerId) { - this._lastControlDown[pointerId] = control23; - this.onControlPickedObservable.notifyObservers(control23); - } - _doPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) { - const scene37 = this.getScene(); - if (!scene37) { - return; + }, + FreeCameraGamepadInput: () => { + { + return FreeCameraGamepadInput; } - const engine47 = scene37.getEngine(); - const textureSize = this.getSize(); - if (this._isFullscreen) { - const camera32 = scene37.cameraToUseForPointers || scene37.activeCamera; - if (!camera32) { - return; - } - const viewport = camera32.viewport; - x = x * (textureSize.width / (engine47.getRenderWidth() * viewport.width)); - y = y * (textureSize.height / (engine47.getRenderHeight() * viewport.height)); + }, + FreeCameraDeviceOrientationInput: () => { + { + return FreeCameraDeviceOrientationInput; } - if (this._capturingControl[pointerId]) { - if (this._capturingControl[pointerId].isPointerBlocker) { - this._shouldBlockPointer = true; - } - this._capturingControl[pointerId]._processObservables(type, x, y, pi, pointerId, buttonIndex); - return; + }, + FreeCamera: () => { + { + return FreeCamera; } - this._cursorChanged = false; - if (!this._rootContainer._processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY)) { - if (!scene37.doNotHandleCursors) { - this._changeCursor(""); - } - if (type === PointerEventTypes.POINTERMOVE) { - if (this._lastControlOver[pointerId]) { - this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], pi); - delete this._lastControlOver[pointerId]; - } - } + }, + FramingBehavior: () => { + { + return FramingBehavior; } - if (!this._cursorChanged && !scene37.doNotHandleCursors) { - this._changeCursor(""); + }, + FragmentOutputBlock: () => { + { + return FragmentOutputBlock; } - this._manageFocus(); - } - _cleanControlAfterRemovalFromList(list, control23) { - for (const pointerId in list) { - if (!Object.prototype.hasOwnProperty.call(list, pointerId)) { - continue; - } - const lastControlOver = list[pointerId]; - if (lastControlOver === control23) { - delete list[pointerId]; - } + }, + FragDepthBlock: () => { + { + return FragDepthBlock; } - } - _cleanControlAfterRemoval(control23) { - this._cleanControlAfterRemovalFromList(this._lastControlDown, control23); - this._cleanControlAfterRemovalFromList(this._lastControlOver, control23); - } - pick(x, y, pi = null) { - if (this._isFullscreen && this._scene) { - this._translateToPicking(this._scene, new Viewport(0, 0, 0, 0), pi, x, y); + }, + FragCoordBlock: () => { + { + return FragCoordBlock; } - } - _translateToPicking(scene37, tempViewport, pi, x = scene37.pointerX, y = scene37.pointerY) { - const camera32 = scene37.cameraToUseForPointers || scene37.activeCamera; - const engine47 = scene37.getEngine(); - const originalCameraToUseForPointers = scene37.cameraToUseForPointers; - if (!camera32) { - tempViewport.x = 0; - tempViewport.y = 0; - tempViewport.width = engine47.getRenderWidth(); - tempViewport.height = engine47.getRenderHeight(); - } else { - if (camera32.rigCameras.length) { - const rigViewport = new Viewport(0, 0, 1, 1); - camera32.rigCameras.forEach((rigCamera) => { - rigCamera.viewport.toGlobalToRef(engine47.getRenderWidth(), engine47.getRenderHeight(), rigViewport); - const transformedX2 = x / engine47.getHardwareScalingLevel() - rigViewport.x; - const transformedY2 = y / engine47.getHardwareScalingLevel() - (engine47.getRenderHeight() - rigViewport.y - rigViewport.height); - if (transformedX2 < 0 || transformedY2 < 0 || x > rigViewport.width || y > rigViewport.height) { - return; - } - scene37.cameraToUseForPointers = rigCamera; - tempViewport.x = rigViewport.x; - tempViewport.y = rigViewport.y; - tempViewport.width = rigViewport.width; - tempViewport.height = rigViewport.height; - }); - } else { - camera32.viewport.toGlobalToRef(engine47.getRenderWidth(), engine47.getRenderHeight(), tempViewport); - } + }, + FollowCameraPointersInput: () => { + { + return FollowCameraPointersInput; } - const transformedX = x / engine47.getHardwareScalingLevel() - tempViewport.x; - const transformedY = y / engine47.getHardwareScalingLevel() - (engine47.getRenderHeight() - tempViewport.y - tempViewport.height); - this._shouldBlockPointer = false; - if (pi) { - const pointerId = pi.event.pointerId || this._defaultMousePointerId; - this._doPicking(transformedX, transformedY, pi, pi.type, pointerId, pi.event.button, pi.event.deltaX, pi.event.deltaY); - if (this._shouldBlockPointer && !(pi.type & this.skipBlockEvents) || this._capturingControl[pointerId]) { - pi.skipOnPointerObservable = true; - } - } else { - this._doPicking(transformedX, transformedY, null, PointerEventTypes.POINTERMOVE, this._defaultMousePointerId, 0); + }, + FollowCameraMouseWheelInput: () => { + { + return FollowCameraMouseWheelInput; } - scene37.cameraToUseForPointers = originalCameraToUseForPointers; - } - attach() { - const scene37 = this.getScene(); - if (!scene37) { - return; + }, + FollowCameraKeyboardMoveInput: () => { + { + return FollowCameraKeyboardMoveInput; } - const tempViewport = new Viewport(0, 0, 0, 0); - this._prePointerObserver = scene37.onPrePointerObservable.add((pi) => { - if (scene37.isPointerCaptured(pi.event.pointerId) && pi.type === PointerEventTypes.POINTERUP && !this._capturedPointerIds.has(pi.event.pointerId)) { - return; - } - if (pi.type !== PointerEventTypes.POINTERMOVE && pi.type !== PointerEventTypes.POINTERUP && pi.type !== PointerEventTypes.POINTERDOWN && pi.type !== PointerEventTypes.POINTERWHEEL) { - return; - } - if (pi.type === PointerEventTypes.POINTERMOVE) { - if (scene37.isPointerCaptured(pi.event.pointerId)) { - return; - } - if (pi.event.pointerId) { - this._defaultMousePointerId = pi.event.pointerId; - } - } - this._translateToPicking(scene37, tempViewport, pi); - }); - this._attachPickingToSceneRender(scene37, () => this._translateToPicking(scene37, tempViewport, null), false); - this._attachToOnPointerOut(scene37); - this._attachToOnBlur(scene37); - } - registerClipboardEvents() { - self.addEventListener("copy", this._onClipboardCopy, false); - self.addEventListener("cut", this._onClipboardCut, false); - self.addEventListener("paste", this._onClipboardPaste, false); - } - unRegisterClipboardEvents() { - self.removeEventListener("copy", this._onClipboardCopy); - self.removeEventListener("cut", this._onClipboardCut); - self.removeEventListener("paste", this._onClipboardPaste); - } - _transformUvs(uv) { - const textureMatrix = this.getTextureMatrix(); - let result; - if (textureMatrix.isIdentityAs3x2()) { - result = uv; - } else { - const homogeneousTextureMatrix = TmpVectors.Matrix[0]; - textureMatrix.getRowToRef(0, TmpVectors.Vector4[0]); - textureMatrix.getRowToRef(1, TmpVectors.Vector4[1]); - textureMatrix.getRowToRef(2, TmpVectors.Vector4[2]); - const r0 = TmpVectors.Vector4[0]; - const r1 = TmpVectors.Vector4[1]; - const r2 = TmpVectors.Vector4[2]; - homogeneousTextureMatrix.setRowFromFloats(0, r0.x, r0.y, 0, 0); - homogeneousTextureMatrix.setRowFromFloats(1, r1.x, r1.y, 0, 0); - homogeneousTextureMatrix.setRowFromFloats(2, 0, 0, 1, 0); - homogeneousTextureMatrix.setRowFromFloats(3, r2.x, r2.y, 0, 1); - result = TmpVectors.Vector2[0]; - Vector2.TransformToRef(uv, homogeneousTextureMatrix, result); + }, + FollowCameraInputsManager: () => { + { + return FollowCameraInputsManager; } - if (this.wrapU === Texture.WRAP_ADDRESSMODE || this.wrapU === Texture.MIRROR_ADDRESSMODE) { - if (result.x > 1) { - let fX = result.x - Math.trunc(result.x); - if (this.wrapU === Texture.MIRROR_ADDRESSMODE && Math.trunc(result.x) % 2 === 1) { - fX = 1 - fX; - } - result.x = fX; - } + }, + FollowCamera: () => { + { + return FollowCamera; } - if (this.wrapV === Texture.WRAP_ADDRESSMODE || this.wrapV === Texture.MIRROR_ADDRESSMODE) { - if (result.y > 1) { - let fY = result.y - Math.trunc(result.y); - if (this.wrapV === Texture.MIRROR_ADDRESSMODE && Math.trunc(result.x) % 2 === 1) { - fY = 1 - fY; - } - result.y = fY; - } + }, + FollowBehavior: () => { + { + return FollowBehavior; } - return result; - } - attachToMesh(mesh72, supportPointerMove = true) { - const scene37 = this.getScene(); - if (!scene37) { - return; + }, + FogBlock: () => { + { + return FogBlock; } - if (this._pointerObserver) { - scene37.onPointerObservable.remove(this._pointerObserver); + }, + FlyCameraMouseInput: () => { + { + return FlyCameraMouseInput; } - this._pointerObserver = scene37.onPointerObservable.add((pi) => { - if (pi.type !== PointerEventTypes.POINTERMOVE && pi.type !== PointerEventTypes.POINTERUP && pi.type !== PointerEventTypes.POINTERDOWN && pi.type !== PointerEventTypes.POINTERWHEEL) { - return; - } - if (pi.type === PointerEventTypes.POINTERMOVE && pi.event.pointerId) { - this._defaultMousePointerId = pi.event.pointerId; - } - const pointerId = pi.event.pointerId || this._defaultMousePointerId; - if (pi.pickInfo && pi.pickInfo.hit && pi.pickInfo.pickedMesh === mesh72) { - let uv = pi.pickInfo.getTextureCoordinates(); - if (uv) { - uv = this._transformUvs(uv); - const size = this.getSize(); - this._doPicking(uv.x * size.width, (this.applyYInversionOnUpdate ? 1 - uv.y : uv.y) * size.height, pi, pi.type, pointerId, pi.event.button, pi.event.deltaX, pi.event.deltaY); - } - } else if (pi.type === PointerEventTypes.POINTERUP) { - if (this._lastControlDown[pointerId]) { - this._lastControlDown[pointerId]._forcePointerUp(pointerId); - } - delete this._lastControlDown[pointerId]; - if (this.focusedControl) { - const friendlyControls = this.focusedControl.keepsFocusWith(); - let canMoveFocus = true; - if (friendlyControls) { - for (const control23 of friendlyControls) { - if (this === control23._host) { - continue; - } - const otherHost = control23._host; - if (otherHost._lastControlOver[pointerId] && otherHost._lastControlOver[pointerId].isAscendant(control23)) { - canMoveFocus = false; - break; - } - } - } - if (canMoveFocus) { - this.focusedControl = null; - } - } - } else if (pi.type === PointerEventTypes.POINTERMOVE) { - if (this._lastControlOver[pointerId]) { - this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], pi, true); - } - delete this._lastControlOver[pointerId]; - } - }); - mesh72.enablePointerMoveEvents = supportPointerMove; - this._attachPickingToSceneRender(scene37, () => { - const pointerId = this._defaultMousePointerId; - const pick = scene37 === null || scene37 === undefined ? undefined : scene37.pick(scene37.pointerX, scene37.pointerY); - if (pick && pick.hit && pick.pickedMesh === mesh72) { - let uv = pick.getTextureCoordinates(); - if (uv) { - uv = this._transformUvs(uv); - const size = this.getSize(); - this._doPicking(uv.x * size.width, (this.applyYInversionOnUpdate ? 1 - uv.y : uv.y) * size.height, null, PointerEventTypes.POINTERMOVE, pointerId, 0); - } - } else { - if (this._lastControlOver[pointerId]) { - this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], null, true); - } - delete this._lastControlOver[pointerId]; - } - }, true); - this._attachToOnPointerOut(scene37); - this._attachToOnBlur(scene37); - } - moveFocusToControl(control23) { - this.focusedControl = control23; - this._lastPickedControl = control23; - this._blockNextFocusCheck = true; - } - _manageFocus() { - if (this._blockNextFocusCheck) { - this._blockNextFocusCheck = false; - this._lastPickedControl = this._focusedControl; - return; + }, + FlyCameraKeyboardInput: () => { + { + return FlyCameraKeyboardInput; } - if (this._focusedControl) { - if (this._focusedControl !== this._lastPickedControl) { - if (this._lastPickedControl.isFocusInvisible) { - return; - } - this.focusedControl = null; - } + }, + FlyCameraInputsManager: () => { + { + return FlyCameraInputsManager; } - } - _attachPickingToSceneRender(scene37, pickFunction, forcePicking) { - this._sceneRenderObserver = scene37.onBeforeRenderObservable.add(() => { - if (!this.checkPointerEveryFrame) { - return; - } - if (this._linkedControls.length > 0 || forcePicking) { - pickFunction(); - } - }); - } - _attachToOnPointerOut(scene37) { - this._canvasPointerOutObserver = scene37.getEngine().onCanvasPointerOutObservable.add((pointerEvent) => { - if (this._lastControlOver[pointerEvent.pointerId]) { - this._lastControlOver[pointerEvent.pointerId]._onPointerOut(this._lastControlOver[pointerEvent.pointerId], null); - } - delete this._lastControlOver[pointerEvent.pointerId]; - if (this._lastControlDown[pointerEvent.pointerId] && this._lastControlDown[pointerEvent.pointerId] !== this._capturingControl[pointerEvent.pointerId]) { - this._lastControlDown[pointerEvent.pointerId]._forcePointerUp(pointerEvent.pointerId); - delete this._lastControlDown[pointerEvent.pointerId]; - } - }); - } - _attachToOnBlur(scene37) { - this._canvasBlurObserver = scene37.getEngine().onCanvasBlurObservable.add(() => { - Object.entries(this._lastControlDown).forEach(([, value]) => { - value._onCanvasBlur(); - }); - this.focusedControl = null; - this._lastControlDown = {}; - }); - } - serializeContent() { - const size = this.getSize(); - const serializationObject = { - root: {}, - width: size.width, - height: size.height - }; - this._rootContainer.serialize(serializationObject.root); - return serializationObject; - } - parseSerializedObject(serializedObject, scaleToSize) { - this._rootContainer = Control.Parse(serializedObject.root, this); - if (scaleToSize) { - const width = serializedObject.width; - const height = serializedObject.height; - if (typeof width === "number" && typeof height === "number" && width >= 0 && height >= 0) { - this.scaleTo(width, height); - } else { - this.scaleTo(1920, 1080); - } + }, + FlyCamera: () => { + { + return FlyCamera; } - } - clone(newName) { - const scene37 = this.getScene(); - if (!scene37) { - return this; + }, + FluidRenderingTargetRenderer: () => { + { + return FluidRenderingTargetRenderer; } - const size = this.getSize(); - const data = this.serializeContent(); - const clone = new AdvancedDynamicTexture(newName !== null && newName !== undefined ? newName : "Clone of " + this.name, size.width, size.height, scene37, !this.noMipmap, this.samplingMode); - clone.parseSerializedObject(data); - return clone; - } - static async ParseFromSnippetAsync(snippetId, scaleToSize, appendToAdt) { - const adt = appendToAdt !== null && appendToAdt !== undefined ? appendToAdt : AdvancedDynamicTexture.CreateFullscreenUI("ADT from snippet"); - if (snippetId === "_BLANK") { - return adt; + }, + FluidRenderingObjectParticleSystem: () => { + { + return FluidRenderingObjectParticleSystem; } - const serialized = await AdvancedDynamicTexture._LoadURLContentAsync(AdvancedDynamicTexture.SnippetUrl + "/" + snippetId.replace(/#/g, "/"), true); - adt.parseSerializedObject(serialized, scaleToSize); - return adt; - } - parseFromSnippetAsync(snippetId, scaleToSize) { - return AdvancedDynamicTexture.ParseFromSnippetAsync(snippetId, scaleToSize, this); - } - static async ParseFromFileAsync(url, scaleToSize, appendToAdt) { - const adt = appendToAdt !== null && appendToAdt !== undefined ? appendToAdt : AdvancedDynamicTexture.CreateFullscreenUI("ADT from URL"); - const serialized = await AdvancedDynamicTexture._LoadURLContentAsync(url); - adt.parseSerializedObject(serialized, scaleToSize); - return adt; - } - parseFromURLAsync(url, scaleToSize) { - return AdvancedDynamicTexture.ParseFromFileAsync(url, scaleToSize, this); - } - static _LoadURLContentAsync(url, snippet = false) { - if (url === "") { - return Promise.reject("No URL provided"); + }, + FluidRenderingObjectCustomParticles: () => { + { + return FluidRenderingObjectCustomParticles; } - return new Promise((resolve, reject) => { - const request = new WebRequest; - request.addEventListener("readystatechange", () => { - if (request.readyState == 4) { - if (request.status == 200) { - let gui; - if (snippet) { - const payload = JSON.parse(JSON.parse(request.responseText).jsonPayload); - gui = payload.encodedGui ? new TextDecoder("utf-8").decode(DecodeBase64ToBinary(payload.encodedGui)) : payload.gui; - } else { - gui = request.responseText; - } - const serializationObject = JSON.parse(gui); - resolve(serializationObject); - } else { - reject("Unable to load"); - } - } - }); - request.open("GET", url); - request.send(); - }); - } - static _Overlaps(control1, control23) { - return !(control1.centerX > control23.centerX + control23.widthInPixels || control1.centerX + control1.widthInPixels < control23.centerX || control1.centerY + control1.heightInPixels < control23.centerY || control1.centerY > control23.centerY + control23.heightInPixels); - } - static CreateForMesh(mesh72, width = 1024, height = 1024, supportPointerMove = true, onlyAlphaTesting = false, invertY, materialSetupCallback = this._CreateMaterial) { - const uniqueId = RandomGUID(); - const result = new AdvancedDynamicTexture(`AdvancedDynamicTexture for ${mesh72.name} [${uniqueId}]`, width, height, mesh72.getScene(), true, Texture.TRILINEAR_SAMPLINGMODE, invertY); - materialSetupCallback(mesh72, uniqueId, result, onlyAlphaTesting); - result.attachToMesh(mesh72, supportPointerMove); - return result; - } - static _CreateMaterial(mesh72, uniqueId, texture77, onlyAlphaTesting) { - const internalClassType = GetClass("BABYLON.StandardMaterial"); - if (!internalClassType) { - throw "StandardMaterial needs to be imported before as it contains a side-effect required by your code."; + }, + FluidRenderingObject: () => { + { + return FluidRenderingObject; } - const material27 = new internalClassType(`AdvancedDynamicTextureMaterial for ${mesh72.name} [${uniqueId}]`, mesh72.getScene()); - material27.backFaceCulling = false; - material27.diffuseColor = Color3.Black(); - material27.specularColor = Color3.Black(); - if (onlyAlphaTesting) { - material27.diffuseTexture = texture77; - material27.emissiveTexture = texture77; - texture77.hasAlpha = true; - } else { - material27.emissiveTexture = texture77; - material27.opacityTexture = texture77; + }, + FluidRenderingDebug: () => { + { + return FluidRenderingDebug; } - mesh72.material = material27; - } - static CreateForMeshTexture(mesh72, width = 1024, height = 1024, supportPointerMove = true, invertY) { - const result = new AdvancedDynamicTexture(mesh72.name + " AdvancedDynamicTexture", width, height, mesh72.getScene(), true, Texture.TRILINEAR_SAMPLINGMODE, invertY); - result.attachToMesh(mesh72, supportPointerMove); - return result; - } - static CreateFullscreenUI(name265, foreground = true, scene37 = null, sampling = Texture.BILINEAR_SAMPLINGMODE, adaptiveScaling = false) { - const result = new AdvancedDynamicTexture(name265, 0, 0, scene37, false, sampling); - const resultScene = result.getScene(); - const layer3 = new Layer(name265 + "_layer", null, resultScene, !foreground); - layer3.texture = result; - result._layerToDispose = layer3; - result._isFullscreen = true; - if (adaptiveScaling && resultScene) { - const newScale = 1 / resultScene.getEngine().getHardwareScalingLevel(); - result._rootContainer.scaleX = newScale; - result._rootContainer.scaleY = newScale; + }, + FluidRendererSceneComponent: () => { + { + return FluidRendererSceneComponent; } - result.attach(); - return result; - } - scale(ratio) { - super.scale(ratio); - this.markAsDirty(); - } - scaleTo(width, height) { - super.scaleTo(width, height); - this.markAsDirty(); - } - _checkGuiIsReady() { - if (this.guiIsReady()) { - this.onGuiReadyObservable.notifyObservers(this); - this.onGuiReadyObservable.clear(); + }, + FluidRenderer: () => { + { + return FluidRenderer; } - } - guiIsReady() { - return this._rootContainer.isReady(); - } -} -AdvancedDynamicTexture.SnippetUrl = Constants.SnippetUrl; -AdvancedDynamicTexture.AllowGPUOptimizations = true; -// node_modules/@babylonjs/gui/3D/vector3WithInfo.js -class Vector3WithInfo extends Vector3 { - constructor(source, buttonIndex = 0) { - super(source.x, source.y, source.z); - this.buttonIndex = buttonIndex; - } -} - -// node_modules/@babylonjs/gui/3D/controls/control3D.js -class Control3D { - get position() { - if (!this._node) { - return Vector3.Zero(); + }, + FlowGraphWhileLoopBlock: () => { + { + return FlowGraphWhileLoopBlock; } - return this._node.position; - } - set position(value) { - if (!this._node) { - return; + }, + FlowGraphWaitAllBlock: () => { + { + return FlowGraphWaitAllBlock; } - this._node.position = value; - } - get scaling() { - if (!this._node) { - return new Vector3(1, 1, 1); + }, + FlowGraphTruncBlock: () => { + { + return FlowGraphTruncBlock; } - return this._node.scaling; - } - set scaling(value) { - if (!this._node) { - return; + }, + FlowGraphTimerBlock: () => { + { + return FlowGraphTimerBlock; } - this._isScaledByManager = false; - this._node.scaling = value; - } - get behaviors() { - return this._behaviors; - } - addBehavior(behavior2) { - const index = this._behaviors.indexOf(behavior2); - if (index !== -1) { - return this; + }, + FlowGraphThrottleBlock: () => { + { + return FlowGraphThrottleBlock; } - behavior2.init(); - const scene37 = this._host.scene; - if (scene37.isLoading) { - scene37.onDataLoadedObservable.addOnce(() => { - behavior2.attach(this); - }); - } else { - behavior2.attach(this); + }, + FlowGraphTanhBlock: () => { + { + return FlowGraphTanhBlock; } - this._behaviors.push(behavior2); - return this; - } - removeBehavior(behavior2) { - const index = this._behaviors.indexOf(behavior2); - if (index === -1) { - return this; + }, + FlowGraphTanBlock: () => { + { + return FlowGraphTanBlock; } - this._behaviors[index].detach(); - this._behaviors.splice(index, 1); - return this; - } - getBehaviorByName(name265) { - for (const behavior2 of this._behaviors) { - if (behavior2.name === name265) { - return behavior2; - } + }, + FlowGraphSwitchBlock: () => { + { + return FlowGraphSwitchBlock; } - return null; - } - get isVisible() { - return this._isVisible; - } - set isVisible(value) { - if (this._isVisible === value) { - return; + }, + FlowGraphSubtractBlock: () => { + { + return FlowGraphSubtractBlock; } - this._isVisible = value; - const mesh72 = this.mesh; - if (mesh72) { - mesh72.setEnabled(value); + }, + FlowGraphStopAnimationBlock: () => { + { + return FlowGraphStopAnimationBlock; } - } - constructor(name265) { - this.name = name265; - this._downCount = 0; - this._enterCount = -1; - this._downPointerIds = {}; - this._isVisible = true; - this._isScaledByManager = false; - this.onPointerMoveObservable = new Observable; - this.onPointerOutObservable = new Observable; - this.onPointerDownObservable = new Observable; - this.onPointerUpObservable = new Observable; - this.onPointerClickObservable = new Observable; - this.onPointerEnterObservable = new Observable; - this._behaviors = new Array; - } - get typeName() { - return this._getTypeName(); - } - getClassName() { - return this._getTypeName(); - } - _getTypeName() { - return "Control3D"; - } - get node() { - return this._node; - } - get mesh() { - if (this._node instanceof AbstractMesh) { - return this._node; + }, + FlowGraphState: () => { + { + return FlowGraphState; } - return null; - } - linkToTransformNode(node30) { - if (this._node) { - this._node.parent = node30; + }, + FlowGraphSqrtBlock: () => { + { + return FlowGraphSqrtBlock; } - return this; - } - _prepareNode(scene37) { - if (!this._node) { - this._node = this._createNode(scene37); - if (!this.node) { - return; - } - this._injectGUI3DReservedDataStore(this.node).control = this; - const mesh72 = this.mesh; - if (mesh72) { - mesh72.isPickable = true; - this._affectMaterial(mesh72); - } + }, + FlowGraphSinhBlock: () => { + { + return FlowGraphSinhBlock; } - } - _injectGUI3DReservedDataStore(node30) { - var _a, _b; - node30.reservedDataStore = (_a = node30.reservedDataStore) !== null && _a !== undefined ? _a : {}; - node30.reservedDataStore.GUI3D = (_b = node30.reservedDataStore.GUI3D) !== null && _b !== undefined ? _b : {}; - return node30.reservedDataStore.GUI3D; - } - _createNode(scene37) { - return null; - } - _affectMaterial(mesh72) { - mesh72.material = null; - } - _isTouchButton3D(control23) { - return control23._generatePointerEventType !== undefined; - } - _onPointerMove(target, coordinates) { - this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this); - } - _onPointerEnter(target) { - if (this._enterCount === -1) { - this._enterCount = 0; + }, + FlowGraphSinBlock: () => { + { + return FlowGraphSinBlock; } - this._enterCount++; - if (this._enterCount > 1) { - return false; + }, + FlowGraphSignalConnection: () => { + { + return FlowGraphSignalConnection; } - this.onPointerEnterObservable.notifyObservers(this, -1, target, this); - if (this.pointerEnterAnimation) { - this.pointerEnterAnimation(); + }, + FlowGraphSignBlock: () => { + { + return FlowGraphSignBlock; } - return true; - } - _onPointerOut(target) { - this._enterCount--; - if (this._enterCount > 0) { - return; + }, + FlowGraphSetVariableBlock: () => { + { + return FlowGraphSetVariableBlock; } - this._enterCount = 0; - this.onPointerOutObservable.notifyObservers(this, -1, target, this); - if (this.pointerOutAnimation) { - this.pointerOutAnimation(); + }, + FlowGraphSetPropertyBlock: () => { + { + return FlowGraphSetPropertyBlock; } - } - _onPointerDown(target, coordinates, pointerId, buttonIndex) { - this._downCount++; - this._downPointerIds[pointerId] = this._downPointerIds[pointerId] + 1 || 1; - if (this._downCount !== 1) { - return false; + }, + FlowGraphSequenceBlock: () => { + { + return FlowGraphSequenceBlock; } - this.onPointerDownObservable.notifyObservers(new Vector3WithInfo(coordinates, buttonIndex), -1, target, this); - if (this.pointerDownAnimation) { - this.pointerDownAnimation(); + }, + FlowGraphSendCustomEventBlock: () => { + { + return FlowGraphSendCustomEventBlock; } - return true; - } - _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick) { - this._downCount--; - this._downPointerIds[pointerId]--; - if (this._downPointerIds[pointerId] <= 0) { - delete this._downPointerIds[pointerId]; + }, + FlowGraphSceneTickEventBlock: () => { + { + return FlowGraphSceneTickEventBlock; } - if (this._downCount < 0) { - this._downCount = 0; - return; + }, + FlowGraphSceneReadyEventBlock: () => { + { + return FlowGraphSceneReadyEventBlock; } - if (this._downCount == 0) { - if (notifyClick && (this._enterCount > 0 || this._enterCount === -1)) { - this.onPointerClickObservable.notifyObservers(new Vector3WithInfo(coordinates, buttonIndex), -1, target, this); - } - this.onPointerUpObservable.notifyObservers(new Vector3WithInfo(coordinates, buttonIndex), -1, target, this); - if (this.pointerUpAnimation) { - this.pointerUpAnimation(); - } + }, + FlowGraphSaturateBlock: () => { + { + return FlowGraphSaturateBlock; } - } - forcePointerUp(pointerId = null) { - if (pointerId !== null) { - this._onPointerUp(this, Vector3.Zero(), pointerId, 0, true); - } else { - for (const key in this._downPointerIds) { - this._onPointerUp(this, Vector3.Zero(), +key, 0, true); - } - if (this._downCount > 0) { - this._downCount = 1; - this._onPointerUp(this, Vector3.Zero(), 0, 0, true); - } + }, + FlowGraphRotate3DBlock: () => { + { + return FlowGraphRotate3DBlock; } - } - _processObservables(type, pickedPoint, originMeshPosition, pointerId, buttonIndex) { - if (this._isTouchButton3D(this) && originMeshPosition) { - type = this._generatePointerEventType(type, originMeshPosition, this._downCount); + }, + FlowGraphRotate2DBlock: () => { + { + return FlowGraphRotate2DBlock; } - if (type === PointerEventTypes.POINTERMOVE) { - this._onPointerMove(this, pickedPoint); - const previousControlOver = this._host._lastControlOver[pointerId]; - if (previousControlOver && previousControlOver !== this) { - previousControlOver._onPointerOut(this); - } - if (previousControlOver !== this) { - this._onPointerEnter(this); - } - this._host._lastControlOver[pointerId] = this; - return true; + }, + FlowGraphRemainderBlock: () => { + { + return FlowGraphRemainderBlock; } - if (type === PointerEventTypes.POINTERDOWN) { - this._onPointerDown(this, pickedPoint, pointerId, buttonIndex); - this._host._lastControlDown[pointerId] = this; - this._host._lastPickedControl = this; - return true; + }, + FlowGraphReceiveCustomEventBlock: () => { + { + return FlowGraphReceiveCustomEventBlock; } - if (type === PointerEventTypes.POINTERUP || type === PointerEventTypes.POINTERDOUBLETAP) { - if (this._host._lastControlDown[pointerId]) { - this._host._lastControlDown[pointerId]._onPointerUp(this, pickedPoint, pointerId, buttonIndex, true); - } - delete this._host._lastControlDown[pointerId]; - return true; + }, + FlowGraphRandomBlock: () => { + { + return FlowGraphRandomBlock; } - return false; - } - _disposeNode() { - if (this._node) { - this._node.dispose(); - this._node = null; + }, + FlowGraphRadToDegBlock: () => { + { + return FlowGraphRadToDegBlock; } - } - dispose() { - this.onPointerDownObservable.clear(); - this.onPointerEnterObservable.clear(); - this.onPointerMoveObservable.clear(); - this.onPointerOutObservable.clear(); - this.onPointerUpObservable.clear(); - this.onPointerClickObservable.clear(); - this._disposeNode(); - for (const behavior2 of this._behaviors) { - behavior2.detach(); + }, + FlowGraphPowBlock: () => { + { + return FlowGraphPowBlock; } - } -} - -// node_modules/@babylonjs/gui/3D/controls/contentDisplay3D.js -class ContentDisplay3D extends Control3D { - constructor() { - super(...arguments); - this._contentResolution = 512; - this._contentScaleRatio = 2; - } - get content() { - return this._content; - } - set content(value) { - this._content = value; - if (!value || !this._host || !this._host.utilityLayer) { - return; + }, + FlowGraphPlayAnimationBlock: () => { + { + return FlowGraphPlayAnimationBlock; } - if (!this._facadeTexture) { - this._facadeTexture = new AdvancedDynamicTexture("Facade", this._contentResolution, this._contentResolution, this._host.utilityLayer.utilityLayerScene, true, Texture.TRILINEAR_SAMPLINGMODE); - this._setFacadeTextureScaling(); - this._facadeTexture.premulAlpha = true; - } else { - this._facadeTexture.rootContainer.clearControls(); + }, + FlowGraphPiBlock: () => { + { + return FlowGraphPiBlock; } - this._facadeTexture.addControl(value); - this._applyFacade(this._facadeTexture); - } - _setFacadeTextureScaling() { - var _a; - if (this._facadeTexture) { - this._facadeTexture.rootContainer.scaleX = this._contentScaleRatio; - this._facadeTexture.rootContainer.scaleY = (_a = this._contentScaleRatioY) !== null && _a !== undefined ? _a : this._contentScaleRatio; + }, + FlowGraphPauseAnimationBlock: () => { + { + return FlowGraphPauseAnimationBlock; } - } - get contentResolution() { - return this._contentResolution; - } - set contentResolution(value) { - if (this._contentResolution === value) { - return; + }, + FlowGraphPath: () => { + { + return FlowGraphPath; } - this._contentResolution = value; - this._resetContent(); - } - _disposeFacadeTexture() { - if (this._facadeTexture) { - this._facadeTexture.dispose(); - this._facadeTexture = null; + }, + FlowGraphNormalizeBlock: () => { + { + return FlowGraphNormalizeBlock; } - } - _resetContent() { - this._disposeFacadeTexture(); - this.content = this._content; - } - _applyFacade(facadeTexture) { - } -} - -// node_modules/@babylonjs/gui/3D/controls/abstractButton3D.js -class AbstractButton3D extends ContentDisplay3D { - constructor(name265) { - super(name265); - } - _getTypeName() { - return "AbstractButton3D"; - } - _createNode(scene37) { - return new TransformNode("button" + this.name, scene37); - } -} -// node_modules/@babylonjs/gui/3D/controls/button3D.js -class Button3D extends AbstractButton3D { - constructor(name265, options) { - super(name265); - this._options = { - width: 1, - height: 1, - depth: 0.08, - ...options - }; - this.pointerEnterAnimation = () => { - if (!this.mesh) { - return; - } - this._currentMaterial.emissiveColor = Color3.Red(); - }; - this.pointerOutAnimation = () => { - this._currentMaterial.emissiveColor = Color3.Black(); - }; - this.pointerDownAnimation = () => { - if (!this.mesh) { - return; - } - this.mesh.scaling.scaleInPlace(0.95); - }; - this.pointerUpAnimation = () => { - if (!this.mesh) { - return; - } - this.mesh.scaling.scaleInPlace(1 / 0.95); - }; - } - _applyFacade(facadeTexture) { - this._currentMaterial.emissiveTexture = facadeTexture; - } - _getTypeName() { - return "Button3D"; - } - _createNode(scene37) { - const faceUV = new Array(6); - for (let i = 0;i < 6; i++) { - faceUV[i] = new Vector4(0, 0, 0, 0); + }, + FlowGraphNegBlock: () => { + { + return FlowGraphNegBlock; } - if (scene37.useRightHandedSystem) { - faceUV[0].copyFromFloats(1, 0, 0, 1); - } else { - faceUV[1].copyFromFloats(0, 0, 1, 1); + }, + FlowGraphNaNBlock: () => { + { + return FlowGraphNaNBlock; } - const mesh72 = CreateBox(this.name + "_rootMesh", { - width: this._options.width, - height: this._options.height, - depth: this._options.depth, - faceUV, - wrap: true - }, scene37); - this._contentScaleRatioY = this._contentScaleRatio * this._options.width / this._options.height; - this._setFacadeTextureScaling(); - return mesh72; - } - _affectMaterial(mesh72) { - const material27 = new StandardMaterial(this.name + "Material", mesh72.getScene()); - material27.specularColor = Color3.Black(); - mesh72.material = material27; - this._currentMaterial = material27; - this._resetContent(); - } - dispose() { - super.dispose(); - this._disposeFacadeTexture(); - if (this._currentMaterial) { - this._currentMaterial.dispose(); + }, + FlowGraphMultiplyBlock: () => { + { + return FlowGraphMultiplyBlock; } - } -} -// node_modules/@babylonjs/gui/3D/controls/container3D.js -class Container3D extends Control3D { - get children() { - return this._children; - } - get blockLayout() { - return this._blockLayout; - } - set blockLayout(value) { - if (this._blockLayout === value) { - return; + }, + FlowGraphMultiGateBlock: () => { + { + return FlowGraphMultiGateBlock; } - this._blockLayout = value; - if (!this._blockLayout) { - this._arrangeChildren(); + }, + FlowGraphMinBlock: () => { + { + return FlowGraphMinBlock; } - } - constructor(name265) { - super(name265); - this._blockLayout = false; - this._children = new Array; - } - updateLayout() { - this._arrangeChildren(); - return this; - } - containsControl(control23) { - return this._children.indexOf(control23) !== -1; - } - addControl(control23) { - const index = this._children.indexOf(control23); - if (index !== -1) { - return this; + }, + FlowGraphMeshPickEventBlock: () => { + { + return FlowGraphMeshPickEventBlock; } - control23.parent = this; - control23._host = this._host; - this._children.push(control23); - if (this._host.utilityLayer) { - control23._prepareNode(this._host.utilityLayer.utilityLayerScene); - if (control23.node) { - control23.node.parent = this.node; - } - if (!this.blockLayout) { - this._arrangeChildren(); - } + }, + FlowGraphMaxBlock: () => { + { + return FlowGraphMaxBlock; } - return this; - } - _arrangeChildren() { - } - _createNode(scene37) { - return new TransformNode("ContainerNode", scene37); - } - removeControl(control23) { - const index = this._children.indexOf(control23); - if (index !== -1) { - this._children.splice(index, 1); - control23.parent = null; - control23._disposeNode(); + }, + FlowGraphLogicOrBlock: () => { + { + return FlowGraphLogicOrBlock; } - return this; - } - _getTypeName() { - return "Container3D"; - } - dispose() { - for (const control23 of this._children) { - control23.dispose(); + }, + FlowGraphLogicNotBlock: () => { + { + return FlowGraphLogicNotBlock; } - this._children.length = 0; - super.dispose(); - } -} -Container3D.UNSET_ORIENTATION = 0; -Container3D.FACEORIGIN_ORIENTATION = 1; -Container3D.FACEORIGINREVERSED_ORIENTATION = 2; -Container3D.FACEFORWARD_ORIENTATION = 3; -Container3D.FACEFORWARDREVERSED_ORIENTATION = 4; -// node_modules/@babylonjs/gui/3D/controls/volumeBasedPanel.js -class VolumeBasedPanel extends Container3D { - get orientation() { - return this._orientation; - } - set orientation(value) { - if (this._orientation === value) { - return; + }, + FlowGraphLogicAndBlock: () => { + { + return FlowGraphLogicAndBlock; } - this._orientation = value; - Tools.SetImmediate(() => { - this._arrangeChildren(); - }); - } - get columns() { - return this._columns; - } - set columns(value) { - if (this._columns === value) { - return; + }, + FlowGraphLogBlock: () => { + { + return FlowGraphLogBlock; } - this._columns = value; - this._rowThenColum = true; - Tools.SetImmediate(() => { - this._arrangeChildren(); - }); - } - get rows() { - return this._rows; - } - set rows(value) { - if (this._rows === value) { - return; + }, + FlowGraphLog2Block: () => { + { + return FlowGraphLog2Block; } - this._rows = value; - this._rowThenColum = false; - Tools.SetImmediate(() => { - this._arrangeChildren(); - }); - } - constructor(name265) { - super(name265); - this._columns = 10; - this._rows = 0; - this._rowThenColum = true; - this._orientation = Container3D.FACEORIGIN_ORIENTATION; - this.margin = 0; - } - _arrangeChildren() { - this._cellWidth = 0; - this._cellHeight = 0; - let rows = 0; - let columns = 0; - let controlCount = 0; - const currentInverseWorld = Matrix.Invert(this.node.computeWorldMatrix(true)); - for (const child of this._children) { - if (!child.mesh) { - continue; - } - controlCount++; - child.mesh.computeWorldMatrix(true); - const boundingBox5 = child.mesh.getHierarchyBoundingVectors(); - const extendSize = TmpVectors.Vector3[0]; - const diff = TmpVectors.Vector3[1]; - boundingBox5.max.subtractToRef(boundingBox5.min, diff); - diff.scaleInPlace(0.5); - Vector3.TransformNormalToRef(diff, currentInverseWorld, extendSize); - this._cellWidth = Math.max(this._cellWidth, extendSize.x * 2); - this._cellHeight = Math.max(this._cellHeight, extendSize.y * 2); + }, + FlowGraphLog10Block: () => { + { + return FlowGraphLog10Block; } - this._cellWidth += this.margin * 2; - this._cellHeight += this.margin * 2; - if (this._rowThenColum) { - columns = this._columns; - rows = Math.ceil(controlCount / this._columns); - } else { - rows = this._rows; - columns = Math.ceil(controlCount / this._rows); + }, + FlowGraphLessThanOrEqualBlock: () => { + { + return FlowGraphLessThanOrEqualBlock; } - const startOffsetX = columns * 0.5 * this._cellWidth; - const startOffsetY = rows * 0.5 * this._cellHeight; - const nodeGrid = []; - let cellCounter = 0; - if (this._rowThenColum) { - for (let r = 0;r < rows; r++) { - for (let c = 0;c < columns; c++) { - nodeGrid.push(new Vector3(c * this._cellWidth - startOffsetX + this._cellWidth / 2, r * this._cellHeight - startOffsetY + this._cellHeight / 2, 0)); - cellCounter++; - if (cellCounter > controlCount) { - break; - } - } - } - } else { - for (let c = 0;c < columns; c++) { - for (let r = 0;r < rows; r++) { - nodeGrid.push(new Vector3(c * this._cellWidth - startOffsetX + this._cellWidth / 2, r * this._cellHeight - startOffsetY + this._cellHeight / 2, 0)); - cellCounter++; - if (cellCounter > controlCount) { - break; - } - } - } + }, + FlowGraphLessThanBlock: () => { + { + return FlowGraphLessThanBlock; } - cellCounter = 0; - for (const child of this._children) { - if (!child.mesh) { - continue; - } - this._mapGridNode(child, nodeGrid[cellCounter]); - cellCounter++; + }, + FlowGraphLengthBlock: () => { + { + return FlowGraphLengthBlock; } - this._finalProcessing(); - } - _finalProcessing() { - } -} -// node_modules/@babylonjs/gui/3D/materials/fluent/shaders/fluent.vertex.js -var name265 = "fluentVertexShader"; -var shader265 = `precision highp float;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;uniform mat4 world;uniform mat4 viewProjection;varying vec2 vUV; -#ifdef BORDER -varying vec2 scaleInfo;uniform float borderWidth;uniform vec3 scaleFactor; -#endif -#ifdef HOVERLIGHT -varying vec3 worldPosition; -#endif -void main(void) {vUV=uv; -#ifdef BORDER -vec3 scale=scaleFactor;float minScale=min(min(scale.x,scale.y),scale.z);float maxScale=max(max(scale.x,scale.y),scale.z);float minOverMiddleScale=minScale/(scale.x+scale.y+scale.z-minScale-maxScale);float areaYZ=scale.y*scale.z;float areaXZ=scale.x*scale.z;float areaXY=scale.x*scale.y;float scaledBorderWidth=borderWidth; -if (abs(normal.x)==1.0) -{scale.x=scale.y;scale.y=scale.z;if (areaYZ>areaXZ && areaYZ>areaXY) -{scaledBorderWidth*=minOverMiddleScale;}} -else if (abs(normal.y)==1.0) -{scale.x=scale.z;if (areaXZ>areaXY && areaXZ>areaYZ) -{scaledBorderWidth*=minOverMiddleScale;}} -else -{if (areaXY>areaYZ && areaXY>areaXZ) -{scaledBorderWidth*=minOverMiddleScale;}} -float scaleRatio=min(scale.x,scale.y)/max(scale.x,scale.y);if (scale.x>scale.y) -{scaleInfo.x=1.0-(scaledBorderWidth*scaleRatio);scaleInfo.y=1.0-scaledBorderWidth;} -else -{scaleInfo.x=1.0-scaledBorderWidth;scaleInfo.y=1.0-(scaledBorderWidth*scaleRatio);} -#endif -vec4 worldPos=world*vec4(position,1.0); -#ifdef HOVERLIGHT -worldPosition=worldPos.xyz; -#endif -gl_Position=viewProjection*worldPos;} -`; -ShaderStore.ShadersStore[name265] = shader265; - -// node_modules/@babylonjs/gui/3D/materials/fluent/shaders/fluent.fragment.js -var name266 = "fluentPixelShader"; -var shader266 = `precision highp float;varying vec2 vUV;uniform vec4 albedoColor; -#ifdef INNERGLOW -uniform vec4 innerGlowColor; -#endif -#ifdef BORDER -varying vec2 scaleInfo;uniform float edgeSmoothingValue;uniform float borderMinValue; -#endif -#ifdef HOVERLIGHT -varying vec3 worldPosition;uniform vec3 hoverPosition;uniform vec4 hoverColor;uniform float hoverRadius; -#endif -#ifdef TEXTURE -uniform sampler2D albedoSampler;uniform mat4 textureMatrix;vec2 finalUV; -#endif -void main(void) {vec3 albedo=albedoColor.rgb;float alpha=albedoColor.a; -#ifdef TEXTURE -finalUV=vec2(textureMatrix*vec4(vUV,1.0,0.0));albedo=texture2D(albedoSampler,finalUV).rgb; -#endif -#ifdef HOVERLIGHT -float pointToHover=(1.0-clamp(length(hoverPosition-worldPosition)/hoverRadius,0.,1.))*hoverColor.a;albedo=clamp(albedo+hoverColor.rgb*pointToHover,0.,1.); -#else -float pointToHover=1.0; -#endif -#ifdef BORDER -float borderPower=10.0;float inverseBorderPower=1.0/borderPower;vec3 borderColor=albedo*borderPower;vec2 distanceToEdge;distanceToEdge.x=abs(vUV.x-0.5)*2.0;distanceToEdge.y=abs(vUV.y-0.5)*2.0;float borderValue=max(smoothstep(scaleInfo.x-edgeSmoothingValue,scaleInfo.x+edgeSmoothingValue,distanceToEdge.x), -smoothstep(scaleInfo.y-edgeSmoothingValue,scaleInfo.y+edgeSmoothingValue,distanceToEdge.y));borderColor=borderColor*borderValue*max(borderMinValue*inverseBorderPower,pointToHover); -albedo+=borderColor;alpha=max(alpha,borderValue); -#endif -#ifdef INNERGLOW -vec2 uvGlow=(vUV-vec2(0.5,0.5))*(innerGlowColor.a*2.0);uvGlow=uvGlow*uvGlow;uvGlow=uvGlow*uvGlow;albedo+=mix(vec3(0.0,0.0,0.0),innerGlowColor.rgb,uvGlow.x+uvGlow.y); -#endif -gl_FragColor=vec4(albedo,alpha);}`; -ShaderStore.ShadersStore[name266] = shader266; - -// node_modules/@babylonjs/gui/3D/materials/fluent/fluentMaterial.js -class FluentMaterialDefines extends MaterialDefines { - constructor() { - super(); - this.INNERGLOW = false; - this.BORDER = false; - this.HOVERLIGHT = false; - this.TEXTURE = false; - this.rebuild(); - } -} - -class FluentMaterial extends PushMaterial { - constructor(name267, scene37) { - super(name267, scene37); - this.innerGlowColorIntensity = 0.5; - this.innerGlowColor = new Color3(1, 1, 1); - this.albedoColor = new Color3(0.3, 0.35, 0.4); - this.renderBorders = false; - this.borderWidth = 0.5; - this.edgeSmoothingValue = 0.02; - this.borderMinValue = 0.1; - this.renderHoverLight = false; - this.hoverRadius = 0.01; - this.hoverColor = new Color4(0.3, 0.3, 0.3, 1); - this.hoverPosition = Vector3.Zero(); - } - needAlphaBlending() { - return this.alpha !== 1; - } - needAlphaTesting() { - return false; - } - getAlphaTestTexture() { - return null; - } - isReadyForSubMesh(mesh72, subMesh10) { - if (this.isFrozen) { - if (subMesh10.effect && subMesh10.effect._wasPreviouslyReady) { - return true; - } + }, + FlowGraphIsNanBlock: () => { + { + return FlowGraphIsNanBlock; } - if (!subMesh10.materialDefines) { - subMesh10.materialDefines = new FluentMaterialDefines; + }, + FlowGraphIsInfBlock: () => { + { + return FlowGraphIsInfBlock; } - const scene37 = this.getScene(); - const defines = subMesh10.materialDefines; - if (!this.checkReadyOnEveryCall && subMesh10.effect) { - if (defines._renderId === scene37.getRenderId()) { - return true; - } + }, + FlowGraphInterpolateBlock: () => { + { + return FlowGraphInterpolateBlock; } - if (defines._areTexturesDirty) { - defines.INNERGLOW = this.innerGlowColorIntensity > 0; - defines.BORDER = this.renderBorders; - defines.HOVERLIGHT = this.renderHoverLight; - if (this._albedoTexture) { - if (!this._albedoTexture.isReadyOrNotBlocking()) { - return false; - } else { - defines.TEXTURE = true; - } - } else { - defines.TEXTURE = false; - } + }, + FlowGraphInfBlock: () => { + { + return FlowGraphInfBlock; } - const engine47 = scene37.getEngine(); - if (defines.isDirty) { - defines.markAsProcessed(); - scene37.resetCachedMaterial(); - const attribs = [VertexBuffer.PositionKind]; - attribs.push(VertexBuffer.NormalKind); - attribs.push(VertexBuffer.UVKind); - const shaderName = "fluent"; - const uniforms2 = [ - "world", - "viewProjection", - "innerGlowColor", - "albedoColor", - "borderWidth", - "edgeSmoothingValue", - "scaleFactor", - "borderMinValue", - "hoverColor", - "hoverPosition", - "hoverRadius", - "textureMatrix" - ]; - const samplers = ["albedoSampler"]; - const uniformBuffers = []; - MaterialHelper.PrepareUniformsAndSamplersList({ - uniformsNames: uniforms2, - uniformBuffersNames: uniformBuffers, - samplers, - defines, - maxSimultaneousLights: 4 - }); - const join = defines.toString(); - subMesh10.setEffect(scene37.getEngine().createEffect(shaderName, { - attributes: attribs, - uniformsNames: uniforms2, - uniformBuffersNames: uniformBuffers, - samplers, - defines: join, - fallbacks: null, - onCompiled: this.onCompiled, - onError: this.onError, - indexParameters: { maxSimultaneousLights: 4 } - }, engine47), defines, this._materialContext); + }, + FlowGraphGreaterThanOrEqualBlock: () => { + { + return FlowGraphGreaterThanOrEqualBlock; } - if (!subMesh10.effect || !subMesh10.effect.isReady()) { - return false; + }, + FlowGraphGreaterThanBlock: () => { + { + return FlowGraphGreaterThanBlock; } - defines._renderId = scene37.getRenderId(); - subMesh10.effect._wasPreviouslyReady = true; - return true; - } - bindForSubMesh(world, mesh72, subMesh10) { - const scene37 = this.getScene(); - const defines = subMesh10.materialDefines; - if (!defines) { - return; + }, + FlowGraphGetVariableBlock: () => { + { + return FlowGraphGetVariableBlock; } - const effect16 = subMesh10.effect; - if (!effect16) { - return; + }, + FlowGraphGetPropertyBlock: () => { + { + return FlowGraphGetPropertyBlock; } - this._activeEffect = effect16; - this.bindOnlyWorldMatrix(world); - this._activeEffect.setMatrix("viewProjection", scene37.getTransformMatrix()); - if (this._mustRebind(scene37, effect16)) { - this._activeEffect.setColor4("albedoColor", this.albedoColor, this.alpha); - if (defines.INNERGLOW) { - this._activeEffect.setColor4("innerGlowColor", this.innerGlowColor, this.innerGlowColorIntensity); - } - if (defines.BORDER) { - this._activeEffect.setFloat("borderWidth", this.borderWidth); - this._activeEffect.setFloat("edgeSmoothingValue", this.edgeSmoothingValue); - this._activeEffect.setFloat("borderMinValue", this.borderMinValue); - mesh72.getBoundingInfo().boundingBox.extendSize.multiplyToRef(mesh72.scaling, TmpVectors.Vector3[0]); - this._activeEffect.setVector3("scaleFactor", TmpVectors.Vector3[0]); - } - if (defines.HOVERLIGHT) { - this._activeEffect.setDirectColor4("hoverColor", this.hoverColor); - this._activeEffect.setFloat("hoverRadius", this.hoverRadius); - this._activeEffect.setVector3("hoverPosition", this.hoverPosition); - } - if (defines.TEXTURE && this._albedoTexture) { - this._activeEffect.setTexture("albedoSampler", this._albedoTexture); - const matrix = this._albedoTexture.getTextureMatrix(); - this._activeEffect.setMatrix("textureMatrix", matrix); - } + }, + FlowGraphFractBlock: () => { + { + return FlowGraphFractBlock; } - this._afterBind(mesh72, this._activeEffect); - } - getActiveTextures() { - const activeTextures = super.getActiveTextures(); - return activeTextures; - } - hasTexture(texture78) { - if (super.hasTexture(texture78)) { - return true; + }, + FlowGraphForLoopBlock: () => { + { + return FlowGraphForLoopBlock; } - return false; - } - dispose(forceDisposeEffect) { - super.dispose(forceDisposeEffect); - } - clone(name267) { - return SerializationHelper.Clone(() => new FluentMaterial(name267, this.getScene()), this); - } - serialize() { - const serializationObject = super.serialize(); - serializationObject.customType = "BABYLON.GUI.FluentMaterial"; - return serializationObject; - } - getClassName() { - return "FluentMaterial"; - } - static Parse(source, scene37, rootUrl) { - return SerializationHelper.Parse(() => new FluentMaterial(source.name, scene37), source, scene37, rootUrl); - } -} -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], FluentMaterial.prototype, "innerGlowColorIntensity", undefined); -__decorate2([ - serializeAsColor3() -], FluentMaterial.prototype, "innerGlowColor", undefined); -__decorate2([ - serializeAsColor3() -], FluentMaterial.prototype, "albedoColor", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], FluentMaterial.prototype, "renderBorders", undefined); -__decorate2([ - serialize() -], FluentMaterial.prototype, "borderWidth", undefined); -__decorate2([ - serialize() -], FluentMaterial.prototype, "edgeSmoothingValue", undefined); -__decorate2([ - serialize() -], FluentMaterial.prototype, "borderMinValue", undefined); -__decorate2([ - serialize(), - expandToProperty("_markAllSubMeshesAsTexturesDirty") -], FluentMaterial.prototype, "renderHoverLight", undefined); -__decorate2([ - serialize() -], FluentMaterial.prototype, "hoverRadius", undefined); -__decorate2([ - serializeAsColor4() -], FluentMaterial.prototype, "hoverColor", undefined); -__decorate2([ - serializeAsVector3() -], FluentMaterial.prototype, "hoverPosition", undefined); -__decorate2([ - serializeAsTexture("albedoTexture") -], FluentMaterial.prototype, "_albedoTexture", undefined); -__decorate2([ - expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") -], FluentMaterial.prototype, "albedoTexture", undefined); -RegisterClass("BABYLON.GUI.FluentMaterial", FluentMaterial); - -// node_modules/@babylonjs/gui/3D/controls/touchHolographicMenu.js -class TouchHolographicMenu extends VolumeBasedPanel { - get backPlateMargin() { - return this._backPlateMargin; - } - set backPlateMargin(value) { - this._backPlateMargin = value; - if (this._children.length >= 1) { - this.children.forEach((control23) => { - this._updateCurrentMinMax(control23.position); - }); - this._updateMargins(); + }, + FlowGraphFloorBlock: () => { + { + return FlowGraphFloorBlock; } - } - _createNode(scene37) { - const node30 = new Mesh(`menu_${this.name}`, scene37); - this._backPlate = CreateBox("backPlate" + this.name, { size: 1 }, scene37); - this._backPlate.parent = node30; - return node30; - } - _affectMaterial(mesh73) { - this._backPlateMaterial = new FluentMaterial(this.name + "backPlateMaterial", mesh73.getScene()); - this._backPlateMaterial.albedoColor = new Color3(0.08, 0.15, 0.55); - this._backPlateMaterial.renderBorders = true; - this._backPlateMaterial.renderHoverLight = true; - this._pickedPointObserver = this._host.onPickedPointChangedObservable.add((pickedPoint) => { - if (pickedPoint) { - this._backPlateMaterial.hoverPosition = pickedPoint; - this._backPlateMaterial.hoverColor.a = 1; - } else { - this._backPlateMaterial.hoverColor.a = 0; - } - }); - this._backPlate.material = this._backPlateMaterial; - } - _mapGridNode(control23, nodePosition) { - const mesh73 = control23.mesh; - if (!mesh73) { - return; + }, + FlowGraphFlipFlopBlock: () => { + { + return FlowGraphFlipFlopBlock; } - control23.position = nodePosition.clone(); - this._updateCurrentMinMax(nodePosition); - } - _finalProcessing() { - this._updateMargins(); - } - _updateCurrentMinMax(nodePosition) { - if (!this._currentMin) { - this._currentMin = nodePosition.clone(); - this._currentMax = nodePosition.clone(); + }, + FlowGraphExpBlock: () => { + { + return FlowGraphExpBlock; } - this._currentMin.minimizeInPlace(nodePosition); - this._currentMax.maximizeInPlace(nodePosition); - } - _updateMargins() { - if (this._children.length > 0) { - this._currentMin.addInPlaceFromFloats(-this._cellWidth / 2, -this._cellHeight / 2, 0); - this._currentMax.addInPlaceFromFloats(this._cellWidth / 2, this._cellHeight / 2, 0); - const extendSize = this._currentMax.subtract(this._currentMin); - this._backPlate.scaling.x = extendSize.x + this._cellWidth * this.backPlateMargin; - this._backPlate.scaling.y = extendSize.y + this._cellHeight * this.backPlateMargin; - this._backPlate.scaling.z = 0.001; - for (let i = 0;i < this._children.length; i++) { - this._children[i].position.subtractInPlace(this._currentMin).subtractInPlace(extendSize.scale(0.5)); - this._children[i].position.z -= 0.01; - } + }, + FlowGraphExecutionBlock: () => { + { + return FlowGraphExecutionBlock; } - this._currentMin = null; - this._currentMax = null; - } - constructor(name267) { - super(name267); - this._backPlateMargin = 1.25; - } - addButton(button5) { - const wasLayoutBlocked = this.blockLayout; - if (!wasLayoutBlocked) { - this.blockLayout = true; + }, + FlowGraphEventBlock: () => { + { + return FlowGraphEventBlock; } - super.addControl(button5); - button5.isBackplateVisible = false; - button5.scaling.scaleInPlace(TouchHolographicMenu.MENU_BUTTON_SCALE); - if (!wasLayoutBlocked) { - this.blockLayout = false; + }, + FlowGraphEqBlock: () => { + { + return FlowGraphEqBlock; } - return this; - } - addControl(_control) { - Logger.Warn("TouchHolographicMenu can only contain buttons. Please use the method `addButton` instead."); - return this; - } - dispose() { - super.dispose(); - this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver); - } -} -TouchHolographicMenu.MENU_BUTTON_SCALE = 1; -// node_modules/@babylonjs/gui/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js -var name267 = "fluentBackplatePixelShader"; -var shader267 = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform float _Angle_;uniform float _Fade_Out_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform sampler2D _Iridescent_Map_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;void Round_Rect_Fragment_B31( -float Radius, -float Line_Width, -vec4 Line_Color, -float Filter_Width, -vec2 UV, -float Line_Visibility, -vec4 Rect_Parms, -vec4 Fill_Color, -out vec4 Color) -{float d=length(max(abs(UV)-Rect_Parms.xy,0.0));float dx=max(fwidth(d)*Filter_Width,0.00001);float g=min(Rect_Parms.z,Rect_Parms.w);float dgrad=max(fwidth(g)*Filter_Width,0.00001);float Inside_Rect=clamp(g/dgrad,0.0,1.0);float inner=clamp((d+dx*0.5-max(Radius-Line_Width,d-dx*0.5))/dx,0.0,1.0);Color=clamp(mix(Fill_Color,Line_Color,inner),0.0,1.0)*Inside_Rect;} -void Blob_Fragment_B71( -sampler2D Blob_Texture, -vec4 Blob_Info1, -vec4 Blob_Info2, -out vec4 Blob_Color) -{float k1=dot(Blob_Info1.xy,Blob_Info1.xy);float k2=dot(Blob_Info2.xy,Blob_Info2.xy);vec3 closer=k10.0 ? g : 1.0;Gradient2=Position_Object.z>0.0 ? 1.0 : g;} else {Gradient1=g+(1.0-g)*(Radial_Gradient);Gradient2=1.0;}} -void Pick_Radius_B144( -float Radius, -float Radius_Top_Left, -float Radius_Top_Right, -float Radius_Bottom_Left, -float Radius_Bottom_Right, -vec3 Position, -out float Result) -{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;} -void main() -{vec3 Nrm_World_Q128;Nrm_World_Q128=normalize((world*vec4(normal,0.0)).xyz);vec3 Tangent_World_Q131;vec3 Tangent_World_N_Q131;float Tangent_Length_Q131;Tangent_World_Q131=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q131=length(Tangent_World_Q131);Tangent_World_N_Q131=Tangent_World_Q131/Tangent_Length_Q131;vec3 Binormal_World_Q132;vec3 Binormal_World_N_Q132;float Binormal_Length_Q132;Object_To_World_Dir_B132(vec3(0,1,0),Binormal_World_Q132,Binormal_World_N_Q132,Binormal_Length_Q132);float Anisotropy_Q133=Tangent_Length_Q131/Binormal_Length_Q132;vec3 Result_Q177;Result_Q177=mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(_Use_Global_Left_Index_));vec3 Result_Q178;Result_Q178=mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(_Use_Global_Right_Index_));float Result_Q144;Pick_Radius_B144(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q144);vec3 Dir_Q140;PickDir_B140(_Angle_,Tangent_World_N_Q131,Binormal_World_N_Q132,Dir_Q140);float Radius_Q147;float Line_Width_Q147;RelativeOrAbsoluteDetail_B147(Result_Q144,_Line_Width_,_Absolute_Sizes_,Binormal_Length_Q132,Radius_Q147,Line_Width_Q147);vec4 Out_Color_Q145=vec4(Radius_Q147,Line_Width_Q147,0,1);vec3 New_P_Q129;vec2 New_UV_Q129;float Radial_Gradient_Q129;vec3 Radial_Dir_Q129;Move_Verts_B129(Anisotropy_Q133,position,Radius_Q147,New_P_Q129,New_UV_Q129,Radial_Gradient_Q129,Radial_Dir_Q129);vec3 Pos_World_Q115;Object_To_World_Pos_B115(New_P_Q129,Pos_World_Q115);vec4 Blob_Info_Q180; -#if BLOB_ENABLE -Blob_Vertex_B180(Pos_World_Q115,Nrm_World_Q128,Tangent_World_N_Q131,Binormal_World_N_Q132,Result_Q177,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q180); -#else -Blob_Info_Q180=vec4(0,0,0,0); -#endif -vec4 Blob_Info_Q181; -#if BLOB_ENABLE_2 -Blob_Vertex_B180(Pos_World_Q115,Nrm_World_Q128,Tangent_World_N_Q131,Binormal_World_N_Q132,Result_Q178,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q181); -#else -Blob_Info_Q181=vec4(0,0,0,0); -#endif -float Gradient1_Q130;float Gradient2_Q130; -#if SMOOTH_EDGES -Edge_AA_Vertex_B130(Pos_World_Q115,position,normal,cameraPosition,Radial_Gradient_Q129,Radial_Dir_Q129,tangent,Gradient1_Q130,Gradient2_Q130); -#else -Gradient1_Q130=1.0;Gradient2_Q130=1.0; -#endif -vec2 Rect_UV_Q139;vec4 Rect_Parms_Q139;vec2 Scale_XY_Q139;vec2 Line_UV_Q139;Round_Rect_Vertex_B139(New_UV_Q129,Radius_Q147,0.0,Anisotropy_Q133,Gradient1_Q130,Gradient2_Q130,Rect_UV_Q139,Rect_Parms_Q139,Scale_XY_Q139,Line_UV_Q139);vec3 Line_Vertex_Q135;Line_Vertex_B135(Scale_XY_Q139,Line_UV_Q139,0.0,_Rate_,_Highlight_Transform_,Line_Vertex_Q135);vec3 Position=Pos_World_Q115;vec3 Normal=Dir_Q140;vec2 UV=Rect_UV_Q139;vec3 Tangent=Line_Vertex_Q135;vec3 Binormal=Nrm_World_Q128;vec4 Color=Out_Color_Q145;vec4 Extra1=Rect_Parms_Q139;vec4 Extra2=Blob_Info_Q180;vec4 Extra3=Blob_Info_Q181;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}`; -ShaderStore.ShadersStore[name268] = shader268; - -// node_modules/@babylonjs/gui/3D/materials/fluentBackplate/fluentBackplateMaterial.js -class FluentBackplateMaterialDefines extends MaterialDefines { - constructor() { - super(); - this.BLOB_ENABLE = true; - this.BLOB_ENABLE_2 = true; - this.SMOOTH_EDGES = true; - this.IRIDESCENT_MAP_ENABLE = true; - this._needNormals = true; - this.rebuild(); - } -} - -class FluentBackplateMaterial extends PushMaterial { - constructor(name269, scene37) { - super(name269, scene37); - this.radius = 0.03; - this.lineWidth = 0.01; - this.absoluteSizes = false; - this._filterWidth = 1; - this.baseColor = new Color4(0.0392157, 0.0666667, 0.207843, 1); - this.lineColor = new Color4(0.14902, 0.133333, 0.384314, 1); - this.blobIntensity = 0.98; - this.blobFarSize = 0.04; - this.blobNearDistance = 0; - this.blobFarDistance = 0.08; - this.blobFadeLength = 0.08; - this.blobNearSize = 0.22; - this.blobPulse = 0; - this.blobFade = 0; - this.blobNearSize2 = 0.22; - this.blobPulse2 = 0; - this.blobFade2 = 0; - this._rate = 0.135; - this.highlightColor = new Color4(0.98, 0.98, 0.98, 1); - this.highlightWidth = 0.25; - this._highlightTransform = new Vector4(1, 1, 0, 0); - this._highlight = 1; - this.iridescenceIntensity = 0; - this.iridescenceEdgeIntensity = 1; - this._angle = -45; - this.fadeOut = 1; - this._reflected = true; - this._frequency = 1; - this._verticalOffset = 0; - this.globalLeftIndexTipPosition = Vector3.Zero(); - this._globalLeftIndexTipPosition4 = Vector4.Zero(); - this.globalRightIndexTipPosition = Vector3.Zero(); - this._globalRightIndexTipPosition4 = Vector4.Zero(); - this.alphaMode = Constants.ALPHA_DISABLE; - this.backFaceCulling = false; - this._blobTexture = new Texture(FluentBackplateMaterial.BLOB_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE); - this._iridescentMap = new Texture(FluentBackplateMaterial.IM_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE); - } - needAlphaBlending() { - return false; - } - needAlphaTesting() { - return false; - } - getAlphaTestTexture() { - return null; - } - isReadyForSubMesh(mesh73, subMesh10) { - if (this.isFrozen) { - if (subMesh10.effect && subMesh10.effect._wasPreviouslyReady) { - return true; - } + }, + FlowGraphEBlock: () => { + { + return FlowGraphEBlock; } - if (!subMesh10.materialDefines) { - subMesh10.materialDefines = new FluentBackplateMaterialDefines; + }, + FlowGraphDotBlock: () => { + { + return FlowGraphDotBlock; } - const defines = subMesh10.materialDefines; - const scene37 = this.getScene(); - if (this._isReadyForSubMesh(subMesh10)) { - return true; + }, + FlowGraphDoNBlock: () => { + { + return FlowGraphDoNBlock; } - const engine47 = scene37.getEngine(); - MaterialHelper.PrepareDefinesForAttributes(mesh73, defines, false, false); - if (defines.isDirty) { - defines.markAsProcessed(); - scene37.resetCachedMaterial(); - const fallbacks = new EffectFallbacks; - if (defines.FOG) { - fallbacks.addFallback(1, "FOG"); - } - MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); - defines.IMAGEPROCESSINGPOSTPROCESS = scene37.imageProcessingConfiguration.applyByPostProcess; - const attribs = [VertexBuffer.PositionKind]; - if (defines.NORMAL) { - attribs.push(VertexBuffer.NormalKind); - } - if (defines.UV1) { - attribs.push(VertexBuffer.UVKind); - } - if (defines.UV2) { - attribs.push(VertexBuffer.UV2Kind); - } - if (defines.VERTEXCOLOR) { - attribs.push(VertexBuffer.ColorKind); - } - if (defines.TANGENT) { - attribs.push(VertexBuffer.TangentKind); - } - MaterialHelper.PrepareAttributesForInstances(attribs, defines); - const shaderName = "fluentBackplate"; - const join = defines.toString(); - const uniforms2 = [ - "world", - "viewProjection", - "cameraPosition", - "_Radius_", - "_Line_Width_", - "_Absolute_Sizes_", - "_Filter_Width_", - "_Base_Color_", - "_Line_Color_", - "_Radius_Top_Left_", - "_Radius_Top_Right_", - "_Radius_Bottom_Left_", - "_Radius_Bottom_Right_", - "_Blob_Position_", - "_Blob_Intensity_", - "_Blob_Near_Size_", - "_Blob_Far_Size_", - "_Blob_Near_Distance_", - "_Blob_Far_Distance_", - "_Blob_Fade_Length_", - "_Blob_Pulse_", - "_Blob_Fade_", - "_Blob_Texture_", - "_Blob_Position_2_", - "_Blob_Near_Size_2_", - "_Blob_Pulse_2_", - "_Blob_Fade_2_", - "_Rate_", - "_Highlight_Color_", - "_Highlight_Width_", - "_Highlight_Transform_", - "_Highlight_", - "_Iridescence_Intensity_", - "_Iridescence_Edge_Intensity_", - "_Angle_", - "_Fade_Out_", - "_Reflected_", - "_Frequency_", - "_Vertical_Offset_", - "_Iridescent_Map_", - "_Use_Global_Left_Index_", - "_Use_Global_Right_Index_", - "Global_Left_Index_Tip_Position", - "Global_Right_Index_Tip_Position" - ]; - const samplers = ["_Blob_Texture_", "_Iridescent_Map_"]; - const uniformBuffers = []; - MaterialHelper.PrepareUniformsAndSamplersList({ - uniformsNames: uniforms2, - uniformBuffersNames: uniformBuffers, - samplers, - defines, - maxSimultaneousLights: 4 - }); - subMesh10.setEffect(scene37.getEngine().createEffect(shaderName, { - attributes: attribs, - uniformsNames: uniforms2, - uniformBuffersNames: uniformBuffers, - samplers, - defines: join, - fallbacks, - onCompiled: this.onCompiled, - onError: this.onError, - indexParameters: { maxSimultaneousLights: 4 } - }, engine47), defines, this._materialContext); + }, + FlowGraphDivideBlock: () => { + { + return FlowGraphDivideBlock; } - if (!subMesh10.effect || !subMesh10.effect.isReady()) { - return false; + }, + FlowGraphDegToRadBlock: () => { + { + return FlowGraphDegToRadBlock; } - defines._renderId = scene37.getRenderId(); - subMesh10.effect._wasPreviouslyReady = true; - return true; - } - bindForSubMesh(world, mesh73, subMesh10) { - var _a, _b; - const defines = subMesh10.materialDefines; - if (!defines) { - return; + }, + FlowGraphDebounceBlock: () => { + { + return FlowGraphDebounceBlock; } - const effect16 = subMesh10.effect; - if (!effect16) { - return; + }, + FlowGraphDataConnection: () => { + { + return FlowGraphDataConnection; } - this._activeEffect = effect16; - this.bindOnlyWorldMatrix(world); - this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix()); - this._activeEffect.setVector3("cameraPosition", (_b = (_a = this.getScene().activeCamera) === null || _a === undefined ? undefined : _a.position) !== null && _b !== undefined ? _b : Vector3.ZeroReadOnly); - this._activeEffect.setFloat("_Radius_", this.radius); - this._activeEffect.setFloat("_Line_Width_", this.lineWidth); - this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1 : 0); - this._activeEffect.setFloat("_Filter_Width_", this._filterWidth); - this._activeEffect.setDirectColor4("_Base_Color_", this.baseColor); - this._activeEffect.setDirectColor4("_Line_Color_", this.lineColor); - this._activeEffect.setFloat("_Radius_Top_Left_", 1); - this._activeEffect.setFloat("_Radius_Top_Right_", 1); - this._activeEffect.setFloat("_Radius_Bottom_Left_", 1); - this._activeEffect.setFloat("_Radius_Bottom_Right_", 1); - this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity); - this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize); - this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize); - this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance); - this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance); - this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength); - this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse); - this._activeEffect.setFloat("_Blob_Fade_", this.blobFade); - this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture); - this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2); - this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2); - this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2); - this._activeEffect.setFloat("_Rate_", this._rate); - this._activeEffect.setDirectColor4("_Highlight_Color_", this.highlightColor); - this._activeEffect.setFloat("_Highlight_Width_", this.highlightWidth); - this._activeEffect.setVector4("_Highlight_Transform_", this._highlightTransform); - this._activeEffect.setFloat("_Highlight_", this._highlight); - this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity); - this._activeEffect.setFloat("_Iridescence_Edge_Intensity_", this.iridescenceEdgeIntensity); - this._activeEffect.setFloat("_Angle_", this._angle); - this._activeEffect.setFloat("_Fade_Out_", this.fadeOut); - this._activeEffect.setFloat("_Reflected_", this._reflected ? 1 : 0); - this._activeEffect.setFloat("_Frequency_", this._frequency); - this._activeEffect.setFloat("_Vertical_Offset_", this._verticalOffset); - this._activeEffect.setTexture("_Iridescent_Map_", this._iridescentMap); - this._activeEffect.setFloat("_Use_Global_Left_Index_", 1); - this._activeEffect.setFloat("_Use_Global_Right_Index_", 1); - this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1); - this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this._globalLeftIndexTipPosition4); - this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1); - this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this._globalRightIndexTipPosition4); - this._afterBind(mesh73, this._activeEffect); - } - getAnimatables() { - return []; - } - dispose(forceDisposeEffect) { - super.dispose(forceDisposeEffect); - this._blobTexture.dispose(); - this._iridescentMap.dispose(); - } - clone(name269) { - return SerializationHelper.Clone(() => new FluentBackplateMaterial(name269, this.getScene()), this); - } - serialize() { - const serializationObject = super.serialize(); - serializationObject.customType = "BABYLON.FluentBackplateMaterial"; - return serializationObject; - } - getClassName() { - return "FluentBackplateMaterial"; - } - static Parse(source, scene37, rootUrl) { - return SerializationHelper.Parse(() => new FluentBackplateMaterial(source.name, scene37), source, scene37, rootUrl); - } -} -FluentBackplateMaterial.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-blob.png"; -FluentBackplateMaterial.IM_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-iridescence.png"; -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "radius", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "lineWidth", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "absoluteSizes", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "baseColor", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "lineColor", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "blobIntensity", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "blobFarSize", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "blobNearDistance", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "blobFarDistance", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "blobFadeLength", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "blobNearSize", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "blobPulse", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "blobFade", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "blobNearSize2", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "blobPulse2", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "blobFade2", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "highlightColor", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "highlightWidth", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "iridescenceIntensity", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "iridescenceEdgeIntensity", undefined); -__decorate2([ - serialize() -], FluentBackplateMaterial.prototype, "fadeOut", undefined); -__decorate2([ - serializeAsVector3() -], FluentBackplateMaterial.prototype, "globalLeftIndexTipPosition", undefined); -__decorate2([ - serializeAsVector3() -], FluentBackplateMaterial.prototype, "globalRightIndexTipPosition", undefined); -RegisterClass("BABYLON.GUI.FluentBackplateMaterial", FluentBackplateMaterial); - -// node_modules/@babylonjs/gui/3D/controls/holographicBackplate.js -class HolographicBackplate extends Control3D { - set renderingGroupId(id) { - this._model.renderingGroupId = id; - } - get renderingGroupId() { - return this._model.renderingGroupId; - } - get material() { - return this._material; - } - get shareMaterials() { - return this._shareMaterials; - } - constructor(name269, _shareMaterials = true) { - super(name269); - this._shareMaterials = _shareMaterials; - } - _getTypeName() { - return "HolographicBackplate"; - } - _createNode(scene37) { - var _a; - const collisionMesh = CreateBox(((_a = this.name) !== null && _a !== undefined ? _a : "HolographicBackplate") + "_CollisionMesh", { - width: 1, - height: 1, - depth: 1 - }, scene37); - collisionMesh.isPickable = true; - collisionMesh.visibility = 0; - SceneLoader.ImportMeshAsync(undefined, HolographicBackplate.MODEL_BASE_URL, HolographicBackplate.MODEL_FILENAME, scene37).then((result) => { - const importedModel = result.meshes[1]; - importedModel.name = `${this.name}_frontPlate`; - importedModel.isPickable = false; - importedModel.parent = collisionMesh; - if (this._material) { - importedModel.material = this._material; - } - this._model = importedModel; - }); - return collisionMesh; - } - _createMaterial(mesh73) { - this._material = new FluentBackplateMaterial(this.name + " Material", mesh73.getScene()); - } - _affectMaterial(mesh73) { - if (this._shareMaterials) { - if (!this._host._touchSharedMaterials["fluentBackplateMaterial"]) { - this._createMaterial(mesh73); - this._host._touchSharedMaterials["fluentBackplateMaterial"] = this._material; - } else { - this._material = this._host._touchSharedMaterials["fluentBackplateMaterial"]; - } - } else { - this._createMaterial(mesh73); + }, + FlowGraphCubeRootBlock: () => { + { + return FlowGraphCubeRootBlock; } - } - dispose() { - super.dispose(); - if (!this.shareMaterials) { - this._material.dispose(); + }, + FlowGraphCrossBlock: () => { + { + return FlowGraphCrossBlock; } - this._model.dispose(); - } -} -HolographicBackplate.MODEL_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/"; -HolographicBackplate.MODEL_FILENAME = "mrtk-fluent-backplate.glb"; -// node_modules/@babylonjs/gui/3D/materials/fluentButton/shaders/fluentButton.fragment.js -var name269 = "fluentButtonPixelShader"; -var shader269 = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;uniform float _Edge_Width_;uniform vec4 _Edge_Color_;uniform bool _Relative_Width_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Active_Face_Dir_;uniform vec3 _Active_Face_Up_;uniform bool Enable_Fade;uniform float _Fade_Width_;uniform bool _Smooth_Active_Face_;uniform bool _Show_Frame_;uniform bool _Use_Blob_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Holo_Edge_Fragment_B35( -vec4 Edges, -float Edge_Width, -out float NotEdge) -{vec2 c=vec2(min(Edges.r,Edges.g),min(Edges.b,Edges.a));vec2 df=fwidth(c)*Edge_Width;vec2 g=clamp(c/df,0.0,1.0);NotEdge=g.x*g.y;} -void Blob_Fragment_B39( -vec2 UV, -vec3 Blob_Info, -sampler2D Blob_Texture, -out vec4 Blob_Color) -{float k=dot(UV,UV);Blob_Color=Blob_Info.y*texture(Blob_Texture,vec2(vec2(sqrt(k),Blob_Info.x).x,1.0-vec2(sqrt(k),Blob_Info.x).y))*(1.0-clamp(k,0.0,1.0));} -vec2 FilterStep(vec2 Edge,vec2 X) -{vec2 dX=max(fwidth(X),vec2(0.00001,0.00001));return clamp( (X+dX-max(Edge,X-dX))/(dX*2.0),0.0,1.0);} -void Wireframe_Fragment_B59( -vec3 Widths, -vec2 UV, -float Proximity, -vec4 Edge_Color, -out vec4 Wireframe) -{vec2 c=min(UV,vec2(1.0,1.0)-UV);vec2 g=FilterStep(Widths.xy*0.5,c); -Wireframe=(1.0-min(g.x,g.y))*Proximity*Edge_Color;} -void Proximity_B53( -vec3 Proximity_Center, -vec3 Proximity_Center_2, -float Proximity_Max_Intensity, -float Proximity_Near_Radius, -vec3 Position, -vec3 Show_Selection, -vec4 Extra1, -float Dist_To_Face, -float Intensity, -out float Proximity) -{vec2 delta1=Extra1.xy;vec2 delta2=Extra1.zw;float d2=sqrt(min(dot(delta1,delta1),dot(delta2,delta2))+Dist_To_Face*Dist_To_Face);Proximity=Intensity*Proximity_Max_Intensity*(1.0-clamp(d2/Proximity_Near_Radius,0.0,1.0))*(1.0-Show_Selection.x)+Show_Selection.x;} -void To_XYZ_B46( -vec3 Vec3, -out float X, -out float Y, -out float Z) -{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;} -void main() -{float NotEdge_Q35; -#if ENABLE_FADE -Holo_Edge_Fragment_B35(vColor,_Fade_Width_,NotEdge_Q35); -#else -NotEdge_Q35=1.0; -#endif -vec4 Blob_Color_Q39;float k=dot(vUV,vUV);vec2 blobTextureCoord=vec2(vec2(sqrt(k),vTangent.x).x,1.0-vec2(sqrt(k),vTangent.x).y);vec4 blobColor=mix(vec4(1.0,1.0,1.0,1.0)*step(1.0-vTangent.x,clamp(sqrt(k)+0.1,0.0,1.0)),texture(_Blob_Texture_,blobTextureCoord),float(_Use_Blob_Texture_));Blob_Color_Q39=vTangent.y*blobColor*(1.0-clamp(k,0.0,1.0));float Is_Quad_Q24;Is_Quad_Q24=vNormal.z;vec3 Blob_Position_Q41= mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(Use_Global_Left_Index));vec3 Blob_Position_Q42= mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(Use_Global_Right_Index));float X_Q46;float Y_Q46;float Z_Q46;To_XYZ_B46(vBinormal,X_Q46,Y_Q46,Z_Q46);float Proximity_Q53;Proximity_B53(Blob_Position_Q41,Blob_Position_Q42,_Proximity_Max_Intensity_,_Proximity_Near_Radius_,vPosition,vBinormal,vExtra1,Y_Q46,Z_Q46,Proximity_Q53);vec4 Wireframe_Q59;Wireframe_Fragment_B59(vNormal,vUV,Proximity_Q53,_Edge_Color_,Wireframe_Q59);vec4 Wire_Or_Blob_Q23=mix(Wireframe_Q59,Blob_Color_Q39,Is_Quad_Q24);vec4 Result_Q22;Result_Q22=mix(Wire_Or_Blob_Q23,vec4(0.3,0.3,0.3,0.3),float(_Show_Frame_));vec4 Final_Color_Q37=NotEdge_Q35*Result_Q22;vec4 Out_Color=Final_Color_Q37;float Clip_Threshold=0.0;bool To_sRGB=false;gl_FragColor=Out_Color;}`; -ShaderStore.ShadersStore[name269] = shader269; - -// node_modules/@babylonjs/gui/3D/materials/fluentButton/shaders/fluentButton.vertex.js -var name270 = "fluentButtonVertexShader"; -var shader270 = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform float _Edge_Width_;uniform vec4 _Edge_Color_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Active_Face_Dir_;uniform vec3 _Active_Face_Up_;uniform bool _Enable_Fade_;uniform float _Fade_Width_;uniform bool _Smooth_Active_Face_;uniform bool _Show_Frame_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;void Blob_Vertex_B47( -vec3 Position, -vec3 Normal, -vec3 Tangent, -vec3 Bitangent, -vec3 Blob_Position, -float Intensity, -float Blob_Near_Size, -float Blob_Far_Size, -float Blob_Near_Distance, -float Blob_Far_Distance, -vec4 Vx_Color, -vec2 UV, -vec3 Face_Center, -vec2 Face_Size, -vec2 In_UV, -float Blob_Fade_Length, -float Selection_Fade, -float Selection_Fade_Size, -float Inner_Fade, -vec3 Active_Face_Center, -float Blob_Pulse, -float Blob_Fade, -float Blob_Enabled, -out vec3 Out_Position, -out vec2 Out_UV, -out vec3 Blob_Info) -{float blobSize,fadeIn;vec3 Hit_Position;Blob_Info=vec3(0.0,0.0,0.0);float Hit_Distance=dot(Blob_Position-Face_Center,Normal);Hit_Position=Blob_Position-Hit_Distance*Normal;float absD=abs(Hit_Distance);float lerpVal=clamp((absD-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);fadeIn=1.0-clamp((absD-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float innerFade=1.0-clamp(-Hit_Distance/Inner_Fade,0.0,1.0);float farClip=clamp(1.0-step(Blob_Far_Distance+Blob_Fade_Length,absD),0.0,1.0);float size=mix(Blob_Near_Size,Blob_Far_Size,lerpVal)*farClip;blobSize=mix(size,Selection_Fade_Size,Selection_Fade)*innerFade*Blob_Enabled;Blob_Info.x=lerpVal*0.5+0.5;Blob_Info.y=fadeIn*Intensity*(1.0-Selection_Fade)*Blob_Fade;Blob_Info.x*=(1.0-Blob_Pulse);vec3 delta=Hit_Position-Face_Center;vec2 blobCenterXY=vec2(dot(delta,Tangent),dot(delta,Bitangent));vec2 quadUVin=2.0*UV-1.0; -vec2 blobXY=blobCenterXY+quadUVin*blobSize;vec2 blobClipped=clamp(blobXY,-Face_Size*0.5,Face_Size*0.5);vec2 blobUV=(blobClipped-blobCenterXY)/max(blobSize,0.0001)*2.0;vec3 blobCorner=Face_Center+blobClipped.x*Tangent+blobClipped.y*Bitangent;Out_Position=mix(Position,blobCorner,Vx_Color.rrr);Out_UV=mix(In_UV,blobUV,Vx_Color.rr);} -vec2 ProjectProximity( -vec3 blobPosition, -vec3 position, -vec3 center, -vec3 dir, -vec3 xdir, -vec3 ydir, -out float vdistance -) -{vec3 delta=blobPosition-position;vec2 xy=vec2(dot(delta,xdir),dot(delta,ydir));vdistance=abs(dot(delta,dir));return xy;} -void Proximity_Vertex_B66( -vec3 Blob_Position, -vec3 Blob_Position_2, -vec3 Active_Face_Center, -vec3 Active_Face_Dir, -vec3 Position, -float Proximity_Far_Distance, -float Relative_Scale, -float Proximity_Anisotropy, -vec3 Up, -out vec4 Extra1, -out float Distance_To_Face, -out float Intensity) -{vec3 Active_Face_Dir_X=normalize(cross(Active_Face_Dir,Up));vec3 Active_Face_Dir_Y=cross(Active_Face_Dir,Active_Face_Dir_X);float distz1,distz2;Extra1.xy=ProjectProximity(Blob_Position,Position,Active_Face_Center,Active_Face_Dir,Active_Face_Dir_X*Proximity_Anisotropy,Active_Face_Dir_Y,distz1)/Relative_Scale;Extra1.zw=ProjectProximity(Blob_Position_2,Position,Active_Face_Center,Active_Face_Dir,Active_Face_Dir_X*Proximity_Anisotropy,Active_Face_Dir_Y,distz2)/Relative_Scale;Distance_To_Face=dot(Active_Face_Dir,Position-Active_Face_Center);Intensity=1.0-clamp(min(distz1,distz2)/Proximity_Far_Distance,0.0,1.0);} -void Holo_Edge_Vertex_B44( -vec3 Incident, -vec3 Normal, -vec2 UV, -vec3 Tangent, -vec3 Bitangent, -bool Smooth_Active_Face, -float Active, -out vec4 Holo_Edges) -{float NdotI=dot(Incident,Normal);vec2 flip=(UV-vec2(0.5,0.5));float udot=dot(Incident,Tangent)*flip.x*NdotI;float uval=1.0-float(udot>0.0);float vdot=-dot(Incident,Bitangent)*flip.y*NdotI;float vval=1.0-float(vdot>0.0);float Smooth_And_Active=step(1.0,float(Smooth_Active_Face && Active>0.0));uval=mix(uval,max(1.0,uval),Smooth_And_Active); -vval=mix(vval,max(1.0,vval),Smooth_And_Active);Holo_Edges=vec4(1.0,1.0,1.0,1.0)-vec4(uval*UV.x,uval*(1.0-UV.x),vval*UV.y,vval*(1.0-UV.y));} -void Object_To_World_Pos_B13( -vec3 Pos_Object, -out vec3 Pos_World) -{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;} -void Choose_Blob_B38( -vec4 Vx_Color, -vec3 Position1, -vec3 Position2, -bool Blob_Enable_1, -bool Blob_Enable_2, -float Near_Size_1, -float Near_Size_2, -float Blob_Inner_Fade_1, -float Blob_Inner_Fade_2, -float Blob_Pulse_1, -float Blob_Pulse_2, -float Blob_Fade_1, -float Blob_Fade_2, -out vec3 Position, -out float Near_Size, -out float Inner_Fade, -out float Blob_Enable, -out float Fade, -out float Pulse) -{Position=Position1*(1.0-Vx_Color.g)+Vx_Color.g*Position2;float b1=float(Blob_Enable_1);float b2=float(Blob_Enable_2);Blob_Enable=b1+(b2-b1)*Vx_Color.g;Pulse=Blob_Pulse_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Pulse_2;Fade=Blob_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Fade_2;Near_Size=Near_Size_1*(1.0-Vx_Color.g)+Vx_Color.g*Near_Size_2;Inner_Fade=Blob_Inner_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Inner_Fade_2;} -void Wireframe_Vertex_B51( -vec3 Position, -vec3 Normal, -vec3 Tangent, -vec3 Bitangent, -float Edge_Width, -vec2 Face_Size, -out vec3 Wire_Vx_Pos, -out vec2 UV, -out vec2 Widths) -{Widths.xy=Edge_Width/Face_Size;float x=dot(Position,Tangent);float y=dot(Position,Bitangent);float dx=0.5-abs(x);float newx=(0.5-dx*Widths.x*2.0)*sign(x);float dy=0.5-abs(y);float newy=(0.5-dy*Widths.y*2.0)*sign(y);Wire_Vx_Pos=Normal*0.5+newx*Tangent+newy*Bitangent;UV.x=dot(Wire_Vx_Pos,Tangent)+0.5;UV.y=dot(Wire_Vx_Pos,Bitangent)+0.5;} -vec2 ramp2(vec2 start,vec2 end,vec2 x) -{return clamp((x-start)/(end-start),vec2(0.0,0.0),vec2(1.0,1.0));} -float computeSelection( -vec3 blobPosition, -vec3 normal, -vec3 tangent, -vec3 bitangent, -vec3 faceCenter, -vec2 faceSize, -float selectionFuzz, -float farDistance, -float fadeLength -) -{vec3 delta=blobPosition-faceCenter;float absD=abs(dot(delta,normal));float fadeIn=1.0-clamp((absD-farDistance)/fadeLength,0.0,1.0);vec2 blobCenterXY=vec2(dot(delta,tangent),dot(delta,bitangent));vec2 innerFace=faceSize*(1.0-selectionFuzz)*0.5;vec2 selectPulse=ramp2(-faceSize*0.5,-innerFace,blobCenterXY)-ramp2(innerFace,faceSize*0.5,blobCenterXY);return selectPulse.x*selectPulse.y*fadeIn;} -void Selection_Vertex_B48( -vec3 Blob_Position, -vec3 Blob_Position_2, -vec3 Face_Center, -vec2 Face_Size, -vec3 Normal, -vec3 Tangent, -vec3 Bitangent, -float Selection_Fuzz, -float Selected, -float Far_Distance, -float Fade_Length, -vec3 Active_Face_Dir, -out float Show_Selection) -{float select1=computeSelection(Blob_Position,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float select2=computeSelection(Blob_Position_2,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float Active=max(0.0,dot(Active_Face_Dir,Normal));Show_Selection=mix(max(select1,select2),1.0,Selected)*Active;} -void Proximity_Visibility_B54( -float Selection, -vec3 Proximity_Center, -vec3 Proximity_Center_2, -float Input_Width, -float Proximity_Far_Distance, -float Proximity_Radius, -vec3 Active_Face_Center, -vec3 Active_Face_Dir, -out float Width) -{vec3 boxEdges=(world*vec4(vec3(0.5,0.5,0.5),0.0)).xyz;float boxMaxSize=length(boxEdges);float d1=dot(Proximity_Center-Active_Face_Center,Active_Face_Dir);vec3 blob1=Proximity_Center-d1*Active_Face_Dir;float d2=dot(Proximity_Center_2-Active_Face_Center,Active_Face_Dir);vec3 blob2=Proximity_Center_2-d2*Active_Face_Dir;vec3 delta1=blob1-Active_Face_Center;vec3 delta2=blob2-Active_Face_Center;float dist1=dot(delta1,delta1);float dist2=dot(delta2,delta2);float nearestProxDist=sqrt(min(dist1,dist2));Width=Input_Width*(1.0-step(boxMaxSize+Proximity_Radius,nearestProxDist))*(1.0-step(Proximity_Far_Distance,min(d1,d2))*(1.0-step(0.0001,Selection)));} -void Object_To_World_Dir_B67( -vec3 Dir_Object, -out vec3 Dir_World) -{Dir_World=(world*vec4(Dir_Object,0.0)).xyz;} -void main() -{vec3 Active_Face_Center_Q49;Active_Face_Center_Q49=(world*vec4(_Active_Face_Dir_*0.5,1.0)).xyz;vec3 Blob_Position_Q41= mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(Use_Global_Left_Index));vec3 Blob_Position_Q42= mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(Use_Global_Right_Index));vec3 Active_Face_Dir_Q64=normalize((world*vec4(_Active_Face_Dir_,0.0)).xyz);float Relative_Scale_Q57; -#if RELATIVE_WIDTH -Relative_Scale_Q57=length((world*vec4(vec3(0,1,0),0.0)).xyz); -#else -Relative_Scale_Q57=1.0; -#endif -vec3 Tangent_World_Q30;Tangent_World_Q30=(world*vec4(tangent,0.0)).xyz;vec3 Binormal_World_Q31;Binormal_World_Q31=(world*vec4((cross(normal,tangent)),0.0)).xyz;vec3 Normal_World_Q60;Normal_World_Q60=(world*vec4(normal,0.0)).xyz;vec3 Result_Q18=0.5*normal;vec3 Dir_World_Q67;Object_To_World_Dir_B67(_Active_Face_Up_,Dir_World_Q67);float Product_Q56=_Edge_Width_*Relative_Scale_Q57;vec3 Normal_World_N_Q29=normalize(Normal_World_Q60);vec3 Tangent_World_N_Q28=normalize(Tangent_World_Q30);vec3 Binormal_World_N_Q32=normalize(Binormal_World_Q31);vec3 Position_Q38;float Near_Size_Q38;float Inner_Fade_Q38;float Blob_Enable_Q38;float Fade_Q38;float Pulse_Q38;Choose_Blob_B38(color,Blob_Position_Q41,Blob_Position_Q42,_Blob_Enable_,_Blob_Enable_2_,_Blob_Near_Size_,_Blob_Near_Size_2_,_Blob_Inner_Fade_,_Blob_Inner_Fade_2_,_Blob_Pulse_,_Blob_Pulse_2_,_Blob_Fade_,_Blob_Fade_2_,Position_Q38,Near_Size_Q38,Inner_Fade_Q38,Blob_Enable_Q38,Fade_Q38,Pulse_Q38);vec3 Face_Center_Q33;Face_Center_Q33=(world*vec4(Result_Q18,1.0)).xyz;vec2 Face_Size_Q50=vec2(length(Tangent_World_Q30),length(Binormal_World_Q31));float Show_Selection_Q48;Selection_Vertex_B48(Blob_Position_Q41,Blob_Position_Q42,Face_Center_Q33,Face_Size_Q50,Normal_World_N_Q29,Tangent_World_N_Q28,Binormal_World_N_Q32,_Selection_Fuzz_,_Selected_,_Selected_Distance_,_Selected_Fade_Length_,Active_Face_Dir_Q64,Show_Selection_Q48);vec3 Normalized_Q72=normalize(Dir_World_Q67);float Active_Q34=max(0.0,dot(Active_Face_Dir_Q64,Normal_World_N_Q29));float Width_Q54;Proximity_Visibility_B54(Show_Selection_Q48,Blob_Position_Q41,Blob_Position_Q42,Product_Q56,_Proximity_Far_Distance_,_Proximity_Near_Radius_,Active_Face_Center_Q49,Active_Face_Dir_Q64,Width_Q54);vec3 Wire_Vx_Pos_Q51;vec2 UV_Q51;vec2 Widths_Q51;Wireframe_Vertex_B51(position,normal,tangent,(cross(normal,tangent)),Width_Q54,Face_Size_Q50,Wire_Vx_Pos_Q51,UV_Q51,Widths_Q51);vec3 Vec3_Q27=vec3(Widths_Q51.x,Widths_Q51.y,color.r);vec3 Pos_World_Q13;Object_To_World_Pos_B13(Wire_Vx_Pos_Q51,Pos_World_Q13);vec3 Incident_Q36=normalize(Pos_World_Q13-cameraPosition);vec3 Out_Position_Q47;vec2 Out_UV_Q47;vec3 Blob_Info_Q47;Blob_Vertex_B47(Pos_World_Q13,Normal_World_N_Q29,Tangent_World_N_Q28,Binormal_World_N_Q32,Position_Q38,_Blob_Intensity_,Near_Size_Q38,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,color,uv,Face_Center_Q33,Face_Size_Q50,UV_Q51,_Blob_Fade_Length_,_Selection_Fade_,_Selection_Fade_Size_,Inner_Fade_Q38,Active_Face_Center_Q49,Pulse_Q38,Fade_Q38,Blob_Enable_Q38,Out_Position_Q47,Out_UV_Q47,Blob_Info_Q47);vec4 Extra1_Q66;float Distance_To_Face_Q66;float Intensity_Q66;Proximity_Vertex_B66(Blob_Position_Q41,Blob_Position_Q42,Active_Face_Center_Q49,Active_Face_Dir_Q64,Pos_World_Q13,_Proximity_Far_Distance_,Relative_Scale_Q57,_Proximity_Anisotropy_,Normalized_Q72,Extra1_Q66,Distance_To_Face_Q66,Intensity_Q66);vec4 Holo_Edges_Q44;Holo_Edge_Vertex_B44(Incident_Q36,Normal_World_N_Q29,uv,Tangent_World_Q30,Binormal_World_Q31,_Smooth_Active_Face_,Active_Q34,Holo_Edges_Q44);vec3 Vec3_Q19=vec3(Show_Selection_Q48,Distance_To_Face_Q66,Intensity_Q66);vec3 Position=Out_Position_Q47;vec2 UV=Out_UV_Q47;vec3 Tangent=Blob_Info_Q47;vec3 Binormal=Vec3_Q19;vec3 Normal=Vec3_Q27;vec4 Extra1=Extra1_Q66;vec4 Color=Holo_Edges_Q44;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;}`; -ShaderStore.ShadersStore[name270] = shader270; - -// node_modules/@babylonjs/gui/3D/materials/fluentButton/fluentButtonMaterial.js -class FluentButtonMaterialDefines extends MaterialDefines { - constructor() { - super(); - this.RELATIVE_WIDTH = true; - this.ENABLE_FADE = true; - this._needNormals = true; - this._needUVs = true; - this.rebuild(); - } -} - -class FluentButtonMaterial extends PushMaterial { - constructor(name271, scene37) { - super(name271, scene37); - this.edgeWidth = 0.04; - this.edgeColor = new Color4(0.592157, 0.592157, 0.592157, 1); - this.proximityMaxIntensity = 0.45; - this.proximityFarDistance = 0.16; - this.proximityNearRadius = 1.5; - this.proximityAnisotropy = 1; - this.selectionFuzz = 0.5; - this.selected = 0; - this.selectionFade = 0; - this.selectionFadeSize = 0.3; - this.selectedDistance = 0.08; - this.selectedFadeLength = 0.08; - this.blobIntensity = 0.5; - this.blobFarSize = 0.05; - this.blobNearDistance = 0; - this.blobFarDistance = 0.08; - this.blobFadeLength = 0.08; - this.leftBlobEnable = true; - this.leftBlobNearSize = 0.025; - this.leftBlobPulse = 0; - this.leftBlobFade = 1; - this.leftBlobInnerFade = 0.01; - this.rightBlobEnable = true; - this.rightBlobNearSize = 0.025; - this.rightBlobPulse = 0; - this.rightBlobFade = 1; - this.rightBlobInnerFade = 0.01; - this.activeFaceDir = new Vector3(0, 0, -1); - this.activeFaceUp = new Vector3(0, 1, 0); - this.enableFade = true; - this.fadeWidth = 1.5; - this.smoothActiveFace = true; - this.showFrame = false; - this.useBlobTexture = true; - this.globalLeftIndexTipPosition = Vector3.Zero(); - this.globalRightIndexTipPosition = Vector3.Zero(); - this.alphaMode = Constants.ALPHA_ADD; - this.disableDepthWrite = true; - this.backFaceCulling = false; - this._blobTexture = new Texture(FluentButtonMaterial.BLOB_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE); - } - needAlphaBlending() { - return true; - } - needAlphaTesting() { - return true; - } - getAlphaTestTexture() { - return null; - } - isReadyForSubMesh(mesh74, subMesh10) { - if (this.isFrozen) { - if (subMesh10.effect && subMesh10.effect._wasPreviouslyReady) { - return true; - } + }, + FlowGraphCounterBlock: () => { + { + return FlowGraphCounterBlock; } - if (!subMesh10.materialDefines) { - subMesh10.materialDefines = new FluentButtonMaterialDefines; + }, + FlowGraphCountTrailingZerosBlock: () => { + { + return FlowGraphCountTrailingZerosBlock; } - const defines = subMesh10.materialDefines; - const scene37 = this.getScene(); - if (this._isReadyForSubMesh(subMesh10)) { - return true; + }, + FlowGraphCountLeadingZerosBlock: () => { + { + return FlowGraphCountLeadingZerosBlock; } - const engine47 = scene37.getEngine(); - MaterialHelper.PrepareDefinesForAttributes(mesh74, defines, true, false); - if (defines.isDirty) { - defines.markAsProcessed(); - scene37.resetCachedMaterial(); - const fallbacks = new EffectFallbacks; - if (defines.FOG) { - fallbacks.addFallback(1, "FOG"); - } - MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); - defines.IMAGEPROCESSINGPOSTPROCESS = scene37.imageProcessingConfiguration.applyByPostProcess; - const attribs = [VertexBuffer.PositionKind]; - if (defines.NORMAL) { - attribs.push(VertexBuffer.NormalKind); - } - if (defines.UV1) { - attribs.push(VertexBuffer.UVKind); - } - if (defines.UV2) { - attribs.push(VertexBuffer.UV2Kind); - } - if (defines.VERTEXCOLOR) { - attribs.push(VertexBuffer.ColorKind); - } - if (defines.TANGENT) { - attribs.push(VertexBuffer.TangentKind); - } - MaterialHelper.PrepareAttributesForInstances(attribs, defines); - const shaderName = "fluentButton"; - const join = defines.toString(); - const uniforms2 = [ - "world", - "viewProjection", - "cameraPosition", - "_Edge_Width_", - "_Edge_Color_", - "_Relative_Width_", - "_Proximity_Max_Intensity_", - "_Proximity_Far_Distance_", - "_Proximity_Near_Radius_", - "_Proximity_Anisotropy_", - "_Selection_Fuzz_", - "_Selected_", - "_Selection_Fade_", - "_Selection_Fade_Size_", - "_Selected_Distance_", - "_Selected_Fade_Length_", - "_Blob_Enable_", - "_Blob_Position_", - "_Blob_Intensity_", - "_Blob_Near_Size_", - "_Blob_Far_Size_", - "_Blob_Near_Distance_", - "_Blob_Far_Distance_", - "_Blob_Fade_Length_", - "_Blob_Inner_Fade_", - "_Blob_Pulse_", - "_Blob_Fade_", - "_Blob_Texture_", - "_Blob_Enable_2_", - "_Blob_Position_2_", - "_Blob_Near_Size_2_", - "_Blob_Inner_Fade_2_", - "_Blob_Pulse_2_", - "_Blob_Fade_2_", - "_Active_Face_Dir_", - "_Active_Face_Up_", - "_Enable_Fade_", - "_Fade_Width_", - "_Smooth_Active_Face_", - "_Show_Frame_", - "_Use_Blob_Texture_", - "Use_Global_Left_Index", - "Use_Global_Right_Index", - "Global_Left_Index_Tip_Position", - "Global_Right_Index_Tip_Position", - "Global_Left_Thumb_Tip_Position", - "Global_Right_Thumb_Tip_Position", - "Global_Left_Index_Tip_Proximity", - "Global_Right_Index_Tip_Proximity" - ]; - const samplers = ["_Blob_Texture_"]; - const uniformBuffers = []; - MaterialHelper.PrepareUniformsAndSamplersList({ - uniformsNames: uniforms2, - uniformBuffersNames: uniformBuffers, - samplers, - defines, - maxSimultaneousLights: 4 - }); - subMesh10.setEffect(scene37.getEngine().createEffect(shaderName, { - attributes: attribs, - uniformsNames: uniforms2, - uniformBuffersNames: uniformBuffers, - samplers, - defines: join, - fallbacks, - onCompiled: this.onCompiled, - onError: this.onError, - indexParameters: { maxSimultaneousLights: 4 } - }, engine47), defines, this._materialContext); + }, + FlowGraphCoshBlock: () => { + { + return FlowGraphCoshBlock; } - if (!subMesh10.effect || !subMesh10.effect.isReady()) { - return false; + }, + FlowGraphCosBlock: () => { + { + return FlowGraphCosBlock; } - defines._renderId = scene37.getRenderId(); - subMesh10.effect._wasPreviouslyReady = true; - return true; - } - bindForSubMesh(world, mesh74, subMesh10) { - const scene37 = this.getScene(); - const defines = subMesh10.materialDefines; - if (!defines) { - return; + }, + FlowGraphCoordinator: () => { + { + return FlowGraphCoordinator; } - const effect16 = subMesh10.effect; - if (!effect16) { - return; + }, + FlowGraphCoordinateTransformBlock: () => { + { + return FlowGraphCoordinateTransformBlock; } - this._activeEffect = effect16; - this.bindOnlyWorldMatrix(world); - this._activeEffect.setMatrix("viewProjection", scene37.getTransformMatrix()); - this._activeEffect.setVector3("cameraPosition", scene37.activeCamera.position); - this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture); - this._activeEffect.setFloat("_Edge_Width_", this.edgeWidth); - this._activeEffect.setColor4("_Edge_Color_", new Color3(this.edgeColor.r, this.edgeColor.g, this.edgeColor.b), this.edgeColor.a); - this._activeEffect.setFloat("_Proximity_Max_Intensity_", this.proximityMaxIntensity); - this._activeEffect.setFloat("_Proximity_Far_Distance_", this.proximityFarDistance); - this._activeEffect.setFloat("_Proximity_Near_Radius_", this.proximityNearRadius); - this._activeEffect.setFloat("_Proximity_Anisotropy_", this.proximityAnisotropy); - this._activeEffect.setFloat("_Selection_Fuzz_", this.selectionFuzz); - this._activeEffect.setFloat("_Selected_", this.selected); - this._activeEffect.setFloat("_Selection_Fade_", this.selectionFade); - this._activeEffect.setFloat("_Selection_Fade_Size_", this.selectionFadeSize); - this._activeEffect.setFloat("_Selected_Distance_", this.selectedDistance); - this._activeEffect.setFloat("_Selected_Fade_Length_", this.selectedFadeLength); - this._activeEffect.setFloat("_Blob_Enable_", this.leftBlobEnable ? 1 : 0); - this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity); - this._activeEffect.setFloat("_Blob_Near_Size_", this.leftBlobNearSize); - this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize); - this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance); - this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance); - this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength); - this._activeEffect.setFloat("_Blob_Inner_Fade_", this.leftBlobInnerFade); - this._activeEffect.setFloat("_Blob_Pulse_", this.leftBlobPulse); - this._activeEffect.setFloat("_Blob_Fade_", this.leftBlobFade); - this._activeEffect.setFloat("_Blob_Enable_2_", this.rightBlobEnable ? 1 : 0); - this._activeEffect.setFloat("_Blob_Near_Size_2_", this.rightBlobNearSize); - this._activeEffect.setFloat("_Blob_Inner_Fade_2_", this.rightBlobInnerFade); - this._activeEffect.setFloat("_Blob_Pulse_2_", this.rightBlobPulse); - this._activeEffect.setFloat("_Blob_Fade_2_", this.rightBlobFade); - this._activeEffect.setVector3("_Active_Face_Dir_", this.activeFaceDir); - this._activeEffect.setVector3("_Active_Face_Up_", this.activeFaceUp); - this._activeEffect.setFloat("_Fade_Width_", this.fadeWidth); - this._activeEffect.setFloat("_Smooth_Active_Face_", this.smoothActiveFace ? 1 : 0); - this._activeEffect.setFloat("_Show_Frame_", this.showFrame ? 1 : 0); - this._activeEffect.setFloat("_Use_Blob_Texture_", this.useBlobTexture ? 1 : 0); - this._activeEffect.setFloat("Use_Global_Left_Index", 1); - this._activeEffect.setFloat("Use_Global_Right_Index", 1); - this._activeEffect.setVector4("Global_Left_Index_Tip_Position", new Vector4(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1)); - this._activeEffect.setVector4("Global_Right_Index_Tip_Position", new Vector4(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1)); - this._afterBind(mesh74, this._activeEffect); - } - getAnimatables() { - return []; - } - dispose(forceDisposeEffect) { - super.dispose(forceDisposeEffect); - } - clone(name271) { - return SerializationHelper.Clone(() => new FluentButtonMaterial(name271, this.getScene()), this); - } - serialize() { - const serializationObject = super.serialize(); - serializationObject.customType = "BABYLON.FluentButtonMaterial"; - return serializationObject; - } - getClassName() { - return "FluentButtonMaterial"; - } - static Parse(source, scene37, rootUrl) { - return SerializationHelper.Parse(() => new FluentButtonMaterial(source.name, scene37), source, scene37, rootUrl); - } -} -FluentButtonMaterial.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-button-blob.png"; -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "edgeWidth", undefined); -__decorate2([ - serializeAsColor4() -], FluentButtonMaterial.prototype, "edgeColor", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "proximityMaxIntensity", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "proximityFarDistance", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "proximityNearRadius", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "proximityAnisotropy", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "selectionFuzz", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "selected", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "selectionFade", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "selectionFadeSize", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "selectedDistance", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "selectedFadeLength", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "blobIntensity", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "blobFarSize", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "blobNearDistance", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "blobFarDistance", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "blobFadeLength", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "leftBlobEnable", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "leftBlobNearSize", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "leftBlobPulse", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "leftBlobFade", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "leftBlobInnerFade", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "rightBlobEnable", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "rightBlobNearSize", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "rightBlobPulse", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "rightBlobFade", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "rightBlobInnerFade", undefined); -__decorate2([ - serializeAsVector3() -], FluentButtonMaterial.prototype, "activeFaceDir", undefined); -__decorate2([ - serializeAsVector3() -], FluentButtonMaterial.prototype, "activeFaceUp", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "enableFade", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "fadeWidth", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "smoothActiveFace", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "showFrame", undefined); -__decorate2([ - serialize() -], FluentButtonMaterial.prototype, "useBlobTexture", undefined); -__decorate2([ - serializeAsVector3() -], FluentButtonMaterial.prototype, "globalLeftIndexTipPosition", undefined); -__decorate2([ - serializeAsVector3() -], FluentButtonMaterial.prototype, "globalRightIndexTipPosition", undefined); -RegisterClass("BABYLON.GUI.FluentButtonMaterial", FluentButtonMaterial); - -// node_modules/@babylonjs/gui/3D/controls/touchButton3D.js -class TouchButton3D extends Button3D { - constructor(name271, collisionMesh) { - super(name271); - this._isNearPressed = false; - this._interactionSurfaceHeight = 0; - this._isToggleButton = false; - this._toggleState = false; - this._toggleButtonCallback = () => { - this._onToggle(!this._toggleState); - }; - this.onToggleObservable = new Observable; - this.collidableFrontDirection = Vector3.Zero(); - if (collisionMesh) { - this.collisionMesh = collisionMesh; + }, + FlowGraphContextLogger: () => { + { + return FlowGraphContextLogger; } - } - get isActiveNearInteraction() { - return this._isNearPressed; - } - set collidableFrontDirection(frontWorldDir) { - this._collidableFrontDirection = frontWorldDir.normalize(); - if (this._collisionMesh) { - const invert = TmpVectors.Matrix[0]; - invert.copyFrom(this._collisionMesh.getWorldMatrix()); - invert.invert(); - Vector3.TransformNormalToRef(this._collidableFrontDirection, invert, this._collidableFrontDirection); - this._collidableFrontDirection.normalize(); + }, + FlowGraphContext: () => { + { + return FlowGraphContext; } - } - get collidableFrontDirection() { - if (this._collisionMesh) { - const transformedDirection = TmpVectors.Vector3[0]; - Vector3.TransformNormalToRef(this._collidableFrontDirection, this._collisionMesh.getWorldMatrix(), transformedDirection); - return transformedDirection.normalize(); + }, + FlowGraphConstantBlock: () => { + { + return FlowGraphConstantBlock; } - return this._collidableFrontDirection; - } - set collisionMesh(collisionMesh) { - var _a; - if (this._collisionMesh) { - this._collisionMesh.isNearPickable = false; - if ((_a = this._collisionMesh.reservedDataStore) === null || _a === undefined ? undefined : _a.GUI3D) { - this._collisionMesh.reservedDataStore.GUI3D = {}; - } - this._collisionMesh.getChildMeshes().forEach((mesh74) => { - var _a2; - mesh74.isNearPickable = false; - if ((_a2 = mesh74.reservedDataStore) === null || _a2 === undefined ? undefined : _a2.GUI3D) { - mesh74.reservedDataStore.GUI3D = {}; - } - }); + }, + FlowGraphConsoleLogBlock: () => { + { + return FlowGraphConsoleLogBlock; } - this._collisionMesh = collisionMesh; - this._injectGUI3DReservedDataStore(this._collisionMesh).control = this; - this._collisionMesh.isNearPickable = true; - this._collisionMesh.getChildMeshes().forEach((mesh74) => { - this._injectGUI3DReservedDataStore(mesh74).control = this; - mesh74.isNearPickable = true; - }); - this.collidableFrontDirection = collisionMesh.forward; - } - set isToggleButton(value) { - if (value === this._isToggleButton) { - return; + }, + FlowGraphConnectionType: () => { + { + return FlowGraphConnectionType; } - this._isToggleButton = value; - if (value) { - this.onPointerUpObservable.add(this._toggleButtonCallback); - } else { - this.onPointerUpObservable.removeCallback(this._toggleButtonCallback); - if (this._toggleState) { - this._onToggle(false); - } + }, + FlowGraphConnection: () => { + { + return FlowGraphConnection; } - } - get isToggleButton() { - return this._isToggleButton; - } - set isToggled(newState) { - if (this._isToggleButton && this._toggleState !== newState) { - this._onToggle(newState); + }, + FlowGraphConditionalDataBlock: () => { + { + return FlowGraphConditionalDataBlock; } - } - get isToggled() { - return this._toggleState; - } - _onToggle(newState) { - this._toggleState = newState; - this.onToggleObservable.notifyObservers(newState); - } - _isInteractionInFrontOfButton(collidablePos) { - return this._getInteractionHeight(collidablePos, this._collisionMesh.getAbsolutePosition()) > 0; - } - getPressDepth(touchPoint) { - if (!this._isNearPressed) { - return 0; + }, + FlowGraphClampBlock: () => { + { + return FlowGraphClampBlock; } - const interactionHeight = this._getInteractionHeight(touchPoint, this._collisionMesh.getAbsolutePosition()); - return this._interactionSurfaceHeight - interactionHeight; - } - _getInteractionHeight(interactionPos, basePos) { - const frontDir = this.collidableFrontDirection; - if (frontDir.length() === 0) { - return Vector3.Distance(interactionPos, basePos); + }, + FlowGraphCeilBlock: () => { + { + return FlowGraphCeilBlock; } - const d = Vector3.Dot(basePos, frontDir); - const abc = Vector3.Dot(interactionPos, frontDir); - return abc - d; - } - _generatePointerEventType(providedType, nearMeshPosition, activeInteractionCount) { - if (providedType === PointerEventTypes.POINTERDOWN || providedType === PointerEventTypes.POINTERMOVE) { - if (!this._isInteractionInFrontOfButton(nearMeshPosition)) { - return PointerEventTypes.POINTERMOVE; - } else { - this._isNearPressed = true; - this._interactionSurfaceHeight = this._getInteractionHeight(nearMeshPosition, this._collisionMesh.getAbsolutePosition()); - } + }, + FlowGraphBranchBlock: () => { + { + return FlowGraphBranchBlock; } - if (providedType === PointerEventTypes.POINTERUP) { - if (activeInteractionCount == 0) { - return PointerEventTypes.POINTERMOVE; - } else { - this._isNearPressed = false; - } + }, + FlowGraphBlock: () => { + { + return FlowGraphBlock; } - return providedType; - } - _getTypeName() { - return "TouchButton3D"; - } - _createNode(scene37) { - return super._createNode(scene37); - } - dispose() { - super.dispose(); - this.onPointerUpObservable.removeCallback(this._toggleButtonCallback); - this.onToggleObservable.clear(); - if (this._collisionMesh) { - this._collisionMesh.dispose(); + }, + FlowGraphBitwiseXorBlock: () => { + { + return FlowGraphBitwiseXorBlock; } - } -} - -// node_modules/@babylonjs/gui/3D/controls/touchHolographicButton.js -class TouchHolographicButton extends TouchButton3D { - _disposeTooltip() { - this._tooltipFade = null; - if (this._tooltipTextBlock) { - this._tooltipTextBlock.dispose(); + }, + FlowGraphBitwiseRightShiftBlock: () => { + { + return FlowGraphBitwiseRightShiftBlock; } - if (this._tooltipTexture) { - this._tooltipTexture.dispose(); + }, + FlowGraphBitwiseOrBlock: () => { + { + return FlowGraphBitwiseOrBlock; } - if (this._tooltipMesh) { - this._tooltipMesh.dispose(); + }, + FlowGraphBitwiseNotBlock: () => { + { + return FlowGraphBitwiseNotBlock; } - this.onPointerEnterObservable.remove(this._tooltipHoverObserver); - this.onPointerOutObservable.remove(this._tooltipOutObserver); - } - set renderingGroupId(id) { - this._backPlate.renderingGroupId = id; - this._textPlate.renderingGroupId = id; - this._frontPlate.renderingGroupId = id; - if (this._tooltipMesh) { - this._tooltipMesh.renderingGroupId = id; + }, + FlowGraphBitwiseLeftShiftBlock: () => { + { + return FlowGraphBitwiseLeftShiftBlock; } - } - get renderingGroupId() { - return this._backPlate.renderingGroupId; - } - get mesh() { - return this._backPlate; - } - set tooltipText(text) { - if (!text) { - this._disposeTooltip(); - return; + }, + FlowGraphBitwiseAndBlock: () => { + { + return FlowGraphBitwiseAndBlock; } - if (!this._tooltipFade) { - const rightHandedScene = this._backPlate._scene.useRightHandedSystem; - this._tooltipMesh = CreatePlane("", { size: 1 }, this._backPlate._scene); - const tooltipBackground = CreatePlane("", { size: 1, sideOrientation: Mesh.DOUBLESIDE }, this._backPlate._scene); - const mat = new StandardMaterial("", this._backPlate._scene); - mat.diffuseColor = Color3.FromHexString("#212121"); - tooltipBackground.material = mat; - tooltipBackground.isPickable = false; - this._tooltipMesh.addChild(tooltipBackground); - tooltipBackground.position = Vector3.Forward(rightHandedScene).scale(0.05); - this._tooltipMesh.scaling.y = 1 / 3; - this._tooltipMesh.position = Vector3.Up().scale(0.7).add(Vector3.Forward(rightHandedScene).scale(-0.15)); - this._tooltipMesh.isPickable = false; - this._tooltipMesh.parent = this._backPlate; - this._tooltipTexture = AdvancedDynamicTexture.CreateForMesh(this._tooltipMesh); - this._tooltipTextBlock = new TextBlock; - this._tooltipTextBlock.scaleY = 3; - this._tooltipTextBlock.color = "white"; - this._tooltipTextBlock.fontSize = 130; - this._tooltipTexture.addControl(this._tooltipTextBlock); - this._tooltipFade = new FadeInOutBehavior; - this._tooltipFade.delay = 500; - this._tooltipMesh.addBehavior(this._tooltipFade); - this._tooltipHoverObserver = this.onPointerEnterObservable.add(() => { - if (this._tooltipFade) { - this._tooltipFade.fadeIn(true); - } - }); - this._tooltipOutObserver = this.onPointerOutObservable.add(() => { - if (this._tooltipFade) { - this._tooltipFade.fadeIn(false); - } - }); + }, + FlowGraphAtanhBlock: () => { + { + return FlowGraphAtanhBlock; } - if (this._tooltipTextBlock) { - this._tooltipTextBlock.text = text; + }, + FlowGraphAtanBlock: () => { + { + return FlowGraphAtanBlock; } - } - get tooltipText() { - if (this._tooltipTextBlock) { - return this._tooltipTextBlock.text; + }, + FlowGraphAtan2Block: () => { + { + return FlowGraphAtan2Block; } - return null; - } - get text() { - return this._text; - } - set text(value) { - if (this._text === value) { - return; + }, + FlowGraphAsinhBlock: () => { + { + return FlowGraphAsinhBlock; } - this._text = value; - this._rebuildContent(); - } - get imageUrl() { - return this._imageUrl; - } - set imageUrl(value) { - if (this._imageUrl === value) { - return; + }, + FlowGraphAsinBlock: () => { + { + return FlowGraphAsinBlock; } - this._imageUrl = value; - this._rebuildContent(); - } - get backMaterial() { - return this._backMaterial; - } - get frontMaterial() { - return this._frontMaterial; - } - get plateMaterial() { - return this._plateMaterial; - } - get shareMaterials() { - return this._shareMaterials; - } - set isBackplateVisible(isVisible) { - if (this.mesh && !!this._backMaterial) { - if (isVisible && !this._isBackplateVisible) { - this._backPlate.visibility = 1; - } else if (!isVisible && this._isBackplateVisible) { - this._backPlate.visibility = 0; - } + }, + FlowGraphAddBlock: () => { + { + return FlowGraphAddBlock; } - this._isBackplateVisible = isVisible; - } - constructor(name271, shareMaterials = true) { - super(name271); - this._shareMaterials = true; - this._isBackplateVisible = true; - this._frontPlateDepth = 0.5; - this._backPlateDepth = 0.04; - this._backplateColor = new Color3(0.08, 0.15, 0.55); - this._backplateToggledColor = new Color3(0.25, 0.4, 0.95); - this._shareMaterials = shareMaterials; - this.pointerEnterAnimation = () => { - this._frontMaterial.leftBlobEnable = true; - this._frontMaterial.rightBlobEnable = true; - }; - this.pointerOutAnimation = () => { - this._frontMaterial.leftBlobEnable = false; - this._frontMaterial.rightBlobEnable = false; - }; - this.pointerDownAnimation = () => { - if (this._frontPlate && !this.isActiveNearInteraction) { - this._frontPlate.scaling.z = this._frontPlateDepth * 0.2; - this._frontPlate.position = Vector3.Forward(this._frontPlate._scene.useRightHandedSystem).scale((this._frontPlateDepth - 0.2 * this._frontPlateDepth) / 2); - this._textPlate.position = Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-(this._backPlateDepth + 0.2 * this._frontPlateDepth) / 2); - } - }; - this.pointerUpAnimation = () => { - if (this._frontPlate) { - this._frontPlate.scaling.z = this._frontPlateDepth; - this._frontPlate.position = Vector3.Forward(this._frontPlate._scene.useRightHandedSystem).scale((this._frontPlateDepth - this._frontPlateDepth) / 2); - this._textPlate.position = Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-(this._backPlateDepth + this._frontPlateDepth) / 2); - } - }; - this.onPointerMoveObservable.add((position) => { - if (this._frontPlate && this.isActiveNearInteraction) { - const scale = Vector3.Zero(); - if (this._backPlate.getWorldMatrix().decompose(scale, undefined, undefined)) { - let interactionHeight = this._getInteractionHeight(position, this._backPlate.getAbsolutePosition()) / scale.z; - interactionHeight = Scalar.Clamp(interactionHeight - this._backPlateDepth / 2, 0.2 * this._frontPlateDepth, this._frontPlateDepth); - this._frontPlate.scaling.z = interactionHeight; - this._frontPlate.position = Vector3.Forward(this._frontPlate._scene.useRightHandedSystem).scale((this._frontPlateDepth - interactionHeight) / 2); - this._textPlate.position = Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-(this._backPlateDepth + interactionHeight) / 2); - } - } - }); - this._pointerHoverObserver = this.onPointerMoveObservable.add((hoverPosition) => { - this._frontMaterial.globalLeftIndexTipPosition = hoverPosition; - }); - } - _getTypeName() { - return "TouchHolographicButton"; - } - _rebuildContent() { - this._disposeFacadeTexture(); - const panel = new StackPanel; - panel.isVertical = true; - if (IsDocumentAvailable() && !!document.createElement) { - if (this._imageUrl) { - const image6 = new Image2; - image6.source = this._imageUrl; - image6.paddingTop = "40px"; - image6.height = "180px"; - image6.width = "100px"; - image6.paddingBottom = "40px"; - panel.addControl(image6); - } + }, + FlowGraphAcoshBlock: () => { + { + return FlowGraphAcoshBlock; } - if (this._text) { - const text = new TextBlock; - text.text = this._text; - text.color = "white"; - text.height = "30px"; - text.fontSize = 24; - panel.addControl(text); + }, + FlowGraphAcosBlock: () => { + { + return FlowGraphAcosBlock; } - this.content = panel; - } - _createNode(scene37) { - var _a; - this.name = (_a = this.name) !== null && _a !== undefined ? _a : "TouchHolographicButton"; - const collisionMesh = CreateBox(`${this.name}_collisionMesh`, { - width: 1, - height: 1, - depth: this._frontPlateDepth - }, scene37); - collisionMesh.isPickable = true; - collisionMesh.isNearPickable = true; - collisionMesh.visibility = 0; - collisionMesh.position = Vector3.Forward(scene37.useRightHandedSystem).scale(-this._frontPlateDepth / 2); - SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MODEL_BASE_URL, TouchHolographicButton.MODEL_FILENAME, scene37).then((result) => { - const alphaMesh = CreateBox("${this.name}_alphaMesh", { - width: 1, - height: 1, - depth: 1 - }, scene37); - alphaMesh.isPickable = false; - alphaMesh.material = new StandardMaterial("${this.name}_alphaMesh_material", scene37); - alphaMesh.material.alpha = 0.15; - const importedFrontPlate = result.meshes[1]; - importedFrontPlate.name = `${this.name}_frontPlate`; - importedFrontPlate.isPickable = false; - importedFrontPlate.scaling.z = this._frontPlateDepth; - alphaMesh.parent = importedFrontPlate; - importedFrontPlate.parent = collisionMesh; - if (this._frontMaterial) { - importedFrontPlate.material = this._frontMaterial; - } - this._frontPlate = importedFrontPlate; - }); - this._backPlate = CreateBox(`${this.name}_backPlate`, { - width: 1, - height: 1, - depth: this._backPlateDepth - }, scene37); - this._backPlate.position = Vector3.Forward(scene37.useRightHandedSystem).scale(this._backPlateDepth / 2); - this._backPlate.isPickable = false; - this._textPlate = super._createNode(scene37); - this._textPlate.name = `${this.name}_textPlate`; - this._textPlate.isPickable = false; - this._textPlate.position = Vector3.Forward(scene37.useRightHandedSystem).scale(-this._frontPlateDepth / 2); - this._backPlate.addChild(collisionMesh); - this._backPlate.addChild(this._textPlate); - const tn = new TransformNode(`{this.name}_root`, scene37); - this._backPlate.setParent(tn); - this.collisionMesh = collisionMesh; - this.collidableFrontDirection = this._backPlate.forward.negate(); - return tn; - } - _applyFacade(facadeTexture) { - this._plateMaterial.emissiveTexture = facadeTexture; - this._plateMaterial.opacityTexture = facadeTexture; - this._plateMaterial.diffuseColor = new Color3(0.4, 0.4, 0.4); - } - _createBackMaterial(mesh75) { - this._backMaterial = new FluentMaterial(this.name + "backPlateMaterial", mesh75.getScene()); - this._backMaterial.albedoColor = this._backplateColor; - this._backMaterial.renderBorders = true; - this._backMaterial.renderHoverLight = false; - } - _createFrontMaterial(mesh75) { - this._frontMaterial = new FluentButtonMaterial(this.name + "Front Material", mesh75.getScene()); - } - _createPlateMaterial(mesh75) { - this._plateMaterial = new StandardMaterial(this.name + "Plate Material", mesh75.getScene()); - this._plateMaterial.specularColor = Color3.Black(); - } - _onToggle(newState) { - if (this._backMaterial) { - if (newState) { - this._backMaterial.albedoColor = this._backplateToggledColor; - } else { - this._backMaterial.albedoColor = this._backplateColor; - } + }, + FlowGraphAbsBlock: () => { + { + return FlowGraphAbsBlock; } - super._onToggle(newState); - } - _affectMaterial(mesh75) { - if (this._shareMaterials) { - if (!this._host._touchSharedMaterials["backFluentMaterial"]) { - this._createBackMaterial(mesh75); - this._host._touchSharedMaterials["backFluentMaterial"] = this._backMaterial; - } else { - this._backMaterial = this._host._touchSharedMaterials["backFluentMaterial"]; - } - if (!this._host._touchSharedMaterials["frontFluentMaterial"]) { - this._createFrontMaterial(mesh75); - this._host._touchSharedMaterials["frontFluentMaterial"] = this._frontMaterial; - } else { - this._frontMaterial = this._host._touchSharedMaterials["frontFluentMaterial"]; - } - } else { - this._createBackMaterial(mesh75); - this._createFrontMaterial(mesh75); + }, + FlowGraph: () => { + { + return FlowGraph; } - this._createPlateMaterial(mesh75); - this._backPlate.material = this._backMaterial; - this._textPlate.material = this._plateMaterial; - if (!this._isBackplateVisible) { - this._backPlate.visibility = 0; + }, + FilterPostProcess: () => { + { + return FilterPostProcess; } - if (this._frontPlate) { - this._frontPlate.material = this._frontMaterial; + }, + FilterMode: () => { + { + return FilterMode; } - this._rebuildContent(); - } - dispose() { - super.dispose(); - this._disposeTooltip(); - this.onPointerMoveObservable.remove(this._pointerHoverObserver); - if (!this.shareMaterials) { - this._backMaterial.dispose(); - this._frontMaterial.dispose(); - this._plateMaterial.dispose(); - if (this._pickedPointObserver) { - this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver); - this._pickedPointObserver = null; - } + }, + FilesInputStore: () => { + { + return FilesInputStore; } - } -} -TouchHolographicButton.MODEL_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/"; -TouchHolographicButton.MODEL_FILENAME = "mrtk-fluent-button.glb"; - -// node_modules/@babylonjs/gui/3D/behaviors/defaultBehavior.js -class DefaultBehavior { - constructor() { - this.followBehaviorEnabled = false; - this.sixDofDragBehaviorEnabled = true; - this.surfaceMagnetismBehaviorEnabled = true; - this._followBehavior = new FollowBehavior; - this._sixDofDragBehavior = new SixDofDragBehavior; - this._surfaceMagnetismBehavior = new SurfaceMagnetismBehavior; - } - get name() { - return "Default"; - } - get followBehavior() { - return this._followBehavior; - } - get sixDofDragBehavior() { - return this._sixDofDragBehavior; - } - get surfaceMagnetismBehavior() { - return this._surfaceMagnetismBehavior; - } - init() { - } - attach(ownerMesh, draggablesMeshes, sceneUnderstandingMeshes) { - this._scene = ownerMesh.getScene(); - this.attachedNode = ownerMesh; - this._addObservables(); - this._followBehavior.attach(ownerMesh); - this._sixDofDragBehavior.attach(ownerMesh); - this._sixDofDragBehavior.draggableMeshes = draggablesMeshes || null; - this._sixDofDragBehavior.faceCameraOnDragStart = true; - this._surfaceMagnetismBehavior.attach(ownerMesh, this._scene); - if (sceneUnderstandingMeshes) { - this._surfaceMagnetismBehavior.meshes = sceneUnderstandingMeshes; + }, + FilesInput: () => { + { + return FilesInput; } - this._surfaceMagnetismBehavior.enabled = false; - } - detach() { - this.attachedNode = null; - this._removeObservables(); - this._followBehavior.detach(); - this._sixDofDragBehavior.detach(); - this._surfaceMagnetismBehavior.detach(); - } - _addObservables() { - this._onBeforeRenderObserver = this._scene.onBeforeRenderObservable.add(() => { - this._followBehavior._enabled = !this._sixDofDragBehavior.isMoving && this.followBehaviorEnabled; - }); - this._onDragObserver = this._sixDofDragBehavior.onDragObservable.add((event) => { - this._sixDofDragBehavior.disableMovement = this._surfaceMagnetismBehavior.findAndUpdateTarget(event.pickInfo); - }); - } - _removeObservables() { - this._scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserver); - this._sixDofDragBehavior.onDragObservable.remove(this._onDragObserver); - } -} - -// node_modules/@babylonjs/gui/3D/materials/handle/shaders/handle.vertex.js -var name271 = "handleVertexShader"; -var shader271 = `precision highp float;attribute vec3 position;uniform vec3 positionOffset;uniform mat4 worldViewProjection;uniform float scale;void main(void) {vec4 vPos=vec4((vec3(position)+positionOffset)*scale,1.0);gl_Position=worldViewProjection*vPos;}`; -ShaderStore.ShadersStore[name271] = shader271; - -// node_modules/@babylonjs/gui/3D/materials/handle/shaders/handle.fragment.js -var name272 = "handlePixelShader"; -var shader272 = `uniform vec3 color;void main(void) {gl_FragColor=vec4(color,1.0);}`; -ShaderStore.ShadersStore[name272] = shader272; - -// node_modules/@babylonjs/gui/3D/materials/handle/handleMaterial.js -class HandleMaterial extends ShaderMaterial { - get hover() { - return this._hover; - } - set hover(b) { - this._hover = b; - this._updateInterpolationTarget(); - } - get drag() { - return this._drag; - } - set drag(b) { - this._drag = b; - this._updateInterpolationTarget(); - } - constructor(name273, scene37) { - super(name273, scene37, "handle", { - attributes: ["position"], - uniforms: ["worldViewProjection", "color", "scale", "positionOffset"], - needAlphaBlending: false, - needAlphaTesting: false - }); - this._hover = false; - this._drag = false; - this._color = new Color3; - this._scale = 1; - this._lastTick = -1; - this.animationLength = 100; - this.hoverColor = new Color3(0, 0.467, 0.84); - this.baseColor = new Color3(1, 1, 1); - this.hoverScale = 0.75; - this.baseScale = 0.35; - this.dragScale = 0.55; - this._positionOffset = Vector3.Zero(); - this._updateInterpolationTarget(); - this._lastTick = Date.now(); - this._onBeforeRender = this.getScene().onBeforeRenderObservable.add(() => { - const tick = Date.now(); - const delta = tick - this._lastTick; - const scaleDiff = this._targetScale - this._scale; - const colorDiff = TmpColors.Color3[0].copyFrom(this._targetColor).subtractToRef(this._color, TmpColors.Color3[0]); - this._scale = this._scale + scaleDiff * delta / this.animationLength; - colorDiff.scaleToRef(delta / this.animationLength, colorDiff); - this._color.addToRef(colorDiff, this._color); - this.setColor3("color", this._color); - this.setFloat("scale", this._scale); - this.setVector3("positionOffset", this._positionOffset); - this._lastTick = tick; - }); - } - _updateInterpolationTarget() { - if (this.drag) { - this._targetColor = this.hoverColor; - this._targetScale = this.dragScale; - } else if (this.hover) { - this._targetColor = this.hoverColor; - this._targetScale = this.hoverScale; - } else { - this._targetColor = this.baseColor; - this._targetScale = this.baseScale; + }, + FileToolsOptions: () => { + { + return FileToolsOptions; } - } - dispose() { - super.dispose(); - this.getScene().onBeforeRenderObservable.remove(this._onBeforeRender); - } -} - -// node_modules/@babylonjs/gui/3D/gizmos/gizmoHandle.js -var HandleState; -(function(HandleState2) { - HandleState2[HandleState2["IDLE"] = 0] = "IDLE"; - HandleState2[HandleState2["HOVER"] = 1] = "HOVER"; - HandleState2[HandleState2["DRAG"] = 2] = "DRAG"; -})(HandleState || (HandleState = {})); - -class GizmoHandle { - get state() { - return this._state; - } - get gizmo() { - return this._gizmo; - } - set hover(value) { - if (value) { - this._state |= HandleState.HOVER; - } else { - this._state &= ~HandleState.HOVER; + }, + FileTools: () => { + { + return FileTools; } - this._updateMaterial(); - } - set drag(value) { - if (value) { - this._state |= HandleState.DRAG; - } else { - this._state &= ~HandleState.DRAG; + }, + FeatureName: () => { + { + return FeatureName; } - this._updateMaterial(); - } - constructor(gizmo13, scene37) { - this._state = HandleState.IDLE; - this._materials = []; - this._scene = scene37; - this._gizmo = gizmo13; - this.node = this.createNode(); - this.node.reservedDataStore = { - handle: this - }; - } - _createMaterial(positionOffset) { - const mat = new HandleMaterial("handle", this._scene); - if (positionOffset) { - mat._positionOffset = positionOffset; + }, + FadeInOutBehavior: () => { + { + return FadeInOutBehavior; } - return mat; - } - _updateMaterial() { - const state = this._state; - for (const mat of this._materials) { - mat.hover = false; - mat.drag = false; + }, + FactorGradient: () => { + { + return FactorGradient; } - if (state & HandleState.DRAG) { - for (const mat of this._materials) { - mat.drag = true; - } - } else if (state & HandleState.HOVER) { - for (const mat of this._materials) { - mat.hover = true; - } + }, + ExtrudeShapeCustom: () => { + { + return ExtrudeShapeCustom; } - } - setDragBehavior(dragStartFn, dragFn, dragEndFn) { - const dragBehavior = new BaseSixDofDragBehavior; - this._dragBehavior = dragBehavior; - this._dragStartObserver = dragBehavior.onDragStartObservable.add(dragStartFn); - this._draggingObserver = dragBehavior.onDragObservable.add(dragFn); - this._dragEndObserver = dragBehavior.onDragEndObservable.add(dragEndFn); - this._dragBehavior.attach(this.node); - } - dispose() { - this._dragBehavior.onDragStartObservable.remove(this._dragStartObserver); - this._dragBehavior.onDragObservable.remove(this._draggingObserver); - this._dragBehavior.onDragEndObservable.remove(this._dragEndObserver); - this._dragBehavior.detach(); - for (const material27 of this._materials) { - material27.dispose(); + }, + ExtrudeShape: () => { + { + return ExtrudeShape; } - this.node.dispose(); - } -} - -class SideHandle extends GizmoHandle { - createNode() { - const verticalBox = CreateBox("sideVert", { width: 1, height: 10, depth: 0.1 }, this._scene); - const sideNode = new TransformNode("side", this._scene); - verticalBox.parent = sideNode; - const mat = this._createMaterial(); - verticalBox.material = mat; - verticalBox.isNearGrabbable = true; - this._materials.push(mat); - return sideNode; - } -} - -class CornerHandle extends GizmoHandle { - createNode() { - const horizontalBox = CreateBox("angleHor", { width: 3, height: 1, depth: 0.1 }, this._scene); - const verticalBox = CreateBox("angleVert", { width: 1, height: 3, depth: 0.1 }, this._scene); - const angleNode = new TransformNode("angle", this._scene); - horizontalBox.parent = angleNode; - verticalBox.parent = angleNode; - horizontalBox.material = this._createMaterial(new Vector3(1, 0, 0)); - verticalBox.material = this._createMaterial(new Vector3(0, 1, 0)); - verticalBox.isNearGrabbable = true; - horizontalBox.isNearGrabbable = true; - this._materials.push(horizontalBox.material); - this._materials.push(verticalBox.material); - return angleNode; - } -} - -// node_modules/@babylonjs/gui/3D/gizmos/slateGizmo.js -class SlateGizmo extends Gizmo { - set attachedSlate(control23) { - if (control23) { - this.attachedMesh = control23.mesh; - this.updateBoundingBox(); - this._pickedPointObserver = control23._host.onPickingObservable.add((pickedMesh) => { - if (this._handleHovered && (!pickedMesh || pickedMesh.parent !== this._handleHovered.node)) { - this._handleHovered.hover = false; - this._handleHovered = null; - } - if (pickedMesh && pickedMesh.parent && pickedMesh.parent.reservedDataStore && pickedMesh.parent.reservedDataStore.handle) { - const handle = pickedMesh.parent.reservedDataStore.handle; - if (handle.gizmo === this) { - this._handleHovered = handle; - this._handleHovered.hover = true; - } - } - }); - } else if (this._attachedSlate) { - this._attachedSlate._host.onPickingObservable.remove(this._pickedPointObserver); + }, + ExtrudePolygon: () => { + { + return ExtrudePolygon; } - this._attachedSlate = control23; - } - get attachedSlate() { - return this._attachedSlate; - } - constructor(utilityLayer) { - super(utilityLayer); - this._boundingDimensions = new Vector3(0, 0, 0); - this._renderObserver = null; - this._tmpQuaternion = new Quaternion; - this._tmpVector = new Vector3(0, 0, 0); - this._corners = []; - this._sides = []; - this._boundingBoxGizmo = { - min: new Vector3, - max: new Vector3 - }; - this._margin = 0.35; - this._handleSize = 0.075; - this._attachedSlate = null; - this._existingSlateScale = new Vector3; - this.fixedScreenSize = false; - this.fixedScreenSizeDistanceFactor = 10; - this._createNode(); - this.updateScale = false; - this._renderObserver = this.gizmoLayer.originalScene.onBeforeRenderObservable.add(() => { - if (this.attachedMesh && !this._existingSlateScale.equals(this.attachedMesh.scaling)) { - this.updateBoundingBox(); - } - }); - } - _createNode() { - this._handlesParent = new TransformNode("handlesParent", this.gizmoLayer.utilityLayerScene); - this._handlesParent.rotationQuaternion = Quaternion.Identity(); - const masksCorners = [ - { - dimensions: new Vector3(-1, -1, 0), - origin: new Vector3(1, 0, 0) - }, - { - dimensions: new Vector3(1, -1, 0), - origin: new Vector3(0, 0, 0) - }, - { - dimensions: new Vector3(1, 1, 0), - origin: new Vector3(0, 1, 0) - }, - { - dimensions: new Vector3(-1, 1, 0), - origin: new Vector3(1, 1, 0) - } - ]; - for (let i = 0;i < 4; i++) { - const corner = new CornerHandle(this, this.gizmoLayer.utilityLayerScene); - this._corners.push(corner); - corner.node.rotation.z = Math.PI / 2 * i; - corner.node.parent = this._handlesParent; - this._assignDragBehaviorCorners(corner, (originStart, dimensionsStart, offset, masks) => this._moveHandle(originStart, dimensionsStart, offset, masks, true), masksCorners[i]); + }, + ExtractHighlightsPostProcess: () => { + { + return ExtractHighlightsPostProcess; } - for (let i = 0;i < 4; i++) { - const side = new SideHandle(this, this.gizmoLayer.utilityLayerScene); - this._sides.push(side); - side.node.rotation.z = Math.PI / 2 * i; - side.node.parent = this._handlesParent; - this._assignDragBehaviorSides(side, i % 2 === 0 ? new Vector3(0, 1, 0) : new Vector3(1, 0, 0)); + }, + ExternalTexture: () => { + { + return ExternalTexture; } - this._handlesParent.parent = this._rootMesh; - } - _keepAspectRatio(vector, aspectRatio, invertDiagonal = false) { - const axis = TmpVectors.Vector3[0]; - axis.copyFromFloats(aspectRatio, 1, 0).normalize(); - if (invertDiagonal) { - axis.y *= -1; + }, + ExponentialEase: () => { + { + return ExponentialEase; } - const dot = Vector3.Dot(vector, axis); - vector.copyFrom(axis).scaleInPlace(dot); - } - _clampDimensions(vector, dimensions, mask, keepAspectRatio = false) { - const impact = TmpVectors.Vector3[0]; - impact.copyFrom(vector).multiplyInPlace(mask); - const clampedDimensions = TmpVectors.Vector3[1]; - clampedDimensions.copyFromFloats(Math.max(this._attachedSlate.minDimensions.x, impact.x + dimensions.x), Math.max(this._attachedSlate.minDimensions.y, impact.y + dimensions.y), 0); - if (keepAspectRatio) { - const ratio = dimensions.x / dimensions.y; - clampedDimensions.x = Math.max(clampedDimensions.x, clampedDimensions.y * ratio); - clampedDimensions.y = Math.max(clampedDimensions.y, clampedDimensions.x / ratio); + }, + ExecuteCodeAction: () => { + { + return ExecuteCodeAction; } - impact.copyFrom(clampedDimensions).subtractInPlace(dimensions); - vector.x = Math.sign(vector.x) * Math.abs(impact.x); - vector.y = Math.sign(vector.y) * Math.abs(impact.y); - } - _moveHandle(originStart, dimensionsStart, offset, masks, isCorner) { - if (!this._attachedSlate) { - return; + }, + EventState: () => { + { + return EventState; } - if (isCorner) { - const aspectRatio = dimensionsStart.x / dimensionsStart.y; - this._keepAspectRatio(offset, aspectRatio, masks.dimensions.x * masks.dimensions.y < 0); + }, + EventConstants: () => { + { + return EventConstants; } - this._clampDimensions(offset, dimensionsStart, masks.dimensions, isCorner); - const offsetOriginMasked = TmpVectors.Vector3[0]; - const offsetDimensionsMasked = TmpVectors.Vector3[1]; - offsetOriginMasked.copyFrom(offset).multiplyInPlace(masks.origin); - offsetDimensionsMasked.copyFrom(offset).multiplyInPlace(masks.dimensions); - this._attachedSlate.origin.copyFrom(originStart).addInPlace(offsetOriginMasked); - this._attachedSlate.dimensions.set(dimensionsStart.x + offsetDimensionsMasked.x, dimensionsStart.y + offsetDimensionsMasked.y); - } - _assignDragBehaviorCorners(handle, moveFn, masks) { - const dimensionsStart = new Vector3; - const originStart = new Vector3; - const dragOrigin = new Vector3; - const toObjectFrame = new Matrix; - const dragPlaneNormal = new Vector3; - const projectToRef = (position, normal, origin, ref) => { - position.subtractToRef(origin, TmpVectors.Vector3[0]); - const dot = Vector3.Dot(TmpVectors.Vector3[0], normal); - TmpVectors.Vector3[1].copyFrom(normal).scaleInPlace(dot); - TmpVectors.Vector3[0].subtractInPlace(TmpVectors.Vector3[1]); - TmpVectors.Vector3[0].addToRef(origin, ref); - }; - const dragStart = (event) => { - if (this.attachedSlate && this.attachedMesh) { - dimensionsStart.set(this.attachedSlate.dimensions.x, this.attachedSlate.dimensions.y, Epsilon); - originStart.copyFrom(this.attachedSlate.origin); - dragOrigin.copyFrom(event.position); - toObjectFrame.copyFrom(this.attachedMesh.computeWorldMatrix(true)); - toObjectFrame.invert(); - this.attachedSlate._followButton.isToggled = false; - Vector3.TransformNormalToRef(Vector3.Forward(), this.attachedMesh.getWorldMatrix(), dragPlaneNormal); - dragPlaneNormal.normalize(); - if (this._handleHovered) { - this._handleDragged = this._handleHovered; - this._handleDragged.drag = true; - } - } - }; - const dragging = (event) => { - if (this.attachedSlate && this.attachedMesh) { - projectToRef(event.position, dragPlaneNormal, dragOrigin, this._tmpVector); - this._tmpVector.subtractInPlace(dragOrigin); - Vector3.TransformNormalToRef(this._tmpVector, toObjectFrame, this._tmpVector); - moveFn(originStart, dimensionsStart, this._tmpVector, masks); - this.attachedSlate._positionElements(); - this.updateBoundingBox(); - } - }; - const dragEnd = () => { - if (this.attachedSlate && this.attachedNode) { - this.attachedSlate._updatePivot(); - if (this._handleDragged) { - this._handleDragged.drag = false; - this._handleDragged = null; - } - } - }; - handle.setDragBehavior(dragStart, dragging, dragEnd); - } - _assignDragBehaviorSides(handle, dragPlaneNormal) { - const quaternionOrigin = new Quaternion; - const dragOrigin = new Vector3; - const directionOrigin = new Vector3; - const worldPivot = new Vector3; - const worldPlaneNormal = new Vector3; - const dragStart = (event) => { - if (this.attachedSlate && this.attachedMesh) { - quaternionOrigin.copyFrom(this.attachedMesh.rotationQuaternion); - dragOrigin.copyFrom(event.position); - worldPivot.copyFrom(this.attachedMesh.getAbsolutePivotPoint()); - directionOrigin.copyFrom(dragOrigin).subtractInPlace(worldPivot).normalize(); - this.attachedSlate._followButton.isToggled = false; - Vector3.TransformNormalToRef(dragPlaneNormal, this.attachedMesh.getWorldMatrix(), worldPlaneNormal); - worldPlaneNormal.normalize(); - if (this._handleHovered) { - this._handleDragged = this._handleHovered; - this._handleDragged.drag = true; - } - } - }; - const dragging = (event) => { - if (this.attachedSlate && this.attachedMesh) { - this._tmpVector.copyFrom(event.position); - this._tmpVector.subtractInPlace(worldPivot); - this._tmpVector.normalize(); - const angle = -Vector3.GetAngleBetweenVectorsOnPlane(this._tmpVector, directionOrigin, worldPlaneNormal); - Quaternion.RotationAxisToRef(dragPlaneNormal, angle, this._tmpQuaternion); - quaternionOrigin.multiplyToRef(this._tmpQuaternion, this.attachedMesh.rotationQuaternion); - } - }; - const dragEnd = () => { - if (this.attachedSlate && this.attachedNode) { - this.attachedSlate._updatePivot(); - if (this._handleDragged) { - this._handleDragged.drag = false; - this._handleDragged = null; - } - } - }; - handle.setDragBehavior(dragStart, dragging, dragEnd); - } - _attachedNodeChanged(value) { - if (value) { - this.updateBoundingBox(); + }, + ErrorFilter: () => { + { + return ErrorFilter; } - } - updateBoundingBox() { - if (this.attachedMesh) { - PivotTools._RemoveAndStorePivotPoint(this.attachedMesh); - const originalParent = this.attachedMesh.parent; - this.attachedMesh.setParent(null); - this._update(); - if (!this.attachedMesh.rotationQuaternion) { - this.attachedMesh.rotationQuaternion = Quaternion.RotationYawPitchRoll(this.attachedMesh.rotation.y, this.attachedMesh.rotation.x, this.attachedMesh.rotation.z); - } - this._tmpQuaternion.copyFrom(this.attachedMesh.rotationQuaternion); - this._tmpVector.copyFrom(this.attachedMesh.position); - this.attachedMesh.rotationQuaternion.set(0, 0, 0, 1); - this.attachedMesh.position.set(0, 0, 0); - const boundingMinMax = this.attachedMesh.getHierarchyBoundingVectors(); - boundingMinMax.max.subtractToRef(boundingMinMax.min, this._boundingDimensions); - this._boundingBoxGizmo.min = boundingMinMax.min; - this._boundingBoxGizmo.max = boundingMinMax.max; - this._updateHandlesPosition(); - this._updateHandlesScaling(); - this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion); - this.attachedMesh.position.copyFrom(this._tmpVector); - PivotTools._RestorePivotPoint(this.attachedMesh); - this.attachedMesh.setParent(originalParent); - this.attachedMesh.computeWorldMatrix(true); - this._existingSlateScale.copyFrom(this.attachedMesh.scaling); + }, + ErrorCodes: () => { + { + return ErrorCodes; } - } - _updateHandlesPosition() { - const min = this._boundingBoxGizmo.min.clone(); - const max = this._boundingBoxGizmo.max.clone(); - const handleScaling = this._corners[0].node.scaling.length(); - min.x -= this._margin * handleScaling; - min.y -= this._margin * handleScaling; - max.x += this._margin * handleScaling; - max.y += this._margin * handleScaling; - const center = min.add(max).scaleInPlace(0.5); - this._corners[0].node.position.copyFromFloats(min.x, min.y, 0); - this._corners[1].node.position.copyFromFloats(max.x, min.y, 0); - this._corners[2].node.position.copyFromFloats(max.x, max.y, 0); - this._corners[3].node.position.copyFromFloats(min.x, max.y, 0); - this._sides[0].node.position.copyFromFloats(min.x, center.y, 0); - this._sides[1].node.position.copyFromFloats(center.x, min.y, 0); - this._sides[2].node.position.copyFromFloats(max.x, center.y, 0); - this._sides[3].node.position.copyFromFloats(center.x, max.y, 0); - } - _updateHandlesScaling() { - if (this._attachedSlate && this._attachedSlate.mesh) { - const scaledWidth = this._attachedSlate.mesh.scaling.x * this._attachedSlate.dimensions.x; - const scaledHeight = this._attachedSlate.mesh.scaling.y * this._attachedSlate.dimensions.y; - const scale = Math.min(scaledWidth, scaledHeight) * this._handleSize; - for (let index = 0;index < this._corners.length; index++) { - this._corners[index].node.scaling.setAll(scale); - } - for (let index = 0;index < this._sides.length; index++) { - this._sides[index].node.scaling.setAll(scale); - } + }, + EquiRectangularCubeTextureAssetTask: () => { + { + return EquiRectangularCubeTextureAssetTask; } - } - _update() { - super._update(); - if (!this.gizmoLayer.utilityLayerScene.activeCamera) { - return; + }, + EquiRectangularCubeTexture: () => { + { + return EquiRectangularCubeTexture; } - if (this._attachedSlate && this._attachedSlate.mesh) { - if (this.fixedScreenSize) { - this._attachedSlate.mesh.absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector); - const distanceFromCamera = this._handleSize * this._tmpVector.length() / this.fixedScreenSizeDistanceFactor; - for (let i = 0;i < this._corners.length; i++) { - this._corners[i].node.scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera); - } - for (let i = 0;i < this._sides.length; i++) { - this._sides[i].node.scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera); - } - } - this._updateHandlesPosition(); + }, + Epsilon: () => { + { + return Epsilon; } - } - dispose() { - this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver); - super.dispose(); - for (const corner of this._corners) { - corner.dispose(); + }, + EnvironmentTextureTools: () => { + { + return EnvironmentTextureTools; } - for (const side of this._sides) { - side.dispose(); + }, + EnvironmentHelper: () => { + { + return EnvironmentHelper; } - } -} - -// node_modules/@babylonjs/gui/3D/controls/holographicSlate.js -class HolographicSlate extends ContentDisplay3D { - get defaultBehavior() { - return this._defaultBehavior; - } - get dimensions() { - return this._dimensions; - } - set dimensions(value) { - let scale = 1; - if (value.x < this.minDimensions.x || value.y < this.minDimensions.y) { - const newRatio = value.x / value.y; - const minRatio = this.minDimensions.x / this.minDimensions.y; - if (minRatio > newRatio) { - scale = this.minDimensions.x / value.x; - } else { - scale = this.minDimensions.y / value.y; - } + }, + EngineView: () => { + { + return EngineView; } - this._dimensions.copyFrom(value).scaleInPlace(scale); - this._updatePivot(); - this._positionElements(); - } - get titleBarHeight() { - return this._titleBarHeight; - } - set titleBarHeight(value) { - this._titleBarHeight = value; - } - set renderingGroupId(id) { - this._titleBar.renderingGroupId = id; - this._titleBarTitle.renderingGroupId = id; - this._contentPlate.renderingGroupId = id; - this._backPlate.renderingGroupId = id; - } - get renderingGroupId() { - return this._titleBar.renderingGroupId; - } - set title(title) { - this._titleText = title; - if (this._titleTextComponent) { - this._titleTextComponent.text = title; + }, + EngineStore: () => { + { + return EngineStore; } - } - get title() { - return this._titleText; - } - constructor(name273) { - super(name273); - this.titleBarMargin = 0.005; - this.origin = new Vector3(0, 0, 0); - this._dimensions = new Vector2(21.875, 12.5); - this._titleBarHeight = 0.625; - this._titleText = ""; - this._contentScaleRatio = 1; - this.minDimensions = new Vector2(15.625, 6.25); - this.defaultDimensions = this._dimensions.clone(); - this._followButton = new TouchHolographicButton("followButton" + this.name); - this._followButton.isToggleButton = true; - this._closeButton = new TouchHolographicButton("closeButton" + this.name); - this._contentViewport = new Viewport(0, 0, 1, 1); - this._contentDragBehavior = new PointerDragBehavior({ - dragPlaneNormal: new Vector3(0, 0, -1) - }); - } - _applyFacade(facadeTexture) { - this._contentMaterial.albedoTexture = facadeTexture; - this._resetContentPositionAndZoom(); - this._applyContentViewport(); - facadeTexture.attachToMesh(this._contentPlate, true); - } - _addControl(control24) { - control24._host = this._host; - if (this._host.utilityLayer) { - control24._prepareNode(this._host.utilityLayer.utilityLayerScene); + }, + EngineInstrumentation: () => { + { + return EngineInstrumentation; } - } - _getTypeName() { - return "HolographicSlate"; - } - _positionElements() { - const followButton = this._followButton; - const closeButton = this._closeButton; - const titleBar = this._titleBar; - const titleBarTitle = this._titleBarTitle; - const contentPlate = this._contentPlate; - const backPlate = this._backPlate; - if (followButton && closeButton && titleBar) { - closeButton.scaling.setAll(this.titleBarHeight); - followButton.scaling.setAll(this.titleBarHeight); - closeButton.position.copyFromFloats(this.dimensions.x - this.titleBarHeight / 2, -this.titleBarHeight / 2, 0).addInPlace(this.origin); - followButton.position.copyFromFloats(this.dimensions.x - 3 * this.titleBarHeight / 2, -this.titleBarHeight / 2, 0).addInPlace(this.origin); - const contentPlateHeight = this.dimensions.y - this.titleBarHeight - this.titleBarMargin; - const rightHandScene = contentPlate.getScene().useRightHandedSystem; - titleBar.scaling.set(this.dimensions.x, this.titleBarHeight, Epsilon); - titleBarTitle.scaling.set(this.dimensions.x - 2 * this.titleBarHeight, this.titleBarHeight, Epsilon); - contentPlate.scaling.copyFromFloats(this.dimensions.x, contentPlateHeight, Epsilon); - backPlate.scaling.copyFromFloats(this.dimensions.x, contentPlateHeight, Epsilon); - titleBar.position.copyFromFloats(this.dimensions.x / 2, -(this.titleBarHeight / 2), 0).addInPlace(this.origin); - titleBarTitle.position.copyFromFloats(this.dimensions.x / 2 - this.titleBarHeight, -(this.titleBarHeight / 2), rightHandScene ? Epsilon : -Epsilon).addInPlace(this.origin); - contentPlate.position.copyFromFloats(this.dimensions.x / 2, -(this.titleBarHeight + this.titleBarMargin + contentPlateHeight / 2), 0).addInPlace(this.origin); - backPlate.position.copyFromFloats(this.dimensions.x / 2, -(this.titleBarHeight + this.titleBarMargin + contentPlateHeight / 2), rightHandScene ? -Epsilon : Epsilon).addInPlace(this.origin); - this._titleTextComponent.host.scaleTo(HolographicSlate._DEFAULT_TEXT_RESOLUTION_Y * titleBarTitle.scaling.x / titleBarTitle.scaling.y, HolographicSlate._DEFAULT_TEXT_RESOLUTION_Y); - const aspectRatio = this.dimensions.x / contentPlateHeight; - this._contentViewport.width = this._contentScaleRatio; - this._contentViewport.height = this._contentScaleRatio / aspectRatio; - this._applyContentViewport(); - if (this._gizmo) { - this._gizmo.updateBoundingBox(); - } + }, + EngineFormat: () => { + { + return EngineFormat; } - } - _applyContentViewport() { - var _a; - if (((_a = this._contentPlate) === null || _a === undefined ? undefined : _a.material) && this._contentPlate.material.albedoTexture) { - const tex = this._contentPlate.material.albedoTexture; - tex.uScale = this._contentScaleRatio; - tex.vScale = this._contentScaleRatio / this._contentViewport.width * this._contentViewport.height; - tex.uOffset = this._contentViewport.x; - tex.vOffset = this._contentViewport.y; + }, + EngineFactory: () => { + { + return EngineFactory; } - } - _resetContentPositionAndZoom() { - this._contentViewport.x = 0; - this._contentViewport.y = 1 - this._contentViewport.height / this._contentViewport.width; - this._contentScaleRatio = 1; - } - _updatePivot() { - if (!this.mesh) { - return; + }, + Engine: () => { + { + return Engine2; } - const center = new Vector3(this.dimensions.x * 0.5, -this.dimensions.y * 0.5, Epsilon); - center.addInPlace(this.origin); - center.z = 0; - const origin = new Vector3(0, 0, 0); - Vector3.TransformCoordinatesToRef(origin, this.mesh.computeWorldMatrix(true), origin); - this.mesh.setPivotPoint(center); - const origin2 = new Vector3(0, 0, 0); - Vector3.TransformCoordinatesToRef(origin2, this.mesh.computeWorldMatrix(true), origin2); - this.mesh.position.addInPlace(origin).subtractInPlace(origin2); - } - _createNode(scene37) { - const node30 = new Mesh("slate_" + this.name, scene37); - this._titleBar = CreateBox("titleBar_" + this.name, { size: 1 }, scene37); - this._titleBarTitle = CreatePlane("titleText_" + this.name, { size: 1 }, scene37); - this._titleBarTitle.parent = node30; - this._titleBarTitle.isPickable = false; - const adt = AdvancedDynamicTexture.CreateForMesh(this._titleBarTitle); - this._titleTextComponent = new TextBlock("titleText_" + this.name, this._titleText); - this._titleTextComponent.textWrapping = TextWrapping.Ellipsis; - this._titleTextComponent.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT; - this._titleTextComponent.color = "white"; - this._titleTextComponent.fontSize = HolographicSlate._DEFAULT_TEXT_RESOLUTION_Y / 2; - this._titleTextComponent.paddingLeft = HolographicSlate._DEFAULT_TEXT_RESOLUTION_Y / 4; - adt.addControl(this._titleTextComponent); - if (scene37.useRightHandedSystem) { - const faceUV = new Vector4(0, 0, 1, 1); - this._contentPlate = CreatePlane("contentPlate_" + this.name, { size: 1, sideOrientation: VertexData.BACKSIDE, frontUVs: faceUV }, scene37); - this._backPlate = CreatePlane("backPlate_" + this.name, { size: 1, sideOrientation: VertexData.FRONTSIDE }, scene37); - } else { - const faceUV = new Vector4(0, 0, 1, 1); - this._contentPlate = CreatePlane("contentPlate_" + this.name, { size: 1, sideOrientation: VertexData.FRONTSIDE, frontUVs: faceUV }, scene37); - this._backPlate = CreatePlane("backPlate_" + this.name, { size: 1, sideOrientation: VertexData.BACKSIDE }, scene37); + }, + EndsWith: () => { + { + return EndsWith; } - this._titleBar.parent = node30; - this._titleBar.isNearGrabbable = true; - this._contentPlate.parent = node30; - this._backPlate.parent = node30; - this._attachContentPlateBehavior(); - this._addControl(this._followButton); - this._addControl(this._closeButton); - const followButton = this._followButton; - const closeButton = this._closeButton; - followButton.node.parent = node30; - closeButton.node.parent = node30; - this._positionElements(); - this._followButton.imageUrl = HolographicSlate.ASSETS_BASE_URL + HolographicSlate.FOLLOW_ICON_FILENAME; - this._closeButton.imageUrl = HolographicSlate.ASSETS_BASE_URL + HolographicSlate.CLOSE_ICON_FILENAME; - this._followButton.isBackplateVisible = false; - this._closeButton.isBackplateVisible = false; - this._followButton.onToggleObservable.add((isToggled) => { - this._defaultBehavior.followBehaviorEnabled = isToggled; - if (this._defaultBehavior.followBehaviorEnabled) { - this._defaultBehavior.followBehavior.recenter(); - } - }); - this._closeButton.onPointerClickObservable.add(() => { - this.dispose(); - }); - node30.rotationQuaternion = Quaternion.Identity(); - node30.isVisible = false; - return node30; - } - _attachContentPlateBehavior() { - this._contentDragBehavior.attach(this._contentPlate); - this._contentDragBehavior.moveAttached = false; - this._contentDragBehavior.useObjectOrientationForDragging = true; - this._contentDragBehavior.updateDragPlane = false; - const origin = new Vector3; - const worldDimensions = new Vector3; - const upWorld = new Vector3; - const rightWorld = new Vector3; - const projectedOffset = new Vector2; - let startViewport; - let worldMatrix; - this._contentDragBehavior.onDragStartObservable.add((event) => { - if (!this.node) { - return; - } - startViewport = this._contentViewport.clone(); - worldMatrix = this.node.computeWorldMatrix(true); - origin.copyFrom(event.dragPlanePoint); - worldDimensions.set(this.dimensions.x, this.dimensions.y, Epsilon); - worldDimensions.y -= this.titleBarHeight + this.titleBarMargin; - Vector3.TransformNormalToRef(worldDimensions, worldMatrix, worldDimensions); - upWorld.copyFromFloats(0, 1, 0); - Vector3.TransformNormalToRef(upWorld, worldMatrix, upWorld); - rightWorld.copyFromFloats(1, 0, 0); - Vector3.TransformNormalToRef(rightWorld, worldMatrix, rightWorld); - upWorld.normalize(); - upWorld.scaleInPlace(1 / Vector3.Dot(upWorld, worldDimensions)); - rightWorld.normalize(); - rightWorld.scaleInPlace(1 / Vector3.Dot(rightWorld, worldDimensions)); - }); - const offset = new Vector3; - this._contentDragBehavior.onDragObservable.add((event) => { - offset.copyFrom(event.dragPlanePoint); - offset.subtractInPlace(origin); - projectedOffset.copyFromFloats(Vector3.Dot(offset, rightWorld), Vector3.Dot(offset, upWorld)); - this._contentViewport.x = Scalar.Clamp(startViewport.x - offset.x, 0, 1 - this._contentViewport.width * this._contentScaleRatio); - this._contentViewport.y = Scalar.Clamp(startViewport.y - offset.y, 0, 1 - this._contentViewport.height * this._contentScaleRatio); - this._applyContentViewport(); - }); - } - _affectMaterial(mesh76) { - this._titleBarMaterial = new FluentBackplateMaterial(`${this.name} plateMaterial`, mesh76.getScene()); - this._contentMaterial = new FluentMaterial(`${this.name} contentMaterial`, mesh76.getScene()); - this._contentMaterial.renderBorders = true; - this._backMaterial = new FluentBackplateMaterial(`${this.name} backPlate`, mesh76.getScene()); - this._backMaterial.lineWidth = Epsilon; - this._backMaterial.radius = 0.005; - this._backMaterial.backFaceCulling = true; - this._titleBar.material = this._titleBarMaterial; - this._contentPlate.material = this._contentMaterial; - this._backPlate.material = this._backMaterial; - this._resetContent(); - this._applyContentViewport(); - } - _prepareNode(scene37) { - super._prepareNode(scene37); - this._gizmo = new SlateGizmo(this._host.utilityLayer); - this._gizmo.attachedSlate = this; - this._defaultBehavior = new DefaultBehavior; - this._defaultBehavior.attach(this.node, [this._titleBar]); - this._defaultBehavior.sixDofDragBehavior.onDragStartObservable.add(() => { - this._followButton.isToggled = false; - }); - this._positionChangedObserver = this._defaultBehavior.sixDofDragBehavior.onPositionChangedObservable.add(() => { - this._gizmo.updateBoundingBox(); - }); - this._updatePivot(); - this.resetDefaultAspectAndPose(false); - } - resetDefaultAspectAndPose(resetAspect = true) { - if (!this._host || !this._host.utilityLayer || !this.node) { - return; + }, + EncodeArrayBufferToBase64: () => { + { + return EncodeArrayBufferToBase64; } - const scene37 = this._host.utilityLayer.utilityLayerScene; - const camera32 = scene37.activeCamera; - if (camera32) { - const worldMatrix = camera32.getWorldMatrix(); - const backward = Vector3.TransformNormal(Vector3.Backward(scene37.useRightHandedSystem), worldMatrix); - this.origin.setAll(0); - this._gizmo.updateBoundingBox(); - const pivot = this.node.getAbsolutePivotPoint(); - this.node.position.copyFrom(camera32.position).subtractInPlace(backward).subtractInPlace(pivot); - this.node.rotationQuaternion = Quaternion.FromLookDirectionLH(backward, new Vector3(0, 1, 0)); - if (resetAspect) { - this.dimensions = this.defaultDimensions; - } + }, + ElbowBlock: () => { + { + return ElbowBlock; } - } - dispose() { - super.dispose(); - this._titleBarMaterial.dispose(); - this._contentMaterial.dispose(); - this._titleBar.dispose(); - this._titleBarTitle.dispose(); - this._contentPlate.dispose(); - this._backPlate.dispose(); - this._followButton.dispose(); - this._closeButton.dispose(); - this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver); - this._defaultBehavior.sixDofDragBehavior.onPositionChangedObservable.remove(this._positionChangedObserver); - this._defaultBehavior.detach(); - this._gizmo.dispose(); - this._contentDragBehavior.detach(); - } -} -HolographicSlate.ASSETS_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/"; -HolographicSlate.CLOSE_ICON_FILENAME = "IconClose.png"; -HolographicSlate.FOLLOW_ICON_FILENAME = "IconFollowMe.png"; -HolographicSlate._DEFAULT_TEXT_RESOLUTION_Y = 102.4; -// node_modules/@babylonjs/gui/3D/controls/nearMenu.js -class NearMenu extends TouchHolographicMenu { - get defaultBehavior() { - return this._defaultBehavior; - } - get isPinned() { - return this._isPinned; - } - set isPinned(value) { - if (this._pinButton.isToggled !== value) { - this._pinButton.isToggled = value; - return; + }, + ElasticEase: () => { + { + return ElasticEase; } - this._isPinned = value; - if (value) { - this._defaultBehavior.followBehaviorEnabled = false; - } else { - this._defaultBehavior.followBehaviorEnabled = true; + }, + EffectWrapper: () => { + { + return EffectWrapper; } - } - _createPinButton(parent) { - const control24 = new TouchHolographicButton("pin" + this.name, false); - control24.imageUrl = NearMenu._ASSETS_BASE_URL + NearMenu._PIN_ICON_FILENAME; - control24.parent = this; - control24._host = this._host; - control24.isToggleButton = true; - control24.onToggleObservable.add((newState) => { - this.isPinned = newState; - }); - if (this._host.utilityLayer) { - control24._prepareNode(this._host.utilityLayer.utilityLayerScene); - control24.scaling.scaleInPlace(TouchHolographicMenu.MENU_BUTTON_SCALE); - if (control24.node) { - control24.node.parent = parent; - } + }, + EffectRenderer: () => { + { + return EffectRenderer; } - return control24; - } - _createNode(scene37) { - const node30 = super._createNode(scene37); - this._pinButton = this._createPinButton(node30); - this.isPinned = false; - this._defaultBehavior.attach(node30, [this._backPlate]); - this._defaultBehavior.followBehavior.ignoreCameraPitchAndRoll = true; - this._defaultBehavior.followBehavior.pitchOffset = -15; - this._defaultBehavior.followBehavior.minimumDistance = 0.3; - this._defaultBehavior.followBehavior.defaultDistance = 0.4; - this._defaultBehavior.followBehavior.maximumDistance = 0.6; - this._backPlate.isNearGrabbable = true; - node30.isVisible = false; - return node30; - } - _finalProcessing() { - super._finalProcessing(); - this._pinButton.position.copyFromFloats((this._backPlate.scaling.x + TouchHolographicMenu.MENU_BUTTON_SCALE) / 2, this._backPlate.scaling.y / 2, 0); - } - constructor(name273) { - super(name273); - this._isPinned = false; - this._defaultBehavior = new DefaultBehavior; - this._dragObserver = this._defaultBehavior.sixDofDragBehavior.onDragObservable.add(() => { - this.isPinned = true; - }); - this.backPlateMargin = 1; - } - dispose() { - super.dispose(); - this._defaultBehavior.sixDofDragBehavior.onDragObservable.remove(this._dragObserver); - this._defaultBehavior.detach(); - } -} -NearMenu._ASSETS_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/"; -NearMenu._PIN_ICON_FILENAME = "IconPin.png"; -// node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js -var name273 = "mrdlSliderBarPixelShader"; -var shader273 = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform vec4 Global_Left_Index_Middle_Position;uniform vec4 Global_Right_Index_Middle_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Blob_Fragment_B30( -sampler2D Blob_Texture, -vec4 Blob_Info1, -vec4 Blob_Info2, -out vec4 Blob_Color) -{float k1=dot(Blob_Info1.xy,Blob_Info1.xy);float k2=dot(Blob_Info2.xy,Blob_Info2.xy);vec3 closer=k10.0) {C=mix(H,S,k);} else {C=mix(H,G,k); } -return C;} -void Sky_Environment_B50( -vec3 Normal, -vec3 Reflected, -vec4 Sky_Color, -vec4 Horizon_Color, -vec4 Ground_Color, -float Horizon_Power, -out vec4 Reflected_Color, -out vec4 Indirect_Color) -{Reflected_Color=SampleEnv_Bid50(Reflected,Sky_Color,Horizon_Color,Ground_Color,Horizon_Power);Indirect_Color=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);} -void Min_Segment_Distance_B65( -vec3 P0, -vec3 P1, -vec3 Q0, -vec3 Q1, -out vec3 NearP, -out vec3 NearQ, -out float Distance) -{vec3 u=P1-P0;vec3 v=Q1-Q0;vec3 w=P0-Q0;float a=dot(u,u);float b=dot(u,v);float c=dot(v,v);float d=dot(u,w);float e=dot(v,w);float D=a*c-b*b;float sD=D;float tD=D;float sc,sN,tc,tN;if (D<0.00001) {sN=0.0;sD=1.0;tN=e;tD=c;} else {sN=(b*e-c*d);tN=(a*e-b*d);if (sN<0.0) {sN=0.0;tN=e;tD=c;} else if (sN>sD) {sN=sD;tN=e+b;tD=c;}} -if (tN<0.0) {tN=0.0;if (-d<0.0) {sN=0.0;} else if (-d>a) {sN=sD;} else {sN=-d;sD=a;}} else if (tN>tD) {tN=tD;if ((-d+b)<0.0) {sN=0.0;} else if ((-d+b)>a) {sN=sD;} else {sN=(-d+b);sD=a;}} -sc=abs(sN)<0.000001 ? 0.0 : sN/sD;tc=abs(tN)<0.000001 ? 0.0 : tN/tD;NearP=P0+sc*u;NearQ=Q0+tc*v;Distance=distance(NearP,NearQ);} -void To_XYZ_B74( -vec3 Vec3, -out float X, -out float Y, -out float Z) -{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;} -void Finger_Positions_B64( -vec3 Left_Index_Pos, -vec3 Right_Index_Pos, -vec3 Left_Index_Middle_Pos, -vec3 Right_Index_Middle_Pos, -out vec3 Left_Index, -out vec3 Right_Index, -out vec3 Left_Index_Middle, -out vec3 Right_Index_Middle) -{Left_Index= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Left_Index_Pos);Right_Index= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Right_Index_Pos);Left_Index_Middle= (Use_Global_Left_Index ? Global_Left_Index_Middle_Position.xyz : Left_Index_Middle_Pos);Right_Index_Middle= (Use_Global_Right_Index ? Global_Right_Index_Middle_Position.xyz : Right_Index_Middle_Pos);} -void VaryHSV_B108( -vec3 HSV_In, -float Hue_Shift, -float Saturation_Shift, -float Value_Shift, -out vec3 HSV_Out) -{HSV_Out=vec3(fract(HSV_In.x+Hue_Shift),clamp(HSV_In.y+Saturation_Shift,0.0,1.0),clamp(HSV_In.z+Value_Shift,0.0,1.0));} -void Remap_Range_B114( -float In_Min, -float In_Max, -float Out_Min, -float Out_Max, -float In, -out float Out) -{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));} -void To_HSV_B75( -vec4 Color, -out float Hue, -out float Saturation, -out float Value, -out float Alpha, -out vec3 HSV) -{vec4 K=vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);vec4 p=Color.g0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;} -void Conditional_Float_B36( -bool Which, -float If_True, -float If_False, -out float Result) -{Result=Which ? If_True : If_False;} -void Greater_Than_B37( -float Left, -float Right, -out bool Not_Greater_Than, -out bool Greater_Than) -{Greater_Than=Left>Right;Not_Greater_Than=!Greater_Than;} -void Remap_Range_B105( -float In_Min, -float In_Max, -float Out_Min, -float Out_Max, -float In, -out float Out) -{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));} -void main() -{vec2 XY_Q85;XY_Q85=(uv-vec2(0.5,0.5))*_Decal_Scale_XY_+vec2(0.5,0.5);vec3 Tangent_World_Q27;vec3 Tangent_World_N_Q27;float Tangent_Length_Q27;Tangent_World_Q27=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q27=length(Tangent_World_Q27);Tangent_World_N_Q27=Tangent_World_Q27/Tangent_Length_Q27;vec3 Normal_World_Q60;vec3 Normal_World_N_Q60;float Normal_Length_Q60;Object_To_World_Dir_B60(vec3(0,0,1),Normal_World_Q60,Normal_World_N_Q60,Normal_Length_Q60);float X_Q78;float Y_Q78;float Z_Q78;To_XYZ_B78(position,X_Q78,Y_Q78,Z_Q78);vec3 Nrm_World_Q26;Nrm_World_Q26=normalize((world*vec4(normal,0.0)).xyz);vec3 Binormal_World_Q28;vec3 Binormal_World_N_Q28;float Binormal_Length_Q28;Object_To_World_Dir_B28(vec3(0,1,0),Binormal_World_Q28,Binormal_World_N_Q28,Binormal_Length_Q28);float Anisotropy_Q29=Tangent_Length_Q27/Binormal_Length_Q28;float Result_Q69;Pick_Radius_B69(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q69);float Anisotropy_Q53=Binormal_Length_Q28/Normal_Length_Q60;bool Not_Greater_Than_Q37;bool Greater_Than_Q37;Greater_Than_B37(Z_Q78,0.0,Not_Greater_Than_Q37,Greater_Than_Q37);vec4 Linear_Q101;Linear_Q101.rgb=clamp(_Left_Color_.rgb*_Left_Color_.rgb,0.0,1.0);Linear_Q101.a=_Left_Color_.a;vec4 Linear_Q102;Linear_Q102.rgb=clamp(_Right_Color_.rgb*_Right_Color_.rgb,0.0,1.0);Linear_Q102.a=_Right_Color_.a;vec3 Difference_Q61=vec3(0,0,0)-Normal_World_N_Q60;vec4 Out_Color_Q34=vec4(X_Q78,Y_Q78,Z_Q78,1);float Result_Q36;Conditional_Float_B36(Greater_Than_Q37,_Bevel_Back_,_Bevel_Front_,Result_Q36);float Result_Q94;Conditional_Float_B36(Greater_Than_Q37,_Bevel_Back_Stretch_,_Bevel_Front_Stretch_,Result_Q94);vec3 New_P_Q130;vec2 New_UV_Q130;float Radial_Gradient_Q130;vec3 Radial_Dir_Q130;vec3 New_Normal_Q130;Move_Verts_B130(Anisotropy_Q29,position,Result_Q69,Result_Q36,normal,Anisotropy_Q53,Result_Q94,New_P_Q130,New_UV_Q130,Radial_Gradient_Q130,Radial_Dir_Q130,New_Normal_Q130);float X_Q98;float Y_Q98;X_Q98=New_UV_Q130.x;Y_Q98=New_UV_Q130.y;vec3 Pos_World_Q12;Object_To_World_Pos_B12(New_P_Q130,Pos_World_Q12);vec3 Nrm_World_Q32;Object_To_World_Normal_B32(New_Normal_Q130,Nrm_World_Q32);vec4 Blob_Info_Q23; -#if BLOB_ENABLE -Blob_Vertex_B23(Pos_World_Q12,Nrm_World_Q26,Tangent_World_N_Q27,Binormal_World_N_Q28,_Blob_Position_,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q23); -#else -Blob_Info_Q23=vec4(0,0,0,0); -#endif -vec4 Blob_Info_Q24; -#if BLOB_ENABLE_2 -Blob_Vertex_B24(Pos_World_Q12,Nrm_World_Q26,Tangent_World_N_Q27,Binormal_World_N_Q28,_Blob_Position_2_,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q24); -#else -Blob_Info_Q24=vec4(0,0,0,0); -#endif -float Out_Q105;Remap_Range_B105(0.0,1.0,0.0,1.0,X_Q98,Out_Q105);float X_Q86;float Y_Q86;float Z_Q86;To_XYZ_B78(Nrm_World_Q32,X_Q86,Y_Q86,Z_Q86);vec4 Color_At_T_Q97=mix(Linear_Q101,Linear_Q102,Out_Q105);float Minus_F_Q87=-Z_Q86;float R_Q99;float G_Q99;float B_Q99;float A_Q99;R_Q99=Color_At_T_Q97.r; G_Q99=Color_At_T_Q97.g; B_Q99=Color_At_T_Q97.b; A_Q99=Color_At_T_Q97.a;float ClampF_Q88=clamp(0.0,Minus_F_Q87,1.0);float Result_Q93;Conditional_Float_B93(_Decal_Front_Only_,ClampF_Q88,1.0,Result_Q93);vec4 Vec4_Q89=vec4(Result_Q93,Radial_Gradient_Q130,G_Q99,B_Q99);vec3 Position=Pos_World_Q12;vec3 Normal=Nrm_World_Q32;vec2 UV=XY_Q85;vec3 Tangent=Tangent_World_N_Q27;vec3 Binormal=Difference_Q61;vec4 Color=Out_Color_Q34;vec4 Extra1=Vec4_Q89;vec4 Extra2=Blob_Info_Q23;vec4 Extra3=Blob_Info_Q24;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}`; -ShaderStore.ShadersStore[name274] = shader274; - -// node_modules/@babylonjs/gui/3D/materials/mrdl/mrdlSliderBarMaterial.js -class MRDLSliderBarMaterialDefines extends MaterialDefines { - constructor() { - super(); - this.SKY_ENABLED = true; - this.BLOB_ENABLE_2 = true; - this.IRIDESCENCE_ENABLED = true; - this._needNormals = true; - this._needUVs = true; - this.rebuild(); - } -} - -class MRDLSliderBarMaterial extends PushMaterial { - constructor(name275, scene37) { - super(name275, scene37); - this.radius = 0.6; - this.bevelFront = 0.6; - this.bevelFrontStretch = 0.077; - this.bevelBack = 0; - this.bevelBackStretch = 0; - this.radiusTopLeft = 1; - this.radiusTopRight = 1; - this.radiusBottomLeft = 1; - this.radiusBottomRight = 1; - this.bulgeEnabled = false; - this.bulgeHeight = -0.323; - this.bulgeRadius = 0.73; - this.sunIntensity = 1.102; - this.sunTheta = 0.76; - this.sunPhi = 0.526; - this.indirectDiffuse = 0.658; + }, + EffectLayerSceneComponent: () => { + { + return EffectLayerSceneComponent; + } + }, + EffectLayer: () => { + { + return EffectLayer; + } + }, + EffectFallbacks: () => { + { + return EffectFallbacks; + } + }, + Effect: () => { + { + return Effect; + } + }, + EdgesRenderer: () => { + { + return EdgesRenderer; + } + }, + EasingFunction: () => { + { + return EasingFunction; + } + }, + DynamicTexture: () => { + { + return DynamicTexture; + } + }, + DynamicFloat32Array: () => { + { + return DynamicFloat32Array; + } + }, + DumpTools: () => { + { + return DumpTools; + } + }, + DualShockPad: () => { + { + return DualShockPad; + } + }, + DualShockInput: () => { + { + return DualShockInput; + } + }, + DualShockDpad: () => { + { + return DualShockDpad; + } + }, + DualShockButton: () => { + { + return DualShockButton; + } + }, + DualSenseInput: () => { + { + return DualSenseInput; + } + }, + DrawWrapper: () => { + { + return DrawWrapper; + } + }, + DracoCompression: () => { + { + return DracoCompression; + } + }, + DotBlock: () => { + { + return DotBlock; + } + }, + DomManagement: () => { + { + return DomManagement; + } + }, + DoNothingAction: () => { + { + return DoNothingAction; + } + }, + DivideBlock: () => { + { + return DivideBlock; + } + }, + DistanceJoint: () => { + { + return DistanceJoint; + } + }, + DistanceConstraint: () => { + { + return DistanceConstraint; + } + }, + DistanceBlock: () => { + { + return DistanceBlock; + } + }, + DisplayPassPostProcess: () => { + { + return DisplayPassPostProcess; + } + }, + DiscardBlock: () => { + { + return DiscardBlock; + } + }, + DiscBuilder: () => { + { + return DiscBuilder; + } + }, + DiscBlock: () => { + { + return DiscBlock; + } + }, + DirectionalLightFrustumViewer: () => { + { + return DirectionalLightFrustumViewer; + } + }, + DirectionalLight: () => { + { + return DirectionalLight; + } + }, + DeviceType: () => { + { + return DeviceType; + } + }, + DeviceSourceManager: () => { + { + return DeviceSourceManager; + } + }, + DeviceSource: () => { + { + return DeviceSource; + } + }, + DeviceOrientationCamera: () => { + { + return DeviceOrientationCamera; + } + }, + DeviceLostReason: () => { + { + return DeviceLostReason; + } + }, + DeviceInputEventType: () => { + { + return DeviceInputEventType; + } + }, + DetailMapConfiguration: () => { + { + return DetailMapConfiguration; + } + }, + DesaturateBlock: () => { + { + return DesaturateBlock; + } + }, + DerivativeBlock: () => { + { + return DerivativeBlock; + } + }, + DepthSortedParticle: () => { + { + return DepthSortedParticle; + } + }, + DepthRendererSceneComponent: () => { + { + return DepthRendererSceneComponent; + } + }, + DepthRenderer: () => { + { + return DepthRenderer; + } + }, + DepthReducer: () => { + { + return DepthReducer; + } + }, + DepthPeelingSceneComponent: () => { + { + return DepthPeelingSceneComponent; + } + }, + DepthPeelingRenderer: () => { + { + return DepthPeelingRenderer; + } + }, + DepthOfFieldMergePostProcess: () => { + { + return DepthOfFieldMergePostProcess; + } + }, + DepthOfFieldEffectBlurLevel: () => { + { + return DepthOfFieldEffectBlurLevel; + } + }, + DepthOfFieldEffect: () => { + { + return DepthOfFieldEffect; + } + }, + DepthOfFieldBlurPostProcess: () => { + { + return DepthOfFieldBlurPostProcess; + } + }, + DepthCullingState: () => { + { + return DepthCullingState; + } + }, + Deferred: () => { + { + return Deferred; + } + }, + DefaultRenderingPipeline: () => { + { + return DefaultRenderingPipeline; + } + }, + DefaultLoadingScreen: () => { + { + return DefaultLoadingScreen; + } + }, + DefaultKTX2DecoderOptions: () => { + { + return DefaultKTX2DecoderOptions; + } + }, + DefaultCollisionCoordinator: () => { + { + return DefaultCollisionCoordinator; + } + }, + DeepCopier: () => { + { + return DeepCopier; + } + }, + DecodeBase64UrlToString: () => { + { + return DecodeBase64UrlToString; + } + }, + DecodeBase64UrlToBinary: () => { + { + return DecodeBase64UrlToBinary; + } + }, + DecodeBase64ToString: () => { + { + return DecodeBase64ToString; + } + }, + DecodeBase64ToBinary: () => { + { + return DecodeBase64ToBinary; + } + }, + Decode: () => { + { + return Decode; + } + }, + DecalMapDefines: () => { + { + return DecalMapDefines; + } + }, + DecalMapConfiguration: () => { + { + return DecalMapConfiguration; + } + }, + DecalBuilder: () => { + { + return DecalBuilder; + } + }, + DebugLayerTab: () => { + { + return DebugLayerTab; + } + }, + DebugLayer: () => { + { + return DebugLayer; + } + }, + DebugBlock: () => { + { + return DebugBlock; + } + }, + Database: () => { + { + return Database; + } + }, + DataStorage: () => { + { + return DataStorage; + } + }, + DataReader: () => { + { + return DataReader; + } + }, + DataBuffer: () => { + { + return DataBuffer; + } + }, + DDSTools: () => { + { + return DDSTools; + } + }, + CylinderParticleEmitter: () => { + { + return CylinderParticleEmitter; + } + }, + CylinderDirectedParticleEmitter: () => { + { + return CylinderDirectedParticleEmitter; + } + }, + CylinderBuilder: () => { + { + return CylinderBuilder; + } + }, + CylinderBlock: () => { + { + return CylinderBlock; + } + }, + CustomProceduralTexture: () => { + { + return CustomProceduralTexture; + } + }, + CustomParticleEmitter: () => { + { + return CustomParticleEmitter; + } + }, + CustomOptimization: () => { + { + return CustomOptimization; + } + }, + CustomBlock: () => { + { + return CustomBlock; + } + }, + CurveBlockTypes: () => { + { + return CurveBlockTypes; + } + }, + CurveBlock: () => { + { + return CurveBlock; + } + }, + Curve3: () => { + { + return Curve3; + } + }, + CurrentScreenBlock: () => { + { + return CurrentScreenBlock; + } + }, + CullMode: () => { + { + return CullMode; + } + }, + CubicEase: () => { + { + return CubicEase; + } + }, + CubeTextureAssetTask: () => { + { + return CubeTextureAssetTask; + } + }, + CubeTexture: () => { + { + return CubeTexture; + } + }, + CubeMapToSphericalPolynomialTools: () => { + { + return CubeMapToSphericalPolynomialTools; + } + }, + CrossBlock: () => { + { + return CrossBlock; + } + }, + CreateTube: () => { + { + return CreateTube; + } + }, + CreateTorusVertexData: () => { + { + return CreateTorusVertexData; + } + }, + CreateTorusKnotVertexData: () => { + { + return CreateTorusKnotVertexData; + } + }, + CreateTorusKnot: () => { + { + return CreateTorusKnot; + } + }, + CreateTorus: () => { + { + return CreateTorus; + } + }, + CreateTiledPlaneVertexData: () => { + { + return CreateTiledPlaneVertexData; + } + }, + CreateTiledPlane: () => { + { + return CreateTiledPlane; + } + }, + CreateTiledGroundVertexData: () => { + { + return CreateTiledGroundVertexData; + } + }, + CreateTiledGround: () => { + { + return CreateTiledGround; + } + }, + CreateTiledBoxVertexData: () => { + { + return CreateTiledBoxVertexData; + } + }, + CreateTiledBox: () => { + { + return CreateTiledBox; + } + }, + CreateTextShapePaths: () => { + { + return CreateTextShapePaths; + } + }, + CreateText: () => { + { + return CreateText; + } + }, + CreateSphereVertexData: () => { + { + return CreateSphereVertexData; + } + }, + CreateSphere: () => { + { + return CreateSphere; + } + }, + CreateSegmentedBoxVertexData: () => { + { + return CreateSegmentedBoxVertexData; + } + }, + CreateScreenshotWithResizeAsync: () => { + { + return CreateScreenshotWithResizeAsync; + } + }, + CreateScreenshotUsingRenderTargetAsync: () => { + { + return CreateScreenshotUsingRenderTargetAsync; + } + }, + CreateScreenshotUsingRenderTarget: () => { + { + return CreateScreenshotUsingRenderTarget; + } + }, + CreateScreenshotAsync: () => { + { + return CreateScreenshotAsync; + } + }, + CreateScreenshot: () => { + { + return CreateScreenshot; + } + }, + CreateRibbonVertexData: () => { + { + return CreateRibbonVertexData; + } + }, + CreateRibbon: () => { + { + return CreateRibbon; + } + }, + CreateResizedCopy: () => { + { + return CreateResizedCopy; + } + }, + CreatePolyhedronVertexData: () => { + { + return CreatePolyhedronVertexData; + } + }, + CreatePolyhedron: () => { + { + return CreatePolyhedron; + } + }, + CreatePolygonVertexData: () => { + { + return CreatePolygonVertexData; + } + }, + CreatePolygon: () => { + { + return CreatePolygon; + } + }, + CreatePlaneVertexData: () => { + { + return CreatePlaneVertexData; + } + }, + CreatePlane: () => { + { + return CreatePlane; + } + }, + CreateLines: () => { + { + return CreateLines; + } + }, + CreateLineSystemVertexData: () => { + { + return CreateLineSystemVertexData; + } + }, + CreateLineSystem: () => { + { + return CreateLineSystem; + } + }, + CreateLathe: () => { + { + return CreateLathe; + } + }, + CreateImageDataArrayBufferViews: () => { + { + return CreateImageDataArrayBufferViews; + } + }, + CreateIcoSphereVertexData: () => { + { + return CreateIcoSphereVertexData; + } + }, + CreateIcoSphere: () => { + { + return CreateIcoSphere; + } + }, + CreateHemisphere: () => { + { + return CreateHemisphere; + } + }, + CreateGroundVertexData: () => { + { + return CreateGroundVertexData; + } + }, + CreateGroundFromHeightMapVertexData: () => { + { + return CreateGroundFromHeightMapVertexData; + } + }, + CreateGroundFromHeightMap: () => { + { + return CreateGroundFromHeightMap; + } + }, + CreateGround: () => { + { + return CreateGround; + } + }, + CreateGreasedLineMaterial: () => { + { + return CreateGreasedLineMaterial; + } + }, + CreateGreasedLine: () => { + { + return CreateGreasedLine; + } + }, + CreateGoldbergVertexData: () => { + { + return CreateGoldbergVertexData; + } + }, + CreateGoldberg: () => { + { + return CreateGoldberg; + } + }, + CreateGeodesic: () => { + { + return CreateGeodesic; + } + }, + CreateEnvTextureAsync: () => { + { + return CreateEnvTextureAsync; + } + }, + CreateDiscVertexData: () => { + { + return CreateDiscVertexData; + } + }, + CreateDisc: () => { + { + return CreateDisc; + } + }, + CreateDecal: () => { + { + return CreateDecal; + } + }, + CreateDashedLinesVertexData: () => { + { + return CreateDashedLinesVertexData; + } + }, + CreateDashedLines: () => { + { + return CreateDashedLines; + } + }, + CreateCylinderVertexData: () => { + { + return CreateCylinderVertexData; + } + }, + CreateCylinder: () => { + { + return CreateCylinder; + } + }, + CreateCapsuleVertexData: () => { + { + return CreateCapsuleVertexData; + } + }, + CreateCapsule: () => { + { + return CreateCapsule; + } + }, + CreateBoxVertexData: () => { + { + return CreateBoxVertexData; + } + }, + CreateBox: () => { + { + return CreateBox; + } + }, + CopyTools: () => { + { + return CopyTools; + } + }, + CopyTextureToTexture: () => { + { + return CopyTextureToTexture; + } + }, + Coordinate: () => { + { + return Coordinate; + } + }, + ConvolutionPostProcess: () => { + { + return ConvolutionPostProcess; + } + }, + ConversionMode: () => { + { + return ConversionMode; + } + }, + ContainerAssetTask: () => { + { + return ContainerAssetTask; + } + }, + Constants: () => { + { + return Constants; + } + }, + ConeParticleEmitter: () => { + { + return ConeParticleEmitter; + } + }, + ConditionalBlockConditions: () => { + { + return ConditionalBlockConditions; + } + }, + ConditionalBlock: () => { + { + return ConditionalBlock; + } + }, + ConditionBlockTests: () => { + { + return ConditionBlockTests; + } + }, + ConditionBlock: () => { + { + return ConditionBlock; + } + }, + Condition: () => { + { + return Condition; + } + }, + ComputeShaderParticleSystem: () => { + { + return ComputeShaderParticleSystem; + } + }, + ComputeShader: () => { + { + return ComputeShader; + } + }, + ComputePassTimestampLocation: () => { + { + return ComputePassTimestampLocation; + } + }, + ComputeNormalsBlock: () => { + { + return ComputeNormalsBlock; + } + }, + ComputeEffect: () => { + { + return ComputeEffect; + } + }, + ComputeBindingType: () => { + { + return ComputeBindingType; + } + }, + CompleteGreasedLineWidthTable: () => { + { + return CompleteGreasedLineWidthTable; + } + }, + CompleteGreasedLineColorTable: () => { + { + return CompleteGreasedLineColorTable; + } + }, + CompilationMessageType: () => { + { + return CompilationMessageType; + } + }, + CompatibilityOptions: () => { + { + return CompatibilityOptions; + } + }, + CompareFunction: () => { + { + return CompareFunction; + } + }, + CombineAction: () => { + { + return CombineAction; + } + }, + ColorWrite: () => { + { + return ColorWrite; + } + }, + ColorSplitterBlock: () => { + { + return ColorSplitterBlock; + } + }, + ColorMergerBlock: () => { + { + return ColorMergerBlock; + } + }, + ColorGradingTexture: () => { + { + return ColorGradingTexture; + } + }, + ColorGradient: () => { + { + return ColorGradient; + } + }, + ColorCurves: () => { + { + return ColorCurves; + } + }, + ColorCorrectionPostProcess: () => { + { + return ColorCorrectionPostProcess; + } + }, + Color4: () => { + { + return Color4; + } + }, + Color3Gradient: () => { + { + return Color3Gradient; + } + }, + Color3: () => { + { + return Color3; + } + }, + Collider: () => { + { + return Collider; + } + }, + CloudPoint: () => { + { + return CloudPoint; + } + }, + CloudBlock: () => { + { + return CloudBlock; + } + }, + ClipboardInfo: () => { + { + return ClipboardInfo; + } + }, + ClipboardEventTypes: () => { + { + return ClipboardEventTypes; + } + }, + ClipPlanesBlock: () => { + { + return ClipPlanesBlock; + } + }, + ClearCoatBlock: () => { + { + return ClearCoatBlock; + } + }, + ClampBlock: () => { + { + return ClampBlock; + } + }, + CircleOfConfusionPostProcess: () => { + { + return CircleOfConfusionPostProcess; + } + }, + CircleEase: () => { + { + return CircleEase; + } + }, + ChromaticAberrationPostProcess: () => { + { + return ChromaticAberrationPostProcess; + } + }, + CascadedShadowGenerator: () => { + { + return CascadedShadowGenerator; + } + }, + CapsuleBuilder: () => { + { + return CapsuleBuilder; + } + }, + CapsuleBlock: () => { + { + return CapsuleBlock; + } + }, + CanvasAlphaMode: () => { + { + return CanvasAlphaMode; + } + }, + CannonJSPlugin: () => { + { + return CannonJSPlugin; + } + }, + CameraInputsManager: () => { + { + return CameraInputsManager; + } + }, + CameraInputTypes: () => { + { + return CameraInputTypes; + } + }, + CameraGizmo: () => { + { + return CameraGizmo; + } + }, + Camera: () => { + { + return Camera; + } + }, + CSG: () => { + { + return CSG; + } + }, + BufferUsage: () => { + { + return BufferUsage; + } + }, + BufferMapState: () => { + { + return BufferMapState; + } + }, + BufferBindingType: () => { + { + return BufferBindingType; + } + }, + Buffer: () => { + { + return Buffer; + } + }, + BoxParticleEmitter: () => { + { + return BoxParticleEmitter; + } + }, + BoxBuilder: () => { + { + return BoxBuilder; + } + }, + BoxBlock: () => { + { + return BoxBlock; + } + }, + BoundingSphere: () => { + { + return BoundingSphere; + } + }, + BoundingInfo: () => { + { + return BoundingInfo; + } + }, + BoundingBoxRenderer: () => { + { + return BoundingBoxRenderer; + } + }, + BoundingBoxGizmo: () => { + { + return BoundingBoxGizmo; + } + }, + BoundingBox: () => { + { + return BoundingBox; + } + }, + BoundingBlock: () => { + { + return BoundingBlock; + } + }, + BouncingBehavior: () => { + { + return BouncingBehavior; + } + }, + BounceEase: () => { + { + return BounceEase; + } + }, + BooleanGeometryOperations: () => { + { + return BooleanGeometryOperations; + } + }, + BooleanGeometryBlock: () => { + { + return BooleanGeometryBlock; + } + }, + BonesBlock: () => { + { + return BonesBlock; + } + }, + BoneLookController: () => { + { + return BoneLookController; + } + }, + BoneIKController: () => { + { + return BoneIKController; + } + }, + BoneAxesViewer: () => { + { + return BoneAxesViewer; + } + }, + Bone: () => { + { + return Bone; + } + }, + BlurPostProcess: () => { + { + return BlurPostProcess; + } + }, + BloomMergePostProcess: () => { + { + return BloomMergePostProcess; + } + }, + BloomEffect: () => { + { + return BloomEffect; + } + }, + BlendOperation: () => { + { + return BlendOperation; + } + }, + BlendFactor: () => { + { + return BlendFactor; + } + }, + BlackAndWhitePostProcess: () => { + { + return BlackAndWhitePostProcess; + } + }, + BinaryFileAssetTask: () => { + { + return BinaryFileAssetTask; + } + }, + BiPlanarBlock: () => { + { + return BiPlanarBlock; + } + }, + BezierCurveEase: () => { + { + return BezierCurveEase; + } + }, + BezierCurve: () => { + { + return BezierCurve; + } + }, + BasisTranscodeConfiguration: () => { + { + return BasisTranscodeConfiguration; + } + }, + BasisToolsOptions: () => { + { + return BasisToolsOptions; + } + }, + BasisTools: () => { + { + return BasisTools; + } + }, + BaseTexture: () => { + { + return BaseTexture; + } + }, + BaseSixDofDragBehavior: () => { + { + return BaseSixDofDragBehavior; + } + }, + BaseParticleSystem: () => { + { + return BaseParticleSystem; + } + }, + BaseError: () => { + { + return BaseError; + } + }, + BaseCameraPointersInput: () => { + { + return BaseCameraPointersInput; + } + }, + BaseCameraMouseWheelInput: () => { + { + return BaseCameraMouseWheelInput; + } + }, + BallAndSocketConstraint: () => { + { + return BallAndSocketConstraint; + } + }, + BakedVertexAnimationManager: () => { + { + return BakedVertexAnimationManager; + } + }, + BackgroundMaterial: () => { + { + return BackgroundMaterial; + } + }, + BackEase: () => { + { + return BackEase; + } + }, + BabylonFileLoaderConfiguration: () => { + { + return BabylonFileLoaderConfiguration; + } + }, + BRDFTextureTools: () => { + { + return BRDFTextureTools; + } + }, + AxisScaleGizmo: () => { + { + return AxisScaleGizmo; + } + }, + AxisDragGizmo: () => { + { + return AxisDragGizmo; + } + }, + Axis: () => { + { + return Axis; + } + }, + AxesViewer: () => { + { + return AxesViewer; + } + }, + AutoRotationBehavior: () => { + { + return AutoRotationBehavior; + } + }, + AutoReleaseWorkerPool: () => { + { + return AutoReleaseWorkerPool; + } + }, + AutoLayoutMode: () => { + { + return AutoLayoutMode; + } + }, + AudioSceneComponent: () => { + { + return AudioSceneComponent; + } + }, + AudioEngine: () => { + { + return AudioEngine; + } + }, + AttachToBoxBehavior: () => { + { + return AttachToBoxBehavior; + } + }, + AsyncLoop: () => { + { + return AsyncLoop; + } + }, + AssetsProgressEvent: () => { + { + return AssetsProgressEvent; + } + }, + AssetsManager: () => { + { + return AssetsManager; + } + }, + AssetTaskState: () => { + { + return AssetTaskState; + } + }, + AssetContainer: () => { + { + return AssetContainer; + } + }, + ArcTan2Block: () => { + { + return ArcTan2Block; + } + }, + ArcRotateCameraVRDeviceOrientationInput: () => { + { + return ArcRotateCameraVRDeviceOrientationInput; + } + }, + ArcRotateCameraPointersInput: () => { + { + return ArcRotateCameraPointersInput; + } + }, + ArcRotateCameraMouseWheelInput: () => { + { + return ArcRotateCameraMouseWheelInput; + } + }, + ArcRotateCameraKeyboardMoveInput: () => { + { + return ArcRotateCameraKeyboardMoveInput; + } + }, + ArcRotateCameraInputsManager: () => { + { + return ArcRotateCameraInputsManager; + } + }, + ArcRotateCameraGamepadInput: () => { + { + return ArcRotateCameraGamepadInput; + } + }, + ArcRotateCamera: () => { + { + return ArcRotateCamera; + } + }, + ArcFollowCamera: () => { + { + return ArcFollowCamera; + } + }, + Arc2: () => { + { + return Arc2; + } + }, + ApplyPostProcess: () => { + { + return ApplyPostProcess; + } + }, + AnisotropyBlock: () => { + { + return AnisotropyBlock; + } + }, + AnimationRange: () => { + { + return AnimationRange; + } + }, + AnimationPropertiesOverride: () => { + { + return AnimationPropertiesOverride; + } + }, + AnimationKeyInterpolation: () => { + { + return AnimationKeyInterpolation; + } + }, + AnimationGroupMaskMode: () => { + { + return AnimationGroupMaskMode; + } + }, + AnimationGroupMask: () => { + { + return AnimationGroupMask; + } + }, + AnimationGroup: () => { + { + return AnimationGroup; + } + }, + AnimationEvent: () => { + { + return AnimationEvent; + } + }, + AnimationAssetTask: () => { + { + return AnimationAssetTask; + } + }, + Animation: () => { + { + return Animation; + } + }, + AnimatedInputBlockTypes: () => { + { + return AnimatedInputBlockTypes; + } + }, + Animatable: () => { + { + return Animatable; + } + }, + Angle: () => { + { + return Angle; + } + }, + AndOrNotEvaluator: () => { + { + return AndOrNotEvaluator; + } + }, + Analyser: () => { + { + return Analyser; + } + }, + AnaglyphUniversalCamera: () => { + { + return AnaglyphUniversalCamera; + } + }, + AnaglyphPostProcess: () => { + { + return AnaglyphPostProcess; + } + }, + AnaglyphGamepadCamera: () => { + { + return AnaglyphGamepadCamera; + } + }, + AnaglyphFreeCamera: () => { + { + return AnaglyphFreeCamera; + } + }, + AnaglyphArcRotateCamera: () => { + { + return AnaglyphArcRotateCamera; + } + }, + AmmoJSPlugin: () => { + { + return AmmoJSPlugin; + } + }, + AlphaState: () => { + { + return AlphaState; + } + }, + AlignBlock: () => { + { + return AlignBlock; + } + }, + AdvancedTimer: () => { + { + return AdvancedTimer; + } + }, + AddressMode: () => { + { + return AddressMode; + } + }, + AddBlock: () => { + { + return AddBlock; + } + }, + ActionManager: () => { + { + return ActionManager; + } + }, + ActionEvent: () => { + { + return ActionEvent; + } + }, + Action: () => { + { + return Action; + } + }, + AcquireNativeObjectAsync: () => { + { + return AcquireNativeObjectAsync; + } + }, + AbstractScene: () => { + { + return AbstractScene; + } + }, + AbstractMesh: () => { + { + return AbstractMesh; + } + }, + AbstractAssetTask: () => { + { + return AbstractAssetTask; + } + }, + AbstractActionManager: () => { + { + return AbstractActionManager; + } + } +}); +var init_core = __esm(() => { + init_abstractScene(); + init_Actions(); + init_Animations(); + init_assetContainer(); + init_Audio(); + init_BakedVertexAnimation(); + init_Behaviors(); + init_Bones(); + init_Buffers(); + init_Cameras2(); + init_Collisions(); + init_Compute(); + init_Culling(); + init_Debug(); + init_DeviceInput(); + init_Engines(); + init_Events(); + init_Gamepads(); + init_Gizmos(); + init_Helpers(); + init_Instrumentation(); + init_Layers(); + init_LensFlares(); + init_Lights(); + init_Loading(); + init_Materials(); + init_Maths(); + init_Meshes2(); + init_Morph(); + init_Navigation(); + init_node(); + init_Offline(); + init_Particles(); + init_Physics(); + init_PostProcesses(); + init_Probes(); + init_Rendering(); + init_scene(); + init_sceneComponent(); + init_Sprites(); + init_States(); + init_Misc(); + init_XR(); + init_types(); + init_Compat(); + init_FlowGraph(); +}); + +// node_modules/alea/alea.js +var require_alea = __commonJS((exports, module) => { + (function(root, factory) { + if (typeof exports === "object") { + module.exports = factory(); + } else if (typeof define === "function" && define.amd) { + define(factory); + } else { + root.Alea = factory(); + } + })(exports, function() { + Alea.importState = function(i) { + var random = new Alea; + random.importState(i); + return random; + }; + return Alea; + function Alea() { + return function(args) { + var s0 = 0; + var s1 = 0; + var s2 = 0; + var c = 1; + if (args.length == 0) { + args = [+new Date]; + } + var mash = Mash(); + s0 = mash(" "); + s1 = mash(" "); + s2 = mash(" "); + for (var i = 0;i < args.length; i++) { + s0 -= mash(args[i]); + if (s0 < 0) { + s0 += 1; + } + s1 -= mash(args[i]); + if (s1 < 0) { + s1 += 1; + } + s2 -= mash(args[i]); + if (s2 < 0) { + s2 += 1; + } + } + mash = null; + var random = function() { + var t = 2091639 * s0 + c * 0.00000000023283064365386964; + s0 = s1; + s1 = s2; + return s2 = t - (c = t | 0); + }; + random.next = random; + random.uint32 = function() { + return random() * 4294967296; + }; + random.fract53 = function() { + return random() + (random() * 2097152 | 0) * 0.00000000000000011102230246251566; + }; + random.version = "Alea 0.9"; + random.args = args; + random.exportState = function() { + return [s0, s1, s2, c]; + }; + random.importState = function(i2) { + s0 = +i2[0] || 0; + s1 = +i2[1] || 0; + s2 = +i2[2] || 0; + c = +i2[3] || 0; + }; + return random; + }(Array.prototype.slice.call(arguments)); + } + function Mash() { + var n = 4022871197; + var mash = function(data) { + data = data.toString(); + for (var i = 0;i < data.length; i++) { + n += data.charCodeAt(i); + var h = 0.02519603282416938 * n; + n = h >>> 0; + h -= n; + h *= n; + n = h >>> 0; + h -= n; + n += h * 4294967296; + } + return (n >>> 0) * 0.00000000023283064365386964; + }; + mash.version = "Mash 0.9"; + return mash; + } + }); +}); + +// node_modules/@babylonjs/loaders/glTF/glTFValidation.js +class GLTFValidation { + static ValidateAsync(data, rootUrl, fileName, getExternalResource) { + const dataCopy = ArrayBuffer.isView(data) ? data.slice().buffer : data; + if (typeof Worker === "function") { + return new Promise((resolve, reject) => { + const workerContent = `${validateAsync}(${workerFunc3})()`; + const workerBlobUrl = URL.createObjectURL(new Blob([workerContent], { type: "application/javascript" })); + const worker2 = new Worker(workerBlobUrl); + const onError = (error6) => { + worker2.removeEventListener("error", onError); + worker2.removeEventListener("message", onMessage); + reject(error6); + }; + const onMessage = (message) => { + const data2 = message.data; + switch (data2.id) { + case "getExternalResource": { + getExternalResource(data2.uri).then((value) => { + worker2.postMessage({ id: "getExternalResource.resolve", index: data2.index, value }, [value]); + }, (reason) => { + worker2.postMessage({ id: "getExternalResource.reject", index: data2.index, reason }); + }); + break; + } + case "validate.resolve": { + worker2.removeEventListener("error", onError); + worker2.removeEventListener("message", onMessage); + resolve(data2.value); + worker2.terminate(); + break; + } + case "validate.reject": { + worker2.removeEventListener("error", onError); + worker2.removeEventListener("message", onMessage); + reject(data2.reason); + worker2.terminate(); + } + } + }; + worker2.addEventListener("error", onError); + worker2.addEventListener("message", onMessage); + worker2.postMessage({ id: "init", url: Tools.GetBabylonScriptURL(this.Configuration.url) }); + worker2.postMessage({ id: "validate", data: dataCopy, rootUrl, fileName }); + }); + } else { + if (!this._LoadScriptPromise) { + this._LoadScriptPromise = Tools.LoadBabylonScriptAsync(this.Configuration.url); + } + return this._LoadScriptPromise.then(() => { + return validateAsync(dataCopy, rootUrl, fileName, getExternalResource); + }); + } + } +} +var validateAsync, workerFunc3; +var init_glTFValidation = __esm(() => { + init_tools(); + validateAsync = function(data, rootUrl, fileName, getExternalResource) { + const options = { + externalResourceFunction: (uri) => getExternalResource(uri).then((value) => new Uint8Array(value)) + }; + if (fileName) { + options.uri = rootUrl === "file:" ? fileName : rootUrl + fileName; + } + return data instanceof ArrayBuffer ? GLTFValidator.validateBytes(new Uint8Array(data), options) : GLTFValidator.validateString(data, options); + }; + workerFunc3 = function() { + const pendingExternalResources = []; + onmessage = (message) => { + const data = message.data; + switch (data.id) { + case "init": { + importScripts(data.url); + break; + } + case "validate": { + validateAsync(data.data, data.rootUrl, data.fileName, (uri) => new Promise((resolve, reject) => { + const index = pendingExternalResources.length; + pendingExternalResources.push({ resolve, reject }); + postMessage({ id: "getExternalResource", index, uri }); + })).then((value) => { + postMessage({ id: "validate.resolve", value }); + }, (reason) => { + postMessage({ id: "validate.reject", reason }); + }); + break; + } + case "getExternalResource.resolve": { + pendingExternalResources[data.index].resolve(data.value); + break; + } + case "getExternalResource.reject": { + pendingExternalResources[data.index].reject(data.reason); + break; + } + } + }; + }; + GLTFValidation.Configuration = { + url: `${Tools._DefaultCdnUrl}/gltf_validator.js` + }; +}); + +// node_modules/@babylonjs/loaders/glTF/glTFFileLoader.js +class GLTFFileLoader { + constructor() { + this.onParsedObservable = new Observable; + this.coordinateSystemMode = GLTFLoaderCoordinateSystemMode.AUTO; + this.animationStartMode = GLTFLoaderAnimationStartMode.FIRST; + this.compileMaterials = false; + this.useClipPlane = false; + this.compileShadowGenerators = false; + this.transparencyAsCoverage = false; + this.useRangeRequests = false; + this.createInstances = true; + this.alwaysComputeBoundingBox = false; + this.loadAllMaterials = false; + this.loadOnlyMaterials = false; + this.skipMaterials = false; + this.useSRGBBuffers = true; + this.targetFps = 60; + this.alwaysComputeSkeletonRootNode = false; + this.preprocessUrlAsync = (url) => Promise.resolve(url); + this.onMeshLoadedObservable = new Observable; + this.onSkinLoadedObservable = new Observable; + this.onTextureLoadedObservable = new Observable; + this.onMaterialLoadedObservable = new Observable; + this.onCameraLoadedObservable = new Observable; + this.onCompleteObservable = new Observable; + this.onErrorObservable = new Observable; + this.onDisposeObservable = new Observable; + this.onExtensionLoadedObservable = new Observable; + this.validate = false; + this.onValidatedObservable = new Observable; + this._loader = null; + this._state = null; + this._requests = new Array; + this.name = "gltf"; + this.extensions = { + ".gltf": { isBinary: false }, + ".glb": { isBinary: true } + }; + this.onLoaderStateChangedObservable = new Observable; + this._logIndentLevel = 0; + this._loggingEnabled = false; + this._log = this._logDisabled; + this._capturePerformanceCounters = false; + this._startPerformanceCounter = this._startPerformanceCounterDisabled; + this._endPerformanceCounter = this._endPerformanceCounterDisabled; + } + set onParsed(callback) { + if (this._onParsedObserver) { + this.onParsedObservable.remove(this._onParsedObserver); + } + this._onParsedObserver = this.onParsedObservable.add(callback); + } + set onMeshLoaded(callback) { + if (this._onMeshLoadedObserver) { + this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver); + } + this._onMeshLoadedObserver = this.onMeshLoadedObservable.add(callback); + } + set onTextureLoaded(callback) { + if (this._onTextureLoadedObserver) { + this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver); + } + this._onTextureLoadedObserver = this.onTextureLoadedObservable.add(callback); + } + set onMaterialLoaded(callback) { + if (this._onMaterialLoadedObserver) { + this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver); + } + this._onMaterialLoadedObserver = this.onMaterialLoadedObservable.add(callback); + } + set onCameraLoaded(callback) { + if (this._onCameraLoadedObserver) { + this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver); + } + this._onCameraLoadedObserver = this.onCameraLoadedObservable.add(callback); + } + set onComplete(callback) { + if (this._onCompleteObserver) { + this.onCompleteObservable.remove(this._onCompleteObserver); + } + this._onCompleteObserver = this.onCompleteObservable.add(callback); + } + set onError(callback) { + if (this._onErrorObserver) { + this.onErrorObservable.remove(this._onErrorObserver); + } + this._onErrorObserver = this.onErrorObservable.add(callback); + } + set onDispose(callback) { + if (this._onDisposeObserver) { + this.onDisposeObservable.remove(this._onDisposeObserver); + } + this._onDisposeObserver = this.onDisposeObservable.add(callback); + } + set onExtensionLoaded(callback) { + if (this._onExtensionLoadedObserver) { + this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver); + } + this._onExtensionLoadedObserver = this.onExtensionLoadedObservable.add(callback); + } + get loggingEnabled() { + return this._loggingEnabled; + } + set loggingEnabled(value) { + if (this._loggingEnabled === value) { + return; + } + this._loggingEnabled = value; + if (this._loggingEnabled) { + this._log = this._logEnabled; + } else { + this._log = this._logDisabled; + } + } + get capturePerformanceCounters() { + return this._capturePerformanceCounters; + } + set capturePerformanceCounters(value) { + if (this._capturePerformanceCounters === value) { + return; + } + this._capturePerformanceCounters = value; + if (this._capturePerformanceCounters) { + this._startPerformanceCounter = this._startPerformanceCounterEnabled; + this._endPerformanceCounter = this._endPerformanceCounterEnabled; + } else { + this._startPerformanceCounter = this._startPerformanceCounterDisabled; + this._endPerformanceCounter = this._endPerformanceCounterDisabled; + } + } + set onValidated(callback) { + if (this._onValidatedObserver) { + this.onValidatedObservable.remove(this._onValidatedObserver); + } + this._onValidatedObserver = this.onValidatedObservable.add(callback); + } + dispose() { + if (this._loader) { + this._loader.dispose(); + this._loader = null; + } + for (const request of this._requests) { + request.abort(); + } + this._requests.length = 0; + delete this._progressCallback; + this.preprocessUrlAsync = (url) => Promise.resolve(url); + this.onMeshLoadedObservable.clear(); + this.onSkinLoadedObservable.clear(); + this.onTextureLoadedObservable.clear(); + this.onMaterialLoadedObservable.clear(); + this.onCameraLoadedObservable.clear(); + this.onCompleteObservable.clear(); + this.onExtensionLoadedObservable.clear(); + this.onDisposeObservable.notifyObservers(undefined); + this.onDisposeObservable.clear(); + } + loadFile(scene37, fileOrUrl, rootUrl, onSuccess, onProgress, useArrayBuffer, onError, name286) { + if (ArrayBuffer.isView(fileOrUrl)) { + this._loadBinary(scene37, fileOrUrl, rootUrl, onSuccess, onError, name286); + return null; + } + this._progressCallback = onProgress; + const fileName = fileOrUrl.name || Tools.GetFilename(fileOrUrl); + if (useArrayBuffer) { + if (this.useRangeRequests) { + if (this.validate) { + Logger.Warn("glTF validation is not supported when range requests are enabled"); + } + const fileRequest2 = { + abort: () => { + }, + onCompleteObservable: new Observable + }; + const dataBuffer7 = { + readAsync: (byteOffset, byteLength) => { + return new Promise((resolve, reject) => { + this._loadFile(scene37, fileOrUrl, (data) => { + resolve(new Uint8Array(data)); + }, true, (error7) => { + reject(error7); + }, (webRequest13) => { + webRequest13.setRequestHeader("Range", `bytes=${byteOffset}-${byteOffset + byteLength - 1}`); + }); + }); + }, + byteLength: 0 + }; + this._unpackBinaryAsync(new DataReader(dataBuffer7)).then((loaderData) => { + fileRequest2.onCompleteObservable.notifyObservers(fileRequest2); + onSuccess(loaderData); + }, onError ? (error7) => onError(undefined, error7) : undefined); + return fileRequest2; + } + return this._loadFile(scene37, fileOrUrl, (data) => { + this._validate(scene37, new Uint8Array(data), rootUrl, fileName); + this._unpackBinaryAsync(new DataReader({ + readAsync: (byteOffset, byteLength) => readAsync(data, byteOffset, byteLength), + byteLength: data.byteLength + })).then((loaderData) => { + onSuccess(loaderData); + }, onError ? (error7) => onError(undefined, error7) : undefined); + }, true, onError); + } + return this._loadFile(scene37, fileOrUrl, (data) => { + this._validate(scene37, new Uint8Array(data), rootUrl, fileName); + onSuccess({ json: this._parseJson(data) }); + }, useArrayBuffer, onError); + } + _loadBinary(scene37, data, rootUrl, onSuccess, onError, fileName) { + this._validate(scene37, data, rootUrl, fileName); + this._unpackBinaryAsync(new DataReader({ + readAsync: (byteOffset, byteLength) => readViewAsync(data, byteOffset, byteLength), + byteLength: data.byteLength + })).then((loaderData) => { + onSuccess(loaderData); + }, onError ? (error7) => onError(undefined, error7) : undefined); + } + importMeshAsync(meshesNames, scene37, data, rootUrl, onProgress, fileName) { + return Promise.resolve().then(() => { + this.onParsedObservable.notifyObservers(data); + this.onParsedObservable.clear(); + this._log(`Loading ${fileName || ""}`); + this._loader = this._getLoader(data); + return this._loader.importMeshAsync(meshesNames, scene37, null, data, rootUrl, onProgress, fileName); + }); + } + loadAsync(scene37, data, rootUrl, onProgress, fileName) { + return Promise.resolve().then(() => { + this.onParsedObservable.notifyObservers(data); + this.onParsedObservable.clear(); + this._log(`Loading ${fileName || ""}`); + this._loader = this._getLoader(data); + return this._loader.loadAsync(scene37, data, rootUrl, onProgress, fileName); + }); + } + loadAssetContainerAsync(scene37, data, rootUrl, onProgress, fileName) { + return Promise.resolve().then(() => { + this.onParsedObservable.notifyObservers(data); + this.onParsedObservable.clear(); + this._log(`Loading ${fileName || ""}`); + this._loader = this._getLoader(data); + const container9 = new AssetContainer(scene37); + const materials2 = []; + this.onMaterialLoadedObservable.add((material27) => { + materials2.push(material27); + }); + const textures = []; + this.onTextureLoadedObservable.add((texture84) => { + textures.push(texture84); + }); + const cameras = []; + this.onCameraLoadedObservable.add((camera32) => { + cameras.push(camera32); + }); + const morphTargetManagers = []; + this.onMeshLoadedObservable.add((mesh77) => { + if (mesh77.morphTargetManager) { + morphTargetManagers.push(mesh77.morphTargetManager); + } + }); + return this._loader.importMeshAsync(null, scene37, container9, data, rootUrl, onProgress, fileName).then((result) => { + Array.prototype.push.apply(container9.geometries, result.geometries); + Array.prototype.push.apply(container9.meshes, result.meshes); + Array.prototype.push.apply(container9.particleSystems, result.particleSystems); + Array.prototype.push.apply(container9.skeletons, result.skeletons); + Array.prototype.push.apply(container9.animationGroups, result.animationGroups); + Array.prototype.push.apply(container9.materials, materials2); + Array.prototype.push.apply(container9.textures, textures); + Array.prototype.push.apply(container9.lights, result.lights); + Array.prototype.push.apply(container9.transformNodes, result.transformNodes); + Array.prototype.push.apply(container9.cameras, cameras); + Array.prototype.push.apply(container9.morphTargetManagers, morphTargetManagers); + return container9; + }); + }); + } + canDirectLoad(data) { + return data.indexOf("asset") !== -1 && data.indexOf("version") !== -1 || data.startsWith("data:base64," + GLTFFileLoader._MagicBase64Encoded) || data.startsWith("data:;base64," + GLTFFileLoader._MagicBase64Encoded) || data.startsWith("data:application/octet-stream;base64," + GLTFFileLoader._MagicBase64Encoded) || data.startsWith("data:model/gltf-binary;base64," + GLTFFileLoader._MagicBase64Encoded); + } + directLoad(scene37, data) { + if (data.startsWith("base64," + GLTFFileLoader._MagicBase64Encoded) || data.startsWith(";base64," + GLTFFileLoader._MagicBase64Encoded) || data.startsWith("application/octet-stream;base64," + GLTFFileLoader._MagicBase64Encoded) || data.startsWith("model/gltf-binary;base64," + GLTFFileLoader._MagicBase64Encoded)) { + const arrayBuffer = DecodeBase64UrlToBinary(data); + this._validate(scene37, new Uint8Array(arrayBuffer)); + return this._unpackBinaryAsync(new DataReader({ + readAsync: (byteOffset, byteLength) => readAsync(arrayBuffer, byteOffset, byteLength), + byteLength: arrayBuffer.byteLength + })); + } + this._validate(scene37, data); + return Promise.resolve({ json: this._parseJson(data) }); + } + createPlugin() { + return new GLTFFileLoader; + } + get loaderState() { + return this._state; + } + whenCompleteAsync() { + return new Promise((resolve, reject) => { + this.onCompleteObservable.addOnce(() => { + resolve(); + }); + this.onErrorObservable.addOnce((reason) => { + reject(reason); + }); + }); + } + _setState(state) { + if (this._state === state) { + return; + } + this._state = state; + this.onLoaderStateChangedObservable.notifyObservers(this._state); + this._log(GLTFLoaderState[this._state]); + } + _loadFile(scene37, fileOrUrl, onSuccess, useArrayBuffer, onError, onOpened) { + const request = scene37._loadFile(fileOrUrl, onSuccess, (event) => { + this._onProgress(event, request); + }, true, useArrayBuffer, onError, onOpened); + request.onCompleteObservable.add((request2) => { + this._requests.splice(this._requests.indexOf(request2), 1); + }); + this._requests.push(request); + return request; + } + _onProgress(event, request) { + if (!this._progressCallback) { + return; + } + request._lengthComputable = event.lengthComputable; + request._loaded = event.loaded; + request._total = event.total; + let lengthComputable = true; + let loaded = 0; + let total = 0; + for (const request2 of this._requests) { + if (request2._lengthComputable === undefined || request2._loaded === undefined || request2._total === undefined) { + return; + } + lengthComputable = lengthComputable && request2._lengthComputable; + loaded += request2._loaded; + total += request2._total; + } + this._progressCallback({ + lengthComputable, + loaded, + total: lengthComputable ? total : 0 + }); + } + _validate(scene37, data, rootUrl = "", fileName = "") { + if (!this.validate) { + return; + } + this._startPerformanceCounter("Validate JSON"); + GLTFValidation.ValidateAsync(data, rootUrl, fileName, (uri) => { + return this.preprocessUrlAsync(rootUrl + uri).then((url) => scene37._loadFileAsync(url, undefined, true, true)); + }).then((result) => { + this._endPerformanceCounter("Validate JSON"); + this.onValidatedObservable.notifyObservers(result); + this.onValidatedObservable.clear(); + }, (reason) => { + this._endPerformanceCounter("Validate JSON"); + Tools.Warn(`Failed to validate: ${reason.message}`); + this.onValidatedObservable.clear(); + }); + } + _getLoader(loaderData) { + const asset = loaderData.json.asset || {}; + this._log(`Asset version: ${asset.version}`); + asset.minVersion && this._log(`Asset minimum version: ${asset.minVersion}`); + asset.generator && this._log(`Asset generator: ${asset.generator}`); + const version = GLTFFileLoader._parseVersion(asset.version); + if (!version) { + throw new Error("Invalid version: " + asset.version); + } + if (asset.minVersion !== undefined) { + const minVersion = GLTFFileLoader._parseVersion(asset.minVersion); + if (!minVersion) { + throw new Error("Invalid minimum version: " + asset.minVersion); + } + if (GLTFFileLoader._compareVersion(minVersion, { major: 2, minor: 0 }) > 0) { + throw new Error("Incompatible minimum version: " + asset.minVersion); + } + } + const createLoaders = { + 1: GLTFFileLoader._CreateGLTF1Loader, + 2: GLTFFileLoader._CreateGLTF2Loader + }; + const createLoader = createLoaders[version.major]; + if (!createLoader) { + throw new Error("Unsupported version: " + asset.version); + } + return createLoader(this); + } + _parseJson(json) { + this._startPerformanceCounter("Parse JSON"); + this._log(`JSON length: ${json.length}`); + const parsed = JSON.parse(json); + this._endPerformanceCounter("Parse JSON"); + return parsed; + } + _unpackBinaryAsync(dataReader3) { + this._startPerformanceCounter("Unpack Binary"); + return dataReader3.loadAsync(20).then(() => { + const Binary = { + Magic: 1179937895 + }; + const magic = dataReader3.readUint32(); + if (magic !== Binary.Magic) { + throw new RuntimeError("Unexpected magic: " + magic, ErrorCodes.GLTFLoaderUnexpectedMagicError); + } + const version = dataReader3.readUint32(); + if (this.loggingEnabled) { + this._log(`Binary version: ${version}`); + } + const length = dataReader3.readUint32(); + if (!this.useRangeRequests && length !== dataReader3.buffer.byteLength) { + Logger.Warn(`Length in header does not match actual data length: ${length} != ${dataReader3.buffer.byteLength}`); + } + let unpacked; + switch (version) { + case 1: { + unpacked = this._unpackBinaryV1Async(dataReader3, length); + break; + } + case 2: { + unpacked = this._unpackBinaryV2Async(dataReader3, length); + break; + } + default: { + throw new Error("Unsupported version: " + version); + } + } + this._endPerformanceCounter("Unpack Binary"); + return unpacked; + }); + } + _unpackBinaryV1Async(dataReader3, length) { + const ContentFormat = { + JSON: 0 + }; + const contentLength = dataReader3.readUint32(); + const contentFormat = dataReader3.readUint32(); + if (contentFormat !== ContentFormat.JSON) { + throw new Error(`Unexpected content format: ${contentFormat}`); + } + const bodyLength = length - dataReader3.byteOffset; + const data = { json: this._parseJson(dataReader3.readString(contentLength)), bin: null }; + if (bodyLength !== 0) { + const startByteOffset = dataReader3.byteOffset; + data.bin = { + readAsync: (byteOffset, byteLength) => dataReader3.buffer.readAsync(startByteOffset + byteOffset, byteLength), + byteLength: bodyLength + }; + } + return Promise.resolve(data); + } + _unpackBinaryV2Async(dataReader3, length) { + const ChunkFormat = { + JSON: 1313821514, + BIN: 5130562 + }; + const chunkLength = dataReader3.readUint32(); + const chunkFormat = dataReader3.readUint32(); + if (chunkFormat !== ChunkFormat.JSON) { + throw new Error("First chunk format is not JSON"); + } + if (dataReader3.byteOffset + chunkLength === length) { + return dataReader3.loadAsync(chunkLength).then(() => { + return { json: this._parseJson(dataReader3.readString(chunkLength)), bin: null }; + }); + } + return dataReader3.loadAsync(chunkLength + 8).then(() => { + const data = { json: this._parseJson(dataReader3.readString(chunkLength)), bin: null }; + const readAsync2 = () => { + const chunkLength2 = dataReader3.readUint32(); + const chunkFormat2 = dataReader3.readUint32(); + switch (chunkFormat2) { + case ChunkFormat.JSON: { + throw new Error("Unexpected JSON chunk"); + } + case ChunkFormat.BIN: { + const startByteOffset = dataReader3.byteOffset; + data.bin = { + readAsync: (byteOffset, byteLength) => dataReader3.buffer.readAsync(startByteOffset + byteOffset, byteLength), + byteLength: chunkLength2 + }; + dataReader3.skipBytes(chunkLength2); + break; + } + default: { + dataReader3.skipBytes(chunkLength2); + break; + } + } + if (dataReader3.byteOffset !== length) { + return dataReader3.loadAsync(8).then(readAsync2); + } + return Promise.resolve(data); + }; + return readAsync2(); + }); + } + static _parseVersion(version) { + if (version === "1.0" || version === "1.0.1") { + return { + major: 1, + minor: 0 + }; + } + const match = (version + "").match(/^(\d+)\.(\d+)/); + if (!match) { + return null; + } + return { + major: parseInt(match[1]), + minor: parseInt(match[2]) + }; + } + static _compareVersion(a, b) { + if (a.major > b.major) { + return 1; + } + if (a.major < b.major) { + return -1; + } + if (a.minor > b.minor) { + return 1; + } + if (a.minor < b.minor) { + return -1; + } + return 0; + } + _logOpen(message) { + this._log(message); + this._logIndentLevel++; + } + _logClose() { + --this._logIndentLevel; + } + _logEnabled(message) { + const spaces = GLTFFileLoader._logSpaces.substr(0, this._logIndentLevel * 2); + Logger.Log(`${spaces}${message}`); + } + _logDisabled(message) { + } + _startPerformanceCounterEnabled(counterName) { + Tools.StartPerformanceCounter(counterName); + } + _startPerformanceCounterDisabled(counterName) { + } + _endPerformanceCounterEnabled(counterName) { + Tools.EndPerformanceCounter(counterName); + } + _endPerformanceCounterDisabled(counterName) { + } +} +var readAsync, readViewAsync, GLTFLoaderCoordinateSystemMode, GLTFLoaderAnimationStartMode, GLTFLoaderState; +var init_glTFFileLoader = __esm(() => { + init_observable(); + init_tools(); + init_sceneLoader(); + init_assetContainer(); + init_logger(); + init_dataReader(); + init_glTFValidation(); + init_fileTools(); + init_error(); + readAsync = function(arrayBuffer, byteOffset, byteLength) { + try { + return Promise.resolve(new Uint8Array(arrayBuffer, byteOffset, byteLength)); + } catch (e) { + return Promise.reject(e); + } + }; + readViewAsync = function(arrayBufferView, byteOffset, byteLength) { + try { + if (byteOffset < 0 || byteOffset >= arrayBufferView.byteLength) { + throw new RangeError("Offset is out of range."); + } + if (byteOffset + byteLength > arrayBufferView.byteLength) { + throw new RangeError("Length is out of range."); + } + return Promise.resolve(new Uint8Array(arrayBufferView.buffer, arrayBufferView.byteOffset + byteOffset, byteLength)); + } catch (e) { + return Promise.reject(e); + } + }; + (function(GLTFLoaderCoordinateSystemMode2) { + GLTFLoaderCoordinateSystemMode2[GLTFLoaderCoordinateSystemMode2["AUTO"] = 0] = "AUTO"; + GLTFLoaderCoordinateSystemMode2[GLTFLoaderCoordinateSystemMode2["FORCE_RIGHT_HANDED"] = 1] = "FORCE_RIGHT_HANDED"; + })(GLTFLoaderCoordinateSystemMode || (GLTFLoaderCoordinateSystemMode = {})); + (function(GLTFLoaderAnimationStartMode2) { + GLTFLoaderAnimationStartMode2[GLTFLoaderAnimationStartMode2["NONE"] = 0] = "NONE"; + GLTFLoaderAnimationStartMode2[GLTFLoaderAnimationStartMode2["FIRST"] = 1] = "FIRST"; + GLTFLoaderAnimationStartMode2[GLTFLoaderAnimationStartMode2["ALL"] = 2] = "ALL"; + })(GLTFLoaderAnimationStartMode || (GLTFLoaderAnimationStartMode = {})); + (function(GLTFLoaderState2) { + GLTFLoaderState2[GLTFLoaderState2["LOADING"] = 0] = "LOADING"; + GLTFLoaderState2[GLTFLoaderState2["READY"] = 1] = "READY"; + GLTFLoaderState2[GLTFLoaderState2["COMPLETE"] = 2] = "COMPLETE"; + })(GLTFLoaderState || (GLTFLoaderState = {})); + GLTFFileLoader.IncrementalLoading = true; + GLTFFileLoader.HomogeneousCoordinates = false; + GLTFFileLoader._MagicBase64Encoded = "Z2xURg"; + GLTFFileLoader._logSpaces = " "; + if (SceneLoader) { + SceneLoader.RegisterPlugin(new GLTFFileLoader); + } +}); + +// node_modules/@babylonjs/loaders/glTF/1.0/glTFLoaderInterfaces.js +var EComponentType, EShaderType, EParameterType, ETextureWrapMode, ETextureFilterType, ETextureFormat, ECullingType, EBlendingFunction; +var init_glTFLoaderInterfaces = __esm(() => { + (function(EComponentType2) { + EComponentType2[EComponentType2["BYTE"] = 5120] = "BYTE"; + EComponentType2[EComponentType2["UNSIGNED_BYTE"] = 5121] = "UNSIGNED_BYTE"; + EComponentType2[EComponentType2["SHORT"] = 5122] = "SHORT"; + EComponentType2[EComponentType2["UNSIGNED_SHORT"] = 5123] = "UNSIGNED_SHORT"; + EComponentType2[EComponentType2["FLOAT"] = 5126] = "FLOAT"; + })(EComponentType || (EComponentType = {})); + (function(EShaderType2) { + EShaderType2[EShaderType2["FRAGMENT"] = 35632] = "FRAGMENT"; + EShaderType2[EShaderType2["VERTEX"] = 35633] = "VERTEX"; + })(EShaderType || (EShaderType = {})); + (function(EParameterType2) { + EParameterType2[EParameterType2["BYTE"] = 5120] = "BYTE"; + EParameterType2[EParameterType2["UNSIGNED_BYTE"] = 5121] = "UNSIGNED_BYTE"; + EParameterType2[EParameterType2["SHORT"] = 5122] = "SHORT"; + EParameterType2[EParameterType2["UNSIGNED_SHORT"] = 5123] = "UNSIGNED_SHORT"; + EParameterType2[EParameterType2["INT"] = 5124] = "INT"; + EParameterType2[EParameterType2["UNSIGNED_INT"] = 5125] = "UNSIGNED_INT"; + EParameterType2[EParameterType2["FLOAT"] = 5126] = "FLOAT"; + EParameterType2[EParameterType2["FLOAT_VEC2"] = 35664] = "FLOAT_VEC2"; + EParameterType2[EParameterType2["FLOAT_VEC3"] = 35665] = "FLOAT_VEC3"; + EParameterType2[EParameterType2["FLOAT_VEC4"] = 35666] = "FLOAT_VEC4"; + EParameterType2[EParameterType2["INT_VEC2"] = 35667] = "INT_VEC2"; + EParameterType2[EParameterType2["INT_VEC3"] = 35668] = "INT_VEC3"; + EParameterType2[EParameterType2["INT_VEC4"] = 35669] = "INT_VEC4"; + EParameterType2[EParameterType2["BOOL"] = 35670] = "BOOL"; + EParameterType2[EParameterType2["BOOL_VEC2"] = 35671] = "BOOL_VEC2"; + EParameterType2[EParameterType2["BOOL_VEC3"] = 35672] = "BOOL_VEC3"; + EParameterType2[EParameterType2["BOOL_VEC4"] = 35673] = "BOOL_VEC4"; + EParameterType2[EParameterType2["FLOAT_MAT2"] = 35674] = "FLOAT_MAT2"; + EParameterType2[EParameterType2["FLOAT_MAT3"] = 35675] = "FLOAT_MAT3"; + EParameterType2[EParameterType2["FLOAT_MAT4"] = 35676] = "FLOAT_MAT4"; + EParameterType2[EParameterType2["SAMPLER_2D"] = 35678] = "SAMPLER_2D"; + })(EParameterType || (EParameterType = {})); + (function(ETextureWrapMode2) { + ETextureWrapMode2[ETextureWrapMode2["CLAMP_TO_EDGE"] = 33071] = "CLAMP_TO_EDGE"; + ETextureWrapMode2[ETextureWrapMode2["MIRRORED_REPEAT"] = 33648] = "MIRRORED_REPEAT"; + ETextureWrapMode2[ETextureWrapMode2["REPEAT"] = 10497] = "REPEAT"; + })(ETextureWrapMode || (ETextureWrapMode = {})); + (function(ETextureFilterType2) { + ETextureFilterType2[ETextureFilterType2["NEAREST"] = 9728] = "NEAREST"; + ETextureFilterType2[ETextureFilterType2["LINEAR"] = 9728] = "LINEAR"; + ETextureFilterType2[ETextureFilterType2["NEAREST_MIPMAP_NEAREST"] = 9984] = "NEAREST_MIPMAP_NEAREST"; + ETextureFilterType2[ETextureFilterType2["LINEAR_MIPMAP_NEAREST"] = 9985] = "LINEAR_MIPMAP_NEAREST"; + ETextureFilterType2[ETextureFilterType2["NEAREST_MIPMAP_LINEAR"] = 9986] = "NEAREST_MIPMAP_LINEAR"; + ETextureFilterType2[ETextureFilterType2["LINEAR_MIPMAP_LINEAR"] = 9987] = "LINEAR_MIPMAP_LINEAR"; + })(ETextureFilterType || (ETextureFilterType = {})); + (function(ETextureFormat2) { + ETextureFormat2[ETextureFormat2["ALPHA"] = 6406] = "ALPHA"; + ETextureFormat2[ETextureFormat2["RGB"] = 6407] = "RGB"; + ETextureFormat2[ETextureFormat2["RGBA"] = 6408] = "RGBA"; + ETextureFormat2[ETextureFormat2["LUMINANCE"] = 6409] = "LUMINANCE"; + ETextureFormat2[ETextureFormat2["LUMINANCE_ALPHA"] = 6410] = "LUMINANCE_ALPHA"; + })(ETextureFormat || (ETextureFormat = {})); + (function(ECullingType2) { + ECullingType2[ECullingType2["FRONT"] = 1028] = "FRONT"; + ECullingType2[ECullingType2["BACK"] = 1029] = "BACK"; + ECullingType2[ECullingType2["FRONT_AND_BACK"] = 1032] = "FRONT_AND_BACK"; + })(ECullingType || (ECullingType = {})); + (function(EBlendingFunction2) { + EBlendingFunction2[EBlendingFunction2["ZERO"] = 0] = "ZERO"; + EBlendingFunction2[EBlendingFunction2["ONE"] = 1] = "ONE"; + EBlendingFunction2[EBlendingFunction2["SRC_COLOR"] = 768] = "SRC_COLOR"; + EBlendingFunction2[EBlendingFunction2["ONE_MINUS_SRC_COLOR"] = 769] = "ONE_MINUS_SRC_COLOR"; + EBlendingFunction2[EBlendingFunction2["DST_COLOR"] = 774] = "DST_COLOR"; + EBlendingFunction2[EBlendingFunction2["ONE_MINUS_DST_COLOR"] = 775] = "ONE_MINUS_DST_COLOR"; + EBlendingFunction2[EBlendingFunction2["SRC_ALPHA"] = 770] = "SRC_ALPHA"; + EBlendingFunction2[EBlendingFunction2["ONE_MINUS_SRC_ALPHA"] = 771] = "ONE_MINUS_SRC_ALPHA"; + EBlendingFunction2[EBlendingFunction2["DST_ALPHA"] = 772] = "DST_ALPHA"; + EBlendingFunction2[EBlendingFunction2["ONE_MINUS_DST_ALPHA"] = 773] = "ONE_MINUS_DST_ALPHA"; + EBlendingFunction2[EBlendingFunction2["CONSTANT_COLOR"] = 32769] = "CONSTANT_COLOR"; + EBlendingFunction2[EBlendingFunction2["ONE_MINUS_CONSTANT_COLOR"] = 32770] = "ONE_MINUS_CONSTANT_COLOR"; + EBlendingFunction2[EBlendingFunction2["CONSTANT_ALPHA"] = 32771] = "CONSTANT_ALPHA"; + EBlendingFunction2[EBlendingFunction2["ONE_MINUS_CONSTANT_ALPHA"] = 32772] = "ONE_MINUS_CONSTANT_ALPHA"; + EBlendingFunction2[EBlendingFunction2["SRC_ALPHA_SATURATE"] = 776] = "SRC_ALPHA_SATURATE"; + })(EBlendingFunction || (EBlendingFunction = {})); +}); + +// node_modules/@babylonjs/loaders/glTF/1.0/glTFLoaderUtils.js +class GLTFUtils { + static SetMatrix(scene37, source, parameter, uniformName, shaderMaterial15) { + let mat = null; + if (parameter.semantic === "MODEL") { + mat = source.getWorldMatrix(); + } else if (parameter.semantic === "PROJECTION") { + mat = scene37.getProjectionMatrix(); + } else if (parameter.semantic === "VIEW") { + mat = scene37.getViewMatrix(); + } else if (parameter.semantic === "MODELVIEWINVERSETRANSPOSE") { + mat = Matrix.Transpose(source.getWorldMatrix().multiply(scene37.getViewMatrix()).invert()); + } else if (parameter.semantic === "MODELVIEW") { + mat = source.getWorldMatrix().multiply(scene37.getViewMatrix()); + } else if (parameter.semantic === "MODELVIEWPROJECTION") { + mat = source.getWorldMatrix().multiply(scene37.getTransformMatrix()); + } else if (parameter.semantic === "MODELINVERSE") { + mat = source.getWorldMatrix().invert(); + } else if (parameter.semantic === "VIEWINVERSE") { + mat = scene37.getViewMatrix().invert(); + } else if (parameter.semantic === "PROJECTIONINVERSE") { + mat = scene37.getProjectionMatrix().invert(); + } else if (parameter.semantic === "MODELVIEWINVERSE") { + mat = source.getWorldMatrix().multiply(scene37.getViewMatrix()).invert(); + } else if (parameter.semantic === "MODELVIEWPROJECTIONINVERSE") { + mat = source.getWorldMatrix().multiply(scene37.getTransformMatrix()).invert(); + } else if (parameter.semantic === "MODELINVERSETRANSPOSE") { + mat = Matrix.Transpose(source.getWorldMatrix().invert()); + } + if (mat) { + switch (parameter.type) { + case EParameterType.FLOAT_MAT2: + shaderMaterial15.setMatrix2x2(uniformName, Matrix.GetAsMatrix2x2(mat)); + break; + case EParameterType.FLOAT_MAT3: + shaderMaterial15.setMatrix3x3(uniformName, Matrix.GetAsMatrix3x3(mat)); + break; + case EParameterType.FLOAT_MAT4: + shaderMaterial15.setMatrix(uniformName, mat); + break; + default: + break; + } + } + } + static SetUniform(shaderMaterial15, uniform, value, type) { + switch (type) { + case EParameterType.FLOAT: + shaderMaterial15.setFloat(uniform, value); + return true; + case EParameterType.FLOAT_VEC2: + shaderMaterial15.setVector2(uniform, Vector2.FromArray(value)); + return true; + case EParameterType.FLOAT_VEC3: + shaderMaterial15.setVector3(uniform, Vector3.FromArray(value)); + return true; + case EParameterType.FLOAT_VEC4: + shaderMaterial15.setVector4(uniform, Vector4.FromArray(value)); + return true; + default: + return false; + } + } + static GetWrapMode(mode) { + switch (mode) { + case ETextureWrapMode.CLAMP_TO_EDGE: + return Texture.CLAMP_ADDRESSMODE; + case ETextureWrapMode.MIRRORED_REPEAT: + return Texture.MIRROR_ADDRESSMODE; + case ETextureWrapMode.REPEAT: + return Texture.WRAP_ADDRESSMODE; + default: + return Texture.WRAP_ADDRESSMODE; + } + } + static GetByteStrideFromType(accessor) { + const type = accessor.type; + switch (type) { + case "VEC2": + return 2; + case "VEC3": + return 3; + case "VEC4": + return 4; + case "MAT2": + return 4; + case "MAT3": + return 9; + case "MAT4": + return 16; + default: + return 1; + } + } + static GetTextureFilterMode(mode) { + switch (mode) { + case ETextureFilterType.LINEAR: + case ETextureFilterType.LINEAR_MIPMAP_NEAREST: + case ETextureFilterType.LINEAR_MIPMAP_LINEAR: + return Texture.TRILINEAR_SAMPLINGMODE; + case ETextureFilterType.NEAREST: + case ETextureFilterType.NEAREST_MIPMAP_NEAREST: + return Texture.NEAREST_SAMPLINGMODE; + default: + return Texture.BILINEAR_SAMPLINGMODE; + } + } + static GetBufferFromBufferView(gltfRuntime, bufferView, byteOffset, byteLength, componentType) { + byteOffset = bufferView.byteOffset + byteOffset; + const loadedBufferView = gltfRuntime.loadedBufferViews[bufferView.buffer]; + if (byteOffset + byteLength > loadedBufferView.byteLength) { + throw new Error("Buffer access is out of range"); + } + const buffer78 = loadedBufferView.buffer; + byteOffset += loadedBufferView.byteOffset; + switch (componentType) { + case EComponentType.BYTE: + return new Int8Array(buffer78, byteOffset, byteLength); + case EComponentType.UNSIGNED_BYTE: + return new Uint8Array(buffer78, byteOffset, byteLength); + case EComponentType.SHORT: + return new Int16Array(buffer78, byteOffset, byteLength); + case EComponentType.UNSIGNED_SHORT: + return new Uint16Array(buffer78, byteOffset, byteLength); + default: + return new Float32Array(buffer78, byteOffset, byteLength); + } + } + static GetBufferFromAccessor(gltfRuntime, accessor) { + const bufferView = gltfRuntime.bufferViews[accessor.bufferView]; + const byteLength = accessor.count * GLTFUtils.GetByteStrideFromType(accessor); + return GLTFUtils.GetBufferFromBufferView(gltfRuntime, bufferView, accessor.byteOffset, byteLength, accessor.componentType); + } + static DecodeBufferToText(view) { + let result = ""; + const length = view.byteLength; + for (let i = 0;i < length; ++i) { + result += String.fromCharCode(view[i]); + } + return result; + } + static GetDefaultMaterial(scene37) { + if (!GLTFUtils._DefaultMaterial) { + Effect.ShadersStore["GLTFDefaultMaterialVertexShader"] = [ + "precision highp float;", + "", + "uniform mat4 worldView;", + "uniform mat4 projection;", + "", + "attribute vec3 position;", + "", + "void main(void)", + "{", + " gl_Position = projection * worldView * vec4(position, 1.0);", + "}" + ].join("\n"); + Effect.ShadersStore["GLTFDefaultMaterialPixelShader"] = [ + "precision highp float;", + "", + "uniform vec4 u_emission;", + "", + "void main(void)", + "{", + " gl_FragColor = u_emission;", + "}" + ].join("\n"); + const shaderPath = { + vertex: "GLTFDefaultMaterial", + fragment: "GLTFDefaultMaterial" + }; + const options = { + attributes: ["position"], + uniforms: ["worldView", "projection", "u_emission"], + samplers: new Array, + needAlphaBlending: false + }; + GLTFUtils._DefaultMaterial = new ShaderMaterial("GLTFDefaultMaterial", scene37, shaderPath, options); + GLTFUtils._DefaultMaterial.setColor4("u_emission", new Color4(0.5, 0.5, 0.5, 1)); + } + return GLTFUtils._DefaultMaterial; + } +} +var init_glTFLoaderUtils = __esm(() => { + init_glTFLoaderInterfaces(); + init_math_vector(); + init_math_color(); + init_effect(); + init_shaderMaterial(); + init_texture(); + GLTFUtils._DefaultMaterial = null; +}); + +// node_modules/@babylonjs/loaders/glTF/1.0/glTFLoader.js +class Tokenizer { + constructor(toParse) { + this._pos = 0; + this.currentToken = ETokenType.UNKNOWN; + this.currentIdentifier = ""; + this.currentString = ""; + this.isLetterOrDigitPattern = /^[a-zA-Z0-9]+$/; + this._toParse = toParse; + this._maxPos = toParse.length; + } + getNextToken() { + if (this.isEnd()) { + return ETokenType.END_OF_INPUT; + } + this.currentString = this.read(); + this.currentToken = ETokenType.UNKNOWN; + if (this.currentString === "_" || this.isLetterOrDigitPattern.test(this.currentString)) { + this.currentToken = ETokenType.IDENTIFIER; + this.currentIdentifier = this.currentString; + while (!this.isEnd() && (this.isLetterOrDigitPattern.test(this.currentString = this.peek()) || this.currentString === "_")) { + this.currentIdentifier += this.currentString; + this.forward(); + } + } + return this.currentToken; + } + peek() { + return this._toParse[this._pos]; + } + read() { + return this._toParse[this._pos++]; + } + forward() { + this._pos++; + } + isEnd() { + return this._pos >= this._maxPos; + } +} + +class GLTFLoaderBase { + static CreateRuntime(parsedData, scene37, rootUrl) { + const gltfRuntime = { + extensions: {}, + accessors: {}, + buffers: {}, + bufferViews: {}, + meshes: {}, + lights: {}, + cameras: {}, + nodes: {}, + images: {}, + textures: {}, + shaders: {}, + programs: {}, + samplers: {}, + techniques: {}, + materials: {}, + animations: {}, + skins: {}, + extensionsUsed: [], + scenes: {}, + buffersCount: 0, + shaderscount: 0, + scene: scene37, + rootUrl, + loadedBufferCount: 0, + loadedBufferViews: {}, + loadedShaderCount: 0, + importOnlyMeshes: false, + dummyNodes: [], + assetContainer: null + }; + if (parsedData.extensions) { + parseObject(parsedData.extensions, "extensions", gltfRuntime); + } + if (parsedData.extensionsUsed) { + parseObject(parsedData.extensionsUsed, "extensionsUsed", gltfRuntime); + } + if (parsedData.buffers) { + parseBuffers(parsedData.buffers, gltfRuntime); + } + if (parsedData.bufferViews) { + parseObject(parsedData.bufferViews, "bufferViews", gltfRuntime); + } + if (parsedData.accessors) { + parseObject(parsedData.accessors, "accessors", gltfRuntime); + } + if (parsedData.meshes) { + parseObject(parsedData.meshes, "meshes", gltfRuntime); + } + if (parsedData.lights) { + parseObject(parsedData.lights, "lights", gltfRuntime); + } + if (parsedData.cameras) { + parseObject(parsedData.cameras, "cameras", gltfRuntime); + } + if (parsedData.nodes) { + parseObject(parsedData.nodes, "nodes", gltfRuntime); + } + if (parsedData.images) { + parseObject(parsedData.images, "images", gltfRuntime); + } + if (parsedData.textures) { + parseObject(parsedData.textures, "textures", gltfRuntime); + } + if (parsedData.shaders) { + parseShaders(parsedData.shaders, gltfRuntime); + } + if (parsedData.programs) { + parseObject(parsedData.programs, "programs", gltfRuntime); + } + if (parsedData.samplers) { + parseObject(parsedData.samplers, "samplers", gltfRuntime); + } + if (parsedData.techniques) { + parseObject(parsedData.techniques, "techniques", gltfRuntime); + } + if (parsedData.materials) { + parseObject(parsedData.materials, "materials", gltfRuntime); + } + if (parsedData.animations) { + parseObject(parsedData.animations, "animations", gltfRuntime); + } + if (parsedData.skins) { + parseObject(parsedData.skins, "skins", gltfRuntime); + } + if (parsedData.scenes) { + gltfRuntime.scenes = parsedData.scenes; + } + if (parsedData.scene && parsedData.scenes) { + gltfRuntime.currentScene = parsedData.scenes[parsedData.scene]; + } + return gltfRuntime; + } + static LoadBufferAsync(gltfRuntime, id, onSuccess, onError, onProgress) { + const buffer79 = gltfRuntime.buffers[id]; + if (Tools.IsBase64(buffer79.uri)) { + setTimeout(() => onSuccess(new Uint8Array(Tools.DecodeBase64(buffer79.uri)))); + } else { + Tools.LoadFile(gltfRuntime.rootUrl + buffer79.uri, (data) => onSuccess(new Uint8Array(data)), onProgress, undefined, true, (request) => { + if (request) { + onError(request.status + " " + request.statusText); + } + }); + } + } + static LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError) { + const texture86 = gltfRuntime.textures[id]; + if (!texture86 || !texture86.source) { + onError(""); + return; + } + if (texture86.babylonTexture) { + onSuccess(null); + return; + } + const source = gltfRuntime.images[texture86.source]; + if (Tools.IsBase64(source.uri)) { + setTimeout(() => onSuccess(new Uint8Array(Tools.DecodeBase64(source.uri)))); + } else { + Tools.LoadFile(gltfRuntime.rootUrl + source.uri, (data) => onSuccess(new Uint8Array(data)), undefined, undefined, true, (request) => { + if (request) { + onError(request.status + " " + request.statusText); + } + }); + } + } + static CreateTextureAsync(gltfRuntime, id, buffer79, onSuccess) { + const texture86 = gltfRuntime.textures[id]; + if (texture86.babylonTexture) { + onSuccess(texture86.babylonTexture); + return; + } + const sampler = gltfRuntime.samplers[texture86.sampler]; + const createMipMaps = sampler.minFilter === ETextureFilterType.NEAREST_MIPMAP_NEAREST || sampler.minFilter === ETextureFilterType.NEAREST_MIPMAP_LINEAR || sampler.minFilter === ETextureFilterType.LINEAR_MIPMAP_NEAREST || sampler.minFilter === ETextureFilterType.LINEAR_MIPMAP_LINEAR; + const samplingMode = Texture.BILINEAR_SAMPLINGMODE; + const blob = buffer79 == null ? new Blob : new Blob([buffer79]); + const blobURL = URL.createObjectURL(blob); + const revokeBlobURL = () => URL.revokeObjectURL(blobURL); + const newTexture = new Texture(blobURL, gltfRuntime.scene, !createMipMaps, true, samplingMode, revokeBlobURL, revokeBlobURL); + if (sampler.wrapS !== undefined) { + newTexture.wrapU = GLTFUtils.GetWrapMode(sampler.wrapS); + } + if (sampler.wrapT !== undefined) { + newTexture.wrapV = GLTFUtils.GetWrapMode(sampler.wrapT); + } + newTexture.name = id; + texture86.babylonTexture = newTexture; + onSuccess(newTexture); + } + static LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError) { + const shader285 = gltfRuntime.shaders[id]; + if (Tools.IsBase64(shader285.uri)) { + const shaderString = atob(shader285.uri.split(",")[1]); + if (onSuccess) { + onSuccess(shaderString); + } + } else { + Tools.LoadFile(gltfRuntime.rootUrl + shader285.uri, onSuccess, undefined, undefined, false, (request) => { + if (request && onError) { + onError(request.status + " " + request.statusText); + } + }); + } + } + static LoadMaterialAsync(gltfRuntime, id, onSuccess, onError) { + const material28 = gltfRuntime.materials[id]; + if (!material28.technique) { + if (onError) { + onError("No technique found."); + } + return; + } + const technique = gltfRuntime.techniques[material28.technique]; + if (!technique) { + gltfRuntime.scene._blockEntityCollection = !!gltfRuntime.assetContainer; + const defaultMaterial = new StandardMaterial(id, gltfRuntime.scene); + defaultMaterial._parentContainer = gltfRuntime.assetContainer; + gltfRuntime.scene._blockEntityCollection = false; + defaultMaterial.diffuseColor = new Color3(0.5, 0.5, 0.5); + defaultMaterial.sideOrientation = Material.CounterClockWiseSideOrientation; + onSuccess(defaultMaterial); + return; + } + const program = gltfRuntime.programs[technique.program]; + const states = technique.states; + const vertexShader = Effect.ShadersStore[program.vertexShader + "VertexShader"]; + const pixelShader = Effect.ShadersStore[program.fragmentShader + "PixelShader"]; + let newVertexShader = ""; + let newPixelShader = ""; + const vertexTokenizer = new Tokenizer(vertexShader); + const pixelTokenizer = new Tokenizer(pixelShader); + const unTreatedUniforms = {}; + const uniforms2 = []; + const attributes = []; + const samplers = []; + for (const unif in technique.uniforms) { + const uniform = technique.uniforms[unif]; + const uniformParameter = technique.parameters[uniform]; + unTreatedUniforms[unif] = uniformParameter; + if (uniformParameter.semantic && !uniformParameter.node && !uniformParameter.source) { + const transformIndex = glTFTransforms.indexOf(uniformParameter.semantic); + if (transformIndex !== -1) { + uniforms2.push(babylonTransforms[transformIndex]); + delete unTreatedUniforms[unif]; + } else { + uniforms2.push(unif); + } + } else if (uniformParameter.type === EParameterType.SAMPLER_2D) { + samplers.push(unif); + } else { + uniforms2.push(unif); + } + } + for (const attr in technique.attributes) { + const attribute = technique.attributes[attr]; + const attributeParameter = technique.parameters[attribute]; + if (attributeParameter.semantic) { + const name286 = getAttribute(attributeParameter); + if (name286) { + attributes.push(name286); + } + } + } + while (!vertexTokenizer.isEnd() && vertexTokenizer.getNextToken()) { + const tokenType = vertexTokenizer.currentToken; + if (tokenType !== ETokenType.IDENTIFIER) { + newVertexShader += vertexTokenizer.currentString; + continue; + } + let foundAttribute = false; + for (const attr in technique.attributes) { + const attribute = technique.attributes[attr]; + const attributeParameter = technique.parameters[attribute]; + if (vertexTokenizer.currentIdentifier === attr && attributeParameter.semantic) { + newVertexShader += getAttribute(attributeParameter); + foundAttribute = true; + break; + } + } + if (foundAttribute) { + continue; + } + newVertexShader += parseShaderUniforms(vertexTokenizer, technique, unTreatedUniforms); + } + while (!pixelTokenizer.isEnd() && pixelTokenizer.getNextToken()) { + const tokenType = pixelTokenizer.currentToken; + if (tokenType !== ETokenType.IDENTIFIER) { + newPixelShader += pixelTokenizer.currentString; + continue; + } + newPixelShader += parseShaderUniforms(pixelTokenizer, technique, unTreatedUniforms); + } + const shaderPath = { + vertex: program.vertexShader + id, + fragment: program.fragmentShader + id + }; + const options = { + attributes, + uniforms: uniforms2, + samplers, + needAlphaBlending: states && states.enable && states.enable.indexOf(3042) !== -1 + }; + Effect.ShadersStore[program.vertexShader + id + "VertexShader"] = newVertexShader; + Effect.ShadersStore[program.fragmentShader + id + "PixelShader"] = newPixelShader; + const shaderMaterial16 = new ShaderMaterial(id, gltfRuntime.scene, shaderPath, options); + shaderMaterial16.onError = onShaderCompileError(program, shaderMaterial16, onError); + shaderMaterial16.onCompiled = onShaderCompileSuccess(gltfRuntime, shaderMaterial16, technique, material28, unTreatedUniforms, onSuccess); + shaderMaterial16.sideOrientation = Material.CounterClockWiseSideOrientation; + if (states && states.functions) { + const functions = states.functions; + if (functions.cullFace && functions.cullFace[0] !== ECullingType.BACK) { + shaderMaterial16.backFaceCulling = false; + } + const blendFunc = functions.blendFuncSeparate; + if (blendFunc) { + if (blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_ALPHA && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { + shaderMaterial16.alphaMode = Constants.ALPHA_COMBINE; + } else if (blendFunc[0] === EBlendingFunction.ONE && blendFunc[1] === EBlendingFunction.ONE && blendFunc[2] === EBlendingFunction.ZERO && blendFunc[3] === EBlendingFunction.ONE) { + shaderMaterial16.alphaMode = Constants.ALPHA_ONEONE; + } else if (blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE && blendFunc[2] === EBlendingFunction.ZERO && blendFunc[3] === EBlendingFunction.ONE) { + shaderMaterial16.alphaMode = Constants.ALPHA_ADD; + } else if (blendFunc[0] === EBlendingFunction.ZERO && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_COLOR && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { + shaderMaterial16.alphaMode = Constants.ALPHA_SUBTRACT; + } else if (blendFunc[0] === EBlendingFunction.DST_COLOR && blendFunc[1] === EBlendingFunction.ZERO && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { + shaderMaterial16.alphaMode = Constants.ALPHA_MULTIPLY; + } else if (blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_COLOR && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { + shaderMaterial16.alphaMode = Constants.ALPHA_MAXIMIZED; + } + } + } + } +} + +class GLTFLoader { + static RegisterExtension(extension) { + if (GLTFLoader.Extensions[extension.name]) { + Tools.Error('Tool with the same name "' + extension.name + '" already exists'); + return; + } + GLTFLoader.Extensions[extension.name] = extension; + } + dispose() { + } + _importMeshAsync(meshesNames, scene37, data, rootUrl, assetContainer4, onSuccess, onProgress, onError) { + scene37.useRightHandedSystem = true; + GLTFLoaderExtension.LoadRuntimeAsync(scene37, data, rootUrl, (gltfRuntime) => { + gltfRuntime.assetContainer = assetContainer4; + gltfRuntime.importOnlyMeshes = true; + if (meshesNames === "") { + gltfRuntime.importMeshesNames = []; + } else if (typeof meshesNames === "string") { + gltfRuntime.importMeshesNames = [meshesNames]; + } else if (meshesNames && !(meshesNames instanceof Array)) { + gltfRuntime.importMeshesNames = [meshesNames]; + } else { + gltfRuntime.importMeshesNames = []; + Tools.Warn("Argument meshesNames must be of type string or string[]"); + } + this._createNodes(gltfRuntime); + const meshes = []; + const skeletons = []; + for (const nde in gltfRuntime.nodes) { + const node30 = gltfRuntime.nodes[nde]; + if (node30.babylonNode instanceof AbstractMesh) { + meshes.push(node30.babylonNode); + } + } + for (const skl in gltfRuntime.skins) { + const skin = gltfRuntime.skins[skl]; + if (skin.babylonSkeleton instanceof Skeleton) { + skeletons.push(skin.babylonSkeleton); + } + } + this._loadBuffersAsync(gltfRuntime, () => { + this._loadShadersAsync(gltfRuntime, () => { + importMaterials(gltfRuntime); + postLoad(gltfRuntime); + if (!GLTFFileLoader.IncrementalLoading && onSuccess) { + onSuccess(meshes, skeletons); + } + }); + }); + if (GLTFFileLoader.IncrementalLoading && onSuccess) { + onSuccess(meshes, skeletons); + } + }, onError); + return true; + } + importMeshAsync(meshesNames, scene37, assetContainer4, data, rootUrl, onProgress) { + return new Promise((resolve, reject) => { + this._importMeshAsync(meshesNames, scene37, data, rootUrl, assetContainer4, (meshes, skeletons) => { + resolve({ + meshes, + particleSystems: [], + skeletons, + animationGroups: [], + lights: [], + transformNodes: [], + geometries: [] + }); + }, onProgress, (message) => { + reject(new Error(message)); + }); + }); + } + _loadAsync(scene37, data, rootUrl, onSuccess, onProgress, onError) { + scene37.useRightHandedSystem = true; + GLTFLoaderExtension.LoadRuntimeAsync(scene37, data, rootUrl, (gltfRuntime) => { + GLTFLoaderExtension.LoadRuntimeExtensionsAsync(gltfRuntime, () => { + this._createNodes(gltfRuntime); + this._loadBuffersAsync(gltfRuntime, () => { + this._loadShadersAsync(gltfRuntime, () => { + importMaterials(gltfRuntime); + postLoad(gltfRuntime); + if (!GLTFFileLoader.IncrementalLoading) { + onSuccess(); + } + }); + }); + if (GLTFFileLoader.IncrementalLoading) { + onSuccess(); + } + }, onError); + }, onError); + } + loadAsync(scene37, data, rootUrl, onProgress) { + return new Promise((resolve, reject) => { + this._loadAsync(scene37, data, rootUrl, () => { + resolve(); + }, onProgress, (message) => { + reject(new Error(message)); + }); + }); + } + _loadShadersAsync(gltfRuntime, onload) { + let hasShaders = false; + const processShader = (sha, shader285) => { + GLTFLoaderExtension.LoadShaderStringAsync(gltfRuntime, sha, (shaderString) => { + if (shaderString instanceof ArrayBuffer) { + return; + } + gltfRuntime.loadedShaderCount++; + if (shaderString) { + Effect.ShadersStore[sha + (shader285.type === EShaderType.VERTEX ? "VertexShader" : "PixelShader")] = shaderString; + } + if (gltfRuntime.loadedShaderCount === gltfRuntime.shaderscount) { + onload(); + } + }, () => { + Tools.Error("Error when loading shader program named " + sha + " located at " + shader285.uri); + }); + }; + for (const sha in gltfRuntime.shaders) { + hasShaders = true; + const shader285 = gltfRuntime.shaders[sha]; + if (shader285) { + processShader.bind(this, sha, shader285)(); + } else { + Tools.Error("No shader named: " + sha); + } + } + if (!hasShaders) { + onload(); + } + } + _loadBuffersAsync(gltfRuntime, onLoad) { + let hasBuffers = false; + const processBuffer = (buf, buffer79) => { + GLTFLoaderExtension.LoadBufferAsync(gltfRuntime, buf, (bufferView) => { + gltfRuntime.loadedBufferCount++; + if (bufferView) { + if (bufferView.byteLength != gltfRuntime.buffers[buf].byteLength) { + Tools.Error("Buffer named " + buf + " is length " + bufferView.byteLength + ". Expected: " + buffer79.byteLength); + } + gltfRuntime.loadedBufferViews[buf] = bufferView; + } + if (gltfRuntime.loadedBufferCount === gltfRuntime.buffersCount) { + onLoad(); + } + }, () => { + Tools.Error("Error when loading buffer named " + buf + " located at " + buffer79.uri); + }); + }; + for (const buf in gltfRuntime.buffers) { + hasBuffers = true; + const buffer79 = gltfRuntime.buffers[buf]; + if (buffer79) { + processBuffer.bind(this, buf, buffer79)(); + } else { + Tools.Error("No buffer named: " + buf); + } + } + if (!hasBuffers) { + onLoad(); + } + } + _createNodes(gltfRuntime) { + let currentScene = gltfRuntime.currentScene; + if (currentScene) { + for (let i = 0;i < currentScene.nodes.length; i++) { + traverseNodes(gltfRuntime, currentScene.nodes[i], null); + } + } else { + for (const thing in gltfRuntime.scenes) { + currentScene = gltfRuntime.scenes[thing]; + for (let i = 0;i < currentScene.nodes.length; i++) { + traverseNodes(gltfRuntime, currentScene.nodes[i], null); + } + } + } + } +} + +class GLTFLoaderExtension { + constructor(name286) { + this._name = name286; + } + get name() { + return this._name; + } + loadRuntimeAsync(scene37, data, rootUrl, onSuccess, onError) { + return false; + } + loadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError) { + return false; + } + loadBufferAsync(gltfRuntime, id, onSuccess, onError, onProgress) { + return false; + } + loadTextureBufferAsync(gltfRuntime, id, onSuccess, onError) { + return false; + } + createTextureAsync(gltfRuntime, id, buffer79, onSuccess, onError) { + return false; + } + loadShaderStringAsync(gltfRuntime, id, onSuccess, onError) { + return false; + } + loadMaterialAsync(gltfRuntime, id, onSuccess, onError) { + return false; + } + static LoadRuntimeAsync(scene37, data, rootUrl, onSuccess, onError) { + GLTFLoaderExtension._ApplyExtensions((loaderExtension) => { + return loaderExtension.loadRuntimeAsync(scene37, data, rootUrl, onSuccess, onError); + }, () => { + setTimeout(() => { + if (!onSuccess) { + return; + } + onSuccess(GLTFLoaderBase.CreateRuntime(data.json, scene37, rootUrl)); + }); + }); + } + static LoadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError) { + GLTFLoaderExtension._ApplyExtensions((loaderExtension) => { + return loaderExtension.loadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError); + }, () => { + setTimeout(() => { + onSuccess(); + }); + }); + } + static LoadBufferAsync(gltfRuntime, id, onSuccess, onError, onProgress) { + GLTFLoaderExtension._ApplyExtensions((loaderExtension) => { + return loaderExtension.loadBufferAsync(gltfRuntime, id, onSuccess, onError, onProgress); + }, () => { + GLTFLoaderBase.LoadBufferAsync(gltfRuntime, id, onSuccess, onError, onProgress); + }); + } + static LoadTextureAsync(gltfRuntime, id, onSuccess, onError) { + GLTFLoaderExtension._LoadTextureBufferAsync(gltfRuntime, id, (buffer79) => { + if (buffer79) { + GLTFLoaderExtension._CreateTextureAsync(gltfRuntime, id, buffer79, onSuccess, onError); + } + }, onError); + } + static LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError) { + GLTFLoaderExtension._ApplyExtensions((loaderExtension) => { + return loaderExtension.loadShaderStringAsync(gltfRuntime, id, onSuccess, onError); + }, () => { + GLTFLoaderBase.LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError); + }); + } + static LoadMaterialAsync(gltfRuntime, id, onSuccess, onError) { + GLTFLoaderExtension._ApplyExtensions((loaderExtension) => { + return loaderExtension.loadMaterialAsync(gltfRuntime, id, onSuccess, onError); + }, () => { + GLTFLoaderBase.LoadMaterialAsync(gltfRuntime, id, onSuccess, onError); + }); + } + static _LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError) { + GLTFLoaderExtension._ApplyExtensions((loaderExtension) => { + return loaderExtension.loadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); + }, () => { + GLTFLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); + }); + } + static _CreateTextureAsync(gltfRuntime, id, buffer79, onSuccess, onError) { + GLTFLoaderExtension._ApplyExtensions((loaderExtension) => { + return loaderExtension.createTextureAsync(gltfRuntime, id, buffer79, onSuccess, onError); + }, () => { + GLTFLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer79, onSuccess); + }); + } + static _ApplyExtensions(func, defaultFunc) { + for (const extensionName in GLTFLoader.Extensions) { + const loaderExtension = GLTFLoader.Extensions[extensionName]; + if (func(loaderExtension)) { + return; + } + } + defaultFunc(); + } +} +var ETokenType, glTFTransforms, babylonTransforms, glTFAnimationPaths, babylonAnimationPaths, parseBuffers, parseShaders, parseObject, normalizeUVs, getAttribute, loadAnimations, configureBoneTransformation, getParentBone, getNodeToRoot, getJointNode, nodeIsInJoints, getNodesToRoot, importSkeleton, importMesh, configureNode, configureNodeFromMatrix, importNode, traverseNodes, postLoad, onBindShaderMaterial, prepareShaderMaterialUniforms, onShaderCompileError, onShaderCompileSuccess, parseShaderUniforms, importMaterials; +var init_glTFLoader = __esm(() => { + init_glTFLoaderInterfaces(); + init_math_vector(); + init_math_color(); + init_tools(); + init_camera(); + init_freeCamera(); + init_animation(); + init_bone(); + init_skeleton(); + init_effect(); + init_material(); + init_multiMaterial(); + init_standardMaterial(); + init_shaderMaterial(); + init_texture(); + init_mesh_vertexData(); + init_buffer(); + init_geometry(); + init_subMesh(); + init_abstractMesh(); + init_mesh(); + init_hemisphericLight(); + init_directionalLight(); + init_pointLight(); + init_spotLight(); + init_glTFLoaderUtils(); + init_glTFFileLoader(); + init_constants(); + (function(ETokenType2) { + ETokenType2[ETokenType2["IDENTIFIER"] = 1] = "IDENTIFIER"; + ETokenType2[ETokenType2["UNKNOWN"] = 2] = "UNKNOWN"; + ETokenType2[ETokenType2["END_OF_INPUT"] = 3] = "END_OF_INPUT"; + })(ETokenType || (ETokenType = {})); + glTFTransforms = ["MODEL", "VIEW", "PROJECTION", "MODELVIEW", "MODELVIEWPROJECTION", "JOINTMATRIX"]; + babylonTransforms = ["world", "view", "projection", "worldView", "worldViewProjection", "mBones"]; + glTFAnimationPaths = ["translation", "rotation", "scale"]; + babylonAnimationPaths = ["position", "rotationQuaternion", "scaling"]; + parseBuffers = (parsedBuffers, gltfRuntime) => { + for (const buf in parsedBuffers) { + const parsedBuffer = parsedBuffers[buf]; + gltfRuntime.buffers[buf] = parsedBuffer; + gltfRuntime.buffersCount++; + } + }; + parseShaders = (parsedShaders, gltfRuntime) => { + for (const sha in parsedShaders) { + const parsedShader = parsedShaders[sha]; + gltfRuntime.shaders[sha] = parsedShader; + gltfRuntime.shaderscount++; + } + }; + parseObject = (parsedObjects, runtimeProperty, gltfRuntime) => { + for (const object in parsedObjects) { + const parsedObject = parsedObjects[object]; + gltfRuntime[runtimeProperty][object] = parsedObject; + } + }; + normalizeUVs = (buffer79) => { + if (!buffer79) { + return; + } + for (let i = 0;i < buffer79.length / 2; i++) { + buffer79[i * 2 + 1] = 1 - buffer79[i * 2 + 1]; + } + }; + getAttribute = (attributeParameter) => { + if (attributeParameter.semantic === "NORMAL") { + return "normal"; + } else if (attributeParameter.semantic === "POSITION") { + return "position"; + } else if (attributeParameter.semantic === "JOINT") { + return "matricesIndices"; + } else if (attributeParameter.semantic === "WEIGHT") { + return "matricesWeights"; + } else if (attributeParameter.semantic === "COLOR") { + return "color"; + } else if (attributeParameter.semantic && attributeParameter.semantic.indexOf("TEXCOORD_") !== -1) { + const channel = Number(attributeParameter.semantic.split("_")[1]); + return "uv" + (channel === 0 ? "" : channel + 1); + } + return null; + }; + loadAnimations = (gltfRuntime) => { + for (const anim in gltfRuntime.animations) { + const animation15 = gltfRuntime.animations[anim]; + if (!animation15.channels || !animation15.samplers) { + continue; + } + let lastAnimation = null; + for (let i = 0;i < animation15.channels.length; i++) { + const channel = animation15.channels[i]; + const sampler = animation15.samplers[channel.sampler]; + if (!sampler) { + continue; + } + let inputData = null; + let outputData = null; + if (animation15.parameters) { + inputData = animation15.parameters[sampler.input]; + outputData = animation15.parameters[sampler.output]; + } else { + inputData = sampler.input; + outputData = sampler.output; + } + const bufferInput = GLTFUtils.GetBufferFromAccessor(gltfRuntime, gltfRuntime.accessors[inputData]); + const bufferOutput = GLTFUtils.GetBufferFromAccessor(gltfRuntime, gltfRuntime.accessors[outputData]); + const targetId = channel.target.id; + let targetNode = gltfRuntime.scene.getNodeById(targetId); + if (targetNode === null) { + targetNode = gltfRuntime.scene.getNodeByName(targetId); + } + if (targetNode === null) { + Tools.Warn("Creating animation named " + anim + ". But cannot find node named " + targetId + " to attach to"); + continue; + } + const isBone = targetNode instanceof Bone; + let targetPath = channel.target.path; + const targetPathIndex = glTFAnimationPaths.indexOf(targetPath); + if (targetPathIndex !== -1) { + targetPath = babylonAnimationPaths[targetPathIndex]; + } + let animationType = Animation.ANIMATIONTYPE_MATRIX; + if (!isBone) { + if (targetPath === "rotationQuaternion") { + animationType = Animation.ANIMATIONTYPE_QUATERNION; + targetNode.rotationQuaternion = new Quaternion; + } else { + animationType = Animation.ANIMATIONTYPE_VECTOR3; + } + } + let babylonAnimation = null; + const keys4 = []; + let arrayOffset = 0; + let modifyKey = false; + if (isBone && lastAnimation && lastAnimation.getKeys().length === bufferInput.length) { + babylonAnimation = lastAnimation; + modifyKey = true; + } + if (!modifyKey) { + gltfRuntime.scene._blockEntityCollection = !!gltfRuntime.assetContainer; + babylonAnimation = new Animation(anim, isBone ? "_matrix" : targetPath, 1, animationType, Animation.ANIMATIONLOOPMODE_CYCLE); + gltfRuntime.scene._blockEntityCollection = false; + } + for (let j = 0;j < bufferInput.length; j++) { + let value = null; + if (targetPath === "rotationQuaternion") { + value = Quaternion.FromArray([bufferOutput[arrayOffset], bufferOutput[arrayOffset + 1], bufferOutput[arrayOffset + 2], bufferOutput[arrayOffset + 3]]); + arrayOffset += 4; + } else { + value = Vector3.FromArray([bufferOutput[arrayOffset], bufferOutput[arrayOffset + 1], bufferOutput[arrayOffset + 2]]); + arrayOffset += 3; + } + if (isBone) { + const bone5 = targetNode; + let translation = Vector3.Zero(); + let rotationQuaternion = new Quaternion; + let scaling = Vector3.Zero(); + let mat = bone5.getBaseMatrix(); + if (modifyKey && lastAnimation) { + mat = lastAnimation.getKeys()[j].value; + } + mat.decompose(scaling, rotationQuaternion, translation); + if (targetPath === "position") { + translation = value; + } else if (targetPath === "rotationQuaternion") { + rotationQuaternion = value; + } else { + scaling = value; + } + value = Matrix.Compose(scaling, rotationQuaternion, translation); + } + if (!modifyKey) { + keys4.push({ + frame: bufferInput[j], + value + }); + } else if (lastAnimation) { + lastAnimation.getKeys()[j].value = value; + } + } + if (!modifyKey && babylonAnimation) { + babylonAnimation.setKeys(keys4); + targetNode.animations.push(babylonAnimation); + } + lastAnimation = babylonAnimation; + gltfRuntime.scene.stopAnimation(targetNode); + gltfRuntime.scene.beginAnimation(targetNode, 0, bufferInput[bufferInput.length - 1], true, 1); + } + } + }; + configureBoneTransformation = (node30) => { + let mat = null; + if (node30.translation || node30.rotation || node30.scale) { + const scale = Vector3.FromArray(node30.scale || [1, 1, 1]); + const rotation = Quaternion.FromArray(node30.rotation || [0, 0, 0, 1]); + const position3 = Vector3.FromArray(node30.translation || [0, 0, 0]); + mat = Matrix.Compose(scale, rotation, position3); + } else { + mat = Matrix.FromArray(node30.matrix); + } + return mat; + }; + getParentBone = (gltfRuntime, skins, jointName, newSkeleton) => { + for (let i = 0;i < newSkeleton.bones.length; i++) { + if (newSkeleton.bones[i].name === jointName) { + return newSkeleton.bones[i]; + } + } + const nodes = gltfRuntime.nodes; + for (const nde in nodes) { + const node30 = nodes[nde]; + if (!node30.jointName) { + continue; + } + const children = node30.children; + for (let i = 0;i < children.length; i++) { + const child = gltfRuntime.nodes[children[i]]; + if (!child.jointName) { + continue; + } + if (child.jointName === jointName) { + const mat = configureBoneTransformation(node30); + const bone5 = new Bone(node30.name || "", newSkeleton, getParentBone(gltfRuntime, skins, node30.jointName, newSkeleton), mat); + bone5.id = nde; + return bone5; + } + } + } + return null; + }; + getNodeToRoot = (nodesToRoot, id) => { + for (let i = 0;i < nodesToRoot.length; i++) { + const nodeToRoot = nodesToRoot[i]; + for (let j = 0;j < nodeToRoot.node.children.length; j++) { + const child = nodeToRoot.node.children[j]; + if (child === id) { + return nodeToRoot.bone; + } + } + } + return null; + }; + getJointNode = (gltfRuntime, jointName) => { + const nodes = gltfRuntime.nodes; + let node30 = nodes[jointName]; + if (node30) { + return { + node: node30, + id: jointName + }; + } + for (const nde in nodes) { + node30 = nodes[nde]; + if (node30.jointName === jointName) { + return { + node: node30, + id: nde + }; + } + } + return null; + }; + nodeIsInJoints = (skins, id) => { + for (let i = 0;i < skins.jointNames.length; i++) { + if (skins.jointNames[i] === id) { + return true; + } + } + return false; + }; + getNodesToRoot = (gltfRuntime, newSkeleton, skins, nodesToRoot) => { + for (const nde in gltfRuntime.nodes) { + const node30 = gltfRuntime.nodes[nde]; + const id = nde; + if (!node30.jointName || nodeIsInJoints(skins, node30.jointName)) { + continue; + } + const mat = configureBoneTransformation(node30); + const bone5 = new Bone(node30.name || "", newSkeleton, null, mat); + bone5.id = id; + nodesToRoot.push({ bone: bone5, node: node30, id }); + } + for (let i = 0;i < nodesToRoot.length; i++) { + const nodeToRoot = nodesToRoot[i]; + const children = nodeToRoot.node.children; + for (let j = 0;j < children.length; j++) { + let child = null; + for (let k = 0;k < nodesToRoot.length; k++) { + if (nodesToRoot[k].id === children[j]) { + child = nodesToRoot[k]; + break; + } + } + if (child) { + child.bone._parent = nodeToRoot.bone; + nodeToRoot.bone.children.push(child.bone); + } + } + } + }; + importSkeleton = (gltfRuntime, skins, mesh78, newSkeleton) => { + if (!newSkeleton) { + newSkeleton = new Skeleton(skins.name || "", "", gltfRuntime.scene); + } + if (!skins.babylonSkeleton) { + return newSkeleton; + } + const nodesToRoot = []; + const nodesToRootToAdd = []; + getNodesToRoot(gltfRuntime, newSkeleton, skins, nodesToRoot); + newSkeleton.bones = []; + for (let i = 0;i < skins.jointNames.length; i++) { + const jointNode = getJointNode(gltfRuntime, skins.jointNames[i]); + if (!jointNode) { + continue; + } + const node30 = jointNode.node; + if (!node30) { + Tools.Warn("Joint named " + skins.jointNames[i] + " does not exist"); + continue; + } + const id = jointNode.id; + const existingBone = gltfRuntime.scene.getBoneById(id); + if (existingBone) { + newSkeleton.bones.push(existingBone); + continue; + } + let foundBone = false; + let parentBone = null; + for (let j = 0;j < i; j++) { + const jointNode2 = getJointNode(gltfRuntime, skins.jointNames[j]); + if (!jointNode2) { + continue; + } + const joint = jointNode2.node; + if (!joint) { + Tools.Warn("Joint named " + skins.jointNames[j] + " does not exist when looking for parent"); + continue; + } + const children = joint.children; + if (!children) { + continue; + } + foundBone = false; + for (let k = 0;k < children.length; k++) { + if (children[k] === id) { + parentBone = getParentBone(gltfRuntime, skins, skins.jointNames[j], newSkeleton); + foundBone = true; + break; + } + } + if (foundBone) { + break; + } + } + const mat = configureBoneTransformation(node30); + if (!parentBone && nodesToRoot.length > 0) { + parentBone = getNodeToRoot(nodesToRoot, id); + if (parentBone) { + if (nodesToRootToAdd.indexOf(parentBone) === -1) { + nodesToRootToAdd.push(parentBone); + } + } + } + const bone5 = new Bone(node30.jointName || "", newSkeleton, parentBone, mat); + bone5.id = id; + } + const bones = newSkeleton.bones; + newSkeleton.bones = []; + for (let i = 0;i < skins.jointNames.length; i++) { + const jointNode = getJointNode(gltfRuntime, skins.jointNames[i]); + if (!jointNode) { + continue; + } + for (let j = 0;j < bones.length; j++) { + if (bones[j].id === jointNode.id) { + newSkeleton.bones.push(bones[j]); + break; + } + } + } + newSkeleton.prepare(); + for (let i = 0;i < nodesToRootToAdd.length; i++) { + newSkeleton.bones.push(nodesToRootToAdd[i]); + } + return newSkeleton; + }; + importMesh = (gltfRuntime, node30, meshes, id, newMesh) => { + if (!newMesh) { + gltfRuntime.scene._blockEntityCollection = !!gltfRuntime.assetContainer; + newMesh = new Mesh(node30.name || "", gltfRuntime.scene); + newMesh._parentContainer = gltfRuntime.assetContainer; + gltfRuntime.scene._blockEntityCollection = false; + newMesh.id = id; + } + if (!node30.babylonNode) { + return newMesh; + } + const subMaterials = []; + let vertexData = null; + const verticesStarts = []; + const verticesCounts = []; + const indexStarts = []; + const indexCounts = []; + for (let meshIndex = 0;meshIndex < meshes.length; meshIndex++) { + const meshId = meshes[meshIndex]; + const mesh78 = gltfRuntime.meshes[meshId]; + if (!mesh78) { + continue; + } + for (let i = 0;i < mesh78.primitives.length; i++) { + const tempVertexData = new VertexData; + const primitive = mesh78.primitives[i]; + if (primitive.mode !== 4) { + } + const attributes = primitive.attributes; + let accessor = null; + let buffer79 = null; + for (const semantic in attributes) { + accessor = gltfRuntime.accessors[attributes[semantic]]; + buffer79 = GLTFUtils.GetBufferFromAccessor(gltfRuntime, accessor); + if (semantic === "NORMAL") { + tempVertexData.normals = new Float32Array(buffer79.length); + tempVertexData.normals.set(buffer79); + } else if (semantic === "POSITION") { + if (GLTFFileLoader.HomogeneousCoordinates) { + tempVertexData.positions = new Float32Array(buffer79.length - buffer79.length / 4); + for (let j = 0;j < buffer79.length; j += 4) { + tempVertexData.positions[j] = buffer79[j]; + tempVertexData.positions[j + 1] = buffer79[j + 1]; + tempVertexData.positions[j + 2] = buffer79[j + 2]; + } + } else { + tempVertexData.positions = new Float32Array(buffer79.length); + tempVertexData.positions.set(buffer79); + } + verticesCounts.push(tempVertexData.positions.length); + } else if (semantic.indexOf("TEXCOORD_") !== -1) { + const channel = Number(semantic.split("_")[1]); + const uvKind = VertexBuffer.UVKind + (channel === 0 ? "" : channel + 1); + const uvs = new Float32Array(buffer79.length); + uvs.set(buffer79); + normalizeUVs(uvs); + tempVertexData.set(uvs, uvKind); + } else if (semantic === "JOINT") { + tempVertexData.matricesIndices = new Float32Array(buffer79.length); + tempVertexData.matricesIndices.set(buffer79); + } else if (semantic === "WEIGHT") { + tempVertexData.matricesWeights = new Float32Array(buffer79.length); + tempVertexData.matricesWeights.set(buffer79); + } else if (semantic === "COLOR") { + tempVertexData.colors = new Float32Array(buffer79.length); + tempVertexData.colors.set(buffer79); + } + } + accessor = gltfRuntime.accessors[primitive.indices]; + if (accessor) { + buffer79 = GLTFUtils.GetBufferFromAccessor(gltfRuntime, accessor); + tempVertexData.indices = new Int32Array(buffer79.length); + tempVertexData.indices.set(buffer79); + indexCounts.push(tempVertexData.indices.length); + } else { + const indices = []; + for (let j = 0;j < tempVertexData.positions.length / 3; j++) { + indices.push(j); + } + tempVertexData.indices = new Int32Array(indices); + indexCounts.push(tempVertexData.indices.length); + } + if (!vertexData) { + vertexData = tempVertexData; + } else { + vertexData.merge(tempVertexData); + } + const material29 = gltfRuntime.scene.getMaterialById(primitive.material); + subMaterials.push(material29 === null ? GLTFUtils.GetDefaultMaterial(gltfRuntime.scene) : material29); + verticesStarts.push(verticesStarts.length === 0 ? 0 : verticesStarts[verticesStarts.length - 1] + verticesCounts[verticesCounts.length - 2]); + indexStarts.push(indexStarts.length === 0 ? 0 : indexStarts[indexStarts.length - 1] + indexCounts[indexCounts.length - 2]); + } + } + let material28; + gltfRuntime.scene._blockEntityCollection = !!gltfRuntime.assetContainer; + if (subMaterials.length > 1) { + material28 = new MultiMaterial("multimat" + id, gltfRuntime.scene); + material28.subMaterials = subMaterials; + } else { + material28 = new StandardMaterial("multimat" + id, gltfRuntime.scene); + } + if (subMaterials.length === 1) { + material28 = subMaterials[0]; + } + material28._parentContainer = gltfRuntime.assetContainer; + if (!newMesh.material) { + newMesh.material = material28; + } + new Geometry(id, gltfRuntime.scene, vertexData, false, newMesh); + newMesh.computeWorldMatrix(true); + gltfRuntime.scene._blockEntityCollection = false; + newMesh.subMeshes = []; + let index = 0; + for (let meshIndex = 0;meshIndex < meshes.length; meshIndex++) { + const meshId = meshes[meshIndex]; + const mesh78 = gltfRuntime.meshes[meshId]; + if (!mesh78) { + continue; + } + for (let i = 0;i < mesh78.primitives.length; i++) { + if (mesh78.primitives[i].mode !== 4) { + } + SubMesh.AddToMesh(index, verticesStarts[index], verticesCounts[index], indexStarts[index], indexCounts[index], newMesh, newMesh, true); + index++; + } + } + return newMesh; + }; + configureNode = (newNode, position3, rotation, scaling) => { + if (newNode.position) { + newNode.position = position3; + } + if (newNode.rotationQuaternion || newNode.rotation) { + newNode.rotationQuaternion = rotation; + } + if (newNode.scaling) { + newNode.scaling = scaling; + } + }; + configureNodeFromMatrix = (newNode, node30) => { + if (node30.matrix) { + const position3 = new Vector3(0, 0, 0); + const rotation = new Quaternion; + const scaling = new Vector3(0, 0, 0); + const mat = Matrix.FromArray(node30.matrix); + mat.decompose(scaling, rotation, position3); + configureNode(newNode, position3, rotation, scaling); + } else if (node30.translation && node30.rotation && node30.scale) { + configureNode(newNode, Vector3.FromArray(node30.translation), Quaternion.FromArray(node30.rotation), Vector3.FromArray(node30.scale)); + } + newNode.computeWorldMatrix(true); + }; + importNode = (gltfRuntime, node30, id) => { + let lastNode = null; + if (gltfRuntime.importOnlyMeshes && (node30.skin || node30.meshes)) { + if (gltfRuntime.importMeshesNames && gltfRuntime.importMeshesNames.length > 0 && gltfRuntime.importMeshesNames.indexOf(node30.name || "") === -1) { + return null; + } + } + if (node30.skin) { + if (node30.meshes) { + const skin = gltfRuntime.skins[node30.skin]; + const newMesh = importMesh(gltfRuntime, node30, node30.meshes, id, node30.babylonNode); + newMesh.skeleton = gltfRuntime.scene.getLastSkeletonById(node30.skin); + if (newMesh.skeleton === null) { + newMesh.skeleton = importSkeleton(gltfRuntime, skin, newMesh, skin.babylonSkeleton); + if (!skin.babylonSkeleton) { + skin.babylonSkeleton = newMesh.skeleton; + } + } + lastNode = newMesh; + } + } else if (node30.meshes) { + const newMesh = importMesh(gltfRuntime, node30, node30.mesh ? [node30.mesh] : node30.meshes, id, node30.babylonNode); + lastNode = newMesh; + } else if (node30.light && !node30.babylonNode && !gltfRuntime.importOnlyMeshes) { + const light12 = gltfRuntime.lights[node30.light]; + if (light12) { + if (light12.type === "ambient") { + const ambienLight = light12[light12.type]; + const hemiLight = new HemisphericLight(node30.light, Vector3.Zero(), gltfRuntime.scene); + hemiLight.name = node30.name || ""; + if (ambienLight.color) { + hemiLight.diffuse = Color3.FromArray(ambienLight.color); + } + lastNode = hemiLight; + } else if (light12.type === "directional") { + const directionalLight5 = light12[light12.type]; + const dirLight = new DirectionalLight(node30.light, Vector3.Zero(), gltfRuntime.scene); + dirLight.name = node30.name || ""; + if (directionalLight5.color) { + dirLight.diffuse = Color3.FromArray(directionalLight5.color); + } + lastNode = dirLight; + } else if (light12.type === "point") { + const pointLight4 = light12[light12.type]; + const ptLight = new PointLight(node30.light, Vector3.Zero(), gltfRuntime.scene); + ptLight.name = node30.name || ""; + if (pointLight4.color) { + ptLight.diffuse = Color3.FromArray(pointLight4.color); + } + lastNode = ptLight; + } else if (light12.type === "spot") { + const spotLight4 = light12[light12.type]; + const spLight = new SpotLight(node30.light, Vector3.Zero(), Vector3.Zero(), 0, 0, gltfRuntime.scene); + spLight.name = node30.name || ""; + if (spotLight4.color) { + spLight.diffuse = Color3.FromArray(spotLight4.color); + } + if (spotLight4.fallOfAngle) { + spLight.angle = spotLight4.fallOfAngle; + } + if (spotLight4.fallOffExponent) { + spLight.exponent = spotLight4.fallOffExponent; + } + lastNode = spLight; + } + } + } else if (node30.camera && !node30.babylonNode && !gltfRuntime.importOnlyMeshes) { + const camera33 = gltfRuntime.cameras[node30.camera]; + if (camera33) { + gltfRuntime.scene._blockEntityCollection = !!gltfRuntime.assetContainer; + if (camera33.type === "orthographic") { + const orthoCamera = new FreeCamera(node30.camera, Vector3.Zero(), gltfRuntime.scene, false); + orthoCamera.name = node30.name || ""; + orthoCamera.mode = Camera.ORTHOGRAPHIC_CAMERA; + orthoCamera.attachControl(); + lastNode = orthoCamera; + orthoCamera._parentContainer = gltfRuntime.assetContainer; + } else if (camera33.type === "perspective") { + const perspectiveCamera = camera33[camera33.type]; + const persCamera = new FreeCamera(node30.camera, Vector3.Zero(), gltfRuntime.scene, false); + persCamera.name = node30.name || ""; + persCamera.attachControl(); + if (!perspectiveCamera.aspectRatio) { + perspectiveCamera.aspectRatio = gltfRuntime.scene.getEngine().getRenderWidth() / gltfRuntime.scene.getEngine().getRenderHeight(); + } + if (perspectiveCamera.znear && perspectiveCamera.zfar) { + persCamera.maxZ = perspectiveCamera.zfar; + persCamera.minZ = perspectiveCamera.znear; + } + lastNode = persCamera; + persCamera._parentContainer = gltfRuntime.assetContainer; + } + gltfRuntime.scene._blockEntityCollection = false; + } + } + if (!node30.jointName) { + if (node30.babylonNode) { + return node30.babylonNode; + } else if (lastNode === null) { + gltfRuntime.scene._blockEntityCollection = !!gltfRuntime.assetContainer; + const dummy = new Mesh(node30.name || "", gltfRuntime.scene); + dummy._parentContainer = gltfRuntime.assetContainer; + gltfRuntime.scene._blockEntityCollection = false; + node30.babylonNode = dummy; + lastNode = dummy; + } + } + if (lastNode !== null) { + if (node30.matrix && lastNode instanceof Mesh) { + configureNodeFromMatrix(lastNode, node30); + } else { + const translation = node30.translation || [0, 0, 0]; + const rotation = node30.rotation || [0, 0, 0, 1]; + const scale = node30.scale || [1, 1, 1]; + configureNode(lastNode, Vector3.FromArray(translation), Quaternion.FromArray(rotation), Vector3.FromArray(scale)); + } + lastNode.updateCache(true); + node30.babylonNode = lastNode; + } + return lastNode; + }; + traverseNodes = (gltfRuntime, id, parent, meshIncluded = false) => { + const node30 = gltfRuntime.nodes[id]; + let newNode = null; + if (gltfRuntime.importOnlyMeshes && !meshIncluded && gltfRuntime.importMeshesNames) { + if (gltfRuntime.importMeshesNames.indexOf(node30.name || "") !== -1 || gltfRuntime.importMeshesNames.length === 0) { + meshIncluded = true; + } else { + meshIncluded = false; + } + } else { + meshIncluded = true; + } + if (!node30.jointName && meshIncluded) { + newNode = importNode(gltfRuntime, node30, id); + if (newNode !== null) { + newNode.id = id; + newNode.parent = parent; + } + } + if (node30.children) { + for (let i = 0;i < node30.children.length; i++) { + traverseNodes(gltfRuntime, node30.children[i], newNode, meshIncluded); + } + } + }; + postLoad = (gltfRuntime) => { + let currentScene = gltfRuntime.currentScene; + if (currentScene) { + for (let i = 0;i < currentScene.nodes.length; i++) { + traverseNodes(gltfRuntime, currentScene.nodes[i], null); + } + } else { + for (const thing in gltfRuntime.scenes) { + currentScene = gltfRuntime.scenes[thing]; + for (let i = 0;i < currentScene.nodes.length; i++) { + traverseNodes(gltfRuntime, currentScene.nodes[i], null); + } + } + } + loadAnimations(gltfRuntime); + for (let i = 0;i < gltfRuntime.scene.skeletons.length; i++) { + const skeleton5 = gltfRuntime.scene.skeletons[i]; + gltfRuntime.scene.beginAnimation(skeleton5, 0, Number.MAX_VALUE, true, 1); + } + }; + onBindShaderMaterial = (mesh78, gltfRuntime, unTreatedUniforms, shaderMaterial16, technique, material28, onSuccess) => { + const materialValues = material28.values || technique.parameters; + for (const unif in unTreatedUniforms) { + const uniform = unTreatedUniforms[unif]; + const type = uniform.type; + if (type === EParameterType.FLOAT_MAT2 || type === EParameterType.FLOAT_MAT3 || type === EParameterType.FLOAT_MAT4) { + if (uniform.semantic && !uniform.source && !uniform.node) { + GLTFUtils.SetMatrix(gltfRuntime.scene, mesh78, uniform, unif, shaderMaterial16.getEffect()); + } else if (uniform.semantic && (uniform.source || uniform.node)) { + let source = gltfRuntime.scene.getNodeByName(uniform.source || uniform.node || ""); + if (source === null) { + source = gltfRuntime.scene.getNodeById(uniform.source || uniform.node || ""); + } + if (source === null) { + continue; + } + GLTFUtils.SetMatrix(gltfRuntime.scene, source, uniform, unif, shaderMaterial16.getEffect()); + } + } else { + const value = materialValues[technique.uniforms[unif]]; + if (!value) { + continue; + } + if (type === EParameterType.SAMPLER_2D) { + const texture86 = gltfRuntime.textures[material28.values ? value : uniform.value].babylonTexture; + if (texture86 === null || texture86 === undefined) { + continue; + } + shaderMaterial16.getEffect().setTexture(unif, texture86); + } else { + GLTFUtils.SetUniform(shaderMaterial16.getEffect(), unif, value, type); + } + } + } + onSuccess(shaderMaterial16); + }; + prepareShaderMaterialUniforms = (gltfRuntime, shaderMaterial16, technique, material28, unTreatedUniforms) => { + const materialValues = material28.values || technique.parameters; + const techniqueUniforms = technique.uniforms; + for (const unif in unTreatedUniforms) { + const uniform = unTreatedUniforms[unif]; + const type = uniform.type; + let value = materialValues[techniqueUniforms[unif]]; + if (value === undefined) { + value = uniform.value; + } + if (!value) { + continue; + } + const onLoadTexture = (uniformName) => { + return (texture86) => { + if (uniform.value && uniformName) { + shaderMaterial16.setTexture(uniformName, texture86); + delete unTreatedUniforms[uniformName]; + } + }; + }; + if (type === EParameterType.SAMPLER_2D) { + GLTFLoaderExtension.LoadTextureAsync(gltfRuntime, material28.values ? value : uniform.value, onLoadTexture(unif), () => onLoadTexture(null)); + } else { + if (uniform.value && GLTFUtils.SetUniform(shaderMaterial16, unif, material28.values ? value : uniform.value, type)) { + delete unTreatedUniforms[unif]; + } + } + } + }; + onShaderCompileError = (program, shaderMaterial16, onError) => { + return (effect18, error7) => { + shaderMaterial16.dispose(true); + onError("Cannot compile program named " + program.name + ". Error: " + error7 + ". Default material will be applied"); + }; + }; + onShaderCompileSuccess = (gltfRuntime, shaderMaterial16, technique, material28, unTreatedUniforms, onSuccess) => { + return (_) => { + prepareShaderMaterialUniforms(gltfRuntime, shaderMaterial16, technique, material28, unTreatedUniforms); + shaderMaterial16.onBind = (mesh78) => { + onBindShaderMaterial(mesh78, gltfRuntime, unTreatedUniforms, shaderMaterial16, technique, material28, onSuccess); + }; + }; + }; + parseShaderUniforms = (tokenizer, technique, unTreatedUniforms) => { + for (const unif in technique.uniforms) { + const uniform = technique.uniforms[unif]; + const uniformParameter = technique.parameters[uniform]; + if (tokenizer.currentIdentifier === unif) { + if (uniformParameter.semantic && !uniformParameter.source && !uniformParameter.node) { + const transformIndex = glTFTransforms.indexOf(uniformParameter.semantic); + if (transformIndex !== -1) { + delete unTreatedUniforms[unif]; + return babylonTransforms[transformIndex]; + } + } + } + } + return tokenizer.currentIdentifier; + }; + importMaterials = (gltfRuntime) => { + for (const mat in gltfRuntime.materials) { + GLTFLoaderExtension.LoadMaterialAsync(gltfRuntime, mat, () => { + }, () => { + }); + } + }; + GLTFLoader.Extensions = {}; + GLTFFileLoader._CreateGLTF1Loader = () => new GLTFLoader; +}); + +// node_modules/@babylonjs/loaders/glTF/1.0/glTFBinaryExtension.js +class GLTFBinaryExtension extends GLTFLoaderExtension { + constructor() { + super("KHR_binary_glTF"); + } + loadRuntimeAsync(scene37, data, rootUrl, onSuccess) { + const extensionsUsed = data.json.extensionsUsed; + if (!extensionsUsed || extensionsUsed.indexOf(this.name) === -1 || !data.bin) { + return false; + } + this._bin = data.bin; + onSuccess(GLTFLoaderBase.CreateRuntime(data.json, scene37, rootUrl)); + return true; + } + loadBufferAsync(gltfRuntime, id, onSuccess, onError) { + if (gltfRuntime.extensionsUsed.indexOf(this.name) === -1) { + return false; + } + if (id !== BinaryExtensionBufferName) { + return false; + } + this._bin.readAsync(0, this._bin.byteLength).then(onSuccess, (error7) => onError(error7.message)); + return true; + } + loadTextureBufferAsync(gltfRuntime, id, onSuccess) { + const texture86 = gltfRuntime.textures[id]; + const source = gltfRuntime.images[texture86.source]; + if (!source.extensions || !(this.name in source.extensions)) { + return false; + } + const sourceExt = source.extensions[this.name]; + const bufferView = gltfRuntime.bufferViews[sourceExt.bufferView]; + const buffer79 = GLTFUtils.GetBufferFromBufferView(gltfRuntime, bufferView, 0, bufferView.byteLength, EComponentType.UNSIGNED_BYTE); + onSuccess(buffer79); + return true; + } + loadShaderStringAsync(gltfRuntime, id, onSuccess) { + const shader285 = gltfRuntime.shaders[id]; + if (!shader285.extensions || !(this.name in shader285.extensions)) { + return false; + } + const binaryExtensionShader = shader285.extensions[this.name]; + const bufferView = gltfRuntime.bufferViews[binaryExtensionShader.bufferView]; + const shaderBytes = GLTFUtils.GetBufferFromBufferView(gltfRuntime, bufferView, 0, bufferView.byteLength, EComponentType.UNSIGNED_BYTE); + setTimeout(() => { + const shaderString = GLTFUtils.DecodeBufferToText(shaderBytes); + onSuccess(shaderString); + }); + return true; + } +} +var BinaryExtensionBufferName; +var init_glTFBinaryExtension = __esm(() => { + init_glTFLoader(); + init_glTFLoaderUtils(); + init_glTFLoaderInterfaces(); + BinaryExtensionBufferName = "binary_glTF"; + GLTFLoader.RegisterExtension(new GLTFBinaryExtension); +}); + +// node_modules/@babylonjs/loaders/glTF/1.0/glTFMaterialsCommonExtension.js +class GLTFMaterialsCommonExtension extends GLTFLoaderExtension { + constructor() { + super("KHR_materials_common"); + } + loadRuntimeExtensionsAsync(gltfRuntime) { + if (!gltfRuntime.extensions) { + return false; + } + const extension = gltfRuntime.extensions[this.name]; + if (!extension) { + return false; + } + const lights = extension.lights; + if (lights) { + for (const thing in lights) { + const light12 = lights[thing]; + switch (light12.type) { + case "ambient": { + const ambientLight = new HemisphericLight(light12.name, new Vector3(0, 1, 0), gltfRuntime.scene); + const ambient = light12.ambient; + if (ambient) { + ambientLight.diffuse = Color3.FromArray(ambient.color || [1, 1, 1]); + } + break; + } + case "point": { + const pointLight5 = new PointLight(light12.name, new Vector3(10, 10, 10), gltfRuntime.scene); + const point = light12.point; + if (point) { + pointLight5.diffuse = Color3.FromArray(point.color || [1, 1, 1]); + } + break; + } + case "directional": { + const dirLight = new DirectionalLight(light12.name, new Vector3(0, -1, 0), gltfRuntime.scene); + const directional = light12.directional; + if (directional) { + dirLight.diffuse = Color3.FromArray(directional.color || [1, 1, 1]); + } + break; + } + case "spot": { + const spot = light12.spot; + if (spot) { + const spotLight5 = new SpotLight(light12.name, new Vector3(0, 10, 0), new Vector3(0, -1, 0), spot.fallOffAngle || Math.PI, spot.fallOffExponent || 0, gltfRuntime.scene); + spotLight5.diffuse = Color3.FromArray(spot.color || [1, 1, 1]); + } + break; + } + default: + Tools.Warn('GLTF Material Common extension: light type "' + light12.type + "\u201D not supported"); + break; + } + } + } + return false; + } + loadMaterialAsync(gltfRuntime, id, onSuccess, onError) { + const material29 = gltfRuntime.materials[id]; + if (!material29 || !material29.extensions) { + return false; + } + const extension = material29.extensions[this.name]; + if (!extension) { + return false; + } + const standardMaterial32 = new StandardMaterial(id, gltfRuntime.scene); + standardMaterial32.sideOrientation = Material.CounterClockWiseSideOrientation; + if (extension.technique === "CONSTANT") { + standardMaterial32.disableLighting = true; + } + standardMaterial32.backFaceCulling = extension.doubleSided === undefined ? false : !extension.doubleSided; + standardMaterial32.alpha = extension.values.transparency === undefined ? 1 : extension.values.transparency; + standardMaterial32.specularPower = extension.values.shininess === undefined ? 0 : extension.values.shininess; + if (typeof extension.values.ambient === "string") { + this._loadTexture(gltfRuntime, extension.values.ambient, standardMaterial32, "ambientTexture", onError); + } else { + standardMaterial32.ambientColor = Color3.FromArray(extension.values.ambient || [0, 0, 0]); + } + if (typeof extension.values.diffuse === "string") { + this._loadTexture(gltfRuntime, extension.values.diffuse, standardMaterial32, "diffuseTexture", onError); + } else { + standardMaterial32.diffuseColor = Color3.FromArray(extension.values.diffuse || [0, 0, 0]); + } + if (typeof extension.values.emission === "string") { + this._loadTexture(gltfRuntime, extension.values.emission, standardMaterial32, "emissiveTexture", onError); + } else { + standardMaterial32.emissiveColor = Color3.FromArray(extension.values.emission || [0, 0, 0]); + } + if (typeof extension.values.specular === "string") { + this._loadTexture(gltfRuntime, extension.values.specular, standardMaterial32, "specularTexture", onError); + } else { + standardMaterial32.specularColor = Color3.FromArray(extension.values.specular || [0, 0, 0]); + } + return true; + } + _loadTexture(gltfRuntime, id, material29, propertyPath, onError) { + GLTFLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, (buffer79) => { + GLTFLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer79, (texture86) => material29[propertyPath] = texture86); + }, onError); + } +} +var init_glTFMaterialsCommonExtension = __esm(() => { + init_glTFLoader(); + init_math_vector(); + init_math_color(); + init_tools(); + init_material(); + init_standardMaterial(); + init_hemisphericLight(); + init_directionalLight(); + init_pointLight(); + init_spotLight(); + GLTFLoader.RegisterExtension(new GLTFMaterialsCommonExtension); +}); + +// node_modules/@babylonjs/loaders/glTF/1.0/index.js +var exports_1 = {}; +__export(exports_1, { + GLTFUtils: () => { + { + return GLTFUtils; + } + }, + GLTFMaterialsCommonExtension: () => { + { + return GLTFMaterialsCommonExtension; + } + }, + GLTFLoaderExtension: () => { + { + return GLTFLoaderExtension; + } + }, + GLTFLoaderBase: () => { + { + return GLTFLoaderBase; + } + }, + GLTFLoader: () => { + { + return GLTFLoader; + } + }, + GLTFBinaryExtension: () => { + { + return GLTFBinaryExtension; + } + }, + ETextureWrapMode: () => { + { + return ETextureWrapMode; + } + }, + ETextureFormat: () => { + { + return ETextureFormat; + } + }, + ETextureFilterType: () => { + { + return ETextureFilterType; + } + }, + EShaderType: () => { + { + return EShaderType; + } + }, + EParameterType: () => { + { + return EParameterType; + } + }, + ECullingType: () => { + { + return ECullingType; + } + }, + EComponentType: () => { + { + return EComponentType; + } + }, + EBlendingFunction: () => { + { + return EBlendingFunction; + } + } +}); +var init_1 = __esm(() => { + init_glTFBinaryExtension(); + init_glTFLoader(); + init_glTFLoaderInterfaces(); + init_glTFLoaderUtils(); + init_glTFMaterialsCommonExtension(); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/glTFLoaderAnimation.js +function getVector3(_target, source, offset, scale) { + return Vector3.FromArray(source, offset).scaleInPlace(scale); +} +function getQuaternion(_target, source, offset, scale) { + return Quaternion.FromArray(source, offset).scaleInPlace(scale); +} +function getWeights(target, source, offset, scale) { + const value = new Array(target._numMorphTargets); + for (let i = 0;i < value.length; i++) { + value[i] = source[offset++] * scale; + } + return value; +} + +class AnimationPropertyInfo { + constructor(type, name286, getValue, getStride) { + this.type = type; + this.name = name286; + this.getValue = getValue; + this.getStride = getStride; + } + _buildAnimation(name286, fps, keys4) { + const babylonAnimation = new Animation(name286, this.name, fps, this.type); + babylonAnimation.setKeys(keys4); + return babylonAnimation; + } +} + +class TransformNodeAnimationPropertyInfo extends AnimationPropertyInfo { + buildAnimations(target, name286, fps, keys4, callback) { + callback(target._babylonTransformNode, this._buildAnimation(name286, fps, keys4)); + } +} + +class WeightAnimationPropertyInfo extends AnimationPropertyInfo { + buildAnimations(target, name286, fps, keys4, callback) { + if (target._numMorphTargets) { + for (let targetIndex = 0;targetIndex < target._numMorphTargets; targetIndex++) { + const babylonAnimation = new Animation(`${name286}_${targetIndex}`, this.name, fps, this.type); + babylonAnimation.setKeys(keys4.map((key) => ({ + frame: key.frame, + inTangent: key.inTangent ? key.inTangent[targetIndex] : undefined, + value: key.value[targetIndex], + outTangent: key.outTangent ? key.outTangent[targetIndex] : undefined, + interpolation: key.interpolation + }))); + if (target._primitiveBabylonMeshes) { + for (const babylonMesh of target._primitiveBabylonMeshes) { + if (babylonMesh.morphTargetManager) { + const morphTarget3 = babylonMesh.morphTargetManager.getTarget(targetIndex); + const babylonAnimationClone = babylonAnimation.clone(); + morphTarget3.animations.push(babylonAnimationClone); + callback(morphTarget3, babylonAnimationClone); + } + } + } + } + } + } +} +var nodeAnimationData; +var init_glTFLoaderAnimation = __esm(() => { + init_animation(); + init_math_vector(); + nodeAnimationData = { + translation: [new TransformNodeAnimationPropertyInfo(Animation.ANIMATIONTYPE_VECTOR3, "position", getVector3, () => 3)], + rotation: [new TransformNodeAnimationPropertyInfo(Animation.ANIMATIONTYPE_QUATERNION, "rotationQuaternion", getQuaternion, () => 4)], + scale: [new TransformNodeAnimationPropertyInfo(Animation.ANIMATIONTYPE_VECTOR3, "scaling", getVector3, () => 3)], + weights: [new WeightAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "influence", getWeights, (target) => target._numMorphTargets)] + }; +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/glTFLoader.js +class ArrayItem { + static Get(context, array, index) { + if (!array || index == undefined || !array[index]) { + throw new Error(`${context}: Failed to find index (${index})`); + } + return array[index]; + } + static TryGet(array, index) { + if (!array || index == undefined || !array[index]) { + return null; + } + return array[index]; + } + static Assign(array) { + if (array) { + for (let index = 0;index < array.length; index++) { + array[index].index = index; + } + } + } +} + +class GLTFLoader2 { + static RegisterExtension(name286, factory) { + if (GLTFLoader2.UnregisterExtension(name286)) { + Logger.Warn(`Extension with the name '${name286}' already exists`); + } + GLTFLoader2._RegisteredExtensions[name286] = { + factory + }; + } + static UnregisterExtension(name286) { + if (!GLTFLoader2._RegisteredExtensions[name286]) { + return false; + } + delete GLTFLoader2._RegisteredExtensions[name286]; + return true; + } + get gltf() { + if (!this._gltf) { + throw new Error("glTF JSON is not available"); + } + return this._gltf; + } + get bin() { + return this._bin; + } + get parent() { + return this._parent; + } + get babylonScene() { + if (!this._babylonScene) { + throw new Error("Scene is not available"); + } + return this._babylonScene; + } + get rootBabylonMesh() { + return this._rootBabylonMesh; + } + constructor(parent) { + this._completePromises = new Array; + this._assetContainer = null; + this._babylonLights = []; + this._disableInstancedMesh = 0; + this._allMaterialsDirtyRequired = false; + this._extensions = new Array; + this._disposed = false; + this._rootUrl = null; + this._fileName = null; + this._uniqueRootUrl = null; + this._bin = null; + this._rootBabylonMesh = null; + this._defaultBabylonMaterialData = {}; + this._postSceneLoadActions = new Array; + this._parent = parent; + } + dispose() { + if (this._disposed) { + return; + } + this._disposed = true; + this._completePromises.length = 0; + this._extensions.forEach((extension) => extension.dispose && extension.dispose()); + this._extensions.length = 0; + this._gltf = null; + this._bin = null; + this._babylonScene = null; + this._rootBabylonMesh = null; + this._defaultBabylonMaterialData = {}; + this._postSceneLoadActions.length = 0; + this._parent.dispose(); + } + importMeshAsync(meshesNames, scene37, container9, data, rootUrl, onProgress, fileName = "") { + return Promise.resolve().then(() => { + this._babylonScene = scene37; + this._assetContainer = container9; + this._loadData(data); + let nodes = null; + if (meshesNames) { + const nodeMap = {}; + if (this._gltf.nodes) { + for (const node30 of this._gltf.nodes) { + if (node30.name) { + nodeMap[node30.name] = node30.index; + } + } + } + const names = meshesNames instanceof Array ? meshesNames : [meshesNames]; + nodes = names.map((name286) => { + const node30 = nodeMap[name286]; + if (node30 === undefined) { + throw new Error(`Failed to find node '${name286}'`); + } + return node30; + }); + } + return this._loadAsync(rootUrl, fileName, nodes, () => { + return { + meshes: this._getMeshes(), + particleSystems: [], + skeletons: this._getSkeletons(), + animationGroups: this._getAnimationGroups(), + lights: this._babylonLights, + transformNodes: this._getTransformNodes(), + geometries: this._getGeometries() + }; + }); + }); + } + loadAsync(scene37, data, rootUrl, onProgress, fileName = "") { + return Promise.resolve().then(() => { + this._babylonScene = scene37; + this._loadData(data); + return this._loadAsync(rootUrl, fileName, null, () => { + return; + }); + }); + } + _loadAsync(rootUrl, fileName, nodes, resultFunc) { + return Promise.resolve().then(() => { + this._rootUrl = rootUrl; + this._uniqueRootUrl = !rootUrl.startsWith("file:") && fileName ? rootUrl : `${rootUrl}${Date.now()}/`; + this._fileName = fileName; + this._allMaterialsDirtyRequired = false; + this._loadExtensions(); + this._checkExtensions(); + const loadingToReadyCounterName = `${GLTFLoaderState[GLTFLoaderState.LOADING]} => ${GLTFLoaderState[GLTFLoaderState.READY]}`; + const loadingToCompleteCounterName = `${GLTFLoaderState[GLTFLoaderState.LOADING]} => ${GLTFLoaderState[GLTFLoaderState.COMPLETE]}`; + this._parent._startPerformanceCounter(loadingToReadyCounterName); + this._parent._startPerformanceCounter(loadingToCompleteCounterName); + this._parent._setState(GLTFLoaderState.LOADING); + this._extensionsOnLoading(); + const promises = new Array; + const oldBlockMaterialDirtyMechanism = this._babylonScene.blockMaterialDirtyMechanism; + this._babylonScene.blockMaterialDirtyMechanism = true; + if (!this.parent.loadOnlyMaterials) { + if (nodes) { + promises.push(this.loadSceneAsync("/nodes", { nodes, index: -1 })); + } else if (this._gltf.scene != null || this._gltf.scenes && this._gltf.scenes[0]) { + const scene37 = ArrayItem.Get(`/scene`, this._gltf.scenes, this._gltf.scene || 0); + promises.push(this.loadSceneAsync(`/scenes/${scene37.index}`, scene37)); + } + } + if (!this.parent.skipMaterials && this.parent.loadAllMaterials && this._gltf.materials) { + for (let m = 0;m < this._gltf.materials.length; ++m) { + const material30 = this._gltf.materials[m]; + const context = "/materials/" + m; + const babylonDrawMode = Material.TriangleFillMode; + promises.push(this._loadMaterialAsync(context, material30, null, babylonDrawMode, () => { + })); + } + } + if (this._allMaterialsDirtyRequired) { + this._babylonScene.blockMaterialDirtyMechanism = oldBlockMaterialDirtyMechanism; + } else { + this._babylonScene._forceBlockMaterialDirtyMechanism(oldBlockMaterialDirtyMechanism); + } + if (this._parent.compileMaterials) { + promises.push(this._compileMaterialsAsync()); + } + if (this._parent.compileShadowGenerators) { + promises.push(this._compileShadowGeneratorsAsync()); + } + const resultPromise = Promise.all(promises).then(() => { + if (this._rootBabylonMesh) { + this._rootBabylonMesh.setEnabled(true); + } + this._extensionsOnReady(); + this._parent._setState(GLTFLoaderState.READY); + this._startAnimations(); + return resultFunc(); + }); + return resultPromise.then((result) => { + this._parent._endPerformanceCounter(loadingToReadyCounterName); + Tools.SetImmediate(() => { + if (!this._disposed) { + Promise.all(this._completePromises).then(() => { + this._parent._endPerformanceCounter(loadingToCompleteCounterName); + this._parent._setState(GLTFLoaderState.COMPLETE); + this._parent.onCompleteObservable.notifyObservers(undefined); + this._parent.onCompleteObservable.clear(); + this.dispose(); + }, (error7) => { + this._parent.onErrorObservable.notifyObservers(error7); + this._parent.onErrorObservable.clear(); + this.dispose(); + }); + } + }); + return result; + }); + }).catch((error7) => { + if (!this._disposed) { + this._parent.onErrorObservable.notifyObservers(error7); + this._parent.onErrorObservable.clear(); + this.dispose(); + } + throw error7; + }); + } + _loadData(data) { + this._gltf = data.json; + this._setupData(); + if (data.bin) { + const buffers = this._gltf.buffers; + if (buffers && buffers[0] && !buffers[0].uri) { + const binaryBuffer = buffers[0]; + if (binaryBuffer.byteLength < data.bin.byteLength - 3 || binaryBuffer.byteLength > data.bin.byteLength) { + Logger.Warn(`Binary buffer length (${binaryBuffer.byteLength}) from JSON does not match chunk length (${data.bin.byteLength})`); + } + this._bin = data.bin; + } else { + Logger.Warn("Unexpected BIN chunk"); + } + } + } + _setupData() { + ArrayItem.Assign(this._gltf.accessors); + ArrayItem.Assign(this._gltf.animations); + ArrayItem.Assign(this._gltf.buffers); + ArrayItem.Assign(this._gltf.bufferViews); + ArrayItem.Assign(this._gltf.cameras); + ArrayItem.Assign(this._gltf.images); + ArrayItem.Assign(this._gltf.materials); + ArrayItem.Assign(this._gltf.meshes); + ArrayItem.Assign(this._gltf.nodes); + ArrayItem.Assign(this._gltf.samplers); + ArrayItem.Assign(this._gltf.scenes); + ArrayItem.Assign(this._gltf.skins); + ArrayItem.Assign(this._gltf.textures); + if (this._gltf.nodes) { + const nodeParents = {}; + for (const node30 of this._gltf.nodes) { + if (node30.children) { + for (const index of node30.children) { + nodeParents[index] = node30.index; + } + } + } + const rootNode = this._createRootNode(); + for (const node30 of this._gltf.nodes) { + const parentIndex = nodeParents[node30.index]; + node30.parent = parentIndex === undefined ? rootNode : this._gltf.nodes[parentIndex]; + } + } + } + _loadExtensions() { + for (const name286 in GLTFLoader2._RegisteredExtensions) { + const extension = GLTFLoader2._RegisteredExtensions[name286].factory(this); + if (extension.name !== name286) { + Logger.Warn(`The name of the glTF loader extension instance does not match the registered name: ${extension.name} !== ${name286}`); + } + this._extensions.push(extension); + this._parent.onExtensionLoadedObservable.notifyObservers(extension); + } + this._extensions.sort((a, b) => (a.order || Number.MAX_VALUE) - (b.order || Number.MAX_VALUE)); + this._parent.onExtensionLoadedObservable.clear(); + } + _checkExtensions() { + if (this._gltf.extensionsRequired) { + for (const name286 of this._gltf.extensionsRequired) { + const available = this._extensions.some((extension) => extension.name === name286 && extension.enabled); + if (!available) { + throw new Error(`Required extension ${name286} is not available`); + } + } + } + } + _createRootNode() { + this._babylonScene._blockEntityCollection = !!this._assetContainer; + this._rootBabylonMesh = new Mesh("__root__", this._babylonScene); + this._rootBabylonMesh._parentContainer = this._assetContainer; + this._babylonScene._blockEntityCollection = false; + this._rootBabylonMesh.setEnabled(false); + const rootNode = { + _babylonTransformNode: this._rootBabylonMesh, + index: -1 + }; + switch (this._parent.coordinateSystemMode) { + case GLTFLoaderCoordinateSystemMode.AUTO: { + if (!this._babylonScene.useRightHandedSystem) { + rootNode.rotation = [0, 1, 0, 0]; + rootNode.scale = [1, 1, -1]; + GLTFLoader2._LoadTransform(rootNode, this._rootBabylonMesh); + } + break; + } + case GLTFLoaderCoordinateSystemMode.FORCE_RIGHT_HANDED: { + this._babylonScene.useRightHandedSystem = true; + break; + } + default: { + throw new Error(`Invalid coordinate system mode (${this._parent.coordinateSystemMode})`); + } + } + this._parent.onMeshLoadedObservable.notifyObservers(this._rootBabylonMesh); + return rootNode; + } + loadSceneAsync(context, scene37) { + const extensionPromise = this._extensionsLoadSceneAsync(context, scene37); + if (extensionPromise) { + return extensionPromise; + } + const promises = new Array; + this.logOpen(`${context} ${scene37.name || ""}`); + if (scene37.nodes) { + for (const index of scene37.nodes) { + const node30 = ArrayItem.Get(`${context}/nodes/${index}`, this._gltf.nodes, index); + promises.push(this.loadNodeAsync(`/nodes/${node30.index}`, node30, (babylonMesh) => { + babylonMesh.parent = this._rootBabylonMesh; + })); + } + } + for (const action7 of this._postSceneLoadActions) { + action7(); + } + promises.push(this._loadAnimationsAsync()); + this.logClose(); + return Promise.all(promises).then(() => { + }); + } + _forEachPrimitive(node30, callback) { + if (node30._primitiveBabylonMeshes) { + for (const babylonMesh of node30._primitiveBabylonMeshes) { + callback(babylonMesh); + } + } + } + _getGeometries() { + const geometries = []; + const nodes = this._gltf.nodes; + if (nodes) { + for (const node30 of nodes) { + this._forEachPrimitive(node30, (babylonMesh) => { + const geometry7 = babylonMesh.geometry; + if (geometry7 && geometries.indexOf(geometry7) === -1) { + geometries.push(geometry7); + } + }); + } + } + return geometries; + } + _getMeshes() { + const meshes = []; + if (this._rootBabylonMesh) { + meshes.push(this._rootBabylonMesh); + } + const nodes = this._gltf.nodes; + if (nodes) { + for (const node30 of nodes) { + this._forEachPrimitive(node30, (babylonMesh) => { + meshes.push(babylonMesh); + }); + } + } + return meshes; + } + _getTransformNodes() { + const transformNodes = []; + const nodes = this._gltf.nodes; + if (nodes) { + for (const node30 of nodes) { + if (node30._babylonTransformNode && node30._babylonTransformNode.getClassName() === "TransformNode") { + transformNodes.push(node30._babylonTransformNode); + } + if (node30._babylonTransformNodeForSkin) { + transformNodes.push(node30._babylonTransformNodeForSkin); + } + } + } + return transformNodes; + } + _getSkeletons() { + const skeletons = []; + const skins = this._gltf.skins; + if (skins) { + for (const skin of skins) { + if (skin._data) { + skeletons.push(skin._data.babylonSkeleton); + } + } + } + return skeletons; + } + _getAnimationGroups() { + const animationGroups = []; + const animations = this._gltf.animations; + if (animations) { + for (const animation16 of animations) { + if (animation16._babylonAnimationGroup) { + animationGroups.push(animation16._babylonAnimationGroup); + } + } + } + return animationGroups; + } + _startAnimations() { + switch (this._parent.animationStartMode) { + case GLTFLoaderAnimationStartMode.NONE: { + break; + } + case GLTFLoaderAnimationStartMode.FIRST: { + const babylonAnimationGroups = this._getAnimationGroups(); + if (babylonAnimationGroups.length !== 0) { + babylonAnimationGroups[0].start(true); + } + break; + } + case GLTFLoaderAnimationStartMode.ALL: { + const babylonAnimationGroups = this._getAnimationGroups(); + for (const babylonAnimationGroup of babylonAnimationGroups) { + babylonAnimationGroup.start(true); + } + break; + } + default: { + Logger.Error(`Invalid animation start mode (${this._parent.animationStartMode})`); + return; + } + } + } + loadNodeAsync(context, node30, assign = () => { + }) { + const extensionPromise = this._extensionsLoadNodeAsync(context, node30, assign); + if (extensionPromise) { + return extensionPromise; + } + if (node30._babylonTransformNode) { + throw new Error(`${context}: Invalid recursive node hierarchy`); + } + const promises = new Array; + this.logOpen(`${context} ${node30.name || ""}`); + const loadNode = (babylonTransformNode) => { + GLTFLoader2.AddPointerMetadata(babylonTransformNode, context); + GLTFLoader2._LoadTransform(node30, babylonTransformNode); + if (node30.camera != null) { + const camera34 = ArrayItem.Get(`${context}/camera`, this._gltf.cameras, node30.camera); + promises.push(this.loadCameraAsync(`/cameras/${camera34.index}`, camera34, (babylonCamera) => { + babylonCamera.parent = babylonTransformNode; + })); + } + if (node30.children) { + for (const index of node30.children) { + const childNode = ArrayItem.Get(`${context}/children/${index}`, this._gltf.nodes, index); + promises.push(this.loadNodeAsync(`/nodes/${childNode.index}`, childNode, (childBabylonMesh) => { + childBabylonMesh.parent = babylonTransformNode; + })); + } + } + assign(babylonTransformNode); + }; + if (node30.mesh == undefined || node30.skin != null) { + const nodeName = node30.name || `node${node30.index}`; + this._babylonScene._blockEntityCollection = !!this._assetContainer; + const transformNode28 = new TransformNode(nodeName, this._babylonScene); + transformNode28._parentContainer = this._assetContainer; + this._babylonScene._blockEntityCollection = false; + if (node30.mesh == undefined) { + node30._babylonTransformNode = transformNode28; + } else { + node30._babylonTransformNodeForSkin = transformNode28; + } + loadNode(transformNode28); + } + if (node30.mesh != null) { + if (node30.skin == undefined) { + const mesh79 = ArrayItem.Get(`${context}/mesh`, this._gltf.meshes, node30.mesh); + promises.push(this._loadMeshAsync(`/meshes/${mesh79.index}`, node30, mesh79, loadNode)); + } else { + const mesh79 = ArrayItem.Get(`${context}/mesh`, this._gltf.meshes, node30.mesh); + promises.push(this._loadMeshAsync(`/meshes/${mesh79.index}`, node30, mesh79, (babylonTransformNode) => { + const babylonTransformNodeForSkin = node30._babylonTransformNodeForSkin; + babylonTransformNode.metadata = mergeDeep(babylonTransformNodeForSkin.metadata, babylonTransformNode.metadata || {}); + const skin = ArrayItem.Get(`${context}/skin`, this._gltf.skins, node30.skin); + promises.push(this._loadSkinAsync(`/skins/${skin.index}`, node30, skin, (babylonSkeleton) => { + this._forEachPrimitive(node30, (babylonMesh) => { + babylonMesh.skeleton = babylonSkeleton; + }); + this._postSceneLoadActions.push(() => { + if (skin.skeleton != null) { + const parentNode = ArrayItem.Get(`/skins/${skin.index}/skeleton`, this._gltf.nodes, skin.skeleton).parent; + if (node30.index === parentNode.index) { + babylonTransformNode.parent = babylonTransformNodeForSkin.parent; + } else { + babylonTransformNode.parent = parentNode._babylonTransformNode; + } + } else { + babylonTransformNode.parent = this._rootBabylonMesh; + } + this._parent.onSkinLoadedObservable.notifyObservers({ node: babylonTransformNodeForSkin, skinnedNode: babylonTransformNode }); + }); + })); + })); + } + } + this.logClose(); + return Promise.all(promises).then(() => { + this._forEachPrimitive(node30, (babylonMesh) => { + if (babylonMesh.geometry && babylonMesh.geometry.useBoundingInfoFromGeometry) { + babylonMesh._updateBoundingInfo(); + } else { + babylonMesh.refreshBoundingInfo(true); + } + }); + return node30._babylonTransformNode; + }); + } + _loadMeshAsync(context, node30, mesh79, assign) { + const primitives = mesh79.primitives; + if (!primitives || !primitives.length) { + throw new Error(`${context}: Primitives are missing`); + } + if (primitives[0].index == undefined) { + ArrayItem.Assign(primitives); + } + const promises = new Array; + this.logOpen(`${context} ${mesh79.name || ""}`); + const name286 = node30.name || `node${node30.index}`; + if (primitives.length === 1) { + const primitive = mesh79.primitives[0]; + promises.push(this._loadMeshPrimitiveAsync(`${context}/primitives/${primitive.index}`, name286, node30, mesh79, primitive, (babylonMesh) => { + node30._babylonTransformNode = babylonMesh; + node30._primitiveBabylonMeshes = [babylonMesh]; + })); + } else { + this._babylonScene._blockEntityCollection = !!this._assetContainer; + node30._babylonTransformNode = new TransformNode(name286, this._babylonScene); + node30._babylonTransformNode._parentContainer = this._assetContainer; + this._babylonScene._blockEntityCollection = false; + node30._primitiveBabylonMeshes = []; + for (const primitive of primitives) { + promises.push(this._loadMeshPrimitiveAsync(`${context}/primitives/${primitive.index}`, `${name286}_primitive${primitive.index}`, node30, mesh79, primitive, (babylonMesh) => { + babylonMesh.parent = node30._babylonTransformNode; + node30._primitiveBabylonMeshes.push(babylonMesh); + })); + } + } + assign(node30._babylonTransformNode); + this.logClose(); + return Promise.all(promises).then(() => { + return node30._babylonTransformNode; + }); + } + _loadMeshPrimitiveAsync(context, name286, node30, mesh79, primitive, assign) { + const extensionPromise = this._extensionsLoadMeshPrimitiveAsync(context, name286, node30, mesh79, primitive, assign); + if (extensionPromise) { + return extensionPromise; + } + this.logOpen(`${context}`); + const shouldInstance = this._disableInstancedMesh === 0 && this._parent.createInstances && node30.skin == undefined && !mesh79.primitives[0].targets; + let babylonAbstractMesh; + let promise; + if (shouldInstance && primitive._instanceData) { + this._babylonScene._blockEntityCollection = !!this._assetContainer; + babylonAbstractMesh = primitive._instanceData.babylonSourceMesh.createInstance(name286); + babylonAbstractMesh._parentContainer = this._assetContainer; + this._babylonScene._blockEntityCollection = false; + promise = primitive._instanceData.promise; + } else { + const promises = new Array; + this._babylonScene._blockEntityCollection = !!this._assetContainer; + const babylonMesh = new Mesh(name286, this._babylonScene); + babylonMesh._parentContainer = this._assetContainer; + this._babylonScene._blockEntityCollection = false; + babylonMesh.overrideMaterialSideOrientation = this._babylonScene.useRightHandedSystem ? Material.CounterClockWiseSideOrientation : Material.ClockWiseSideOrientation; + this._createMorphTargets(context, node30, mesh79, primitive, babylonMesh); + promises.push(this._loadVertexDataAsync(context, primitive, babylonMesh).then((babylonGeometry) => { + return this._loadMorphTargetsAsync(context, primitive, babylonMesh, babylonGeometry).then(() => { + if (this._disposed) { + return; + } + this._babylonScene._blockEntityCollection = !!this._assetContainer; + babylonGeometry.applyToMesh(babylonMesh); + babylonGeometry._parentContainer = this._assetContainer; + this._babylonScene._blockEntityCollection = false; + }); + })); + const babylonDrawMode = GLTFLoader2._GetDrawMode(context, primitive.mode); + if (primitive.material == undefined) { + let babylonMaterial = this._defaultBabylonMaterialData[babylonDrawMode]; + if (!babylonMaterial) { + babylonMaterial = this._createDefaultMaterial("__GLTFLoader._default", babylonDrawMode); + this._parent.onMaterialLoadedObservable.notifyObservers(babylonMaterial); + this._defaultBabylonMaterialData[babylonDrawMode] = babylonMaterial; + } + babylonMesh.material = babylonMaterial; + } else if (!this.parent.skipMaterials) { + const material30 = ArrayItem.Get(`${context}/material`, this._gltf.materials, primitive.material); + promises.push(this._loadMaterialAsync(`/materials/${material30.index}`, material30, babylonMesh, babylonDrawMode, (babylonMaterial) => { + babylonMesh.material = babylonMaterial; + })); + } + promise = Promise.all(promises); + if (shouldInstance) { + primitive._instanceData = { + babylonSourceMesh: babylonMesh, + promise + }; + } + babylonAbstractMesh = babylonMesh; + } + GLTFLoader2.AddPointerMetadata(babylonAbstractMesh, context); + this._parent.onMeshLoadedObservable.notifyObservers(babylonAbstractMesh); + assign(babylonAbstractMesh); + this.logClose(); + return promise.then(() => { + return babylonAbstractMesh; + }); + } + _loadVertexDataAsync(context, primitive, babylonMesh) { + const extensionPromise = this._extensionsLoadVertexDataAsync(context, primitive, babylonMesh); + if (extensionPromise) { + return extensionPromise; + } + const attributes = primitive.attributes; + if (!attributes) { + throw new Error(`${context}: Attributes are missing`); + } + const promises = new Array; + const babylonGeometry = new Geometry(babylonMesh.name, this._babylonScene); + if (primitive.indices == undefined) { + babylonMesh.isUnIndexed = true; + } else { + const accessor = ArrayItem.Get(`${context}/indices`, this._gltf.accessors, primitive.indices); + promises.push(this._loadIndicesAccessorAsync(`/accessors/${accessor.index}`, accessor).then((data) => { + babylonGeometry.setIndices(data); + })); + } + const loadAttribute = (name286, kind, callback) => { + if (attributes[name286] == undefined) { + return; + } + babylonMesh._delayInfo = babylonMesh._delayInfo || []; + if (babylonMesh._delayInfo.indexOf(kind) === -1) { + babylonMesh._delayInfo.push(kind); + } + const accessor = ArrayItem.Get(`${context}/attributes/${name286}`, this._gltf.accessors, attributes[name286]); + promises.push(this._loadVertexAccessorAsync(`/accessors/${accessor.index}`, accessor, kind).then((babylonVertexBuffer) => { + if (babylonVertexBuffer.getKind() === VertexBuffer.PositionKind && !this.parent.alwaysComputeBoundingBox && !babylonMesh.skeleton) { + if (accessor.min && accessor.max) { + const min = TmpVectors.Vector3[0].copyFromFloats(...accessor.min); + const max = TmpVectors.Vector3[1].copyFromFloats(...accessor.max); + if (accessor.normalized && accessor.componentType !== 5126) { + let divider = 1; + switch (accessor.componentType) { + case 5120: + divider = 127; + break; + case 5121: + divider = 255; + break; + case 5122: + divider = 32767; + break; + case 5123: + divider = 65535; + break; + } + const oneOverDivider = 1 / divider; + min.scaleInPlace(oneOverDivider); + max.scaleInPlace(oneOverDivider); + } + babylonGeometry._boundingInfo = new BoundingInfo(min, max); + babylonGeometry.useBoundingInfoFromGeometry = true; + } + } + babylonGeometry.setVerticesBuffer(babylonVertexBuffer, accessor.count); + })); + if (kind == VertexBuffer.MatricesIndicesExtraKind) { + babylonMesh.numBoneInfluencers = 8; + } + if (callback) { + callback(accessor); + } + }; + loadAttribute("POSITION", VertexBuffer.PositionKind); + loadAttribute("NORMAL", VertexBuffer.NormalKind); + loadAttribute("TANGENT", VertexBuffer.TangentKind); + loadAttribute("TEXCOORD_0", VertexBuffer.UVKind); + loadAttribute("TEXCOORD_1", VertexBuffer.UV2Kind); + loadAttribute("TEXCOORD_2", VertexBuffer.UV3Kind); + loadAttribute("TEXCOORD_3", VertexBuffer.UV4Kind); + loadAttribute("TEXCOORD_4", VertexBuffer.UV5Kind); + loadAttribute("TEXCOORD_5", VertexBuffer.UV6Kind); + loadAttribute("JOINTS_0", VertexBuffer.MatricesIndicesKind); + loadAttribute("WEIGHTS_0", VertexBuffer.MatricesWeightsKind); + loadAttribute("JOINTS_1", VertexBuffer.MatricesIndicesExtraKind); + loadAttribute("WEIGHTS_1", VertexBuffer.MatricesWeightsExtraKind); + loadAttribute("COLOR_0", VertexBuffer.ColorKind, (accessor) => { + if (accessor.type === "VEC4") { + babylonMesh.hasVertexAlpha = true; + } + }); + return Promise.all(promises).then(() => { + return babylonGeometry; + }); + } + _createMorphTargets(context, node30, mesh79, primitive, babylonMesh) { + if (!primitive.targets) { + return; + } + if (node30._numMorphTargets == undefined) { + node30._numMorphTargets = primitive.targets.length; + } else if (primitive.targets.length !== node30._numMorphTargets) { + throw new Error(`${context}: Primitives do not have the same number of targets`); + } + const targetNames = mesh79.extras ? mesh79.extras.targetNames : null; + this._babylonScene._blockEntityCollection = !!this._assetContainer; + babylonMesh.morphTargetManager = new MorphTargetManager(this._babylonScene); + babylonMesh.morphTargetManager._parentContainer = this._assetContainer; + this._babylonScene._blockEntityCollection = false; + babylonMesh.morphTargetManager.areUpdatesFrozen = true; + for (let index = 0;index < primitive.targets.length; index++) { + const weight = node30.weights ? node30.weights[index] : mesh79.weights ? mesh79.weights[index] : 0; + const name286 = targetNames ? targetNames[index] : `morphTarget${index}`; + babylonMesh.morphTargetManager.addTarget(new MorphTarget(name286, weight, babylonMesh.getScene())); + } + } + _loadMorphTargetsAsync(context, primitive, babylonMesh, babylonGeometry) { + if (!primitive.targets) { + return Promise.resolve(); + } + const promises = new Array; + const morphTargetManager5 = babylonMesh.morphTargetManager; + for (let index = 0;index < morphTargetManager5.numTargets; index++) { + const babylonMorphTarget = morphTargetManager5.getTarget(index); + promises.push(this._loadMorphTargetVertexDataAsync(`${context}/targets/${index}`, babylonGeometry, primitive.targets[index], babylonMorphTarget)); + } + return Promise.all(promises).then(() => { + morphTargetManager5.areUpdatesFrozen = false; + }); + } + _loadMorphTargetVertexDataAsync(context, babylonGeometry, attributes, babylonMorphTarget) { + const promises = new Array; + const loadAttribute = (attribute, kind, setData) => { + if (attributes[attribute] == undefined) { + return; + } + const babylonVertexBuffer = babylonGeometry.getVertexBuffer(kind); + if (!babylonVertexBuffer) { + return; + } + const accessor = ArrayItem.Get(`${context}/${attribute}`, this._gltf.accessors, attributes[attribute]); + promises.push(this._loadFloatAccessorAsync(`/accessors/${accessor.index}`, accessor).then((data) => { + setData(babylonVertexBuffer, data); + })); + }; + loadAttribute("POSITION", VertexBuffer.PositionKind, (babylonVertexBuffer, data) => { + const positions = new Float32Array(data.length); + babylonVertexBuffer.forEach(data.length, (value, index) => { + positions[index] = data[index] + value; + }); + babylonMorphTarget.setPositions(positions); + }); + loadAttribute("NORMAL", VertexBuffer.NormalKind, (babylonVertexBuffer, data) => { + const normals = new Float32Array(data.length); + babylonVertexBuffer.forEach(normals.length, (value, index) => { + normals[index] = data[index] + value; + }); + babylonMorphTarget.setNormals(normals); + }); + loadAttribute("TANGENT", VertexBuffer.TangentKind, (babylonVertexBuffer, data) => { + const tangents = new Float32Array(data.length / 3 * 4); + let dataIndex = 0; + babylonVertexBuffer.forEach(data.length / 3 * 4, (value, index) => { + if ((index + 1) % 4 !== 0) { + tangents[dataIndex] = data[dataIndex] + value; + dataIndex++; + } + }); + babylonMorphTarget.setTangents(tangents); + }); + return Promise.all(promises).then(() => { + }); + } + static _LoadTransform(node30, babylonNode) { + if (node30.skin != null) { + return; + } + let position3 = Vector3.Zero(); + let rotation = Quaternion.Identity(); + let scaling = Vector3.One(); + if (node30.matrix) { + const matrix = Matrix.FromArray(node30.matrix); + matrix.decompose(scaling, rotation, position3); + } else { + if (node30.translation) { + position3 = Vector3.FromArray(node30.translation); + } + if (node30.rotation) { + rotation = Quaternion.FromArray(node30.rotation); + } + if (node30.scale) { + scaling = Vector3.FromArray(node30.scale); + } + } + babylonNode.position = position3; + babylonNode.rotationQuaternion = rotation; + babylonNode.scaling = scaling; + } + _loadSkinAsync(context, node30, skin, assign) { + const extensionPromise = this._extensionsLoadSkinAsync(context, node30, skin); + if (extensionPromise) { + return extensionPromise; + } + if (skin._data) { + assign(skin._data.babylonSkeleton); + return skin._data.promise; + } + const skeletonId = `skeleton${skin.index}`; + this._babylonScene._blockEntityCollection = !!this._assetContainer; + const babylonSkeleton = new Skeleton(skin.name || skeletonId, skeletonId, this._babylonScene); + babylonSkeleton._parentContainer = this._assetContainer; + this._babylonScene._blockEntityCollection = false; + this._loadBones(context, skin, babylonSkeleton); + const promise = this._loadSkinInverseBindMatricesDataAsync(context, skin).then((inverseBindMatricesData) => { + this._updateBoneMatrices(babylonSkeleton, inverseBindMatricesData); + }); + skin._data = { + babylonSkeleton, + promise + }; + assign(babylonSkeleton); + return promise; + } + _loadBones(context, skin, babylonSkeleton) { + if (skin.skeleton == undefined || this._parent.alwaysComputeSkeletonRootNode) { + const rootNode = this._findSkeletonRootNode(`${context}/joints`, skin.joints); + if (rootNode) { + if (skin.skeleton === undefined) { + skin.skeleton = rootNode.index; + } else { + const isParent = (a, b) => { + for (;b.parent; b = b.parent) { + if (b.parent === a) { + return true; + } + } + return false; + }; + const skeletonNode = ArrayItem.Get(`${context}/skeleton`, this._gltf.nodes, skin.skeleton); + if (skeletonNode !== rootNode && !isParent(skeletonNode, rootNode)) { + Logger.Warn(`${context}/skeleton: Overriding with nearest common ancestor as skeleton node is not a common root`); + skin.skeleton = rootNode.index; + } + } + } else { + Logger.Warn(`${context}: Failed to find common root`); + } + } + const babylonBones = {}; + for (const index of skin.joints) { + const node30 = ArrayItem.Get(`${context}/joints/${index}`, this._gltf.nodes, index); + this._loadBone(node30, skin, babylonSkeleton, babylonBones); + } + } + _findSkeletonRootNode(context, joints) { + if (joints.length === 0) { + return null; + } + const paths = {}; + for (const index of joints) { + const path = []; + let node30 = ArrayItem.Get(`${context}/${index}`, this._gltf.nodes, index); + while (node30.index !== -1) { + path.unshift(node30); + node30 = node30.parent; + } + paths[index] = path; + } + let rootNode = null; + for (let i = 0;; ++i) { + let path = paths[joints[0]]; + if (i >= path.length) { + return rootNode; + } + const node30 = path[i]; + for (let j = 1;j < joints.length; ++j) { + path = paths[joints[j]]; + if (i >= path.length || node30 !== path[i]) { + return rootNode; + } + } + rootNode = node30; + } + } + _loadBone(node30, skin, babylonSkeleton, babylonBones) { + let babylonBone = babylonBones[node30.index]; + if (babylonBone) { + return babylonBone; + } + let parentBabylonBone = null; + if (node30.index !== skin.skeleton) { + if (node30.parent && node30.parent.index !== -1) { + parentBabylonBone = this._loadBone(node30.parent, skin, babylonSkeleton, babylonBones); + } else if (skin.skeleton !== undefined) { + Logger.Warn(`/skins/${skin.index}/skeleton: Skeleton node is not a common root`); + } + } + const boneIndex = skin.joints.indexOf(node30.index); + babylonBone = new Bone(node30.name || `joint${node30.index}`, babylonSkeleton, parentBabylonBone, this._getNodeMatrix(node30), null, null, boneIndex); + babylonBones[node30.index] = babylonBone; + this._postSceneLoadActions.push(() => { + babylonBone.linkTransformNode(node30._babylonTransformNode); + }); + return babylonBone; + } + _loadSkinInverseBindMatricesDataAsync(context, skin) { + if (skin.inverseBindMatrices == undefined) { + return Promise.resolve(null); + } + const accessor = ArrayItem.Get(`${context}/inverseBindMatrices`, this._gltf.accessors, skin.inverseBindMatrices); + return this._loadFloatAccessorAsync(`/accessors/${accessor.index}`, accessor); + } + _updateBoneMatrices(babylonSkeleton, inverseBindMatricesData) { + for (const babylonBone of babylonSkeleton.bones) { + const baseMatrix = Matrix.Identity(); + const boneIndex = babylonBone._index; + if (inverseBindMatricesData && boneIndex !== -1) { + Matrix.FromArrayToRef(inverseBindMatricesData, boneIndex * 16, baseMatrix); + baseMatrix.invertToRef(baseMatrix); + } + const babylonParentBone = babylonBone.getParent(); + if (babylonParentBone) { + baseMatrix.multiplyToRef(babylonParentBone.getAbsoluteInverseBindMatrix(), baseMatrix); + } + babylonBone.updateMatrix(baseMatrix, false, false); + babylonBone._updateAbsoluteBindMatrices(undefined, false); + } + } + _getNodeMatrix(node30) { + return node30.matrix ? Matrix.FromArray(node30.matrix) : Matrix.Compose(node30.scale ? Vector3.FromArray(node30.scale) : Vector3.One(), node30.rotation ? Quaternion.FromArray(node30.rotation) : Quaternion.Identity(), node30.translation ? Vector3.FromArray(node30.translation) : Vector3.Zero()); + } + loadCameraAsync(context, camera34, assign = () => { + }) { + const extensionPromise = this._extensionsLoadCameraAsync(context, camera34, assign); + if (extensionPromise) { + return extensionPromise; + } + const promises = new Array; + this.logOpen(`${context} ${camera34.name || ""}`); + this._babylonScene._blockEntityCollection = !!this._assetContainer; + const babylonCamera = new FreeCamera(camera34.name || `camera${camera34.index}`, Vector3.Zero(), this._babylonScene, false); + babylonCamera._parentContainer = this._assetContainer; + this._babylonScene._blockEntityCollection = false; + babylonCamera.ignoreParentScaling = true; + camera34._babylonCamera = babylonCamera; + babylonCamera.rotation.set(0, Math.PI, 0); + switch (camera34.type) { + case "perspective": { + const perspective = camera34.perspective; + if (!perspective) { + throw new Error(`${context}: Camera perspective properties are missing`); + } + babylonCamera.fov = perspective.yfov; + babylonCamera.minZ = perspective.znear; + babylonCamera.maxZ = perspective.zfar || 0; + break; + } + case "orthographic": { + if (!camera34.orthographic) { + throw new Error(`${context}: Camera orthographic properties are missing`); + } + babylonCamera.mode = Camera.ORTHOGRAPHIC_CAMERA; + babylonCamera.orthoLeft = -camera34.orthographic.xmag; + babylonCamera.orthoRight = camera34.orthographic.xmag; + babylonCamera.orthoBottom = -camera34.orthographic.ymag; + babylonCamera.orthoTop = camera34.orthographic.ymag; + babylonCamera.minZ = camera34.orthographic.znear; + babylonCamera.maxZ = camera34.orthographic.zfar; + break; + } + default: { + throw new Error(`${context}: Invalid camera type (${camera34.type})`); + } + } + GLTFLoader2.AddPointerMetadata(babylonCamera, context); + this._parent.onCameraLoadedObservable.notifyObservers(babylonCamera); + assign(babylonCamera); + this.logClose(); + return Promise.all(promises).then(() => { + return babylonCamera; + }); + } + _loadAnimationsAsync() { + const animations = this._gltf.animations; + if (!animations) { + return Promise.resolve(); + } + const promises = new Array; + for (let index = 0;index < animations.length; index++) { + const animation16 = animations[index]; + promises.push(this.loadAnimationAsync(`/animations/${animation16.index}`, animation16).then((animationGroup5) => { + if (animationGroup5.targetedAnimations.length === 0) { + animationGroup5.dispose(); + } + })); + } + return Promise.all(promises).then(() => { + }); + } + loadAnimationAsync(context, animation16) { + const promise = this._extensionsLoadAnimationAsync(context, animation16); + if (promise) { + return promise; + } + this._babylonScene._blockEntityCollection = !!this._assetContainer; + const babylonAnimationGroup = new AnimationGroup(animation16.name || `animation${animation16.index}`, this._babylonScene); + babylonAnimationGroup._parentContainer = this._assetContainer; + this._babylonScene._blockEntityCollection = false; + animation16._babylonAnimationGroup = babylonAnimationGroup; + const promises = new Array; + ArrayItem.Assign(animation16.channels); + ArrayItem.Assign(animation16.samplers); + for (const channel of animation16.channels) { + promises.push(this._loadAnimationChannelAsync(`${context}/channels/${channel.index}`, context, animation16, channel, (babylonTarget, babylonAnimation) => { + babylonTarget.animations = babylonTarget.animations || []; + babylonTarget.animations.push(babylonAnimation); + babylonAnimationGroup.addTargetedAnimation(babylonAnimation, babylonTarget); + })); + } + return Promise.all(promises).then(() => { + babylonAnimationGroup.normalize(0); + return babylonAnimationGroup; + }); + } + _loadAnimationChannelAsync(context, animationContext, animation16, channel, onLoad) { + const promise = this._extensionsLoadAnimationChannelAsync(context, animationContext, animation16, channel, onLoad); + if (promise) { + return promise; + } + if (channel.target.node == undefined) { + return Promise.resolve(); + } + const targetNode = ArrayItem.Get(`${context}/target/node`, this._gltf.nodes, channel.target.node); + if (channel.target.path === "weights" && !targetNode._numMorphTargets || channel.target.path !== "weights" && !targetNode._babylonTransformNode) { + return Promise.resolve(); + } + let properties; + switch (channel.target.path) { + case "translation": { + properties = nodeAnimationData.translation; + break; + } + case "rotation": { + properties = nodeAnimationData.rotation; + break; + } + case "scale": { + properties = nodeAnimationData.scale; + break; + } + case "weights": { + properties = nodeAnimationData.weights; + break; + } + default: { + throw new Error(`${context}/target/path: Invalid value (${channel.target.path})`); + } + } + const targetInfo = { + target: targetNode, + properties + }; + return this._loadAnimationChannelFromTargetInfoAsync(context, animationContext, animation16, channel, targetInfo, onLoad); + } + _loadAnimationChannelFromTargetInfoAsync(context, animationContext, animation16, channel, targetInfo, onLoad) { + const fps = this.parent.targetFps; + const invfps = 1 / fps; + const sampler = ArrayItem.Get(`${context}/sampler`, animation16.samplers, channel.sampler); + return this._loadAnimationSamplerAsync(`${animationContext}/samplers/${channel.sampler}`, sampler).then((data) => { + let numAnimations = 0; + for (const property of targetInfo.properties) { + const stride = property.getStride(targetInfo.target); + const input = data.input; + const output = data.output; + const keys4 = new Array(input.length); + let outputOffset = 0; + switch (data.interpolation) { + case "STEP": { + for (let index = 0;index < input.length; index++) { + const value = property.getValue(targetInfo.target, output, outputOffset, 1); + outputOffset += stride; + keys4[index] = { + frame: input[index] * fps, + value, + interpolation: AnimationKeyInterpolation.STEP + }; + } + break; + } + case "CUBICSPLINE": { + for (let index = 0;index < input.length; index++) { + const inTangent = property.getValue(targetInfo.target, output, outputOffset, invfps); + outputOffset += stride; + const value = property.getValue(targetInfo.target, output, outputOffset, 1); + outputOffset += stride; + const outTangent = property.getValue(targetInfo.target, output, outputOffset, invfps); + outputOffset += stride; + keys4[index] = { + frame: input[index] * fps, + inTangent, + value, + outTangent + }; + } + break; + } + case "LINEAR": { + for (let index = 0;index < input.length; index++) { + const value = property.getValue(targetInfo.target, output, outputOffset, 1); + outputOffset += stride; + keys4[index] = { + frame: input[index] * fps, + value + }; + } + break; + } + } + if (outputOffset > 0) { + const name286 = `${animation16.name || `animation${animation16.index}`}_channel${channel.index}_${numAnimations}`; + property.buildAnimations(targetInfo.target, name286, fps, keys4, (babylonAnimatable, babylonAnimation) => { + ++numAnimations; + onLoad(babylonAnimatable, babylonAnimation); + }); + } + } + }); + } + _loadAnimationSamplerAsync(context, sampler) { + if (sampler._data) { + return sampler._data; + } + const interpolation = sampler.interpolation || "LINEAR"; + switch (interpolation) { + case "STEP": + case "LINEAR": + case "CUBICSPLINE": { + break; + } + default: { + throw new Error(`${context}/interpolation: Invalid value (${sampler.interpolation})`); + } + } + const inputAccessor = ArrayItem.Get(`${context}/input`, this._gltf.accessors, sampler.input); + const outputAccessor = ArrayItem.Get(`${context}/output`, this._gltf.accessors, sampler.output); + sampler._data = Promise.all([ + this._loadFloatAccessorAsync(`/accessors/${inputAccessor.index}`, inputAccessor), + this._loadFloatAccessorAsync(`/accessors/${outputAccessor.index}`, outputAccessor) + ]).then(([inputData, outputData]) => { + return { + input: inputData, + interpolation, + output: outputData + }; + }); + return sampler._data; + } + loadBufferAsync(context, buffer80, byteOffset, byteLength) { + const extensionPromise = this._extensionsLoadBufferAsync(context, buffer80, byteOffset, byteLength); + if (extensionPromise) { + return extensionPromise; + } + if (!buffer80._data) { + if (buffer80.uri) { + buffer80._data = this.loadUriAsync(`${context}/uri`, buffer80, buffer80.uri); + } else { + if (!this._bin) { + throw new Error(`${context}: Uri is missing or the binary glTF is missing its binary chunk`); + } + buffer80._data = this._bin.readAsync(0, buffer80.byteLength); + } + } + return buffer80._data.then((data) => { + try { + return new Uint8Array(data.buffer, data.byteOffset + byteOffset, byteLength); + } catch (e) { + throw new Error(`${context}: ${e.message}`); + } + }); + } + loadBufferViewAsync(context, bufferView) { + const extensionPromise = this._extensionsLoadBufferViewAsync(context, bufferView); + if (extensionPromise) { + return extensionPromise; + } + if (bufferView._data) { + return bufferView._data; + } + const buffer80 = ArrayItem.Get(`${context}/buffer`, this._gltf.buffers, bufferView.buffer); + bufferView._data = this.loadBufferAsync(`/buffers/${buffer80.index}`, buffer80, bufferView.byteOffset || 0, bufferView.byteLength); + return bufferView._data; + } + _loadAccessorAsync(context, accessor, constructor) { + if (accessor._data) { + return accessor._data; + } + const numComponents = GLTFLoader2._GetNumComponents(context, accessor.type); + const byteStride = numComponents * VertexBuffer.GetTypeByteLength(accessor.componentType); + const length = numComponents * accessor.count; + if (accessor.bufferView == undefined) { + accessor._data = Promise.resolve(new constructor(length)); + } else { + const bufferView = ArrayItem.Get(`${context}/bufferView`, this._gltf.bufferViews, accessor.bufferView); + accessor._data = this.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView).then((data) => { + if (accessor.componentType === 5126 && !accessor.normalized && (!bufferView.byteStride || bufferView.byteStride === byteStride)) { + return GLTFLoader2._GetTypedArray(context, accessor.componentType, data, accessor.byteOffset, length); + } else { + const typedArray = new constructor(length); + VertexBuffer.ForEach(data, accessor.byteOffset || 0, bufferView.byteStride || byteStride, numComponents, accessor.componentType, typedArray.length, accessor.normalized || false, (value, index) => { + typedArray[index] = value; + }); + return typedArray; + } + }); + } + if (accessor.sparse) { + const sparse = accessor.sparse; + accessor._data = accessor._data.then((data) => { + const typedArray = data; + const indicesBufferView = ArrayItem.Get(`${context}/sparse/indices/bufferView`, this._gltf.bufferViews, sparse.indices.bufferView); + const valuesBufferView = ArrayItem.Get(`${context}/sparse/values/bufferView`, this._gltf.bufferViews, sparse.values.bufferView); + return Promise.all([ + this.loadBufferViewAsync(`/bufferViews/${indicesBufferView.index}`, indicesBufferView), + this.loadBufferViewAsync(`/bufferViews/${valuesBufferView.index}`, valuesBufferView) + ]).then(([indicesData, valuesData]) => { + const indices = GLTFLoader2._GetTypedArray(`${context}/sparse/indices`, sparse.indices.componentType, indicesData, sparse.indices.byteOffset, sparse.count); + const sparseLength = numComponents * sparse.count; + let values; + if (accessor.componentType === 5126 && !accessor.normalized) { + values = GLTFLoader2._GetTypedArray(`${context}/sparse/values`, accessor.componentType, valuesData, sparse.values.byteOffset, sparseLength); + } else { + const sparseData = GLTFLoader2._GetTypedArray(`${context}/sparse/values`, accessor.componentType, valuesData, sparse.values.byteOffset, sparseLength); + values = new constructor(sparseLength); + VertexBuffer.ForEach(sparseData, 0, byteStride, numComponents, accessor.componentType, values.length, accessor.normalized || false, (value, index) => { + values[index] = value; + }); + } + let valuesIndex = 0; + for (let indicesIndex = 0;indicesIndex < indices.length; indicesIndex++) { + let dataIndex = indices[indicesIndex] * numComponents; + for (let componentIndex = 0;componentIndex < numComponents; componentIndex++) { + typedArray[dataIndex++] = values[valuesIndex++]; + } + } + return typedArray; + }); + }); + } + return accessor._data; + } + _loadFloatAccessorAsync(context, accessor) { + return this._loadAccessorAsync(context, accessor, Float32Array); + } + _loadIndicesAccessorAsync(context, accessor) { + if (accessor.type !== "SCALAR") { + throw new Error(`${context}/type: Invalid value ${accessor.type}`); + } + if (accessor.componentType !== 5121 && accessor.componentType !== 5123 && accessor.componentType !== 5125) { + throw new Error(`${context}/componentType: Invalid value ${accessor.componentType}`); + } + if (accessor._data) { + return accessor._data; + } + if (accessor.sparse) { + const constructor = GLTFLoader2._GetTypedArrayConstructor(`${context}/componentType`, accessor.componentType); + accessor._data = this._loadAccessorAsync(context, accessor, constructor); + } else { + const bufferView = ArrayItem.Get(`${context}/bufferView`, this._gltf.bufferViews, accessor.bufferView); + accessor._data = this.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView).then((data) => { + return GLTFLoader2._GetTypedArray(context, accessor.componentType, data, accessor.byteOffset, accessor.count); + }); + } + return accessor._data; + } + _loadVertexBufferViewAsync(bufferView) { + if (bufferView._babylonBuffer) { + return bufferView._babylonBuffer; + } + const engine47 = this._babylonScene.getEngine(); + bufferView._babylonBuffer = this.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView).then((data) => { + return new Buffer(engine47, data, false); + }); + return bufferView._babylonBuffer; + } + _loadVertexAccessorAsync(context, accessor, kind) { + var _a; + if ((_a = accessor._babylonVertexBuffer) === null || _a === undefined ? undefined : _a[kind]) { + return accessor._babylonVertexBuffer[kind]; + } + if (!accessor._babylonVertexBuffer) { + accessor._babylonVertexBuffer = {}; + } + const engine47 = this._babylonScene.getEngine(); + if (accessor.sparse || accessor.bufferView == undefined) { + accessor._babylonVertexBuffer[kind] = this._loadFloatAccessorAsync(context, accessor).then((data) => { + return new VertexBuffer(engine47, data, kind, false); + }); + } else { + const bufferView = ArrayItem.Get(`${context}/bufferView`, this._gltf.bufferViews, accessor.bufferView); + accessor._babylonVertexBuffer[kind] = this._loadVertexBufferViewAsync(bufferView).then((babylonBuffer) => { + const numComponents = GLTFLoader2._GetNumComponents(context, accessor.type); + return new VertexBuffer(engine47, babylonBuffer, kind, false, undefined, bufferView.byteStride, undefined, accessor.byteOffset, numComponents, accessor.componentType, accessor.normalized, true, undefined, true); + }); + } + return accessor._babylonVertexBuffer[kind]; + } + _loadMaterialMetallicRoughnessPropertiesAsync(context, properties, babylonMaterial) { + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${context}: Material type not supported`); + } + const promises = new Array; + if (properties) { + if (properties.baseColorFactor) { + babylonMaterial.albedoColor = Color3.FromArray(properties.baseColorFactor); + babylonMaterial.alpha = properties.baseColorFactor[3]; + } else { + babylonMaterial.albedoColor = Color3.White(); + } + babylonMaterial.metallic = properties.metallicFactor == undefined ? 1 : properties.metallicFactor; + babylonMaterial.roughness = properties.roughnessFactor == undefined ? 1 : properties.roughnessFactor; + if (properties.baseColorTexture) { + promises.push(this.loadTextureInfoAsync(`${context}/baseColorTexture`, properties.baseColorTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (Base Color)`; + babylonMaterial.albedoTexture = texture87; + })); + } + if (properties.metallicRoughnessTexture) { + properties.metallicRoughnessTexture.nonColorData = true; + promises.push(this.loadTextureInfoAsync(`${context}/metallicRoughnessTexture`, properties.metallicRoughnessTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (Metallic Roughness)`; + babylonMaterial.metallicTexture = texture87; + })); + babylonMaterial.useMetallnessFromMetallicTextureBlue = true; + babylonMaterial.useRoughnessFromMetallicTextureGreen = true; + babylonMaterial.useRoughnessFromMetallicTextureAlpha = false; + } + } + return Promise.all(promises).then(() => { + }); + } + _loadMaterialAsync(context, material30, babylonMesh, babylonDrawMode, assign = () => { + }) { + const extensionPromise = this._extensionsLoadMaterialAsync(context, material30, babylonMesh, babylonDrawMode, assign); + if (extensionPromise) { + return extensionPromise; + } + material30._data = material30._data || {}; + let babylonData = material30._data[babylonDrawMode]; + if (!babylonData) { + this.logOpen(`${context} ${material30.name || ""}`); + const babylonMaterial = this.createMaterial(context, material30, babylonDrawMode); + babylonData = { + babylonMaterial, + babylonMeshes: [], + promise: this.loadMaterialPropertiesAsync(context, material30, babylonMaterial) + }; + material30._data[babylonDrawMode] = babylonData; + GLTFLoader2.AddPointerMetadata(babylonMaterial, context); + this._parent.onMaterialLoadedObservable.notifyObservers(babylonMaterial); + this.logClose(); + } + if (babylonMesh) { + babylonData.babylonMeshes.push(babylonMesh); + babylonMesh.onDisposeObservable.addOnce(() => { + const index = babylonData.babylonMeshes.indexOf(babylonMesh); + if (index !== -1) { + babylonData.babylonMeshes.splice(index, 1); + } + }); + } + assign(babylonData.babylonMaterial); + return babylonData.promise.then(() => { + return babylonData.babylonMaterial; + }); + } + _createDefaultMaterial(name286, babylonDrawMode) { + this._babylonScene._blockEntityCollection = !!this._assetContainer; + const babylonMaterial = new PBRMaterial(name286, this._babylonScene); + babylonMaterial._parentContainer = this._assetContainer; + this._babylonScene._blockEntityCollection = false; + babylonMaterial.fillMode = babylonDrawMode; + babylonMaterial.enableSpecularAntiAliasing = true; + babylonMaterial.useRadianceOverAlpha = !this._parent.transparencyAsCoverage; + babylonMaterial.useSpecularOverAlpha = !this._parent.transparencyAsCoverage; + babylonMaterial.transparencyMode = PBRMaterial.PBRMATERIAL_OPAQUE; + babylonMaterial.metallic = 1; + babylonMaterial.roughness = 1; + return babylonMaterial; + } + createMaterial(context, material30, babylonDrawMode) { + const extensionPromise = this._extensionsCreateMaterial(context, material30, babylonDrawMode); + if (extensionPromise) { + return extensionPromise; + } + const name286 = material30.name || `material${material30.index}`; + const babylonMaterial = this._createDefaultMaterial(name286, babylonDrawMode); + return babylonMaterial; + } + loadMaterialPropertiesAsync(context, material30, babylonMaterial) { + const extensionPromise = this._extensionsLoadMaterialPropertiesAsync(context, material30, babylonMaterial); + if (extensionPromise) { + return extensionPromise; + } + const promises = new Array; + promises.push(this.loadMaterialBasePropertiesAsync(context, material30, babylonMaterial)); + if (material30.pbrMetallicRoughness) { + promises.push(this._loadMaterialMetallicRoughnessPropertiesAsync(`${context}/pbrMetallicRoughness`, material30.pbrMetallicRoughness, babylonMaterial)); + } + this.loadMaterialAlphaProperties(context, material30, babylonMaterial); + return Promise.all(promises).then(() => { + }); + } + loadMaterialBasePropertiesAsync(context, material30, babylonMaterial) { + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${context}: Material type not supported`); + } + const promises = new Array; + babylonMaterial.emissiveColor = material30.emissiveFactor ? Color3.FromArray(material30.emissiveFactor) : new Color3(0, 0, 0); + if (material30.doubleSided) { + babylonMaterial.backFaceCulling = false; + babylonMaterial.twoSidedLighting = true; + } + if (material30.normalTexture) { + material30.normalTexture.nonColorData = true; + promises.push(this.loadTextureInfoAsync(`${context}/normalTexture`, material30.normalTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (Normal)`; + babylonMaterial.bumpTexture = texture87; + })); + babylonMaterial.invertNormalMapX = !this._babylonScene.useRightHandedSystem; + babylonMaterial.invertNormalMapY = this._babylonScene.useRightHandedSystem; + if (material30.normalTexture.scale != null && babylonMaterial.bumpTexture) { + babylonMaterial.bumpTexture.level = material30.normalTexture.scale; + } + babylonMaterial.forceIrradianceInFragment = true; + } + if (material30.occlusionTexture) { + material30.occlusionTexture.nonColorData = true; + promises.push(this.loadTextureInfoAsync(`${context}/occlusionTexture`, material30.occlusionTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (Occlusion)`; + babylonMaterial.ambientTexture = texture87; + })); + babylonMaterial.useAmbientInGrayScale = true; + if (material30.occlusionTexture.strength != null) { + babylonMaterial.ambientTextureStrength = material30.occlusionTexture.strength; + } + } + if (material30.emissiveTexture) { + promises.push(this.loadTextureInfoAsync(`${context}/emissiveTexture`, material30.emissiveTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (Emissive)`; + babylonMaterial.emissiveTexture = texture87; + })); + } + return Promise.all(promises).then(() => { + }); + } + loadMaterialAlphaProperties(context, material30, babylonMaterial) { + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${context}: Material type not supported`); + } + const alphaMode = material30.alphaMode || "OPAQUE"; + switch (alphaMode) { + case "OPAQUE": { + babylonMaterial.transparencyMode = PBRMaterial.PBRMATERIAL_OPAQUE; + break; + } + case "MASK": { + babylonMaterial.transparencyMode = PBRMaterial.PBRMATERIAL_ALPHATEST; + babylonMaterial.alphaCutOff = material30.alphaCutoff == undefined ? 0.5 : material30.alphaCutoff; + if (babylonMaterial.albedoTexture) { + babylonMaterial.albedoTexture.hasAlpha = true; + } + break; + } + case "BLEND": { + babylonMaterial.transparencyMode = PBRMaterial.PBRMATERIAL_ALPHABLEND; + if (babylonMaterial.albedoTexture) { + babylonMaterial.albedoTexture.hasAlpha = true; + babylonMaterial.useAlphaFromAlbedoTexture = true; + } + break; + } + default: { + throw new Error(`${context}/alphaMode: Invalid value (${material30.alphaMode})`); + } + } + } + loadTextureInfoAsync(context, textureInfo, assign = () => { + }) { + const extensionPromise = this._extensionsLoadTextureInfoAsync(context, textureInfo, assign); + if (extensionPromise) { + return extensionPromise; + } + this.logOpen(`${context}`); + if (textureInfo.texCoord >= 6) { + throw new Error(`${context}/texCoord: Invalid value (${textureInfo.texCoord})`); + } + const texture87 = ArrayItem.Get(`${context}/index`, this._gltf.textures, textureInfo.index); + texture87._textureInfo = textureInfo; + const promise = this._loadTextureAsync(`/textures/${textureInfo.index}`, texture87, (babylonTexture) => { + babylonTexture.coordinatesIndex = textureInfo.texCoord || 0; + GLTFLoader2.AddPointerMetadata(babylonTexture, context); + this._parent.onTextureLoadedObservable.notifyObservers(babylonTexture); + assign(babylonTexture); + }); + this.logClose(); + return promise; + } + _loadTextureAsync(context, texture87, assign = () => { + }) { + const extensionPromise = this._extensionsLoadTextureAsync(context, texture87, assign); + if (extensionPromise) { + return extensionPromise; + } + this.logOpen(`${context} ${texture87.name || ""}`); + const sampler = texture87.sampler == undefined ? GLTFLoader2.DefaultSampler : ArrayItem.Get(`${context}/sampler`, this._gltf.samplers, texture87.sampler); + const image7 = ArrayItem.Get(`${context}/source`, this._gltf.images, texture87.source); + const promise = this._createTextureAsync(context, sampler, image7, assign, undefined, !texture87._textureInfo.nonColorData); + this.logClose(); + return promise; + } + _createTextureAsync(context, sampler, image7, assign = () => { + }, textureLoaderOptions, useSRGBBuffer) { + const samplerData = this._loadSampler(`/samplers/${sampler.index}`, sampler); + const promises = new Array; + const deferred3 = new Deferred; + this._babylonScene._blockEntityCollection = !!this._assetContainer; + const textureCreationOptions = { + noMipmap: samplerData.noMipMaps, + invertY: false, + samplingMode: samplerData.samplingMode, + onLoad: () => { + if (!this._disposed) { + deferred3.resolve(); + } + }, + onError: (message, exception) => { + if (!this._disposed) { + deferred3.reject(new Error(`${context}: ${exception && exception.message ? exception.message : message || "Failed to load texture"}`)); + } + }, + mimeType: image7.mimeType, + loaderOptions: textureLoaderOptions, + useSRGBBuffer: !!useSRGBBuffer && this._parent.useSRGBBuffers + }; + const babylonTexture = new Texture(null, this._babylonScene, textureCreationOptions); + babylonTexture._parentContainer = this._assetContainer; + this._babylonScene._blockEntityCollection = false; + promises.push(deferred3.promise); + promises.push(this.loadImageAsync(`/images/${image7.index}`, image7).then((data) => { + const name286 = image7.uri || `${this._fileName}#image${image7.index}`; + const dataUrl = `data:${this._uniqueRootUrl}${name286}`; + babylonTexture.updateURL(dataUrl, data); + })); + babylonTexture.wrapU = samplerData.wrapU; + babylonTexture.wrapV = samplerData.wrapV; + assign(babylonTexture); + return Promise.all(promises).then(() => { + return babylonTexture; + }); + } + _loadSampler(context, sampler) { + if (!sampler._data) { + sampler._data = { + noMipMaps: sampler.minFilter === 9728 || sampler.minFilter === 9729, + samplingMode: GLTFLoader2._GetTextureSamplingMode(context, sampler), + wrapU: GLTFLoader2._GetTextureWrapMode(`${context}/wrapS`, sampler.wrapS), + wrapV: GLTFLoader2._GetTextureWrapMode(`${context}/wrapT`, sampler.wrapT) + }; + } + return sampler._data; + } + loadImageAsync(context, image7) { + if (!image7._data) { + this.logOpen(`${context} ${image7.name || ""}`); + if (image7.uri) { + image7._data = this.loadUriAsync(`${context}/uri`, image7, image7.uri); + } else { + const bufferView = ArrayItem.Get(`${context}/bufferView`, this._gltf.bufferViews, image7.bufferView); + image7._data = this.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView); + } + this.logClose(); + } + return image7._data; + } + loadUriAsync(context, property, uri) { + const extensionPromise = this._extensionsLoadUriAsync(context, property, uri); + if (extensionPromise) { + return extensionPromise; + } + if (!GLTFLoader2._ValidateUri(uri)) { + throw new Error(`${context}: '${uri}' is invalid`); + } + if (IsBase64DataUrl(uri)) { + const data = new Uint8Array(DecodeBase64UrlToBinary(uri)); + this.log(`${context}: Decoded ${uri.substr(0, 64)}... (${data.length} bytes)`); + return Promise.resolve(data); + } + this.log(`${context}: Loading ${uri}`); + return this._parent.preprocessUrlAsync(this._rootUrl + uri).then((url) => { + return new Promise((resolve, reject) => { + this._parent._loadFile(this._babylonScene, url, (data) => { + if (!this._disposed) { + this.log(`${context}: Loaded ${uri} (${data.byteLength} bytes)`); + resolve(new Uint8Array(data)); + } + }, true, (request) => { + reject(new LoadFileError(`${context}: Failed to load '${uri}'${request ? ": " + request.status + " " + request.statusText : ""}`, request)); + }); + }); + }); + } + static AddPointerMetadata(babylonObject, pointer) { + babylonObject.metadata = babylonObject.metadata || {}; + const metadata = babylonObject._internalMetadata = babylonObject._internalMetadata || {}; + const gltf = metadata.gltf = metadata.gltf || {}; + const pointers = gltf.pointers = gltf.pointers || []; + pointers.push(pointer); + } + static _GetTextureWrapMode(context, mode) { + mode = mode == undefined ? 10497 : mode; + switch (mode) { + case 33071: + return Texture.CLAMP_ADDRESSMODE; + case 33648: + return Texture.MIRROR_ADDRESSMODE; + case 10497: + return Texture.WRAP_ADDRESSMODE; + default: + Logger.Warn(`${context}: Invalid value (${mode})`); + return Texture.WRAP_ADDRESSMODE; + } + } + static _GetTextureSamplingMode(context, sampler) { + const magFilter = sampler.magFilter == undefined ? 9729 : sampler.magFilter; + const minFilter = sampler.minFilter == undefined ? 9987 : sampler.minFilter; + if (magFilter === 9729) { + switch (minFilter) { + case 9728: + return Texture.LINEAR_NEAREST; + case 9729: + return Texture.LINEAR_LINEAR; + case 9984: + return Texture.LINEAR_NEAREST_MIPNEAREST; + case 9985: + return Texture.LINEAR_LINEAR_MIPNEAREST; + case 9986: + return Texture.LINEAR_NEAREST_MIPLINEAR; + case 9987: + return Texture.LINEAR_LINEAR_MIPLINEAR; + default: + Logger.Warn(`${context}/minFilter: Invalid value (${minFilter})`); + return Texture.LINEAR_LINEAR_MIPLINEAR; + } + } else { + if (magFilter !== 9728) { + Logger.Warn(`${context}/magFilter: Invalid value (${magFilter})`); + } + switch (minFilter) { + case 9728: + return Texture.NEAREST_NEAREST; + case 9729: + return Texture.NEAREST_LINEAR; + case 9984: + return Texture.NEAREST_NEAREST_MIPNEAREST; + case 9985: + return Texture.NEAREST_LINEAR_MIPNEAREST; + case 9986: + return Texture.NEAREST_NEAREST_MIPLINEAR; + case 9987: + return Texture.NEAREST_LINEAR_MIPLINEAR; + default: + Logger.Warn(`${context}/minFilter: Invalid value (${minFilter})`); + return Texture.NEAREST_NEAREST_MIPNEAREST; + } + } + } + static _GetTypedArrayConstructor(context, componentType) { + switch (componentType) { + case 5120: + return Int8Array; + case 5121: + return Uint8Array; + case 5122: + return Int16Array; + case 5123: + return Uint16Array; + case 5125: + return Uint32Array; + case 5126: + return Float32Array; + default: + throw new Error(`${context}: Invalid component type ${componentType}`); + } + } + static _GetTypedArray(context, componentType, bufferView, byteOffset, length) { + const buffer80 = bufferView.buffer; + byteOffset = bufferView.byteOffset + (byteOffset || 0); + const constructor = GLTFLoader2._GetTypedArrayConstructor(`${context}/componentType`, componentType); + const componentTypeLength = VertexBuffer.GetTypeByteLength(componentType); + if (byteOffset % componentTypeLength !== 0) { + Logger.Warn(`${context}: Copying buffer as byte offset (${byteOffset}) is not a multiple of component type byte length (${componentTypeLength})`); + return new constructor(buffer80.slice(byteOffset, byteOffset + length * componentTypeLength), 0); + } + return new constructor(buffer80, byteOffset, length); + } + static _GetNumComponents(context, type) { + switch (type) { + case "SCALAR": + return 1; + case "VEC2": + return 2; + case "VEC3": + return 3; + case "VEC4": + return 4; + case "MAT2": + return 4; + case "MAT3": + return 9; + case "MAT4": + return 16; + } + throw new Error(`${context}: Invalid type (${type})`); + } + static _ValidateUri(uri) { + return Tools.IsBase64(uri) || uri.indexOf("..") === -1; + } + static _GetDrawMode(context, mode) { + if (mode == undefined) { + mode = 4; + } + switch (mode) { + case 0: + return Material.PointListDrawMode; + case 1: + return Material.LineListDrawMode; + case 2: + return Material.LineLoopDrawMode; + case 3: + return Material.LineStripDrawMode; + case 4: + return Material.TriangleFillMode; + case 5: + return Material.TriangleStripDrawMode; + case 6: + return Material.TriangleFanDrawMode; + } + throw new Error(`${context}: Invalid mesh primitive mode (${mode})`); + } + _compileMaterialsAsync() { + this._parent._startPerformanceCounter("Compile materials"); + const promises = new Array; + if (this._gltf.materials) { + for (const material30 of this._gltf.materials) { + if (material30._data) { + for (const babylonDrawMode in material30._data) { + const babylonData = material30._data[babylonDrawMode]; + for (const babylonMesh of babylonData.babylonMeshes) { + babylonMesh.computeWorldMatrix(true); + const babylonMaterial = babylonData.babylonMaterial; + promises.push(babylonMaterial.forceCompilationAsync(babylonMesh)); + promises.push(babylonMaterial.forceCompilationAsync(babylonMesh, { useInstances: true })); + if (this._parent.useClipPlane) { + promises.push(babylonMaterial.forceCompilationAsync(babylonMesh, { clipPlane: true })); + promises.push(babylonMaterial.forceCompilationAsync(babylonMesh, { clipPlane: true, useInstances: true })); + } + } + } + } + } + } + return Promise.all(promises).then(() => { + this._parent._endPerformanceCounter("Compile materials"); + }); + } + _compileShadowGeneratorsAsync() { + this._parent._startPerformanceCounter("Compile shadow generators"); + const promises = new Array; + const lights = this._babylonScene.lights; + for (const light12 of lights) { + const generator = light12.getShadowGenerator(); + if (generator) { + promises.push(generator.forceCompilationAsync()); + } + } + return Promise.all(promises).then(() => { + this._parent._endPerformanceCounter("Compile shadow generators"); + }); + } + _forEachExtensions(action7) { + for (const extension of this._extensions) { + if (extension.enabled) { + action7(extension); + } + } + } + _applyExtensions(property, functionName, actionAsync) { + for (const extension of this._extensions) { + if (extension.enabled) { + const id = `${extension.name}.${functionName}`; + const loaderProperty = property; + loaderProperty._activeLoaderExtensionFunctions = loaderProperty._activeLoaderExtensionFunctions || {}; + const activeLoaderExtensionFunctions = loaderProperty._activeLoaderExtensionFunctions; + if (!activeLoaderExtensionFunctions[id]) { + activeLoaderExtensionFunctions[id] = true; + try { + const result = actionAsync(extension); + if (result) { + return result; + } + } finally { + delete activeLoaderExtensionFunctions[id]; + } + } + } + } + return null; + } + _extensionsOnLoading() { + this._forEachExtensions((extension) => extension.onLoading && extension.onLoading()); + } + _extensionsOnReady() { + this._forEachExtensions((extension) => extension.onReady && extension.onReady()); + } + _extensionsLoadSceneAsync(context, scene37) { + return this._applyExtensions(scene37, "loadScene", (extension) => extension.loadSceneAsync && extension.loadSceneAsync(context, scene37)); + } + _extensionsLoadNodeAsync(context, node30, assign) { + return this._applyExtensions(node30, "loadNode", (extension) => extension.loadNodeAsync && extension.loadNodeAsync(context, node30, assign)); + } + _extensionsLoadCameraAsync(context, camera34, assign) { + return this._applyExtensions(camera34, "loadCamera", (extension) => extension.loadCameraAsync && extension.loadCameraAsync(context, camera34, assign)); + } + _extensionsLoadVertexDataAsync(context, primitive, babylonMesh) { + return this._applyExtensions(primitive, "loadVertexData", (extension) => extension._loadVertexDataAsync && extension._loadVertexDataAsync(context, primitive, babylonMesh)); + } + _extensionsLoadMeshPrimitiveAsync(context, name286, node30, mesh79, primitive, assign) { + return this._applyExtensions(primitive, "loadMeshPrimitive", (extension) => extension._loadMeshPrimitiveAsync && extension._loadMeshPrimitiveAsync(context, name286, node30, mesh79, primitive, assign)); + } + _extensionsLoadMaterialAsync(context, material30, babylonMesh, babylonDrawMode, assign) { + return this._applyExtensions(material30, "loadMaterial", (extension) => extension._loadMaterialAsync && extension._loadMaterialAsync(context, material30, babylonMesh, babylonDrawMode, assign)); + } + _extensionsCreateMaterial(context, material30, babylonDrawMode) { + return this._applyExtensions(material30, "createMaterial", (extension) => extension.createMaterial && extension.createMaterial(context, material30, babylonDrawMode)); + } + _extensionsLoadMaterialPropertiesAsync(context, material30, babylonMaterial) { + return this._applyExtensions(material30, "loadMaterialProperties", (extension) => extension.loadMaterialPropertiesAsync && extension.loadMaterialPropertiesAsync(context, material30, babylonMaterial)); + } + _extensionsLoadTextureInfoAsync(context, textureInfo, assign) { + return this._applyExtensions(textureInfo, "loadTextureInfo", (extension) => extension.loadTextureInfoAsync && extension.loadTextureInfoAsync(context, textureInfo, assign)); + } + _extensionsLoadTextureAsync(context, texture87, assign) { + return this._applyExtensions(texture87, "loadTexture", (extension) => extension._loadTextureAsync && extension._loadTextureAsync(context, texture87, assign)); + } + _extensionsLoadAnimationAsync(context, animation16) { + return this._applyExtensions(animation16, "loadAnimation", (extension) => extension.loadAnimationAsync && extension.loadAnimationAsync(context, animation16)); + } + _extensionsLoadAnimationChannelAsync(context, animationContext, animation16, channel, onLoad) { + return this._applyExtensions(animation16, "loadAnimationChannel", (extension) => extension._loadAnimationChannelAsync && extension._loadAnimationChannelAsync(context, animationContext, animation16, channel, onLoad)); + } + _extensionsLoadSkinAsync(context, node30, skin) { + return this._applyExtensions(skin, "loadSkin", (extension) => extension._loadSkinAsync && extension._loadSkinAsync(context, node30, skin)); + } + _extensionsLoadUriAsync(context, property, uri) { + return this._applyExtensions(property, "loadUri", (extension) => extension._loadUriAsync && extension._loadUriAsync(context, property, uri)); + } + _extensionsLoadBufferViewAsync(context, bufferView) { + return this._applyExtensions(bufferView, "loadBufferView", (extension) => extension.loadBufferViewAsync && extension.loadBufferViewAsync(context, bufferView)); + } + _extensionsLoadBufferAsync(context, buffer80, byteOffset, byteLength) { + return this._applyExtensions(buffer80, "loadBuffer", (extension) => extension.loadBufferAsync && extension.loadBufferAsync(context, buffer80, byteOffset, byteLength)); + } + static LoadExtensionAsync(context, property, extensionName, actionAsync) { + if (!property.extensions) { + return null; + } + const extensions = property.extensions; + const extension = extensions[extensionName]; + if (!extension) { + return null; + } + return actionAsync(`${context}/extensions/${extensionName}`, extension); + } + static LoadExtraAsync(context, property, extensionName, actionAsync) { + if (!property.extras) { + return null; + } + const extras = property.extras; + const extra = extras[extensionName]; + if (!extra) { + return null; + } + return actionAsync(`${context}/extras/${extensionName}`, extra); + } + isExtensionUsed(name286) { + return !!this._gltf.extensionsUsed && this._gltf.extensionsUsed.indexOf(name286) !== -1; + } + logOpen(message) { + this._parent._logOpen(message); + } + logClose() { + this._parent._logClose(); + } + log(message) { + this._parent._log(message); + } + startPerformanceCounter(counterName) { + this._parent._startPerformanceCounter(counterName); + } + endPerformanceCounter(counterName) { + this._parent._endPerformanceCounter(counterName); + } +} +var mergeDeep; +var init_glTFLoader2 = __esm(() => { + init_deferred(); + init_math_vector(); + init_math_color(); + init_tools(); + init_camera(); + init_freeCamera(); + init_animationKey(); + init_animationGroup(); + init_bone(); + init_skeleton(); + init_material(); + init_pbrMaterial(); + init_texture(); + init_transformNode(); + init_buffer(); + init_geometry(); + init_mesh(); + init_morphTarget(); + init_morphTargetManager(); + init_glTFFileLoader(); + init_fileTools(); + init_logger(); + init_boundingInfo(); + init_glTFLoaderAnimation(); + mergeDeep = function(...objects) { + const isObject = (obj) => obj && typeof obj === "object"; + return objects.reduce((prev, obj) => { + Object.keys(obj).forEach((key) => { + const pVal = prev[key]; + const oVal = obj[key]; + if (Array.isArray(pVal) && Array.isArray(oVal)) { + prev[key] = pVal.concat(...oVal); + } else if (isObject(pVal) && isObject(oVal)) { + prev[key] = mergeDeep(pVal, oVal); + } else { + prev[key] = oVal; + } + }); + return prev; + }, {}); + }; + GLTFLoader2._RegisteredExtensions = {}; + GLTFLoader2.DefaultSampler = { index: -1 }; + GLTFFileLoader._CreateGLTF2Loader = (parent) => new GLTFLoader2(parent); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/glTFLoaderExtension.js +var init_glTFLoaderExtension = __esm(() => { +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/glTFLoaderInterfaces.js +var init_glTFLoaderInterfaces2 = __esm(() => { +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/EXT_lights_image_based.js +class EXT_lights_image_based { + constructor(loader) { + this.name = NAME; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME); + } + dispose() { + this._loader = null; + delete this._lights; + } + onLoading() { + const extensions = this._loader.gltf.extensions; + if (extensions && extensions[this.name]) { + const extension = extensions[this.name]; + this._lights = extension.lights; + } + } + loadSceneAsync(context, scene37) { + return GLTFLoader2.LoadExtensionAsync(context, scene37, this.name, (extensionContext, extension) => { + this._loader._allMaterialsDirtyRequired = true; + const promises = new Array; + promises.push(this._loader.loadSceneAsync(context, scene37)); + this._loader.logOpen(`${extensionContext}`); + const light12 = ArrayItem.Get(`${extensionContext}/light`, this._lights, extension.light); + promises.push(this._loadLightAsync(`/extensions/${this.name}/lights/${extension.light}`, light12).then((texture87) => { + this._loader.babylonScene.environmentTexture = texture87; + })); + this._loader.logClose(); + return Promise.all(promises).then(() => { + }); + }); + } + _loadLightAsync(context, light12) { + if (!light12._loaded) { + const promises = new Array; + this._loader.logOpen(`${context}`); + const imageData = new Array(light12.specularImages.length); + for (let mipmap = 0;mipmap < light12.specularImages.length; mipmap++) { + const faces = light12.specularImages[mipmap]; + imageData[mipmap] = new Array(faces.length); + for (let face = 0;face < faces.length; face++) { + const specularImageContext = `${context}/specularImages/${mipmap}/${face}`; + this._loader.logOpen(`${specularImageContext}`); + const index = faces[face]; + const image7 = ArrayItem.Get(specularImageContext, this._loader.gltf.images, index); + promises.push(this._loader.loadImageAsync(`/images/${index}`, image7).then((data) => { + imageData[mipmap][face] = data; + })); + this._loader.logClose(); + } + } + this._loader.logClose(); + light12._loaded = Promise.all(promises).then(() => { + const babylonTexture = new RawCubeTexture(this._loader.babylonScene, null, light12.specularImageSize); + babylonTexture.name = light12.name || "environment"; + light12._babylonTexture = babylonTexture; + if (light12.intensity != null) { + babylonTexture.level = light12.intensity; + } + if (light12.rotation) { + let rotation = Quaternion.FromArray(light12.rotation); + if (!this._loader.babylonScene.useRightHandedSystem) { + rotation = Quaternion.Inverse(rotation); + } + Matrix.FromQuaternionToRef(rotation, babylonTexture.getReflectionTextureMatrix()); + } + if (!light12.irradianceCoefficients) { + throw new Error(`${context}: Irradiance coefficients are missing`); + } + const sphericalHarmonics = SphericalHarmonics.FromArray(light12.irradianceCoefficients); + sphericalHarmonics.scaleInPlace(light12.intensity); + sphericalHarmonics.convertIrradianceToLambertianRadiance(); + const sphericalPolynomial8 = SphericalPolynomial.FromHarmonics(sphericalHarmonics); + const lodGenerationScale = (imageData.length - 1) / Scalar.Log2(light12.specularImageSize); + return babylonTexture.updateRGBDAsync(imageData, sphericalPolynomial8, lodGenerationScale); + }); + } + return light12._loaded.then(() => { + return light12._babylonTexture; + }); + } +} +var NAME; +var init_EXT_lights_image_based = __esm(() => { + init_math_scalar(); + init_sphericalPolynomial(); + init_math_vector(); + init_rawCubeTexture(); + init_glTFLoader2(); + NAME = "EXT_lights_image_based"; + GLTFLoader2.RegisterExtension(NAME, (loader) => new EXT_lights_image_based(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +class EXT_mesh_gpu_instancing { + constructor(loader) { + this.name = NAME2; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME2); + } + dispose() { + this._loader = null; + } + loadNodeAsync(context, node30, assign) { + return GLTFLoader2.LoadExtensionAsync(context, node30, this.name, (extensionContext, extension) => { + this._loader._disableInstancedMesh++; + const promise = this._loader.loadNodeAsync(`/nodes/${node30.index}`, node30, assign); + this._loader._disableInstancedMesh--; + if (!node30._primitiveBabylonMeshes) { + return promise; + } + const promises = new Array; + let instanceCount = 0; + const loadAttribute = (attribute) => { + if (extension.attributes[attribute] == undefined) { + promises.push(Promise.resolve(null)); + return; + } + const accessor = ArrayItem.Get(`${extensionContext}/attributes/${attribute}`, this._loader.gltf.accessors, extension.attributes[attribute]); + promises.push(this._loader._loadFloatAccessorAsync(`/accessors/${accessor.bufferView}`, accessor)); + if (instanceCount === 0) { + instanceCount = accessor.count; + } else if (instanceCount !== accessor.count) { + throw new Error(`${extensionContext}/attributes: Instance buffer accessors do not have the same count.`); + } + }; + loadAttribute("TRANSLATION"); + loadAttribute("ROTATION"); + loadAttribute("SCALE"); + return promise.then((babylonTransformNode) => { + return Promise.all(promises).then(([translationBuffer, rotationBuffer, scaleBuffer]) => { + const matrices = new Float32Array(instanceCount * 16); + TmpVectors.Vector3[0].copyFromFloats(0, 0, 0); + TmpVectors.Quaternion[0].copyFromFloats(0, 0, 0, 1); + TmpVectors.Vector3[1].copyFromFloats(1, 1, 1); + for (let i = 0;i < instanceCount; ++i) { + translationBuffer && Vector3.FromArrayToRef(translationBuffer, i * 3, TmpVectors.Vector3[0]); + rotationBuffer && Quaternion.FromArrayToRef(rotationBuffer, i * 4, TmpVectors.Quaternion[0]); + scaleBuffer && Vector3.FromArrayToRef(scaleBuffer, i * 3, TmpVectors.Vector3[1]); + Matrix.ComposeToRef(TmpVectors.Vector3[1], TmpVectors.Quaternion[0], TmpVectors.Vector3[0], TmpVectors.Matrix[0]); + TmpVectors.Matrix[0].copyToArray(matrices, i * 16); + } + for (const babylonMesh of node30._primitiveBabylonMeshes) { + babylonMesh.thinInstanceSetBuffer("matrix", matrices, 16, true); + } + return babylonTransformNode; + }); + }); + }); + } +} +var NAME2; +var init_EXT_mesh_gpu_instancing = __esm(() => { + init_math_vector(); + init_glTFLoader2(); + init_thinInstanceMesh(); + NAME2 = "EXT_mesh_gpu_instancing"; + GLTFLoader2.RegisterExtension(NAME2, (loader) => new EXT_mesh_gpu_instancing(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/EXT_meshopt_compression.js +class EXT_meshopt_compression { + constructor(loader) { + this.name = NAME3; + this.enabled = loader.isExtensionUsed(NAME3); + this._loader = loader; + } + dispose() { + this._loader = null; + } + loadBufferViewAsync(context, bufferView) { + return GLTFLoader2.LoadExtensionAsync(context, bufferView, this.name, (extensionContext, extension) => { + const bufferViewMeshopt = bufferView; + if (bufferViewMeshopt._meshOptData) { + return bufferViewMeshopt._meshOptData; + } + const buffer80 = ArrayItem.Get(`${context}/buffer`, this._loader.gltf.buffers, extension.buffer); + bufferViewMeshopt._meshOptData = this._loader.loadBufferAsync(`/buffers/${buffer80.index}`, buffer80, extension.byteOffset || 0, extension.byteLength).then((buffer81) => { + return MeshoptCompression.Default.decodeGltfBufferAsync(buffer81, extension.count, extension.byteStride, extension.mode, extension.filter); + }); + return bufferViewMeshopt._meshOptData; + }); + } +} +var NAME3; +var init_EXT_meshopt_compression = __esm(() => { + init_glTFLoader2(); + init_meshoptCompression(); + NAME3 = "EXT_meshopt_compression"; + GLTFLoader2.RegisterExtension(NAME3, (loader) => new EXT_meshopt_compression(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/EXT_texture_webp.js +class EXT_texture_webp { + constructor(loader) { + this.name = NAME4; + this._loader = loader; + this.enabled = loader.isExtensionUsed(NAME4); + } + dispose() { + this._loader = null; + } + _loadTextureAsync(context, texture87, assign) { + return GLTFLoader2.LoadExtensionAsync(context, texture87, this.name, (extensionContext, extension) => { + const sampler = texture87.sampler == undefined ? GLTFLoader2.DefaultSampler : ArrayItem.Get(`${context}/sampler`, this._loader.gltf.samplers, texture87.sampler); + const image7 = ArrayItem.Get(`${extensionContext}/source`, this._loader.gltf.images, extension.source); + return this._loader._createTextureAsync(context, sampler, image7, (babylonTexture) => { + assign(babylonTexture); + }, undefined, !texture87._textureInfo.nonColorData); + }); + } +} +var NAME4; +var init_EXT_texture_webp = __esm(() => { + init_glTFLoader2(); + NAME4 = "EXT_texture_webp"; + GLTFLoader2.RegisterExtension(NAME4, (loader) => new EXT_texture_webp(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +class KHR_draco_mesh_compression { + constructor(loader) { + this.name = NAME5; + this.useNormalizedFlagFromAccessor = true; + this._loader = loader; + this.enabled = DracoCompression.DecoderAvailable && this._loader.isExtensionUsed(NAME5); + } + dispose() { + delete this.dracoCompression; + this._loader = null; + } + _loadVertexDataAsync(context, primitive, babylonMesh) { + return GLTFLoader2.LoadExtensionAsync(context, primitive, this.name, (extensionContext, extension) => { + if (primitive.mode != null) { + if (primitive.mode !== 5 && primitive.mode !== 4) { + throw new Error(`${context}: Unsupported mode ${primitive.mode}`); + } + if (primitive.mode === 5) { + throw new Error(`${context}: Mode ${primitive.mode} is not currently supported`); + } + } + const attributes = {}; + const normalized = {}; + const loadAttribute = (name286, kind) => { + const uniqueId = extension.attributes[name286]; + if (uniqueId == undefined) { + return; + } + babylonMesh._delayInfo = babylonMesh._delayInfo || []; + if (babylonMesh._delayInfo.indexOf(kind) === -1) { + babylonMesh._delayInfo.push(kind); + } + attributes[kind] = uniqueId; + if (this.useNormalizedFlagFromAccessor) { + const accessor = ArrayItem.TryGet(this._loader.gltf.accessors, primitive.attributes[name286]); + if (accessor) { + normalized[kind] = accessor.normalized || false; + } + } + }; + loadAttribute("POSITION", VertexBuffer.PositionKind); + loadAttribute("NORMAL", VertexBuffer.NormalKind); + loadAttribute("TANGENT", VertexBuffer.TangentKind); + loadAttribute("TEXCOORD_0", VertexBuffer.UVKind); + loadAttribute("TEXCOORD_1", VertexBuffer.UV2Kind); + loadAttribute("TEXCOORD_2", VertexBuffer.UV3Kind); + loadAttribute("TEXCOORD_3", VertexBuffer.UV4Kind); + loadAttribute("TEXCOORD_4", VertexBuffer.UV5Kind); + loadAttribute("TEXCOORD_5", VertexBuffer.UV6Kind); + loadAttribute("JOINTS_0", VertexBuffer.MatricesIndicesKind); + loadAttribute("WEIGHTS_0", VertexBuffer.MatricesWeightsKind); + loadAttribute("COLOR_0", VertexBuffer.ColorKind); + const bufferView = ArrayItem.Get(extensionContext, this._loader.gltf.bufferViews, extension.bufferView); + if (!bufferView._dracoBabylonGeometry) { + bufferView._dracoBabylonGeometry = this._loader.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView).then((data) => { + const dracoCompression3 = this.dracoCompression || DracoCompression.Default; + return dracoCompression3._decodeMeshToGeometryForGltfAsync(babylonMesh.name, this._loader.babylonScene, data, attributes, normalized).catch((error7) => { + throw new Error(`${context}: ${error7.message}`); + }); + }); + } + return bufferView._dracoBabylonGeometry; + }); + } +} +var NAME5; +var init_KHR_draco_mesh_compression = __esm(() => { + init_dracoCompression(); + init_buffer(); + init_glTFLoader2(); + NAME5 = "KHR_draco_mesh_compression"; + GLTFLoader2.RegisterExtension(NAME5, (loader) => new KHR_draco_mesh_compression(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_lights_punctual.js +class KHR_lights { + constructor(loader) { + this.name = NAME6; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME6); + } + dispose() { + this._loader = null; + delete this._lights; + } + onLoading() { + const extensions = this._loader.gltf.extensions; + if (extensions && extensions[this.name]) { + const extension = extensions[this.name]; + this._lights = extension.lights; + ArrayItem.Assign(this._lights); + } + } + loadNodeAsync(context, node30, assign) { + return GLTFLoader2.LoadExtensionAsync(context, node30, this.name, (extensionContext, extension) => { + this._loader._allMaterialsDirtyRequired = true; + return this._loader.loadNodeAsync(context, node30, (babylonMesh) => { + let babylonLight; + const light13 = ArrayItem.Get(extensionContext, this._lights, extension.light); + const name286 = light13.name || babylonMesh.name; + this._loader.babylonScene._blockEntityCollection = !!this._loader._assetContainer; + switch (light13.type) { + case "directional": { + const babylonDirectionalLight = new DirectionalLight(name286, Vector3.Backward(), this._loader.babylonScene); + babylonDirectionalLight.position.setAll(0); + babylonLight = babylonDirectionalLight; + break; + } + case "point": { + babylonLight = new PointLight(name286, Vector3.Zero(), this._loader.babylonScene); + break; + } + case "spot": { + const babylonSpotLight = new SpotLight(name286, Vector3.Zero(), Vector3.Backward(), 0, 1, this._loader.babylonScene); + babylonSpotLight.angle = (light13.spot && light13.spot.outerConeAngle || Math.PI / 4) * 2; + babylonSpotLight.innerAngle = (light13.spot && light13.spot.innerConeAngle || 0) * 2; + babylonLight = babylonSpotLight; + break; + } + default: { + this._loader.babylonScene._blockEntityCollection = false; + throw new Error(`${extensionContext}: Invalid light type (${light13.type})`); + } + } + babylonLight._parentContainer = this._loader._assetContainer; + this._loader.babylonScene._blockEntityCollection = false; + light13._babylonLight = babylonLight; + babylonLight.falloffType = Light.FALLOFF_GLTF; + babylonLight.diffuse = light13.color ? Color3.FromArray(light13.color) : Color3.White(); + babylonLight.intensity = light13.intensity == undefined ? 1 : light13.intensity; + babylonLight.range = light13.range == undefined ? Number.MAX_VALUE : light13.range; + babylonLight.parent = babylonMesh; + this._loader._babylonLights.push(babylonLight); + GLTFLoader2.AddPointerMetadata(babylonLight, extensionContext); + assign(babylonMesh); + }); + }); + } +} +var NAME6; +var init_KHR_lights_punctual = __esm(() => { + init_math_vector(); + init_math_color(); + init_directionalLight(); + init_pointLight(); + init_spotLight(); + init_light(); + init_glTFLoader2(); + NAME6 = "KHR_lights_punctual"; + GLTFLoader2.RegisterExtension(NAME6, (loader) => new KHR_lights(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +class KHR_materials_pbrSpecularGlossiness { + constructor(loader) { + this.name = NAME7; + this.order = 200; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME7); + } + dispose() { + this._loader = null; + } + loadMaterialPropertiesAsync(context, material30, babylonMaterial) { + return GLTFLoader2.LoadExtensionAsync(context, material30, this.name, (extensionContext, extension) => { + const promises = new Array; + promises.push(this._loader.loadMaterialBasePropertiesAsync(context, material30, babylonMaterial)); + promises.push(this._loadSpecularGlossinessPropertiesAsync(extensionContext, material30, extension, babylonMaterial)); + this._loader.loadMaterialAlphaProperties(context, material30, babylonMaterial); + return Promise.all(promises).then(() => { + }); + }); + } + _loadSpecularGlossinessPropertiesAsync(context, material30, properties, babylonMaterial) { + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${context}: Material type not supported`); + } + const promises = new Array; + babylonMaterial.metallic = null; + babylonMaterial.roughness = null; + if (properties.diffuseFactor) { + babylonMaterial.albedoColor = Color3.FromArray(properties.diffuseFactor); + babylonMaterial.alpha = properties.diffuseFactor[3]; + } else { + babylonMaterial.albedoColor = Color3.White(); + } + babylonMaterial.reflectivityColor = properties.specularFactor ? Color3.FromArray(properties.specularFactor) : Color3.White(); + babylonMaterial.microSurface = properties.glossinessFactor == undefined ? 1 : properties.glossinessFactor; + if (properties.diffuseTexture) { + promises.push(this._loader.loadTextureInfoAsync(`${context}/diffuseTexture`, properties.diffuseTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (Diffuse)`; + babylonMaterial.albedoTexture = texture87; + })); + } + if (properties.specularGlossinessTexture) { + promises.push(this._loader.loadTextureInfoAsync(`${context}/specularGlossinessTexture`, properties.specularGlossinessTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (Specular Glossiness)`; + babylonMaterial.reflectivityTexture = texture87; + babylonMaterial.reflectivityTexture.hasAlpha = true; + })); + babylonMaterial.useMicroSurfaceFromReflectivityMapAlpha = true; + } + return Promise.all(promises).then(() => { + }); + } +} +var NAME7; +var init_KHR_materials_pbrSpecularGlossiness = __esm(() => { + init_math_color(); + init_pbrMaterial(); + init_glTFLoader2(); + NAME7 = "KHR_materials_pbrSpecularGlossiness"; + GLTFLoader2.RegisterExtension(NAME7, (loader) => new KHR_materials_pbrSpecularGlossiness(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_unlit.js +class KHR_materials_unlit { + constructor(loader) { + this.name = NAME8; + this.order = 210; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME8); + } + dispose() { + this._loader = null; + } + loadMaterialPropertiesAsync(context, material30, babylonMaterial) { + return GLTFLoader2.LoadExtensionAsync(context, material30, this.name, () => { + return this._loadUnlitPropertiesAsync(context, material30, babylonMaterial); + }); + } + _loadUnlitPropertiesAsync(context, material30, babylonMaterial) { + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${context}: Material type not supported`); + } + const promises = new Array; + babylonMaterial.unlit = true; + const properties = material30.pbrMetallicRoughness; + if (properties) { + if (properties.baseColorFactor) { + babylonMaterial.albedoColor = Color3.FromArray(properties.baseColorFactor); + babylonMaterial.alpha = properties.baseColorFactor[3]; + } else { + babylonMaterial.albedoColor = Color3.White(); + } + if (properties.baseColorTexture) { + promises.push(this._loader.loadTextureInfoAsync(`${context}/baseColorTexture`, properties.baseColorTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (Base Color)`; + babylonMaterial.albedoTexture = texture87; + })); + } + } + if (material30.doubleSided) { + babylonMaterial.backFaceCulling = false; + babylonMaterial.twoSidedLighting = true; + } + this._loader.loadMaterialAlphaProperties(context, material30, babylonMaterial); + return Promise.all(promises).then(() => { + }); + } +} +var NAME8; +var init_KHR_materials_unlit = __esm(() => { + init_math_color(); + init_pbrMaterial(); + init_glTFLoader2(); + NAME8 = "KHR_materials_unlit"; + GLTFLoader2.RegisterExtension(NAME8, (loader) => new KHR_materials_unlit(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_clearcoat.js +class KHR_materials_clearcoat { + constructor(loader) { + this.name = NAME9; + this.order = 190; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME9); + } + dispose() { + this._loader = null; + } + loadMaterialPropertiesAsync(context, material30, babylonMaterial) { + return GLTFLoader2.LoadExtensionAsync(context, material30, this.name, (extensionContext, extension) => { + const promises = new Array; + promises.push(this._loader.loadMaterialPropertiesAsync(context, material30, babylonMaterial)); + promises.push(this._loadClearCoatPropertiesAsync(extensionContext, extension, babylonMaterial)); + return Promise.all(promises).then(() => { + }); + }); + } + _loadClearCoatPropertiesAsync(context, properties, babylonMaterial) { + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${context}: Material type not supported`); + } + const promises = new Array; + babylonMaterial.clearCoat.isEnabled = true; + babylonMaterial.clearCoat.useRoughnessFromMainTexture = false; + babylonMaterial.clearCoat.remapF0OnInterfaceChange = false; + if (properties.clearcoatFactor != null) { + babylonMaterial.clearCoat.intensity = properties.clearcoatFactor; + } else { + babylonMaterial.clearCoat.intensity = 0; + } + if (properties.clearcoatTexture) { + promises.push(this._loader.loadTextureInfoAsync(`${context}/clearcoatTexture`, properties.clearcoatTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (ClearCoat Intensity)`; + babylonMaterial.clearCoat.texture = texture87; + })); + } + if (properties.clearcoatRoughnessFactor != null) { + babylonMaterial.clearCoat.roughness = properties.clearcoatRoughnessFactor; + } else { + babylonMaterial.clearCoat.roughness = 0; + } + if (properties.clearcoatRoughnessTexture) { + properties.clearcoatRoughnessTexture.nonColorData = true; + promises.push(this._loader.loadTextureInfoAsync(`${context}/clearcoatRoughnessTexture`, properties.clearcoatRoughnessTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (ClearCoat Roughness)`; + babylonMaterial.clearCoat.textureRoughness = texture87; + })); + } + if (properties.clearcoatNormalTexture) { + properties.clearcoatNormalTexture.nonColorData = true; + promises.push(this._loader.loadTextureInfoAsync(`${context}/clearcoatNormalTexture`, properties.clearcoatNormalTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (ClearCoat Normal)`; + babylonMaterial.clearCoat.bumpTexture = texture87; + })); + babylonMaterial.invertNormalMapX = !babylonMaterial.getScene().useRightHandedSystem; + babylonMaterial.invertNormalMapY = babylonMaterial.getScene().useRightHandedSystem; + if (properties.clearcoatNormalTexture.scale != null) { + babylonMaterial.clearCoat.bumpTexture.level = properties.clearcoatNormalTexture.scale; + } + } + return Promise.all(promises).then(() => { + }); + } +} +var NAME9; +var init_KHR_materials_clearcoat = __esm(() => { + init_pbrMaterial(); + init_glTFLoader2(); + NAME9 = "KHR_materials_clearcoat"; + GLTFLoader2.RegisterExtension(NAME9, (loader) => new KHR_materials_clearcoat(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_iridescence.js +class KHR_materials_iridescence { + constructor(loader) { + this.name = NAME10; + this.order = 195; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME10); + } + dispose() { + this._loader = null; + } + loadMaterialPropertiesAsync(context, material30, babylonMaterial) { + return GLTFLoader2.LoadExtensionAsync(context, material30, this.name, (extensionContext, extension) => { + const promises = new Array; + promises.push(this._loader.loadMaterialPropertiesAsync(context, material30, babylonMaterial)); + promises.push(this._loadIridescencePropertiesAsync(extensionContext, extension, babylonMaterial)); + return Promise.all(promises).then(() => { + }); + }); + } + _loadIridescencePropertiesAsync(context, properties, babylonMaterial) { + var _a, _b, _c, _d, _e; + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${context}: Material type not supported`); + } + const promises = new Array; + babylonMaterial.iridescence.isEnabled = true; + babylonMaterial.iridescence.intensity = (_a = properties.iridescenceFactor) !== null && _a !== undefined ? _a : 0; + babylonMaterial.iridescence.indexOfRefraction = (_c = (_b = properties.iridescenceIor) !== null && _b !== undefined ? _b : properties.iridescenceIOR) !== null && _c !== undefined ? _c : 1.3; + babylonMaterial.iridescence.minimumThickness = (_d = properties.iridescenceThicknessMinimum) !== null && _d !== undefined ? _d : 100; + babylonMaterial.iridescence.maximumThickness = (_e = properties.iridescenceThicknessMaximum) !== null && _e !== undefined ? _e : 400; + if (properties.iridescenceTexture) { + promises.push(this._loader.loadTextureInfoAsync(`${context}/iridescenceTexture`, properties.iridescenceTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (Iridescence Intensity)`; + babylonMaterial.iridescence.texture = texture87; + })); + } + if (properties.iridescenceThicknessTexture) { + promises.push(this._loader.loadTextureInfoAsync(`${context}/iridescenceThicknessTexture`, properties.iridescenceThicknessTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (Iridescence Thickness)`; + babylonMaterial.iridescence.thicknessTexture = texture87; + })); + } + return Promise.all(promises).then(() => { + }); + } +} +var NAME10; +var init_KHR_materials_iridescence = __esm(() => { + init_pbrMaterial(); + init_glTFLoader2(); + NAME10 = "KHR_materials_iridescence"; + GLTFLoader2.RegisterExtension(NAME10, (loader) => new KHR_materials_iridescence(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_anisotropy.js +class KHR_materials_anisotropy { + constructor(loader) { + this.name = NAME11; + this.order = 195; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME11); + } + dispose() { + this._loader = null; + } + loadMaterialPropertiesAsync(context, material30, babylonMaterial) { + return GLTFLoader2.LoadExtensionAsync(context, material30, this.name, (extensionContext, extension) => { + const promises = new Array; + promises.push(this._loader.loadMaterialPropertiesAsync(context, material30, babylonMaterial)); + promises.push(this._loadIridescencePropertiesAsync(extensionContext, extension, babylonMaterial)); + return Promise.all(promises).then(() => { + }); + }); + } + _loadIridescencePropertiesAsync(context, properties, babylonMaterial) { + var _a, _b; + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${context}: Material type not supported`); + } + const promises = new Array; + babylonMaterial.anisotropy.isEnabled = true; + babylonMaterial.anisotropy.intensity = (_a = properties.anisotropyStrength) !== null && _a !== undefined ? _a : 0; + babylonMaterial.anisotropy.angle = (_b = properties.anisotropyRotation) !== null && _b !== undefined ? _b : 0; + if (properties.anisotropyTexture) { + promises.push(this._loader.loadTextureInfoAsync(`${context}/anisotropyTexture`, properties.anisotropyTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (Anisotropy Intensity)`; + babylonMaterial.anisotropy.texture = texture87; + })); + } + return Promise.all(promises).then(() => { + }); + } +} +var NAME11; +var init_KHR_materials_anisotropy = __esm(() => { + init_pbrMaterial(); + init_glTFLoader2(); + NAME11 = "KHR_materials_anisotropy"; + GLTFLoader2.RegisterExtension(NAME11, (loader) => new KHR_materials_anisotropy(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +class KHR_materials_emissive_strength { + constructor(loader) { + this.name = NAME12; + this.order = 170; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME12); + } + dispose() { + this._loader = null; + } + loadMaterialPropertiesAsync(context, material30, babylonMaterial) { + return GLTFLoader2.LoadExtensionAsync(context, material30, this.name, (extensionContext, extension) => { + return this._loader.loadMaterialPropertiesAsync(context, material30, babylonMaterial).then(() => { + this._loadEmissiveProperties(extensionContext, extension, babylonMaterial); + }); + }); + } + _loadEmissiveProperties(context, properties, babylonMaterial) { + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${context}: Material type not supported`); + } + if (properties.emissiveStrength !== undefined) { + babylonMaterial.emissiveColor.scaleToRef(properties.emissiveStrength, babylonMaterial.emissiveColor); + } + } +} +var NAME12; +var init_KHR_materials_emissive_strength = __esm(() => { + init_pbrMaterial(); + init_glTFLoader2(); + NAME12 = "KHR_materials_emissive_strength"; + GLTFLoader2.RegisterExtension(NAME12, (loader) => new KHR_materials_emissive_strength(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_sheen.js +class KHR_materials_sheen { + constructor(loader) { + this.name = NAME13; + this.order = 190; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME13); + } + dispose() { + this._loader = null; + } + loadMaterialPropertiesAsync(context, material30, babylonMaterial) { + return GLTFLoader2.LoadExtensionAsync(context, material30, this.name, (extensionContext, extension) => { + const promises = new Array; + promises.push(this._loader.loadMaterialPropertiesAsync(context, material30, babylonMaterial)); + promises.push(this._loadSheenPropertiesAsync(extensionContext, extension, babylonMaterial)); + return Promise.all(promises).then(() => { + }); + }); + } + _loadSheenPropertiesAsync(context, properties, babylonMaterial) { + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${context}: Material type not supported`); + } + const promises = new Array; + babylonMaterial.sheen.isEnabled = true; + babylonMaterial.sheen.intensity = 1; + if (properties.sheenColorFactor != null) { + babylonMaterial.sheen.color = Color3.FromArray(properties.sheenColorFactor); + } else { + babylonMaterial.sheen.color = Color3.Black(); + } + if (properties.sheenColorTexture) { + promises.push(this._loader.loadTextureInfoAsync(`${context}/sheenColorTexture`, properties.sheenColorTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (Sheen Color)`; + babylonMaterial.sheen.texture = texture87; + })); + } + if (properties.sheenRoughnessFactor !== undefined) { + babylonMaterial.sheen.roughness = properties.sheenRoughnessFactor; + } else { + babylonMaterial.sheen.roughness = 0; + } + if (properties.sheenRoughnessTexture) { + properties.sheenRoughnessTexture.nonColorData = true; + promises.push(this._loader.loadTextureInfoAsync(`${context}/sheenRoughnessTexture`, properties.sheenRoughnessTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (Sheen Roughness)`; + babylonMaterial.sheen.textureRoughness = texture87; + })); + } + babylonMaterial.sheen.albedoScaling = true; + babylonMaterial.sheen.useRoughnessFromMainTexture = false; + return Promise.all(promises).then(() => { + }); + } +} +var NAME13; +var init_KHR_materials_sheen = __esm(() => { + init_pbrMaterial(); + init_glTFLoader2(); + init_math_color(); + NAME13 = "KHR_materials_sheen"; + GLTFLoader2.RegisterExtension(NAME13, (loader) => new KHR_materials_sheen(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_specular.js +class KHR_materials_specular { + constructor(loader) { + this.name = NAME14; + this.order = 190; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME14); + } + dispose() { + this._loader = null; + } + loadMaterialPropertiesAsync(context, material30, babylonMaterial) { + return GLTFLoader2.LoadExtensionAsync(context, material30, this.name, (extensionContext, extension) => { + const promises = new Array; + promises.push(this._loader.loadMaterialPropertiesAsync(context, material30, babylonMaterial)); + promises.push(this._loadSpecularPropertiesAsync(extensionContext, extension, babylonMaterial)); + return Promise.all(promises).then(() => { + }); + }); + } + _loadSpecularPropertiesAsync(context, properties, babylonMaterial) { + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${context}: Material type not supported`); + } + const promises = new Array; + if (properties.specularFactor !== undefined) { + babylonMaterial.metallicF0Factor = properties.specularFactor; + } + if (properties.specularColorFactor !== undefined) { + babylonMaterial.metallicReflectanceColor = Color3.FromArray(properties.specularColorFactor); + } + if (properties.specularTexture) { + properties.specularTexture.nonColorData = true; + promises.push(this._loader.loadTextureInfoAsync(`${context}/specularTexture`, properties.specularTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (Specular F0 Strength)`; + babylonMaterial.metallicReflectanceTexture = texture87; + babylonMaterial.useOnlyMetallicFromMetallicReflectanceTexture = true; + })); + } + if (properties.specularColorTexture) { + promises.push(this._loader.loadTextureInfoAsync(`${context}/specularColorTexture`, properties.specularColorTexture, (texture87) => { + texture87.name = `${babylonMaterial.name} (Specular F0 Color)`; + babylonMaterial.reflectanceTexture = texture87; + })); + } + return Promise.all(promises).then(() => { + }); + } +} +var NAME14; +var init_KHR_materials_specular = __esm(() => { + init_pbrMaterial(); + init_glTFLoader2(); + init_math_color(); + NAME14 = "KHR_materials_specular"; + GLTFLoader2.RegisterExtension(NAME14, (loader) => new KHR_materials_specular(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_ior.js +class KHR_materials_ior { + constructor(loader) { + this.name = NAME15; + this.order = 180; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME15); + } + dispose() { + this._loader = null; + } + loadMaterialPropertiesAsync(context, material30, babylonMaterial) { + return GLTFLoader2.LoadExtensionAsync(context, material30, this.name, (extensionContext, extension) => { + const promises = new Array; + promises.push(this._loader.loadMaterialPropertiesAsync(context, material30, babylonMaterial)); + promises.push(this._loadIorPropertiesAsync(extensionContext, extension, babylonMaterial)); + return Promise.all(promises).then(() => { + }); + }); + } + _loadIorPropertiesAsync(context, properties, babylonMaterial) { + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${context}: Material type not supported`); + } + if (properties.ior !== undefined) { + babylonMaterial.indexOfRefraction = properties.ior; + } else { + babylonMaterial.indexOfRefraction = KHR_materials_ior._DEFAULT_IOR; + } + return Promise.resolve(); + } +} +var NAME15; +var init_KHR_materials_ior = __esm(() => { + init_pbrMaterial(); + init_glTFLoader2(); + NAME15 = "KHR_materials_ior"; + KHR_materials_ior._DEFAULT_IOR = 1.5; + GLTFLoader2.RegisterExtension(NAME15, (loader) => new KHR_materials_ior(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_variants.js +class KHR_materials_variants { + constructor(loader) { + this.name = NAME16; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME16); + } + dispose() { + this._loader = null; + } + static GetAvailableVariants(rootMesh) { + const extensionMetadata = this._GetExtensionMetadata(rootMesh); + if (!extensionMetadata) { + return []; + } + return Object.keys(extensionMetadata.variants); + } + getAvailableVariants(rootMesh) { + return KHR_materials_variants.GetAvailableVariants(rootMesh); + } + static SelectVariant(rootMesh, variantName) { + const extensionMetadata = this._GetExtensionMetadata(rootMesh); + if (!extensionMetadata) { + throw new Error(`Cannot select variant on a glTF mesh that does not have the ${NAME16} extension`); + } + const select = (variantName2) => { + const entries = extensionMetadata.variants[variantName2]; + if (entries) { + for (const entry of entries) { + entry.mesh.material = entry.material; + } + } + }; + if (variantName instanceof Array) { + for (const name286 of variantName) { + select(name286); + } + } else { + select(variantName); + } + extensionMetadata.lastSelected = variantName; + } + selectVariant(rootMesh, variantName) { + return KHR_materials_variants.SelectVariant(rootMesh, variantName); + } + static Reset(rootMesh) { + const extensionMetadata = this._GetExtensionMetadata(rootMesh); + if (!extensionMetadata) { + throw new Error(`Cannot reset on a glTF mesh that does not have the ${NAME16} extension`); + } + for (const entry of extensionMetadata.original) { + entry.mesh.material = entry.material; + } + extensionMetadata.lastSelected = null; + } + reset(rootMesh) { + return KHR_materials_variants.Reset(rootMesh); + } + static GetLastSelectedVariant(rootMesh) { + const extensionMetadata = this._GetExtensionMetadata(rootMesh); + if (!extensionMetadata) { + throw new Error(`Cannot get the last selected variant on a glTF mesh that does not have the ${NAME16} extension`); + } + return extensionMetadata.lastSelected; + } + getLastSelectedVariant(rootMesh) { + return KHR_materials_variants.GetLastSelectedVariant(rootMesh); + } + static _GetExtensionMetadata(rootMesh) { + var _a, _b; + return ((_b = (_a = rootMesh === null || rootMesh === undefined ? undefined : rootMesh._internalMetadata) === null || _a === undefined ? undefined : _a.gltf) === null || _b === undefined ? undefined : _b[NAME16]) || null; + } + onLoading() { + const extensions = this._loader.gltf.extensions; + if (extensions && extensions[this.name]) { + const extension = extensions[this.name]; + this._variants = extension.variants; + } + } + _loadMeshPrimitiveAsync(context, name286, node30, mesh80, primitive, assign) { + return GLTFLoader2.LoadExtensionAsync(context, primitive, this.name, (extensionContext, extension) => { + const promises = new Array; + promises.push(this._loader._loadMeshPrimitiveAsync(context, name286, node30, mesh80, primitive, (babylonMesh) => { + assign(babylonMesh); + if (babylonMesh instanceof Mesh) { + const babylonDrawMode = GLTFLoader2._GetDrawMode(context, primitive.mode); + const root = this._loader.rootBabylonMesh; + const metadata = root ? root._internalMetadata = root._internalMetadata || {} : {}; + const gltf = metadata.gltf = metadata.gltf || {}; + const extensionMetadata = gltf[NAME16] = gltf[NAME16] || { lastSelected: null, original: [], variants: {} }; + extensionMetadata.original.push({ mesh: babylonMesh, material: babylonMesh.material }); + for (let mappingIndex = 0;mappingIndex < extension.mappings.length; ++mappingIndex) { + const mapping = extension.mappings[mappingIndex]; + const material30 = ArrayItem.Get(`${extensionContext}/mappings/${mappingIndex}/material`, this._loader.gltf.materials, mapping.material); + promises.push(this._loader._loadMaterialAsync(`#/materials/${mapping.material}`, material30, babylonMesh, babylonDrawMode, (babylonMaterial) => { + for (let mappingVariantIndex = 0;mappingVariantIndex < mapping.variants.length; ++mappingVariantIndex) { + const variantIndex = mapping.variants[mappingVariantIndex]; + const variant = ArrayItem.Get(`/extensions/${NAME16}/variants/${variantIndex}`, this._variants, variantIndex); + extensionMetadata.variants[variant.name] = extensionMetadata.variants[variant.name] || []; + extensionMetadata.variants[variant.name].push({ + mesh: babylonMesh, + material: babylonMaterial + }); + babylonMesh.onClonedObservable.add((newOne) => { + const newMesh = newOne; + let metadata2 = null; + let newRoot = newMesh; + do { + newRoot = newRoot.parent; + if (!newRoot) { + return; + } + metadata2 = KHR_materials_variants._GetExtensionMetadata(newRoot); + } while (metadata2 === null); + if (root && metadata2 === KHR_materials_variants._GetExtensionMetadata(root)) { + newRoot._internalMetadata = {}; + for (const key in root._internalMetadata) { + newRoot._internalMetadata[key] = root._internalMetadata[key]; + } + newRoot._internalMetadata.gltf = []; + for (const key in root._internalMetadata.gltf) { + newRoot._internalMetadata.gltf[key] = root._internalMetadata.gltf[key]; + } + newRoot._internalMetadata.gltf[NAME16] = { lastSelected: null, original: [], variants: {} }; + for (const original of metadata2.original) { + newRoot._internalMetadata.gltf[NAME16].original.push({ + mesh: original.mesh, + material: original.material + }); + } + for (const key in metadata2.variants) { + if (Object.prototype.hasOwnProperty.call(metadata2.variants, key)) { + newRoot._internalMetadata.gltf[NAME16].variants[key] = []; + for (const variantEntry of metadata2.variants[key]) { + newRoot._internalMetadata.gltf[NAME16].variants[key].push({ + mesh: variantEntry.mesh, + material: variantEntry.material + }); + } + } + } + metadata2 = newRoot._internalMetadata.gltf[NAME16]; + } + for (const target of metadata2.original) { + if (target.mesh === babylonMesh) { + target.mesh = newMesh; + } + } + for (const target of metadata2.variants[variant.name]) { + if (target.mesh === babylonMesh) { + target.mesh = newMesh; + } + } + }); + } + })); + } + } + })); + return Promise.all(promises).then(([babylonMesh]) => { + return babylonMesh; + }); + }); + } +} +var NAME16; +var init_KHR_materials_variants = __esm(() => { + init_glTFLoader2(); + init_mesh(); + NAME16 = "KHR_materials_variants"; + GLTFLoader2.RegisterExtension(NAME16, (loader) => new KHR_materials_variants(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_transmission.js +class TransmissionHelper { + static _GetDefaultOptions() { + return { + renderSize: 1024, + samples: 4, + lodGenerationScale: 1, + lodGenerationOffset: -4, + renderTargetTextureType: Constants.TEXTURETYPE_HALF_FLOAT, + generateMipmaps: true + }; + } + constructor(options, scene37) { + this._opaqueRenderTarget = null; + this._opaqueMeshesCache = []; + this._transparentMeshesCache = []; + this._materialObservers = {}; + this._options = { + ...TransmissionHelper._GetDefaultOptions(), + ...options + }; + this._scene = scene37; + this._scene._transmissionHelper = this; + this.onErrorObservable = new Observable; + this._scene.onDisposeObservable.addOnce(() => { + this.dispose(); + }); + this._parseScene(); + this._setupRenderTargets(); + } + updateOptions(options) { + const newValues = Object.keys(options).filter((key) => this._options[key] !== options[key]); + if (!newValues.length) { + return; + } + const newOptions = { + ...this._options, + ...options + }; + const oldOptions = this._options; + this._options = newOptions; + if (newOptions.renderSize !== oldOptions.renderSize || newOptions.renderTargetTextureType !== oldOptions.renderTargetTextureType || newOptions.generateMipmaps !== oldOptions.generateMipmaps || !this._opaqueRenderTarget) { + this._setupRenderTargets(); + } else { + this._opaqueRenderTarget.samples = newOptions.samples; + this._opaqueRenderTarget.lodGenerationScale = newOptions.lodGenerationScale; + this._opaqueRenderTarget.lodGenerationOffset = newOptions.lodGenerationOffset; + } + } + getOpaqueTarget() { + return this._opaqueRenderTarget; + } + _shouldRenderAsTransmission(material30) { + if (!material30) { + return false; + } + if (material30 instanceof PBRMaterial && material30.subSurface.isRefractionEnabled) { + return true; + } + return false; + } + _addMesh(mesh80) { + this._materialObservers[mesh80.uniqueId] = mesh80.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this)); + Tools.SetImmediate(() => { + if (this._shouldRenderAsTransmission(mesh80.material)) { + mesh80.material.refractionTexture = this._opaqueRenderTarget; + if (this._transparentMeshesCache.indexOf(mesh80) === -1) { + this._transparentMeshesCache.push(mesh80); + } + } else { + if (this._opaqueMeshesCache.indexOf(mesh80) === -1) { + this._opaqueMeshesCache.push(mesh80); + } + } + }); + } + _removeMesh(mesh80) { + mesh80.onMaterialChangedObservable.remove(this._materialObservers[mesh80.uniqueId]); + delete this._materialObservers[mesh80.uniqueId]; + let idx = this._transparentMeshesCache.indexOf(mesh80); + if (idx !== -1) { + this._transparentMeshesCache.splice(idx, 1); + } + idx = this._opaqueMeshesCache.indexOf(mesh80); + if (idx !== -1) { + this._opaqueMeshesCache.splice(idx, 1); + } + } + _parseScene() { + this._scene.meshes.forEach(this._addMesh.bind(this)); + this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this)); + this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this)); + } + _onMeshMaterialChanged(mesh80) { + const transparentIdx = this._transparentMeshesCache.indexOf(mesh80); + const opaqueIdx = this._opaqueMeshesCache.indexOf(mesh80); + const useTransmission = this._shouldRenderAsTransmission(mesh80.material); + if (useTransmission) { + if (mesh80.material instanceof PBRMaterial) { + mesh80.material.subSurface.refractionTexture = this._opaqueRenderTarget; + } + if (opaqueIdx !== -1) { + this._opaqueMeshesCache.splice(opaqueIdx, 1); + this._transparentMeshesCache.push(mesh80); + } else if (transparentIdx === -1) { + this._transparentMeshesCache.push(mesh80); + } + } else { + if (transparentIdx !== -1) { + this._transparentMeshesCache.splice(transparentIdx, 1); + this._opaqueMeshesCache.push(mesh80); + } else if (opaqueIdx === -1) { + this._opaqueMeshesCache.push(mesh80); + } + } + } + _isRenderTargetValid() { + var _a; + return ((_a = this._opaqueRenderTarget) === null || _a === undefined ? undefined : _a.getInternalTexture()) !== null; + } + _setupRenderTargets() { + var _a, _b; + if (this._opaqueRenderTarget) { + this._opaqueRenderTarget.dispose(); + } + this._opaqueRenderTarget = new RenderTargetTexture("opaqueSceneTexture", this._options.renderSize, this._scene, this._options.generateMipmaps, undefined, this._options.renderTargetTextureType); + this._opaqueRenderTarget.ignoreCameraViewport = true; + this._opaqueRenderTarget.renderList = this._opaqueMeshesCache; + this._opaqueRenderTarget.clearColor = (_b = (_a = this._options.clearColor) === null || _a === undefined ? undefined : _a.clone()) !== null && _b !== undefined ? _b : this._scene.clearColor.clone(); + this._opaqueRenderTarget.gammaSpace = false; + this._opaqueRenderTarget.lodGenerationScale = this._options.lodGenerationScale; + this._opaqueRenderTarget.lodGenerationOffset = this._options.lodGenerationOffset; + this._opaqueRenderTarget.samples = this._options.samples; + this._opaqueRenderTarget.renderSprites = true; + this._opaqueRenderTarget.renderParticles = true; + let sceneImageProcessingapplyByPostProcess; + let saveSceneEnvIntensity; + this._opaqueRenderTarget.onBeforeBindObservable.add((opaqueRenderTarget) => { + saveSceneEnvIntensity = this._scene.environmentIntensity; + this._scene.environmentIntensity = 1; + sceneImageProcessingapplyByPostProcess = this._scene.imageProcessingConfiguration.applyByPostProcess; + if (!this._options.clearColor) { + this._scene.clearColor.toLinearSpaceToRef(opaqueRenderTarget.clearColor, this._scene.getEngine().useExactSrgbConversions); + } else { + opaqueRenderTarget.clearColor.copyFrom(this._options.clearColor); + } + this._scene.imageProcessingConfiguration._applyByPostProcess = true; + }); + this._opaqueRenderTarget.onAfterUnbindObservable.add(() => { + this._scene.environmentIntensity = saveSceneEnvIntensity; + this._scene.imageProcessingConfiguration._applyByPostProcess = sceneImageProcessingapplyByPostProcess; + }); + this._transparentMeshesCache.forEach((mesh80) => { + if (this._shouldRenderAsTransmission(mesh80.material)) { + mesh80.material.refractionTexture = this._opaqueRenderTarget; + } + }); + } + dispose() { + this._scene._transmissionHelper = undefined; + if (this._opaqueRenderTarget) { + this._opaqueRenderTarget.dispose(); + this._opaqueRenderTarget = null; + } + this._transparentMeshesCache = []; + this._opaqueMeshesCache = []; + } +} + +class KHR_materials_transmission { + constructor(loader) { + this.name = NAME17; + this.order = 175; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME17); + if (this.enabled) { + loader.parent.transparencyAsCoverage = true; + } + } + dispose() { + this._loader = null; + } + loadMaterialPropertiesAsync(context, material30, babylonMaterial) { + return GLTFLoader2.LoadExtensionAsync(context, material30, this.name, (extensionContext, extension) => { + const promises = new Array; + promises.push(this._loader.loadMaterialBasePropertiesAsync(context, material30, babylonMaterial)); + promises.push(this._loader.loadMaterialPropertiesAsync(context, material30, babylonMaterial)); + promises.push(this._loadTransparentPropertiesAsync(extensionContext, material30, babylonMaterial, extension)); + return Promise.all(promises).then(() => { + }); + }); + } + _loadTransparentPropertiesAsync(context, material30, babylonMaterial, extension) { + var _a, _b; + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${context}: Material type not supported`); + } + const pbrMaterial15 = babylonMaterial; + pbrMaterial15.subSurface.isRefractionEnabled = true; + pbrMaterial15.subSurface.volumeIndexOfRefraction = 1; + pbrMaterial15.subSurface.useAlbedoToTintRefraction = true; + if (extension.transmissionFactor !== undefined) { + pbrMaterial15.subSurface.refractionIntensity = extension.transmissionFactor; + const scene37 = pbrMaterial15.getScene(); + if (pbrMaterial15.subSurface.refractionIntensity && !scene37._transmissionHelper) { + new TransmissionHelper({}, pbrMaterial15.getScene()); + } else if (pbrMaterial15.subSurface.refractionIntensity && !((_a = scene37._transmissionHelper) === null || _a === undefined ? undefined : _a._isRenderTargetValid())) { + (_b = scene37._transmissionHelper) === null || _b === undefined || _b._setupRenderTargets(); + } + } else { + pbrMaterial15.subSurface.refractionIntensity = 0; + pbrMaterial15.subSurface.isRefractionEnabled = false; + return Promise.resolve(); + } + pbrMaterial15.subSurface.minimumThickness = 0; + pbrMaterial15.subSurface.maximumThickness = 0; + if (extension.transmissionTexture) { + extension.transmissionTexture.nonColorData = true; + return this._loader.loadTextureInfoAsync(`${context}/transmissionTexture`, extension.transmissionTexture, undefined).then((texture87) => { + pbrMaterial15.subSurface.refractionIntensityTexture = texture87; + pbrMaterial15.subSurface.useGltfStyleTextures = true; + }); + } else { + return Promise.resolve(); + } + } +} +var NAME17; +var init_KHR_materials_transmission = __esm(() => { + init_pbrMaterial(); + init_glTFLoader2(); + init_renderTargetTexture(); + init_observable(); + init_constants(); + init_tools(); + NAME17 = "KHR_materials_transmission"; + GLTFLoader2.RegisterExtension(NAME17, (loader) => new KHR_materials_transmission(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_translucency.js +class KHR_materials_translucency { + constructor(loader) { + this.name = NAME18; + this.order = 174; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME18); + if (this.enabled) { + loader.parent.transparencyAsCoverage = true; + } + } + dispose() { + this._loader = null; + } + loadMaterialPropertiesAsync(context, material30, babylonMaterial) { + return GLTFLoader2.LoadExtensionAsync(context, material30, this.name, (extensionContext, extension) => { + const promises = new Array; + promises.push(this._loader.loadMaterialBasePropertiesAsync(context, material30, babylonMaterial)); + promises.push(this._loader.loadMaterialPropertiesAsync(context, material30, babylonMaterial)); + promises.push(this._loadTranslucentPropertiesAsync(extensionContext, material30, babylonMaterial, extension)); + return Promise.all(promises).then(() => { + }); + }); + } + _loadTranslucentPropertiesAsync(context, material30, babylonMaterial, extension) { + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${context}: Material type not supported`); + } + const pbrMaterial16 = babylonMaterial; + pbrMaterial16.subSurface.isTranslucencyEnabled = true; + pbrMaterial16.subSurface.volumeIndexOfRefraction = 1; + pbrMaterial16.subSurface.minimumThickness = 0; + pbrMaterial16.subSurface.maximumThickness = 0; + pbrMaterial16.subSurface.useAlbedoToTintTranslucency = true; + if (extension.translucencyFactor !== undefined) { + pbrMaterial16.subSurface.translucencyIntensity = extension.translucencyFactor; + } else { + pbrMaterial16.subSurface.translucencyIntensity = 0; + pbrMaterial16.subSurface.isTranslucencyEnabled = false; + return Promise.resolve(); + } + if (extension.translucencyTexture) { + extension.translucencyTexture.nonColorData = true; + return this._loader.loadTextureInfoAsync(`${context}/translucencyTexture`, extension.translucencyTexture).then((texture87) => { + pbrMaterial16.subSurface.translucencyIntensityTexture = texture87; + }); + } else { + return Promise.resolve(); + } + } +} +var NAME18; +var init_KHR_materials_translucency = __esm(() => { + init_pbrMaterial(); + init_glTFLoader2(); + NAME18 = "KHR_materials_translucency"; + GLTFLoader2.RegisterExtension(NAME18, (loader) => new KHR_materials_translucency(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_volume.js +class KHR_materials_volume { + constructor(loader) { + this.name = NAME19; + this.order = 173; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME19); + if (this.enabled) { + this._loader._disableInstancedMesh++; + } + } + dispose() { + if (this.enabled) { + this._loader._disableInstancedMesh--; + } + this._loader = null; + } + loadMaterialPropertiesAsync(context, material30, babylonMaterial) { + return GLTFLoader2.LoadExtensionAsync(context, material30, this.name, (extensionContext, extension) => { + const promises = new Array; + promises.push(this._loader.loadMaterialBasePropertiesAsync(context, material30, babylonMaterial)); + promises.push(this._loader.loadMaterialPropertiesAsync(context, material30, babylonMaterial)); + promises.push(this._loadVolumePropertiesAsync(extensionContext, material30, babylonMaterial, extension)); + return Promise.all(promises).then(() => { + }); + }); + } + _loadVolumePropertiesAsync(context, material30, babylonMaterial, extension) { + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${context}: Material type not supported`); + } + if (!babylonMaterial.subSurface.isRefractionEnabled && !babylonMaterial.subSurface.isTranslucencyEnabled || !extension.thicknessFactor) { + return Promise.resolve(); + } + babylonMaterial.subSurface.volumeIndexOfRefraction = babylonMaterial.indexOfRefraction; + const attenuationDistance = extension.attenuationDistance !== undefined ? extension.attenuationDistance : Number.MAX_VALUE; + babylonMaterial.subSurface.tintColorAtDistance = attenuationDistance; + if (extension.attenuationColor !== undefined && extension.attenuationColor.length == 3) { + babylonMaterial.subSurface.tintColor.copyFromFloats(extension.attenuationColor[0], extension.attenuationColor[1], extension.attenuationColor[2]); + } + babylonMaterial.subSurface.minimumThickness = 0; + babylonMaterial.subSurface.maximumThickness = extension.thicknessFactor; + babylonMaterial.subSurface.useThicknessAsDepth = true; + if (extension.thicknessTexture) { + extension.thicknessTexture.nonColorData = true; + return this._loader.loadTextureInfoAsync(`${context}/thicknessTexture`, extension.thicknessTexture).then((texture87) => { + babylonMaterial.subSurface.thicknessTexture = texture87; + babylonMaterial.subSurface.useGltfStyleTextures = true; + }); + } else { + return Promise.resolve(); + } + } +} +var NAME19; +var init_KHR_materials_volume = __esm(() => { + init_pbrMaterial(); + init_glTFLoader2(); + NAME19 = "KHR_materials_volume"; + GLTFLoader2.RegisterExtension(NAME19, (loader) => new KHR_materials_volume(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_dispersion.js +class KHR_materials_dispersion { + constructor(loader) { + this.name = NAME20; + this.order = 174; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME20); + } + dispose() { + this._loader = null; + } + loadMaterialPropertiesAsync(context, material30, babylonMaterial) { + return GLTFLoader2.LoadExtensionAsync(context, material30, this.name, (extensionContext, extension) => { + const promises = new Array; + promises.push(this._loader.loadMaterialBasePropertiesAsync(context, material30, babylonMaterial)); + promises.push(this._loader.loadMaterialPropertiesAsync(context, material30, babylonMaterial)); + promises.push(this._loadDispersionPropertiesAsync(extensionContext, material30, babylonMaterial, extension)); + return Promise.all(promises).then(() => { + }); + }); + } + _loadDispersionPropertiesAsync(context, material30, babylonMaterial, extension) { + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${context}: Material type not supported`); + } + if (!babylonMaterial.subSurface.isRefractionEnabled || !extension.dispersion) { + return Promise.resolve(); + } + babylonMaterial.subSurface.isDispersionEnabled = true; + babylonMaterial.subSurface.dispersion = extension.dispersion; + return Promise.resolve(); + } +} +var NAME20; +var init_KHR_materials_dispersion = __esm(() => { + init_pbrMaterial(); + init_glTFLoader2(); + NAME20 = "KHR_materials_dispersion"; + GLTFLoader2.RegisterExtension(NAME20, (loader) => new KHR_materials_dispersion(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_mesh_quantization.js +class KHR_mesh_quantization { + constructor(loader) { + this.name = NAME21; + this.enabled = loader.isExtensionUsed(NAME21); + } + dispose() { + } +} +var NAME21; +var init_KHR_mesh_quantization = __esm(() => { + init_glTFLoader2(); + NAME21 = "KHR_mesh_quantization"; + GLTFLoader2.RegisterExtension(NAME21, (loader) => new KHR_mesh_quantization(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_texture_basisu.js +class KHR_texture_basisu { + constructor(loader) { + this.name = NAME22; + this._loader = loader; + this.enabled = loader.isExtensionUsed(NAME22); + } + dispose() { + this._loader = null; + } + _loadTextureAsync(context, texture87, assign) { + return GLTFLoader2.LoadExtensionAsync(context, texture87, this.name, (extensionContext, extension) => { + const sampler = texture87.sampler == undefined ? GLTFLoader2.DefaultSampler : ArrayItem.Get(`${context}/sampler`, this._loader.gltf.samplers, texture87.sampler); + const image7 = ArrayItem.Get(`${extensionContext}/source`, this._loader.gltf.images, extension.source); + return this._loader._createTextureAsync(context, sampler, image7, (babylonTexture) => { + assign(babylonTexture); + }, texture87._textureInfo.nonColorData ? { useRGBAIfASTCBC7NotAvailableWhenUASTC: true } : undefined, !texture87._textureInfo.nonColorData); + }); + } +} +var NAME22; +var init_KHR_texture_basisu = __esm(() => { + init_glTFLoader2(); + NAME22 = "KHR_texture_basisu"; + GLTFLoader2.RegisterExtension(NAME22, (loader) => new KHR_texture_basisu(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_texture_transform.js +class KHR_texture_transform { + constructor(loader) { + this.name = NAME23; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME23); + } + dispose() { + this._loader = null; + } + loadTextureInfoAsync(context, textureInfo, assign) { + return GLTFLoader2.LoadExtensionAsync(context, textureInfo, this.name, (extensionContext, extension) => { + return this._loader.loadTextureInfoAsync(context, textureInfo, (babylonTexture) => { + if (!(babylonTexture instanceof Texture)) { + throw new Error(`${extensionContext}: Texture type not supported`); + } + if (extension.offset) { + babylonTexture.uOffset = extension.offset[0]; + babylonTexture.vOffset = extension.offset[1]; + } + babylonTexture.uRotationCenter = 0; + babylonTexture.vRotationCenter = 0; + if (extension.rotation) { + babylonTexture.wAng = -extension.rotation; + } + if (extension.scale) { + babylonTexture.uScale = extension.scale[0]; + babylonTexture.vScale = extension.scale[1]; + } + if (extension.texCoord != null) { + babylonTexture.coordinatesIndex = extension.texCoord; + } + assign(babylonTexture); + }); + }); + } +} +var NAME23; +var init_KHR_texture_transform = __esm(() => { + init_texture(); + init_glTFLoader2(); + NAME23 = "KHR_texture_transform"; + GLTFLoader2.RegisterExtension(NAME23, (loader) => new KHR_texture_transform(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_xmp_json_ld.js +class KHR_xmp_json_ld { + constructor(loader) { + this.name = NAME24; + this.order = 100; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME24); + } + dispose() { + this._loader = null; + } + onLoading() { + var _a, _b, _c; + if (this._loader.rootBabylonMesh === null) { + return; + } + const xmp_gltf = (_a = this._loader.gltf.extensions) === null || _a === undefined ? undefined : _a.KHR_xmp_json_ld; + const xmp_node = (_c = (_b = this._loader.gltf.asset) === null || _b === undefined ? undefined : _b.extensions) === null || _c === undefined ? undefined : _c.KHR_xmp_json_ld; + if (xmp_gltf && xmp_node) { + const packet = +xmp_node.packet; + if (xmp_gltf.packets && packet < xmp_gltf.packets.length) { + this._loader.rootBabylonMesh.metadata = this._loader.rootBabylonMesh.metadata || {}; + this._loader.rootBabylonMesh.metadata.xmp = xmp_gltf.packets[packet]; + } + } + } +} +var NAME24; +var init_KHR_xmp_json_ld = __esm(() => { + init_glTFLoader2(); + NAME24 = "KHR_xmp_json_ld"; + GLTFLoader2.RegisterExtension(NAME24, (loader) => new KHR_xmp_json_ld(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_animation_pointer.data.js +class CameraAnimationPropertyInfo extends AnimationPropertyInfo { + buildAnimations(target, name286, fps, keys4, callback) { + callback(target._babylonCamera, this._buildAnimation(name286, fps, keys4)); + } +} + +class MaterialAnimationPropertyInfo extends AnimationPropertyInfo { + buildAnimations(target, name286, fps, keys4, callback) { + for (const fillMode in target._data) { + callback(target._data[fillMode].babylonMaterial, this._buildAnimation(name286, fps, keys4)); + } + } +} + +class LightAnimationPropertyInfo extends AnimationPropertyInfo { + buildAnimations(target, name286, fps, keys4, callback) { + callback(target._babylonLight, this._buildAnimation(name286, fps, keys4)); + } +} +var getColor3, getAlpha, getFloat, getMinusFloat, getNextFloat, getFloatBy2, getTextureTransformTree, nodesTree, camerasTree, materialsTree, extensionsTree, animationPointerTree; +var init_KHR_animation_pointer_data = __esm(() => { + init_animation(); + init_glTFLoaderAnimation(); + init_math_color(); + getColor3 = function(_target, source, offset, scale) { + return Color3.FromArray(source, offset).scale(scale); + }; + getAlpha = function(_target, source, offset, scale) { + return source[offset + 3] * scale; + }; + getFloat = function(_target, source, offset, scale) { + return source[offset] * scale; + }; + getMinusFloat = function(_target, source, offset, scale) { + return -source[offset] * scale; + }; + getNextFloat = function(_target, source, offset, scale) { + return source[offset + 1] * scale; + }; + getFloatBy2 = function(_target, source, offset, scale) { + return source[offset] * scale * 2; + }; + getTextureTransformTree = function(textureName) { + return { + scale: [ + new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, `${textureName}.uScale`, getFloat, () => 2), + new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, `${textureName}.vScale`, getNextFloat, () => 2) + ], + offset: [ + new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, `${textureName}.uOffset`, getFloat, () => 2), + new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, `${textureName}.vOffset`, getNextFloat, () => 2) + ], + rotation: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, `${textureName}.wAng`, getMinusFloat, () => 1)] + }; + }; + nodesTree = { + __array__: { + __target__: true, + ...nodeAnimationData + } + }; + camerasTree = { + __array__: { + __target__: true, + orthographic: { + xmag: [ + new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "orthoLeft", getMinusFloat, () => 1), + new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "orthoRight", getNextFloat, () => 1) + ], + ymag: [ + new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "orthoBottom", getMinusFloat, () => 1), + new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "orthoTop", getNextFloat, () => 1) + ], + zfar: [new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "maxZ", getFloat, () => 1)], + znear: [new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "minZ", getFloat, () => 1)] + }, + perspective: { + yfov: [new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "fov", getFloat, () => 1)], + zfar: [new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "maxZ", getFloat, () => 1)], + znear: [new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "minZ", getFloat, () => 1)] + } + } + }; + materialsTree = { + __array__: { + __target__: true, + pbrMetallicRoughness: { + baseColorFactor: [ + new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, "albedoColor", getColor3, () => 4), + new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "alpha", getAlpha, () => 4) + ], + metallicFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "metallic", getFloat, () => 1)], + roughnessFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "roughness", getFloat, () => 1)], + baseColorTexture: { + extensions: { + KHR_texture_transform: getTextureTransformTree("albedoTexture") + } + } + }, + emissiveFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, "emissiveColor", getColor3, () => 3)], + normalTexture: { + scale: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "bumpTexture.level", getFloat, () => 1)] + }, + occlusionTexture: { + strength: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "ambientTextureStrength", getFloat, () => 1)], + extensions: { + KHR_texture_transform: getTextureTransformTree("ambientTexture") + } + }, + emissiveTexture: { + extensions: { + KHR_texture_transform: getTextureTransformTree("emissiveTexture") + } + }, + extensions: { + KHR_materials_ior: { + ior: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "indexOfRefraction", getFloat, () => 1)] + }, + KHR_materials_clearcoat: { + clearcoatFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "clearCoat.intensity", getFloat, () => 1)], + clearcoatRoughnessFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "clearCoat.roughness", getFloat, () => 1)] + }, + KHR_materials_sheen: { + sheenColorFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, "sheen.color", getColor3, () => 3)], + sheenRoughnessFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "sheen.roughness", getFloat, () => 1)] + }, + KHR_materials_specular: { + specularFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "metallicF0Factor", getFloat, () => 1)], + specularColorFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, "metallicReflectanceColor", getColor3, () => 3)] + }, + KHR_materials_emissive_strength: { + emissiveStrength: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "emissiveIntensity", getFloat, () => 1)] + }, + KHR_materials_transmission: { + transmissionFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "subSurface.refractionIntensity", getFloat, () => 1)] + }, + KHR_materials_volume: { + attenuationColor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, "subSurface.tintColor", getColor3, () => 3)], + attenuationDistance: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "subSurface.tintColorAtDistance", getFloat, () => 1)], + thicknessFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "subSurface.maximumThickness", getFloat, () => 1)] + }, + KHR_materials_dispersion: { + dispersion: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "subSurface.dispersion", getFloat, () => 1)] + }, + KHR_materials_iridescence: { + iridescenceFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "iridescence.intensity", getFloat, () => 1)], + iridescenceIor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "iridescence.indexOfRefraction", getFloat, () => 1)], + iridescenceThicknessMinimum: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "iridescence.minimumThickness", getFloat, () => 1)], + iridescenceThicknessMaximum: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "iridescence.maximumThickness", getFloat, () => 1)] + }, + KHR_materials_anisotropy: { + anisotropyStrength: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "anisotropy.intensity", getFloat, () => 1)], + anisotropyRotation: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "anisotropy.angle", getFloat, () => 1)] + } + } + } + }; + extensionsTree = { + KHR_lights_punctual: { + lights: { + __array__: { + __target__: true, + color: [new LightAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, "diffuse", getColor3, () => 3)], + intensity: [new LightAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "intensity", getFloat, () => 1)], + range: [new LightAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "range", getFloat, () => 1)], + spot: { + innerConeAngle: [new LightAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "innerAngle", getFloatBy2, () => 1)], + outerConeAngle: [new LightAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "angle", getFloatBy2, () => 1)] + } + } + } + } + }; + animationPointerTree = { + nodes: nodesTree, + materials: materialsTree, + cameras: camerasTree, + extensions: extensionsTree + }; +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_animation_pointer.js +class KHR_animation_pointer { + constructor(loader) { + this.name = NAME25; + this._loader = loader; + } + get enabled() { + return this._loader.isExtensionUsed(NAME25); + } + dispose() { + this._loader = null; + } + _loadAnimationChannelAsync(context, animationContext, animation17, channel, onLoad) { + var _a; + const extension = (_a = channel.target.extensions) === null || _a === undefined ? undefined : _a.KHR_animation_pointer; + if (!extension) { + return null; + } + if (channel.target.path !== "pointer") { + Logger.Warn(`${context}/target/path: Value (${channel.target.path}) must be (${"pointer"}) when using the ${this.name} extension`); + } + if (channel.target.node != null) { + Logger.Warn(`${context}/target/node: Value (${channel.target.node}) must not be present when using the ${this.name} extension`); + } + const extensionContext = `${context}/extensions/${this.name}`; + const pointer = extension.pointer; + if (!pointer) { + throw new Error(`${extensionContext}: Pointer is missing`); + } + const targetInfo = this._parseAnimationPointer(`${extensionContext}/pointer`, pointer); + if (!targetInfo) { + Logger.Warn(`${extensionContext}/pointer: Invalid pointer (${pointer}) skipped`); + return null; + } + return this._loader._loadAnimationChannelFromTargetInfoAsync(context, animationContext, animation17, channel, targetInfo, onLoad); + } + _parseAnimationPointer(context, pointer) { + if (!pointer.startsWith("/")) { + Logger.Warn(`${context}: Value (${pointer}) must start with a slash`); + return null; + } + const parts = pointer.split("/"); + parts.shift(); + let node30 = animationPointerTree; + let gltfCurrentNode = this._loader.gltf; + let gltfTargetNode = undefined; + for (const part of parts) { + if (node30.__array__) { + node30 = node30.__array__; + } else { + node30 = node30[part]; + if (!node30) { + return null; + } + } + gltfCurrentNode = gltfCurrentNode && gltfCurrentNode[part]; + if (node30.__target__) { + gltfTargetNode = gltfCurrentNode; + } + } + if (!gltfTargetNode || !Array.isArray(node30)) { + return null; + } + return { + target: gltfTargetNode, + properties: node30 + }; + } +} +var NAME25; +var init_KHR_animation_pointer = __esm(() => { + init_glTFLoader2(); + init_logger(); + init_KHR_animation_pointer_data(); + NAME25 = "KHR_animation_pointer"; + GLTFLoader2.RegisterExtension(NAME25, (loader) => new KHR_animation_pointer(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/MSFT_audio_emitter.js +class MSFT_audio_emitter { + constructor(loader) { + this.name = NAME26; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME26); + } + dispose() { + this._loader = null; + this._clips = null; + this._emitters = null; + } + onLoading() { + const extensions = this._loader.gltf.extensions; + if (extensions && extensions[this.name]) { + const extension = extensions[this.name]; + this._clips = extension.clips; + this._emitters = extension.emitters; + ArrayItem.Assign(this._clips); + ArrayItem.Assign(this._emitters); + } + } + loadSceneAsync(context, scene37) { + return GLTFLoader2.LoadExtensionAsync(context, scene37, this.name, (extensionContext, extension) => { + const promises = new Array; + promises.push(this._loader.loadSceneAsync(context, scene37)); + for (const emitterIndex of extension.emitters) { + const emitter = ArrayItem.Get(`${extensionContext}/emitters`, this._emitters, emitterIndex); + if (emitter.refDistance != null || emitter.maxDistance != null || emitter.rolloffFactor != null || emitter.distanceModel != null || emitter.innerAngle != null || emitter.outerAngle != null) { + throw new Error(`${extensionContext}: Direction or Distance properties are not allowed on emitters attached to a scene`); + } + promises.push(this._loadEmitterAsync(`${extensionContext}/emitters/${emitter.index}`, emitter)); + } + return Promise.all(promises).then(() => { + }); + }); + } + loadNodeAsync(context, node30, assign) { + return GLTFLoader2.LoadExtensionAsync(context, node30, this.name, (extensionContext, extension) => { + const promises = new Array; + return this._loader.loadNodeAsync(extensionContext, node30, (babylonMesh) => { + for (const emitterIndex of extension.emitters) { + const emitter = ArrayItem.Get(`${extensionContext}/emitters`, this._emitters, emitterIndex); + promises.push(this._loadEmitterAsync(`${extensionContext}/emitters/${emitter.index}`, emitter).then(() => { + for (const sound4 of emitter._babylonSounds) { + sound4.attachToMesh(babylonMesh); + if (emitter.innerAngle != null || emitter.outerAngle != null) { + sound4.setLocalDirectionToMesh(Vector3.Forward()); + sound4.setDirectionalCone(2 * Tools.ToDegrees(emitter.innerAngle == undefined ? Math.PI : emitter.innerAngle), 2 * Tools.ToDegrees(emitter.outerAngle == undefined ? Math.PI : emitter.outerAngle), 0); + } + } + })); + } + assign(babylonMesh); + }).then((babylonMesh) => { + return Promise.all(promises).then(() => { + return babylonMesh; + }); + }); + }); + } + loadAnimationAsync(context, animation17) { + return GLTFLoader2.LoadExtensionAsync(context, animation17, this.name, (extensionContext, extension) => { + return this._loader.loadAnimationAsync(context, animation17).then((babylonAnimationGroup) => { + const promises = new Array; + ArrayItem.Assign(extension.events); + for (const event of extension.events) { + promises.push(this._loadAnimationEventAsync(`${extensionContext}/events/${event.index}`, context, animation17, event, babylonAnimationGroup)); + } + return Promise.all(promises).then(() => { + return babylonAnimationGroup; + }); + }); + }); + } + _loadClipAsync(context, clip) { + if (clip._objectURL) { + return clip._objectURL; + } + let promise; + if (clip.uri) { + promise = this._loader.loadUriAsync(context, clip, clip.uri); + } else { + const bufferView = ArrayItem.Get(`${context}/bufferView`, this._loader.gltf.bufferViews, clip.bufferView); + promise = this._loader.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView); + } + clip._objectURL = promise.then((data) => { + return URL.createObjectURL(new Blob([data], { type: clip.mimeType })); + }); + return clip._objectURL; + } + _loadEmitterAsync(context, emitter) { + emitter._babylonSounds = emitter._babylonSounds || []; + if (!emitter._babylonData) { + const clipPromises = new Array; + const name286 = emitter.name || `emitter${emitter.index}`; + const options = { + loop: false, + autoplay: false, + volume: emitter.volume == undefined ? 1 : emitter.volume + }; + for (let i = 0;i < emitter.clips.length; i++) { + const clipContext = `/extensions/${this.name}/clips`; + const clip = ArrayItem.Get(clipContext, this._clips, emitter.clips[i].clip); + clipPromises.push(this._loadClipAsync(`${clipContext}/${emitter.clips[i].clip}`, clip).then((objectURL) => { + const sound4 = emitter._babylonSounds[i] = new Sound(name286, objectURL, this._loader.babylonScene, null, options); + sound4.refDistance = emitter.refDistance || 1; + sound4.maxDistance = emitter.maxDistance || 256; + sound4.rolloffFactor = emitter.rolloffFactor || 1; + sound4.distanceModel = emitter.distanceModel || "exponential"; + })); + } + const promise = Promise.all(clipPromises).then(() => { + const weights = emitter.clips.map((clip) => { + return clip.weight || 1; + }); + const weightedSound = new WeightedSound(emitter.loop || false, emitter._babylonSounds, weights); + if (emitter.innerAngle) { + weightedSound.directionalConeInnerAngle = 2 * Tools.ToDegrees(emitter.innerAngle); + } + if (emitter.outerAngle) { + weightedSound.directionalConeOuterAngle = 2 * Tools.ToDegrees(emitter.outerAngle); + } + if (emitter.volume) { + weightedSound.volume = emitter.volume; + } + emitter._babylonData.sound = weightedSound; + }); + emitter._babylonData = { + loaded: promise + }; + } + return emitter._babylonData.loaded; + } + _getEventAction(context, sound4, action7, time, startOffset) { + switch (action7) { + case "play": { + return (currentFrame) => { + const frameOffset = (startOffset || 0) + (currentFrame - time); + sound4.play(frameOffset); + }; + } + case "stop": { + return () => { + sound4.stop(); + }; + } + case "pause": { + return () => { + sound4.pause(); + }; + } + default: { + throw new Error(`${context}: Unsupported action ${action7}`); + } + } + } + _loadAnimationEventAsync(context, animationContext, animation17, event, babylonAnimationGroup) { + if (babylonAnimationGroup.targetedAnimations.length == 0) { + return Promise.resolve(); + } + const babylonAnimation = babylonAnimationGroup.targetedAnimations[0]; + const emitterIndex = event.emitter; + const emitter = ArrayItem.Get(`/extensions/${this.name}/emitters`, this._emitters, emitterIndex); + return this._loadEmitterAsync(context, emitter).then(() => { + const sound4 = emitter._babylonData.sound; + if (sound4) { + const babylonAnimationEvent = new AnimationEvent(event.time, this._getEventAction(context, sound4, event.action, event.time, event.startOffset)); + babylonAnimation.animation.addEvent(babylonAnimationEvent); + babylonAnimationGroup.onAnimationGroupEndObservable.add(() => { + sound4.stop(); + }); + babylonAnimationGroup.onAnimationGroupPauseObservable.add(() => { + sound4.pause(); + }); + } + }); + } +} +var NAME26; +var init_MSFT_audio_emitter = __esm(() => { + init_math_vector(); + init_tools(); + init_animationEvent(); + init_sound(); + init_weightedsound(); + init_glTFLoader2(); + NAME26 = "MSFT_audio_emitter"; + GLTFLoader2.RegisterExtension(NAME26, (loader) => new MSFT_audio_emitter(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/MSFT_lod.js +class MSFT_lod { + constructor(loader) { + this.name = NAME27; + this.order = 100; + this.maxLODsToLoad = 10; + this.onNodeLODsLoadedObservable = new Observable; + this.onMaterialLODsLoadedObservable = new Observable; + this._bufferLODs = new Array; + this._nodeIndexLOD = null; + this._nodeSignalLODs = new Array; + this._nodePromiseLODs = new Array; + this._nodeBufferLODs = new Array; + this._materialIndexLOD = null; + this._materialSignalLODs = new Array; + this._materialPromiseLODs = new Array; + this._materialBufferLODs = new Array; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME27); + } + dispose() { + this._loader = null; + this._nodeIndexLOD = null; + this._nodeSignalLODs.length = 0; + this._nodePromiseLODs.length = 0; + this._nodeBufferLODs.length = 0; + this._materialIndexLOD = null; + this._materialSignalLODs.length = 0; + this._materialPromiseLODs.length = 0; + this._materialBufferLODs.length = 0; + this.onMaterialLODsLoadedObservable.clear(); + this.onNodeLODsLoadedObservable.clear(); + } + onReady() { + for (let indexLOD = 0;indexLOD < this._nodePromiseLODs.length; indexLOD++) { + const promise = Promise.all(this._nodePromiseLODs[indexLOD]).then(() => { + if (indexLOD !== 0) { + this._loader.endPerformanceCounter(`Node LOD ${indexLOD}`); + this._loader.log(`Loaded node LOD ${indexLOD}`); + } + this.onNodeLODsLoadedObservable.notifyObservers(indexLOD); + if (indexLOD !== this._nodePromiseLODs.length - 1) { + this._loader.startPerformanceCounter(`Node LOD ${indexLOD + 1}`); + this._loadBufferLOD(this._nodeBufferLODs, indexLOD + 1); + if (this._nodeSignalLODs[indexLOD]) { + this._nodeSignalLODs[indexLOD].resolve(); + } + } + }); + this._loader._completePromises.push(promise); + } + for (let indexLOD = 0;indexLOD < this._materialPromiseLODs.length; indexLOD++) { + const promise = Promise.all(this._materialPromiseLODs[indexLOD]).then(() => { + if (indexLOD !== 0) { + this._loader.endPerformanceCounter(`Material LOD ${indexLOD}`); + this._loader.log(`Loaded material LOD ${indexLOD}`); + } + this.onMaterialLODsLoadedObservable.notifyObservers(indexLOD); + if (indexLOD !== this._materialPromiseLODs.length - 1) { + this._loader.startPerformanceCounter(`Material LOD ${indexLOD + 1}`); + this._loadBufferLOD(this._materialBufferLODs, indexLOD + 1); + if (this._materialSignalLODs[indexLOD]) { + this._materialSignalLODs[indexLOD].resolve(); + } + } + }); + this._loader._completePromises.push(promise); + } + } + loadSceneAsync(context, scene37) { + const promise = this._loader.loadSceneAsync(context, scene37); + this._loadBufferLOD(this._bufferLODs, 0); + return promise; + } + loadNodeAsync(context, node30, assign) { + return GLTFLoader2.LoadExtensionAsync(context, node30, this.name, (extensionContext, extension) => { + let firstPromise; + const nodeLODs = this._getLODs(extensionContext, node30, this._loader.gltf.nodes, extension.ids); + this._loader.logOpen(`${extensionContext}`); + for (let indexLOD = 0;indexLOD < nodeLODs.length; indexLOD++) { + const nodeLOD = nodeLODs[indexLOD]; + if (indexLOD !== 0) { + this._nodeIndexLOD = indexLOD; + this._nodeSignalLODs[indexLOD] = this._nodeSignalLODs[indexLOD] || new Deferred; + } + const assignWrap = (babylonTransformNode) => { + assign(babylonTransformNode); + babylonTransformNode.setEnabled(false); + }; + const promise = this._loader.loadNodeAsync(`/nodes/${nodeLOD.index}`, nodeLOD, assignWrap).then((babylonMesh) => { + if (indexLOD !== 0) { + const previousNodeLOD = nodeLODs[indexLOD - 1]; + if (previousNodeLOD._babylonTransformNode) { + this._disposeTransformNode(previousNodeLOD._babylonTransformNode); + delete previousNodeLOD._babylonTransformNode; + } + } + babylonMesh.setEnabled(true); + return babylonMesh; + }); + this._nodePromiseLODs[indexLOD] = this._nodePromiseLODs[indexLOD] || []; + if (indexLOD === 0) { + firstPromise = promise; + } else { + this._nodeIndexLOD = null; + this._nodePromiseLODs[indexLOD].push(promise); + } + } + this._loader.logClose(); + return firstPromise; + }); + } + _loadMaterialAsync(context, material30, babylonMesh, babylonDrawMode, assign) { + if (this._nodeIndexLOD) { + return null; + } + return GLTFLoader2.LoadExtensionAsync(context, material30, this.name, (extensionContext, extension) => { + let firstPromise; + const materialLODs = this._getLODs(extensionContext, material30, this._loader.gltf.materials, extension.ids); + this._loader.logOpen(`${extensionContext}`); + for (let indexLOD = 0;indexLOD < materialLODs.length; indexLOD++) { + const materialLOD = materialLODs[indexLOD]; + if (indexLOD !== 0) { + this._materialIndexLOD = indexLOD; + } + const promise = this._loader._loadMaterialAsync(`/materials/${materialLOD.index}`, materialLOD, babylonMesh, babylonDrawMode, (babylonMaterial) => { + if (indexLOD === 0) { + assign(babylonMaterial); + } + }).then((babylonMaterial) => { + if (indexLOD !== 0) { + assign(babylonMaterial); + const previousDataLOD = materialLODs[indexLOD - 1]._data; + if (previousDataLOD[babylonDrawMode]) { + this._disposeMaterials([previousDataLOD[babylonDrawMode].babylonMaterial]); + delete previousDataLOD[babylonDrawMode]; + } + } + return babylonMaterial; + }); + this._materialPromiseLODs[indexLOD] = this._materialPromiseLODs[indexLOD] || []; + if (indexLOD === 0) { + firstPromise = promise; + } else { + this._materialIndexLOD = null; + this._materialPromiseLODs[indexLOD].push(promise); + } + } + this._loader.logClose(); + return firstPromise; + }); + } + _loadUriAsync(context, property, uri) { + if (this._nodeIndexLOD !== null) { + this._loader.log(`deferred`); + const previousIndexLOD = this._nodeIndexLOD - 1; + this._nodeSignalLODs[previousIndexLOD] = this._nodeSignalLODs[previousIndexLOD] || new Deferred; + return this._nodeSignalLODs[this._nodeIndexLOD - 1].promise.then(() => { + return this._loader.loadUriAsync(context, property, uri); + }); + } else if (this._materialIndexLOD !== null) { + this._loader.log(`deferred`); + const previousIndexLOD = this._materialIndexLOD - 1; + this._materialSignalLODs[previousIndexLOD] = this._materialSignalLODs[previousIndexLOD] || new Deferred; + return this._materialSignalLODs[previousIndexLOD].promise.then(() => { + return this._loader.loadUriAsync(context, property, uri); + }); + } + return null; + } + loadBufferAsync(context, buffer81, byteOffset, byteLength) { + if (this._loader.parent.useRangeRequests && !buffer81.uri) { + if (!this._loader.bin) { + throw new Error(`${context}: Uri is missing or the binary glTF is missing its binary chunk`); + } + const loadAsync = (bufferLODs, indexLOD) => { + const start = byteOffset; + const end = start + byteLength - 1; + let bufferLOD = bufferLODs[indexLOD]; + if (bufferLOD) { + bufferLOD.start = Math.min(bufferLOD.start, start); + bufferLOD.end = Math.max(bufferLOD.end, end); + } else { + bufferLOD = { start, end, loaded: new Deferred }; + bufferLODs[indexLOD] = bufferLOD; + } + return bufferLOD.loaded.promise.then((data) => { + return new Uint8Array(data.buffer, data.byteOffset + byteOffset - bufferLOD.start, byteLength); + }); + }; + this._loader.log(`deferred`); + if (this._nodeIndexLOD !== null) { + return loadAsync(this._nodeBufferLODs, this._nodeIndexLOD); + } else if (this._materialIndexLOD !== null) { + return loadAsync(this._materialBufferLODs, this._materialIndexLOD); + } else { + return loadAsync(this._bufferLODs, 0); + } + } + return null; + } + _loadBufferLOD(bufferLODs, indexLOD) { + const bufferLOD = bufferLODs[indexLOD]; + if (bufferLOD) { + this._loader.log(`Loading buffer range [${bufferLOD.start}-${bufferLOD.end}]`); + this._loader.bin.readAsync(bufferLOD.start, bufferLOD.end - bufferLOD.start + 1).then((data) => { + bufferLOD.loaded.resolve(data); + }, (error7) => { + bufferLOD.loaded.reject(error7); + }); + } + } + _getLODs(context, property, array, ids) { + if (this.maxLODsToLoad <= 0) { + throw new Error("maxLODsToLoad must be greater than zero"); + } + const properties = []; + for (let i = ids.length - 1;i >= 0; i--) { + properties.push(ArrayItem.Get(`${context}/ids/${ids[i]}`, array, ids[i])); + if (properties.length === this.maxLODsToLoad) { + return properties; + } + } + properties.push(property); + return properties; + } + _disposeTransformNode(babylonTransformNode) { + const babylonMaterials = []; + const babylonMaterial = babylonTransformNode.material; + if (babylonMaterial) { + babylonMaterials.push(babylonMaterial); + } + for (const babylonMesh of babylonTransformNode.getChildMeshes()) { + if (babylonMesh.material) { + babylonMaterials.push(babylonMesh.material); + } + } + babylonTransformNode.dispose(); + const babylonMaterialsToDispose = babylonMaterials.filter((babylonMaterial2) => this._loader.babylonScene.meshes.every((mesh80) => mesh80.material != babylonMaterial2)); + this._disposeMaterials(babylonMaterialsToDispose); + } + _disposeMaterials(babylonMaterials) { + const babylonTextures = {}; + for (const babylonMaterial of babylonMaterials) { + for (const babylonTexture of babylonMaterial.getActiveTextures()) { + babylonTextures[babylonTexture.uniqueId] = babylonTexture; + } + babylonMaterial.dispose(); + } + for (const uniqueId in babylonTextures) { + for (const babylonMaterial of this._loader.babylonScene.materials) { + if (babylonMaterial.hasTexture(babylonTextures[uniqueId])) { + delete babylonTextures[uniqueId]; + } + } + } + for (const uniqueId in babylonTextures) { + babylonTextures[uniqueId].dispose(); + } + } +} +var NAME27; +var init_MSFT_lod = __esm(() => { + init_observable(); + init_deferred(); + init_glTFLoader2(); + NAME27 = "MSFT_lod"; + GLTFLoader2.RegisterExtension(NAME27, (loader) => new MSFT_lod(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/MSFT_minecraftMesh.js +class MSFT_minecraftMesh { + constructor(loader) { + this.name = NAME28; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME28); + } + dispose() { + this._loader = null; + } + loadMaterialPropertiesAsync(context, material30, babylonMaterial) { + return GLTFLoader2.LoadExtraAsync(context, material30, this.name, (extraContext, extra) => { + if (extra) { + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${extraContext}: Material type not supported`); + } + const promise = this._loader.loadMaterialPropertiesAsync(context, material30, babylonMaterial); + if (babylonMaterial.needAlphaBlending()) { + babylonMaterial.forceDepthWrite = true; + babylonMaterial.separateCullingPass = true; + } + babylonMaterial.backFaceCulling = babylonMaterial.forceDepthWrite; + babylonMaterial.twoSidedLighting = true; + return promise; + } + return null; + }); + } +} +var NAME28; +var init_MSFT_minecraftMesh = __esm(() => { + init_pbrMaterial(); + init_glTFLoader2(); + NAME28 = "MSFT_minecraftMesh"; + GLTFLoader2.RegisterExtension(NAME28, (loader) => new MSFT_minecraftMesh(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/MSFT_sRGBFactors.js +class MSFT_sRGBFactors { + constructor(loader) { + this.name = NAME29; + this._loader = loader; + this.enabled = this._loader.isExtensionUsed(NAME29); + } + dispose() { + this._loader = null; + } + loadMaterialPropertiesAsync(context, material30, babylonMaterial) { + return GLTFLoader2.LoadExtraAsync(context, material30, this.name, (extraContext, extra) => { + if (extra) { + if (!(babylonMaterial instanceof PBRMaterial)) { + throw new Error(`${extraContext}: Material type not supported`); + } + const promise = this._loader.loadMaterialPropertiesAsync(context, material30, babylonMaterial); + const useExactSrgbConversions = babylonMaterial.getScene().getEngine().useExactSrgbConversions; + if (!babylonMaterial.albedoTexture) { + babylonMaterial.albedoColor.toLinearSpaceToRef(babylonMaterial.albedoColor, useExactSrgbConversions); + } + if (!babylonMaterial.reflectivityTexture) { + babylonMaterial.reflectivityColor.toLinearSpaceToRef(babylonMaterial.reflectivityColor, useExactSrgbConversions); + } + return promise; + } + return null; + }); + } +} +var NAME29; +var init_MSFT_sRGBFactors = __esm(() => { + init_pbrMaterial(); + init_glTFLoader2(); + NAME29 = "MSFT_sRGBFactors"; + GLTFLoader2.RegisterExtension(NAME29, (loader) => new MSFT_sRGBFactors(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/interactivityUtils.js +var gltfToFlowGraphTypeMap, gltfTypeToBabylonType; +var init_interactivityUtils = __esm(() => { + init_flowGraphSceneReadyEventBlock(); + init_flowGraphSceneTickEventBlock(); + init_flowGraphConsoleLogBlock(); + init_flowGraphTimerBlock(); + init_flowGraphSendCustomEventBlock(); + init_flowGraphReceiveCustomEventBlock(); + init_flowGraphSequenceBlock(); + init_flowGraphGetPropertyBlock(); + init_flowGraphSetPropertyBlock(); + init_flowGraphMathBlocks(); + init_flowGraphDoNBlock(); + init_flowGraphGetVariableBlock(); + init_flowGraphSetVariableBlock(); + init_flowGraphWhileLoopBlock(); + gltfToFlowGraphTypeMap = { + "lifecycle/onStart": FlowGraphSceneReadyEventBlock.ClassName, + "lifecycle/onTick": FlowGraphSceneTickEventBlock.ClassName, + log: FlowGraphConsoleLogBlock.ClassName, + "flow/delay": FlowGraphTimerBlock.ClassName, + "customEvent/send": FlowGraphSendCustomEventBlock.ClassName, + "customEvent/receive": FlowGraphReceiveCustomEventBlock.ClassName, + "flow/sequence": FlowGraphSequenceBlock.ClassName, + "world/get": FlowGraphGetPropertyBlock.ClassName, + "world/set": FlowGraphSetPropertyBlock.ClassName, + "flow/doN": FlowGraphDoNBlock.ClassName, + "variable/get": FlowGraphGetVariableBlock.ClassName, + "variable/set": FlowGraphSetVariableBlock.ClassName, + "flow/whileLoop": FlowGraphWhileLoopBlock.ClassName, + "math/random": FlowGraphRandomBlock.ClassName, + "math/e": FlowGraphEBlock.ClassName, + "math/pi": FlowGraphPiBlock.ClassName, + "math/inf": FlowGraphInfBlock.ClassName, + "math/nan": FlowGraphNaNBlock.ClassName, + "math/abs": FlowGraphAbsBlock.ClassName, + "math/sign": FlowGraphSignBlock.ClassName, + "math/trunc": FlowGraphTruncBlock.ClassName, + "math/floor": FlowGraphFloorBlock.ClassName, + "math/ceil": FlowGraphCeilBlock.ClassName, + "math/fract": FlowGraphFractBlock.ClassName, + "math/neg": FlowGraphNegBlock.ClassName, + "math/add": FlowGraphAddBlock.ClassName, + "math/sub": FlowGraphSubtractBlock.ClassName, + "math/mul": FlowGraphMultiplyBlock.ClassName, + "math/div": FlowGraphDivideBlock.ClassName, + "math/rem": FlowGraphRemainderBlock.ClassName, + "math/min": FlowGraphMinBlock.ClassName, + "math/max": FlowGraphMaxBlock.ClassName, + "math/clamp": FlowGraphClampBlock.ClassName, + "math/saturate": FlowGraphSaturateBlock.ClassName, + "math/mix": FlowGraphInterpolateBlock.ClassName, + "math/eq": FlowGraphEqBlock.ClassName, + "math/lt": FlowGraphLessThanBlock.ClassName, + "math/le": FlowGraphLessThanOrEqualBlock.ClassName, + "math/gt": FlowGraphGreaterThanBlock.ClassName, + "math/ge": FlowGraphGreaterThanOrEqualBlock.ClassName, + "math/isnan": FlowGraphIsNanBlock.ClassName, + "math/isinf": FlowGraphIsInfBlock.ClassName, + "math/rad": FlowGraphDegToRadBlock.ClassName, + "math/deg": FlowGraphRadToDegBlock.ClassName, + "math/sin": FlowGraphSinBlock.ClassName, + "math/cos": FlowGraphCosBlock.ClassName, + "math/tan": FlowGraphTanBlock.ClassName, + "math/asin": FlowGraphAsinBlock.ClassName, + "math/acos": FlowGraphAcosBlock.ClassName, + "math/atan": FlowGraphAtanBlock.ClassName, + "math/atan2": FlowGraphAtan2Block.ClassName, + "math/sinh": FlowGraphSinhBlock.ClassName, + "math/cosh": FlowGraphCoshBlock.ClassName, + "math/tanh": FlowGraphTanhBlock.ClassName, + "math/asinh": FlowGraphAsinhBlock.ClassName, + "math/acosh": FlowGraphAcoshBlock.ClassName, + "math/atanh": FlowGraphAtanhBlock.ClassName, + "math/exp": FlowGraphExpBlock.ClassName, + "math/log": FlowGraphLogBlock.ClassName, + "math/log2": FlowGraphLog2Block.ClassName, + "math/log10": FlowGraphLog10Block.ClassName, + "math/sqrt": FlowGraphSqrtBlock.ClassName, + "math/cbrt": FlowGraphCubeRootBlock.ClassName, + "math/pow": FlowGraphPowBlock.ClassName, + "math/length": FlowGraphLengthBlock.ClassName, + "math/normalize": FlowGraphNormalizeBlock.ClassName, + "math/dot": FlowGraphDotBlock.ClassName, + "math/cross": FlowGraphCrossBlock.ClassName, + "math/rotate2d": FlowGraphRotate2DBlock.ClassName, + "math/rotate3d": FlowGraphRotate3DBlock.ClassName + }; + gltfTypeToBabylonType = { + float2: "Vector2", + float3: "Vector3", + float4: "Vector4" + }; +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/interactivityFunctions.js +function convertGLTFToSerializedFlowGraph(gltf) { + var _a, _b, _c; + const context = { + uniqueId: RandomGUID(), + _userVariables: {}, + _connectionValues: {} + }; + const executionContexts = [context]; + const flowGraphJsonBlocks = []; + for (let i = 0;i < gltf.nodes.length; i++) { + const gltfBlock = gltf.nodes[i]; + const flowGraphJsonBlock = convertBlock(i, gltfBlock, gltf); + flowGraphJsonBlocks.push(flowGraphJsonBlock); + } + for (let i = 0;i < gltf.nodes.length; i++) { + const gltfBlock = gltf.nodes[i]; + const fgBlock = flowGraphJsonBlocks[i]; + const gltfFlows = (_a = gltfBlock.flows) !== null && _a !== undefined ? _a : []; + for (const flow of gltfFlows) { + const socketOutName = flow.id; + const socketOut = { + uniqueId: RandomGUID(), + name: socketOutName, + _connectionType: FlowGraphConnectionType.Output, + connectedPointIds: [] + }; + fgBlock.signalOutputs.push(socketOut); + const nodeInId = flow.node; + const nodeInSocketName = flow.socket; + const nodeIn = flowGraphJsonBlocks[nodeInId]; + if (!nodeIn) { + throw new Error(`/extensions/KHR_interactivity/nodes/${i}: Could not find node with id ${nodeInId} that connects its input with with node ${i}'s output ${socketOutName}`); + } + let socketIn = nodeIn.signalInputs.find((s) => s.name === nodeInSocketName); + if (!socketIn) { + socketIn = { + uniqueId: RandomGUID(), + name: nodeInSocketName, + _connectionType: FlowGraphConnectionType.Input, + connectedPointIds: [] + }; + nodeIn.signalInputs.push(socketIn); + } + socketIn.connectedPointIds.push(socketOut.uniqueId); + socketOut.connectedPointIds.push(socketIn.uniqueId); + } + const gltfValues = (_b = gltfBlock.values) !== null && _b !== undefined ? _b : []; + for (const value of gltfValues) { + const socketInName = value.id; + const socketIn = { + uniqueId: RandomGUID(), + name: socketInName, + _connectionType: FlowGraphConnectionType.Input, + connectedPointIds: [] + }; + fgBlock.dataInputs.push(socketIn); + if (value.value !== undefined) { + const convertedValue = convertValueWithType(value, gltf, `/extensions/KHR_interactivity/nodes/${i}`); + context._connectionValues[socketIn.uniqueId] = convertedValue; + } else if (value.node !== undefined && value.socket !== undefined) { + const nodeOutId = value.node; + const nodeOutSocketName = value.socket; + const nodeOut = flowGraphJsonBlocks[nodeOutId]; + if (!nodeOut) { + throw new Error(`/extensions/KHR_interactivity/nodes/${i}: Could not find node with id ${nodeOutId} that connects its output with node${i}'s input ${socketInName}`); + } + let socketOut = nodeOut.dataOutputs.find((s) => s.name === nodeOutSocketName); + if (!socketOut) { + socketOut = { + uniqueId: RandomGUID(), + name: nodeOutSocketName, + _connectionType: FlowGraphConnectionType.Output, + connectedPointIds: [] + }; + nodeOut.dataOutputs.push(socketOut); + } + socketIn.connectedPointIds.push(socketOut.uniqueId); + socketOut.connectedPointIds.push(socketIn.uniqueId); + } else { + throw new Error(`/extensions/KHR_interactivity/nodes/${i}: Invalid socket ${socketInName} in node ${i}`); + } + } + } + const variables = (_c = gltf.variables) !== null && _c !== undefined ? _c : []; + for (let i = 0;i < variables.length; i++) { + const variable = variables[i]; + const variableName = variable.id; + context._userVariables[variableName] = convertValueWithType(variable, gltf, `/extensions/KHR_interactivity/variables/${i}`); + } + return { + allBlocks: flowGraphJsonBlocks, + executionContexts + }; +} +var convertValueWithType, convertConfiguration, convertBlock; +var init_interactivityFunctions = __esm(() => { + init_guid(); + init_interactivityUtils(); + init_flowGraphConnection(); + convertValueWithType = function(configObject, definition, context) { + if (configObject.type !== undefined) { + const type = definition.types && definition.types[configObject.type]; + if (!type) { + throw new Error(`${context}: Unknown type: ${configObject.type}`); + } + const signature = type.signature; + if (!signature) { + throw new Error(`${context}: Type ${configObject.type} has no signature`); + } + const convertedType = gltfTypeToBabylonType[signature]; + return { + value: configObject.value, + className: convertedType + }; + } else { + return configObject.value; + } + }; + convertConfiguration = function(gltfBlock, definition, id) { + var _a; + const converted = {}; + const configurationList = (_a = gltfBlock.configuration) !== null && _a !== undefined ? _a : []; + for (const configObject of configurationList) { + if (configObject.id === "customEvent") { + const customEvent = definition.customEvents && definition.customEvents[configObject.value]; + if (!customEvent) { + throw new Error(`/extensions/KHR_interactivity/nodes/${id}: Unknown custom event: ${configObject.value}`); + } + converted.eventId = customEvent.id; + converted.eventData = customEvent.values.map((v) => v.id); + } else if (configObject.id === "variable") { + const variable = definition.variables && definition.variables[configObject.value]; + if (!variable) { + throw new Error(`/extensions/KHR_interactivity/nodes/${id}: Unknown variable: ${configObject.value}`); + } + converted.variableName = variable.id; + } else if (configObject.id === "path") { + const pathValue = configObject.value; + converted.path = { + path: pathValue, + className: "FGPath" + }; + } else { + converted[configObject.id] = convertValueWithType(configObject, definition, `/extensions/KHR_interactivity/nodes/${id}`); + } + } + return converted; + }; + convertBlock = function(id, gltfBlock, definition) { + const className2 = gltfToFlowGraphTypeMap[gltfBlock.type]; + if (!className2) { + throw new Error(`/extensions/KHR_interactivity/nodes/${id}: Unknown block type: ${gltfBlock.type}`); + } + const uniqueId = id.toString(); + const config = convertConfiguration(gltfBlock, definition, uniqueId); + const metadata = gltfBlock.metadata; + const dataInputs = []; + const dataOutputs = []; + const signalInputs = []; + const signalOutputs = []; + return { + className: className2, + config, + uniqueId, + metadata, + dataInputs, + dataOutputs, + signalInputs, + signalOutputs + }; + }; +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/interactivityPathTransformNodeExtensions.js +var getBabylonTransformNode, nodesRegex, gltfNodePropertyToBabylonPropertyMap, transformNodeExtension; +var init_interactivityPathTransformNodeExtensions = __esm(() => { + getBabylonTransformNode = function(path, context) { + const fullPath = path.getFinalPath(); + const gltfTree = context.getVariable("gltf"); + if (!gltfTree) { + throw new Error(`No glTF tree found for path ${fullPath}`); + } + const matches = fullPath.match(nodesRegex); + if (!matches || matches.length !== 3) { + throw new Error(`Invalid path ${fullPath}`); + } + const nodeIndex = parseInt(matches[1]); + const node30 = gltfTree.nodes && gltfTree.nodes[nodeIndex]; + if (!node30) { + throw new Error(`Invalid node index for path ${fullPath}`); + } + const babylonNode = node30._babylonTransformNode; + if (!babylonNode) { + throw new Error(`No Babylon node found for path ${fullPath}`); + } + const property = matches[2]; + if (!property) { + throw new Error(`Invalid property for path ${fullPath}`); + } + const babylonProperty = gltfNodePropertyToBabylonPropertyMap[property]; + if (!babylonProperty) { + throw new Error(`Invalid property for path ${fullPath}`); + } + return { babylonNode, babylonProperty }; + }; + nodesRegex = /^\/nodes\/(\d+)\/(translation|rotation|scale)$/; + gltfNodePropertyToBabylonPropertyMap = { + translation: "position", + scale: "scaling", + rotation: "rotationQuaternion" + }; + transformNodeExtension = { + shouldProcess(path) { + const fullPath = path.getFinalPath(); + return !!fullPath.match(nodesRegex); + }, + processGet(path, context) { + const { babylonNode, babylonProperty } = getBabylonTransformNode(path, context); + return babylonNode[babylonProperty]; + }, + processSet(path, context, value) { + const { babylonNode, babylonProperty } = getBabylonTransformNode(path, context); + babylonNode[babylonProperty] = value; + } + }; +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/interactivityPathMaterialExtensions.js +var getBabylonMaterial, materialsRegex, gltfPbrMaterialPropertyToBabylonPropertyMap, pbrMaterialExtension; +var init_interactivityPathMaterialExtensions = __esm(() => { + init_math_color(); + getBabylonMaterial = function(path, context) { + var _a; + const fullPath = path.getFinalPath(); + const gltfTree = context.getVariable("gltf"); + if (!gltfTree) { + throw new Error(`No glTF tree found for path ${fullPath}`); + } + const matches = fullPath.match(materialsRegex); + if (!matches || matches.length !== 3) { + throw new Error(`Invalid path ${fullPath}`); + } + const materialIndex = parseInt(matches[1]); + const material30 = gltfTree.materials && gltfTree.materials[materialIndex]; + if (!material30) { + throw new Error(`Invalid material index for path ${fullPath}`); + } + const babylonMaterials = []; + if (!material30._data) { + throw new Error(`No Babylon materials found for path ${fullPath}`); + } + for (const data of Object.keys(material30._data)) { + const babylonMaterial = material30._data[parseInt(data)].babylonMaterial; + if (babylonMaterial) { + babylonMaterials.push(babylonMaterial); + } + } + if (!babylonMaterials || babylonMaterials.length === 0) { + throw new Error(`No Babylon materials found for path ${fullPath}`); + } + const property = matches[2]; + if (!property) { + throw new Error(`Invalid property for path ${fullPath}`); + } + const babylonProperty = (_a = gltfPbrMaterialPropertyToBabylonPropertyMap[property]) !== null && _a !== undefined ? _a : property; + return { babylonMaterials, babylonProperty }; + }; + materialsRegex = /^\/materials\/(\d+)\/(pbrMetallicRoughness\/baseColorFactor|pbrMetallicRoughness\/metallicFactor|pbrMetallicRoughness\/roughnessFactor|alphaCutoff|emissiveFactor|normalTexture\/scale|emissiveTexture\/strength)$/; + gltfPbrMaterialPropertyToBabylonPropertyMap = { + "pbrMetallicRoughness/baseColorFactor": "albedoColor", + "pbrMetallicRoughness/metallicFactor": "metallic", + "pbrMetallicRoughness/roughnessFactor": "roughness", + emissiveFactor: "emissiveColor" + }; + pbrMaterialExtension = { + shouldProcess(path) { + const fullPath = path.getFinalPath(); + return !!fullPath.match(materialsRegex); + }, + processGet(path, context) { + var _a, _b; + const { babylonMaterials, babylonProperty } = getBabylonMaterial(path, context); + if (babylonProperty === "normalTexture/scale") { + const firstMat = babylonMaterials[0]; + return (_a = firstMat.bumpTexture) === null || _a === undefined ? undefined : _a.uScale; + } else if (babylonProperty === "emissiveTexture/strength") { + const firstMat = babylonMaterials[0]; + return (_b = firstMat.emissiveTexture) === null || _b === undefined ? undefined : _b.level; + } else { + return babylonMaterials[0][babylonProperty]; + } + }, + processSet(path, context, value) { + const { babylonMaterials, babylonProperty } = getBabylonMaterial(path, context); + for (const material30 of babylonMaterials) { + if (babylonProperty === "normalTexture/scale") { + material30.bumpTexture.uScale = value; + material30.bumpTexture.vScale = value; + } else if (babylonProperty === "emissiveTexture/strength") { + material30.emissiveTexture.level = value; + } else { + let finalValue = value; + if (babylonProperty === "albedoColor" || babylonProperty === "emissiveColor") { + finalValue = new Color3(value.x, value.y, value.z); + } + material30[babylonProperty] = finalValue; + } + } + } + }; +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/interactivityPathCameraExtensions.js +var getBabylonCamera, camerasRegex, camerasExtension; +var init_interactivityPathCameraExtensions = __esm(() => { + init_tools(); + getBabylonCamera = function(path, context) { + const fullPath = path.getFinalPath(); + const gltfTree = context.getVariable("gltf"); + if (!gltfTree) { + throw new Error(`No glTF tree found for path ${fullPath}`); + } + const matches = fullPath.match(camerasRegex); + if (!matches || matches.length !== 4) { + throw new Error(`Invalid path ${fullPath}`); + } + const cameraIndex = parseInt(matches[1]); + const camera34 = gltfTree.cameras && gltfTree.cameras[cameraIndex]; + if (!camera34) { + throw new Error(`Invalid camera index for path ${fullPath}`); + } + const babylonCamera = camera34._babylonCamera; + if (!babylonCamera) { + throw new Error(`No Babylon camera found for path ${fullPath}`); + } + const gltfProperty = matches[3]; + if (!gltfProperty) { + throw new Error(`Invalid property for path ${fullPath}`); + } + return { babylonCamera, gltfProperty }; + }; + camerasRegex = /^\/cameras\/(\d+)\/(orthographic|perspective)\/(xmag|ymag|zfar|znear|aspectRatio|yfov)$/; + camerasExtension = { + shouldProcess(path) { + const fullPath = path.getFinalPath(); + return !!fullPath.match(camerasRegex); + }, + processGet(path, context) { + const { babylonCamera, gltfProperty } = getBabylonCamera(path, context); + switch (gltfProperty) { + case "aspectRatio": + Tools.Warn("Getting aspect ratio is not supported."); + return -1; + case "zNear": + return babylonCamera.minZ; + case "zFar": + return babylonCamera.maxZ; + case "yfov": + return babylonCamera.fov; + case "xmag": + return babylonCamera.orthoRight; + case "ymag": + return babylonCamera.orthoTop; + } + }, + processSet(path, context, value) { + const { babylonCamera, gltfProperty } = getBabylonCamera(path, context); + switch (gltfProperty) { + case "aspectRatio": + Tools.Warn("Setting aspect ratio is not supported."); + break; + case "zNear": + babylonCamera.minZ = value; + break; + case "zFar": + babylonCamera.maxZ = value; + break; + case "yfov": + babylonCamera.fov = value; + break; + case "xmag": + babylonCamera.orthoLeft = -value; + babylonCamera.orthoRight = value; + break; + case "ymag": + babylonCamera.orthoTop = value; + babylonCamera.orthoBottom = -value; + break; + } + } + }; +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/interactivityPathExtensions.js +var interactivityPathExensions; +var init_interactivityPathExtensions = __esm(() => { + init_interactivityPathTransformNodeExtensions(); + init_interactivityPathMaterialExtensions(); + init_interactivityPathCameraExtensions(); + interactivityPathExensions = [transformNodeExtension, pbrMaterialExtension, camerasExtension]; +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_interactivity.js +class KHR_interactivity { + constructor(_loader) { + this._loader = _loader; + this.name = NAME30; + this.enabled = this._loader.isExtensionUsed(NAME30); + } + dispose() { + this._loader = null; + } + onReady() { + var _a; + if (!this._loader.babylonScene) { + return; + } + const scene37 = this._loader.babylonScene; + const definition = (_a = this._loader.gltf.extensions) === null || _a === undefined ? undefined : _a.KHR_interactivity; + for (const extension of interactivityPathExensions) { + if (!FlowGraphPath.Extensions.includes(extension)) { + FlowGraphPath.Extensions.push(extension); + } + } + const json = convertGLTFToSerializedFlowGraph(definition); + const coordinator = new FlowGraphCoordinator({ scene: scene37 }); + const graph = FlowGraph.Parse(json, coordinator); + const context = graph.getContext(0); + context.setVariable("gltf", this._loader.gltf); + coordinator.start(); + } +} +var NAME30; +var init_KHR_interactivity = __esm(() => { + init_glTFLoader2(); + init_flowGraphCoordinator(); + init_flowGraph(); + init_flowGraphPath(); + init_interactivityFunctions(); + init_interactivityPathExtensions(); + NAME30 = "KHR_interactivity"; + GLTFLoader2.RegisterExtension(NAME30, (loader) => new KHR_interactivity(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/ExtrasAsMetadata.js +class ExtrasAsMetadata { + _assignExtras(babylonObject, gltfProp) { + if (gltfProp.extras && Object.keys(gltfProp.extras).length > 0) { + const metadata = babylonObject.metadata = babylonObject.metadata || {}; + const gltf = metadata.gltf = metadata.gltf || {}; + gltf.extras = gltfProp.extras; + } + } + constructor(loader) { + this.name = NAME31; + this.enabled = true; + this._loader = loader; + } + dispose() { + this._loader = null; + } + loadNodeAsync(context, node30, assign) { + return this._loader.loadNodeAsync(context, node30, (babylonTransformNode) => { + this._assignExtras(babylonTransformNode, node30); + assign(babylonTransformNode); + }); + } + loadCameraAsync(context, camera34, assign) { + return this._loader.loadCameraAsync(context, camera34, (babylonCamera) => { + this._assignExtras(babylonCamera, camera34); + assign(babylonCamera); + }); + } + createMaterial(context, material30, babylonDrawMode) { + const babylonMaterial = this._loader.createMaterial(context, material30, babylonDrawMode); + this._assignExtras(babylonMaterial, material30); + return babylonMaterial; + } +} +var NAME31; +var init_ExtrasAsMetadata = __esm(() => { + init_glTFLoader2(); + NAME31 = "ExtrasAsMetadata"; + GLTFLoader2.RegisterExtension(NAME31, (loader) => new ExtrasAsMetadata(loader)); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/Extensions/index.js +var init_Extensions3 = __esm(() => { + init_EXT_lights_image_based(); + init_EXT_mesh_gpu_instancing(); + init_EXT_meshopt_compression(); + init_EXT_texture_webp(); + init_KHR_draco_mesh_compression(); + init_KHR_lights_punctual(); + init_KHR_materials_pbrSpecularGlossiness(); + init_KHR_materials_unlit(); + init_KHR_materials_clearcoat(); + init_KHR_materials_iridescence(); + init_KHR_materials_anisotropy(); + init_KHR_materials_emissive_strength(); + init_KHR_materials_sheen(); + init_KHR_materials_specular(); + init_KHR_materials_ior(); + init_KHR_materials_variants(); + init_KHR_materials_transmission(); + init_KHR_materials_translucency(); + init_KHR_materials_volume(); + init_KHR_materials_dispersion(); + init_KHR_mesh_quantization(); + init_KHR_texture_basisu(); + init_KHR_texture_transform(); + init_KHR_xmp_json_ld(); + init_KHR_animation_pointer(); + init_MSFT_audio_emitter(); + init_MSFT_lod(); + init_MSFT_minecraftMesh(); + init_MSFT_sRGBFactors(); + init_KHR_interactivity(); + init_ExtrasAsMetadata(); +}); + +// node_modules/@babylonjs/loaders/glTF/2.0/index.js +var exports_2 = {}; +__export(exports_2, { + MSFT_sRGBFactors: () => { + { + return MSFT_sRGBFactors; + } + }, + MSFT_minecraftMesh: () => { + { + return MSFT_minecraftMesh; + } + }, + MSFT_lod: () => { + { + return MSFT_lod; + } + }, + MSFT_audio_emitter: () => { + { + return MSFT_audio_emitter; + } + }, + KHR_xmp_json_ld: () => { + { + return KHR_xmp_json_ld; + } + }, + KHR_texture_transform: () => { + { + return KHR_texture_transform; + } + }, + KHR_texture_basisu: () => { + { + return KHR_texture_basisu; + } + }, + KHR_mesh_quantization: () => { + { + return KHR_mesh_quantization; + } + }, + KHR_materials_volume: () => { + { + return KHR_materials_volume; + } + }, + KHR_materials_variants: () => { + { + return KHR_materials_variants; + } + }, + KHR_materials_unlit: () => { + { + return KHR_materials_unlit; + } + }, + KHR_materials_transmission: () => { + { + return KHR_materials_transmission; + } + }, + KHR_materials_translucency: () => { + { + return KHR_materials_translucency; + } + }, + KHR_materials_specular: () => { + { + return KHR_materials_specular; + } + }, + KHR_materials_sheen: () => { + { + return KHR_materials_sheen; + } + }, + KHR_materials_pbrSpecularGlossiness: () => { + { + return KHR_materials_pbrSpecularGlossiness; + } + }, + KHR_materials_iridescence: () => { + { + return KHR_materials_iridescence; + } + }, + KHR_materials_ior: () => { + { + return KHR_materials_ior; + } + }, + KHR_materials_emissive_strength: () => { + { + return KHR_materials_emissive_strength; + } + }, + KHR_materials_dispersion: () => { + { + return KHR_materials_dispersion; + } + }, + KHR_materials_clearcoat: () => { + { + return KHR_materials_clearcoat; + } + }, + KHR_materials_anisotropy: () => { + { + return KHR_materials_anisotropy; + } + }, + KHR_lights: () => { + { + return KHR_lights; + } + }, + KHR_interactivity: () => { + { + return KHR_interactivity; + } + }, + KHR_draco_mesh_compression: () => { + { + return KHR_draco_mesh_compression; + } + }, + KHR_animation_pointer: () => { + { + return KHR_animation_pointer; + } + }, + GLTFLoader: () => { + { + return GLTFLoader2; + } + }, + ExtrasAsMetadata: () => { + { + return ExtrasAsMetadata; + } + }, + EXT_texture_webp: () => { + { + return EXT_texture_webp; + } + }, + EXT_meshopt_compression: () => { + { + return EXT_meshopt_compression; + } + }, + EXT_mesh_gpu_instancing: () => { + { + return EXT_mesh_gpu_instancing; + } + }, + EXT_lights_image_based: () => { + { + return EXT_lights_image_based; + } + }, + ArrayItem: () => { + { + return ArrayItem; + } + } +}); +var init_2 = __esm(() => { + init_glTFLoader2(); + init_glTFLoaderExtension(); + init_glTFLoaderInterfaces2(); + init_Extensions3(); +}); + +// node_modules/@babylonjs/loaders/glTF/index.js +var init_glTF = __esm(() => { + init_glTFFileLoader(); + init_glTFValidation(); + init_1(); + init_2(); +}); + +// node_modules/@babylonjs/materials/cell/cell.fragment.js +var name286, shader285; +var init_cell_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_lightsFragmentFunctions(); + init_shadowsFragmentFunctions(); + init_clipPlaneFragmentDeclaration(); + init_logDepthDeclaration(); + init_fogFragmentDeclaration(); + init_clipPlaneFragment(); + init_depthPrePass(); + init_lightFragment(); + init_logDepthFragment(); + init_fogFragment(); + init_imageProcessingCompatibility(); + name286 = "cellPixelShader"; + shader285 = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#ifdef VERTEXCOLOR +varying vec4 vColor; +#endif +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +#include +#include +#ifdef DIFFUSE +varying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos; +#endif +#include +#ifdef LOGARITHMICDEPTH +#extension GL_EXT_frag_depth : enable +#endif +#include +#include +vec3 computeCustomDiffuseLighting(lightingInfo info,vec3 diffuseBase,float shadow) +{diffuseBase=info.diffuse*shadow; +#ifdef CELLBASIC +float level=1.0;if (info.ndl<0.5) +level=0.5;diffuseBase.rgb*vec3(level,level,level); +#else +float ToonThresholds[4];ToonThresholds[0]=0.95;ToonThresholds[1]=0.5;ToonThresholds[2]=0.2;ToonThresholds[3]=0.03;float ToonBrightnessLevels[5];ToonBrightnessLevels[0]=1.0;ToonBrightnessLevels[1]=0.8;ToonBrightnessLevels[2]=0.6;ToonBrightnessLevels[3]=0.35;ToonBrightnessLevels[4]=0.2;if (info.ndl>ToonThresholds[0]) +{diffuseBase.rgb*=ToonBrightnessLevels[0];} +else if (info.ndl>ToonThresholds[1]) +{diffuseBase.rgb*=ToonBrightnessLevels[1];} +else if (info.ndl>ToonThresholds[2]) +{diffuseBase.rgb*=ToonBrightnessLevels[2];} +else if (info.ndl>ToonThresholds[3]) +{diffuseBase.rgb*=ToonBrightnessLevels[3];} +else +{diffuseBase.rgb*=ToonBrightnessLevels[4];} +#endif +return max(diffuseBase,vec3(0.2));} +#define CUSTOM_FRAGMENT_DEFINITIONS +void main(void) +{ +#define CUSTOM_FRAGMENT_MAIN_BEGIN +#include +vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a; +#ifdef DIFFUSE +baseColor=texture2D(diffuseSampler,vDiffuseUV); +#ifdef ALPHATEST +if (baseColor.a<0.4) +discard; +#endif +#include +baseColor.rgb*=vDiffuseInfos.y; +#endif +#ifdef VERTEXCOLOR +baseColor.rgb*=vColor.rgb; +#endif +#ifdef NORMAL +vec3 normalW=normalize(vNormalW); +#else +vec3 normalW=vec3(1.0,1.0,1.0); +#endif +lightingInfo info;vec3 diffuseBase=vec3(0.,0.,0.);float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.; +#ifdef SPECULARTERM +vec3 specularBase=vec3(0.,0.,0.); +#endif +#include[0..maxSimultaneousLights] +#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) +alpha*=vColor.a; +#endif +vec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha); +#include +#include +gl_FragColor=color; +#include +#define CUSTOM_FRAGMENT_MAIN_END +}`; + ShaderStore.ShadersStore[name286] = shader285; +}); + +// node_modules/@babylonjs/materials/cell/cell.vertex.js +var name287, shader286; +var init_cell_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_instancesDeclaration(); + init_clipPlaneVertexDeclaration(); + init_logDepthDeclaration(); + init_fogVertexDeclaration(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + init_fogVertex(); + init_shadowsVertex(); + init_vertexColorMixing(); + init_logDepthVertex(); + name287 = "cellVertexShader"; + shader286 = `precision highp float;attribute vec3 position; +#ifdef NORMAL +attribute vec3 normal; +#endif +#ifdef UV1 +attribute vec2 uv; +#endif +#ifdef UV2 +attribute vec2 uv2; +#endif +#ifdef VERTEXCOLOR +attribute vec4 color; +#endif +#include +#include +#include +uniform mat4 view;uniform mat4 viewProjection; +#ifdef DIFFUSE +varying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos; +#endif +#ifdef POINTSIZE +uniform float pointSize; +#endif +varying vec3 vPositionW; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#ifdef VERTEXCOLOR +varying vec4 vColor; +#endif +#include +#include +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +#define CUSTOM_VERTEX_DEFINITIONS +void main(void) { +#define CUSTOM_VERTEX_MAIN_BEGIN +#include +#include +#include +vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos); +#ifdef NORMAL +vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0))); +#endif +#ifndef UV1 +vec2 uv=vec2(0.,0.); +#endif +#ifndef UV2 +vec2 uv2=vec2(0.,0.); +#endif +#ifdef DIFFUSE +if (vDiffuseInfos.x==0.) +{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));} +else +{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));} +#endif +#include +#include +#include[0..maxSimultaneousLights] +#include +#if defined(POINTSIZE) && !defined(WEBGPU) +gl_PointSize=pointSize; +#endif +#include +#define CUSTOM_VERTEX_MAIN_END +} +`; + ShaderStore.ShadersStore[name287] = shader286; +}); + +// node_modules/@babylonjs/materials/cell/cellMaterial.js +class CellMaterialDefines extends MaterialDefines { + constructor() { + super(); + this.DIFFUSE = false; + this.CLIPPLANE = false; + this.CLIPPLANE2 = false; + this.CLIPPLANE3 = false; + this.CLIPPLANE4 = false; + this.CLIPPLANE5 = false; + this.CLIPPLANE6 = false; + this.ALPHATEST = false; + this.POINTSIZE = false; + this.FOG = false; + this.NORMAL = false; + this.UV1 = false; + this.UV2 = false; + this.VERTEXCOLOR = false; + this.VERTEXALPHA = false; + this.NUM_BONE_INFLUENCERS = 0; + this.BonesPerMesh = 0; + this.INSTANCES = false; + this.INSTANCESCOLOR = false; + this.NDOTL = true; + this.CUSTOMUSERLIGHTING = true; + this.CELLBASIC = true; + this.DEPTHPREPASS = false; + this.IMAGEPROCESSINGPOSTPROCESS = false; + this.SKIPFINALCOLORCLAMP = false; + this.LOGARITHMICDEPTH = false; + this.rebuild(); + } +} + +class CellMaterial extends PushMaterial { + constructor(name288, scene38) { + super(name288, scene38); + this.diffuseColor = new Color3(1, 1, 1); + this._computeHighLevel = false; + this._disableLighting = false; + this._maxSimultaneousLights = 4; + } + needAlphaBlending() { + return this.alpha < 1; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh80, subMesh11, useInstances) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady && subMesh11.effect._wasPreviouslyUsingInstances === useInstances) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new CellMaterialDefines; + } + const defines = subMesh11.materialDefines; + const scene38 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene38.getEngine(); + if (defines._areTexturesDirty) { + defines._needUVs = false; + if (scene38.texturesEnabled) { + if (this._diffuseTexture && MaterialFlags.DiffuseTextureEnabled) { + if (!this._diffuseTexture.isReady()) { + return false; + } else { + defines._needUVs = true; + defines.DIFFUSE = true; + } + } + } + } + defines.CELLBASIC = !this.computeHighLevel; + MaterialHelper.PrepareDefinesForMisc(mesh80, scene38, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh80), defines); + defines._needNormals = MaterialHelper.PrepareDefinesForLights(scene38, mesh80, defines, false, this._maxSimultaneousLights, this._disableLighting); + MaterialHelper.PrepareDefinesForFrameBoundValues(scene38, engine47, this, defines, useInstances ? true : false); + MaterialHelper.PrepareDefinesForAttributes(mesh80, defines, true, true); + if (defines.isDirty) { + defines.markAsProcessed(); + scene38.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh80); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene38.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + MaterialHelper.PrepareAttributesForBones(attribs, mesh80, defines, fallbacks); + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "cell"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "view", + "viewProjection", + "vEyePosition", + "vLightsType", + "vDiffuseColor", + "vFogInfos", + "vFogColor", + "pointSize", + "vDiffuseInfos", + "mBones", + "diffuseMatrix", + "logarithmicDepthConstant" + ]; + const samplers = ["diffuseSampler"]; + const uniformBuffers = []; + addClipPlaneUniforms(uniforms2); + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: this.maxSimultaneousLights + }); + subMesh11.setEffect(scene38.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights - 1 } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene38.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + subMesh11.effect._wasPreviouslyUsingInstances = !!useInstances; + return true; + } + bindForSubMesh(world, mesh80, subMesh11) { + const scene38 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect18 = subMesh11.effect; + if (!effect18) { + return; + } + this._activeEffect = effect18; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene38.getTransformMatrix()); + MaterialHelper.BindBonesParameters(mesh80, this._activeEffect); + if (this._mustRebind(scene38, effect18)) { + if (this._diffuseTexture && MaterialFlags.DiffuseTextureEnabled) { + this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture); + this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level); + this._activeEffect.setMatrix("diffuseMatrix", this._diffuseTexture.getTextureMatrix()); + } + bindClipPlane(this._activeEffect, this, scene38); + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + if (this._useLogarithmicDepth) { + MaterialHelper.BindLogDepth(defines, effect18, scene38); + } + scene38.bindEyePosition(effect18); + } + this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh80.visibility); + if (scene38.lightsEnabled && !this.disableLighting) { + MaterialHelper.BindLights(scene38, mesh80, this._activeEffect, defines, this._maxSimultaneousLights); + } + if (scene38.fogEnabled && mesh80.applyFog && scene38.fogMode !== Scene.FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene38.getViewMatrix()); + } + MaterialHelper.BindFogParameters(scene38, mesh80, this._activeEffect); + this._afterBind(mesh80, this._activeEffect); + } + getAnimatables() { + const results = []; + if (this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0) { + results.push(this._diffuseTexture); + } + return results; + } + getActiveTextures() { + const activeTextures = super.getActiveTextures(); + if (this._diffuseTexture) { + activeTextures.push(this._diffuseTexture); + } + return activeTextures; + } + hasTexture(texture88) { + if (super.hasTexture(texture88)) { + return true; + } + return this._diffuseTexture === texture88; + } + dispose(forceDisposeEffect) { + if (this._diffuseTexture) { + this._diffuseTexture.dispose(); + } + super.dispose(forceDisposeEffect); + } + getClassName() { + return "CellMaterial"; + } + clone(name288) { + return SerializationHelper.Clone(() => new CellMaterial(name288, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.CellMaterial"; + return serializationObject; + } + static Parse(source, scene38, rootUrl) { + return SerializationHelper.Parse(() => new CellMaterial(source.name, scene38), source, scene38, rootUrl); + } +} +var init_cellMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_color(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_materialFlags(); + init_buffer(); + init_scene(); + init_typeStore(); + init_cell_fragment(); + init_cell_vertex(); + init_effectFallbacks(); + init_clipPlaneMaterialHelper(); + __decorate2([ + serializeAsTexture("diffuseTexture") + ], CellMaterial.prototype, "_diffuseTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], CellMaterial.prototype, "diffuseTexture", undefined); + __decorate2([ + serializeAsColor3("diffuse") + ], CellMaterial.prototype, "diffuseColor", undefined); + __decorate2([ + serialize("computeHighLevel") + ], CellMaterial.prototype, "_computeHighLevel", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], CellMaterial.prototype, "computeHighLevel", undefined); + __decorate2([ + serialize("disableLighting") + ], CellMaterial.prototype, "_disableLighting", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], CellMaterial.prototype, "disableLighting", undefined); + __decorate2([ + serialize("maxSimultaneousLights") + ], CellMaterial.prototype, "_maxSimultaneousLights", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], CellMaterial.prototype, "maxSimultaneousLights", undefined); + RegisterClass("BABYLON.CellMaterial", CellMaterial); +}); + +// node_modules/@babylonjs/materials/cell/index.js +var init_cell = __esm(() => { + init_cellMaterial(); +}); + +// node_modules/@babylonjs/materials/custom/customMaterial.js +class CustomShaderStructure { + constructor() { + } +} + +class ShaderSpecialParts { + constructor() { + } +} + +class CustomMaterial extends StandardMaterial { + AttachAfterBind(mesh80, effect19) { + if (this._newUniformInstances) { + for (const el in this._newUniformInstances) { + const ea = el.toString().split("-"); + if (ea[0] == "vec2") { + effect19.setVector2(ea[1], this._newUniformInstances[el]); + } else if (ea[0] == "vec3") { + if (this._newUniformInstances[el] instanceof Color3) { + effect19.setColor3(ea[1], this._newUniformInstances[el]); + } else { + effect19.setVector3(ea[1], this._newUniformInstances[el]); + } + } else if (ea[0] == "vec4") { + if (this._newUniformInstances[el] instanceof Color4) { + effect19.setDirectColor4(ea[1], this._newUniformInstances[el]); + } else { + effect19.setVector4(ea[1], this._newUniformInstances[el]); + } + effect19.setVector4(ea[1], this._newUniformInstances[el]); + } else if (ea[0] == "mat4") { + effect19.setMatrix(ea[1], this._newUniformInstances[el]); + } else if (ea[0] == "float") { + effect19.setFloat(ea[1], this._newUniformInstances[el]); + } + } + } + if (this._newSamplerInstances) { + for (const el in this._newSamplerInstances) { + const ea = el.toString().split("-"); + if (ea[0] == "sampler2D" && this._newSamplerInstances[el].isReady && this._newSamplerInstances[el].isReady()) { + effect19.setTexture(ea[1], this._newSamplerInstances[el]); + } + } + } + } + ReviewUniform(name288, arr) { + if (name288 == "uniform" && this._newUniforms) { + for (let ind = 0;ind < this._newUniforms.length; ind++) { + if (this._customUniform[ind].indexOf("sampler") == -1) { + arr.push(this._newUniforms[ind].replace(/\[\d*\]/g, "")); + } + } + } + if (name288 == "sampler" && this._newUniforms) { + for (let ind = 0;ind < this._newUniforms.length; ind++) { + if (this._customUniform[ind].indexOf("sampler") != -1) { + arr.push(this._newUniforms[ind].replace(/\[\d*\]/g, "")); + } + } + } + return arr; + } + Builder(shaderName, uniforms2, uniformBuffers, samplers, defines, attributes) { + if (attributes && this._customAttributes && this._customAttributes.length > 0) { + attributes.push(...this._customAttributes); + } + this.ReviewUniform("uniform", uniforms2); + this.ReviewUniform("sampler", samplers); + const name288 = this._createdShaderName; + if (Effect.ShadersStore[name288 + "VertexShader"] && Effect.ShadersStore[name288 + "PixelShader"]) { + return name288; + } + Effect.ShadersStore[name288 + "VertexShader"] = this._injectCustomCode(this.VertexShader, "vertex"); + Effect.ShadersStore[name288 + "PixelShader"] = this._injectCustomCode(this.FragmentShader, "fragment"); + return name288; + } + _injectCustomCode(code, shaderType) { + const customCode = this._getCustomCode(shaderType); + for (const point in customCode) { + const injectedCode = customCode[point]; + if (injectedCode && injectedCode.length > 0) { + const fullPointName = "#define " + point; + code = code.replace(fullPointName, "\n" + injectedCode + "\n" + fullPointName); + } + } + return code; + } + _getCustomCode(shaderType) { + var _a, _b; + if (shaderType === "vertex") { + return { + CUSTOM_VERTEX_BEGIN: this.CustomParts.Vertex_Begin, + CUSTOM_VERTEX_DEFINITIONS: (((_a = this._customUniform) === null || _a === undefined ? undefined : _a.join("\n")) || "") + (this.CustomParts.Vertex_Definitions || ""), + CUSTOM_VERTEX_MAIN_BEGIN: this.CustomParts.Vertex_MainBegin, + CUSTOM_VERTEX_UPDATE_POSITION: this.CustomParts.Vertex_Before_PositionUpdated, + CUSTOM_VERTEX_UPDATE_NORMAL: this.CustomParts.Vertex_Before_NormalUpdated, + CUSTOM_VERTEX_MAIN_END: this.CustomParts.Vertex_MainEnd, + CUSTOM_VERTEX_UPDATE_WORLDPOS: this.CustomParts.Vertex_After_WorldPosComputed + }; + } + return { + CUSTOM_FRAGMENT_BEGIN: this.CustomParts.Fragment_Begin, + CUSTOM_FRAGMENT_DEFINITIONS: (((_b = this._customUniform) === null || _b === undefined ? undefined : _b.join("\n")) || "") + (this.CustomParts.Fragment_Definitions || ""), + CUSTOM_FRAGMENT_MAIN_BEGIN: this.CustomParts.Fragment_MainBegin, + CUSTOM_FRAGMENT_UPDATE_DIFFUSE: this.CustomParts.Fragment_Custom_Diffuse, + CUSTOM_FRAGMENT_UPDATE_ALPHA: this.CustomParts.Fragment_Custom_Alpha, + CUSTOM_FRAGMENT_BEFORE_LIGHTS: this.CustomParts.Fragment_Before_Lights, + CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR: this.CustomParts.Fragment_Before_FragColor, + CUSTOM_FRAGMENT_MAIN_END: this.CustomParts.Fragment_MainEnd, + CUSTOM_FRAGMENT_BEFORE_FOG: this.CustomParts.Fragment_Before_Fog + }; + } + constructor(name288, scene38) { + super(name288, scene38); + this.CustomParts = new ShaderSpecialParts; + this.customShaderNameResolve = this.Builder; + this.FragmentShader = Effect.ShadersStore["defaultPixelShader"]; + this.VertexShader = Effect.ShadersStore["defaultVertexShader"]; + CustomMaterial.ShaderIndexer++; + this._createdShaderName = "custom_" + CustomMaterial.ShaderIndexer; + } + _afterBind(mesh80, effect19 = null) { + if (!effect19) { + return; + } + this.AttachAfterBind(mesh80, effect19); + try { + super._afterBind(mesh80, effect19); + } catch (e) { + } + } + AddUniform(name288, kind, param) { + if (!this._customUniform) { + this._customUniform = new Array; + this._newUniforms = new Array; + this._newSamplerInstances = {}; + this._newUniformInstances = {}; + } + if (param) { + if (kind.indexOf("sampler") != -1) { + this._newSamplerInstances[kind + "-" + name288] = param; + } else { + this._newUniformInstances[kind + "-" + name288] = param; + } + } + this._customUniform.push("uniform " + kind + " " + name288 + ";"); + this._newUniforms.push(name288); + return this; + } + AddAttribute(name288) { + if (!this._customAttributes) { + this._customAttributes = []; + } + this._customAttributes.push(name288); + return this; + } + Fragment_Begin(shaderPart) { + this.CustomParts.Fragment_Begin = shaderPart; + return this; + } + Fragment_Definitions(shaderPart) { + this.CustomParts.Fragment_Definitions = shaderPart; + return this; + } + Fragment_MainBegin(shaderPart) { + this.CustomParts.Fragment_MainBegin = shaderPart; + return this; + } + Fragment_MainEnd(shaderPart) { + this.CustomParts.Fragment_MainEnd = shaderPart; + return this; + } + Fragment_Custom_Diffuse(shaderPart) { + this.CustomParts.Fragment_Custom_Diffuse = shaderPart.replace("result", "diffuseColor"); + return this; + } + Fragment_Custom_Alpha(shaderPart) { + this.CustomParts.Fragment_Custom_Alpha = shaderPart.replace("result", "alpha"); + return this; + } + Fragment_Before_Lights(shaderPart) { + this.CustomParts.Fragment_Before_Lights = shaderPart; + return this; + } + Fragment_Before_Fog(shaderPart) { + this.CustomParts.Fragment_Before_Fog = shaderPart; + return this; + } + Fragment_Before_FragColor(shaderPart) { + this.CustomParts.Fragment_Before_FragColor = shaderPart.replace("result", "color"); + return this; + } + Vertex_Begin(shaderPart) { + this.CustomParts.Vertex_Begin = shaderPart; + return this; + } + Vertex_Definitions(shaderPart) { + this.CustomParts.Vertex_Definitions = shaderPart; + return this; + } + Vertex_MainBegin(shaderPart) { + this.CustomParts.Vertex_MainBegin = shaderPart; + return this; + } + Vertex_Before_PositionUpdated(shaderPart) { + this.CustomParts.Vertex_Before_PositionUpdated = shaderPart.replace("result", "positionUpdated"); + return this; + } + Vertex_Before_NormalUpdated(shaderPart) { + this.CustomParts.Vertex_Before_NormalUpdated = shaderPart.replace("result", "normalUpdated"); + return this; + } + Vertex_After_WorldPosComputed(shaderPart) { + this.CustomParts.Vertex_After_WorldPosComputed = shaderPart; + return this; + } + Vertex_MainEnd(shaderPart) { + this.CustomParts.Vertex_MainEnd = shaderPart; + return this; + } +} +var init_customMaterial = __esm(() => { + init_effect(); + init_standardMaterial(); + init_typeStore(); + init_math_color(); + CustomMaterial.ShaderIndexer = 1; + RegisterClass("BABYLON.CustomMaterial", CustomMaterial); +}); + +// node_modules/@babylonjs/materials/custom/pbrCustomMaterial.js +class ShaderAlbedoParts { + constructor() { + } +} + +class PBRCustomMaterial extends PBRMaterial { + AttachAfterBind(mesh80, effect20) { + if (this._newUniformInstances) { + for (const el in this._newUniformInstances) { + const ea = el.toString().split("-"); + if (ea[0] == "vec2") { + effect20.setVector2(ea[1], this._newUniformInstances[el]); + } else if (ea[0] == "vec3") { + if (this._newUniformInstances[el] instanceof Color3) { + effect20.setColor3(ea[1], this._newUniformInstances[el]); + } else { + effect20.setVector3(ea[1], this._newUniformInstances[el]); + } + } else if (ea[0] == "vec4") { + if (this._newUniformInstances[el] instanceof Color4) { + effect20.setDirectColor4(ea[1], this._newUniformInstances[el]); + } else { + effect20.setVector4(ea[1], this._newUniformInstances[el]); + } + effect20.setVector4(ea[1], this._newUniformInstances[el]); + } else if (ea[0] == "mat4") { + effect20.setMatrix(ea[1], this._newUniformInstances[el]); + } else if (ea[0] == "float") { + effect20.setFloat(ea[1], this._newUniformInstances[el]); + } + } + } + if (this._newSamplerInstances) { + for (const el in this._newSamplerInstances) { + const ea = el.toString().split("-"); + if (ea[0] == "sampler2D" && this._newSamplerInstances[el].isReady && this._newSamplerInstances[el].isReady()) { + effect20.setTexture(ea[1], this._newSamplerInstances[el]); + } + } + } + } + ReviewUniform(name288, arr) { + if (name288 == "uniform" && this._newUniforms) { + for (let ind = 0;ind < this._newUniforms.length; ind++) { + if (this._customUniform[ind].indexOf("sampler") == -1) { + arr.push(this._newUniforms[ind].replace(/\[\d*\]/g, "")); + } + } + } + if (name288 == "sampler" && this._newUniforms) { + for (let ind = 0;ind < this._newUniforms.length; ind++) { + if (this._customUniform[ind].indexOf("sampler") != -1) { + arr.push(this._newUniforms[ind].replace(/\[\d*\]/g, "")); + } + } + } + return arr; + } + Builder(shaderName, uniforms2, uniformBuffers, samplers, defines, attributes, options) { + if (options) { + const currentProcessing = options.processFinalCode; + options.processFinalCode = (type, code) => { + if (type === "vertex") { + return currentProcessing ? currentProcessing(type, code) : code; + } + const sci = new ShaderCodeInliner(code); + sci.inlineToken = "#define pbr_inline"; + sci.processCode(); + return currentProcessing ? currentProcessing(type, sci.code) : sci.code; + }; + } + if (attributes && this._customAttributes && this._customAttributes.length > 0) { + attributes.push(...this._customAttributes); + } + this.ReviewUniform("uniform", uniforms2); + this.ReviewUniform("sampler", samplers); + const name288 = this._createdShaderName; + if (Effect.ShadersStore[name288 + "VertexShader"] && Effect.ShadersStore[name288 + "PixelShader"]) { + return name288; + } + Effect.ShadersStore[name288 + "VertexShader"] = this._injectCustomCode(this.VertexShader, "vertex"); + Effect.ShadersStore[name288 + "PixelShader"] = this._injectCustomCode(this.FragmentShader, "fragment"); + return name288; + } + _injectCustomCode(code, shaderType) { + const customCode = this._getCustomCode(shaderType); + for (const point in customCode) { + const injectedCode = customCode[point]; + if (injectedCode && injectedCode.length > 0) { + const fullPointName = "#define " + point; + code = code.replace(fullPointName, "\n" + injectedCode + "\n" + fullPointName); + } + } + return code; + } + _getCustomCode(shaderType) { + var _a, _b; + if (shaderType === "vertex") { + return { + CUSTOM_VERTEX_BEGIN: this.CustomParts.Vertex_Begin, + CUSTOM_VERTEX_DEFINITIONS: (((_a = this._customUniform) === null || _a === undefined ? undefined : _a.join("\n")) || "") + (this.CustomParts.Vertex_Definitions || ""), + CUSTOM_VERTEX_MAIN_BEGIN: this.CustomParts.Vertex_MainBegin, + CUSTOM_VERTEX_UPDATE_POSITION: this.CustomParts.Vertex_Before_PositionUpdated, + CUSTOM_VERTEX_UPDATE_NORMAL: this.CustomParts.Vertex_Before_NormalUpdated, + CUSTOM_VERTEX_MAIN_END: this.CustomParts.Vertex_MainEnd, + CUSTOM_VERTEX_UPDATE_WORLDPOS: this.CustomParts.Vertex_After_WorldPosComputed + }; + } + return { + CUSTOM_FRAGMENT_BEGIN: this.CustomParts.Fragment_Begin, + CUSTOM_FRAGMENT_MAIN_BEGIN: this.CustomParts.Fragment_MainBegin, + CUSTOM_FRAGMENT_DEFINITIONS: (((_b = this._customUniform) === null || _b === undefined ? undefined : _b.join("\n")) || "") + (this.CustomParts.Fragment_Definitions || ""), + CUSTOM_FRAGMENT_UPDATE_ALBEDO: this.CustomParts.Fragment_Custom_Albedo, + CUSTOM_FRAGMENT_UPDATE_ALPHA: this.CustomParts.Fragment_Custom_Alpha, + CUSTOM_FRAGMENT_BEFORE_LIGHTS: this.CustomParts.Fragment_Before_Lights, + CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS: this.CustomParts.Fragment_Custom_MetallicRoughness, + CUSTOM_FRAGMENT_UPDATE_MICROSURFACE: this.CustomParts.Fragment_Custom_MicroSurface, + CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION: this.CustomParts.Fragment_Before_FinalColorComposition, + CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR: this.CustomParts.Fragment_Before_FragColor, + CUSTOM_FRAGMENT_MAIN_END: this.CustomParts.Fragment_MainEnd, + CUSTOM_FRAGMENT_BEFORE_FOG: this.CustomParts.Fragment_Before_Fog + }; + } + constructor(name288, scene38) { + super(name288, scene38); + this.CustomParts = new ShaderAlbedoParts; + this.customShaderNameResolve = this.Builder; + this.FragmentShader = Effect.ShadersStore["pbrPixelShader"]; + this.VertexShader = Effect.ShadersStore["pbrVertexShader"]; + this.FragmentShader = this.FragmentShader.replace(/#include/g, Effect.IncludesShadersStore["pbrBlockAlbedoOpacity"]); + this.FragmentShader = this.FragmentShader.replace(/#include/g, Effect.IncludesShadersStore["pbrBlockReflectivity"]); + this.FragmentShader = this.FragmentShader.replace(/#include/g, Effect.IncludesShadersStore["pbrBlockFinalColorComposition"]); + PBRCustomMaterial.ShaderIndexer++; + this._createdShaderName = "custompbr_" + PBRCustomMaterial.ShaderIndexer; + } + _afterBind(mesh80, effect20 = null) { + if (!effect20) { + return; + } + this.AttachAfterBind(mesh80, effect20); + try { + super._afterBind(mesh80, effect20); + } catch (e) { + } + } + AddUniform(name288, kind, param) { + if (!this._customUniform) { + this._customUniform = new Array; + this._newUniforms = new Array; + this._newSamplerInstances = {}; + this._newUniformInstances = {}; + } + if (param) { + if (kind.indexOf("sampler") != -1) { + this._newSamplerInstances[kind + "-" + name288] = param; + } else { + this._newUniformInstances[kind + "-" + name288] = param; + } + } + this._customUniform.push("uniform " + kind + " " + name288 + ";"); + this._newUniforms.push(name288); + return this; + } + AddAttribute(name288) { + if (!this._customAttributes) { + this._customAttributes = []; + } + this._customAttributes.push(name288); + return this; + } + Fragment_Begin(shaderPart) { + this.CustomParts.Fragment_Begin = shaderPart; + return this; + } + Fragment_Definitions(shaderPart) { + this.CustomParts.Fragment_Definitions = shaderPart; + return this; + } + Fragment_MainBegin(shaderPart) { + this.CustomParts.Fragment_MainBegin = shaderPart; + return this; + } + Fragment_Custom_Albedo(shaderPart) { + this.CustomParts.Fragment_Custom_Albedo = shaderPart.replace("result", "surfaceAlbedo"); + return this; + } + Fragment_Custom_Alpha(shaderPart) { + this.CustomParts.Fragment_Custom_Alpha = shaderPart.replace("result", "alpha"); + return this; + } + Fragment_Before_Lights(shaderPart) { + this.CustomParts.Fragment_Before_Lights = shaderPart; + return this; + } + Fragment_Custom_MetallicRoughness(shaderPart) { + this.CustomParts.Fragment_Custom_MetallicRoughness = shaderPart; + return this; + } + Fragment_Custom_MicroSurface(shaderPart) { + this.CustomParts.Fragment_Custom_MicroSurface = shaderPart; + return this; + } + Fragment_Before_Fog(shaderPart) { + this.CustomParts.Fragment_Before_Fog = shaderPart; + return this; + } + Fragment_Before_FinalColorComposition(shaderPart) { + this.CustomParts.Fragment_Before_FinalColorComposition = shaderPart; + return this; + } + Fragment_Before_FragColor(shaderPart) { + this.CustomParts.Fragment_Before_FragColor = shaderPart.replace("result", "color"); + return this; + } + Fragment_MainEnd(shaderPart) { + this.CustomParts.Fragment_MainEnd = shaderPart; + return this; + } + Vertex_Begin(shaderPart) { + this.CustomParts.Vertex_Begin = shaderPart; + return this; + } + Vertex_Definitions(shaderPart) { + this.CustomParts.Vertex_Definitions = shaderPart; + return this; + } + Vertex_MainBegin(shaderPart) { + this.CustomParts.Vertex_MainBegin = shaderPart; + return this; + } + Vertex_Before_PositionUpdated(shaderPart) { + this.CustomParts.Vertex_Before_PositionUpdated = shaderPart.replace("result", "positionUpdated"); + return this; + } + Vertex_Before_NormalUpdated(shaderPart) { + this.CustomParts.Vertex_Before_NormalUpdated = shaderPart.replace("result", "normalUpdated"); + return this; + } + Vertex_After_WorldPosComputed(shaderPart) { + this.CustomParts.Vertex_After_WorldPosComputed = shaderPart; + return this; + } + Vertex_MainEnd(shaderPart) { + this.CustomParts.Vertex_MainEnd = shaderPart; + return this; + } +} +var ShaderAlebdoParts; +var init_pbrCustomMaterial = __esm(() => { + init_effect(); + init_pbrMaterial(); + init_typeStore(); + init_shaderCodeInliner(); + init_math_color(); + ShaderAlebdoParts = ShaderAlbedoParts; + PBRCustomMaterial.ShaderIndexer = 1; + RegisterClass("BABYLON.PBRCustomMaterial", PBRCustomMaterial); +}); + +// node_modules/@babylonjs/materials/custom/index.js +var init_custom = __esm(() => { + init_customMaterial(); + init_pbrCustomMaterial(); +}); + +// node_modules/@babylonjs/materials/fire/fire.fragment.js +var name288, shader287; +var init_fire_fragment = __esm(() => { + init_shaderStore(); + init_clipPlaneFragmentDeclaration(); + init_logDepthDeclaration(); + init_fogFragmentDeclaration(); + init_clipPlaneFragment(); + init_depthPrePass(); + init_logDepthFragment(); + init_fogFragment(); + init_imageProcessingCompatibility(); + name288 = "firePixelShader"; + shader287 = `precision highp float;uniform vec4 vEyePosition;varying vec3 vPositionW; +#ifdef VERTEXCOLOR +varying vec4 vColor; +#endif +#ifdef DIFFUSE +varying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos; +#endif +uniform sampler2D distortionSampler;uniform sampler2D opacitySampler; +#ifdef DIFFUSE +varying vec2 vDistortionCoords1;varying vec2 vDistortionCoords2;varying vec2 vDistortionCoords3; +#endif +#include +#ifdef LOGARITHMICDEPTH +#extension GL_EXT_frag_depth : enable +#endif +#include +#include +vec4 bx2(vec4 x) +{return vec4(2.0)*x-vec4(1.0);} +#define CUSTOM_FRAGMENT_DEFINITIONS +void main(void) { +#define CUSTOM_FRAGMENT_MAIN_BEGIN +#include +vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);float alpha=1.0; +#ifdef DIFFUSE +const float distortionAmount0 =0.092;const float distortionAmount1 =0.092;const float distortionAmount2 =0.092;vec2 heightAttenuation=vec2(0.3,0.39);vec4 noise0=texture2D(distortionSampler,vDistortionCoords1);vec4 noise1=texture2D(distortionSampler,vDistortionCoords2);vec4 noise2=texture2D(distortionSampler,vDistortionCoords3);vec4 noiseSum=bx2(noise0)*distortionAmount0+bx2(noise1)*distortionAmount1+bx2(noise2)*distortionAmount2;vec4 perturbedBaseCoords=vec4(vDiffuseUV,0.0,1.0)+noiseSum*(vDiffuseUV.y*heightAttenuation.x+heightAttenuation.y);vec4 opacityColor=texture2D(opacitySampler,perturbedBaseCoords.xy); +#ifdef ALPHATEST +if (opacityColor.r<0.1) +discard; +#endif +#include +baseColor=texture2D(diffuseSampler,perturbedBaseCoords.xy)*2.0;baseColor*=opacityColor;baseColor.rgb*=vDiffuseInfos.y; +#endif +#ifdef VERTEXCOLOR +baseColor.rgb*=vColor.rgb; +#endif +vec3 diffuseBase=vec3(1.0,1.0,1.0); +#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) +alpha*=vColor.a; +#endif +vec4 color=vec4(baseColor.rgb,alpha); +#include +#include +gl_FragColor=color; +#include +#define CUSTOM_FRAGMENT_MAIN_END +}`; + ShaderStore.ShadersStore[name288] = shader287; +}); + +// node_modules/@babylonjs/materials/fire/fire.vertex.js +var name289, shader288; +var init_fire_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_instancesDeclaration(); + init_clipPlaneVertexDeclaration(); + init_logDepthDeclaration(); + init_fogVertexDeclaration(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + init_logDepthVertex(); + init_fogVertex(); + init_vertexColorMixing(); + name289 = "fireVertexShader"; + shader288 = `precision highp float;attribute vec3 position; +#ifdef UV1 +attribute vec2 uv; +#endif +#ifdef UV2 +attribute vec2 uv2; +#endif +#ifdef VERTEXCOLOR +attribute vec4 color; +#endif +#include +#include +#include +uniform mat4 view;uniform mat4 viewProjection; +#ifdef DIFFUSE +varying vec2 vDiffuseUV; +#endif +#ifdef POINTSIZE +uniform float pointSize; +#endif +varying vec3 vPositionW; +#ifdef VERTEXCOLOR +varying vec4 vColor; +#endif +#include +#include +#include +uniform float time;uniform float speed; +#ifdef DIFFUSE +varying vec2 vDistortionCoords1;varying vec2 vDistortionCoords2;varying vec2 vDistortionCoords3; +#endif +#define CUSTOM_VERTEX_DEFINITIONS +void main(void) { +#define CUSTOM_VERTEX_MAIN_BEGIN +#include +#include +#include +vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos); +#ifdef DIFFUSE +vDiffuseUV=uv;vDiffuseUV.y-=0.2; +#endif +#include +#include +#include +#include +#if defined(POINTSIZE) && !defined(WEBGPU) +gl_PointSize=pointSize; +#endif +#ifdef DIFFUSE +vec3 layerSpeed=vec3(-0.2,-0.52,-0.1)*speed;vDistortionCoords1.x=uv.x;vDistortionCoords1.y=uv.y+layerSpeed.x*time/1000.0;vDistortionCoords2.x=uv.x;vDistortionCoords2.y=uv.y+layerSpeed.y*time/1000.0;vDistortionCoords3.x=uv.x;vDistortionCoords3.y=uv.y+layerSpeed.z*time/1000.0; +#endif +#define CUSTOM_VERTEX_MAIN_END +} +`; + ShaderStore.ShadersStore[name289] = shader288; +}); + +// node_modules/@babylonjs/materials/fire/fireMaterial.js +class FireMaterialDefines extends MaterialDefines { + constructor() { + super(); + this.DIFFUSE = false; + this.CLIPPLANE = false; + this.CLIPPLANE2 = false; + this.CLIPPLANE3 = false; + this.CLIPPLANE4 = false; + this.CLIPPLANE5 = false; + this.CLIPPLANE6 = false; + this.ALPHATEST = false; + this.DEPTHPREPASS = false; + this.POINTSIZE = false; + this.FOG = false; + this.UV1 = false; + this.VERTEXCOLOR = false; + this.VERTEXALPHA = false; + this.BonesPerMesh = 0; + this.NUM_BONE_INFLUENCERS = 0; + this.INSTANCES = false; + this.INSTANCESCOLOR = false; + this.IMAGEPROCESSINGPOSTPROCESS = false; + this.SKIPFINALCOLORCLAMP = false; + this.LOGARITHMICDEPTH = false; + this.rebuild(); + } +} + +class FireMaterial extends PushMaterial { + constructor(name290, scene39) { + super(name290, scene39); + this.diffuseColor = new Color3(1, 1, 1); + this.speed = 1; + this._scaledDiffuse = new Color3; + this._lastTime = 0; + } + needAlphaBlending() { + return false; + } + needAlphaTesting() { + return true; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh80, subMesh11, useInstances) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady && subMesh11.effect._wasPreviouslyUsingInstances === useInstances) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new FireMaterialDefines; + } + const defines = subMesh11.materialDefines; + const scene39 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene39.getEngine(); + if (defines._areTexturesDirty) { + defines._needUVs = false; + if (this._diffuseTexture && MaterialFlags.DiffuseTextureEnabled) { + if (!this._diffuseTexture.isReady()) { + return false; + } else { + defines._needUVs = true; + defines.DIFFUSE = true; + } + } + } + defines.ALPHATEST = this._opacityTexture ? true : false; + if (defines._areMiscDirty) { + defines.POINTSIZE = this.pointsCloud || scene39.forcePointsCloud; + defines.FOG = scene39.fogEnabled && mesh80.applyFog && scene39.fogMode !== Scene.FOGMODE_NONE && this.fogEnabled; + defines.LOGARITHMICDEPTH = this._useLogarithmicDepth; + } + MaterialHelper.PrepareDefinesForFrameBoundValues(scene39, engine47, this, defines, useInstances ? true : false); + MaterialHelper.PrepareDefinesForAttributes(mesh80, defines, false, true); + if (defines.isDirty) { + defines.markAsProcessed(); + scene39.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh80); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene39.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + MaterialHelper.PrepareAttributesForBones(attribs, mesh80, defines, fallbacks); + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "fire"; + const uniforms2 = [ + "world", + "view", + "viewProjection", + "vEyePosition", + "vFogInfos", + "vFogColor", + "pointSize", + "vDiffuseInfos", + "mBones", + "diffuseMatrix", + "logarithmicDepthConstant", + "time", + "speed" + ]; + addClipPlaneUniforms(uniforms2); + const join = defines.toString(); + subMesh11.setEffect(scene39.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: [], + samplers: [ + "diffuseSampler", + "distortionSampler", + "opacitySampler" + ], + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: null, + maxSimultaneousLights: 4, + transformFeedbackVaryings: null + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene39.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + subMesh11.effect._wasPreviouslyUsingInstances = !!useInstances; + return true; + } + bindForSubMesh(world, mesh80, subMesh11) { + const scene39 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene39.getTransformMatrix()); + MaterialHelper.BindBonesParameters(mesh80, this._activeEffect); + if (this._mustRebind(scene39, effect20)) { + if (this._diffuseTexture && MaterialFlags.DiffuseTextureEnabled) { + this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture); + this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level); + this._activeEffect.setMatrix("diffuseMatrix", this._diffuseTexture.getTextureMatrix()); + this._activeEffect.setTexture("distortionSampler", this._distortionTexture); + this._activeEffect.setTexture("opacitySampler", this._opacityTexture); + } + bindClipPlane(this._activeEffect, this, scene39); + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + if (this._useLogarithmicDepth) { + MaterialHelper.BindLogDepth(defines, effect20, scene39); + } + scene39.bindEyePosition(effect20); + } + this._activeEffect.setColor4("vDiffuseColor", this._scaledDiffuse, this.alpha * mesh80.visibility); + if (scene39.fogEnabled && mesh80.applyFog && scene39.fogMode !== Scene.FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene39.getViewMatrix()); + } + MaterialHelper.BindFogParameters(scene39, mesh80, this._activeEffect); + this._lastTime += scene39.getEngine().getDeltaTime(); + this._activeEffect.setFloat("time", this._lastTime); + this._activeEffect.setFloat("speed", this.speed); + this._afterBind(mesh80, this._activeEffect); + } + getAnimatables() { + const results = []; + if (this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0) { + results.push(this._diffuseTexture); + } + if (this._distortionTexture && this._distortionTexture.animations && this._distortionTexture.animations.length > 0) { + results.push(this._distortionTexture); + } + if (this._opacityTexture && this._opacityTexture.animations && this._opacityTexture.animations.length > 0) { + results.push(this._opacityTexture); + } + return results; + } + getActiveTextures() { + const activeTextures = super.getActiveTextures(); + if (this._diffuseTexture) { + activeTextures.push(this._diffuseTexture); + } + if (this._distortionTexture) { + activeTextures.push(this._distortionTexture); + } + if (this._opacityTexture) { + activeTextures.push(this._opacityTexture); + } + return activeTextures; + } + hasTexture(texture89) { + if (super.hasTexture(texture89)) { + return true; + } + if (this._diffuseTexture === texture89) { + return true; + } + if (this._distortionTexture === texture89) { + return true; + } + if (this._opacityTexture === texture89) { + return true; + } + return false; + } + getClassName() { + return "FireMaterial"; + } + dispose(forceDisposeEffect) { + if (this._diffuseTexture) { + this._diffuseTexture.dispose(); + } + if (this._distortionTexture) { + this._distortionTexture.dispose(); + } + super.dispose(forceDisposeEffect); + } + clone(name290) { + return SerializationHelper.Clone(() => new FireMaterial(name290, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.FireMaterial"; + serializationObject.diffuseColor = this.diffuseColor.asArray(); + serializationObject.speed = this.speed; + if (this._diffuseTexture) { + serializationObject._diffuseTexture = this._diffuseTexture.serialize(); + } + if (this._distortionTexture) { + serializationObject._distortionTexture = this._distortionTexture.serialize(); + } + if (this._opacityTexture) { + serializationObject._opacityTexture = this._opacityTexture.serialize(); + } + return serializationObject; + } + static Parse(source, scene39, rootUrl) { + const material30 = new FireMaterial(source.name, scene39); + material30.diffuseColor = Color3.FromArray(source.diffuseColor); + material30.speed = source.speed; + material30.alpha = source.alpha; + material30.id = source.id; + Tags.AddTagsTo(material30, source.tags); + material30.backFaceCulling = source.backFaceCulling; + material30.wireframe = source.wireframe; + if (source._diffuseTexture) { + material30._diffuseTexture = Texture.Parse(source._diffuseTexture, scene39, rootUrl); + } + if (source._distortionTexture) { + material30._distortionTexture = Texture.Parse(source._distortionTexture, scene39, rootUrl); + } + if (source._opacityTexture) { + material30._opacityTexture = Texture.Parse(source._opacityTexture, scene39, rootUrl); + } + return material30; + } +} +var init_fireMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_color(); + init_tags(); + init_texture(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_materialFlags(); + init_buffer(); + init_scene(); + init_typeStore(); + init_fire_fragment(); + init_fire_vertex(); + init_effectFallbacks(); + init_clipPlaneMaterialHelper(); + __decorate2([ + serializeAsTexture("diffuseTexture") + ], FireMaterial.prototype, "_diffuseTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], FireMaterial.prototype, "diffuseTexture", undefined); + __decorate2([ + serializeAsTexture("distortionTexture") + ], FireMaterial.prototype, "_distortionTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], FireMaterial.prototype, "distortionTexture", undefined); + __decorate2([ + serializeAsTexture("opacityTexture") + ], FireMaterial.prototype, "_opacityTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], FireMaterial.prototype, "opacityTexture", undefined); + __decorate2([ + serializeAsColor3("diffuse") + ], FireMaterial.prototype, "diffuseColor", undefined); + __decorate2([ + serialize() + ], FireMaterial.prototype, "speed", undefined); + RegisterClass("BABYLON.FireMaterial", FireMaterial); +}); + +// node_modules/@babylonjs/materials/fire/index.js +var init_fire = __esm(() => { + init_fireMaterial(); +}); + +// node_modules/@babylonjs/materials/fur/fur.fragment.js +var name290, shader289; +var init_fur_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_logDepthDeclaration(); + init_lightsFragmentFunctions(); + init_shadowsFragmentFunctions(); + init_fogFragmentDeclaration(); + init_clipPlaneFragmentDeclaration(); + init_clipPlaneFragment(); + init_depthPrePass(); + init_lightFragment(); + init_logDepthFragment(); + init_fogFragment(); + init_imageProcessingCompatibility(); + name290 = "furPixelShader"; + shader289 = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;uniform vec4 furColor;uniform float furLength;varying vec3 vPositionW;varying float vfur_length; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#ifdef VERTEXCOLOR +varying vec4 vColor; +#endif +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +#ifdef DIFFUSE +varying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos; +#endif +#ifdef HIGHLEVEL +uniform float furOffset;uniform float furOcclusion;uniform sampler2D furTexture;varying vec2 vFurUV; +#endif +#ifdef LOGARITHMICDEPTH +#extension GL_EXT_frag_depth : enable +#endif +#include +#include +#include +#include +#include +float Rand(vec3 rv) {float x=dot(rv,vec3(12.9898,78.233,24.65487));return fract(sin(x)*43758.5453);} +#define CUSTOM_FRAGMENT_DEFINITIONS +void main(void) { +#define CUSTOM_FRAGMENT_MAIN_BEGIN +#include +vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=furColor;vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a; +#ifdef DIFFUSE +baseColor*=texture2D(diffuseSampler,vDiffuseUV); +#ifdef ALPHATEST +if (baseColor.a<0.4) +discard; +#endif +#include +baseColor.rgb*=vDiffuseInfos.y; +#endif +#ifdef VERTEXCOLOR +baseColor.rgb*=vColor.rgb; +#endif +#ifdef NORMAL +vec3 normalW=normalize(vNormalW); +#else +vec3 normalW=vec3(1.0,1.0,1.0); +#endif +#ifdef HIGHLEVEL +vec4 furTextureColor=texture2D(furTexture,vec2(vFurUV.x,vFurUV.y));if (furTextureColor.a<=0.0 || furTextureColor.g[0..maxSimultaneousLights] +#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) +alpha*=vColor.a; +#endif +vec3 finalDiffuse=clamp(diffuseBase.rgb*baseColor.rgb,0.0,1.0); +#ifdef HIGHLEVEL +vec4 color=vec4(finalDiffuse,alpha); +#else +float r=vfur_length/furLength*0.5;vec4 color=vec4(finalDiffuse*(0.5+r),alpha); +#endif +#include +#include +gl_FragColor=color; +#include +#define CUSTOM_FRAGMENT_MAIN_END +}`; + ShaderStore.ShadersStore[name290] = shader289; +}); + +// node_modules/@babylonjs/materials/fur/fur.vertex.js +var name291, shader290; +var init_fur_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_instancesDeclaration(); + init_clipPlaneVertexDeclaration(); + init_logDepthDeclaration(); + init_fogVertexDeclaration(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + init_logDepthVertex(); + init_fogVertex(); + init_shadowsVertex(); + init_vertexColorMixing(); + name291 = "furVertexShader"; + shader290 = `precision highp float;attribute vec3 position;attribute vec3 normal; +#ifdef UV1 +attribute vec2 uv; +#endif +#ifdef UV2 +attribute vec2 uv2; +#endif +#ifdef VERTEXCOLOR +attribute vec4 color; +#endif +#include +#include +uniform float furLength;uniform float furAngle; +#ifdef HIGHLEVEL +uniform float furOffset;uniform vec3 furGravity;uniform float furTime;uniform float furSpacing;uniform float furDensity; +#endif +#ifdef HEIGHTMAP +uniform sampler2D heightTexture; +#endif +#ifdef HIGHLEVEL +varying vec2 vFurUV; +#endif +#include +uniform mat4 view;uniform mat4 viewProjection; +#ifdef DIFFUSE +varying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos; +#endif +#ifdef POINTSIZE +uniform float pointSize; +#endif +varying vec3 vPositionW; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +varying float vfur_length; +#ifdef VERTEXCOLOR +varying vec4 vColor; +#endif +#include +#include +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +float Rand(vec3 rv) {float x=dot(rv,vec3(12.9898,78.233,24.65487));return fract(sin(x)*43758.5453);} +#define CUSTOM_VERTEX_DEFINITIONS +void main(void) { +#define CUSTOM_VERTEX_MAIN_BEGIN +#include +#include +#include +float r=Rand(position); +#ifdef HEIGHTMAP +#if __VERSION__>100 +vfur_length=furLength*texture(heightTexture,uv).x; +#else +vfur_length=furLength*texture2D(heightTexture,uv).r; +#endif +#else +vfur_length=(furLength*r); +#endif +vec3 tangent1=vec3(normal.y,-normal.x,0);vec3 tangent2=vec3(-normal.z,0,normal.x);r=Rand(tangent1*r);float J=(2.0+4.0*r);r=Rand(tangent2*r);float K=(2.0+2.0*r);tangent1=tangent1*J+tangent2*K;tangent1=normalize(tangent1);vec3 newPosition=position+normal*vfur_length*cos(furAngle)+tangent1*vfur_length*sin(furAngle); +#ifdef HIGHLEVEL +vec3 forceDirection=vec3(0.0,0.0,0.0);forceDirection.x=sin(furTime+position.x*0.05)*0.2;forceDirection.y=cos(furTime*0.7+position.y*0.04)*0.2;forceDirection.z=sin(furTime*0.7+position.z*0.04)*0.2;vec3 displacement=vec3(0.0,0.0,0.0);displacement=furGravity+forceDirection;float displacementFactor=pow(furOffset,3.0);vec3 aNormal=normal;aNormal.xyz+=displacement*displacementFactor;newPosition=vec3(newPosition.x,newPosition.y,newPosition.z)+(normalize(aNormal)*furOffset*furSpacing); +#endif +#ifdef NORMAL +vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0))); +#endif +gl_Position=viewProjection*finalWorld*vec4(newPosition,1.0);vec4 worldPos=finalWorld*vec4(newPosition,1.0);vPositionW=vec3(worldPos); +#ifndef UV1 +vec2 uv=vec2(0.,0.); +#endif +#ifndef UV2 +vec2 uv2=vec2(0.,0.); +#endif +#ifdef DIFFUSE +if (vDiffuseInfos.x==0.) +{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));} +else +{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));} +#ifdef HIGHLEVEL +vFurUV=vDiffuseUV*furDensity; +#endif +#else +#ifdef HIGHLEVEL +vFurUV=uv*furDensity; +#endif +#endif +#include +#include +#include +#include[0..maxSimultaneousLights] +#include +#if defined(POINTSIZE) && !defined(WEBGPU) +gl_PointSize=pointSize; +#endif +#define CUSTOM_VERTEX_MAIN_END +} +`; + ShaderStore.ShadersStore[name291] = shader290; +}); + +// node_modules/@babylonjs/materials/fur/furMaterial.js +class FurMaterialDefines extends MaterialDefines { + constructor() { + super(); + this.DIFFUSE = false; + this.HEIGHTMAP = false; + this.CLIPPLANE = false; + this.CLIPPLANE2 = false; + this.CLIPPLANE3 = false; + this.CLIPPLANE4 = false; + this.CLIPPLANE5 = false; + this.CLIPPLANE6 = false; + this.ALPHATEST = false; + this.DEPTHPREPASS = false; + this.POINTSIZE = false; + this.FOG = false; + this.NORMAL = false; + this.UV1 = false; + this.UV2 = false; + this.VERTEXCOLOR = false; + this.VERTEXALPHA = false; + this.NUM_BONE_INFLUENCERS = 0; + this.BonesPerMesh = 0; + this.INSTANCES = false; + this.INSTANCESCOLOR = false; + this.HIGHLEVEL = false; + this.IMAGEPROCESSINGPOSTPROCESS = false; + this.SKIPFINALCOLORCLAMP = false; + this.LOGARITHMICDEPTH = false; + this.rebuild(); + } +} + +class FurMaterial extends PushMaterial { + constructor(name292, scene40) { + super(name292, scene40); + this.diffuseColor = new Color3(1, 1, 1); + this.furLength = 1; + this.furAngle = 0; + this.furColor = new Color3(0.44, 0.21, 0.02); + this.furOffset = 0; + this.furSpacing = 12; + this.furGravity = new Vector3(0, 0, 0); + this.furSpeed = 100; + this.furDensity = 20; + this.furOcclusion = 0; + this._disableLighting = false; + this._maxSimultaneousLights = 4; + this.highLevelFur = true; + this._furTime = 0; + } + get furTime() { + return this._furTime; + } + set furTime(furTime) { + this._furTime = furTime; + } + needAlphaBlending() { + return this.alpha < 1; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + updateFur() { + for (let i = 1;i < this._meshes.length; i++) { + const offsetFur = this._meshes[i].material; + offsetFur.furLength = this.furLength; + offsetFur.furAngle = this.furAngle; + offsetFur.furGravity = this.furGravity; + offsetFur.furSpacing = this.furSpacing; + offsetFur.furSpeed = this.furSpeed; + offsetFur.furColor = this.furColor; + offsetFur.diffuseTexture = this.diffuseTexture; + offsetFur.furTexture = this.furTexture; + offsetFur.highLevelFur = this.highLevelFur; + offsetFur.furTime = this.furTime; + offsetFur.furDensity = this.furDensity; + } + } + isReadyForSubMesh(mesh80, subMesh11, useInstances) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady && subMesh11.effect._wasPreviouslyUsingInstances === useInstances) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new FurMaterialDefines; + } + const defines = subMesh11.materialDefines; + const scene40 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene40.getEngine(); + if (defines._areTexturesDirty) { + if (scene40.texturesEnabled) { + if (this.diffuseTexture && MaterialFlags.DiffuseTextureEnabled) { + if (!this.diffuseTexture.isReady()) { + return false; + } else { + defines._needUVs = true; + defines.DIFFUSE = true; + } + } + if (this.heightTexture && engine47.getCaps().maxVertexTextureImageUnits) { + if (!this.heightTexture.isReady()) { + return false; + } else { + defines._needUVs = true; + defines.HEIGHTMAP = true; + } + } + } + } + if (this.highLevelFur !== defines.HIGHLEVEL) { + defines.HIGHLEVEL = true; + defines.markAsUnprocessed(); + } + MaterialHelper.PrepareDefinesForMisc(mesh80, scene40, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh80), defines); + defines._needNormals = MaterialHelper.PrepareDefinesForLights(scene40, mesh80, defines, false, this._maxSimultaneousLights, this._disableLighting); + MaterialHelper.PrepareDefinesForFrameBoundValues(scene40, engine47, this, defines, useInstances ? true : false); + MaterialHelper.PrepareDefinesForAttributes(mesh80, defines, true, true); + if (defines.isDirty) { + defines.markAsProcessed(); + scene40.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh80); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene40.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + MaterialHelper.PrepareAttributesForBones(attribs, mesh80, defines, fallbacks); + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "fur"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "view", + "viewProjection", + "vEyePosition", + "vLightsType", + "vDiffuseColor", + "vFogInfos", + "vFogColor", + "pointSize", + "vDiffuseInfos", + "mBones", + "diffuseMatrix", + "logarithmicDepthConstant", + "furLength", + "furAngle", + "furColor", + "furOffset", + "furGravity", + "furTime", + "furSpacing", + "furDensity", + "furOcclusion" + ]; + addClipPlaneUniforms(uniforms2); + const samplers = ["diffuseSampler", "heightTexture", "furTexture"]; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: this.maxSimultaneousLights + }); + subMesh11.setEffect(scene40.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene40.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + subMesh11.effect._wasPreviouslyUsingInstances = !!useInstances; + return true; + } + bindForSubMesh(world, mesh80, subMesh11) { + const scene40 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene40.getTransformMatrix()); + MaterialHelper.BindBonesParameters(mesh80, this._activeEffect); + if (scene40.getCachedMaterial() !== this) { + if (this._diffuseTexture && MaterialFlags.DiffuseTextureEnabled) { + this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture); + this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level); + this._activeEffect.setMatrix("diffuseMatrix", this._diffuseTexture.getTextureMatrix()); + } + if (this._heightTexture) { + this._activeEffect.setTexture("heightTexture", this._heightTexture); + } + bindClipPlane(this._activeEffect, this, scene40); + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + if (this._useLogarithmicDepth) { + MaterialHelper.BindLogDepth(defines, effect20, scene40); + } + scene40.bindEyePosition(effect20); + } + this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh80.visibility); + if (scene40.lightsEnabled && !this.disableLighting) { + MaterialHelper.BindLights(scene40, mesh80, this._activeEffect, defines, this.maxSimultaneousLights); + } + if (scene40.fogEnabled && mesh80.applyFog && scene40.fogMode !== Scene.FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene40.getViewMatrix()); + } + MaterialHelper.BindFogParameters(scene40, mesh80, this._activeEffect); + this._activeEffect.setFloat("furLength", this.furLength); + this._activeEffect.setFloat("furAngle", this.furAngle); + this._activeEffect.setColor4("furColor", this.furColor, 1); + if (this.highLevelFur) { + this._activeEffect.setVector3("furGravity", this.furGravity); + this._activeEffect.setFloat("furOffset", this.furOffset); + this._activeEffect.setFloat("furSpacing", this.furSpacing); + this._activeEffect.setFloat("furDensity", this.furDensity); + this._activeEffect.setFloat("furOcclusion", this.furOcclusion); + this._furTime += this.getScene().getEngine().getDeltaTime() / this.furSpeed; + this._activeEffect.setFloat("furTime", this._furTime); + this._activeEffect.setTexture("furTexture", this.furTexture); + } + this._afterBind(mesh80, this._activeEffect); + } + getAnimatables() { + const results = []; + if (this.diffuseTexture && this.diffuseTexture.animations && this.diffuseTexture.animations.length > 0) { + results.push(this.diffuseTexture); + } + if (this.heightTexture && this.heightTexture.animations && this.heightTexture.animations.length > 0) { + results.push(this.heightTexture); + } + return results; + } + getActiveTextures() { + const activeTextures = super.getActiveTextures(); + if (this._diffuseTexture) { + activeTextures.push(this._diffuseTexture); + } + if (this._heightTexture) { + activeTextures.push(this._heightTexture); + } + return activeTextures; + } + hasTexture(texture90) { + if (super.hasTexture(texture90)) { + return true; + } + if (this.diffuseTexture === texture90) { + return true; + } + if (this._heightTexture === texture90) { + return true; + } + return false; + } + dispose(forceDisposeEffect) { + if (this.diffuseTexture) { + this.diffuseTexture.dispose(); + } + if (this._meshes) { + for (let i = 1;i < this._meshes.length; i++) { + const mat = this._meshes[i].material; + if (mat) { + mat.dispose(forceDisposeEffect); + } + this._meshes[i].dispose(); + } + } + super.dispose(forceDisposeEffect); + } + clone(name292) { + return SerializationHelper.Clone(() => new FurMaterial(name292, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.FurMaterial"; + if (this._meshes) { + serializationObject.sourceMeshName = this._meshes[0].name; + serializationObject.quality = this._meshes.length; + } + return serializationObject; + } + getClassName() { + return "FurMaterial"; + } + static Parse(source, scene40, rootUrl) { + const material30 = SerializationHelper.Parse(() => new FurMaterial(source.name, scene40), source, scene40, rootUrl); + if (source.sourceMeshName && material30.highLevelFur) { + scene40.executeWhenReady(() => { + const sourceMesh = scene40.getMeshByName(source.sourceMeshName); + if (sourceMesh) { + const furTexture = FurMaterial.GenerateTexture("Fur Texture", scene40); + material30.furTexture = furTexture; + FurMaterial.FurifyMesh(sourceMesh, source.quality); + } + }); + } + return material30; + } + static GenerateTexture(name292, scene40) { + const texture90 = new DynamicTexture("FurTexture " + name292, 256, scene40, true); + const context = texture90.getContext(); + for (let i = 0;i < 20000; ++i) { + context.fillStyle = "rgba(255, " + Math.floor(Math.random() * 255) + ", " + Math.floor(Math.random() * 255) + ", 1)"; + context.fillRect(Math.random() * texture90.getSize().width, Math.random() * texture90.getSize().height, 2, 2); + } + texture90.update(false); + texture90.wrapU = Texture.WRAP_ADDRESSMODE; + texture90.wrapV = Texture.WRAP_ADDRESSMODE; + return texture90; + } + static FurifyMesh(sourceMesh, quality) { + const meshes = [sourceMesh]; + const mat = sourceMesh.material; + let i; + if (!(mat instanceof FurMaterial)) { + throw "The material of the source mesh must be a Fur Material"; + } + for (i = 1;i < quality; i++) { + const offsetFur = new FurMaterial(mat.name + i, sourceMesh.getScene()); + sourceMesh.getScene().materials.pop(); + Tags.EnableFor(offsetFur); + Tags.AddTagsTo(offsetFur, "furShellMaterial"); + offsetFur.furLength = mat.furLength; + offsetFur.furAngle = mat.furAngle; + offsetFur.furGravity = mat.furGravity; + offsetFur.furSpacing = mat.furSpacing; + offsetFur.furSpeed = mat.furSpeed; + offsetFur.furColor = mat.furColor; + offsetFur.diffuseTexture = mat.diffuseTexture; + offsetFur.furOffset = i / quality; + offsetFur.furTexture = mat.furTexture; + offsetFur.highLevelFur = mat.highLevelFur; + offsetFur.furTime = mat.furTime; + offsetFur.furDensity = mat.furDensity; + const offsetMesh = sourceMesh.clone(sourceMesh.name + i); + offsetMesh.material = offsetFur; + offsetMesh.skeleton = sourceMesh.skeleton; + offsetMesh.position = Vector3.Zero(); + meshes.push(offsetMesh); + } + for (i = 1;i < meshes.length; i++) { + meshes[i].parent = sourceMesh; + } + sourceMesh.material._meshes = meshes; + return meshes; + } +} +var init_furMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_math_color(); + init_tags(); + init_texture(); + init_dynamicTexture(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_materialFlags(); + init_buffer(); + init_scene(); + init_typeStore(); + init_effectFallbacks(); + init_fur_fragment(); + init_fur_vertex(); + init_clipPlaneMaterialHelper(); + __decorate2([ + serializeAsTexture("diffuseTexture") + ], FurMaterial.prototype, "_diffuseTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], FurMaterial.prototype, "diffuseTexture", undefined); + __decorate2([ + serializeAsTexture("heightTexture") + ], FurMaterial.prototype, "_heightTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], FurMaterial.prototype, "heightTexture", undefined); + __decorate2([ + serializeAsColor3() + ], FurMaterial.prototype, "diffuseColor", undefined); + __decorate2([ + serialize() + ], FurMaterial.prototype, "furLength", undefined); + __decorate2([ + serialize() + ], FurMaterial.prototype, "furAngle", undefined); + __decorate2([ + serializeAsColor3() + ], FurMaterial.prototype, "furColor", undefined); + __decorate2([ + serialize() + ], FurMaterial.prototype, "furOffset", undefined); + __decorate2([ + serialize() + ], FurMaterial.prototype, "furSpacing", undefined); + __decorate2([ + serializeAsVector3() + ], FurMaterial.prototype, "furGravity", undefined); + __decorate2([ + serialize() + ], FurMaterial.prototype, "furSpeed", undefined); + __decorate2([ + serialize() + ], FurMaterial.prototype, "furDensity", undefined); + __decorate2([ + serialize() + ], FurMaterial.prototype, "furOcclusion", undefined); + __decorate2([ + serialize("disableLighting") + ], FurMaterial.prototype, "_disableLighting", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], FurMaterial.prototype, "disableLighting", undefined); + __decorate2([ + serialize("maxSimultaneousLights") + ], FurMaterial.prototype, "_maxSimultaneousLights", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], FurMaterial.prototype, "maxSimultaneousLights", undefined); + __decorate2([ + serialize() + ], FurMaterial.prototype, "highLevelFur", undefined); + __decorate2([ + serialize() + ], FurMaterial.prototype, "furTime", null); + RegisterClass("BABYLON.FurMaterial", FurMaterial); +}); + +// node_modules/@babylonjs/materials/fur/index.js +var init_fur = __esm(() => { + init_furMaterial(); +}); + +// node_modules/@babylonjs/materials/gradient/gradient.fragment.js +var name292, shader291; +var init_gradient_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_lightsFragmentFunctions(); + init_shadowsFragmentFunctions(); + init_clipPlaneFragmentDeclaration(); + init_logDepthDeclaration(); + init_fogFragmentDeclaration(); + init_clipPlaneFragment(); + init_depthPrePass(); + init_lightFragment(); + init_logDepthFragment(); + init_fogFragment(); + init_imageProcessingCompatibility(); + name292 = "gradientPixelShader"; + shader291 = `precision highp float;uniform vec4 vEyePosition;uniform vec4 topColor;uniform vec4 bottomColor;uniform float offset;uniform float scale;uniform float smoothness;varying vec3 vPositionW;varying vec3 vPosition; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#ifdef VERTEXCOLOR +varying vec4 vColor; +#endif +#include +#include<__decl__lightFragment>[0] +#include<__decl__lightFragment>[1] +#include<__decl__lightFragment>[2] +#include<__decl__lightFragment>[3] +#include +#include +#include +#ifdef LOGARITHMICDEPTH +#extension GL_EXT_frag_depth : enable +#endif +#include +#include +#define CUSTOM_FRAGMENT_DEFINITIONS +void main(void) { +#define CUSTOM_FRAGMENT_MAIN_BEGIN +#include +vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);float h=vPosition.y*scale+offset;float mysmoothness=clamp(smoothness,0.01,max(smoothness,10.));vec4 baseColor=mix(bottomColor,topColor,max(pow(max(h,0.0),mysmoothness),0.0));vec3 diffuseColor=baseColor.rgb;float alpha=baseColor.a; +#ifdef ALPHATEST +if (baseColor.a<0.4) +discard; +#endif +#include +#ifdef VERTEXCOLOR +baseColor.rgb*=vColor.rgb; +#endif +#ifdef NORMAL +vec3 normalW=normalize(vNormalW); +#else +vec3 normalW=vec3(1.0,1.0,1.0); +#endif +#ifdef EMISSIVE +vec3 diffuseBase=baseColor.rgb; +#else +vec3 diffuseBase=vec3(0.,0.,0.); +#endif +lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.; +#include[0..maxSimultaneousLights] +#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) +alpha*=vColor.a; +#endif +vec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha); +#include +#include +gl_FragColor=color; +#include +#define CUSTOM_FRAGMENT_MAIN_END +} +`; + ShaderStore.ShadersStore[name292] = shader291; +}); + +// node_modules/@babylonjs/materials/gradient/gradient.vertex.js +var name293, shader292; +var init_gradient_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_instancesDeclaration(); + init_clipPlaneVertexDeclaration(); + init_logDepthDeclaration(); + init_fogVertexDeclaration(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + init_logDepthVertex(); + init_fogVertex(); + init_shadowsVertex(); + init_vertexColorMixing(); + name293 = "gradientVertexShader"; + shader292 = `precision highp float;attribute vec3 position; +#ifdef NORMAL +attribute vec3 normal; +#endif +#ifdef UV1 +attribute vec2 uv; +#endif +#ifdef UV2 +attribute vec2 uv2; +#endif +#ifdef VERTEXCOLOR +attribute vec4 color; +#endif +#include +#include +#include +uniform mat4 view;uniform mat4 viewProjection; +#ifdef POINTSIZE +uniform float pointSize; +#endif +varying vec3 vPositionW;varying vec3 vPosition; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#ifdef VERTEXCOLOR +varying vec4 vColor; +#endif +#include +#include +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +#define CUSTOM_VERTEX_DEFINITIONS +void main(void) { +#define CUSTOM_VERTEX_MAIN_BEGIN +#include +#include +#include +vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);vPosition=position; +#ifdef NORMAL +vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0))); +#endif +#ifndef UV1 +vec2 uv=vec2(0.,0.); +#endif +#ifndef UV2 +vec2 uv2=vec2(0.,0.); +#endif +#include +#include +#include +#include[0..maxSimultaneousLights] +#include +#if defined(POINTSIZE) && !defined(WEBGPU) +gl_PointSize=pointSize; +#endif +#define CUSTOM_VERTEX_MAIN_END +} +`; + ShaderStore.ShadersStore[name293] = shader292; +}); + +// node_modules/@babylonjs/materials/gradient/gradientMaterial.js +class GradientMaterialDefines extends MaterialDefines { + constructor() { + super(); + this.EMISSIVE = false; + this.CLIPPLANE = false; + this.CLIPPLANE2 = false; + this.CLIPPLANE3 = false; + this.CLIPPLANE4 = false; + this.CLIPPLANE5 = false; + this.CLIPPLANE6 = false; + this.ALPHATEST = false; + this.DEPTHPREPASS = false; + this.POINTSIZE = false; + this.FOG = false; + this.NORMAL = false; + this.UV1 = false; + this.UV2 = false; + this.VERTEXCOLOR = false; + this.VERTEXALPHA = false; + this.NUM_BONE_INFLUENCERS = 0; + this.BonesPerMesh = 0; + this.INSTANCES = false; + this.INSTANCESCOLOR = false; + this.IMAGEPROCESSINGPOSTPROCESS = false; + this.SKIPFINALCOLORCLAMP = false; + this.LOGARITHMICDEPTH = false; + this.rebuild(); + } +} + +class GradientMaterial extends PushMaterial { + constructor(name294, scene41) { + super(name294, scene41); + this._maxSimultaneousLights = 4; + this.topColor = new Color3(1, 0, 0); + this.topColorAlpha = 1; + this.bottomColor = new Color3(0, 0, 1); + this.bottomColorAlpha = 1; + this.offset = 0; + this.scale = 1; + this.smoothness = 1; + this._disableLighting = false; + } + needAlphaBlending() { + return this.alpha < 1 || this.topColorAlpha < 1 || this.bottomColorAlpha < 1; + } + needAlphaTesting() { + return true; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh80, subMesh11, useInstances) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady && subMesh11.effect._wasPreviouslyUsingInstances === useInstances) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new GradientMaterialDefines; + } + const defines = subMesh11.materialDefines; + const scene41 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene41.getEngine(); + MaterialHelper.PrepareDefinesForFrameBoundValues(scene41, engine47, this, defines, useInstances ? true : false); + MaterialHelper.PrepareDefinesForMisc(mesh80, scene41, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh80), defines); + defines._needNormals = MaterialHelper.PrepareDefinesForLights(scene41, mesh80, defines, false, this._maxSimultaneousLights, this._disableLighting); + defines.EMISSIVE = this._disableLighting; + MaterialHelper.PrepareDefinesForAttributes(mesh80, defines, false, true); + if (defines.isDirty) { + defines.markAsProcessed(); + scene41.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh80); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene41.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + MaterialHelper.PrepareAttributesForBones(attribs, mesh80, defines, fallbacks); + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "gradient"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "view", + "viewProjection", + "vEyePosition", + "vLightsType", + "vFogInfos", + "vFogColor", + "pointSize", + "mBones", + "logarithmicDepthConstant", + "topColor", + "bottomColor", + "offset", + "smoothness", + "scale" + ]; + addClipPlaneUniforms(uniforms2); + const samplers = []; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene41.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene41.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + subMesh11.effect._wasPreviouslyUsingInstances = !!useInstances; + return true; + } + bindForSubMesh(world, mesh80, subMesh11) { + const scene41 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene41.getTransformMatrix()); + MaterialHelper.BindBonesParameters(mesh80, effect20); + if (this._mustRebind(scene41, effect20)) { + bindClipPlane(effect20, this, scene41); + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + if (this._useLogarithmicDepth) { + MaterialHelper.BindLogDepth(defines, effect20, scene41); + } + scene41.bindEyePosition(effect20); + } + if (scene41.lightsEnabled && !this.disableLighting) { + MaterialHelper.BindLights(scene41, mesh80, this._activeEffect, defines, this.maxSimultaneousLights); + } + if (scene41.fogEnabled && mesh80.applyFog && scene41.fogMode !== Scene.FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene41.getViewMatrix()); + } + MaterialHelper.BindFogParameters(scene41, mesh80, this._activeEffect); + this._activeEffect.setColor4("topColor", this.topColor, this.topColorAlpha); + this._activeEffect.setColor4("bottomColor", this.bottomColor, this.bottomColorAlpha); + this._activeEffect.setFloat("offset", this.offset); + this._activeEffect.setFloat("scale", this.scale); + this._activeEffect.setFloat("smoothness", this.smoothness); + this._afterBind(mesh80, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + } + clone(name294) { + return SerializationHelper.Clone(() => new GradientMaterial(name294, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.GradientMaterial"; + return serializationObject; + } + getClassName() { + return "GradientMaterial"; + } + static Parse(source, scene41, rootUrl) { + return SerializationHelper.Parse(() => new GradientMaterial(source.name, scene41), source, scene41, rootUrl); + } +} +var init_gradientMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_color(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_buffer(); + init_scene(); + init_typeStore(); + init_gradient_fragment(); + init_gradient_vertex(); + init_effectFallbacks(); + init_clipPlaneMaterialHelper(); + __decorate2([ + serialize("maxSimultaneousLights") + ], GradientMaterial.prototype, "_maxSimultaneousLights", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], GradientMaterial.prototype, "maxSimultaneousLights", undefined); + __decorate2([ + serializeAsColor3() + ], GradientMaterial.prototype, "topColor", undefined); + __decorate2([ + serialize() + ], GradientMaterial.prototype, "topColorAlpha", undefined); + __decorate2([ + serializeAsColor3() + ], GradientMaterial.prototype, "bottomColor", undefined); + __decorate2([ + serialize() + ], GradientMaterial.prototype, "bottomColorAlpha", undefined); + __decorate2([ + serialize() + ], GradientMaterial.prototype, "offset", undefined); + __decorate2([ + serialize() + ], GradientMaterial.prototype, "scale", undefined); + __decorate2([ + serialize() + ], GradientMaterial.prototype, "smoothness", undefined); + __decorate2([ + serialize("disableLighting") + ], GradientMaterial.prototype, "_disableLighting", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], GradientMaterial.prototype, "disableLighting", undefined); + RegisterClass("BABYLON.GradientMaterial", GradientMaterial); +}); + +// node_modules/@babylonjs/materials/gradient/index.js +var init_gradient = __esm(() => { + init_gradientMaterial(); +}); + +// node_modules/@babylonjs/materials/grid/grid.fragment.js +var name294, shader293; +var init_grid_fragment = __esm(() => { + init_shaderStore(); + init_logDepthDeclaration(); + init_fogFragmentDeclaration(); + init_fogFragment(); + init_logDepthFragment(); + init_imageProcessingCompatibility(); + name294 = "gridPixelShader"; + shader293 = `#extension GL_OES_standard_derivatives : enable +#define SQRT2 1.41421356 +#define PI 3.14159 +precision highp float;uniform float visibility;uniform vec3 mainColor;uniform vec3 lineColor;uniform vec4 gridControl;uniform vec3 gridOffset;varying vec3 vPosition;varying vec3 vNormal; +#ifdef LOGARITHMICDEPTH +#extension GL_EXT_frag_depth : enable +#endif +#include +#include +#ifdef OPACITY +varying vec2 vOpacityUV;uniform sampler2D opacitySampler;uniform vec2 vOpacityInfos; +#endif +float getDynamicVisibility(float position) {float majorGridFrequency=gridControl.y;if (floor(position+0.5)==floor(position/majorGridFrequency+0.5)*majorGridFrequency) +{return 1.0;} +return gridControl.z;} +float getAnisotropicAttenuation(float differentialLength) {const float maxNumberOfLines=10.0;return clamp(1.0/(differentialLength+1.0)-1.0/maxNumberOfLines,0.0,1.0);} +float isPointOnLine(float position,float differentialLength) {float fractionPartOfPosition=position-floor(position+0.5); +fractionPartOfPosition/=differentialLength; +#ifdef ANTIALIAS +fractionPartOfPosition=clamp(fractionPartOfPosition,-1.,1.);float result=0.5+0.5*cos(fractionPartOfPosition*PI); +return result; +#else +return abs(fractionPartOfPosition) +#endif +float opacity=1.0; +#ifdef TRANSPARENT +opacity=clamp(grid,0.08,gridControl.w*grid); +#endif +#ifdef OPACITY +opacity*=texture2D(opacitySampler,vOpacityUV).a; +#endif +gl_FragColor=vec4(color.rgb,opacity*visibility); +#ifdef TRANSPARENT +#ifdef PREMULTIPLYALPHA +gl_FragColor.rgb*=opacity; +#endif +#else +#endif +#include +#include +#define CUSTOM_FRAGMENT_MAIN_END +} +`; + ShaderStore.ShadersStore[name294] = shader293; +}); + +// node_modules/@babylonjs/materials/grid/grid.vertex.js +var name295, shader294; +var init_grid_vertex = __esm(() => { + init_shaderStore(); + init_instancesDeclaration(); + init_logDepthDeclaration(); + init_fogVertexDeclaration(); + init_instancesVertex(); + init_fogVertex(); + init_logDepthVertex(); + name295 = "gridVertexShader"; + shader294 = `precision highp float;attribute vec3 position;attribute vec3 normal; +#ifdef UV1 +attribute vec2 uv; +#endif +#ifdef UV2 +attribute vec2 uv2; +#endif +#include +uniform mat4 projection;uniform mat4 view;varying vec3 vPosition;varying vec3 vNormal; +#include +#include +#ifdef OPACITY +varying vec2 vOpacityUV;uniform mat4 opacityMatrix;uniform vec2 vOpacityInfos; +#endif +#define CUSTOM_VERTEX_DEFINITIONS +void main(void) { +#define CUSTOM_VERTEX_MAIN_BEGIN +#include +vec4 worldPos=finalWorld*vec4(position,1.0); +#include +vec4 cameraSpacePosition=view*worldPos;gl_Position=projection*cameraSpacePosition; +#ifdef OPACITY +#ifndef UV1 +vec2 uv=vec2(0.,0.); +#endif +#ifndef UV2 +vec2 uv2=vec2(0.,0.); +#endif +if (vOpacityInfos.x==0.) +{vOpacityUV=vec2(opacityMatrix*vec4(uv,1.0,0.0));} +else +{vOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));} +#endif +#include +vPosition=position;vNormal=normal; +#define CUSTOM_VERTEX_MAIN_END +}`; + ShaderStore.ShadersStore[name295] = shader294; +}); + +// node_modules/@babylonjs/materials/grid/gridMaterial.js +class GridMaterialDefines extends MaterialDefines { + constructor() { + super(); + this.OPACITY = false; + this.ANTIALIAS = false; + this.TRANSPARENT = false; + this.FOG = false; + this.PREMULTIPLYALPHA = false; + this.MAX_LINE = false; + this.UV1 = false; + this.UV2 = false; + this.INSTANCES = false; + this.THIN_INSTANCES = false; + this.IMAGEPROCESSINGPOSTPROCESS = false; + this.SKIPFINALCOLORCLAMP = false; + this.LOGARITHMICDEPTH = false; + this.rebuild(); + } +} + +class GridMaterial extends PushMaterial { + constructor(name296, scene41) { + super(name296, scene41); + this.mainColor = Color3.Black(); + this.lineColor = Color3.Teal(); + this.gridRatio = 1; + this.gridOffset = Vector3.Zero(); + this.majorUnitFrequency = 10; + this.minorUnitVisibility = 0.33; + this.opacity = 1; + this.antialias = true; + this.preMultiplyAlpha = false; + this.useMaxLine = false; + this._gridControl = new Vector4(this.gridRatio, this.majorUnitFrequency, this.minorUnitVisibility, this.opacity); + } + needAlphaBlending() { + return this.opacity < 1 || this._opacityTexture && this._opacityTexture.isReady(); + } + needAlphaBlendingForMesh(mesh80) { + return mesh80.visibility < 1 || this.needAlphaBlending(); + } + isReadyForSubMesh(mesh80, subMesh11, useInstances) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady && subMesh11.effect._wasPreviouslyUsingInstances === useInstances) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new GridMaterialDefines; + } + const defines = subMesh11.materialDefines; + const scene41 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + if (defines.TRANSPARENT !== this.opacity < 1) { + defines.TRANSPARENT = !defines.TRANSPARENT; + defines.markAsUnprocessed(); + } + if (defines.PREMULTIPLYALPHA != this.preMultiplyAlpha) { + defines.PREMULTIPLYALPHA = !defines.PREMULTIPLYALPHA; + defines.markAsUnprocessed(); + } + if (defines.MAX_LINE !== this.useMaxLine) { + defines.MAX_LINE = !defines.MAX_LINE; + defines.markAsUnprocessed(); + } + if (defines.ANTIALIAS !== this.antialias) { + defines.ANTIALIAS = !defines.ANTIALIAS; + defines.markAsUnprocessed(); + } + if (defines._areTexturesDirty) { + defines._needUVs = false; + if (scene41.texturesEnabled) { + if (this._opacityTexture && MaterialFlags.OpacityTextureEnabled) { + if (!this._opacityTexture.isReady()) { + return false; + } else { + defines._needUVs = true; + defines.OPACITY = true; + } + } + } + } + MaterialHelper.PrepareDefinesForMisc(mesh80, scene41, this._useLogarithmicDepth, false, this.fogEnabled, false, defines); + MaterialHelper.PrepareDefinesForFrameBoundValues(scene41, scene41.getEngine(), this, defines, !!useInstances); + if (defines.isDirty) { + defines.markAsProcessed(); + scene41.resetCachedMaterial(); + MaterialHelper.PrepareDefinesForAttributes(mesh80, defines, false, false); + const attribs = [VertexBuffer.PositionKind, VertexBuffer.NormalKind]; + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene41.imageProcessingConfiguration.applyByPostProcess; + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const join = defines.toString(); + subMesh11.setEffect(scene41.getEngine().createEffect("grid", attribs, [ + "projection", + "mainColor", + "lineColor", + "gridControl", + "gridOffset", + "vFogInfos", + "vFogColor", + "world", + "view", + "opacityMatrix", + "vOpacityInfos", + "visibility", + "logarithmicDepthConstant" + ], ["opacitySampler"], join, undefined, this.onCompiled, this.onError), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene41.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + subMesh11.effect._wasPreviouslyUsingInstances = !!useInstances; + return true; + } + bindForSubMesh(world, mesh80, subMesh11) { + const scene41 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this._activeEffect.setFloat("visibility", mesh80.visibility); + if (!defines.INSTANCES || defines.THIN_INSTANCE) { + this.bindOnlyWorldMatrix(world); + } + this._activeEffect.setMatrix("view", scene41.getViewMatrix()); + this._activeEffect.setMatrix("projection", scene41.getProjectionMatrix()); + if (this._mustRebind(scene41, effect20)) { + this._activeEffect.setColor3("mainColor", this.mainColor); + this._activeEffect.setColor3("lineColor", this.lineColor); + this._activeEffect.setVector3("gridOffset", this.gridOffset); + this._gridControl.x = this.gridRatio; + this._gridControl.y = Math.round(this.majorUnitFrequency); + this._gridControl.z = this.minorUnitVisibility; + this._gridControl.w = this.opacity; + this._activeEffect.setVector4("gridControl", this._gridControl); + if (this._opacityTexture && MaterialFlags.OpacityTextureEnabled) { + this._activeEffect.setTexture("opacitySampler", this._opacityTexture); + this._activeEffect.setFloat2("vOpacityInfos", this._opacityTexture.coordinatesIndex, this._opacityTexture.level); + this._activeEffect.setMatrix("opacityMatrix", this._opacityTexture.getTextureMatrix()); + } + if (this._useLogarithmicDepth) { + MaterialHelper.BindLogDepth(defines, effect20, scene41); + } + } + MaterialHelper.BindFogParameters(scene41, mesh80, this._activeEffect); + this._afterBind(mesh80, this._activeEffect); + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + } + clone(name296) { + return SerializationHelper.Clone(() => new GridMaterial(name296, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.GridMaterial"; + return serializationObject; + } + getClassName() { + return "GridMaterial"; + } + static Parse(source, scene41, rootUrl) { + return SerializationHelper.Parse(() => new GridMaterial(source.name, scene41), source, scene41, rootUrl); + } +} +var init_gridMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_math_color(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_materialFlags(); + init_buffer(); + init_typeStore(); + init_grid_fragment(); + init_grid_vertex(); + __decorate2([ + serializeAsColor3() + ], GridMaterial.prototype, "mainColor", undefined); + __decorate2([ + serializeAsColor3() + ], GridMaterial.prototype, "lineColor", undefined); + __decorate2([ + serialize() + ], GridMaterial.prototype, "gridRatio", undefined); + __decorate2([ + serializeAsVector3() + ], GridMaterial.prototype, "gridOffset", undefined); + __decorate2([ + serialize() + ], GridMaterial.prototype, "majorUnitFrequency", undefined); + __decorate2([ + serialize() + ], GridMaterial.prototype, "minorUnitVisibility", undefined); + __decorate2([ + serialize() + ], GridMaterial.prototype, "opacity", undefined); + __decorate2([ + serialize() + ], GridMaterial.prototype, "antialias", undefined); + __decorate2([ + serialize() + ], GridMaterial.prototype, "preMultiplyAlpha", undefined); + __decorate2([ + serialize() + ], GridMaterial.prototype, "useMaxLine", undefined); + __decorate2([ + serializeAsTexture("opacityTexture") + ], GridMaterial.prototype, "_opacityTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], GridMaterial.prototype, "opacityTexture", undefined); + RegisterClass("BABYLON.GridMaterial", GridMaterial); +}); + +// node_modules/@babylonjs/materials/grid/index.js +var init_grid = __esm(() => { + init_gridMaterial(); +}); + +// node_modules/@babylonjs/materials/lava/lava.fragment.js +var name296, shader295; +var init_lava_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_lightsFragmentFunctions(); + init_shadowsFragmentFunctions(); + init_clipPlaneFragmentDeclaration(); + init_logDepthDeclaration(); + init_fogFragmentDeclaration(); + init_clipPlaneFragment(); + init_depthPrePass(); + init_lightFragment(); + init_logDepthFragment(); + init_fogFragment(); + init_imageProcessingCompatibility(); + name296 = "lavaPixelShader"; + shader295 = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;uniform float time;uniform float speed;uniform float movingSpeed;uniform vec3 fogColor;uniform sampler2D noiseTexture;uniform float fogDensity;varying float noise; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#ifdef VERTEXCOLOR +varying vec4 vColor; +#endif +#include +#include<__decl__lightFragment>[0] +#include<__decl__lightFragment>[1] +#include<__decl__lightFragment>[2] +#include<__decl__lightFragment>[3] +#include +#include +#ifdef DIFFUSE +varying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos; +#endif +#include +#ifdef LOGARITHMICDEPTH +#extension GL_EXT_frag_depth : enable +#endif +#include +#include +float random( vec3 scale,float seed ){return fract( sin( dot( gl_FragCoord.xyz+seed,scale ) )*43758.5453+seed ) ;} +#define CUSTOM_FRAGMENT_DEFINITIONS +void main(void) { +#define CUSTOM_FRAGMENT_MAIN_BEGIN +#include +vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a; +#ifdef DIFFUSE +vec4 noiseTex=texture2D( noiseTexture,vDiffuseUV );vec2 T1=vDiffuseUV+vec2( 1.5,-1.5 )*time *0.02;vec2 T2=vDiffuseUV+vec2( -0.5,2.0 )*time*0.01*speed;T1.x+=noiseTex.x*2.0;T1.y+=noiseTex.y*2.0;T2.x-=noiseTex.y*0.2+time*0.001*movingSpeed;T2.y+=noiseTex.z*0.2+time*0.002*movingSpeed;float p=texture2D( noiseTexture,T1*3.0 ).a;vec4 lavaColor=texture2D( diffuseSampler,T2*4.0);vec4 temp=lavaColor*( vec4( p,p,p,p )*2. )+( lavaColor*lavaColor-0.1 );baseColor=temp;float depth=gl_FragCoord.z*4.0;const float LOG2=1.442695;float fogFactor=exp2(-fogDensity*fogDensity*depth*depth*LOG2 );fogFactor=1.0-clamp( fogFactor,0.0,1.0 );baseColor=mix( baseColor,vec4( fogColor,baseColor.w ),fogFactor );diffuseColor=baseColor.rgb; +#ifdef ALPHATEST +if (baseColor.a<0.4) +discard; +#endif +#include +baseColor.rgb*=vDiffuseInfos.y; +#endif +#ifdef VERTEXCOLOR +baseColor.rgb*=vColor.rgb; +#endif +#ifdef NORMAL +vec3 normalW=normalize(vNormalW); +#else +vec3 normalW=vec3(1.0,1.0,1.0); +#endif +#ifdef UNLIT +vec3 diffuseBase=vec3(1.,1.,1.); +#else +vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.; +#include[0] +#include[1] +#include[2] +#include[3] +#endif +#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) +alpha*=vColor.a; +#endif +vec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha); +#include +#include +gl_FragColor=color; +#include +#define CUSTOM_FRAGMENT_MAIN_END +}`; + ShaderStore.ShadersStore[name296] = shader295; +}); + +// node_modules/@babylonjs/materials/lava/lava.vertex.js +var name297, shader296; +var init_lava_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_instancesDeclaration(); + init_clipPlaneVertexDeclaration(); + init_logDepthDeclaration(); + init_fogVertexDeclaration(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + init_fogVertex(); + init_shadowsVertex(); + init_vertexColorMixing(); + init_logDepthVertex(); + name297 = "lavaVertexShader"; + shader296 = `precision highp float;uniform float time;uniform float lowFrequencySpeed;varying float noise;attribute vec3 position; +#ifdef NORMAL +attribute vec3 normal; +#endif +#ifdef UV1 +attribute vec2 uv; +#endif +#ifdef UV2 +attribute vec2 uv2; +#endif +#ifdef VERTEXCOLOR +attribute vec4 color; +#endif +#include +#include +#include +uniform mat4 view;uniform mat4 viewProjection; +#ifdef DIFFUSE +varying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos; +#endif +#ifdef POINTSIZE +uniform float pointSize; +#endif +varying vec3 vPositionW; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#ifdef VERTEXCOLOR +varying vec4 vColor; +#endif +#include +#include +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +/* NOISE FUNCTIONS */ +vec3 mod289(vec3 x) +{return x-floor(x*(1.0/289.0))*289.0;} +vec4 mod289(vec4 x) +{return x-floor(x*(1.0/289.0))*289.0;} +vec4 permute(vec4 x) +{return mod289(((x*34.0)+1.0)*x);} +vec4 taylorInvSqrt(vec4 r) +{return 1.79284291400159-0.85373472095314*r;} +vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);} +float pnoise(vec3 P,vec3 rep) +{vec3 Pi0=mod(floor(P),rep); +vec3 Pi1=mod(Pi0+vec3(1.0),rep); +Pi0=mod289(Pi0);Pi1=mod289(Pi1);vec3 Pf0=fract(P); +vec3 Pf1=Pf0-vec3(1.0); +vec4 ix=vec4(Pi0.x,Pi1.x,Pi0.x,Pi1.x);vec4 iy=vec4(Pi0.yy,Pi1.yy);vec4 iz0=Pi0.zzzz;vec4 iz1=Pi1.zzzz;vec4 ixy=permute(permute(ix)+iy);vec4 ixy0=permute(ixy+iz0);vec4 ixy1=permute(ixy+iz1);vec4 gx0=ixy0*(1.0/7.0);vec4 gy0=fract(floor(gx0)*(1.0/7.0))-0.5;gx0=fract(gx0);vec4 gz0=vec4(0.5)-abs(gx0)-abs(gy0);vec4 sz0=step(gz0,vec4(0.0));gx0-=sz0*(step(0.0,gx0)-0.5);gy0-=sz0*(step(0.0,gy0)-0.5);vec4 gx1=ixy1*(1.0/7.0);vec4 gy1=fract(floor(gx1)*(1.0/7.0))-0.5;gx1=fract(gx1);vec4 gz1=vec4(0.5)-abs(gx1)-abs(gy1);vec4 sz1=step(gz1,vec4(0.0));gx1-=sz1*(step(0.0,gx1)-0.5);gy1-=sz1*(step(0.0,gy1)-0.5);vec3 g000=vec3(gx0.x,gy0.x,gz0.x);vec3 g100=vec3(gx0.y,gy0.y,gz0.y);vec3 g010=vec3(gx0.z,gy0.z,gz0.z);vec3 g110=vec3(gx0.w,gy0.w,gz0.w);vec3 g001=vec3(gx1.x,gy1.x,gz1.x);vec3 g101=vec3(gx1.y,gy1.y,gz1.y);vec3 g011=vec3(gx1.z,gy1.z,gz1.z);vec3 g111=vec3(gx1.w,gy1.w,gz1.w);vec4 norm0=taylorInvSqrt(vec4(dot(g000,g000),dot(g010,g010),dot(g100,g100),dot(g110,g110)));g000*=norm0.x;g010*=norm0.y;g100*=norm0.z;g110*=norm0.w;vec4 norm1=taylorInvSqrt(vec4(dot(g001,g001),dot(g011,g011),dot(g101,g101),dot(g111,g111)));g001*=norm1.x;g011*=norm1.y;g101*=norm1.z;g111*=norm1.w;float n000=dot(g000,Pf0);float n100=dot(g100,vec3(Pf1.x,Pf0.yz));float n010=dot(g010,vec3(Pf0.x,Pf1.y,Pf0.z));float n110=dot(g110,vec3(Pf1.xy,Pf0.z));float n001=dot(g001,vec3(Pf0.xy,Pf1.z));float n101=dot(g101,vec3(Pf1.x,Pf0.y,Pf1.z));float n011=dot(g011,vec3(Pf0.x,Pf1.yz));float n111=dot(g111,Pf1);vec3 fade_xyz=fade(Pf0);vec4 n_z=mix(vec4(n000,n100,n010,n110),vec4(n001,n101,n011,n111),fade_xyz.z);vec2 n_yz=mix(n_z.xy,n_z.zw,fade_xyz.y);float n_xyz=mix(n_yz.x,n_yz.y,fade_xyz.x);return 2.2*n_xyz;} +/* END FUNCTION */ +float turbulence( vec3 p ) {float w=100.0;float t=-.5;for (float f=1.0 ; f<=10.0 ; f++ ){float power=pow( 2.0,f );t+=abs( pnoise( vec3( power*p ),vec3( 10.0,10.0,10.0 ) )/power );} +return t;} +#define CUSTOM_VERTEX_DEFINITIONS +void main(void) { +#define CUSTOM_VERTEX_MAIN_BEGIN +#include +#include +#include +#ifdef NORMAL +noise=10.0* -.10*turbulence( .5*normal+time*1.15 );float b=lowFrequencySpeed*5.0*pnoise( 0.05*position +vec3(time*1.025),vec3( 100.0 ) );float displacement=- 1.5*noise+b;vec3 newPosition=position+normal*displacement;gl_Position=viewProjection*finalWorld*vec4( newPosition,1.0 );vec4 worldPos=finalWorld*vec4(newPosition,1.0);vPositionW=vec3(worldPos);vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0))); +#endif +#ifndef UV1 +vec2 uv=vec2(0.,0.); +#endif +#ifndef UV2 +vec2 uv2=vec2(0.,0.); +#endif +#ifdef DIFFUSE +if (vDiffuseInfos.x==0.) +{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));} +else +{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));} +#endif +#include +#include +#include[0..maxSimultaneousLights] +#include +#include +#if defined(POINTSIZE) && !defined(WEBGPU) +gl_PointSize=pointSize; +#endif +#define CUSTOM_VERTEX_MAIN_END +}`; + ShaderStore.ShadersStore[name297] = shader296; +}); + +// node_modules/@babylonjs/materials/lava/lavaMaterial.js +class LavaMaterialDefines extends MaterialDefines { + constructor() { + super(); + this.DIFFUSE = false; + this.CLIPPLANE = false; + this.CLIPPLANE2 = false; + this.CLIPPLANE3 = false; + this.CLIPPLANE4 = false; + this.CLIPPLANE5 = false; + this.CLIPPLANE6 = false; + this.ALPHATEST = false; + this.DEPTHPREPASS = false; + this.POINTSIZE = false; + this.FOG = false; + this.LIGHT0 = false; + this.LIGHT1 = false; + this.LIGHT2 = false; + this.LIGHT3 = false; + this.SPOTLIGHT0 = false; + this.SPOTLIGHT1 = false; + this.SPOTLIGHT2 = false; + this.SPOTLIGHT3 = false; + this.HEMILIGHT0 = false; + this.HEMILIGHT1 = false; + this.HEMILIGHT2 = false; + this.HEMILIGHT3 = false; + this.DIRLIGHT0 = false; + this.DIRLIGHT1 = false; + this.DIRLIGHT2 = false; + this.DIRLIGHT3 = false; + this.POINTLIGHT0 = false; + this.POINTLIGHT1 = false; + this.POINTLIGHT2 = false; + this.POINTLIGHT3 = false; + this.SHADOW0 = false; + this.SHADOW1 = false; + this.SHADOW2 = false; + this.SHADOW3 = false; + this.SHADOWS = false; + this.SHADOWESM0 = false; + this.SHADOWESM1 = false; + this.SHADOWESM2 = false; + this.SHADOWESM3 = false; + this.SHADOWPOISSON0 = false; + this.SHADOWPOISSON1 = false; + this.SHADOWPOISSON2 = false; + this.SHADOWPOISSON3 = false; + this.SHADOWPCF0 = false; + this.SHADOWPCF1 = false; + this.SHADOWPCF2 = false; + this.SHADOWPCF3 = false; + this.SHADOWPCSS0 = false; + this.SHADOWPCSS1 = false; + this.SHADOWPCSS2 = false; + this.SHADOWPCSS3 = false; + this.NORMAL = false; + this.UV1 = false; + this.UV2 = false; + this.VERTEXCOLOR = false; + this.VERTEXALPHA = false; + this.NUM_BONE_INFLUENCERS = 0; + this.BonesPerMesh = 0; + this.INSTANCES = false; + this.INSTANCESCOLOR = false; + this.UNLIT = false; + this.IMAGEPROCESSINGPOSTPROCESS = false; + this.SKIPFINALCOLORCLAMP = false; + this.LOGARITHMICDEPTH = false; + this.rebuild(); + } +} + +class LavaMaterial extends PushMaterial { + constructor(name298, scene42) { + super(name298, scene42); + this.speed = 1; + this.movingSpeed = 1; + this.lowFrequencySpeed = 1; + this.fogDensity = 0.15; + this._lastTime = 0; + this.diffuseColor = new Color3(1, 1, 1); + this._disableLighting = false; + this._unlit = false; + this._maxSimultaneousLights = 4; + this._scaledDiffuse = new Color3; + } + needAlphaBlending() { + return this.alpha < 1; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh80, subMesh11, useInstances) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady && subMesh11.effect._wasPreviouslyUsingInstances === useInstances) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new LavaMaterialDefines; + } + const defines = subMesh11.materialDefines; + const scene42 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene42.getEngine(); + if (defines._areTexturesDirty) { + defines._needUVs = false; + if (scene42.texturesEnabled) { + if (this._diffuseTexture && MaterialFlags.DiffuseTextureEnabled) { + if (!this._diffuseTexture.isReady()) { + return false; + } else { + defines._needUVs = true; + defines.DIFFUSE = true; + } + } + } + } + MaterialHelper.PrepareDefinesForMisc(mesh80, scene42, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh80), defines); + defines._needNormals = true; + MaterialHelper.PrepareDefinesForLights(scene42, mesh80, defines, false, this._maxSimultaneousLights, this._disableLighting); + MaterialHelper.PrepareDefinesForFrameBoundValues(scene42, engine47, this, defines, useInstances ? true : false); + MaterialHelper.PrepareDefinesForAttributes(mesh80, defines, true, true); + if (defines.isDirty) { + defines.markAsProcessed(); + scene42.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh80); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene42.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + MaterialHelper.PrepareAttributesForBones(attribs, mesh80, defines, fallbacks); + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "lava"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "view", + "viewProjection", + "vEyePosition", + "vLightsType", + "vDiffuseColor", + "vFogInfos", + "vFogColor", + "pointSize", + "vDiffuseInfos", + "mBones", + "diffuseMatrix", + "logarithmicDepthConstant", + "time", + "speed", + "movingSpeed", + "fogColor", + "fogDensity", + "lowFrequencySpeed" + ]; + addClipPlaneUniforms(uniforms2); + const samplers = ["diffuseSampler", "noiseTexture"]; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: this.maxSimultaneousLights + }); + subMesh11.setEffect(scene42.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene42.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + subMesh11.effect._wasPreviouslyUsingInstances = !!useInstances; + return true; + } + bindForSubMesh(world, mesh80, subMesh11) { + const scene42 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + defines.UNLIT = this._unlit; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene42.getTransformMatrix()); + MaterialHelper.BindBonesParameters(mesh80, this._activeEffect); + if (this._mustRebind(scene42, effect20)) { + if (this.diffuseTexture && MaterialFlags.DiffuseTextureEnabled) { + this._activeEffect.setTexture("diffuseSampler", this.diffuseTexture); + this._activeEffect.setFloat2("vDiffuseInfos", this.diffuseTexture.coordinatesIndex, this.diffuseTexture.level); + this._activeEffect.setMatrix("diffuseMatrix", this.diffuseTexture.getTextureMatrix()); + } + if (this.noiseTexture) { + this._activeEffect.setTexture("noiseTexture", this.noiseTexture); + } + bindClipPlane(effect20, this, scene42); + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + if (this._useLogarithmicDepth) { + MaterialHelper.BindLogDepth(defines, effect20, scene42); + } + scene42.bindEyePosition(effect20); + } + this._activeEffect.setColor4("vDiffuseColor", this._scaledDiffuse, this.alpha * mesh80.visibility); + if (scene42.lightsEnabled && !this.disableLighting) { + MaterialHelper.BindLights(scene42, mesh80, this._activeEffect, defines); + } + if (scene42.fogEnabled && mesh80.applyFog && scene42.fogMode !== Scene.FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene42.getViewMatrix()); + } + MaterialHelper.BindFogParameters(scene42, mesh80, this._activeEffect); + this._lastTime += scene42.getEngine().getDeltaTime(); + this._activeEffect.setFloat("time", this._lastTime * this.speed / 1000); + if (!this.fogColor) { + this.fogColor = Color3.Black(); + } + this._activeEffect.setColor3("fogColor", this.fogColor); + this._activeEffect.setFloat("fogDensity", this.fogDensity); + this._activeEffect.setFloat("lowFrequencySpeed", this.lowFrequencySpeed); + this._activeEffect.setFloat("movingSpeed", this.movingSpeed); + this._afterBind(mesh80, this._activeEffect); + } + getAnimatables() { + const results = []; + if (this.diffuseTexture && this.diffuseTexture.animations && this.diffuseTexture.animations.length > 0) { + results.push(this.diffuseTexture); + } + if (this.noiseTexture && this.noiseTexture.animations && this.noiseTexture.animations.length > 0) { + results.push(this.noiseTexture); + } + return results; + } + getActiveTextures() { + const activeTextures = super.getActiveTextures(); + if (this._diffuseTexture) { + activeTextures.push(this._diffuseTexture); + } + return activeTextures; + } + hasTexture(texture90) { + if (super.hasTexture(texture90)) { + return true; + } + if (this.diffuseTexture === texture90) { + return true; + } + return false; + } + dispose(forceDisposeEffect) { + if (this.diffuseTexture) { + this.diffuseTexture.dispose(); + } + if (this.noiseTexture) { + this.noiseTexture.dispose(); + } + super.dispose(forceDisposeEffect); + } + clone(name298) { + return SerializationHelper.Clone(() => new LavaMaterial(name298, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.LavaMaterial"; + return serializationObject; + } + getClassName() { + return "LavaMaterial"; + } + static Parse(source, scene42, rootUrl) { + return SerializationHelper.Parse(() => new LavaMaterial(source.name, scene42), source, scene42, rootUrl); + } +} +var init_lavaMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_color(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_materialFlags(); + init_buffer(); + init_scene(); + init_typeStore(); + init_lava_fragment(); + init_lava_vertex(); + init_effectFallbacks(); + init_clipPlaneMaterialHelper(); + __decorate2([ + serializeAsTexture("diffuseTexture") + ], LavaMaterial.prototype, "_diffuseTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], LavaMaterial.prototype, "diffuseTexture", undefined); + __decorate2([ + serializeAsTexture() + ], LavaMaterial.prototype, "noiseTexture", undefined); + __decorate2([ + serializeAsColor3() + ], LavaMaterial.prototype, "fogColor", undefined); + __decorate2([ + serialize() + ], LavaMaterial.prototype, "speed", undefined); + __decorate2([ + serialize() + ], LavaMaterial.prototype, "movingSpeed", undefined); + __decorate2([ + serialize() + ], LavaMaterial.prototype, "lowFrequencySpeed", undefined); + __decorate2([ + serialize() + ], LavaMaterial.prototype, "fogDensity", undefined); + __decorate2([ + serializeAsColor3() + ], LavaMaterial.prototype, "diffuseColor", undefined); + __decorate2([ + serialize("disableLighting") + ], LavaMaterial.prototype, "_disableLighting", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], LavaMaterial.prototype, "disableLighting", undefined); + __decorate2([ + serialize("unlit") + ], LavaMaterial.prototype, "_unlit", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], LavaMaterial.prototype, "unlit", undefined); + __decorate2([ + serialize("maxSimultaneousLights") + ], LavaMaterial.prototype, "_maxSimultaneousLights", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], LavaMaterial.prototype, "maxSimultaneousLights", undefined); + RegisterClass("BABYLON.LavaMaterial", LavaMaterial); +}); + +// node_modules/@babylonjs/materials/lava/index.js +var init_lava = __esm(() => { + init_lavaMaterial(); +}); + +// node_modules/@babylonjs/materials/mix/mix.fragment.js +var name298, shader297; +var init_mix_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_lightsFragmentFunctions(); + init_shadowsFragmentFunctions(); + init_clipPlaneFragmentDeclaration(); + init_logDepthDeclaration(); + init_fogFragmentDeclaration(); + init_clipPlaneFragment(); + init_depthPrePass(); + init_lightFragment(); + init_logDepthFragment(); + init_fogFragment(); + init_imageProcessingCompatibility(); + name298 = "mixPixelShader"; + shader297 = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor; +#ifdef SPECULARTERM +uniform vec4 vSpecularColor; +#endif +varying vec3 vPositionW; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#ifdef VERTEXCOLOR +varying vec4 vColor; +#endif +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +#ifdef DIFFUSE +varying vec2 vTextureUV;uniform sampler2D mixMap1Sampler;uniform vec2 vTextureInfos; +#ifdef MIXMAP2 +uniform sampler2D mixMap2Sampler; +#endif +uniform sampler2D diffuse1Sampler;uniform sampler2D diffuse2Sampler;uniform sampler2D diffuse3Sampler;uniform sampler2D diffuse4Sampler;uniform vec2 diffuse1Infos;uniform vec2 diffuse2Infos;uniform vec2 diffuse3Infos;uniform vec2 diffuse4Infos; +#ifdef MIXMAP2 +uniform sampler2D diffuse5Sampler;uniform sampler2D diffuse6Sampler;uniform sampler2D diffuse7Sampler;uniform sampler2D diffuse8Sampler;uniform vec2 diffuse5Infos;uniform vec2 diffuse6Infos;uniform vec2 diffuse7Infos;uniform vec2 diffuse8Infos; +#endif +#endif +#include +#include +#include +#ifdef LOGARITHMICDEPTH +#extension GL_EXT_frag_depth : enable +#endif +#include +#include +#define CUSTOM_FRAGMENT_DEFINITIONS +void main(void) { +#define CUSTOM_FRAGMENT_MAIN_BEGIN +#include +vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 finalMixColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb; +#ifdef MIXMAP2 +vec4 mixColor2=vec4(1.,1.,1.,1.); +#endif +#ifdef SPECULARTERM +float glossiness=vSpecularColor.a;vec3 specularColor=vSpecularColor.rgb; +#else +float glossiness=0.; +#endif +float alpha=vDiffuseColor.a; +#ifdef NORMAL +vec3 normalW=normalize(vNormalW); +#else +vec3 normalW=vec3(1.0,1.0,1.0); +#endif +#ifdef DIFFUSE +vec4 mixColor=texture2D(mixMap1Sampler,vTextureUV); +#include +mixColor.rgb*=vTextureInfos.y;vec4 diffuse1Color=texture2D(diffuse1Sampler,vTextureUV*diffuse1Infos);vec4 diffuse2Color=texture2D(diffuse2Sampler,vTextureUV*diffuse2Infos);vec4 diffuse3Color=texture2D(diffuse3Sampler,vTextureUV*diffuse3Infos);vec4 diffuse4Color=texture2D(diffuse4Sampler,vTextureUV*diffuse4Infos);diffuse1Color.rgb*=mixColor.r;diffuse2Color.rgb=mix(diffuse1Color.rgb,diffuse2Color.rgb,mixColor.g);diffuse3Color.rgb=mix(diffuse2Color.rgb,diffuse3Color.rgb,mixColor.b);finalMixColor.rgb=mix(diffuse3Color.rgb,diffuse4Color.rgb,1.0-mixColor.a); +#ifdef MIXMAP2 +mixColor=texture2D(mixMap2Sampler,vTextureUV);mixColor.rgb*=vTextureInfos.y;vec4 diffuse5Color=texture2D(diffuse5Sampler,vTextureUV*diffuse5Infos);vec4 diffuse6Color=texture2D(diffuse6Sampler,vTextureUV*diffuse6Infos);vec4 diffuse7Color=texture2D(diffuse7Sampler,vTextureUV*diffuse7Infos);vec4 diffuse8Color=texture2D(diffuse8Sampler,vTextureUV*diffuse8Infos);diffuse5Color.rgb=mix(finalMixColor.rgb,diffuse5Color.rgb,mixColor.r);diffuse6Color.rgb=mix(diffuse5Color.rgb,diffuse6Color.rgb,mixColor.g);diffuse7Color.rgb=mix(diffuse6Color.rgb,diffuse7Color.rgb,mixColor.b);finalMixColor.rgb=mix(diffuse7Color.rgb,diffuse8Color.rgb,1.0-mixColor.a); +#endif +#endif +#ifdef VERTEXCOLOR +finalMixColor.rgb*=vColor.rgb; +#endif +vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.; +#ifdef SPECULARTERM +vec3 specularBase=vec3(0.,0.,0.); +#endif +#include[0..maxSimultaneousLights] +#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) +alpha*=vColor.a; +#endif +#ifdef SPECULARTERM +vec3 finalSpecular=specularBase*specularColor; +#else +vec3 finalSpecular=vec3(0.0); +#endif +vec3 finalDiffuse=clamp(diffuseBase*diffuseColor*finalMixColor.rgb,0.0,1.0);vec4 color=vec4(finalDiffuse+finalSpecular,alpha); +#include +#include +gl_FragColor=color; +#include +#define CUSTOM_FRAGMENT_MAIN_END +} +`; + ShaderStore.ShadersStore[name298] = shader297; +}); + +// node_modules/@babylonjs/materials/mix/mix.vertex.js +var name299, shader298; +var init_mix_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_instancesDeclaration(); + init_clipPlaneVertexDeclaration(); + init_logDepthDeclaration(); + init_fogVertexDeclaration(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + init_fogVertex(); + init_shadowsVertex(); + init_vertexColorMixing(); + init_logDepthVertex(); + name299 = "mixVertexShader"; + shader298 = `precision highp float;attribute vec3 position; +#ifdef NORMAL +attribute vec3 normal; +#endif +#ifdef UV1 +attribute vec2 uv; +#endif +#ifdef UV2 +attribute vec2 uv2; +#endif +#ifdef VERTEXCOLOR +attribute vec4 color; +#endif +#include +#include +#include +uniform mat4 view;uniform mat4 viewProjection; +#ifdef DIFFUSE +varying vec2 vTextureUV;uniform mat4 textureMatrix;uniform vec2 vTextureInfos; +#endif +#ifdef POINTSIZE +uniform float pointSize; +#endif +varying vec3 vPositionW; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#ifdef VERTEXCOLOR +varying vec4 vColor; +#endif +#include +#include +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +#define CUSTOM_VERTEX_DEFINITIONS +void main(void) { +#define CUSTOM_VERTEX_MAIN_BEGIN +#include +#include +#include +vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos); +#ifdef NORMAL +vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0))); +#endif +#ifndef UV1 +vec2 uv=vec2(0.,0.); +#endif +#ifndef UV2 +vec2 uv2=vec2(0.,0.); +#endif +#ifdef DIFFUSE +if (vTextureInfos.x==0.) +{vTextureUV=vec2(textureMatrix*vec4(uv,1.0,0.0));} +else +{vTextureUV=vec2(textureMatrix*vec4(uv2,1.0,0.0));} +#endif +#include +#include +#include[0..maxSimultaneousLights] +#include +#if defined(POINTSIZE) && !defined(WEBGPU) +gl_PointSize=pointSize; +#endif +#include +#define CUSTOM_VERTEX_MAIN_END +} +`; + ShaderStore.ShadersStore[name299] = shader298; +}); + +// node_modules/@babylonjs/materials/mix/mixMaterial.js +class MixMaterialDefines extends MaterialDefines { + constructor() { + super(); + this.DIFFUSE = false; + this.CLIPPLANE = false; + this.CLIPPLANE2 = false; + this.CLIPPLANE3 = false; + this.CLIPPLANE4 = false; + this.CLIPPLANE5 = false; + this.CLIPPLANE6 = false; + this.ALPHATEST = false; + this.DEPTHPREPASS = false; + this.POINTSIZE = false; + this.FOG = false; + this.SPECULARTERM = false; + this.NORMAL = false; + this.UV1 = false; + this.UV2 = false; + this.VERTEXCOLOR = false; + this.VERTEXALPHA = false; + this.NUM_BONE_INFLUENCERS = 0; + this.BonesPerMesh = 0; + this.INSTANCES = false; + this.INSTANCESCOLOR = false; + this.MIXMAP2 = false; + this.IMAGEPROCESSINGPOSTPROCESS = false; + this.SKIPFINALCOLORCLAMP = false; + this.LOGARITHMICDEPTH = false; + this.rebuild(); + } +} + +class MixMaterial extends PushMaterial { + constructor(name300, scene43) { + super(name300, scene43); + this.diffuseColor = new Color3(1, 1, 1); + this.specularColor = new Color3(0, 0, 0); + this.specularPower = 64; + this._disableLighting = false; + this._maxSimultaneousLights = 4; + } + needAlphaBlending() { + return this.alpha < 1; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh80, subMesh11, useInstances) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady && subMesh11.effect._wasPreviouslyUsingInstances === useInstances) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new MixMaterialDefines; + } + const defines = subMesh11.materialDefines; + const scene43 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene43.getEngine(); + if (scene43.texturesEnabled) { + if (!this._mixTexture1 || !this._mixTexture1.isReady()) { + return false; + } + defines._needUVs = true; + if (MaterialFlags.DiffuseTextureEnabled) { + if (!this._diffuseTexture1 || !this._diffuseTexture1.isReady()) { + return false; + } + defines.DIFFUSE = true; + if (!this._diffuseTexture2 || !this._diffuseTexture2.isReady()) { + return false; + } + if (!this._diffuseTexture3 || !this._diffuseTexture3.isReady()) { + return false; + } + if (!this._diffuseTexture4 || !this._diffuseTexture4.isReady()) { + return false; + } + if (this._mixTexture2) { + if (!this._mixTexture2.isReady()) { + return false; + } + defines.MIXMAP2 = true; + if (!this._diffuseTexture5 || !this._diffuseTexture5.isReady()) { + return false; + } + if (!this._diffuseTexture6 || !this._diffuseTexture6.isReady()) { + return false; + } + if (!this._diffuseTexture7 || !this._diffuseTexture7.isReady()) { + return false; + } + if (!this._diffuseTexture8 || !this._diffuseTexture8.isReady()) { + return false; + } + } + } + } + MaterialHelper.PrepareDefinesForMisc(mesh80, scene43, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh80), defines); + defines._needNormals = MaterialHelper.PrepareDefinesForLights(scene43, mesh80, defines, false, this._maxSimultaneousLights, this._disableLighting); + MaterialHelper.PrepareDefinesForFrameBoundValues(scene43, engine47, this, defines, useInstances ? true : false); + MaterialHelper.PrepareDefinesForAttributes(mesh80, defines, true, true); + if (defines.isDirty) { + defines.markAsProcessed(); + scene43.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh80); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene43.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + MaterialHelper.PrepareAttributesForBones(attribs, mesh80, defines, fallbacks); + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "mix"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "view", + "viewProjection", + "vEyePosition", + "vLightsType", + "vDiffuseColor", + "vSpecularColor", + "vFogInfos", + "vFogColor", + "pointSize", + "vTextureInfos", + "mBones", + "textureMatrix", + "logarithmicDepthConstant", + "diffuse1Infos", + "diffuse2Infos", + "diffuse3Infos", + "diffuse4Infos", + "diffuse5Infos", + "diffuse6Infos", + "diffuse7Infos", + "diffuse8Infos" + ]; + const samplers = [ + "mixMap1Sampler", + "mixMap2Sampler", + "diffuse1Sampler", + "diffuse2Sampler", + "diffuse3Sampler", + "diffuse4Sampler", + "diffuse5Sampler", + "diffuse6Sampler", + "diffuse7Sampler", + "diffuse8Sampler" + ]; + const uniformBuffers = []; + addClipPlaneUniforms(uniforms2); + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: this.maxSimultaneousLights + }); + subMesh11.setEffect(scene43.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene43.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + subMesh11.effect._wasPreviouslyUsingInstances = !!useInstances; + return true; + } + bindForSubMesh(world, mesh80, subMesh11) { + const scene43 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene43.getTransformMatrix()); + MaterialHelper.BindBonesParameters(mesh80, this._activeEffect); + if (this._mustRebind(scene43, effect20)) { + if (this._mixTexture1) { + this._activeEffect.setTexture("mixMap1Sampler", this._mixTexture1); + this._activeEffect.setFloat2("vTextureInfos", this._mixTexture1.coordinatesIndex, this._mixTexture1.level); + this._activeEffect.setMatrix("textureMatrix", this._mixTexture1.getTextureMatrix()); + if (MaterialFlags.DiffuseTextureEnabled) { + if (this._diffuseTexture1) { + this._activeEffect.setTexture("diffuse1Sampler", this._diffuseTexture1); + this._activeEffect.setFloat2("diffuse1Infos", this._diffuseTexture1.uScale, this._diffuseTexture1.vScale); + } + if (this._diffuseTexture2) { + this._activeEffect.setTexture("diffuse2Sampler", this._diffuseTexture2); + this._activeEffect.setFloat2("diffuse2Infos", this._diffuseTexture2.uScale, this._diffuseTexture2.vScale); + } + if (this._diffuseTexture3) { + this._activeEffect.setTexture("diffuse3Sampler", this._diffuseTexture3); + this._activeEffect.setFloat2("diffuse3Infos", this._diffuseTexture3.uScale, this._diffuseTexture3.vScale); + } + if (this._diffuseTexture4) { + this._activeEffect.setTexture("diffuse4Sampler", this._diffuseTexture4); + this._activeEffect.setFloat2("diffuse4Infos", this._diffuseTexture4.uScale, this._diffuseTexture4.vScale); + } + } + } + if (this._mixTexture2) { + this._activeEffect.setTexture("mixMap2Sampler", this._mixTexture2); + if (MaterialFlags.DiffuseTextureEnabled) { + if (this._diffuseTexture5) { + this._activeEffect.setTexture("diffuse5Sampler", this._diffuseTexture5); + this._activeEffect.setFloat2("diffuse5Infos", this._diffuseTexture5.uScale, this._diffuseTexture5.vScale); + } + if (this._diffuseTexture6) { + this._activeEffect.setTexture("diffuse6Sampler", this._diffuseTexture6); + this._activeEffect.setFloat2("diffuse6Infos", this._diffuseTexture6.uScale, this._diffuseTexture6.vScale); + } + if (this._diffuseTexture7) { + this._activeEffect.setTexture("diffuse7Sampler", this._diffuseTexture7); + this._activeEffect.setFloat2("diffuse7Infos", this._diffuseTexture7.uScale, this._diffuseTexture7.vScale); + } + if (this._diffuseTexture8) { + this._activeEffect.setTexture("diffuse8Sampler", this._diffuseTexture8); + this._activeEffect.setFloat2("diffuse8Infos", this._diffuseTexture8.uScale, this._diffuseTexture8.vScale); + } + } + } + bindClipPlane(effect20, this, scene43); + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + if (this._useLogarithmicDepth) { + MaterialHelper.BindLogDepth(defines, effect20, scene43); + } + scene43.bindEyePosition(effect20); + } + this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh80.visibility); + if (defines.SPECULARTERM) { + this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower); + } + if (scene43.lightsEnabled && !this.disableLighting) { + MaterialHelper.BindLights(scene43, mesh80, this._activeEffect, defines, this.maxSimultaneousLights); + } + if (scene43.fogEnabled && mesh80.applyFog && scene43.fogMode !== Scene.FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene43.getViewMatrix()); + } + MaterialHelper.BindFogParameters(scene43, mesh80, this._activeEffect); + this._afterBind(mesh80, this._activeEffect); + } + getAnimatables() { + const results = []; + if (this._mixTexture1 && this._mixTexture1.animations && this._mixTexture1.animations.length > 0) { + results.push(this._mixTexture1); + } + if (this._mixTexture2 && this._mixTexture2.animations && this._mixTexture2.animations.length > 0) { + results.push(this._mixTexture2); + } + return results; + } + getActiveTextures() { + const activeTextures = super.getActiveTextures(); + if (this._mixTexture1) { + activeTextures.push(this._mixTexture1); + } + if (this._diffuseTexture1) { + activeTextures.push(this._diffuseTexture1); + } + if (this._diffuseTexture2) { + activeTextures.push(this._diffuseTexture2); + } + if (this._diffuseTexture3) { + activeTextures.push(this._diffuseTexture3); + } + if (this._diffuseTexture4) { + activeTextures.push(this._diffuseTexture4); + } + if (this._mixTexture2) { + activeTextures.push(this._mixTexture2); + } + if (this._diffuseTexture5) { + activeTextures.push(this._diffuseTexture5); + } + if (this._diffuseTexture6) { + activeTextures.push(this._diffuseTexture6); + } + if (this._diffuseTexture7) { + activeTextures.push(this._diffuseTexture7); + } + if (this._diffuseTexture8) { + activeTextures.push(this._diffuseTexture8); + } + return activeTextures; + } + hasTexture(texture90) { + if (super.hasTexture(texture90)) { + return true; + } + if (this._mixTexture1 === texture90) { + return true; + } + if (this._diffuseTexture1 === texture90) { + return true; + } + if (this._diffuseTexture2 === texture90) { + return true; + } + if (this._diffuseTexture3 === texture90) { + return true; + } + if (this._diffuseTexture4 === texture90) { + return true; + } + if (this._mixTexture2 === texture90) { + return true; + } + if (this._diffuseTexture5 === texture90) { + return true; + } + if (this._diffuseTexture6 === texture90) { + return true; + } + if (this._diffuseTexture7 === texture90) { + return true; + } + if (this._diffuseTexture8 === texture90) { + return true; + } + return false; + } + dispose(forceDisposeEffect) { + if (this._mixTexture1) { + this._mixTexture1.dispose(); + } + super.dispose(forceDisposeEffect); + } + clone(name300) { + return SerializationHelper.Clone(() => new MixMaterial(name300, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.MixMaterial"; + return serializationObject; + } + getClassName() { + return "MixMaterial"; + } + static Parse(source, scene43, rootUrl) { + return SerializationHelper.Parse(() => new MixMaterial(source.name, scene43), source, scene43, rootUrl); + } +} +var init_mixMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_color(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_materialFlags(); + init_buffer(); + init_scene(); + init_typeStore(); + init_mix_fragment(); + init_mix_vertex(); + init_effectFallbacks(); + init_clipPlaneMaterialHelper(); + __decorate2([ + serializeAsTexture("mixTexture1") + ], MixMaterial.prototype, "_mixTexture1", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "mixTexture1", undefined); + __decorate2([ + serializeAsTexture("mixTexture2") + ], MixMaterial.prototype, "_mixTexture2", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "mixTexture2", undefined); + __decorate2([ + serializeAsTexture("diffuseTexture1") + ], MixMaterial.prototype, "_diffuseTexture1", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "diffuseTexture1", undefined); + __decorate2([ + serializeAsTexture("diffuseTexture2") + ], MixMaterial.prototype, "_diffuseTexture2", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "diffuseTexture2", undefined); + __decorate2([ + serializeAsTexture("diffuseTexture3") + ], MixMaterial.prototype, "_diffuseTexture3", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "diffuseTexture3", undefined); + __decorate2([ + serializeAsTexture("diffuseTexture4") + ], MixMaterial.prototype, "_diffuseTexture4", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "diffuseTexture4", undefined); + __decorate2([ + serializeAsTexture("diffuseTexture1") + ], MixMaterial.prototype, "_diffuseTexture5", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "diffuseTexture5", undefined); + __decorate2([ + serializeAsTexture("diffuseTexture2") + ], MixMaterial.prototype, "_diffuseTexture6", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "diffuseTexture6", undefined); + __decorate2([ + serializeAsTexture("diffuseTexture3") + ], MixMaterial.prototype, "_diffuseTexture7", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "diffuseTexture7", undefined); + __decorate2([ + serializeAsTexture("diffuseTexture4") + ], MixMaterial.prototype, "_diffuseTexture8", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], MixMaterial.prototype, "diffuseTexture8", undefined); + __decorate2([ + serializeAsColor3() + ], MixMaterial.prototype, "diffuseColor", undefined); + __decorate2([ + serializeAsColor3() + ], MixMaterial.prototype, "specularColor", undefined); + __decorate2([ + serialize() + ], MixMaterial.prototype, "specularPower", undefined); + __decorate2([ + serialize("disableLighting") + ], MixMaterial.prototype, "_disableLighting", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], MixMaterial.prototype, "disableLighting", undefined); + __decorate2([ + serialize("maxSimultaneousLights") + ], MixMaterial.prototype, "_maxSimultaneousLights", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], MixMaterial.prototype, "maxSimultaneousLights", undefined); + RegisterClass("BABYLON.MixMaterial", MixMaterial); +}); + +// node_modules/@babylonjs/materials/mix/index.js +var init_mix = __esm(() => { + init_mixMaterial(); +}); + +// node_modules/@babylonjs/materials/normal/normal.fragment.js +var name300, shader299; +var init_normal_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_lightsFragmentFunctions(); + init_shadowsFragmentFunctions(); + init_clipPlaneFragmentDeclaration(); + init_logDepthDeclaration(); + init_fogFragmentDeclaration(); + init_clipPlaneFragment(); + init_depthPrePass(); + init_lightFragment(); + init_logDepthFragment(); + init_fogFragment(); + init_imageProcessingCompatibility(); + name300 = "normalPixelShader"; + shader299 = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#ifdef LIGHTING +#include +#include<__decl__lightFragment>[0] +#include<__decl__lightFragment>[1] +#include<__decl__lightFragment>[2] +#include<__decl__lightFragment>[3] +#include +#include +#endif +#ifdef DIFFUSE +varying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos; +#endif +#include +#ifdef LOGARITHMICDEPTH +#extension GL_EXT_frag_depth : enable +#endif +#include +#include +#define CUSTOM_FRAGMENT_DEFINITIONS +void main(void) { +#define CUSTOM_FRAGMENT_MAIN_BEGIN +#include +vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a; +#ifdef DIFFUSE +baseColor=texture2D(diffuseSampler,vDiffuseUV); +#ifdef ALPHATEST +if (baseColor.a<0.4) +discard; +#endif +#include +baseColor.rgb*=vDiffuseInfos.y; +#endif +#ifdef NORMAL +baseColor=mix(baseColor,vec4(vNormalW,1.0),0.5); +#endif +#ifdef NORMAL +vec3 normalW=normalize(vNormalW); +#else +vec3 normalW=vec3(1.0,1.0,1.0); +#endif +#ifdef LIGHTING +vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.; +#include[0] +#include[1] +#include[2] +#include[3] +vec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb; +#else +vec3 finalDiffuse= baseColor.rgb; +#endif +vec4 color=vec4(finalDiffuse,alpha); +#include +#include +gl_FragColor=color; +#include +#define CUSTOM_FRAGMENT_MAIN_END +}`; + ShaderStore.ShadersStore[name300] = shader299; +}); + +// node_modules/@babylonjs/materials/normal/normal.vertex.js +var name301, shader300; +var init_normal_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_instancesDeclaration(); + init_clipPlaneVertexDeclaration(); + init_logDepthDeclaration(); + init_fogVertexDeclaration(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + init_logDepthVertex(); + init_fogVertex(); + init_shadowsVertex(); + name301 = "normalVertexShader"; + shader300 = `precision highp float;attribute vec3 position; +#ifdef NORMAL +attribute vec3 normal; +#endif +#ifdef UV1 +attribute vec2 uv; +#endif +#ifdef UV2 +attribute vec2 uv2; +#endif +#ifdef VERTEXCOLOR +attribute vec4 color; +#endif +#include +#include +#include +uniform mat4 view;uniform mat4 viewProjection; +#ifdef DIFFUSE +varying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos; +#endif +#ifdef POINTSIZE +uniform float pointSize; +#endif +varying vec3 vPositionW; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#include +#include +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +#define CUSTOM_VERTEX_DEFINITIONS +void main(void) { +#define CUSTOM_VERTEX_MAIN_BEGIN +#include +#include +#include +vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos); +#ifdef NORMAL +vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0))); +#endif +#ifndef UV1 +vec2 uv=vec2(0.,0.); +#endif +#ifndef UV2 +vec2 uv2=vec2(0.,0.); +#endif +#ifdef DIFFUSE +if (vDiffuseInfos.x==0.) +{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));} +else +{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));} +#endif +#include +#include +#include +#include[0..maxSimultaneousLights] +#if defined(POINTSIZE) && !defined(WEBGPU) +gl_PointSize=pointSize; +#endif +#define CUSTOM_VERTEX_MAIN_END +} +`; + ShaderStore.ShadersStore[name301] = shader300; +}); + +// node_modules/@babylonjs/materials/normal/normalMaterial.js +class NormalMaterialDefines extends MaterialDefines { + constructor() { + super(); + this.DIFFUSE = false; + this.CLIPPLANE = false; + this.CLIPPLANE2 = false; + this.CLIPPLANE3 = false; + this.CLIPPLANE4 = false; + this.CLIPPLANE5 = false; + this.CLIPPLANE6 = false; + this.ALPHATEST = false; + this.DEPTHPREPASS = false; + this.POINTSIZE = false; + this.FOG = false; + this.LIGHT0 = false; + this.LIGHT1 = false; + this.LIGHT2 = false; + this.LIGHT3 = false; + this.SPOTLIGHT0 = false; + this.SPOTLIGHT1 = false; + this.SPOTLIGHT2 = false; + this.SPOTLIGHT3 = false; + this.HEMILIGHT0 = false; + this.HEMILIGHT1 = false; + this.HEMILIGHT2 = false; + this.HEMILIGHT3 = false; + this.DIRLIGHT0 = false; + this.DIRLIGHT1 = false; + this.DIRLIGHT2 = false; + this.DIRLIGHT3 = false; + this.POINTLIGHT0 = false; + this.POINTLIGHT1 = false; + this.POINTLIGHT2 = false; + this.POINTLIGHT3 = false; + this.SHADOW0 = false; + this.SHADOW1 = false; + this.SHADOW2 = false; + this.SHADOW3 = false; + this.SHADOWS = false; + this.SHADOWESM0 = false; + this.SHADOWESM1 = false; + this.SHADOWESM2 = false; + this.SHADOWESM3 = false; + this.SHADOWPOISSON0 = false; + this.SHADOWPOISSON1 = false; + this.SHADOWPOISSON2 = false; + this.SHADOWPOISSON3 = false; + this.SHADOWPCF0 = false; + this.SHADOWPCF1 = false; + this.SHADOWPCF2 = false; + this.SHADOWPCF3 = false; + this.SHADOWPCSS0 = false; + this.SHADOWPCSS1 = false; + this.SHADOWPCSS2 = false; + this.SHADOWPCSS3 = false; + this.NORMAL = false; + this.UV1 = false; + this.UV2 = false; + this.NUM_BONE_INFLUENCERS = 0; + this.BonesPerMesh = 0; + this.INSTANCES = false; + this.LIGHTING = false; + this.IMAGEPROCESSINGPOSTPROCESS = false; + this.SKIPFINALCOLORCLAMP = false; + this.LOGARITHMICDEPTH = false; + this.rebuild(); + } +} + +class NormalMaterial extends PushMaterial { + constructor(name302, scene44) { + super(name302, scene44); + this.diffuseColor = new Color3(1, 1, 1); + this._disableLighting = false; + this._maxSimultaneousLights = 4; + } + needAlphaBlending() { + return this.alpha < 1; + } + needAlphaBlendingForMesh(mesh80) { + return this.needAlphaBlending() || mesh80.visibility < 1; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh80, subMesh11, useInstances) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady && subMesh11.effect._wasPreviouslyUsingInstances === useInstances) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new NormalMaterialDefines; + } + const defines = subMesh11.materialDefines; + const scene44 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene44.getEngine(); + if (defines._areTexturesDirty) { + defines._needUVs = false; + if (scene44.texturesEnabled) { + if (this._diffuseTexture && MaterialFlags.DiffuseTextureEnabled) { + if (!this._diffuseTexture.isReady()) { + return false; + } else { + defines._needUVs = true; + defines.DIFFUSE = true; + } + } + } + } + MaterialHelper.PrepareDefinesForMisc(mesh80, scene44, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh80), defines); + defines._needNormals = true; + MaterialHelper.PrepareDefinesForLights(scene44, mesh80, defines, false, this._maxSimultaneousLights, this._disableLighting); + MaterialHelper.PrepareDefinesForFrameBoundValues(scene44, engine47, this, defines, useInstances ? true : false); + defines.LIGHTING = !this._disableLighting; + MaterialHelper.PrepareDefinesForAttributes(mesh80, defines, true, true); + if (defines.isDirty) { + defines.markAsProcessed(); + scene44.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh80); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene44.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + MaterialHelper.PrepareAttributesForBones(attribs, mesh80, defines, fallbacks); + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "normal"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "view", + "viewProjection", + "vEyePosition", + "vLightsType", + "vDiffuseColor", + "vFogInfos", + "vFogColor", + "pointSize", + "vDiffuseInfos", + "mBones", + "diffuseMatrix", + "logarithmicDepthConstant" + ]; + const samplers = ["diffuseSampler"]; + const uniformBuffers = []; + addClipPlaneUniforms(uniforms2); + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene44.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene44.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + subMesh11.effect._wasPreviouslyUsingInstances = !!useInstances; + return true; + } + bindForSubMesh(world, mesh80, subMesh11) { + const scene44 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene44.getTransformMatrix()); + MaterialHelper.BindBonesParameters(mesh80, this._activeEffect); + if (this._mustRebind(scene44, effect20)) { + if (this.diffuseTexture && MaterialFlags.DiffuseTextureEnabled) { + this._activeEffect.setTexture("diffuseSampler", this.diffuseTexture); + this._activeEffect.setFloat2("vDiffuseInfos", this.diffuseTexture.coordinatesIndex, this.diffuseTexture.level); + this._activeEffect.setMatrix("diffuseMatrix", this.diffuseTexture.getTextureMatrix()); + } + bindClipPlane(effect20, this, scene44); + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + if (this._useLogarithmicDepth) { + MaterialHelper.BindLogDepth(defines, effect20, scene44); + } + scene44.bindEyePosition(effect20); + } + this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh80.visibility); + if (scene44.lightsEnabled && !this.disableLighting) { + MaterialHelper.BindLights(scene44, mesh80, this._activeEffect, defines); + } + if (scene44.fogEnabled && mesh80.applyFog && scene44.fogMode !== Scene.FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene44.getViewMatrix()); + } + MaterialHelper.BindFogParameters(scene44, mesh80, this._activeEffect); + this._afterBind(mesh80, this._activeEffect); + } + getAnimatables() { + const results = []; + if (this.diffuseTexture && this.diffuseTexture.animations && this.diffuseTexture.animations.length > 0) { + results.push(this.diffuseTexture); + } + return results; + } + getActiveTextures() { + const activeTextures = super.getActiveTextures(); + if (this._diffuseTexture) { + activeTextures.push(this._diffuseTexture); + } + return activeTextures; + } + hasTexture(texture90) { + if (super.hasTexture(texture90)) { + return true; + } + if (this.diffuseTexture === texture90) { + return true; + } + return false; + } + dispose(forceDisposeEffect) { + if (this.diffuseTexture) { + this.diffuseTexture.dispose(); + } + super.dispose(forceDisposeEffect); + } + clone(name302) { + return SerializationHelper.Clone(() => new NormalMaterial(name302, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.NormalMaterial"; + return serializationObject; + } + getClassName() { + return "NormalMaterial"; + } + static Parse(source, scene44, rootUrl) { + return SerializationHelper.Parse(() => new NormalMaterial(source.name, scene44), source, scene44, rootUrl); + } +} +var init_normalMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_color(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_materialFlags(); + init_buffer(); + init_scene(); + init_typeStore(); + init_normal_fragment(); + init_normal_vertex(); + init_effectFallbacks(); + init_clipPlaneMaterialHelper(); + __decorate2([ + serializeAsTexture("diffuseTexture") + ], NormalMaterial.prototype, "_diffuseTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], NormalMaterial.prototype, "diffuseTexture", undefined); + __decorate2([ + serializeAsColor3() + ], NormalMaterial.prototype, "diffuseColor", undefined); + __decorate2([ + serialize("disableLighting") + ], NormalMaterial.prototype, "_disableLighting", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], NormalMaterial.prototype, "disableLighting", undefined); + __decorate2([ + serialize("maxSimultaneousLights") + ], NormalMaterial.prototype, "_maxSimultaneousLights", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], NormalMaterial.prototype, "maxSimultaneousLights", undefined); + RegisterClass("BABYLON.NormalMaterial", NormalMaterial); +}); + +// node_modules/@babylonjs/materials/normal/index.js +var init_normal = __esm(() => { + init_normalMaterial(); +}); + +// node_modules/@babylonjs/materials/shadowOnly/shadowOnly.fragment.js +var name302, shader301; +var init_shadowOnly_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_lightsFragmentFunctions(); + init_shadowsFragmentFunctions(); + init_clipPlaneFragmentDeclaration(); + init_logDepthDeclaration(); + init_fogFragmentDeclaration(); + init_clipPlaneFragment(); + init_lightFragment(); + init_logDepthFragment(); + init_fogFragment(); + init_imageProcessingCompatibility(); + name302 = "shadowOnlyPixelShader"; + shader301 = `precision highp float;uniform vec4 vEyePosition;uniform float alpha;uniform vec3 shadowColor;varying vec3 vPositionW; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +#include +#include +#include +#ifdef LOGARITHMICDEPTH +#extension GL_EXT_frag_depth : enable +#endif +#include +#include +#define CUSTOM_FRAGMENT_DEFINITIONS +void main(void) { +#define CUSTOM_FRAGMENT_MAIN_BEGIN +#include +vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW); +#ifdef NORMAL +vec3 normalW=normalize(vNormalW); +#else +vec3 normalW=vec3(1.0,1.0,1.0); +#endif +vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.; +#include[0..1] +vec4 color=vec4(shadowColor,(1.0-clamp(shadow,0.,1.))*alpha); +#include +#include +gl_FragColor=color; +#include +#define CUSTOM_FRAGMENT_MAIN_END +}`; + ShaderStore.ShadersStore[name302] = shader301; +}); + +// node_modules/@babylonjs/materials/shadowOnly/shadowOnly.vertex.js +var name303, shader302; +var init_shadowOnly_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_instancesDeclaration(); + init_clipPlaneVertexDeclaration(); + init_logDepthDeclaration(); + init_fogVertexDeclaration(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + init_logDepthVertex(); + init_fogVertex(); + init_shadowsVertex(); + name303 = "shadowOnlyVertexShader"; + shader302 = `precision highp float;attribute vec3 position; +#ifdef NORMAL +attribute vec3 normal; +#endif +#include +#include +#include +uniform mat4 view;uniform mat4 viewProjection; +#ifdef POINTSIZE +uniform float pointSize; +#endif +varying vec3 vPositionW; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#ifdef VERTEXCOLOR +varying vec4 vColor; +#endif +#include +#include +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +#define CUSTOM_VERTEX_DEFINITIONS +void main(void) { +#define CUSTOM_VERTEX_MAIN_BEGIN +#include +#include +#include +vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos); +#ifdef NORMAL +vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0))); +#endif +#include +#include +#include +#include[0..maxSimultaneousLights] +#if defined(POINTSIZE) && !defined(WEBGPU) +gl_PointSize=pointSize; +#endif +#define CUSTOM_VERTEX_MAIN_END +} +`; + ShaderStore.ShadersStore[name303] = shader302; +}); + +// node_modules/@babylonjs/materials/shadowOnly/shadowOnlyMaterial.js +class ShadowOnlyMaterialDefines extends MaterialDefines { + constructor() { + super(); + this.CLIPPLANE = false; + this.CLIPPLANE2 = false; + this.CLIPPLANE3 = false; + this.CLIPPLANE4 = false; + this.CLIPPLANE5 = false; + this.CLIPPLANE6 = false; + this.POINTSIZE = false; + this.FOG = false; + this.NORMAL = false; + this.NUM_BONE_INFLUENCERS = 0; + this.BonesPerMesh = 0; + this.INSTANCES = false; + this.IMAGEPROCESSINGPOSTPROCESS = false; + this.SKIPFINALCOLORCLAMP = false; + this.LOGARITHMICDEPTH = false; + this.rebuild(); + } +} + +class ShadowOnlyMaterial extends PushMaterial { + constructor(name304, scene45) { + super(name304, scene45); + this._needAlphaBlending = true; + this.shadowColor = Color3.Black(); + } + needAlphaBlending() { + return this._needAlphaBlending; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + get activeLight() { + return this._activeLight; + } + set activeLight(light13) { + this._activeLight = light13; + } + _getFirstShadowLightForMesh(mesh80) { + for (const light13 of mesh80.lightSources) { + if (light13.shadowEnabled) { + return light13; + } + } + return null; + } + isReadyForSubMesh(mesh80, subMesh11, useInstances) { + var _a; + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady && subMesh11.effect._wasPreviouslyUsingInstances === useInstances) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new ShadowOnlyMaterialDefines; + } + const defines = subMesh11.materialDefines; + const scene45 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene45.getEngine(); + if (this._activeLight) { + for (const light13 of mesh80.lightSources) { + if (light13.shadowEnabled) { + if (this._activeLight === light13) { + break; + } + const lightPosition = mesh80.lightSources.indexOf(this._activeLight); + if (lightPosition !== -1) { + mesh80.lightSources.splice(lightPosition, 1); + mesh80.lightSources.splice(0, 0, this._activeLight); + } + break; + } + } + } + MaterialHelper.PrepareDefinesForFrameBoundValues(scene45, engine47, this, defines, useInstances ? true : false); + MaterialHelper.PrepareDefinesForMisc(mesh80, scene45, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh80), defines); + defines._needNormals = MaterialHelper.PrepareDefinesForLights(scene45, mesh80, defines, false, 1); + const shadowGenerator5 = (_a = this._getFirstShadowLightForMesh(mesh80)) === null || _a === undefined ? undefined : _a.getShadowGenerator(); + this._needAlphaBlending = true; + if (shadowGenerator5 && shadowGenerator5.getClassName && shadowGenerator5.getClassName() === "CascadedShadowGenerator") { + const csg3 = shadowGenerator5; + this._needAlphaBlending = !csg3.autoCalcDepthBounds; + } + MaterialHelper.PrepareDefinesForAttributes(mesh80, defines, false, true); + if (defines.isDirty) { + defines.markAsProcessed(); + scene45.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks, 1); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh80); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene45.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + MaterialHelper.PrepareAttributesForBones(attribs, mesh80, defines, fallbacks); + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "shadowOnly"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "view", + "viewProjection", + "vEyePosition", + "vLightsType", + "vFogInfos", + "vFogColor", + "pointSize", + "alpha", + "shadowColor", + "mBones", + "logarithmicDepthConstant" + ]; + const samplers = []; + const uniformBuffers = []; + addClipPlaneUniforms(uniforms2); + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 1 + }); + subMesh11.setEffect(scene45.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 1 } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene45.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + subMesh11.effect._wasPreviouslyUsingInstances = !!useInstances; + return true; + } + bindForSubMesh(world, mesh80, subMesh11) { + const scene45 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene45.getTransformMatrix()); + MaterialHelper.BindBonesParameters(mesh80, this._activeEffect); + if (this._mustRebind(scene45, effect20)) { + bindClipPlane(effect20, this, scene45); + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + this._activeEffect.setFloat("alpha", this.alpha); + this._activeEffect.setColor3("shadowColor", this.shadowColor); + if (this._useLogarithmicDepth) { + MaterialHelper.BindLogDepth(defines, effect20, scene45); + } + scene45.bindEyePosition(effect20); + } + if (scene45.lightsEnabled) { + MaterialHelper.BindLights(scene45, mesh80, this._activeEffect, defines, 1); + const light13 = this._getFirstShadowLightForMesh(mesh80); + if (light13) { + light13._renderId = -1; + } + } + if (scene45.fogEnabled && mesh80.applyFog && scene45.fogMode !== Scene.FOGMODE_NONE || defines["SHADOWCSM0"]) { + this._activeEffect.setMatrix("view", scene45.getViewMatrix()); + } + MaterialHelper.BindFogParameters(scene45, mesh80, this._activeEffect); + this._afterBind(mesh80, this._activeEffect); + } + clone(name304) { + return SerializationHelper.Clone(() => new ShadowOnlyMaterial(name304, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.ShadowOnlyMaterial"; + return serializationObject; + } + getClassName() { + return "ShadowOnlyMaterial"; + } + static Parse(source, scene45, rootUrl) { + return SerializationHelper.Parse(() => new ShadowOnlyMaterial(source.name, scene45), source, scene45, rootUrl); + } +} +var init_shadowOnlyMaterial = __esm(() => { + init_decorators(); + init_math_color(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_buffer(); + init_scene(); + init_typeStore(); + init_shadowOnly_fragment(); + init_shadowOnly_vertex(); + init_effectFallbacks(); + init_clipPlaneMaterialHelper(); + RegisterClass("BABYLON.ShadowOnlyMaterial", ShadowOnlyMaterial); +}); + +// node_modules/@babylonjs/materials/shadowOnly/index.js +var init_shadowOnly = __esm(() => { + init_shadowOnlyMaterial(); +}); + +// node_modules/@babylonjs/materials/simple/simple.fragment.js +var name304, shader303; +var init_simple_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_lightsFragmentFunctions(); + init_shadowsFragmentFunctions(); + init_clipPlaneFragmentDeclaration(); + init_logDepthDeclaration(); + init_fogFragmentDeclaration(); + init_clipPlaneFragment(); + init_depthPrePass(); + init_lightFragment(); + init_logDepthFragment(); + init_fogFragment(); + init_imageProcessingCompatibility(); + name304 = "simplePixelShader"; + shader303 = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) +varying vec4 vColor; +#endif +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +#include +#include +#ifdef DIFFUSE +varying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos; +#endif +#include +#ifdef LOGARITHMICDEPTH +#extension GL_EXT_frag_depth : enable +#endif +#include +#include +#define CUSTOM_FRAGMENT_DEFINITIONS +void main(void) { +#define CUSTOM_FRAGMENT_MAIN_BEGIN +#include +vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a; +#ifdef DIFFUSE +baseColor=texture2D(diffuseSampler,vDiffuseUV); +#ifdef ALPHATEST +if (baseColor.a<0.4) +discard; +#endif +#include +baseColor.rgb*=vDiffuseInfos.y; +#endif +#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) +baseColor.rgb*=vColor.rgb; +#endif +#ifdef NORMAL +vec3 normalW=normalize(vNormalW); +#else +vec3 normalW=vec3(1.0,1.0,1.0); +#endif +vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.; +#ifdef SPECULARTERM +vec3 specularBase=vec3(0.,0.,0.); +#endif +#include[0..maxSimultaneousLights] +#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) +alpha*=vColor.a; +#endif +vec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha); +#include +#include +gl_FragColor=color; +#include +#define CUSTOM_FRAGMENT_MAIN_END +}`; + ShaderStore.ShadersStore[name304] = shader303; +}); + +// node_modules/@babylonjs/materials/simple/simple.vertex.js +var name305, shader304; +var init_simple_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_instancesDeclaration(); + init_clipPlaneVertexDeclaration(); + init_logDepthDeclaration(); + init_fogVertexDeclaration(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + init_logDepthVertex(); + init_fogVertex(); + init_shadowsVertex(); + init_vertexColorMixing(); + name305 = "simpleVertexShader"; + shader304 = `precision highp float;attribute vec3 position; +#ifdef NORMAL +attribute vec3 normal; +#endif +#ifdef UV1 +attribute vec2 uv; +#endif +#ifdef UV2 +attribute vec2 uv2; +#endif +#ifdef VERTEXCOLOR +attribute vec4 color; +#endif +#include +#include +#include +uniform mat4 view;uniform mat4 viewProjection; +#ifdef DIFFUSE +varying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos; +#endif +#ifdef POINTSIZE +uniform float pointSize; +#endif +varying vec3 vPositionW; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) +varying vec4 vColor; +#endif +#include +#include +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +#define CUSTOM_VERTEX_DEFINITIONS +void main(void) { +#define CUSTOM_VERTEX_MAIN_BEGIN +#include +#include +#include +vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos); +#ifdef NORMAL +vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0))); +#endif +#ifndef UV1 +vec2 uv=vec2(0.,0.); +#endif +#ifndef UV2 +vec2 uv2=vec2(0.,0.); +#endif +#ifdef DIFFUSE +if (vDiffuseInfos.x==0.) +{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));} +else +{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));} +#endif +#include +#include +#include +#include[0..maxSimultaneousLights] +#include +#if defined(POINTSIZE) && !defined(WEBGPU) +gl_PointSize=pointSize; +#endif +#define CUSTOM_VERTEX_MAIN_END +} +`; + ShaderStore.ShadersStore[name305] = shader304; +}); + +// node_modules/@babylonjs/materials/simple/simpleMaterial.js +class SimpleMaterialDefines extends MaterialDefines { + constructor() { + super(); + this.DIFFUSE = false; + this.CLIPPLANE = false; + this.CLIPPLANE2 = false; + this.CLIPPLANE3 = false; + this.CLIPPLANE4 = false; + this.CLIPPLANE5 = false; + this.CLIPPLANE6 = false; + this.ALPHATEST = false; + this.DEPTHPREPASS = false; + this.POINTSIZE = false; + this.FOG = false; + this.NORMAL = false; + this.UV1 = false; + this.UV2 = false; + this.VERTEXCOLOR = false; + this.VERTEXALPHA = false; + this.NUM_BONE_INFLUENCERS = 0; + this.BonesPerMesh = 0; + this.INSTANCES = false; + this.INSTANCESCOLOR = false; + this.IMAGEPROCESSINGPOSTPROCESS = false; + this.SKIPFINALCOLORCLAMP = false; + this.LOGARITHMICDEPTH = false; + this.rebuild(); + } +} + +class SimpleMaterial extends PushMaterial { + constructor(name306, scene46) { + super(name306, scene46); + this.diffuseColor = new Color3(1, 1, 1); + this._disableLighting = false; + this._maxSimultaneousLights = 4; + } + needAlphaBlending() { + return this.alpha < 1; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh80, subMesh11, useInstances) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady && subMesh11.effect._wasPreviouslyUsingInstances === useInstances) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new SimpleMaterialDefines; + } + const defines = subMesh11.materialDefines; + const scene46 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene46.getEngine(); + if (defines._areTexturesDirty) { + defines._needUVs = false; + if (scene46.texturesEnabled) { + if (this._diffuseTexture && MaterialFlags.DiffuseTextureEnabled) { + if (!this._diffuseTexture.isReady()) { + return false; + } else { + defines._needUVs = true; + defines.DIFFUSE = true; + } + } + } + } + MaterialHelper.PrepareDefinesForMisc(mesh80, scene46, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh80), defines); + defines._needNormals = MaterialHelper.PrepareDefinesForLights(scene46, mesh80, defines, false, this._maxSimultaneousLights, this._disableLighting); + MaterialHelper.PrepareDefinesForFrameBoundValues(scene46, engine47, this, defines, useInstances ? true : false); + MaterialHelper.PrepareDefinesForAttributes(mesh80, defines, true, true); + if (defines.isDirty) { + defines.markAsProcessed(); + scene46.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh80); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene46.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + MaterialHelper.PrepareAttributesForBones(attribs, mesh80, defines, fallbacks); + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "simple"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "view", + "viewProjection", + "vEyePosition", + "vLightsType", + "vDiffuseColor", + "vFogInfos", + "vFogColor", + "pointSize", + "vDiffuseInfos", + "mBones", + "diffuseMatrix", + "logarithmicDepthConstant" + ]; + const samplers = ["diffuseSampler"]; + const uniformBuffers = []; + addClipPlaneUniforms(uniforms2); + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: this.maxSimultaneousLights + }); + subMesh11.setEffect(scene46.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights - 1 } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene46.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + subMesh11.effect._wasPreviouslyUsingInstances = !!useInstances; + return true; + } + bindForSubMesh(world, mesh80, subMesh11) { + const scene46 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene46.getTransformMatrix()); + MaterialHelper.BindBonesParameters(mesh80, this._activeEffect); + if (this._mustRebind(scene46, effect20)) { + if (this._diffuseTexture && MaterialFlags.DiffuseTextureEnabled) { + this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture); + this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level); + this._activeEffect.setMatrix("diffuseMatrix", this._diffuseTexture.getTextureMatrix()); + } + bindClipPlane(effect20, this, scene46); + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + if (this._useLogarithmicDepth) { + MaterialHelper.BindLogDepth(defines, effect20, scene46); + } + scene46.bindEyePosition(effect20); + } + this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh80.visibility); + if (scene46.lightsEnabled && !this.disableLighting) { + MaterialHelper.BindLights(scene46, mesh80, this._activeEffect, defines, this.maxSimultaneousLights); + } + if (scene46.fogEnabled && mesh80.applyFog && scene46.fogMode !== Scene.FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene46.getViewMatrix()); + } + MaterialHelper.BindFogParameters(scene46, mesh80, this._activeEffect); + this._afterBind(mesh80, this._activeEffect); + } + getAnimatables() { + const results = []; + if (this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0) { + results.push(this._diffuseTexture); + } + return results; + } + getActiveTextures() { + const activeTextures = super.getActiveTextures(); + if (this._diffuseTexture) { + activeTextures.push(this._diffuseTexture); + } + return activeTextures; + } + hasTexture(texture90) { + if (super.hasTexture(texture90)) { + return true; + } + if (this.diffuseTexture === texture90) { + return true; + } + return false; + } + dispose(forceDisposeEffect) { + if (this._diffuseTexture) { + this._diffuseTexture.dispose(); + } + super.dispose(forceDisposeEffect); + } + clone(name306) { + return SerializationHelper.Clone(() => new SimpleMaterial(name306, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.SimpleMaterial"; + return serializationObject; + } + getClassName() { + return "SimpleMaterial"; + } + static Parse(source, scene46, rootUrl) { + return SerializationHelper.Parse(() => new SimpleMaterial(source.name, scene46), source, scene46, rootUrl); + } +} +var init_simpleMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_color(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_materialFlags(); + init_buffer(); + init_scene(); + init_typeStore(); + init_simple_fragment(); + init_simple_vertex(); + init_effectFallbacks(); + init_clipPlaneMaterialHelper(); + __decorate2([ + serializeAsTexture("diffuseTexture") + ], SimpleMaterial.prototype, "_diffuseTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], SimpleMaterial.prototype, "diffuseTexture", undefined); + __decorate2([ + serializeAsColor3("diffuse") + ], SimpleMaterial.prototype, "diffuseColor", undefined); + __decorate2([ + serialize("disableLighting") + ], SimpleMaterial.prototype, "_disableLighting", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], SimpleMaterial.prototype, "disableLighting", undefined); + __decorate2([ + serialize("maxSimultaneousLights") + ], SimpleMaterial.prototype, "_maxSimultaneousLights", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], SimpleMaterial.prototype, "maxSimultaneousLights", undefined); + RegisterClass("BABYLON.SimpleMaterial", SimpleMaterial); +}); + +// node_modules/@babylonjs/materials/simple/index.js +var init_simple = __esm(() => { + init_simpleMaterial(); +}); + +// node_modules/@babylonjs/materials/sky/sky.fragment.js +var name306, shader305; +var init_sky_fragment = __esm(() => { + init_shaderStore(); + init_clipPlaneFragmentDeclaration(); + init_logDepthDeclaration(); + init_fogFragmentDeclaration(); + init_helperFunctions(); + init_clipPlaneFragment(); + init_logDepthFragment(); + init_fogFragment(); + init_imageProcessingCompatibility(); + name306 = "skyPixelShader"; + shader305 = `precision highp float;varying vec3 vPositionW; +#ifdef VERTEXCOLOR +varying vec4 vColor; +#endif +#include +uniform vec3 cameraPosition;uniform vec3 cameraOffset;uniform vec3 up;uniform float luminance;uniform float turbidity;uniform float rayleigh;uniform float mieCoefficient;uniform float mieDirectionalG;uniform vec3 sunPosition; +#ifdef LOGARITHMICDEPTH +#extension GL_EXT_frag_depth : enable +#endif +#include +#include +const float e=2.71828182845904523536028747135266249775724709369995957;const float pi=3.141592653589793238462643383279502884197169;const float n=1.0003;const float N=2.545E25;const float pn=0.035;const vec3 lambda=vec3(680E-9,550E-9,450E-9);const vec3 K=vec3(0.686,0.678,0.666);const float v=4.0;const float rayleighZenithLength=8.4E3;const float mieZenithLength=1.25E3;const float EE=1000.0;const float sunAngularDiameterCos=0.999956676946448443553574619906976478926848692873900859324;const float cutoffAngle=pi/1.95;const float steepness=1.5;vec3 totalRayleigh(vec3 lambda) +{return (8.0*pow(pi,3.0)*pow(pow(n,2.0)-1.0,2.0)*(6.0+3.0*pn))/(3.0*N*pow(lambda,vec3(4.0))*(6.0-7.0*pn));} +vec3 simplifiedRayleigh() +{return 0.0005/vec3(94,40,18);} +float rayleighPhase(float cosTheta) +{ +return (3.0/(16.0*pi))*(1.0+pow(cosTheta,2.0));} +vec3 totalMie(vec3 lambda,vec3 K,float T) +{float c=(0.2*T )*10E-18;return 0.434*c*pi*pow((2.0*pi)/lambda,vec3(v-2.0))*K;} +float hgPhase(float cosTheta,float g) +{return (1.0/(4.0*pi))*((1.0-pow(g,2.0))/pow(1.0-2.0*g*cosTheta+pow(g,2.0),1.5));} +float sunIntensity(float zenithAngleCos) +{return EE*max(0.0,1.0-exp((-(cutoffAngle-acos(zenithAngleCos))/steepness)));} +float A=0.15;float B=0.50;float C=0.10;float D=0.20;float EEE=0.02;float F=0.30;float W=1000.0;vec3 Uncharted2Tonemap(vec3 x) +{return ((x*(A*x+C*B)+D*EEE)/(x*(A*x+B)+D*F))-EEE/F;} +#if DITHER +#include +#endif +#define CUSTOM_FRAGMENT_DEFINITIONS +void main(void) { +#define CUSTOM_FRAGMENT_MAIN_BEGIN +#include +/** +*-------------------------------------------------------------------------------------------------- +* Sky Color +*-------------------------------------------------------------------------------------------------- +*/ +float sunfade=1.0-clamp(1.0-exp((sunPosition.y/450000.0)),0.0,1.0);float rayleighCoefficient=rayleigh-(1.0*(1.0-sunfade));vec3 sunDirection=normalize(sunPosition);float sunE=sunIntensity(dot(sunDirection,up));vec3 betaR=simplifiedRayleigh()*rayleighCoefficient;vec3 betaM=totalMie(lambda,K,turbidity)*mieCoefficient;float zenithAngle=acos(max(0.0,dot(up,normalize(vPositionW-cameraPosition+cameraOffset))));float sR=rayleighZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));float sM=mieZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));vec3 Fex=exp(-(betaR*sR+betaM*sM));float cosTheta=dot(normalize(vPositionW-cameraPosition),sunDirection);float rPhase=rayleighPhase(cosTheta*0.5+0.5);vec3 betaRTheta=betaR*rPhase;float mPhase=hgPhase(cosTheta,mieDirectionalG);vec3 betaMTheta=betaM*mPhase;vec3 Lin=pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*(1.0-Fex),vec3(1.5));Lin*=mix(vec3(1.0),pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up,sunDirection),5.0),0.0,1.0));vec3 direction=normalize(vPositionW-cameraPosition);float theta=acos(direction.y);float phi=atan(direction.z,direction.x);vec2 uv=vec2(phi,theta)/vec2(2.0*pi,pi)+vec2(0.5,0.0);vec3 L0=vec3(0.1)*Fex;float sundisk=smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);L0+=(sunE*19000.0*Fex)*sundisk;vec3 whiteScale=1.0/Uncharted2Tonemap(vec3(W));vec3 texColor=(Lin+L0);texColor*=0.04 ;texColor+=vec3(0.0,0.001,0.0025)*0.3;float g_fMaxLuminance=1.0;float fLumScaled=0.1/luminance; +float fLumCompressed=(fLumScaled*(1.0+(fLumScaled/(g_fMaxLuminance*g_fMaxLuminance))))/(1.0+fLumScaled); +float ExposureBias=fLumCompressed;vec3 curr=Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);vec3 retColor=curr*whiteScale;/** +*-------------------------------------------------------------------------------------------------- +* Sky Color +*-------------------------------------------------------------------------------------------------- +*/ +float alpha=1.0; +#ifdef VERTEXCOLOR +retColor.rgb*=vColor.rgb; +#endif +#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) +alpha*=vColor.a; +#endif +#if DITHER +retColor.rgb+=dither(gl_FragCoord.xy,0.5); +#endif +vec4 color=clamp(vec4(retColor.rgb,alpha),0.0,1.0); +#include +#include +gl_FragColor=color; +#include +#define CUSTOM_FRAGMENT_MAIN_END +} +`; + ShaderStore.ShadersStore[name306] = shader305; +}); + +// node_modules/@babylonjs/materials/sky/sky.vertex.js +var name307, shader306; +var init_sky_vertex = __esm(() => { + init_shaderStore(); + init_logDepthDeclaration(); + init_clipPlaneVertexDeclaration(); + init_fogVertexDeclaration(); + init_clipPlaneVertex(); + init_logDepthVertex(); + init_fogVertex(); + name307 = "skyVertexShader"; + shader306 = `precision highp float;attribute vec3 position; +#ifdef VERTEXCOLOR +attribute vec4 color; +#endif +uniform mat4 world;uniform mat4 view;uniform mat4 viewProjection; +#ifdef POINTSIZE +uniform float pointSize; +#endif +varying vec3 vPositionW; +#ifdef VERTEXCOLOR +varying vec4 vColor; +#endif +#include +#include +#include +#define CUSTOM_VERTEX_DEFINITIONS +void main(void) { +#define CUSTOM_VERTEX_MAIN_BEGIN +gl_Position=viewProjection*world*vec4(position,1.0);vec4 worldPos=world*vec4(position,1.0);vPositionW=vec3(worldPos); +#include +#include +#include +#ifdef VERTEXCOLOR +vColor=color; +#endif +#if defined(POINTSIZE) && !defined(WEBGPU) +gl_PointSize=pointSize; +#endif +#define CUSTOM_VERTEX_MAIN_END +} +`; + ShaderStore.ShadersStore[name307] = shader306; +}); + +// node_modules/@babylonjs/materials/sky/skyMaterial.js +class SkyMaterialDefines extends MaterialDefines { + constructor() { + super(); + this.CLIPPLANE = false; + this.CLIPPLANE2 = false; + this.CLIPPLANE3 = false; + this.CLIPPLANE4 = false; + this.CLIPPLANE5 = false; + this.CLIPPLANE6 = false; + this.POINTSIZE = false; + this.FOG = false; + this.VERTEXCOLOR = false; + this.VERTEXALPHA = false; + this.IMAGEPROCESSINGPOSTPROCESS = false; + this.SKIPFINALCOLORCLAMP = false; + this.DITHER = false; + this.LOGARITHMICDEPTH = false; + this.rebuild(); + } +} + +class SkyMaterial extends PushMaterial { + constructor(name308, scene47) { + super(name308, scene47); + this.luminance = 1; + this.turbidity = 10; + this.rayleigh = 2; + this.mieCoefficient = 0.005; + this.mieDirectionalG = 0.8; + this.distance = 500; + this.inclination = 0.49; + this.azimuth = 0.25; + this.sunPosition = new Vector3(0, 100, 0); + this.useSunPosition = false; + this.cameraOffset = Vector3.Zero(); + this.up = Vector3.Up(); + this.dithering = false; + this._cameraPosition = Vector3.Zero(); + this._skyOrientation = new Quaternion; + } + needAlphaBlending() { + return this.alpha < 1; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh80, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new SkyMaterialDefines; + } + const defines = subMesh11.materialDefines; + const scene47 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + MaterialHelper.PrepareDefinesForMisc(mesh80, scene47, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, false, defines); + MaterialHelper.PrepareDefinesForAttributes(mesh80, defines, true, false); + if (defines.IMAGEPROCESSINGPOSTPROCESS !== scene47.imageProcessingConfiguration.applyByPostProcess) { + defines.markAsMiscDirty(); + } + if (defines.DITHER !== this.dithering) { + defines.markAsMiscDirty(); + } + if (defines.isDirty) { + defines.markAsProcessed(); + scene47.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene47.imageProcessingConfiguration.applyByPostProcess; + defines.DITHER = this.dithering; + const attribs = [VertexBuffer.PositionKind]; + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + const shaderName = "sky"; + const uniforms2 = [ + "world", + "viewProjection", + "view", + "vFogInfos", + "vFogColor", + "logarithmicDepthConstant", + "pointSize", + "luminance", + "turbidity", + "rayleigh", + "mieCoefficient", + "mieDirectionalG", + "sunPosition", + "cameraPosition", + "cameraOffset", + "up" + ]; + addClipPlaneUniforms(uniforms2); + const join = defines.toString(); + subMesh11.setEffect(scene47.getEngine().createEffect(shaderName, attribs, uniforms2, [], join, fallbacks, this.onCompiled, this.onError), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene47.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh80, subMesh11) { + const scene47 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene47.getTransformMatrix()); + if (this._mustRebind(scene47, effect20)) { + bindClipPlane(effect20, this, scene47); + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + if (this._useLogarithmicDepth) { + MaterialHelper.BindLogDepth(defines, effect20, scene47); + } + } + if (scene47.fogEnabled && mesh80.applyFog && scene47.fogMode !== Scene.FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene47.getViewMatrix()); + } + MaterialHelper.BindFogParameters(scene47, mesh80, this._activeEffect); + const camera34 = scene47.activeCamera; + if (camera34) { + const cameraWorldMatrix = camera34.getWorldMatrix(); + this._cameraPosition.x = cameraWorldMatrix.m[12]; + this._cameraPosition.y = cameraWorldMatrix.m[13]; + this._cameraPosition.z = cameraWorldMatrix.m[14]; + this._activeEffect.setVector3("cameraPosition", this._cameraPosition); + } + this._activeEffect.setVector3("cameraOffset", this.cameraOffset); + this._activeEffect.setVector3("up", this.up); + if (this.luminance > 0) { + this._activeEffect.setFloat("luminance", this.luminance); + } + this._activeEffect.setFloat("turbidity", this.turbidity); + this._activeEffect.setFloat("rayleigh", this.rayleigh); + this._activeEffect.setFloat("mieCoefficient", this.mieCoefficient); + this._activeEffect.setFloat("mieDirectionalG", this.mieDirectionalG); + if (!this.useSunPosition) { + const theta = Math.PI * (this.inclination - 0.5); + const phi = 2 * Math.PI * (this.azimuth - 0.5); + this.sunPosition.x = this.distance * Math.cos(phi) * Math.cos(theta); + this.sunPosition.y = this.distance * Math.sin(-theta); + this.sunPosition.z = this.distance * Math.sin(phi) * Math.cos(theta); + Quaternion.FromUnitVectorsToRef(Vector3.UpReadOnly, this.up, this._skyOrientation); + this.sunPosition.rotateByQuaternionToRef(this._skyOrientation, this.sunPosition); + } + this._activeEffect.setVector3("sunPosition", this.sunPosition); + this._afterBind(mesh80, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + } + clone(name308) { + return SerializationHelper.Clone(() => new SkyMaterial(name308, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.SkyMaterial"; + return serializationObject; + } + getClassName() { + return "SkyMaterial"; + } + static Parse(source, scene47, rootUrl) { + return SerializationHelper.Parse(() => new SkyMaterial(source.name, scene47), source, scene47, rootUrl); + } +} +var init_skyMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_buffer(); + init_scene(); + init_typeStore(); + init_sky_fragment(); + init_sky_vertex(); + init_effectFallbacks(); + init_clipPlaneMaterialHelper(); + __decorate2([ + serialize() + ], SkyMaterial.prototype, "luminance", undefined); + __decorate2([ + serialize() + ], SkyMaterial.prototype, "turbidity", undefined); + __decorate2([ + serialize() + ], SkyMaterial.prototype, "rayleigh", undefined); + __decorate2([ + serialize() + ], SkyMaterial.prototype, "mieCoefficient", undefined); + __decorate2([ + serialize() + ], SkyMaterial.prototype, "mieDirectionalG", undefined); + __decorate2([ + serialize() + ], SkyMaterial.prototype, "distance", undefined); + __decorate2([ + serialize() + ], SkyMaterial.prototype, "inclination", undefined); + __decorate2([ + serialize() + ], SkyMaterial.prototype, "azimuth", undefined); + __decorate2([ + serializeAsVector3() + ], SkyMaterial.prototype, "sunPosition", undefined); + __decorate2([ + serialize() + ], SkyMaterial.prototype, "useSunPosition", undefined); + __decorate2([ + serializeAsVector3() + ], SkyMaterial.prototype, "cameraOffset", undefined); + __decorate2([ + serializeAsVector3() + ], SkyMaterial.prototype, "up", undefined); + __decorate2([ + serialize() + ], SkyMaterial.prototype, "dithering", undefined); + RegisterClass("BABYLON.SkyMaterial", SkyMaterial); +}); + +// node_modules/@babylonjs/materials/sky/index.js +var init_sky = __esm(() => { + init_skyMaterial(); +}); + +// node_modules/@babylonjs/materials/terrain/terrain.fragment.js +var name308, shader307; +var init_terrain_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_lightsFragmentFunctions(); + init_shadowsFragmentFunctions(); + init_clipPlaneFragmentDeclaration(); + init_logDepthDeclaration(); + init_fogFragmentDeclaration(); + init_clipPlaneFragment(); + init_depthPrePass(); + init_lightFragment(); + init_logDepthFragment(); + init_fogFragment(); + init_imageProcessingCompatibility(); + name308 = "terrainPixelShader"; + shader307 = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor; +#ifdef SPECULARTERM +uniform vec4 vSpecularColor; +#endif +varying vec3 vPositionW; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) +varying vec4 vColor; +#endif +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +#ifdef DIFFUSE +varying vec2 vTextureUV;uniform sampler2D textureSampler;uniform vec2 vTextureInfos;uniform sampler2D diffuse1Sampler;uniform sampler2D diffuse2Sampler;uniform sampler2D diffuse3Sampler;uniform vec2 diffuse1Infos;uniform vec2 diffuse2Infos;uniform vec2 diffuse3Infos; +#endif +#ifdef BUMP +uniform sampler2D bump1Sampler;uniform sampler2D bump2Sampler;uniform sampler2D bump3Sampler; +#endif +#include +#include +#include +#ifdef LOGARITHMICDEPTH +#extension GL_EXT_frag_depth : enable +#endif +#include +#include +#ifdef BUMP +#extension GL_OES_standard_derivatives : enable +mat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv) +{vec3 dp1=dFdx(p);vec3 dp2=dFdy(p);vec2 duv1=dFdx(uv);vec2 duv2=dFdy(uv);vec3 dp2perp=cross(dp2,normal);vec3 dp1perp=cross(normal,dp1);vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;vec3 binormal=dp2perp*duv1.y+dp1perp*duv2.y;float invmax=inversesqrt(max(dot(tangent,tangent),dot(binormal,binormal)));return mat3(tangent*invmax,binormal*invmax,normal);} +vec3 perturbNormal(vec3 viewDir,vec3 mixColor) +{vec3 bump1Color=texture2D(bump1Sampler,vTextureUV*diffuse1Infos).xyz;vec3 bump2Color=texture2D(bump2Sampler,vTextureUV*diffuse2Infos).xyz;vec3 bump3Color=texture2D(bump3Sampler,vTextureUV*diffuse3Infos).xyz;bump1Color.rgb*=mixColor.r;bump2Color.rgb=mix(bump1Color.rgb,bump2Color.rgb,mixColor.g);vec3 map=mix(bump2Color.rgb,bump3Color.rgb,mixColor.b);map=map*255./127.-128./127.;mat3 TBN=cotangent_frame(vNormalW*vTextureInfos.y,-viewDir,vTextureUV);return normalize(TBN*map);} +#endif +#define CUSTOM_FRAGMENT_DEFINITIONS +void main(void) { +#define CUSTOM_FRAGMENT_MAIN_BEGIN +#include +vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb; +#ifdef SPECULARTERM +float glossiness=vSpecularColor.a;vec3 specularColor=vSpecularColor.rgb; +#else +float glossiness=0.; +#endif +float alpha=vDiffuseColor.a; +#ifdef NORMAL +vec3 normalW=normalize(vNormalW); +#else +vec3 normalW=vec3(1.0,1.0,1.0); +#endif +#ifdef DIFFUSE +baseColor=texture2D(textureSampler,vTextureUV); +#if defined(BUMP) && defined(DIFFUSE) +normalW=perturbNormal(viewDirectionW,baseColor.rgb); +#endif +#ifdef ALPHATEST +if (baseColor.a<0.4) +discard; +#endif +#include +baseColor.rgb*=vTextureInfos.y;vec4 diffuse1Color=texture2D(diffuse1Sampler,vTextureUV*diffuse1Infos);vec4 diffuse2Color=texture2D(diffuse2Sampler,vTextureUV*diffuse2Infos);vec4 diffuse3Color=texture2D(diffuse3Sampler,vTextureUV*diffuse3Infos);diffuse1Color.rgb*=baseColor.r;diffuse2Color.rgb=mix(diffuse1Color.rgb,diffuse2Color.rgb,baseColor.g);baseColor.rgb=mix(diffuse2Color.rgb,diffuse3Color.rgb,baseColor.b); +#endif +#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) +baseColor.rgb*=vColor.rgb; +#endif +vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.; +#ifdef SPECULARTERM +vec3 specularBase=vec3(0.,0.,0.); +#endif +#include[0..maxSimultaneousLights] +#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) +alpha*=vColor.a; +#endif +#ifdef SPECULARTERM +vec3 finalSpecular=specularBase*specularColor; +#else +vec3 finalSpecular=vec3(0.0); +#endif +vec3 finalDiffuse=clamp(diffuseBase*diffuseColor*baseColor.rgb,0.0,1.0);vec4 color=vec4(finalDiffuse+finalSpecular,alpha); +#include +#include +gl_FragColor=color; +#include +#define CUSTOM_FRAGMENT_MAIN_END +} +`; + ShaderStore.ShadersStore[name308] = shader307; +}); + +// node_modules/@babylonjs/materials/terrain/terrain.vertex.js +var name309, shader308; +var init_terrain_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_instancesDeclaration(); + init_logDepthDeclaration(); + init_clipPlaneVertexDeclaration(); + init_fogVertexDeclaration(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + init_logDepthVertex(); + init_fogVertex(); + init_shadowsVertex(); + init_vertexColorMixing(); + name309 = "terrainVertexShader"; + shader308 = `precision highp float;attribute vec3 position; +#ifdef NORMAL +attribute vec3 normal; +#endif +#ifdef UV1 +attribute vec2 uv; +#endif +#ifdef UV2 +attribute vec2 uv2; +#endif +#ifdef VERTEXCOLOR +attribute vec4 color; +#endif +#include +#include +#include +uniform mat4 view;uniform mat4 viewProjection; +#ifdef DIFFUSE +varying vec2 vTextureUV;uniform mat4 textureMatrix;uniform vec2 vTextureInfos; +#endif +#ifdef POINTSIZE +uniform float pointSize; +#endif +varying vec3 vPositionW; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) +varying vec4 vColor; +#endif +#include +#include +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +#define CUSTOM_VERTEX_DEFINITIONS +void main(void) { +#define CUSTOM_VERTEX_MAIN_BEGIN +#include +#include +#include +vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos); +#ifdef NORMAL +vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0))); +#endif +#ifndef UV1 +vec2 uv=vec2(0.,0.); +#endif +#ifndef UV2 +vec2 uv2=vec2(0.,0.); +#endif +#ifdef DIFFUSE +if (vTextureInfos.x==0.) +{vTextureUV=vec2(textureMatrix*vec4(uv,1.0,0.0));} +else +{vTextureUV=vec2(textureMatrix*vec4(uv2,1.0,0.0));} +#endif +#include +#include +#include +#include[0..maxSimultaneousLights] +#include +#if defined(POINTSIZE) && !defined(WEBGPU) +gl_PointSize=pointSize; +#endif +#define CUSTOM_VERTEX_MAIN_END +} +`; + ShaderStore.ShadersStore[name309] = shader308; +}); + +// node_modules/@babylonjs/materials/terrain/terrainMaterial.js +class TerrainMaterialDefines extends MaterialDefines { + constructor() { + super(); + this.DIFFUSE = false; + this.BUMP = false; + this.CLIPPLANE = false; + this.CLIPPLANE2 = false; + this.CLIPPLANE3 = false; + this.CLIPPLANE4 = false; + this.CLIPPLANE5 = false; + this.CLIPPLANE6 = false; + this.ALPHATEST = false; + this.DEPTHPREPASS = false; + this.POINTSIZE = false; + this.FOG = false; + this.SPECULARTERM = false; + this.NORMAL = false; + this.UV1 = false; + this.UV2 = false; + this.VERTEXCOLOR = false; + this.VERTEXALPHA = false; + this.NUM_BONE_INFLUENCERS = 0; + this.BonesPerMesh = 0; + this.INSTANCES = false; + this.INSTANCESCOLOR = false; + this.IMAGEPROCESSINGPOSTPROCESS = false; + this.SKIPFINALCOLORCLAMP = false; + this.LOGARITHMICDEPTH = false; + this.rebuild(); + } +} + +class TerrainMaterial extends PushMaterial { + constructor(name310, scene48) { + super(name310, scene48); + this.diffuseColor = new Color3(1, 1, 1); + this.specularColor = new Color3(0, 0, 0); + this.specularPower = 64; + this._disableLighting = false; + this._maxSimultaneousLights = 4; + } + needAlphaBlending() { + return this.alpha < 1; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh80, subMesh11, useInstances) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady && subMesh11.effect._wasPreviouslyUsingInstances === useInstances) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new TerrainMaterialDefines; + } + const defines = subMesh11.materialDefines; + const scene48 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene48.getEngine(); + if (scene48.texturesEnabled) { + if (!this.mixTexture || !this.mixTexture.isReady()) { + return false; + } + defines._needUVs = true; + if (MaterialFlags.DiffuseTextureEnabled) { + if (!this.diffuseTexture1 || !this.diffuseTexture1.isReady()) { + return false; + } + if (!this.diffuseTexture2 || !this.diffuseTexture2.isReady()) { + return false; + } + if (!this.diffuseTexture3 || !this.diffuseTexture3.isReady()) { + return false; + } + defines.DIFFUSE = true; + } + if (this.bumpTexture1 && this.bumpTexture2 && this.bumpTexture3 && MaterialFlags.BumpTextureEnabled) { + if (!this.bumpTexture1.isReady()) { + return false; + } + if (!this.bumpTexture2.isReady()) { + return false; + } + if (!this.bumpTexture3.isReady()) { + return false; + } + defines._needNormals = true; + defines.BUMP = true; + } + } + MaterialHelper.PrepareDefinesForMisc(mesh80, scene48, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh80), defines); + defines._needNormals = MaterialHelper.PrepareDefinesForLights(scene48, mesh80, defines, false, this._maxSimultaneousLights, this._disableLighting); + MaterialHelper.PrepareDefinesForFrameBoundValues(scene48, engine47, this, defines, useInstances ? true : false); + MaterialHelper.PrepareDefinesForAttributes(mesh80, defines, true, true); + if (defines.isDirty) { + defines.markAsProcessed(); + scene48.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh80); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene48.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + MaterialHelper.PrepareAttributesForBones(attribs, mesh80, defines, fallbacks); + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "terrain"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "view", + "viewProjection", + "vEyePosition", + "vLightsType", + "vDiffuseColor", + "vSpecularColor", + "vFogInfos", + "vFogColor", + "pointSize", + "vTextureInfos", + "mBones", + "textureMatrix", + "diffuse1Infos", + "diffuse2Infos", + "diffuse3Infos" + ]; + const samplers = [ + "textureSampler", + "diffuse1Sampler", + "diffuse2Sampler", + "diffuse3Sampler", + "bump1Sampler", + "bump2Sampler", + "bump3Sampler", + "logarithmicDepthConstant" + ]; + const uniformBuffers = []; + addClipPlaneUniforms(uniforms2); + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: this.maxSimultaneousLights + }); + subMesh11.setEffect(scene48.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene48.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + subMesh11.effect._wasPreviouslyUsingInstances = !!useInstances; + return true; + } + bindForSubMesh(world, mesh80, subMesh11) { + const scene48 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene48.getTransformMatrix()); + MaterialHelper.BindBonesParameters(mesh80, this._activeEffect); + if (this._mustRebind(scene48, effect20)) { + if (this.mixTexture) { + this._activeEffect.setTexture("textureSampler", this._mixTexture); + this._activeEffect.setFloat2("vTextureInfos", this._mixTexture.coordinatesIndex, this._mixTexture.level); + this._activeEffect.setMatrix("textureMatrix", this._mixTexture.getTextureMatrix()); + if (MaterialFlags.DiffuseTextureEnabled) { + if (this._diffuseTexture1) { + this._activeEffect.setTexture("diffuse1Sampler", this._diffuseTexture1); + this._activeEffect.setFloat2("diffuse1Infos", this._diffuseTexture1.uScale, this._diffuseTexture1.vScale); + } + if (this._diffuseTexture2) { + this._activeEffect.setTexture("diffuse2Sampler", this._diffuseTexture2); + this._activeEffect.setFloat2("diffuse2Infos", this._diffuseTexture2.uScale, this._diffuseTexture2.vScale); + } + if (this._diffuseTexture3) { + this._activeEffect.setTexture("diffuse3Sampler", this._diffuseTexture3); + this._activeEffect.setFloat2("diffuse3Infos", this._diffuseTexture3.uScale, this._diffuseTexture3.vScale); + } + } + if (MaterialFlags.BumpTextureEnabled && scene48.getEngine().getCaps().standardDerivatives) { + if (this._bumpTexture1) { + this._activeEffect.setTexture("bump1Sampler", this._bumpTexture1); + } + if (this._bumpTexture2) { + this._activeEffect.setTexture("bump2Sampler", this._bumpTexture2); + } + if (this._bumpTexture3) { + this._activeEffect.setTexture("bump3Sampler", this._bumpTexture3); + } + } + } + bindClipPlane(effect20, this, scene48); + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + if (this._useLogarithmicDepth) { + MaterialHelper.BindLogDepth(defines, effect20, scene48); + } + scene48.bindEyePosition(effect20); + } + this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh80.visibility); + if (defines.SPECULARTERM) { + this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower); + } + if (scene48.lightsEnabled && !this.disableLighting) { + MaterialHelper.BindLights(scene48, mesh80, this._activeEffect, defines, this.maxSimultaneousLights); + } + if (scene48.fogEnabled && mesh80.applyFog && scene48.fogMode !== Scene.FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene48.getViewMatrix()); + } + MaterialHelper.BindFogParameters(scene48, mesh80, this._activeEffect); + this._afterBind(mesh80, this._activeEffect); + } + getAnimatables() { + const results = []; + if (this.mixTexture && this.mixTexture.animations && this.mixTexture.animations.length > 0) { + results.push(this.mixTexture); + } + return results; + } + getActiveTextures() { + const activeTextures = super.getActiveTextures(); + if (this._mixTexture) { + activeTextures.push(this._mixTexture); + } + if (this._diffuseTexture1) { + activeTextures.push(this._diffuseTexture1); + } + if (this._diffuseTexture2) { + activeTextures.push(this._diffuseTexture2); + } + if (this._diffuseTexture3) { + activeTextures.push(this._diffuseTexture3); + } + if (this._bumpTexture1) { + activeTextures.push(this._bumpTexture1); + } + if (this._bumpTexture2) { + activeTextures.push(this._bumpTexture2); + } + if (this._bumpTexture3) { + activeTextures.push(this._bumpTexture3); + } + return activeTextures; + } + hasTexture(texture90) { + if (super.hasTexture(texture90)) { + return true; + } + if (this._mixTexture === texture90) { + return true; + } + if (this._diffuseTexture1 === texture90) { + return true; + } + if (this._diffuseTexture2 === texture90) { + return true; + } + if (this._diffuseTexture3 === texture90) { + return true; + } + if (this._bumpTexture1 === texture90) { + return true; + } + if (this._bumpTexture2 === texture90) { + return true; + } + if (this._bumpTexture3 === texture90) { + return true; + } + return false; + } + dispose(forceDisposeEffect) { + if (this.mixTexture) { + this.mixTexture.dispose(); + } + super.dispose(forceDisposeEffect); + } + clone(name310) { + return SerializationHelper.Clone(() => new TerrainMaterial(name310, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.TerrainMaterial"; + return serializationObject; + } + getClassName() { + return "TerrainMaterial"; + } + static Parse(source, scene48, rootUrl) { + return SerializationHelper.Parse(() => new TerrainMaterial(source.name, scene48), source, scene48, rootUrl); + } +} +var init_terrainMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_color(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_materialFlags(); + init_buffer(); + init_scene(); + init_typeStore(); + init_terrain_fragment(); + init_terrain_vertex(); + init_effectFallbacks(); + init_clipPlaneMaterialHelper(); + __decorate2([ + serializeAsTexture("mixTexture") + ], TerrainMaterial.prototype, "_mixTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], TerrainMaterial.prototype, "mixTexture", undefined); + __decorate2([ + serializeAsTexture("diffuseTexture1") + ], TerrainMaterial.prototype, "_diffuseTexture1", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], TerrainMaterial.prototype, "diffuseTexture1", undefined); + __decorate2([ + serializeAsTexture("diffuseTexture2") + ], TerrainMaterial.prototype, "_diffuseTexture2", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], TerrainMaterial.prototype, "diffuseTexture2", undefined); + __decorate2([ + serializeAsTexture("diffuseTexture3") + ], TerrainMaterial.prototype, "_diffuseTexture3", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], TerrainMaterial.prototype, "diffuseTexture3", undefined); + __decorate2([ + serializeAsTexture("bumpTexture1") + ], TerrainMaterial.prototype, "_bumpTexture1", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], TerrainMaterial.prototype, "bumpTexture1", undefined); + __decorate2([ + serializeAsTexture("bumpTexture2") + ], TerrainMaterial.prototype, "_bumpTexture2", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], TerrainMaterial.prototype, "bumpTexture2", undefined); + __decorate2([ + serializeAsTexture("bumpTexture3") + ], TerrainMaterial.prototype, "_bumpTexture3", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], TerrainMaterial.prototype, "bumpTexture3", undefined); + __decorate2([ + serializeAsColor3() + ], TerrainMaterial.prototype, "diffuseColor", undefined); + __decorate2([ + serializeAsColor3() + ], TerrainMaterial.prototype, "specularColor", undefined); + __decorate2([ + serialize() + ], TerrainMaterial.prototype, "specularPower", undefined); + __decorate2([ + serialize("disableLighting") + ], TerrainMaterial.prototype, "_disableLighting", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], TerrainMaterial.prototype, "disableLighting", undefined); + __decorate2([ + serialize("maxSimultaneousLights") + ], TerrainMaterial.prototype, "_maxSimultaneousLights", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], TerrainMaterial.prototype, "maxSimultaneousLights", undefined); + RegisterClass("BABYLON.TerrainMaterial", TerrainMaterial); +}); + +// node_modules/@babylonjs/materials/terrain/index.js +var init_terrain = __esm(() => { + init_terrainMaterial(); +}); + +// node_modules/@babylonjs/materials/triPlanar/triplanar.fragment.js +var name310, shader309; +var init_triplanar_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_logDepthDeclaration(); + init_lightsFragmentFunctions(); + init_shadowsFragmentFunctions(); + init_clipPlaneFragmentDeclaration(); + init_fogFragmentDeclaration(); + init_clipPlaneFragment(); + init_depthPrePass(); + init_lightFragment(); + init_logDepthFragment(); + init_fogFragment(); + init_imageProcessingCompatibility(); + name310 = "triplanarPixelShader"; + shader309 = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor; +#ifdef SPECULARTERM +uniform vec4 vSpecularColor; +#endif +varying vec3 vPositionW; +#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) +varying vec4 vColor; +#endif +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +#ifdef DIFFUSEX +varying vec2 vTextureUVX;uniform sampler2D diffuseSamplerX; +#ifdef BUMPX +uniform sampler2D normalSamplerX; +#endif +#endif +#ifdef DIFFUSEY +varying vec2 vTextureUVY;uniform sampler2D diffuseSamplerY; +#ifdef BUMPY +uniform sampler2D normalSamplerY; +#endif +#endif +#ifdef DIFFUSEZ +varying vec2 vTextureUVZ;uniform sampler2D diffuseSamplerZ; +#ifdef BUMPZ +uniform sampler2D normalSamplerZ; +#endif +#endif +#ifdef NORMAL +varying mat3 tangentSpace; +#endif +#ifdef LOGARITHMICDEPTH +#extension GL_EXT_frag_depth : enable +#endif +#include +#include +#include +#include +#include +#define CUSTOM_FRAGMENT_DEFINITIONS +void main(void) { +#define CUSTOM_FRAGMENT_MAIN_BEGIN +#include +vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(0.,0.,0.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a; +#ifdef NORMAL +vec3 normalW=tangentSpace[2]; +#else +vec3 normalW=vec3(1.0,1.0,1.0); +#endif +vec4 baseNormal=vec4(0.0,0.0,0.0,1.0);normalW*=normalW; +#ifdef DIFFUSEX +baseColor+=texture2D(diffuseSamplerX,vTextureUVX)*normalW.x; +#ifdef BUMPX +baseNormal+=texture2D(normalSamplerX,vTextureUVX)*normalW.x; +#endif +#endif +#ifdef DIFFUSEY +baseColor+=texture2D(diffuseSamplerY,vTextureUVY)*normalW.y; +#ifdef BUMPY +baseNormal+=texture2D(normalSamplerY,vTextureUVY)*normalW.y; +#endif +#endif +#ifdef DIFFUSEZ +baseColor+=texture2D(diffuseSamplerZ,vTextureUVZ)*normalW.z; +#ifdef BUMPZ +baseNormal+=texture2D(normalSamplerZ,vTextureUVZ)*normalW.z; +#endif +#endif +#ifdef NORMAL +normalW=normalize((2.0*baseNormal.xyz-1.0)*tangentSpace); +#endif +#ifdef ALPHATEST +if (baseColor.a<0.4) +discard; +#endif +#include +#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) +baseColor.rgb*=vColor.rgb; +#endif +vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.; +#ifdef SPECULARTERM +float glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb; +#else +float glossiness=0.; +#endif +#include[0..maxSimultaneousLights] +#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) +alpha*=vColor.a; +#endif +#ifdef SPECULARTERM +vec3 finalSpecular=specularBase*specularColor; +#else +vec3 finalSpecular=vec3(0.0); +#endif +vec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse+finalSpecular,alpha); +#include +#include +gl_FragColor=color; +#include +#define CUSTOM_FRAGMENT_MAIN_END +} +`; + ShaderStore.ShadersStore[name310] = shader309; +}); + +// node_modules/@babylonjs/materials/triPlanar/triplanar.vertex.js +var name311, shader310; +var init_triplanar_vertex = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_instancesDeclaration(); + init_clipPlaneVertexDeclaration(); + init_logDepthDeclaration(); + init_fogVertexDeclaration(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + init_logDepthVertex(); + init_fogVertex(); + init_shadowsVertex(); + init_vertexColorMixing(); + name311 = "triplanarVertexShader"; + shader310 = `precision highp float;attribute vec3 position; +#ifdef NORMAL +attribute vec3 normal; +#endif +#ifdef VERTEXCOLOR +attribute vec4 color; +#endif +#include +#include +#include +#include +uniform mat4 view;uniform mat4 viewProjection; +#ifdef DIFFUSEX +varying vec2 vTextureUVX; +#endif +#ifdef DIFFUSEY +varying vec2 vTextureUVY; +#endif +#ifdef DIFFUSEZ +varying vec2 vTextureUVZ; +#endif +uniform float tileSize; +#ifdef POINTSIZE +uniform float pointSize; +#endif +varying vec3 vPositionW; +#ifdef NORMAL +varying mat3 tangentSpace; +#endif +#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) +varying vec4 vColor; +#endif +#include +#include +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +#define CUSTOM_VERTEX_DEFINITIONS +void main(void) +{ +#define CUSTOM_VERTEX_MAIN_BEGIN +#include +#include +#include +vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos); +#ifdef DIFFUSEX +vTextureUVX=worldPos.zy/tileSize; +#endif +#ifdef DIFFUSEY +vTextureUVY=worldPos.xz/tileSize; +#endif +#ifdef DIFFUSEZ +vTextureUVZ=worldPos.xy/tileSize; +#endif +#ifdef NORMAL +vec3 xtan=vec3(0,0,1);vec3 xbin=vec3(0,1,0);vec3 ytan=vec3(1,0,0);vec3 ybin=vec3(0,0,1);vec3 ztan=vec3(1,0,0);vec3 zbin=vec3(0,1,0);vec3 normalizedNormal=normalize(normal);normalizedNormal*=normalizedNormal;vec3 worldBinormal=normalize(xbin*normalizedNormal.x+ybin*normalizedNormal.y+zbin*normalizedNormal.z);vec3 worldTangent=normalize(xtan*normalizedNormal.x+ytan*normalizedNormal.y+ztan*normalizedNormal.z);mat3 normalWorld=mat3(world); +#ifdef NONUNIFORMSCALING +normalWorld=transposeMat3(inverseMat3(normalWorld)); +#endif +worldTangent=normalize((normalWorld*worldTangent).xyz);worldBinormal=normalize((normalWorld*worldBinormal).xyz);vec3 worldNormal=normalize((normalWorld*normalize(normal)).xyz);tangentSpace[0]=worldTangent;tangentSpace[1]=worldBinormal;tangentSpace[2]=worldNormal; +#endif +#include +#include +#include +#include[0..maxSimultaneousLights] +#include +#if defined(POINTSIZE) && !defined(WEBGPU) +gl_PointSize=pointSize; +#endif +#define CUSTOM_VERTEX_MAIN_END +} +`; + ShaderStore.ShadersStore[name311] = shader310; +}); + +// node_modules/@babylonjs/materials/triPlanar/triPlanarMaterial.js +class TriPlanarMaterialDefines extends MaterialDefines { + constructor() { + super(); + this.DIFFUSEX = false; + this.DIFFUSEY = false; + this.DIFFUSEZ = false; + this.BUMPX = false; + this.BUMPY = false; + this.BUMPZ = false; + this.CLIPPLANE = false; + this.CLIPPLANE2 = false; + this.CLIPPLANE3 = false; + this.CLIPPLANE4 = false; + this.CLIPPLANE5 = false; + this.CLIPPLANE6 = false; + this.ALPHATEST = false; + this.DEPTHPREPASS = false; + this.POINTSIZE = false; + this.FOG = false; + this.SPECULARTERM = false; + this.NORMAL = false; + this.VERTEXCOLOR = false; + this.VERTEXALPHA = false; + this.NUM_BONE_INFLUENCERS = 0; + this.BonesPerMesh = 0; + this.INSTANCES = false; + this.INSTANCESCOLOR = false; + this.IMAGEPROCESSINGPOSTPROCESS = false; + this.SKIPFINALCOLORCLAMP = false; + this.NONUNIFORMSCALING = false; + this.LOGARITHMICDEPTH = false; + this.rebuild(); + } +} + +class TriPlanarMaterial extends PushMaterial { + constructor(name312, scene49) { + super(name312, scene49); + this.tileSize = 1; + this.diffuseColor = new Color3(1, 1, 1); + this.specularColor = new Color3(0.2, 0.2, 0.2); + this.specularPower = 64; + this._disableLighting = false; + this._maxSimultaneousLights = 4; + } + needAlphaBlending() { + return this.alpha < 1; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh80, subMesh11, useInstances) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady && subMesh11.effect._wasPreviouslyUsingInstances === useInstances) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new TriPlanarMaterialDefines; + } + const defines = subMesh11.materialDefines; + const scene49 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene49.getEngine(); + if (defines._areTexturesDirty) { + if (scene49.texturesEnabled) { + if (MaterialFlags.DiffuseTextureEnabled) { + const textures = [this.diffuseTextureX, this.diffuseTextureY, this.diffuseTextureZ]; + const textureDefines = ["DIFFUSEX", "DIFFUSEY", "DIFFUSEZ"]; + for (let i = 0;i < textures.length; i++) { + if (textures[i]) { + if (!textures[i].isReady()) { + return false; + } else { + defines[textureDefines[i]] = true; + } + } + } + } + if (MaterialFlags.BumpTextureEnabled) { + const textures = [this.normalTextureX, this.normalTextureY, this.normalTextureZ]; + const textureDefines = ["BUMPX", "BUMPY", "BUMPZ"]; + for (let i = 0;i < textures.length; i++) { + if (textures[i]) { + if (!textures[i].isReady()) { + return false; + } else { + defines[textureDefines[i]] = true; + } + } + } + } + } + } + MaterialHelper.PrepareDefinesForMisc(mesh80, scene49, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh80), defines); + defines._needNormals = MaterialHelper.PrepareDefinesForLights(scene49, mesh80, defines, false, this._maxSimultaneousLights, this._disableLighting); + MaterialHelper.PrepareDefinesForFrameBoundValues(scene49, engine47, this, defines, useInstances ? true : false); + MaterialHelper.PrepareDefinesForAttributes(mesh80, defines, true, true); + if (defines.isDirty) { + defines.markAsProcessed(); + scene49.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh80); + } + defines.IMAGEPROCESSINGPOSTPROCESS = scene49.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + MaterialHelper.PrepareAttributesForBones(attribs, mesh80, defines, fallbacks); + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "triplanar"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "view", + "viewProjection", + "vEyePosition", + "vLightsType", + "vDiffuseColor", + "vSpecularColor", + "vFogInfos", + "vFogColor", + "pointSize", + "mBones", + "tileSize" + ]; + const samplers = ["diffuseSamplerX", "diffuseSamplerY", "diffuseSamplerZ", "normalSamplerX", "normalSamplerY", "normalSamplerZ", "logarithmicDepthConstant"]; + const uniformBuffers = []; + addClipPlaneUniforms(uniforms2); + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: this.maxSimultaneousLights + }); + subMesh11.setEffect(scene49.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene49.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + subMesh11.effect._wasPreviouslyUsingInstances = !!useInstances; + return true; + } + bindForSubMesh(world, mesh80, subMesh11) { + const scene49 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene49.getTransformMatrix()); + MaterialHelper.BindBonesParameters(mesh80, this._activeEffect); + this._activeEffect.setFloat("tileSize", this.tileSize); + if (scene49.getCachedMaterial() !== this) { + if (this.diffuseTextureX) { + this._activeEffect.setTexture("diffuseSamplerX", this.diffuseTextureX); + } + if (this.diffuseTextureY) { + this._activeEffect.setTexture("diffuseSamplerY", this.diffuseTextureY); + } + if (this.diffuseTextureZ) { + this._activeEffect.setTexture("diffuseSamplerZ", this.diffuseTextureZ); + } + if (this.normalTextureX) { + this._activeEffect.setTexture("normalSamplerX", this.normalTextureX); + } + if (this.normalTextureY) { + this._activeEffect.setTexture("normalSamplerY", this.normalTextureY); + } + if (this.normalTextureZ) { + this._activeEffect.setTexture("normalSamplerZ", this.normalTextureZ); + } + bindClipPlane(effect20, this, scene49); + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + if (this._useLogarithmicDepth) { + MaterialHelper.BindLogDepth(defines, effect20, scene49); + } + scene49.bindEyePosition(effect20); + } + this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh80.visibility); + if (defines.SPECULARTERM) { + this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower); + } + if (scene49.lightsEnabled && !this.disableLighting) { + MaterialHelper.BindLights(scene49, mesh80, this._activeEffect, defines, this.maxSimultaneousLights); + } + if (scene49.fogEnabled && mesh80.applyFog && scene49.fogMode !== Scene.FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene49.getViewMatrix()); + } + MaterialHelper.BindFogParameters(scene49, mesh80, this._activeEffect); + this._afterBind(mesh80, this._activeEffect); + } + getAnimatables() { + const results = []; + if (this.mixTexture && this.mixTexture.animations && this.mixTexture.animations.length > 0) { + results.push(this.mixTexture); + } + return results; + } + getActiveTextures() { + const activeTextures = super.getActiveTextures(); + if (this._diffuseTextureX) { + activeTextures.push(this._diffuseTextureX); + } + if (this._diffuseTextureY) { + activeTextures.push(this._diffuseTextureY); + } + if (this._diffuseTextureZ) { + activeTextures.push(this._diffuseTextureZ); + } + if (this._normalTextureX) { + activeTextures.push(this._normalTextureX); + } + if (this._normalTextureY) { + activeTextures.push(this._normalTextureY); + } + if (this._normalTextureZ) { + activeTextures.push(this._normalTextureZ); + } + return activeTextures; + } + hasTexture(texture90) { + if (super.hasTexture(texture90)) { + return true; + } + if (this._diffuseTextureX === texture90) { + return true; + } + if (this._diffuseTextureY === texture90) { + return true; + } + if (this._diffuseTextureZ === texture90) { + return true; + } + if (this._normalTextureX === texture90) { + return true; + } + if (this._normalTextureY === texture90) { + return true; + } + if (this._normalTextureZ === texture90) { + return true; + } + return false; + } + dispose(forceDisposeEffect) { + if (this.mixTexture) { + this.mixTexture.dispose(); + } + super.dispose(forceDisposeEffect); + } + clone(name312) { + return SerializationHelper.Clone(() => new TriPlanarMaterial(name312, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.TriPlanarMaterial"; + return serializationObject; + } + getClassName() { + return "TriPlanarMaterial"; + } + static Parse(source, scene49, rootUrl) { + return SerializationHelper.Parse(() => new TriPlanarMaterial(source.name, scene49), source, scene49, rootUrl); + } +} +var init_triPlanarMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_color(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_materialFlags(); + init_buffer(); + init_scene(); + init_typeStore(); + init_triplanar_fragment(); + init_triplanar_vertex(); + init_effectFallbacks(); + init_clipPlaneMaterialHelper(); + __decorate2([ + serializeAsTexture() + ], TriPlanarMaterial.prototype, "mixTexture", undefined); + __decorate2([ + serializeAsTexture("diffuseTextureX") + ], TriPlanarMaterial.prototype, "_diffuseTextureX", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], TriPlanarMaterial.prototype, "diffuseTextureX", undefined); + __decorate2([ + serializeAsTexture("diffuseTexturY") + ], TriPlanarMaterial.prototype, "_diffuseTextureY", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], TriPlanarMaterial.prototype, "diffuseTextureY", undefined); + __decorate2([ + serializeAsTexture("diffuseTextureZ") + ], TriPlanarMaterial.prototype, "_diffuseTextureZ", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], TriPlanarMaterial.prototype, "diffuseTextureZ", undefined); + __decorate2([ + serializeAsTexture("normalTextureX") + ], TriPlanarMaterial.prototype, "_normalTextureX", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], TriPlanarMaterial.prototype, "normalTextureX", undefined); + __decorate2([ + serializeAsTexture("normalTextureY") + ], TriPlanarMaterial.prototype, "_normalTextureY", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], TriPlanarMaterial.prototype, "normalTextureY", undefined); + __decorate2([ + serializeAsTexture("normalTextureZ") + ], TriPlanarMaterial.prototype, "_normalTextureZ", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], TriPlanarMaterial.prototype, "normalTextureZ", undefined); + __decorate2([ + serialize() + ], TriPlanarMaterial.prototype, "tileSize", undefined); + __decorate2([ + serializeAsColor3() + ], TriPlanarMaterial.prototype, "diffuseColor", undefined); + __decorate2([ + serializeAsColor3() + ], TriPlanarMaterial.prototype, "specularColor", undefined); + __decorate2([ + serialize() + ], TriPlanarMaterial.prototype, "specularPower", undefined); + __decorate2([ + serialize("disableLighting") + ], TriPlanarMaterial.prototype, "_disableLighting", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], TriPlanarMaterial.prototype, "disableLighting", undefined); + __decorate2([ + serialize("maxSimultaneousLights") + ], TriPlanarMaterial.prototype, "_maxSimultaneousLights", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], TriPlanarMaterial.prototype, "maxSimultaneousLights", undefined); + RegisterClass("BABYLON.TriPlanarMaterial", TriPlanarMaterial); +}); + +// node_modules/@babylonjs/materials/triPlanar/index.js +var init_triPlanar = __esm(() => { + init_triPlanarMaterial(); +}); + +// node_modules/@babylonjs/materials/water/water.fragment.js +var name312, shader311; +var init_water_fragment = __esm(() => { + init_shaderStore(); + init_helperFunctions(); + init_imageProcessingDeclaration(); + init_imageProcessingFunctions(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_lightsFragmentFunctions(); + init_shadowsFragmentFunctions(); + init_clipPlaneFragmentDeclaration(); + init_logDepthDeclaration(); + init_fogFragmentDeclaration(); + init_clipPlaneFragment(); + init_lightFragment(); + init_logDepthFragment(); + init_fogFragment(); + name312 = "waterPixelShader"; + shader311 = `#ifdef LOGARITHMICDEPTH +#extension GL_EXT_frag_depth : enable +#endif +precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor; +#ifdef SPECULARTERM +uniform vec4 vSpecularColor; +#endif +varying vec3 vPositionW; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) +varying vec4 vColor; +#endif +#include +#include +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +#include +#include +#ifdef BUMP +varying vec2 vNormalUV; +#ifdef BUMPSUPERIMPOSE +varying vec2 vNormalUV2; +#endif +uniform sampler2D normalSampler;uniform vec2 vNormalInfos; +#endif +uniform sampler2D refractionSampler;uniform sampler2D reflectionSampler;const float LOG2=1.442695;uniform vec3 cameraPosition;uniform vec4 waterColor;uniform float colorBlendFactor;uniform vec4 waterColor2;uniform float colorBlendFactor2;uniform float bumpHeight;uniform float time;varying vec3 vRefractionMapTexCoord;varying vec3 vReflectionMapTexCoord; +#include +#include +#include +#define CUSTOM_FRAGMENT_DEFINITIONS +void main(void) { +#define CUSTOM_FRAGMENT_MAIN_BEGIN +#include +vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a; +#ifdef BUMP +#ifdef BUMPSUPERIMPOSE +baseColor=0.6*texture2D(normalSampler,vNormalUV)+0.4*texture2D(normalSampler,vec2(vNormalUV2.x,vNormalUV2.y)); +#else +baseColor=texture2D(normalSampler,vNormalUV); +#endif +vec3 bumpColor=baseColor.rgb; +#ifdef ALPHATEST +if (baseColor.a<0.4) +discard; +#endif +baseColor.rgb*=vNormalInfos.y; +#else +vec3 bumpColor=vec3(1.0); +#endif +#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) +baseColor.rgb*=vColor.rgb; +#endif +#ifdef NORMAL +vec2 perturbation=bumpHeight*(baseColor.rg-0.5); +#ifdef BUMPAFFECTSREFLECTION +vec3 normalW=normalize(vNormalW+vec3(perturbation.x*8.0,0.0,perturbation.y*8.0));if (normalW.y<0.0) {normalW.y=-normalW.y;} +#else +vec3 normalW=normalize(vNormalW); +#endif +#else +vec3 normalW=vec3(1.0,1.0,1.0);vec2 perturbation=bumpHeight*(vec2(1.0,1.0)-0.5); +#endif +#ifdef FRESNELSEPARATE +#ifdef REFLECTION +vec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation*0.5,0.0,1.0);vec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords); +#ifdef IS_REFRACTION_LINEAR +refractiveColor.rgb=toGammaSpace(refractiveColor.rgb); +#endif +vec2 projectedReflectionTexCoords=clamp(vec2( +vReflectionMapTexCoord.x/vReflectionMapTexCoord.z+perturbation.x*0.3, +vReflectionMapTexCoord.y/vReflectionMapTexCoord.z+perturbation.y +),0.0,1.0);vec4 reflectiveColor=texture2D(reflectionSampler,projectedReflectionTexCoords); +#ifdef IS_REFLECTION_LINEAR +reflectiveColor.rgb=toGammaSpace(reflectiveColor.rgb); +#endif +vec3 upVector=vec3(0.0,1.0,0.0);float fresnelTerm=clamp(abs(pow(dot(viewDirectionW,upVector),3.0)),0.05,0.65);float IfresnelTerm=1.0-fresnelTerm;refractiveColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*refractiveColor;reflectiveColor=IfresnelTerm*colorBlendFactor2*waterColor+(1.0-colorBlendFactor2*IfresnelTerm)*reflectiveColor;vec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*IfresnelTerm;baseColor=combinedColor; +#endif +vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.; +#ifdef SPECULARTERM +float glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb; +#else +float glossiness=0.; +#endif +#include[0..maxSimultaneousLights] +vec3 finalDiffuse=clamp(baseColor.rgb,0.0,1.0); +#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) +alpha*=vColor.a; +#endif +#ifdef SPECULARTERM +vec3 finalSpecular=specularBase*specularColor; +#else +vec3 finalSpecular=vec3(0.0); +#endif +#else +#ifdef REFLECTION +vec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation,0.0,1.0);vec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords); +#ifdef IS_REFRACTION_LINEAR +refractiveColor.rgb=toGammaSpace(refractiveColor.rgb); +#endif +vec2 projectedReflectionTexCoords=clamp(vReflectionMapTexCoord.xy/vReflectionMapTexCoord.z+perturbation,0.0,1.0);vec4 reflectiveColor=texture2D(reflectionSampler,projectedReflectionTexCoords); +#ifdef IS_REFLECTION_LINEAR +reflectiveColor.rgb=toGammaSpace(reflectiveColor.rgb); +#endif +vec3 upVector=vec3(0.0,1.0,0.0);float fresnelTerm=max(dot(viewDirectionW,upVector),0.0);vec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*(1.0-fresnelTerm);baseColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*combinedColor; +#endif +vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.; +#ifdef SPECULARTERM +float glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb; +#else +float glossiness=0.; +#endif +#include[0..maxSimultaneousLights] +vec3 finalDiffuse=clamp(baseColor.rgb,0.0,1.0); +#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES) +alpha*=vColor.a; +#endif +#ifdef SPECULARTERM +vec3 finalSpecular=specularBase*specularColor; +#else +vec3 finalSpecular=vec3(0.0); +#endif +#endif +vec4 color=vec4(finalDiffuse+finalSpecular,alpha); +#include +#include +#ifdef IMAGEPROCESSINGPOSTPROCESS +color.rgb=toLinearSpace(color.rgb); +#elif defined(IMAGEPROCESSING) +color.rgb=toLinearSpace(color.rgb);color=applyImageProcessing(color); +#endif +gl_FragColor=color; +#define CUSTOM_FRAGMENT_MAIN_END +} +`; + ShaderStore.ShadersStore[name312] = shader311; +}); + +// node_modules/@babylonjs/materials/water/water.vertex.js +var name313, shader312; +var init_water_vertex = __esm(() => { + init_shaderStore(); + init_bonesDeclaration(); + init_bakedVertexAnimationDeclaration(); + init_instancesDeclaration(); + init_clipPlaneVertexDeclaration(); + init_fogVertexDeclaration(); + init_lightFragmentDeclaration(); + init_lightUboDeclaration(); + init_logDepthDeclaration(); + init_instancesVertex(); + init_bonesVertex(); + init_bakedVertexAnimation(); + init_clipPlaneVertex(); + init_fogVertex(); + init_shadowsVertex(); + init_vertexColorMixing(); + init_logDepthVertex(); + name313 = "waterVertexShader"; + shader312 = `precision highp float;attribute vec3 position; +#ifdef NORMAL +attribute vec3 normal; +#endif +#ifdef UV1 +attribute vec2 uv; +#endif +#ifdef UV2 +attribute vec2 uv2; +#endif +#ifdef VERTEXCOLOR +attribute vec4 color; +#endif +#include +#include +#include +uniform mat4 view;uniform mat4 viewProjection; +#ifdef BUMP +varying vec2 vNormalUV; +#ifdef BUMPSUPERIMPOSE +varying vec2 vNormalUV2; +#endif +uniform mat4 normalMatrix;uniform vec2 vNormalInfos; +#endif +#ifdef POINTSIZE +uniform float pointSize; +#endif +varying vec3 vPositionW; +#ifdef NORMAL +varying vec3 vNormalW; +#endif +#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) +varying vec4 vColor; +#endif +#include +#include +#include<__decl__lightFragment>[0..maxSimultaneousLights] +#include +uniform mat4 reflectionViewProjection;uniform vec2 windDirection;uniform float waveLength;uniform float time;uniform float windForce;uniform float waveHeight;uniform float waveSpeed;uniform float waveCount;varying vec3 vRefractionMapTexCoord;varying vec3 vReflectionMapTexCoord; +#define CUSTOM_VERTEX_DEFINITIONS +void main(void) { +#define CUSTOM_VERTEX_MAIN_BEGIN +#include +#include +#include +vec4 worldPos=finalWorld*vec4(position,1.0);vPositionW=vec3(worldPos); +#ifdef NORMAL +vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0))); +#endif +#ifndef UV1 +vec2 uv=vec2(0.,0.); +#endif +#ifndef UV2 +vec2 uv2=vec2(0.,0.); +#endif +#ifdef BUMP +if (vNormalInfos.x==0.) +{vNormalUV=vec2(normalMatrix*vec4((uv*1.0)/waveLength+time*windForce*windDirection,1.0,0.0)); +#ifdef BUMPSUPERIMPOSE +vNormalUV2=vec2(normalMatrix*vec4((uv*0.721)/waveLength+time*1.2*windForce*windDirection,1.0,0.0)); +#endif +} +else +{vNormalUV=vec2(normalMatrix*vec4((uv2*1.0)/waveLength+time*windForce*windDirection ,1.0,0.0)); +#ifdef BUMPSUPERIMPOSE +vNormalUV2=vec2(normalMatrix*vec4((uv2*0.721)/waveLength+time*1.2*windForce*windDirection ,1.0,0.0)); +#endif +} +#endif +#include +#include +#include[0..maxSimultaneousLights] +#include +#if defined(POINTSIZE) && !defined(WEBGPU) +gl_PointSize=pointSize; +#endif +float finalWaveCount=1.0/(waveCount*0.5); +#ifdef USE_WORLD_COORDINATES +vec3 p=worldPos.xyz; +#else +vec3 p=position; +#endif +float newY=(sin(((p.x/finalWaveCount)+time*waveSpeed))*waveHeight*windDirection.x*5.0) ++ (cos(((p.z/finalWaveCount)+ time*waveSpeed))*waveHeight*windDirection.y*5.0);p.y+=abs(newY); +#ifdef USE_WORLD_COORDINATES +gl_Position=viewProjection*vec4(p,1.0); +#else +gl_Position=viewProjection*finalWorld*vec4(p,1.0); +#endif +#ifdef REFLECTION +vRefractionMapTexCoord.x=0.5*(gl_Position.w+gl_Position.x);vRefractionMapTexCoord.y=0.5*(gl_Position.w+gl_Position.y);vRefractionMapTexCoord.z=gl_Position.w;worldPos=reflectionViewProjection*finalWorld*vec4(position,1.0);vReflectionMapTexCoord.x=0.5*(worldPos.w+worldPos.x);vReflectionMapTexCoord.y=0.5*(worldPos.w+worldPos.y);vReflectionMapTexCoord.z=worldPos.w; +#endif +#include +#define CUSTOM_VERTEX_MAIN_END +} +`; + ShaderStore.ShadersStore[name313] = shader312; +}); + +// node_modules/@babylonjs/materials/water/waterMaterial.js +class WaterMaterialDefines extends MaterialDefines { + constructor() { + super(); + this.BUMP = false; + this.REFLECTION = false; + this.CLIPPLANE = false; + this.CLIPPLANE2 = false; + this.CLIPPLANE3 = false; + this.CLIPPLANE4 = false; + this.CLIPPLANE5 = false; + this.CLIPPLANE6 = false; + this.ALPHATEST = false; + this.DEPTHPREPASS = false; + this.POINTSIZE = false; + this.FOG = false; + this.NORMAL = false; + this.UV1 = false; + this.UV2 = false; + this.VERTEXCOLOR = false; + this.VERTEXALPHA = false; + this.NUM_BONE_INFLUENCERS = 0; + this.BonesPerMesh = 0; + this.INSTANCES = false; + this.INSTANCESCOLOR = false; + this.SPECULARTERM = false; + this.LOGARITHMICDEPTH = false; + this.USE_REVERSE_DEPTHBUFFER = false; + this.FRESNELSEPARATE = false; + this.BUMPSUPERIMPOSE = false; + this.BUMPAFFECTSREFLECTION = false; + this.USE_WORLD_COORDINATES = false; + this.IMAGEPROCESSING = false; + this.VIGNETTE = false; + this.VIGNETTEBLENDMODEMULTIPLY = false; + this.VIGNETTEBLENDMODEOPAQUE = false; + this.TONEMAPPING = false; + this.TONEMAPPING_ACES = false; + this.CONTRAST = false; + this.EXPOSURE = false; + this.COLORCURVES = false; + this.COLORGRADING = false; + this.COLORGRADING3D = false; + this.SAMPLER3DGREENDEPTH = false; + this.SAMPLER3DBGRMAP = false; + this.DITHER = false; + this.IMAGEPROCESSINGPOSTPROCESS = false; + this.SKIPFINALCOLORCLAMP = false; + this.rebuild(); + } +} + +class WaterMaterial extends PushMaterial { + get hasRenderTargetTextures() { + return true; + } + constructor(name314, scene50, renderTargetSize = new Vector2(512, 512)) { + super(name314, scene50); + this.renderTargetSize = renderTargetSize; + this.diffuseColor = new Color3(1, 1, 1); + this.specularColor = new Color3(0, 0, 0); + this.specularPower = 64; + this._disableLighting = false; + this._maxSimultaneousLights = 4; + this.windForce = 6; + this.windDirection = new Vector2(0, 1); + this.waveHeight = 0.4; + this.bumpHeight = 0.4; + this._bumpSuperimpose = false; + this._fresnelSeparate = false; + this._bumpAffectsReflection = false; + this.waterColor = new Color3(0.1, 0.1, 0.6); + this.colorBlendFactor = 0.2; + this.waterColor2 = new Color3(0.1, 0.1, 0.6); + this.colorBlendFactor2 = 0.2; + this.waveLength = 0.1; + this.waveSpeed = 1; + this.waveCount = 20; + this.disableClipPlane = false; + this._useWorldCoordinatesForWaveDeformation = false; + this._renderTargets = new SmartArray(16); + this._mesh = null; + this._reflectionTransform = Matrix.Zero(); + this._lastTime = 0; + this._lastDeltaTime = 0; + this._createRenderTargets(this.getScene(), renderTargetSize); + this.getRenderTargetTextures = () => { + this._renderTargets.reset(); + this._renderTargets.push(this._reflectionRTT); + this._renderTargets.push(this._refractionRTT); + return this._renderTargets; + }; + this._imageProcessingConfiguration = this.getScene().imageProcessingConfiguration; + if (this._imageProcessingConfiguration) { + this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => { + this._markAllSubMeshesAsImageProcessingDirty(); + }); + } + } + get refractionTexture() { + return this._refractionRTT; + } + get reflectionTexture() { + return this._reflectionRTT; + } + addToRenderList(node30) { + if (this._refractionRTT && this._refractionRTT.renderList) { + this._refractionRTT.renderList.push(node30); + } + if (this._reflectionRTT && this._reflectionRTT.renderList) { + this._reflectionRTT.renderList.push(node30); + } + } + removeFromRenderList(node30) { + if (this._refractionRTT && this._refractionRTT.renderList) { + const idx = this._refractionRTT.renderList.indexOf(node30); + if (idx !== -1) { + this._refractionRTT.renderList.splice(idx, 1); + } + } + if (this._reflectionRTT && this._reflectionRTT.renderList) { + const idx = this._reflectionRTT.renderList.indexOf(node30); + if (idx !== -1) { + this._reflectionRTT.renderList.splice(idx, 1); + } + } + } + enableRenderTargets(enable) { + const refreshRate = enable ? 1 : 0; + if (this._refractionRTT) { + this._refractionRTT.refreshRate = refreshRate; + } + if (this._reflectionRTT) { + this._reflectionRTT.refreshRate = refreshRate; + } + } + getRenderList() { + return this._refractionRTT ? this._refractionRTT.renderList : []; + } + get renderTargetsEnabled() { + return !(this._refractionRTT && this._refractionRTT.refreshRate === 0); + } + needAlphaBlending() { + return this.alpha < 1; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh80, subMesh11, useInstances) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady && subMesh11.effect._wasPreviouslyUsingInstances === useInstances) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new WaterMaterialDefines; + } + const defines = subMesh11.materialDefines; + const scene50 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene50.getEngine(); + if (defines._areTexturesDirty) { + defines._needUVs = false; + if (scene50.texturesEnabled) { + if (this.bumpTexture && MaterialFlags.BumpTextureEnabled) { + if (!this.bumpTexture.isReady()) { + return false; + } else { + defines._needUVs = true; + defines.BUMP = true; + } + } + if (MaterialFlags.ReflectionTextureEnabled) { + defines.REFLECTION = true; + } + } + } + MaterialHelper.PrepareDefinesForFrameBoundValues(scene50, engine47, this, defines, useInstances ? true : false); + MaterialHelper.PrepareDefinesForMisc(mesh80, scene50, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh80), defines); + if (defines._areMiscDirty) { + defines.FRESNELSEPARATE = this._fresnelSeparate; + defines.BUMPSUPERIMPOSE = this._bumpSuperimpose; + defines.BUMPAFFECTSREFLECTION = this._bumpAffectsReflection; + defines.USE_WORLD_COORDINATES = this._useWorldCoordinatesForWaveDeformation; + } + defines._needNormals = MaterialHelper.PrepareDefinesForLights(scene50, mesh80, defines, true, this._maxSimultaneousLights, this._disableLighting); + if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) { + if (!this._imageProcessingConfiguration.isReady()) { + return false; + } + this._imageProcessingConfiguration.prepareDefines(defines); + defines.IS_REFLECTION_LINEAR = this.reflectionTexture != null && !this.reflectionTexture.gammaSpace; + defines.IS_REFRACTION_LINEAR = this.refractionTexture != null && !this.refractionTexture.gammaSpace; + } + MaterialHelper.PrepareDefinesForAttributes(mesh80, defines, true, true); + this._mesh = mesh80; + if (this._waitingRenderList) { + for (let i = 0;i < this._waitingRenderList.length; i++) { + this.addToRenderList(scene50.getNodeById(this._waitingRenderList[i])); + } + this._waitingRenderList = null; + } + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + if (defines.LOGARITHMICDEPTH) { + fallbacks.addFallback(0, "LOGARITHMICDEPTH"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights); + if (defines.NUM_BONE_INFLUENCERS > 0) { + fallbacks.addCPUSkinningFallback(0, mesh80); + } + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + MaterialHelper.PrepareAttributesForBones(attribs, mesh80, defines, fallbacks); + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "water"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "view", + "viewProjection", + "vEyePosition", + "vLightsType", + "vDiffuseColor", + "vSpecularColor", + "vFogInfos", + "vFogColor", + "pointSize", + "vNormalInfos", + "mBones", + "normalMatrix", + "logarithmicDepthConstant", + "reflectionViewProjection", + "windDirection", + "waveLength", + "time", + "windForce", + "cameraPosition", + "bumpHeight", + "waveHeight", + "waterColor", + "waterColor2", + "colorBlendFactor", + "colorBlendFactor2", + "waveSpeed", + "waveCount" + ]; + const samplers = [ + "normalSampler", + "refractionSampler", + "reflectionSampler" + ]; + const uniformBuffers = []; + if (ImageProcessingConfiguration) { + ImageProcessingConfiguration.PrepareUniforms(uniforms2, defines); + ImageProcessingConfiguration.PrepareSamplers(samplers, defines); + } + addClipPlaneUniforms(uniforms2); + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: this.maxSimultaneousLights + }); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + subMesh11.effect._wasPreviouslyUsingInstances = !!useInstances; + return true; + } + bindForSubMesh(world, mesh80, subMesh11) { + const scene50 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20 || !this._mesh) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene50.getTransformMatrix()); + MaterialHelper.BindBonesParameters(mesh80, this._activeEffect); + if (this._mustRebind(scene50, effect20)) { + if (this.bumpTexture && MaterialFlags.BumpTextureEnabled) { + this._activeEffect.setTexture("normalSampler", this.bumpTexture); + this._activeEffect.setFloat2("vNormalInfos", this.bumpTexture.coordinatesIndex, this.bumpTexture.level); + this._activeEffect.setMatrix("normalMatrix", this.bumpTexture.getTextureMatrix()); + } + bindClipPlane(effect20, this, scene50); + if (this.pointsCloud) { + this._activeEffect.setFloat("pointSize", this.pointSize); + } + if (this._useLogarithmicDepth) { + MaterialHelper.BindLogDepth(defines, effect20, scene50); + } + scene50.bindEyePosition(effect20); + } + this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh80.visibility); + if (defines.SPECULARTERM) { + this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower); + } + if (scene50.lightsEnabled && !this.disableLighting) { + MaterialHelper.BindLights(scene50, mesh80, this._activeEffect, defines, this.maxSimultaneousLights); + } + if (scene50.fogEnabled && mesh80.applyFog && scene50.fogMode !== Scene.FOGMODE_NONE) { + this._activeEffect.setMatrix("view", scene50.getViewMatrix()); + } + MaterialHelper.BindFogParameters(scene50, mesh80, this._activeEffect); + MaterialHelper.BindLogDepth(defines, this._activeEffect, scene50); + if (MaterialFlags.ReflectionTextureEnabled) { + this._activeEffect.setTexture("refractionSampler", this._refractionRTT); + this._activeEffect.setTexture("reflectionSampler", this._reflectionRTT); + } + const wrvp = this._reflectionTransform.multiply(scene50.getProjectionMatrix()); + const deltaTime = scene50.getEngine().getDeltaTime(); + if (deltaTime !== this._lastDeltaTime) { + this._lastDeltaTime = deltaTime; + this._lastTime += this._lastDeltaTime; + } + this._activeEffect.setMatrix("reflectionViewProjection", wrvp); + this._activeEffect.setVector2("windDirection", this.windDirection); + this._activeEffect.setFloat("waveLength", this.waveLength); + this._activeEffect.setFloat("time", this._lastTime / 1e5); + this._activeEffect.setFloat("windForce", this.windForce); + this._activeEffect.setFloat("waveHeight", this.waveHeight); + this._activeEffect.setFloat("bumpHeight", this.bumpHeight); + this._activeEffect.setColor4("waterColor", this.waterColor, 1); + this._activeEffect.setFloat("colorBlendFactor", this.colorBlendFactor); + this._activeEffect.setColor4("waterColor2", this.waterColor2, 1); + this._activeEffect.setFloat("colorBlendFactor2", this.colorBlendFactor2); + this._activeEffect.setFloat("waveSpeed", this.waveSpeed); + this._activeEffect.setFloat("waveCount", this.waveCount); + if (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess) { + this._imageProcessingConfiguration.bind(this._activeEffect); + } + this._afterBind(mesh80, this._activeEffect); + } + _createRenderTargets(scene50, renderTargetSize) { + this._refractionRTT = new RenderTargetTexture(name + "_refraction", { width: renderTargetSize.x, height: renderTargetSize.y }, scene50, false, true); + this._refractionRTT.wrapU = Constants.TEXTURE_MIRROR_ADDRESSMODE; + this._refractionRTT.wrapV = Constants.TEXTURE_MIRROR_ADDRESSMODE; + this._refractionRTT.ignoreCameraViewport = true; + this._reflectionRTT = new RenderTargetTexture(name + "_reflection", { width: renderTargetSize.x, height: renderTargetSize.y }, scene50, false, true); + this._reflectionRTT.wrapU = Constants.TEXTURE_MIRROR_ADDRESSMODE; + this._reflectionRTT.wrapV = Constants.TEXTURE_MIRROR_ADDRESSMODE; + this._reflectionRTT.ignoreCameraViewport = true; + let isVisible; + let clipPlane = null; + let savedViewMatrix; + const mirrorMatrix = Matrix.Zero(); + this._refractionRTT.onBeforeRender = () => { + if (this._mesh) { + isVisible = this._mesh.isVisible; + this._mesh.isVisible = false; + } + if (!this.disableClipPlane) { + clipPlane = scene50.clipPlane; + const positiony = this._mesh ? this._mesh.absolutePosition.y : 0; + scene50.clipPlane = Plane.FromPositionAndNormal(new Vector3(0, positiony + 0.05, 0), new Vector3(0, 1, 0)); + } + }; + this._refractionRTT.onAfterRender = () => { + if (this._mesh) { + this._mesh.isVisible = isVisible; + } + if (!this.disableClipPlane) { + scene50.clipPlane = clipPlane; + } + }; + this._reflectionRTT.onBeforeRender = () => { + if (this._mesh) { + isVisible = this._mesh.isVisible; + this._mesh.isVisible = false; + } + if (!this.disableClipPlane) { + clipPlane = scene50.clipPlane; + const positiony = this._mesh ? this._mesh.absolutePosition.y : 0; + scene50.clipPlane = Plane.FromPositionAndNormal(new Vector3(0, positiony - 0.05, 0), new Vector3(0, -1, 0)); + Matrix.ReflectionToRef(scene50.clipPlane, mirrorMatrix); + } + savedViewMatrix = scene50.getViewMatrix(); + mirrorMatrix.multiplyToRef(savedViewMatrix, this._reflectionTransform); + scene50.setTransformMatrix(this._reflectionTransform, scene50.getProjectionMatrix()); + scene50._mirroredCameraPosition = Vector3.TransformCoordinates(scene50.activeCamera.position, mirrorMatrix); + }; + this._reflectionRTT.onAfterRender = () => { + if (this._mesh) { + this._mesh.isVisible = isVisible; + } + scene50.clipPlane = clipPlane; + scene50.setTransformMatrix(savedViewMatrix, scene50.getProjectionMatrix()); + scene50._mirroredCameraPosition = null; + }; + } + getAnimatables() { + const results = []; + if (this.bumpTexture && this.bumpTexture.animations && this.bumpTexture.animations.length > 0) { + results.push(this.bumpTexture); + } + if (this._reflectionRTT && this._reflectionRTT.animations && this._reflectionRTT.animations.length > 0) { + results.push(this._reflectionRTT); + } + if (this._refractionRTT && this._refractionRTT.animations && this._refractionRTT.animations.length > 0) { + results.push(this._refractionRTT); + } + return results; + } + getActiveTextures() { + const activeTextures = super.getActiveTextures(); + if (this._bumpTexture) { + activeTextures.push(this._bumpTexture); + } + return activeTextures; + } + hasTexture(texture90) { + if (super.hasTexture(texture90)) { + return true; + } + if (this._bumpTexture === texture90) { + return true; + } + return false; + } + dispose(forceDisposeEffect) { + if (this.bumpTexture) { + this.bumpTexture.dispose(); + } + let index = this.getScene().customRenderTargets.indexOf(this._refractionRTT); + if (index != -1) { + this.getScene().customRenderTargets.splice(index, 1); + } + index = -1; + index = this.getScene().customRenderTargets.indexOf(this._reflectionRTT); + if (index != -1) { + this.getScene().customRenderTargets.splice(index, 1); + } + if (this._reflectionRTT) { + this._reflectionRTT.dispose(); + } + if (this._refractionRTT) { + this._refractionRTT.dispose(); + } + if (this._imageProcessingConfiguration && this._imageProcessingObserver) { + this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver); + } + super.dispose(forceDisposeEffect); + } + clone(name314) { + return SerializationHelper.Clone(() => new WaterMaterial(name314, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.WaterMaterial"; + serializationObject.renderList = []; + if (this._refractionRTT && this._refractionRTT.renderList) { + for (let i = 0;i < this._refractionRTT.renderList.length; i++) { + serializationObject.renderList.push(this._refractionRTT.renderList[i].id); + } + } + return serializationObject; + } + getClassName() { + return "WaterMaterial"; + } + static Parse(source, scene50, rootUrl) { + const mat = SerializationHelper.Parse(() => new WaterMaterial(source.name, scene50), source, scene50, rootUrl); + mat._waitingRenderList = source.renderList; + return mat; + } + static CreateDefaultMesh(name314, scene50) { + const mesh80 = CreateGround(name314, { width: 512, height: 512, subdivisions: 32, updatable: false }, scene50); + return mesh80; + } +} +var init_waterMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_math_color(); + init_math_plane(); + init_constants(); + init_smartArray(); + init_renderTargetTexture(); + init_materialDefines(); + init_imageProcessingConfiguration(); + init_materialHelper(); + init_pushMaterial(); + init_materialFlags(); + init_buffer(); + init_scene(); + init_typeStore(); + init_water_fragment(); + init_water_vertex(); + init_effectFallbacks(); + init_groundBuilder(); + init_clipPlaneMaterialHelper(); + __decorate2([ + serializeAsTexture("bumpTexture") + ], WaterMaterial.prototype, "_bumpTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], WaterMaterial.prototype, "bumpTexture", undefined); + __decorate2([ + serializeAsColor3() + ], WaterMaterial.prototype, "diffuseColor", undefined); + __decorate2([ + serializeAsColor3() + ], WaterMaterial.prototype, "specularColor", undefined); + __decorate2([ + serialize() + ], WaterMaterial.prototype, "specularPower", undefined); + __decorate2([ + serialize("disableLighting") + ], WaterMaterial.prototype, "_disableLighting", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], WaterMaterial.prototype, "disableLighting", undefined); + __decorate2([ + serialize("maxSimultaneousLights") + ], WaterMaterial.prototype, "_maxSimultaneousLights", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsLightsDirty") + ], WaterMaterial.prototype, "maxSimultaneousLights", undefined); + __decorate2([ + serialize() + ], WaterMaterial.prototype, "windForce", undefined); + __decorate2([ + serializeAsVector2() + ], WaterMaterial.prototype, "windDirection", undefined); + __decorate2([ + serialize() + ], WaterMaterial.prototype, "waveHeight", undefined); + __decorate2([ + serialize() + ], WaterMaterial.prototype, "bumpHeight", undefined); + __decorate2([ + serialize("bumpSuperimpose") + ], WaterMaterial.prototype, "_bumpSuperimpose", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsMiscDirty") + ], WaterMaterial.prototype, "bumpSuperimpose", undefined); + __decorate2([ + serialize("fresnelSeparate") + ], WaterMaterial.prototype, "_fresnelSeparate", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsMiscDirty") + ], WaterMaterial.prototype, "fresnelSeparate", undefined); + __decorate2([ + serialize("bumpAffectsReflection") + ], WaterMaterial.prototype, "_bumpAffectsReflection", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsMiscDirty") + ], WaterMaterial.prototype, "bumpAffectsReflection", undefined); + __decorate2([ + serializeAsColor3() + ], WaterMaterial.prototype, "waterColor", undefined); + __decorate2([ + serialize() + ], WaterMaterial.prototype, "colorBlendFactor", undefined); + __decorate2([ + serializeAsColor3() + ], WaterMaterial.prototype, "waterColor2", undefined); + __decorate2([ + serialize() + ], WaterMaterial.prototype, "colorBlendFactor2", undefined); + __decorate2([ + serialize() + ], WaterMaterial.prototype, "waveLength", undefined); + __decorate2([ + serialize() + ], WaterMaterial.prototype, "waveSpeed", undefined); + __decorate2([ + serialize() + ], WaterMaterial.prototype, "waveCount", undefined); + __decorate2([ + serialize() + ], WaterMaterial.prototype, "disableClipPlane", undefined); + __decorate2([ + serialize("useWorldCoordinatesForWaveDeformation") + ], WaterMaterial.prototype, "_useWorldCoordinatesForWaveDeformation", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsMiscDirty") + ], WaterMaterial.prototype, "useWorldCoordinatesForWaveDeformation", undefined); + RegisterClass("BABYLON.WaterMaterial", WaterMaterial); +}); + +// node_modules/@babylonjs/materials/water/index.js +var init_water = __esm(() => { + init_waterMaterial(); +}); + +// node_modules/@babylonjs/materials/index.js +var exports_materials = {}; +__export(exports_materials, { + WaterMaterial: () => { + { + return WaterMaterial; + } + }, + TriPlanarMaterial: () => { + { + return TriPlanarMaterial; + } + }, + TerrainMaterial: () => { + { + return TerrainMaterial; + } + }, + SkyMaterial: () => { + { + return SkyMaterial; + } + }, + SimpleMaterial: () => { + { + return SimpleMaterial; + } + }, + ShadowOnlyMaterial: () => { + { + return ShadowOnlyMaterial; + } + }, + ShaderSpecialParts: () => { + { + return ShaderSpecialParts; + } + }, + ShaderAlebdoParts: () => { + { + return ShaderAlebdoParts; + } + }, + ShaderAlbedoParts: () => { + { + return ShaderAlbedoParts; + } + }, + PBRCustomMaterial: () => { + { + return PBRCustomMaterial; + } + }, + NormalMaterial: () => { + { + return NormalMaterial; + } + }, + MixMaterial: () => { + { + return MixMaterial; + } + }, + LavaMaterial: () => { + { + return LavaMaterial; + } + }, + GridMaterial: () => { + { + return GridMaterial; + } + }, + GradientMaterial: () => { + { + return GradientMaterial; + } + }, + FurMaterial: () => { + { + return FurMaterial; + } + }, + FireMaterial: () => { + { + return FireMaterial; + } + }, + CustomShaderStructure: () => { + { + return CustomShaderStructure; + } + }, + CustomMaterial: () => { + { + return CustomMaterial; + } + }, + CellMaterial: () => { + { + return CellMaterial; + } + } +}); +var init_materials = __esm(() => { + init_cell(); + init_custom(); + init_fire(); + init_fur(); + init_gradient(); + init_grid(); + init_lava(); + init_mix(); + init_normal(); + init_shadowOnly(); + init_simple(); + init_sky(); + init_terrain(); + init_triPlanar(); + init_water(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/valueAndUnit.js +class ValueAndUnit2 { + constructor(value, unit = ValueAndUnit2.UNITMODE_PIXEL, negativeValueAllowed = true) { + this.negativeValueAllowed = negativeValueAllowed; + this._value = 1; + this._unit = ValueAndUnit2.UNITMODE_PIXEL; + this.ignoreAdaptiveScaling = false; + this.onChangedObservable = new Observable; + this._value = value; + this._unit = unit; + this._originalUnit = unit; + } + get isPercentage() { + return this._unit === ValueAndUnit2.UNITMODE_PERCENTAGE; + } + get isPixel() { + return this._unit === ValueAndUnit2.UNITMODE_PIXEL; + } + get internalValue() { + return this._value; + } + get value() { + return this._value; + } + set value(value) { + if (value !== this._value) { + this._value = value; + this.onChangedObservable.notifyObservers(); + } + } + get unit() { + return this._unit; + } + set unit(value) { + if (value !== this._unit) { + this._unit = value; + this.onChangedObservable.notifyObservers(); + } + } + getValueInPixel(host, refValue) { + if (this.isPixel) { + return this.getValue(host); + } + return this.getValue(host) * refValue; + } + updateInPlace(value, unit = ValueAndUnit2.UNITMODE_PIXEL) { + if (this.value !== value || this.unit !== unit) { + this._value = value; + this._unit = unit; + this.onChangedObservable.notifyObservers(); + } + return this; + } + getValue(host) { + if (host && !this.ignoreAdaptiveScaling && this.unit !== ValueAndUnit2.UNITMODE_PERCENTAGE) { + let width = 0; + let height = 0; + if (host.idealWidth) { + width = Math.ceil(this._value * host.getSize().width / host.idealWidth); + } + if (host.idealHeight) { + height = Math.ceil(this._value * host.getSize().height / host.idealHeight); + } + if (host.useSmallestIdeal && host.idealWidth && host.idealHeight) { + return window.innerWidth < window.innerHeight ? width : height; + } + if (host.idealWidth) { + return width; + } + if (host.idealHeight) { + return height; + } + } + return this._value; + } + toString(host, decimals) { + switch (this._unit) { + case ValueAndUnit2.UNITMODE_PERCENTAGE: { + const percentage = this.getValue(host) * 100; + return (decimals ? percentage.toFixed(decimals) : percentage) + "%"; + } + case ValueAndUnit2.UNITMODE_PIXEL: { + const pixels = this.getValue(host); + return (decimals ? pixels.toFixed(decimals) : pixels) + "px"; + } + } + return this._unit.toString(); + } + fromString(source) { + const match = ValueAndUnit2._Regex.exec(source.toString()); + if (!match || match.length === 0) { + return false; + } + let sourceValue = parseFloat(match[1]); + let sourceUnit = this._originalUnit; + if (!this.negativeValueAllowed) { + if (sourceValue < 0) { + sourceValue = 0; + } + } + if (match.length === 4) { + switch (match[3]) { + case "px": + sourceUnit = ValueAndUnit2.UNITMODE_PIXEL; + break; + case "%": + sourceUnit = ValueAndUnit2.UNITMODE_PERCENTAGE; + sourceValue /= 100; + break; + } + } + if (sourceValue === this._value && sourceUnit === this._unit) { + return false; + } + this._value = sourceValue; + this._unit = sourceUnit; + this.onChangedObservable.notifyObservers(); + return true; + } + static get UNITMODE_PERCENTAGE() { + return ValueAndUnit2._UNITMODE_PERCENTAGE; + } + static get UNITMODE_PIXEL() { + return ValueAndUnit2._UNITMODE_PIXEL; + } +} +var init_valueAndUnit = __esm(() => { + init_observable(); + ValueAndUnit2._Regex = /(^-?\d*(\.\d+)?)(%|px)?/; + ValueAndUnit2._UNITMODE_PERCENTAGE = 0; + ValueAndUnit2._UNITMODE_PIXEL = 1; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/measure.js +class Measure2 { + constructor(left, top, width, height) { + this.left = left; + this.top = top; + this.width = width; + this.height = height; + } + copyFrom(other) { + this.left = other.left; + this.top = other.top; + this.width = other.width; + this.height = other.height; + } + copyFromFloats(left, top, width, height) { + this.left = left; + this.top = top; + this.width = width; + this.height = height; + } + static CombineToRef(a, b, result) { + const left = Math.min(a.left, b.left); + const top = Math.min(a.top, b.top); + const right = Math.max(a.left + a.width, b.left + b.width); + const bottom = Math.max(a.top + a.height, b.top + b.height); + result.left = left; + result.top = top; + result.width = right - left; + result.height = bottom - top; + } + addAndTransformToRef(transform, addX, addY, addWidth, addHeight, result) { + const left = this.left + addX; + const top = this.top + addY; + const width = this.width + addWidth; + const height = this.height + addHeight; + tmpRect3[0].copyFromFloats(left, top); + tmpRect3[1].copyFromFloats(left + width, top); + tmpRect3[2].copyFromFloats(left + width, top + height); + tmpRect3[3].copyFromFloats(left, top + height); + tmpV12.copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE); + tmpV22.copyFromFloats(0, 0); + for (let i = 0;i < 4; i++) { + transform.transformCoordinates(tmpRect3[i].x, tmpRect3[i].y, tmpRect22[i]); + tmpV12.x = Math.floor(Math.min(tmpV12.x, tmpRect22[i].x)); + tmpV12.y = Math.floor(Math.min(tmpV12.y, tmpRect22[i].y)); + tmpV22.x = Math.ceil(Math.max(tmpV22.x, tmpRect22[i].x)); + tmpV22.y = Math.ceil(Math.max(tmpV22.y, tmpRect22[i].y)); + } + result.left = tmpV12.x; + result.top = tmpV12.y; + result.width = tmpV22.x - tmpV12.x; + result.height = tmpV22.y - tmpV12.y; + } + transformToRef(transform, result) { + this.addAndTransformToRef(transform, 0, 0, 0, 0, result); + } + isEqualsTo(other) { + if (this.left !== other.left) { + return false; + } + if (this.top !== other.top) { + return false; + } + if (this.width !== other.width) { + return false; + } + if (this.height !== other.height) { + return false; + } + return true; + } + static Empty() { + return new Measure2(0, 0, 0, 0); + } +} +var tmpRect3, tmpRect22, tmpV12, tmpV22; +var init_measure = __esm(() => { + init_math_vector(); + tmpRect3 = [new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0)]; + tmpRect22 = [new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0)]; + tmpV12 = new Vector2(0, 0); + tmpV22 = new Vector2(0, 0); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/math2D.js +class Vector2WithInfo2 extends Vector2 { + constructor(source, buttonIndex = 0) { + super(source.x, source.y); + this.buttonIndex = buttonIndex; + } +} + +class Matrix2D2 { + constructor(m00, m01, m10, m11, m20, m21) { + this.m = new Float32Array(6); + this.fromValues(m00, m01, m10, m11, m20, m21); + } + fromValues(m00, m01, m10, m11, m20, m21) { + this.m[0] = m00; + this.m[1] = m01; + this.m[2] = m10; + this.m[3] = m11; + this.m[4] = m20; + this.m[5] = m21; + return this; + } + determinant() { + return this.m[0] * this.m[3] - this.m[1] * this.m[2]; + } + invertToRef(result) { + const l0 = this.m[0]; + const l1 = this.m[1]; + const l2 = this.m[2]; + const l3 = this.m[3]; + const l4 = this.m[4]; + const l5 = this.m[5]; + const det = this.determinant(); + if (det < Epsilon * Epsilon) { + result.m[0] = 0; + result.m[1] = 0; + result.m[2] = 0; + result.m[3] = 0; + result.m[4] = 0; + result.m[5] = 0; + return this; + } + const detDiv = 1 / det; + const det4 = l2 * l5 - l3 * l4; + const det5 = l1 * l4 - l0 * l5; + result.m[0] = l3 * detDiv; + result.m[1] = -l1 * detDiv; + result.m[2] = -l2 * detDiv; + result.m[3] = l0 * detDiv; + result.m[4] = det4 * detDiv; + result.m[5] = det5 * detDiv; + return this; + } + multiplyToRef(other, result) { + const l0 = this.m[0]; + const l1 = this.m[1]; + const l2 = this.m[2]; + const l3 = this.m[3]; + const l4 = this.m[4]; + const l5 = this.m[5]; + const r0 = other.m[0]; + const r1 = other.m[1]; + const r2 = other.m[2]; + const r3 = other.m[3]; + const r4 = other.m[4]; + const r5 = other.m[5]; + result.m[0] = l0 * r0 + l1 * r2; + result.m[1] = l0 * r1 + l1 * r3; + result.m[2] = l2 * r0 + l3 * r2; + result.m[3] = l2 * r1 + l3 * r3; + result.m[4] = l4 * r0 + l5 * r2 + r4; + result.m[5] = l4 * r1 + l5 * r3 + r5; + return this; + } + transformCoordinates(x, y, result) { + result.x = x * this.m[0] + y * this.m[2] + this.m[4]; + result.y = x * this.m[1] + y * this.m[3] + this.m[5]; + return this; + } + static Identity() { + return new Matrix2D2(1, 0, 0, 1, 0, 0); + } + static IdentityToRef(result) { + result.m[0] = 1; + result.m[1] = 0; + result.m[2] = 0; + result.m[3] = 1; + result.m[4] = 0; + result.m[5] = 0; + } + static TranslationToRef(x, y, result) { + result.fromValues(1, 0, 0, 1, x, y); + } + static ScalingToRef(x, y, result) { + result.fromValues(x, 0, 0, y, 0, 0); + } + static RotationToRef(angle, result) { + const s = Math.sin(angle); + const c = Math.cos(angle); + result.fromValues(c, s, -s, c, 0, 0); + } + static ComposeToRef(tx, ty, angle, scaleX, scaleY, parentMatrix, result) { + Matrix2D2.TranslationToRef(tx, ty, Matrix2D2._TempPreTranslationMatrix); + Matrix2D2.ScalingToRef(scaleX, scaleY, Matrix2D2._TempScalingMatrix); + Matrix2D2.RotationToRef(angle, Matrix2D2._TempRotationMatrix); + Matrix2D2.TranslationToRef(-tx, -ty, Matrix2D2._TempPostTranslationMatrix); + Matrix2D2._TempPreTranslationMatrix.multiplyToRef(Matrix2D2._TempScalingMatrix, Matrix2D2._TempCompose0); + Matrix2D2._TempCompose0.multiplyToRef(Matrix2D2._TempRotationMatrix, Matrix2D2._TempCompose1); + if (parentMatrix) { + Matrix2D2._TempCompose1.multiplyToRef(Matrix2D2._TempPostTranslationMatrix, Matrix2D2._TempCompose2); + Matrix2D2._TempCompose2.multiplyToRef(parentMatrix, result); + } else { + Matrix2D2._TempCompose1.multiplyToRef(Matrix2D2._TempPostTranslationMatrix, result); + } + } +} + +class MathTools2 { + static Round(value, precision = MathTools2.DefaultRoundingPrecision) { + return Math.round(value * precision) / precision; + } +} +var init_math2D = __esm(() => { + init_math_vector(); + init_math_constants(); + Matrix2D2._TempPreTranslationMatrix = Matrix2D2.Identity(); + Matrix2D2._TempPostTranslationMatrix = Matrix2D2.Identity(); + Matrix2D2._TempRotationMatrix = Matrix2D2.Identity(); + Matrix2D2._TempScalingMatrix = Matrix2D2.Identity(); + Matrix2D2._TempCompose0 = Matrix2D2.Identity(); + Matrix2D2._TempCompose1 = Matrix2D2.Identity(); + Matrix2D2._TempCompose2 = Matrix2D2.Identity(); + MathTools2.DefaultRoundingPrecision = 100; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/control.js +class Control2 { + get isReadOnly() { + return this._isReadOnly; + } + set isReadOnly(value) { + this._isReadOnly = value; + } + get transformedMeasure() { + return this._evaluatedMeasure; + } + set clipChildren(value) { + this._clipChildren = value; + } + get clipChildren() { + return this._clipChildren; + } + set clipContent(value) { + this._clipContent = value; + } + get clipContent() { + return this._clipContent; + } + get shadowOffsetX() { + return this._shadowOffsetX; + } + set shadowOffsetX(value) { + if (this._shadowOffsetX === value) { + return; + } + this._shadowOffsetX = value; + this._markAsDirty(); + } + get shadowOffsetY() { + return this._shadowOffsetY; + } + set shadowOffsetY(value) { + if (this._shadowOffsetY === value) { + return; + } + this._shadowOffsetY = value; + this._markAsDirty(); + } + get shadowBlur() { + return this._shadowBlur; + } + set shadowBlur(value) { + if (this._shadowBlur === value) { + return; + } + this._previousShadowBlur = this._shadowBlur; + this._shadowBlur = value; + this._markAsDirty(); + } + get shadowColor() { + return this._shadowColor; + } + set shadowColor(value) { + if (this._shadowColor === value) { + return; + } + this._shadowColor = value; + this._markAsDirty(); + } + get typeName() { + return this._getTypeName(); + } + getClassName() { + return this._getTypeName(); + } + set accessibilityTag(value) { + this._accessibilityTag = value; + this.onAccessibilityTagChangedObservable.notifyObservers(value); + } + get accessibilityTag() { + return this._accessibilityTag; + } + get host() { + return this._host; + } + get fontOffset() { + return this._fontOffset; + } + set fontOffset(offset) { + this._fontOffset = offset; + } + get alpha() { + return this._alpha; + } + set alpha(value) { + if (this._alpha === value) { + return; + } + this._alphaSet = true; + this._alpha = value; + this._markAsDirty(); + } + get highlightLineWidth() { + return this._highlightLineWidth; + } + set highlightLineWidth(value) { + if (this._highlightLineWidth === value) { + return; + } + this._highlightLineWidth = value; + this._markAsDirty(); + } + get isHighlighted() { + return this._isHighlighted; + } + set isHighlighted(value) { + if (this._isHighlighted === value) { + return; + } + this._isHighlighted = value; + this._markAsDirty(); + } + get highlightColor() { + return this._highlightColor; + } + set highlightColor(value) { + if (this._highlightColor === value) { + return; + } + this._highlightColor = value; + this._markAsDirty(); + } + get scaleX() { + return this._scaleX; + } + set scaleX(value) { + if (this._scaleX === value) { + return; + } + this._scaleX = value; + this._markAsDirty(); + this._markMatrixAsDirty(); + } + get scaleY() { + return this._scaleY; + } + set scaleY(value) { + if (this._scaleY === value) { + return; + } + this._scaleY = value; + this._markAsDirty(); + this._markMatrixAsDirty(); + } + get rotation() { + return this._rotation; + } + set rotation(value) { + if (this._rotation === value) { + return; + } + this._rotation = value; + this._markAsDirty(); + this._markMatrixAsDirty(); + } + get transformCenterY() { + return this._transformCenterY; + } + set transformCenterY(value) { + if (this._transformCenterY === value) { + return; + } + this._transformCenterY = value; + this._markAsDirty(); + this._markMatrixAsDirty(); + } + get transformCenterX() { + return this._transformCenterX; + } + set transformCenterX(value) { + if (this._transformCenterX === value) { + return; + } + this._transformCenterX = value; + this._markAsDirty(); + this._markMatrixAsDirty(); + } + get horizontalAlignment() { + return this._horizontalAlignment; + } + set horizontalAlignment(value) { + if (this._horizontalAlignment === value) { + return; + } + this._horizontalAlignment = value; + this._markAsDirty(); + } + get verticalAlignment() { + return this._verticalAlignment; + } + set verticalAlignment(value) { + if (this._verticalAlignment === value) { + return; + } + this._verticalAlignment = value; + this._markAsDirty(); + } + set fixedRatio(value) { + if (this._fixedRatio === value) { + return; + } + this._fixedRatio = value; + this._markAsDirty(); + } + get fixedRatio() { + return this._fixedRatio; + } + set fixedRatioMasterIsWidth(value) { + if (this._fixedRatioMasterIsWidth === value) { + return; + } + this._fixedRatioMasterIsWidth = value; + this._markAsDirty(); + } + get fixedRatioMasterIsWidth() { + return this._fixedRatioMasterIsWidth; + } + get width() { + return this._width.toString(this._host); + } + set width(value) { + this._fixedRatioMasterIsWidth = true; + if (this._width.toString(this._host) === value) { + return; + } + if (this._width.fromString(value)) { + this._markAsDirty(); + } + } + get widthInPixels() { + return this._width.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set widthInPixels(value) { + if (isNaN(value)) { + return; + } + this._fixedRatioMasterIsWidth = true; + this.width = value + "px"; + } + get height() { + return this._height.toString(this._host); + } + set height(value) { + this._fixedRatioMasterIsWidth = false; + if (this._height.toString(this._host) === value) { + return; + } + if (this._height.fromString(value)) { + this._markAsDirty(); + } + } + get heightInPixels() { + return this._height.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + set heightInPixels(value) { + if (isNaN(value)) { + return; + } + this._fixedRatioMasterIsWidth = false; + this.height = value + "px"; + } + get fontFamily() { + return this._fontFamily; + } + set fontFamily(value) { + if (this._fontFamily === value) { + return; + } + this._fontFamily = value; + this._resetFontCache(); + } + get fontStyle() { + return this._fontStyle; + } + set fontStyle(value) { + if (this._fontStyle === value) { + return; + } + this._fontStyle = value; + this._resetFontCache(); + } + get fontWeight() { + return this._fontWeight; + } + set fontWeight(value) { + if (this._fontWeight === value) { + return; + } + this._fontWeight = value; + this._resetFontCache(); + } + get style() { + return this._style; + } + set style(value) { + if (this._style) { + this._style.onChangedObservable.remove(this._styleObserver); + this._styleObserver = null; + } + this._style = value; + if (this._style) { + this._styleObserver = this._style.onChangedObservable.add(() => { + this._markAsDirty(); + this._resetFontCache(); + }); + } + this._markAsDirty(); + this._resetFontCache(); + } + get _isFontSizeInPercentage() { + return this._fontSize.isPercentage; + } + get fontSizeInPixels() { + const fontSizeToUse = this._style ? this._style._fontSize : this._fontSize; + if (fontSizeToUse.isPixel) { + return fontSizeToUse.getValue(this._host); + } + return fontSizeToUse.getValueInPixel(this._host, this._tempParentMeasure.height || this._cachedParentMeasure.height); + } + set fontSizeInPixels(value) { + if (isNaN(value)) { + return; + } + this.fontSize = value + "px"; + } + get fontSize() { + return this._fontSize.toString(this._host); + } + set fontSize(value) { + if (this._fontSize.toString(this._host) === value) { + return; + } + if (this._fontSize.fromString(value)) { + this._markAsDirty(); + this._resetFontCache(); + } + } + get color() { + return this._color; + } + set color(value) { + if (this._color === value) { + return; + } + this._color = value; + this._markAsDirty(); + } + get gradient() { + return this._gradient; + } + set gradient(value) { + if (this._gradient === value) { + return; + } + this._gradient = value; + this._markAsDirty(); + } + get zIndex() { + return this._zIndex; + } + set zIndex(value) { + if (this.zIndex === value) { + return; + } + this._zIndex = value; + if (this.parent) { + this.parent._reOrderControl(this); + } + } + get notRenderable() { + return this._doNotRender; + } + set notRenderable(value) { + if (this._doNotRender === value) { + return; + } + this._doNotRender = value; + this._markAsDirty(); + } + get isVisible() { + return this._isVisible; + } + set isVisible(value) { + if (this._isVisible === value) { + return; + } + this._isVisible = value; + this._markAsDirty(true); + this.onIsVisibleChangedObservable.notifyObservers(value); + } + get isDirty() { + return this._isDirty; + } + get linkedMesh() { + return this._linkedMesh; + } + get descendantsOnlyPadding() { + return this._descendantsOnlyPadding; + } + set descendantsOnlyPadding(value) { + if (this._descendantsOnlyPadding === value) { + return; + } + this._descendantsOnlyPadding = value; + this._markAsDirty(); + } + get paddingLeft() { + return this._paddingLeft.toString(this._host); + } + set paddingLeft(value) { + if (this._paddingLeft.fromString(value)) { + this._markAsDirty(); + } + } + get paddingLeftInPixels() { + return this._paddingLeft.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set paddingLeftInPixels(value) { + if (isNaN(value)) { + return; + } + this.paddingLeft = value + "px"; + } + get _paddingLeftInPixels() { + if (this._descendantsOnlyPadding) { + return 0; + } + return this.paddingLeftInPixels; + } + get paddingRight() { + return this._paddingRight.toString(this._host); + } + set paddingRight(value) { + if (this._paddingRight.fromString(value)) { + this._markAsDirty(); + } + } + get paddingRightInPixels() { + return this._paddingRight.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set paddingRightInPixels(value) { + if (isNaN(value)) { + return; + } + this.paddingRight = value + "px"; + } + get _paddingRightInPixels() { + if (this._descendantsOnlyPadding) { + return 0; + } + return this.paddingRightInPixels; + } + get paddingTop() { + return this._paddingTop.toString(this._host); + } + set paddingTop(value) { + if (this._paddingTop.fromString(value)) { + this._markAsDirty(); + } + } + get paddingTopInPixels() { + return this._paddingTop.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + set paddingTopInPixels(value) { + if (isNaN(value)) { + return; + } + this.paddingTop = value + "px"; + } + get _paddingTopInPixels() { + if (this._descendantsOnlyPadding) { + return 0; + } + return this.paddingTopInPixels; + } + get paddingBottom() { + return this._paddingBottom.toString(this._host); + } + set paddingBottom(value) { + if (this._paddingBottom.fromString(value)) { + this._markAsDirty(); + } + } + get paddingBottomInPixels() { + return this._paddingBottom.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + set paddingBottomInPixels(value) { + if (isNaN(value)) { + return; + } + this.paddingBottom = value + "px"; + } + get _paddingBottomInPixels() { + if (this._descendantsOnlyPadding) { + return 0; + } + return this.paddingBottomInPixels; + } + get left() { + return this._left.toString(this._host); + } + set left(value) { + if (this._left.fromString(value)) { + this._markAsDirty(); + } + } + get leftInPixels() { + return this._left.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set leftInPixels(value) { + if (isNaN(value)) { + return; + } + this.left = value + "px"; + } + get top() { + return this._top.toString(this._host); + } + set top(value) { + if (this._top.fromString(value)) { + this._markAsDirty(); + } + } + get topInPixels() { + return this._top.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + set topInPixels(value) { + if (isNaN(value)) { + return; + } + this.top = value + "px"; + } + get linkOffsetX() { + return this._linkOffsetX.toString(this._host); + } + set linkOffsetX(value) { + if (this._linkOffsetX.fromString(value)) { + this._markAsDirty(); + } + } + get linkOffsetXInPixels() { + return this._linkOffsetX.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set linkOffsetXInPixels(value) { + if (isNaN(value)) { + return; + } + this.linkOffsetX = value + "px"; + } + get linkOffsetY() { + return this._linkOffsetY.toString(this._host); + } + set linkOffsetY(value) { + if (this._linkOffsetY.fromString(value)) { + this._markAsDirty(); + } + } + get linkOffsetYInPixels() { + return this._linkOffsetY.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + set linkOffsetYInPixels(value) { + if (isNaN(value)) { + return; + } + this.linkOffsetY = value + "px"; + } + get centerX() { + return this._currentMeasure.left + this._currentMeasure.width / 2; + } + get centerY() { + return this._currentMeasure.top + this._currentMeasure.height / 2; + } + get isEnabled() { + return this._isEnabled; + } + set isEnabled(value) { + if (this._isEnabled === value) { + return; + } + this._isEnabled = value; + this._markAsDirty(); + const recursivelyFirePointerOut = (control25) => { + if (!control25.host) { + return; + } + for (const pointer in control25.host._lastControlOver) { + if (control25 === this.host._lastControlOver[pointer]) { + control25._onPointerOut(control25, null, true); + delete control25.host._lastControlOver[pointer]; + } + } + if (control25.children !== undefined) { + control25.children.forEach(recursivelyFirePointerOut); + } + }; + recursivelyFirePointerOut(this); + this.onEnabledStateChangedObservable.notifyObservers(value); + } + get disabledColor() { + return this._disabledColor; + } + set disabledColor(value) { + if (this._disabledColor === value) { + return; + } + this._disabledColor = value; + this._markAsDirty(); + } + get disabledColorItem() { + return this._disabledColorItem; + } + set disabledColorItem(value) { + if (this._disabledColorItem === value) { + return; + } + this._disabledColorItem = value; + this._markAsDirty(); + } + constructor(name314) { + this.name = name314; + this._alpha = 1; + this._alphaSet = false; + this._zIndex = 0; + this._currentMeasure = Measure2.Empty(); + this._tempPaddingMeasure = Measure2.Empty(); + this._fontFamily = ""; + this._fontStyle = ""; + this._fontWeight = ""; + this._fontSize = new ValueAndUnit2(18, ValueAndUnit2.UNITMODE_PIXEL, false); + this._width = new ValueAndUnit2(1, ValueAndUnit2.UNITMODE_PERCENTAGE, false); + this._height = new ValueAndUnit2(1, ValueAndUnit2.UNITMODE_PERCENTAGE, false); + this._color = ""; + this._style = null; + this._horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_CENTER; + this._verticalAlignment = Control2.VERTICAL_ALIGNMENT_CENTER; + this._isDirty = true; + this._wasDirty = false; + this._tempParentMeasure = Measure2.Empty(); + this._prevCurrentMeasureTransformedIntoGlobalSpace = Measure2.Empty(); + this._cachedParentMeasure = Measure2.Empty(); + this._descendantsOnlyPadding = false; + this._paddingLeft = new ValueAndUnit2(0); + this._paddingRight = new ValueAndUnit2(0); + this._paddingTop = new ValueAndUnit2(0); + this._paddingBottom = new ValueAndUnit2(0); + this._left = new ValueAndUnit2(0); + this._top = new ValueAndUnit2(0); + this._scaleX = 1; + this._scaleY = 1; + this._rotation = 0; + this._transformCenterX = 0.5; + this._transformCenterY = 0.5; + this._transformMatrix = Matrix2D2.Identity(); + this._invertTransformMatrix = Matrix2D2.Identity(); + this._transformedPosition = Vector2.Zero(); + this._isMatrixDirty = true; + this._isVisible = true; + this._isHighlighted = false; + this._highlightColor = "#4affff"; + this._highlightLineWidth = 2; + this._fontSet = false; + this._dummyVector2 = Vector2.Zero(); + this._downCount = 0; + this._enterCount = -1; + this._doNotRender = false; + this._downPointerIds = {}; + this._evaluatedMeasure = new Measure2(0, 0, 0, 0); + this._evaluatedParentMeasure = new Measure2(0, 0, 0, 0); + this._isEnabled = true; + this._disabledColor = "#9a9a9a"; + this._disabledColorItem = "#6a6a6a"; + this._isReadOnly = false; + this._gradient = null; + this._rebuildLayout = false; + this.onEnabledStateChangedObservable = new Observable; + this._customData = {}; + this._isClipped = false; + this._automaticSize = false; + this.metadata = null; + this.isHitTestVisible = true; + this.isPointerBlocker = false; + this.isFocusInvisible = false; + this._clipChildren = true; + this._clipContent = true; + this.useBitmapCache = false; + this._shadowOffsetX = 0; + this._shadowOffsetY = 0; + this._shadowBlur = 0; + this._previousShadowBlur = 0; + this._shadowColor = "black"; + this.hoverCursor = ""; + this._linkOffsetX = new ValueAndUnit2(0); + this._linkOffsetY = new ValueAndUnit2(0); + this._accessibilityTag = null; + this.onAccessibilityTagChangedObservable = new Observable; + this.onWheelObservable = new Observable; + this.onPointerMoveObservable = new Observable; + this.onPointerOutObservable = new Observable; + this.onPointerDownObservable = new Observable; + this.onPointerUpObservable = new Observable; + this.onPointerClickObservable = new Observable; + this.onPointerEnterObservable = new Observable; + this.onDirtyObservable = new Observable; + this.onBeforeDrawObservable = new Observable; + this.onAfterDrawObservable = new Observable; + this.onDisposeObservable = new Observable; + this.onIsVisibleChangedObservable = new Observable; + this._fixedRatio = 0; + this._fixedRatioMasterIsWidth = true; + this.animations = null; + this._tmpMeasureA = new Measure2(0, 0, 0, 0); + } + _getTypeName() { + return "Control"; + } + getAscendantOfClass(className2) { + if (!this.parent) { + return null; + } + if (this.parent.getClassName() === className2) { + return this.parent; + } + return this.parent.getAscendantOfClass(className2); + } + markAsDirty(force = false) { + this._markAsDirty(force); + } + markAllAsDirty() { + this._markAllAsDirty(); + } + _resetFontCache() { + this._fontSet = true; + this._markAsDirty(); + } + isAscendant(container9) { + if (!this.parent) { + return false; + } + if (this.parent === container9) { + return true; + } + return this.parent.isAscendant(container9); + } + getLocalCoordinates(globalCoordinates) { + const result = Vector2.Zero(); + this.getLocalCoordinatesToRef(globalCoordinates, result); + return result; + } + getLocalCoordinatesToRef(globalCoordinates, result) { + result.x = globalCoordinates.x - this._currentMeasure.left; + result.y = globalCoordinates.y - this._currentMeasure.top; + return this; + } + getParentLocalCoordinates(globalCoordinates) { + const result = Vector2.Zero(); + result.x = globalCoordinates.x - this._cachedParentMeasure.left; + result.y = globalCoordinates.y - this._cachedParentMeasure.top; + return result; + } + moveToVector3(position3, scene50) { + if (!this._host || this.parent !== this._host._rootContainer) { + Tools.Error("Cannot move a control to a vector3 if the control is not at root level"); + return; + } + this.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + this.verticalAlignment = Control2.VERTICAL_ALIGNMENT_TOP; + const globalViewport = this._host._getGlobalViewport(); + const projectedPosition = Vector3.Project(position3, Matrix.IdentityReadOnly, scene50.getTransformMatrix(), globalViewport); + this._moveToProjectedPosition(projectedPosition); + if (projectedPosition.z < 0 || projectedPosition.z > 1) { + this.notRenderable = true; + return; + } + this.notRenderable = false; + } + getDescendantsToRef(results, directDescendantsOnly = false, predicate) { + } + getDescendants(directDescendantsOnly, predicate) { + const results = []; + this.getDescendantsToRef(results, directDescendantsOnly, predicate); + return results; + } + linkWithMesh(mesh80) { + if (!this._host || this.parent && this.parent !== this._host._rootContainer) { + if (mesh80) { + Tools.Error("Cannot link a control to a mesh if the control is not at root level"); + } + return; + } + const index = this._host._linkedControls.indexOf(this); + if (index !== -1) { + this._linkedMesh = mesh80; + if (!mesh80) { + this._host._linkedControls.splice(index, 1); + } + return; + } else if (!mesh80) { + return; + } + this.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + this.verticalAlignment = Control2.VERTICAL_ALIGNMENT_TOP; + this._linkedMesh = mesh80; + this._host._linkedControls.push(this); + } + setPadding(paddingTop, paddingRight, paddingBottom, paddingLeft) { + const top = paddingTop; + const right = paddingRight !== null && paddingRight !== undefined ? paddingRight : top; + const bottom = paddingBottom !== null && paddingBottom !== undefined ? paddingBottom : top; + const left = paddingLeft !== null && paddingLeft !== undefined ? paddingLeft : right; + this.paddingTop = top; + this.paddingRight = right; + this.paddingBottom = bottom; + this.paddingLeft = left; + } + setPaddingInPixels(paddingTop, paddingRight, paddingBottom, paddingLeft) { + const top = paddingTop; + const right = paddingRight !== null && paddingRight !== undefined ? paddingRight : top; + const bottom = paddingBottom !== null && paddingBottom !== undefined ? paddingBottom : top; + const left = paddingLeft !== null && paddingLeft !== undefined ? paddingLeft : right; + this.paddingTopInPixels = top; + this.paddingRightInPixels = right; + this.paddingBottomInPixels = bottom; + this.paddingLeftInPixels = left; + } + _moveToProjectedPosition(projectedPosition) { + var _a; + const oldLeft = this._left.getValue(this._host); + const oldTop = this._top.getValue(this._host); + const parentMeasure = (_a = this.parent) === null || _a === undefined ? undefined : _a._currentMeasure; + if (parentMeasure) { + this._processMeasures(parentMeasure, this._host.getContext()); + } + let newLeft = projectedPosition.x + this._linkOffsetX.getValue(this._host) - this._currentMeasure.width / 2; + let newTop = projectedPosition.y + this._linkOffsetY.getValue(this._host) - this._currentMeasure.height / 2; + const leftAndTopIgnoreAdaptiveScaling = this._left.ignoreAdaptiveScaling && this._top.ignoreAdaptiveScaling; + if (leftAndTopIgnoreAdaptiveScaling) { + if (Math.abs(newLeft - oldLeft) < 0.5) { + newLeft = oldLeft; + } + if (Math.abs(newTop - oldTop) < 0.5) { + newTop = oldTop; + } + } + if (!leftAndTopIgnoreAdaptiveScaling && oldLeft === newLeft && oldTop === newTop) { + return; + } + this.left = newLeft + "px"; + this.top = newTop + "px"; + this._left.ignoreAdaptiveScaling = true; + this._top.ignoreAdaptiveScaling = true; + this._markAsDirty(); + } + _offsetLeft(offset) { + this._isDirty = true; + this._currentMeasure.left += offset; + } + _offsetTop(offset) { + this._isDirty = true; + this._currentMeasure.top += offset; + } + _markMatrixAsDirty() { + this._isMatrixDirty = true; + this._flagDescendantsAsMatrixDirty(); + } + _flagDescendantsAsMatrixDirty() { + } + _intersectsRect(rect, context) { + this._transform(context); + if (this._evaluatedMeasure.left >= rect.left + rect.width) { + return false; + } + if (this._evaluatedMeasure.top >= rect.top + rect.height) { + return false; + } + if (this._evaluatedMeasure.left + this._evaluatedMeasure.width <= rect.left) { + return false; + } + if (this._evaluatedMeasure.top + this._evaluatedMeasure.height <= rect.top) { + return false; + } + return true; + } + _computeAdditionalOffsetX() { + return 0; + } + _computeAdditionalOffsetY() { + return 0; + } + invalidateRect() { + this._transform(); + if (this.host && this.host.useInvalidateRectOptimization) { + this._currentMeasure.transformToRef(this._transformMatrix, this._tmpMeasureA); + Measure2.CombineToRef(this._tmpMeasureA, this._prevCurrentMeasureTransformedIntoGlobalSpace, this._tmpMeasureA); + const shadowOffsetX = this.shadowOffsetX; + const shadowOffsetY = this.shadowOffsetY; + const shadowBlur = Math.max(this._previousShadowBlur, this.shadowBlur); + const leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0); + const rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0); + const topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0); + const bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0); + const offsetX = this._computeAdditionalOffsetX(); + const offsetY = this._computeAdditionalOffsetY(); + this.host.invalidateRect(Math.floor(this._tmpMeasureA.left + leftShadowOffset - offsetX), Math.floor(this._tmpMeasureA.top + topShadowOffset - offsetY), Math.ceil(this._tmpMeasureA.left + this._tmpMeasureA.width + rightShadowOffset + offsetX), Math.ceil(this._tmpMeasureA.top + this._tmpMeasureA.height + bottomShadowOffset + offsetY)); + } + } + _markAsDirty(force = false) { + if (!this._isVisible && !force) { + return; + } + this._isDirty = true; + this._markMatrixAsDirty(); + if (this._host) { + this._host.markAsDirty(); + } + } + _markAllAsDirty() { + this._markAsDirty(); + if (this._font) { + this._prepareFont(); + } + } + _link(host) { + this._host = host; + if (this._host) { + this.uniqueId = this._host.getScene().getUniqueId(); + } + } + _transform(context) { + if (!this._isMatrixDirty && this._scaleX === 1 && this._scaleY === 1 && this._rotation === 0) { + return; + } + const offsetX = this._currentMeasure.width * this._transformCenterX + this._currentMeasure.left; + const offsetY = this._currentMeasure.height * this._transformCenterY + this._currentMeasure.top; + if (context) { + context.translate(offsetX, offsetY); + context.rotate(this._rotation); + context.scale(this._scaleX, this._scaleY); + context.translate(-offsetX, -offsetY); + } + if (this._isMatrixDirty || this._cachedOffsetX !== offsetX || this._cachedOffsetY !== offsetY) { + this._cachedOffsetX = offsetX; + this._cachedOffsetY = offsetY; + this._isMatrixDirty = false; + this._flagDescendantsAsMatrixDirty(); + Matrix2D2.ComposeToRef(-offsetX, -offsetY, this._rotation, this._scaleX, this._scaleY, this.parent ? this.parent._transformMatrix : null, this._transformMatrix); + this._transformMatrix.invertToRef(this._invertTransformMatrix); + this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure); + } + } + _renderHighlight(context) { + if (!this.isHighlighted) { + return; + } + context.save(); + context.strokeStyle = this._highlightColor; + context.lineWidth = this._highlightLineWidth; + this._renderHighlightSpecific(context); + context.restore(); + } + _renderHighlightSpecific(context) { + context.strokeRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + _getColor(context) { + return this.gradient ? this.gradient.getCanvasGradient(context) : this.color; + } + _applyStates(context) { + if (this._isFontSizeInPercentage) { + this._fontSet = true; + } + if (this._host && this._host.useSmallestIdeal && !this._font) { + this._fontSet = true; + } + if (this._fontSet) { + this._prepareFont(); + this._fontSet = false; + } + if (this._font) { + context.font = this._font; + } + if (this._color || this.gradient) { + context.fillStyle = this._getColor(context); + } + if (Control2.AllowAlphaInheritance) { + context.globalAlpha *= this._alpha; + } else if (this._alphaSet) { + context.globalAlpha = this.parent && !this.parent.renderToIntermediateTexture ? this.parent.alpha * this._alpha : this._alpha; + } + } + _layout(parentMeasure, context) { + if (!this.isDirty && (!this.isVisible || this.notRenderable)) { + return false; + } + if (this._isDirty || !this._cachedParentMeasure.isEqualsTo(parentMeasure)) { + this.host._numLayoutCalls++; + this._currentMeasure.addAndTransformToRef(this._transformMatrix, -this._paddingLeftInPixels | 0, -this._paddingTopInPixels | 0, this._paddingRightInPixels | 0, this._paddingBottomInPixels | 0, this._prevCurrentMeasureTransformedIntoGlobalSpace); + context.save(); + this._applyStates(context); + let rebuildCount = 0; + do { + this._rebuildLayout = false; + this._processMeasures(parentMeasure, context); + rebuildCount++; + } while (this._rebuildLayout && rebuildCount < 3); + if (rebuildCount >= 3) { + Logger.Error(`Layout cycle detected in GUI (Control name=${this.name}, uniqueId=${this.uniqueId})`); + } + context.restore(); + this.invalidateRect(); + this._evaluateClippingState(parentMeasure); + } + this._wasDirty = this._isDirty; + this._isDirty = false; + return true; + } + _processMeasures(parentMeasure, context) { + this._tempPaddingMeasure.copyFrom(parentMeasure); + if (this.parent && this.parent.descendantsOnlyPadding) { + this._tempPaddingMeasure.left += this.parent.paddingLeftInPixels; + this._tempPaddingMeasure.top += this.parent.paddingTopInPixels; + this._tempPaddingMeasure.width -= this.parent.paddingLeftInPixels + this.parent.paddingRightInPixels; + this._tempPaddingMeasure.height -= this.parent.paddingTopInPixels + this.parent.paddingBottomInPixels; + } + this._currentMeasure.copyFrom(this._tempPaddingMeasure); + this._preMeasure(this._tempPaddingMeasure, context); + this._measure(); + this._postMeasure(this._tempPaddingMeasure, context); + this._computeAlignment(this._tempPaddingMeasure, context); + this._currentMeasure.left = this._currentMeasure.left | 0; + this._currentMeasure.top = this._currentMeasure.top | 0; + this._currentMeasure.width = this._currentMeasure.width | 0; + this._currentMeasure.height = this._currentMeasure.height | 0; + this._additionalProcessing(this._tempPaddingMeasure, context); + this._cachedParentMeasure.copyFrom(this._tempPaddingMeasure); + this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure); + if (this.onDirtyObservable.hasObservers()) { + this.onDirtyObservable.notifyObservers(this); + } + } + _evaluateClippingState(parentMeasure) { + this._transform(); + this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure); + if (this.parent && this.parent.clipChildren) { + parentMeasure.transformToRef(this.parent._transformMatrix, this._evaluatedParentMeasure); + if (this._evaluatedMeasure.left > this._evaluatedParentMeasure.left + this._evaluatedParentMeasure.width) { + this._isClipped = true; + return; + } + if (this._evaluatedMeasure.left + this._evaluatedMeasure.width < this._evaluatedParentMeasure.left) { + this._isClipped = true; + return; + } + if (this._evaluatedMeasure.top > this._evaluatedParentMeasure.top + this._evaluatedParentMeasure.height) { + this._isClipped = true; + return; + } + if (this._evaluatedMeasure.top + this._evaluatedMeasure.height < this._evaluatedParentMeasure.top) { + this._isClipped = true; + return; + } + } + this._isClipped = false; + } + _measure() { + if (this._width.isPixel) { + this._currentMeasure.width = this._width.getValue(this._host); + } else { + this._currentMeasure.width *= this._width.getValue(this._host); + } + if (this._height.isPixel) { + this._currentMeasure.height = this._height.getValue(this._host); + } else { + this._currentMeasure.height *= this._height.getValue(this._host); + } + if (this._fixedRatio !== 0) { + if (this._fixedRatioMasterIsWidth) { + this._currentMeasure.height = this._currentMeasure.width * this._fixedRatio; + } else { + this._currentMeasure.width = this._currentMeasure.height * this._fixedRatio; + } + } + } + _computeAlignment(parentMeasure, context) { + const width = this._currentMeasure.width; + const height = this._currentMeasure.height; + const parentWidth = parentMeasure.width; + const parentHeight = parentMeasure.height; + let x = 0; + let y = 0; + switch (this.horizontalAlignment) { + case Control2.HORIZONTAL_ALIGNMENT_LEFT: + x = 0; + break; + case Control2.HORIZONTAL_ALIGNMENT_RIGHT: + x = parentWidth - width; + break; + case Control2.HORIZONTAL_ALIGNMENT_CENTER: + x = (parentWidth - width) / 2; + break; + } + switch (this.verticalAlignment) { + case Control2.VERTICAL_ALIGNMENT_TOP: + y = 0; + break; + case Control2.VERTICAL_ALIGNMENT_BOTTOM: + y = parentHeight - height; + break; + case Control2.VERTICAL_ALIGNMENT_CENTER: + y = (parentHeight - height) / 2; + break; + } + if (!this.descendantsOnlyPadding) { + if (this._paddingLeft.isPixel) { + this._currentMeasure.left += this._paddingLeft.getValue(this._host); + this._currentMeasure.width -= this._paddingLeft.getValue(this._host); + } else { + this._currentMeasure.left += parentWidth * this._paddingLeft.getValue(this._host); + this._currentMeasure.width -= parentWidth * this._paddingLeft.getValue(this._host); + } + if (this._paddingRight.isPixel) { + this._currentMeasure.width -= this._paddingRight.getValue(this._host); + } else { + this._currentMeasure.width -= parentWidth * this._paddingRight.getValue(this._host); + } + if (this._paddingTop.isPixel) { + this._currentMeasure.top += this._paddingTop.getValue(this._host); + this._currentMeasure.height -= this._paddingTop.getValue(this._host); + } else { + this._currentMeasure.top += parentHeight * this._paddingTop.getValue(this._host); + this._currentMeasure.height -= parentHeight * this._paddingTop.getValue(this._host); + } + if (this._paddingBottom.isPixel) { + this._currentMeasure.height -= this._paddingBottom.getValue(this._host); + } else { + this._currentMeasure.height -= parentHeight * this._paddingBottom.getValue(this._host); + } + } + if (this._left.isPixel) { + this._currentMeasure.left += this._left.getValue(this._host); + } else { + this._currentMeasure.left += parentWidth * this._left.getValue(this._host); + } + if (this._top.isPixel) { + this._currentMeasure.top += this._top.getValue(this._host); + } else { + this._currentMeasure.top += parentHeight * this._top.getValue(this._host); + } + this._currentMeasure.left += x; + this._currentMeasure.top += y; + } + _preMeasure(parentMeasure, context) { + } + _postMeasure(parentMeasure, context) { + } + _additionalProcessing(parentMeasure, context) { + } + _clipForChildren(context) { + } + _clip(context, invalidatedRectangle) { + context.beginPath(); + Control2._ClipMeasure.copyFrom(this._currentMeasure); + if (invalidatedRectangle) { + invalidatedRectangle.transformToRef(this._invertTransformMatrix, this._tmpMeasureA); + const intersection = new Measure2(0, 0, 0, 0); + intersection.left = Math.max(this._tmpMeasureA.left, this._currentMeasure.left); + intersection.top = Math.max(this._tmpMeasureA.top, this._currentMeasure.top); + intersection.width = Math.min(this._tmpMeasureA.left + this._tmpMeasureA.width, this._currentMeasure.left + this._currentMeasure.width) - intersection.left; + intersection.height = Math.min(this._tmpMeasureA.top + this._tmpMeasureA.height, this._currentMeasure.top + this._currentMeasure.height) - intersection.top; + Control2._ClipMeasure.copyFrom(intersection); + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + const shadowOffsetX = this.shadowOffsetX; + const shadowOffsetY = this.shadowOffsetY; + const shadowBlur = this.shadowBlur; + const leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0); + const rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0); + const topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0); + const bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0); + context.rect(Control2._ClipMeasure.left + leftShadowOffset, Control2._ClipMeasure.top + topShadowOffset, Control2._ClipMeasure.width + rightShadowOffset - leftShadowOffset, Control2._ClipMeasure.height + bottomShadowOffset - topShadowOffset); + } else { + context.rect(Control2._ClipMeasure.left, Control2._ClipMeasure.top, Control2._ClipMeasure.width, Control2._ClipMeasure.height); + } + context.clip(); + } + _render(context, invalidatedRectangle) { + if (!this.isVisible || this.notRenderable || this._isClipped) { + this._isDirty = false; + return false; + } + this.host._numRenderCalls++; + context.save(); + this._applyStates(context); + this._transform(context); + if (this.clipContent) { + this._clip(context, invalidatedRectangle); + } + if (this.onBeforeDrawObservable.hasObservers()) { + this.onBeforeDrawObservable.notifyObservers(this); + } + if (this.useBitmapCache && !this._wasDirty && this._cacheData) { + context.putImageData(this._cacheData, this._currentMeasure.left, this._currentMeasure.top); + } else { + this._draw(context, invalidatedRectangle); + } + if (this.useBitmapCache && this._wasDirty) { + this._cacheData = context.getImageData(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + this._renderHighlight(context); + if (this.onAfterDrawObservable.hasObservers()) { + this.onAfterDrawObservable.notifyObservers(this); + } + context.restore(); + return true; + } + _draw(context, invalidatedRectangle) { + } + contains(x, y) { + this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition); + x = this._transformedPosition.x; + y = this._transformedPosition.y; + if (x < this._currentMeasure.left) { + return false; + } + if (x > this._currentMeasure.left + this._currentMeasure.width) { + return false; + } + if (y < this._currentMeasure.top) { + return false; + } + if (y > this._currentMeasure.top + this._currentMeasure.height) { + return false; + } + if (this.isPointerBlocker) { + this._host._shouldBlockPointer = true; + } + return true; + } + _processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) { + if (!this._isEnabled) { + return false; + } + if (!this.isHitTestVisible || !this.isVisible || this._doNotRender) { + return false; + } + if (!this.contains(x, y)) { + return false; + } + this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY); + return true; + } + _onPointerMove(target, coordinates, pointerId, pi) { + const canNotify = this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this, pi); + if (canNotify && this.parent != null && !this.isPointerBlocker) { + this.parent._onPointerMove(target, coordinates, pointerId, pi); + } + } + _onPointerEnter(target, pi) { + if (!this._isEnabled) { + return false; + } + if (this._enterCount > 0) { + return false; + } + if (this._enterCount === -1) { + this._enterCount = 0; + } + this._enterCount++; + const canNotify = this.onPointerEnterObservable.notifyObservers(this, -1, target, this, pi); + if (canNotify && this.parent != null && !this.isPointerBlocker) { + this.parent._onPointerEnter(target, pi); + } + return true; + } + _onPointerOut(target, pi, force = false) { + if (!force && (!this._isEnabled || target === this)) { + return; + } + this._enterCount = 0; + let canNotify = true; + if (!target.isAscendant(this)) { + canNotify = this.onPointerOutObservable.notifyObservers(this, -1, target, this, pi); + } + if (canNotify && this.parent != null && !this.isPointerBlocker) { + this.parent._onPointerOut(target, pi, force); + } + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + this._onPointerEnter(this, pi); + if (this._downCount !== 0) { + return false; + } + this._downCount++; + this._downPointerIds[pointerId] = true; + const canNotify = this.onPointerDownObservable.notifyObservers(new Vector2WithInfo2(coordinates, buttonIndex), -1, target, this, pi); + if (canNotify && this.parent != null && !this.isPointerBlocker) { + this.parent._onPointerDown(target, coordinates, pointerId, buttonIndex, pi); + } + if (pi && this.uniqueId !== this._host.rootContainer.uniqueId) { + this._host._capturedPointerIds.add(pi.event.pointerId); + } + return true; + } + _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi) { + if (!this._isEnabled) { + return; + } + this._downCount = 0; + delete this._downPointerIds[pointerId]; + let canNotifyClick = notifyClick; + if (notifyClick && (this._enterCount > 0 || this._enterCount === -1)) { + canNotifyClick = this.onPointerClickObservable.notifyObservers(new Vector2WithInfo2(coordinates, buttonIndex), -1, target, this, pi); + } + const canNotify = this.onPointerUpObservable.notifyObservers(new Vector2WithInfo2(coordinates, buttonIndex), -1, target, this, pi); + if (canNotify && this.parent != null && !this.isPointerBlocker) { + this.parent._onPointerUp(target, coordinates, pointerId, buttonIndex, canNotifyClick, pi); + } + if (pi && this.uniqueId !== this._host.rootContainer.uniqueId) { + this._host._capturedPointerIds.delete(pi.event.pointerId); + } + } + _forcePointerUp(pointerId = null) { + if (pointerId !== null) { + this._onPointerUp(this, Vector2.Zero(), pointerId, 0, true); + } else { + for (const key in this._downPointerIds) { + this._onPointerUp(this, Vector2.Zero(), +key, 0, true); + } + } + } + _onWheelScroll(deltaX, deltaY) { + if (!this._isEnabled) { + return; + } + const canNotify = this.onWheelObservable.notifyObservers(new Vector2(deltaX, deltaY)); + if (canNotify && this.parent != null) { + this.parent._onWheelScroll(deltaX, deltaY); + } + } + _onCanvasBlur() { + } + _processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY) { + if (!this._isEnabled) { + return false; + } + this._dummyVector2.copyFromFloats(x, y); + if (type === PointerEventTypes.POINTERMOVE) { + this._onPointerMove(this, this._dummyVector2, pointerId, pi); + const previousControlOver = this._host._lastControlOver[pointerId]; + if (previousControlOver && previousControlOver !== this) { + previousControlOver._onPointerOut(this, pi); + } + if (previousControlOver !== this) { + this._onPointerEnter(this, pi); + } + this._host._lastControlOver[pointerId] = this; + return true; + } + if (type === PointerEventTypes.POINTERDOWN) { + this._onPointerDown(this, this._dummyVector2, pointerId, buttonIndex, pi); + this._host._registerLastControlDown(this, pointerId); + this._host._lastPickedControl = this; + return true; + } + if (type === PointerEventTypes.POINTERUP) { + if (this._host._lastControlDown[pointerId]) { + this._host._lastControlDown[pointerId]._onPointerUp(this, this._dummyVector2, pointerId, buttonIndex, true, pi); + } + delete this._host._lastControlDown[pointerId]; + return true; + } + if (type === PointerEventTypes.POINTERWHEEL) { + if (this._host._lastControlOver[pointerId]) { + this._host._lastControlOver[pointerId]._onWheelScroll(deltaX, deltaY); + return true; + } + } + return false; + } + _getStyleProperty(propName, defaultValue) { + var _a; + const prop = (_a = this._style && this._style[propName]) !== null && _a !== undefined ? _a : this[propName]; + if (!prop && this.parent) { + return this.parent._getStyleProperty(propName, defaultValue); + } else if (!this.parent) { + return defaultValue; + } else { + return prop; + } + } + _prepareFont() { + if (!this._font && !this._fontSet) { + return; + } + this._font = this._getStyleProperty("fontStyle", "") + " " + this._getStyleProperty("fontWeight", "") + " " + this.fontSizeInPixels + "px " + this._getStyleProperty("fontFamily", "Arial"); + this._fontOffset = Control2._GetFontOffset(this._font); + this.getDescendants().forEach((child) => child._markAllAsDirty()); + } + isDimensionFullyDefined(dim) { + return this.getDimension(dim).isPixel; + } + getDimension(dim) { + if (dim === "width") { + return this._width; + } else { + return this._height; + } + } + clone(host) { + const serialization4 = {}; + this.serialize(serialization4); + const controlType = Tools.Instantiate("BABYLON.GUI." + serialization4.className); + const cloned = new controlType; + cloned.parse(serialization4, host); + return cloned; + } + parse(serializedObject, host) { + SerializationHelper.Parse(() => this, serializedObject, null); + this.name = serializedObject.name; + this._parseFromContent(serializedObject, host !== null && host !== undefined ? host : this._host); + return this; + } + serialize(serializationObject) { + SerializationHelper.Serialize(this, serializationObject); + serializationObject.name = this.name; + serializationObject.className = this.getClassName(); + this._prepareFont(); + if (this._font) { + serializationObject.fontFamily = this._fontFamily; + serializationObject.fontSize = this.fontSize; + serializationObject.fontWeight = this.fontWeight; + serializationObject.fontStyle = this.fontStyle; + } + if (this._gradient) { + serializationObject.gradient = {}; + this._gradient.serialize(serializationObject.gradient); + } + SerializationHelper.AppendSerializedAnimations(this, serializationObject); + } + _parseFromContent(serializedObject, host) { + var _a, _b; + if (serializedObject.fontFamily) { + this.fontFamily = serializedObject.fontFamily; + } + if (serializedObject.fontSize) { + this.fontSize = serializedObject.fontSize; + } + if (serializedObject.fontWeight) { + this.fontWeight = serializedObject.fontWeight; + } + if (serializedObject.fontStyle) { + this.fontStyle = serializedObject.fontStyle; + } + if (serializedObject.gradient) { + const className2 = Tools.Instantiate("BABYLON.GUI." + serializedObject.gradient.className); + this._gradient = new className2; + (_a = this._gradient) === null || _a === undefined || _a.parse(serializedObject.gradient); + } + if (serializedObject.animations) { + this.animations = []; + for (let animationIndex = 0;animationIndex < serializedObject.animations.length; animationIndex++) { + const parsedAnimation = serializedObject.animations[animationIndex]; + const internalClass = GetClass("BABYLON.Animation"); + if (internalClass) { + this.animations.push(internalClass.Parse(parsedAnimation)); + } + } + if (serializedObject.autoAnimate && this._host && this._host.getScene()) { + this._host.getScene().beginAnimation(this, serializedObject.autoAnimateFrom, serializedObject.autoAnimateTo, serializedObject.autoAnimateLoop, serializedObject.autoAnimateSpeed || 1); + } + } + this.fixedRatioMasterIsWidth = (_b = serializedObject.fixedRatioMasterIsWidth) !== null && _b !== undefined ? _b : this.fixedRatioMasterIsWidth; + } + dispose() { + this.onDirtyObservable.clear(); + this.onBeforeDrawObservable.clear(); + this.onAfterDrawObservable.clear(); + this.onPointerDownObservable.clear(); + this.onPointerEnterObservable.clear(); + this.onPointerMoveObservable.clear(); + this.onPointerOutObservable.clear(); + this.onPointerUpObservable.clear(); + this.onPointerClickObservable.clear(); + this.onWheelObservable.clear(); + if (this._styleObserver && this._style) { + this._style.onChangedObservable.remove(this._styleObserver); + this._styleObserver = null; + } + if (this.parent) { + this.parent.removeControl(this); + this.parent = null; + } + if (this._host) { + const index = this._host._linkedControls.indexOf(this); + if (index > -1) { + this.linkWithMesh(null); + } + } + this.onDisposeObservable.notifyObservers(this); + this.onDisposeObservable.clear(); + } + static get HORIZONTAL_ALIGNMENT_LEFT() { + return Control2._HORIZONTAL_ALIGNMENT_LEFT; + } + static get HORIZONTAL_ALIGNMENT_RIGHT() { + return Control2._HORIZONTAL_ALIGNMENT_RIGHT; + } + static get HORIZONTAL_ALIGNMENT_CENTER() { + return Control2._HORIZONTAL_ALIGNMENT_CENTER; + } + static get VERTICAL_ALIGNMENT_TOP() { + return Control2._VERTICAL_ALIGNMENT_TOP; + } + static get VERTICAL_ALIGNMENT_BOTTOM() { + return Control2._VERTICAL_ALIGNMENT_BOTTOM; + } + static get VERTICAL_ALIGNMENT_CENTER() { + return Control2._VERTICAL_ALIGNMENT_CENTER; + } + static _GetFontOffset(font) { + if (Control2._FontHeightSizes[font]) { + return Control2._FontHeightSizes[font]; + } + const engine47 = EngineStore.LastCreatedEngine; + if (!engine47) { + throw new Error("Invalid engine. Unable to create a canvas."); + } + const result = engine47.getFontOffset(font); + Control2._FontHeightSizes[font] = result; + return result; + } + static Parse(serializedObject, host) { + const controlType = Tools.Instantiate("BABYLON.GUI." + serializedObject.className); + const control25 = SerializationHelper.Parse(() => new controlType, serializedObject, null); + control25.name = serializedObject.name; + control25._parseFromContent(serializedObject, host); + return control25; + } + static drawEllipse(x, y, width, height, context) { + context.translate(x, y); + context.scale(width, height); + context.beginPath(); + context.arc(0, 0, 1, 0, 2 * Math.PI); + context.closePath(); + context.scale(1 / width, 1 / height); + context.translate(-x, -y); + } + isReady() { + return true; + } +} +var init_control = __esm(() => { + init_tslib_es62(); + init_observable(); + init_math_vector(); + init_pointerEvents(); + init_logger(); + init_tools(); + init_valueAndUnit(); + init_measure(); + init_math2D(); + init_typeStore(); + init_decorators(); + init_engineStore(); + Control2.AllowAlphaInheritance = false; + Control2._ClipMeasure = new Measure2(0, 0, 0, 0); + Control2._HORIZONTAL_ALIGNMENT_LEFT = 0; + Control2._HORIZONTAL_ALIGNMENT_RIGHT = 1; + Control2._HORIZONTAL_ALIGNMENT_CENTER = 2; + Control2._VERTICAL_ALIGNMENT_TOP = 0; + Control2._VERTICAL_ALIGNMENT_BOTTOM = 1; + Control2._VERTICAL_ALIGNMENT_CENTER = 2; + Control2._FontHeightSizes = {}; + Control2.AddHeader = () => { + }; + __decorate2([ + serialize() + ], Control2.prototype, "metadata", undefined); + __decorate2([ + serialize() + ], Control2.prototype, "isHitTestVisible", undefined); + __decorate2([ + serialize() + ], Control2.prototype, "isPointerBlocker", undefined); + __decorate2([ + serialize() + ], Control2.prototype, "isFocusInvisible", undefined); + __decorate2([ + serialize() + ], Control2.prototype, "clipChildren", null); + __decorate2([ + serialize() + ], Control2.prototype, "clipContent", null); + __decorate2([ + serialize() + ], Control2.prototype, "useBitmapCache", undefined); + __decorate2([ + serialize() + ], Control2.prototype, "shadowOffsetX", null); + __decorate2([ + serialize() + ], Control2.prototype, "shadowOffsetY", null); + __decorate2([ + serialize() + ], Control2.prototype, "shadowBlur", null); + __decorate2([ + serialize() + ], Control2.prototype, "shadowColor", null); + __decorate2([ + serialize() + ], Control2.prototype, "hoverCursor", undefined); + __decorate2([ + serialize() + ], Control2.prototype, "fontOffset", null); + __decorate2([ + serialize() + ], Control2.prototype, "alpha", null); + __decorate2([ + serialize() + ], Control2.prototype, "scaleX", null); + __decorate2([ + serialize() + ], Control2.prototype, "scaleY", null); + __decorate2([ + serialize() + ], Control2.prototype, "rotation", null); + __decorate2([ + serialize() + ], Control2.prototype, "transformCenterY", null); + __decorate2([ + serialize() + ], Control2.prototype, "transformCenterX", null); + __decorate2([ + serialize() + ], Control2.prototype, "horizontalAlignment", null); + __decorate2([ + serialize() + ], Control2.prototype, "verticalAlignment", null); + __decorate2([ + serialize() + ], Control2.prototype, "fixedRatio", null); + __decorate2([ + serialize() + ], Control2.prototype, "fixedRatioMasterIsWidth", null); + __decorate2([ + serialize() + ], Control2.prototype, "width", null); + __decorate2([ + serialize() + ], Control2.prototype, "height", null); + __decorate2([ + serialize() + ], Control2.prototype, "style", null); + __decorate2([ + serialize() + ], Control2.prototype, "color", null); + __decorate2([ + serialize() + ], Control2.prototype, "gradient", null); + __decorate2([ + serialize() + ], Control2.prototype, "zIndex", null); + __decorate2([ + serialize() + ], Control2.prototype, "notRenderable", null); + __decorate2([ + serialize() + ], Control2.prototype, "isVisible", null); + __decorate2([ + serialize() + ], Control2.prototype, "descendantsOnlyPadding", null); + __decorate2([ + serialize() + ], Control2.prototype, "paddingLeft", null); + __decorate2([ + serialize() + ], Control2.prototype, "paddingRight", null); + __decorate2([ + serialize() + ], Control2.prototype, "paddingTop", null); + __decorate2([ + serialize() + ], Control2.prototype, "paddingBottom", null); + __decorate2([ + serialize() + ], Control2.prototype, "left", null); + __decorate2([ + serialize() + ], Control2.prototype, "top", null); + __decorate2([ + serialize() + ], Control2.prototype, "linkOffsetX", null); + __decorate2([ + serialize() + ], Control2.prototype, "linkOffsetY", null); + __decorate2([ + serialize() + ], Control2.prototype, "isEnabled", null); + __decorate2([ + serialize() + ], Control2.prototype, "disabledColor", null); + __decorate2([ + serialize() + ], Control2.prototype, "disabledColorItem", null); + __decorate2([ + serialize() + ], Control2.prototype, "overlapGroup", undefined); + __decorate2([ + serialize() + ], Control2.prototype, "overlapDeltaMultiplier", undefined); + RegisterClass("BABYLON.GUI.Control", Control2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/container.js +class Container2 extends Control2 { + get renderToIntermediateTexture() { + return this._renderToIntermediateTexture; + } + set renderToIntermediateTexture(value) { + if (this._renderToIntermediateTexture === value) { + return; + } + this._renderToIntermediateTexture = value; + this._markAsDirty(); + } + get adaptHeightToChildren() { + return this._adaptHeightToChildren; + } + set adaptHeightToChildren(value) { + if (this._adaptHeightToChildren === value) { + return; + } + this._adaptHeightToChildren = value; + if (value) { + this.height = "100%"; + } + this._markAsDirty(); + } + get adaptWidthToChildren() { + return this._adaptWidthToChildren; + } + set adaptWidthToChildren(value) { + if (this._adaptWidthToChildren === value) { + return; + } + this._adaptWidthToChildren = value; + if (value) { + this.width = "100%"; + } + this._markAsDirty(); + } + get background() { + return this._background; + } + set background(value) { + if (this._background === value) { + return; + } + this._background = value; + this._markAsDirty(); + } + get backgroundGradient() { + return this._backgroundGradient; + } + set backgroundGradient(value) { + if (this._backgroundGradient === value) { + return; + } + this._backgroundGradient = value; + this._markAsDirty(); + } + get children() { + return this._children; + } + get isReadOnly() { + return this._isReadOnly; + } + set isReadOnly(value) { + this._isReadOnly = value; + for (const child of this._children) { + child.isReadOnly = value; + } + } + constructor(name314) { + super(name314); + this.name = name314; + this._children = new Array; + this._measureForChildren = Measure2.Empty(); + this._background = ""; + this._backgroundGradient = null; + this._adaptWidthToChildren = false; + this._adaptHeightToChildren = false; + this._renderToIntermediateTexture = false; + this._intermediateTexture = null; + this.logLayoutCycleErrors = false; + this.maxLayoutCycle = 3; + this.onControlAddedObservable = new Observable; + this.onControlRemovedObservable = new Observable; + this._inverseTransformMatrix = Matrix2D2.Identity(); + this._inverseMeasure = new Measure2(0, 0, 0, 0); + } + _getTypeName() { + return "Container"; + } + _flagDescendantsAsMatrixDirty() { + for (const child of this.children) { + child._isClipped = false; + child._markMatrixAsDirty(); + } + } + getChildByName(name314) { + for (const child of this.children) { + if (child.name === name314) { + return child; + } + } + return null; + } + getChildByType(name314, type) { + for (const child of this.children) { + if (child.typeName === type) { + return child; + } + } + return null; + } + containsControl(control26) { + return this.children.indexOf(control26) !== -1; + } + addControl(control26) { + if (!control26) { + return this; + } + const index = this._children.indexOf(control26); + if (index !== -1) { + return this; + } + control26._link(this._host); + control26._markAllAsDirty(); + this._reOrderControl(control26); + this._markAsDirty(); + this.onControlAddedObservable.notifyObservers(control26); + return this; + } + clearControls() { + const children = this.children.slice(); + for (const child of children) { + this.removeControl(child); + } + return this; + } + removeControl(control26) { + const index = this._children.indexOf(control26); + if (index !== -1) { + this._children.splice(index, 1); + control26.parent = null; + } + control26.linkWithMesh(null); + if (this._host) { + this._host._cleanControlAfterRemoval(control26); + } + this._markAsDirty(); + this.onControlRemovedObservable.notifyObservers(control26); + return this; + } + _reOrderControl(control26) { + const linkedMesh = control26.linkedMesh; + this.removeControl(control26); + let wasAdded = false; + for (let index = 0;index < this._children.length; index++) { + if (this._children[index].zIndex > control26.zIndex) { + this._children.splice(index, 0, control26); + wasAdded = true; + break; + } + } + if (!wasAdded) { + this._children.push(control26); + } + control26.parent = this; + if (linkedMesh) { + control26.linkWithMesh(linkedMesh); + } + this._markAsDirty(); + } + _offsetLeft(offset) { + super._offsetLeft(offset); + for (const child of this._children) { + child._offsetLeft(offset); + } + } + _offsetTop(offset) { + super._offsetTop(offset); + for (const child of this._children) { + child._offsetTop(offset); + } + } + _markAllAsDirty() { + super._markAllAsDirty(); + for (let index = 0;index < this._children.length; index++) { + this._children[index]._markAllAsDirty(); + } + } + _getBackgroundColor(context) { + return this._backgroundGradient ? this._backgroundGradient.getCanvasGradient(context) : this._background; + } + _localDraw(context) { + if (this._background || this._backgroundGradient) { + context.save(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + context.fillStyle = this._getBackgroundColor(context); + context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + context.restore(); + } + } + _link(host) { + super._link(host); + for (const child of this._children) { + child._link(host); + } + } + _beforeLayout() { + } + _processMeasures(parentMeasure, context) { + if (this._isDirty || !this._cachedParentMeasure.isEqualsTo(parentMeasure)) { + super._processMeasures(parentMeasure, context); + this._evaluateClippingState(parentMeasure); + if (this._renderToIntermediateTexture) { + if (this._intermediateTexture && this._host.getScene() != this._intermediateTexture.getScene()) { + this._intermediateTexture.dispose(); + this._intermediateTexture = null; + } + if (!this._intermediateTexture) { + this._intermediateTexture = new DynamicTexture("", { width: this._currentMeasure.width, height: this._currentMeasure.height }, this._host.getScene(), false, Texture.NEAREST_SAMPLINGMODE, Constants.TEXTUREFORMAT_RGBA, false); + this._intermediateTexture.hasAlpha = true; + } else { + this._intermediateTexture.scaleTo(this._currentMeasure.width, this._currentMeasure.height); + } + } + } + } + _layout(parentMeasure, context) { + var _a, _b; + if (!this.isDirty && (!this.isVisible || this.notRenderable)) { + return false; + } + this.host._numLayoutCalls++; + if (this._isDirty) { + this._currentMeasure.transformToRef(this._transformMatrix, this._prevCurrentMeasureTransformedIntoGlobalSpace); + } + let rebuildCount = 0; + context.save(); + this._applyStates(context); + this._beforeLayout(); + do { + let computedWidth = -1; + let computedHeight = -1; + this._rebuildLayout = false; + this._processMeasures(parentMeasure, context); + if (!this._isClipped) { + for (const child of this._children) { + child._tempParentMeasure.copyFrom(this._measureForChildren); + if (child._layout(this._measureForChildren, context)) { + if (child.isVisible && !child.notRenderable) { + if (this.adaptWidthToChildren && child._width.isPixel) { + computedWidth = Math.max(computedWidth, child._currentMeasure.width + child._paddingLeftInPixels + child._paddingRightInPixels); + } + if (this.adaptHeightToChildren && child._height.isPixel) { + computedHeight = Math.max(computedHeight, child._currentMeasure.height + child._paddingTopInPixels + child._paddingBottomInPixels); + } + } + } + } + if (this.adaptWidthToChildren && computedWidth >= 0) { + computedWidth += this.paddingLeftInPixels + this.paddingRightInPixels; + if (this.width !== computedWidth + "px") { + (_a = this.parent) === null || _a === undefined || _a._markAsDirty(); + this.width = computedWidth + "px"; + this._width.ignoreAdaptiveScaling = true; + this._rebuildLayout = true; + } + } + if (this.adaptHeightToChildren && computedHeight >= 0) { + computedHeight += this.paddingTopInPixels + this.paddingBottomInPixels; + if (this.height !== computedHeight + "px") { + (_b = this.parent) === null || _b === undefined || _b._markAsDirty(); + this.height = computedHeight + "px"; + this._height.ignoreAdaptiveScaling = true; + this._rebuildLayout = true; + } + } + this._postMeasure(); + } + rebuildCount++; + } while (this._rebuildLayout && rebuildCount < this.maxLayoutCycle); + if (rebuildCount >= 3 && this.logLayoutCycleErrors) { + Logger.Error(`Layout cycle detected in GUI (Container name=${this.name}, uniqueId=${this.uniqueId})`); + } + context.restore(); + if (this._isDirty) { + this.invalidateRect(); + this._isDirty = false; + } + return true; + } + _postMeasure() { + } + _draw(context, invalidatedRectangle) { + const renderToIntermediateTextureThisDraw = this._renderToIntermediateTexture && this._intermediateTexture; + const contextToDrawTo = renderToIntermediateTextureThisDraw ? this._intermediateTexture.getContext() : context; + if (renderToIntermediateTextureThisDraw) { + contextToDrawTo.save(); + contextToDrawTo.translate(-this._currentMeasure.left, -this._currentMeasure.top); + if (invalidatedRectangle) { + this._transformMatrix.invertToRef(this._inverseTransformMatrix); + invalidatedRectangle.transformToRef(this._inverseTransformMatrix, this._inverseMeasure); + contextToDrawTo.clearRect(this._inverseMeasure.left, this._inverseMeasure.top, this._inverseMeasure.width, this._inverseMeasure.height); + } else { + contextToDrawTo.clearRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + } + this._localDraw(contextToDrawTo); + context.save(); + if (this.clipChildren) { + this._clipForChildren(contextToDrawTo); + } + for (const child of this._children) { + if (invalidatedRectangle) { + if (!child._intersectsRect(invalidatedRectangle)) { + continue; + } + } + child._render(contextToDrawTo, invalidatedRectangle); + } + if (renderToIntermediateTextureThisDraw) { + contextToDrawTo.restore(); + context.save(); + context.globalAlpha = this.alpha; + context.drawImage(contextToDrawTo.canvas, this._currentMeasure.left, this._currentMeasure.top); + context.restore(); + } + context.restore(); + } + getDescendantsToRef(results, directDescendantsOnly = false, predicate) { + if (!this.children) { + return; + } + for (let index = 0;index < this.children.length; index++) { + const item = this.children[index]; + if (!predicate || predicate(item)) { + results.push(item); + } + if (!directDescendantsOnly) { + item.getDescendantsToRef(results, false, predicate); + } + } + } + _processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) { + if (!this._isEnabled || !this.isVisible || this.notRenderable) { + return false; + } + const contains = super.contains(x, y); + if (!contains && this.clipChildren) { + return false; + } + for (let index = this._children.length - 1;index >= 0; index--) { + const child = this._children[index]; + if (child._processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY)) { + if (child.hoverCursor) { + this._host._changeCursor(child.hoverCursor); + } + return true; + } + } + if (!contains) { + return false; + } + if (!this.isHitTestVisible) { + return false; + } + return this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY); + } + _additionalProcessing(parentMeasure, context) { + super._additionalProcessing(parentMeasure, context); + this._measureForChildren.copyFrom(this._currentMeasure); + } + _getAdaptDimTo(dim) { + if (dim === "width") { + return this.adaptWidthToChildren; + } else { + return this.adaptHeightToChildren; + } + } + isDimensionFullyDefined(dim) { + if (this._getAdaptDimTo(dim)) { + for (const child of this.children) { + if (!child.isDimensionFullyDefined(dim)) { + return false; + } + } + return true; + } + return super.isDimensionFullyDefined(dim); + } + serialize(serializationObject) { + super.serialize(serializationObject); + if (this.backgroundGradient) { + serializationObject.backgroundGradient = {}; + this.backgroundGradient.serialize(serializationObject.backgroundGradient); + } + if (!this.children.length) { + return; + } + serializationObject.children = []; + for (const child of this.children) { + const childSerializationObject = {}; + child.serialize(childSerializationObject); + serializationObject.children.push(childSerializationObject); + } + } + dispose() { + var _a; + super.dispose(); + for (let index = this.children.length - 1;index >= 0; index--) { + this.children[index].dispose(); + } + (_a = this._intermediateTexture) === null || _a === undefined || _a.dispose(); + } + _parseFromContent(serializedObject, host) { + var _a; + super._parseFromContent(serializedObject, host); + this._link(host); + if (serializedObject.backgroundGradient) { + const className2 = Tools.Instantiate("BABYLON.GUI." + serializedObject.backgroundGradient.className); + this._backgroundGradient = new className2; + (_a = this._backgroundGradient) === null || _a === undefined || _a.parse(serializedObject.backgroundGradient); + } + if (!serializedObject.children) { + return; + } + for (const childData of serializedObject.children) { + this.addControl(Control2.Parse(childData, host)); + } + } + isReady() { + for (const child of this.children) { + if (!child.isReady()) { + return false; + } + } + return true; + } +} +var init_container = __esm(() => { + init_tslib_es62(); + init_logger(); + init_control(); + init_measure(); + init_typeStore(); + init_decorators(); + init_dynamicTexture(); + init_texture(); + init_constants(); + init_observable(); + init_tools(); + init_math2D(); + __decorate2([ + serialize() + ], Container2.prototype, "renderToIntermediateTexture", null); + __decorate2([ + serialize() + ], Container2.prototype, "maxLayoutCycle", undefined); + __decorate2([ + serialize() + ], Container2.prototype, "adaptHeightToChildren", null); + __decorate2([ + serialize() + ], Container2.prototype, "adaptWidthToChildren", null); + __decorate2([ + serialize() + ], Container2.prototype, "background", null); + __decorate2([ + serialize() + ], Container2.prototype, "backgroundGradient", null); + RegisterClass("BABYLON.GUI.Container", Container2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/rectangle.js +class Rectangle2 extends Container2 { + get thickness() { + return this._thickness; + } + set thickness(value) { + if (this._thickness === value) { + return; + } + this._thickness = value; + this._markAsDirty(); + } + get cornerRadius() { + return this._cornerRadius[0]; + } + set cornerRadius(value) { + if (value < 0) { + value = 0; + } + if (this._cornerRadius[0] === value && this._cornerRadius[1] === value && this._cornerRadius[2] === value && this._cornerRadius[3] === value) { + return; + } + this._cornerRadius[0] = this._cornerRadius[1] = this._cornerRadius[2] = this._cornerRadius[3] = value; + this._markAsDirty(); + } + get cornerRadiusX() { + return this._cornerRadius[0]; + } + set cornerRadiusX(value) { + if (this._cornerRadius[0] === value) { + return; + } + this._cornerRadius[0] = value; + } + get cornerRadiusY() { + return this._cornerRadius[1]; + } + set cornerRadiusY(value) { + if (this._cornerRadius[1] === value) { + return; + } + this._cornerRadius[1] = value; + } + get cornerRadiusZ() { + return this._cornerRadius[2]; + } + set cornerRadiusZ(value) { + if (this._cornerRadius[2] === value) { + return; + } + this._cornerRadius[2] = value; + } + get cornerRadiusW() { + return this._cornerRadius[3]; + } + set cornerRadiusW(value) { + if (this._cornerRadius[3] === value) { + return; + } + this._cornerRadius[3] = value; + } + constructor(name314) { + super(name314); + this.name = name314; + this._thickness = 1; + this._cornerRadius = [0, 0, 0, 0]; + this._cachedRadius = [0, 0, 0, 0]; + } + _getTypeName() { + return "Rectangle"; + } + _computeAdditionalOffsetX() { + let additionalWidth = 0; + if (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) { + additionalWidth += 1; + } + if (this.thickness) { + additionalWidth += this.thickness / 2; + } + return additionalWidth; + } + _computeAdditionalOffsetY() { + let additionalHeight = 0; + if (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) { + additionalHeight += 1; + } + if (this.thickness) { + additionalHeight += this.thickness / 2; + } + return additionalHeight; + } + _getRectangleFill(context) { + return this._getBackgroundColor(context); + } + _localDraw(context) { + context.save(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + if (this._background || this._backgroundGradient) { + context.fillStyle = this._getRectangleFill(context); + if (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) { + this._drawRoundedRect(context, this._thickness / 2); + context.fill(); + } else { + context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + } + if (this._thickness) { + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + if (this.color || this.gradient) { + context.strokeStyle = this.gradient ? this.gradient.getCanvasGradient(context) : this.color; + } + context.lineWidth = this._thickness; + if (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) { + this._drawRoundedRect(context, this._thickness / 2); + context.stroke(); + } else { + context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, this._currentMeasure.width - this._thickness, this._currentMeasure.height - this._thickness); + } + } + context.restore(); + } + _additionalProcessing(parentMeasure, context) { + super._additionalProcessing(parentMeasure, context); + this._measureForChildren.width -= 2 * this._thickness; + this._measureForChildren.height -= 2 * this._thickness; + this._measureForChildren.left += this._thickness; + this._measureForChildren.top += this._thickness; + } + _drawRoundedRect(context, offset = 0) { + const x = this._currentMeasure.left + offset; + const y = this._currentMeasure.top + offset; + const width = this._currentMeasure.width - offset * 2; + const height = this._currentMeasure.height - offset * 2; + for (let index = 0;index < this._cornerRadius.length; index++) { + this._cachedRadius[index] = Math.abs(Math.min(height / 2, Math.min(width / 2, this._cornerRadius[index]))); + } + context.beginPath(); + context.moveTo(x + this._cachedRadius[0], y); + context.lineTo(x + width - this._cachedRadius[1], y); + context.arc(x + width - this._cachedRadius[1], y + this._cachedRadius[1], this._cachedRadius[1], 3 * Math.PI / 2, Math.PI * 2); + context.lineTo(x + width, y + height - this._cachedRadius[2]); + context.arc(x + width - this._cachedRadius[2], y + height - this._cachedRadius[2], this._cachedRadius[2], 0, Math.PI / 2); + context.lineTo(x + this._cachedRadius[3], y + height); + context.arc(x + this._cachedRadius[3], y + height - this._cachedRadius[3], this._cachedRadius[3], Math.PI / 2, Math.PI); + context.lineTo(x, y + this._cachedRadius[0]); + context.arc(x + this._cachedRadius[0], y + this._cachedRadius[0], this._cachedRadius[0], Math.PI, 3 * Math.PI / 2); + context.closePath(); + } + _clipForChildren(context) { + if (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) { + this._drawRoundedRect(context, this._thickness); + context.clip(); + } + } +} +var init_rectangle = __esm(() => { + init_tslib_es62(); + init_container(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], Rectangle2.prototype, "thickness", null); + __decorate2([ + serialize() + ], Rectangle2.prototype, "cornerRadius", null); + __decorate2([ + serialize() + ], Rectangle2.prototype, "cornerRadiusX", null); + __decorate2([ + serialize() + ], Rectangle2.prototype, "cornerRadiusY", null); + __decorate2([ + serialize() + ], Rectangle2.prototype, "cornerRadiusZ", null); + __decorate2([ + serialize() + ], Rectangle2.prototype, "cornerRadiusW", null); + RegisterClass("BABYLON.GUI.Rectangle", Rectangle2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/textBlock.js +class TextBlock2 extends Control2 { + get lines() { + return this._lines; + } + get resizeToFit() { + return this._resizeToFit; + } + set resizeToFit(value) { + if (this._resizeToFit === value) { + return; + } + this._resizeToFit = value; + if (this._resizeToFit) { + this._width.ignoreAdaptiveScaling = true; + this._height.ignoreAdaptiveScaling = true; + } + this._markAsDirty(); + } + get textWrapping() { + return this._textWrapping; + } + set textWrapping(value) { + if (this._textWrapping === value) { + return; + } + this._textWrapping = +value; + this._markAsDirty(); + } + get text() { + return this._text; + } + set text(value) { + if (this._text === value) { + return; + } + this._text = value + ""; + this._markAsDirty(); + this.onTextChangedObservable.notifyObservers(this); + } + get textHorizontalAlignment() { + return this._textHorizontalAlignment; + } + set textHorizontalAlignment(value) { + if (this._textHorizontalAlignment === value) { + return; + } + this._textHorizontalAlignment = value; + this._markAsDirty(); + } + get textVerticalAlignment() { + return this._textVerticalAlignment; + } + set textVerticalAlignment(value) { + if (this._textVerticalAlignment === value) { + return; + } + this._textVerticalAlignment = value; + this._markAsDirty(); + } + set lineSpacing(value) { + if (this._lineSpacing.fromString(value)) { + this._markAsDirty(); + } + } + get lineSpacing() { + return this._lineSpacing.toString(this._host); + } + get outlineWidth() { + return this._outlineWidth; + } + set outlineWidth(value) { + if (this._outlineWidth === value) { + return; + } + this._outlineWidth = value; + this._markAsDirty(); + } + get underline() { + return this._underline; + } + set underline(value) { + if (this._underline === value) { + return; + } + this._underline = value; + this._markAsDirty(); + } + get lineThrough() { + return this._lineThrough; + } + set lineThrough(value) { + if (this._lineThrough === value) { + return; + } + this._lineThrough = value; + this._markAsDirty(); + } + get applyOutlineToUnderline() { + return this._applyOutlineToUnderline; + } + set applyOutlineToUnderline(value) { + if (this._applyOutlineToUnderline === value) { + return; + } + this._applyOutlineToUnderline = value; + this._markAsDirty(); + } + get outlineColor() { + return this._outlineColor; + } + set outlineColor(value) { + if (this._outlineColor === value) { + return; + } + this._outlineColor = value; + this._markAsDirty(); + } + get wordDivider() { + return this._wordDivider; + } + set wordDivider(value) { + if (this._wordDivider === value) { + return; + } + this._wordDivider = value; + this._markAsDirty(); + } + get forceResizeWidth() { + return this._forceResizeWidth; + } + set forceResizeWidth(value) { + if (this._forceResizeWidth === value) { + return; + } + this._forceResizeWidth = value; + this._markAsDirty(); + } + constructor(name314, text = "") { + super(name314); + this.name = name314; + this._text = ""; + this._textWrapping = TextWrapping2.Clip; + this._textHorizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_CENTER; + this._textVerticalAlignment = Control2.VERTICAL_ALIGNMENT_CENTER; + this._resizeToFit = false; + this._lineSpacing = new ValueAndUnit2(0); + this._outlineWidth = 0; + this._outlineColor = "white"; + this._underline = false; + this._lineThrough = false; + this._wordDivider = " "; + this._forceResizeWidth = false; + this._applyOutlineToUnderline = false; + this.onTextChangedObservable = new Observable; + this.onLinesReadyObservable = new Observable; + this._linesTemp = []; + this.text = text; + } + _getTypeName() { + return "TextBlock"; + } + _processMeasures(parentMeasure, context) { + if (!this._fontOffset || this.isDirty) { + this._fontOffset = Control2._GetFontOffset(context.font); + } + super._processMeasures(parentMeasure, context); + this._lines = this._breakLines(this._currentMeasure.width, this._currentMeasure.height, context); + this.onLinesReadyObservable.notifyObservers(this); + let maxLineWidth = 0; + for (let i = 0;i < this._lines.length; i++) { + const line2 = this._lines[i]; + if (line2.width > maxLineWidth) { + maxLineWidth = line2.width; + } + } + if (this._resizeToFit) { + if (this._textWrapping === TextWrapping2.Clip || this._forceResizeWidth) { + const newWidth = Math.ceil(this._paddingLeftInPixels) + Math.ceil(this._paddingRightInPixels) + Math.ceil(maxLineWidth); + if (newWidth !== this._width.getValueInPixel(this._host, this._tempParentMeasure.width)) { + this._width.updateInPlace(newWidth, ValueAndUnit2.UNITMODE_PIXEL); + this._rebuildLayout = true; + } + } + let newHeight = this._paddingTopInPixels + this._paddingBottomInPixels + this._fontOffset.height * this._lines.length | 0; + if (this._lines.length > 0 && this._lineSpacing.internalValue !== 0) { + let lineSpacing = 0; + if (this._lineSpacing.isPixel) { + lineSpacing = this._lineSpacing.getValue(this._host); + } else { + lineSpacing = this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + newHeight += (this._lines.length - 1) * lineSpacing; + } + if (newHeight !== this._height.internalValue) { + this._height.updateInPlace(newHeight, ValueAndUnit2.UNITMODE_PIXEL); + this._rebuildLayout = true; + } + } + } + _drawText(text, textWidth, y, context) { + const width = this._currentMeasure.width; + let x = 0; + switch (this._textHorizontalAlignment) { + case Control2.HORIZONTAL_ALIGNMENT_LEFT: + x = 0; + break; + case Control2.HORIZONTAL_ALIGNMENT_RIGHT: + x = width - textWidth; + break; + case Control2.HORIZONTAL_ALIGNMENT_CENTER: + x = (width - textWidth) / 2; + break; + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + if (this.outlineWidth) { + context.strokeText(text, this._currentMeasure.left + x, y); + } + context.fillText(text, this._currentMeasure.left + x, y); + if (this._underline) { + this._drawLine(this._currentMeasure.left + x, y + 3, this._currentMeasure.left + x + textWidth, y + 3, context); + } + if (this._lineThrough) { + this._drawLine(this._currentMeasure.left + x, y - this.fontSizeInPixels / 3, this._currentMeasure.left + x + textWidth, y - this.fontSizeInPixels / 3, context); + } + } + _drawLine(xFrom, yFrom, xTo, yTo, context) { + context.beginPath(); + context.lineWidth = Math.round(this.fontSizeInPixels * 0.05); + context.moveTo(xFrom, yFrom); + context.lineTo(xTo, yTo); + if (this.outlineWidth && this.applyOutlineToUnderline) { + context.stroke(); + context.fill(); + } else { + const currentStroke = context.strokeStyle; + context.strokeStyle = context.fillStyle; + context.stroke(); + context.strokeStyle = currentStroke; + } + context.closePath(); + } + _draw(context) { + context.save(); + this._applyStates(context); + this._renderLines(context); + context.restore(); + } + _applyStates(context) { + super._applyStates(context); + if (this.outlineWidth) { + context.lineWidth = this.outlineWidth; + context.strokeStyle = this.outlineColor; + context.lineJoin = "miter"; + context.miterLimit = 2; + } + } + _breakLines(refWidth, refHeight, context) { + this._linesTemp.length = 0; + const _lines = this.text.split("\n"); + if (this._textWrapping === TextWrapping2.Ellipsis) { + for (const _line of _lines) { + this._linesTemp.push(this._parseLineEllipsis(_line, refWidth, context)); + } + } else if (this._textWrapping === TextWrapping2.WordWrap) { + for (const _line of _lines) { + this._linesTemp.push(...this._parseLineWordWrap(_line, refWidth, context)); + } + } else if (this._textWrapping === TextWrapping2.WordWrapEllipsis) { + for (const _line of _lines) { + this._linesTemp.push(...this._parseLineWordWrapEllipsis(_line, refWidth, refHeight, context)); + } + } else { + for (const _line of _lines) { + this._linesTemp.push(this._parseLine(_line, context)); + } + } + return this._linesTemp; + } + _parseLine(line2 = "", context) { + return { text: line2, width: this._getTextMetricsWidth(context.measureText(line2)) }; + } + _getCharsToRemove(lineWidth, width, lineLength) { + const diff = lineWidth > width ? lineWidth - width : 0; + const charWidth = lineWidth / lineLength; + const removeChars = Math.max(Math.floor(diff / charWidth), 1); + return removeChars; + } + _parseLineEllipsis(line2 = "", width, context) { + let lineWidth = this._getTextMetricsWidth(context.measureText(line2)); + let removeChars = this._getCharsToRemove(lineWidth, width, line2.length); + const characters = Array.from && Array.from(line2); + if (!characters) { + while (line2.length > 2 && lineWidth > width) { + line2 = line2.slice(0, -removeChars); + lineWidth = this._getTextMetricsWidth(context.measureText(line2 + "\u2026")); + removeChars = this._getCharsToRemove(lineWidth, width, line2.length); + } + line2 += "\u2026"; + } else { + while (characters.length && lineWidth > width) { + characters.splice(characters.length - removeChars, removeChars); + line2 = `${characters.join("")}\u2026`; + lineWidth = this._getTextMetricsWidth(context.measureText(line2)); + removeChars = this._getCharsToRemove(lineWidth, width, line2.length); + } + } + return { text: line2, width: lineWidth }; + } + _getTextMetricsWidth(textMetrics) { + if (textMetrics.actualBoundingBoxLeft !== undefined) { + return Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight); + } + return textMetrics.width; + } + _parseLineWordWrap(line2 = "", width, context) { + const lines = []; + const words = this.wordSplittingFunction ? this.wordSplittingFunction(line2) : line2.split(this._wordDivider); + let lineWidth = this._getTextMetricsWidth(context.measureText(line2)); + for (let n = 0;n < words.length; n++) { + const testLine = n > 0 ? line2 + this._wordDivider + words[n] : words[0]; + const testWidth = this._getTextMetricsWidth(context.measureText(testLine)); + if (testWidth > width && n > 0) { + lines.push({ text: line2, width: lineWidth }); + line2 = words[n]; + lineWidth = this._getTextMetricsWidth(context.measureText(line2)); + } else { + lineWidth = testWidth; + line2 = testLine; + } + } + lines.push({ text: line2, width: lineWidth }); + return lines; + } + _parseLineWordWrapEllipsis(line2 = "", width, height, context) { + const lines = this._parseLineWordWrap(line2, width, context); + for (let n = 1;n <= lines.length; n++) { + const currentHeight = this._computeHeightForLinesOf(n); + if (currentHeight > height && n > 1) { + const lastLine = lines[n - 2]; + const currentLine = lines[n - 1]; + lines[n - 2] = this._parseLineEllipsis(lastLine.text + this._wordDivider + currentLine.text, width, context); + const linesToRemove = lines.length - n + 1; + for (let i = 0;i < linesToRemove; i++) { + lines.pop(); + } + return lines; + } + } + return lines; + } + _renderLines(context) { + if (!this._fontOffset || !this._lines) { + return; + } + const height = this._currentMeasure.height; + let rootY = 0; + switch (this._textVerticalAlignment) { + case Control2.VERTICAL_ALIGNMENT_TOP: + rootY = this._fontOffset.ascent; + break; + case Control2.VERTICAL_ALIGNMENT_BOTTOM: + rootY = height - this._fontOffset.height * (this._lines.length - 1) - this._fontOffset.descent; + break; + case Control2.VERTICAL_ALIGNMENT_CENTER: + rootY = this._fontOffset.ascent + (height - this._fontOffset.height * this._lines.length) / 2; + break; + } + rootY += this._currentMeasure.top; + for (let i = 0;i < this._lines.length; i++) { + const line2 = this._lines[i]; + if (i !== 0 && this._lineSpacing.internalValue !== 0) { + if (this._lineSpacing.isPixel) { + rootY += this._lineSpacing.getValue(this._host); + } else { + rootY = rootY + this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + } + this._drawText(line2.text, line2.width, rootY, context); + rootY += this._fontOffset.height; + } + } + _computeHeightForLinesOf(lineCount) { + let newHeight = this._paddingTopInPixels + this._paddingBottomInPixels + this._fontOffset.height * lineCount; + if (lineCount > 0 && this._lineSpacing.internalValue !== 0) { + let lineSpacing = 0; + if (this._lineSpacing.isPixel) { + lineSpacing = this._lineSpacing.getValue(this._host); + } else { + lineSpacing = this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + newHeight += (lineCount - 1) * lineSpacing; + } + return newHeight; + } + isDimensionFullyDefined(dim) { + if (this.resizeToFit) { + return true; + } + return super.isDimensionFullyDefined(dim); + } + computeExpectedHeight() { + var _a; + if (this.text && this.widthInPixels) { + const context = (_a = EngineStore.LastCreatedEngine) === null || _a === undefined ? undefined : _a.createCanvas(0, 0).getContext("2d"); + if (context) { + this._applyStates(context); + if (!this._fontOffset) { + this._fontOffset = Control2._GetFontOffset(context.font); + } + const lines = this._lines ? this._lines : this._breakLines(this.widthInPixels - this._paddingLeftInPixels - this._paddingRightInPixels, this.heightInPixels - this._paddingTopInPixels - this._paddingBottomInPixels, context); + return this._computeHeightForLinesOf(lines.length); + } + } + return 0; + } + dispose() { + super.dispose(); + this.onTextChangedObservable.clear(); + } +} +var TextWrapping2; +var init_textBlock = __esm(() => { + init_tslib_es62(); + init_observable(); + init_valueAndUnit(); + init_control(); + init_typeStore(); + init_decorators(); + init_engineStore(); + (function(TextWrapping3) { + TextWrapping3[TextWrapping3["Clip"] = 0] = "Clip"; + TextWrapping3[TextWrapping3["WordWrap"] = 1] = "WordWrap"; + TextWrapping3[TextWrapping3["Ellipsis"] = 2] = "Ellipsis"; + TextWrapping3[TextWrapping3["WordWrapEllipsis"] = 3] = "WordWrapEllipsis"; + })(TextWrapping2 || (TextWrapping2 = {})); + __decorate2([ + serialize() + ], TextBlock2.prototype, "resizeToFit", null); + __decorate2([ + serialize() + ], TextBlock2.prototype, "textWrapping", null); + __decorate2([ + serialize() + ], TextBlock2.prototype, "text", null); + __decorate2([ + serialize() + ], TextBlock2.prototype, "textHorizontalAlignment", null); + __decorate2([ + serialize() + ], TextBlock2.prototype, "textVerticalAlignment", null); + __decorate2([ + serialize() + ], TextBlock2.prototype, "lineSpacing", null); + __decorate2([ + serialize() + ], TextBlock2.prototype, "outlineWidth", null); + __decorate2([ + serialize() + ], TextBlock2.prototype, "underline", null); + __decorate2([ + serialize() + ], TextBlock2.prototype, "lineThrough", null); + __decorate2([ + serialize() + ], TextBlock2.prototype, "applyOutlineToUnderline", null); + __decorate2([ + serialize() + ], TextBlock2.prototype, "outlineColor", null); + __decorate2([ + serialize() + ], TextBlock2.prototype, "wordDivider", null); + __decorate2([ + serialize() + ], TextBlock2.prototype, "forceResizeWidth", null); + RegisterClass("BABYLON.GUI.TextBlock", TextBlock2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/image.js +class Image3 extends Control2 { + get isLoaded() { + return this._loaded; + } + isReady() { + return this.isLoaded; + } + get detectPointerOnOpaqueOnly() { + return this._detectPointerOnOpaqueOnly; + } + set detectPointerOnOpaqueOnly(value) { + if (this._detectPointerOnOpaqueOnly === value) { + return; + } + this._detectPointerOnOpaqueOnly = value; + } + get sliceLeft() { + return this._sliceLeft; + } + set sliceLeft(value) { + if (this._sliceLeft === value) { + return; + } + this._sliceLeft = value; + this._markAsDirty(); + } + get sliceRight() { + return this._sliceRight; + } + set sliceRight(value) { + if (this._sliceRight === value) { + return; + } + this._sliceRight = value; + this._markAsDirty(); + } + get sliceTop() { + return this._sliceTop; + } + set sliceTop(value) { + if (this._sliceTop === value) { + return; + } + this._sliceTop = value; + this._markAsDirty(); + } + get sliceBottom() { + return this._sliceBottom; + } + set sliceBottom(value) { + if (this._sliceBottom === value) { + return; + } + this._sliceBottom = value; + this._markAsDirty(); + } + get sourceLeft() { + return this._sourceLeft; + } + set sourceLeft(value) { + if (this._sourceLeft === value) { + return; + } + this._sourceLeft = value; + this._markAsDirty(); + } + get sourceTop() { + return this._sourceTop; + } + set sourceTop(value) { + if (this._sourceTop === value) { + return; + } + this._sourceTop = value; + this._markAsDirty(); + } + get sourceWidth() { + return this._sourceWidth; + } + set sourceWidth(value) { + if (this._sourceWidth === value) { + return; + } + this._sourceWidth = value; + this._markAsDirty(); + } + get sourceHeight() { + return this._sourceHeight; + } + set sourceHeight(value) { + if (this._sourceHeight === value) { + return; + } + this._sourceHeight = value; + this._markAsDirty(); + } + get imageWidth() { + return this._imageWidth; + } + get imageHeight() { + return this._imageHeight; + } + get populateNinePatchSlicesFromImage() { + return this._populateNinePatchSlicesFromImage; + } + set populateNinePatchSlicesFromImage(value) { + if (this._populateNinePatchSlicesFromImage === value) { + return; + } + this._populateNinePatchSlicesFromImage = value; + if (this._populateNinePatchSlicesFromImage && this._loaded) { + this._extractNinePatchSliceDataFromImage(); + } + } + get isSVG() { + return this._isSVG; + } + get svgAttributesComputationCompleted() { + return this._svgAttributesComputationCompleted; + } + get autoScale() { + return this._autoScale; + } + set autoScale(value) { + if (this._autoScale === value) { + return; + } + this._autoScale = value; + if (value && this._loaded) { + this.synchronizeSizeWithContent(); + } + } + get stretch() { + return this._stretch; + } + set stretch(value) { + if (this._stretch === value) { + return; + } + this._stretch = value; + this._markAsDirty(); + } + _rotate90(n, preserveProperties = false) { + var _a, _b; + const width = this._domImage.width; + const height = this._domImage.height; + const engine47 = ((_b = (_a = this._host) === null || _a === undefined ? undefined : _a.getScene()) === null || _b === undefined ? undefined : _b.getEngine()) || EngineStore.LastCreatedEngine; + if (!engine47) { + throw new Error("Invalid engine. Unable to create a canvas."); + } + const canvas = engine47.createCanvas(height, width); + const context = canvas.getContext("2d"); + context.translate(canvas.width / 2, canvas.height / 2); + context.rotate(n * Math.PI / 2); + context.drawImage(this._domImage, 0, 0, width, height, -width / 2, -height / 2, width, height); + const dataUrl = canvas.toDataURL("image/jpg"); + const rotatedImage = new Image3(this.name + "rotated", dataUrl); + if (preserveProperties) { + rotatedImage._stretch = this._stretch; + rotatedImage._autoScale = this._autoScale; + rotatedImage._cellId = this._cellId; + rotatedImage._cellWidth = n % 1 ? this._cellHeight : this._cellWidth; + rotatedImage._cellHeight = n % 1 ? this._cellWidth : this._cellHeight; + } + this._handleRotationForSVGImage(this, rotatedImage, n); + this._imageDataCache.data = null; + return rotatedImage; + } + _handleRotationForSVGImage(srcImage, dstImage, n) { + if (!srcImage._isSVG) { + return; + } + if (srcImage._svgAttributesComputationCompleted) { + this._rotate90SourceProperties(srcImage, dstImage, n); + this._markAsDirty(); + } else { + srcImage.onSVGAttributesComputedObservable.addOnce(() => { + this._rotate90SourceProperties(srcImage, dstImage, n); + this._markAsDirty(); + }); + } + } + _rotate90SourceProperties(srcImage, dstImage, n) { + let { sourceLeft: srcLeft, sourceTop: srcTop } = srcImage, srcWidth = srcImage.domImage.width, srcHeight = srcImage.domImage.height; + let dstLeft = srcLeft, dstTop = srcTop, dstWidth = srcImage.sourceWidth, dstHeight = srcImage.sourceHeight; + if (n != 0) { + const mult = n < 0 ? -1 : 1; + n = n % 4; + for (let i = 0;i < Math.abs(n); ++i) { + dstLeft = -(srcTop - srcHeight / 2) * mult + srcHeight / 2; + dstTop = (srcLeft - srcWidth / 2) * mult + srcWidth / 2; + [dstWidth, dstHeight] = [dstHeight, dstWidth]; + if (n < 0) { + dstTop -= dstHeight; + } else { + dstLeft -= dstWidth; + } + srcLeft = dstLeft; + srcTop = dstTop; + [srcWidth, srcHeight] = [srcHeight, srcWidth]; + } + } + dstImage.sourceLeft = dstLeft; + dstImage.sourceTop = dstTop; + dstImage.sourceWidth = dstWidth; + dstImage.sourceHeight = dstHeight; + } + _extractNinePatchSliceDataFromImage() { + var _a, _b; + const width = this._domImage.width; + const height = this._domImage.height; + if (!this._workingCanvas) { + const engine47 = ((_b = (_a = this._host) === null || _a === undefined ? undefined : _a.getScene()) === null || _b === undefined ? undefined : _b.getEngine()) || EngineStore.LastCreatedEngine; + if (!engine47) { + throw new Error("Invalid engine. Unable to create a canvas."); + } + this._workingCanvas = engine47.createCanvas(width, height); + } + const canvas = this._workingCanvas; + const context = canvas.getContext("2d"); + context.drawImage(this._domImage, 0, 0, width, height); + const imageData = context.getImageData(0, 0, width, height); + this._sliceLeft = -1; + this._sliceRight = -1; + for (let x = 0;x < width; x++) { + const alpha = imageData.data[x * 4 + 3]; + if (alpha > 127 && this._sliceLeft === -1) { + this._sliceLeft = x; + continue; + } + if (alpha < 127 && this._sliceLeft > -1) { + this._sliceRight = x; + break; + } + } + this._sliceTop = -1; + this._sliceBottom = -1; + for (let y = 0;y < height; y++) { + const alpha = imageData.data[y * width * 4 + 3]; + if (alpha > 127 && this._sliceTop === -1) { + this._sliceTop = y; + continue; + } + if (alpha < 127 && this._sliceTop > -1) { + this._sliceBottom = y; + break; + } + } + } + set domImage(value) { + this._domImage = value; + this._loaded = false; + this._imageDataCache.data = null; + if (this._domImage.width) { + this._onImageLoaded(); + } else { + this._domImage.onload = () => { + this._onImageLoaded(); + }; + } + } + get domImage() { + return this._domImage; + } + _onImageLoaded() { + this._imageDataCache.data = null; + this._imageWidth = this._domImage.width; + this._imageHeight = this._domImage.height; + this._loaded = true; + if (this._populateNinePatchSlicesFromImage) { + this._extractNinePatchSliceDataFromImage(); + } + if (this._autoScale) { + this.synchronizeSizeWithContent(); + } + this.onImageLoadedObservable.notifyObservers(this); + this._markAsDirty(); + } + get source() { + return this._source; + } + static ResetImageCache() { + Image3.SourceImgCache.clear(); + } + _removeCacheUsage(source) { + const value = source && Image3.SourceImgCache.get(source); + if (value) { + value.timesUsed -= 1; + if (value.timesUsed === 0) { + Image3.SourceImgCache.delete(source); + } + } + } + set source(value) { + var _a, _b; + if (this._source === value) { + return; + } + this._removeCacheUsage(this._source); + this._loaded = false; + this._source = value; + this._imageDataCache.data = null; + if (value) { + value = this._svgCheck(value); + } + const engine47 = ((_b = (_a = this._host) === null || _a === undefined ? undefined : _a.getScene()) === null || _b === undefined ? undefined : _b.getEngine()) || EngineStore.LastCreatedEngine; + if (!engine47) { + throw new Error("Invalid engine. Unable to create a canvas."); + } + if (value && Image3.SourceImgCache.has(value)) { + const cachedData = Image3.SourceImgCache.get(value); + this._domImage = cachedData.img; + cachedData.timesUsed += 1; + if (cachedData.loaded) { + this._onImageLoaded(); + } else { + cachedData.waitingForLoadCallback.push(this._onImageLoaded.bind(this)); + } + return; + } + this._domImage = engine47.createCanvasImage(); + if (value) { + Image3.SourceImgCache.set(value, { img: this._domImage, timesUsed: 1, loaded: false, waitingForLoadCallback: [this._onImageLoaded.bind(this)] }); + } + this._domImage.onload = () => { + if (value) { + const cachedData = Image3.SourceImgCache.get(value); + if (cachedData) { + cachedData.loaded = true; + for (const waitingCallback of cachedData.waitingForLoadCallback) { + waitingCallback(); + } + cachedData.waitingForLoadCallback.length = 0; + return; + } + } + this._onImageLoaded(); + }; + if (value) { + Tools.SetCorsBehavior(value, this._domImage); + Tools.SetReferrerPolicyBehavior(this.referrerPolicy, this._domImage); + this._domImage.src = value; + } + } + _svgCheck(value) { + if (window.SVGSVGElement && value.search(/.svg#/gi) !== -1 && value.indexOf("#") === value.lastIndexOf("#")) { + this._isSVG = true; + const svgsrc = value.split("#")[0]; + const elemid = value.split("#")[1]; + const svgExist = document.body.querySelector('object[data="' + svgsrc + '"]'); + if (svgExist) { + const svgDoc = svgExist.contentDocument; + if (svgDoc && svgDoc.documentElement) { + const vb = svgDoc.documentElement.getAttribute("viewBox"); + const docwidth = Number(svgDoc.documentElement.getAttribute("width")); + const docheight = Number(svgDoc.documentElement.getAttribute("height")); + const elem = svgDoc.getElementById(elemid); + if (elem && vb && docwidth && docheight) { + this._getSVGAttribs(svgExist, elemid); + return value; + } + } + svgExist.addEventListener("load", () => { + this._getSVGAttribs(svgExist, elemid); + }); + } else { + const svgImage = document.createElement("object"); + svgImage.data = svgsrc; + svgImage.type = "image/svg+xml"; + svgImage.width = "0%"; + svgImage.height = "0%"; + document.body.appendChild(svgImage); + svgImage.onload = () => { + const svgobj = document.body.querySelector('object[data="' + svgsrc + '"]'); + if (svgobj) { + this._getSVGAttribs(svgobj, elemid); + } + }; + } + return svgsrc; + } else { + return value; + } + } + _getSVGAttribs(svgsrc, elemid) { + const svgDoc = svgsrc.contentDocument; + if (svgDoc && svgDoc.documentElement) { + const vb = svgDoc.documentElement.getAttribute("viewBox"); + const docwidth = Number(svgDoc.documentElement.getAttribute("width")); + const docheight = Number(svgDoc.documentElement.getAttribute("height")); + const elem = svgDoc.getElementById(elemid); + if (vb && docwidth && docheight && elem) { + const vb_width = Number(vb.split(" ")[2]); + const vb_height = Number(vb.split(" ")[3]); + const elem_bbox = elem.getBBox(); + let elem_matrix_a = 1; + let elem_matrix_d = 1; + let elem_matrix_e = 0; + let elem_matrix_f = 0; + const mainMatrix = elem.transform.baseVal.consolidate().matrix; + if (elem.transform && elem.transform.baseVal.consolidate()) { + elem_matrix_a = mainMatrix.a; + elem_matrix_d = mainMatrix.d; + elem_matrix_e = mainMatrix.e; + elem_matrix_f = mainMatrix.f; + } + this.sourceLeft = (elem_matrix_a * elem_bbox.x + elem_matrix_e) * docwidth / vb_width; + this.sourceTop = (elem_matrix_d * elem_bbox.y + elem_matrix_f) * docheight / vb_height; + this.sourceWidth = elem_bbox.width * elem_matrix_a * (docwidth / vb_width); + this.sourceHeight = elem_bbox.height * elem_matrix_d * (docheight / vb_height); + this._svgAttributesComputationCompleted = true; + this.onSVGAttributesComputedObservable.notifyObservers(this); + } + } + } + get cellWidth() { + return this._cellWidth; + } + set cellWidth(value) { + if (this._cellWidth === value) { + return; + } + this._cellWidth = value; + this._markAsDirty(); + } + get cellHeight() { + return this._cellHeight; + } + set cellHeight(value) { + if (this._cellHeight === value) { + return; + } + this._cellHeight = value; + this._markAsDirty(); + } + get cellId() { + return this._cellId; + } + set cellId(value) { + if (this._cellId === value) { + return; + } + this._cellId = value; + this._markAsDirty(); + } + constructor(name314, url = null) { + super(name314); + this.name = name314; + this._workingCanvas = null; + this._loaded = false; + this._stretch = Image3.STRETCH_FILL; + this._autoScale = false; + this._sourceLeft = 0; + this._sourceTop = 0; + this._sourceWidth = 0; + this._sourceHeight = 0; + this._svgAttributesComputationCompleted = false; + this._isSVG = false; + this._cellWidth = 0; + this._cellHeight = 0; + this._cellId = -1; + this._populateNinePatchSlicesFromImage = false; + this._imageDataCache = { data: null, key: "" }; + this.onImageLoadedObservable = new Observable; + this.onSVGAttributesComputedObservable = new Observable; + this.source = url; + } + contains(x, y) { + if (!super.contains(x, y)) { + return false; + } + if (!this._detectPointerOnOpaqueOnly || !this._workingCanvas) { + return true; + } + const width = this._currentMeasure.width | 0; + const height = this._currentMeasure.height | 0; + const key = width + "_" + height; + let imageData = this._imageDataCache.data; + if (!imageData || this._imageDataCache.key !== key) { + const canvas = this._workingCanvas; + const context = canvas.getContext("2d"); + this._imageDataCache.data = imageData = context.getImageData(0, 0, width, height).data; + this._imageDataCache.key = key; + } + x = x - this._currentMeasure.left | 0; + y = y - this._currentMeasure.top | 0; + const pickedPixel = imageData[(x + y * width) * 4 + 3]; + return pickedPixel > 0; + } + _getTypeName() { + return "Image"; + } + synchronizeSizeWithContent() { + if (!this._loaded) { + return; + } + this.width = this._domImage.width + "px"; + this.height = this._domImage.height + "px"; + } + _processMeasures(parentMeasure, context) { + if (this._loaded) { + switch (this._stretch) { + case Image3.STRETCH_NONE: + break; + case Image3.STRETCH_FILL: + break; + case Image3.STRETCH_UNIFORM: + break; + case Image3.STRETCH_NINE_PATCH: + break; + case Image3.STRETCH_EXTEND: + if (this._autoScale) { + this.synchronizeSizeWithContent(); + } + if (this.parent && this.parent.parent) { + this.parent.adaptWidthToChildren = true; + this.parent.adaptHeightToChildren = true; + } + break; + } + } + super._processMeasures(parentMeasure, context); + } + _prepareWorkingCanvasForOpaqueDetection() { + var _a, _b; + if (!this._detectPointerOnOpaqueOnly) { + return; + } + const width = this._currentMeasure.width; + const height = this._currentMeasure.height; + if (!this._workingCanvas) { + const engine47 = ((_b = (_a = this._host) === null || _a === undefined ? undefined : _a.getScene()) === null || _b === undefined ? undefined : _b.getEngine()) || EngineStore.LastCreatedEngine; + if (!engine47) { + throw new Error("Invalid engine. Unable to create a canvas."); + } + this._workingCanvas = engine47.createCanvas(width, height); + } + const canvas = this._workingCanvas; + const context = canvas.getContext("2d"); + context.clearRect(0, 0, width, height); + } + _drawImage(context, sx, sy, sw, sh, tx, ty, tw, th) { + context.drawImage(this._domImage, sx, sy, sw, sh, tx, ty, tw, th); + if (!this._detectPointerOnOpaqueOnly) { + return; + } + const transform = context.getTransform(); + const canvas = this._workingCanvas; + const workingCanvasContext = canvas.getContext("2d"); + workingCanvasContext.save(); + const ttx = tx - this._currentMeasure.left; + const tty = ty - this._currentMeasure.top; + workingCanvasContext.setTransform(transform.a, transform.b, transform.c, transform.d, (ttx + tw) / 2, (tty + th) / 2); + workingCanvasContext.translate(-(ttx + tw) / 2, -(tty + th) / 2); + workingCanvasContext.drawImage(this._domImage, sx, sy, sw, sh, ttx, tty, tw, th); + workingCanvasContext.restore(); + } + _draw(context) { + context.save(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + let x, y, width, height; + if (this.cellId == -1) { + x = this._sourceLeft; + y = this._sourceTop; + width = this._sourceWidth ? this._sourceWidth : this._imageWidth; + height = this._sourceHeight ? this._sourceHeight : this._imageHeight; + } else { + const rowCount = this._domImage.naturalWidth / this.cellWidth; + const column = this.cellId / rowCount >> 0; + const row = this.cellId % rowCount; + x = this.cellWidth * row; + y = this.cellHeight * column; + width = this.cellWidth; + height = this.cellHeight; + } + this._prepareWorkingCanvasForOpaqueDetection(); + this._applyStates(context); + if (this._loaded) { + switch (this._stretch) { + case Image3.STRETCH_NONE: + this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + break; + case Image3.STRETCH_FILL: + this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + break; + case Image3.STRETCH_UNIFORM: { + const hRatio = this._currentMeasure.width / width; + const vRatio = this._currentMeasure.height / height; + const ratio = Math.min(hRatio, vRatio); + const centerX = (this._currentMeasure.width - width * ratio) / 2; + const centerY = (this._currentMeasure.height - height * ratio) / 2; + this._drawImage(context, x, y, width, height, this._currentMeasure.left + centerX, this._currentMeasure.top + centerY, width * ratio, height * ratio); + break; + } + case Image3.STRETCH_EXTEND: + this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + break; + case Image3.STRETCH_NINE_PATCH: + this._renderNinePatch(context, x, y, width, height); + break; + } + } + context.restore(); + } + _renderNinePatch(context, sx, sy, sw, sh) { + const leftWidth = this._sliceLeft; + const topHeight = this._sliceTop; + const bottomHeight = sh - this._sliceBottom; + const rightWidth = sw - this._sliceRight; + const centerWidth = this._sliceRight - this._sliceLeft; + const centerHeight = this._sliceBottom - this._sliceTop; + const targetCenterWidth = this._currentMeasure.width - rightWidth - leftWidth + 2; + const targetCenterHeight = this._currentMeasure.height - bottomHeight - topHeight + 2; + const centerLeftOffset = this._currentMeasure.left + leftWidth - 1; + const centerTopOffset = this._currentMeasure.top + topHeight - 1; + const rightOffset = this._currentMeasure.left + this._currentMeasure.width - rightWidth; + const bottomOffset = this._currentMeasure.top + this._currentMeasure.height - bottomHeight; + this._drawImage(context, sx, sy, leftWidth, topHeight, this._currentMeasure.left, this._currentMeasure.top, leftWidth, topHeight); + this._drawImage(context, sx + this._sliceLeft, sy, centerWidth, topHeight, centerLeftOffset + 1, this._currentMeasure.top, targetCenterWidth - 2, topHeight); + this._drawImage(context, sx + this._sliceRight, sy, rightWidth, topHeight, rightOffset, this._currentMeasure.top, rightWidth, topHeight); + this._drawImage(context, sx, sy + this._sliceTop, leftWidth, centerHeight, this._currentMeasure.left, centerTopOffset + 1, leftWidth, targetCenterHeight - 2); + this._drawImage(context, sx + this._sliceLeft, sy + this._sliceTop, centerWidth, centerHeight, centerLeftOffset, centerTopOffset, targetCenterWidth, targetCenterHeight); + this._drawImage(context, sx + this._sliceRight, sy + this._sliceTop, rightWidth, centerHeight, rightOffset, centerTopOffset + 1, rightWidth, targetCenterHeight - 2); + this._drawImage(context, sx, sy + this._sliceBottom, leftWidth, bottomHeight, this._currentMeasure.left, bottomOffset, leftWidth, bottomHeight); + this._drawImage(context, sx + this.sliceLeft, sy + this._sliceBottom, centerWidth, bottomHeight, centerLeftOffset + 1, bottomOffset, targetCenterWidth - 2, bottomHeight); + this._drawImage(context, sx + this._sliceRight, sy + this._sliceBottom, rightWidth, bottomHeight, rightOffset, bottomOffset, rightWidth, bottomHeight); + } + dispose() { + super.dispose(); + this.onImageLoadedObservable.clear(); + this.onSVGAttributesComputedObservable.clear(); + this._removeCacheUsage(this._source); + } +} +var init_image = __esm(() => { + init_tslib_es62(); + init_observable(); + init_tools(); + init_control(); + init_typeStore(); + init_decorators(); + init_engineStore(); + Image3.SourceImgCache = new Map; + Image3.STRETCH_NONE = 0; + Image3.STRETCH_FILL = 1; + Image3.STRETCH_UNIFORM = 2; + Image3.STRETCH_EXTEND = 3; + Image3.STRETCH_NINE_PATCH = 4; + __decorate2([ + serialize() + ], Image3.prototype, "detectPointerOnOpaqueOnly", null); + __decorate2([ + serialize() + ], Image3.prototype, "sliceLeft", null); + __decorate2([ + serialize() + ], Image3.prototype, "sliceRight", null); + __decorate2([ + serialize() + ], Image3.prototype, "sliceTop", null); + __decorate2([ + serialize() + ], Image3.prototype, "sliceBottom", null); + __decorate2([ + serialize() + ], Image3.prototype, "sourceLeft", null); + __decorate2([ + serialize() + ], Image3.prototype, "sourceTop", null); + __decorate2([ + serialize() + ], Image3.prototype, "sourceWidth", null); + __decorate2([ + serialize() + ], Image3.prototype, "sourceHeight", null); + __decorate2([ + serialize() + ], Image3.prototype, "populateNinePatchSlicesFromImage", null); + __decorate2([ + serialize() + ], Image3.prototype, "autoScale", null); + __decorate2([ + serialize() + ], Image3.prototype, "stretch", null); + __decorate2([ + serialize() + ], Image3.prototype, "source", null); + __decorate2([ + serialize() + ], Image3.prototype, "cellWidth", null); + __decorate2([ + serialize() + ], Image3.prototype, "cellHeight", null); + __decorate2([ + serialize() + ], Image3.prototype, "cellId", null); + RegisterClass("BABYLON.GUI.Image", Image3); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/button.js +class Button2 extends Rectangle2 { + get image() { + return this._image; + } + get textBlock() { + return this._textBlock; + } + constructor(name314) { + super(name314); + this.name = name314; + this.delegatePickingToChildren = false; + this.thickness = 1; + this.isPointerBlocker = true; + let alphaStore = null; + this.pointerEnterAnimation = () => { + alphaStore = this.alpha; + this.alpha -= 0.1; + }; + this.pointerOutAnimation = () => { + if (alphaStore !== null) { + this.alpha = alphaStore; + } + }; + this.pointerDownAnimation = () => { + this.scaleX -= 0.05; + this.scaleY -= 0.05; + }; + this.pointerUpAnimation = () => { + this.scaleX += 0.05; + this.scaleY += 0.05; + }; + } + _getTypeName() { + return "Button"; + } + _processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) { + if (!this._isEnabled || !this.isHitTestVisible || !this.isVisible || this.notRenderable) { + return false; + } + if (!super.contains(x, y)) { + return false; + } + if (this.delegatePickingToChildren) { + let contains = false; + for (let index = this._children.length - 1;index >= 0; index--) { + const child = this._children[index]; + if (child.isEnabled && child.isHitTestVisible && child.isVisible && !child.notRenderable && child.contains(x, y)) { + contains = true; + break; + } + } + if (!contains) { + return false; + } + } + this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY); + return true; + } + _onPointerEnter(target, pi) { + if (!super._onPointerEnter(target, pi)) { + return false; + } + if (!this.isReadOnly && this.pointerEnterAnimation) { + this.pointerEnterAnimation(); + } + return true; + } + _onPointerOut(target, pi, force = false) { + if (!this.isReadOnly && this.pointerOutAnimation) { + this.pointerOutAnimation(); + } + super._onPointerOut(target, pi, force); + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { + return false; + } + if (!this.isReadOnly && this.pointerDownAnimation) { + this.pointerDownAnimation(); + } + return true; + } + _getRectangleFill(context) { + if (this.isEnabled) { + return this._getBackgroundColor(context); + } else { + return this._disabledColor; + } + } + _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi) { + if (!this.isReadOnly && this.pointerUpAnimation) { + this.pointerUpAnimation(); + } + super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi); + } + serialize(serializationObject) { + super.serialize(serializationObject); + if (this._textBlock) { + serializationObject.textBlockName = this._textBlock.name; + } + if (this._image) { + serializationObject.imageName = this._image.name; + } + } + _parseFromContent(serializedObject, host) { + super._parseFromContent(serializedObject, host); + if (serializedObject.textBlockName) { + this._textBlock = this.getChildByName(serializedObject.textBlockName); + } + if (serializedObject.imageName) { + this._image = this.getChildByName(serializedObject.imageName); + } + } + static CreateImageButton(name314, text, imageUrl) { + const result = new this(name314); + const textBlock13 = new TextBlock2(name314 + "_button", text); + textBlock13.textWrapping = true; + textBlock13.textHorizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_CENTER; + textBlock13.paddingLeft = "20%"; + result.addControl(textBlock13); + const iconImage = new Image3(name314 + "_icon", imageUrl); + iconImage.width = "20%"; + iconImage.stretch = Image3.STRETCH_UNIFORM; + iconImage.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + result.addControl(iconImage); + result._image = iconImage; + result._textBlock = textBlock13; + return result; + } + static CreateImageOnlyButton(name314, imageUrl) { + const result = new this(name314); + const iconImage = new Image3(name314 + "_icon", imageUrl); + iconImage.stretch = Image3.STRETCH_FILL; + iconImage.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + result.addControl(iconImage); + result._image = iconImage; + return result; + } + static CreateSimpleButton(name314, text) { + const result = new this(name314); + const textBlock13 = new TextBlock2(name314 + "_button", text); + textBlock13.textWrapping = true; + textBlock13.textHorizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_CENTER; + result.addControl(textBlock13); + result._textBlock = textBlock13; + return result; + } + static CreateImageWithCenterTextButton(name314, text, imageUrl) { + const result = new this(name314); + const iconImage = new Image3(name314 + "_icon", imageUrl); + iconImage.stretch = Image3.STRETCH_FILL; + result.addControl(iconImage); + const textBlock13 = new TextBlock2(name314 + "_button", text); + textBlock13.textWrapping = true; + textBlock13.textHorizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_CENTER; + result.addControl(textBlock13); + result._image = iconImage; + result._textBlock = textBlock13; + return result; + } +} +var init_button = __esm(() => { + init_rectangle(); + init_control(); + init_textBlock(); + init_image(); + init_typeStore(); + RegisterClass("BABYLON.GUI.Button", Button2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/stackPanel.js +class StackPanel2 extends Container2 { + get isVertical() { + return this._isVertical; + } + set isVertical(value) { + if (this._isVertical === value) { + return; + } + this._isVertical = value; + this._markAsDirty(); + } + get spacing() { + return this._spacing; + } + set spacing(value) { + if (this._spacing === value) { + return; + } + this._spacing = value; + this._markAsDirty(); + } + set width(value) { + if (!this._doNotTrackManualChanges) { + this._manualWidth = true; + } + if (this._width.toString(this._host) === value) { + return; + } + if (this._width.fromString(value)) { + this._markAsDirty(); + } + } + get width() { + return this._width.toString(this._host); + } + set height(value) { + if (!this._doNotTrackManualChanges) { + this._manualHeight = true; + } + if (this._height.toString(this._host) === value) { + return; + } + if (this._height.fromString(value)) { + this._markAsDirty(); + } + } + get height() { + return this._height.toString(this._host); + } + constructor(name314) { + super(name314); + this.name = name314; + this._isVertical = true; + this._manualWidth = false; + this._manualHeight = false; + this._doNotTrackManualChanges = false; + this._spacing = 0; + this.ignoreLayoutWarnings = false; + } + _getTypeName() { + return "StackPanel"; + } + _preMeasure(parentMeasure, context) { + for (const child of this._children) { + if (this._isVertical) { + child.verticalAlignment = Control2.VERTICAL_ALIGNMENT_TOP; + } else { + child.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + } + } + super._preMeasure(parentMeasure, context); + } + _additionalProcessing(parentMeasure, context) { + super._additionalProcessing(parentMeasure, context); + this._measureForChildren.copyFrom(parentMeasure); + this._measureForChildren.left = this._currentMeasure.left; + this._measureForChildren.top = this._currentMeasure.top; + if (!this.isVertical || this._manualWidth) { + this._measureForChildren.width = this._currentMeasure.width; + } + if (this.isVertical || this._manualHeight) { + this._measureForChildren.height = this._currentMeasure.height; + } + } + _postMeasure() { + let stackWidth = 0; + let stackHeight = 0; + const childrenCount = this._children.length; + for (let index = 0;index < childrenCount; index++) { + const child = this._children[index]; + if (!child.isVisible || child.notRenderable) { + continue; + } + if (this._isVertical) { + if (child.top !== stackHeight + "px") { + child.top = stackHeight + "px"; + this._rebuildLayout = true; + child._top.ignoreAdaptiveScaling = true; + } + if (!this.ignoreLayoutWarnings && !child.isDimensionFullyDefined("height")) { + Logger.Warn(`Control (Name:${child.name}, UniqueId:${child.uniqueId}) is using height in percentage mode inside a vertical StackPanel`, 1); + } else { + stackHeight += child._currentMeasure.height + child._paddingTopInPixels + child._paddingBottomInPixels + (index < childrenCount - 1 ? this._spacing : 0); + } + } else { + if (child.left !== stackWidth + "px") { + child.left = stackWidth + "px"; + this._rebuildLayout = true; + child._left.ignoreAdaptiveScaling = true; + } + if (!this.ignoreLayoutWarnings && !child.isDimensionFullyDefined("width")) { + Logger.Warn(`Control (Name:${child.name}, UniqueId:${child.uniqueId}) is using width in percentage mode inside a horizontal StackPanel`, 1); + } else { + stackWidth += child._currentMeasure.width + child._paddingLeftInPixels + child._paddingRightInPixels + (index < childrenCount - 1 ? this._spacing : 0); + } + } + } + stackWidth += this._paddingLeftInPixels + this._paddingRightInPixels; + stackHeight += this._paddingTopInPixels + this._paddingBottomInPixels; + this._doNotTrackManualChanges = true; + let panelWidthChanged = false; + let panelHeightChanged = false; + if ((!this._manualHeight || this.adaptHeightToChildren) && this._isVertical) { + const previousHeight = this.height; + this.height = stackHeight + "px"; + panelHeightChanged = previousHeight !== this.height || !this._height.ignoreAdaptiveScaling; + } + if ((!this._manualWidth || this.adaptWidthToChildren) && !this._isVertical) { + const previousWidth = this.width; + this.width = stackWidth + "px"; + panelWidthChanged = previousWidth !== this.width || !this._width.ignoreAdaptiveScaling; + } + if (panelHeightChanged) { + this._height.ignoreAdaptiveScaling = true; + } + if (panelWidthChanged) { + this._width.ignoreAdaptiveScaling = true; + } + this._doNotTrackManualChanges = false; + if (panelWidthChanged || panelHeightChanged) { + this._rebuildLayout = true; + } + super._postMeasure(); + } + _getManualDim(dim) { + if (dim === "width") { + return this._manualWidth; + } else { + return this._manualHeight; + } + } + isDimensionFullyDefined(dim) { + if (dim === "height" ? this.isVertical : !this.isVertical && !this._getManualDim(dim)) { + for (const child of this._children) { + if (!child.isDimensionFullyDefined(dim)) { + return false; + } + } + return true; + } + return this.getDimension(dim).isPixel || this._getAdaptDimTo(dim); + } + serialize(serializationObject) { + super.serialize(serializationObject); + serializationObject.manualWidth = this._manualWidth; + serializationObject.manualHeight = this._manualHeight; + } + _parseFromContent(serializedObject, host) { + this._manualWidth = serializedObject.manualWidth; + this._manualHeight = serializedObject.manualHeight; + super._parseFromContent(serializedObject, host); + } +} +var init_stackPanel = __esm(() => { + init_tslib_es62(); + init_container(); + init_control(); + init_typeStore(); + init_decorators(); + init_logger(); + __decorate2([ + serialize() + ], StackPanel2.prototype, "ignoreLayoutWarnings", undefined); + __decorate2([ + serialize() + ], StackPanel2.prototype, "isVertical", null); + __decorate2([ + serialize() + ], StackPanel2.prototype, "spacing", null); + __decorate2([ + serialize() + ], StackPanel2.prototype, "width", null); + __decorate2([ + serialize() + ], StackPanel2.prototype, "height", null); + RegisterClass("BABYLON.GUI.StackPanel", StackPanel2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/checkbox.js +class Checkbox2 extends Control2 { + get thickness() { + return this._thickness; + } + set thickness(value) { + if (this._thickness === value) { + return; + } + this._thickness = value; + this._markAsDirty(); + } + get checkSizeRatio() { + return this._checkSizeRatio; + } + set checkSizeRatio(value) { + value = Math.max(Math.min(1, value), 0); + if (this._checkSizeRatio === value) { + return; + } + this._checkSizeRatio = value; + this._markAsDirty(); + } + get background() { + return this._background; + } + set background(value) { + if (this._background === value) { + return; + } + this._background = value; + this._markAsDirty(); + } + get isChecked() { + return this._isChecked; + } + set isChecked(value) { + if (this._isChecked === value) { + return; + } + this._isChecked = value; + this._markAsDirty(); + this.onIsCheckedChangedObservable.notifyObservers(value); + } + constructor(name314) { + super(name314); + this.name = name314; + this._isChecked = false; + this._background = "black"; + this._checkSizeRatio = 0.8; + this._thickness = 1; + this.onIsCheckedChangedObservable = new Observable; + this.isPointerBlocker = true; + } + _getTypeName() { + return "Checkbox"; + } + _draw(context) { + context.save(); + this._applyStates(context); + const actualWidth = this._currentMeasure.width - this._thickness; + const actualHeight = this._currentMeasure.height - this._thickness; + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + context.fillStyle = this._isEnabled ? this._background : this._disabledColor; + context.fillRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, actualWidth, actualHeight); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + if (this._isChecked) { + context.fillStyle = this._isEnabled ? this.color : this._disabledColorItem; + const offsetWidth = actualWidth * this._checkSizeRatio; + const offsetHeight = actualHeight * this._checkSizeRatio; + context.fillRect(this._currentMeasure.left + this._thickness / 2 + (actualWidth - offsetWidth) / 2, this._currentMeasure.top + this._thickness / 2 + (actualHeight - offsetHeight) / 2, offsetWidth, offsetHeight); + } + context.strokeStyle = this.color; + context.lineWidth = this._thickness; + context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, actualWidth, actualHeight); + context.restore(); + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { + return false; + } + if (!this.isReadOnly) { + this.isChecked = !this.isChecked; + } + return true; + } + static AddCheckBoxWithHeader(title, onValueChanged) { + const panel = new StackPanel2; + panel.isVertical = false; + panel.height = "30px"; + const checkbox3 = new Checkbox2; + checkbox3.width = "20px"; + checkbox3.height = "20px"; + checkbox3.isChecked = true; + checkbox3.color = "green"; + checkbox3.onIsCheckedChangedObservable.add(onValueChanged); + panel.addControl(checkbox3); + const header = new TextBlock2; + header.text = title; + header.width = "180px"; + header.paddingLeft = "5px"; + header.textHorizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + header.color = "white"; + panel.addControl(header); + return panel; + } +} +var init_checkbox = __esm(() => { + init_tslib_es62(); + init_observable(); + init_control(); + init_stackPanel(); + init_textBlock(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], Checkbox2.prototype, "thickness", null); + __decorate2([ + serialize() + ], Checkbox2.prototype, "checkSizeRatio", null); + __decorate2([ + serialize() + ], Checkbox2.prototype, "background", null); + __decorate2([ + serialize() + ], Checkbox2.prototype, "isChecked", null); + RegisterClass("BABYLON.GUI.Checkbox", Checkbox2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/textWrapper.js +class TextWrapper2 { + get text() { + return this._characters ? this._characters.join("") : this._text; + } + set text(txt) { + this._text = txt; + this._characters = Array.from && Array.from(txt); + } + get length() { + return this._characters ? this._characters.length : this._text.length; + } + removePart(idxStart, idxEnd, insertTxt) { + this._text = this._text.slice(0, idxStart) + (insertTxt ? insertTxt : "") + this._text.slice(idxEnd); + if (this._characters) { + const newCharacters = insertTxt ? Array.from(insertTxt) : []; + this._characters.splice(idxStart, idxEnd - idxStart, ...newCharacters); + } + } + charAt(idx) { + return this._characters ? this._characters[idx] : this._text.charAt(idx); + } + substr(from, length) { + if (this._characters) { + if (isNaN(from)) { + from = 0; + } else if (from >= 0) { + from = Math.min(from, this._characters.length); + } else { + from = this._characters.length + Math.max(from, -this._characters.length); + } + if (length === undefined) { + length = this._characters.length - from; + } else if (isNaN(length)) { + length = 0; + } else if (length < 0) { + length = 0; + } + const temp = []; + while (--length >= 0) { + temp[length] = this._characters[from + length]; + } + return temp.join(""); + } + return this._text.substr(from, length); + } + substring(from, to) { + if (this._characters) { + if (isNaN(from)) { + from = 0; + } else if (from > this._characters.length) { + from = this._characters.length; + } else if (from < 0) { + from = 0; + } + if (to === undefined) { + to = this._characters.length; + } else if (isNaN(to)) { + to = 0; + } else if (to > this._characters.length) { + to = this._characters.length; + } else if (to < 0) { + to = 0; + } + const temp = []; + let idx = 0; + while (from < to) { + temp[idx++] = this._characters[from++]; + } + return temp.join(""); + } + return this._text.substring(from, to); + } + isWord(index) { + const rWord = /\w/g; + return this._characters ? this._characters[index].search(rWord) !== -1 : this._text.search(rWord) !== -1; + } +} +var init_textWrapper = __esm(() => { +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/inputText.js +class InputText2 extends Control2 { + get maxWidth() { + return this._maxWidth.toString(this._host); + } + get maxWidthInPixels() { + return this._maxWidth.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set maxWidth(value) { + if (this._maxWidth.toString(this._host) === value) { + return; + } + if (this._maxWidth.fromString(value)) { + this._markAsDirty(); + } + } + get highligherOpacity() { + return this._highligherOpacity; + } + set highligherOpacity(value) { + if (this._highligherOpacity === value) { + return; + } + this._highligherOpacity = value; + this._markAsDirty(); + } + get onFocusSelectAll() { + return this._onFocusSelectAll; + } + set onFocusSelectAll(value) { + if (this._onFocusSelectAll === value) { + return; + } + this._onFocusSelectAll = value; + this._markAsDirty(); + } + get textHighlightColor() { + return this._textHighlightColor; + } + set textHighlightColor(value) { + if (this._textHighlightColor === value) { + return; + } + this._textHighlightColor = value; + this._markAsDirty(); + } + get margin() { + return this._margin.toString(this._host); + } + get marginInPixels() { + return this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set margin(value) { + if (this._margin.toString(this._host) === value) { + return; + } + if (this._margin.fromString(value)) { + this._markAsDirty(); + } + } + get autoStretchWidth() { + return this._autoStretchWidth; + } + set autoStretchWidth(value) { + if (this._autoStretchWidth === value) { + return; + } + this._autoStretchWidth = value; + this._markAsDirty(); + } + get thickness() { + return this._thickness; + } + set thickness(value) { + if (this._thickness === value) { + return; + } + this._thickness = value; + this._markAsDirty(); + } + get focusedBackground() { + return this._focusedBackground; + } + set focusedBackground(value) { + if (this._focusedBackground === value) { + return; + } + this._focusedBackground = value; + this._markAsDirty(); + } + get focusedColor() { + return this._focusedColor; + } + set focusedColor(value) { + if (this._focusedColor === value) { + return; + } + this._focusedColor = value; + this._markAsDirty(); + } + get background() { + return this._background; + } + set background(value) { + if (this._background === value) { + return; + } + this._background = value; + this._markAsDirty(); + } + get placeholderColor() { + return this._placeholderColor; + } + set placeholderColor(value) { + if (this._placeholderColor === value) { + return; + } + this._placeholderColor = value; + this._markAsDirty(); + } + get placeholderText() { + return this._placeholderText; + } + set placeholderText(value) { + if (this._placeholderText === value) { + return; + } + this._placeholderText = value; + this._markAsDirty(); + } + get deadKey() { + return this._deadKey; + } + set deadKey(flag) { + this._deadKey = flag; + } + get highlightedText() { + return this._highlightedText; + } + set highlightedText(text) { + if (this._highlightedText === text) { + return; + } + this._highlightedText = text; + this._markAsDirty(); + } + get addKey() { + return this._addKey; + } + set addKey(flag) { + this._addKey = flag; + } + get currentKey() { + return this._currentKey; + } + set currentKey(key) { + this._currentKey = key; + } + get text() { + return this._textWrapper.text; + } + set text(value) { + const valueAsString = value.toString(); + if (!this._textWrapper) { + this._textWrapper = new TextWrapper2; + } + if (this._textWrapper.text === valueAsString) { + return; + } + this._textWrapper.text = valueAsString; + this._textHasChanged(); + } + _textHasChanged() { + this._markAsDirty(); + this.onTextChangedObservable.notifyObservers(this); + } + get width() { + return this._width.toString(this._host); + } + set width(value) { + if (this._width.toString(this._host) === value) { + return; + } + if (this._width.fromString(value)) { + this._markAsDirty(); + } + this.autoStretchWidth = false; + } + constructor(name314, text = "") { + super(name314); + this.name = name314; + this._placeholderText = ""; + this._background = "#222222"; + this._focusedBackground = "#000000"; + this._focusedColor = "white"; + this._placeholderColor = "gray"; + this._thickness = 1; + this._margin = new ValueAndUnit2(10, ValueAndUnit2.UNITMODE_PIXEL); + this._autoStretchWidth = true; + this._maxWidth = new ValueAndUnit2(1, ValueAndUnit2.UNITMODE_PERCENTAGE, false); + this._isFocused = false; + this._blinkIsEven = false; + this._cursorOffset = 0; + this._deadKey = false; + this._addKey = true; + this._currentKey = ""; + this._isTextHighlightOn = false; + this._textHighlightColor = "#d5e0ff"; + this._highligherOpacity = 0.4; + this._highlightedText = ""; + this._startHighlightIndex = 0; + this._endHighlightIndex = 0; + this._cursorIndex = -1; + this._onFocusSelectAll = false; + this._isPointerDown = false; + this.promptMessage = "Please enter text:"; + this.disableMobilePrompt = false; + this.onTextChangedObservable = new Observable; + this.onBeforeKeyAddObservable = new Observable; + this.onFocusObservable = new Observable; + this.onBlurObservable = new Observable; + this.onTextHighlightObservable = new Observable; + this.onTextCopyObservable = new Observable; + this.onTextCutObservable = new Observable; + this.onTextPasteObservable = new Observable; + this.onKeyboardEventProcessedObservable = new Observable; + this.text = text; + this.isPointerBlocker = true; + } + onBlur() { + this._isFocused = false; + this._scrollLeft = null; + this._cursorOffset = 0; + clearTimeout(this._blinkTimeout); + this._markAsDirty(); + this.onBlurObservable.notifyObservers(this); + this._host.unRegisterClipboardEvents(); + if (this._onClipboardObserver) { + this._host.onClipboardObservable.remove(this._onClipboardObserver); + } + const scene50 = this._host.getScene(); + if (this._onPointerDblTapObserver && scene50) { + scene50.onPointerObservable.remove(this._onPointerDblTapObserver); + } + } + onFocus() { + if (!this._isEnabled) { + return; + } + this._scrollLeft = null; + this._isFocused = true; + this._blinkIsEven = false; + this._cursorOffset = 0; + this._markAsDirty(); + this.onFocusObservable.notifyObservers(this); + if (this._focusedBy === "touch" && !this.disableMobilePrompt) { + const value = prompt(this.promptMessage); + if (value !== null) { + this.text = value; + } + this._host.focusedControl = null; + return; + } + this._host.registerClipboardEvents(); + this._onClipboardObserver = this._host.onClipboardObservable.add((clipboardInfo) => { + switch (clipboardInfo.type) { + case ClipboardEventTypes.COPY: + this._onCopyText(clipboardInfo.event); + this.onTextCopyObservable.notifyObservers(this); + break; + case ClipboardEventTypes.CUT: + this._onCutText(clipboardInfo.event); + this.onTextCutObservable.notifyObservers(this); + break; + case ClipboardEventTypes.PASTE: + this._onPasteText(clipboardInfo.event); + this.onTextPasteObservable.notifyObservers(this); + break; + default: + return; + } + }); + const scene50 = this._host.getScene(); + if (scene50) { + this._onPointerDblTapObserver = scene50.onPointerObservable.add((pointerInfo) => { + if (!this._isFocused) { + return; + } + if (pointerInfo.type === PointerEventTypes.POINTERDOUBLETAP) { + this._processDblClick(pointerInfo); + } + }); + } + if (this._onFocusSelectAll) { + this._selectAllText(); + } + } + focus() { + this._host.moveFocusToControl(this); + } + blur() { + this._host.focusedControl = null; + } + _getTypeName() { + return "InputText"; + } + keepsFocusWith() { + if (!this._connectedVirtualKeyboard) { + return null; + } + return [this._connectedVirtualKeyboard]; + } + processKey(keyCode, key, evt) { + var _a; + if (this.isReadOnly) { + return; + } + if (evt && (evt.ctrlKey || evt.metaKey) && (keyCode === 67 || keyCode === 86 || keyCode === 88)) { + return; + } + if (evt && (evt.ctrlKey || evt.metaKey) && keyCode === 65) { + this._selectAllText(); + evt.preventDefault(); + return; + } + switch (keyCode) { + case 32: + key = " "; + break; + case 191: + if (evt) { + evt.preventDefault(); + } + break; + case 8: + if (this._textWrapper.text && this._textWrapper.length > 0) { + if (this.isTextHighlightOn) { + this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex); + this._textHasChanged(); + this.isTextHighlightOn = false; + this._cursorOffset = this._textWrapper.length - this._startHighlightIndex; + this._blinkIsEven = false; + if (evt) { + evt.preventDefault(); + } + return; + } + if (this._cursorOffset === 0) { + this.text = this._textWrapper.substr(0, this._textWrapper.length - 1); + } else { + const deletePosition = this._textWrapper.length - this._cursorOffset; + if (deletePosition > 0) { + this._textWrapper.removePart(deletePosition - 1, deletePosition); + this._textHasChanged(); + } + } + } + if (evt) { + evt.preventDefault(); + } + return; + case 46: + if (this.isTextHighlightOn) { + this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex); + this._textHasChanged(); + this.isTextHighlightOn = false; + this._cursorOffset = this._textWrapper.length - this._startHighlightIndex; + if (evt) { + evt.preventDefault(); + } + return; + } + if (this._textWrapper.text && this._textWrapper.length > 0 && this._cursorOffset > 0) { + const deletePosition = this._textWrapper.length - this._cursorOffset; + this._textWrapper.removePart(deletePosition, deletePosition + 1); + this._textHasChanged(); + this._cursorOffset--; + } + if (evt) { + evt.preventDefault(); + } + return; + case 13: + this._host.focusedControl = null; + this.isTextHighlightOn = false; + return; + case 35: + this._cursorOffset = 0; + this._blinkIsEven = false; + this.isTextHighlightOn = false; + this._markAsDirty(); + return; + case 36: + this._cursorOffset = this._textWrapper.length; + this._blinkIsEven = false; + this.isTextHighlightOn = false; + this._markAsDirty(); + return; + case 37: + this._cursorOffset++; + if (this._cursorOffset > this._textWrapper.length) { + this._cursorOffset = this._textWrapper.length; + } + if (evt && evt.shiftKey) { + this._blinkIsEven = false; + if (evt.ctrlKey || evt.metaKey) { + if (!this.isTextHighlightOn) { + if (this._textWrapper.length === this._cursorOffset) { + return; + } else { + this._endHighlightIndex = this._textWrapper.length - this._cursorOffset + 1; + } + } + this._startHighlightIndex = 0; + this._cursorIndex = this._textWrapper.length - this._endHighlightIndex; + this._cursorOffset = this._textWrapper.length; + this.isTextHighlightOn = true; + this._markAsDirty(); + return; + } + if (!this.isTextHighlightOn) { + this.isTextHighlightOn = true; + this._cursorIndex = this._cursorOffset >= this._textWrapper.length ? this._textWrapper.length : this._cursorOffset - 1; + } else if (this._cursorIndex === -1) { + this._cursorIndex = this._textWrapper.length - this._endHighlightIndex; + this._cursorOffset = this._startHighlightIndex === 0 ? this._textWrapper.length : this._textWrapper.length - this._startHighlightIndex + 1; + } + if (this._cursorIndex < this._cursorOffset) { + this._endHighlightIndex = this._textWrapper.length - this._cursorIndex; + this._startHighlightIndex = this._textWrapper.length - this._cursorOffset; + } else if (this._cursorIndex > this._cursorOffset) { + this._endHighlightIndex = this._textWrapper.length - this._cursorOffset; + this._startHighlightIndex = this._textWrapper.length - this._cursorIndex; + } else { + this.isTextHighlightOn = false; + } + this._markAsDirty(); + return; + } + if (this.isTextHighlightOn) { + this._cursorOffset = this._textWrapper.length - this._startHighlightIndex; + this.isTextHighlightOn = false; + } + if (evt && (evt.ctrlKey || evt.metaKey)) { + this._cursorOffset = this._textWrapper.length; + evt.preventDefault(); + } + this._blinkIsEven = false; + this.isTextHighlightOn = false; + this._cursorIndex = -1; + this._markAsDirty(); + return; + case 39: + this._cursorOffset--; + if (this._cursorOffset < 0) { + this._cursorOffset = 0; + } + if (evt && evt.shiftKey) { + this._blinkIsEven = false; + if (evt.ctrlKey || evt.metaKey) { + if (!this.isTextHighlightOn) { + if (this._cursorOffset === 0) { + return; + } else { + this._startHighlightIndex = this._textWrapper.length - this._cursorOffset - 1; + } + } + this._endHighlightIndex = this._textWrapper.length; + this.isTextHighlightOn = true; + this._cursorIndex = this._textWrapper.length - this._startHighlightIndex; + this._cursorOffset = 0; + this._markAsDirty(); + return; + } + if (!this.isTextHighlightOn) { + this.isTextHighlightOn = true; + this._cursorIndex = this._cursorOffset <= 0 ? 0 : this._cursorOffset + 1; + } else if (this._cursorIndex === -1) { + this._cursorIndex = this._textWrapper.length - this._startHighlightIndex; + this._cursorOffset = this._textWrapper.length === this._endHighlightIndex ? 0 : this._textWrapper.length - this._endHighlightIndex - 1; + } + if (this._cursorIndex < this._cursorOffset) { + this._endHighlightIndex = this._textWrapper.length - this._cursorIndex; + this._startHighlightIndex = this._textWrapper.length - this._cursorOffset; + } else if (this._cursorIndex > this._cursorOffset) { + this._endHighlightIndex = this._textWrapper.length - this._cursorOffset; + this._startHighlightIndex = this._textWrapper.length - this._cursorIndex; + } else { + this.isTextHighlightOn = false; + } + this._markAsDirty(); + return; + } + if (this.isTextHighlightOn) { + this._cursorOffset = this._textWrapper.length - this._endHighlightIndex; + this.isTextHighlightOn = false; + } + if (evt && (evt.ctrlKey || evt.metaKey)) { + this._cursorOffset = 0; + evt.preventDefault(); + } + this._blinkIsEven = false; + this.isTextHighlightOn = false; + this._cursorIndex = -1; + this._markAsDirty(); + return; + } + if (keyCode === 32) { + key = (_a = evt === null || evt === undefined ? undefined : evt.key) !== null && _a !== undefined ? _a : " "; + } + this._deadKey = key === "Dead"; + if (key && (keyCode === -1 || keyCode === 32 || keyCode === 34 || keyCode === 39 || keyCode > 47 && keyCode < 64 || keyCode > 64 && keyCode < 91 || keyCode > 159 && keyCode < 193 || keyCode > 218 && keyCode < 223 || keyCode > 95 && keyCode < 112)) { + this._currentKey = key; + this.onBeforeKeyAddObservable.notifyObservers(this); + key = this._currentKey; + if (this._addKey && !this._deadKey) { + if (this.isTextHighlightOn) { + this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex, key); + this._textHasChanged(); + this._cursorOffset = this._textWrapper.length - (this._startHighlightIndex + 1); + this.isTextHighlightOn = false; + this._blinkIsEven = false; + this._markAsDirty(); + } else if (this._cursorOffset === 0) { + this.text += this._deadKey && (evt === null || evt === undefined ? undefined : evt.key) ? evt.key : key; + } else { + const insertPosition = this._textWrapper.length - this._cursorOffset; + this._textWrapper.removePart(insertPosition, insertPosition, key); + this._textHasChanged(); + } + } + } + } + _updateValueFromCursorIndex(offset) { + this._blinkIsEven = false; + if (this._cursorIndex === -1) { + this._cursorIndex = offset; + } else { + if (this._cursorIndex < this._cursorOffset) { + this._endHighlightIndex = this._textWrapper.length - this._cursorIndex; + this._startHighlightIndex = this._textWrapper.length - this._cursorOffset; + } else if (this._cursorIndex > this._cursorOffset) { + this._endHighlightIndex = this._textWrapper.length - this._cursorOffset; + this._startHighlightIndex = this._textWrapper.length - this._cursorIndex; + } else { + this.isTextHighlightOn = false; + this._markAsDirty(); + return; + } + } + this.isTextHighlightOn = true; + this._markAsDirty(); + } + _processDblClick(evt) { + this._startHighlightIndex = this._textWrapper.length - this._cursorOffset; + this._endHighlightIndex = this._startHighlightIndex; + let moveLeft, moveRight; + do { + moveRight = this._endHighlightIndex < this._textWrapper.length && this._textWrapper.isWord(this._endHighlightIndex) ? ++this._endHighlightIndex : 0; + moveLeft = this._startHighlightIndex > 0 && this._textWrapper.isWord(this._startHighlightIndex - 1) ? --this._startHighlightIndex : 0; + } while (moveLeft || moveRight); + this._cursorOffset = this._textWrapper.length - this._startHighlightIndex; + this.isTextHighlightOn = true; + this._clickedCoordinate = null; + this._blinkIsEven = true; + this._cursorIndex = -1; + this._markAsDirty(); + } + _selectAllText() { + this._blinkIsEven = true; + this.isTextHighlightOn = true; + this._startHighlightIndex = 0; + this._endHighlightIndex = this._textWrapper.length; + this._cursorOffset = this._textWrapper.length; + this._cursorIndex = -1; + this._markAsDirty(); + } + processKeyboard(evt) { + this.processKey(evt.keyCode, evt.key, evt); + this.onKeyboardEventProcessedObservable.notifyObservers(evt); + } + _onCopyText(ev) { + this.isTextHighlightOn = false; + try { + ev.clipboardData && ev.clipboardData.setData("text/plain", this._highlightedText); + } catch (_a) { + } + this._host.clipboardData = this._highlightedText; + } + _onCutText(ev) { + if (!this._highlightedText) { + return; + } + this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex); + this._textHasChanged(); + this.isTextHighlightOn = false; + this._cursorOffset = this._textWrapper.length - this._startHighlightIndex; + try { + ev.clipboardData && ev.clipboardData.setData("text/plain", this._highlightedText); + } catch (_a) { + } + this._host.clipboardData = this._highlightedText; + this._highlightedText = ""; + } + _onPasteText(ev) { + let data = ""; + if (ev.clipboardData && ev.clipboardData.types.indexOf("text/plain") !== -1) { + data = ev.clipboardData.getData("text/plain"); + } else { + data = this._host.clipboardData; + } + const insertPosition = this._textWrapper.length - this._cursorOffset; + this._textWrapper.removePart(insertPosition, insertPosition, data); + this._textHasChanged(); + } + _draw(context) { + context.save(); + this._applyStates(context); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + if (this._isFocused) { + if (this._focusedBackground) { + context.fillStyle = this._isEnabled ? this._focusedBackground : this._disabledColor; + context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + } else if (this._background) { + context.fillStyle = this._isEnabled ? this._background : this._disabledColor; + context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + if (!this._fontOffset || this._wasDirty) { + this._fontOffset = Control2._GetFontOffset(context.font); + } + const clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, this._tempParentMeasure.width); + if (this.color) { + context.fillStyle = this.color; + } + let text = this._beforeRenderText(this._textWrapper); + if (!this._isFocused && !this._textWrapper.text && this._placeholderText) { + text = new TextWrapper2; + text.text = this._placeholderText; + if (this._placeholderColor) { + context.fillStyle = this._placeholderColor; + } + } + this._textWidth = context.measureText(text.text).width; + const marginWidth = this._margin.getValueInPixel(this._host, this._tempParentMeasure.width) * 2; + if (this._autoStretchWidth) { + this.width = Math.min(this._maxWidth.getValueInPixel(this._host, this._tempParentMeasure.width), this._textWidth + marginWidth) + "px"; + this._autoStretchWidth = true; + } + const rootY = this._fontOffset.ascent + (this._currentMeasure.height - this._fontOffset.height) / 2; + const availableWidth = this._width.getValueInPixel(this._host, this._tempParentMeasure.width) - marginWidth; + context.save(); + context.beginPath(); + context.rect(clipTextLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, availableWidth + 2, this._currentMeasure.height); + context.clip(); + if (this._isFocused && this._textWidth > availableWidth) { + const textLeft = clipTextLeft - this._textWidth + availableWidth; + if (!this._scrollLeft) { + this._scrollLeft = textLeft; + } + } else { + this._scrollLeft = clipTextLeft; + } + context.fillText(text.text, this._scrollLeft, this._currentMeasure.top + rootY); + if (this._isFocused) { + if (this._clickedCoordinate) { + const rightPosition = this._scrollLeft + this._textWidth; + const absoluteCursorPosition = rightPosition - this._clickedCoordinate; + let currentSize = 0; + this._cursorOffset = 0; + let previousDist = 0; + do { + if (this._cursorOffset) { + previousDist = Math.abs(absoluteCursorPosition - currentSize); + } + this._cursorOffset++; + currentSize = context.measureText(text.substr(text.length - this._cursorOffset, this._cursorOffset)).width; + } while (currentSize < absoluteCursorPosition && text.length >= this._cursorOffset); + if (Math.abs(absoluteCursorPosition - currentSize) > previousDist) { + this._cursorOffset--; + } + this._blinkIsEven = false; + this._clickedCoordinate = null; + } + if (!this._blinkIsEven) { + const cursorOffsetText = text.substr(text.length - this._cursorOffset); + const cursorOffsetWidth = context.measureText(cursorOffsetText).width; + let cursorLeft = this._scrollLeft + this._textWidth - cursorOffsetWidth; + if (cursorLeft < clipTextLeft) { + this._scrollLeft += clipTextLeft - cursorLeft; + cursorLeft = clipTextLeft; + this._markAsDirty(); + } else if (cursorLeft > clipTextLeft + availableWidth) { + this._scrollLeft += clipTextLeft + availableWidth - cursorLeft; + cursorLeft = clipTextLeft + availableWidth; + this._markAsDirty(); + } + if (!this.isTextHighlightOn) { + context.fillRect(cursorLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, 2, this._fontOffset.height); + } + } + clearTimeout(this._blinkTimeout); + this._blinkTimeout = setTimeout(() => { + this._blinkIsEven = !this._blinkIsEven; + this._markAsDirty(); + }, 500); + if (this.isTextHighlightOn) { + clearTimeout(this._blinkTimeout); + const highlightCursorOffsetWidth = context.measureText(text.substring(this._startHighlightIndex)).width; + let highlightCursorLeft = this._scrollLeft + this._textWidth - highlightCursorOffsetWidth; + this._highlightedText = text.substring(this._startHighlightIndex, this._endHighlightIndex); + let width = context.measureText(text.substring(this._startHighlightIndex, this._endHighlightIndex)).width; + if (highlightCursorLeft < clipTextLeft) { + width = width - (clipTextLeft - highlightCursorLeft); + if (!width) { + width = context.measureText(text.charAt(text.length - this._cursorOffset)).width; + } + highlightCursorLeft = clipTextLeft; + } + context.globalAlpha = this._highligherOpacity; + context.fillStyle = this._textHighlightColor; + context.fillRect(highlightCursorLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, width, this._fontOffset.height); + context.globalAlpha = 1; + } + } + context.restore(); + if (this._thickness) { + if (this._isFocused) { + if (this.focusedColor) { + context.strokeStyle = this.focusedColor; + } + } else { + if (this.color) { + context.strokeStyle = this.color; + } + } + context.lineWidth = this._thickness; + context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, this._currentMeasure.width - this._thickness, this._currentMeasure.height - this._thickness); + } + context.restore(); + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { + return false; + } + if (this.isReadOnly) { + return true; + } + this._clickedCoordinate = coordinates.x; + this.isTextHighlightOn = false; + this._highlightedText = ""; + this._cursorIndex = -1; + this._isPointerDown = true; + this._host._capturingControl[pointerId] = this; + this._focusedBy = pi.event.pointerType; + if (this._host.focusedControl === this) { + clearTimeout(this._blinkTimeout); + this._markAsDirty(); + return true; + } + if (!this._isEnabled) { + return false; + } + this._host.focusedControl = this; + return true; + } + _onPointerMove(target, coordinates, pointerId, pi) { + if (this._host.focusedControl === this && this._isPointerDown && !this.isReadOnly) { + this._clickedCoordinate = coordinates.x; + this._markAsDirty(); + this._updateValueFromCursorIndex(this._cursorOffset); + } + super._onPointerMove(target, coordinates, pointerId, pi); + } + _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick) { + this._isPointerDown = false; + delete this._host._capturingControl[pointerId]; + super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick); + } + _beforeRenderText(textWrapper5) { + return textWrapper5; + } + set isTextHighlightOn(value) { + if (this._isTextHighlightOn === value) { + return; + } + if (value) { + this.onTextHighlightObservable.notifyObservers(this); + } + this._isTextHighlightOn = value; + } + get isTextHighlightOn() { + return this._isTextHighlightOn; + } + dispose() { + super.dispose(); + this.onBlurObservable.clear(); + this.onFocusObservable.clear(); + this.onTextChangedObservable.clear(); + this.onTextCopyObservable.clear(); + this.onTextCutObservable.clear(); + this.onTextPasteObservable.clear(); + this.onTextHighlightObservable.clear(); + this.onKeyboardEventProcessedObservable.clear(); + } +} +var init_inputText = __esm(() => { + init_tslib_es62(); + init_observable(); + init_clipboardEvents(); + init_pointerEvents(); + init_control(); + init_valueAndUnit(); + init_typeStore(); + init_textWrapper(); + init_decorators(); + __decorate2([ + serialize() + ], InputText2.prototype, "promptMessage", undefined); + __decorate2([ + serialize() + ], InputText2.prototype, "disableMobilePrompt", undefined); + __decorate2([ + serialize() + ], InputText2.prototype, "maxWidth", null); + __decorate2([ + serialize() + ], InputText2.prototype, "highligherOpacity", null); + __decorate2([ + serialize() + ], InputText2.prototype, "onFocusSelectAll", null); + __decorate2([ + serialize() + ], InputText2.prototype, "textHighlightColor", null); + __decorate2([ + serialize() + ], InputText2.prototype, "margin", null); + __decorate2([ + serialize() + ], InputText2.prototype, "autoStretchWidth", null); + __decorate2([ + serialize() + ], InputText2.prototype, "thickness", null); + __decorate2([ + serialize() + ], InputText2.prototype, "focusedBackground", null); + __decorate2([ + serialize() + ], InputText2.prototype, "focusedColor", null); + __decorate2([ + serialize() + ], InputText2.prototype, "background", null); + __decorate2([ + serialize() + ], InputText2.prototype, "placeholderColor", null); + __decorate2([ + serialize() + ], InputText2.prototype, "placeholderText", null); + __decorate2([ + serialize() + ], InputText2.prototype, "deadKey", null); + __decorate2([ + serialize() + ], InputText2.prototype, "text", null); + __decorate2([ + serialize() + ], InputText2.prototype, "width", null); + RegisterClass("BABYLON.GUI.InputText", InputText2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/grid.js +class Grid2 extends Container2 { + set clipContent(value) { + this._clipContent = value; + for (const key in this._cells) { + this._cells[key].clipContent = value; + } + } + get clipContent() { + return this._clipContent; + } + set clipChildren(value) { + this._clipChildren = value; + for (const key in this._cells) { + this._cells[key].clipChildren = value; + } + } + get clipChildren() { + return this._clipChildren; + } + get columnCount() { + return this._columnDefinitions.length; + } + get rowCount() { + return this._rowDefinitions.length; + } + get children() { + return this._childControls; + } + get cells() { + return this._cells; + } + getRowDefinition(index) { + if (index < 0 || index >= this._rowDefinitions.length) { + return null; + } + return this._rowDefinitions[index]; + } + getColumnDefinition(index) { + if (index < 0 || index >= this._columnDefinitions.length) { + return null; + } + return this._columnDefinitions[index]; + } + addRowDefinition(height, isPixel = false) { + this._rowDefinitions.push(new ValueAndUnit2(height, isPixel ? ValueAndUnit2.UNITMODE_PIXEL : ValueAndUnit2.UNITMODE_PERCENTAGE)); + this._rowDefinitionObservers.push(this._rowDefinitions[this.rowCount - 1].onChangedObservable.add(() => this._markAsDirty())); + this._markAsDirty(); + return this; + } + addColumnDefinition(width, isPixel = false) { + this._columnDefinitions.push(new ValueAndUnit2(width, isPixel ? ValueAndUnit2.UNITMODE_PIXEL : ValueAndUnit2.UNITMODE_PERCENTAGE)); + this._columnDefinitionObservers.push(this._columnDefinitions[this.columnCount - 1].onChangedObservable.add(() => this._markAsDirty())); + this._markAsDirty(); + return this; + } + setRowDefinition(index, height, isPixel = false) { + if (index < 0 || index >= this._rowDefinitions.length) { + return this; + } + const current = this._rowDefinitions[index]; + if (current && current.isPixel === isPixel && current.value === height) { + return this; + } + this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]); + this._rowDefinitions[index] = new ValueAndUnit2(height, isPixel ? ValueAndUnit2.UNITMODE_PIXEL : ValueAndUnit2.UNITMODE_PERCENTAGE); + this._rowDefinitionObservers[index] = this._rowDefinitions[index].onChangedObservable.add(() => this._markAsDirty()); + this._markAsDirty(); + return this; + } + setColumnDefinition(index, width, isPixel = false) { + if (index < 0 || index >= this._columnDefinitions.length) { + return this; + } + const current = this._columnDefinitions[index]; + if (current && current.isPixel === isPixel && current.value === width) { + return this; + } + this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]); + this._columnDefinitions[index] = new ValueAndUnit2(width, isPixel ? ValueAndUnit2.UNITMODE_PIXEL : ValueAndUnit2.UNITMODE_PERCENTAGE); + this._columnDefinitionObservers[index] = this._columnDefinitions[index].onChangedObservable.add(() => this._markAsDirty()); + this._markAsDirty(); + return this; + } + getChildrenAt(row, column) { + const cell2 = this._cells[`${row}:${column}`]; + if (!cell2) { + return null; + } + return cell2.children; + } + getChildCellInfo(child) { + return child._tag; + } + _removeCell(cell2, key) { + if (!cell2) { + return; + } + super.removeControl(cell2); + for (const control33 of cell2.children) { + const childIndex = this._childControls.indexOf(control33); + if (childIndex !== -1) { + this._childControls.splice(childIndex, 1); + } + } + delete this._cells[key]; + } + _offsetCell(previousKey, key) { + if (!this._cells[key]) { + return; + } + this._cells[previousKey] = this._cells[key]; + for (const control33 of this._cells[previousKey].children) { + control33._tag = previousKey; + } + delete this._cells[key]; + } + removeColumnDefinition(index) { + if (index < 0 || index >= this._columnDefinitions.length) { + return this; + } + for (let x = 0;x < this._rowDefinitions.length; x++) { + const key = `${x}:${index}`; + const cell2 = this._cells[key]; + this._removeCell(cell2, key); + } + for (let x = 0;x < this._rowDefinitions.length; x++) { + for (let y = index + 1;y < this._columnDefinitions.length; y++) { + const previousKey = `${x}:${y - 1}`; + const key = `${x}:${y}`; + this._offsetCell(previousKey, key); + } + } + this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]); + this._columnDefinitions.splice(index, 1); + this._columnDefinitionObservers.splice(index, 1); + this._markAsDirty(); + return this; + } + removeRowDefinition(index) { + if (index < 0 || index >= this._rowDefinitions.length) { + return this; + } + for (let y = 0;y < this._columnDefinitions.length; y++) { + const key = `${index}:${y}`; + const cell2 = this._cells[key]; + this._removeCell(cell2, key); + } + for (let y = 0;y < this._columnDefinitions.length; y++) { + for (let x = index + 1;x < this._rowDefinitions.length; x++) { + const previousKey = `${x - 1}:${y}`; + const key = `${x}:${y}`; + this._offsetCell(previousKey, key); + } + } + this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]); + this._rowDefinitions.splice(index, 1); + this._rowDefinitionObservers.splice(index, 1); + this._markAsDirty(); + return this; + } + addControl(control33, row = 0, column = 0) { + if (this._rowDefinitions.length === 0) { + this.addRowDefinition(1, false); + } + if (this._columnDefinitions.length === 0) { + this.addColumnDefinition(1, false); + } + if (this._childControls.indexOf(control33) !== -1) { + Tools.Warn(`Control (Name:${control33.name}, UniqueId:${control33.uniqueId}) is already associated with this grid. You must remove it before reattaching it`); + return this; + } + const x = Math.min(row, this._rowDefinitions.length - 1); + const y = Math.min(column, this._columnDefinitions.length - 1); + const key = `${x}:${y}`; + let goodContainer = this._cells[key]; + if (!goodContainer) { + goodContainer = new Container2(key); + this._cells[key] = goodContainer; + goodContainer.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + goodContainer.verticalAlignment = Control2.VERTICAL_ALIGNMENT_TOP; + goodContainer.clipContent = this.clipContent; + goodContainer.clipChildren = this.clipChildren; + super.addControl(goodContainer); + } + goodContainer.addControl(control33); + this._childControls.push(control33); + control33._tag = key; + control33.parent = this; + this._markAsDirty(); + return this; + } + removeControl(control33) { + const index = this._childControls.indexOf(control33); + if (index !== -1) { + this._childControls.splice(index, 1); + } + const cell2 = this._cells[control33._tag]; + if (cell2) { + cell2.removeControl(control33); + control33._tag = null; + } + this._markAsDirty(); + return this; + } + constructor(name314) { + super(name314); + this.name = name314; + this._rowDefinitions = new Array; + this._rowDefinitionObservers = []; + this._columnDefinitions = new Array; + this._columnDefinitionObservers = []; + this._cells = {}; + this._childControls = new Array; + } + _getTypeName() { + return "Grid"; + } + _getGridDefinitions(definitionCallback) { + const widths = []; + const heights = []; + const lefts = []; + const tops = []; + let availableWidth = this._currentMeasure.width; + let globalWidthPercentage = 0; + let availableHeight = this._currentMeasure.height; + let globalHeightPercentage = 0; + let index = 0; + for (const rowDefinition of this._rowDefinitions) { + if (rowDefinition.isPixel) { + const height = rowDefinition.getValue(this._host); + availableHeight -= height; + heights[index] = height; + } else { + globalHeightPercentage += rowDefinition.value; + } + index++; + } + let top = 0; + index = 0; + for (const rowDefinition of this._rowDefinitions) { + tops.push(top); + if (!rowDefinition.isPixel) { + const height = Math.round(rowDefinition.value / globalHeightPercentage * availableHeight); + top += height; + heights[index] = height; + } else { + top += rowDefinition.getValue(this._host); + } + index++; + } + index = 0; + for (const columnDefinition of this._columnDefinitions) { + if (columnDefinition.isPixel) { + const width = columnDefinition.getValue(this._host); + availableWidth -= width; + widths[index] = width; + } else { + globalWidthPercentage += columnDefinition.value; + } + index++; + } + let left = 0; + index = 0; + for (const columnDefinition of this._columnDefinitions) { + lefts.push(left); + if (!columnDefinition.isPixel) { + const width = Math.round(columnDefinition.value / globalWidthPercentage * availableWidth); + left += width; + widths[index] = width; + } else { + left += columnDefinition.getValue(this._host); + } + index++; + } + definitionCallback(lefts, tops, widths, heights); + } + _additionalProcessing(parentMeasure, context) { + this._getGridDefinitions((lefts, tops, widths, heights) => { + for (const key in this._cells) { + if (!Object.prototype.hasOwnProperty.call(this._cells, key)) { + continue; + } + const split = key.split(":"); + const x = parseInt(split[0]); + const y = parseInt(split[1]); + const cell2 = this._cells[key]; + cell2.leftInPixels = lefts[y]; + cell2.topInPixels = tops[x]; + cell2.widthInPixels = widths[y]; + cell2.heightInPixels = heights[x]; + cell2._left.ignoreAdaptiveScaling = true; + cell2._top.ignoreAdaptiveScaling = true; + cell2._width.ignoreAdaptiveScaling = true; + cell2._height.ignoreAdaptiveScaling = true; + } + }); + super._additionalProcessing(parentMeasure, context); + } + _flagDescendantsAsMatrixDirty() { + for (const key in this._cells) { + if (!Object.prototype.hasOwnProperty.call(this._cells, key)) { + continue; + } + const child = this._cells[key]; + child._markMatrixAsDirty(); + } + } + _renderHighlightSpecific(context) { + super._renderHighlightSpecific(context); + this._getGridDefinitions((lefts, tops, widths, heights) => { + for (let index = 0;index < lefts.length; index++) { + const left = this._currentMeasure.left + lefts[index] + widths[index]; + context.beginPath(); + context.moveTo(left, this._currentMeasure.top); + context.lineTo(left, this._currentMeasure.top + this._currentMeasure.height); + context.stroke(); + } + for (let index = 0;index < tops.length; index++) { + const top = this._currentMeasure.top + tops[index] + heights[index]; + context.beginPath(); + context.moveTo(this._currentMeasure.left, top); + context.lineTo(this._currentMeasure.left + this._currentMeasure.width, top); + context.stroke(); + } + }); + context.restore(); + } + dispose() { + super.dispose(); + for (const control33 of this._childControls) { + control33.dispose(); + } + for (let index = 0;index < this._rowDefinitions.length; index++) { + this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]); + } + for (let index = 0;index < this._columnDefinitions.length; index++) { + this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]); + } + this._rowDefinitionObservers.length = 0; + this._rowDefinitions.length = 0; + this._columnDefinitionObservers.length = 0; + this._columnDefinitions.length = 0; + this._cells = {}; + this._childControls.length = 0; + } + serialize(serializationObject) { + super.serialize(serializationObject); + serializationObject.columnCount = this.columnCount; + serializationObject.rowCount = this.rowCount; + serializationObject.columns = []; + serializationObject.rows = []; + serializationObject.tags = []; + for (let i = 0;i < this.columnCount; ++i) { + const cd = this.getColumnDefinition(i); + const childSerializationObject = { value: cd === null || cd === undefined ? undefined : cd.getValue(this.host), unit: cd === null || cd === undefined ? undefined : cd.unit }; + serializationObject.columns.push(childSerializationObject); + } + for (let i = 0;i < this.rowCount; ++i) { + const rd = this.getRowDefinition(i); + const childSerializationObject = { value: rd === null || rd === undefined ? undefined : rd.getValue(this.host), unit: rd === null || rd === undefined ? undefined : rd.unit }; + serializationObject.rows.push(childSerializationObject); + } + this.children.forEach((child) => { + serializationObject.tags.push(child._tag); + }); + } + _parseFromContent(serializedObject, host) { + super._parseFromContent(serializedObject, host); + const children = []; + this.children.forEach((child) => { + children.push(child); + }); + this.removeRowDefinition(0); + this.removeColumnDefinition(0); + for (let i = 0;i < serializedObject.columnCount; ++i) { + const columnValue = serializedObject.columns[i].value; + const unit = serializedObject.columns[i].unit; + this.addColumnDefinition(columnValue, unit === 1 ? true : false); + } + for (let i = 0;i < serializedObject.rowCount; ++i) { + const rowValue = serializedObject.rows[i].value; + const unit = serializedObject.rows[i].unit; + this.addRowDefinition(rowValue, unit === 1 ? true : false); + } + for (let i = 0;i < children.length; ++i) { + const cellInfo = serializedObject.tags[i]; + let rowNumber = parseInt(cellInfo.substring(0, cellInfo.search(":"))); + if (isNaN(rowNumber)) { + rowNumber = 0; + } + let columnNumber = parseInt(cellInfo.substring(cellInfo.search(":") + 1)); + if (isNaN(columnNumber)) { + columnNumber = 0; + } + this.addControl(children[i], rowNumber, columnNumber); + } + } +} +var init_grid2 = __esm(() => { + init_tslib_es62(); + init_container(); + init_valueAndUnit(); + init_control(); + init_tools(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], Grid2.prototype, "clipContent", null); + RegisterClass("BABYLON.GUI.Grid", Grid2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/colorpicker.js +class ColorPicker2 extends Control2 { + get value() { + return this._value; + } + set value(value) { + if (this._value.equals(value)) { + return; + } + this._value.copyFrom(value); + this._value.toHSVToRef(this._tmpColor); + this._h = this._tmpColor.r; + this._s = Math.max(this._tmpColor.g, 0.00001); + this._v = Math.max(this._tmpColor.b, 0.00001); + this._markAsDirty(); + if (this._value.r <= ColorPicker2._Epsilon) { + this._value.r = 0; + } + if (this._value.g <= ColorPicker2._Epsilon) { + this._value.g = 0; + } + if (this._value.b <= ColorPicker2._Epsilon) { + this._value.b = 0; + } + if (this._value.r >= 1 - ColorPicker2._Epsilon) { + this._value.r = 1; + } + if (this._value.g >= 1 - ColorPicker2._Epsilon) { + this._value.g = 1; + } + if (this._value.b >= 1 - ColorPicker2._Epsilon) { + this._value.b = 1; + } + this.onValueChangedObservable.notifyObservers(this._value); + } + get width() { + return this._width.toString(this._host); + } + set width(value) { + if (this._width.toString(this._host) === value) { + return; + } + if (this._width.fromString(value)) { + if (this._width.getValue(this._host) === 0) { + value = "1px"; + this._width.fromString(value); + } + this._height.fromString(value); + this._markAsDirty(); + } + } + get height() { + return this._height.toString(this._host); + } + set height(value) { + if (this._height.toString(this._host) === value) { + return; + } + if (this._height.fromString(value)) { + if (this._height.getValue(this._host) === 0) { + value = "1px"; + this._height.fromString(value); + } + this._width.fromString(value); + this._markAsDirty(); + } + } + get size() { + return this.width; + } + set size(value) { + this.width = value; + } + constructor(name314) { + super(name314); + this.name = name314; + this._value = Color3.Red(); + this._tmpColor = new Color3; + this._pointerStartedOnSquare = false; + this._pointerStartedOnWheel = false; + this._squareLeft = 0; + this._squareTop = 0; + this._squareSize = 0; + this._h = 360; + this._s = 1; + this._v = 1; + this._lastPointerDownId = -1; + this.onValueChangedObservable = new Observable; + this._pointerIsDown = false; + this.value = new Color3(0.88, 0.1, 0.1); + this.size = "200px"; + this.isPointerBlocker = true; + } + _getTypeName() { + return "ColorPicker"; + } + _preMeasure(parentMeasure) { + if (parentMeasure.width < parentMeasure.height) { + this._currentMeasure.height = parentMeasure.width; + } else { + this._currentMeasure.width = parentMeasure.height; + } + } + _updateSquareProps() { + const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5; + const wheelThickness = radius * 0.2; + const innerDiameter = (radius - wheelThickness) * 2; + const squareSize = innerDiameter / Math.sqrt(2); + const offset = radius - squareSize * 0.5; + this._squareLeft = this._currentMeasure.left + offset; + this._squareTop = this._currentMeasure.top + offset; + this._squareSize = squareSize; + } + _drawGradientSquare(hueValue, left, top, width, height, context) { + const lgh = context.createLinearGradient(left, top, width + left, top); + lgh.addColorStop(0, "#fff"); + lgh.addColorStop(1, "hsl(" + hueValue + ", 100%, 50%)"); + context.fillStyle = lgh; + context.fillRect(left, top, width, height); + const lgv = context.createLinearGradient(left, top, left, height + top); + lgv.addColorStop(0, "rgba(0,0,0,0)"); + lgv.addColorStop(1, "#000"); + context.fillStyle = lgv; + context.fillRect(left, top, width, height); + } + _drawCircle(centerX, centerY, radius, context) { + context.beginPath(); + context.arc(centerX, centerY, radius + 1, 0, 2 * Math.PI, false); + context.lineWidth = 3; + context.strokeStyle = "#333333"; + context.stroke(); + context.beginPath(); + context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false); + context.lineWidth = 3; + context.strokeStyle = "#ffffff"; + context.stroke(); + } + _createColorWheelCanvas(radius, thickness) { + const engine47 = EngineStore.LastCreatedEngine; + if (!engine47) { + throw new Error("Invalid engine. Unable to create a canvas."); + } + const canvas = engine47.createCanvas(radius * 2, radius * 2); + const context = canvas.getContext("2d"); + const image8 = context.getImageData(0, 0, radius * 2, radius * 2); + const data = image8.data; + const color = this._tmpColor; + const maxDistSq = radius * radius; + const innerRadius = radius - thickness; + const minDistSq = innerRadius * innerRadius; + for (let x = -radius;x < radius; x++) { + for (let y = -radius;y < radius; y++) { + const distSq = x * x + y * y; + if (distSq > maxDistSq || distSq < minDistSq) { + continue; + } + const dist = Math.sqrt(distSq); + const ang = Math.atan2(y, x); + Color3.HSVtoRGBToRef(ang * 180 / Math.PI + 180, dist / radius, 1, color); + const index = (x + radius + (y + radius) * 2 * radius) * 4; + data[index] = color.r * 255; + data[index + 1] = color.g * 255; + data[index + 2] = color.b * 255; + let alphaRatio = (dist - innerRadius) / (radius - innerRadius); + let alphaAmount = 0.2; + const maxAlpha = 0.2; + const minAlpha = 0.04; + const lowerRadius = 50; + const upperRadius = 150; + if (radius < lowerRadius) { + alphaAmount = maxAlpha; + } else if (radius > upperRadius) { + alphaAmount = minAlpha; + } else { + alphaAmount = (minAlpha - maxAlpha) * (radius - lowerRadius) / (upperRadius - lowerRadius) + maxAlpha; + } + alphaRatio = (dist - innerRadius) / (radius - innerRadius); + if (alphaRatio < alphaAmount) { + data[index + 3] = 255 * (alphaRatio / alphaAmount); + } else if (alphaRatio > 1 - alphaAmount) { + data[index + 3] = 255 * (1 - (alphaRatio - (1 - alphaAmount)) / alphaAmount); + } else { + data[index + 3] = 255; + } + } + } + context.putImageData(image8, 0, 0); + return canvas; + } + _draw(context) { + context.save(); + this._applyStates(context); + const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5; + const wheelThickness = radius * 0.2; + const left = this._currentMeasure.left; + const top = this._currentMeasure.top; + if (!this._colorWheelCanvas || this._colorWheelCanvas.width != radius * 2) { + this._colorWheelCanvas = this._createColorWheelCanvas(radius, wheelThickness); + } + this._updateSquareProps(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + context.fillRect(this._squareLeft, this._squareTop, this._squareSize, this._squareSize); + } + context.drawImage(this._colorWheelCanvas, left, top); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + this._drawGradientSquare(this._h, this._squareLeft, this._squareTop, this._squareSize, this._squareSize, context); + let cx = this._squareLeft + this._squareSize * this._s; + let cy = this._squareTop + this._squareSize * (1 - this._v); + this._drawCircle(cx, cy, radius * 0.04, context); + const dist = radius - wheelThickness * 0.5; + cx = left + radius + Math.cos((this._h - 180) * Math.PI / 180) * dist; + cy = top + radius + Math.sin((this._h - 180) * Math.PI / 180) * dist; + this._drawCircle(cx, cy, wheelThickness * 0.35, context); + context.restore(); + } + _updateValueFromPointer(x, y) { + if (this._pointerStartedOnWheel) { + const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5; + const centerX = radius + this._currentMeasure.left; + const centerY = radius + this._currentMeasure.top; + this._h = Math.atan2(y - centerY, x - centerX) * 180 / Math.PI + 180; + } else if (this._pointerStartedOnSquare) { + this._updateSquareProps(); + this._s = (x - this._squareLeft) / this._squareSize; + this._v = 1 - (y - this._squareTop) / this._squareSize; + this._s = Math.min(this._s, 1); + this._s = Math.max(this._s, ColorPicker2._Epsilon); + this._v = Math.min(this._v, 1); + this._v = Math.max(this._v, ColorPicker2._Epsilon); + } + Color3.HSVtoRGBToRef(this._h, this._s, this._v, this._tmpColor); + this.value = this._tmpColor; + } + _isPointOnSquare(x, y) { + this._updateSquareProps(); + const left = this._squareLeft; + const top = this._squareTop; + const size = this._squareSize; + if (x >= left && x <= left + size && y >= top && y <= top + size) { + return true; + } + return false; + } + _isPointOnWheel(x, y) { + const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5; + const centerX = radius + this._currentMeasure.left; + const centerY = radius + this._currentMeasure.top; + const wheelThickness = radius * 0.2; + const innerRadius = radius - wheelThickness; + const radiusSq = radius * radius; + const innerRadiusSq = innerRadius * innerRadius; + const dx = x - centerX; + const dy = y - centerY; + const distSq = dx * dx + dy * dy; + if (distSq <= radiusSq && distSq >= innerRadiusSq) { + return true; + } + return false; + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { + return false; + } + if (this.isReadOnly) { + return true; + } + this._pointerIsDown = true; + this._pointerStartedOnSquare = false; + this._pointerStartedOnWheel = false; + this._invertTransformMatrix.transformCoordinates(coordinates.x, coordinates.y, this._transformedPosition); + const x = this._transformedPosition.x; + const y = this._transformedPosition.y; + if (this._isPointOnSquare(x, y)) { + this._pointerStartedOnSquare = true; + } else if (this._isPointOnWheel(x, y)) { + this._pointerStartedOnWheel = true; + } + this._updateValueFromPointer(x, y); + this._host._capturingControl[pointerId] = this; + this._lastPointerDownId = pointerId; + return true; + } + _onPointerMove(target, coordinates, pointerId, pi) { + if (pointerId != this._lastPointerDownId) { + return; + } + if (!this.isReadOnly) { + this._invertTransformMatrix.transformCoordinates(coordinates.x, coordinates.y, this._transformedPosition); + const x = this._transformedPosition.x; + const y = this._transformedPosition.y; + if (this._pointerIsDown) { + this._updateValueFromPointer(x, y); + } + } + super._onPointerMove(target, coordinates, pointerId, pi); + } + _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi) { + this._pointerIsDown = false; + delete this._host._capturingControl[pointerId]; + super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi); + } + _onCanvasBlur() { + this._forcePointerUp(); + super._onCanvasBlur(); + } + static ShowPickerDialogAsync(advancedTexture, options) { + return new Promise((resolve) => { + options.pickerWidth = options.pickerWidth || "640px"; + options.pickerHeight = options.pickerHeight || "400px"; + options.headerHeight = options.headerHeight || "35px"; + options.lastColor = options.lastColor || "#000000"; + options.swatchLimit = options.swatchLimit || 20; + options.numSwatchesPerLine = options.numSwatchesPerLine || 10; + const drawerMaxRows = options.swatchLimit / options.numSwatchesPerLine; + const rawSwatchSize = parseFloat(options.pickerWidth) / options.numSwatchesPerLine; + const gutterSize = Math.floor(rawSwatchSize * 0.25); + const colGutters = gutterSize * (options.numSwatchesPerLine + 1); + const swatchSize = Math.floor((parseFloat(options.pickerWidth) - colGutters) / options.numSwatchesPerLine); + const drawerMaxSize = swatchSize * drawerMaxRows + gutterSize * (drawerMaxRows + 1); + const containerSize = (parseInt(options.pickerHeight) + drawerMaxSize + Math.floor(swatchSize * 0.25)).toString() + "px"; + const buttonColor = "#c0c0c0"; + const buttonBackgroundColor = "#535353"; + const buttonBackgroundHoverColor = "#414141"; + const buttonBackgroundClickColor = "515151"; + const buttonDisabledColor = "#555555"; + const buttonDisabledBackgroundColor = "#454545"; + const currentSwatchesOutlineColor = "#404040"; + const luminanceLimitColor = Color3.FromHexString("#dddddd"); + const luminanceLimit = luminanceLimitColor.r + luminanceLimitColor.g + luminanceLimitColor.b; + const iconColorDark = "#aaaaaa"; + const iconColorLight = "#ffffff"; + let buttonFontSize; + let butEdit; + const inputFieldLabels = ["R", "G", "B"]; + const inputTextBackgroundColor = "#454545"; + const inputTextColor = "#f0f0f0"; + let swatchNumber; + let swatchDrawer; + let editSwatchMode = false; + let butSave; + let lastVal; + let activeField; + const dialogContainer = new Grid2; + dialogContainer.name = "Dialog Container"; + dialogContainer.width = options.pickerWidth; + if (options.savedColors) { + dialogContainer.height = containerSize; + const topRow = parseInt(options.pickerHeight) / parseInt(containerSize); + dialogContainer.addRowDefinition(topRow, false); + dialogContainer.addRowDefinition(1 - topRow, false); + } else { + dialogContainer.height = options.pickerHeight; + dialogContainer.addRowDefinition(1, false); + } + advancedTexture.addControl(dialogContainer); + if (options.savedColors) { + swatchDrawer = new Grid2; + swatchDrawer.name = "Swatch Drawer"; + swatchDrawer.verticalAlignment = Control2.VERTICAL_ALIGNMENT_TOP; + swatchDrawer.background = buttonBackgroundColor; + swatchDrawer.width = options.pickerWidth; + const initialRows = options.savedColors.length / options.numSwatchesPerLine; + let gutterCount; + if (initialRows == 0) { + gutterCount = 0; + } else { + gutterCount = initialRows + 1; + } + swatchDrawer.height = (swatchSize * initialRows + gutterCount * gutterSize).toString() + "px"; + swatchDrawer.top = Math.floor(swatchSize * 0.25).toString() + "px"; + for (let i = 0;i < Math.ceil(options.savedColors.length / options.numSwatchesPerLine) * 2 + 1; i++) { + if (i % 2 != 0) { + swatchDrawer.addRowDefinition(swatchSize, true); + } else { + swatchDrawer.addRowDefinition(gutterSize, true); + } + } + for (let i = 0;i < options.numSwatchesPerLine * 2 + 1; i++) { + if (i % 2 != 0) { + swatchDrawer.addColumnDefinition(swatchSize, true); + } else { + swatchDrawer.addColumnDefinition(gutterSize, true); + } + } + dialogContainer.addControl(swatchDrawer, 1, 0); + } + const pickerPanel = new Grid2; + pickerPanel.name = "Picker Panel"; + pickerPanel.height = options.pickerHeight; + const panelHead = parseInt(options.headerHeight) / parseInt(options.pickerHeight); + const pickerPanelRows = [panelHead, 1 - panelHead]; + pickerPanel.addRowDefinition(pickerPanelRows[0], false); + pickerPanel.addRowDefinition(pickerPanelRows[1], false); + dialogContainer.addControl(pickerPanel, 0, 0); + const header = new Rectangle2; + header.name = "Dialogue Header Bar"; + header.background = "#cccccc"; + header.thickness = 0; + pickerPanel.addControl(header, 0, 0); + const closeButton = Button2.CreateSimpleButton("closeButton", "a"); + closeButton.fontFamily = "coreglyphs"; + const headerColor3 = Color3.FromHexString(header.background); + const closeIconColor = new Color3(1 - headerColor3.r, 1 - headerColor3.g, 1 - headerColor3.b); + closeButton.color = closeIconColor.toHexString(); + closeButton.fontSize = Math.floor(parseInt(options.headerHeight) * 0.6); + closeButton.textBlock.textVerticalAlignment = Control2.VERTICAL_ALIGNMENT_CENTER; + closeButton.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_RIGHT; + closeButton.height = closeButton.width = options.headerHeight; + closeButton.background = header.background; + closeButton.thickness = 0; + closeButton.pointerDownAnimation = () => { + }; + closeButton.pointerUpAnimation = () => { + closeButton.background = header.background; + }; + closeButton.pointerEnterAnimation = () => { + closeButton.color = header.background; + closeButton.background = "red"; + }; + closeButton.pointerOutAnimation = () => { + closeButton.color = closeIconColor.toHexString(); + closeButton.background = header.background; + }; + closeButton.onPointerClickObservable.add(() => { + closePicker(currentSwatch.background); + }); + pickerPanel.addControl(closeButton, 0, 0); + const dialogBody = new Grid2; + dialogBody.name = "Dialogue Body"; + dialogBody.background = buttonBackgroundColor; + const dialogBodyCols = [0.4375, 0.5625]; + dialogBody.addRowDefinition(1, false); + dialogBody.addColumnDefinition(dialogBodyCols[0], false); + dialogBody.addColumnDefinition(dialogBodyCols[1], false); + pickerPanel.addControl(dialogBody, 1, 0); + const pickerGrid = new Grid2; + pickerGrid.name = "Picker Grid"; + pickerGrid.addRowDefinition(0.85, false); + pickerGrid.addRowDefinition(0.15, false); + dialogBody.addControl(pickerGrid, 0, 0); + const picker = new ColorPicker2; + picker.name = "GUI Color Picker"; + if (options.pickerHeight < options.pickerWidth) { + picker.width = 0.89; + } else { + picker.height = 0.89; + } + picker.value = Color3.FromHexString(options.lastColor); + picker.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_CENTER; + picker.verticalAlignment = Control2.VERTICAL_ALIGNMENT_CENTER; + picker.onPointerDownObservable.add(() => { + activeField = picker.name; + lastVal = ""; + editSwatches(false); + }); + picker.onValueChangedObservable.add(function(value) { + if (activeField == picker.name) { + updateValues(value, picker.name); + } + }); + pickerGrid.addControl(picker, 0, 0); + const pickerBodyRight = new Grid2; + pickerBodyRight.name = "Dialogue Right Half"; + pickerBodyRight.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + const pickerBodyRightRows = [0.514, 0.486]; + pickerBodyRight.addRowDefinition(pickerBodyRightRows[0], false); + pickerBodyRight.addRowDefinition(pickerBodyRightRows[1], false); + dialogBody.addControl(pickerBodyRight, 1, 1); + const pickerSwatchesButtons = new Grid2; + pickerSwatchesButtons.name = "Swatches and Buttons"; + const pickerButtonsCol = [0.417, 0.583]; + pickerSwatchesButtons.addRowDefinition(1, false); + pickerSwatchesButtons.addColumnDefinition(pickerButtonsCol[0], false); + pickerSwatchesButtons.addColumnDefinition(pickerButtonsCol[1], false); + pickerBodyRight.addControl(pickerSwatchesButtons, 0, 0); + const pickerSwatches = new Grid2; + pickerSwatches.name = "New and Current Swatches"; + const pickeSwatchesRows = [0.04, 0.16, 0.64, 0.16]; + pickerSwatches.addRowDefinition(pickeSwatchesRows[0], false); + pickerSwatches.addRowDefinition(pickeSwatchesRows[1], false); + pickerSwatches.addRowDefinition(pickeSwatchesRows[2], false); + pickerSwatches.addRowDefinition(pickeSwatchesRows[3], false); + pickerSwatchesButtons.addControl(pickerSwatches, 0, 0); + const activeSwatches = new Grid2; + activeSwatches.name = "Active Swatches"; + activeSwatches.width = 0.67; + activeSwatches.addRowDefinition(0.5, false); + activeSwatches.addRowDefinition(0.5, false); + pickerSwatches.addControl(activeSwatches, 2, 0); + const labelWidth = Math.floor(parseInt(options.pickerWidth) * dialogBodyCols[1] * pickerButtonsCol[0] * 0.11); + const labelHeight = Math.floor(parseInt(options.pickerHeight) * pickerPanelRows[1] * pickerBodyRightRows[0] * pickeSwatchesRows[1] * 0.5); + let labelTextSize; + if (options.pickerWidth > options.pickerHeight) { + labelTextSize = labelHeight; + } else { + labelTextSize = labelWidth; + } + const newText = new TextBlock2; + newText.text = "new"; + newText.name = "New Color Label"; + newText.color = buttonColor; + newText.fontSize = labelTextSize; + pickerSwatches.addControl(newText, 1, 0); + const newSwatch = new Rectangle2; + newSwatch.name = "New Color Swatch"; + newSwatch.background = options.lastColor; + newSwatch.thickness = 0; + activeSwatches.addControl(newSwatch, 0, 0); + const currentSwatch = Button2.CreateSimpleButton("currentSwatch", ""); + currentSwatch.background = options.lastColor; + currentSwatch.thickness = 0; + currentSwatch.onPointerClickObservable.add(() => { + const revertColor = Color3.FromHexString(currentSwatch.background); + updateValues(revertColor, currentSwatch.name); + editSwatches(false); + }); + currentSwatch.pointerDownAnimation = () => { + }; + currentSwatch.pointerUpAnimation = () => { + }; + currentSwatch.pointerEnterAnimation = () => { + }; + currentSwatch.pointerOutAnimation = () => { + }; + activeSwatches.addControl(currentSwatch, 1, 0); + const swatchOutline = new Rectangle2; + swatchOutline.name = "Swatch Outline"; + swatchOutline.width = 0.67; + swatchOutline.thickness = 2; + swatchOutline.color = currentSwatchesOutlineColor; + swatchOutline.isHitTestVisible = false; + pickerSwatches.addControl(swatchOutline, 2, 0); + const currentText = new TextBlock2; + currentText.name = "Current Color Label"; + currentText.text = "current"; + currentText.color = buttonColor; + currentText.fontSize = labelTextSize; + pickerSwatches.addControl(currentText, 3, 0); + const buttonGrid = new Grid2; + buttonGrid.name = "Button Grid"; + buttonGrid.height = 0.8; + const buttonGridRows = 1 / 3; + buttonGrid.addRowDefinition(buttonGridRows, false); + buttonGrid.addRowDefinition(buttonGridRows, false); + buttonGrid.addRowDefinition(buttonGridRows, false); + pickerSwatchesButtons.addControl(buttonGrid, 0, 1); + const buttonWidth = Math.floor(parseInt(options.pickerWidth) * dialogBodyCols[1] * pickerButtonsCol[1] * 0.67).toString() + "px"; + const buttonHeight = Math.floor(parseInt(options.pickerHeight) * pickerPanelRows[1] * pickerBodyRightRows[0] * (parseFloat(buttonGrid.height.toString()) / 100) * buttonGridRows * 0.7).toString() + "px"; + if (parseFloat(buttonWidth) > parseFloat(buttonHeight)) { + buttonFontSize = Math.floor(parseFloat(buttonHeight) * 0.45); + } else { + buttonFontSize = Math.floor(parseFloat(buttonWidth) * 0.11); + } + const butOK = Button2.CreateSimpleButton("butOK", "OK"); + butOK.width = buttonWidth; + butOK.height = buttonHeight; + butOK.verticalAlignment = Control2.VERTICAL_ALIGNMENT_CENTER; + butOK.thickness = 2; + butOK.color = buttonColor; + butOK.fontSize = buttonFontSize; + butOK.background = buttonBackgroundColor; + butOK.onPointerEnterObservable.add(() => { + butOK.background = buttonBackgroundHoverColor; + }); + butOK.onPointerOutObservable.add(() => { + butOK.background = buttonBackgroundColor; + }); + butOK.pointerDownAnimation = () => { + butOK.background = buttonBackgroundClickColor; + }; + butOK.pointerUpAnimation = () => { + butOK.background = buttonBackgroundHoverColor; + }; + butOK.onPointerClickObservable.add(() => { + editSwatches(false); + closePicker(newSwatch.background); + }); + buttonGrid.addControl(butOK, 0, 0); + const butCancel = Button2.CreateSimpleButton("butCancel", "Cancel"); + butCancel.width = buttonWidth; + butCancel.height = buttonHeight; + butCancel.verticalAlignment = Control2.VERTICAL_ALIGNMENT_CENTER; + butCancel.thickness = 2; + butCancel.color = buttonColor; + butCancel.fontSize = buttonFontSize; + butCancel.background = buttonBackgroundColor; + butCancel.onPointerEnterObservable.add(() => { + butCancel.background = buttonBackgroundHoverColor; + }); + butCancel.onPointerOutObservable.add(() => { + butCancel.background = buttonBackgroundColor; + }); + butCancel.pointerDownAnimation = () => { + butCancel.background = buttonBackgroundClickColor; + }; + butCancel.pointerUpAnimation = () => { + butCancel.background = buttonBackgroundHoverColor; + }; + butCancel.onPointerClickObservable.add(() => { + editSwatches(false); + closePicker(currentSwatch.background); + }); + buttonGrid.addControl(butCancel, 1, 0); + if (options.savedColors) { + butSave = Button2.CreateSimpleButton("butSave", "Save"); + butSave.width = buttonWidth; + butSave.height = buttonHeight; + butSave.verticalAlignment = Control2.VERTICAL_ALIGNMENT_CENTER; + butSave.thickness = 2; + butSave.fontSize = buttonFontSize; + if (options.savedColors.length < options.swatchLimit) { + butSave.color = buttonColor; + butSave.background = buttonBackgroundColor; + } else { + disableButton(butSave, true); + } + butSave.onPointerEnterObservable.add(() => { + if (options.savedColors) { + if (options.savedColors.length < options.swatchLimit) { + butSave.background = buttonBackgroundHoverColor; + } + } + }); + butSave.onPointerOutObservable.add(() => { + if (options.savedColors) { + if (options.savedColors.length < options.swatchLimit) { + butSave.background = buttonBackgroundColor; + } + } + }); + butSave.pointerDownAnimation = () => { + if (options.savedColors) { + if (options.savedColors.length < options.swatchLimit) { + butSave.background = buttonBackgroundClickColor; + } + } + }; + butSave.pointerUpAnimation = () => { + if (options.savedColors) { + if (options.savedColors.length < options.swatchLimit) { + butSave.background = buttonBackgroundHoverColor; + } + } + }; + butSave.onPointerClickObservable.add(() => { + if (options.savedColors) { + if (options.savedColors.length == 0) { + setEditButtonVisibility(true); + } + if (options.savedColors.length < options.swatchLimit) { + updateSwatches(newSwatch.background, butSave); + } + editSwatches(false); + } + }); + if (options.savedColors.length > 0) { + setEditButtonVisibility(true); + } + buttonGrid.addControl(butSave, 2, 0); + } + const pickerColorValues = new Grid2; + pickerColorValues.name = "Dialog Lower Right"; + pickerColorValues.addRowDefinition(0.02, false); + pickerColorValues.addRowDefinition(0.63, false); + pickerColorValues.addRowDefinition(0.21, false); + pickerColorValues.addRowDefinition(0.14, false); + pickerBodyRight.addControl(pickerColorValues, 1, 0); + const currentColor = Color3.FromHexString(options.lastColor); + const rgbValuesQuadrant = new Grid2; + rgbValuesQuadrant.name = "RGB Values"; + rgbValuesQuadrant.width = 0.82; + rgbValuesQuadrant.verticalAlignment = Control2.VERTICAL_ALIGNMENT_CENTER; + rgbValuesQuadrant.addRowDefinition(1 / 3, false); + rgbValuesQuadrant.addRowDefinition(1 / 3, false); + rgbValuesQuadrant.addRowDefinition(1 / 3, false); + rgbValuesQuadrant.addColumnDefinition(0.1, false); + rgbValuesQuadrant.addColumnDefinition(0.2, false); + rgbValuesQuadrant.addColumnDefinition(0.7, false); + pickerColorValues.addControl(rgbValuesQuadrant, 1, 0); + for (let i = 0;i < inputFieldLabels.length; i++) { + const labelText2 = new TextBlock2; + labelText2.text = inputFieldLabels[i]; + labelText2.color = buttonColor; + labelText2.fontSize = buttonFontSize; + rgbValuesQuadrant.addControl(labelText2, i, 0); + } + const rValInt = new InputText2; + rValInt.width = 0.83; + rValInt.height = 0.72; + rValInt.name = "rIntField"; + rValInt.fontSize = buttonFontSize; + rValInt.text = (currentColor.r * 255).toString(); + rValInt.color = inputTextColor; + rValInt.background = inputTextBackgroundColor; + rValInt.onFocusObservable.add(() => { + activeField = rValInt.name; + lastVal = rValInt.text; + editSwatches(false); + }); + rValInt.onBlurObservable.add(() => { + if (rValInt.text == "") { + rValInt.text = "0"; + } + updateInt(rValInt, "r"); + if (activeField == rValInt.name) { + activeField = ""; + } + }); + rValInt.onTextChangedObservable.add(() => { + if (activeField == rValInt.name) { + updateInt(rValInt, "r"); + } + }); + rgbValuesQuadrant.addControl(rValInt, 0, 1); + const gValInt = new InputText2; + gValInt.width = 0.83; + gValInt.height = 0.72; + gValInt.name = "gIntField"; + gValInt.fontSize = buttonFontSize; + gValInt.text = (currentColor.g * 255).toString(); + gValInt.color = inputTextColor; + gValInt.background = inputTextBackgroundColor; + gValInt.onFocusObservable.add(() => { + activeField = gValInt.name; + lastVal = gValInt.text; + editSwatches(false); + }); + gValInt.onBlurObservable.add(() => { + if (gValInt.text == "") { + gValInt.text = "0"; + } + updateInt(gValInt, "g"); + if (activeField == gValInt.name) { + activeField = ""; + } + }); + gValInt.onTextChangedObservable.add(() => { + if (activeField == gValInt.name) { + updateInt(gValInt, "g"); + } + }); + rgbValuesQuadrant.addControl(gValInt, 1, 1); + const bValInt = new InputText2; + bValInt.width = 0.83; + bValInt.height = 0.72; + bValInt.name = "bIntField"; + bValInt.fontSize = buttonFontSize; + bValInt.text = (currentColor.b * 255).toString(); + bValInt.color = inputTextColor; + bValInt.background = inputTextBackgroundColor; + bValInt.onFocusObservable.add(() => { + activeField = bValInt.name; + lastVal = bValInt.text; + editSwatches(false); + }); + bValInt.onBlurObservable.add(() => { + if (bValInt.text == "") { + bValInt.text = "0"; + } + updateInt(bValInt, "b"); + if (activeField == bValInt.name) { + activeField = ""; + } + }); + bValInt.onTextChangedObservable.add(() => { + if (activeField == bValInt.name) { + updateInt(bValInt, "b"); + } + }); + rgbValuesQuadrant.addControl(bValInt, 2, 1); + const rValDec = new InputText2; + rValDec.width = 0.95; + rValDec.height = 0.72; + rValDec.name = "rDecField"; + rValDec.fontSize = buttonFontSize; + rValDec.text = currentColor.r.toString(); + rValDec.color = inputTextColor; + rValDec.background = inputTextBackgroundColor; + rValDec.onFocusObservable.add(() => { + activeField = rValDec.name; + lastVal = rValDec.text; + editSwatches(false); + }); + rValDec.onBlurObservable.add(() => { + if (parseFloat(rValDec.text) == 0 || rValDec.text == "") { + rValDec.text = "0"; + updateFloat(rValDec, "r"); + } + if (activeField == rValDec.name) { + activeField = ""; + } + }); + rValDec.onTextChangedObservable.add(() => { + if (activeField == rValDec.name) { + updateFloat(rValDec, "r"); + } + }); + rgbValuesQuadrant.addControl(rValDec, 0, 2); + const gValDec = new InputText2; + gValDec.width = 0.95; + gValDec.height = 0.72; + gValDec.name = "gDecField"; + gValDec.fontSize = buttonFontSize; + gValDec.text = currentColor.g.toString(); + gValDec.color = inputTextColor; + gValDec.background = inputTextBackgroundColor; + gValDec.onFocusObservable.add(() => { + activeField = gValDec.name; + lastVal = gValDec.text; + editSwatches(false); + }); + gValDec.onBlurObservable.add(() => { + if (parseFloat(gValDec.text) == 0 || gValDec.text == "") { + gValDec.text = "0"; + updateFloat(gValDec, "g"); + } + if (activeField == gValDec.name) { + activeField = ""; + } + }); + gValDec.onTextChangedObservable.add(() => { + if (activeField == gValDec.name) { + updateFloat(gValDec, "g"); + } + }); + rgbValuesQuadrant.addControl(gValDec, 1, 2); + const bValDec = new InputText2; + bValDec.width = 0.95; + bValDec.height = 0.72; + bValDec.name = "bDecField"; + bValDec.fontSize = buttonFontSize; + bValDec.text = currentColor.b.toString(); + bValDec.color = inputTextColor; + bValDec.background = inputTextBackgroundColor; + bValDec.onFocusObservable.add(() => { + activeField = bValDec.name; + lastVal = bValDec.text; + editSwatches(false); + }); + bValDec.onBlurObservable.add(() => { + if (parseFloat(bValDec.text) == 0 || bValDec.text == "") { + bValDec.text = "0"; + updateFloat(bValDec, "b"); + } + if (activeField == bValDec.name) { + activeField = ""; + } + }); + bValDec.onTextChangedObservable.add(() => { + if (activeField == bValDec.name) { + updateFloat(bValDec, "b"); + } + }); + rgbValuesQuadrant.addControl(bValDec, 2, 2); + const hexValueQuadrant = new Grid2; + hexValueQuadrant.name = "Hex Value"; + hexValueQuadrant.width = 0.82; + hexValueQuadrant.addRowDefinition(1, false); + hexValueQuadrant.addColumnDefinition(0.1, false); + hexValueQuadrant.addColumnDefinition(0.9, false); + pickerColorValues.addControl(hexValueQuadrant, 2, 0); + const labelText = new TextBlock2; + labelText.text = "#"; + labelText.color = buttonColor; + labelText.fontSize = buttonFontSize; + hexValueQuadrant.addControl(labelText, 0, 0); + const hexVal = new InputText2; + hexVal.width = 0.96; + hexVal.height = 0.72; + hexVal.name = "hexField"; + hexVal.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_CENTER; + hexVal.fontSize = buttonFontSize; + const minusPound = options.lastColor.split("#"); + hexVal.text = minusPound[1]; + hexVal.color = inputTextColor; + hexVal.background = inputTextBackgroundColor; + hexVal.onFocusObservable.add(() => { + activeField = hexVal.name; + lastVal = hexVal.text; + editSwatches(false); + }); + hexVal.onBlurObservable.add(() => { + if (hexVal.text.length == 3) { + const val = hexVal.text.split(""); + hexVal.text = val[0] + val[0] + val[1] + val[1] + val[2] + val[2]; + } + if (hexVal.text == "") { + hexVal.text = "000000"; + updateValues(Color3.FromHexString(hexVal.text), "b"); + } + if (activeField == hexVal.name) { + activeField = ""; + } + }); + hexVal.onTextChangedObservable.add(() => { + let newHexValue = hexVal.text; + const checkHex = /[^0-9A-F]/i.test(newHexValue); + if ((hexVal.text.length > 6 || checkHex) && activeField == hexVal.name) { + hexVal.text = lastVal; + } else { + if (hexVal.text.length < 6) { + const leadingZero = 6 - hexVal.text.length; + for (let i = 0;i < leadingZero; i++) { + newHexValue = "0" + newHexValue; + } + } + if (hexVal.text.length == 3) { + const val = hexVal.text.split(""); + newHexValue = val[0] + val[0] + val[1] + val[1] + val[2] + val[2]; + } + newHexValue = "#" + newHexValue; + if (activeField == hexVal.name) { + lastVal = hexVal.text; + updateValues(Color3.FromHexString(newHexValue), hexVal.name); + } + } + }); + hexValueQuadrant.addControl(hexVal, 0, 1); + if (options.savedColors && options.savedColors.length > 0) { + updateSwatches("", butSave); + } + function updateValues(value, inputField) { + activeField = inputField; + const pickedColor = value.toHexString(); + newSwatch.background = pickedColor; + if (rValInt.name != activeField) { + rValInt.text = Math.floor(value.r * 255).toString(); + } + if (gValInt.name != activeField) { + gValInt.text = Math.floor(value.g * 255).toString(); + } + if (bValInt.name != activeField) { + bValInt.text = Math.floor(value.b * 255).toString(); + } + if (rValDec.name != activeField) { + rValDec.text = value.r.toString(); + } + if (gValDec.name != activeField) { + gValDec.text = value.g.toString(); + } + if (bValDec.name != activeField) { + bValDec.text = value.b.toString(); + } + if (hexVal.name != activeField) { + const minusPound2 = pickedColor.split("#"); + hexVal.text = minusPound2[1]; + } + if (picker.name != activeField) { + picker.value = value; + } + } + function updateInt(field, channel) { + let newValue = field.text; + const checkVal = /[^0-9]/g.test(newValue); + if (checkVal) { + field.text = lastVal; + return; + } else { + if (newValue != "") { + if (Math.floor(parseInt(newValue)) < 0) { + newValue = "0"; + } else if (Math.floor(parseInt(newValue)) > 255) { + newValue = "255"; + } else if (isNaN(parseInt(newValue))) { + newValue = "0"; + } + } + if (activeField == field.name) { + lastVal = newValue; + } + } + if (newValue != "") { + newValue = parseInt(newValue).toString(); + field.text = newValue; + const newSwatchRGB = Color3.FromHexString(newSwatch.background); + if (activeField == field.name) { + if (channel == "r") { + updateValues(new Color3(parseInt(newValue) / 255, newSwatchRGB.g, newSwatchRGB.b), field.name); + } else if (channel == "g") { + updateValues(new Color3(newSwatchRGB.r, parseInt(newValue) / 255, newSwatchRGB.b), field.name); + } else { + updateValues(new Color3(newSwatchRGB.r, newSwatchRGB.g, parseInt(newValue) / 255), field.name); + } + } + } + } + function updateFloat(field, channel) { + let newValue = field.text; + const checkVal = /[^0-9.]/g.test(newValue); + if (checkVal) { + field.text = lastVal; + return; + } else { + if (newValue != "" && newValue != "." && parseFloat(newValue) != 0) { + if (parseFloat(newValue) < 0) { + newValue = "0.0"; + } else if (parseFloat(newValue) > 1) { + newValue = "1.0"; + } else if (isNaN(parseFloat(newValue))) { + newValue = "0.0"; + } + } + if (activeField == field.name) { + lastVal = newValue; + } + } + if (newValue != "" && newValue != "." && parseFloat(newValue) != 0) { + newValue = parseFloat(newValue).toString(); + field.text = newValue; + } else { + newValue = "0.0"; + } + const newSwatchRGB = Color3.FromHexString(newSwatch.background); + if (activeField == field.name) { + if (channel == "r") { + updateValues(new Color3(parseFloat(newValue), newSwatchRGB.g, newSwatchRGB.b), field.name); + } else if (channel == "g") { + updateValues(new Color3(newSwatchRGB.r, parseFloat(newValue), newSwatchRGB.b), field.name); + } else { + updateValues(new Color3(newSwatchRGB.r, newSwatchRGB.g, parseFloat(newValue)), field.name); + } + } + } + function deleteSwatch(index) { + if (options.savedColors) { + options.savedColors.splice(index, 1); + } + if (options.savedColors && options.savedColors.length == 0) { + setEditButtonVisibility(false); + editSwatchMode = false; + } + } + function createSwatch() { + if (options.savedColors && options.savedColors[swatchNumber]) { + let icon; + if (editSwatchMode) { + icon = "b"; + } else { + icon = ""; + } + const swatch = Button2.CreateSimpleButton("Swatch_" + swatchNumber, icon); + swatch.fontFamily = "coreglyphs"; + const swatchColor = Color3.FromHexString(options.savedColors[swatchNumber]); + const swatchLuminence = swatchColor.r + swatchColor.g + swatchColor.b; + if (swatchLuminence > luminanceLimit) { + swatch.color = iconColorDark; + } else { + swatch.color = iconColorLight; + } + swatch.fontSize = Math.floor(swatchSize * 0.7); + swatch.textBlock.verticalAlignment = Control2.VERTICAL_ALIGNMENT_CENTER; + swatch.height = swatch.width = swatchSize.toString() + "px"; + swatch.background = options.savedColors[swatchNumber]; + swatch.thickness = 2; + const metadata = swatchNumber; + swatch.pointerDownAnimation = () => { + swatch.thickness = 4; + }; + swatch.pointerUpAnimation = () => { + swatch.thickness = 3; + }; + swatch.pointerEnterAnimation = () => { + swatch.thickness = 3; + }; + swatch.pointerOutAnimation = () => { + swatch.thickness = 2; + }; + swatch.onPointerClickObservable.add(() => { + if (!editSwatchMode) { + if (options.savedColors) { + updateValues(Color3.FromHexString(options.savedColors[metadata]), swatch.name); + } + } else { + deleteSwatch(metadata); + updateSwatches("", butSave); + } + }); + return swatch; + } else { + return null; + } + } + function editSwatches(mode) { + if (mode !== undefined) { + editSwatchMode = mode; + } + let thisButton; + if (editSwatchMode) { + for (let i = 0;i < swatchDrawer.children.length; i++) { + thisButton = swatchDrawer.children[i]; + thisButton.textBlock.text = "b"; + } + if (butEdit !== undefined) { + butEdit.textBlock.text = "Done"; + } + } else { + for (let i = 0;i < swatchDrawer.children.length; i++) { + thisButton = swatchDrawer.children[i]; + thisButton.textBlock.text = ""; + } + if (butEdit !== undefined) { + butEdit.textBlock.text = "Edit"; + } + } + } + function updateSwatches(color, button6) { + if (options.savedColors) { + if (color != "") { + options.savedColors.push(color); + } + swatchNumber = 0; + swatchDrawer.clearControls(); + const rowCount = Math.ceil(options.savedColors.length / options.numSwatchesPerLine); + let gutterCount; + if (rowCount == 0) { + gutterCount = 0; + } else { + gutterCount = rowCount + 1; + } + if (swatchDrawer.rowCount != rowCount + gutterCount) { + const currentRows = swatchDrawer.rowCount; + for (let i = 0;i < currentRows; i++) { + swatchDrawer.removeRowDefinition(0); + } + for (let i = 0;i < rowCount + gutterCount; i++) { + if (i % 2) { + swatchDrawer.addRowDefinition(swatchSize, true); + } else { + swatchDrawer.addRowDefinition(gutterSize, true); + } + } + } + swatchDrawer.height = (swatchSize * rowCount + gutterCount * gutterSize).toString() + "px"; + for (let y = 1, thisRow = 1;y < rowCount + gutterCount; y += 2, thisRow++) { + let totalButtonsThisRow; + if (options.savedColors.length > thisRow * options.numSwatchesPerLine) { + totalButtonsThisRow = options.numSwatchesPerLine; + } else { + totalButtonsThisRow = options.savedColors.length - (thisRow - 1) * options.numSwatchesPerLine; + } + const buttonIterations = Math.min(Math.max(totalButtonsThisRow, 0), options.numSwatchesPerLine); + for (let x = 0, w = 1;x < buttonIterations; x++) { + if (x > options.numSwatchesPerLine) { + continue; + } + const swatch = createSwatch(); + if (swatch != null) { + swatchDrawer.addControl(swatch, y, w); + w += 2; + swatchNumber++; + } else { + continue; + } + } + } + if (options.savedColors.length >= options.swatchLimit) { + disableButton(button6, true); + } else { + disableButton(button6, false); + } + } + } + function setEditButtonVisibility(enableButton) { + if (enableButton) { + butEdit = Button2.CreateSimpleButton("butEdit", "Edit"); + butEdit.width = buttonWidth; + butEdit.height = buttonHeight; + butEdit.left = Math.floor(parseInt(buttonWidth) * 0.1).toString() + "px"; + butEdit.top = (parseFloat(butEdit.left) * -1).toString() + "px"; + butEdit.verticalAlignment = Control2.VERTICAL_ALIGNMENT_BOTTOM; + butEdit.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + butEdit.thickness = 2; + butEdit.color = buttonColor; + butEdit.fontSize = buttonFontSize; + butEdit.background = buttonBackgroundColor; + butEdit.onPointerEnterObservable.add(() => { + butEdit.background = buttonBackgroundHoverColor; + }); + butEdit.onPointerOutObservable.add(() => { + butEdit.background = buttonBackgroundColor; + }); + butEdit.pointerDownAnimation = () => { + butEdit.background = buttonBackgroundClickColor; + }; + butEdit.pointerUpAnimation = () => { + butEdit.background = buttonBackgroundHoverColor; + }; + butEdit.onPointerClickObservable.add(() => { + if (editSwatchMode) { + editSwatchMode = false; + } else { + editSwatchMode = true; + } + editSwatches(); + }); + pickerGrid.addControl(butEdit, 1, 0); + } else { + pickerGrid.removeControl(butEdit); + } + } + function disableButton(button6, disabled) { + if (disabled) { + button6.color = buttonDisabledColor; + button6.background = buttonDisabledBackgroundColor; + } else { + button6.color = buttonColor; + button6.background = buttonBackgroundColor; + } + } + function closePicker(color) { + if (options.savedColors && options.savedColors.length > 0) { + resolve({ + savedColors: options.savedColors, + pickedColor: color + }); + } else { + resolve({ + pickedColor: color + }); + } + advancedTexture.removeControl(dialogContainer); + } + }); + } +} +var init_colorpicker = __esm(() => { + init_tslib_es62(); + init_observable(); + init_control(); + init_inputText(); + init_rectangle(); + init_button(); + init_grid2(); + init_textBlock(); + init_typeStore(); + init_math_color(); + init_decorators(); + init_engineStore(); + ColorPicker2._Epsilon = 0.000001; + __decorate2([ + serialize() + ], ColorPicker2.prototype, "value", null); + __decorate2([ + serialize() + ], ColorPicker2.prototype, "width", null); + __decorate2([ + serialize() + ], ColorPicker2.prototype, "height", null); + __decorate2([ + serialize() + ], ColorPicker2.prototype, "size", null); + RegisterClass("BABYLON.GUI.ColorPicker", ColorPicker2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/ellipse.js +class Ellipse2 extends Container2 { + get thickness() { + return this._thickness; + } + set thickness(value) { + if (this._thickness === value) { + return; + } + this._thickness = value; + this._markAsDirty(); + } + constructor(name314) { + super(name314); + this.name = name314; + this._thickness = 1; + } + _getTypeName() { + return "Ellipse"; + } + _localDraw(context) { + context.save(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + Control2.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2 - this._thickness / 2, this._currentMeasure.height / 2 - this._thickness / 2, context); + if (this._backgroundGradient || this._background) { + context.fillStyle = this._getBackgroundColor(context); + context.fill(); + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + if (this._thickness) { + if (this.color) { + context.strokeStyle = this.color; + } + context.lineWidth = this._thickness; + context.stroke(); + } + context.restore(); + } + _additionalProcessing(parentMeasure, context) { + super._additionalProcessing(parentMeasure, context); + this._measureForChildren.width -= 2 * this._thickness; + this._measureForChildren.height -= 2 * this._thickness; + this._measureForChildren.left += this._thickness; + this._measureForChildren.top += this._thickness; + } + _clipForChildren(context) { + Control2.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2, this._currentMeasure.height / 2, context); + context.clip(); + } + _renderHighlightSpecific(context) { + Control2.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2 - this._highlightLineWidth / 2, this._currentMeasure.height / 2 - this._highlightLineWidth / 2, context); + context.stroke(); + } +} +var init_ellipse = __esm(() => { + init_tslib_es62(); + init_container(); + init_control(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], Ellipse2.prototype, "thickness", null); + RegisterClass("BABYLON.GUI.Ellipse", Ellipse2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/focusableButton.js +class FocusableButton2 extends Button2 { + constructor(name314) { + super(name314); + this.name = name314; + this.focusedColor = null; + this._isFocused = false; + this._unfocusedColor = null; + this.onFocusObservable = new Observable; + this.onBlurObservable = new Observable; + this.onKeyboardEventProcessedObservable = new Observable; + this._unfocusedColor = this.color; + } + onBlur() { + if (this._isFocused) { + this._isFocused = false; + if (this.focusedColor && this._unfocusedColor != null) { + this.color = this._unfocusedColor; + } + this.onBlurObservable.notifyObservers(this); + } + } + onFocus() { + this._isFocused = true; + if (this.focusedColor) { + this._unfocusedColor = this.color; + this.color = this.focusedColor; + } + this.onFocusObservable.notifyObservers(this); + } + keepsFocusWith() { + return null; + } + focus() { + this._host.moveFocusToControl(this); + } + blur() { + this._host.focusedControl = null; + } + processKeyboard(evt) { + this.onKeyboardEventProcessedObservable.notifyObservers(evt, -1, this); + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!this.isReadOnly) { + this.focus(); + } + return super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi); + } + displose() { + super.dispose(); + this.onBlurObservable.clear(); + this.onFocusObservable.clear(); + this.onKeyboardEventProcessedObservable.clear(); + } +} +var init_focusableButton = __esm(() => { + init_button(); + init_typeStore(); + init_observable(); + RegisterClass("BABYLON.GUI.FocusableButton", FocusableButton2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/focusableControl.js +var init_focusableControl = __esm(() => { +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/inputTextArea.js +class InputTextArea2 extends InputText2 { + get outlineWidth() { + return this._outlineWidth; + } + set outlineWidth(value) { + if (this._outlineWidth === value) { + return; + } + this._outlineWidth = value; + this._markAsDirty(); + } + get outlineColor() { + return this._outlineColor; + } + set outlineColor(value) { + if (this._outlineColor === value) { + return; + } + this._outlineColor = value; + this._markAsDirty(); + } + get autoStretchHeight() { + return this._autoStretchHeight; + } + set autoStretchHeight(value) { + if (this._autoStretchHeight === value) { + return; + } + this._autoStretchHeight = value; + this._markAsDirty(); + } + set height(value) { + this.fixedRatioMasterIsWidth = false; + if (this._height.toString(this._host) === value) { + return; + } + if (this._height.fromString(value)) { + this._markAsDirty(); + } + this._autoStretchHeight = false; + } + get maxHeight() { + return this._maxHeight.toString(this._host); + } + get maxHeightInPixels() { + return this._maxHeight.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + set maxHeight(value) { + if (this._maxHeight.toString(this._host) === value) { + return; + } + if (this._maxHeight.fromString(value)) { + this._markAsDirty(); + } + } + constructor(name314, text = "") { + super(name314); + this.name = name314; + this._textHorizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + this._textVerticalAlignment = Control2.VERTICAL_ALIGNMENT_TOP; + this._prevText = this.text; + this._lineSpacing = new ValueAndUnit2(0); + this._outlineWidth = 0; + this._outlineColor = "white"; + this._maxHeight = new ValueAndUnit2(1, ValueAndUnit2.UNITMODE_PERCENTAGE, false); + this.onLinesReadyObservable = new Observable; + this.text = text; + this.isPointerBlocker = true; + this.onLinesReadyObservable.add(() => this._updateCursorPosition()); + this._highlightCursorInfo = { + initialStartIndex: -1, + initialRelativeStartIndex: -1, + initialLineIndex: -1 + }; + this._cursorInfo = { + globalStartIndex: 0, + globalEndIndex: 0, + relativeEndIndex: 0, + relativeStartIndex: 0, + currentLineIndex: 0 + }; + } + _getTypeName() { + return "InputTextArea"; + } + processKeyboard(evt) { + if (this.isReadOnly) { + return; + } + this.alternativeProcessKey(evt.code, evt.key, evt); + this.onKeyboardEventProcessedObservable.notifyObservers(evt); + } + alternativeProcessKey(code, key, evt) { + if (evt && (evt.ctrlKey || evt.metaKey) && (code === "KeyC" || code === "KeyV" || code === "KeyX")) { + return; + } + switch (code) { + case "KeyA": + if (evt && (evt.ctrlKey || evt.metaKey)) { + this._selectAllText(); + evt.preventDefault(); + return; + } + break; + case "Period": + if (evt && evt.shiftKey) { + evt.preventDefault(); + } + break; + case "Backspace": + if (!this._isTextHighlightOn && this._cursorInfo.globalStartIndex > 0) { + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + this._cursorInfo.globalStartIndex--; + } + this._prevText = this._textWrapper.text; + this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex); + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + if (evt) { + evt.preventDefault(); + } + this._blinkIsEven = false; + this._isTextHighlightOn = false; + this._textHasChanged(); + break; + case "Delete": + if (!this._isTextHighlightOn && this._cursorInfo.globalEndIndex < this.text.length) { + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex + 1; + } + this._prevText = this._textWrapper.text; + this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex); + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + if (evt) { + evt.preventDefault(); + } + this._blinkIsEven = false; + this._isTextHighlightOn = false; + this._textHasChanged(); + break; + case "Enter": + this._prevText = this._textWrapper.text; + this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, "\n"); + this._cursorInfo.globalStartIndex++; + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + this._blinkIsEven = false; + this._isTextHighlightOn = false; + this._textHasChanged(); + return; + case "End": + this._cursorInfo.globalStartIndex = this.text.length; + this._blinkIsEven = false; + this._isTextHighlightOn = false; + this._markAsDirty(); + return; + case "Home": + this._cursorInfo.globalStartIndex = 0; + this._blinkIsEven = false; + this._isTextHighlightOn = false; + this._markAsDirty(); + return; + case "ArrowLeft": + this._markAsDirty(); + if (evt && evt.shiftKey) { + if (evt.ctrlKey || evt.metaKey) { + this._cursorInfo.globalStartIndex -= this._cursorInfo.relativeStartIndex; + this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex; + } + if (!this._isTextHighlightOn) { + this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; + this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; + this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex; + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + this._cursorInfo.globalStartIndex--; + this._isTextHighlightOn = true; + } else { + if (this._cursorInfo.globalEndIndex > this._highlightCursorInfo.initialStartIndex) { + this._cursorInfo.globalEndIndex--; + } else { + this._cursorInfo.globalStartIndex--; + } + } + this._blinkIsEven = true; + evt.preventDefault(); + return; + } + if (this._isTextHighlightOn) { + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + } else if (evt && (evt.ctrlKey || evt.metaKey)) { + this._cursorInfo.globalStartIndex -= this._cursorInfo.relativeStartIndex; + evt.preventDefault(); + } else if (this._cursorInfo.globalStartIndex > 0) { + this._cursorInfo.globalStartIndex--; + } + this._blinkIsEven = false; + this._isTextHighlightOn = false; + return; + case "ArrowRight": + this._markAsDirty(); + if (evt && evt.shiftKey) { + if (evt.ctrlKey || evt.metaKey) { + const rightDelta = this._lines[this._cursorInfo.currentLineIndex].text.length - this._cursorInfo.relativeEndIndex - 1; + this._cursorInfo.globalEndIndex += rightDelta; + this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex; + } + if (!this._isTextHighlightOn) { + this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; + this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; + this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex; + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + this._cursorInfo.globalEndIndex++; + this._isTextHighlightOn = true; + } else { + if (this._cursorInfo.globalStartIndex < this._highlightCursorInfo.initialStartIndex) { + this._cursorInfo.globalStartIndex++; + } else { + this._cursorInfo.globalEndIndex++; + } + } + this._blinkIsEven = true; + evt.preventDefault(); + return; + } + if (this._isTextHighlightOn) { + this._cursorInfo.globalStartIndex = this._cursorInfo.globalEndIndex; + } else if (evt && (evt.ctrlKey || evt.metaKey)) { + const rightDelta = this._lines[this._cursorInfo.currentLineIndex].text.length - this._cursorInfo.relativeEndIndex; + this._cursorInfo.globalStartIndex += rightDelta; + } else if (this._cursorInfo.globalStartIndex < this.text.length) { + this._cursorInfo.globalStartIndex++; + } + this._blinkIsEven = false; + this._isTextHighlightOn = false; + return; + case "ArrowUp": + this._blinkIsEven = false; + if (evt) { + if (evt.shiftKey) { + if (!this._isTextHighlightOn) { + this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; + this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; + this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex; + } + this._isTextHighlightOn = true; + this._blinkIsEven = true; + } else { + this._isTextHighlightOn = false; + } + evt.preventDefault(); + } + if (this._cursorInfo.currentLineIndex === 0) { + this._cursorInfo.globalStartIndex = 0; + } else { + const currentLine = this._lines[this._cursorInfo.currentLineIndex]; + const upperLine = this._lines[this._cursorInfo.currentLineIndex - 1]; + let tmpIndex = 0; + let relativeIndex = 0; + if (!this._isTextHighlightOn || this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex) { + tmpIndex = this._cursorInfo.globalStartIndex; + relativeIndex = this._cursorInfo.relativeStartIndex; + } else { + tmpIndex = this._cursorInfo.globalEndIndex; + relativeIndex = this._cursorInfo.relativeEndIndex; + } + const currentText = currentLine.text.substr(0, relativeIndex); + const currentWidth = this._contextForBreakLines.measureText(currentText).width; + let upperWidth = 0; + let previousWidth = 0; + tmpIndex -= relativeIndex; + tmpIndex -= upperLine.text.length + upperLine.lineEnding.length; + let upperLineRelativeIndex = 0; + while (upperWidth < currentWidth && upperLineRelativeIndex < upperLine.text.length) { + tmpIndex++; + upperLineRelativeIndex++; + previousWidth = Math.abs(currentWidth - upperWidth); + upperWidth = this._contextForBreakLines.measureText(upperLine.text.substr(0, upperLineRelativeIndex)).width; + } + if (Math.abs(currentWidth - upperWidth) > previousWidth && upperLineRelativeIndex > 0) { + tmpIndex--; + } + if (!this._isTextHighlightOn) { + this._cursorInfo.globalStartIndex = tmpIndex; + } else if (this._cursorInfo.currentLineIndex <= this._highlightCursorInfo.initialLineIndex) { + this._cursorInfo.globalStartIndex = tmpIndex; + this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex; + this._cursorInfo.relativeEndIndex = this._highlightCursorInfo.initialRelativeStartIndex; + } else { + this._cursorInfo.globalEndIndex = tmpIndex; + } + } + this._markAsDirty(); + return; + case "ArrowDown": + this._blinkIsEven = false; + if (evt) { + if (evt.shiftKey) { + if (!this._isTextHighlightOn) { + this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; + this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; + this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex; + } + this._isTextHighlightOn = true; + this._blinkIsEven = true; + } else { + this._isTextHighlightOn = false; + } + evt.preventDefault(); + } + if (this._cursorInfo.currentLineIndex === this._lines.length - 1) { + this._cursorInfo.globalStartIndex = this.text.length; + } else { + const currentLine = this._lines[this._cursorInfo.currentLineIndex]; + const underLine = this._lines[this._cursorInfo.currentLineIndex + 1]; + let tmpIndex = 0; + let relativeIndex = 0; + if (!this._isTextHighlightOn || this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex) { + tmpIndex = this._cursorInfo.globalStartIndex; + relativeIndex = this._cursorInfo.relativeStartIndex; + } else { + tmpIndex = this._cursorInfo.globalEndIndex; + relativeIndex = this._cursorInfo.relativeEndIndex; + } + const currentText = currentLine.text.substr(0, relativeIndex); + const currentWidth = this._contextForBreakLines.measureText(currentText).width; + let underWidth = 0; + let previousWidth = 0; + tmpIndex += currentLine.text.length - relativeIndex + currentLine.lineEnding.length; + let underLineRelativeIndex = 0; + while (underWidth < currentWidth && underLineRelativeIndex < underLine.text.length) { + tmpIndex++; + underLineRelativeIndex++; + previousWidth = Math.abs(currentWidth - underWidth); + underWidth = this._contextForBreakLines.measureText(underLine.text.substr(0, underLineRelativeIndex)).width; + } + if (Math.abs(currentWidth - underWidth) > previousWidth && underLineRelativeIndex > 0) { + tmpIndex--; + } + if (!this._isTextHighlightOn) { + this._cursorInfo.globalStartIndex = tmpIndex; + } else if (this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex) { + this._cursorInfo.globalStartIndex = tmpIndex; + if (this._cursorInfo.globalStartIndex > this._cursorInfo.globalEndIndex) { + this._cursorInfo.globalEndIndex += this._cursorInfo.globalStartIndex; + this._cursorInfo.globalStartIndex = this._cursorInfo.globalEndIndex - this._cursorInfo.globalStartIndex; + this._cursorInfo.globalEndIndex -= this._cursorInfo.globalStartIndex; + } + } else { + this._cursorInfo.globalEndIndex = tmpIndex; + this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex; + } + } + this._markAsDirty(); + return; + } + if ((key === null || key === undefined ? undefined : key.length) === 1) { + evt === null || evt === undefined || evt.preventDefault(); + this._currentKey = key; + this.onBeforeKeyAddObservable.notifyObservers(this); + key = this._currentKey; + if (this._addKey) { + this._isTextHighlightOn = false; + this._blinkIsEven = false; + this._prevText = this._textWrapper.text; + this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, key); + this._cursorInfo.globalStartIndex += key.length; + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + this._textHasChanged(); + } + } + } + _parseLineWordWrap(line2 = "", width, context) { + const lines = []; + const words = line2.split(" "); + let lineWidth = 0; + for (let n = 0;n < words.length; n++) { + const testLine = n > 0 ? line2 + " " + words[n] : words[0]; + const metrics = context.measureText(testLine); + const testWidth = metrics.width; + if (testWidth > width) { + if (n > 0) { + lineWidth = context.measureText(line2).width; + lines.push({ text: line2, width: lineWidth, lineEnding: " " }); + } + line2 = words[n]; + let flushedLine = ""; + line2.split("").map((char) => { + if (context.measureText(flushedLine + char).width > width) { + lines.push({ text: flushedLine, width: context.measureText(flushedLine).width, lineEnding: "" }); + flushedLine = ""; + } + flushedLine += char; + }); + line2 = flushedLine; + lineWidth = context.measureText(line2).width; + } else { + lineWidth = testWidth; + line2 = testLine; + } + } + lines.push({ text: line2, width: lineWidth, lineEnding: " " }); + return lines; + } + _breakLines(refWidth, context) { + const lines = []; + const _lines = (this.text || this.placeholderText).split("\n"); + if (this.clipContent) { + for (const _line of _lines) { + lines.push(...this._parseLineWordWrap(_line, refWidth, context)); + } + } else { + for (const _line of _lines) { + lines.push(this._parseLine(_line, context)); + } + } + lines[lines.length - 1].lineEnding = "\n"; + return lines; + } + _parseLine(line2 = "", context) { + return { text: line2, width: context.measureText(line2).width, lineEnding: " " }; + } + _preMeasure(parentMeasure, context) { + if (!this._fontOffset || this._wasDirty) { + this._fontOffset = Control2._GetFontOffset(context.font); + } + let text = this._beforeRenderText(this._textWrapper).text; + if (!this.text && this._placeholderText) { + text = this._placeholderText; + } + this._textWidth = context.measureText(text).width; + const marginWidth = this._margin.getValueInPixel(this._host, parentMeasure.width) * 2; + if (this._autoStretchWidth) { + const tmpLines = text.split("\n"); + const longerString = tmpLines.reduce((acc, val) => { + const valueLength = context.measureText(val).width; + const accLength = context.measureText(acc).width; + return valueLength > accLength ? val : acc; + }, ""); + const longerStringWidth = context.measureText(longerString).width; + this.width = Math.min(this._maxWidth.getValueInPixel(this._host, parentMeasure.width), longerStringWidth + marginWidth) + "px"; + this.autoStretchWidth = true; + } + this._availableWidth = this._width.getValueInPixel(this._host, parentMeasure.width) - marginWidth; + this._lines = this._breakLines(this._availableWidth, context); + this._contextForBreakLines = context; + if (this._autoStretchHeight) { + const textHeight = this._lines.length * this._fontOffset.height; + const totalHeight = textHeight + this._margin.getValueInPixel(this._host, parentMeasure.height) * 2; + this.height = Math.min(this._maxHeight.getValueInPixel(this._host, parentMeasure.height), totalHeight) + "px"; + this._autoStretchHeight = true; + } + this._availableHeight = this._height.getValueInPixel(this._host, parentMeasure.height) - marginWidth; + if (this._isFocused) { + this._cursorInfo.currentLineIndex = 0; + let lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length; + let tmpLength = 0; + while (tmpLength + lineLength <= this._cursorInfo.globalStartIndex) { + tmpLength += lineLength; + if (this._cursorInfo.currentLineIndex < this._lines.length - 1) { + this._cursorInfo.currentLineIndex++; + lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length; + } + } + } + } + _textHasChanged() { + if (!this._prevText && this._textWrapper.text && this.placeholderText) { + this._cursorInfo.currentLineIndex = 0; + this._cursorInfo.globalStartIndex = 1; + this._cursorInfo.globalEndIndex = 1; + this._cursorInfo.relativeStartIndex = 1; + this._cursorInfo.relativeEndIndex = 1; + } + super._textHasChanged(); + } + _computeScroll() { + this._clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width); + this._clipTextTop = this._currentMeasure.top + this._margin.getValueInPixel(this._host, this._cachedParentMeasure.height); + if (this._isFocused && this._lines[this._cursorInfo.currentLineIndex].width > this._availableWidth) { + const textLeft = this._clipTextLeft - this._lines[this._cursorInfo.currentLineIndex].width + this._availableWidth; + if (!this._scrollLeft) { + this._scrollLeft = textLeft; + } + } else { + this._scrollLeft = this._clipTextLeft; + } + if (this._isFocused && !this._autoStretchHeight) { + const selectedHeight = (this._cursorInfo.currentLineIndex + 1) * this._fontOffset.height; + const textTop = this._clipTextTop - selectedHeight; + if (!this._scrollTop) { + this._scrollTop = textTop; + } + } else { + this._scrollTop = this._clipTextTop; + } + } + _additionalProcessing() { + this.highlightedText = ""; + this.onLinesReadyObservable.notifyObservers(this); + } + _drawText(text, textWidth, y, context) { + const width = this._currentMeasure.width; + let x = this._scrollLeft; + switch (this._textHorizontalAlignment) { + case Control2.HORIZONTAL_ALIGNMENT_LEFT: + x += 0; + break; + case Control2.HORIZONTAL_ALIGNMENT_RIGHT: + x += width - textWidth; + break; + case Control2.HORIZONTAL_ALIGNMENT_CENTER: + x += (width - textWidth) / 2; + break; + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + if (this.outlineWidth) { + context.strokeText(text, this._currentMeasure.left + x, y); + } + context.fillText(text, x, y); + } + _onCopyText(ev) { + this._isTextHighlightOn = false; + try { + ev.clipboardData && ev.clipboardData.setData("text/plain", this._highlightedText); + } catch (_a) { + } + this._host.clipboardData = this._highlightedText; + } + _onCutText(ev) { + if (!this._highlightedText) { + return; + } + try { + ev.clipboardData && ev.clipboardData.setData("text/plain", this._highlightedText); + } catch (_a) { + } + this._host.clipboardData = this._highlightedText; + this._prevText = this._textWrapper.text; + this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex); + this._textHasChanged(); + } + _onPasteText(ev) { + let data = ""; + if (ev.clipboardData && ev.clipboardData.types.indexOf("text/plain") !== -1) { + data = ev.clipboardData.getData("text/plain"); + } else { + data = this._host.clipboardData; + } + this._isTextHighlightOn = false; + this._prevText = this._textWrapper.text; + this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, data); + const deltaIndex = data.length - (this._cursorInfo.globalEndIndex - this._cursorInfo.globalStartIndex); + this._cursorInfo.globalStartIndex += deltaIndex; + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + this._textHasChanged(); + } + _draw(context) { + var _a, _b; + this._computeScroll(); + this._scrollLeft = (_a = this._scrollLeft) !== null && _a !== undefined ? _a : 0; + this._scrollTop = (_b = this._scrollTop) !== null && _b !== undefined ? _b : 0; + context.save(); + this._applyStates(context); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + if (this._isFocused) { + if (this._focusedBackground) { + context.fillStyle = this._isEnabled ? this._focusedBackground : this._disabledColor; + context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + } else if (this._background) { + context.fillStyle = this._isEnabled ? this._background : this._disabledColor; + context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + if (this.color) { + context.fillStyle = this.color; + } + const height = this._currentMeasure.height; + const width = this._currentMeasure.width; + let rootY = 0; + switch (this._textVerticalAlignment) { + case Control2.VERTICAL_ALIGNMENT_TOP: + rootY = this._fontOffset.ascent; + break; + case Control2.VERTICAL_ALIGNMENT_BOTTOM: + rootY = height - this._fontOffset.height * (this._lines.length - 1) - this._fontOffset.descent; + break; + case Control2.VERTICAL_ALIGNMENT_CENTER: + rootY = this._fontOffset.ascent + (height - this._fontOffset.height * this._lines.length) / 2; + break; + } + context.save(); + context.beginPath(); + context.fillStyle = this.fontStyle; + if (!this._textWrapper.text && this.placeholderText) { + context.fillStyle = this._placeholderColor; + } + context.rect(this._clipTextLeft, this._clipTextTop, this._availableWidth + 2, this._availableHeight + 2); + context.clip(); + rootY += this._scrollTop; + for (let i = 0;i < this._lines.length; i++) { + const line2 = this._lines[i]; + if (i !== 0 && this._lineSpacing.internalValue !== 0) { + if (this._lineSpacing.isPixel) { + rootY += this._lineSpacing.getValue(this._host); + } else { + rootY = rootY + this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + } + this._drawText(line2.text, line2.width, rootY, context); + rootY += this._fontOffset.height; + } + context.restore(); + if (this._isFocused) { + if (!this._blinkIsEven || this._isTextHighlightOn) { + let cursorLeft = this._scrollLeft + context.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0, this._cursorInfo.relativeStartIndex)).width; + if (cursorLeft < this._clipTextLeft) { + this._scrollLeft += this._clipTextLeft - cursorLeft; + cursorLeft = this._clipTextLeft; + this._markAsDirty(); + } else if (cursorLeft > this._clipTextLeft + this._availableWidth) { + this._scrollLeft += this._clipTextLeft + this._availableWidth - cursorLeft; + cursorLeft = this._clipTextLeft + this._availableWidth; + this._markAsDirty(); + } + let cursorTop = this._scrollTop + this._cursorInfo.currentLineIndex * this._fontOffset.height; + if (cursorTop < this._clipTextTop) { + this._scrollTop += this._clipTextTop - cursorTop; + cursorTop = this._clipTextTop; + this._markAsDirty(); + } else if (cursorTop + this._fontOffset.height > this._clipTextTop + this._availableHeight) { + this._scrollTop += this._clipTextTop + this._availableHeight - cursorTop - this._fontOffset.height; + cursorTop = this._clipTextTop + this._availableHeight - this._fontOffset.height; + this._markAsDirty(); + } + if (!this._isTextHighlightOn) { + context.fillRect(cursorLeft, cursorTop, 2, this._fontOffset.height); + } + } + this._resetBlinking(); + if (this._isTextHighlightOn) { + clearTimeout(this._blinkTimeout); + this._highlightedText = this.text.substring(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex); + context.globalAlpha = this._highligherOpacity; + context.fillStyle = this._textHighlightColor; + const startLineIndex = Math.min(this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialLineIndex); + const endLineIndex = Math.max(this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialLineIndex); + let highlightRootY = this._scrollTop + startLineIndex * this._fontOffset.height; + for (let i = startLineIndex;i <= endLineIndex; i++) { + const line2 = this._lines[i]; + let highlightRootX = this._scrollLeft; + switch (this._textHorizontalAlignment) { + case Control2.HORIZONTAL_ALIGNMENT_LEFT: + highlightRootX += 0; + break; + case Control2.HORIZONTAL_ALIGNMENT_RIGHT: + highlightRootX += width - line2.width; + break; + case Control2.HORIZONTAL_ALIGNMENT_CENTER: + highlightRootX += (width - line2.width) / 2; + break; + } + const begin = i === startLineIndex ? this._cursorInfo.relativeStartIndex : 0; + const end = i === endLineIndex ? this._cursorInfo.relativeEndIndex : line2.text.length; + const leftOffsetWidth = context.measureText(line2.text.substr(0, begin)).width; + const selectedText = line2.text.substring(begin, end); + const hightlightWidth = context.measureText(selectedText).width; + context.fillRect(highlightRootX + leftOffsetWidth, highlightRootY, hightlightWidth, this._fontOffset.height); + highlightRootY += this._fontOffset.height; + } + if (this._cursorInfo.globalEndIndex === this._cursorInfo.globalStartIndex) { + this._resetBlinking(); + } + } + } + context.restore(); + if (this._thickness) { + if (this._isFocused) { + if (this.focusedColor) { + context.strokeStyle = this.focusedColor; + } + } else { + if (this.color) { + context.strokeStyle = this.color; + } + } + context.lineWidth = this._thickness; + context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, this._currentMeasure.width - this._thickness, this._currentMeasure.height - this._thickness); + } + } + _resetBlinking() { + clearTimeout(this._blinkTimeout); + this._blinkTimeout = setTimeout(() => { + this._blinkIsEven = !this._blinkIsEven; + this._markAsDirty(); + }, 500); + } + _applyStates(context) { + super._applyStates(context); + if (this.outlineWidth) { + context.lineWidth = this.outlineWidth; + context.strokeStyle = this.outlineColor; + } + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { + return false; + } + if (this.isReadOnly) { + return true; + } + this._clickedCoordinateX = coordinates.x; + this._clickedCoordinateY = coordinates.y; + this._isTextHighlightOn = false; + this._highlightedText = ""; + this._isPointerDown = true; + this._host._capturingControl[pointerId] = this; + if (this._host.focusedControl === this) { + clearTimeout(this._blinkTimeout); + this._markAsDirty(); + return true; + } + if (!this._isEnabled) { + return false; + } + this._host.focusedControl = this; + return true; + } + _onPointerMove(target, coordinates, pointerId, pi) { + if (pi.event.movementX === 0 && pi.event.movementY === 0) { + return; + } + if (this._host.focusedControl === this && this._isPointerDown && !this.isReadOnly) { + this._clickedCoordinateX = coordinates.x; + this._clickedCoordinateY = coordinates.y; + if (!this._isTextHighlightOn) { + this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; + this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; + this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex; + this._isTextHighlightOn = true; + } + this._markAsDirty(); + } + super._onPointerMove(target, coordinates, pointerId, pi); + } + _updateCursorPosition() { + var _a; + if (!this._isFocused) { + return; + } + if (!this._textWrapper.text && this.placeholderText) { + this._cursorInfo.currentLineIndex = 0; + this._cursorInfo.globalStartIndex = 0; + this._cursorInfo.globalEndIndex = 0; + this._cursorInfo.relativeStartIndex = 0; + this._cursorInfo.relativeEndIndex = 0; + } else { + if (this._clickedCoordinateX && this._clickedCoordinateY) { + if (!this._isTextHighlightOn) { + this._cursorInfo = { + globalStartIndex: 0, + globalEndIndex: 0, + relativeStartIndex: 0, + relativeEndIndex: 0, + currentLineIndex: 0 + }; + } + let globalIndex = 0; + let relativeIndex = 0; + const lastClickedCoordinateY = this._clickedCoordinateY - this._scrollTop; + const relativeCoordinateY = Math.floor(lastClickedCoordinateY / this._fontOffset.height); + this._cursorInfo.currentLineIndex = Math.min(Math.max(relativeCoordinateY, 0), this._lines.length - 1); + let currentSize = 0; + const relativeXPosition = this._clickedCoordinateX - ((_a = this._scrollLeft) !== null && _a !== undefined ? _a : 0); + let previousDist = 0; + for (let index = 0;index < this._cursorInfo.currentLineIndex; index++) { + const line2 = this._lines[index]; + globalIndex += line2.text.length + line2.lineEnding.length; + } + while (currentSize < relativeXPosition && this._lines[this._cursorInfo.currentLineIndex].text.length > relativeIndex) { + relativeIndex++; + previousDist = Math.abs(relativeXPosition - currentSize); + currentSize = this._contextForBreakLines.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0, relativeIndex)).width; + } + if (Math.abs(relativeXPosition - currentSize) > previousDist && relativeIndex > 0) { + relativeIndex--; + } + globalIndex += relativeIndex; + if (!this._isTextHighlightOn) { + this._cursorInfo.globalStartIndex = globalIndex; + this._cursorInfo.relativeStartIndex = relativeIndex; + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + this._cursorInfo.relativeEndIndex = this._cursorInfo.relativeStartIndex; + } else { + if (globalIndex < this._highlightCursorInfo.initialStartIndex) { + this._cursorInfo.globalStartIndex = globalIndex; + this._cursorInfo.relativeStartIndex = relativeIndex; + this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex; + this._cursorInfo.relativeEndIndex = this._highlightCursorInfo.initialRelativeStartIndex; + } else { + this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex; + this._cursorInfo.relativeStartIndex = this._highlightCursorInfo.initialRelativeStartIndex; + this._cursorInfo.globalEndIndex = globalIndex; + this._cursorInfo.relativeEndIndex = relativeIndex; + } + } + this._blinkIsEven = this._isTextHighlightOn; + this._clickedCoordinateX = null; + this._clickedCoordinateY = null; + } else { + this._cursorInfo.relativeStartIndex = 0; + this._cursorInfo.currentLineIndex = 0; + let lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length; + let tmpLength = 0; + while (tmpLength + lineLength <= this._cursorInfo.globalStartIndex) { + tmpLength += lineLength; + if (this._cursorInfo.currentLineIndex < this._lines.length - 1) { + this._cursorInfo.currentLineIndex++; + lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length; + } + } + this._cursorInfo.relativeStartIndex = this._cursorInfo.globalStartIndex - tmpLength; + if (this._highlightCursorInfo.initialStartIndex !== -1 && this._cursorInfo.globalStartIndex >= this._highlightCursorInfo.initialStartIndex) { + while (tmpLength + lineLength <= this._cursorInfo.globalEndIndex) { + tmpLength += lineLength; + if (this._cursorInfo.currentLineIndex < this._lines.length - 1) { + this._cursorInfo.currentLineIndex++; + lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length; + } + } + this._cursorInfo.relativeEndIndex = this._cursorInfo.globalEndIndex - tmpLength; + } else if (!this._isTextHighlightOn) { + this._cursorInfo.relativeEndIndex = this._cursorInfo.relativeStartIndex; + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + } + } + } + } + _updateValueFromCursorIndex(offset) { + } + _processDblClick(_evt) { + let moveLeft, moveRight; + do { + moveLeft = this._cursorInfo.globalStartIndex > 0 && this._textWrapper.isWord(this._cursorInfo.globalStartIndex - 1) ? --this._cursorInfo.globalStartIndex : 0; + moveRight = this._cursorInfo.globalEndIndex < this._textWrapper.length && this._textWrapper.isWord(this._cursorInfo.globalEndIndex) ? ++this._cursorInfo.globalEndIndex : 0; + } while (moveLeft || moveRight); + this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; + this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; + this.onTextHighlightObservable.notifyObservers(this); + this._isTextHighlightOn = true; + this._blinkIsEven = true; + this._markAsDirty(); + } + _selectAllText() { + this._isTextHighlightOn = true; + this._blinkIsEven = true; + this._highlightCursorInfo = { + initialStartIndex: 0, + initialRelativeStartIndex: 0, + initialLineIndex: 0 + }; + this._cursorInfo = { + globalStartIndex: 0, + globalEndIndex: this._textWrapper.length, + relativeEndIndex: this._lines[this._lines.length - 1].text.length, + relativeStartIndex: 0, + currentLineIndex: this._lines.length - 1 + }; + this._markAsDirty(); + } + dispose() { + super.dispose(); + this.onLinesReadyObservable.clear(); + } +} +var init_inputTextArea = __esm(() => { + init_tslib_es62(); + init_observable(); + init_control(); + init_valueAndUnit(); + init_typeStore(); + init_inputText(); + init_decorators(); + __decorate2([ + serialize() + ], InputTextArea2.prototype, "autoStretchHeight", null); + __decorate2([ + serialize() + ], InputTextArea2.prototype, "maxHeight", null); + RegisterClass("BABYLON.GUI.InputTextArea", InputTextArea2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/inputPassword.js +class InputPassword2 extends InputText2 { + _getTypeName() { + return "InputPassword"; + } + _beforeRenderText(textWrapper6) { + const pwdTextWrapper = new TextWrapper2; + let txt = ""; + for (let i = 0;i < textWrapper6.length; i++) { + txt += "\u2022"; + } + pwdTextWrapper.text = txt; + return pwdTextWrapper; + } +} +var init_inputPassword = __esm(() => { + init_inputText(); + init_typeStore(); + init_textWrapper(); + RegisterClass("BABYLON.GUI.InputPassword", InputPassword2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/line.js +class Line2 extends Control2 { + get dash() { + return this._dash; + } + set dash(value) { + if (this._dash === value) { + return; + } + this._dash = value; + this._markAsDirty(); + } + get connectedControl() { + return this._connectedControl; + } + set connectedControl(value) { + if (this._connectedControl === value) { + return; + } + if (this._connectedControlDirtyObserver && this._connectedControl) { + this._connectedControl.onDirtyObservable.remove(this._connectedControlDirtyObserver); + this._connectedControlDirtyObserver = null; + } + if (value) { + this._connectedControlDirtyObserver = value.onDirtyObservable.add(() => this._markAsDirty()); + } + this._connectedControl = value; + this._markAsDirty(); + } + get x1() { + return this._x1.toString(this._host); + } + set x1(value) { + if (this._x1.toString(this._host) === value) { + return; + } + if (this._x1.fromString(value)) { + this._markAsDirty(); + } + } + get y1() { + return this._y1.toString(this._host); + } + set y1(value) { + if (this._y1.toString(this._host) === value) { + return; + } + if (this._y1.fromString(value)) { + this._markAsDirty(); + } + } + get x2() { + return this._x2.toString(this._host); + } + set x2(value) { + if (this._x2.toString(this._host) === value) { + return; + } + if (this._x2.fromString(value)) { + this._markAsDirty(); + } + } + get y2() { + return this._y2.toString(this._host); + } + set y2(value) { + if (this._y2.toString(this._host) === value) { + return; + } + if (this._y2.fromString(value)) { + this._markAsDirty(); + } + } + get lineWidth() { + return this._lineWidth; + } + set lineWidth(value) { + if (this._lineWidth === value) { + return; + } + this._lineWidth = value; + this._markAsDirty(); + } + set horizontalAlignment(value) { + return; + } + set verticalAlignment(value) { + return; + } + get _effectiveX2() { + return (this._connectedControl ? this._connectedControl.centerX : 0) + this._x2.getValue(this._host); + } + get _effectiveY2() { + return (this._connectedControl ? this._connectedControl.centerY : 0) + this._y2.getValue(this._host); + } + constructor(name314) { + super(name314); + this.name = name314; + this._lineWidth = 1; + this._x1 = new ValueAndUnit2(0); + this._y1 = new ValueAndUnit2(0); + this._x2 = new ValueAndUnit2(0); + this._y2 = new ValueAndUnit2(0); + this._dash = new Array; + this._automaticSize = true; + this.isHitTestVisible = false; + this._horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + this._verticalAlignment = Control2.VERTICAL_ALIGNMENT_TOP; + } + _getTypeName() { + return "Line"; + } + _draw(context) { + context.save(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + this._applyStates(context); + context.strokeStyle = this._getColor(context); + context.lineWidth = this._lineWidth; + context.setLineDash(this._dash); + context.beginPath(); + context.moveTo(this._cachedParentMeasure.left + this._x1.getValue(this._host), this._cachedParentMeasure.top + this._y1.getValue(this._host)); + context.lineTo(this._cachedParentMeasure.left + this._effectiveX2, this._cachedParentMeasure.top + this._effectiveY2); + context.stroke(); + context.restore(); + } + _measure() { + this._currentMeasure.width = Math.abs(this._x1.getValue(this._host) - this._effectiveX2) + this._lineWidth; + this._currentMeasure.height = Math.abs(this._y1.getValue(this._host) - this._effectiveY2) + this._lineWidth; + } + _computeAlignment(parentMeasure) { + this._currentMeasure.left = parentMeasure.left + Math.min(this._x1.getValue(this._host), this._effectiveX2) - this._lineWidth / 2; + this._currentMeasure.top = parentMeasure.top + Math.min(this._y1.getValue(this._host), this._effectiveY2) - this._lineWidth / 2; + } + moveToVector3(position3, scene50, end = false) { + if (!this._host || this.parent !== this._host._rootContainer) { + Tools.Error("Cannot move a control to a vector3 if the control is not at root level"); + return; + } + const globalViewport = this._host._getGlobalViewport(); + const projectedPosition = Vector3.Project(position3, Matrix.IdentityReadOnly, scene50.getTransformMatrix(), globalViewport); + this._moveToProjectedPosition(projectedPosition, end); + if (projectedPosition.z < 0 || projectedPosition.z > 1) { + this.notRenderable = true; + return; + } + this.notRenderable = false; + } + _moveToProjectedPosition(projectedPosition, end = false) { + const x = projectedPosition.x + this._linkOffsetX.getValue(this._host) + "px"; + const y = projectedPosition.y + this._linkOffsetY.getValue(this._host) + "px"; + if (end) { + this.x2 = x; + this.y2 = y; + this._x2.ignoreAdaptiveScaling = true; + this._y2.ignoreAdaptiveScaling = true; + } else { + this.x1 = x; + this.y1 = y; + this._x1.ignoreAdaptiveScaling = true; + this._y1.ignoreAdaptiveScaling = true; + } + } +} +var init_line = __esm(() => { + init_tslib_es62(); + init_math_vector(); + init_tools(); + init_control(); + init_valueAndUnit(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], Line2.prototype, "dash", null); + __decorate2([ + serialize() + ], Line2.prototype, "x1", null); + __decorate2([ + serialize() + ], Line2.prototype, "y1", null); + __decorate2([ + serialize() + ], Line2.prototype, "x2", null); + __decorate2([ + serialize() + ], Line2.prototype, "y2", null); + __decorate2([ + serialize() + ], Line2.prototype, "lineWidth", null); + RegisterClass("BABYLON.GUI.Line", Line2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/multiLinePoint.js +class MultiLinePoint2 { + constructor(multiLine2) { + this._multiLine = multiLine2; + this._x = new ValueAndUnit2(0); + this._y = new ValueAndUnit2(0); + this._point = new Vector3(0, 0, 0); + } + get x() { + return this._x.toString(this._multiLine._host); + } + set x(value) { + if (this._x.toString(this._multiLine._host) === value) { + return; + } + if (this._x.fromString(value)) { + this._multiLine._markAsDirty(); + } + } + get y() { + return this._y.toString(this._multiLine._host); + } + set y(value) { + if (this._y.toString(this._multiLine._host) === value) { + return; + } + if (this._y.fromString(value)) { + this._multiLine._markAsDirty(); + } + } + get control() { + return this._control; + } + set control(value) { + if (this._control === value) { + return; + } + if (this._control && this._controlObserver) { + this._control.onDirtyObservable.remove(this._controlObserver); + this._controlObserver = null; + } + this._control = value; + if (this._control) { + this._controlObserver = this._control.onDirtyObservable.add(this._multiLine.onPointUpdate); + } + this._multiLine._markAsDirty(); + } + get mesh() { + return this._mesh; + } + set mesh(value) { + if (this._mesh === value) { + return; + } + if (this._mesh && this._meshObserver) { + this._mesh.getScene().onAfterCameraRenderObservable.remove(this._meshObserver); + } + this._mesh = value; + if (this._mesh) { + this._meshObserver = this._mesh.getScene().onAfterCameraRenderObservable.add(this._multiLine.onPointUpdate); + } + this._multiLine._markAsDirty(); + } + resetLinks() { + this.control = null; + this.mesh = null; + } + translate() { + this._point = this._translatePoint(); + return this._point; + } + _translatePoint() { + if (this._mesh != null) { + return this._multiLine._host.getProjectedPositionWithZ(this._mesh.getBoundingInfo().boundingSphere.center, this._mesh.getWorldMatrix()); + } else if (this._control != null) { + return new Vector3(this._control.centerX, this._control.centerY, 1 - Epsilon); + } else { + const host = this._multiLine._host; + const xValue = this._x.getValueInPixel(host, Number(host._canvas.width)); + const yValue = this._y.getValueInPixel(host, Number(host._canvas.height)); + return new Vector3(xValue, yValue, 1 - Epsilon); + } + } + dispose() { + this.resetLinks(); + } +} +var init_multiLinePoint = __esm(() => { + init_math_vector(); + init_math_constants(); + init_valueAndUnit(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/multiLine.js +class MultiLine2 extends Control2 { + constructor(name314) { + super(name314); + this.name = name314; + this._lineWidth = 1; + this.onPointUpdate = () => { + this._markAsDirty(); + }; + this._automaticSize = true; + this.isHitTestVisible = false; + this._horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + this._verticalAlignment = Control2.VERTICAL_ALIGNMENT_TOP; + this._dash = []; + this._points = []; + } + get dash() { + return this._dash; + } + set dash(value) { + if (this._dash === value) { + return; + } + this._dash = value; + this._markAsDirty(); + } + getAt(index) { + if (!this._points[index]) { + this._points[index] = new MultiLinePoint2(this); + } + return this._points[index]; + } + add(...items) { + return items.map((item) => this.push(item)); + } + push(item) { + const point = this.getAt(this._points.length); + if (item == null) { + return point; + } + if (item instanceof AbstractMesh) { + point.mesh = item; + } else if (item instanceof Control2) { + point.control = item; + } else if (item.x != null && item.y != null) { + point.x = item.x; + point.y = item.y; + } + return point; + } + remove(value) { + let index; + if (value instanceof MultiLinePoint2) { + index = this._points.indexOf(value); + if (index === -1) { + return; + } + } else { + index = value; + } + const point = this._points[index]; + if (!point) { + return; + } + point.dispose(); + this._points.splice(index, 1); + } + reset() { + while (this._points.length > 0) { + this.remove(this._points.length - 1); + } + } + resetLinks() { + this._points.forEach((point) => { + if (point != null) { + point.resetLinks(); + } + }); + } + get lineWidth() { + return this._lineWidth; + } + set lineWidth(value) { + if (this._lineWidth === value) { + return; + } + this._lineWidth = value; + this._markAsDirty(); + } + set horizontalAlignment(value) { + return; + } + set verticalAlignment(value) { + return; + } + _getTypeName() { + return "MultiLine"; + } + _draw(context) { + context.save(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + this._applyStates(context); + context.strokeStyle = this.color; + context.lineWidth = this._lineWidth; + context.setLineDash(this._dash); + context.beginPath(); + let first = true; + let previousPoint; + this._points.forEach((point) => { + if (!point) { + return; + } + if (first) { + context.moveTo(point._point.x, point._point.y); + first = false; + } else { + if (point._point.z < 1 && previousPoint.z < 1) { + context.lineTo(point._point.x, point._point.y); + } else { + context.moveTo(point._point.x, point._point.y); + } + } + previousPoint = point._point; + }); + context.stroke(); + context.restore(); + } + _additionalProcessing() { + this._minX = null; + this._minY = null; + this._maxX = null; + this._maxY = null; + this._points.forEach((point) => { + if (!point) { + return; + } + point.translate(); + if (this._minX == null || point._point.x < this._minX) { + this._minX = point._point.x; + } + if (this._minY == null || point._point.y < this._minY) { + this._minY = point._point.y; + } + if (this._maxX == null || point._point.x > this._maxX) { + this._maxX = point._point.x; + } + if (this._maxY == null || point._point.y > this._maxY) { + this._maxY = point._point.y; + } + }); + if (this._minX == null) { + this._minX = 0; + } + if (this._minY == null) { + this._minY = 0; + } + if (this._maxX == null) { + this._maxX = 0; + } + if (this._maxY == null) { + this._maxY = 0; + } + } + _measure() { + if (this._minX == null || this._maxX == null || this._minY == null || this._maxY == null) { + return; + } + this._currentMeasure.width = Math.abs(this._maxX - this._minX) + this._lineWidth; + this._currentMeasure.height = Math.abs(this._maxY - this._minY) + this._lineWidth; + } + _computeAlignment() { + if (this._minX == null || this._minY == null) { + return; + } + this._currentMeasure.left = this._minX - this._lineWidth / 2; + this._currentMeasure.top = this._minY - this._lineWidth / 2; + } + dispose() { + this.reset(); + super.dispose(); + } +} +var init_multiLine = __esm(() => { + init_tslib_es62(); + init_abstractMesh(); + init_control(); + init_multiLinePoint(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], MultiLine2.prototype, "dash", null); + RegisterClass("BABYLON.GUI.MultiLine", MultiLine2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/radioButton.js +class RadioButton2 extends Control2 { + get thickness() { + return this._thickness; + } + set thickness(value) { + if (this._thickness === value) { + return; + } + this._thickness = value; + this._markAsDirty(); + } + get checkSizeRatio() { + return this._checkSizeRatio; + } + set checkSizeRatio(value) { + value = Math.max(Math.min(1, value), 0); + if (this._checkSizeRatio === value) { + return; + } + this._checkSizeRatio = value; + this._markAsDirty(); + } + get background() { + return this._background; + } + set background(value) { + if (this._background === value) { + return; + } + this._background = value; + this._markAsDirty(); + } + get isChecked() { + return this._isChecked; + } + set isChecked(value) { + if (this._isChecked === value) { + return; + } + this._isChecked = value; + this._markAsDirty(); + this.onIsCheckedChangedObservable.notifyObservers(value); + if (this._isChecked && this._host) { + this._host.executeOnAllControls((control39) => { + if (control39 === this) { + return; + } + if (control39.group === undefined) { + return; + } + const childRadio = control39; + if (childRadio.group === this.group) { + childRadio.isChecked = false; + } + }); + } + } + constructor(name314) { + super(name314); + this.name = name314; + this._isChecked = false; + this._background = "black"; + this._checkSizeRatio = 0.8; + this._thickness = 1; + this.group = ""; + this.onIsCheckedChangedObservable = new Observable; + this.isPointerBlocker = true; + } + _getTypeName() { + return "RadioButton"; + } + _draw(context) { + context.save(); + this._applyStates(context); + const actualWidth = this._currentMeasure.width - this._thickness; + const actualHeight = this._currentMeasure.height - this._thickness; + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + Control2.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2 - this._thickness / 2, this._currentMeasure.height / 2 - this._thickness / 2, context); + context.fillStyle = this._isEnabled ? this._background : this._disabledColor; + context.fill(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + context.strokeStyle = this.color; + context.lineWidth = this._thickness; + context.stroke(); + if (this._isChecked) { + context.fillStyle = this._isEnabled ? this.color : this._disabledColor; + const offsetWidth = actualWidth * this._checkSizeRatio; + const offseHeight = actualHeight * this._checkSizeRatio; + Control2.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, offsetWidth / 2 - this._thickness / 2, offseHeight / 2 - this._thickness / 2, context); + context.fill(); + } + context.restore(); + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { + return false; + } + if (this.isReadOnly) { + return true; + } + if (!this.isChecked) { + this.isChecked = true; + } + return true; + } + static AddRadioButtonWithHeader(title, group, isChecked, onValueChanged) { + const panel = new StackPanel2; + panel.isVertical = false; + panel.height = "30px"; + const radio = new RadioButton2; + radio.width = "20px"; + radio.height = "20px"; + radio.isChecked = isChecked; + radio.color = "green"; + radio.group = group; + radio.onIsCheckedChangedObservable.add((value) => onValueChanged(radio, value)); + panel.addControl(radio); + const header = new TextBlock2; + header.text = title; + header.width = "180px"; + header.paddingLeft = "5px"; + header.textHorizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + header.color = "white"; + panel.addControl(header); + return panel; + } +} +var init_radioButton = __esm(() => { + init_tslib_es62(); + init_observable(); + init_control(); + init_stackPanel(); + init_textBlock(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], RadioButton2.prototype, "thickness", null); + __decorate2([ + serialize() + ], RadioButton2.prototype, "group", undefined); + __decorate2([ + serialize() + ], RadioButton2.prototype, "checkSizeRatio", null); + __decorate2([ + serialize() + ], RadioButton2.prototype, "background", null); + __decorate2([ + serialize() + ], RadioButton2.prototype, "isChecked", null); + RegisterClass("BABYLON.GUI.RadioButton", RadioButton2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/sliders/baseSlider.js +class BaseSlider2 extends Control2 { + get displayThumb() { + return this._displayThumb; + } + set displayThumb(value) { + if (this._displayThumb === value) { + return; + } + this._displayThumb = value; + this._markAsDirty(); + } + get step() { + return this._step; + } + set step(value) { + if (this._step === value) { + return; + } + this._step = value; + this._markAsDirty(); + } + get barOffset() { + return this._barOffset.toString(this._host); + } + get barOffsetInPixels() { + return this._barOffset.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set barOffset(value) { + if (this._barOffset.toString(this._host) === value) { + return; + } + if (this._barOffset.fromString(value)) { + this._markAsDirty(); + } + } + get thumbWidth() { + return this._thumbWidth.toString(this._host); + } + get thumbWidthInPixels() { + return this._thumbWidth.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set thumbWidth(value) { + if (this._thumbWidth.toString(this._host) === value) { + return; + } + if (this._thumbWidth.fromString(value)) { + this._markAsDirty(); + } + } + get minimum() { + return this._minimum; + } + set minimum(value) { + if (this._minimum === value) { + return; + } + this._minimum = value; + this._markAsDirty(); + this.value = Math.max(Math.min(this.value, this._maximum), this._minimum); + } + get maximum() { + return this._maximum; + } + set maximum(value) { + if (this._maximum === value) { + return; + } + this._maximum = value; + this._markAsDirty(); + this.value = Math.max(Math.min(this.value, this._maximum), this._minimum); + } + get value() { + return this._value; + } + set value(value) { + value = Math.max(Math.min(value, this._maximum), this._minimum); + if (this._value === value) { + return; + } + this._value = value; + this._markAsDirty(); + this.onValueChangedObservable.notifyObservers(this._value); + } + get isVertical() { + return this._isVertical; + } + set isVertical(value) { + if (this._isVertical === value) { + return; + } + this._isVertical = value; + this._markAsDirty(); + } + get isThumbClamped() { + return this._isThumbClamped; + } + set isThumbClamped(value) { + if (this._isThumbClamped === value) { + return; + } + this._isThumbClamped = value; + this._markAsDirty(); + } + constructor(name314) { + super(name314); + this.name = name314; + this._thumbWidth = new ValueAndUnit2(20, ValueAndUnit2.UNITMODE_PIXEL, false); + this._minimum = 0; + this._maximum = 100; + this._value = 50; + this._isVertical = false; + this._barOffset = new ValueAndUnit2(5, ValueAndUnit2.UNITMODE_PIXEL, false); + this._isThumbClamped = false; + this._displayThumb = true; + this._step = 0; + this._lastPointerDownId = -1; + this._effectiveBarOffset = 0; + this.onValueChangedObservable = new Observable; + this._pointerIsDown = false; + this.isPointerBlocker = true; + } + _getTypeName() { + return "BaseSlider"; + } + _getThumbPosition() { + if (this.isVertical) { + return (this.maximum - this.value) / (this.maximum - this.minimum) * this._backgroundBoxLength; + } + return (this.value - this.minimum) / (this.maximum - this.minimum) * this._backgroundBoxLength; + } + _getThumbThickness(type) { + let thumbThickness = 0; + switch (type) { + case "circle": + if (this._thumbWidth.isPixel) { + thumbThickness = Math.max(this._thumbWidth.getValue(this._host), this._backgroundBoxThickness); + } else { + thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host); + } + break; + case "rectangle": + if (this._thumbWidth.isPixel) { + thumbThickness = Math.min(this._thumbWidth.getValue(this._host), this._backgroundBoxThickness); + } else { + thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host); + } + } + return thumbThickness; + } + _prepareRenderingData(type) { + this._effectiveBarOffset = 0; + this._renderLeft = this._currentMeasure.left; + this._renderTop = this._currentMeasure.top; + this._renderWidth = this._currentMeasure.width; + this._renderHeight = this._currentMeasure.height; + this._backgroundBoxLength = Math.max(this._currentMeasure.width, this._currentMeasure.height); + this._backgroundBoxThickness = Math.min(this._currentMeasure.width, this._currentMeasure.height); + this._effectiveThumbThickness = this._getThumbThickness(type); + if (this.displayThumb) { + this._backgroundBoxLength -= this._effectiveThumbThickness; + } + if (this.isVertical && this._currentMeasure.height < this._currentMeasure.width) { + console.error("Height should be greater than width"); + return; + } + if (this._barOffset.isPixel) { + this._effectiveBarOffset = Math.min(this._barOffset.getValue(this._host), this._backgroundBoxThickness); + } else { + this._effectiveBarOffset = this._backgroundBoxThickness * this._barOffset.getValue(this._host); + } + this._backgroundBoxThickness -= this._effectiveBarOffset * 2; + if (this.isVertical) { + this._renderLeft += this._effectiveBarOffset; + if (!this.isThumbClamped && this.displayThumb) { + this._renderTop += this._effectiveThumbThickness / 2; + } + this._renderHeight = this._backgroundBoxLength; + this._renderWidth = this._backgroundBoxThickness; + } else { + this._renderTop += this._effectiveBarOffset; + if (!this.isThumbClamped && this.displayThumb) { + this._renderLeft += this._effectiveThumbThickness / 2; + } + this._renderHeight = this._backgroundBoxThickness; + this._renderWidth = this._backgroundBoxLength; + } + } + _updateValueFromPointer(x, y) { + if (this.rotation != 0) { + this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition); + x = this._transformedPosition.x; + y = this._transformedPosition.y; + } + let value; + if (this._isVertical) { + value = this._minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this._maximum - this._minimum); + } else { + value = this._minimum + (x - this._currentMeasure.left) / this._currentMeasure.width * (this._maximum - this._minimum); + } + this.value = this._step ? Math.round(value / this._step) * this._step : value; + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { + return false; + } + if (this.isReadOnly) { + return true; + } + this._pointerIsDown = true; + this._updateValueFromPointer(coordinates.x, coordinates.y); + this._host._capturingControl[pointerId] = this; + this._lastPointerDownId = pointerId; + return true; + } + _onPointerMove(target, coordinates, pointerId, pi) { + if (pointerId != this._lastPointerDownId) { + return; + } + if (this._pointerIsDown && !this.isReadOnly) { + this._updateValueFromPointer(coordinates.x, coordinates.y); + } + super._onPointerMove(target, coordinates, pointerId, pi); + } + _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick) { + this._pointerIsDown = false; + delete this._host._capturingControl[pointerId]; + super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick); + } + _onCanvasBlur() { + this._forcePointerUp(); + super._onCanvasBlur(); + } +} +var init_baseSlider = __esm(() => { + init_tslib_es62(); + init_observable(); + init_control(); + init_valueAndUnit(); + init_decorators(); + __decorate2([ + serialize() + ], BaseSlider2.prototype, "displayThumb", null); + __decorate2([ + serialize() + ], BaseSlider2.prototype, "step", null); + __decorate2([ + serialize() + ], BaseSlider2.prototype, "barOffset", null); + __decorate2([ + serialize() + ], BaseSlider2.prototype, "thumbWidth", null); + __decorate2([ + serialize() + ], BaseSlider2.prototype, "minimum", null); + __decorate2([ + serialize() + ], BaseSlider2.prototype, "maximum", null); + __decorate2([ + serialize() + ], BaseSlider2.prototype, "value", null); + __decorate2([ + serialize() + ], BaseSlider2.prototype, "isVertical", null); + __decorate2([ + serialize() + ], BaseSlider2.prototype, "isThumbClamped", null); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/sliders/slider.js +class Slider2 extends BaseSlider2 { + get displayValueBar() { + return this._displayValueBar; + } + set displayValueBar(value) { + if (this._displayValueBar === value) { + return; + } + this._displayValueBar = value; + this._markAsDirty(); + } + get borderColor() { + return this._borderColor; + } + set borderColor(value) { + if (this._borderColor === value) { + return; + } + this._borderColor = value; + this._markAsDirty(); + } + get background() { + return this._background; + } + set background(value) { + if (this._background === value) { + return; + } + this._background = value; + this._markAsDirty(); + } + get backgroundGradient() { + return this._backgroundGradient; + } + set backgroundGradient(value) { + if (this._backgroundGradient === value) { + return; + } + this._backgroundGradient = value; + this._markAsDirty(); + } + get thumbColor() { + return this._thumbColor; + } + set thumbColor(value) { + if (this._thumbColor === value) { + return; + } + this._thumbColor = value; + this._markAsDirty(); + } + get isThumbCircle() { + return this._isThumbCircle; + } + set isThumbCircle(value) { + if (this._isThumbCircle === value) { + return; + } + this._isThumbCircle = value; + this._markAsDirty(); + } + constructor(name314) { + super(name314); + this.name = name314; + this._background = "black"; + this._borderColor = "white"; + this._thumbColor = ""; + this._isThumbCircle = false; + this._displayValueBar = true; + this._backgroundGradient = null; + } + _getTypeName() { + return "Slider"; + } + _getBackgroundColor(context) { + return this._backgroundGradient ? this._backgroundGradient.getCanvasGradient(context) : this._background; + } + _draw(context) { + context.save(); + this._applyStates(context); + this._prepareRenderingData(this.isThumbCircle ? "circle" : "rectangle"); + let left = this._renderLeft; + let top = this._renderTop; + const width = this._renderWidth; + const height = this._renderHeight; + let radius = 0; + if (this.isThumbClamped && this.isThumbCircle) { + if (this.isVertical) { + top += this._effectiveThumbThickness / 2; + } else { + left += this._effectiveThumbThickness / 2; + } + radius = this._backgroundBoxThickness / 2; + } else { + radius = (this._effectiveThumbThickness - this._effectiveBarOffset) / 2; + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + const thumbPosition = this._getThumbPosition(); + context.fillStyle = this._getBackgroundColor(context); + if (this.isVertical) { + if (this.isThumbClamped) { + if (this.isThumbCircle) { + context.beginPath(); + context.arc(left + this._backgroundBoxThickness / 2, top, radius, Math.PI, 2 * Math.PI); + context.fill(); + context.fillRect(left, top, width, height); + } else { + context.fillRect(left, top, width, height + this._effectiveThumbThickness); + } + } else { + context.fillRect(left, top, width, height); + } + } else { + if (this.isThumbClamped) { + if (this.isThumbCircle) { + context.beginPath(); + context.arc(left + this._backgroundBoxLength, top + this._backgroundBoxThickness / 2, radius, 0, 2 * Math.PI); + context.fill(); + context.fillRect(left, top, width, height); + } else { + context.fillRect(left, top, width + this._effectiveThumbThickness, height); + } + } else { + context.fillRect(left, top, width, height); + } + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + context.fillStyle = this._getColor(context); + if (this._displayValueBar) { + if (this.isVertical) { + if (this.isThumbClamped) { + if (this.isThumbCircle) { + context.beginPath(); + context.arc(left + this._backgroundBoxThickness / 2, top + this._backgroundBoxLength, radius, 0, 2 * Math.PI); + context.fill(); + context.fillRect(left, top + thumbPosition, width, height - thumbPosition); + } else { + context.fillRect(left, top + thumbPosition, width, height - thumbPosition + this._effectiveThumbThickness); + } + } else { + context.fillRect(left, top + thumbPosition, width, height - thumbPosition); + } + } else { + if (this.isThumbClamped) { + if (this.isThumbCircle) { + context.beginPath(); + context.arc(left, top + this._backgroundBoxThickness / 2, radius, 0, 2 * Math.PI); + context.fill(); + context.fillRect(left, top, thumbPosition, height); + } else { + context.fillRect(left, top, thumbPosition, height); + } + } else { + context.fillRect(left, top, thumbPosition, height); + } + } + } + context.fillStyle = this._thumbColor || this._getColor(context); + if (this.displayThumb) { + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + if (this._isThumbCircle) { + context.beginPath(); + if (this.isVertical) { + context.arc(left + this._backgroundBoxThickness / 2, top + thumbPosition, radius, 0, 2 * Math.PI); + } else { + context.arc(left + thumbPosition, top + this._backgroundBoxThickness / 2, radius, 0, 2 * Math.PI); + } + context.fill(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + context.strokeStyle = this._borderColor; + context.stroke(); + } else { + if (this.isVertical) { + context.fillRect(left - this._effectiveBarOffset, this._currentMeasure.top + thumbPosition, this._currentMeasure.width, this._effectiveThumbThickness); + } else { + context.fillRect(this._currentMeasure.left + thumbPosition, this._currentMeasure.top, this._effectiveThumbThickness, this._currentMeasure.height); + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + context.strokeStyle = this._borderColor; + if (this.isVertical) { + context.strokeRect(left - this._effectiveBarOffset, this._currentMeasure.top + thumbPosition, this._currentMeasure.width, this._effectiveThumbThickness); + } else { + context.strokeRect(this._currentMeasure.left + thumbPosition, this._currentMeasure.top, this._effectiveThumbThickness, this._currentMeasure.height); + } + } + } + context.restore(); + } + serialize(serializationObject) { + super.serialize(serializationObject); + if (this.backgroundGradient) { + serializationObject.backgroundGradient = {}; + this.backgroundGradient.serialize(serializationObject.backgroundGradient); + } + } + _parseFromContent(serializedObject, host) { + super._parseFromContent(serializedObject, host); + if (serializedObject.backgroundGradient) { + const className2 = Tools.Instantiate("BABYLON.GUI." + serializedObject.backgroundGradient.className); + this.backgroundGradient = new className2; + this.backgroundGradient.parse(serializedObject.backgroundGradient); + } + } +} +var init_slider = __esm(() => { + init_tslib_es62(); + init_baseSlider(); + init_typeStore(); + init_decorators(); + init_tools(); + __decorate2([ + serialize() + ], Slider2.prototype, "displayValueBar", null); + __decorate2([ + serialize() + ], Slider2.prototype, "borderColor", null); + __decorate2([ + serialize() + ], Slider2.prototype, "background", null); + __decorate2([ + serialize() + ], Slider2.prototype, "thumbColor", null); + __decorate2([ + serialize() + ], Slider2.prototype, "isThumbCircle", null); + RegisterClass("BABYLON.GUI.Slider", Slider2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/selector.js +class SelectorGroup { + constructor(name314) { + this.name = name314; + this._groupPanel = new StackPanel2; + this._selectors = new Array; + this._groupPanel.verticalAlignment = Control2.VERTICAL_ALIGNMENT_TOP; + this._groupPanel.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + this._groupHeader = this._addGroupHeader(name314); + } + get groupPanel() { + return this._groupPanel; + } + get selectors() { + return this._selectors; + } + get header() { + return this._groupHeader.text; + } + set header(label) { + if (this._groupHeader.text === "label") { + return; + } + this._groupHeader.text = label; + } + _addGroupHeader(text) { + const groupHeading = new TextBlock2("groupHead", text); + groupHeading.width = 0.9; + groupHeading.height = "30px"; + groupHeading.textWrapping = true; + groupHeading.color = "black"; + groupHeading.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + groupHeading.textHorizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + groupHeading.left = "2px"; + this._groupPanel.addControl(groupHeading); + return groupHeading; + } + _getSelector(selectorNb) { + if (selectorNb < 0 || selectorNb >= this._selectors.length) { + return; + } + return this._selectors[selectorNb]; + } + removeSelector(selectorNb) { + if (selectorNb < 0 || selectorNb >= this._selectors.length) { + return; + } + this._groupPanel.removeControl(this._selectors[selectorNb]); + this._selectors.splice(selectorNb, 1); + } +} + +class CheckboxGroup extends SelectorGroup { + addCheckbox(text, func = (s) => { + }, checked = false) { + checked = checked || false; + const button7 = new Checkbox2; + button7.width = "20px"; + button7.height = "20px"; + button7.color = "#364249"; + button7.background = "#CCCCCC"; + button7.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + button7.onIsCheckedChangedObservable.add(function(state) { + func(state); + }); + const _selector = Control2.AddHeader(button7, text, "200px", { isHorizontal: true, controlFirst: true }); + _selector.height = "30px"; + _selector.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + _selector.left = "4px"; + this.groupPanel.addControl(_selector); + this.selectors.push(_selector); + button7.isChecked = checked; + if (this.groupPanel.parent && this.groupPanel.parent.parent) { + button7.color = this.groupPanel.parent.parent.buttonColor; + button7.background = this.groupPanel.parent.parent.buttonBackground; + } + } + _setSelectorLabel(selectorNb, label) { + this.selectors[selectorNb].children[1].text = label; + } + _setSelectorLabelColor(selectorNb, color) { + this.selectors[selectorNb].children[1].color = color; + } + _setSelectorButtonColor(selectorNb, color) { + this.selectors[selectorNb].children[0].color = color; + } + _setSelectorButtonBackground(selectorNb, color) { + this.selectors[selectorNb].children[0].background = color; + } +} + +class RadioGroup extends SelectorGroup { + constructor() { + super(...arguments); + this._selectNb = 0; + } + addRadio(label, func = (n) => { + }, checked = false) { + const nb = this._selectNb++; + const button7 = new RadioButton2; + button7.name = label; + button7.width = "20px"; + button7.height = "20px"; + button7.color = "#364249"; + button7.background = "#CCCCCC"; + button7.group = this.name; + button7.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + button7.onIsCheckedChangedObservable.add(function(state) { + if (state) { + func(nb); + } + }); + const _selector = Control2.AddHeader(button7, label, "200px", { isHorizontal: true, controlFirst: true }); + _selector.height = "30px"; + _selector.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + _selector.left = "4px"; + this.groupPanel.addControl(_selector); + this.selectors.push(_selector); + button7.isChecked = checked; + if (this.groupPanel.parent && this.groupPanel.parent.parent) { + button7.color = this.groupPanel.parent.parent.buttonColor; + button7.background = this.groupPanel.parent.parent.buttonBackground; + } + } + _setSelectorLabel(selectorNb, label) { + this.selectors[selectorNb].children[1].text = label; + } + _setSelectorLabelColor(selectorNb, color) { + this.selectors[selectorNb].children[1].color = color; + } + _setSelectorButtonColor(selectorNb, color) { + this.selectors[selectorNb].children[0].color = color; + } + _setSelectorButtonBackground(selectorNb, color) { + this.selectors[selectorNb].children[0].background = color; + } +} + +class SliderGroup extends SelectorGroup { + addSlider(label, func = (v) => { + }, unit = "Units", min = 0, max = 0, value = 0, onValueChange = (v) => { + return v | 0; + }) { + const button7 = new Slider2; + button7.name = unit; + button7.value = value; + button7.minimum = min; + button7.maximum = max; + button7.width = 0.9; + button7.height = "20px"; + button7.color = "#364249"; + button7.background = "#CCCCCC"; + button7.borderColor = "black"; + button7.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + button7.left = "4px"; + button7.paddingBottom = "4px"; + button7.onValueChangedObservable.add(function(value2) { + button7.parent.children[0].text = button7.parent.children[0].name + ": " + onValueChange(value2) + " " + button7.name; + func(value2); + }); + const _selector = Control2.AddHeader(button7, label + ": " + onValueChange(value) + " " + unit, "30px", { isHorizontal: false, controlFirst: false }); + _selector.height = "60px"; + _selector.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + _selector.left = "4px"; + _selector.children[0].name = label; + this.groupPanel.addControl(_selector); + this.selectors.push(_selector); + if (this.groupPanel.parent && this.groupPanel.parent.parent) { + button7.color = this.groupPanel.parent.parent.buttonColor; + button7.background = this.groupPanel.parent.parent.buttonBackground; + } + } + _setSelectorLabel(selectorNb, label) { + this.selectors[selectorNb].children[0].name = label; + this.selectors[selectorNb].children[0].text = label + ": " + this.selectors[selectorNb].children[1].value + " " + this.selectors[selectorNb].children[1].name; + } + _setSelectorLabelColor(selectorNb, color) { + this.selectors[selectorNb].children[0].color = color; + } + _setSelectorButtonColor(selectorNb, color) { + this.selectors[selectorNb].children[1].color = color; + } + _setSelectorButtonBackground(selectorNb, color) { + this.selectors[selectorNb].children[1].background = color; + } +} + +class SelectionPanel extends Rectangle2 { + constructor(name314, groups = []) { + super(name314); + this.name = name314; + this.groups = groups; + this._buttonColor = "#364249"; + this._buttonBackground = "#CCCCCC"; + this._headerColor = "black"; + this._barColor = "white"; + this._barHeight = "2px"; + this._spacerHeight = "20px"; + this._bars = new Array; + this._groups = groups; + this.thickness = 2; + this._panel = new StackPanel2; + this._panel.verticalAlignment = Control2.VERTICAL_ALIGNMENT_TOP; + this._panel.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + this._panel.top = 5; + this._panel.left = 5; + this._panel.width = 0.95; + if (groups.length > 0) { + for (let i = 0;i < groups.length - 1; i++) { + this._panel.addControl(groups[i].groupPanel); + this._addSpacer(); + } + this._panel.addControl(groups[groups.length - 1].groupPanel); + } + this.addControl(this._panel); + } + _getTypeName() { + return "SelectionPanel"; + } + get panel() { + return this._panel; + } + get headerColor() { + return this._headerColor; + } + set headerColor(color) { + if (this._headerColor === color) { + return; + } + this._headerColor = color; + this._setHeaderColor(); + } + _setHeaderColor() { + for (let i = 0;i < this._groups.length; i++) { + this._groups[i].groupPanel.children[0].color = this._headerColor; + } + } + get buttonColor() { + return this._buttonColor; + } + set buttonColor(color) { + if (this._buttonColor === color) { + return; + } + this._buttonColor = color; + this._setbuttonColor(); + } + _setbuttonColor() { + for (let i = 0;i < this._groups.length; i++) { + for (let j = 0;j < this._groups[i].selectors.length; j++) { + this._groups[i]._setSelectorButtonColor(j, this._buttonColor); + } + } + } + get labelColor() { + return this._labelColor; + } + set labelColor(color) { + if (this._labelColor === color) { + return; + } + this._labelColor = color; + this._setLabelColor(); + } + _setLabelColor() { + for (let i = 0;i < this._groups.length; i++) { + for (let j = 0;j < this._groups[i].selectors.length; j++) { + this._groups[i]._setSelectorLabelColor(j, this._labelColor); + } + } + } + get buttonBackground() { + return this._buttonBackground; + } + set buttonBackground(color) { + if (this._buttonBackground === color) { + return; + } + this._buttonBackground = color; + this._setButtonBackground(); + } + _setButtonBackground() { + for (let i = 0;i < this._groups.length; i++) { + for (let j = 0;j < this._groups[i].selectors.length; j++) { + this._groups[i]._setSelectorButtonBackground(j, this._buttonBackground); + } + } + } + get barColor() { + return this._barColor; + } + set barColor(color) { + if (this._barColor === color) { + return; + } + this._barColor = color; + this._setBarColor(); + } + _setBarColor() { + for (let i = 0;i < this._bars.length; i++) { + this._bars[i].children[0].background = this._barColor; + } + } + get barHeight() { + return this._barHeight; + } + set barHeight(value) { + if (this._barHeight === value) { + return; + } + this._barHeight = value; + this._setBarHeight(); + } + _setBarHeight() { + for (let i = 0;i < this._bars.length; i++) { + this._bars[i].children[0].height = this._barHeight; + } + } + get spacerHeight() { + return this._spacerHeight; + } + set spacerHeight(value) { + if (this._spacerHeight === value) { + return; + } + this._spacerHeight = value; + this._setSpacerHeight(); + } + _setSpacerHeight() { + for (let i = 0;i < this._bars.length; i++) { + this._bars[i].height = this._spacerHeight; + } + } + _addSpacer() { + const separator = new Container2; + separator.width = 1; + separator.height = this._spacerHeight; + separator.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + const bar = new Rectangle2; + bar.width = 1; + bar.height = this._barHeight; + bar.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + bar.verticalAlignment = Control2.VERTICAL_ALIGNMENT_CENTER; + bar.background = this._barColor; + bar.color = "transparent"; + separator.addControl(bar); + this._panel.addControl(separator); + this._bars.push(separator); + } + addGroup(group) { + if (this._groups.length > 0) { + this._addSpacer(); + } + this._panel.addControl(group.groupPanel); + this._groups.push(group); + group.groupPanel.children[0].color = this._headerColor; + for (let j = 0;j < group.selectors.length; j++) { + group._setSelectorButtonColor(j, this._buttonColor); + group._setSelectorButtonBackground(j, this._buttonBackground); + } + } + removeGroup(groupNb) { + if (groupNb < 0 || groupNb >= this._groups.length) { + return; + } + const group = this._groups[groupNb]; + this._panel.removeControl(group.groupPanel); + this._groups.splice(groupNb, 1); + if (groupNb < this._bars.length) { + this._panel.removeControl(this._bars[groupNb]); + this._bars.splice(groupNb, 1); + } + } + setHeaderName(label, groupNb) { + if (groupNb < 0 || groupNb >= this._groups.length) { + return; + } + const group = this._groups[groupNb]; + group.groupPanel.children[0].text = label; + } + relabel(label, groupNb, selectorNb) { + if (groupNb < 0 || groupNb >= this._groups.length) { + return; + } + const group = this._groups[groupNb]; + if (selectorNb < 0 || selectorNb >= group.selectors.length) { + return; + } + group._setSelectorLabel(selectorNb, label); + } + removeFromGroupSelector(groupNb, selectorNb) { + if (groupNb < 0 || groupNb >= this._groups.length) { + return; + } + const group = this._groups[groupNb]; + if (selectorNb < 0 || selectorNb >= group.selectors.length) { + return; + } + group.removeSelector(selectorNb); + } + addToGroupCheckbox(groupNb, label, func = () => { + }, checked = false) { + if (groupNb < 0 || groupNb >= this._groups.length) { + return; + } + const group = this._groups[groupNb]; + group.addCheckbox(label, func, checked); + } + addToGroupRadio(groupNb, label, func = () => { + }, checked = false) { + if (groupNb < 0 || groupNb >= this._groups.length) { + return; + } + const group = this._groups[groupNb]; + group.addRadio(label, func, checked); + } + addToGroupSlider(groupNb, label, func = () => { + }, unit = "Units", min = 0, max = 0, value = 0, onVal = (v) => { + return v | 0; + }) { + if (groupNb < 0 || groupNb >= this._groups.length) { + return; + } + const group = this._groups[groupNb]; + group.addSlider(label, func, unit, min, max, value, onVal); + } +} +var init_selector = __esm(() => { + init_rectangle(); + init_stackPanel(); + init_control(); + init_textBlock(); + init_checkbox(); + init_radioButton(); + init_slider(); + init_container(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/scrollViewers/scrollViewerWindow.js +class _ScrollViewerWindow2 extends Container2 { + get freezeControls() { + return this._freezeControls; + } + set freezeControls(value) { + if (this._freezeControls === value) { + return; + } + if (!value) { + this._restoreMeasures(); + } + this._freezeControls = false; + const textureSize = this.host.getSize(); + const renderWidth = textureSize.width; + const renderHeight = textureSize.height; + const context = this.host.getContext(); + const measure12 = new Measure2(0, 0, renderWidth, renderHeight); + this.host._numLayoutCalls = 0; + this.host._rootContainer._layout(measure12, context); + if (value) { + this._updateMeasures(); + if (this._useBuckets()) { + this._makeBuckets(); + } + } + this._freezeControls = value; + this.host.markAsDirty(); + } + get bucketWidth() { + return this._bucketWidth; + } + get bucketHeight() { + return this._bucketHeight; + } + setBucketSizes(width, height) { + this._bucketWidth = width; + this._bucketHeight = height; + if (this._useBuckets()) { + if (this._freezeControls) { + this._makeBuckets(); + } + } else { + this._buckets = {}; + } + } + _useBuckets() { + return this._bucketWidth > 0 && this._bucketHeight > 0; + } + _makeBuckets() { + this._buckets = {}; + this._bucketLen = Math.ceil(this.widthInPixels / this._bucketWidth); + this._dispatchInBuckets(this._children); + this._oldLeft = null; + this._oldTop = null; + } + _dispatchInBuckets(children) { + for (let i = 0;i < children.length; ++i) { + const child = children[i]; + const bStartX = Math.max(0, Math.floor((child._customData._origLeft - this._customData.origLeft) / this._bucketWidth)), bEndX = Math.floor((child._customData._origLeft - this._customData.origLeft + child._currentMeasure.width - 1) / this._bucketWidth), bEndY = Math.floor((child._customData._origTop - this._customData.origTop + child._currentMeasure.height - 1) / this._bucketHeight); + let bStartY = Math.max(0, Math.floor((child._customData._origTop - this._customData.origTop) / this._bucketHeight)); + while (bStartY <= bEndY) { + for (let x = bStartX;x <= bEndX; ++x) { + const bucket = bStartY * this._bucketLen + x; + let lstc = this._buckets[bucket]; + if (!lstc) { + lstc = []; + this._buckets[bucket] = lstc; + } + lstc.push(child); + } + bStartY++; + } + if (child instanceof Container2 && child._children.length > 0) { + this._dispatchInBuckets(child._children); + } + } + } + _updateMeasures() { + const left = this.leftInPixels | 0, top = this.topInPixels | 0; + this._measureForChildren.left -= left; + this._measureForChildren.top -= top; + this._currentMeasure.left -= left; + this._currentMeasure.top -= top; + this._customData.origLeftForChildren = this._measureForChildren.left; + this._customData.origTopForChildren = this._measureForChildren.top; + this._customData.origLeft = this._currentMeasure.left; + this._customData.origTop = this._currentMeasure.top; + this._updateChildrenMeasures(this._children, left, top); + } + _updateChildrenMeasures(children, left, top) { + for (let i = 0;i < children.length; ++i) { + const child = children[i]; + child._currentMeasure.left -= left; + child._currentMeasure.top -= top; + child._customData._origLeft = child._currentMeasure.left; + child._customData._origTop = child._currentMeasure.top; + if (child instanceof Container2 && child._children.length > 0) { + this._updateChildrenMeasures(child._children, left, top); + } + } + } + _restoreMeasures() { + const left = this.leftInPixels | 0, top = this.topInPixels | 0; + this._measureForChildren.left = this._customData.origLeftForChildren + left; + this._measureForChildren.top = this._customData.origTopForChildren + top; + this._currentMeasure.left = this._customData.origLeft + left; + this._currentMeasure.top = this._customData.origTop + top; + } + constructor(name314) { + super(name314); + this._freezeControls = false; + this._bucketWidth = 0; + this._bucketHeight = 0; + this._buckets = {}; + } + _getTypeName() { + return "ScrollViewerWindow"; + } + _additionalProcessing(parentMeasure, context) { + super._additionalProcessing(parentMeasure, context); + this._parentMeasure = parentMeasure; + this._measureForChildren.left = this._currentMeasure.left; + this._measureForChildren.top = this._currentMeasure.top; + this._measureForChildren.width = parentMeasure.width; + this._measureForChildren.height = parentMeasure.height; + } + _layout(parentMeasure, context) { + if (this._freezeControls) { + this.invalidateRect(); + return false; + } + return super._layout(parentMeasure, context); + } + _scrollChildren(children, left, top) { + for (let i = 0;i < children.length; ++i) { + const child = children[i]; + child._currentMeasure.left = child._customData._origLeft + left; + child._currentMeasure.top = child._customData._origTop + top; + child._isClipped = false; + if (child instanceof Container2 && child._children.length > 0) { + this._scrollChildren(child._children, left, top); + } + } + } + _scrollChildrenWithBuckets(left, top, scrollLeft, scrollTop) { + const bStartX = Math.max(0, Math.floor(-left / this._bucketWidth)), bEndX = Math.floor((-left + this._parentMeasure.width - 1) / this._bucketWidth), bEndY = Math.floor((-top + this._parentMeasure.height - 1) / this._bucketHeight); + let bStartY = Math.max(0, Math.floor(-top / this._bucketHeight)); + while (bStartY <= bEndY) { + for (let x = bStartX;x <= bEndX; ++x) { + const bucket = bStartY * this._bucketLen + x, lstc = this._buckets[bucket]; + if (lstc) { + for (let i = 0;i < lstc.length; ++i) { + const child = lstc[i]; + child._currentMeasure.left = child._customData._origLeft + scrollLeft; + child._currentMeasure.top = child._customData._origTop + scrollTop; + child._isClipped = false; + } + } + } + bStartY++; + } + } + _draw(context, invalidatedRectangle) { + if (!this._freezeControls) { + super._draw(context, invalidatedRectangle); + return; + } + this._localDraw(context); + if (this.clipChildren) { + this._clipForChildren(context); + } + const left = this.leftInPixels | 0, top = this.topInPixels | 0; + if (this._useBuckets()) { + if (this._oldLeft !== null && this._oldTop !== null) { + this._scrollChildrenWithBuckets(this._oldLeft, this._oldTop, left, top); + this._scrollChildrenWithBuckets(left, top, left, top); + } else { + this._scrollChildren(this._children, left, top); + } + } else { + this._scrollChildren(this._children, left, top); + } + this._oldLeft = left; + this._oldTop = top; + for (const child of this._children) { + if (!child._intersectsRect(this._parentMeasure)) { + continue; + } + child._render(context, this._parentMeasure); + } + } + _postMeasure() { + if (this._freezeControls) { + super._postMeasure(); + return; + } + let maxWidth = this.parentClientWidth; + let maxHeight = this.parentClientHeight; + for (const child of this.children) { + if (!child.isVisible || child.notRenderable) { + continue; + } + if (child.horizontalAlignment === Control2.HORIZONTAL_ALIGNMENT_CENTER) { + child._offsetLeft(this._currentMeasure.left - child._currentMeasure.left); + } + if (child.verticalAlignment === Control2.VERTICAL_ALIGNMENT_CENTER) { + child._offsetTop(this._currentMeasure.top - child._currentMeasure.top); + } + maxWidth = Math.max(maxWidth, child._currentMeasure.left - this._currentMeasure.left + child._currentMeasure.width + child.paddingRightInPixels); + maxHeight = Math.max(maxHeight, child._currentMeasure.top - this._currentMeasure.top + child._currentMeasure.height + child.paddingBottomInPixels); + } + if (this._currentMeasure.width !== maxWidth) { + this._width.updateInPlace(maxWidth, ValueAndUnit2.UNITMODE_PIXEL); + this._currentMeasure.width = maxWidth; + this._rebuildLayout = true; + this._isDirty = true; + } + if (this._currentMeasure.height !== maxHeight) { + this._height.updateInPlace(maxHeight, ValueAndUnit2.UNITMODE_PIXEL); + this._currentMeasure.height = maxHeight; + this._rebuildLayout = true; + this._isDirty = true; + } + super._postMeasure(); + } +} +var init_scrollViewerWindow = __esm(() => { + init_measure(); + init_container(); + init_valueAndUnit(); + init_control(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/sliders/scrollBar.js +class ScrollBar2 extends BaseSlider2 { + get borderColor() { + return this._borderColor; + } + set borderColor(value) { + if (this._borderColor === value) { + return; + } + this._borderColor = value; + this._markAsDirty(); + } + get background() { + return this._background; + } + set background(value) { + if (this._background === value) { + return; + } + this._background = value; + this._markAsDirty(); + } + get backgroundGradient() { + return this._backgroundGradient; + } + set backgroundGradient(value) { + if (this._backgroundGradient === value) { + return; + } + this._backgroundGradient = value; + this._markAsDirty(); + } + get invertScrollDirection() { + return this._invertScrollDirection; + } + set invertScrollDirection(invert) { + this._invertScrollDirection = invert; + } + constructor(name314) { + super(name314); + this.name = name314; + this._background = "black"; + this._borderColor = "white"; + this._tempMeasure = new Measure2(0, 0, 0, 0); + this._invertScrollDirection = false; + this._backgroundGradient = null; + } + _getTypeName() { + return "Scrollbar"; + } + _getThumbThickness() { + let thumbThickness = 0; + if (this._thumbWidth.isPixel) { + thumbThickness = this._thumbWidth.getValue(this._host); + } else { + thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host); + } + return thumbThickness; + } + _getBackgroundColor(context) { + return this._backgroundGradient ? this._backgroundGradient.getCanvasGradient(context) : this._background; + } + _draw(context) { + context.save(); + this._applyStates(context); + this._prepareRenderingData("rectangle"); + const left = this._renderLeft; + const thumbPosition = this._getThumbPosition(); + context.fillStyle = this._getBackgroundColor(context); + context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + context.fillStyle = this._getColor(context); + if (this.isVertical) { + this._tempMeasure.left = left - this._effectiveBarOffset; + this._tempMeasure.top = this._currentMeasure.top + thumbPosition; + this._tempMeasure.width = this._currentMeasure.width; + this._tempMeasure.height = this._effectiveThumbThickness; + } else { + this._tempMeasure.left = this._currentMeasure.left + thumbPosition; + this._tempMeasure.top = this._currentMeasure.top; + this._tempMeasure.width = this._effectiveThumbThickness; + this._tempMeasure.height = this._currentMeasure.height; + } + context.fillRect(this._tempMeasure.left, this._tempMeasure.top, this._tempMeasure.width, this._tempMeasure.height); + context.restore(); + } + _updateValueFromPointer(x, y) { + if (this.rotation != 0) { + this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition); + x = this._transformedPosition.x; + y = this._transformedPosition.y; + } + const sign = this._invertScrollDirection ? -1 : 1; + if (this._first) { + this._first = false; + this._originX = x; + this._originY = y; + if (x < this._tempMeasure.left || x > this._tempMeasure.left + this._tempMeasure.width || y < this._tempMeasure.top || y > this._tempMeasure.top + this._tempMeasure.height) { + if (this.isVertical) { + this.value = this.minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this.maximum - this.minimum); + } else { + this.value = this.minimum + (x - this._currentMeasure.left) / this._currentMeasure.width * (this.maximum - this.minimum); + } + } + } + let delta = 0; + if (this.isVertical) { + delta = -((y - this._originY) / (this._currentMeasure.height - this._effectiveThumbThickness)); + } else { + delta = (x - this._originX) / (this._currentMeasure.width - this._effectiveThumbThickness); + } + this.value += sign * delta * (this.maximum - this.minimum); + this._originX = x; + this._originY = y; + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + this._first = true; + return super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi); + } + serialize(serializationObject) { + super.serialize(serializationObject); + if (this.backgroundGradient) { + serializationObject.backgroundGradient = {}; + this.backgroundGradient.serialize(serializationObject.backgroundGradient); + } + } + _parseFromContent(serializationObject, host) { + super._parseFromContent(serializationObject, host); + if (serializationObject.backgroundGradient) { + const className2 = Tools.Instantiate("BABYLON.GUI." + serializationObject.backgroundGradient.className); + this.backgroundGradient = new className2; + this.backgroundGradient.parse(serializationObject.backgroundGradient); + } + } +} +var init_scrollBar = __esm(() => { + init_tslib_es62(); + init_baseSlider(); + init_measure(); + init_decorators(); + init_tools(); + init_typeStore(); + __decorate2([ + serialize() + ], ScrollBar2.prototype, "borderColor", null); + __decorate2([ + serialize() + ], ScrollBar2.prototype, "background", null); + __decorate2([ + serialize() + ], ScrollBar2.prototype, "invertScrollDirection", null); + RegisterClass("BABYLON.GUI.Scrollbar", ScrollBar2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/sliders/imageScrollBar.js +class ImageScrollBar2 extends BaseSlider2 { + get invertScrollDirection() { + return this._invertScrollDirection; + } + set invertScrollDirection(invert) { + this._invertScrollDirection = invert; + } + get backgroundImage() { + return this._backgroundBaseImage; + } + set backgroundImage(value) { + if (this._backgroundBaseImage === value) { + return; + } + this._backgroundBaseImage = value; + if (this.isVertical && this.num90RotationInVerticalMode !== 0) { + if (!value.isLoaded) { + value.onImageLoadedObservable.addOnce(() => { + const rotatedValue = value._rotate90(this.num90RotationInVerticalMode, true); + this._backgroundImage = rotatedValue; + if (!rotatedValue.isLoaded) { + rotatedValue.onImageLoadedObservable.addOnce(() => { + this._markAsDirty(); + }); + } + this._markAsDirty(); + }); + } else { + this._backgroundImage = value._rotate90(this.num90RotationInVerticalMode, true); + this._markAsDirty(); + } + } else { + this._backgroundImage = value; + if (value && !value.isLoaded) { + value.onImageLoadedObservable.addOnce(() => { + this._markAsDirty(); + }); + } + this._markAsDirty(); + } + } + get thumbImage() { + return this._thumbBaseImage; + } + set thumbImage(value) { + if (this._thumbBaseImage === value) { + return; + } + this._thumbBaseImage = value; + if (this.isVertical && this.num90RotationInVerticalMode !== 0) { + if (!value.isLoaded) { + value.onImageLoadedObservable.addOnce(() => { + const rotatedValue = value._rotate90(-this.num90RotationInVerticalMode, true); + this._thumbImage = rotatedValue; + if (!rotatedValue.isLoaded) { + rotatedValue.onImageLoadedObservable.addOnce(() => { + this._markAsDirty(); + }); + } + this._markAsDirty(); + }); + } else { + this._thumbImage = value._rotate90(-this.num90RotationInVerticalMode, true); + this._markAsDirty(); + } + } else { + this._thumbImage = value; + if (value && !value.isLoaded) { + value.onImageLoadedObservable.addOnce(() => { + this._markAsDirty(); + }); + } + this._markAsDirty(); + } + } + get thumbLength() { + return this._thumbLength; + } + set thumbLength(value) { + if (this._thumbLength === value) { + return; + } + this._thumbLength = value; + this._markAsDirty(); + } + get thumbHeight() { + return this._thumbHeight; + } + set thumbHeight(value) { + if (this._thumbLength === value) { + return; + } + this._thumbHeight = value; + this._markAsDirty(); + } + get barImageHeight() { + return this._barImageHeight; + } + set barImageHeight(value) { + if (this._barImageHeight === value) { + return; + } + this._barImageHeight = value; + this._markAsDirty(); + } + constructor(name314) { + super(name314); + this.name = name314; + this._thumbLength = 0.5; + this._thumbHeight = 1; + this._barImageHeight = 1; + this._tempMeasure = new Measure2(0, 0, 0, 0); + this._invertScrollDirection = false; + this.num90RotationInVerticalMode = 1; + } + _getTypeName() { + return "ImageScrollBar"; + } + _getThumbThickness() { + let thumbThickness = 0; + if (this._thumbWidth.isPixel) { + thumbThickness = this._thumbWidth.getValue(this._host); + } else { + thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host); + } + return thumbThickness; + } + _draw(context) { + context.save(); + this._applyStates(context); + this._prepareRenderingData("rectangle"); + const thumbPosition = this._getThumbPosition(); + const left = this._renderLeft; + const top = this._renderTop; + const width = this._renderWidth; + const height = this._renderHeight; + if (this._backgroundImage) { + this._tempMeasure.copyFromFloats(left, top, width, height); + if (this.isVertical) { + this._tempMeasure.copyFromFloats(left + width * (1 - this._barImageHeight) * 0.5, this._currentMeasure.top, width * this._barImageHeight, height); + this._tempMeasure.height += this._effectiveThumbThickness; + this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure); + } else { + this._tempMeasure.copyFromFloats(this._currentMeasure.left, top + height * (1 - this._barImageHeight) * 0.5, width, height * this._barImageHeight); + this._tempMeasure.width += this._effectiveThumbThickness; + this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure); + } + this._backgroundImage._draw(context); + } + if (this.isVertical) { + this._tempMeasure.copyFromFloats(left - this._effectiveBarOffset + this._currentMeasure.width * (1 - this._thumbHeight) * 0.5, this._currentMeasure.top + thumbPosition, this._currentMeasure.width * this._thumbHeight, this._effectiveThumbThickness); + } else { + this._tempMeasure.copyFromFloats(this._currentMeasure.left + thumbPosition, this._currentMeasure.top + this._currentMeasure.height * (1 - this._thumbHeight) * 0.5, this._effectiveThumbThickness, this._currentMeasure.height * this._thumbHeight); + } + if (this._thumbImage) { + this._thumbImage._currentMeasure.copyFrom(this._tempMeasure); + this._thumbImage._draw(context); + } + context.restore(); + } + _updateValueFromPointer(x, y) { + if (this.rotation != 0) { + this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition); + x = this._transformedPosition.x; + y = this._transformedPosition.y; + } + const sign = this._invertScrollDirection ? -1 : 1; + if (this._first) { + this._first = false; + this._originX = x; + this._originY = y; + if (x < this._tempMeasure.left || x > this._tempMeasure.left + this._tempMeasure.width || y < this._tempMeasure.top || y > this._tempMeasure.top + this._tempMeasure.height) { + if (this.isVertical) { + this.value = this.minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this.maximum - this.minimum); + } else { + this.value = this.minimum + (x - this._currentMeasure.left) / this._currentMeasure.width * (this.maximum - this.minimum); + } + } + } + let delta = 0; + if (this.isVertical) { + delta = -((y - this._originY) / (this._currentMeasure.height - this._effectiveThumbThickness)); + } else { + delta = (x - this._originX) / (this._currentMeasure.width - this._effectiveThumbThickness); + } + this.value += sign * delta * (this.maximum - this.minimum); + this._originX = x; + this._originY = y; + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + this._first = true; + return super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi); + } +} +var init_imageScrollBar = __esm(() => { + init_tslib_es62(); + init_baseSlider(); + init_measure(); + init_decorators(); + __decorate2([ + serialize() + ], ImageScrollBar2.prototype, "num90RotationInVerticalMode", undefined); + __decorate2([ + serialize() + ], ImageScrollBar2.prototype, "invertScrollDirection", null); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/scrollViewers/scrollViewer.js +class ScrollViewer2 extends Rectangle2 { + get horizontalBar() { + return this._horizontalBar; + } + get verticalBar() { + return this._verticalBar; + } + addControl(control43) { + if (!control43) { + return this; + } + this._window.addControl(control43); + return this; + } + removeControl(control43) { + this._window.removeControl(control43); + return this; + } + get children() { + return this._window.children; + } + _flagDescendantsAsMatrixDirty() { + for (const child of this._children) { + child._markMatrixAsDirty(); + } + } + get freezeControls() { + return this._window.freezeControls; + } + set freezeControls(value) { + this._window.freezeControls = value; + } + get bucketWidth() { + return this._window.bucketWidth; + } + get bucketHeight() { + return this._window.bucketHeight; + } + setBucketSizes(width, height) { + this._window.setBucketSizes(width, height); + } + get forceHorizontalBar() { + return this._forceHorizontalBar; + } + set forceHorizontalBar(value) { + this._grid.setRowDefinition(1, value ? this._barSize : 0, true); + this._horizontalBar.isVisible = value; + this._forceHorizontalBar = value; + } + get forceVerticalBar() { + return this._forceVerticalBar; + } + set forceVerticalBar(value) { + this._grid.setColumnDefinition(1, value ? this._barSize : 0, true); + this._verticalBar.isVisible = value; + this._forceVerticalBar = value; + } + constructor(name314, isImageBased) { + super(name314); + this._barSize = 20; + this._pointerIsOver = false; + this._wheelPrecision = 0.05; + this._thumbLength = 0.5; + this._thumbHeight = 1; + this._barImageHeight = 1; + this._horizontalBarImageHeight = 1; + this._verticalBarImageHeight = 1; + this._oldWindowContentsWidth = 0; + this._oldWindowContentsHeight = 0; + this._forceHorizontalBar = false; + this._forceVerticalBar = false; + this._useImageBar = isImageBased ? isImageBased : false; + this.onDirtyObservable.add(() => { + this._horizontalBarSpace.color = this.color; + this._verticalBarSpace.color = this.color; + this._dragSpace.color = this.color; + }); + this.onPointerEnterObservable.add(() => { + this._pointerIsOver = true; + }); + this.onPointerOutObservable.add(() => { + this._pointerIsOver = false; + }); + this._grid = new Grid2; + if (this._useImageBar) { + this._horizontalBar = new ImageScrollBar2; + this._verticalBar = new ImageScrollBar2; + } else { + this._horizontalBar = new ScrollBar2; + this._verticalBar = new ScrollBar2; + } + this._window = new _ScrollViewerWindow2("scrollViewer_window"); + this._window.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + this._window.verticalAlignment = Control2.VERTICAL_ALIGNMENT_TOP; + this._grid.addColumnDefinition(1); + this._grid.addColumnDefinition(0, true); + this._grid.addRowDefinition(1); + this._grid.addRowDefinition(0, true); + super.addControl(this._grid); + this._grid.addControl(this._window, 0, 0); + this._verticalBarSpace = new Rectangle2; + this._verticalBarSpace.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + this._verticalBarSpace.verticalAlignment = Control2.VERTICAL_ALIGNMENT_TOP; + this._verticalBarSpace.thickness = 1; + this._grid.addControl(this._verticalBarSpace, 0, 1); + this._addBar(this._verticalBar, this._verticalBarSpace, true, Math.PI); + this._horizontalBarSpace = new Rectangle2; + this._horizontalBarSpace.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + this._horizontalBarSpace.verticalAlignment = Control2.VERTICAL_ALIGNMENT_TOP; + this._horizontalBarSpace.thickness = 1; + this._grid.addControl(this._horizontalBarSpace, 1, 0); + this._addBar(this._horizontalBar, this._horizontalBarSpace, false, 0); + this._dragSpace = new Rectangle2; + this._dragSpace.thickness = 1; + this._grid.addControl(this._dragSpace, 1, 1); + if (!this._useImageBar) { + this.barColor = "grey"; + this.barBackground = "transparent"; + } + } + resetWindow() { + this._window.width = "100%"; + this._window.height = "100%"; + } + _getTypeName() { + return "ScrollViewer"; + } + _buildClientSizes() { + const ratio = this.host.idealRatio; + this._window.parentClientWidth = this._currentMeasure.width - (this._verticalBar.isVisible || this.forceVerticalBar ? this._barSize * ratio : 0) - 2 * this.thickness; + this._window.parentClientHeight = this._currentMeasure.height - (this._horizontalBar.isVisible || this.forceHorizontalBar ? this._barSize * ratio : 0) - 2 * this.thickness; + this._clientWidth = this._window.parentClientWidth; + this._clientHeight = this._window.parentClientHeight; + } + _additionalProcessing(parentMeasure, context) { + super._additionalProcessing(parentMeasure, context); + this._buildClientSizes(); + } + _postMeasure() { + super._postMeasure(); + this._updateScroller(); + this._setWindowPosition(false); + } + get wheelPrecision() { + return this._wheelPrecision; + } + set wheelPrecision(value) { + if (this._wheelPrecision === value) { + return; + } + if (value < 0) { + value = 0; + } + if (value > 1) { + value = 1; + } + this._wheelPrecision = value; + } + get scrollBackground() { + return this._horizontalBarSpace.background; + } + set scrollBackground(color) { + if (this._horizontalBarSpace.background === color) { + return; + } + this._horizontalBarSpace.background = color; + this._verticalBarSpace.background = color; + } + get barColor() { + return this._barColor; + } + set barColor(color) { + if (this._barColor === color) { + return; + } + this._barColor = color; + this._horizontalBar.color = color; + this._verticalBar.color = color; + } + get thumbImage() { + return this._barImage; + } + set thumbImage(value) { + if (this._barImage === value) { + return; + } + this._barImage = value; + const hb = this._horizontalBar; + const vb = this._verticalBar; + hb.thumbImage = value; + vb.thumbImage = value; + } + get horizontalThumbImage() { + return this._horizontalBarImage; + } + set horizontalThumbImage(value) { + if (this._horizontalBarImage === value) { + return; + } + this._horizontalBarImage = value; + const hb = this._horizontalBar; + hb.thumbImage = value; + } + get verticalThumbImage() { + return this._verticalBarImage; + } + set verticalThumbImage(value) { + if (this._verticalBarImage === value) { + return; + } + this._verticalBarImage = value; + const vb = this._verticalBar; + vb.thumbImage = value; + } + get barSize() { + return this._barSize; + } + set barSize(value) { + if (this._barSize === value) { + return; + } + this._barSize = value; + this._markAsDirty(); + if (this._horizontalBar.isVisible) { + this._grid.setRowDefinition(1, this._barSize, true); + } + if (this._verticalBar.isVisible) { + this._grid.setColumnDefinition(1, this._barSize, true); + } + } + get thumbLength() { + return this._thumbLength; + } + set thumbLength(value) { + if (this._thumbLength === value) { + return; + } + if (value <= 0) { + value = 0.1; + } + if (value > 1) { + value = 1; + } + this._thumbLength = value; + const hb = this._horizontalBar; + const vb = this._verticalBar; + hb.thumbLength = value; + vb.thumbLength = value; + this._markAsDirty(); + } + get thumbHeight() { + return this._thumbHeight; + } + set thumbHeight(value) { + if (this._thumbHeight === value) { + return; + } + if (value <= 0) { + value = 0.1; + } + if (value > 1) { + value = 1; + } + this._thumbHeight = value; + const hb = this._horizontalBar; + const vb = this._verticalBar; + hb.thumbHeight = value; + vb.thumbHeight = value; + this._markAsDirty(); + } + get barImageHeight() { + return this._barImageHeight; + } + set barImageHeight(value) { + if (this._barImageHeight === value) { + return; + } + if (value <= 0) { + value = 0.1; + } + if (value > 1) { + value = 1; + } + this._barImageHeight = value; + const hb = this._horizontalBar; + const vb = this._verticalBar; + hb.barImageHeight = value; + vb.barImageHeight = value; + this._markAsDirty(); + } + get horizontalBarImageHeight() { + return this._horizontalBarImageHeight; + } + set horizontalBarImageHeight(value) { + if (this._horizontalBarImageHeight === value) { + return; + } + if (value <= 0) { + value = 0.1; + } + if (value > 1) { + value = 1; + } + this._horizontalBarImageHeight = value; + const hb = this._horizontalBar; + hb.barImageHeight = value; + this._markAsDirty(); + } + get verticalBarImageHeight() { + return this._verticalBarImageHeight; + } + set verticalBarImageHeight(value) { + if (this._verticalBarImageHeight === value) { + return; + } + if (value <= 0) { + value = 0.1; + } + if (value > 1) { + value = 1; + } + this._verticalBarImageHeight = value; + const vb = this._verticalBar; + vb.barImageHeight = value; + this._markAsDirty(); + } + get barBackground() { + return this._barBackground; + } + set barBackground(color) { + if (this._barBackground === color) { + return; + } + this._barBackground = color; + const hb = this._horizontalBar; + const vb = this._verticalBar; + hb.background = color; + vb.background = color; + this._dragSpace.background = color; + } + get barImage() { + return this._barBackgroundImage; + } + set barImage(value) { + this._barBackgroundImage = value; + const hb = this._horizontalBar; + const vb = this._verticalBar; + hb.backgroundImage = value; + vb.backgroundImage = value; + } + get horizontalBarImage() { + return this._horizontalBarBackgroundImage; + } + set horizontalBarImage(value) { + this._horizontalBarBackgroundImage = value; + const hb = this._horizontalBar; + hb.backgroundImage = value; + } + get verticalBarImage() { + return this._verticalBarBackgroundImage; + } + set verticalBarImage(value) { + this._verticalBarBackgroundImage = value; + const vb = this._verticalBar; + vb.backgroundImage = value; + } + _setWindowPosition(force = true) { + const ratio = this.host.idealRatio; + const windowContentsWidth = this._window._currentMeasure.width; + const windowContentsHeight = this._window._currentMeasure.height; + if (!force && this._oldWindowContentsWidth === windowContentsWidth && this._oldWindowContentsHeight === windowContentsHeight) { + return; + } + this._oldWindowContentsWidth = windowContentsWidth; + this._oldWindowContentsHeight = windowContentsHeight; + const _endLeft = this._clientWidth - windowContentsWidth; + const _endTop = this._clientHeight - windowContentsHeight; + const newLeft = this._horizontalBar.value / ratio * _endLeft + "px"; + const newTop = this._verticalBar.value / ratio * _endTop + "px"; + if (newLeft !== this._window.left) { + this._window.left = newLeft; + if (!this.freezeControls) { + this._rebuildLayout = true; + } + } + if (newTop !== this._window.top) { + this._window.top = newTop; + if (!this.freezeControls) { + this._rebuildLayout = true; + } + } + } + _updateScroller() { + const windowContentsWidth = this._window._currentMeasure.width; + const windowContentsHeight = this._window._currentMeasure.height; + if (this._horizontalBar.isVisible && windowContentsWidth <= this._clientWidth && !this.forceHorizontalBar) { + this._grid.setRowDefinition(1, 0, true); + this._horizontalBar.isVisible = false; + this._horizontalBar.value = 0; + this._rebuildLayout = true; + } else if (!this._horizontalBar.isVisible && (windowContentsWidth > this._clientWidth || this.forceHorizontalBar)) { + this._grid.setRowDefinition(1, this._barSize, true); + this._horizontalBar.isVisible = true; + this._rebuildLayout = true; + } + if (this._verticalBar.isVisible && windowContentsHeight <= this._clientHeight && !this.forceVerticalBar) { + this._grid.setColumnDefinition(1, 0, true); + this._verticalBar.isVisible = false; + this._verticalBar.value = 0; + this._rebuildLayout = true; + } else if (!this._verticalBar.isVisible && (windowContentsHeight > this._clientHeight || this.forceVerticalBar)) { + this._grid.setColumnDefinition(1, this._barSize, true); + this._verticalBar.isVisible = true; + this._rebuildLayout = true; + } + this._buildClientSizes(); + const ratio = this.host.idealRatio; + this._horizontalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientWidth / ratio) + "px"; + this._verticalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientHeight / ratio) + "px"; + } + _link(host) { + super._link(host); + this._attachWheel(); + } + _addBar(barControl, barContainer, isVertical, rotation) { + barControl.paddingLeft = 0; + barControl.width = "100%"; + barControl.height = "100%"; + barControl.barOffset = 0; + barControl.value = 0; + barControl.maximum = 1; + barControl.horizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_CENTER; + barControl.verticalAlignment = Control2.VERTICAL_ALIGNMENT_CENTER; + barControl.isVertical = isVertical; + barControl.rotation = rotation; + barControl.isVisible = false; + barContainer.addControl(barControl); + barControl.onValueChangedObservable.add(() => { + this._setWindowPosition(); + }); + } + _attachWheel() { + if (!this._host || this._onWheelObserver) { + return; + } + this._onWheelObserver = this.onWheelObservable.add((pi) => { + if (!this._pointerIsOver || this.isReadOnly) { + return; + } + if (this._verticalBar.isVisible == true) { + if (pi.y < 0 && this._verticalBar.value > 0) { + this._verticalBar.value -= this._wheelPrecision; + } else if (pi.y > 0 && this._verticalBar.value < this._verticalBar.maximum) { + this._verticalBar.value += this._wheelPrecision; + } + } + if (this._horizontalBar.isVisible == true) { + if (pi.x < 0 && this._horizontalBar.value < this._horizontalBar.maximum) { + this._horizontalBar.value += this._wheelPrecision; + } else if (pi.x > 0 && this._horizontalBar.value > 0) { + this._horizontalBar.value -= this._wheelPrecision; + } + } + }); + } + _renderHighlightSpecific(context) { + if (!this.isHighlighted) { + return; + } + super._renderHighlightSpecific(context); + this._grid._renderHighlightSpecific(context); + context.restore(); + } + dispose() { + this.onWheelObservable.remove(this._onWheelObserver); + this._onWheelObserver = null; + super.dispose(); + } +} +var init_scrollViewer = __esm(() => { + init_tslib_es62(); + init_rectangle(); + init_grid2(); + init_control(); + init_scrollViewerWindow(); + init_scrollBar(); + init_imageScrollBar(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], ScrollViewer2.prototype, "wheelPrecision", null); + __decorate2([ + serialize() + ], ScrollViewer2.prototype, "scrollBackground", null); + __decorate2([ + serialize() + ], ScrollViewer2.prototype, "barColor", null); + __decorate2([ + serialize() + ], ScrollViewer2.prototype, "barSize", null); + __decorate2([ + serialize() + ], ScrollViewer2.prototype, "barBackground", null); + RegisterClass("BABYLON.GUI.ScrollViewer", ScrollViewer2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/toggleButton.js +class ToggleButton2 extends Rectangle2 { + get group() { + return this._group; + } + set group(value) { + if (this._group === value) { + return; + } + this._group = value; + } + get isActive() { + return this._isActive; + } + set isActive(value) { + var _a, _b; + if (this._isActive === value) { + return; + } + this._isActive = value; + if (this._isActive) { + (_a = this.toActiveAnimation) === null || _a === undefined || _a.call(this); + } else { + (_b = this.toInactiveAnimation) === null || _b === undefined || _b.call(this); + } + this._markAsDirty(); + this.onIsActiveChangedObservable.notifyObservers(value); + if (this._isActive && this._host && this._group) { + this._host.executeOnAllControls((control43) => { + if (control43.typeName === "ToggleButton") { + if (control43 === this) { + return; + } + const childToggle = control43; + if (childToggle.group === this.group) { + childToggle.isActive = false; + } + } + }); + } + } + constructor(name314, group) { + super(name314); + this.name = name314; + this.onIsActiveChangedObservable = new Observable; + this.delegatePickingToChildren = false; + this._isActive = false; + this.group = group !== null && group !== undefined ? group : ""; + this.thickness = 0; + this.isPointerBlocker = true; + let alphaStore = null; + this.toActiveAnimation = () => { + this.thickness = 1; + }; + this.toInactiveAnimation = () => { + this.thickness = 0; + }; + this.pointerEnterActiveAnimation = () => { + alphaStore = this.alpha; + this.alpha -= 0.1; + }; + this.pointerOutActiveAnimation = () => { + if (alphaStore !== null) { + this.alpha = alphaStore; + } + }; + this.pointerDownActiveAnimation = () => { + this.scaleX -= 0.05; + this.scaleY -= 0.05; + }; + this.pointerUpActiveAnimation = () => { + this.scaleX += 0.05; + this.scaleY += 0.05; + }; + this.pointerEnterInactiveAnimation = () => { + alphaStore = this.alpha; + this.alpha -= 0.1; + }; + this.pointerOutInactiveAnimation = () => { + if (alphaStore !== null) { + this.alpha = alphaStore; + } + }; + this.pointerDownInactiveAnimation = () => { + this.scaleX -= 0.05; + this.scaleY -= 0.05; + }; + this.pointerUpInactiveAnimation = () => { + this.scaleX += 0.05; + this.scaleY += 0.05; + }; + } + _getTypeName() { + return "ToggleButton"; + } + _processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) { + if (!this._isEnabled || !this.isHitTestVisible || !this.isVisible || this.notRenderable) { + return false; + } + if (!super.contains(x, y)) { + return false; + } + if (this.delegatePickingToChildren) { + let contains = false; + for (let index = this._children.length - 1;index >= 0; index--) { + const child = this._children[index]; + if (child.isEnabled && child.isHitTestVisible && child.isVisible && !child.notRenderable && child.contains(x, y)) { + contains = true; + break; + } + } + if (!contains) { + return false; + } + } + this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY); + return true; + } + _onPointerEnter(target, pi) { + if (!super._onPointerEnter(target, pi)) { + return false; + } + if (this.isReadOnly) { + return true; + } + if (this._isActive) { + if (this.pointerEnterActiveAnimation) { + this.pointerEnterActiveAnimation(); + } + } else { + if (this.pointerEnterInactiveAnimation) { + this.pointerEnterInactiveAnimation(); + } + } + return true; + } + _onPointerOut(target, pi, force = false) { + if (!this.isReadOnly) { + if (this._isActive) { + if (this.pointerOutActiveAnimation) { + this.pointerOutActiveAnimation(); + } + } else { + if (this.pointerOutInactiveAnimation) { + this.pointerOutInactiveAnimation(); + } + } + } + super._onPointerOut(target, pi, force); + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { + return false; + } + if (this.isReadOnly) { + return true; + } + if (this._isActive) { + if (this.pointerDownActiveAnimation) { + this.pointerDownActiveAnimation(); + } + } else { + if (this.pointerDownInactiveAnimation) { + this.pointerDownInactiveAnimation(); + } + } + return true; + } + _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi) { + if (!this.isReadOnly) { + if (this._isActive) { + if (this.pointerUpActiveAnimation) { + this.pointerUpActiveAnimation(); + } + } else { + if (this.pointerUpInactiveAnimation) { + this.pointerUpInactiveAnimation(); + } + } + } + super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi); + } +} +var init_toggleButton = __esm(() => { + init_observable(); + init_rectangle(); + init_typeStore(); + RegisterClass("BABYLON.GUI.ToggleButton", ToggleButton2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/virtualKeyboard.js +class KeyPropertySet { +} + +class VirtualKeyboard2 extends StackPanel2 { + constructor() { + super(...arguments); + this.onKeyPressObservable = new Observable; + this.defaultButtonWidth = "40px"; + this.defaultButtonHeight = "40px"; + this.defaultButtonPaddingLeft = "2px"; + this.defaultButtonPaddingRight = "2px"; + this.defaultButtonPaddingTop = "2px"; + this.defaultButtonPaddingBottom = "2px"; + this.defaultButtonColor = "#DDD"; + this.defaultButtonBackground = "#070707"; + this.shiftButtonColor = "#7799FF"; + this.selectedShiftThickness = 1; + this.shiftState = 0; + this._currentlyConnectedInputText = null; + this._connectedInputTexts = []; + this._onKeyPressObserver = null; + } + _getTypeName() { + return "VirtualKeyboard"; + } + _createKey(key, propertySet) { + const button8 = Button2.CreateSimpleButton(key, key); + button8.width = propertySet && propertySet.width ? propertySet.width : this.defaultButtonWidth; + button8.height = propertySet && propertySet.height ? propertySet.height : this.defaultButtonHeight; + button8.color = propertySet && propertySet.color ? propertySet.color : this.defaultButtonColor; + button8.background = propertySet && propertySet.background ? propertySet.background : this.defaultButtonBackground; + button8.paddingLeft = propertySet && propertySet.paddingLeft ? propertySet.paddingLeft : this.defaultButtonPaddingLeft; + button8.paddingRight = propertySet && propertySet.paddingRight ? propertySet.paddingRight : this.defaultButtonPaddingRight; + button8.paddingTop = propertySet && propertySet.paddingTop ? propertySet.paddingTop : this.defaultButtonPaddingTop; + button8.paddingBottom = propertySet && propertySet.paddingBottom ? propertySet.paddingBottom : this.defaultButtonPaddingBottom; + button8.thickness = 0; + button8.isFocusInvisible = true; + button8.shadowColor = this.shadowColor; + button8.shadowBlur = this.shadowBlur; + button8.shadowOffsetX = this.shadowOffsetX; + button8.shadowOffsetY = this.shadowOffsetY; + button8.onPointerUpObservable.add(() => { + this.onKeyPressObservable.notifyObservers(key); + }); + return button8; + } + addKeysRow(keys4, propertySets) { + const panel = new StackPanel2; + panel.isVertical = false; + panel.isFocusInvisible = true; + let maxKey = null; + for (let i = 0;i < keys4.length; i++) { + let properties = null; + if (propertySets && propertySets.length === keys4.length) { + properties = propertySets[i]; + } + const key = this._createKey(keys4[i], properties); + if (!maxKey || key.heightInPixels > maxKey.heightInPixels) { + maxKey = key; + } + panel.addControl(key); + } + panel.height = maxKey ? maxKey.height : this.defaultButtonHeight; + this.addControl(panel); + } + applyShiftState(shiftState) { + if (!this.children) { + return; + } + for (let i = 0;i < this.children.length; i++) { + const row = this.children[i]; + if (!row || !row.children) { + continue; + } + const rowContainer = row; + for (let j = 0;j < rowContainer.children.length; j++) { + const button8 = rowContainer.children[j]; + if (!button8 || !button8.children[0]) { + continue; + } + const button_tblock = button8.children[0]; + if (button_tblock.text === "\u21E7") { + button8.color = shiftState ? this.shiftButtonColor : this.defaultButtonColor; + button8.thickness = shiftState > 1 ? this.selectedShiftThickness : 0; + } + button_tblock.text = shiftState > 0 ? button_tblock.text.toUpperCase() : button_tblock.text.toLowerCase(); + } + } + } + get connectedInputText() { + return this._currentlyConnectedInputText; + } + connect(input) { + const inputTextAlreadyConnected = this._connectedInputTexts.some((a) => a.input === input); + if (inputTextAlreadyConnected) { + return; + } + if (this._onKeyPressObserver === null) { + this._onKeyPressObserver = this.onKeyPressObservable.add((key) => { + if (!this._currentlyConnectedInputText) { + return; + } + this._currentlyConnectedInputText._host.focusedControl = this._currentlyConnectedInputText; + switch (key) { + case "\u21E7": + this.shiftState++; + if (this.shiftState > 2) { + this.shiftState = 0; + } + this.applyShiftState(this.shiftState); + return; + case "\u2190": + if (this._currentlyConnectedInputText instanceof InputTextArea2) { + this._currentlyConnectedInputText.alternativeProcessKey("Backspace"); + } else { + this._currentlyConnectedInputText.processKey(8); + } + return; + case "\u21B5": + if (this._currentlyConnectedInputText instanceof InputTextArea2) { + this._currentlyConnectedInputText.alternativeProcessKey("Enter"); + } else { + this._currentlyConnectedInputText.processKey(13); + } + return; + } + if (this._currentlyConnectedInputText instanceof InputTextArea2) { + this._currentlyConnectedInputText.alternativeProcessKey("", this.shiftState ? key.toUpperCase() : key); + } else { + this._currentlyConnectedInputText.processKey(-1, this.shiftState ? key.toUpperCase() : key); + } + if (this.shiftState === 1) { + this.shiftState = 0; + this.applyShiftState(this.shiftState); + } + }); + } + this.isVisible = false; + this._currentlyConnectedInputText = input; + input._connectedVirtualKeyboard = this; + const onFocusObserver = input.onFocusObservable.add(() => { + this._currentlyConnectedInputText = input; + input._connectedVirtualKeyboard = this; + this.isVisible = true; + }); + const onBlurObserver = input.onBlurObservable.add(() => { + input._connectedVirtualKeyboard = null; + this._currentlyConnectedInputText = null; + this.isVisible = false; + }); + this._connectedInputTexts.push({ + input, + onBlurObserver, + onFocusObserver + }); + } + disconnect(input) { + if (input) { + const filtered = this._connectedInputTexts.filter((a) => a.input === input); + if (filtered.length === 1) { + this._removeConnectedInputObservables(filtered[0]); + this._connectedInputTexts = this._connectedInputTexts.filter((a) => a.input !== input); + if (this._currentlyConnectedInputText === input) { + this._currentlyConnectedInputText = null; + } + } + } else { + this._connectedInputTexts.forEach((connectedInputText) => { + this._removeConnectedInputObservables(connectedInputText); + }); + this._connectedInputTexts.length = 0; + } + if (this._connectedInputTexts.length === 0) { + this._currentlyConnectedInputText = null; + this.onKeyPressObservable.remove(this._onKeyPressObserver); + this._onKeyPressObserver = null; + } + } + _removeConnectedInputObservables(connectedInputText) { + connectedInputText.input._connectedVirtualKeyboard = null; + connectedInputText.input.onFocusObservable.remove(connectedInputText.onFocusObserver); + connectedInputText.input.onBlurObservable.remove(connectedInputText.onBlurObserver); + } + dispose() { + super.dispose(); + this.disconnect(); + } + static CreateDefaultLayout(name314) { + const returnValue = new VirtualKeyboard2(name314); + returnValue.addKeysRow(["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "\u2190"]); + returnValue.addKeysRow(["q", "w", "e", "r", "t", "y", "u", "i", "o", "p"]); + returnValue.addKeysRow(["a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "\u21B5"]); + returnValue.addKeysRow(["\u21E7", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/"]); + returnValue.addKeysRow([" "], [{ width: "200px" }]); + return returnValue; + } + _parseFromContent(serializedObject, host) { + super._parseFromContent(serializedObject, host); + for (const row of this.children) { + if (row.getClassName() === "StackPanel") { + const stackPanel14 = row; + for (const key of stackPanel14.children) { + if (key.getClassName() === "Button" && key.name) { + key.onPointerUpObservable.add(() => { + this.onKeyPressObservable.notifyObservers(key.name); + }); + } + } + } + } + } +} +var init_virtualKeyboard = __esm(() => { + init_observable(); + init_stackPanel(); + init_button(); + init_typeStore(); + init_inputTextArea(); + RegisterClass("BABYLON.GUI.VirtualKeyboard", VirtualKeyboard2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/displayGrid.js +class DisplayGrid2 extends Control2 { + get displayMinorLines() { + return this._displayMinorLines; + } + set displayMinorLines(value) { + if (this._displayMinorLines === value) { + return; + } + this._displayMinorLines = value; + this._markAsDirty(); + } + get displayMajorLines() { + return this._displayMajorLines; + } + set displayMajorLines(value) { + if (this._displayMajorLines === value) { + return; + } + this._displayMajorLines = value; + this._markAsDirty(); + } + get background() { + return this._background; + } + set background(value) { + if (this._background === value) { + return; + } + this._background = value; + this._markAsDirty(); + } + get cellWidth() { + return this._cellWidth; + } + set cellWidth(value) { + this._cellWidth = value; + this._markAsDirty(); + } + get cellHeight() { + return this._cellHeight; + } + set cellHeight(value) { + this._cellHeight = value; + this._markAsDirty(); + } + get minorLineTickness() { + return this._minorLineTickness; + } + set minorLineTickness(value) { + this._minorLineTickness = value; + this._markAsDirty(); + } + get minorLineColor() { + return this._minorLineColor; + } + set minorLineColor(value) { + this._minorLineColor = value; + this._markAsDirty(); + } + get majorLineTickness() { + return this._majorLineTickness; + } + set majorLineTickness(value) { + this._majorLineTickness = value; + this._markAsDirty(); + } + get majorLineColor() { + return this._majorLineColor; + } + set majorLineColor(value) { + this._majorLineColor = value; + this._markAsDirty(); + } + get majorLineFrequency() { + return this._majorLineFrequency; + } + set majorLineFrequency(value) { + this._majorLineFrequency = value; + this._markAsDirty(); + } + constructor(name314) { + super(name314); + this.name = name314; + this._cellWidth = 20; + this._cellHeight = 20; + this._minorLineTickness = 1; + this._minorLineColor = "DarkGray"; + this._majorLineTickness = 2; + this._majorLineColor = "White"; + this._majorLineFrequency = 5; + this._background = "Black"; + this._displayMajorLines = true; + this._displayMinorLines = true; + } + _draw(context) { + context.save(); + this._applyStates(context); + if (this._isEnabled) { + if (this._background) { + context.fillStyle = this._background; + context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + const cellCountX = this._currentMeasure.width / this._cellWidth; + const cellCountY = this._currentMeasure.height / this._cellHeight; + const left = this._currentMeasure.left + this._currentMeasure.width / 2; + const top = this._currentMeasure.top + this._currentMeasure.height / 2; + if (this._displayMinorLines) { + context.strokeStyle = this._minorLineColor; + context.lineWidth = this._minorLineTickness; + for (let x = -cellCountX / 2 + 1;x < cellCountX / 2; x++) { + const cellX = left + x * this.cellWidth; + context.beginPath(); + context.moveTo(cellX, this._currentMeasure.top); + context.lineTo(cellX, this._currentMeasure.top + this._currentMeasure.height); + context.stroke(); + } + for (let y = -cellCountY / 2 + 1;y < cellCountY / 2; y++) { + const cellY = top + y * this.cellHeight; + context.beginPath(); + context.moveTo(this._currentMeasure.left, cellY); + context.lineTo(this._currentMeasure.left + this._currentMeasure.width, cellY); + context.stroke(); + } + } + if (this._displayMajorLines) { + context.strokeStyle = this._majorLineColor; + context.lineWidth = this._majorLineTickness; + for (let x = -cellCountX / 2 + this._majorLineFrequency;x < cellCountX / 2; x += this._majorLineFrequency) { + const cellX = left + x * this.cellWidth; + context.beginPath(); + context.moveTo(cellX, this._currentMeasure.top); + context.lineTo(cellX, this._currentMeasure.top + this._currentMeasure.height); + context.stroke(); + } + for (let y = -cellCountY / 2 + this._majorLineFrequency;y < cellCountY / 2; y += this._majorLineFrequency) { + const cellY = top + y * this.cellHeight; + context.moveTo(this._currentMeasure.left, cellY); + context.lineTo(this._currentMeasure.left + this._currentMeasure.width, cellY); + context.closePath(); + context.stroke(); + } + } + } + context.restore(); + } + _getTypeName() { + return "DisplayGrid"; + } +} +var init_displayGrid = __esm(() => { + init_tslib_es62(); + init_control(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], DisplayGrid2.prototype, "displayMinorLines", null); + __decorate2([ + serialize() + ], DisplayGrid2.prototype, "displayMajorLines", null); + __decorate2([ + serialize() + ], DisplayGrid2.prototype, "background", null); + __decorate2([ + serialize() + ], DisplayGrid2.prototype, "cellWidth", null); + __decorate2([ + serialize() + ], DisplayGrid2.prototype, "cellHeight", null); + __decorate2([ + serialize() + ], DisplayGrid2.prototype, "minorLineTickness", null); + __decorate2([ + serialize() + ], DisplayGrid2.prototype, "minorLineColor", null); + __decorate2([ + serialize() + ], DisplayGrid2.prototype, "majorLineTickness", null); + __decorate2([ + serialize() + ], DisplayGrid2.prototype, "majorLineColor", null); + __decorate2([ + serialize() + ], DisplayGrid2.prototype, "majorLineFrequency", null); + RegisterClass("BABYLON.GUI.DisplayGrid", DisplayGrid2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/sliders/imageBasedSlider.js +class ImageBasedSlider2 extends BaseSlider2 { + get displayThumb() { + return this._displayThumb && this.thumbImage != null; + } + set displayThumb(value) { + if (this._displayThumb === value) { + return; + } + this._displayThumb = value; + this._markAsDirty(); + } + get backgroundImage() { + return this._backgroundImage; + } + set backgroundImage(value) { + if (this._backgroundImage === value) { + return; + } + this._backgroundImage = value; + if (value && !value.isLoaded) { + value.onImageLoadedObservable.addOnce(() => this._markAsDirty()); + } + this._markAsDirty(); + } + get valueBarImage() { + return this._valueBarImage; + } + set valueBarImage(value) { + if (this._valueBarImage === value) { + return; + } + this._valueBarImage = value; + if (value && !value.isLoaded) { + value.onImageLoadedObservable.addOnce(() => this._markAsDirty()); + } + this._markAsDirty(); + } + get thumbImage() { + return this._thumbImage; + } + set thumbImage(value) { + if (this._thumbImage === value) { + return; + } + this._thumbImage = value; + if (value && !value.isLoaded) { + value.onImageLoadedObservable.addOnce(() => this._markAsDirty()); + } + this._markAsDirty(); + } + constructor(name314) { + super(name314); + this.name = name314; + this._tempMeasure = new Measure2(0, 0, 0, 0); + } + _getTypeName() { + return "ImageBasedSlider"; + } + _draw(context) { + context.save(); + this._applyStates(context); + this._prepareRenderingData("rectangle"); + const thumbPosition = this._getThumbPosition(); + const left = this._renderLeft; + const top = this._renderTop; + const width = this._renderWidth; + const height = this._renderHeight; + if (this._backgroundImage) { + this._tempMeasure.copyFromFloats(left, top, width, height); + if (this.isThumbClamped && this.displayThumb) { + if (this.isVertical) { + this._tempMeasure.height += this._effectiveThumbThickness; + } else { + this._tempMeasure.width += this._effectiveThumbThickness; + } + } + this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure); + this._backgroundImage._draw(context); + } + if (this._valueBarImage) { + if (this.isVertical) { + if (this.isThumbClamped && this.displayThumb) { + this._tempMeasure.copyFromFloats(left, top + thumbPosition, width, height - thumbPosition + this._effectiveThumbThickness); + } else { + this._tempMeasure.copyFromFloats(left, top + thumbPosition, width, height - thumbPosition); + } + } else { + if (this.isThumbClamped && this.displayThumb) { + this._tempMeasure.copyFromFloats(left, top, thumbPosition + this._effectiveThumbThickness / 2, height); + } else { + this._tempMeasure.copyFromFloats(left, top, thumbPosition, height); + } + } + this._valueBarImage._currentMeasure.copyFrom(this._tempMeasure); + this._valueBarImage._draw(context); + } + if (this.displayThumb) { + if (this.isVertical) { + this._tempMeasure.copyFromFloats(left - this._effectiveBarOffset, this._currentMeasure.top + thumbPosition, this._currentMeasure.width, this._effectiveThumbThickness); + } else { + this._tempMeasure.copyFromFloats(this._currentMeasure.left + thumbPosition, this._currentMeasure.top, this._effectiveThumbThickness, this._currentMeasure.height); + } + this._thumbImage._currentMeasure.copyFrom(this._tempMeasure); + this._thumbImage._draw(context); + } + context.restore(); + } + serialize(serializationObject) { + super.serialize(serializationObject); + const backgroundImage = {}; + const thumbImage = {}; + const valueBarImage = {}; + this.backgroundImage.serialize(backgroundImage); + this.thumbImage.serialize(thumbImage); + this.valueBarImage.serialize(valueBarImage); + serializationObject.backgroundImage = backgroundImage; + serializationObject.thumbImage = thumbImage; + serializationObject.valueBarImage = valueBarImage; + } + _parseFromContent(serializedObject, host) { + super._parseFromContent(serializedObject, host); + this.backgroundImage = Image3.Parse(serializedObject.backgroundImage, host); + this.thumbImage = Image3.Parse(serializedObject.thumbImage, host); + this.valueBarImage = Image3.Parse(serializedObject.valueBarImage, host); + } +} +var init_imageBasedSlider = __esm(() => { + init_tslib_es62(); + init_baseSlider(); + init_measure(); + init_image(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], ImageBasedSlider2.prototype, "displayThumb", null); + RegisterClass("BABYLON.GUI.ImageBasedSlider", ImageBasedSlider2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/statics.js +var name314; +var init_statics = __esm(() => { + init_control(); + init_stackPanel(); + init_textBlock(); + name314 = "Statics"; + Control2.AddHeader = function(control45, text, size, options) { + const panel = new StackPanel2("panel"); + const isHorizontal = options ? options.isHorizontal : true; + const controlFirst = options ? options.controlFirst : true; + panel.isVertical = !isHorizontal; + const header = new TextBlock2("header"); + header.text = text; + header.textHorizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + if (isHorizontal) { + header.width = size; + } else { + header.height = size; + } + if (controlFirst) { + panel.addControl(control45); + panel.addControl(header); + header.paddingLeft = "5px"; + } else { + panel.addControl(header); + panel.addControl(control45); + header.paddingRight = "5px"; + } + header.shadowBlur = control45.shadowBlur; + header.shadowColor = control45.shadowColor; + header.shadowOffsetX = control45.shadowOffsetX; + header.shadowOffsetY = control45.shadowOffsetY; + return panel; + }; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/gradient/BaseGradient.js +class BaseGradient5 { + constructor() { + this._colorStops = []; + this._gradientDirty = true; + } + _addColorStopsToCanvasGradient() { + for (const stop of this._colorStops) { + this._canvasGradient.addColorStop(stop.offset, stop.color); + } + } + getCanvasGradient(context) { + if (this._gradientDirty || this._context !== context) { + this._context = context; + this._canvasGradient = this._createCanvasGradient(context); + this._addColorStopsToCanvasGradient(); + this._gradientDirty = false; + } + return this._canvasGradient; + } + addColorStop(offset, color) { + this._colorStops.push({ offset, color }); + this._gradientDirty = true; + } + removeColorStop(offset) { + this._colorStops = this._colorStops.filter((colorStop) => colorStop.offset !== offset); + this._gradientDirty = true; + } + clearColorStops() { + this._colorStops = []; + this._gradientDirty = true; + } + get colorStops() { + return this._colorStops; + } + getClassName() { + return "BaseGradient"; + } + serialize(serializationObject) { + serializationObject.colorStops = this._colorStops; + serializationObject.className = this.getClassName(); + } + parse(serializationObject) { + this._colorStops = serializationObject.colorStops; + } +} +var init_BaseGradient = __esm(() => { +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/gradient/LinearGradient.js +class LinearGradient3 extends BaseGradient5 { + constructor(x0, y0, x1, y1) { + super(); + this._x0 = x0 !== null && x0 !== undefined ? x0 : 0; + this._y0 = y0 !== null && y0 !== undefined ? y0 : 0; + this._x1 = x1 !== null && x1 !== undefined ? x1 : 0; + this._y1 = y1 !== null && y1 !== undefined ? y1 : 0; + } + _createCanvasGradient(context) { + return context.createLinearGradient(this._x0, this._y0, this._x1, this._y1); + } + get x0() { + return this._x0; + } + get x1() { + return this._x1; + } + get y0() { + return this._y0; + } + get y1() { + return this._y1; + } + getClassName() { + return "LinearGradient"; + } + serialize(serializationObject) { + super.serialize(serializationObject); + serializationObject.x0 = this._x0; + serializationObject.y0 = this._y0; + serializationObject.x1 = this._x1; + serializationObject.y1 = this._y1; + } + parse(serializationObject) { + super.parse(serializationObject); + this._x0 = serializationObject.x0; + this._y0 = serializationObject.y0; + this._x1 = serializationObject.x1; + this._y1 = serializationObject.y1; + } +} +var init_LinearGradient = __esm(() => { + init_BaseGradient(); + init_typeStore(); + RegisterClass("BABYLON.GUI.LinearGradient", LinearGradient3); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/gradient/RadialGradient.js +class RadialGradient3 extends BaseGradient5 { + constructor(x0, y0, r0, x1, y1, r1) { + super(); + this._x0 = x0 !== null && x0 !== undefined ? x0 : 0; + this._y0 = y0 !== null && y0 !== undefined ? y0 : 0; + this._r0 = r0 !== null && r0 !== undefined ? r0 : 0; + this._x1 = x1 !== null && x1 !== undefined ? x1 : 0; + this._y1 = y1 !== null && y1 !== undefined ? y1 : 0; + this._r1 = r1 !== null && r1 !== undefined ? r1 : 0; + } + _createCanvasGradient(context) { + return context.createRadialGradient(this._x0, this._y0, this._r0, this._x1, this._y1, this._r1); + } + get x0() { + return this._x0; + } + get x1() { + return this._x1; + } + get y0() { + return this._y0; + } + get y1() { + return this._y1; + } + get r0() { + return this._r0; + } + get r1() { + return this._r1; + } + getClassName() { + return "RadialGradient"; + } + serialize(serializationObject) { + super.serialize(serializationObject); + serializationObject.x0 = this._x0; + serializationObject.y0 = this._y0; + serializationObject.r0 = this._r0; + serializationObject.x1 = this._x1; + serializationObject.y1 = this._y1; + serializationObject.r1 = this._r1; + } + parse(serializationObject) { + super.parse(serializationObject); + this._x0 = serializationObject.x0; + this._y0 = serializationObject.y0; + this._r0 = serializationObject.r0; + this._x1 = serializationObject.x1; + this._y1 = serializationObject.y1; + this._r1 = serializationObject.r1; + } +} +var init_RadialGradient = __esm(() => { + init_BaseGradient(); + init_typeStore(); + RegisterClass("BABYLON.GUI.RadialGradient", RadialGradient3); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/controls/index.js +var init_controls = __esm(() => { + init_button(); + init_checkbox(); + init_colorpicker(); + init_container(); + init_control(); + init_ellipse(); + init_focusableButton(); + init_focusableControl(); + init_grid2(); + init_image(); + init_inputText(); + init_inputTextArea(); + init_inputPassword(); + init_line(); + init_multiLine(); + init_radioButton(); + init_stackPanel(); + init_selector(); + init_scrollViewer(); + init_textBlock(); + init_textWrapper(); + init_toggleButton(); + init_virtualKeyboard(); + init_rectangle(); + init_displayGrid(); + init_baseSlider(); + init_slider(); + init_imageBasedSlider(); + init_scrollBar(); + init_imageScrollBar(); + init_statics(); + init_BaseGradient(); + init_LinearGradient(); + init_RadialGradient(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/style.js +class Style2 { + constructor(host) { + this._fontFamily = "Arial"; + this._fontStyle = ""; + this._fontWeight = ""; + this._fontSize = new ValueAndUnit2(18, ValueAndUnit2.UNITMODE_PIXEL, false); + this.onChangedObservable = new Observable; + this._host = host; + } + get fontSize() { + return this._fontSize.toString(this._host); + } + set fontSize(value) { + if (this._fontSize.toString(this._host) === value) { + return; + } + if (this._fontSize.fromString(value)) { + this.onChangedObservable.notifyObservers(this); + } + } + get fontFamily() { + return this._fontFamily; + } + set fontFamily(value) { + if (this._fontFamily === value) { + return; + } + this._fontFamily = value; + this.onChangedObservable.notifyObservers(this); + } + get fontStyle() { + return this._fontStyle; + } + set fontStyle(value) { + if (this._fontStyle === value) { + return; + } + this._fontStyle = value; + this.onChangedObservable.notifyObservers(this); + } + get fontWeight() { + return this._fontWeight; + } + set fontWeight(value) { + if (this._fontWeight === value) { + return; + } + this._fontWeight = value; + this.onChangedObservable.notifyObservers(this); + } + dispose() { + this.onChangedObservable.clear(); + } +} +var init_style = __esm(() => { + init_observable(); + init_valueAndUnit(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/advancedDynamicTexture.js +class AdvancedDynamicTexture2 extends DynamicTexture { + get numLayoutCalls() { + return this._numLayoutCalls; + } + get numRenderCalls() { + return this._numRenderCalls; + } + get renderScale() { + return this._renderScale; + } + set renderScale(value) { + if (value === this._renderScale) { + return; + } + this._renderScale = value; + this._onResize(); + } + get background() { + return this._background; + } + set background(value) { + if (this._background === value) { + return; + } + this._background = value; + this.markAsDirty(); + } + get idealWidth() { + return this._idealWidth; + } + set idealWidth(value) { + if (this._idealWidth === value) { + return; + } + this._idealWidth = value; + this.markAsDirty(); + this._rootContainer._markAllAsDirty(); + } + get idealHeight() { + return this._idealHeight; + } + set idealHeight(value) { + if (this._idealHeight === value) { + return; + } + this._idealHeight = value; + this.markAsDirty(); + this._rootContainer._markAllAsDirty(); + } + get useSmallestIdeal() { + return this._useSmallestIdeal; + } + set useSmallestIdeal(value) { + if (this._useSmallestIdeal === value) { + return; + } + this._useSmallestIdeal = value; + this.markAsDirty(); + this._rootContainer._markAllAsDirty(); + } + get renderAtIdealSize() { + return this._renderAtIdealSize; + } + set renderAtIdealSize(value) { + if (this._renderAtIdealSize === value) { + return; + } + this._renderAtIdealSize = value; + this._onResize(); + } + get idealRatio() { + let rwidth = 0; + let rheight = 0; + if (this._idealWidth) { + rwidth = this.getSize().width / this._idealWidth; + } + if (this._idealHeight) { + rheight = this.getSize().height / this._idealHeight; + } + if (this._useSmallestIdeal && this._idealWidth && this._idealHeight) { + return window.innerWidth < window.innerHeight ? rwidth : rheight; + } + if (this._idealWidth) { + return rwidth; + } + if (this._idealHeight) { + return rheight; + } + return 1; + } + get layer() { + return this._layerToDispose; + } + get rootContainer() { + return this._rootContainer; + } + getChildren() { + return [this._rootContainer]; + } + getDescendants(directDescendantsOnly, predicate) { + return this._rootContainer.getDescendants(directDescendantsOnly, predicate); + } + getControlsByType(typeName) { + return this._rootContainer.getDescendants(false, (control47) => control47.typeName === typeName); + } + getControlByName(name315) { + return this._getControlByKey("name", name315); + } + _getControlByKey(key, value) { + return this._rootContainer.getDescendants().find((control47) => control47[key] === value) || null; + } + get focusedControl() { + return this._focusedControl; + } + set focusedControl(control47) { + if (this._focusedControl == control47) { + return; + } + if (this._focusedControl) { + this._focusedControl.onBlur(); + } + if (control47) { + control47.onFocus(); + } + this._focusedControl = control47; + } + get isForeground() { + if (!this.layer) { + return true; + } + return !this.layer.isBackground; + } + set isForeground(value) { + if (!this.layer) { + return; + } + if (this.layer.isBackground === !value) { + return; + } + this.layer.isBackground = !value; + } + get clipboardData() { + return this._clipboardData; + } + set clipboardData(value) { + this._clipboardData = value; + } + constructor(name315, width = 0, height = 0, scene50, generateMipMaps = false, samplingMode = Texture.NEAREST_SAMPLINGMODE, invertY = true) { + super(name315, { width, height }, scene50, generateMipMaps, samplingMode, Constants.TEXTUREFORMAT_RGBA, invertY); + this.onGuiReadyObservable = new Observable; + this._isDirty = false; + this._rootContainer = new Container2("root"); + this._lastControlOver = {}; + this._lastControlDown = {}; + this._capturingControl = {}; + this._linkedControls = new Array; + this._isFullscreen = false; + this._fullscreenViewport = new Viewport(0, 0, 1, 1); + this._idealWidth = 0; + this._idealHeight = 0; + this._useSmallestIdeal = false; + this._renderAtIdealSize = false; + this._blockNextFocusCheck = false; + this._renderScale = 1; + this._cursorChanged = false; + this._defaultMousePointerId = 0; + this._rootChildrenHaveChanged = false; + this._capturedPointerIds = new Set; + this._numLayoutCalls = 0; + this._numRenderCalls = 0; + this._clipboardData = ""; + this.onClipboardObservable = new Observable; + this.onControlPickedObservable = new Observable; + this.onBeginLayoutObservable = new Observable; + this.onEndLayoutObservable = new Observable; + this.onBeginRenderObservable = new Observable; + this.onEndRenderObservable = new Observable; + this.premulAlpha = false; + this.applyYInversionOnUpdate = true; + this.skipBlockEvents = 0; + this.checkPointerEveryFrame = false; + this._useInvalidateRectOptimization = true; + this._invalidatedRectangle = null; + this._clearMeasure = new Measure2(0, 0, 0, 0); + this._onClipboardCopy = (rawEvt) => { + const evt = rawEvt; + const ev = new ClipboardInfo(ClipboardEventTypes.COPY, evt); + this.onClipboardObservable.notifyObservers(ev); + evt.preventDefault(); + }; + this._onClipboardCut = (rawEvt) => { + const evt = rawEvt; + const ev = new ClipboardInfo(ClipboardEventTypes.CUT, evt); + this.onClipboardObservable.notifyObservers(ev); + evt.preventDefault(); + }; + this._onClipboardPaste = (rawEvt) => { + const evt = rawEvt; + const ev = new ClipboardInfo(ClipboardEventTypes.PASTE, evt); + this.onClipboardObservable.notifyObservers(ev); + evt.preventDefault(); + }; + this.parseContent = this.parseSerializedObject; + scene50 = this.getScene(); + if (!scene50 || !this._texture) { + return; + } + this.applyYInversionOnUpdate = invertY; + this._rootElement = scene50.getEngine().getInputElement(); + this._renderObserver = scene50.onBeforeCameraRenderObservable.add((camera34) => this._checkUpdate(camera34)); + this._controlAddedObserver = this._rootContainer.onControlAddedObservable.add((control47) => { + if (control47) { + this._rootChildrenHaveChanged = true; + } + }); + this._controlRemovedObserver = this._rootContainer.onControlRemovedObservable.add((control47) => { + if (control47) { + this._rootChildrenHaveChanged = true; + } + }); + this._preKeyboardObserver = scene50.onPreKeyboardObservable.add((info) => { + if (!this._focusedControl) { + return; + } + if (info.type === KeyboardEventTypes.KEYDOWN) { + this._focusedControl.processKeyboard(info.event); + } + info.skipOnPointerObservable = true; + }); + this._rootContainer._link(this); + this.hasAlpha = true; + if (!width || !height) { + this._resizeObserver = scene50.getEngine().onResizeObservable.add(() => this._onResize()); + this._onResize(); + } + this._texture.isReady = true; + } + getClassName() { + return "AdvancedDynamicTexture"; + } + executeOnAllControls(func, container17) { + if (!container17) { + container17 = this._rootContainer; + } + func(container17); + for (const child of container17.children) { + if (child.children) { + this.executeOnAllControls(func, child); + continue; + } + func(child); + } + } + get useInvalidateRectOptimization() { + return this._useInvalidateRectOptimization; + } + set useInvalidateRectOptimization(value) { + this._useInvalidateRectOptimization = value; + } + invalidateRect(invalidMinX, invalidMinY, invalidMaxX, invalidMaxY) { + if (!this._useInvalidateRectOptimization) { + return; + } + if (!this._invalidatedRectangle) { + this._invalidatedRectangle = new Measure2(invalidMinX, invalidMinY, invalidMaxX - invalidMinX + 1, invalidMaxY - invalidMinY + 1); + } else { + const maxX = Math.ceil(Math.max(this._invalidatedRectangle.left + this._invalidatedRectangle.width - 1, invalidMaxX)); + const maxY = Math.ceil(Math.max(this._invalidatedRectangle.top + this._invalidatedRectangle.height - 1, invalidMaxY)); + this._invalidatedRectangle.left = Math.floor(Math.min(this._invalidatedRectangle.left, invalidMinX)); + this._invalidatedRectangle.top = Math.floor(Math.min(this._invalidatedRectangle.top, invalidMinY)); + this._invalidatedRectangle.width = maxX - this._invalidatedRectangle.left + 1; + this._invalidatedRectangle.height = maxY - this._invalidatedRectangle.top + 1; + } + } + markAsDirty() { + this._isDirty = true; + } + createStyle() { + return new Style2(this); + } + addControl(control47) { + this._rootContainer.addControl(control47); + return this; + } + removeControl(control47) { + this._rootContainer.removeControl(control47); + return this; + } + moveToNonOverlappedPosition(overlapGroup, deltaStep = 1, repelFactor = 1) { + let controlsForGroup; + if (Array.isArray(overlapGroup)) { + controlsForGroup = overlapGroup; + } else { + const descendants = this.getDescendants(true); + controlsForGroup = overlapGroup === undefined ? descendants.filter((c) => c.overlapGroup !== undefined) : descendants.filter((c) => c.overlapGroup === overlapGroup); + } + controlsForGroup.forEach((control1) => { + var _a; + let velocity = Vector2.Zero(); + const center = new Vector2(control1.centerX, control1.centerY); + controlsForGroup.forEach((control210) => { + if (control1 !== control210 && AdvancedDynamicTexture2._Overlaps(control1, control210)) { + const diff = center.subtract(new Vector2(control210.centerX, control210.centerY)); + const diffLength = diff.length(); + if (diffLength > 0) { + velocity = velocity.add(diff.normalize().scale(repelFactor / diffLength)); + } + } + }); + if (velocity.length() > 0) { + velocity = velocity.normalize().scale(deltaStep * ((_a = control1.overlapDeltaMultiplier) !== null && _a !== undefined ? _a : 1)); + control1.linkOffsetXInPixels += velocity.x; + control1.linkOffsetYInPixels += velocity.y; + } + }); + } + dispose() { + const scene50 = this.getScene(); + if (!scene50) { + return; + } + this._rootElement = null; + scene50.onBeforeCameraRenderObservable.remove(this._renderObserver); + if (this._resizeObserver) { + scene50.getEngine().onResizeObservable.remove(this._resizeObserver); + } + if (this._prePointerObserver) { + scene50.onPrePointerObservable.remove(this._prePointerObserver); + } + if (this._sceneRenderObserver) { + scene50.onBeforeRenderObservable.remove(this._sceneRenderObserver); + } + if (this._pointerObserver) { + scene50.onPointerObservable.remove(this._pointerObserver); + } + if (this._preKeyboardObserver) { + scene50.onPreKeyboardObservable.remove(this._preKeyboardObserver); + } + if (this._canvasPointerOutObserver) { + scene50.getEngine().onCanvasPointerOutObservable.remove(this._canvasPointerOutObserver); + } + if (this._canvasBlurObserver) { + scene50.getEngine().onCanvasBlurObservable.remove(this._canvasBlurObserver); + } + if (this._controlAddedObserver) { + this._rootContainer.onControlAddedObservable.remove(this._controlAddedObserver); + } + if (this._controlRemovedObserver) { + this._rootContainer.onControlRemovedObservable.remove(this._controlRemovedObserver); + } + if (this._layerToDispose) { + this._layerToDispose.texture = null; + this._layerToDispose.dispose(); + this._layerToDispose = null; + } + this._rootContainer.dispose(); + this.onClipboardObservable.clear(); + this.onControlPickedObservable.clear(); + this.onBeginRenderObservable.clear(); + this.onEndRenderObservable.clear(); + this.onBeginLayoutObservable.clear(); + this.onEndLayoutObservable.clear(); + this.onGuiReadyObservable.clear(); + super.dispose(); + } + _onResize() { + const scene50 = this.getScene(); + if (!scene50) { + return; + } + const engine47 = scene50.getEngine(); + const textureSize = this.getSize(); + let renderWidth = engine47.getRenderWidth() * this._renderScale; + let renderHeight = engine47.getRenderHeight() * this._renderScale; + if (this._renderAtIdealSize) { + if (this._idealWidth) { + renderHeight = renderHeight * this._idealWidth / renderWidth; + renderWidth = this._idealWidth; + } else if (this._idealHeight) { + renderWidth = renderWidth * this._idealHeight / renderHeight; + renderHeight = this._idealHeight; + } + } + if (textureSize.width !== renderWidth || textureSize.height !== renderHeight) { + this.scaleTo(renderWidth, renderHeight); + this.markAsDirty(); + if (this._idealWidth || this._idealHeight) { + this._rootContainer._markAllAsDirty(); + } + } + this.invalidateRect(0, 0, textureSize.width - 1, textureSize.height - 1); + } + _getGlobalViewport() { + const size = this.getSize(); + const globalViewPort = this._fullscreenViewport.toGlobal(size.width, size.height); + const targetX = Math.round(globalViewPort.width * (1 / this.rootContainer.scaleX)); + const targetY = Math.round(globalViewPort.height * (1 / this.rootContainer.scaleY)); + globalViewPort.x += (globalViewPort.width - targetX) / 2; + globalViewPort.y += (globalViewPort.height - targetY) / 2; + globalViewPort.width = targetX; + globalViewPort.height = targetY; + return globalViewPort; + } + getProjectedPosition(position3, worldMatrix) { + const result = this.getProjectedPositionWithZ(position3, worldMatrix); + return new Vector2(result.x, result.y); + } + getProjectedPositionWithZ(position3, worldMatrix) { + const scene50 = this.getScene(); + if (!scene50) { + return Vector3.Zero(); + } + const globalViewport = this._getGlobalViewport(); + const projectedPosition = Vector3.Project(position3, worldMatrix, scene50.getTransformMatrix(), globalViewport); + return new Vector3(projectedPosition.x, projectedPosition.y, projectedPosition.z); + } + _checkUpdate(camera34, skipUpdate) { + if (this._layerToDispose) { + if ((camera34.layerMask & this._layerToDispose.layerMask) === 0) { + return; + } + } + if (this._isFullscreen && this._linkedControls.length) { + const scene50 = this.getScene(); + if (!scene50) { + return; + } + const globalViewport = this._getGlobalViewport(); + for (const control47 of this._linkedControls) { + if (!control47.isVisible) { + continue; + } + const mesh80 = control47._linkedMesh; + if (!mesh80 || mesh80.isDisposed()) { + Tools.SetImmediate(() => { + control47.linkWithMesh(null); + }); + continue; + } + const position3 = mesh80.getBoundingInfo ? mesh80.getBoundingInfo().boundingSphere.center : Vector3.ZeroReadOnly; + const projectedPosition = Vector3.Project(position3, mesh80.getWorldMatrix(), scene50.getTransformMatrix(), globalViewport); + if (projectedPosition.z < 0 || projectedPosition.z > 1) { + control47.notRenderable = true; + continue; + } + control47.notRenderable = false; + if (this.useInvalidateRectOptimization) { + control47.invalidateRect(); + } + control47._moveToProjectedPosition(projectedPosition); + } + } + if (!this._isDirty && !this._rootContainer.isDirty) { + return; + } + this._isDirty = false; + this._render(skipUpdate); + if (!skipUpdate) { + this.update(this.applyYInversionOnUpdate, this.premulAlpha, AdvancedDynamicTexture2.AllowGPUOptimizations); + } + } + _render(skipRender) { + var _a; + const textureSize = this.getSize(); + const renderWidth = textureSize.width; + const renderHeight = textureSize.height; + const context = this.getContext(); + context.font = "18px Arial"; + context.strokeStyle = "white"; + if (this.onGuiReadyObservable.hasObservers()) { + this._checkGuiIsReady(); + } + if (this._rootChildrenHaveChanged) { + const camera34 = (_a = this.getScene()) === null || _a === undefined ? undefined : _a.activeCamera; + if (camera34) { + this._rootChildrenHaveChanged = false; + this._checkUpdate(camera34, true); + } + } + this.onBeginLayoutObservable.notifyObservers(this); + const measure16 = new Measure2(0, 0, renderWidth, renderHeight); + this._numLayoutCalls = 0; + this._rootContainer._layout(measure16, context); + this.onEndLayoutObservable.notifyObservers(this); + this._isDirty = false; + if (skipRender) { + return; + } + if (this._invalidatedRectangle) { + this._clearMeasure.copyFrom(this._invalidatedRectangle); + } else { + this._clearMeasure.copyFromFloats(0, 0, renderWidth, renderHeight); + } + context.clearRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height); + if (this._background) { + context.save(); + context.fillStyle = this._background; + context.fillRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height); + context.restore(); + } + this.onBeginRenderObservable.notifyObservers(this); + this._numRenderCalls = 0; + this._rootContainer._render(context, this._invalidatedRectangle); + this.onEndRenderObservable.notifyObservers(this); + this._invalidatedRectangle = null; + } + _changeCursor(cursor) { + if (this._rootElement) { + this._rootElement.style.cursor = cursor; + this._cursorChanged = true; + } + } + _registerLastControlDown(control47, pointerId) { + this._lastControlDown[pointerId] = control47; + this.onControlPickedObservable.notifyObservers(control47); + } + _doPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) { + const scene50 = this.getScene(); + if (!scene50) { + return; + } + const engine47 = scene50.getEngine(); + const textureSize = this.getSize(); + if (this._isFullscreen) { + const camera34 = scene50.cameraToUseForPointers || scene50.activeCamera; + if (!camera34) { + return; + } + const viewport = camera34.viewport; + x = x * (textureSize.width / (engine47.getRenderWidth() * viewport.width)); + y = y * (textureSize.height / (engine47.getRenderHeight() * viewport.height)); + } + if (this._capturingControl[pointerId]) { + if (this._capturingControl[pointerId].isPointerBlocker) { + this._shouldBlockPointer = true; + } + this._capturingControl[pointerId]._processObservables(type, x, y, pi, pointerId, buttonIndex); + return; + } + this._cursorChanged = false; + if (!this._rootContainer._processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY)) { + if (!scene50.doNotHandleCursors) { + this._changeCursor(""); + } + if (type === PointerEventTypes.POINTERMOVE) { + if (this._lastControlOver[pointerId]) { + this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], pi); + delete this._lastControlOver[pointerId]; + } + } + } + if (!this._cursorChanged && !scene50.doNotHandleCursors) { + this._changeCursor(""); + } + this._manageFocus(); + } + _cleanControlAfterRemovalFromList(list, control47) { + for (const pointerId in list) { + if (!Object.prototype.hasOwnProperty.call(list, pointerId)) { + continue; + } + const lastControlOver = list[pointerId]; + if (lastControlOver === control47) { + delete list[pointerId]; + } + } + } + _cleanControlAfterRemoval(control47) { + this._cleanControlAfterRemovalFromList(this._lastControlDown, control47); + this._cleanControlAfterRemovalFromList(this._lastControlOver, control47); + } + pick(x, y, pi = null) { + if (this._isFullscreen && this._scene) { + this._translateToPicking(this._scene, new Viewport(0, 0, 0, 0), pi, x, y); + } + } + _translateToPicking(scene50, tempViewport, pi, x = scene50.pointerX, y = scene50.pointerY) { + const camera34 = scene50.cameraToUseForPointers || scene50.activeCamera; + const engine47 = scene50.getEngine(); + const originalCameraToUseForPointers = scene50.cameraToUseForPointers; + if (!camera34) { + tempViewport.x = 0; + tempViewport.y = 0; + tempViewport.width = engine47.getRenderWidth(); + tempViewport.height = engine47.getRenderHeight(); + } else { + if (camera34.rigCameras.length) { + const rigViewport = new Viewport(0, 0, 1, 1); + camera34.rigCameras.forEach((rigCamera) => { + rigCamera.viewport.toGlobalToRef(engine47.getRenderWidth(), engine47.getRenderHeight(), rigViewport); + const transformedX2 = x / engine47.getHardwareScalingLevel() - rigViewport.x; + const transformedY2 = y / engine47.getHardwareScalingLevel() - (engine47.getRenderHeight() - rigViewport.y - rigViewport.height); + if (transformedX2 < 0 || transformedY2 < 0 || x > rigViewport.width || y > rigViewport.height) { + return; + } + scene50.cameraToUseForPointers = rigCamera; + tempViewport.x = rigViewport.x; + tempViewport.y = rigViewport.y; + tempViewport.width = rigViewport.width; + tempViewport.height = rigViewport.height; + }); + } else { + camera34.viewport.toGlobalToRef(engine47.getRenderWidth(), engine47.getRenderHeight(), tempViewport); + } + } + const transformedX = x / engine47.getHardwareScalingLevel() - tempViewport.x; + const transformedY = y / engine47.getHardwareScalingLevel() - (engine47.getRenderHeight() - tempViewport.y - tempViewport.height); + this._shouldBlockPointer = false; + if (pi) { + const pointerId = pi.event.pointerId || this._defaultMousePointerId; + this._doPicking(transformedX, transformedY, pi, pi.type, pointerId, pi.event.button, pi.event.deltaX, pi.event.deltaY); + if (this._shouldBlockPointer && !(pi.type & this.skipBlockEvents) || this._capturingControl[pointerId]) { + pi.skipOnPointerObservable = true; + } + } else { + this._doPicking(transformedX, transformedY, null, PointerEventTypes.POINTERMOVE, this._defaultMousePointerId, 0); + } + scene50.cameraToUseForPointers = originalCameraToUseForPointers; + } + attach() { + const scene50 = this.getScene(); + if (!scene50) { + return; + } + const tempViewport = new Viewport(0, 0, 0, 0); + this._prePointerObserver = scene50.onPrePointerObservable.add((pi) => { + if (scene50.isPointerCaptured(pi.event.pointerId) && pi.type === PointerEventTypes.POINTERUP && !this._capturedPointerIds.has(pi.event.pointerId)) { + return; + } + if (pi.type !== PointerEventTypes.POINTERMOVE && pi.type !== PointerEventTypes.POINTERUP && pi.type !== PointerEventTypes.POINTERDOWN && pi.type !== PointerEventTypes.POINTERWHEEL) { + return; + } + if (pi.type === PointerEventTypes.POINTERMOVE) { + if (scene50.isPointerCaptured(pi.event.pointerId)) { + return; + } + if (pi.event.pointerId) { + this._defaultMousePointerId = pi.event.pointerId; + } + } + this._translateToPicking(scene50, tempViewport, pi); + }); + this._attachPickingToSceneRender(scene50, () => this._translateToPicking(scene50, tempViewport, null), false); + this._attachToOnPointerOut(scene50); + this._attachToOnBlur(scene50); + } + registerClipboardEvents() { + self.addEventListener("copy", this._onClipboardCopy, false); + self.addEventListener("cut", this._onClipboardCut, false); + self.addEventListener("paste", this._onClipboardPaste, false); + } + unRegisterClipboardEvents() { + self.removeEventListener("copy", this._onClipboardCopy); + self.removeEventListener("cut", this._onClipboardCut); + self.removeEventListener("paste", this._onClipboardPaste); + } + _transformUvs(uv) { + const textureMatrix = this.getTextureMatrix(); + let result; + if (textureMatrix.isIdentityAs3x2()) { + result = uv; + } else { + const homogeneousTextureMatrix = TmpVectors.Matrix[0]; + textureMatrix.getRowToRef(0, TmpVectors.Vector4[0]); + textureMatrix.getRowToRef(1, TmpVectors.Vector4[1]); + textureMatrix.getRowToRef(2, TmpVectors.Vector4[2]); + const r0 = TmpVectors.Vector4[0]; + const r1 = TmpVectors.Vector4[1]; + const r2 = TmpVectors.Vector4[2]; + homogeneousTextureMatrix.setRowFromFloats(0, r0.x, r0.y, 0, 0); + homogeneousTextureMatrix.setRowFromFloats(1, r1.x, r1.y, 0, 0); + homogeneousTextureMatrix.setRowFromFloats(2, 0, 0, 1, 0); + homogeneousTextureMatrix.setRowFromFloats(3, r2.x, r2.y, 0, 1); + result = TmpVectors.Vector2[0]; + Vector2.TransformToRef(uv, homogeneousTextureMatrix, result); + } + if (this.wrapU === Texture.WRAP_ADDRESSMODE || this.wrapU === Texture.MIRROR_ADDRESSMODE) { + if (result.x > 1) { + let fX = result.x - Math.trunc(result.x); + if (this.wrapU === Texture.MIRROR_ADDRESSMODE && Math.trunc(result.x) % 2 === 1) { + fX = 1 - fX; + } + result.x = fX; + } + } + if (this.wrapV === Texture.WRAP_ADDRESSMODE || this.wrapV === Texture.MIRROR_ADDRESSMODE) { + if (result.y > 1) { + let fY = result.y - Math.trunc(result.y); + if (this.wrapV === Texture.MIRROR_ADDRESSMODE && Math.trunc(result.x) % 2 === 1) { + fY = 1 - fY; + } + result.y = fY; + } + } + return result; + } + attachToMesh(mesh80, supportPointerMove = true) { + const scene50 = this.getScene(); + if (!scene50) { + return; + } + if (this._pointerObserver) { + scene50.onPointerObservable.remove(this._pointerObserver); + } + this._pointerObserver = scene50.onPointerObservable.add((pi) => { + if (pi.type !== PointerEventTypes.POINTERMOVE && pi.type !== PointerEventTypes.POINTERUP && pi.type !== PointerEventTypes.POINTERDOWN && pi.type !== PointerEventTypes.POINTERWHEEL) { + return; + } + if (pi.type === PointerEventTypes.POINTERMOVE && pi.event.pointerId) { + this._defaultMousePointerId = pi.event.pointerId; + } + const pointerId = pi.event.pointerId || this._defaultMousePointerId; + if (pi.pickInfo && pi.pickInfo.hit && pi.pickInfo.pickedMesh === mesh80) { + let uv = pi.pickInfo.getTextureCoordinates(); + if (uv) { + uv = this._transformUvs(uv); + const size = this.getSize(); + this._doPicking(uv.x * size.width, (this.applyYInversionOnUpdate ? 1 - uv.y : uv.y) * size.height, pi, pi.type, pointerId, pi.event.button, pi.event.deltaX, pi.event.deltaY); + } + } else if (pi.type === PointerEventTypes.POINTERUP) { + if (this._lastControlDown[pointerId]) { + this._lastControlDown[pointerId]._forcePointerUp(pointerId); + } + delete this._lastControlDown[pointerId]; + if (this.focusedControl) { + const friendlyControls = this.focusedControl.keepsFocusWith(); + let canMoveFocus = true; + if (friendlyControls) { + for (const control47 of friendlyControls) { + if (this === control47._host) { + continue; + } + const otherHost = control47._host; + if (otherHost._lastControlOver[pointerId] && otherHost._lastControlOver[pointerId].isAscendant(control47)) { + canMoveFocus = false; + break; + } + } + } + if (canMoveFocus) { + this.focusedControl = null; + } + } + } else if (pi.type === PointerEventTypes.POINTERMOVE) { + if (this._lastControlOver[pointerId]) { + this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], pi, true); + } + delete this._lastControlOver[pointerId]; + } + }); + mesh80.enablePointerMoveEvents = supportPointerMove; + this._attachPickingToSceneRender(scene50, () => { + const pointerId = this._defaultMousePointerId; + const pick = scene50 === null || scene50 === undefined ? undefined : scene50.pick(scene50.pointerX, scene50.pointerY); + if (pick && pick.hit && pick.pickedMesh === mesh80) { + let uv = pick.getTextureCoordinates(); + if (uv) { + uv = this._transformUvs(uv); + const size = this.getSize(); + this._doPicking(uv.x * size.width, (this.applyYInversionOnUpdate ? 1 - uv.y : uv.y) * size.height, null, PointerEventTypes.POINTERMOVE, pointerId, 0); + } + } else { + if (this._lastControlOver[pointerId]) { + this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], null, true); + } + delete this._lastControlOver[pointerId]; + } + }, true); + this._attachToOnPointerOut(scene50); + this._attachToOnBlur(scene50); + } + moveFocusToControl(control47) { + this.focusedControl = control47; + this._lastPickedControl = control47; + this._blockNextFocusCheck = true; + } + _manageFocus() { + if (this._blockNextFocusCheck) { + this._blockNextFocusCheck = false; + this._lastPickedControl = this._focusedControl; + return; + } + if (this._focusedControl) { + if (this._focusedControl !== this._lastPickedControl) { + if (this._lastPickedControl.isFocusInvisible) { + return; + } + this.focusedControl = null; + } + } + } + _attachPickingToSceneRender(scene50, pickFunction, forcePicking) { + this._sceneRenderObserver = scene50.onBeforeRenderObservable.add(() => { + if (!this.checkPointerEveryFrame) { + return; + } + if (this._linkedControls.length > 0 || forcePicking) { + pickFunction(); + } + }); + } + _attachToOnPointerOut(scene50) { + this._canvasPointerOutObserver = scene50.getEngine().onCanvasPointerOutObservable.add((pointerEvent) => { + if (this._lastControlOver[pointerEvent.pointerId]) { + this._lastControlOver[pointerEvent.pointerId]._onPointerOut(this._lastControlOver[pointerEvent.pointerId], null); + } + delete this._lastControlOver[pointerEvent.pointerId]; + if (this._lastControlDown[pointerEvent.pointerId] && this._lastControlDown[pointerEvent.pointerId] !== this._capturingControl[pointerEvent.pointerId]) { + this._lastControlDown[pointerEvent.pointerId]._forcePointerUp(pointerEvent.pointerId); + delete this._lastControlDown[pointerEvent.pointerId]; + } + }); + } + _attachToOnBlur(scene50) { + this._canvasBlurObserver = scene50.getEngine().onCanvasBlurObservable.add(() => { + Object.entries(this._lastControlDown).forEach(([, value]) => { + value._onCanvasBlur(); + }); + this.focusedControl = null; + this._lastControlDown = {}; + }); + } + serializeContent() { + const size = this.getSize(); + const serializationObject = { + root: {}, + width: size.width, + height: size.height + }; + this._rootContainer.serialize(serializationObject.root); + return serializationObject; + } + parseSerializedObject(serializedObject, scaleToSize) { + this._rootContainer = Control2.Parse(serializedObject.root, this); + if (scaleToSize) { + const width = serializedObject.width; + const height = serializedObject.height; + if (typeof width === "number" && typeof height === "number" && width >= 0 && height >= 0) { + this.scaleTo(width, height); + } else { + this.scaleTo(1920, 1080); + } + } + } + clone(newName) { + const scene50 = this.getScene(); + if (!scene50) { + return this; + } + const size = this.getSize(); + const data = this.serializeContent(); + const clone = new AdvancedDynamicTexture2(newName !== null && newName !== undefined ? newName : "Clone of " + this.name, size.width, size.height, scene50, !this.noMipmap, this.samplingMode); + clone.parseSerializedObject(data); + return clone; + } + static async ParseFromSnippetAsync(snippetId, scaleToSize, appendToAdt) { + const adt = appendToAdt !== null && appendToAdt !== undefined ? appendToAdt : AdvancedDynamicTexture2.CreateFullscreenUI("ADT from snippet"); + if (snippetId === "_BLANK") { + return adt; + } + const serialized = await AdvancedDynamicTexture2._LoadURLContentAsync(AdvancedDynamicTexture2.SnippetUrl + "/" + snippetId.replace(/#/g, "/"), true); + adt.parseSerializedObject(serialized, scaleToSize); + return adt; + } + parseFromSnippetAsync(snippetId, scaleToSize) { + return AdvancedDynamicTexture2.ParseFromSnippetAsync(snippetId, scaleToSize, this); + } + static async ParseFromFileAsync(url, scaleToSize, appendToAdt) { + const adt = appendToAdt !== null && appendToAdt !== undefined ? appendToAdt : AdvancedDynamicTexture2.CreateFullscreenUI("ADT from URL"); + const serialized = await AdvancedDynamicTexture2._LoadURLContentAsync(url); + adt.parseSerializedObject(serialized, scaleToSize); + return adt; + } + parseFromURLAsync(url, scaleToSize) { + return AdvancedDynamicTexture2.ParseFromFileAsync(url, scaleToSize, this); + } + static _LoadURLContentAsync(url, snippet = false) { + if (url === "") { + return Promise.reject("No URL provided"); + } + return new Promise((resolve, reject) => { + const request = new WebRequest; + request.addEventListener("readystatechange", () => { + if (request.readyState == 4) { + if (request.status == 200) { + let gui2; + if (snippet) { + const payload = JSON.parse(JSON.parse(request.responseText).jsonPayload); + gui2 = payload.encodedGui ? new TextDecoder("utf-8").decode(DecodeBase64ToBinary(payload.encodedGui)) : payload.gui; + } else { + gui2 = request.responseText; + } + const serializationObject = JSON.parse(gui2); + resolve(serializationObject); + } else { + reject("Unable to load"); + } + } + }); + request.open("GET", url); + request.send(); + }); + } + static _Overlaps(control1, control210) { + return !(control1.centerX > control210.centerX + control210.widthInPixels || control1.centerX + control1.widthInPixels < control210.centerX || control1.centerY + control1.heightInPixels < control210.centerY || control1.centerY > control210.centerY + control210.heightInPixels); + } + static CreateForMesh(mesh80, width = 1024, height = 1024, supportPointerMove = true, onlyAlphaTesting = false, invertY, materialSetupCallback = this._CreateMaterial) { + const uniqueId = RandomGUID(); + const result = new AdvancedDynamicTexture2(`AdvancedDynamicTexture for ${mesh80.name} [${uniqueId}]`, width, height, mesh80.getScene(), true, Texture.TRILINEAR_SAMPLINGMODE, invertY); + materialSetupCallback(mesh80, uniqueId, result, onlyAlphaTesting); + result.attachToMesh(mesh80, supportPointerMove); + return result; + } + static _CreateMaterial(mesh80, uniqueId, texture92, onlyAlphaTesting) { + const internalClassType = GetClass("BABYLON.StandardMaterial"); + if (!internalClassType) { + throw "StandardMaterial needs to be imported before as it contains a side-effect required by your code."; + } + const material30 = new internalClassType(`AdvancedDynamicTextureMaterial for ${mesh80.name} [${uniqueId}]`, mesh80.getScene()); + material30.backFaceCulling = false; + material30.diffuseColor = Color3.Black(); + material30.specularColor = Color3.Black(); + if (onlyAlphaTesting) { + material30.diffuseTexture = texture92; + material30.emissiveTexture = texture92; + texture92.hasAlpha = true; + } else { + material30.emissiveTexture = texture92; + material30.opacityTexture = texture92; + } + mesh80.material = material30; + } + static CreateForMeshTexture(mesh80, width = 1024, height = 1024, supportPointerMove = true, invertY) { + const result = new AdvancedDynamicTexture2(mesh80.name + " AdvancedDynamicTexture", width, height, mesh80.getScene(), true, Texture.TRILINEAR_SAMPLINGMODE, invertY); + result.attachToMesh(mesh80, supportPointerMove); + return result; + } + static CreateFullscreenUI(name315, foreground = true, scene50 = null, sampling = Texture.BILINEAR_SAMPLINGMODE, adaptiveScaling = false) { + const result = new AdvancedDynamicTexture2(name315, 0, 0, scene50, false, sampling); + const resultScene = result.getScene(); + const layer4 = new Layer(name315 + "_layer", null, resultScene, !foreground); + layer4.texture = result; + result._layerToDispose = layer4; + result._isFullscreen = true; + if (adaptiveScaling && resultScene) { + const newScale = 1 / resultScene.getEngine().getHardwareScalingLevel(); + result._rootContainer.scaleX = newScale; + result._rootContainer.scaleY = newScale; + } + result.attach(); + return result; + } + scale(ratio) { + super.scale(ratio); + this.markAsDirty(); + } + scaleTo(width, height) { + super.scaleTo(width, height); + this.markAsDirty(); + } + _checkGuiIsReady() { + if (this.guiIsReady()) { + this.onGuiReadyObservable.notifyObservers(this); + this.onGuiReadyObservable.clear(); + } + } + guiIsReady() { + return this._rootContainer.isReady(); + } +} +var init_advancedDynamicTexture = __esm(() => { + init_observable(); + init_math_vector(); + init_tools(); + init_pointerEvents(); + init_clipboardEvents(); + init_keyboardEvents(); + init_texture(); + init_dynamicTexture(); + init_layer(); + init_container(); + init_control(); + init_style(); + init_measure(); + init_constants(); + init_math_viewport(); + init_math_color(); + init_webRequest(); + init_guid(); + init_typeStore(); + init_stringTools(); + AdvancedDynamicTexture2.SnippetUrl = Constants.SnippetUrl; + AdvancedDynamicTexture2.AllowGPUOptimizations = true; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/adtInstrumentation.js +class AdvancedDynamicTextureInstrumentation { + get renderTimeCounter() { + return this._renderTime; + } + get layoutTimeCounter() { + return this._layoutTime; + } + get captureRenderTime() { + return this._captureRenderTime; + } + set captureRenderTime(value) { + if (value === this._captureRenderTime) { + return; + } + this._captureRenderTime = value; + if (value) { + this._onBeginRenderObserver = this.texture.onBeginRenderObservable.add(() => { + this._renderTime.beginMonitoring(); + }); + this._onEndRenderObserver = this.texture.onEndRenderObservable.add(() => { + this._renderTime.endMonitoring(true); + }); + } else { + this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver); + this._onBeginRenderObserver = null; + this.texture.onEndRenderObservable.remove(this._onEndRenderObserver); + this._onEndRenderObserver = null; + } + } + get captureLayoutTime() { + return this._captureLayoutTime; + } + set captureLayoutTime(value) { + if (value === this._captureLayoutTime) { + return; + } + this._captureLayoutTime = value; + if (value) { + this._onBeginLayoutObserver = this.texture.onBeginLayoutObservable.add(() => { + this._layoutTime.beginMonitoring(); + }); + this._onEndLayoutObserver = this.texture.onEndLayoutObservable.add(() => { + this._layoutTime.endMonitoring(true); + }); + } else { + this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver); + this._onBeginLayoutObserver = null; + this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver); + this._onEndLayoutObserver = null; + } + } + constructor(texture92) { + this.texture = texture92; + this._captureRenderTime = false; + this._renderTime = new PerfCounter; + this._captureLayoutTime = false; + this._layoutTime = new PerfCounter; + this._onBeginRenderObserver = null; + this._onEndRenderObserver = null; + this._onBeginLayoutObserver = null; + this._onEndLayoutObserver = null; + } + dispose() { + this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver); + this._onBeginRenderObserver = null; + this.texture.onEndRenderObservable.remove(this._onEndRenderObserver); + this._onEndRenderObserver = null; + this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver); + this._onBeginLayoutObserver = null; + this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver); + this._onEndLayoutObserver = null; + this.texture = null; + } +} +var init_adtInstrumentation = __esm(() => { + init_perfCounter(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/xmlLoader.js +class XmlLoader { + constructor(parentClass = null) { + this._nodes = {}; + this._nodeTypes = { + element: 1, + attribute: 2, + text: 3 + }; + this._isLoaded = false; + this._objectAttributes = { + textHorizontalAlignment: 1, + textVerticalAlignment: 2, + horizontalAlignment: 3, + verticalAlignment: 4, + stretch: 5 + }; + if (parentClass) { + this._parentClass = parentClass; + } + } + _getChainElement(attributeValue) { + let element = window; + if (this._parentClass) { + element = this._parentClass; + } + let value = attributeValue; + value = value.split("."); + for (let i = 0;i < value.length; i++) { + element = element[value[i]]; + } + return element; + } + _getClassAttribute(attributeName) { + const attribute = attributeName.split("."); + const className2 = GetClass("BABYLON.GUI." + attribute[0]); + return className2[attribute[1]]; + } + _createGuiElement(node30, parent, linkParent = true) { + try { + const className2 = GetClass("BABYLON.GUI." + node30.nodeName); + const guiNode = new className2; + if (parent && linkParent) { + parent.addControl(guiNode); + } + for (let i = 0;i < node30.attributes.length; i++) { + if (node30.attributes[i].name.toLowerCase().includes("datasource")) { + continue; + } + if (node30.attributes[i].name.toLowerCase().includes("observable")) { + const element = this._getChainElement(node30.attributes[i].value); + guiNode[node30.attributes[i].name].add(element); + continue; + } else if (node30.attributes[i].name == "linkWithMesh") { + if (this._parentClass) { + guiNode.linkWithMesh(this._parentClass[node30.attributes[i].value]); + } else { + guiNode.linkWithMesh(window[node30.attributes[i].value]); + } + } else if (node30.attributes[i].value.startsWith("{{") && node30.attributes[i].value.endsWith("}}")) { + const element = this._getChainElement(node30.attributes[i].value.substring(2, node30.attributes[i].value.length - 2)); + guiNode[node30.attributes[i].name] = element; + } else if (!this._objectAttributes[node30.attributes[i].name]) { + if (node30.attributes[i].value == "true" || node30.attributes[i].value == "false") { + guiNode[node30.attributes[i].name] = node30.attributes[i].value == "true"; + } else { + guiNode[node30.attributes[i].name] = !isNaN(Number(node30.attributes[i].value)) ? Number(node30.attributes[i].value) : node30.attributes[i].value; + } + } else { + guiNode[node30.attributes[i].name] = this._getClassAttribute(node30.attributes[i].value); + } + } + if (!node30.attributes.getNamedItem("id")) { + this._nodes[node30.nodeName + Object.keys(this._nodes).length + "_gen"] = guiNode; + return guiNode; + } + let id = node30.attributes.getNamedItem("id").value; + if (id.startsWith("{{") && id.endsWith("}}")) { + id = this._getChainElement(id.substring(2, id.length - 2)); + } + if (!this._nodes[id]) { + this._nodes[id] = guiNode; + } else { + throw "XmlLoader Exception : Duplicate ID, every element should have an unique ID attribute"; + } + return guiNode; + } catch (exception) { + throw "XmlLoader Exception : Error parsing Control " + node30.nodeName + "," + exception + "."; + } + } + _parseGrid(node30, guiNode, parent) { + let width; + let height; + let columns; + const rows = node30.children; + let cells; + let isPixel = false; + let cellNode; + let rowNumber = -1; + let columnNumber = -1; + let totalColumnsNumber = 0; + for (let i = 0;i < rows.length; i++) { + if (rows[i].nodeType != this._nodeTypes.element) { + continue; + } + if (rows[i].nodeName != "Row") { + throw "XmlLoader Exception : Expecting Row node, received " + rows[i].nodeName; + } + rowNumber += 1; + columns = rows[i].children; + if (!rows[i].attributes.getNamedItem("height")) { + throw "XmlLoader Exception : Height must be defined for grid rows"; + } + height = Number(rows[i].attributes.getNamedItem("height").nodeValue); + isPixel = rows[i].attributes.getNamedItem("isPixel") ? JSON.parse(rows[i].attributes.getNamedItem("isPixel").nodeValue) : false; + guiNode.addRowDefinition(height, isPixel); + for (let j = 0;j < columns.length; j++) { + if (columns[j].nodeType != this._nodeTypes.element) { + continue; + } + if (columns[j].nodeName != "Column") { + throw "XmlLoader Exception : Expecting Column node, received " + columns[j].nodeName; + } + columnNumber += 1; + if (rowNumber > 0 && columnNumber > totalColumnsNumber) { + throw "XmlLoader Exception : In the Grid element, the number of columns is defined in the first row, do not add more columns in the subsequent rows."; + } + if (rowNumber == 0) { + if (!columns[j].attributes.getNamedItem("width")) { + throw "XmlLoader Exception : Width must be defined for all the grid columns in the first row"; + } + width = Number(columns[j].attributes.getNamedItem("width").nodeValue); + isPixel = columns[j].attributes.getNamedItem("isPixel") ? JSON.parse(columns[j].attributes.getNamedItem("isPixel").nodeValue) : false; + guiNode.addColumnDefinition(width, isPixel); + } + cells = columns[j].children; + for (let k = 0;k < cells.length; k++) { + if (cells[k].nodeType != this._nodeTypes.element) { + continue; + } + cellNode = this._createGuiElement(cells[k], guiNode, false); + guiNode.addControl(cellNode, rowNumber, columnNumber); + if (cells[k].firstChild) { + this._parseXml(cells[k].firstChild, cellNode); + } + } + } + if (rowNumber == 0) { + totalColumnsNumber = columnNumber; + } + columnNumber = -1; + } + if (node30.nextSibling) { + this._parseXml(node30.nextSibling, parent); + } + } + _parseElement(node30, guiNode, parent) { + if (node30.firstChild) { + this._parseXml(node30.firstChild, guiNode); + } + if (node30.nextSibling) { + this._parseXml(node30.nextSibling, parent); + } + } + _prepareSourceElement(node30, guiNode, variable, source, iterator) { + if (this._parentClass) { + this._parentClass[variable] = source[iterator]; + } else { + window[variable] = source[iterator]; + } + if (node30.firstChild) { + this._parseXml(node30.firstChild, guiNode, true); + } + } + _parseElementsFromSource(node30, guiNode, parent) { + const dataSource = node30.attributes.getNamedItem("dataSource").value; + if (!dataSource.includes(" in ")) { + throw "XmlLoader Exception : Malformed XML, Data Source must include an in"; + } else { + let isArray = true; + const splittedSource = dataSource.split(" in "); + if (splittedSource.length < 2) { + throw "XmlLoader Exception : Malformed XML, Data Source must have an iterator and a source"; + } + let source = splittedSource[1]; + if (source.startsWith("{") && source.endsWith("}")) { + isArray = false; + } + if (!isArray || source.startsWith("[") && source.endsWith("]")) { + source = source.substring(1, source.length - 1); + } + if (this._parentClass) { + source = this._parentClass[source]; + } else { + source = window[source]; + } + if (isArray) { + for (let i = 0;i < source.length; i++) { + this._prepareSourceElement(node30, guiNode, splittedSource[0], source, i); + } + } else { + for (const i in source) { + this._prepareSourceElement(node30, guiNode, splittedSource[0], source, i); + } + } + if (node30.nextSibling) { + this._parseXml(node30.nextSibling, parent); + } + } + } + _parseXml(node30, parent, generated = false) { + if (node30.nodeType != this._nodeTypes.element) { + if (node30.nextSibling) { + this._parseXml(node30.nextSibling, parent, generated); + } + return; + } + if (generated) { + node30.setAttribute("id", parent.id + (parent._children.length + 1)); + } + const guiNode = this._createGuiElement(node30, parent); + if (!this._rootNode) { + this._rootNode = guiNode; + } + if (node30.nodeName == "Grid") { + this._parseGrid(node30, guiNode, parent); + } else if (!node30.attributes.getNamedItem("dataSource")) { + this._parseElement(node30, guiNode, parent); + } else { + this._parseElementsFromSource(node30, guiNode, parent); + } + } + isLoaded() { + return this._isLoaded; + } + getNodeById(id) { + return this._nodes[id]; + } + getNodes() { + return this._nodes; + } + dispose() { + if (this._rootNode) { + this._rootNode.dispose(); + this._rootNode = null; + this._nodes = {}; + } + } + loadLayout(xmlFile, rootNode, onSuccess = null, onError = null) { + const xhttp = new XMLHttpRequest; + xhttp.onload = () => { + if (xhttp.readyState === 4 && xhttp.status === 200) { + if (!xhttp.responseXML) { + if (onError) { + onError(XmlLoaderError); + return; + } else { + throw XmlLoaderError; + } + } + const xmlDoc = xhttp.responseXML.documentElement; + this._parseXml(xmlDoc.firstChild, rootNode); + this._isLoaded = true; + if (onSuccess) { + onSuccess(); + } + } + }; + xhttp.onerror = function() { + if (onError) { + onError("an error occurred during loading the layout"); + } + }; + xhttp.open("GET", xmlFile, true); + xhttp.send(); + } + async loadLayoutAsync(xmlFile, rootNode) { + return new Promise((resolve, reject) => { + this.loadLayout(xmlFile, rootNode, resolve, reject); + }); + } +} +var XmlLoaderError; +var init_xmlLoader = __esm(() => { + init_typeStore(); + XmlLoaderError = "XmlLoader Exception : XML file is malformed or corrupted."; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/2D/index.js +var init_2D = __esm(() => { + init_controls(); + init_advancedDynamicTexture(); + init_adtInstrumentation(); + init_math2D(); + init_measure(); + init_multiLinePoint(); + init_style(); + init_valueAndUnit(); + init_xmlLoader(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/vector3WithInfo.js +class Vector3WithInfo2 extends Vector3 { + constructor(source, buttonIndex = 0) { + super(source.x, source.y, source.z); + this.buttonIndex = buttonIndex; + } +} +var init_vector3WithInfo = __esm(() => { + init_math_vector(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/control3D.js +class Control3D2 { + get position() { + if (!this._node) { + return Vector3.Zero(); + } + return this._node.position; + } + set position(value) { + if (!this._node) { + return; + } + this._node.position = value; + } + get scaling() { + if (!this._node) { + return new Vector3(1, 1, 1); + } + return this._node.scaling; + } + set scaling(value) { + if (!this._node) { + return; + } + this._isScaledByManager = false; + this._node.scaling = value; + } + get behaviors() { + return this._behaviors; + } + addBehavior(behavior2) { + const index = this._behaviors.indexOf(behavior2); + if (index !== -1) { + return this; + } + behavior2.init(); + const scene50 = this._host.scene; + if (scene50.isLoading) { + scene50.onDataLoadedObservable.addOnce(() => { + behavior2.attach(this); + }); + } else { + behavior2.attach(this); + } + this._behaviors.push(behavior2); + return this; + } + removeBehavior(behavior2) { + const index = this._behaviors.indexOf(behavior2); + if (index === -1) { + return this; + } + this._behaviors[index].detach(); + this._behaviors.splice(index, 1); + return this; + } + getBehaviorByName(name315) { + for (const behavior2 of this._behaviors) { + if (behavior2.name === name315) { + return behavior2; + } + } + return null; + } + get isVisible() { + return this._isVisible; + } + set isVisible(value) { + if (this._isVisible === value) { + return; + } + this._isVisible = value; + const mesh80 = this.mesh; + if (mesh80) { + mesh80.setEnabled(value); + } + } + constructor(name315) { + this.name = name315; + this._downCount = 0; + this._enterCount = -1; + this._downPointerIds = {}; + this._isVisible = true; + this._isScaledByManager = false; + this.onPointerMoveObservable = new Observable; + this.onPointerOutObservable = new Observable; + this.onPointerDownObservable = new Observable; + this.onPointerUpObservable = new Observable; + this.onPointerClickObservable = new Observable; + this.onPointerEnterObservable = new Observable; + this._behaviors = new Array; + } + get typeName() { + return this._getTypeName(); + } + getClassName() { + return this._getTypeName(); + } + _getTypeName() { + return "Control3D"; + } + get node() { + return this._node; + } + get mesh() { + if (this._node instanceof AbstractMesh) { + return this._node; + } + return null; + } + linkToTransformNode(node30) { + if (this._node) { + this._node.parent = node30; + } + return this; + } + _prepareNode(scene50) { + if (!this._node) { + this._node = this._createNode(scene50); + if (!this.node) { + return; + } + this._injectGUI3DReservedDataStore(this.node).control = this; + const mesh80 = this.mesh; + if (mesh80) { + mesh80.isPickable = true; + this._affectMaterial(mesh80); + } + } + } + _injectGUI3DReservedDataStore(node30) { + var _a, _b; + node30.reservedDataStore = (_a = node30.reservedDataStore) !== null && _a !== undefined ? _a : {}; + node30.reservedDataStore.GUI3D = (_b = node30.reservedDataStore.GUI3D) !== null && _b !== undefined ? _b : {}; + return node30.reservedDataStore.GUI3D; + } + _createNode(scene50) { + return null; + } + _affectMaterial(mesh80) { + mesh80.material = null; + } + _isTouchButton3D(control47) { + return control47._generatePointerEventType !== undefined; + } + _onPointerMove(target, coordinates) { + this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this); + } + _onPointerEnter(target) { + if (this._enterCount === -1) { + this._enterCount = 0; + } + this._enterCount++; + if (this._enterCount > 1) { + return false; + } + this.onPointerEnterObservable.notifyObservers(this, -1, target, this); + if (this.pointerEnterAnimation) { + this.pointerEnterAnimation(); + } + return true; + } + _onPointerOut(target) { + this._enterCount--; + if (this._enterCount > 0) { + return; + } + this._enterCount = 0; + this.onPointerOutObservable.notifyObservers(this, -1, target, this); + if (this.pointerOutAnimation) { + this.pointerOutAnimation(); + } + } + _onPointerDown(target, coordinates, pointerId, buttonIndex) { + this._downCount++; + this._downPointerIds[pointerId] = this._downPointerIds[pointerId] + 1 || 1; + if (this._downCount !== 1) { + return false; + } + this.onPointerDownObservable.notifyObservers(new Vector3WithInfo2(coordinates, buttonIndex), -1, target, this); + if (this.pointerDownAnimation) { + this.pointerDownAnimation(); + } + return true; + } + _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick) { + this._downCount--; + this._downPointerIds[pointerId]--; + if (this._downPointerIds[pointerId] <= 0) { + delete this._downPointerIds[pointerId]; + } + if (this._downCount < 0) { + this._downCount = 0; + return; + } + if (this._downCount == 0) { + if (notifyClick && (this._enterCount > 0 || this._enterCount === -1)) { + this.onPointerClickObservable.notifyObservers(new Vector3WithInfo2(coordinates, buttonIndex), -1, target, this); + } + this.onPointerUpObservable.notifyObservers(new Vector3WithInfo2(coordinates, buttonIndex), -1, target, this); + if (this.pointerUpAnimation) { + this.pointerUpAnimation(); + } + } + } + forcePointerUp(pointerId = null) { + if (pointerId !== null) { + this._onPointerUp(this, Vector3.Zero(), pointerId, 0, true); + } else { + for (const key in this._downPointerIds) { + this._onPointerUp(this, Vector3.Zero(), +key, 0, true); + } + if (this._downCount > 0) { + this._downCount = 1; + this._onPointerUp(this, Vector3.Zero(), 0, 0, true); + } + } + } + _processObservables(type, pickedPoint, originMeshPosition, pointerId, buttonIndex) { + if (this._isTouchButton3D(this) && originMeshPosition) { + type = this._generatePointerEventType(type, originMeshPosition, this._downCount); + } + if (type === PointerEventTypes.POINTERMOVE) { + this._onPointerMove(this, pickedPoint); + const previousControlOver = this._host._lastControlOver[pointerId]; + if (previousControlOver && previousControlOver !== this) { + previousControlOver._onPointerOut(this); + } + if (previousControlOver !== this) { + this._onPointerEnter(this); + } + this._host._lastControlOver[pointerId] = this; + return true; + } + if (type === PointerEventTypes.POINTERDOWN) { + this._onPointerDown(this, pickedPoint, pointerId, buttonIndex); + this._host._lastControlDown[pointerId] = this; + this._host._lastPickedControl = this; + return true; + } + if (type === PointerEventTypes.POINTERUP || type === PointerEventTypes.POINTERDOUBLETAP) { + if (this._host._lastControlDown[pointerId]) { + this._host._lastControlDown[pointerId]._onPointerUp(this, pickedPoint, pointerId, buttonIndex, true); + } + delete this._host._lastControlDown[pointerId]; + return true; + } + return false; + } + _disposeNode() { + if (this._node) { + this._node.dispose(); + this._node = null; + } + } + dispose() { + this.onPointerDownObservable.clear(); + this.onPointerEnterObservable.clear(); + this.onPointerMoveObservable.clear(); + this.onPointerOutObservable.clear(); + this.onPointerUpObservable.clear(); + this.onPointerClickObservable.clear(); + this._disposeNode(); + for (const behavior2 of this._behaviors) { + behavior2.detach(); + } + } +} +var init_control3D = __esm(() => { + init_observable(); + init_math_vector(); + init_pointerEvents(); + init_abstractMesh(); + init_vector3WithInfo(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/contentDisplay3D.js +class ContentDisplay3D2 extends Control3D2 { + constructor() { + super(...arguments); + this._contentResolution = 512; + this._contentScaleRatio = 2; + } + get content() { + return this._content; + } + set content(value) { + this._content = value; + if (!value || !this._host || !this._host.utilityLayer) { + return; + } + if (!this._facadeTexture) { + this._facadeTexture = new AdvancedDynamicTexture2("Facade", this._contentResolution, this._contentResolution, this._host.utilityLayer.utilityLayerScene, true, Texture.TRILINEAR_SAMPLINGMODE); + this._setFacadeTextureScaling(); + this._facadeTexture.premulAlpha = true; + } else { + this._facadeTexture.rootContainer.clearControls(); + } + this._facadeTexture.addControl(value); + this._applyFacade(this._facadeTexture); + } + _setFacadeTextureScaling() { + var _a; + if (this._facadeTexture) { + this._facadeTexture.rootContainer.scaleX = this._contentScaleRatio; + this._facadeTexture.rootContainer.scaleY = (_a = this._contentScaleRatioY) !== null && _a !== undefined ? _a : this._contentScaleRatio; + } + } + get contentResolution() { + return this._contentResolution; + } + set contentResolution(value) { + if (this._contentResolution === value) { + return; + } + this._contentResolution = value; + this._resetContent(); + } + _disposeFacadeTexture() { + if (this._facadeTexture) { + this._facadeTexture.dispose(); + this._facadeTexture = null; + } + } + _resetContent() { + this._disposeFacadeTexture(); + this.content = this._content; + } + _applyFacade(facadeTexture) { + } +} +var init_contentDisplay3D = __esm(() => { + init_advancedDynamicTexture(); + init_control3D(); + init_texture(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/abstractButton3D.js +class AbstractButton3D2 extends ContentDisplay3D2 { + constructor(name315) { + super(name315); + } + _getTypeName() { + return "AbstractButton3D"; + } + _createNode(scene50) { + return new TransformNode("button" + this.name, scene50); + } +} +var init_abstractButton3D = __esm(() => { + init_transformNode(); + init_contentDisplay3D(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/button3D.js +class Button3D2 extends AbstractButton3D2 { + constructor(name315, options) { + super(name315); + this._options = { + width: 1, + height: 1, + depth: 0.08, + ...options + }; + this.pointerEnterAnimation = () => { + if (!this.mesh) { + return; + } + this._currentMaterial.emissiveColor = Color3.Red(); + }; + this.pointerOutAnimation = () => { + this._currentMaterial.emissiveColor = Color3.Black(); + }; + this.pointerDownAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(0.95); + }; + this.pointerUpAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(1 / 0.95); + }; + } + _applyFacade(facadeTexture) { + this._currentMaterial.emissiveTexture = facadeTexture; + } + _getTypeName() { + return "Button3D"; + } + _createNode(scene50) { + const faceUV = new Array(6); + for (let i = 0;i < 6; i++) { + faceUV[i] = new Vector4(0, 0, 0, 0); + } + if (scene50.useRightHandedSystem) { + faceUV[0].copyFromFloats(1, 0, 0, 1); + } else { + faceUV[1].copyFromFloats(0, 0, 1, 1); + } + const mesh80 = CreateBox(this.name + "_rootMesh", { + width: this._options.width, + height: this._options.height, + depth: this._options.depth, + faceUV, + wrap: true + }, scene50); + this._contentScaleRatioY = this._contentScaleRatio * this._options.width / this._options.height; + this._setFacadeTextureScaling(); + return mesh80; + } + _affectMaterial(mesh80) { + const material30 = new StandardMaterial(this.name + "Material", mesh80.getScene()); + material30.specularColor = Color3.Black(); + mesh80.material = material30; + this._currentMaterial = material30; + this._resetContent(); + } + dispose() { + super.dispose(); + this._disposeFacadeTexture(); + if (this._currentMaterial) { + this._currentMaterial.dispose(); + } + } +} +var init_button3D = __esm(() => { + init_math_vector(); + init_boxBuilder(); + init_standardMaterial(); + init_abstractButton3D(); + init_math_color(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/container3D.js +class Container3D2 extends Control3D2 { + get children() { + return this._children; + } + get blockLayout() { + return this._blockLayout; + } + set blockLayout(value) { + if (this._blockLayout === value) { + return; + } + this._blockLayout = value; + if (!this._blockLayout) { + this._arrangeChildren(); + } + } + constructor(name315) { + super(name315); + this._blockLayout = false; + this._children = new Array; + } + updateLayout() { + this._arrangeChildren(); + return this; + } + containsControl(control47) { + return this._children.indexOf(control47) !== -1; + } + addControl(control47) { + const index = this._children.indexOf(control47); + if (index !== -1) { + return this; + } + control47.parent = this; + control47._host = this._host; + this._children.push(control47); + if (this._host.utilityLayer) { + control47._prepareNode(this._host.utilityLayer.utilityLayerScene); + if (control47.node) { + control47.node.parent = this.node; + } + if (!this.blockLayout) { + this._arrangeChildren(); + } + } + return this; + } + _arrangeChildren() { + } + _createNode(scene50) { + return new TransformNode("ContainerNode", scene50); + } + removeControl(control47) { + const index = this._children.indexOf(control47); + if (index !== -1) { + this._children.splice(index, 1); + control47.parent = null; + control47._disposeNode(); + } + return this; + } + _getTypeName() { + return "Container3D"; + } + dispose() { + for (const control47 of this._children) { + control47.dispose(); + } + this._children.length = 0; + super.dispose(); + } +} +var init_container3D = __esm(() => { + init_transformNode(); + init_control3D(); + Container3D2.UNSET_ORIENTATION = 0; + Container3D2.FACEORIGIN_ORIENTATION = 1; + Container3D2.FACEORIGINREVERSED_ORIENTATION = 2; + Container3D2.FACEFORWARD_ORIENTATION = 3; + Container3D2.FACEFORWARDREVERSED_ORIENTATION = 4; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/volumeBasedPanel.js +class VolumeBasedPanel2 extends Container3D2 { + get orientation() { + return this._orientation; + } + set orientation(value) { + if (this._orientation === value) { + return; + } + this._orientation = value; + Tools.SetImmediate(() => { + this._arrangeChildren(); + }); + } + get columns() { + return this._columns; + } + set columns(value) { + if (this._columns === value) { + return; + } + this._columns = value; + this._rowThenColum = true; + Tools.SetImmediate(() => { + this._arrangeChildren(); + }); + } + get rows() { + return this._rows; + } + set rows(value) { + if (this._rows === value) { + return; + } + this._rows = value; + this._rowThenColum = false; + Tools.SetImmediate(() => { + this._arrangeChildren(); + }); + } + constructor(name315) { + super(name315); + this._columns = 10; + this._rows = 0; + this._rowThenColum = true; + this._orientation = Container3D2.FACEORIGIN_ORIENTATION; + this.margin = 0; + } + _arrangeChildren() { + this._cellWidth = 0; + this._cellHeight = 0; + let rows = 0; + let columns = 0; + let controlCount = 0; + const currentInverseWorld = Matrix.Invert(this.node.computeWorldMatrix(true)); + for (const child of this._children) { + if (!child.mesh) { + continue; + } + controlCount++; + child.mesh.computeWorldMatrix(true); + const boundingBox5 = child.mesh.getHierarchyBoundingVectors(); + const extendSize = TmpVectors.Vector3[0]; + const diff = TmpVectors.Vector3[1]; + boundingBox5.max.subtractToRef(boundingBox5.min, diff); + diff.scaleInPlace(0.5); + Vector3.TransformNormalToRef(diff, currentInverseWorld, extendSize); + this._cellWidth = Math.max(this._cellWidth, extendSize.x * 2); + this._cellHeight = Math.max(this._cellHeight, extendSize.y * 2); + } + this._cellWidth += this.margin * 2; + this._cellHeight += this.margin * 2; + if (this._rowThenColum) { + columns = this._columns; + rows = Math.ceil(controlCount / this._columns); + } else { + rows = this._rows; + columns = Math.ceil(controlCount / this._rows); + } + const startOffsetX = columns * 0.5 * this._cellWidth; + const startOffsetY = rows * 0.5 * this._cellHeight; + const nodeGrid = []; + let cellCounter = 0; + if (this._rowThenColum) { + for (let r = 0;r < rows; r++) { + for (let c = 0;c < columns; c++) { + nodeGrid.push(new Vector3(c * this._cellWidth - startOffsetX + this._cellWidth / 2, r * this._cellHeight - startOffsetY + this._cellHeight / 2, 0)); + cellCounter++; + if (cellCounter > controlCount) { + break; + } + } + } + } else { + for (let c = 0;c < columns; c++) { + for (let r = 0;r < rows; r++) { + nodeGrid.push(new Vector3(c * this._cellWidth - startOffsetX + this._cellWidth / 2, r * this._cellHeight - startOffsetY + this._cellHeight / 2, 0)); + cellCounter++; + if (cellCounter > controlCount) { + break; + } + } + } + } + cellCounter = 0; + for (const child of this._children) { + if (!child.mesh) { + continue; + } + this._mapGridNode(child, nodeGrid[cellCounter]); + cellCounter++; + } + this._finalProcessing(); + } + _finalProcessing() { + } +} +var init_volumeBasedPanel = __esm(() => { + init_tools(); + init_math_vector(); + init_container3D(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/cylinderPanel.js +class CylinderPanel extends VolumeBasedPanel2 { + constructor() { + super(...arguments); + this._radius = 5; + } + get radius() { + return this._radius; + } + set radius(value) { + if (this._radius === value) { + return; + } + this._radius = value; + Tools.SetImmediate(() => { + this._arrangeChildren(); + }); + } + _mapGridNode(control47, nodePosition) { + const mesh80 = control47.mesh; + if (!mesh80) { + return; + } + const newPos = this._cylindricalMapping(nodePosition); + control47.position = newPos; + switch (this.orientation) { + case Container3D2.FACEORIGIN_ORIENTATION: + mesh80.lookAt(new Vector3(2 * newPos.x, newPos.y, 2 * newPos.z)); + break; + case Container3D2.FACEORIGINREVERSED_ORIENTATION: + mesh80.lookAt(new Vector3(-newPos.x, newPos.y, -newPos.z)); + break; + case Container3D2.FACEFORWARD_ORIENTATION: + break; + case Container3D2.FACEFORWARDREVERSED_ORIENTATION: + mesh80.rotate(Axis.Y, Math.PI, Space.LOCAL); + break; + } + } + _cylindricalMapping(source) { + const newPos = new Vector3(0, source.y, this._radius); + const yAngle = source.x / this._radius; + Matrix.RotationYawPitchRollToRef(yAngle, 0, 0, TmpVectors.Matrix[0]); + return Vector3.TransformNormal(newPos, TmpVectors.Matrix[0]); + } +} +var init_cylinderPanel = __esm(() => { + init_tools(); + init_math_vector(); + init_volumeBasedPanel(); + init_container3D(); + init_math_axis(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/fluent/shaders/fluent.vertex.js +var name315, shader313; +var init_fluent_vertex = __esm(() => { + init_shaderStore(); + name315 = "fluentVertexShader"; + shader313 = `precision highp float;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;uniform mat4 world;uniform mat4 viewProjection;varying vec2 vUV; +#ifdef BORDER +varying vec2 scaleInfo;uniform float borderWidth;uniform vec3 scaleFactor; +#endif +#ifdef HOVERLIGHT +varying vec3 worldPosition; +#endif +void main(void) {vUV=uv; +#ifdef BORDER +vec3 scale=scaleFactor;float minScale=min(min(scale.x,scale.y),scale.z);float maxScale=max(max(scale.x,scale.y),scale.z);float minOverMiddleScale=minScale/(scale.x+scale.y+scale.z-minScale-maxScale);float areaYZ=scale.y*scale.z;float areaXZ=scale.x*scale.z;float areaXY=scale.x*scale.y;float scaledBorderWidth=borderWidth; +if (abs(normal.x)==1.0) +{scale.x=scale.y;scale.y=scale.z;if (areaYZ>areaXZ && areaYZ>areaXY) +{scaledBorderWidth*=minOverMiddleScale;}} +else if (abs(normal.y)==1.0) +{scale.x=scale.z;if (areaXZ>areaXY && areaXZ>areaYZ) +{scaledBorderWidth*=minOverMiddleScale;}} +else +{if (areaXY>areaYZ && areaXY>areaXZ) +{scaledBorderWidth*=minOverMiddleScale;}} +float scaleRatio=min(scale.x,scale.y)/max(scale.x,scale.y);if (scale.x>scale.y) +{scaleInfo.x=1.0-(scaledBorderWidth*scaleRatio);scaleInfo.y=1.0-scaledBorderWidth;} +else +{scaleInfo.x=1.0-scaledBorderWidth;scaleInfo.y=1.0-(scaledBorderWidth*scaleRatio);} +#endif +vec4 worldPos=world*vec4(position,1.0); +#ifdef HOVERLIGHT +worldPosition=worldPos.xyz; +#endif +gl_Position=viewProjection*worldPos;} +`; + ShaderStore.ShadersStore[name315] = shader313; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/fluent/shaders/fluent.fragment.js +var name316, shader314; +var init_fluent_fragment = __esm(() => { + init_shaderStore(); + name316 = "fluentPixelShader"; + shader314 = `precision highp float;varying vec2 vUV;uniform vec4 albedoColor; +#ifdef INNERGLOW +uniform vec4 innerGlowColor; +#endif +#ifdef BORDER +varying vec2 scaleInfo;uniform float edgeSmoothingValue;uniform float borderMinValue; +#endif +#ifdef HOVERLIGHT +varying vec3 worldPosition;uniform vec3 hoverPosition;uniform vec4 hoverColor;uniform float hoverRadius; +#endif +#ifdef TEXTURE +uniform sampler2D albedoSampler;uniform mat4 textureMatrix;vec2 finalUV; +#endif +void main(void) {vec3 albedo=albedoColor.rgb;float alpha=albedoColor.a; +#ifdef TEXTURE +finalUV=vec2(textureMatrix*vec4(vUV,1.0,0.0));albedo=texture2D(albedoSampler,finalUV).rgb; +#endif +#ifdef HOVERLIGHT +float pointToHover=(1.0-clamp(length(hoverPosition-worldPosition)/hoverRadius,0.,1.))*hoverColor.a;albedo=clamp(albedo+hoverColor.rgb*pointToHover,0.,1.); +#else +float pointToHover=1.0; +#endif +#ifdef BORDER +float borderPower=10.0;float inverseBorderPower=1.0/borderPower;vec3 borderColor=albedo*borderPower;vec2 distanceToEdge;distanceToEdge.x=abs(vUV.x-0.5)*2.0;distanceToEdge.y=abs(vUV.y-0.5)*2.0;float borderValue=max(smoothstep(scaleInfo.x-edgeSmoothingValue,scaleInfo.x+edgeSmoothingValue,distanceToEdge.x), +smoothstep(scaleInfo.y-edgeSmoothingValue,scaleInfo.y+edgeSmoothingValue,distanceToEdge.y));borderColor=borderColor*borderValue*max(borderMinValue*inverseBorderPower,pointToHover); +albedo+=borderColor;alpha=max(alpha,borderValue); +#endif +#ifdef INNERGLOW +vec2 uvGlow=(vUV-vec2(0.5,0.5))*(innerGlowColor.a*2.0);uvGlow=uvGlow*uvGlow;uvGlow=uvGlow*uvGlow;albedo+=mix(vec3(0.0,0.0,0.0),innerGlowColor.rgb,uvGlow.x+uvGlow.y); +#endif +gl_FragColor=vec4(albedo,alpha);}`; + ShaderStore.ShadersStore[name316] = shader314; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/fluent/fluentMaterial.js +class FluentMaterialDefines2 extends MaterialDefines { + constructor() { + super(); + this.INNERGLOW = false; + this.BORDER = false; + this.HOVERLIGHT = false; + this.TEXTURE = false; + this.rebuild(); + } +} + +class FluentMaterial2 extends PushMaterial { + constructor(name317, scene50) { + super(name317, scene50); + this.innerGlowColorIntensity = 0.5; + this.innerGlowColor = new Color3(1, 1, 1); + this.albedoColor = new Color3(0.3, 0.35, 0.4); + this.renderBorders = false; + this.borderWidth = 0.5; + this.edgeSmoothingValue = 0.02; + this.borderMinValue = 0.1; + this.renderHoverLight = false; + this.hoverRadius = 0.01; + this.hoverColor = new Color4(0.3, 0.3, 0.3, 1); + this.hoverPosition = Vector3.Zero(); + } + needAlphaBlending() { + return this.alpha !== 1; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh80, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new FluentMaterialDefines2; + } + const scene50 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!this.checkReadyOnEveryCall && subMesh11.effect) { + if (defines._renderId === scene50.getRenderId()) { + return true; + } + } + if (defines._areTexturesDirty) { + defines.INNERGLOW = this.innerGlowColorIntensity > 0; + defines.BORDER = this.renderBorders; + defines.HOVERLIGHT = this.renderHoverLight; + if (this._albedoTexture) { + if (!this._albedoTexture.isReadyOrNotBlocking()) { + return false; + } else { + defines.TEXTURE = true; + } + } else { + defines.TEXTURE = false; + } + } + const engine47 = scene50.getEngine(); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const attribs = [VertexBuffer.PositionKind]; + attribs.push(VertexBuffer.NormalKind); + attribs.push(VertexBuffer.UVKind); + const shaderName = "fluent"; + const uniforms2 = [ + "world", + "viewProjection", + "innerGlowColor", + "albedoColor", + "borderWidth", + "edgeSmoothingValue", + "scaleFactor", + "borderMinValue", + "hoverColor", + "hoverPosition", + "hoverRadius", + "textureMatrix" + ]; + const samplers = ["albedoSampler"]; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + const join = defines.toString(); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks: null, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh80, subMesh11) { + const scene50 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene50.getTransformMatrix()); + if (this._mustRebind(scene50, effect20)) { + this._activeEffect.setColor4("albedoColor", this.albedoColor, this.alpha); + if (defines.INNERGLOW) { + this._activeEffect.setColor4("innerGlowColor", this.innerGlowColor, this.innerGlowColorIntensity); + } + if (defines.BORDER) { + this._activeEffect.setFloat("borderWidth", this.borderWidth); + this._activeEffect.setFloat("edgeSmoothingValue", this.edgeSmoothingValue); + this._activeEffect.setFloat("borderMinValue", this.borderMinValue); + mesh80.getBoundingInfo().boundingBox.extendSize.multiplyToRef(mesh80.scaling, TmpVectors.Vector3[0]); + this._activeEffect.setVector3("scaleFactor", TmpVectors.Vector3[0]); + } + if (defines.HOVERLIGHT) { + this._activeEffect.setDirectColor4("hoverColor", this.hoverColor); + this._activeEffect.setFloat("hoverRadius", this.hoverRadius); + this._activeEffect.setVector3("hoverPosition", this.hoverPosition); + } + if (defines.TEXTURE && this._albedoTexture) { + this._activeEffect.setTexture("albedoSampler", this._albedoTexture); + const matrix = this._albedoTexture.getTextureMatrix(); + this._activeEffect.setMatrix("textureMatrix", matrix); + } + } + this._afterBind(mesh80, this._activeEffect); + } + getActiveTextures() { + const activeTextures = super.getActiveTextures(); + return activeTextures; + } + hasTexture(texture93) { + if (super.hasTexture(texture93)) { + return true; + } + return false; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + } + clone(name317) { + return SerializationHelper.Clone(() => new FluentMaterial2(name317, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.GUI.FluentMaterial"; + return serializationObject; + } + getClassName() { + return "FluentMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new FluentMaterial2(source.name, scene50), source, scene50, rootUrl); + } +} +var init_fluentMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_buffer(); + init_typeStore(); + init_math_color(); + init_fluent_vertex(); + init_fluent_fragment(); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], FluentMaterial2.prototype, "innerGlowColorIntensity", undefined); + __decorate2([ + serializeAsColor3() + ], FluentMaterial2.prototype, "innerGlowColor", undefined); + __decorate2([ + serializeAsColor3() + ], FluentMaterial2.prototype, "albedoColor", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], FluentMaterial2.prototype, "renderBorders", undefined); + __decorate2([ + serialize() + ], FluentMaterial2.prototype, "borderWidth", undefined); + __decorate2([ + serialize() + ], FluentMaterial2.prototype, "edgeSmoothingValue", undefined); + __decorate2([ + serialize() + ], FluentMaterial2.prototype, "borderMinValue", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], FluentMaterial2.prototype, "renderHoverLight", undefined); + __decorate2([ + serialize() + ], FluentMaterial2.prototype, "hoverRadius", undefined); + __decorate2([ + serializeAsColor4() + ], FluentMaterial2.prototype, "hoverColor", undefined); + __decorate2([ + serializeAsVector3() + ], FluentMaterial2.prototype, "hoverPosition", undefined); + __decorate2([ + serializeAsTexture("albedoTexture") + ], FluentMaterial2.prototype, "_albedoTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") + ], FluentMaterial2.prototype, "albedoTexture", undefined); + RegisterClass("BABYLON.GUI.FluentMaterial", FluentMaterial2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/touchHolographicMenu.js +class TouchHolographicMenu2 extends VolumeBasedPanel2 { + get backPlateMargin() { + return this._backPlateMargin; + } + set backPlateMargin(value) { + this._backPlateMargin = value; + if (this._children.length >= 1) { + this.children.forEach((control47) => { + this._updateCurrentMinMax(control47.position); + }); + this._updateMargins(); + } + } + _createNode(scene50) { + const node30 = new Mesh(`menu_${this.name}`, scene50); + this._backPlate = CreateBox("backPlate" + this.name, { size: 1 }, scene50); + this._backPlate.parent = node30; + return node30; + } + _affectMaterial(mesh81) { + this._backPlateMaterial = new FluentMaterial2(this.name + "backPlateMaterial", mesh81.getScene()); + this._backPlateMaterial.albedoColor = new Color3(0.08, 0.15, 0.55); + this._backPlateMaterial.renderBorders = true; + this._backPlateMaterial.renderHoverLight = true; + this._pickedPointObserver = this._host.onPickedPointChangedObservable.add((pickedPoint) => { + if (pickedPoint) { + this._backPlateMaterial.hoverPosition = pickedPoint; + this._backPlateMaterial.hoverColor.a = 1; + } else { + this._backPlateMaterial.hoverColor.a = 0; + } + }); + this._backPlate.material = this._backPlateMaterial; + } + _mapGridNode(control47, nodePosition) { + const mesh81 = control47.mesh; + if (!mesh81) { + return; + } + control47.position = nodePosition.clone(); + this._updateCurrentMinMax(nodePosition); + } + _finalProcessing() { + this._updateMargins(); + } + _updateCurrentMinMax(nodePosition) { + if (!this._currentMin) { + this._currentMin = nodePosition.clone(); + this._currentMax = nodePosition.clone(); + } + this._currentMin.minimizeInPlace(nodePosition); + this._currentMax.maximizeInPlace(nodePosition); + } + _updateMargins() { + if (this._children.length > 0) { + this._currentMin.addInPlaceFromFloats(-this._cellWidth / 2, -this._cellHeight / 2, 0); + this._currentMax.addInPlaceFromFloats(this._cellWidth / 2, this._cellHeight / 2, 0); + const extendSize = this._currentMax.subtract(this._currentMin); + this._backPlate.scaling.x = extendSize.x + this._cellWidth * this.backPlateMargin; + this._backPlate.scaling.y = extendSize.y + this._cellHeight * this.backPlateMargin; + this._backPlate.scaling.z = 0.001; + for (let i = 0;i < this._children.length; i++) { + this._children[i].position.subtractInPlace(this._currentMin).subtractInPlace(extendSize.scale(0.5)); + this._children[i].position.z -= 0.01; + } + } + this._currentMin = null; + this._currentMax = null; + } + constructor(name317) { + super(name317); + this._backPlateMargin = 1.25; + } + addButton(button9) { + const wasLayoutBlocked = this.blockLayout; + if (!wasLayoutBlocked) { + this.blockLayout = true; + } + super.addControl(button9); + button9.isBackplateVisible = false; + button9.scaling.scaleInPlace(TouchHolographicMenu2.MENU_BUTTON_SCALE); + if (!wasLayoutBlocked) { + this.blockLayout = false; + } + return this; + } + addControl(_control) { + Logger.Warn("TouchHolographicMenu can only contain buttons. Please use the method `addButton` instead."); + return this; + } + dispose() { + super.dispose(); + this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver); + } +} +var init_touchHolographicMenu = __esm(() => { + init_volumeBasedPanel(); + init_mesh(); + init_boxBuilder(); + init_fluentMaterial(); + init_math_color(); + init_logger(); + TouchHolographicMenu2.MENU_BUTTON_SCALE = 1; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/handMenu.js +class HandMenu extends TouchHolographicMenu2 { + get handConstraintBehavior() { + return this._handConstraintBehavior; + } + _createNode(scene50) { + const node30 = super._createNode(scene50); + this._handConstraintBehavior.attach(node30); + return node30; + } + constructor(xr, name317) { + super(name317); + this._handConstraintBehavior = new HandConstraintBehavior; + this._handConstraintBehavior.linkToXRExperience(xr); + this.backPlateMargin = 0.15; + this.rows = 3; + } + dispose() { + super.dispose(); + this._handConstraintBehavior.detach(); + } +} +var init_handMenu = __esm(() => { + init_touchHolographicMenu(); + init_handConstraintBehavior(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js +var name317, shader315; +var init_fluentBackplate_fragment = __esm(() => { + init_shaderStore(); + name317 = "fluentBackplatePixelShader"; + shader315 = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform float _Angle_;uniform float _Fade_Out_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform sampler2D _Iridescent_Map_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;void Round_Rect_Fragment_B31( +float Radius, +float Line_Width, +vec4 Line_Color, +float Filter_Width, +vec2 UV, +float Line_Visibility, +vec4 Rect_Parms, +vec4 Fill_Color, +out vec4 Color) +{float d=length(max(abs(UV)-Rect_Parms.xy,0.0));float dx=max(fwidth(d)*Filter_Width,0.00001);float g=min(Rect_Parms.z,Rect_Parms.w);float dgrad=max(fwidth(g)*Filter_Width,0.00001);float Inside_Rect=clamp(g/dgrad,0.0,1.0);float inner=clamp((d+dx*0.5-max(Radius-Line_Width,d-dx*0.5))/dx,0.0,1.0);Color=clamp(mix(Fill_Color,Line_Color,inner),0.0,1.0)*Inside_Rect;} +void Blob_Fragment_B71( +sampler2D Blob_Texture, +vec4 Blob_Info1, +vec4 Blob_Info2, +out vec4 Blob_Color) +{float k1=dot(Blob_Info1.xy,Blob_Info1.xy);float k2=dot(Blob_Info2.xy,Blob_Info2.xy);vec3 closer=k1 { + init_shaderStore(); + name318 = "fluentBackplateVertexShader"; + shader316 = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal; +#ifdef TANGENT +attribute vec3 tangent; +#else +const vec3 tangent=vec3(0.); +#endif +uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform float _Angle_;uniform float _Fade_Out_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform sampler2D _Iridescent_Map_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Object_To_World_Pos_B115( +vec3 Pos_Object, +out vec3 Pos_World) +{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;} +void PickDir_B140( +float Degrees, +vec3 DirX, +vec3 DirY, +out vec3 Dir) +{float a=Degrees*3.14159/180.0;Dir=cos(a)*DirX+sin(a)*DirY;} +void Round_Rect_Vertex_B139( +vec2 UV, +float Radius, +float Margin, +float Anisotropy, +float Gradient1, +float Gradient2, +out vec2 Rect_UV, +out vec4 Rect_Parms, +out vec2 Scale_XY, +out vec2 Line_UV) +{Scale_XY=vec2(Anisotropy,1.0);Line_UV=(UV-vec2(0.5,0.5));Rect_UV=Line_UV*Scale_XY;Rect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius)-vec2(Margin,Margin);Rect_Parms.z=Gradient1; +Rect_Parms.w=Gradient2;} +void Line_Vertex_B135( +vec2 Scale_XY, +vec2 UV, +float Time, +float Rate, +vec4 Highlight_Transform, +out vec3 Line_Vertex) +{float angle2=(Rate*Time)*2.0*3.1416;float sinAngle2=sin(angle2);float cosAngle2=cos(angle2);vec2 xformUV=UV*Highlight_Transform.xy+Highlight_Transform.zw;Line_Vertex.x=0.0;Line_Vertex.y=cosAngle2*xformUV.x-sinAngle2*xformUV.y;Line_Vertex.z=0.0; } +void Blob_Vertex_B180( +vec3 Position, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +vec3 Blob_Position, +float Intensity, +float Blob_Near_Size, +float Blob_Far_Size, +float Blob_Near_Distance, +float Blob_Far_Distance, +float Blob_Fade_Length, +float Blob_Pulse, +float Blob_Fade, +out vec4 Blob_Info) +{vec3 blob=Blob_Position;vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);} +void Move_Verts_B129( +float Anisotropy, +vec3 P, +float Radius, +out vec3 New_P, +out vec2 New_UV, +out float Radial_Gradient, +out vec3 Radial_Dir) +{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);New_UV=center+r2*(UV-2.0*center+0.5);New_P=vec3(New_UV-0.5,P.z);Radial_Gradient=1.0-length(delta)*2.0;Radial_Dir=vec3(delta*r2,0.0);} +void Object_To_World_Dir_B132( +vec3 Dir_Object, +out vec3 Binormal_World, +out vec3 Binormal_World_N, +out float Binormal_Length) +{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;} +void RelativeOrAbsoluteDetail_B147( +float Nominal_Radius, +float Nominal_LineWidth, +bool Absolute_Measurements, +float Height, +out float Radius, +out float Line_Width) +{float scale=Absolute_Measurements ? 1.0/Height : 1.0;Radius=Nominal_Radius*scale;Line_Width=Nominal_LineWidth*scale;} +void Edge_AA_Vertex_B130( +vec3 Position_World, +vec3 Position_Object, +vec3 Normal_Object, +vec3 Eye, +float Radial_Gradient, +vec3 Radial_Dir, +vec3 Tangent, +out float Gradient1, +out float Gradient2) +{vec3 I=(Eye-Position_World);vec3 T=(world* vec4(Tangent,0.0)).xyz;float g=(dot(T,I)<0.0) ? 0.0 : 1.0;if (Normal_Object.z==0.0) { +Gradient1=Position_Object.z>0.0 ? g : 1.0;Gradient2=Position_Object.z>0.0 ? 1.0 : g;} else {Gradient1=g+(1.0-g)*(Radial_Gradient);Gradient2=1.0;}} +void Pick_Radius_B144( +float Radius, +float Radius_Top_Left, +float Radius_Top_Right, +float Radius_Bottom_Left, +float Radius_Bottom_Right, +vec3 Position, +out float Result) +{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;} +void main() +{vec3 Nrm_World_Q128;Nrm_World_Q128=normalize((world*vec4(normal,0.0)).xyz);vec3 Tangent_World_Q131;vec3 Tangent_World_N_Q131;float Tangent_Length_Q131;Tangent_World_Q131=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q131=length(Tangent_World_Q131);Tangent_World_N_Q131=Tangent_World_Q131/Tangent_Length_Q131;vec3 Binormal_World_Q132;vec3 Binormal_World_N_Q132;float Binormal_Length_Q132;Object_To_World_Dir_B132(vec3(0,1,0),Binormal_World_Q132,Binormal_World_N_Q132,Binormal_Length_Q132);float Anisotropy_Q133=Tangent_Length_Q131/Binormal_Length_Q132;vec3 Result_Q177;Result_Q177=mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(_Use_Global_Left_Index_));vec3 Result_Q178;Result_Q178=mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(_Use_Global_Right_Index_));float Result_Q144;Pick_Radius_B144(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q144);vec3 Dir_Q140;PickDir_B140(_Angle_,Tangent_World_N_Q131,Binormal_World_N_Q132,Dir_Q140);float Radius_Q147;float Line_Width_Q147;RelativeOrAbsoluteDetail_B147(Result_Q144,_Line_Width_,_Absolute_Sizes_,Binormal_Length_Q132,Radius_Q147,Line_Width_Q147);vec4 Out_Color_Q145=vec4(Radius_Q147,Line_Width_Q147,0,1);vec3 New_P_Q129;vec2 New_UV_Q129;float Radial_Gradient_Q129;vec3 Radial_Dir_Q129;Move_Verts_B129(Anisotropy_Q133,position,Radius_Q147,New_P_Q129,New_UV_Q129,Radial_Gradient_Q129,Radial_Dir_Q129);vec3 Pos_World_Q115;Object_To_World_Pos_B115(New_P_Q129,Pos_World_Q115);vec4 Blob_Info_Q180; +#if BLOB_ENABLE +Blob_Vertex_B180(Pos_World_Q115,Nrm_World_Q128,Tangent_World_N_Q131,Binormal_World_N_Q132,Result_Q177,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q180); +#else +Blob_Info_Q180=vec4(0,0,0,0); +#endif +vec4 Blob_Info_Q181; +#if BLOB_ENABLE_2 +Blob_Vertex_B180(Pos_World_Q115,Nrm_World_Q128,Tangent_World_N_Q131,Binormal_World_N_Q132,Result_Q178,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q181); +#else +Blob_Info_Q181=vec4(0,0,0,0); +#endif +float Gradient1_Q130;float Gradient2_Q130; +#if SMOOTH_EDGES +Edge_AA_Vertex_B130(Pos_World_Q115,position,normal,cameraPosition,Radial_Gradient_Q129,Radial_Dir_Q129,tangent,Gradient1_Q130,Gradient2_Q130); +#else +Gradient1_Q130=1.0;Gradient2_Q130=1.0; +#endif +vec2 Rect_UV_Q139;vec4 Rect_Parms_Q139;vec2 Scale_XY_Q139;vec2 Line_UV_Q139;Round_Rect_Vertex_B139(New_UV_Q129,Radius_Q147,0.0,Anisotropy_Q133,Gradient1_Q130,Gradient2_Q130,Rect_UV_Q139,Rect_Parms_Q139,Scale_XY_Q139,Line_UV_Q139);vec3 Line_Vertex_Q135;Line_Vertex_B135(Scale_XY_Q139,Line_UV_Q139,0.0,_Rate_,_Highlight_Transform_,Line_Vertex_Q135);vec3 Position=Pos_World_Q115;vec3 Normal=Dir_Q140;vec2 UV=Rect_UV_Q139;vec3 Tangent=Line_Vertex_Q135;vec3 Binormal=Nrm_World_Q128;vec4 Color=Out_Color_Q145;vec4 Extra1=Rect_Parms_Q139;vec4 Extra2=Blob_Info_Q180;vec4 Extra3=Blob_Info_Q181;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}`; + ShaderStore.ShadersStore[name318] = shader316; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/fluentBackplate/fluentBackplateMaterial.js +class FluentBackplateMaterialDefines2 extends MaterialDefines { + constructor() { + super(); + this.BLOB_ENABLE = true; + this.BLOB_ENABLE_2 = true; + this.SMOOTH_EDGES = true; + this.IRIDESCENT_MAP_ENABLE = true; + this._needNormals = true; + this.rebuild(); + } +} + +class FluentBackplateMaterial2 extends PushMaterial { + constructor(name319, scene50) { + super(name319, scene50); + this.radius = 0.03; + this.lineWidth = 0.01; + this.absoluteSizes = false; + this._filterWidth = 1; + this.baseColor = new Color4(0.0392157, 0.0666667, 0.207843, 1); + this.lineColor = new Color4(0.14902, 0.133333, 0.384314, 1); + this.blobIntensity = 0.98; + this.blobFarSize = 0.04; + this.blobNearDistance = 0; + this.blobFarDistance = 0.08; + this.blobFadeLength = 0.08; + this.blobNearSize = 0.22; + this.blobPulse = 0; + this.blobFade = 0; + this.blobNearSize2 = 0.22; + this.blobPulse2 = 0; + this.blobFade2 = 0; + this._rate = 0.135; + this.highlightColor = new Color4(0.98, 0.98, 0.98, 1); + this.highlightWidth = 0.25; + this._highlightTransform = new Vector4(1, 1, 0, 0); + this._highlight = 1; + this.iridescenceIntensity = 0; + this.iridescenceEdgeIntensity = 1; + this._angle = -45; + this.fadeOut = 1; + this._reflected = true; + this._frequency = 1; + this._verticalOffset = 0; + this.globalLeftIndexTipPosition = Vector3.Zero(); + this._globalLeftIndexTipPosition4 = Vector4.Zero(); + this.globalRightIndexTipPosition = Vector3.Zero(); + this._globalRightIndexTipPosition4 = Vector4.Zero(); + this.alphaMode = Constants.ALPHA_DISABLE; + this.backFaceCulling = false; + this._blobTexture = new Texture(FluentBackplateMaterial2.BLOB_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE); + this._iridescentMap = new Texture(FluentBackplateMaterial2.IM_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE); + } + needAlphaBlending() { + return false; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh81, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new FluentBackplateMaterialDefines2; + } + const defines = subMesh11.materialDefines; + const scene50 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene50.getEngine(); + MaterialHelper.PrepareDefinesForAttributes(mesh81, defines, false, false); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + defines.IMAGEPROCESSINGPOSTPROCESS = scene50.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + if (defines.TANGENT) { + attribs.push(VertexBuffer.TangentKind); + } + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "fluentBackplate"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "viewProjection", + "cameraPosition", + "_Radius_", + "_Line_Width_", + "_Absolute_Sizes_", + "_Filter_Width_", + "_Base_Color_", + "_Line_Color_", + "_Radius_Top_Left_", + "_Radius_Top_Right_", + "_Radius_Bottom_Left_", + "_Radius_Bottom_Right_", + "_Blob_Position_", + "_Blob_Intensity_", + "_Blob_Near_Size_", + "_Blob_Far_Size_", + "_Blob_Near_Distance_", + "_Blob_Far_Distance_", + "_Blob_Fade_Length_", + "_Blob_Pulse_", + "_Blob_Fade_", + "_Blob_Texture_", + "_Blob_Position_2_", + "_Blob_Near_Size_2_", + "_Blob_Pulse_2_", + "_Blob_Fade_2_", + "_Rate_", + "_Highlight_Color_", + "_Highlight_Width_", + "_Highlight_Transform_", + "_Highlight_", + "_Iridescence_Intensity_", + "_Iridescence_Edge_Intensity_", + "_Angle_", + "_Fade_Out_", + "_Reflected_", + "_Frequency_", + "_Vertical_Offset_", + "_Iridescent_Map_", + "_Use_Global_Left_Index_", + "_Use_Global_Right_Index_", + "Global_Left_Index_Tip_Position", + "Global_Right_Index_Tip_Position" + ]; + const samplers = ["_Blob_Texture_", "_Iridescent_Map_"]; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh81, subMesh11) { + var _a, _b; + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix()); + this._activeEffect.setVector3("cameraPosition", (_b = (_a = this.getScene().activeCamera) === null || _a === undefined ? undefined : _a.position) !== null && _b !== undefined ? _b : Vector3.ZeroReadOnly); + this._activeEffect.setFloat("_Radius_", this.radius); + this._activeEffect.setFloat("_Line_Width_", this.lineWidth); + this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1 : 0); + this._activeEffect.setFloat("_Filter_Width_", this._filterWidth); + this._activeEffect.setDirectColor4("_Base_Color_", this.baseColor); + this._activeEffect.setDirectColor4("_Line_Color_", this.lineColor); + this._activeEffect.setFloat("_Radius_Top_Left_", 1); + this._activeEffect.setFloat("_Radius_Top_Right_", 1); + this._activeEffect.setFloat("_Radius_Bottom_Left_", 1); + this._activeEffect.setFloat("_Radius_Bottom_Right_", 1); + this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity); + this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize); + this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize); + this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance); + this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance); + this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength); + this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse); + this._activeEffect.setFloat("_Blob_Fade_", this.blobFade); + this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture); + this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2); + this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2); + this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2); + this._activeEffect.setFloat("_Rate_", this._rate); + this._activeEffect.setDirectColor4("_Highlight_Color_", this.highlightColor); + this._activeEffect.setFloat("_Highlight_Width_", this.highlightWidth); + this._activeEffect.setVector4("_Highlight_Transform_", this._highlightTransform); + this._activeEffect.setFloat("_Highlight_", this._highlight); + this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity); + this._activeEffect.setFloat("_Iridescence_Edge_Intensity_", this.iridescenceEdgeIntensity); + this._activeEffect.setFloat("_Angle_", this._angle); + this._activeEffect.setFloat("_Fade_Out_", this.fadeOut); + this._activeEffect.setFloat("_Reflected_", this._reflected ? 1 : 0); + this._activeEffect.setFloat("_Frequency_", this._frequency); + this._activeEffect.setFloat("_Vertical_Offset_", this._verticalOffset); + this._activeEffect.setTexture("_Iridescent_Map_", this._iridescentMap); + this._activeEffect.setFloat("_Use_Global_Left_Index_", 1); + this._activeEffect.setFloat("_Use_Global_Right_Index_", 1); + this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1); + this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this._globalLeftIndexTipPosition4); + this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1); + this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this._globalRightIndexTipPosition4); + this._afterBind(mesh81, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + this._blobTexture.dispose(); + this._iridescentMap.dispose(); + } + clone(name319) { + return SerializationHelper.Clone(() => new FluentBackplateMaterial2(name319, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.FluentBackplateMaterial"; + return serializationObject; + } + getClassName() { + return "FluentBackplateMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new FluentBackplateMaterial2(source.name, scene50), source, scene50, rootUrl); + } +} +var init_fluentBackplateMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_texture(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_buffer(); + init_typeStore(); + init_math_color(); + init_effectFallbacks(); + init_constants(); + init_fluentBackplate_fragment(); + init_fluentBackplate_vertex(); + FluentBackplateMaterial2.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-blob.png"; + FluentBackplateMaterial2.IM_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-iridescence.png"; + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "radius", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "lineWidth", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "absoluteSizes", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "baseColor", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "lineColor", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "blobIntensity", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "blobFarSize", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "blobNearDistance", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "blobFarDistance", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "blobFadeLength", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "blobNearSize", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "blobPulse", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "blobFade", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "blobNearSize2", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "blobPulse2", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "blobFade2", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "highlightColor", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "highlightWidth", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "iridescenceIntensity", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "iridescenceEdgeIntensity", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial2.prototype, "fadeOut", undefined); + __decorate2([ + serializeAsVector3() + ], FluentBackplateMaterial2.prototype, "globalLeftIndexTipPosition", undefined); + __decorate2([ + serializeAsVector3() + ], FluentBackplateMaterial2.prototype, "globalRightIndexTipPosition", undefined); + RegisterClass("BABYLON.GUI.FluentBackplateMaterial", FluentBackplateMaterial2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/holographicBackplate.js +class HolographicBackplate2 extends Control3D2 { + set renderingGroupId(id) { + this._model.renderingGroupId = id; + } + get renderingGroupId() { + return this._model.renderingGroupId; + } + get material() { + return this._material; + } + get shareMaterials() { + return this._shareMaterials; + } + constructor(name319, _shareMaterials = true) { + super(name319); + this._shareMaterials = _shareMaterials; + } + _getTypeName() { + return "HolographicBackplate"; + } + _createNode(scene50) { + var _a; + const collisionMesh = CreateBox(((_a = this.name) !== null && _a !== undefined ? _a : "HolographicBackplate") + "_CollisionMesh", { + width: 1, + height: 1, + depth: 1 + }, scene50); + collisionMesh.isPickable = true; + collisionMesh.visibility = 0; + SceneLoader.ImportMeshAsync(undefined, HolographicBackplate2.MODEL_BASE_URL, HolographicBackplate2.MODEL_FILENAME, scene50).then((result) => { + const importedModel = result.meshes[1]; + importedModel.name = `${this.name}_frontPlate`; + importedModel.isPickable = false; + importedModel.parent = collisionMesh; + if (this._material) { + importedModel.material = this._material; + } + this._model = importedModel; + }); + return collisionMesh; + } + _createMaterial(mesh81) { + this._material = new FluentBackplateMaterial2(this.name + " Material", mesh81.getScene()); + } + _affectMaterial(mesh81) { + if (this._shareMaterials) { + if (!this._host._touchSharedMaterials["fluentBackplateMaterial"]) { + this._createMaterial(mesh81); + this._host._touchSharedMaterials["fluentBackplateMaterial"] = this._material; + } else { + this._material = this._host._touchSharedMaterials["fluentBackplateMaterial"]; + } + } else { + this._createMaterial(mesh81); + } + } + dispose() { + super.dispose(); + if (!this.shareMaterials) { + this._material.dispose(); + } + this._model.dispose(); + } +} +var init_holographicBackplate = __esm(() => { + init_boxBuilder(); + init_fluentBackplateMaterial(); + init_control3D(); + init_sceneLoader(); + HolographicBackplate2.MODEL_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/"; + HolographicBackplate2.MODEL_FILENAME = "mrtk-fluent-backplate.glb"; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/holographicButton.js +class HolographicButton extends Button3D2 { + _disposeTooltip() { + this._tooltipFade = null; + if (this._tooltipTextBlock) { + this._tooltipTextBlock.dispose(); + } + if (this._tooltipTexture) { + this._tooltipTexture.dispose(); + } + if (this._tooltipMesh) { + this._tooltipMesh.dispose(); + } + this.onPointerEnterObservable.remove(this._tooltipHoverObserver); + this.onPointerOutObservable.remove(this._tooltipOutObserver); + } + set renderingGroupId(id) { + this._backPlate.renderingGroupId = id; + this._textPlate.renderingGroupId = id; + this._frontPlate.renderingGroupId = id; + if (this._tooltipMesh) { + this._tooltipMesh.renderingGroupId = id; + } + } + get renderingGroupId() { + return this._backPlate.renderingGroupId; + } + set tooltipText(text) { + if (!text) { + this._disposeTooltip(); + return; + } + if (!this._tooltipFade) { + const rightHandedScene = this._backPlate._scene.useRightHandedSystem; + this._tooltipMesh = CreatePlane("", { size: 1 }, this._backPlate._scene); + const tooltipBackground = CreatePlane("", { size: 1, sideOrientation: Mesh.DOUBLESIDE }, this._backPlate._scene); + const mat = new StandardMaterial("", this._backPlate._scene); + mat.diffuseColor = Color3.FromHexString("#212121"); + tooltipBackground.material = mat; + tooltipBackground.isPickable = false; + this._tooltipMesh.addChild(tooltipBackground); + tooltipBackground.position = Vector3.Forward(rightHandedScene).scale(0.05); + this._tooltipMesh.scaling.y = 1 / 3; + this._tooltipMesh.position = Vector3.Up().scale(0.7).add(Vector3.Forward(rightHandedScene).scale(-0.15)); + this._tooltipMesh.isPickable = false; + this._tooltipMesh.parent = this._backPlate; + this._tooltipTexture = AdvancedDynamicTexture2.CreateForMesh(this._tooltipMesh); + this._tooltipTextBlock = new TextBlock2; + this._tooltipTextBlock.scaleY = 3; + this._tooltipTextBlock.color = "white"; + this._tooltipTextBlock.fontSize = 130; + this._tooltipTexture.addControl(this._tooltipTextBlock); + this._tooltipFade = new FadeInOutBehavior; + this._tooltipFade.delay = 500; + this._tooltipMesh.addBehavior(this._tooltipFade); + this._tooltipHoverObserver = this.onPointerEnterObservable.add(() => { + if (this._tooltipFade) { + this._tooltipFade.fadeIn(true); + } + }); + this._tooltipOutObserver = this.onPointerOutObservable.add(() => { + if (this._tooltipFade) { + this._tooltipFade.fadeIn(false); + } + }); + } + if (this._tooltipTextBlock) { + this._tooltipTextBlock.text = text; + } + } + get tooltipText() { + if (this._tooltipTextBlock) { + return this._tooltipTextBlock.text; + } + return null; + } + get text() { + return this._text; + } + set text(value) { + if (this._text === value) { + return; + } + this._text = value; + this._rebuildContent(); + } + get imageUrl() { + return this._imageUrl; + } + set imageUrl(value) { + if (this._imageUrl === value) { + return; + } + this._imageUrl = value; + this._rebuildContent(); + } + get backMaterial() { + return this._backMaterial; + } + get frontMaterial() { + return this._frontMaterial; + } + get plateMaterial() { + return this._plateMaterial; + } + get shareMaterials() { + return this._shareMaterials; + } + constructor(name319, shareMaterials = true) { + super(name319); + this._shareMaterials = true; + this._shareMaterials = shareMaterials; + this.pointerEnterAnimation = () => { + if (!this.mesh) { + return; + } + this._frontPlate.setEnabled(true); + }; + this.pointerOutAnimation = () => { + if (!this.mesh) { + return; + } + this._frontPlate.setEnabled(false); + }; + } + _getTypeName() { + return "HolographicButton"; + } + _rebuildContent() { + this._disposeFacadeTexture(); + const panel = new StackPanel2; + panel.isVertical = true; + if (IsDocumentAvailable() && !!document.createElement) { + if (this._imageUrl) { + const image11 = new Image3; + image11.source = this._imageUrl; + image11.paddingTop = "40px"; + image11.height = "180px"; + image11.width = "100px"; + image11.paddingBottom = "40px"; + panel.addControl(image11); + } + } + if (this._text) { + const text = new TextBlock2; + text.text = this._text; + text.color = "white"; + text.height = "30px"; + text.fontSize = 24; + panel.addControl(text); + } + if (this._frontPlate) { + this.content = panel; + } + } + _createNode(scene50) { + this._backPlate = CreateBox(this.name + "BackMesh", { + width: 1, + height: 1, + depth: 0.08 + }, scene50); + this._frontPlate = CreateBox(this.name + "FrontMesh", { + width: 1, + height: 1, + depth: 0.08 + }, scene50); + this._frontPlate.parent = this._backPlate; + this._frontPlate.position = Vector3.Forward(scene50.useRightHandedSystem).scale(-0.08); + this._frontPlate.isPickable = false; + this._frontPlate.setEnabled(false); + this._textPlate = super._createNode(scene50); + this._textPlate.parent = this._backPlate; + this._textPlate.position = Vector3.Forward(scene50.useRightHandedSystem).scale(-0.08); + this._textPlate.isPickable = false; + return this._backPlate; + } + _applyFacade(facadeTexture) { + this._plateMaterial.emissiveTexture = facadeTexture; + this._plateMaterial.opacityTexture = facadeTexture; + } + _createBackMaterial(mesh82) { + this._backMaterial = new FluentMaterial2(this.name + "Back Material", mesh82.getScene()); + this._backMaterial.renderHoverLight = true; + this._pickedPointObserver = this._host.onPickedPointChangedObservable.add((pickedPoint) => { + if (pickedPoint) { + this._backMaterial.hoverPosition = pickedPoint; + this._backMaterial.hoverColor.a = 1; + } else { + this._backMaterial.hoverColor.a = 0; + } + }); + } + _createFrontMaterial(mesh82) { + this._frontMaterial = new FluentMaterial2(this.name + "Front Material", mesh82.getScene()); + this._frontMaterial.innerGlowColorIntensity = 0; + this._frontMaterial.alpha = 0.5; + this._frontMaterial.renderBorders = true; + } + _createPlateMaterial(mesh82) { + this._plateMaterial = new StandardMaterial(this.name + "Plate Material", mesh82.getScene()); + this._plateMaterial.specularColor = Color3.Black(); + } + _affectMaterial(mesh82) { + if (this._shareMaterials) { + if (!this._host._sharedMaterials["backFluentMaterial"]) { + this._createBackMaterial(mesh82); + this._host._sharedMaterials["backFluentMaterial"] = this._backMaterial; + } else { + this._backMaterial = this._host._sharedMaterials["backFluentMaterial"]; + } + if (!this._host._sharedMaterials["frontFluentMaterial"]) { + this._createFrontMaterial(mesh82); + this._host._sharedMaterials["frontFluentMaterial"] = this._frontMaterial; + } else { + this._frontMaterial = this._host._sharedMaterials["frontFluentMaterial"]; + } + } else { + this._createBackMaterial(mesh82); + this._createFrontMaterial(mesh82); + } + this._createPlateMaterial(mesh82); + this._backPlate.material = this._backMaterial; + this._frontPlate.material = this._frontMaterial; + this._textPlate.material = this._plateMaterial; + this._rebuildContent(); + } + dispose() { + super.dispose(); + this._disposeTooltip(); + if (!this.shareMaterials) { + this._backMaterial.dispose(); + this._frontMaterial.dispose(); + this._plateMaterial.dispose(); + if (this._pickedPointObserver) { + this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver); + this._pickedPointObserver = null; + } + } + } +} +var init_holographicButton = __esm(() => { + init_button3D(); + init_math_vector(); + init_standardMaterial(); + init_mesh(); + init_planeBuilder(); + init_boxBuilder(); + init_fadeInOutBehavior(); + init_fluentMaterial(); + init_stackPanel(); + init_image(); + init_textBlock(); + init_advancedDynamicTexture(); + init_math_color(); + init_domManagement(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/fluentButton/shaders/fluentButton.fragment.js +var name319, shader317; +var init_fluentButton_fragment = __esm(() => { + init_shaderStore(); + name319 = "fluentButtonPixelShader"; + shader317 = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;uniform float _Edge_Width_;uniform vec4 _Edge_Color_;uniform bool _Relative_Width_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Active_Face_Dir_;uniform vec3 _Active_Face_Up_;uniform bool Enable_Fade;uniform float _Fade_Width_;uniform bool _Smooth_Active_Face_;uniform bool _Show_Frame_;uniform bool _Use_Blob_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Holo_Edge_Fragment_B35( +vec4 Edges, +float Edge_Width, +out float NotEdge) +{vec2 c=vec2(min(Edges.r,Edges.g),min(Edges.b,Edges.a));vec2 df=fwidth(c)*Edge_Width;vec2 g=clamp(c/df,0.0,1.0);NotEdge=g.x*g.y;} +void Blob_Fragment_B39( +vec2 UV, +vec3 Blob_Info, +sampler2D Blob_Texture, +out vec4 Blob_Color) +{float k=dot(UV,UV);Blob_Color=Blob_Info.y*texture(Blob_Texture,vec2(vec2(sqrt(k),Blob_Info.x).x,1.0-vec2(sqrt(k),Blob_Info.x).y))*(1.0-clamp(k,0.0,1.0));} +vec2 FilterStep(vec2 Edge,vec2 X) +{vec2 dX=max(fwidth(X),vec2(0.00001,0.00001));return clamp( (X+dX-max(Edge,X-dX))/(dX*2.0),0.0,1.0);} +void Wireframe_Fragment_B59( +vec3 Widths, +vec2 UV, +float Proximity, +vec4 Edge_Color, +out vec4 Wireframe) +{vec2 c=min(UV,vec2(1.0,1.0)-UV);vec2 g=FilterStep(Widths.xy*0.5,c); +Wireframe=(1.0-min(g.x,g.y))*Proximity*Edge_Color;} +void Proximity_B53( +vec3 Proximity_Center, +vec3 Proximity_Center_2, +float Proximity_Max_Intensity, +float Proximity_Near_Radius, +vec3 Position, +vec3 Show_Selection, +vec4 Extra1, +float Dist_To_Face, +float Intensity, +out float Proximity) +{vec2 delta1=Extra1.xy;vec2 delta2=Extra1.zw;float d2=sqrt(min(dot(delta1,delta1),dot(delta2,delta2))+Dist_To_Face*Dist_To_Face);Proximity=Intensity*Proximity_Max_Intensity*(1.0-clamp(d2/Proximity_Near_Radius,0.0,1.0))*(1.0-Show_Selection.x)+Show_Selection.x;} +void To_XYZ_B46( +vec3 Vec3, +out float X, +out float Y, +out float Z) +{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;} +void main() +{float NotEdge_Q35; +#if ENABLE_FADE +Holo_Edge_Fragment_B35(vColor,_Fade_Width_,NotEdge_Q35); +#else +NotEdge_Q35=1.0; +#endif +vec4 Blob_Color_Q39;float k=dot(vUV,vUV);vec2 blobTextureCoord=vec2(vec2(sqrt(k),vTangent.x).x,1.0-vec2(sqrt(k),vTangent.x).y);vec4 blobColor=mix(vec4(1.0,1.0,1.0,1.0)*step(1.0-vTangent.x,clamp(sqrt(k)+0.1,0.0,1.0)),texture(_Blob_Texture_,blobTextureCoord),float(_Use_Blob_Texture_));Blob_Color_Q39=vTangent.y*blobColor*(1.0-clamp(k,0.0,1.0));float Is_Quad_Q24;Is_Quad_Q24=vNormal.z;vec3 Blob_Position_Q41= mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(Use_Global_Left_Index));vec3 Blob_Position_Q42= mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(Use_Global_Right_Index));float X_Q46;float Y_Q46;float Z_Q46;To_XYZ_B46(vBinormal,X_Q46,Y_Q46,Z_Q46);float Proximity_Q53;Proximity_B53(Blob_Position_Q41,Blob_Position_Q42,_Proximity_Max_Intensity_,_Proximity_Near_Radius_,vPosition,vBinormal,vExtra1,Y_Q46,Z_Q46,Proximity_Q53);vec4 Wireframe_Q59;Wireframe_Fragment_B59(vNormal,vUV,Proximity_Q53,_Edge_Color_,Wireframe_Q59);vec4 Wire_Or_Blob_Q23=mix(Wireframe_Q59,Blob_Color_Q39,Is_Quad_Q24);vec4 Result_Q22;Result_Q22=mix(Wire_Or_Blob_Q23,vec4(0.3,0.3,0.3,0.3),float(_Show_Frame_));vec4 Final_Color_Q37=NotEdge_Q35*Result_Q22;vec4 Out_Color=Final_Color_Q37;float Clip_Threshold=0.0;bool To_sRGB=false;gl_FragColor=Out_Color;}`; + ShaderStore.ShadersStore[name319] = shader317; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/fluentButton/shaders/fluentButton.vertex.js +var name320, shader318; +var init_fluentButton_vertex = __esm(() => { + init_shaderStore(); + name320 = "fluentButtonVertexShader"; + shader318 = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform float _Edge_Width_;uniform vec4 _Edge_Color_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Active_Face_Dir_;uniform vec3 _Active_Face_Up_;uniform bool _Enable_Fade_;uniform float _Fade_Width_;uniform bool _Smooth_Active_Face_;uniform bool _Show_Frame_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;void Blob_Vertex_B47( +vec3 Position, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +vec3 Blob_Position, +float Intensity, +float Blob_Near_Size, +float Blob_Far_Size, +float Blob_Near_Distance, +float Blob_Far_Distance, +vec4 Vx_Color, +vec2 UV, +vec3 Face_Center, +vec2 Face_Size, +vec2 In_UV, +float Blob_Fade_Length, +float Selection_Fade, +float Selection_Fade_Size, +float Inner_Fade, +vec3 Active_Face_Center, +float Blob_Pulse, +float Blob_Fade, +float Blob_Enabled, +out vec3 Out_Position, +out vec2 Out_UV, +out vec3 Blob_Info) +{float blobSize,fadeIn;vec3 Hit_Position;Blob_Info=vec3(0.0,0.0,0.0);float Hit_Distance=dot(Blob_Position-Face_Center,Normal);Hit_Position=Blob_Position-Hit_Distance*Normal;float absD=abs(Hit_Distance);float lerpVal=clamp((absD-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);fadeIn=1.0-clamp((absD-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float innerFade=1.0-clamp(-Hit_Distance/Inner_Fade,0.0,1.0);float farClip=clamp(1.0-step(Blob_Far_Distance+Blob_Fade_Length,absD),0.0,1.0);float size=mix(Blob_Near_Size,Blob_Far_Size,lerpVal)*farClip;blobSize=mix(size,Selection_Fade_Size,Selection_Fade)*innerFade*Blob_Enabled;Blob_Info.x=lerpVal*0.5+0.5;Blob_Info.y=fadeIn*Intensity*(1.0-Selection_Fade)*Blob_Fade;Blob_Info.x*=(1.0-Blob_Pulse);vec3 delta=Hit_Position-Face_Center;vec2 blobCenterXY=vec2(dot(delta,Tangent),dot(delta,Bitangent));vec2 quadUVin=2.0*UV-1.0; +vec2 blobXY=blobCenterXY+quadUVin*blobSize;vec2 blobClipped=clamp(blobXY,-Face_Size*0.5,Face_Size*0.5);vec2 blobUV=(blobClipped-blobCenterXY)/max(blobSize,0.0001)*2.0;vec3 blobCorner=Face_Center+blobClipped.x*Tangent+blobClipped.y*Bitangent;Out_Position=mix(Position,blobCorner,Vx_Color.rrr);Out_UV=mix(In_UV,blobUV,Vx_Color.rr);} +vec2 ProjectProximity( +vec3 blobPosition, +vec3 position, +vec3 center, +vec3 dir, +vec3 xdir, +vec3 ydir, +out float vdistance +) +{vec3 delta=blobPosition-position;vec2 xy=vec2(dot(delta,xdir),dot(delta,ydir));vdistance=abs(dot(delta,dir));return xy;} +void Proximity_Vertex_B66( +vec3 Blob_Position, +vec3 Blob_Position_2, +vec3 Active_Face_Center, +vec3 Active_Face_Dir, +vec3 Position, +float Proximity_Far_Distance, +float Relative_Scale, +float Proximity_Anisotropy, +vec3 Up, +out vec4 Extra1, +out float Distance_To_Face, +out float Intensity) +{vec3 Active_Face_Dir_X=normalize(cross(Active_Face_Dir,Up));vec3 Active_Face_Dir_Y=cross(Active_Face_Dir,Active_Face_Dir_X);float distz1,distz2;Extra1.xy=ProjectProximity(Blob_Position,Position,Active_Face_Center,Active_Face_Dir,Active_Face_Dir_X*Proximity_Anisotropy,Active_Face_Dir_Y,distz1)/Relative_Scale;Extra1.zw=ProjectProximity(Blob_Position_2,Position,Active_Face_Center,Active_Face_Dir,Active_Face_Dir_X*Proximity_Anisotropy,Active_Face_Dir_Y,distz2)/Relative_Scale;Distance_To_Face=dot(Active_Face_Dir,Position-Active_Face_Center);Intensity=1.0-clamp(min(distz1,distz2)/Proximity_Far_Distance,0.0,1.0);} +void Holo_Edge_Vertex_B44( +vec3 Incident, +vec3 Normal, +vec2 UV, +vec3 Tangent, +vec3 Bitangent, +bool Smooth_Active_Face, +float Active, +out vec4 Holo_Edges) +{float NdotI=dot(Incident,Normal);vec2 flip=(UV-vec2(0.5,0.5));float udot=dot(Incident,Tangent)*flip.x*NdotI;float uval=1.0-float(udot>0.0);float vdot=-dot(Incident,Bitangent)*flip.y*NdotI;float vval=1.0-float(vdot>0.0);float Smooth_And_Active=step(1.0,float(Smooth_Active_Face && Active>0.0));uval=mix(uval,max(1.0,uval),Smooth_And_Active); +vval=mix(vval,max(1.0,vval),Smooth_And_Active);Holo_Edges=vec4(1.0,1.0,1.0,1.0)-vec4(uval*UV.x,uval*(1.0-UV.x),vval*UV.y,vval*(1.0-UV.y));} +void Object_To_World_Pos_B13( +vec3 Pos_Object, +out vec3 Pos_World) +{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;} +void Choose_Blob_B38( +vec4 Vx_Color, +vec3 Position1, +vec3 Position2, +bool Blob_Enable_1, +bool Blob_Enable_2, +float Near_Size_1, +float Near_Size_2, +float Blob_Inner_Fade_1, +float Blob_Inner_Fade_2, +float Blob_Pulse_1, +float Blob_Pulse_2, +float Blob_Fade_1, +float Blob_Fade_2, +out vec3 Position, +out float Near_Size, +out float Inner_Fade, +out float Blob_Enable, +out float Fade, +out float Pulse) +{Position=Position1*(1.0-Vx_Color.g)+Vx_Color.g*Position2;float b1=float(Blob_Enable_1);float b2=float(Blob_Enable_2);Blob_Enable=b1+(b2-b1)*Vx_Color.g;Pulse=Blob_Pulse_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Pulse_2;Fade=Blob_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Fade_2;Near_Size=Near_Size_1*(1.0-Vx_Color.g)+Vx_Color.g*Near_Size_2;Inner_Fade=Blob_Inner_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Inner_Fade_2;} +void Wireframe_Vertex_B51( +vec3 Position, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +float Edge_Width, +vec2 Face_Size, +out vec3 Wire_Vx_Pos, +out vec2 UV, +out vec2 Widths) +{Widths.xy=Edge_Width/Face_Size;float x=dot(Position,Tangent);float y=dot(Position,Bitangent);float dx=0.5-abs(x);float newx=(0.5-dx*Widths.x*2.0)*sign(x);float dy=0.5-abs(y);float newy=(0.5-dy*Widths.y*2.0)*sign(y);Wire_Vx_Pos=Normal*0.5+newx*Tangent+newy*Bitangent;UV.x=dot(Wire_Vx_Pos,Tangent)+0.5;UV.y=dot(Wire_Vx_Pos,Bitangent)+0.5;} +vec2 ramp2(vec2 start,vec2 end,vec2 x) +{return clamp((x-start)/(end-start),vec2(0.0,0.0),vec2(1.0,1.0));} +float computeSelection( +vec3 blobPosition, +vec3 normal, +vec3 tangent, +vec3 bitangent, +vec3 faceCenter, +vec2 faceSize, +float selectionFuzz, +float farDistance, +float fadeLength +) +{vec3 delta=blobPosition-faceCenter;float absD=abs(dot(delta,normal));float fadeIn=1.0-clamp((absD-farDistance)/fadeLength,0.0,1.0);vec2 blobCenterXY=vec2(dot(delta,tangent),dot(delta,bitangent));vec2 innerFace=faceSize*(1.0-selectionFuzz)*0.5;vec2 selectPulse=ramp2(-faceSize*0.5,-innerFace,blobCenterXY)-ramp2(innerFace,faceSize*0.5,blobCenterXY);return selectPulse.x*selectPulse.y*fadeIn;} +void Selection_Vertex_B48( +vec3 Blob_Position, +vec3 Blob_Position_2, +vec3 Face_Center, +vec2 Face_Size, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +float Selection_Fuzz, +float Selected, +float Far_Distance, +float Fade_Length, +vec3 Active_Face_Dir, +out float Show_Selection) +{float select1=computeSelection(Blob_Position,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float select2=computeSelection(Blob_Position_2,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float Active=max(0.0,dot(Active_Face_Dir,Normal));Show_Selection=mix(max(select1,select2),1.0,Selected)*Active;} +void Proximity_Visibility_B54( +float Selection, +vec3 Proximity_Center, +vec3 Proximity_Center_2, +float Input_Width, +float Proximity_Far_Distance, +float Proximity_Radius, +vec3 Active_Face_Center, +vec3 Active_Face_Dir, +out float Width) +{vec3 boxEdges=(world*vec4(vec3(0.5,0.5,0.5),0.0)).xyz;float boxMaxSize=length(boxEdges);float d1=dot(Proximity_Center-Active_Face_Center,Active_Face_Dir);vec3 blob1=Proximity_Center-d1*Active_Face_Dir;float d2=dot(Proximity_Center_2-Active_Face_Center,Active_Face_Dir);vec3 blob2=Proximity_Center_2-d2*Active_Face_Dir;vec3 delta1=blob1-Active_Face_Center;vec3 delta2=blob2-Active_Face_Center;float dist1=dot(delta1,delta1);float dist2=dot(delta2,delta2);float nearestProxDist=sqrt(min(dist1,dist2));Width=Input_Width*(1.0-step(boxMaxSize+Proximity_Radius,nearestProxDist))*(1.0-step(Proximity_Far_Distance,min(d1,d2))*(1.0-step(0.0001,Selection)));} +void Object_To_World_Dir_B67( +vec3 Dir_Object, +out vec3 Dir_World) +{Dir_World=(world*vec4(Dir_Object,0.0)).xyz;} +void main() +{vec3 Active_Face_Center_Q49;Active_Face_Center_Q49=(world*vec4(_Active_Face_Dir_*0.5,1.0)).xyz;vec3 Blob_Position_Q41= mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(Use_Global_Left_Index));vec3 Blob_Position_Q42= mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(Use_Global_Right_Index));vec3 Active_Face_Dir_Q64=normalize((world*vec4(_Active_Face_Dir_,0.0)).xyz);float Relative_Scale_Q57; +#if RELATIVE_WIDTH +Relative_Scale_Q57=length((world*vec4(vec3(0,1,0),0.0)).xyz); +#else +Relative_Scale_Q57=1.0; +#endif +vec3 Tangent_World_Q30;Tangent_World_Q30=(world*vec4(tangent,0.0)).xyz;vec3 Binormal_World_Q31;Binormal_World_Q31=(world*vec4((cross(normal,tangent)),0.0)).xyz;vec3 Normal_World_Q60;Normal_World_Q60=(world*vec4(normal,0.0)).xyz;vec3 Result_Q18=0.5*normal;vec3 Dir_World_Q67;Object_To_World_Dir_B67(_Active_Face_Up_,Dir_World_Q67);float Product_Q56=_Edge_Width_*Relative_Scale_Q57;vec3 Normal_World_N_Q29=normalize(Normal_World_Q60);vec3 Tangent_World_N_Q28=normalize(Tangent_World_Q30);vec3 Binormal_World_N_Q32=normalize(Binormal_World_Q31);vec3 Position_Q38;float Near_Size_Q38;float Inner_Fade_Q38;float Blob_Enable_Q38;float Fade_Q38;float Pulse_Q38;Choose_Blob_B38(color,Blob_Position_Q41,Blob_Position_Q42,_Blob_Enable_,_Blob_Enable_2_,_Blob_Near_Size_,_Blob_Near_Size_2_,_Blob_Inner_Fade_,_Blob_Inner_Fade_2_,_Blob_Pulse_,_Blob_Pulse_2_,_Blob_Fade_,_Blob_Fade_2_,Position_Q38,Near_Size_Q38,Inner_Fade_Q38,Blob_Enable_Q38,Fade_Q38,Pulse_Q38);vec3 Face_Center_Q33;Face_Center_Q33=(world*vec4(Result_Q18,1.0)).xyz;vec2 Face_Size_Q50=vec2(length(Tangent_World_Q30),length(Binormal_World_Q31));float Show_Selection_Q48;Selection_Vertex_B48(Blob_Position_Q41,Blob_Position_Q42,Face_Center_Q33,Face_Size_Q50,Normal_World_N_Q29,Tangent_World_N_Q28,Binormal_World_N_Q32,_Selection_Fuzz_,_Selected_,_Selected_Distance_,_Selected_Fade_Length_,Active_Face_Dir_Q64,Show_Selection_Q48);vec3 Normalized_Q72=normalize(Dir_World_Q67);float Active_Q34=max(0.0,dot(Active_Face_Dir_Q64,Normal_World_N_Q29));float Width_Q54;Proximity_Visibility_B54(Show_Selection_Q48,Blob_Position_Q41,Blob_Position_Q42,Product_Q56,_Proximity_Far_Distance_,_Proximity_Near_Radius_,Active_Face_Center_Q49,Active_Face_Dir_Q64,Width_Q54);vec3 Wire_Vx_Pos_Q51;vec2 UV_Q51;vec2 Widths_Q51;Wireframe_Vertex_B51(position,normal,tangent,(cross(normal,tangent)),Width_Q54,Face_Size_Q50,Wire_Vx_Pos_Q51,UV_Q51,Widths_Q51);vec3 Vec3_Q27=vec3(Widths_Q51.x,Widths_Q51.y,color.r);vec3 Pos_World_Q13;Object_To_World_Pos_B13(Wire_Vx_Pos_Q51,Pos_World_Q13);vec3 Incident_Q36=normalize(Pos_World_Q13-cameraPosition);vec3 Out_Position_Q47;vec2 Out_UV_Q47;vec3 Blob_Info_Q47;Blob_Vertex_B47(Pos_World_Q13,Normal_World_N_Q29,Tangent_World_N_Q28,Binormal_World_N_Q32,Position_Q38,_Blob_Intensity_,Near_Size_Q38,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,color,uv,Face_Center_Q33,Face_Size_Q50,UV_Q51,_Blob_Fade_Length_,_Selection_Fade_,_Selection_Fade_Size_,Inner_Fade_Q38,Active_Face_Center_Q49,Pulse_Q38,Fade_Q38,Blob_Enable_Q38,Out_Position_Q47,Out_UV_Q47,Blob_Info_Q47);vec4 Extra1_Q66;float Distance_To_Face_Q66;float Intensity_Q66;Proximity_Vertex_B66(Blob_Position_Q41,Blob_Position_Q42,Active_Face_Center_Q49,Active_Face_Dir_Q64,Pos_World_Q13,_Proximity_Far_Distance_,Relative_Scale_Q57,_Proximity_Anisotropy_,Normalized_Q72,Extra1_Q66,Distance_To_Face_Q66,Intensity_Q66);vec4 Holo_Edges_Q44;Holo_Edge_Vertex_B44(Incident_Q36,Normal_World_N_Q29,uv,Tangent_World_Q30,Binormal_World_Q31,_Smooth_Active_Face_,Active_Q34,Holo_Edges_Q44);vec3 Vec3_Q19=vec3(Show_Selection_Q48,Distance_To_Face_Q66,Intensity_Q66);vec3 Position=Out_Position_Q47;vec2 UV=Out_UV_Q47;vec3 Tangent=Blob_Info_Q47;vec3 Binormal=Vec3_Q19;vec3 Normal=Vec3_Q27;vec4 Extra1=Extra1_Q66;vec4 Color=Holo_Edges_Q44;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;}`; + ShaderStore.ShadersStore[name320] = shader318; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/fluentButton/fluentButtonMaterial.js +class FluentButtonMaterialDefines2 extends MaterialDefines { + constructor() { + super(); + this.RELATIVE_WIDTH = true; + this.ENABLE_FADE = true; + this._needNormals = true; + this._needUVs = true; + this.rebuild(); + } +} + +class FluentButtonMaterial2 extends PushMaterial { + constructor(name321, scene50) { + super(name321, scene50); + this.edgeWidth = 0.04; + this.edgeColor = new Color4(0.592157, 0.592157, 0.592157, 1); + this.proximityMaxIntensity = 0.45; + this.proximityFarDistance = 0.16; + this.proximityNearRadius = 1.5; + this.proximityAnisotropy = 1; + this.selectionFuzz = 0.5; + this.selected = 0; + this.selectionFade = 0; + this.selectionFadeSize = 0.3; + this.selectedDistance = 0.08; + this.selectedFadeLength = 0.08; + this.blobIntensity = 0.5; + this.blobFarSize = 0.05; + this.blobNearDistance = 0; + this.blobFarDistance = 0.08; + this.blobFadeLength = 0.08; + this.leftBlobEnable = true; + this.leftBlobNearSize = 0.025; + this.leftBlobPulse = 0; + this.leftBlobFade = 1; + this.leftBlobInnerFade = 0.01; + this.rightBlobEnable = true; + this.rightBlobNearSize = 0.025; + this.rightBlobPulse = 0; + this.rightBlobFade = 1; + this.rightBlobInnerFade = 0.01; + this.activeFaceDir = new Vector3(0, 0, -1); + this.activeFaceUp = new Vector3(0, 1, 0); + this.enableFade = true; + this.fadeWidth = 1.5; + this.smoothActiveFace = true; + this.showFrame = false; + this.useBlobTexture = true; + this.globalLeftIndexTipPosition = Vector3.Zero(); + this.globalRightIndexTipPosition = Vector3.Zero(); + this.alphaMode = Constants.ALPHA_ADD; + this.disableDepthWrite = true; + this.backFaceCulling = false; + this._blobTexture = new Texture(FluentButtonMaterial2.BLOB_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE); + } + needAlphaBlending() { + return true; + } + needAlphaTesting() { + return true; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh82, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new FluentButtonMaterialDefines2; + } + const defines = subMesh11.materialDefines; + const scene50 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene50.getEngine(); + MaterialHelper.PrepareDefinesForAttributes(mesh82, defines, true, false); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + defines.IMAGEPROCESSINGPOSTPROCESS = scene50.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + if (defines.TANGENT) { + attribs.push(VertexBuffer.TangentKind); + } + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "fluentButton"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "viewProjection", + "cameraPosition", + "_Edge_Width_", + "_Edge_Color_", + "_Relative_Width_", + "_Proximity_Max_Intensity_", + "_Proximity_Far_Distance_", + "_Proximity_Near_Radius_", + "_Proximity_Anisotropy_", + "_Selection_Fuzz_", + "_Selected_", + "_Selection_Fade_", + "_Selection_Fade_Size_", + "_Selected_Distance_", + "_Selected_Fade_Length_", + "_Blob_Enable_", + "_Blob_Position_", + "_Blob_Intensity_", + "_Blob_Near_Size_", + "_Blob_Far_Size_", + "_Blob_Near_Distance_", + "_Blob_Far_Distance_", + "_Blob_Fade_Length_", + "_Blob_Inner_Fade_", + "_Blob_Pulse_", + "_Blob_Fade_", + "_Blob_Texture_", + "_Blob_Enable_2_", + "_Blob_Position_2_", + "_Blob_Near_Size_2_", + "_Blob_Inner_Fade_2_", + "_Blob_Pulse_2_", + "_Blob_Fade_2_", + "_Active_Face_Dir_", + "_Active_Face_Up_", + "_Enable_Fade_", + "_Fade_Width_", + "_Smooth_Active_Face_", + "_Show_Frame_", + "_Use_Blob_Texture_", + "Use_Global_Left_Index", + "Use_Global_Right_Index", + "Global_Left_Index_Tip_Position", + "Global_Right_Index_Tip_Position", + "Global_Left_Thumb_Tip_Position", + "Global_Right_Thumb_Tip_Position", + "Global_Left_Index_Tip_Proximity", + "Global_Right_Index_Tip_Proximity" + ]; + const samplers = ["_Blob_Texture_"]; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh82, subMesh11) { + const scene50 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene50.getTransformMatrix()); + this._activeEffect.setVector3("cameraPosition", scene50.activeCamera.position); + this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture); + this._activeEffect.setFloat("_Edge_Width_", this.edgeWidth); + this._activeEffect.setColor4("_Edge_Color_", new Color3(this.edgeColor.r, this.edgeColor.g, this.edgeColor.b), this.edgeColor.a); + this._activeEffect.setFloat("_Proximity_Max_Intensity_", this.proximityMaxIntensity); + this._activeEffect.setFloat("_Proximity_Far_Distance_", this.proximityFarDistance); + this._activeEffect.setFloat("_Proximity_Near_Radius_", this.proximityNearRadius); + this._activeEffect.setFloat("_Proximity_Anisotropy_", this.proximityAnisotropy); + this._activeEffect.setFloat("_Selection_Fuzz_", this.selectionFuzz); + this._activeEffect.setFloat("_Selected_", this.selected); + this._activeEffect.setFloat("_Selection_Fade_", this.selectionFade); + this._activeEffect.setFloat("_Selection_Fade_Size_", this.selectionFadeSize); + this._activeEffect.setFloat("_Selected_Distance_", this.selectedDistance); + this._activeEffect.setFloat("_Selected_Fade_Length_", this.selectedFadeLength); + this._activeEffect.setFloat("_Blob_Enable_", this.leftBlobEnable ? 1 : 0); + this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity); + this._activeEffect.setFloat("_Blob_Near_Size_", this.leftBlobNearSize); + this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize); + this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance); + this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance); + this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength); + this._activeEffect.setFloat("_Blob_Inner_Fade_", this.leftBlobInnerFade); + this._activeEffect.setFloat("_Blob_Pulse_", this.leftBlobPulse); + this._activeEffect.setFloat("_Blob_Fade_", this.leftBlobFade); + this._activeEffect.setFloat("_Blob_Enable_2_", this.rightBlobEnable ? 1 : 0); + this._activeEffect.setFloat("_Blob_Near_Size_2_", this.rightBlobNearSize); + this._activeEffect.setFloat("_Blob_Inner_Fade_2_", this.rightBlobInnerFade); + this._activeEffect.setFloat("_Blob_Pulse_2_", this.rightBlobPulse); + this._activeEffect.setFloat("_Blob_Fade_2_", this.rightBlobFade); + this._activeEffect.setVector3("_Active_Face_Dir_", this.activeFaceDir); + this._activeEffect.setVector3("_Active_Face_Up_", this.activeFaceUp); + this._activeEffect.setFloat("_Fade_Width_", this.fadeWidth); + this._activeEffect.setFloat("_Smooth_Active_Face_", this.smoothActiveFace ? 1 : 0); + this._activeEffect.setFloat("_Show_Frame_", this.showFrame ? 1 : 0); + this._activeEffect.setFloat("_Use_Blob_Texture_", this.useBlobTexture ? 1 : 0); + this._activeEffect.setFloat("Use_Global_Left_Index", 1); + this._activeEffect.setFloat("Use_Global_Right_Index", 1); + this._activeEffect.setVector4("Global_Left_Index_Tip_Position", new Vector4(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1)); + this._activeEffect.setVector4("Global_Right_Index_Tip_Position", new Vector4(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1)); + this._afterBind(mesh82, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + } + clone(name321) { + return SerializationHelper.Clone(() => new FluentButtonMaterial2(name321, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.FluentButtonMaterial"; + return serializationObject; + } + getClassName() { + return "FluentButtonMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new FluentButtonMaterial2(source.name, scene50), source, scene50, rootUrl); + } +} +var init_fluentButtonMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_texture(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_buffer(); + init_typeStore(); + init_math_color(); + init_effectFallbacks(); + init_constants(); + init_fluentButton_fragment(); + init_fluentButton_vertex(); + FluentButtonMaterial2.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-button-blob.png"; + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "edgeWidth", undefined); + __decorate2([ + serializeAsColor4() + ], FluentButtonMaterial2.prototype, "edgeColor", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "proximityMaxIntensity", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "proximityFarDistance", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "proximityNearRadius", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "proximityAnisotropy", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "selectionFuzz", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "selected", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "selectionFade", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "selectionFadeSize", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "selectedDistance", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "selectedFadeLength", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "blobIntensity", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "blobFarSize", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "blobNearDistance", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "blobFarDistance", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "blobFadeLength", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "leftBlobEnable", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "leftBlobNearSize", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "leftBlobPulse", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "leftBlobFade", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "leftBlobInnerFade", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "rightBlobEnable", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "rightBlobNearSize", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "rightBlobPulse", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "rightBlobFade", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "rightBlobInnerFade", undefined); + __decorate2([ + serializeAsVector3() + ], FluentButtonMaterial2.prototype, "activeFaceDir", undefined); + __decorate2([ + serializeAsVector3() + ], FluentButtonMaterial2.prototype, "activeFaceUp", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "enableFade", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "fadeWidth", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "smoothActiveFace", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "showFrame", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial2.prototype, "useBlobTexture", undefined); + __decorate2([ + serializeAsVector3() + ], FluentButtonMaterial2.prototype, "globalLeftIndexTipPosition", undefined); + __decorate2([ + serializeAsVector3() + ], FluentButtonMaterial2.prototype, "globalRightIndexTipPosition", undefined); + RegisterClass("BABYLON.GUI.FluentButtonMaterial", FluentButtonMaterial2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/touchButton3D.js +class TouchButton3D2 extends Button3D2 { + constructor(name321, collisionMesh) { + super(name321); + this._isNearPressed = false; + this._interactionSurfaceHeight = 0; + this._isToggleButton = false; + this._toggleState = false; + this._toggleButtonCallback = () => { + this._onToggle(!this._toggleState); + }; + this.onToggleObservable = new Observable; + this.collidableFrontDirection = Vector3.Zero(); + if (collisionMesh) { + this.collisionMesh = collisionMesh; + } + } + get isActiveNearInteraction() { + return this._isNearPressed; + } + set collidableFrontDirection(frontWorldDir) { + this._collidableFrontDirection = frontWorldDir.normalize(); + if (this._collisionMesh) { + const invert = TmpVectors.Matrix[0]; + invert.copyFrom(this._collisionMesh.getWorldMatrix()); + invert.invert(); + Vector3.TransformNormalToRef(this._collidableFrontDirection, invert, this._collidableFrontDirection); + this._collidableFrontDirection.normalize(); + } + } + get collidableFrontDirection() { + if (this._collisionMesh) { + const transformedDirection = TmpVectors.Vector3[0]; + Vector3.TransformNormalToRef(this._collidableFrontDirection, this._collisionMesh.getWorldMatrix(), transformedDirection); + return transformedDirection.normalize(); + } + return this._collidableFrontDirection; + } + set collisionMesh(collisionMesh) { + var _a; + if (this._collisionMesh) { + this._collisionMesh.isNearPickable = false; + if ((_a = this._collisionMesh.reservedDataStore) === null || _a === undefined ? undefined : _a.GUI3D) { + this._collisionMesh.reservedDataStore.GUI3D = {}; + } + this._collisionMesh.getChildMeshes().forEach((mesh82) => { + var _a2; + mesh82.isNearPickable = false; + if ((_a2 = mesh82.reservedDataStore) === null || _a2 === undefined ? undefined : _a2.GUI3D) { + mesh82.reservedDataStore.GUI3D = {}; + } + }); + } + this._collisionMesh = collisionMesh; + this._injectGUI3DReservedDataStore(this._collisionMesh).control = this; + this._collisionMesh.isNearPickable = true; + this._collisionMesh.getChildMeshes().forEach((mesh82) => { + this._injectGUI3DReservedDataStore(mesh82).control = this; + mesh82.isNearPickable = true; + }); + this.collidableFrontDirection = collisionMesh.forward; + } + set isToggleButton(value) { + if (value === this._isToggleButton) { + return; + } + this._isToggleButton = value; + if (value) { + this.onPointerUpObservable.add(this._toggleButtonCallback); + } else { + this.onPointerUpObservable.removeCallback(this._toggleButtonCallback); + if (this._toggleState) { + this._onToggle(false); + } + } + } + get isToggleButton() { + return this._isToggleButton; + } + set isToggled(newState) { + if (this._isToggleButton && this._toggleState !== newState) { + this._onToggle(newState); + } + } + get isToggled() { + return this._toggleState; + } + _onToggle(newState) { + this._toggleState = newState; + this.onToggleObservable.notifyObservers(newState); + } + _isInteractionInFrontOfButton(collidablePos) { + return this._getInteractionHeight(collidablePos, this._collisionMesh.getAbsolutePosition()) > 0; + } + getPressDepth(touchPoint) { + if (!this._isNearPressed) { + return 0; + } + const interactionHeight = this._getInteractionHeight(touchPoint, this._collisionMesh.getAbsolutePosition()); + return this._interactionSurfaceHeight - interactionHeight; + } + _getInteractionHeight(interactionPos, basePos) { + const frontDir = this.collidableFrontDirection; + if (frontDir.length() === 0) { + return Vector3.Distance(interactionPos, basePos); + } + const d = Vector3.Dot(basePos, frontDir); + const abc = Vector3.Dot(interactionPos, frontDir); + return abc - d; + } + _generatePointerEventType(providedType, nearMeshPosition, activeInteractionCount) { + if (providedType === PointerEventTypes.POINTERDOWN || providedType === PointerEventTypes.POINTERMOVE) { + if (!this._isInteractionInFrontOfButton(nearMeshPosition)) { + return PointerEventTypes.POINTERMOVE; + } else { + this._isNearPressed = true; + this._interactionSurfaceHeight = this._getInteractionHeight(nearMeshPosition, this._collisionMesh.getAbsolutePosition()); + } + } + if (providedType === PointerEventTypes.POINTERUP) { + if (activeInteractionCount == 0) { + return PointerEventTypes.POINTERMOVE; + } else { + this._isNearPressed = false; + } + } + return providedType; + } + _getTypeName() { + return "TouchButton3D"; + } + _createNode(scene50) { + return super._createNode(scene50); + } + dispose() { + super.dispose(); + this.onPointerUpObservable.removeCallback(this._toggleButtonCallback); + this.onToggleObservable.clear(); + if (this._collisionMesh) { + this._collisionMesh.dispose(); + } + } +} +var init_touchButton3D = __esm(() => { + init_math_vector(); + init_pointerEvents(); + init_observable(); + init_button3D(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/touchHolographicButton.js +class TouchHolographicButton3 extends TouchButton3D2 { + _disposeTooltip() { + this._tooltipFade = null; + if (this._tooltipTextBlock) { + this._tooltipTextBlock.dispose(); + } + if (this._tooltipTexture) { + this._tooltipTexture.dispose(); + } + if (this._tooltipMesh) { + this._tooltipMesh.dispose(); + } + this.onPointerEnterObservable.remove(this._tooltipHoverObserver); + this.onPointerOutObservable.remove(this._tooltipOutObserver); + } + set renderingGroupId(id) { + this._backPlate.renderingGroupId = id; + this._textPlate.renderingGroupId = id; + this._frontPlate.renderingGroupId = id; + if (this._tooltipMesh) { + this._tooltipMesh.renderingGroupId = id; + } + } + get renderingGroupId() { + return this._backPlate.renderingGroupId; + } + get mesh() { + return this._backPlate; + } + set tooltipText(text) { + if (!text) { + this._disposeTooltip(); + return; + } + if (!this._tooltipFade) { + const rightHandedScene = this._backPlate._scene.useRightHandedSystem; + this._tooltipMesh = CreatePlane("", { size: 1 }, this._backPlate._scene); + const tooltipBackground = CreatePlane("", { size: 1, sideOrientation: Mesh.DOUBLESIDE }, this._backPlate._scene); + const mat = new StandardMaterial("", this._backPlate._scene); + mat.diffuseColor = Color3.FromHexString("#212121"); + tooltipBackground.material = mat; + tooltipBackground.isPickable = false; + this._tooltipMesh.addChild(tooltipBackground); + tooltipBackground.position = Vector3.Forward(rightHandedScene).scale(0.05); + this._tooltipMesh.scaling.y = 1 / 3; + this._tooltipMesh.position = Vector3.Up().scale(0.7).add(Vector3.Forward(rightHandedScene).scale(-0.15)); + this._tooltipMesh.isPickable = false; + this._tooltipMesh.parent = this._backPlate; + this._tooltipTexture = AdvancedDynamicTexture2.CreateForMesh(this._tooltipMesh); + this._tooltipTextBlock = new TextBlock2; + this._tooltipTextBlock.scaleY = 3; + this._tooltipTextBlock.color = "white"; + this._tooltipTextBlock.fontSize = 130; + this._tooltipTexture.addControl(this._tooltipTextBlock); + this._tooltipFade = new FadeInOutBehavior; + this._tooltipFade.delay = 500; + this._tooltipMesh.addBehavior(this._tooltipFade); + this._tooltipHoverObserver = this.onPointerEnterObservable.add(() => { + if (this._tooltipFade) { + this._tooltipFade.fadeIn(true); + } + }); + this._tooltipOutObserver = this.onPointerOutObservable.add(() => { + if (this._tooltipFade) { + this._tooltipFade.fadeIn(false); + } + }); + } + if (this._tooltipTextBlock) { + this._tooltipTextBlock.text = text; + } + } + get tooltipText() { + if (this._tooltipTextBlock) { + return this._tooltipTextBlock.text; + } + return null; + } + get text() { + return this._text; + } + set text(value) { + if (this._text === value) { + return; + } + this._text = value; + this._rebuildContent(); + } + get imageUrl() { + return this._imageUrl; + } + set imageUrl(value) { + if (this._imageUrl === value) { + return; + } + this._imageUrl = value; + this._rebuildContent(); + } + get backMaterial() { + return this._backMaterial; + } + get frontMaterial() { + return this._frontMaterial; + } + get plateMaterial() { + return this._plateMaterial; + } + get shareMaterials() { + return this._shareMaterials; + } + set isBackplateVisible(isVisible) { + if (this.mesh && !!this._backMaterial) { + if (isVisible && !this._isBackplateVisible) { + this._backPlate.visibility = 1; + } else if (!isVisible && this._isBackplateVisible) { + this._backPlate.visibility = 0; + } + } + this._isBackplateVisible = isVisible; + } + constructor(name321, shareMaterials = true) { + super(name321); + this._shareMaterials = true; + this._isBackplateVisible = true; + this._frontPlateDepth = 0.5; + this._backPlateDepth = 0.04; + this._backplateColor = new Color3(0.08, 0.15, 0.55); + this._backplateToggledColor = new Color3(0.25, 0.4, 0.95); + this._shareMaterials = shareMaterials; + this.pointerEnterAnimation = () => { + this._frontMaterial.leftBlobEnable = true; + this._frontMaterial.rightBlobEnable = true; + }; + this.pointerOutAnimation = () => { + this._frontMaterial.leftBlobEnable = false; + this._frontMaterial.rightBlobEnable = false; + }; + this.pointerDownAnimation = () => { + if (this._frontPlate && !this.isActiveNearInteraction) { + this._frontPlate.scaling.z = this._frontPlateDepth * 0.2; + this._frontPlate.position = Vector3.Forward(this._frontPlate._scene.useRightHandedSystem).scale((this._frontPlateDepth - 0.2 * this._frontPlateDepth) / 2); + this._textPlate.position = Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-(this._backPlateDepth + 0.2 * this._frontPlateDepth) / 2); + } + }; + this.pointerUpAnimation = () => { + if (this._frontPlate) { + this._frontPlate.scaling.z = this._frontPlateDepth; + this._frontPlate.position = Vector3.Forward(this._frontPlate._scene.useRightHandedSystem).scale((this._frontPlateDepth - this._frontPlateDepth) / 2); + this._textPlate.position = Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-(this._backPlateDepth + this._frontPlateDepth) / 2); + } + }; + this.onPointerMoveObservable.add((position3) => { + if (this._frontPlate && this.isActiveNearInteraction) { + const scale = Vector3.Zero(); + if (this._backPlate.getWorldMatrix().decompose(scale, undefined, undefined)) { + let interactionHeight = this._getInteractionHeight(position3, this._backPlate.getAbsolutePosition()) / scale.z; + interactionHeight = Scalar.Clamp(interactionHeight - this._backPlateDepth / 2, 0.2 * this._frontPlateDepth, this._frontPlateDepth); + this._frontPlate.scaling.z = interactionHeight; + this._frontPlate.position = Vector3.Forward(this._frontPlate._scene.useRightHandedSystem).scale((this._frontPlateDepth - interactionHeight) / 2); + this._textPlate.position = Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-(this._backPlateDepth + interactionHeight) / 2); + } + } + }); + this._pointerHoverObserver = this.onPointerMoveObservable.add((hoverPosition) => { + this._frontMaterial.globalLeftIndexTipPosition = hoverPosition; + }); + } + _getTypeName() { + return "TouchHolographicButton"; + } + _rebuildContent() { + this._disposeFacadeTexture(); + const panel = new StackPanel2; + panel.isVertical = true; + if (IsDocumentAvailable() && !!document.createElement) { + if (this._imageUrl) { + const image12 = new Image3; + image12.source = this._imageUrl; + image12.paddingTop = "40px"; + image12.height = "180px"; + image12.width = "100px"; + image12.paddingBottom = "40px"; + panel.addControl(image12); + } + } + if (this._text) { + const text = new TextBlock2; + text.text = this._text; + text.color = "white"; + text.height = "30px"; + text.fontSize = 24; + panel.addControl(text); + } + this.content = panel; + } + _createNode(scene50) { + var _a; + this.name = (_a = this.name) !== null && _a !== undefined ? _a : "TouchHolographicButton"; + const collisionMesh = CreateBox(`${this.name}_collisionMesh`, { + width: 1, + height: 1, + depth: this._frontPlateDepth + }, scene50); + collisionMesh.isPickable = true; + collisionMesh.isNearPickable = true; + collisionMesh.visibility = 0; + collisionMesh.position = Vector3.Forward(scene50.useRightHandedSystem).scale(-this._frontPlateDepth / 2); + SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton3.MODEL_BASE_URL, TouchHolographicButton3.MODEL_FILENAME, scene50).then((result) => { + const alphaMesh = CreateBox("${this.name}_alphaMesh", { + width: 1, + height: 1, + depth: 1 + }, scene50); + alphaMesh.isPickable = false; + alphaMesh.material = new StandardMaterial("${this.name}_alphaMesh_material", scene50); + alphaMesh.material.alpha = 0.15; + const importedFrontPlate = result.meshes[1]; + importedFrontPlate.name = `${this.name}_frontPlate`; + importedFrontPlate.isPickable = false; + importedFrontPlate.scaling.z = this._frontPlateDepth; + alphaMesh.parent = importedFrontPlate; + importedFrontPlate.parent = collisionMesh; + if (this._frontMaterial) { + importedFrontPlate.material = this._frontMaterial; + } + this._frontPlate = importedFrontPlate; + }); + this._backPlate = CreateBox(`${this.name}_backPlate`, { + width: 1, + height: 1, + depth: this._backPlateDepth + }, scene50); + this._backPlate.position = Vector3.Forward(scene50.useRightHandedSystem).scale(this._backPlateDepth / 2); + this._backPlate.isPickable = false; + this._textPlate = super._createNode(scene50); + this._textPlate.name = `${this.name}_textPlate`; + this._textPlate.isPickable = false; + this._textPlate.position = Vector3.Forward(scene50.useRightHandedSystem).scale(-this._frontPlateDepth / 2); + this._backPlate.addChild(collisionMesh); + this._backPlate.addChild(this._textPlate); + const tn = new TransformNode(`{this.name}_root`, scene50); + this._backPlate.setParent(tn); + this.collisionMesh = collisionMesh; + this.collidableFrontDirection = this._backPlate.forward.negate(); + return tn; + } + _applyFacade(facadeTexture) { + this._plateMaterial.emissiveTexture = facadeTexture; + this._plateMaterial.opacityTexture = facadeTexture; + this._plateMaterial.diffuseColor = new Color3(0.4, 0.4, 0.4); + } + _createBackMaterial(mesh83) { + this._backMaterial = new FluentMaterial2(this.name + "backPlateMaterial", mesh83.getScene()); + this._backMaterial.albedoColor = this._backplateColor; + this._backMaterial.renderBorders = true; + this._backMaterial.renderHoverLight = false; + } + _createFrontMaterial(mesh83) { + this._frontMaterial = new FluentButtonMaterial2(this.name + "Front Material", mesh83.getScene()); + } + _createPlateMaterial(mesh83) { + this._plateMaterial = new StandardMaterial(this.name + "Plate Material", mesh83.getScene()); + this._plateMaterial.specularColor = Color3.Black(); + } + _onToggle(newState) { + if (this._backMaterial) { + if (newState) { + this._backMaterial.albedoColor = this._backplateToggledColor; + } else { + this._backMaterial.albedoColor = this._backplateColor; + } + } + super._onToggle(newState); + } + _affectMaterial(mesh83) { + if (this._shareMaterials) { + if (!this._host._touchSharedMaterials["backFluentMaterial"]) { + this._createBackMaterial(mesh83); + this._host._touchSharedMaterials["backFluentMaterial"] = this._backMaterial; + } else { + this._backMaterial = this._host._touchSharedMaterials["backFluentMaterial"]; + } + if (!this._host._touchSharedMaterials["frontFluentMaterial"]) { + this._createFrontMaterial(mesh83); + this._host._touchSharedMaterials["frontFluentMaterial"] = this._frontMaterial; + } else { + this._frontMaterial = this._host._touchSharedMaterials["frontFluentMaterial"]; + } + } else { + this._createBackMaterial(mesh83); + this._createFrontMaterial(mesh83); + } + this._createPlateMaterial(mesh83); + this._backPlate.material = this._backMaterial; + this._textPlate.material = this._plateMaterial; + if (!this._isBackplateVisible) { + this._backPlate.visibility = 0; + } + if (this._frontPlate) { + this._frontPlate.material = this._frontMaterial; + } + this._rebuildContent(); + } + dispose() { + super.dispose(); + this._disposeTooltip(); + this.onPointerMoveObservable.remove(this._pointerHoverObserver); + if (!this.shareMaterials) { + this._backMaterial.dispose(); + this._frontMaterial.dispose(); + this._plateMaterial.dispose(); + if (this._pickedPointObserver) { + this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver); + this._pickedPointObserver = null; + } + } + } +} +var init_touchHolographicButton = __esm(() => { + init_math_vector(); + init_standardMaterial(); + init_transformNode(); + init_mesh(); + init_planeBuilder(); + init_boxBuilder(); + init_fadeInOutBehavior(); + init_fluentMaterial(); + init_fluentButtonMaterial(); + init_stackPanel(); + init_image(); + init_textBlock(); + init_advancedDynamicTexture(); + init_math_color(); + init_touchButton3D(); + init_sceneLoader(); + init_domManagement(); + init_math_scalar(); + TouchHolographicButton3.MODEL_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/"; + TouchHolographicButton3.MODEL_FILENAME = "mrtk-fluent-button.glb"; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/behaviors/defaultBehavior.js +class DefaultBehavior2 { + constructor() { + this.followBehaviorEnabled = false; + this.sixDofDragBehaviorEnabled = true; + this.surfaceMagnetismBehaviorEnabled = true; + this._followBehavior = new FollowBehavior; + this._sixDofDragBehavior = new SixDofDragBehavior; + this._surfaceMagnetismBehavior = new SurfaceMagnetismBehavior; + } + get name() { + return "Default"; + } + get followBehavior() { + return this._followBehavior; + } + get sixDofDragBehavior() { + return this._sixDofDragBehavior; + } + get surfaceMagnetismBehavior() { + return this._surfaceMagnetismBehavior; + } + init() { + } + attach(ownerMesh, draggablesMeshes, sceneUnderstandingMeshes) { + this._scene = ownerMesh.getScene(); + this.attachedNode = ownerMesh; + this._addObservables(); + this._followBehavior.attach(ownerMesh); + this._sixDofDragBehavior.attach(ownerMesh); + this._sixDofDragBehavior.draggableMeshes = draggablesMeshes || null; + this._sixDofDragBehavior.faceCameraOnDragStart = true; + this._surfaceMagnetismBehavior.attach(ownerMesh, this._scene); + if (sceneUnderstandingMeshes) { + this._surfaceMagnetismBehavior.meshes = sceneUnderstandingMeshes; + } + this._surfaceMagnetismBehavior.enabled = false; + } + detach() { + this.attachedNode = null; + this._removeObservables(); + this._followBehavior.detach(); + this._sixDofDragBehavior.detach(); + this._surfaceMagnetismBehavior.detach(); + } + _addObservables() { + this._onBeforeRenderObserver = this._scene.onBeforeRenderObservable.add(() => { + this._followBehavior._enabled = !this._sixDofDragBehavior.isMoving && this.followBehaviorEnabled; + }); + this._onDragObserver = this._sixDofDragBehavior.onDragObservable.add((event) => { + this._sixDofDragBehavior.disableMovement = this._surfaceMagnetismBehavior.findAndUpdateTarget(event.pickInfo); + }); + } + _removeObservables() { + this._scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserver); + this._sixDofDragBehavior.onDragObservable.remove(this._onDragObserver); + } +} +var init_defaultBehavior = __esm(() => { + init_followBehavior(); + init_sixDofDragBehavior(); + init_surfaceMagnetismBehavior(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/handle/shaders/handle.vertex.js +var name321, shader319; +var init_handle_vertex = __esm(() => { + init_shaderStore(); + name321 = "handleVertexShader"; + shader319 = `precision highp float;attribute vec3 position;uniform vec3 positionOffset;uniform mat4 worldViewProjection;uniform float scale;void main(void) {vec4 vPos=vec4((vec3(position)+positionOffset)*scale,1.0);gl_Position=worldViewProjection*vPos;}`; + ShaderStore.ShadersStore[name321] = shader319; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/handle/shaders/handle.fragment.js +var name322, shader320; +var init_handle_fragment = __esm(() => { + init_shaderStore(); + name322 = "handlePixelShader"; + shader320 = `uniform vec3 color;void main(void) {gl_FragColor=vec4(color,1.0);}`; + ShaderStore.ShadersStore[name322] = shader320; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/handle/handleMaterial.js +class HandleMaterial2 extends ShaderMaterial { + get hover() { + return this._hover; + } + set hover(b) { + this._hover = b; + this._updateInterpolationTarget(); + } + get drag() { + return this._drag; + } + set drag(b) { + this._drag = b; + this._updateInterpolationTarget(); + } + constructor(name323, scene50) { + super(name323, scene50, "handle", { + attributes: ["position"], + uniforms: ["worldViewProjection", "color", "scale", "positionOffset"], + needAlphaBlending: false, + needAlphaTesting: false + }); + this._hover = false; + this._drag = false; + this._color = new Color3; + this._scale = 1; + this._lastTick = -1; + this.animationLength = 100; + this.hoverColor = new Color3(0, 0.467, 0.84); + this.baseColor = new Color3(1, 1, 1); + this.hoverScale = 0.75; + this.baseScale = 0.35; + this.dragScale = 0.55; + this._positionOffset = Vector3.Zero(); + this._updateInterpolationTarget(); + this._lastTick = Date.now(); + this._onBeforeRender = this.getScene().onBeforeRenderObservable.add(() => { + const tick = Date.now(); + const delta = tick - this._lastTick; + const scaleDiff = this._targetScale - this._scale; + const colorDiff = TmpColors.Color3[0].copyFrom(this._targetColor).subtractToRef(this._color, TmpColors.Color3[0]); + this._scale = this._scale + scaleDiff * delta / this.animationLength; + colorDiff.scaleToRef(delta / this.animationLength, colorDiff); + this._color.addToRef(colorDiff, this._color); + this.setColor3("color", this._color); + this.setFloat("scale", this._scale); + this.setVector3("positionOffset", this._positionOffset); + this._lastTick = tick; + }); + } + _updateInterpolationTarget() { + if (this.drag) { + this._targetColor = this.hoverColor; + this._targetScale = this.dragScale; + } else if (this.hover) { + this._targetColor = this.hoverColor; + this._targetScale = this.hoverScale; + } else { + this._targetColor = this.baseColor; + this._targetScale = this.baseScale; + } + } + dispose() { + super.dispose(); + this.getScene().onBeforeRenderObservable.remove(this._onBeforeRender); + } +} +var init_handleMaterial = __esm(() => { + init_shaderMaterial(); + init_math_color(); + init_math_vector(); + init_handle_vertex(); + init_handle_fragment(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/gizmos/gizmoHandle.js +class GizmoHandle2 { + get state() { + return this._state; + } + get gizmo() { + return this._gizmo; + } + set hover(value) { + if (value) { + this._state |= HandleState2.HOVER; + } else { + this._state &= ~HandleState2.HOVER; + } + this._updateMaterial(); + } + set drag(value) { + if (value) { + this._state |= HandleState2.DRAG; + } else { + this._state &= ~HandleState2.DRAG; + } + this._updateMaterial(); + } + constructor(gizmo14, scene50) { + this._state = HandleState2.IDLE; + this._materials = []; + this._scene = scene50; + this._gizmo = gizmo14; + this.node = this.createNode(); + this.node.reservedDataStore = { + handle: this + }; + } + _createMaterial(positionOffset) { + const mat = new HandleMaterial2("handle", this._scene); + if (positionOffset) { + mat._positionOffset = positionOffset; + } + return mat; + } + _updateMaterial() { + const state = this._state; + for (const mat of this._materials) { + mat.hover = false; + mat.drag = false; + } + if (state & HandleState2.DRAG) { + for (const mat of this._materials) { + mat.drag = true; + } + } else if (state & HandleState2.HOVER) { + for (const mat of this._materials) { + mat.hover = true; + } + } + } + setDragBehavior(dragStartFn, dragFn, dragEndFn) { + const dragBehavior = new BaseSixDofDragBehavior; + this._dragBehavior = dragBehavior; + this._dragStartObserver = dragBehavior.onDragStartObservable.add(dragStartFn); + this._draggingObserver = dragBehavior.onDragObservable.add(dragFn); + this._dragEndObserver = dragBehavior.onDragEndObservable.add(dragEndFn); + this._dragBehavior.attach(this.node); + } + dispose() { + this._dragBehavior.onDragStartObservable.remove(this._dragStartObserver); + this._dragBehavior.onDragObservable.remove(this._draggingObserver); + this._dragBehavior.onDragEndObservable.remove(this._dragEndObserver); + this._dragBehavior.detach(); + for (const material30 of this._materials) { + material30.dispose(); + } + this.node.dispose(); + } +} + +class SideHandle2 extends GizmoHandle2 { + createNode() { + const verticalBox = CreateBox("sideVert", { width: 1, height: 10, depth: 0.1 }, this._scene); + const sideNode = new TransformNode("side", this._scene); + verticalBox.parent = sideNode; + const mat = this._createMaterial(); + verticalBox.material = mat; + verticalBox.isNearGrabbable = true; + this._materials.push(mat); + return sideNode; + } +} + +class CornerHandle2 extends GizmoHandle2 { + createNode() { + const horizontalBox = CreateBox("angleHor", { width: 3, height: 1, depth: 0.1 }, this._scene); + const verticalBox = CreateBox("angleVert", { width: 1, height: 3, depth: 0.1 }, this._scene); + const angleNode = new TransformNode("angle", this._scene); + horizontalBox.parent = angleNode; + verticalBox.parent = angleNode; + horizontalBox.material = this._createMaterial(new Vector3(1, 0, 0)); + verticalBox.material = this._createMaterial(new Vector3(0, 1, 0)); + verticalBox.isNearGrabbable = true; + horizontalBox.isNearGrabbable = true; + this._materials.push(horizontalBox.material); + this._materials.push(verticalBox.material); + return angleNode; + } +} +var HandleState2; +var init_gizmoHandle = __esm(() => { + init_boxBuilder(); + init_transformNode(); + init_math_vector(); + init_handleMaterial(); + init_baseSixDofDragBehavior(); + (function(HandleState3) { + HandleState3[HandleState3["IDLE"] = 0] = "IDLE"; + HandleState3[HandleState3["HOVER"] = 1] = "HOVER"; + HandleState3[HandleState3["DRAG"] = 2] = "DRAG"; + })(HandleState2 || (HandleState2 = {})); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/gizmos/slateGizmo.js +class SlateGizmo2 extends Gizmo { + set attachedSlate(control47) { + if (control47) { + this.attachedMesh = control47.mesh; + this.updateBoundingBox(); + this._pickedPointObserver = control47._host.onPickingObservable.add((pickedMesh) => { + if (this._handleHovered && (!pickedMesh || pickedMesh.parent !== this._handleHovered.node)) { + this._handleHovered.hover = false; + this._handleHovered = null; + } + if (pickedMesh && pickedMesh.parent && pickedMesh.parent.reservedDataStore && pickedMesh.parent.reservedDataStore.handle) { + const handle2 = pickedMesh.parent.reservedDataStore.handle; + if (handle2.gizmo === this) { + this._handleHovered = handle2; + this._handleHovered.hover = true; + } + } + }); + } else if (this._attachedSlate) { + this._attachedSlate._host.onPickingObservable.remove(this._pickedPointObserver); + } + this._attachedSlate = control47; + } + get attachedSlate() { + return this._attachedSlate; + } + constructor(utilityLayer) { + super(utilityLayer); + this._boundingDimensions = new Vector3(0, 0, 0); + this._renderObserver = null; + this._tmpQuaternion = new Quaternion; + this._tmpVector = new Vector3(0, 0, 0); + this._corners = []; + this._sides = []; + this._boundingBoxGizmo = { + min: new Vector3, + max: new Vector3 + }; + this._margin = 0.35; + this._handleSize = 0.075; + this._attachedSlate = null; + this._existingSlateScale = new Vector3; + this.fixedScreenSize = false; + this.fixedScreenSizeDistanceFactor = 10; + this._createNode(); + this.updateScale = false; + this._renderObserver = this.gizmoLayer.originalScene.onBeforeRenderObservable.add(() => { + if (this.attachedMesh && !this._existingSlateScale.equals(this.attachedMesh.scaling)) { + this.updateBoundingBox(); + } + }); + } + _createNode() { + this._handlesParent = new TransformNode("handlesParent", this.gizmoLayer.utilityLayerScene); + this._handlesParent.rotationQuaternion = Quaternion.Identity(); + const masksCorners = [ + { + dimensions: new Vector3(-1, -1, 0), + origin: new Vector3(1, 0, 0) + }, + { + dimensions: new Vector3(1, -1, 0), + origin: new Vector3(0, 0, 0) + }, + { + dimensions: new Vector3(1, 1, 0), + origin: new Vector3(0, 1, 0) + }, + { + dimensions: new Vector3(-1, 1, 0), + origin: new Vector3(1, 1, 0) + } + ]; + for (let i = 0;i < 4; i++) { + const corner = new CornerHandle2(this, this.gizmoLayer.utilityLayerScene); + this._corners.push(corner); + corner.node.rotation.z = Math.PI / 2 * i; + corner.node.parent = this._handlesParent; + this._assignDragBehaviorCorners(corner, (originStart, dimensionsStart, offset, masks) => this._moveHandle(originStart, dimensionsStart, offset, masks, true), masksCorners[i]); + } + for (let i = 0;i < 4; i++) { + const side = new SideHandle2(this, this.gizmoLayer.utilityLayerScene); + this._sides.push(side); + side.node.rotation.z = Math.PI / 2 * i; + side.node.parent = this._handlesParent; + this._assignDragBehaviorSides(side, i % 2 === 0 ? new Vector3(0, 1, 0) : new Vector3(1, 0, 0)); + } + this._handlesParent.parent = this._rootMesh; + } + _keepAspectRatio(vector, aspectRatio, invertDiagonal = false) { + const axis = TmpVectors.Vector3[0]; + axis.copyFromFloats(aspectRatio, 1, 0).normalize(); + if (invertDiagonal) { + axis.y *= -1; + } + const dot = Vector3.Dot(vector, axis); + vector.copyFrom(axis).scaleInPlace(dot); + } + _clampDimensions(vector, dimensions, mask, keepAspectRatio = false) { + const impact = TmpVectors.Vector3[0]; + impact.copyFrom(vector).multiplyInPlace(mask); + const clampedDimensions = TmpVectors.Vector3[1]; + clampedDimensions.copyFromFloats(Math.max(this._attachedSlate.minDimensions.x, impact.x + dimensions.x), Math.max(this._attachedSlate.minDimensions.y, impact.y + dimensions.y), 0); + if (keepAspectRatio) { + const ratio = dimensions.x / dimensions.y; + clampedDimensions.x = Math.max(clampedDimensions.x, clampedDimensions.y * ratio); + clampedDimensions.y = Math.max(clampedDimensions.y, clampedDimensions.x / ratio); + } + impact.copyFrom(clampedDimensions).subtractInPlace(dimensions); + vector.x = Math.sign(vector.x) * Math.abs(impact.x); + vector.y = Math.sign(vector.y) * Math.abs(impact.y); + } + _moveHandle(originStart, dimensionsStart, offset, masks, isCorner) { + if (!this._attachedSlate) { + return; + } + if (isCorner) { + const aspectRatio = dimensionsStart.x / dimensionsStart.y; + this._keepAspectRatio(offset, aspectRatio, masks.dimensions.x * masks.dimensions.y < 0); + } + this._clampDimensions(offset, dimensionsStart, masks.dimensions, isCorner); + const offsetOriginMasked = TmpVectors.Vector3[0]; + const offsetDimensionsMasked = TmpVectors.Vector3[1]; + offsetOriginMasked.copyFrom(offset).multiplyInPlace(masks.origin); + offsetDimensionsMasked.copyFrom(offset).multiplyInPlace(masks.dimensions); + this._attachedSlate.origin.copyFrom(originStart).addInPlace(offsetOriginMasked); + this._attachedSlate.dimensions.set(dimensionsStart.x + offsetDimensionsMasked.x, dimensionsStart.y + offsetDimensionsMasked.y); + } + _assignDragBehaviorCorners(handle2, moveFn, masks) { + const dimensionsStart = new Vector3; + const originStart = new Vector3; + const dragOrigin = new Vector3; + const toObjectFrame = new Matrix; + const dragPlaneNormal = new Vector3; + const projectToRef = (position3, normal2, origin, ref) => { + position3.subtractToRef(origin, TmpVectors.Vector3[0]); + const dot = Vector3.Dot(TmpVectors.Vector3[0], normal2); + TmpVectors.Vector3[1].copyFrom(normal2).scaleInPlace(dot); + TmpVectors.Vector3[0].subtractInPlace(TmpVectors.Vector3[1]); + TmpVectors.Vector3[0].addToRef(origin, ref); + }; + const dragStart = (event) => { + if (this.attachedSlate && this.attachedMesh) { + dimensionsStart.set(this.attachedSlate.dimensions.x, this.attachedSlate.dimensions.y, Epsilon); + originStart.copyFrom(this.attachedSlate.origin); + dragOrigin.copyFrom(event.position); + toObjectFrame.copyFrom(this.attachedMesh.computeWorldMatrix(true)); + toObjectFrame.invert(); + this.attachedSlate._followButton.isToggled = false; + Vector3.TransformNormalToRef(Vector3.Forward(), this.attachedMesh.getWorldMatrix(), dragPlaneNormal); + dragPlaneNormal.normalize(); + if (this._handleHovered) { + this._handleDragged = this._handleHovered; + this._handleDragged.drag = true; + } + } + }; + const dragging = (event) => { + if (this.attachedSlate && this.attachedMesh) { + projectToRef(event.position, dragPlaneNormal, dragOrigin, this._tmpVector); + this._tmpVector.subtractInPlace(dragOrigin); + Vector3.TransformNormalToRef(this._tmpVector, toObjectFrame, this._tmpVector); + moveFn(originStart, dimensionsStart, this._tmpVector, masks); + this.attachedSlate._positionElements(); + this.updateBoundingBox(); + } + }; + const dragEnd = () => { + if (this.attachedSlate && this.attachedNode) { + this.attachedSlate._updatePivot(); + if (this._handleDragged) { + this._handleDragged.drag = false; + this._handleDragged = null; + } + } + }; + handle2.setDragBehavior(dragStart, dragging, dragEnd); + } + _assignDragBehaviorSides(handle2, dragPlaneNormal) { + const quaternionOrigin = new Quaternion; + const dragOrigin = new Vector3; + const directionOrigin = new Vector3; + const worldPivot = new Vector3; + const worldPlaneNormal = new Vector3; + const dragStart = (event) => { + if (this.attachedSlate && this.attachedMesh) { + quaternionOrigin.copyFrom(this.attachedMesh.rotationQuaternion); + dragOrigin.copyFrom(event.position); + worldPivot.copyFrom(this.attachedMesh.getAbsolutePivotPoint()); + directionOrigin.copyFrom(dragOrigin).subtractInPlace(worldPivot).normalize(); + this.attachedSlate._followButton.isToggled = false; + Vector3.TransformNormalToRef(dragPlaneNormal, this.attachedMesh.getWorldMatrix(), worldPlaneNormal); + worldPlaneNormal.normalize(); + if (this._handleHovered) { + this._handleDragged = this._handleHovered; + this._handleDragged.drag = true; + } + } + }; + const dragging = (event) => { + if (this.attachedSlate && this.attachedMesh) { + this._tmpVector.copyFrom(event.position); + this._tmpVector.subtractInPlace(worldPivot); + this._tmpVector.normalize(); + const angle = -Vector3.GetAngleBetweenVectorsOnPlane(this._tmpVector, directionOrigin, worldPlaneNormal); + Quaternion.RotationAxisToRef(dragPlaneNormal, angle, this._tmpQuaternion); + quaternionOrigin.multiplyToRef(this._tmpQuaternion, this.attachedMesh.rotationQuaternion); + } + }; + const dragEnd = () => { + if (this.attachedSlate && this.attachedNode) { + this.attachedSlate._updatePivot(); + if (this._handleDragged) { + this._handleDragged.drag = false; + this._handleDragged = null; + } + } + }; + handle2.setDragBehavior(dragStart, dragging, dragEnd); + } + _attachedNodeChanged(value) { + if (value) { + this.updateBoundingBox(); + } + } + updateBoundingBox() { + if (this.attachedMesh) { + PivotTools._RemoveAndStorePivotPoint(this.attachedMesh); + const originalParent = this.attachedMesh.parent; + this.attachedMesh.setParent(null); + this._update(); + if (!this.attachedMesh.rotationQuaternion) { + this.attachedMesh.rotationQuaternion = Quaternion.RotationYawPitchRoll(this.attachedMesh.rotation.y, this.attachedMesh.rotation.x, this.attachedMesh.rotation.z); + } + this._tmpQuaternion.copyFrom(this.attachedMesh.rotationQuaternion); + this._tmpVector.copyFrom(this.attachedMesh.position); + this.attachedMesh.rotationQuaternion.set(0, 0, 0, 1); + this.attachedMesh.position.set(0, 0, 0); + const boundingMinMax = this.attachedMesh.getHierarchyBoundingVectors(); + boundingMinMax.max.subtractToRef(boundingMinMax.min, this._boundingDimensions); + this._boundingBoxGizmo.min = boundingMinMax.min; + this._boundingBoxGizmo.max = boundingMinMax.max; + this._updateHandlesPosition(); + this._updateHandlesScaling(); + this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion); + this.attachedMesh.position.copyFrom(this._tmpVector); + PivotTools._RestorePivotPoint(this.attachedMesh); + this.attachedMesh.setParent(originalParent); + this.attachedMesh.computeWorldMatrix(true); + this._existingSlateScale.copyFrom(this.attachedMesh.scaling); + } + } + _updateHandlesPosition() { + const min = this._boundingBoxGizmo.min.clone(); + const max = this._boundingBoxGizmo.max.clone(); + const handleScaling = this._corners[0].node.scaling.length(); + min.x -= this._margin * handleScaling; + min.y -= this._margin * handleScaling; + max.x += this._margin * handleScaling; + max.y += this._margin * handleScaling; + const center = min.add(max).scaleInPlace(0.5); + this._corners[0].node.position.copyFromFloats(min.x, min.y, 0); + this._corners[1].node.position.copyFromFloats(max.x, min.y, 0); + this._corners[2].node.position.copyFromFloats(max.x, max.y, 0); + this._corners[3].node.position.copyFromFloats(min.x, max.y, 0); + this._sides[0].node.position.copyFromFloats(min.x, center.y, 0); + this._sides[1].node.position.copyFromFloats(center.x, min.y, 0); + this._sides[2].node.position.copyFromFloats(max.x, center.y, 0); + this._sides[3].node.position.copyFromFloats(center.x, max.y, 0); + } + _updateHandlesScaling() { + if (this._attachedSlate && this._attachedSlate.mesh) { + const scaledWidth = this._attachedSlate.mesh.scaling.x * this._attachedSlate.dimensions.x; + const scaledHeight = this._attachedSlate.mesh.scaling.y * this._attachedSlate.dimensions.y; + const scale = Math.min(scaledWidth, scaledHeight) * this._handleSize; + for (let index = 0;index < this._corners.length; index++) { + this._corners[index].node.scaling.setAll(scale); + } + for (let index = 0;index < this._sides.length; index++) { + this._sides[index].node.scaling.setAll(scale); + } + } + } + _update() { + super._update(); + if (!this.gizmoLayer.utilityLayerScene.activeCamera) { + return; + } + if (this._attachedSlate && this._attachedSlate.mesh) { + if (this.fixedScreenSize) { + this._attachedSlate.mesh.absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector); + const distanceFromCamera = this._handleSize * this._tmpVector.length() / this.fixedScreenSizeDistanceFactor; + for (let i = 0;i < this._corners.length; i++) { + this._corners[i].node.scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera); + } + for (let i = 0;i < this._sides.length; i++) { + this._sides[i].node.scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera); + } + } + this._updateHandlesPosition(); + } + } + dispose() { + this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver); + super.dispose(); + for (const corner of this._corners) { + corner.dispose(); + } + for (const side of this._sides) { + side.dispose(); + } + } +} +var init_slateGizmo = __esm(() => { + init_gizmo(); + init_math_constants(); + init_math_vector(); + init_transformNode(); + init_pivotTools(); + init_gizmoHandle(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/holographicSlate.js +class HolographicSlate2 extends ContentDisplay3D2 { + get defaultBehavior() { + return this._defaultBehavior; + } + get dimensions() { + return this._dimensions; + } + set dimensions(value) { + let scale = 1; + if (value.x < this.minDimensions.x || value.y < this.minDimensions.y) { + const newRatio = value.x / value.y; + const minRatio = this.minDimensions.x / this.minDimensions.y; + if (minRatio > newRatio) { + scale = this.minDimensions.x / value.x; + } else { + scale = this.minDimensions.y / value.y; + } + } + this._dimensions.copyFrom(value).scaleInPlace(scale); + this._updatePivot(); + this._positionElements(); + } + get titleBarHeight() { + return this._titleBarHeight; + } + set titleBarHeight(value) { + this._titleBarHeight = value; + } + set renderingGroupId(id) { + this._titleBar.renderingGroupId = id; + this._titleBarTitle.renderingGroupId = id; + this._contentPlate.renderingGroupId = id; + this._backPlate.renderingGroupId = id; + } + get renderingGroupId() { + return this._titleBar.renderingGroupId; + } + set title(title) { + this._titleText = title; + if (this._titleTextComponent) { + this._titleTextComponent.text = title; + } + } + get title() { + return this._titleText; + } + constructor(name323) { + super(name323); + this.titleBarMargin = 0.005; + this.origin = new Vector3(0, 0, 0); + this._dimensions = new Vector2(21.875, 12.5); + this._titleBarHeight = 0.625; + this._titleText = ""; + this._contentScaleRatio = 1; + this.minDimensions = new Vector2(15.625, 6.25); + this.defaultDimensions = this._dimensions.clone(); + this._followButton = new TouchHolographicButton3("followButton" + this.name); + this._followButton.isToggleButton = true; + this._closeButton = new TouchHolographicButton3("closeButton" + this.name); + this._contentViewport = new Viewport(0, 0, 1, 1); + this._contentDragBehavior = new PointerDragBehavior({ + dragPlaneNormal: new Vector3(0, 0, -1) + }); + } + _applyFacade(facadeTexture) { + this._contentMaterial.albedoTexture = facadeTexture; + this._resetContentPositionAndZoom(); + this._applyContentViewport(); + facadeTexture.attachToMesh(this._contentPlate, true); + } + _addControl(control48) { + control48._host = this._host; + if (this._host.utilityLayer) { + control48._prepareNode(this._host.utilityLayer.utilityLayerScene); + } + } + _getTypeName() { + return "HolographicSlate"; + } + _positionElements() { + const followButton = this._followButton; + const closeButton = this._closeButton; + const titleBar = this._titleBar; + const titleBarTitle = this._titleBarTitle; + const contentPlate = this._contentPlate; + const backPlate = this._backPlate; + if (followButton && closeButton && titleBar) { + closeButton.scaling.setAll(this.titleBarHeight); + followButton.scaling.setAll(this.titleBarHeight); + closeButton.position.copyFromFloats(this.dimensions.x - this.titleBarHeight / 2, -this.titleBarHeight / 2, 0).addInPlace(this.origin); + followButton.position.copyFromFloats(this.dimensions.x - 3 * this.titleBarHeight / 2, -this.titleBarHeight / 2, 0).addInPlace(this.origin); + const contentPlateHeight = this.dimensions.y - this.titleBarHeight - this.titleBarMargin; + const rightHandScene = contentPlate.getScene().useRightHandedSystem; + titleBar.scaling.set(this.dimensions.x, this.titleBarHeight, Epsilon); + titleBarTitle.scaling.set(this.dimensions.x - 2 * this.titleBarHeight, this.titleBarHeight, Epsilon); + contentPlate.scaling.copyFromFloats(this.dimensions.x, contentPlateHeight, Epsilon); + backPlate.scaling.copyFromFloats(this.dimensions.x, contentPlateHeight, Epsilon); + titleBar.position.copyFromFloats(this.dimensions.x / 2, -(this.titleBarHeight / 2), 0).addInPlace(this.origin); + titleBarTitle.position.copyFromFloats(this.dimensions.x / 2 - this.titleBarHeight, -(this.titleBarHeight / 2), rightHandScene ? Epsilon : -Epsilon).addInPlace(this.origin); + contentPlate.position.copyFromFloats(this.dimensions.x / 2, -(this.titleBarHeight + this.titleBarMargin + contentPlateHeight / 2), 0).addInPlace(this.origin); + backPlate.position.copyFromFloats(this.dimensions.x / 2, -(this.titleBarHeight + this.titleBarMargin + contentPlateHeight / 2), rightHandScene ? -Epsilon : Epsilon).addInPlace(this.origin); + this._titleTextComponent.host.scaleTo(HolographicSlate2._DEFAULT_TEXT_RESOLUTION_Y * titleBarTitle.scaling.x / titleBarTitle.scaling.y, HolographicSlate2._DEFAULT_TEXT_RESOLUTION_Y); + const aspectRatio = this.dimensions.x / contentPlateHeight; + this._contentViewport.width = this._contentScaleRatio; + this._contentViewport.height = this._contentScaleRatio / aspectRatio; + this._applyContentViewport(); + if (this._gizmo) { + this._gizmo.updateBoundingBox(); + } + } + } + _applyContentViewport() { + var _a; + if (((_a = this._contentPlate) === null || _a === undefined ? undefined : _a.material) && this._contentPlate.material.albedoTexture) { + const tex = this._contentPlate.material.albedoTexture; + tex.uScale = this._contentScaleRatio; + tex.vScale = this._contentScaleRatio / this._contentViewport.width * this._contentViewport.height; + tex.uOffset = this._contentViewport.x; + tex.vOffset = this._contentViewport.y; + } + } + _resetContentPositionAndZoom() { + this._contentViewport.x = 0; + this._contentViewport.y = 1 - this._contentViewport.height / this._contentViewport.width; + this._contentScaleRatio = 1; + } + _updatePivot() { + if (!this.mesh) { + return; + } + const center = new Vector3(this.dimensions.x * 0.5, -this.dimensions.y * 0.5, Epsilon); + center.addInPlace(this.origin); + center.z = 0; + const origin = new Vector3(0, 0, 0); + Vector3.TransformCoordinatesToRef(origin, this.mesh.computeWorldMatrix(true), origin); + this.mesh.setPivotPoint(center); + const origin2 = new Vector3(0, 0, 0); + Vector3.TransformCoordinatesToRef(origin2, this.mesh.computeWorldMatrix(true), origin2); + this.mesh.position.addInPlace(origin).subtractInPlace(origin2); + } + _createNode(scene50) { + const node30 = new Mesh("slate_" + this.name, scene50); + this._titleBar = CreateBox("titleBar_" + this.name, { size: 1 }, scene50); + this._titleBarTitle = CreatePlane("titleText_" + this.name, { size: 1 }, scene50); + this._titleBarTitle.parent = node30; + this._titleBarTitle.isPickable = false; + const adt = AdvancedDynamicTexture2.CreateForMesh(this._titleBarTitle); + this._titleTextComponent = new TextBlock2("titleText_" + this.name, this._titleText); + this._titleTextComponent.textWrapping = TextWrapping2.Ellipsis; + this._titleTextComponent.textHorizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + this._titleTextComponent.color = "white"; + this._titleTextComponent.fontSize = HolographicSlate2._DEFAULT_TEXT_RESOLUTION_Y / 2; + this._titleTextComponent.paddingLeft = HolographicSlate2._DEFAULT_TEXT_RESOLUTION_Y / 4; + adt.addControl(this._titleTextComponent); + if (scene50.useRightHandedSystem) { + const faceUV = new Vector4(0, 0, 1, 1); + this._contentPlate = CreatePlane("contentPlate_" + this.name, { size: 1, sideOrientation: VertexData.BACKSIDE, frontUVs: faceUV }, scene50); + this._backPlate = CreatePlane("backPlate_" + this.name, { size: 1, sideOrientation: VertexData.FRONTSIDE }, scene50); + } else { + const faceUV = new Vector4(0, 0, 1, 1); + this._contentPlate = CreatePlane("contentPlate_" + this.name, { size: 1, sideOrientation: VertexData.FRONTSIDE, frontUVs: faceUV }, scene50); + this._backPlate = CreatePlane("backPlate_" + this.name, { size: 1, sideOrientation: VertexData.BACKSIDE }, scene50); + } + this._titleBar.parent = node30; + this._titleBar.isNearGrabbable = true; + this._contentPlate.parent = node30; + this._backPlate.parent = node30; + this._attachContentPlateBehavior(); + this._addControl(this._followButton); + this._addControl(this._closeButton); + const followButton = this._followButton; + const closeButton = this._closeButton; + followButton.node.parent = node30; + closeButton.node.parent = node30; + this._positionElements(); + this._followButton.imageUrl = HolographicSlate2.ASSETS_BASE_URL + HolographicSlate2.FOLLOW_ICON_FILENAME; + this._closeButton.imageUrl = HolographicSlate2.ASSETS_BASE_URL + HolographicSlate2.CLOSE_ICON_FILENAME; + this._followButton.isBackplateVisible = false; + this._closeButton.isBackplateVisible = false; + this._followButton.onToggleObservable.add((isToggled) => { + this._defaultBehavior.followBehaviorEnabled = isToggled; + if (this._defaultBehavior.followBehaviorEnabled) { + this._defaultBehavior.followBehavior.recenter(); + } + }); + this._closeButton.onPointerClickObservable.add(() => { + this.dispose(); + }); + node30.rotationQuaternion = Quaternion.Identity(); + node30.isVisible = false; + return node30; + } + _attachContentPlateBehavior() { + this._contentDragBehavior.attach(this._contentPlate); + this._contentDragBehavior.moveAttached = false; + this._contentDragBehavior.useObjectOrientationForDragging = true; + this._contentDragBehavior.updateDragPlane = false; + const origin = new Vector3; + const worldDimensions = new Vector3; + const upWorld = new Vector3; + const rightWorld = new Vector3; + const projectedOffset = new Vector2; + let startViewport; + let worldMatrix; + this._contentDragBehavior.onDragStartObservable.add((event) => { + if (!this.node) { + return; + } + startViewport = this._contentViewport.clone(); + worldMatrix = this.node.computeWorldMatrix(true); + origin.copyFrom(event.dragPlanePoint); + worldDimensions.set(this.dimensions.x, this.dimensions.y, Epsilon); + worldDimensions.y -= this.titleBarHeight + this.titleBarMargin; + Vector3.TransformNormalToRef(worldDimensions, worldMatrix, worldDimensions); + upWorld.copyFromFloats(0, 1, 0); + Vector3.TransformNormalToRef(upWorld, worldMatrix, upWorld); + rightWorld.copyFromFloats(1, 0, 0); + Vector3.TransformNormalToRef(rightWorld, worldMatrix, rightWorld); + upWorld.normalize(); + upWorld.scaleInPlace(1 / Vector3.Dot(upWorld, worldDimensions)); + rightWorld.normalize(); + rightWorld.scaleInPlace(1 / Vector3.Dot(rightWorld, worldDimensions)); + }); + const offset = new Vector3; + this._contentDragBehavior.onDragObservable.add((event) => { + offset.copyFrom(event.dragPlanePoint); + offset.subtractInPlace(origin); + projectedOffset.copyFromFloats(Vector3.Dot(offset, rightWorld), Vector3.Dot(offset, upWorld)); + this._contentViewport.x = Scalar.Clamp(startViewport.x - offset.x, 0, 1 - this._contentViewport.width * this._contentScaleRatio); + this._contentViewport.y = Scalar.Clamp(startViewport.y - offset.y, 0, 1 - this._contentViewport.height * this._contentScaleRatio); + this._applyContentViewport(); + }); + } + _affectMaterial(mesh84) { + this._titleBarMaterial = new FluentBackplateMaterial2(`${this.name} plateMaterial`, mesh84.getScene()); + this._contentMaterial = new FluentMaterial2(`${this.name} contentMaterial`, mesh84.getScene()); + this._contentMaterial.renderBorders = true; + this._backMaterial = new FluentBackplateMaterial2(`${this.name} backPlate`, mesh84.getScene()); + this._backMaterial.lineWidth = Epsilon; + this._backMaterial.radius = 0.005; + this._backMaterial.backFaceCulling = true; + this._titleBar.material = this._titleBarMaterial; + this._contentPlate.material = this._contentMaterial; + this._backPlate.material = this._backMaterial; + this._resetContent(); + this._applyContentViewport(); + } + _prepareNode(scene50) { + super._prepareNode(scene50); + this._gizmo = new SlateGizmo2(this._host.utilityLayer); + this._gizmo.attachedSlate = this; + this._defaultBehavior = new DefaultBehavior2; + this._defaultBehavior.attach(this.node, [this._titleBar]); + this._defaultBehavior.sixDofDragBehavior.onDragStartObservable.add(() => { + this._followButton.isToggled = false; + }); + this._positionChangedObserver = this._defaultBehavior.sixDofDragBehavior.onPositionChangedObservable.add(() => { + this._gizmo.updateBoundingBox(); + }); + this._updatePivot(); + this.resetDefaultAspectAndPose(false); + } + resetDefaultAspectAndPose(resetAspect = true) { + if (!this._host || !this._host.utilityLayer || !this.node) { + return; + } + const scene50 = this._host.utilityLayer.utilityLayerScene; + const camera34 = scene50.activeCamera; + if (camera34) { + const worldMatrix = camera34.getWorldMatrix(); + const backward = Vector3.TransformNormal(Vector3.Backward(scene50.useRightHandedSystem), worldMatrix); + this.origin.setAll(0); + this._gizmo.updateBoundingBox(); + const pivot = this.node.getAbsolutePivotPoint(); + this.node.position.copyFrom(camera34.position).subtractInPlace(backward).subtractInPlace(pivot); + this.node.rotationQuaternion = Quaternion.FromLookDirectionLH(backward, new Vector3(0, 1, 0)); + if (resetAspect) { + this.dimensions = this.defaultDimensions; + } + } + } + dispose() { + super.dispose(); + this._titleBarMaterial.dispose(); + this._contentMaterial.dispose(); + this._titleBar.dispose(); + this._titleBarTitle.dispose(); + this._contentPlate.dispose(); + this._backPlate.dispose(); + this._followButton.dispose(); + this._closeButton.dispose(); + this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver); + this._defaultBehavior.sixDofDragBehavior.onPositionChangedObservable.remove(this._positionChangedObserver); + this._defaultBehavior.detach(); + this._gizmo.dispose(); + this._contentDragBehavior.detach(); + } +} +var init_holographicSlate = __esm(() => { + init_contentDisplay3D(); + init_touchHolographicButton(); + init_advancedDynamicTexture(); + init_control(); + init_textBlock(); + init_defaultBehavior(); + init_slateGizmo(); + init_fluentMaterial(); + init_fluentBackplateMaterial(); + init_pointerDragBehavior(); + init_math(); + init_math_constants(); + init_math_scalar(); + init_math_vector(); + init_math_viewport(); + init_boxBuilder(); + init_planeBuilder(); + init_mesh(); + init_mesh_vertexData(); + HolographicSlate2.ASSETS_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/"; + HolographicSlate2.CLOSE_ICON_FILENAME = "IconClose.png"; + HolographicSlate2.FOLLOW_ICON_FILENAME = "IconFollowMe.png"; + HolographicSlate2._DEFAULT_TEXT_RESOLUTION_Y = 102.4; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/meshButton3D.js +class MeshButton3D extends Button3D2 { + constructor(mesh84, name323) { + super(name323); + this._currentMesh = mesh84; + this.pointerEnterAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(1.1); + }; + this.pointerOutAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(1 / 1.1); + }; + this.pointerDownAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(0.95); + }; + this.pointerUpAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(1 / 0.95); + }; + } + _getTypeName() { + return "MeshButton3D"; + } + _createNode(scene50) { + this._currentMesh.getChildMeshes().forEach((mesh84) => { + this._injectGUI3DReservedDataStore(mesh84).control = this; + }); + return this._currentMesh; + } + _affectMaterial(mesh84) { + } +} +var init_meshButton3D = __esm(() => { + init_button3D(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/nearMenu.js +class NearMenu2 extends TouchHolographicMenu2 { + get defaultBehavior() { + return this._defaultBehavior; + } + get isPinned() { + return this._isPinned; + } + set isPinned(value) { + if (this._pinButton.isToggled !== value) { + this._pinButton.isToggled = value; + return; + } + this._isPinned = value; + if (value) { + this._defaultBehavior.followBehaviorEnabled = false; + } else { + this._defaultBehavior.followBehaviorEnabled = true; + } + } + _createPinButton(parent) { + const control48 = new TouchHolographicButton3("pin" + this.name, false); + control48.imageUrl = NearMenu2._ASSETS_BASE_URL + NearMenu2._PIN_ICON_FILENAME; + control48.parent = this; + control48._host = this._host; + control48.isToggleButton = true; + control48.onToggleObservable.add((newState) => { + this.isPinned = newState; + }); + if (this._host.utilityLayer) { + control48._prepareNode(this._host.utilityLayer.utilityLayerScene); + control48.scaling.scaleInPlace(TouchHolographicMenu2.MENU_BUTTON_SCALE); + if (control48.node) { + control48.node.parent = parent; + } + } + return control48; + } + _createNode(scene50) { + const node30 = super._createNode(scene50); + this._pinButton = this._createPinButton(node30); + this.isPinned = false; + this._defaultBehavior.attach(node30, [this._backPlate]); + this._defaultBehavior.followBehavior.ignoreCameraPitchAndRoll = true; + this._defaultBehavior.followBehavior.pitchOffset = -15; + this._defaultBehavior.followBehavior.minimumDistance = 0.3; + this._defaultBehavior.followBehavior.defaultDistance = 0.4; + this._defaultBehavior.followBehavior.maximumDistance = 0.6; + this._backPlate.isNearGrabbable = true; + node30.isVisible = false; + return node30; + } + _finalProcessing() { + super._finalProcessing(); + this._pinButton.position.copyFromFloats((this._backPlate.scaling.x + TouchHolographicMenu2.MENU_BUTTON_SCALE) / 2, this._backPlate.scaling.y / 2, 0); + } + constructor(name323) { + super(name323); + this._isPinned = false; + this._defaultBehavior = new DefaultBehavior2; + this._dragObserver = this._defaultBehavior.sixDofDragBehavior.onDragObservable.add(() => { + this.isPinned = true; + }); + this.backPlateMargin = 1; + } + dispose() { + super.dispose(); + this._defaultBehavior.sixDofDragBehavior.onDragObservable.remove(this._dragObserver); + this._defaultBehavior.detach(); + } +} +var init_nearMenu = __esm(() => { + init_touchHolographicButton(); + init_defaultBehavior(); + init_touchHolographicMenu(); + NearMenu2._ASSETS_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/"; + NearMenu2._PIN_ICON_FILENAME = "IconPin.png"; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/planePanel.js +class PlanePanel extends VolumeBasedPanel2 { + _mapGridNode(control48, nodePosition) { + const mesh84 = control48.mesh; + if (!mesh84) { + return; + } + control48.position = nodePosition.clone(); + const target = TmpVectors.Vector3[0]; + target.copyFrom(nodePosition); + switch (this.orientation) { + case Container3D2.FACEORIGIN_ORIENTATION: + case Container3D2.FACEFORWARD_ORIENTATION: + target.addInPlace(new Vector3(0, 0, 1)); + mesh84.lookAt(target); + break; + case Container3D2.FACEFORWARDREVERSED_ORIENTATION: + case Container3D2.FACEORIGINREVERSED_ORIENTATION: + target.addInPlace(new Vector3(0, 0, -1)); + mesh84.lookAt(target); + break; + } + } +} +var init_planePanel = __esm(() => { + init_math_vector(); + init_container3D(); + init_volumeBasedPanel(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/scatterPanel.js +class ScatterPanel extends VolumeBasedPanel2 { + constructor() { + super(...arguments); + this._iteration = 100; + } + get iteration() { + return this._iteration; + } + set iteration(value) { + if (this._iteration === value) { + return; + } + this._iteration = value; + Tools.SetImmediate(() => { + this._arrangeChildren(); + }); + } + _mapGridNode(control48, nodePosition) { + const mesh84 = control48.mesh; + const newPos = this._scatterMapping(nodePosition); + if (!mesh84) { + return; + } + switch (this.orientation) { + case Container3D2.FACEORIGIN_ORIENTATION: + case Container3D2.FACEFORWARD_ORIENTATION: + mesh84.lookAt(new Vector3(0, 0, 1)); + break; + case Container3D2.FACEFORWARDREVERSED_ORIENTATION: + case Container3D2.FACEORIGINREVERSED_ORIENTATION: + mesh84.lookAt(new Vector3(0, 0, -1)); + break; + } + control48.position = newPos; + } + _scatterMapping(source) { + source.x = (1 - Math.random() * 2) * this._cellWidth; + source.y = (1 - Math.random() * 2) * this._cellHeight; + return source; + } + _finalProcessing() { + const meshes = []; + for (const child of this._children) { + if (!child.mesh) { + continue; + } + meshes.push(child.mesh); + } + for (let count = 0;count < this._iteration; count++) { + meshes.sort((a, b) => { + const distance1 = a.position.lengthSquared(); + const distance2 = b.position.lengthSquared(); + if (distance1 < distance2) { + return 1; + } else if (distance1 > distance2) { + return -1; + } + return 0; + }); + const radiusPaddingSquared = Math.pow(this.margin, 2); + const cellSize = Math.max(this._cellWidth, this._cellHeight); + const difference2D = TmpVectors.Vector2[0]; + const difference = TmpVectors.Vector3[0]; + for (let i = 0;i < meshes.length - 1; i++) { + for (let j = i + 1;j < meshes.length; j++) { + if (i != j) { + meshes[j].position.subtractToRef(meshes[i].position, difference); + difference2D.x = difference.x; + difference2D.y = difference.y; + const combinedRadius = cellSize; + let distance = difference2D.lengthSquared() - radiusPaddingSquared; + const minSeparation = Math.min(distance, radiusPaddingSquared); + distance -= minSeparation; + if (distance < Math.pow(combinedRadius, 2)) { + difference2D.normalize(); + difference.scaleInPlace((combinedRadius - Math.sqrt(distance)) * 0.5); + meshes[j].position.addInPlace(difference); + meshes[i].position.subtractInPlace(difference); + } + } + } + } + } + } +} +var init_scatterPanel = __esm(() => { + init_tools(); + init_math_vector(); + init_volumeBasedPanel(); + init_container3D(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js +var name323, shader321; +var init_mrdlSliderBar_fragment = __esm(() => { + init_shaderStore(); + name323 = "mrdlSliderBarPixelShader"; + shader321 = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform vec4 Global_Left_Index_Middle_Position;uniform vec4 Global_Right_Index_Middle_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Blob_Fragment_B30( +sampler2D Blob_Texture, +vec4 Blob_Info1, +vec4 Blob_Info2, +out vec4 Blob_Color) +{float k1=dot(Blob_Info1.xy,Blob_Info1.xy);float k2=dot(Blob_Info2.xy,Blob_Info2.xy);vec3 closer=k10.0) {C=mix(H,S,k);} else {C=mix(H,G,k); } +return C;} +void Sky_Environment_B50( +vec3 Normal, +vec3 Reflected, +vec4 Sky_Color, +vec4 Horizon_Color, +vec4 Ground_Color, +float Horizon_Power, +out vec4 Reflected_Color, +out vec4 Indirect_Color) +{Reflected_Color=SampleEnv_Bid50(Reflected,Sky_Color,Horizon_Color,Ground_Color,Horizon_Power);Indirect_Color=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);} +void Min_Segment_Distance_B65( +vec3 P0, +vec3 P1, +vec3 Q0, +vec3 Q1, +out vec3 NearP, +out vec3 NearQ, +out float Distance) +{vec3 u=P1-P0;vec3 v=Q1-Q0;vec3 w=P0-Q0;float a=dot(u,u);float b=dot(u,v);float c=dot(v,v);float d=dot(u,w);float e=dot(v,w);float D=a*c-b*b;float sD=D;float tD=D;float sc,sN,tc,tN;if (D<0.00001) {sN=0.0;sD=1.0;tN=e;tD=c;} else {sN=(b*e-c*d);tN=(a*e-b*d);if (sN<0.0) {sN=0.0;tN=e;tD=c;} else if (sN>sD) {sN=sD;tN=e+b;tD=c;}} +if (tN<0.0) {tN=0.0;if (-d<0.0) {sN=0.0;} else if (-d>a) {sN=sD;} else {sN=-d;sD=a;}} else if (tN>tD) {tN=tD;if ((-d+b)<0.0) {sN=0.0;} else if ((-d+b)>a) {sN=sD;} else {sN=(-d+b);sD=a;}} +sc=abs(sN)<0.000001 ? 0.0 : sN/sD;tc=abs(tN)<0.000001 ? 0.0 : tN/tD;NearP=P0+sc*u;NearQ=Q0+tc*v;Distance=distance(NearP,NearQ);} +void To_XYZ_B74( +vec3 Vec3, +out float X, +out float Y, +out float Z) +{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;} +void Finger_Positions_B64( +vec3 Left_Index_Pos, +vec3 Right_Index_Pos, +vec3 Left_Index_Middle_Pos, +vec3 Right_Index_Middle_Pos, +out vec3 Left_Index, +out vec3 Right_Index, +out vec3 Left_Index_Middle, +out vec3 Right_Index_Middle) +{Left_Index= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Left_Index_Pos);Right_Index= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Right_Index_Pos);Left_Index_Middle= (Use_Global_Left_Index ? Global_Left_Index_Middle_Position.xyz : Left_Index_Middle_Pos);Right_Index_Middle= (Use_Global_Right_Index ? Global_Right_Index_Middle_Position.xyz : Right_Index_Middle_Pos);} +void VaryHSV_B108( +vec3 HSV_In, +float Hue_Shift, +float Saturation_Shift, +float Value_Shift, +out vec3 HSV_Out) +{HSV_Out=vec3(fract(HSV_In.x+Hue_Shift),clamp(HSV_In.y+Saturation_Shift,0.0,1.0),clamp(HSV_In.z+Value_Shift,0.0,1.0));} +void Remap_Range_B114( +float In_Min, +float In_Max, +float Out_Min, +float Out_Max, +float In, +out float Out) +{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));} +void To_HSV_B75( +vec4 Color, +out float Hue, +out float Saturation, +out float Value, +out float Alpha, +out vec3 HSV) +{vec4 K=vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);vec4 p=Color.g { + init_shaderStore(); + name324 = "mrdlSliderBarVertexShader"; + shader322 = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv; +#ifdef TANGENT +attribute vec3 tangent; +#else +const vec3 tangent=vec3(0.); +#endif +uniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Object_To_World_Pos_B12( +vec3 Pos_Object, +out vec3 Pos_World) +{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;} +void Object_To_World_Normal_B32( +vec3 Nrm_Object, +out vec3 Nrm_World) +{Nrm_World=(vec4(Nrm_Object,0.0)).xyz;} +void Blob_Vertex_B23( +vec3 Position, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +vec3 Blob_Position, +float Intensity, +float Blob_Near_Size, +float Blob_Far_Size, +float Blob_Near_Distance, +float Blob_Far_Distance, +float Blob_Fade_Length, +float Blob_Pulse, +float Blob_Fade, +out vec4 Blob_Info) +{vec3 blob= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Blob_Position);vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);} +void Blob_Vertex_B24( +vec3 Position, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +vec3 Blob_Position, +float Intensity, +float Blob_Near_Size, +float Blob_Far_Size, +float Blob_Near_Distance, +float Blob_Far_Distance, +float Blob_Fade_Length, +float Blob_Pulse, +float Blob_Fade, +out vec4 Blob_Info) +{vec3 blob= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Blob_Position);vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);} +void Move_Verts_B130( +float Anisotropy, +vec3 P, +float Radius, +float Bevel, +vec3 Normal_Object, +float ScaleZ, +float Stretch, +out vec3 New_P, +out vec2 New_UV, +out float Radial_Gradient, +out vec3 Radial_Dir, +out vec3 New_Normal) +{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;float deltad=(length(delta)*2.0);float f=(Bevel+(Radius-Bevel)*Stretch)/Radius;float innerd=clamp(deltad*2.0,0.0,1.0);float outerd=clamp(deltad*2.0-1.0,0.0,1.0);float bevelAngle=outerd*3.14159*0.5;float sinb=sin(bevelAngle);float cosb=cos(bevelAngle);float beveld=(1.0-f)*innerd+f*sinb;float br=outerd;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);float dir=P.z<0.0001 ? 1.0 : -1.0;New_UV=center+r2*((0.5-center)+normalize(delta+vec2(0.0,0.000001))*beveld*0.5);New_P=vec3(New_UV-0.5,P.z+dir*(1.0-cosb)*Bevel*ScaleZ);Radial_Gradient=clamp((deltad-0.5)*2.0,0.0,1.0);Radial_Dir=vec3(delta*r2,0.0);vec3 beveledNormal=cosb*Normal_Object+sinb*vec3(delta.x,delta.y,0.0);New_Normal=Normal_Object.z==0.0 ? Normal_Object : beveledNormal;} +void Object_To_World_Dir_B60( +vec3 Dir_Object, +out vec3 Normal_World, +out vec3 Normal_World_N, +out float Normal_Length) +{Normal_World=(world*vec4(Dir_Object,0.0)).xyz;Normal_Length=length(Normal_World);Normal_World_N=Normal_World/Normal_Length;} +void To_XYZ_B78( +vec3 Vec3, +out float X, +out float Y, +out float Z) +{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;} +void Conditional_Float_B93( +bool Which, +float If_True, +float If_False, +out float Result) +{Result=Which ? If_True : If_False;} +void Object_To_World_Dir_B28( +vec3 Dir_Object, +out vec3 Binormal_World, +out vec3 Binormal_World_N, +out float Binormal_Length) +{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;} +void Pick_Radius_B69( +float Radius, +float Radius_Top_Left, +float Radius_Top_Right, +float Radius_Bottom_Left, +float Radius_Bottom_Right, +vec3 Position, +out float Result) +{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;} +void Conditional_Float_B36( +bool Which, +float If_True, +float If_False, +out float Result) +{Result=Which ? If_True : If_False;} +void Greater_Than_B37( +float Left, +float Right, +out bool Not_Greater_Than, +out bool Greater_Than) +{Greater_Than=Left>Right;Not_Greater_Than=!Greater_Than;} +void Remap_Range_B105( +float In_Min, +float In_Max, +float Out_Min, +float Out_Max, +float In, +out float Out) +{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));} +void main() +{vec2 XY_Q85;XY_Q85=(uv-vec2(0.5,0.5))*_Decal_Scale_XY_+vec2(0.5,0.5);vec3 Tangent_World_Q27;vec3 Tangent_World_N_Q27;float Tangent_Length_Q27;Tangent_World_Q27=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q27=length(Tangent_World_Q27);Tangent_World_N_Q27=Tangent_World_Q27/Tangent_Length_Q27;vec3 Normal_World_Q60;vec3 Normal_World_N_Q60;float Normal_Length_Q60;Object_To_World_Dir_B60(vec3(0,0,1),Normal_World_Q60,Normal_World_N_Q60,Normal_Length_Q60);float X_Q78;float Y_Q78;float Z_Q78;To_XYZ_B78(position,X_Q78,Y_Q78,Z_Q78);vec3 Nrm_World_Q26;Nrm_World_Q26=normalize((world*vec4(normal,0.0)).xyz);vec3 Binormal_World_Q28;vec3 Binormal_World_N_Q28;float Binormal_Length_Q28;Object_To_World_Dir_B28(vec3(0,1,0),Binormal_World_Q28,Binormal_World_N_Q28,Binormal_Length_Q28);float Anisotropy_Q29=Tangent_Length_Q27/Binormal_Length_Q28;float Result_Q69;Pick_Radius_B69(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q69);float Anisotropy_Q53=Binormal_Length_Q28/Normal_Length_Q60;bool Not_Greater_Than_Q37;bool Greater_Than_Q37;Greater_Than_B37(Z_Q78,0.0,Not_Greater_Than_Q37,Greater_Than_Q37);vec4 Linear_Q101;Linear_Q101.rgb=clamp(_Left_Color_.rgb*_Left_Color_.rgb,0.0,1.0);Linear_Q101.a=_Left_Color_.a;vec4 Linear_Q102;Linear_Q102.rgb=clamp(_Right_Color_.rgb*_Right_Color_.rgb,0.0,1.0);Linear_Q102.a=_Right_Color_.a;vec3 Difference_Q61=vec3(0,0,0)-Normal_World_N_Q60;vec4 Out_Color_Q34=vec4(X_Q78,Y_Q78,Z_Q78,1);float Result_Q36;Conditional_Float_B36(Greater_Than_Q37,_Bevel_Back_,_Bevel_Front_,Result_Q36);float Result_Q94;Conditional_Float_B36(Greater_Than_Q37,_Bevel_Back_Stretch_,_Bevel_Front_Stretch_,Result_Q94);vec3 New_P_Q130;vec2 New_UV_Q130;float Radial_Gradient_Q130;vec3 Radial_Dir_Q130;vec3 New_Normal_Q130;Move_Verts_B130(Anisotropy_Q29,position,Result_Q69,Result_Q36,normal,Anisotropy_Q53,Result_Q94,New_P_Q130,New_UV_Q130,Radial_Gradient_Q130,Radial_Dir_Q130,New_Normal_Q130);float X_Q98;float Y_Q98;X_Q98=New_UV_Q130.x;Y_Q98=New_UV_Q130.y;vec3 Pos_World_Q12;Object_To_World_Pos_B12(New_P_Q130,Pos_World_Q12);vec3 Nrm_World_Q32;Object_To_World_Normal_B32(New_Normal_Q130,Nrm_World_Q32);vec4 Blob_Info_Q23; +#if BLOB_ENABLE +Blob_Vertex_B23(Pos_World_Q12,Nrm_World_Q26,Tangent_World_N_Q27,Binormal_World_N_Q28,_Blob_Position_,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q23); +#else +Blob_Info_Q23=vec4(0,0,0,0); +#endif +vec4 Blob_Info_Q24; +#if BLOB_ENABLE_2 +Blob_Vertex_B24(Pos_World_Q12,Nrm_World_Q26,Tangent_World_N_Q27,Binormal_World_N_Q28,_Blob_Position_2_,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q24); +#else +Blob_Info_Q24=vec4(0,0,0,0); +#endif +float Out_Q105;Remap_Range_B105(0.0,1.0,0.0,1.0,X_Q98,Out_Q105);float X_Q86;float Y_Q86;float Z_Q86;To_XYZ_B78(Nrm_World_Q32,X_Q86,Y_Q86,Z_Q86);vec4 Color_At_T_Q97=mix(Linear_Q101,Linear_Q102,Out_Q105);float Minus_F_Q87=-Z_Q86;float R_Q99;float G_Q99;float B_Q99;float A_Q99;R_Q99=Color_At_T_Q97.r; G_Q99=Color_At_T_Q97.g; B_Q99=Color_At_T_Q97.b; A_Q99=Color_At_T_Q97.a;float ClampF_Q88=clamp(0.0,Minus_F_Q87,1.0);float Result_Q93;Conditional_Float_B93(_Decal_Front_Only_,ClampF_Q88,1.0,Result_Q93);vec4 Vec4_Q89=vec4(Result_Q93,Radial_Gradient_Q130,G_Q99,B_Q99);vec3 Position=Pos_World_Q12;vec3 Normal=Nrm_World_Q32;vec2 UV=XY_Q85;vec3 Tangent=Tangent_World_N_Q27;vec3 Binormal=Difference_Q61;vec4 Color=Out_Color_Q34;vec4 Extra1=Vec4_Q89;vec4 Extra2=Blob_Info_Q23;vec4 Extra3=Blob_Info_Q24;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}`; + ShaderStore.ShadersStore[name324] = shader322; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/mrdl/mrdlSliderBarMaterial.js +class MRDLSliderBarMaterialDefines2 extends MaterialDefines { + constructor() { + super(); + this.SKY_ENABLED = true; + this.BLOB_ENABLE_2 = true; + this.IRIDESCENCE_ENABLED = true; + this._needNormals = true; + this._needUVs = true; + this.rebuild(); + } +} + +class MRDLSliderBarMaterial2 extends PushMaterial { + constructor(name325, scene50) { + super(name325, scene50); + this.radius = 0.6; + this.bevelFront = 0.6; + this.bevelFrontStretch = 0.077; + this.bevelBack = 0; + this.bevelBackStretch = 0; + this.radiusTopLeft = 1; + this.radiusTopRight = 1; + this.radiusBottomLeft = 1; + this.radiusBottomRight = 1; + this.bulgeEnabled = false; + this.bulgeHeight = -0.323; + this.bulgeRadius = 0.73; + this.sunIntensity = 1.102; + this.sunTheta = 0.76; + this.sunPhi = 0.526; + this.indirectDiffuse = 0.658; + this.albedo = new Color4(0.0117647, 0.505882, 0.996078, 1); + this.specular = 0; + this.shininess = 10; + this.sharpness = 0; + this.subsurface = 0; + this.leftGradientColor = new Color4(0.0117647, 0.505882, 0.996078, 1); + this.rightGradientColor = new Color4(0.0117647, 0.505882, 0.996078, 1); + this.reflection = 0.749; + this.frontReflect = 0; + this.edgeReflect = 0.09; + this.power = 8.13; + this.skyColor = new Color4(0.0117647, 0.964706, 0.996078, 1); + this.horizonColor = new Color4(0.0117647, 0.333333, 0.996078, 1); + this.groundColor = new Color4(0, 0.254902, 0.996078, 1); + this.horizonPower = 1; + this.width = 0.02; + this.fuzz = 0.5; + this.minFuzz = 0.001; + this.clipFade = 0.01; + this.hueShift = 0; + this.saturationShift = 0; + this.valueShift = 0; + this.blobPosition = new Vector3(0, 0, 0.1); + this.blobIntensity = 0.5; + this.blobNearSize = 0.01; + this.blobFarSize = 0.03; + this.blobNearDistance = 0; + this.blobFarDistance = 0.08; + this.blobFadeLength = 0.576; + this.blobPulse = 0; + this.blobFade = 1; + this.blobPosition2 = new Vector3(0.2, 0, 0.1); + this.blobNearSize2 = 0.01; + this.blobPulse2 = 0; + this.blobFade2 = 1; + this.blobTexture = new Texture("", this.getScene()); + this.leftIndexPosition = new Vector3(0, 0, 1); + this.rightIndexPosition = new Vector3(-1, -1, -1); + this.leftIndexMiddlePosition = new Vector3(0, 0, 0); + this.rightIndexMiddlePosition = new Vector3(0, 0, 0); + this.decalScaleXY = new Vector2(1.5, 1.5); + this.decalFrontOnly = true; + this.rimIntensity = 0.287; + this.rimHueShift = 0; + this.rimSaturationShift = 0; + this.rimValueShift = -1; + this.iridescenceIntensity = 0; + this.useGlobalLeftIndex = 1; + this.useGlobalRightIndex = 1; + this.globalLeftIndexTipProximity = 0; + this.globalRightIndexTipProximity = 0; + this.globalLeftIndexTipPosition = new Vector4(0.5, 0, -0.55, 1); + this.globaRightIndexTipPosition = new Vector4(0, 0, 0, 1); + this.globalLeftThumbTipPosition = new Vector4(0.5, 0, -0.55, 1); + this.globalRightThumbTipPosition = new Vector4(0, 0, 0, 1); + this.globalLeftIndexMiddlePosition = new Vector4(0.5, 0, -0.55, 1); + this.globalRightIndexMiddlePosition = new Vector4(0, 0, 0, 1); + this.alphaMode = Constants.ALPHA_DISABLE; + this.backFaceCulling = false; + this._blueGradientTexture = new Texture(MRDLSliderBarMaterial2.BLUE_GRADIENT_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE); + this._decalTexture = new Texture("", this.getScene()); + this._reflectionMapTexture = new Texture("", this.getScene()); + this._indirectEnvTexture = new Texture("", this.getScene()); + } + needAlphaBlending() { + return false; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh84, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new MRDLSliderBarMaterialDefines2; + } + const defines = subMesh11.materialDefines; + const scene50 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene50.getEngine(); + MaterialHelper.PrepareDefinesForAttributes(mesh84, defines, false, false); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + defines.IMAGEPROCESSINGPOSTPROCESS = scene50.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + if (defines.TANGENT) { + attribs.push(VertexBuffer.TangentKind); + } + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "mrdlSliderBar"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "viewProjection", + "cameraPosition", + "_Radius_", + "_Bevel_Front_", + "_Bevel_Front_Stretch_", + "_Bevel_Back_", + "_Bevel_Back_Stretch_", + "_Radius_Top_Left_", + "_Radius_Top_Right_", + "_Radius_Bottom_Left_", + "_Radius_Bottom_Right_", + "_Bulge_Enabled_", + "_Bulge_Height_", + "_Bulge_Radius_", + "_Sun_Intensity_", + "_Sun_Theta_", + "_Sun_Phi_", + "_Indirect_Diffuse_", + "_Albedo_", + "_Specular_", + "_Shininess_", + "_Sharpness_", + "_Subsurface_", + "_Left_Color_", + "_Right_Color_", + "_Reflection_", + "_Front_Reflect_", + "_Edge_Reflect_", + "_Power_", + "_Sky_Color_", + "_Horizon_Color_", + "_Ground_Color_", + "_Horizon_Power_", + "_Reflection_Map_", + "_Indirect_Environment_", + "_Width_", + "_Fuzz_", + "_Min_Fuzz_", + "_Clip_Fade_", + "_Hue_Shift_", + "_Saturation_Shift_", + "_Value_Shift_", + "_Blob_Position_", + "_Blob_Intensity_", + "_Blob_Near_Size_", + "_Blob_Far_Size_", + "_Blob_Near_Distance_", + "_Blob_Far_Distance_", + "_Blob_Fade_Length_", + "_Blob_Pulse_", + "_Blob_Fade_", + "_Blob_Texture_", + "_Blob_Position_2_", + "_Blob_Near_Size_2_", + "_Blob_Pulse_2_", + "_Blob_Fade_2_", + "_Left_Index_Pos_", + "_Right_Index_Pos_", + "_Left_Index_Middle_Pos_", + "_Right_Index_Middle_Pos_", + "_Decal_", + "_Decal_Scale_XY_", + "_Decal_Front_Only_", + "_Rim_Intensity_", + "_Rim_Texture_", + "_Rim_Hue_Shift_", + "_Rim_Saturation_Shift_", + "_Rim_Value_Shift_", + "_Iridescence_Intensity_", + "_Iridescence_Texture_", + "Use_Global_Left_Index", + "Use_Global_Right_Index", + "Global_Left_Index_Tip_Position", + "Global_Right_Index_Tip_Position", + "Global_Left_Thumb_Tip_Position", + "Global_Right_Thumb_Tip_Position", + "Global_Left_Index_Middle_Position;", + "Global_Right_Index_Middle_Position", + "Global_Left_Index_Tip_Proximity", + "Global_Right_Index_Tip_Proximity" + ]; + const samplers = ["_Rim_Texture_", "_Iridescence_Texture_"]; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh84, subMesh11) { + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix()); + this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera.position); + this._activeEffect.setFloat("_Radius_", this.radius); + this._activeEffect.setFloat("_Bevel_Front_", this.bevelFront); + this._activeEffect.setFloat("_Bevel_Front_Stretch_", this.bevelFrontStretch); + this._activeEffect.setFloat("_Bevel_Back_", this.bevelBack); + this._activeEffect.setFloat("_Bevel_Back_Stretch_", this.bevelBackStretch); + this._activeEffect.setFloat("_Radius_Top_Left_", this.radiusTopLeft); + this._activeEffect.setFloat("_Radius_Top_Right_", this.radiusTopRight); + this._activeEffect.setFloat("_Radius_Bottom_Left_", this.radiusBottomLeft); + this._activeEffect.setFloat("_Radius_Bottom_Right_", this.radiusBottomRight); + this._activeEffect.setFloat("_Bulge_Enabled_", this.bulgeEnabled ? 1 : 0); + this._activeEffect.setFloat("_Bulge_Height_", this.bulgeHeight); + this._activeEffect.setFloat("_Bulge_Radius_", this.bulgeRadius); + this._activeEffect.setFloat("_Sun_Intensity_", this.sunIntensity); + this._activeEffect.setFloat("_Sun_Theta_", this.sunTheta); + this._activeEffect.setFloat("_Sun_Phi_", this.sunPhi); + this._activeEffect.setFloat("_Indirect_Diffuse_", this.indirectDiffuse); + this._activeEffect.setDirectColor4("_Albedo_", this.albedo); + this._activeEffect.setFloat("_Specular_", this.specular); + this._activeEffect.setFloat("_Shininess_", this.shininess); + this._activeEffect.setFloat("_Sharpness_", this.sharpness); + this._activeEffect.setFloat("_Subsurface_", this.subsurface); + this._activeEffect.setDirectColor4("_Left_Color_", this.leftGradientColor); + this._activeEffect.setDirectColor4("_Right_Color_", this.rightGradientColor); + this._activeEffect.setFloat("_Reflection_", this.reflection); + this._activeEffect.setFloat("_Front_Reflect_", this.frontReflect); + this._activeEffect.setFloat("_Edge_Reflect_", this.edgeReflect); + this._activeEffect.setFloat("_Power_", this.power); + this._activeEffect.setDirectColor4("_Sky_Color_", this.skyColor); + this._activeEffect.setDirectColor4("_Horizon_Color_", this.horizonColor); + this._activeEffect.setDirectColor4("_Ground_Color_", this.groundColor); + this._activeEffect.setFloat("_Horizon_Power_", this.horizonPower); + this._activeEffect.setTexture("_Reflection_Map_", this._reflectionMapTexture); + this._activeEffect.setTexture("_Indirect_Environment_", this._indirectEnvTexture); + this._activeEffect.setFloat("_Width_", this.width); + this._activeEffect.setFloat("_Fuzz_", this.fuzz); + this._activeEffect.setFloat("_Min_Fuzz_", this.minFuzz); + this._activeEffect.setFloat("_Clip_Fade_", this.clipFade); + this._activeEffect.setFloat("_Hue_Shift_", this.hueShift); + this._activeEffect.setFloat("_Saturation_Shift_", this.saturationShift); + this._activeEffect.setFloat("_Value_Shift_", this.valueShift); + this._activeEffect.setVector3("_Blob_Position_", this.blobPosition); + this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity); + this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize); + this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize); + this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance); + this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance); + this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength); + this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse); + this._activeEffect.setFloat("_Blob_Fade_", this.blobFade); + this._activeEffect.setTexture("_Blob_Texture_", this.blobTexture); + this._activeEffect.setVector3("_Blob_Position_2_", this.blobPosition2); + this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2); + this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2); + this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2); + this._activeEffect.setVector3("_Left_Index_Pos_", this.leftIndexPosition); + this._activeEffect.setVector3("_Right_Index_Pos_", this.rightIndexPosition); + this._activeEffect.setVector3("_Left_Index_Middle_Pos_", this.leftIndexMiddlePosition); + this._activeEffect.setVector3("_Right_Index_Middle_Pos_", this.rightIndexMiddlePosition); + this._activeEffect.setTexture("_Decal_", this._decalTexture); + this._activeEffect.setVector2("_Decal_Scale_XY_", this.decalScaleXY); + this._activeEffect.setFloat("_Decal_Front_Only_", this.decalFrontOnly ? 1 : 0); + this._activeEffect.setFloat("_Rim_Intensity_", this.rimIntensity); + this._activeEffect.setTexture("_Rim_Texture_", this._blueGradientTexture); + this._activeEffect.setFloat("_Rim_Hue_Shift_", this.rimHueShift); + this._activeEffect.setFloat("_Rim_Saturation_Shift_", this.rimSaturationShift); + this._activeEffect.setFloat("_Rim_Value_Shift_", this.rimValueShift); + this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity); + this._activeEffect.setTexture("_Iridescence_Texture_", this._blueGradientTexture); + this._activeEffect.setFloat("Use_Global_Left_Index", this.useGlobalLeftIndex); + this._activeEffect.setFloat("Use_Global_Right_Index", this.useGlobalRightIndex); + this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this.globalLeftIndexTipPosition); + this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this.globaRightIndexTipPosition); + this._activeEffect.setVector4("Global_Left_Thumb_Tip_Position", this.globalLeftThumbTipPosition); + this._activeEffect.setVector4("Global_Right_Thumb_Tip_Position", this.globalRightThumbTipPosition); + this._activeEffect.setVector4("Global_Left_Index_Middle_Position", this.globalLeftIndexMiddlePosition); + this._activeEffect.setVector4("Global_Right_Index_Middle_Position", this.globalRightIndexMiddlePosition); + this._activeEffect.setFloat("Global_Left_Index_Tip_Proximity", this.globalLeftIndexTipProximity); + this._activeEffect.setFloat("Global_Right_Index_Tip_Proximity", this.globalRightIndexTipProximity); + this._afterBind(mesh84, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + this._reflectionMapTexture.dispose(); + this._indirectEnvTexture.dispose(); + this._blueGradientTexture.dispose(); + this._decalTexture.dispose(); + } + clone(name325) { + return SerializationHelper.Clone(() => new MRDLSliderBarMaterial2(name325, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.MRDLSliderBarMaterial"; + return serializationObject; + } + getClassName() { + return "MRDLSliderBarMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new MRDLSliderBarMaterial2(source.name, scene50), source, scene50, rootUrl); + } +} +var init_mrdlSliderBarMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_texture(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_buffer(); + init_typeStore(); + init_math_color(); + init_effectFallbacks(); + init_constants(); + init_mrdlSliderBar_fragment(); + init_mrdlSliderBar_vertex(); + MRDLSliderBarMaterial2.BLUE_GRADIENT_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-blue-gradient.png"; + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "radius", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "bevelFront", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "bevelFrontStretch", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "bevelBack", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "bevelBackStretch", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "radiusTopLeft", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "radiusTopRight", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "radiusBottomLeft", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "radiusBottomRight", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "bulgeEnabled", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "bulgeHeight", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "bulgeRadius", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "sunIntensity", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "sunTheta", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "sunPhi", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "indirectDiffuse", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "albedo", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "specular", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "shininess", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "sharpness", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "subsurface", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "leftGradientColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "rightGradientColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "reflection", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "frontReflect", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "edgeReflect", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "power", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "skyColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "horizonColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "groundColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "horizonPower", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "width", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "fuzz", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "minFuzz", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "clipFade", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "hueShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "saturationShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "valueShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "blobPosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "blobIntensity", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "blobNearSize", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "blobFarSize", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "blobNearDistance", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "blobFarDistance", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "blobFadeLength", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "blobPulse", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "blobFade", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "blobPosition2", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "blobNearSize2", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "blobPulse2", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "blobFade2", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "blobTexture", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "leftIndexPosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "rightIndexPosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "leftIndexMiddlePosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "rightIndexMiddlePosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "decalScaleXY", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "decalFrontOnly", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "rimIntensity", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "rimHueShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "rimSaturationShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "rimValueShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial2.prototype, "iridescenceIntensity", undefined); + RegisterClass("BABYLON.GUI.MRDLSliderBarMaterial", MRDLSliderBarMaterial2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js +var name325, shader323; +var init_mrdlSliderThumb_fragment = __esm(() => { + init_shaderStore(); + name325 = "mrdlSliderThumbPixelShader"; + shader323 = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform vec4 Global_Left_Index_Middle_Position;uniform vec4 Global_Right_Index_Middle_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Blob_Fragment_B180( +sampler2D Blob_Texture, +vec4 Blob_Info1, +vec4 Blob_Info2, +out vec4 Blob_Color) +{float k1=dot(Blob_Info1.xy,Blob_Info1.xy);float k2=dot(Blob_Info2.xy,Blob_Info2.xy);vec3 closer=k10.0) {C=mix(H,S,k);} else {C=mix(H,G,k); } +return C;} +void Sky_Environment_B200( +vec3 Normal, +vec3 Reflected, +vec4 Sky_Color, +vec4 Horizon_Color, +vec4 Ground_Color, +float Horizon_Power, +out vec4 Reflected_Color, +out vec4 Indirect_Color) +{Reflected_Color=SampleEnv_Bid200(Reflected,Sky_Color,Horizon_Color,Ground_Color,Horizon_Power);Indirect_Color=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);} +void Min_Segment_Distance_B215( +vec3 P0, +vec3 P1, +vec3 Q0, +vec3 Q1, +out vec3 NearP, +out vec3 NearQ, +out float Distance) +{vec3 u=P1-P0;vec3 v=Q1-Q0;vec3 w=P0-Q0;float a=dot(u,u);float b=dot(u,v);float c=dot(v,v);float d=dot(u,w);float e=dot(v,w);float D=a*c-b*b;float sD=D;float tD=D;float sc,sN,tc,tN;if (D<0.00001) {sN=0.0;sD=1.0;tN=e;tD=c;} else {sN=(b*e-c*d);tN=(a*e-b*d);if (sN<0.0) {sN=0.0;tN=e;tD=c;} else if (sN>sD) {sN=sD;tN=e+b;tD=c;}} +if (tN<0.0) {tN=0.0;if (-d<0.0) {sN=0.0;} else if (-d>a) {sN=sD;} else {sN=-d;sD=a;}} else if (tN>tD) {tN=tD;if ((-d+b)<0.0) {sN=0.0;} else if ((-d+b)>a) {sN=sD;} else {sN=(-d+b);sD=a;}} +sc=abs(sN)<0.000001 ? 0.0 : sN/sD;tc=abs(tN)<0.000001 ? 0.0 : tN/tD;NearP=P0+sc*u;NearQ=Q0+tc*v;Distance=distance(NearP,NearQ);} +void To_XYZ_B224( +vec3 Vec3, +out float X, +out float Y, +out float Z) +{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;} +void Finger_Positions_B214( +vec3 Left_Index_Pos, +vec3 Right_Index_Pos, +vec3 Left_Index_Middle_Pos, +vec3 Right_Index_Middle_Pos, +out vec3 Left_Index, +out vec3 Right_Index, +out vec3 Left_Index_Middle, +out vec3 Right_Index_Middle) +{Left_Index= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Left_Index_Pos);Right_Index= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Right_Index_Pos);Left_Index_Middle= (Use_Global_Left_Index ? Global_Left_Index_Middle_Position.xyz : Left_Index_Middle_Pos);Right_Index_Middle= (Use_Global_Right_Index ? Global_Right_Index_Middle_Position.xyz : Right_Index_Middle_Pos);} +void VaryHSV_B258( +vec3 HSV_In, +float Hue_Shift, +float Saturation_Shift, +float Value_Shift, +out vec3 HSV_Out) +{HSV_Out=vec3(fract(HSV_In.x+Hue_Shift),clamp(HSV_In.y+Saturation_Shift,0.0,1.0),clamp(HSV_In.z+Value_Shift,0.0,1.0));} +void Remap_Range_B264( +float In_Min, +float In_Max, +float Out_Min, +float Out_Max, +float In, +out float Out) +{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));} +void To_HSV_B225( +vec4 Color, +out float Hue, +out float Saturation, +out float Value, +out float Alpha, +out vec3 HSV) +{vec4 K=vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);vec4 p=Color.g { + init_shaderStore(); + name326 = "mrdlSliderThumbVertexShader"; + shader324 = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv; +#ifdef TANGENT +attribute vec3 tangent; +#else +const vec3 tangent=vec3(0.); +#endif +uniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Object_To_World_Pos_B162( +vec3 Pos_Object, +out vec3 Pos_World) +{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;} +void Object_To_World_Normal_B182( +vec3 Nrm_Object, +out vec3 Nrm_World) +{Nrm_World=(vec4(Nrm_Object,0.0)).xyz;} +void Blob_Vertex_B173( +vec3 Position, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +vec3 Blob_Position, +float Intensity, +float Blob_Near_Size, +float Blob_Far_Size, +float Blob_Near_Distance, +float Blob_Far_Distance, +float Blob_Fade_Length, +float Blob_Pulse, +float Blob_Fade, +out vec4 Blob_Info) +{vec3 blob= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Blob_Position);vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);} +void Blob_Vertex_B174( +vec3 Position, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +vec3 Blob_Position, +float Intensity, +float Blob_Near_Size, +float Blob_Far_Size, +float Blob_Near_Distance, +float Blob_Far_Distance, +float Blob_Fade_Length, +float Blob_Pulse, +float Blob_Fade, +out vec4 Blob_Info) +{vec3 blob= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Blob_Position);vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);} +void Move_Verts_B280( +float Anisotropy, +vec3 P, +float Radius, +float Bevel, +vec3 Normal_Object, +float ScaleZ, +float Stretch, +out vec3 New_P, +out vec2 New_UV, +out float Radial_Gradient, +out vec3 Radial_Dir, +out vec3 New_Normal) +{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;float deltad=(length(delta)*2.0);float f=(Bevel+(Radius-Bevel)*Stretch)/Radius;float innerd=clamp(deltad*2.0,0.0,1.0);float outerd=clamp(deltad*2.0-1.0,0.0,1.0);float bevelAngle=outerd*3.14159*0.5;float sinb=sin(bevelAngle);float cosb=cos(bevelAngle);float beveld=(1.0-f)*innerd+f*sinb;float br=outerd;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);float dir=P.z<0.0001 ? 1.0 : -1.0;New_UV=center+r2*((0.5-center)+normalize(delta+vec2(0.0,0.000001))*beveld*0.5);New_P=vec3(New_UV-0.5,P.z+dir*(1.0-cosb)*Bevel*ScaleZ);Radial_Gradient=clamp((deltad-0.5)*2.0,0.0,1.0);Radial_Dir=vec3(delta*r2,0.0);vec3 beveledNormal=cosb*Normal_Object+sinb*vec3(delta.x,delta.y,0.0);New_Normal=Normal_Object.z==0.0 ? Normal_Object : beveledNormal;} +void Object_To_World_Dir_B210( +vec3 Dir_Object, +out vec3 Normal_World, +out vec3 Normal_World_N, +out float Normal_Length) +{Normal_World=(world*vec4(Dir_Object,0.0)).xyz;Normal_Length=length(Normal_World);Normal_World_N=Normal_World/Normal_Length;} +void To_XYZ_B228( +vec3 Vec3, +out float X, +out float Y, +out float Z) +{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;} +void Conditional_Float_B243( +bool Which, +float If_True, +float If_False, +out float Result) +{Result=Which ? If_True : If_False;} +void Object_To_World_Dir_B178( +vec3 Dir_Object, +out vec3 Binormal_World, +out vec3 Binormal_World_N, +out float Binormal_Length) +{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;} +void Pick_Radius_B219( +float Radius, +float Radius_Top_Left, +float Radius_Top_Right, +float Radius_Bottom_Left, +float Radius_Bottom_Right, +vec3 Position, +out float Result) +{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;} +void Conditional_Float_B186( +bool Which, +float If_True, +float If_False, +out float Result) +{Result=Which ? If_True : If_False;} +void Greater_Than_B187( +float Left, +float Right, +out bool Not_Greater_Than, +out bool Greater_Than) +{Greater_Than=Left>Right;Not_Greater_Than=!Greater_Than;} +void Remap_Range_B255( +float In_Min, +float In_Max, +float Out_Min, +float Out_Max, +float In, +out float Out) +{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));} +void main() +{vec2 XY_Q235;XY_Q235=(uv-vec2(0.5,0.5))*_Decal_Scale_XY_+vec2(0.5,0.5);vec3 Tangent_World_Q177;vec3 Tangent_World_N_Q177;float Tangent_Length_Q177;Tangent_World_Q177=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q177=length(Tangent_World_Q177);Tangent_World_N_Q177=Tangent_World_Q177/Tangent_Length_Q177;vec3 Normal_World_Q210;vec3 Normal_World_N_Q210;float Normal_Length_Q210;Object_To_World_Dir_B210(vec3(0,0,1),Normal_World_Q210,Normal_World_N_Q210,Normal_Length_Q210);float X_Q228;float Y_Q228;float Z_Q228;To_XYZ_B228(position,X_Q228,Y_Q228,Z_Q228);vec3 Nrm_World_Q176;Nrm_World_Q176=normalize((world*vec4(normal,0.0)).xyz);vec3 Binormal_World_Q178;vec3 Binormal_World_N_Q178;float Binormal_Length_Q178;Object_To_World_Dir_B178(vec3(0,1,0),Binormal_World_Q178,Binormal_World_N_Q178,Binormal_Length_Q178);float Anisotropy_Q179=Tangent_Length_Q177/Binormal_Length_Q178;float Result_Q219;Pick_Radius_B219(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q219);float Anisotropy_Q203=Binormal_Length_Q178/Normal_Length_Q210;bool Not_Greater_Than_Q187;bool Greater_Than_Q187;Greater_Than_B187(Z_Q228,0.0,Not_Greater_Than_Q187,Greater_Than_Q187);vec4 Linear_Q251;Linear_Q251.rgb=clamp(_Left_Color_.rgb*_Left_Color_.rgb,0.0,1.0);Linear_Q251.a=_Left_Color_.a;vec4 Linear_Q252;Linear_Q252.rgb=clamp(_Right_Color_.rgb*_Right_Color_.rgb,0.0,1.0);Linear_Q252.a=_Right_Color_.a;vec3 Difference_Q211=vec3(0,0,0)-Normal_World_N_Q210;vec4 Out_Color_Q184=vec4(X_Q228,Y_Q228,Z_Q228,1);float Result_Q186;Conditional_Float_B186(Greater_Than_Q187,_Bevel_Back_,_Bevel_Front_,Result_Q186);float Result_Q244;Conditional_Float_B186(Greater_Than_Q187,_Bevel_Back_Stretch_,_Bevel_Front_Stretch_,Result_Q244);vec3 New_P_Q280;vec2 New_UV_Q280;float Radial_Gradient_Q280;vec3 Radial_Dir_Q280;vec3 New_Normal_Q280;Move_Verts_B280(Anisotropy_Q179,position,Result_Q219,Result_Q186,normal,Anisotropy_Q203,Result_Q244,New_P_Q280,New_UV_Q280,Radial_Gradient_Q280,Radial_Dir_Q280,New_Normal_Q280);float X_Q248;float Y_Q248;X_Q248=New_UV_Q280.x;Y_Q248=New_UV_Q280.y;vec3 Pos_World_Q162;Object_To_World_Pos_B162(New_P_Q280,Pos_World_Q162);vec3 Nrm_World_Q182;Object_To_World_Normal_B182(New_Normal_Q280,Nrm_World_Q182);vec4 Blob_Info_Q173; +#if BLOB_ENABLE +Blob_Vertex_B173(Pos_World_Q162,Nrm_World_Q176,Tangent_World_N_Q177,Binormal_World_N_Q178,_Blob_Position_,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q173); +#else +Blob_Info_Q173=vec4(0,0,0,0); +#endif +vec4 Blob_Info_Q174; +#if BLOB_ENABLE_2 +Blob_Vertex_B174(Pos_World_Q162,Nrm_World_Q176,Tangent_World_N_Q177,Binormal_World_N_Q178,_Blob_Position_2_,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q174); +#else +Blob_Info_Q174=vec4(0,0,0,0); +#endif +float Out_Q255;Remap_Range_B255(0.0,1.0,0.0,1.0,X_Q248,Out_Q255);float X_Q236;float Y_Q236;float Z_Q236;To_XYZ_B228(Nrm_World_Q182,X_Q236,Y_Q236,Z_Q236);vec4 Color_At_T_Q247=mix(Linear_Q251,Linear_Q252,Out_Q255);float Minus_F_Q237=-Z_Q236;float R_Q249;float G_Q249;float B_Q249;float A_Q249;R_Q249=Color_At_T_Q247.r; G_Q249=Color_At_T_Q247.g; B_Q249=Color_At_T_Q247.b; A_Q249=Color_At_T_Q247.a;float ClampF_Q238=clamp(0.0,Minus_F_Q237,1.0);float Result_Q243;Conditional_Float_B243(_Decal_Front_Only_,ClampF_Q238,1.0,Result_Q243);vec4 Vec4_Q239=vec4(Result_Q243,Radial_Gradient_Q280,G_Q249,B_Q249);vec3 Position=Pos_World_Q162;vec3 Normal=Nrm_World_Q182;vec2 UV=XY_Q235;vec3 Tangent=Tangent_World_N_Q177;vec3 Binormal=Difference_Q211;vec4 Color=Out_Color_Q184;vec4 Extra1=Vec4_Q239;vec4 Extra2=Blob_Info_Q173;vec4 Extra3=Blob_Info_Q174;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}`; + ShaderStore.ShadersStore[name326] = shader324; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/mrdl/mrdlSliderThumbMaterial.js +class MRDLSliderThumbMaterialDefines2 extends MaterialDefines { + constructor() { + super(); + this.SKY_ENABLED = true; + this.BLOB_ENABLE_2 = true; + this.IRIDESCENCE_ENABLED = true; + this._needNormals = true; + this._needUVs = true; + this.rebuild(); + } +} + +class MRDLSliderThumbMaterial2 extends PushMaterial { + constructor(name327, scene50) { + super(name327, scene50); + this.radius = 0.157; + this.bevelFront = 0.065; + this.bevelFrontStretch = 0.077; + this.bevelBack = 0.031; + this.bevelBackStretch = 0; + this.radiusTopLeft = 1; + this.radiusTopRight = 1; + this.radiusBottomLeft = 1; + this.radiusBottomRight = 1; + this.bulgeEnabled = false; + this.bulgeHeight = -0.323; + this.bulgeRadius = 0.73; + this.sunIntensity = 2; + this.sunTheta = 0.937; + this.sunPhi = 0.555; + this.indirectDiffuse = 1; + this.albedo = new Color4(0.0117647, 0.505882, 0.996078, 1); + this.specular = 0; + this.shininess = 10; + this.sharpness = 0; + this.subsurface = 0.31; + this.leftGradientColor = new Color4(0.0117647, 0.505882, 0.996078, 1); + this.rightGradientColor = new Color4(0.0117647, 0.505882, 0.996078, 1); + this.reflection = 0.749; + this.frontReflect = 0; + this.edgeReflect = 0.09; + this.power = 8.1; + this.skyColor = new Color4(0.0117647, 0.960784, 0.996078, 1); + this.horizonColor = new Color4(0.0117647, 0.333333, 0.996078, 1); + this.groundColor = new Color4(0, 0.254902, 0.996078, 1); + this.horizonPower = 1; + this.width = 0.02; + this.fuzz = 0.5; + this.minFuzz = 0.001; + this.clipFade = 0.01; + this.hueShift = 0; + this.saturationShift = 0; + this.valueShift = 0; + this.blobPosition = new Vector3(0, 0, 0.1); + this.blobIntensity = 0.5; + this.blobNearSize = 0.01; + this.blobFarSize = 0.03; + this.blobNearDistance = 0; + this.blobFarDistance = 0.08; + this.blobFadeLength = 0.576; + this.blobPulse = 0; + this.blobFade = 1; + this.blobPosition2 = new Vector3(0.2, 0, 0.1); + this.blobNearSize2 = 0.01; + this.blobPulse2 = 0; + this.blobFade2 = 1; + this.blobTexture = new Texture("", this.getScene()); + this.leftIndexPosition = new Vector3(0, 0, 1); + this.rightIndexPosition = new Vector3(-1, -1, -1); + this.leftIndexMiddlePosition = new Vector3(0, 0, 0); + this.rightIndexMiddlePosition = new Vector3(0, 0, 0); + this.decalScaleXY = new Vector2(1.5, 1.5); + this.decalFrontOnly = true; + this.rimIntensity = 0.287; + this.rimHueShift = 0; + this.rimSaturationShift = 0; + this.rimValueShift = -1; + this.iridescenceIntensity = 0; + this.useGlobalLeftIndex = 1; + this.useGlobalRightIndex = 1; + this.globalLeftIndexTipProximity = 0; + this.globalRightIndexTipProximity = 0; + this.globalLeftIndexTipPosition = new Vector4(0.5, 0, -0.55, 1); + this.globaRightIndexTipPosition = new Vector4(0, 0, 0, 1); + this.globalLeftThumbTipPosition = new Vector4(0.5, 0, -0.55, 1); + this.globalRightThumbTipPosition = new Vector4(0, 0, 0, 1); + this.globalLeftIndexMiddlePosition = new Vector4(0.5, 0, -0.55, 1); + this.globalRightIndexMiddlePosition = new Vector4(0, 0, 0, 1); + this.alphaMode = Constants.ALPHA_DISABLE; + this.backFaceCulling = false; + this._blueGradientTexture = new Texture(MRDLSliderThumbMaterial2.BLUE_GRADIENT_TEXTURE_URL, scene50, true, false, Texture.NEAREST_SAMPLINGMODE); + this._decalTexture = new Texture("", this.getScene()); + this._reflectionMapTexture = new Texture("", this.getScene()); + this._indirectEnvTexture = new Texture("", this.getScene()); + } + needAlphaBlending() { + return false; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh84, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new MRDLSliderThumbMaterialDefines2; + } + const defines = subMesh11.materialDefines; + const scene50 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene50.getEngine(); + MaterialHelper.PrepareDefinesForAttributes(mesh84, defines, false, false); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + defines.IMAGEPROCESSINGPOSTPROCESS = scene50.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + if (defines.TANGENT) { + attribs.push(VertexBuffer.TangentKind); + } + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "mrdlSliderThumb"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "viewProjection", + "cameraPosition", + "_Radius_", + "_Bevel_Front_", + "_Bevel_Front_Stretch_", + "_Bevel_Back_", + "_Bevel_Back_Stretch_", + "_Radius_Top_Left_", + "_Radius_Top_Right_", + "_Radius_Bottom_Left_", + "_Radius_Bottom_Right_", + "_Bulge_Enabled_", + "_Bulge_Height_", + "_Bulge_Radius_", + "_Sun_Intensity_", + "_Sun_Theta_", + "_Sun_Phi_", + "_Indirect_Diffuse_", + "_Albedo_", + "_Specular_", + "_Shininess_", + "_Sharpness_", + "_Subsurface_", + "_Left_Color_", + "_Right_Color_", + "_Reflection_", + "_Front_Reflect_", + "_Edge_Reflect_", + "_Power_", + "_Sky_Color_", + "_Horizon_Color_", + "_Ground_Color_", + "_Horizon_Power_", + "_Reflection_Map_", + "_Indirect_Environment_", + "_Width_", + "_Fuzz_", + "_Min_Fuzz_", + "_Clip_Fade_", + "_Hue_Shift_", + "_Saturation_Shift_", + "_Value_Shift_", + "_Blob_Position_", + "_Blob_Intensity_", + "_Blob_Near_Size_", + "_Blob_Far_Size_", + "_Blob_Near_Distance_", + "_Blob_Far_Distance_", + "_Blob_Fade_Length_", + "_Blob_Pulse_", + "_Blob_Fade_", + "_Blob_Texture_", + "_Blob_Position_2_", + "_Blob_Near_Size_2_", + "_Blob_Pulse_2_", + "_Blob_Fade_2_", + "_Left_Index_Pos_", + "_Right_Index_Pos_", + "_Left_Index_Middle_Pos_", + "_Right_Index_Middle_Pos_", + "_Decal_", + "_Decal_Scale_XY_", + "_Decal_Front_Only_", + "_Rim_Intensity_", + "_Rim_Texture_", + "_Rim_Hue_Shift_", + "_Rim_Saturation_Shift_", + "_Rim_Value_Shift_", + "_Iridescence_Intensity_", + "_Iridescence_Texture_", + "Use_Global_Left_Index", + "Use_Global_Right_Index", + "Global_Left_Index_Tip_Position", + "Global_Right_Index_Tip_Position", + "Global_Left_Thumb_Tip_Position", + "Global_Right_Thumb_Tip_Position", + "Global_Left_Index_Middle_Position;", + "Global_Right_Index_Middle_Position", + "Global_Left_Index_Tip_Proximity", + "Global_Right_Index_Tip_Proximity" + ]; + const samplers = ["_Rim_Texture_", "_Iridescence_Texture_"]; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh84, subMesh11) { + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix()); + this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera.position); + this._activeEffect.setFloat("_Radius_", this.radius); + this._activeEffect.setFloat("_Bevel_Front_", this.bevelFront); + this._activeEffect.setFloat("_Bevel_Front_Stretch_", this.bevelFrontStretch); + this._activeEffect.setFloat("_Bevel_Back_", this.bevelBack); + this._activeEffect.setFloat("_Bevel_Back_Stretch_", this.bevelBackStretch); + this._activeEffect.setFloat("_Radius_Top_Left_", this.radiusTopLeft); + this._activeEffect.setFloat("_Radius_Top_Right_", this.radiusTopRight); + this._activeEffect.setFloat("_Radius_Bottom_Left_", this.radiusBottomLeft); + this._activeEffect.setFloat("_Radius_Bottom_Right_", this.radiusBottomRight); + this._activeEffect.setFloat("_Bulge_Enabled_", this.bulgeEnabled ? 1 : 0); + this._activeEffect.setFloat("_Bulge_Height_", this.bulgeHeight); + this._activeEffect.setFloat("_Bulge_Radius_", this.bulgeRadius); + this._activeEffect.setFloat("_Sun_Intensity_", this.sunIntensity); + this._activeEffect.setFloat("_Sun_Theta_", this.sunTheta); + this._activeEffect.setFloat("_Sun_Phi_", this.sunPhi); + this._activeEffect.setFloat("_Indirect_Diffuse_", this.indirectDiffuse); + this._activeEffect.setDirectColor4("_Albedo_", this.albedo); + this._activeEffect.setFloat("_Specular_", this.specular); + this._activeEffect.setFloat("_Shininess_", this.shininess); + this._activeEffect.setFloat("_Sharpness_", this.sharpness); + this._activeEffect.setFloat("_Subsurface_", this.subsurface); + this._activeEffect.setDirectColor4("_Left_Color_", this.leftGradientColor); + this._activeEffect.setDirectColor4("_Right_Color_", this.rightGradientColor); + this._activeEffect.setFloat("_Reflection_", this.reflection); + this._activeEffect.setFloat("_Front_Reflect_", this.frontReflect); + this._activeEffect.setFloat("_Edge_Reflect_", this.edgeReflect); + this._activeEffect.setFloat("_Power_", this.power); + this._activeEffect.setDirectColor4("_Sky_Color_", this.skyColor); + this._activeEffect.setDirectColor4("_Horizon_Color_", this.horizonColor); + this._activeEffect.setDirectColor4("_Ground_Color_", this.groundColor); + this._activeEffect.setFloat("_Horizon_Power_", this.horizonPower); + this._activeEffect.setTexture("_Reflection_Map_", this._reflectionMapTexture); + this._activeEffect.setTexture("_Indirect_Environment_", this._indirectEnvTexture); + this._activeEffect.setFloat("_Width_", this.width); + this._activeEffect.setFloat("_Fuzz_", this.fuzz); + this._activeEffect.setFloat("_Min_Fuzz_", this.minFuzz); + this._activeEffect.setFloat("_Clip_Fade_", this.clipFade); + this._activeEffect.setFloat("_Hue_Shift_", this.hueShift); + this._activeEffect.setFloat("_Saturation_Shift_", this.saturationShift); + this._activeEffect.setFloat("_Value_Shift_", this.valueShift); + this._activeEffect.setVector3("_Blob_Position_", this.blobPosition); + this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity); + this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize); + this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize); + this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance); + this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance); + this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength); + this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse); + this._activeEffect.setFloat("_Blob_Fade_", this.blobFade); + this._activeEffect.setTexture("_Blob_Texture_", this.blobTexture); + this._activeEffect.setVector3("_Blob_Position_2_", this.blobPosition2); + this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2); + this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2); + this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2); + this._activeEffect.setVector3("_Left_Index_Pos_", this.leftIndexPosition); + this._activeEffect.setVector3("_Right_Index_Pos_", this.rightIndexPosition); + this._activeEffect.setVector3("_Left_Index_Middle_Pos_", this.leftIndexMiddlePosition); + this._activeEffect.setVector3("_Right_Index_Middle_Pos_", this.rightIndexMiddlePosition); + this._activeEffect.setTexture("_Decal_", this._decalTexture); + this._activeEffect.setVector2("_Decal_Scale_XY_", this.decalScaleXY); + this._activeEffect.setFloat("_Decal_Front_Only_", this.decalFrontOnly ? 1 : 0); + this._activeEffect.setFloat("_Rim_Intensity_", this.rimIntensity); + this._activeEffect.setTexture("_Rim_Texture_", this._blueGradientTexture); + this._activeEffect.setFloat("_Rim_Hue_Shift_", this.rimHueShift); + this._activeEffect.setFloat("_Rim_Saturation_Shift_", this.rimSaturationShift); + this._activeEffect.setFloat("_Rim_Value_Shift_", this.rimValueShift); + this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity); + this._activeEffect.setTexture("_Iridescence_Texture_", this._blueGradientTexture); + this._activeEffect.setFloat("Use_Global_Left_Index", this.useGlobalLeftIndex); + this._activeEffect.setFloat("Use_Global_Right_Index", this.useGlobalRightIndex); + this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this.globalLeftIndexTipPosition); + this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this.globaRightIndexTipPosition); + this._activeEffect.setVector4("Global_Left_Thumb_Tip_Position", this.globalLeftThumbTipPosition); + this._activeEffect.setVector4("Global_Right_Thumb_Tip_Position", this.globalRightThumbTipPosition); + this._activeEffect.setVector4("Global_Left_Index_Middle_Position", this.globalLeftIndexMiddlePosition); + this._activeEffect.setVector4("Global_Right_Index_Middle_Position", this.globalRightIndexMiddlePosition); + this._activeEffect.setFloat("Global_Left_Index_Tip_Proximity", this.globalLeftIndexTipProximity); + this._activeEffect.setFloat("Global_Right_Index_Tip_Proximity", this.globalRightIndexTipProximity); + this._afterBind(mesh84, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + this._reflectionMapTexture.dispose(); + this._indirectEnvTexture.dispose(); + this._blueGradientTexture.dispose(); + this._decalTexture.dispose(); + } + clone(name327) { + return SerializationHelper.Clone(() => new MRDLSliderThumbMaterial2(name327, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.MRDLSliderThumbMaterial"; + return serializationObject; + } + getClassName() { + return "MRDLSliderThumbMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new MRDLSliderThumbMaterial2(source.name, scene50), source, scene50, rootUrl); + } +} +var init_mrdlSliderThumbMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_texture(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_buffer(); + init_typeStore(); + init_math_color(); + init_effectFallbacks(); + init_constants(); + init_mrdlSliderThumb_fragment(); + init_mrdlSliderThumb_vertex(); + MRDLSliderThumbMaterial2.BLUE_GRADIENT_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-blue-gradient.png"; + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "radius", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "bevelFront", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "bevelFrontStretch", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "bevelBack", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "bevelBackStretch", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "radiusTopLeft", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "radiusTopRight", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "radiusBottomLeft", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "radiusBottomRight", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "bulgeEnabled", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "bulgeHeight", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "bulgeRadius", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "sunIntensity", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "sunTheta", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "sunPhi", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "indirectDiffuse", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "albedo", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "specular", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "shininess", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "sharpness", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "subsurface", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "leftGradientColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "rightGradientColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "reflection", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "frontReflect", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "edgeReflect", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "power", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "skyColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "horizonColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "groundColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "horizonPower", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "width", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "fuzz", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "minFuzz", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "clipFade", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "hueShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "saturationShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "valueShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "blobPosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "blobIntensity", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "blobNearSize", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "blobFarSize", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "blobNearDistance", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "blobFarDistance", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "blobFadeLength", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "blobPulse", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "blobFade", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "blobPosition2", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "blobNearSize2", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "blobPulse2", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "blobFade2", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "blobTexture", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "leftIndexPosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "rightIndexPosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "leftIndexMiddlePosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "rightIndexMiddlePosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "decalScaleXY", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "decalFrontOnly", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "rimIntensity", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "rimHueShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "rimSaturationShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "rimValueShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial2.prototype, "iridescenceIntensity", undefined); + RegisterClass("BABYLON.GUI.MRDLSliderThumbMaterial", MRDLSliderThumbMaterial2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js +var name327, shader325; +var init_mrdlBackplate_fragment = __esm(() => { + init_shaderStore(); + name327 = "mrdlBackplatePixelShader"; + shader325 = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vExtra1;varying vec4 vExtra2;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform vec4 _Iridescence_Tint_;uniform sampler2D _Iridescent_Map_;uniform float _Angle_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform vec4 _Gradient_Color_;uniform vec4 _Top_Left_;uniform vec4 _Top_Right_;uniform vec4 _Bottom_Left_;uniform vec4 _Bottom_Right_;uniform float _Edge_Width_;uniform float _Edge_Power_;uniform float _Line_Gradient_Blend_;uniform float _Fade_Out_;void FastLinearTosRGB_B353( +vec4 Linear, +out vec4 sRGB) +{sRGB.rgb=sqrt(clamp(Linear.rgb,0.0,1.0));sRGB.a=Linear.a;} +void Round_Rect_Fragment_B332( +float Radius, +float Line_Width, +vec4 Line_Color, +float Filter_Width, +vec2 UV, +float Line_Visibility, +vec4 Rect_Parms, +vec4 Fill_Color, +out vec4 Color) +{float d=length(max(abs(UV)-Rect_Parms.xy,0.0));float dx=max(fwidth(d)*Filter_Width,0.00001);float g=min(Rect_Parms.z,Rect_Parms.w);float dgrad=max(fwidth(g)*Filter_Width,0.00001);float Inside_Rect=clamp(g/dgrad,0.0,1.0);float inner=clamp((d+dx*0.5-max(Radius-Line_Width,d-dx*0.5))/dx,0.0,1.0);Color=clamp(mix(Fill_Color,Line_Color,inner),0.0,1.0)*Inside_Rect;} +void Iridescence_B343( +vec3 Position, +vec3 Normal, +vec2 UV, +vec3 Axis, +vec3 Eye, +vec4 Tint, +sampler2D Texture, +bool Reflected, +float Frequency, +float Vertical_Offset, +out vec4 Color) +{vec3 i=normalize(Position-Eye);vec3 r=reflect(i,Normal);float idota=dot(i,Axis);float idotr=dot(i,r);float x=Reflected ? idotr : idota;vec2 xy;xy.x=fract((x*Frequency+1.0)*0.5+UV.y*Vertical_Offset);xy.y=0.5;Color=texture(Texture,xy);Color.rgb*=Tint.rgb;} +void Scale_RGB_B346( +vec4 Color, +float Scalar, +out vec4 Result) +{Result=vec4(Scalar,Scalar,Scalar,1)*Color;} +void Scale_RGB_B344( +float Scalar, +vec4 Color, +out vec4 Result) +{Result=vec4(Scalar,Scalar,Scalar,1)*Color;} +void Line_Fragment_B362( +vec4 Base_Color, +vec4 Highlight_Color, +float Highlight_Width, +vec3 Line_Vertex, +float Highlight, +out vec4 Line_Color) +{float k2=1.0-clamp(abs(Line_Vertex.y/Highlight_Width),0.0,1.0);Line_Color=mix(Base_Color,Highlight_Color,Highlight*k2);} +void Edge_B356( +vec4 RectParms, +float Radius, +float Line_Width, +vec2 UV, +float Edge_Width, +float Edge_Power, +out float Result) +{float d=length(max(abs(UV)-RectParms.xy,0.0));float edge=1.0-clamp((1.0-d/(Radius-Line_Width))/Edge_Width,0.0,1.0);Result=pow(edge,Edge_Power);} +void Gradient_B355( +vec4 Gradient_Color, +vec4 Top_Left, +vec4 Top_Right, +vec4 Bottom_Left, +vec4 Bottom_Right, +vec2 UV, +out vec4 Result) +{vec3 top=Top_Left.rgb+(Top_Right.rgb-Top_Left.rgb)*UV.x;vec3 bottom=Bottom_Left.rgb+(Bottom_Right.rgb-Bottom_Left.rgb)*UV.x;Result.rgb=Gradient_Color.rgb*(bottom+(top-bottom)*UV.y);Result.a=1.0;} +void main() +{float X_Q338;float Y_Q338;float Z_Q338;float W_Q338;X_Q338=vExtra2.x;Y_Q338=vExtra2.y;Z_Q338=vExtra2.z;W_Q338=vExtra2.w;vec4 Color_Q343; +#if IRIDESCENCE_ENABLE +Iridescence_B343(vPosition,vNormal,vUV,vBinormal,cameraPosition,_Iridescence_Tint_,_Iridescent_Map_,_Reflected_,_Frequency_,_Vertical_Offset_,Color_Q343); +#else +Color_Q343=vec4(0,0,0,0); +#endif +vec4 Result_Q344;Scale_RGB_B344(_Iridescence_Intensity_,Color_Q343,Result_Q344);vec4 Line_Color_Q362;Line_Fragment_B362(_Line_Color_,_Highlight_Color_,_Highlight_Width_,vTangent,_Highlight_,Line_Color_Q362);float Result_Q356; +#if EDGE_ONLY +Edge_B356(vExtra1,Z_Q338,W_Q338,vUV,_Edge_Width_,_Edge_Power_,Result_Q356); +#else +Result_Q356=1.0; +#endif +vec2 Vec2_Q339=vec2(X_Q338,Y_Q338);vec4 Result_Q355;Gradient_B355(_Gradient_Color_,_Top_Left_,_Top_Right_,_Bottom_Left_,_Bottom_Right_,Vec2_Q339,Result_Q355);vec4 Linear_Q348;Linear_Q348.rgb=clamp(Result_Q355.rgb*Result_Q355.rgb,0.0,1.0);Linear_Q348.a=Result_Q355.a;vec4 Result_Q346;Scale_RGB_B346(Linear_Q348,Result_Q356,Result_Q346);vec4 Sum_Q345=Result_Q346+Result_Q344;vec4 Color_At_T_Q347=mix(Line_Color_Q362,Result_Q346,_Line_Gradient_Blend_);vec4 Base_And_Iridescent_Q350;Base_And_Iridescent_Q350=_Base_Color_+vec4(Sum_Q345.rgb,0.0);vec4 Sum_Q349=Color_At_T_Q347+_Iridescence_Edge_Intensity_*Color_Q343;vec4 Result_Q351=Sum_Q349; Result_Q351.a=1.0;vec4 Color_Q332;Round_Rect_Fragment_B332(Z_Q338,W_Q338,Result_Q351,_Filter_Width_,vUV,1.0,vExtra1,Base_And_Iridescent_Q350,Color_Q332);vec4 Result_Q354=_Fade_Out_*Color_Q332;vec4 sRGB_Q353;FastLinearTosRGB_B353(Result_Q354,sRGB_Q353);vec4 Out_Color=sRGB_Q353;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}`; + ShaderStore.ShadersStore[name327] = shader325; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js +var name328, shader326; +var init_mrdlBackplate_vertex = __esm(() => { + init_shaderStore(); + name328 = "mrdlBackplateVertexShader"; + shader326 = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec3 tangent;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform vec4 _Iridescence_Tint_;uniform sampler2D _Iridescent_Map_;uniform float _Angle_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform vec4 _Gradient_Color_;uniform vec4 _Top_Left_;uniform vec4 _Top_Right_;uniform vec4 _Bottom_Left_;uniform vec4 _Bottom_Right_;uniform float _Edge_Width_;uniform float _Edge_Power_;uniform float _Line_Gradient_Blend_;uniform float _Fade_Out_;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vExtra1;varying vec4 vExtra2;void Object_To_World_Pos_B314( +vec3 Pos_Object, +out vec3 Pos_World) +{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;} +void Round_Rect_Vertex_B357( +vec2 UV, +float Radius, +float Margin, +float Anisotropy, +float Gradient1, +float Gradient2, +vec3 Normal, +vec4 Color_Scale_Translate, +out vec2 Rect_UV, +out vec4 Rect_Parms, +out vec2 Scale_XY, +out vec2 Line_UV, +out vec2 Color_UV_Info) +{Scale_XY=vec2(Anisotropy,1.0);Line_UV=(UV-vec2(0.5,0.5));Rect_UV=Line_UV*Scale_XY;Rect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius)-vec2(Margin,Margin);Rect_Parms.z=Gradient1; +Rect_Parms.w=Gradient2;Color_UV_Info=(Line_UV+vec2(0.5,0.5))*Color_Scale_Translate.xy+Color_Scale_Translate.zw;} +void Line_Vertex_B333( +vec2 Scale_XY, +vec2 UV, +float Time, +float Rate, +vec4 Highlight_Transform, +out vec3 Line_Vertex) +{float angle2=(Rate*Time)*2.0*3.1416;float sinAngle2=sin(angle2);float cosAngle2=cos(angle2);vec2 xformUV=UV*Highlight_Transform.xy+Highlight_Transform.zw;Line_Vertex.x=0.0;Line_Vertex.y=cosAngle2*xformUV.x-sinAngle2*xformUV.y;Line_Vertex.z=0.0; } +void PickDir_B334( +float Degrees, +vec3 DirX, +vec3 DirY, +out vec3 Dir) +{float a=Degrees*3.14159/180.0;Dir=cos(a)*DirX+sin(a)*DirY;} +void Move_Verts_B327( +float Anisotropy, +vec3 P, +float Radius, +out vec3 New_P, +out vec2 New_UV, +out float Radial_Gradient, +out vec3 Radial_Dir) +{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);New_UV=center+r2*(UV-2.0*center+0.5);New_P=vec3(New_UV-0.5,P.z);Radial_Gradient=1.0-length(delta)*2.0;Radial_Dir=vec3(delta*r2,0.0);} +void Pick_Radius_B336( +float Radius, +float Radius_Top_Left, +float Radius_Top_Right, +float Radius_Bottom_Left, +float Radius_Bottom_Right, +vec3 Position, +out float Result) +{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;} +void Edge_AA_Vertex_B328( +vec3 Position_World, +vec3 Position_Object, +vec3 Normal_Object, +vec3 Eye, +float Radial_Gradient, +vec3 Radial_Dir, +vec3 Tangent, +out float Gradient1, +out float Gradient2) +{vec3 I=(Eye-Position_World);vec3 T=(vec4(Tangent,0.0)).xyz;float g=(dot(T,I)<0.0) ? 0.0 : 1.0;if (Normal_Object.z==0.0) { +Gradient1=Position_Object.z>0.0 ? g : 1.0;Gradient2=Position_Object.z>0.0 ? 1.0 : g;} else {Gradient1=g+(1.0-g)*(Radial_Gradient);Gradient2=1.0;}} +void Object_To_World_Dir_B330( +vec3 Dir_Object, +out vec3 Binormal_World, +out vec3 Binormal_World_N, +out float Binormal_Length) +{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;} +void RelativeOrAbsoluteDetail_B341( +float Nominal_Radius, +float Nominal_LineWidth, +bool Absolute_Measurements, +float Height, +out float Radius, +out float Line_Width) +{float scale=Absolute_Measurements ? 1.0/Height : 1.0;Radius=Nominal_Radius*scale;Line_Width=Nominal_LineWidth*scale;} +void main() +{vec3 Nrm_World_Q326;Nrm_World_Q326=normalize((world*vec4(normal,0.0)).xyz);vec3 Tangent_World_Q329;vec3 Tangent_World_N_Q329;float Tangent_Length_Q329;Tangent_World_Q329=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q329=length(Tangent_World_Q329);Tangent_World_N_Q329=Tangent_World_Q329/Tangent_Length_Q329;vec3 Binormal_World_Q330;vec3 Binormal_World_N_Q330;float Binormal_Length_Q330;Object_To_World_Dir_B330(vec3(0,1,0),Binormal_World_Q330,Binormal_World_N_Q330,Binormal_Length_Q330);float Radius_Q341;float Line_Width_Q341;RelativeOrAbsoluteDetail_B341(_Radius_,_Line_Width_,_Absolute_Sizes_,Binormal_Length_Q330,Radius_Q341,Line_Width_Q341);vec3 Dir_Q334;PickDir_B334(_Angle_,Tangent_World_N_Q329,Binormal_World_N_Q330,Dir_Q334);float Result_Q336;Pick_Radius_B336(Radius_Q341,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q336);float Anisotropy_Q331=Tangent_Length_Q329/Binormal_Length_Q330;vec4 Out_Color_Q337=vec4(Result_Q336,Line_Width_Q341,0,1);vec3 New_P_Q327;vec2 New_UV_Q327;float Radial_Gradient_Q327;vec3 Radial_Dir_Q327;Move_Verts_B327(Anisotropy_Q331,position,Result_Q336,New_P_Q327,New_UV_Q327,Radial_Gradient_Q327,Radial_Dir_Q327);vec3 Pos_World_Q314;Object_To_World_Pos_B314(New_P_Q327,Pos_World_Q314);float Gradient1_Q328;float Gradient2_Q328; +#if SMOOTH_EDGES +Edge_AA_Vertex_B328(Pos_World_Q314,position,normal,cameraPosition,Radial_Gradient_Q327,Radial_Dir_Q327,tangent,Gradient1_Q328,Gradient2_Q328); +#else +Gradient1_Q328=1.0;Gradient2_Q328=1.0; +#endif +vec2 Rect_UV_Q357;vec4 Rect_Parms_Q357;vec2 Scale_XY_Q357;vec2 Line_UV_Q357;vec2 Color_UV_Info_Q357;Round_Rect_Vertex_B357(New_UV_Q327,Result_Q336,0.0,Anisotropy_Q331,Gradient1_Q328,Gradient2_Q328,normal,vec4(1,1,0,0),Rect_UV_Q357,Rect_Parms_Q357,Scale_XY_Q357,Line_UV_Q357,Color_UV_Info_Q357);vec3 Line_Vertex_Q333;Line_Vertex_B333(Scale_XY_Q357,Line_UV_Q357,(20.0),_Rate_,_Highlight_Transform_,Line_Vertex_Q333);float X_Q359;float Y_Q359;X_Q359=Color_UV_Info_Q357.x;Y_Q359=Color_UV_Info_Q357.y;vec4 Vec4_Q358=vec4(X_Q359,Y_Q359,Result_Q336,Line_Width_Q341);vec3 Position=Pos_World_Q314;vec3 Normal=Nrm_World_Q326;vec2 UV=Rect_UV_Q357;vec3 Tangent=Line_Vertex_Q333;vec3 Binormal=Dir_Q334;vec4 Color=Out_Color_Q337;vec4 Extra1=Rect_Parms_Q357;vec4 Extra2=Vec4_Q358;vec4 Extra3=vec4(0,0,0,0);gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vExtra1=Extra1;vExtra2=Extra2;}`; + ShaderStore.ShadersStore[name328] = shader326; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/mrdl/mrdlBackplateMaterial.js +class MRDLBackplateMaterialDefines2 extends MaterialDefines { + constructor() { + super(); + this.IRIDESCENCE_ENABLE = true; + this.SMOOTH_EDGES = true; + this._needNormals = true; + this.rebuild(); + } +} + +class MRDLBackplateMaterial2 extends PushMaterial { + constructor(name329, scene50) { + super(name329, scene50); + this.radius = 0.3; + this.lineWidth = 0.003; + this.absoluteSizes = false; + this._filterWidth = 1; + this.baseColor = new Color4(0, 0, 0, 1); + this.lineColor = new Color4(0.2, 0.262745, 0.4, 1); + this.radiusTopLeft = 1; + this.radiusTopRight = 1; + this.radiusBottomLeft = 1; + this.radiusBottomRight = 1; + this._rate = 0; + this.highlightColor = new Color4(0.239216, 0.435294, 0.827451, 1); + this.highlightWidth = 0; + this._highlightTransform = new Vector4(1, 1, 0, 0); + this._highlight = 1; + this.iridescenceIntensity = 0.45; + this.iridescenceEdgeIntensity = 1; + this.iridescenceTint = new Color4(1, 1, 1, 1); + this._angle = -45; + this.fadeOut = 1; + this._reflected = true; + this._frequency = 1; + this._verticalOffset = 0; + this.gradientColor = new Color4(0.74902, 0.74902, 0.74902, 1); + this.topLeftGradientColor = new Color4(0.00784314, 0.294118, 0.580392, 1); + this.topRightGradientColor = new Color4(0.305882, 0, 1, 1); + this.bottomLeftGradientColor = new Color4(0.133333, 0.258824, 0.992157, 1); + this.bottomRightGradientColor = new Color4(0.176471, 0.176471, 0.619608, 1); + this.edgeWidth = 0.5; + this.edgePower = 1; + this.edgeLineGradientBlend = 0.5; + this.alphaMode = Constants.ALPHA_DISABLE; + this.backFaceCulling = false; + this._iridescentMapTexture = new Texture(MRDLBackplateMaterial2.IRIDESCENT_MAP_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE); + } + needAlphaBlending() { + return false; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh84, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new MRDLBackplateMaterialDefines2; + } + const defines = subMesh11.materialDefines; + const scene50 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene50.getEngine(); + MaterialHelper.PrepareDefinesForAttributes(mesh84, defines, false, false); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + defines.IMAGEPROCESSINGPOSTPROCESS = scene50.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + if (defines.TANGENT) { + attribs.push(VertexBuffer.TangentKind); + } + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "mrdlBackplate"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "viewProjection", + "cameraPosition", + "_Radius_", + "_Line_Width_", + "_Absolute_Sizes_", + "_Filter_Width_", + "_Base_Color_", + "_Line_Color_", + "_Radius_Top_Left_", + "_Radius_Top_Right_", + "_Radius_Bottom_Left_", + "_Radius_Bottom_Right_", + "_Rate_", + "_Highlight_Color_", + "_Highlight_Width_", + "_Highlight_Transform_", + "_Highlight_", + "_Iridescence_Intensity_", + "_Iridescence_Edge_Intensity_", + "_Iridescence_Tint_", + "_Iridescent_Map_", + "_Angle_", + "_Reflected_", + "_Frequency_", + "_Vertical_Offset_", + "_Gradient_Color_", + "_Top_Left_", + "_Top_Right_", + "_Bottom_Left_", + "_Bottom_Right_", + "_Edge_Width_", + "_Edge_Power_", + "_Line_Gradient_Blend_", + "_Fade_Out_" + ]; + const samplers = ["_Iridescent_Map_"]; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh84, subMesh11) { + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix()); + this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera.position); + this._activeEffect.setFloat("_Radius_", this.radius); + this._activeEffect.setFloat("_Line_Width_", this.lineWidth); + this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1 : 0); + this._activeEffect.setFloat("_Filter_Width_", this._filterWidth); + this._activeEffect.setDirectColor4("_Base_Color_", this.baseColor); + this._activeEffect.setDirectColor4("_Line_Color_", this.lineColor); + this._activeEffect.setFloat("_Radius_Top_Left_", this.radiusTopLeft); + this._activeEffect.setFloat("_Radius_Top_Right_", this.radiusTopRight); + this._activeEffect.setFloat("_Radius_Bottom_Left_", this.radiusBottomLeft); + this._activeEffect.setFloat("_Radius_Bottom_Right_", this.radiusBottomRight); + this._activeEffect.setFloat("_Rate_", this._rate); + this._activeEffect.setDirectColor4("_Highlight_Color_", this.highlightColor); + this._activeEffect.setFloat("_Highlight_Width_", this.highlightWidth); + this._activeEffect.setVector4("_Highlight_Transform_", this._highlightTransform); + this._activeEffect.setFloat("_Highlight_", this._highlight); + this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity); + this._activeEffect.setFloat("_Iridescence_Edge_Intensity_", this.iridescenceEdgeIntensity); + this._activeEffect.setDirectColor4("_Iridescence_Tint_", this.iridescenceTint); + this._activeEffect.setTexture("_Iridescent_Map_", this._iridescentMapTexture); + this._activeEffect.setFloat("_Angle_", this._angle); + this._activeEffect.setFloat("_Reflected_", this._reflected ? 1 : 0); + this._activeEffect.setFloat("_Frequency_", this._frequency); + this._activeEffect.setFloat("_Vertical_Offset_", this._verticalOffset); + this._activeEffect.setDirectColor4("_Gradient_Color_", this.gradientColor); + this._activeEffect.setDirectColor4("_Top_Left_", this.topLeftGradientColor); + this._activeEffect.setDirectColor4("_Top_Right_", this.topRightGradientColor); + this._activeEffect.setDirectColor4("_Bottom_Left_", this.bottomLeftGradientColor); + this._activeEffect.setDirectColor4("_Bottom_Right_", this.bottomRightGradientColor); + this._activeEffect.setFloat("_Edge_Width_", this.edgeWidth); + this._activeEffect.setFloat("_Edge_Power_", this.edgePower); + this._activeEffect.setFloat("_Line_Gradient_Blend_", this.edgeLineGradientBlend); + this._activeEffect.setFloat("_Fade_Out_", this.fadeOut); + this._afterBind(mesh84, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + } + clone(name329) { + return SerializationHelper.Clone(() => new MRDLBackplateMaterial2(name329, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.MRDLBackplateMaterial"; + return serializationObject; + } + getClassName() { + return "MRDLBackplateMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new MRDLBackplateMaterial2(source.name, scene50), source, scene50, rootUrl); + } +} +var init_mrdlBackplateMaterial = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_texture(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_buffer(); + init_typeStore(); + init_math_color(); + init_effectFallbacks(); + init_constants(); + init_mrdlBackplate_fragment(); + init_mrdlBackplate_vertex(); + MRDLBackplateMaterial2.IRIDESCENT_MAP_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-backplate-iridescence.png"; + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "radius", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "lineWidth", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "absoluteSizes", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "baseColor", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "lineColor", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "radiusTopLeft", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "radiusTopRight", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "radiusBottomLeft", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "radiusBottomRight", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "highlightColor", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "highlightWidth", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "iridescenceIntensity", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "iridescenceEdgeIntensity", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "iridescenceTint", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "fadeOut", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "gradientColor", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "topLeftGradientColor", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "topRightGradientColor", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "bottomLeftGradientColor", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "bottomRightGradientColor", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "edgeWidth", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "edgePower", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial2.prototype, "edgeLineGradientBlend", undefined); + RegisterClass("BABYLON.GUI.MRDLBackplateMaterial", MRDLBackplateMaterial2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/slider3D.js +class Slider3D2 extends Control3D2 { + constructor(name329, sliderBackplateVisible) { + super(name329); + this.onValueChangedObservable = new Observable; + this._sliderBackplateVisible = sliderBackplateVisible || false; + this._minimum = SLIDER_MIN2; + this._maximum = SLIDER_MAX2; + this._step = SLIDER_STEP2; + this._value = SLIDER_VAL2; + } + get mesh() { + if (this.node) { + return this._sliderThumb; + } + return null; + } + get minimum() { + return this._minimum; + } + set minimum(value) { + if (this._minimum === value) { + return; + } + this._minimum = Math.max(value, SLIDER_MIN2); + this._value = Math.max(Math.min(this._value, this._maximum), this._minimum); + } + get maximum() { + return this._maximum; + } + set maximum(value) { + if (this._maximum === value) { + return; + } + this._maximum = Math.max(value, this._minimum); + this._value = Math.max(Math.min(this._value, this._maximum), this._minimum); + } + get step() { + return this._step; + } + set step(value) { + if (this._step === value) { + return; + } + this._step = Math.max(Math.min(value, this._maximum - this._minimum), SLIDER_STEP2); + } + get value() { + return this._value; + } + set value(value) { + if (this._value === value) { + return; + } + this._value = Math.max(Math.min(value, this._maximum), this._minimum); + if (this._sliderThumb) { + this._sliderThumb.position.x = this._convertToPosition(this.value); + } + this.onValueChangedObservable.notifyObservers(this._value); + } + get start() { + if (!this.node) { + return -SLIDER_SCALING2 / 2; + } + return this._sliderBar.position.x - this._sliderBar.scaling.x / 2; + } + get end() { + if (!this.node) { + return SLIDER_SCALING2 / 2; + } + return this._sliderBar.position.x + this._sliderBar.scaling.x / 2; + } + get sliderBarMaterial() { + return this._sliderBarMaterial; + } + get sliderThumbMaterial() { + return this._sliderThumbMaterial; + } + get sliderBackplateMaterial() { + return this._sliderBackplateMaterial; + } + set isVisible(value) { + var _a; + if (this._isVisible === value) { + return; + } + this._isVisible = value; + (_a = this.node) === null || _a === undefined || _a.setEnabled(value); + } + _createNode(scene50) { + const sliderBackplate = CreateBox(`${this.name}_sliderbackplate`, { + width: 1, + height: 1, + depth: 1 + }, scene50); + sliderBackplate.isPickable = false; + sliderBackplate.visibility = 0; + sliderBackplate.scaling = new Vector3(1, 0.5, 0.8); + SceneLoader.ImportMeshAsync(undefined, Slider3D2.MODEL_BASE_URL, Slider3D2.MODEL_FILENAME, scene50).then((result) => { + result.meshes.forEach((m) => { + m.isPickable = false; + }); + const sliderBackplateModel = result.meshes[1]; + const sliderBarModel = result.meshes[1].clone(`${this.name}_sliderbar`, sliderBackplate); + const sliderThumbModel = result.meshes[1].clone(`${this.name}_sliderthumb`, sliderBackplate); + sliderBackplateModel.visibility = 0; + if (this._sliderBackplateVisible) { + sliderBackplateModel.visibility = 1; + sliderBackplateModel.name = `${this.name}_sliderbackplate`; + sliderBackplateModel.scaling.x = 1; + sliderBackplateModel.scaling.z = 0.2; + sliderBackplateModel.parent = sliderBackplate; + if (this._sliderBackplateMaterial) { + sliderBackplateModel.material = this._sliderBackplateMaterial; + } + this._sliderBackplate = sliderBackplateModel; + } + if (sliderBarModel) { + sliderBarModel.parent = sliderBackplate; + sliderBarModel.position.z = -0.1; + sliderBarModel.scaling = new Vector3(SLIDER_SCALING2 - SLIDER_MARGIN2, 0.04, 0.3); + if (this._sliderBarMaterial) { + sliderBarModel.material = this._sliderBarMaterial; + } + this._sliderBar = sliderBarModel; + } + if (sliderThumbModel) { + sliderThumbModel.parent = sliderBackplate; + sliderThumbModel.isPickable = true; + sliderThumbModel.position.z = -0.115; + sliderThumbModel.scaling = new Vector3(0.025, 0.3, 0.6); + sliderThumbModel.position.x = this._convertToPosition(this.value); + sliderThumbModel.addBehavior(this._createBehavior()); + if (this._sliderThumbMaterial) { + sliderThumbModel.material = this._sliderThumbMaterial; + } + this._sliderThumb = sliderThumbModel; + } + this._injectGUI3DReservedDataStore(sliderBackplate).control = this; + sliderBackplate.getChildMeshes().forEach((mesh84) => { + this._injectGUI3DReservedDataStore(mesh84).control = this; + }); + }); + this._affectMaterial(sliderBackplate); + return sliderBackplate; + } + _affectMaterial(mesh84) { + var _a, _b, _c; + this._sliderBackplateMaterial = (_a = this._sliderBackplateMaterial) !== null && _a !== undefined ? _a : new MRDLBackplateMaterial2(`${this.name}_sliderbackplate_material`, mesh84.getScene()); + this._sliderBarMaterial = (_b = this._sliderBarMaterial) !== null && _b !== undefined ? _b : new MRDLSliderBarMaterial2(`${this.name}_sliderbar_material`, mesh84.getScene()); + this._sliderThumbMaterial = (_c = this._sliderThumbMaterial) !== null && _c !== undefined ? _c : new MRDLSliderThumbMaterial2(`${this.name}_sliderthumb_material`, mesh84.getScene()); + } + _createBehavior() { + const pointerDragBehavior12 = new PointerDragBehavior({ dragAxis: Vector3.Right() }); + pointerDragBehavior12.moveAttached = false; + pointerDragBehavior12.onDragStartObservable.add(() => { + this._draggedPosition = this._sliderThumb.position.x; + }); + pointerDragBehavior12.onDragObservable.add((event) => { + this._draggedPosition += event.dragDistance / this.scaling.x; + this.value = this._convertToValue(this._draggedPosition); + }); + return pointerDragBehavior12; + } + _convertToPosition(value) { + const position3 = (value - this.minimum) / (this.maximum - this.minimum) * (this.end - this.start) + this.start; + return Math.min(Math.max(position3, this.start), this.end); + } + _convertToValue(position3) { + let value = (position3 - this.start) / (this.end - this.start) * (this.maximum - this.minimum); + value = this.step ? Math.round(value / this.step) * this.step : value; + return Math.max(Math.min(this.minimum + value, this._maximum), this._minimum); + } + dispose() { + var _a, _b, _c, _d, _e, _f; + super.dispose(); + (_a = this._sliderBar) === null || _a === undefined || _a.dispose(); + (_b = this._sliderThumb) === null || _b === undefined || _b.dispose(); + (_c = this._sliderBarMaterial) === null || _c === undefined || _c.dispose(); + (_d = this._sliderThumbMaterial) === null || _d === undefined || _d.dispose(); + (_e = this._sliderBackplate) === null || _e === undefined || _e.dispose(); + (_f = this._sliderBackplateMaterial) === null || _f === undefined || _f.dispose(); + } +} +var SLIDER_MIN2, SLIDER_MAX2, SLIDER_VAL2, SLIDER_STEP2, SLIDER_SCALING2, SLIDER_MARGIN2; +var init_slider3D = __esm(() => { + init_observable(); + init_math_vector(); + init_control3D(); + init_boxBuilder(); + init_pointerDragBehavior(); + init_sceneLoader(); + init_mrdlSliderBarMaterial(); + init_mrdlSliderThumbMaterial(); + init_mrdlBackplateMaterial(); + SLIDER_MIN2 = 0; + SLIDER_MAX2 = 100; + SLIDER_VAL2 = 50; + SLIDER_STEP2 = 0; + SLIDER_SCALING2 = 1; + SLIDER_MARGIN2 = 0.2; + Slider3D2.MODEL_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/"; + Slider3D2.MODEL_FILENAME = "mrtk-fluent-backplate.glb"; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/spherePanel.js +class SpherePanel extends VolumeBasedPanel2 { + constructor() { + super(...arguments); + this._radius = 5; + } + get radius() { + return this._radius; + } + set radius(value) { + if (this._radius === value) { + return; + } + this._radius = value; + Tools.SetImmediate(() => { + this._arrangeChildren(); + }); + } + _mapGridNode(control48, nodePosition) { + const mesh84 = control48.mesh; + if (!mesh84) { + return; + } + const newPos = this._sphericalMapping(nodePosition); + control48.position = newPos; + switch (this.orientation) { + case Container3D2.FACEORIGIN_ORIENTATION: + mesh84.lookAt(new Vector3(2 * newPos.x, 2 * newPos.y, 2 * newPos.z)); + break; + case Container3D2.FACEORIGINREVERSED_ORIENTATION: + mesh84.lookAt(new Vector3(-newPos.x, -newPos.y, -newPos.z)); + break; + case Container3D2.FACEFORWARD_ORIENTATION: + break; + case Container3D2.FACEFORWARDREVERSED_ORIENTATION: + mesh84.rotate(Axis.Y, Math.PI, Space.LOCAL); + break; + } + } + _sphericalMapping(source) { + const newPos = new Vector3(0, 0, this._radius); + const xAngle = source.y / this._radius; + const yAngle = -(source.x / this._radius); + Matrix.RotationYawPitchRollToRef(yAngle, xAngle, 0, TmpVectors.Matrix[0]); + return Vector3.TransformNormal(newPos, TmpVectors.Matrix[0]); + } +} +var init_spherePanel = __esm(() => { + init_tools(); + init_math_vector(); + init_volumeBasedPanel(); + init_container3D(); + init_math_axis(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/stackPanel3D.js +class StackPanel3D extends Container3D2 { + get isVertical() { + return this._isVertical; + } + set isVertical(value) { + if (this._isVertical === value) { + return; + } + this._isVertical = value; + Tools.SetImmediate(() => { + this._arrangeChildren(); + }); + } + constructor(isVertical = false) { + super(); + this._isVertical = false; + this.margin = 0.1; + this._isVertical = isVertical; + } + _arrangeChildren() { + let width = 0; + let height = 0; + let controlCount = 0; + const extendSizes = []; + const currentInverseWorld = Matrix.Invert(this.node.computeWorldMatrix(true)); + for (const child of this._children) { + if (!child.mesh) { + continue; + } + controlCount++; + child.mesh.computeWorldMatrix(true); + child.mesh.getWorldMatrix().multiplyToRef(currentInverseWorld, TmpVectors.Matrix[0]); + const boundingBox5 = child.mesh.getBoundingInfo().boundingBox; + const extendSize = Vector3.TransformNormal(boundingBox5.extendSize, TmpVectors.Matrix[0]); + extendSizes.push(extendSize); + if (this._isVertical) { + height += extendSize.y; + } else { + width += extendSize.x; + } + } + if (this._isVertical) { + height += (controlCount - 1) * this.margin / 2; + } else { + width += (controlCount - 1) * this.margin / 2; + } + let offset; + if (this._isVertical) { + offset = -height; + } else { + offset = -width; + } + let index = 0; + for (const child of this._children) { + if (!child.mesh) { + continue; + } + controlCount--; + const extendSize = extendSizes[index++]; + if (this._isVertical) { + child.position.y = offset + extendSize.y; + child.position.x = 0; + offset += extendSize.y * 2; + } else { + child.position.x = offset + extendSize.x; + child.position.y = 0; + offset += extendSize.x * 2; + } + offset += controlCount > 0 ? this.margin : 0; + } + } +} +var init_stackPanel3D = __esm(() => { + init_tools(); + init_math_vector(); + init_container3D(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/touchMeshButton3D.js +class TouchMeshButton3D extends TouchButton3D2 { + constructor(mesh84, name329) { + super(name329, mesh84); + this._currentMesh = mesh84; + this.pointerEnterAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(1.1); + }; + this.pointerOutAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(1 / 1.1); + }; + this.pointerDownAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(0.95); + }; + this.pointerUpAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(1 / 0.95); + }; + } + _getTypeName() { + return "TouchMeshButton3D"; + } + _createNode() { + this._currentMesh.getChildMeshes().forEach((mesh84) => { + this._injectGUI3DReservedDataStore(mesh84).control = this; + }); + return this._currentMesh; + } + _affectMaterial(mesh84) { + } +} +var init_touchMeshButton3D = __esm(() => { + init_touchButton3D(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlBackglow.fragment.js +var name329, shader327; +var init_mrdlBackglow_fragment = __esm(() => { + init_shaderStore(); + name329 = "mrdlBackglowPixelShader"; + shader327 = `uniform vec3 cameraPosition;varying vec3 vNormal;varying vec2 vUV;uniform float _Bevel_Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Tuning_Motion_;uniform float _Motion_;uniform float _Max_Intensity_;uniform float _Intensity_Fade_In_Exponent_;uniform float _Outer_Fuzz_Start_;uniform float _Outer_Fuzz_End_;uniform vec4 _Color_;uniform vec4 _Inner_Color_;uniform float _Blend_Exponent_;uniform float _Falloff_;uniform float _Bias_;float BiasFunc(float b,float v) {return pow(v,log(clamp(b,0.001,0.999))/log(0.5));} +void Fuzzy_Round_Rect_B33( +float Size_X, +float Size_Y, +float Radius_X, +float Radius_Y, +float Line_Width, +vec2 UV, +float Outer_Fuzz, +float Max_Outer_Fuzz, +out float Rect_Distance, +out float Inner_Distance) +{vec2 halfSize=vec2(Size_X,Size_Y)*0.5;vec2 r=max(min(vec2(Radius_X,Radius_Y),halfSize),vec2(0.001,0.001));float radius=min(r.x,r.y)-Max_Outer_Fuzz;vec2 v=abs(UV);vec2 nearestp=min(v,halfSize-r);float d=distance(nearestp,v);Inner_Distance=clamp(1.0-(radius-d)/Line_Width,0.0,1.0);Rect_Distance=clamp(1.0-(d-radius)/Outer_Fuzz,0.0,1.0)*Inner_Distance;} +void main() +{float X_Q42;float Y_Q42;X_Q42=vNormal.x;Y_Q42=vNormal.y;float MaxAB_Q24=max(_Tuning_Motion_,_Motion_);float Sqrt_F_Q27=sqrt(MaxAB_Q24);float Power_Q43=pow(MaxAB_Q24,_Intensity_Fade_In_Exponent_);float Value_At_T_Q26=mix(_Outer_Fuzz_Start_,_Outer_Fuzz_End_,Sqrt_F_Q27);float Product_Q23=_Max_Intensity_*Power_Q43;float Rect_Distance_Q33;float Inner_Distance_Q33;Fuzzy_Round_Rect_B33(X_Q42,Y_Q42,_Bevel_Radius_,_Bevel_Radius_,_Line_Width_,vUV,Value_At_T_Q26,_Outer_Fuzz_Start_,Rect_Distance_Q33,Inner_Distance_Q33);float Power_Q44=pow(Inner_Distance_Q33,_Blend_Exponent_);float Result_Q45=pow(BiasFunc(_Bias_,Rect_Distance_Q33),_Falloff_);vec4 Color_At_T_Q25=mix(_Inner_Color_,_Color_,Power_Q44);float Product_Q22=Result_Q45*Product_Q23;vec4 Result_Q28=Product_Q22*Color_At_T_Q25;vec4 Out_Color=Result_Q28;float Clip_Threshold=0.0;gl_FragColor=Out_Color;}`; + ShaderStore.ShadersStore[name329] = shader327; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlBackglow.vertex.js +var name330, shader328; +var init_mrdlBackglow_vertex = __esm(() => { + init_shaderStore(); + name330 = "mrdlBackglowVertexShader"; + shader328 = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;uniform float _Bevel_Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Tuning_Motion_;uniform float _Motion_;uniform float _Max_Intensity_;uniform float _Intensity_Fade_In_Exponent_;uniform float _Outer_Fuzz_Start_;uniform float _Outer_Fuzz_End_;uniform vec4 _Color_;uniform vec4 _Inner_Color_;uniform float _Blend_Exponent_;uniform float _Falloff_;uniform float _Bias_;varying vec3 vNormal;varying vec2 vUV;void main() +{vec3 Dir_World_Q41=(world*vec4(tangent,0.0)).xyz;vec3 Dir_World_Q40=(world*vec4((cross(normal,tangent)),0.0)).xyz;float MaxAB_Q24=max(_Tuning_Motion_,_Motion_);float Length_Q16=length(Dir_World_Q41);float Length_Q17=length(Dir_World_Q40);bool Greater_Than_Q37=MaxAB_Q24>0.0;vec3 Sizes_Q35;vec2 XY_Q35;Sizes_Q35=(_Absolute_Sizes_ ? vec3(Length_Q16,Length_Q17,0) : vec3(Length_Q16/Length_Q17,1,0));XY_Q35=(uv-vec2(0.5,0.5))*Sizes_Q35.xy;vec3 Result_Q38=Greater_Than_Q37 ? position : vec3(0,0,0);vec3 Pos_World_Q39=(world*vec4(Result_Q38,1.0)).xyz;vec3 Position=Pos_World_Q39;vec3 Normal=Sizes_Q35;vec2 UV=XY_Q35;vec3 Tangent=vec3(0,0,0);vec3 Binormal=vec3(0,0,0);vec4 Color=vec4(1,1,1,1);gl_Position=viewProjection*vec4(Position,1);vNormal=Normal;vUV=UV;}`; + ShaderStore.ShadersStore[name330] = shader328; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/mrdl/mrdlBackglowMaterial.js +class MRDLBackglowMaterialDefines2 extends MaterialDefines { + constructor() { + super(); + this._needNormals = true; + this._needUVs = true; + this.rebuild(); + } +} + +class MRDLBackglowMaterial2 extends PushMaterial { + constructor(name331, scene50) { + super(name331, scene50); + this.bevelRadius = 0.16; + this.lineWidth = 0.16; + this.absoluteSizes = false; + this.tuningMotion = 0; + this.motion = 1; + this.maxIntensity = 0.7; + this.intensityFadeInExponent = 2; + this.outerFuzzStart = 0.04; + this.outerFuzzEnd = 0.04; + this.color = new Color4(0.682353, 0.698039, 1, 1); + this.innerColor = new Color4(0.356863, 0.392157, 0.796078, 1); + this.blendExponent = 1.5; + this.falloff = 2; + this.bias = 0.5; + this.alphaMode = Constants.ALPHA_ADD; + this.disableDepthWrite = true; + this.backFaceCulling = false; + } + needAlphaBlending() { + return true; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh84, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new MRDLBackglowMaterialDefines2; + } + const defines = subMesh11.materialDefines; + const scene50 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene50.getEngine(); + MaterialHelper.PrepareDefinesForAttributes(mesh84, defines, false, false); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + defines.IMAGEPROCESSINGPOSTPROCESS = scene50.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + if (defines.TANGENT) { + attribs.push(VertexBuffer.TangentKind); + } + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "mrdlBackglow"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "worldView", + "worldViewProjection", + "view", + "projection", + "viewProjection", + "cameraPosition", + "_Bevel_Radius_", + "_Line_Width_", + "_Absolute_Sizes_", + "_Tuning_Motion_", + "_Motion_", + "_Max_Intensity_", + "_Intensity_Fade_In_Exponent_", + "_Outer_Fuzz_Start_", + "_Outer_Fuzz_End_", + "_Color_", + "_Inner_Color_", + "_Blend_Exponent_", + "_Falloff_", + "_Bias_" + ]; + const samplers = []; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh84, subMesh11) { + const scene50 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene50.getTransformMatrix()); + this._activeEffect.setVector3("cameraPosition", scene50.activeCamera.position); + this._activeEffect.setFloat("_Bevel_Radius_", this.bevelRadius); + this._activeEffect.setFloat("_Line_Width_", this.lineWidth); + this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1 : 0); + this._activeEffect.setFloat("_Tuning_Motion_", this.tuningMotion); + this._activeEffect.setFloat("_Motion_", this.motion); + this._activeEffect.setFloat("_Max_Intensity_", this.maxIntensity); + this._activeEffect.setFloat("_Intensity_Fade_In_Exponent_", this.intensityFadeInExponent); + this._activeEffect.setFloat("_Outer_Fuzz_Start_", this.outerFuzzStart); + this._activeEffect.setFloat("_Outer_Fuzz_End_", this.outerFuzzEnd); + this._activeEffect.setDirectColor4("_Color_", this.color); + this._activeEffect.setDirectColor4("_Inner_Color_", this.innerColor); + this._activeEffect.setFloat("_Blend_Exponent_", this.blendExponent); + this._activeEffect.setFloat("_Falloff_", this.falloff); + this._activeEffect.setFloat("_Bias_", this.bias); + this._afterBind(mesh84, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + } + clone(name331) { + return SerializationHelper.Clone(() => new MRDLBackglowMaterial2(name331, this.getScene()), this); + } + serialize() { + const serializationObject = SerializationHelper.Serialize(this); + serializationObject.customType = "BABYLON.MRDLBackglowMaterial"; + return serializationObject; + } + getClassName() { + return "MRDLBackglowMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new MRDLBackglowMaterial2(source.name, scene50), source, scene50, rootUrl); + } +} +var init_mrdlBackglowMaterial = __esm(() => { + init_tslib_es62(); + init_math_color(); + init_constants(); + init_effectFallbacks(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_typeStore(); + init_decorators(); + init_buffer(); + init_mrdlBackglow_fragment(); + init_mrdlBackglow_vertex(); + __decorate2([ + serialize() + ], MRDLBackglowMaterial2.prototype, "bevelRadius", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial2.prototype, "lineWidth", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial2.prototype, "absoluteSizes", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial2.prototype, "tuningMotion", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial2.prototype, "motion", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial2.prototype, "maxIntensity", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial2.prototype, "intensityFadeInExponent", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial2.prototype, "outerFuzzStart", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial2.prototype, "outerFuzzEnd", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial2.prototype, "color", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial2.prototype, "innerColor", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial2.prototype, "blendExponent", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial2.prototype, "falloff", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial2.prototype, "bias", undefined); + RegisterClass("BABYLON.GUI.MRDLBackglowMaterial", MRDLBackglowMaterial2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlFrontplate.fragment.js +var name331, shader329; +var init_mrdlFrontplate_fragment = __esm(() => { + init_shaderStore(); + name331 = "mrdlFrontplatePixelShader"; + shader329 = `uniform vec3 cameraPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Relative_To_Height_;uniform float _Filter_Width_;uniform vec4 _Edge_Color_;uniform float _Fade_Out_;uniform bool _Smooth_Edges_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform float _Blob_Pulse_Max_Size_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Gaze_Intensity_;uniform float _Gaze_Focus_;uniform sampler2D _Blob_Texture_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;void Scale_Color_B54( +vec4 Color, +float Scalar, +out vec4 Result) +{Result=Scalar*Color;} +void Scale_RGB_B50( +vec4 Color, +float Scalar, +out vec4 Result) +{Result=vec4(Scalar,Scalar,Scalar,1)*Color;} +void Proximity_Fragment_B51( +float Proximity_Max_Intensity, +float Proximity_Near_Radius, +vec4 Deltas, +float Show_Selection, +float Distance_Fade1, +float Distance_Fade2, +float Strength, +out float Proximity) +{float proximity1=(1.0-clamp(length(Deltas.xy)/Proximity_Near_Radius,0.0,1.0))*Distance_Fade1;float proximity2=(1.0-clamp(length(Deltas.zw)/Proximity_Near_Radius,0.0,1.0))*Distance_Fade2;Proximity=Strength*(Proximity_Max_Intensity*max(proximity1,proximity2) *(1.0-Show_Selection)+Show_Selection);} +void Blob_Fragment_B56( +vec2 UV, +vec3 Blob_Info, +sampler2D Blob_Texture, +out vec4 Blob_Color) +{float k=dot(UV,UV);Blob_Color=Blob_Info.y*texture(Blob_Texture,vec2(vec2(sqrt(k),Blob_Info.x).x,1.0-vec2(sqrt(k),Blob_Info.x).y))*(1.0-clamp(k,0.0,1.0));} +void Round_Rect_Fragment_B61( +float Radius, +vec4 Line_Color, +float Filter_Width, +float Line_Visibility, +vec4 Fill_Color, +bool Smooth_Edges, +vec4 Rect_Parms, +out float Inside_Rect) +{float d=length(max(abs(Rect_Parms.zw)-Rect_Parms.xy,0.0));float dx=max(fwidth(d)*Filter_Width,0.00001);Inside_Rect=Smooth_Edges ? clamp((Radius-d)/dx,0.0,1.0) : 1.0-step(Radius,d);} +void main() +{float Is_Quad_Q53;Is_Quad_Q53=vNormal.z;vec4 Blob_Color_Q56;Blob_Fragment_B56(vUV,vTangent,_Blob_Texture_,Blob_Color_Q56);float X_Q52;float Y_Q52;float Z_Q52;float W_Q52;X_Q52=vExtra3.x;Y_Q52=vExtra3.y;Z_Q52=vExtra3.z;W_Q52=vExtra3.w;float Proximity_Q51;Proximity_Fragment_B51(_Proximity_Max_Intensity_,_Proximity_Near_Radius_,vExtra2,X_Q52,Y_Q52,Z_Q52,1.0,Proximity_Q51);float Inside_Rect_Q61;Round_Rect_Fragment_B61(W_Q52,vec4(1,1,1,1),_Filter_Width_,1.0,vec4(0,0,0,0),_Smooth_Edges_,vExtra1,Inside_Rect_Q61);vec4 Result_Q50;Scale_RGB_B50(_Edge_Color_,Proximity_Q51,Result_Q50);vec4 Result_Q47=Inside_Rect_Q61*Blob_Color_Q56;vec4 Color_At_T_Q48=mix(Result_Q50,Result_Q47,Is_Quad_Q53);vec4 Result_Q54;Scale_Color_B54(Color_At_T_Q48,_Fade_Out_,Result_Q54);vec4 Out_Color=Result_Q54;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}`; + ShaderStore.ShadersStore[name331] = shader329; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlFrontplate.vertex.js +var name332, shader330; +var init_mrdlFrontplate_vertex = __esm(() => { + init_shaderStore(); + name332 = "mrdlFrontplateVertexShader"; + shader330 = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Relative_To_Height_;uniform float _Filter_Width_;uniform vec4 _Edge_Color_;uniform float _Fade_Out_;uniform bool _Smooth_Edges_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform float _Blob_Pulse_Max_Size_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Gaze_Intensity_;uniform float _Gaze_Focus_;uniform sampler2D _Blob_Texture_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Blob_Vertex_B40( +vec3 Position, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +vec3 Blob_Position, +float Intensity, +float Blob_Near_Size, +float Blob_Far_Size, +float Blob_Near_Distance, +float Blob_Far_Distance, +vec4 Vx_Color, +vec2 UV, +vec3 Face_Center, +vec2 Face_Size, +vec2 In_UV, +float Blob_Fade_Length, +float Selection_Fade, +float Selection_Fade_Size, +float Inner_Fade, +float Blob_Pulse, +float Blob_Fade, +float Blob_Enabled, +float DistanceOffset, +out vec3 Out_Position, +out vec2 Out_UV, +out vec3 Blob_Info, +out vec2 Blob_Relative_UV) +{float blobSize,fadeIn;vec3 Hit_Position;Blob_Info=vec3(0.0,0.0,0.0);float Hit_Distance=dot(Blob_Position-Face_Center,Normal)+DistanceOffset*Blob_Far_Distance;Hit_Position=Blob_Position-Hit_Distance*Normal;float absD=abs(Hit_Distance);float lerpVal=clamp((absD-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);fadeIn=1.0-clamp((absD-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float innerFade=1.0-clamp(-Hit_Distance/Inner_Fade,0.0,1.0);float farClip=clamp(1.0-step(Blob_Far_Distance+Blob_Fade_Length,absD),0.0,1.0);float size=mix(Blob_Near_Size,Blob_Far_Size,lerpVal)*farClip;blobSize=mix(size,Selection_Fade_Size,Selection_Fade)*innerFade*Blob_Enabled;Blob_Info.x=lerpVal*0.5+0.5;Blob_Info.y=fadeIn*Intensity*(1.0-Selection_Fade)*Blob_Fade;Blob_Info.x*=(1.0-Blob_Pulse);vec3 delta=Hit_Position-Face_Center;vec2 blobCenterXY=vec2(dot(delta,Tangent),dot(delta,Bitangent));vec2 quadUVin=2.0*UV-1.0; +vec2 blobXY=blobCenterXY+quadUVin*blobSize;vec2 blobClipped=clamp(blobXY,-Face_Size*0.5,Face_Size*0.5);vec2 blobUV=(blobClipped-blobCenterXY)/max(blobSize,0.0001)*2.0;vec3 blobCorner=Face_Center+blobClipped.x*Tangent+blobClipped.y*Bitangent;Out_Position=mix(Position,blobCorner,Vx_Color.rrr);Out_UV=mix(In_UV,blobUV,Vx_Color.rr);Blob_Relative_UV=blobClipped/Face_Size.y;} +void Round_Rect_Vertex_B36( +vec2 UV, +vec3 Tangent, +vec3 Binormal, +float Radius, +float Anisotropy, +vec2 Blob_Center_UV, +out vec2 Rect_UV, +out vec2 Scale_XY, +out vec4 Rect_Parms) +{Scale_XY=vec2(Anisotropy,1.0);Rect_UV=(UV-vec2(0.5,0.5))*Scale_XY;Rect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius);Rect_Parms.zw=Blob_Center_UV;} +vec2 ProjectProximity( +vec3 blobPosition, +vec3 position, +vec3 center, +vec3 dir, +vec3 xdir, +vec3 ydir, +out float vdistance +) +{vec3 delta=blobPosition-position;vec2 xy=vec2(dot(delta,xdir),dot(delta,ydir));vdistance=abs(dot(delta,dir));return xy;} +void Proximity_Vertex_B33( +vec3 Blob_Position, +vec3 Blob_Position_2, +vec3 Face_Center, +vec3 Position, +float Proximity_Far_Distance, +float Relative_Scale, +float Proximity_Anisotropy, +vec3 Normal, +vec3 Tangent, +vec3 Binormal, +out vec4 Extra, +out float Distance_To_Face, +out float Distance_Fade1, +out float Distance_Fade2) +{float distz1,distz2;Extra.xy=ProjectProximity(Blob_Position,Position,Face_Center,Normal,Tangent*Proximity_Anisotropy,Binormal,distz1)/Relative_Scale;Extra.zw=ProjectProximity(Blob_Position_2,Position,Face_Center,Normal,Tangent*Proximity_Anisotropy,Binormal,distz2)/Relative_Scale;Distance_To_Face=dot(Normal,Position-Face_Center);Distance_Fade1=1.0-clamp(distz1/Proximity_Far_Distance,0.0,1.0);Distance_Fade2=1.0-clamp(distz2/Proximity_Far_Distance,0.0,1.0);} +void Object_To_World_Pos_B12( +vec3 Pos_Object, +out vec3 Pos_World) +{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;} +void Choose_Blob_B27( +vec4 Vx_Color, +vec3 Position1, +vec3 Position2, +bool Blob_Enable_1, +bool Blob_Enable_2, +float Near_Size_1, +float Near_Size_2, +float Blob_Inner_Fade_1, +float Blob_Inner_Fade_2, +float Blob_Pulse_1, +float Blob_Pulse_2, +float Blob_Fade_1, +float Blob_Fade_2, +out vec3 Position, +out float Near_Size, +out float Inner_Fade, +out float Blob_Enable, +out float Fade, +out float Pulse) +{Position=Position1*(1.0-Vx_Color.g)+Vx_Color.g*Position2;float b1=Blob_Enable_1 ? 1.0 : 0.0;float b2=Blob_Enable_2 ? 1.0 : 0.0;Blob_Enable=b1+(b2-b1)*Vx_Color.g;Pulse=Blob_Pulse_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Pulse_2;Fade=Blob_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Fade_2;Near_Size=Near_Size_1*(1.0-Vx_Color.g)+Vx_Color.g*Near_Size_2;Inner_Fade=Blob_Inner_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Inner_Fade_2;} +void Move_Verts_B32( +vec2 UV, +float Radius, +float Anisotropy, +float Line_Width, +float Visible, +out vec3 New_P, +out vec2 New_UV) +{vec2 xy=2.0*UV-vec2(0.5,0.5);vec2 center=clamp(xy,0.0,1.0);vec2 delta=2.0*(xy-center);float deltaLength=length(delta);vec2 aniso=vec2(1.0/Anisotropy,1.0);center=(center-vec2(0.5,0.5))*(1.0-2.0*Radius*aniso);New_UV=vec2((2.0-2.0*deltaLength)*Visible,0.0);float deltaRadius= (Radius-Line_Width*New_UV.x);New_P.xy=(center+deltaRadius/deltaLength *aniso*delta);New_P.z=0.0;} +void Object_To_World_Dir_B14( +vec3 Dir_Object, +out vec3 Binormal_World) +{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;} +void Proximity_Visibility_B55( +float Selection, +vec3 Proximity_Center, +vec3 Proximity_Center_2, +float Proximity_Far_Distance, +float Proximity_Radius, +vec3 Face_Center, +vec3 Normal, +vec2 Face_Size, +float Gaze, +out float Width) +{float boxMaxSize=length(Face_Size)*0.5;float d1=dot(Proximity_Center-Face_Center,Normal);vec3 blob1=Proximity_Center-d1*Normal;float d2=dot(Proximity_Center_2-Face_Center,Normal);vec3 blob2=Proximity_Center_2-d2*Normal;vec3 delta1=blob1-Face_Center;vec3 delta2=blob2-Face_Center;float dist1=dot(delta1,delta1);float dist2=dot(delta2,delta2);float nearestProxDist=sqrt(min(dist1,dist2));Width=(1.0-step(boxMaxSize+Proximity_Radius,nearestProxDist))*(1.0-step(Proximity_Far_Distance,min(d1,d2))*(1.0-step(0.0001,Selection)));Width=max(Gaze,Width);} +vec2 ramp2(vec2 start,vec2 end,vec2 x) +{return clamp((x-start)/(end-start),vec2(0.0,0.0),vec2(1.0,1.0));} +float computeSelection( +vec3 blobPosition, +vec3 normal, +vec3 tangent, +vec3 bitangent, +vec3 faceCenter, +vec2 faceSize, +float selectionFuzz, +float farDistance, +float fadeLength +) +{vec3 delta=blobPosition-faceCenter;float absD=abs(dot(delta,normal));float fadeIn=1.0-clamp((absD-farDistance)/fadeLength,0.0,1.0);vec2 blobCenterXY=vec2(dot(delta,tangent),dot(delta,bitangent));vec2 innerFace=faceSize*(1.0-selectionFuzz)*0.5;vec2 selectPulse=ramp2(-faceSize*0.5,-innerFace,blobCenterXY)-ramp2(innerFace,faceSize*0.5,blobCenterXY);return selectPulse.x*selectPulse.y*fadeIn;} +void Selection_Vertex_B31( +vec3 Blob_Position, +vec3 Blob_Position_2, +vec3 Face_Center, +vec2 Face_Size, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +float Selection_Fuzz, +float Selected, +float Far_Distance, +float Fade_Length, +vec3 Active_Face_Dir, +out float Show_Selection) +{float select1=computeSelection(Blob_Position,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float select2=computeSelection(Blob_Position_2,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);Show_Selection=mix(max(select1,select2),1.0,Selected);} +void main() +{vec3 Vec3_Q29=vec3(vec2(0,0).x,vec2(0,0).y,color.r);vec3 Nrm_World_Q24;Nrm_World_Q24=normalize((world*vec4(normal,0.0)).xyz);vec3 Face_Center_Q30;Face_Center_Q30=(world*vec4(vec3(0,0,0),1.0)).xyz;vec3 Tangent_World_Q13;Tangent_World_Q13=(world*vec4(tangent,0.0)).xyz;vec3 Result_Q42;Result_Q42=_Use_Global_Left_Index_ ? Global_Left_Index_Tip_Position.xyz : _Blob_Position_;vec3 Result_Q43;Result_Q43=_Use_Global_Right_Index_ ? Global_Right_Index_Tip_Position.xyz : _Blob_Position_2_;float Value_At_T_Q58=mix(_Blob_Near_Size_,_Blob_Pulse_Max_Size_,_Blob_Pulse_);float Value_At_T_Q59=mix(_Blob_Near_Size_2_,_Blob_Pulse_Max_Size_,_Blob_Pulse_2_);vec3 Cross_Q70=cross(normal,tangent);float Product_Q45=_Gaze_Intensity_*_Gaze_Focus_;float Step_Q46=step(0.0001,Product_Q45);vec3 Tangent_World_N_Q15=normalize(Tangent_World_Q13);vec3 Position_Q27;float Near_Size_Q27;float Inner_Fade_Q27;float Blob_Enable_Q27;float Fade_Q27;float Pulse_Q27;Choose_Blob_B27(color,Result_Q42,Result_Q43,_Blob_Enable_,_Blob_Enable_2_,Value_At_T_Q58,Value_At_T_Q59,_Blob_Inner_Fade_,_Blob_Inner_Fade_2_,_Blob_Pulse_,_Blob_Pulse_2_,_Blob_Fade_,_Blob_Fade_2_,Position_Q27,Near_Size_Q27,Inner_Fade_Q27,Blob_Enable_Q27,Fade_Q27,Pulse_Q27);vec3 Binormal_World_Q14;Object_To_World_Dir_B14(Cross_Q70,Binormal_World_Q14);float Anisotropy_Q21=length(Tangent_World_Q13)/length(Binormal_World_Q14);vec3 Binormal_World_N_Q16=normalize(Binormal_World_Q14);vec2 Face_Size_Q35;float ScaleY_Q35;Face_Size_Q35=vec2(length(Tangent_World_Q13),length(Binormal_World_Q14));ScaleY_Q35=Face_Size_Q35.y;float Out_Radius_Q38;float Out_Line_Width_Q38;Out_Radius_Q38=_Relative_To_Height_ ? _Radius_ : _Radius_/ScaleY_Q35;Out_Line_Width_Q38=_Relative_To_Height_ ? _Line_Width_ : _Line_Width_/ScaleY_Q35;float Show_Selection_Q31;Selection_Vertex_B31(Result_Q42,Result_Q43,Face_Center_Q30,Face_Size_Q35,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,_Selection_Fuzz_,_Selected_,_Selected_Distance_,_Selected_Fade_Length_,vec3(0,0,-1),Show_Selection_Q31);float MaxAB_Q41=max(Show_Selection_Q31,Product_Q45);float Width_Q55;Proximity_Visibility_B55(Show_Selection_Q31,Result_Q42,Result_Q43,_Proximity_Far_Distance_,_Proximity_Near_Radius_,Face_Center_Q30,Nrm_World_Q24,Face_Size_Q35,Step_Q46,Width_Q55);vec3 New_P_Q32;vec2 New_UV_Q32;Move_Verts_B32(uv,Out_Radius_Q38,Anisotropy_Q21,Out_Line_Width_Q38,Width_Q55,New_P_Q32,New_UV_Q32);vec3 Pos_World_Q12;Object_To_World_Pos_B12(New_P_Q32,Pos_World_Q12);vec3 Out_Position_Q40;vec2 Out_UV_Q40;vec3 Blob_Info_Q40;vec2 Blob_Relative_UV_Q40;Blob_Vertex_B40(Pos_World_Q12,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,Position_Q27,_Blob_Intensity_,Near_Size_Q27,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,color,uv,Face_Center_Q30,Face_Size_Q35,New_UV_Q32,_Blob_Fade_Length_,_Selection_Fade_,_Selection_Fade_Size_,Inner_Fade_Q27,Pulse_Q27,Fade_Q27,Blob_Enable_Q27,0.0,Out_Position_Q40,Out_UV_Q40,Blob_Info_Q40,Blob_Relative_UV_Q40);vec2 Rect_UV_Q36;vec2 Scale_XY_Q36;vec4 Rect_Parms_Q36;Round_Rect_Vertex_B36(New_UV_Q32,Tangent_World_Q13,Binormal_World_Q14,Out_Radius_Q38,Anisotropy_Q21,Blob_Relative_UV_Q40,Rect_UV_Q36,Scale_XY_Q36,Rect_Parms_Q36);vec4 Extra_Q33;float Distance_To_Face_Q33;float Distance_Fade1_Q33;float Distance_Fade2_Q33;Proximity_Vertex_B33(Result_Q42,Result_Q43,Face_Center_Q30,Pos_World_Q12,_Proximity_Far_Distance_,1.0,_Proximity_Anisotropy_,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,Extra_Q33,Distance_To_Face_Q33,Distance_Fade1_Q33,Distance_Fade2_Q33);vec4 Vec4_Q37=vec4(MaxAB_Q41,Distance_Fade1_Q33,Distance_Fade2_Q33,Out_Radius_Q38);vec3 Position=Out_Position_Q40;vec3 Normal=Vec3_Q29;vec2 UV=Out_UV_Q40;vec3 Tangent=Blob_Info_Q40;vec3 Binormal=vec3(0,0,0);vec4 Color=vec4(1,1,1,1);vec4 Extra1=Rect_Parms_Q36;vec4 Extra2=Extra_Q33;vec4 Extra3=Vec4_Q37;gl_Position=viewProjection*vec4(Position,1);vNormal=Normal;vUV=UV;vTangent=Tangent;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}`; + ShaderStore.ShadersStore[name332] = shader330; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/mrdl/mrdlFrontplateMaterial.js +class MRDLFrontplateMaterialDefines2 extends MaterialDefines { + constructor() { + super(); + this.SMOOTH_EDGES = true; + this._needNormals = true; + this._needUVs = true; + this.rebuild(); + } +} + +class MRDLFrontplateMaterial2 extends PushMaterial { + constructor(name333, scene50) { + super(name333, scene50); + this.radius = 0.12; + this.lineWidth = 0.01; + this.relativeToHeight = false; + this._filterWidth = 1; + this.edgeColor = new Color4(0.53, 0.53, 0.53, 1); + this.blobEnable = true; + this.blobPosition = new Vector3(100, 100, 100); + this.blobIntensity = 0.5; + this.blobNearSize = 0.032; + this.blobFarSize = 0.048; + this.blobNearDistance = 0.008; + this.blobFarDistance = 0.064; + this.blobFadeLength = 0.04; + this.blobInnerFade = 0.01; + this.blobPulse = 0; + this.blobFade = 1; + this.blobPulseMaxSize = 0.05; + this.blobEnable2 = true; + this.blobPosition2 = new Vector3(10, 10.1, -0.6); + this.blobNearSize2 = 0.008; + this.blobInnerFade2 = 0.1; + this.blobPulse2 = 0; + this.blobFade2 = 1; + this.gazeIntensity = 0.8; + this.gazeFocus = 0; + this.selectionFuzz = 0.5; + this.selected = 1; + this.selectionFade = 0.2; + this.selectionFadeSize = 0; + this.selectedDistance = 0.08; + this.selectedFadeLength = 0.08; + this.proximityMaxIntensity = 0.45; + this.proximityFarDistance = 0.16; + this.proximityNearRadius = 0.016; + this.proximityAnisotropy = 1; + this.useGlobalLeftIndex = true; + this.useGlobalRightIndex = true; + this.fadeOut = 1; + this.alphaMode = Constants.ALPHA_ADD; + this.disableDepthWrite = true; + this.backFaceCulling = false; + this._blobTexture = new Texture(MRDLFrontplateMaterial2.BLOB_TEXTURE_URL, scene50, true, false, Texture.NEAREST_SAMPLINGMODE); + } + needAlphaBlending() { + return true; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh84, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new MRDLFrontplateMaterialDefines2; + } + const defines = subMesh11.materialDefines; + const scene50 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene50.getEngine(); + MaterialHelper.PrepareDefinesForAttributes(mesh84, defines, false, false); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + defines.IMAGEPROCESSINGPOSTPROCESS = scene50.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + if (defines.TANGENT) { + attribs.push(VertexBuffer.TangentKind); + } + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "mrdlFrontplate"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "worldView", + "worldViewProjection", + "view", + "projection", + "viewProjection", + "cameraPosition", + "_Radius_", + "_Line_Width_", + "_Relative_To_Height_", + "_Filter_Width_", + "_Edge_Color_", + "_Fade_Out_", + "_Smooth_Edges_", + "_Blob_Enable_", + "_Blob_Position_", + "_Blob_Intensity_", + "_Blob_Near_Size_", + "_Blob_Far_Size_", + "_Blob_Near_Distance_", + "_Blob_Far_Distance_", + "_Blob_Fade_Length_", + "_Blob_Inner_Fade_", + "_Blob_Pulse_", + "_Blob_Fade_", + "_Blob_Pulse_Max_Size_", + "_Blob_Enable_2_", + "_Blob_Position_2_", + "_Blob_Near_Size_2_", + "_Blob_Inner_Fade_2_", + "_Blob_Pulse_2_", + "_Blob_Fade_2_", + "_Gaze_Intensity_", + "_Gaze_Focus_", + "_Blob_Texture_", + "_Selection_Fuzz_", + "_Selected_", + "_Selection_Fade_", + "_Selection_Fade_Size_", + "_Selected_Distance_", + "_Selected_Fade_Length_", + "_Proximity_Max_Intensity_", + "_Proximity_Far_Distance_", + "_Proximity_Near_Radius_", + "_Proximity_Anisotropy_", + "Global_Left_Index_Tip_Position", + "Global_Right_Index_Tip_Position", + "_Use_Global_Left_Index_", + "_Use_Global_Right_Index_" + ]; + const samplers = []; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh84, subMesh11) { + const scene50 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene50.getTransformMatrix()); + this._activeEffect.setVector3("cameraPosition", scene50.activeCamera.position); + this._activeEffect.setFloat("_Radius_", this.radius); + this._activeEffect.setFloat("_Line_Width_", this.lineWidth); + this._activeEffect.setFloat("_Relative_To_Height_", this.relativeToHeight ? 1 : 0); + this._activeEffect.setFloat("_Filter_Width_", this._filterWidth); + this._activeEffect.setDirectColor4("_Edge_Color_", this.edgeColor); + this._activeEffect.setFloat("_Fade_Out_", this.fadeOut); + this._activeEffect.setFloat("_Blob_Enable_", this.blobEnable ? 1 : 0); + this._activeEffect.setVector3("_Blob_Position_", this.blobPosition); + this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity); + this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize); + this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize); + this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance); + this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance); + this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength); + this._activeEffect.setFloat("_Blob_Inner_Fade_", this.blobInnerFade); + this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse); + this._activeEffect.setFloat("_Blob_Fade_", this.blobFade); + this._activeEffect.setFloat("_Blob_Pulse_Max_Size_", this.blobPulseMaxSize); + this._activeEffect.setFloat("_Blob_Enable_2_", this.blobEnable2 ? 1 : 0); + this._activeEffect.setVector3("_Blob_Position_2_", this.blobPosition2); + this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2); + this._activeEffect.setFloat("_Blob_Inner_Fade_2_", this.blobInnerFade2); + this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2); + this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2); + this._activeEffect.setFloat("_Gaze_Intensity_", this.gazeIntensity); + this._activeEffect.setFloat("_Gaze_Focus_", this.gazeFocus); + this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture); + this._activeEffect.setFloat("_Selection_Fuzz_", this.selectionFuzz); + this._activeEffect.setFloat("_Selected_", this.selected); + this._activeEffect.setFloat("_Selection_Fade_", this.selectionFade); + this._activeEffect.setFloat("_Selection_Fade_Size_", this.selectionFadeSize); + this._activeEffect.setFloat("_Selected_Distance_", this.selectedDistance); + this._activeEffect.setFloat("_Selected_Fade_Length_", this.selectedFadeLength); + this._activeEffect.setFloat("_Proximity_Max_Intensity_", this.proximityMaxIntensity); + this._activeEffect.setFloat("_Proximity_Far_Distance_", this.proximityFarDistance); + this._activeEffect.setFloat("_Proximity_Near_Radius_", this.proximityNearRadius); + this._activeEffect.setFloat("_Proximity_Anisotropy_", this.proximityAnisotropy); + this._activeEffect.setFloat("_Use_Global_Left_Index_", this.useGlobalLeftIndex ? 1 : 0); + this._activeEffect.setFloat("_Use_Global_Right_Index_", this.useGlobalRightIndex ? 1 : 0); + this._afterBind(mesh84, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + } + clone(name333) { + return SerializationHelper.Clone(() => new MRDLFrontplateMaterial2(name333, this.getScene()), this); + } + serialize() { + const serializationObject = SerializationHelper.Serialize(this); + serializationObject.customType = "BABYLON.MRDLFrontplateMaterial"; + return serializationObject; + } + getClassName() { + return "MRDLFrontplateMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new MRDLFrontplateMaterial2(source.name, scene50), source, scene50, rootUrl); + } +} +var init_mrdlFrontplateMaterial = __esm(() => { + init_tslib_es62(); + init_math_color(); + init_constants(); + init_effectFallbacks(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_typeStore(); + init_decorators(); + init_math_vector(); + init_buffer(); + init_texture(); + init_mrdlFrontplate_fragment(); + init_mrdlFrontplate_vertex(); + MRDLFrontplateMaterial2.BLOB_TEXTURE_URL = ""; + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "radius", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "lineWidth", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "relativeToHeight", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "edgeColor", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobEnable", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobPosition", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobIntensity", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobNearSize", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobFarSize", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobNearDistance", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobFarDistance", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobFadeLength", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobInnerFade", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobPulse", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobFade", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobPulseMaxSize", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobEnable2", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobPosition2", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobNearSize2", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobInnerFade2", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobPulse2", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "blobFade2", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "gazeIntensity", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "gazeFocus", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "selectionFuzz", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "selected", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "selectionFade", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "selectionFadeSize", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "selectedDistance", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "selectedFadeLength", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "proximityMaxIntensity", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "proximityFarDistance", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "proximityNearRadius", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "proximityAnisotropy", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "useGlobalLeftIndex", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial2.prototype, "useGlobalRightIndex", undefined); + RegisterClass("BABYLON.GUI.MRDLFrontplateMaterial", MRDLFrontplateMaterial2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlInnerquad.fragment.js +var name333, shader331; +var init_mrdlInnerquad_fragment = __esm(() => { + init_shaderStore(); + name333 = "mrdlInnerquadPixelShader"; + shader331 = `uniform vec3 cameraPosition;varying vec2 vUV;varying vec3 vTangent;uniform vec4 _Color_;uniform float _Radius_;uniform bool _Fixed_Radius_;uniform float _Filter_Width_;uniform float _Glow_Fraction_;uniform float _Glow_Max_;uniform float _Glow_Falloff_;float FilterStep_Bid194(float edge,float x,float filterWidth) +{float dx=max(1.0E-5,fwidth(x)*filterWidth);return max((x+dx*0.5-max(edge,x-dx*0.5))/dx,0.0);} +void Round_Rect_B194( +float Size_X, +float Size_Y, +float Radius, +vec4 Rect_Color, +float Filter_Width, +vec2 UV, +float Glow_Fraction, +float Glow_Max, +float Glow_Falloff, +out vec4 Color) +{vec2 halfSize=vec2(Size_X,Size_Y)*0.5;vec2 r=max(min(vec2(Radius,Radius),halfSize),vec2(0.01,0.01));vec2 v=abs(UV);vec2 nearestp=min(v,halfSize-r);vec2 delta=(v-nearestp)/max(vec2(0.01,0.01),r);float Distance=length(delta);float insideRect=1.0-FilterStep_Bid194(1.0-Glow_Fraction,Distance,Filter_Width);float glow=clamp((1.0-Distance)/Glow_Fraction,0.0,1.0);glow=pow(glow,Glow_Falloff);Color=Rect_Color*max(insideRect,glow*Glow_Max);} +void main() +{float X_Q192;float Y_Q192;float Z_Q192;X_Q192=vTangent.x;Y_Q192=vTangent.y;Z_Q192=vTangent.z;vec4 Color_Q194;Round_Rect_B194(X_Q192,1.0,Y_Q192,_Color_,_Filter_Width_,vUV,_Glow_Fraction_,_Glow_Max_,_Glow_Falloff_,Color_Q194);vec4 Out_Color=Color_Q194;float Clip_Threshold=0.0;gl_FragColor=Out_Color;} +`; + ShaderStore.ShadersStore[name333] = shader331; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlInnerquad.vertex.js +var name334, shader332; +var init_mrdlInnerquad_vertex = __esm(() => { + init_shaderStore(); + name334 = "mrdlInnerquadVertexShader"; + shader332 = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform vec4 _Color_;uniform float _Radius_;uniform bool _Fixed_Radius_;uniform float _Filter_Width_;uniform float _Glow_Fraction_;uniform float _Glow_Max_;uniform float _Glow_Falloff_;varying vec2 vUV;varying vec3 vTangent;void main() +{vec3 Pos_World_Q189;Pos_World_Q189=(world*vec4(position,1.0)).xyz;vec3 Dir_World_Q190;Dir_World_Q190=(world*vec4(tangent,0.0)).xyz;vec3 Dir_World_Q191;Dir_World_Q191=(world*vec4((cross(normal,tangent)),0.0)).xyz;float Length_Q180=length(Dir_World_Q190);float Length_Q181=length(Dir_World_Q191);float Quotient_Q184=Length_Q180/Length_Q181;float Quotient_Q195=_Radius_/Length_Q181;vec2 Result_Q193;Result_Q193=vec2((uv.x-0.5)*Length_Q180/Length_Q181,(uv.y-0.5));float Result_Q198=_Fixed_Radius_ ? Quotient_Q195 : _Radius_;vec3 Vec3_Q183=vec3(Quotient_Q184,Result_Q198,0);vec3 Position=Pos_World_Q189;vec3 Normal=vec3(0,0,0);vec2 UV=Result_Q193;vec3 Tangent=Vec3_Q183;vec3 Binormal=vec3(0,0,0);vec4 Color=color;gl_Position=viewProjection*vec4(Position,1);vUV=UV;vTangent=Tangent;} +`; + ShaderStore.ShadersStore[name334] = shader332; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/mrdl/mrdlInnerquadMaterial.js +class MRDLInnerquadMaterialDefines2 extends MaterialDefines { + constructor() { + super(); + this._needNormals = true; + this._needUVs = true; + this.rebuild(); + } +} + +class MRDLInnerquadMaterial2 extends PushMaterial { + constructor(name335, scene50) { + super(name335, scene50); + this.color = new Color4(1, 1, 1, 0.05); + this.radius = 0.12; + this.fixedRadius = true; + this._filterWidth = 1; + this.glowFraction = 0; + this.glowMax = 0.5; + this.glowFalloff = 2; + this.alphaMode = Constants.ALPHA_COMBINE; + this.backFaceCulling = false; + } + needAlphaBlending() { + return true; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh84, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new MRDLInnerquadMaterialDefines2; + } + const defines = subMesh11.materialDefines; + const scene50 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene50.getEngine(); + MaterialHelper.PrepareDefinesForAttributes(mesh84, defines, true, false); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + defines.IMAGEPROCESSINGPOSTPROCESS = scene50.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + if (defines.TANGENT) { + attribs.push(VertexBuffer.TangentKind); + } + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "mrdlInnerquad"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "worldView", + "worldViewProjection", + "view", + "projection", + "viewProjection", + "cameraPosition", + "_Color_", + "_Radius_", + "_Fixed_Radius_", + "_Filter_Width_", + "_Glow_Fraction_", + "_Glow_Max_", + "_Glow_Falloff_" + ]; + const samplers = []; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh84, subMesh11) { + const scene50 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene50.getTransformMatrix()); + this._activeEffect.setVector3("cameraPosition", scene50.activeCamera.position); + this._activeEffect.setDirectColor4("_Color_", this.color); + this._activeEffect.setFloat("_Radius_", this.radius); + this._activeEffect.setFloat("_Fixed_Radius_", this.fixedRadius ? 1 : 0); + this._activeEffect.setFloat("_Filter_Width_", this._filterWidth); + this._activeEffect.setFloat("_Glow_Fraction_", this.glowFraction); + this._activeEffect.setFloat("_Glow_Max_", this.glowMax); + this._activeEffect.setFloat("_Glow_Falloff_", this.glowFalloff); + this._afterBind(mesh84, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + } + clone(name335) { + return SerializationHelper.Clone(() => new MRDLInnerquadMaterial2(name335, this.getScene()), this); + } + serialize() { + const serializationObject = SerializationHelper.Serialize(this); + serializationObject.customType = "BABYLON.MRDLInnerquadMaterial"; + return serializationObject; + } + getClassName() { + return "MRDLInnerquadMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new MRDLInnerquadMaterial2(source.name, scene50), source, scene50, rootUrl); + } +} +var init_mrdlInnerquadMaterial = __esm(() => { + init_tslib_es62(); + init_math_color(); + init_constants(); + init_effectFallbacks(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_typeStore(); + init_decorators(); + init_buffer(); + init_mrdlInnerquad_fragment(); + init_mrdlInnerquad_vertex(); + __decorate2([ + serialize() + ], MRDLInnerquadMaterial2.prototype, "color", undefined); + __decorate2([ + serialize() + ], MRDLInnerquadMaterial2.prototype, "radius", undefined); + __decorate2([ + serialize() + ], MRDLInnerquadMaterial2.prototype, "fixedRadius", undefined); + __decorate2([ + serialize() + ], MRDLInnerquadMaterial2.prototype, "glowFraction", undefined); + __decorate2([ + serialize() + ], MRDLInnerquadMaterial2.prototype, "glowMax", undefined); + __decorate2([ + serialize() + ], MRDLInnerquadMaterial2.prototype, "glowFalloff", undefined); + RegisterClass("BABYLON.GUI.MRDLInnerquadMaterial", MRDLInnerquadMaterial2); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/MRTK3/touchHolographicButton.js +class TouchHolographicButton4 extends TouchButton3D2 { + _disposeTooltip() { + this._tooltipFade = null; + if (this._tooltipTextBlock) { + this._tooltipTextBlock.dispose(); + } + if (this._tooltipTexture) { + this._tooltipTexture.dispose(); + } + if (this._tooltipMesh) { + this._tooltipMesh.dispose(); + } + this.onPointerEnterObservable.remove(this._tooltipHoverObserver); + this.onPointerOutObservable.remove(this._tooltipOutObserver); + } + set renderingGroupId(id) { + this._backPlate.renderingGroupId = id; + this._textPlate.renderingGroupId = id; + this._frontPlate.renderingGroupId = id; + this._backGlow.renderingGroupId = id; + this._innerQuad.renderingGroupId = id; + if (this._tooltipMesh) { + this._tooltipMesh.renderingGroupId = id; + } + } + get renderingGroupId() { + return this._backPlate.renderingGroupId; + } + get mesh() { + return this._backPlate; + } + set tooltipText(text) { + if (!text) { + this._disposeTooltip(); + return; + } + if (!this._tooltipFade) { + const rightHandedScene = this._backPlate._scene.useRightHandedSystem; + this._tooltipMesh = CreatePlane("", { size: 1 }, this._backPlate._scene); + this._tooltipMesh.position = Vector3.Down().scale(0.7).add(Vector3.Forward(rightHandedScene).scale(-0.15)); + this._tooltipMesh.isPickable = false; + this._tooltipMesh.parent = this._frontPlateCollisionMesh; + this._tooltipTexture = AdvancedDynamicTexture2.CreateForMesh(this._tooltipMesh); + const tooltipBackground = new Rectangle2; + tooltipBackground.height = 0.25; + tooltipBackground.width = 0.8; + tooltipBackground.cornerRadius = 25; + tooltipBackground.color = "#ffffff"; + tooltipBackground.thickness = 20; + tooltipBackground.background = "#060668"; + this._tooltipTexture.addControl(tooltipBackground); + this._tooltipTextBlock = new TextBlock2; + this._tooltipTextBlock.color = "white"; + this._tooltipTextBlock.fontSize = 100; + this._tooltipTexture.addControl(this._tooltipTextBlock); + this._tooltipFade = new FadeInOutBehavior; + this._tooltipFade.delay = 500; + this._tooltipMesh.addBehavior(this._tooltipFade); + this._tooltipHoverObserver = this.onPointerEnterObservable.add(() => { + if (this._tooltipFade) { + this._tooltipFade.fadeIn(true); + } + }); + this._tooltipOutObserver = this.onPointerOutObservable.add(() => { + if (this._tooltipFade) { + this._tooltipFade.fadeIn(false); + } + }); + } + if (this._tooltipTextBlock) { + this._tooltipTextBlock.text = text; + } + } + get tooltipText() { + var _a; + return ((_a = this._tooltipTextBlock) === null || _a === undefined ? undefined : _a.text) || null; + } + get text() { + return this._text; + } + set text(value) { + if (this._text === value) { + return; + } + this._text = value; + this._rebuildContent(); + } + get subtext() { + return this._subtext; + } + set subtext(value) { + if (this._subtext === value) { + return; + } + this._subtext = value; + this._rebuildContent(); + } + get imageUrl() { + return this._imageUrl; + } + set imageUrl(value) { + if (this._imageUrl === value) { + return; + } + this._imageUrl = value; + this._rebuildContent(); + } + get backMaterial() { + return this._backMaterial; + } + get frontMaterial() { + return this._frontMaterial; + } + get backGlowMaterial() { + return this._backGlowMaterial; + } + get innerQuadMaterial() { + return this._innerQuadMaterial; + } + get plateMaterial() { + return this._plateMaterial; + } + get shareMaterials() { + return this._shareMaterials; + } + set isBackplateVisible(isVisible) { + if (this.mesh && this._backMaterial) { + if (isVisible && !this._isBackplateVisible) { + this._backPlate.visibility = 1; + } else if (!isVisible && this._isBackplateVisible) { + this._backPlate.visibility = 0; + } + } + this._isBackplateVisible = isVisible; + } + constructor(name335, shareMaterials = true) { + super(name335); + this.width = 1; + this.height = 1; + this.radius = 0.14; + this.textSizeInPixels = 18; + this.imageSizeInPixels = 40; + this.plateMaterialColor = new Color3(0.4, 0.4, 0.4); + this.frontPlateDepth = 0.2; + this.backPlateDepth = 0.04; + this.backGlowOffset = 0.1; + this.flatPlaneDepth = 0.001; + this.innerQuadRadius = this.radius - 0.04; + this.innerQuadColor = new Color4(0, 0, 0, 0); + this.innerQuadToggledColor = new Color4(0.5197843, 0.6485234, 0.9607843, 0.6); + this.innerQuadHoverColor = new Color4(1, 1, 1, 0.05); + this.innerQuadToggledHoverColor = new Color4(0.5197843, 0.6485234, 0.9607843, 1); + this._isBackplateVisible = true; + this._shareMaterials = true; + this._shareMaterials = shareMaterials; + this.pointerEnterAnimation = () => { + if (this._frontPlate && this._textPlate && !this.isToggleButton) { + this._performEnterExitAnimation(1); + } + if (this.isToggleButton && this._innerQuadMaterial) { + if (this.isToggled) { + this._innerQuadMaterial.color = this.innerQuadToggledHoverColor; + } else { + this._innerQuadMaterial.color = this.innerQuadHoverColor; + } + } + }; + this.pointerOutAnimation = () => { + if (this._frontPlate && this._textPlate && !this.isToggleButton) { + this._performEnterExitAnimation(-0.8); + } + if (this.isToggleButton && this._innerQuadMaterial) { + this._onToggle(this.isToggled); + } + }; + this.pointerDownAnimation = () => { + }; + this.pointerUpAnimation = () => { + }; + this._pointerClickObserver = this.onPointerClickObservable.add(() => { + if (this._frontPlate && this._backGlow && !this.isActiveNearInteraction) { + this._performClickAnimation(); + } + if (this.isToggleButton && this._innerQuadMaterial) { + this._onToggle(this.isToggled); + } + }); + this._pointerEnterObserver = this.onPointerEnterObservable.add(() => { + this.pointerEnterAnimation(); + }); + this._pointerOutObserver = this.onPointerOutObservable.add(() => { + this.pointerOutAnimation(); + }); + this._toggleObserver = this.onToggleObservable.add((isToggled) => { + if (isToggled) { + this._innerQuadMaterial.color = this.innerQuadToggledColor; + } else { + this._innerQuadMaterial.color = this.innerQuadColor; + } + }); + } + _getTypeName() { + return "TouchHolographicButton"; + } + _rebuildContent() { + let content; + if (this._getAspectRatio() <= 1) { + content = this._alignContentVertically(); + } else { + content = this._alignContentHorizontally(); + } + this.content = content; + } + _getAspectRatio() { + return this.width / this.height; + } + _alignContentVertically() { + const panel = new StackPanel2; + panel.isVertical = true; + if (IsDocumentAvailable() && !!document.createElement) { + if (this._imageUrl) { + const image13 = new Image3; + image13.source = this._imageUrl; + image13.heightInPixels = 180; + image13.widthInPixels = 100; + image13.paddingTopInPixels = 40; + image13.paddingBottomInPixels = 40; + panel.addControl(image13); + } + } + if (this._text) { + const text = new TextBlock2; + text.text = this._text; + text.color = "white"; + text.heightInPixels = 30; + text.fontSize = 24; + panel.addControl(text); + } + return panel; + } + _alignContentHorizontally() { + let totalPanelWidthInPixels = 240; + const padding = 15; + const contentContainer = new Rectangle2; + contentContainer.widthInPixels = totalPanelWidthInPixels; + contentContainer.heightInPixels = totalPanelWidthInPixels; + contentContainer.color = "transparent"; + contentContainer.setPaddingInPixels(padding, padding, padding, padding); + totalPanelWidthInPixels -= padding * 2; + const panel = new StackPanel2; + panel.isVertical = false; + panel.scaleY = this._getAspectRatio(); + if (IsDocumentAvailable() && !!document.createElement) { + if (this._imageUrl) { + const imageContainer = new Rectangle2(`${this.name}_image`); + imageContainer.widthInPixels = this.imageSizeInPixels; + imageContainer.heightInPixels = this.imageSizeInPixels; + imageContainer.color = "transparent"; + totalPanelWidthInPixels -= this.imageSizeInPixels; + const image13 = new Image3; + image13.source = this._imageUrl; + imageContainer.addControl(image13); + panel.addControl(imageContainer); + } + } + if (this._text) { + const text = new TextBlock2(`${this.name}_text`); + text.text = this._text; + text.color = "white"; + text.fontSize = this.textSizeInPixels; + text.widthInPixels = totalPanelWidthInPixels; + if (this._imageUrl) { + text.textHorizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + text.paddingLeftInPixels = padding; + } + if (this._subtext) { + const textContainer = new Grid2; + textContainer.addColumnDefinition(1); + textContainer.addRowDefinition(0.5); + textContainer.addRowDefinition(0.5); + textContainer.widthInPixels = totalPanelWidthInPixels; + textContainer.heightInPixels = 45; + const subtext = new TextBlock2(`${this.name}_subtext`); + subtext.text = this._subtext; + subtext.color = "#EEEEEEAB"; + subtext.fontSize = this.textSizeInPixels * 0.75; + subtext.fontWeight = "600"; + if (this._imageUrl) { + subtext.textHorizontalAlignment = Control2.HORIZONTAL_ALIGNMENT_LEFT; + subtext.paddingLeftInPixels = padding; + } + textContainer.addControl(text, 0); + textContainer.addControl(subtext, 1); + panel.addControl(textContainer); + } else { + panel.addControl(text); + } + } + contentContainer.addControl(panel); + return contentContainer; + } + _createNode(scene50) { + var _a; + this.name = (_a = this.name) !== null && _a !== undefined ? _a : "TouchHolographicButton"; + const backPlateMesh = this._createBackPlate(scene50); + const collisionMesh = this._createFrontPlate(scene50); + const innerQuadMesh = this._createInnerQuad(scene50); + const backGlowMesh = this._createBackGlow(scene50); + this._frontPlateCollisionMesh = collisionMesh; + this._textPlate = super._createNode(scene50); + this._textPlate.name = `${this.name}_textPlate`; + this._textPlate.isPickable = false; + this._textPlate.scaling.x = this.width; + this._textPlate.parent = collisionMesh; + this._backPlate = backPlateMesh; + this._backPlate.position = Vector3.Forward(scene50.useRightHandedSystem).scale(this.backPlateDepth / 2); + this._backPlate.isPickable = false; + this._backPlate.addChild(collisionMesh); + this._backPlate.addChild(innerQuadMesh); + if (backGlowMesh) { + this._backPlate.addChild(backGlowMesh); + } + const tn = new TransformNode(`${this.name}_root`, scene50); + this._backPlate.setParent(tn); + this.collisionMesh = collisionMesh; + this.collidableFrontDirection = this._backPlate.forward.negate(); + return tn; + } + _createBackPlate(scene50) { + const backPlateMesh = CreateBox(`${this.name}_backPlate`, {}, scene50); + backPlateMesh.isPickable = false; + backPlateMesh.visibility = 0; + backPlateMesh.scaling.z = 0.2; + SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton4.MRTK_ASSET_BASE_URL, TouchHolographicButton4.BACKPLATE_MODEL_FILENAME, scene50).then((result) => { + const backPlateModel = result.meshes[1]; + backPlateModel.visibility = 0; + if (this._isBackplateVisible) { + backPlateModel.visibility = 1; + backPlateModel.name = `${this.name}_backPlate`; + backPlateModel.isPickable = false; + backPlateModel.scaling.x = this.width; + backPlateModel.scaling.y = this.height; + backPlateModel.parent = backPlateMesh; + } + if (this._backMaterial) { + backPlateModel.material = this._backMaterial; + } + this._backPlate = backPlateModel; + }); + return backPlateMesh; + } + _createFrontPlate(scene50) { + const collisionMesh = CreateBox(`${this.name}_frontPlate`, { + width: this.width, + height: this.height, + depth: this.frontPlateDepth + }, scene50); + collisionMesh.isPickable = true; + collisionMesh.isNearPickable = true; + collisionMesh.visibility = 0; + collisionMesh.position = Vector3.Forward(scene50.useRightHandedSystem).scale((this.backPlateDepth - this.frontPlateDepth) / 2); + SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton4.MRTK_ASSET_BASE_URL, TouchHolographicButton4.FRONTPLATE_MODEL_FILENAME, scene50).then((result) => { + const collisionPlate = CreateBox(`${this.name}_collisionPlate`, { + width: this.width, + height: this.height + }, scene50); + collisionPlate.isPickable = false; + collisionPlate.scaling.z = this.frontPlateDepth; + collisionPlate.visibility = 0; + collisionPlate.parent = collisionMesh; + this._collisionPlate = collisionPlate; + const frontPlateModel = result.meshes[1]; + frontPlateModel.name = `${this.name}_frontPlate`; + frontPlateModel.isPickable = false; + frontPlateModel.scaling.x = this.width - this.backGlowOffset; + frontPlateModel.scaling.y = this.height - this.backGlowOffset; + frontPlateModel.position = Vector3.Forward(scene50.useRightHandedSystem).scale(-0.5); + frontPlateModel.parent = collisionPlate; + if (this.isToggleButton) { + frontPlateModel.visibility = 0; + } + if (this._frontMaterial) { + frontPlateModel.material = this._frontMaterial; + } + this._textPlate.scaling.x = 1; + this._textPlate.parent = frontPlateModel; + this._frontPlate = frontPlateModel; + }); + return collisionMesh; + } + _createInnerQuad(scene50) { + const innerQuadMesh = CreateBox(`${this.name}_innerQuad`, {}, scene50); + innerQuadMesh.isPickable = false; + innerQuadMesh.visibility = 0; + innerQuadMesh.scaling.z = this.flatPlaneDepth; + innerQuadMesh.position.z += this.backPlateDepth / 2 - this.flatPlaneDepth; + SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton4.MRTK_ASSET_BASE_URL, TouchHolographicButton4.INNERQUAD_MODEL_FILENAME, scene50).then((result) => { + const innerQuadModel = result.meshes[1]; + innerQuadModel.name = `${this.name}_innerQuad`; + innerQuadModel.isPickable = false; + innerQuadModel.scaling.x = this.width - this.backGlowOffset; + innerQuadModel.scaling.y = this.height - this.backGlowOffset; + innerQuadModel.parent = innerQuadMesh; + if (this._innerQuadMaterial) { + innerQuadModel.material = this._innerQuadMaterial; + } + this._innerQuad = innerQuadModel; + }); + return innerQuadMesh; + } + _createBackGlow(scene50) { + if (this.isToggleButton) { + return; + } + const backGlowMesh = CreateBox(`${this.name}_backGlow`, {}, scene50); + backGlowMesh.isPickable = false; + backGlowMesh.visibility = 0; + backGlowMesh.scaling.z = this.flatPlaneDepth; + backGlowMesh.position.z += this.backPlateDepth / 2 - this.flatPlaneDepth * 2; + SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton4.MRTK_ASSET_BASE_URL, TouchHolographicButton4.BACKGLOW_MODEL_FILENAME, scene50).then((result) => { + const backGlowModel = result.meshes[1]; + backGlowModel.name = `${this.name}_backGlow`; + backGlowModel.isPickable = false; + backGlowModel.scaling.x = this.width - this.backGlowOffset; + backGlowModel.scaling.y = this.height - this.backGlowOffset; + backGlowModel.parent = backGlowMesh; + if (this._backGlowMaterial) { + backGlowModel.material = this._backGlowMaterial; + } + this._backGlow = backGlowModel; + }); + return backGlowMesh; + } + _applyFacade(facadeTexture) { + this._plateMaterial.emissiveTexture = facadeTexture; + this._plateMaterial.opacityTexture = facadeTexture; + this._plateMaterial.diffuseColor = this.plateMaterialColor; + } + _performClickAnimation() { + const frameRate = 60; + const animationGroup6 = new AnimationGroup("Click Animation Group"); + const animations = [ + { + name: "backGlowMotion", + mesh: this._backGlow, + property: "material.motion", + keys: [ + { + frame: 0, + values: [0, 0, 0] + }, + { + frame: 20, + values: [1, 0.0144, 0.0144] + }, + { + frame: 40, + values: [0.0027713229489760476, 0, 0] + }, + { + frame: 45, + values: [0.0027713229489760476] + } + ] + }, + { + name: "_collisionPlateZSlide", + mesh: this._collisionPlate, + property: "position.z", + keys: [ + { + frame: 0, + values: [0, 0, 0] + }, + { + frame: 20, + values: [Vector3.Forward(this._collisionPlate._scene.useRightHandedSystem).scale(this.frontPlateDepth / 2).z, 0, 0] + }, + { + frame: 40, + values: [0, 0.005403332496794331] + }, + { + frame: 45, + values: [0] + } + ] + }, + { + name: "_collisionPlateZScale", + mesh: this._collisionPlate, + property: "scaling.z", + keys: [ + { + frame: 0, + values: [this.frontPlateDepth, 0, 0] + }, + { + frame: 20, + values: [this.backPlateDepth, 0, 0] + }, + { + frame: 40, + values: [this.frontPlateDepth, 0.0054] + }, + { + frame: 45, + values: [this.frontPlateDepth] + } + ] + } + ]; + for (const animation18 of animations) { + const anim = new Animation(animation18.name, animation18.property, frameRate, Animation.ANIMATIONTYPE_FLOAT, Animation.ANIMATIONLOOPMODE_CYCLE); + const animkeyFrames = []; + for (const key of animation18.keys) { + animkeyFrames.push({ + frame: key.frame, + value: key.values[0], + inTangent: key.values[1], + outTangent: key.values[2], + interpolation: key.values[3] + }); + } + anim.setKeys(animkeyFrames); + if (!animation18.mesh) { + continue; + } + animationGroup6.addTargetedAnimation(anim, animation18.mesh); + } + animationGroup6.normalize(0, 45); + animationGroup6.speedRatio = 1; + animationGroup6.play(); + } + _performEnterExitAnimation(speedRatio) { + const frameRate = 60; + const animationGroup6 = new AnimationGroup("Enter Exit Animation Group"); + const animations = [ + { + name: "frontPlateFadeOut", + mesh: this._frontPlate, + property: "material.fadeOut", + keys: [ + { + frame: 0, + values: [0, 0, 0.025045314830017686, 0] + }, + { + frame: 40, + values: [1.00205599570012, 0.025045314830017686, 0, 0] + } + ] + }, + { + name: "textPlateZSlide", + mesh: this._textPlate, + property: "position.z", + keys: [ + { + frame: 0, + values: [0, 0, 0] + }, + { + frame: 40, + values: [Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-0.15).z, 0, 0] + } + ] + } + ]; + for (const animation18 of animations) { + const anim = new Animation(animation18.name, animation18.property, frameRate, Animation.ANIMATIONTYPE_FLOAT, Animation.ANIMATIONLOOPMODE_CYCLE); + const animkeyFrames = []; + for (const key of animation18.keys) { + animkeyFrames.push({ + frame: key.frame, + value: key.values[0], + inTangent: key.values[1], + outTangent: key.values[2], + interpolation: key.values[3] + }); + } + anim.setKeys(animkeyFrames); + if (!animation18.mesh) { + continue; + } + animationGroup6.addTargetedAnimation(anim, animation18.mesh); + } + animationGroup6.normalize(0, 45); + animationGroup6.speedRatio = speedRatio; + animationGroup6.play(); + } + _createBackMaterial(mesh84) { + var _a; + this._backMaterial = (_a = this._backMaterial) !== null && _a !== undefined ? _a : new MRDLBackplateMaterial2(this.name + "backPlateMaterial", mesh84.getScene()); + this._backMaterial.absoluteSizes = true; + this._backMaterial.radius = this.radius; + this._backMaterial.lineWidth = 0.02; + } + _createFrontMaterial(mesh84) { + var _a; + this._frontMaterial = (_a = this._frontMaterial) !== null && _a !== undefined ? _a : new MRDLFrontplateMaterial2(this.name + "Front Material", mesh84.getScene()); + this.frontMaterial.radius = this.innerQuadRadius; + this.frontMaterial.fadeOut = 0; + } + _createBackGlowMaterial(mesh84) { + var _a; + const glowRadius = this.radius + 0.04; + this._backGlowMaterial = (_a = this._backGlowMaterial) !== null && _a !== undefined ? _a : new MRDLBackglowMaterial2(this.name + "Back Glow Material", mesh84.getScene()); + this._backGlowMaterial.bevelRadius = glowRadius; + this._backGlowMaterial.lineWidth = glowRadius; + this._backGlowMaterial.motion = 0; + } + _createInnerQuadMaterial(mesh84) { + var _a; + this._innerQuadMaterial = (_a = this._innerQuadMaterial) !== null && _a !== undefined ? _a : new MRDLInnerquadMaterial2("inner_quad", mesh84.getScene()); + this._innerQuadMaterial.radius = this.innerQuadRadius; + if (this.isToggleButton) { + this._innerQuadMaterial.color = this.innerQuadColor; + } + } + _createPlateMaterial(mesh84) { + var _a; + this._plateMaterial = (_a = this._plateMaterial) !== null && _a !== undefined ? _a : new StandardMaterial(this.name + "Plate Material", mesh84.getScene()); + this._plateMaterial.specularColor = Color3.Black(); + } + _onToggle(newState) { + super._onToggle(newState); + } + _affectMaterial(mesh84) { + if (this._shareMaterials) { + if (!this._host._touchSharedMaterials["mrdlBackplateMaterial"]) { + this._createBackMaterial(mesh84); + this._host._touchSharedMaterials["mrdlBackplateMaterial"] = this._backMaterial; + } else { + this._backMaterial = this._host._touchSharedMaterials["mrdlBackplateMaterial"]; + } + if (!this._host._touchSharedMaterials["mrdlFrontplateMaterial"]) { + this._createFrontMaterial(mesh84); + this._host._touchSharedMaterials["mrdlFrontplateMaterial"] = this._frontMaterial; + } else { + this._frontMaterial = this._host._touchSharedMaterials["mrdlFrontplateMaterial"]; + } + if (!this._host._touchSharedMaterials["mrdlBackglowMaterial"]) { + this._createBackGlowMaterial(mesh84); + this._host._touchSharedMaterials["mrdlBackglowMaterial"] = this._backGlowMaterial; + } else { + this._backGlowMaterial = this._host._touchSharedMaterials["mrdlBackglowMaterial"]; + } + if (!this._host._touchSharedMaterials["mrdlInnerQuadMaterial"]) { + this._createInnerQuadMaterial(mesh84); + this._host._touchSharedMaterials["mrdlInnerQuadMaterial"] = this._innerQuadMaterial; + } else { + this._innerQuadMaterial = this._host._touchSharedMaterials["mrdlInnerQuadMaterial"]; + } + } else { + this._createBackMaterial(mesh84); + this._createFrontMaterial(mesh84); + this._createBackGlowMaterial(mesh84); + this._createInnerQuadMaterial(mesh84); + } + this._createPlateMaterial(mesh84); + this._backPlate.material = this._backMaterial; + this._textPlate.material = this._plateMaterial; + if (!this._isBackplateVisible) { + this._backPlate.visibility = 0; + } + if (this._frontPlate) { + this._frontPlate.material = this._frontMaterial; + } + if (this._backGlow) { + this._backGlow.material = this._backGlowMaterial; + } + if (this._innerQuad) { + this._innerQuad.material = this._innerQuadMaterial; + } + this._rebuildContent(); + } + dispose() { + super.dispose(); + this._disposeTooltip(); + this.onPointerClickObservable.remove(this._pointerClickObserver); + this.onPointerEnterObservable.remove(this._pointerEnterObserver); + this.onPointerOutObservable.remove(this._pointerOutObserver); + this.onToggleObservable.remove(this._toggleObserver); + if (!this.shareMaterials) { + this._backMaterial.dispose(); + this._frontMaterial.dispose(); + this._plateMaterial.dispose(); + this._backGlowMaterial.dispose(); + this._innerQuadMaterial.dispose(); + if (this._pickedPointObserver) { + this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver); + this._pickedPointObserver = null; + } + } + } +} +var init_touchHolographicButton2 = __esm(() => { + init_advancedDynamicTexture(); + init_animation(); + init_animationGroup(); + init_math_color(); + init_control(); + init_planeBuilder(); + init_boxBuilder(); + init_domManagement(); + init_fadeInOutBehavior(); + init_grid2(); + init_image(); + init_mrdlBackglowMaterial(); + init_mrdlBackplateMaterial(); + init_mrdlFrontplateMaterial(); + init_mrdlInnerquadMaterial(); + init_rectangle(); + init_sceneLoader(); + init_stackPanel(); + init_standardMaterial(); + init_textBlock(); + init_touchButton3D(); + init_transformNode(); + init_math_vector(); + TouchHolographicButton4.MRTK_ASSET_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/"; + TouchHolographicButton4.FRONTPLATE_MODEL_FILENAME = "mrtk-fluent-frontplate.glb"; + TouchHolographicButton4.BACKPLATE_MODEL_FILENAME = "mrtk-fluent-backplate.glb"; + TouchHolographicButton4.BACKGLOW_MODEL_FILENAME = "mrtk-fluent-button.glb"; + TouchHolographicButton4.INNERQUAD_MODEL_FILENAME = "SlateProximity.glb"; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/controls/index.js +var init_controls2 = __esm(() => { + init_abstractButton3D(); + init_button3D(); + init_container3D(); + init_control3D(); + init_cylinderPanel(); + init_handMenu(); + init_holographicBackplate(); + init_holographicButton(); + init_holographicSlate(); + init_meshButton3D(); + init_nearMenu(); + init_planePanel(); + init_scatterPanel(); + init_slider3D(); + init_spherePanel(); + init_stackPanel3D(); + init_touchButton3D(); + init_touchMeshButton3D(); + init_touchHolographicButton(); + init_touchHolographicMenu(); + init_volumeBasedPanel(); + init_touchHolographicButton2(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/fluent/index.js +var init_fluent = __esm(() => { + init_fluentMaterial(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/fluentButton/index.js +var init_fluentButton = __esm(() => { + init_fluentButtonMaterial(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/fluentBackplate/index.js +var init_fluentBackplate = __esm(() => { + init_fluentBackplateMaterial(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/handle/index.js +var init_handle = __esm(() => { + init_handleMaterial(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/mrdl/index.js +var init_mrdl = __esm(() => { + init_mrdlSliderBarMaterial(); + init_mrdlSliderThumbMaterial(); + init_mrdlBackplateMaterial(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/materials/index.js +var init_materials2 = __esm(() => { + init_fluent(); + init_fluentButton(); + init_fluentBackplate(); + init_handle(); + init_mrdl(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/gizmos/index.js +var init_gizmos = __esm(() => { + init_slateGizmo(); + init_gizmoHandle(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/gui3DManager.js +class GUI3DManager2 { + get scene() { + return this._scene; + } + get utilityLayer() { + return this._utilityLayer; + } + get controlScaling() { + return this._customControlScaling; + } + set controlScaling(newScale) { + if (this._customControlScaling !== newScale && newScale > 0) { + const scaleRatio = newScale / this._customControlScaling; + this._customControlScaling = newScale; + this._rootContainer.children.forEach((control49) => { + control49.scaling.scaleInPlace(scaleRatio); + if (newScale !== 1) { + control49._isScaledByManager = true; + } + }); + } + } + get useRealisticScaling() { + return this.controlScaling === GUI3DManager2.MRTK_REALISTIC_SCALING; + } + set useRealisticScaling(newValue) { + this.controlScaling = newValue ? GUI3DManager2.MRTK_REALISTIC_SCALING : 1; + } + constructor(scene50) { + this._customControlScaling = 1; + this._lastControlOver = {}; + this._lastControlDown = {}; + this.onPickedPointChangedObservable = new Observable; + this.onPickingObservable = new Observable; + this._sharedMaterials = {}; + this._touchSharedMaterials = {}; + this._scene = scene50 || EngineStore.LastCreatedScene; + this._sceneDisposeObserver = this._scene.onDisposeObservable.add(() => { + this._sceneDisposeObserver = null; + this._utilityLayer = null; + this.dispose(); + }); + this._utilityLayer = UtilityLayerRenderer._CreateDefaultUtilityLayerFromScene(this._scene); + this._utilityLayer.onlyCheckPointerDownEvents = false; + this._utilityLayer.pickUtilitySceneFirst = false; + this._utilityLayer.mainSceneTrackerPredicate = (mesh84) => { + var _a, _b, _c; + return mesh84 && ((_c = (_b = (_a = mesh84.reservedDataStore) === null || _a === undefined ? undefined : _a.GUI3D) === null || _b === undefined ? undefined : _b.control) === null || _c === undefined ? undefined : _c._node); + }; + this._rootContainer = new Container3D2("RootContainer"); + this._rootContainer._host = this; + const utilityLayerScene = this._utilityLayer.utilityLayerScene; + this._pointerOutObserver = this._utilityLayer.onPointerOutObservable.add((pointerId) => { + this._handlePointerOut(pointerId, true); + }); + this._pointerObserver = utilityLayerScene.onPointerObservable.add((pi) => { + this._doPicking(pi); + }); + this._utilityLayer.utilityLayerScene.autoClear = false; + this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil = false; + new HemisphericLight("hemi", Vector3.Up(), this._utilityLayer.utilityLayerScene); + } + _handlePointerOut(pointerId, isPointerUp) { + const previousControlOver = this._lastControlOver[pointerId]; + if (previousControlOver) { + previousControlOver._onPointerOut(previousControlOver); + delete this._lastControlOver[pointerId]; + } + if (isPointerUp) { + if (this._lastControlDown[pointerId]) { + this._lastControlDown[pointerId].forcePointerUp(); + delete this._lastControlDown[pointerId]; + } + } + this.onPickedPointChangedObservable.notifyObservers(null); + } + _doPicking(pi) { + var _a, _b, _c; + if (!this._utilityLayer || !this._utilityLayer.shouldRender || !this._utilityLayer.utilityLayerScene.activeCamera) { + return false; + } + const pointerEvent = pi.event; + const pointerId = pointerEvent.pointerId || 0; + const buttonIndex = pointerEvent.button; + const pickingInfo12 = pi.pickInfo; + if (pickingInfo12) { + this.onPickingObservable.notifyObservers(pickingInfo12.pickedMesh); + } + if (!pickingInfo12 || !pickingInfo12.hit) { + this._handlePointerOut(pointerId, pi.type === PointerEventTypes.POINTERUP); + return false; + } + if (pickingInfo12.pickedPoint) { + this.onPickedPointChangedObservable.notifyObservers(pickingInfo12.pickedPoint); + } + const control49 = (_b = (_a = pickingInfo12.pickedMesh.reservedDataStore) === null || _a === undefined ? undefined : _a.GUI3D) === null || _b === undefined ? undefined : _b.control; + if (!!control49 && !control49._processObservables(pi.type, pickingInfo12.pickedPoint, ((_c = pickingInfo12.originMesh) === null || _c === undefined ? undefined : _c.position) || null, pointerId, buttonIndex)) { + if (pi.type === PointerEventTypes.POINTERMOVE) { + if (this._lastControlOver[pointerId]) { + this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId]); + } + delete this._lastControlOver[pointerId]; + } + } + if (pi.type === PointerEventTypes.POINTERUP) { + if (this._lastControlDown[pointerEvent.pointerId]) { + this._lastControlDown[pointerEvent.pointerId].forcePointerUp(); + delete this._lastControlDown[pointerEvent.pointerId]; + } + if (pointerEvent.pointerType === "touch" || pointerEvent.pointerType === "xr" && this._scene.getEngine().hostInformation.isMobile) { + this._handlePointerOut(pointerId, false); + } + } + return true; + } + get rootContainer() { + return this._rootContainer; + } + containsControl(control49) { + return this._rootContainer.containsControl(control49); + } + addControl(control49) { + this._rootContainer.addControl(control49); + if (this._customControlScaling !== 1) { + control49.scaling.scaleInPlace(this._customControlScaling); + control49._isScaledByManager = true; + } + return this; + } + removeControl(control49) { + this._rootContainer.removeControl(control49); + if (control49._isScaledByManager) { + control49.scaling.scaleInPlace(1 / this._customControlScaling); + control49._isScaledByManager = false; + } + return this; + } + dispose() { + this._rootContainer.dispose(); + for (const materialName in this._sharedMaterials) { + if (!Object.prototype.hasOwnProperty.call(this._sharedMaterials, materialName)) { + continue; + } + this._sharedMaterials[materialName].dispose(); + } + this._sharedMaterials = {}; + for (const materialName in this._touchSharedMaterials) { + if (!Object.prototype.hasOwnProperty.call(this._touchSharedMaterials, materialName)) { + continue; + } + this._touchSharedMaterials[materialName].dispose(); + } + this._touchSharedMaterials = {}; + if (this._pointerOutObserver && this._utilityLayer) { + this._utilityLayer.onPointerOutObservable.remove(this._pointerOutObserver); + this._pointerOutObserver = null; + } + this.onPickedPointChangedObservable.clear(); + this.onPickingObservable.clear(); + const utilityLayerScene = this._utilityLayer ? this._utilityLayer.utilityLayerScene : null; + if (utilityLayerScene) { + if (this._pointerObserver) { + utilityLayerScene.onPointerObservable.remove(this._pointerObserver); + this._pointerObserver = null; + } + } + if (this._scene) { + if (this._sceneDisposeObserver) { + this._scene.onDisposeObservable.remove(this._sceneDisposeObserver); + this._sceneDisposeObserver = null; + } + } + if (this._utilityLayer) { + this._utilityLayer.dispose(); + } + } +} +var init_gui3DManager = __esm(() => { + init_observable(); + init_math_vector(); + init_pointerEvents(); + init_hemisphericLight(); + init_utilityLayerRenderer(); + init_engineStore(); + init_container3D(); + GUI3DManager2.MRTK_REALISTIC_SCALING = 0.032; +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/3D/index.js +var init_3D = __esm(() => { + init_controls2(); + init_materials2(); + init_gizmos(); + init_gui3DManager(); + init_vector3WithInfo(); +}); + +// node_modules/@babylonjs/inspector/node_modules/@babylonjs/gui/index.js +var exports_gui = {}; +__export(exports_gui, { + name: () => { + { + return name314; + } + }, + XmlLoader: () => { + { + return XmlLoader; + } + }, + VolumeBasedPanel: () => { + { + return VolumeBasedPanel2; + } + }, + VirtualKeyboard: () => { + { + return VirtualKeyboard2; + } + }, + Vector3WithInfo: () => { + { + return Vector3WithInfo2; + } + }, + Vector2WithInfo: () => { + { + return Vector2WithInfo2; + } + }, + ValueAndUnit: () => { + { + return ValueAndUnit2; + } + }, + TouchMeshButton3D: () => { + { + return TouchMeshButton3D; + } + }, + TouchHolographicMenu: () => { + { + return TouchHolographicMenu2; + } + }, + TouchHolographicButtonV3: () => { + { + return TouchHolographicButton4; + } + }, + TouchHolographicButton: () => { + { + return TouchHolographicButton3; + } + }, + TouchButton3D: () => { + { + return TouchButton3D2; + } + }, + ToggleButton: () => { + { + return ToggleButton2; + } + }, + TextWrapping: () => { + { + return TextWrapping2; + } + }, + TextWrapper: () => { + { + return TextWrapper2; + } + }, + TextBlock: () => { + { + return TextBlock2; + } + }, + Style: () => { + { + return Style2; + } + }, + StackPanel3D: () => { + { + return StackPanel3D; + } + }, + StackPanel: () => { + { + return StackPanel2; + } + }, + SpherePanel: () => { + { + return SpherePanel; + } + }, + SliderGroup: () => { + { + return SliderGroup; + } + }, + Slider3D: () => { + { + return Slider3D2; + } + }, + Slider: () => { + { + return Slider2; + } + }, + SlateGizmo: () => { + { + return SlateGizmo2; + } + }, + SideHandle: () => { + { + return SideHandle2; + } + }, + SelectorGroup: () => { + { + return SelectorGroup; + } + }, + SelectionPanel: () => { + { + return SelectionPanel; + } + }, + ScrollViewer: () => { + { + return ScrollViewer2; + } + }, + ScrollBar: () => { + { + return ScrollBar2; + } + }, + ScatterPanel: () => { + { + return ScatterPanel; + } + }, + Rectangle: () => { + { + return Rectangle2; + } + }, + RadioGroup: () => { + { + return RadioGroup; + } + }, + RadioButton: () => { + { + return RadioButton2; + } + }, + RadialGradient: () => { + { + return RadialGradient3; + } + }, + PlanePanel: () => { + { + return PlanePanel; + } + }, + NearMenu: () => { + { + return NearMenu2; + } + }, + MultiLinePoint: () => { + { + return MultiLinePoint2; + } + }, + MultiLine: () => { + { + return MultiLine2; + } + }, + MeshButton3D: () => { + { + return MeshButton3D; + } + }, + Measure: () => { + { + return Measure2; + } + }, + Matrix2D: () => { + { + return Matrix2D2; + } + }, + MathTools: () => { + { + return MathTools2; + } + }, + MRDLSliderThumbMaterial: () => { + { + return MRDLSliderThumbMaterial2; + } + }, + MRDLSliderBarMaterial: () => { + { + return MRDLSliderBarMaterial2; + } + }, + MRDLBackplateMaterial: () => { + { + return MRDLBackplateMaterial2; + } + }, + LinearGradient: () => { + { + return LinearGradient3; + } + }, + Line: () => { + { + return Line2; + } + }, + KeyPropertySet: () => { + { + return KeyPropertySet; + } + }, + InputTextArea: () => { + { + return InputTextArea2; + } + }, + InputText: () => { + { + return InputText2; + } + }, + InputPassword: () => { + { + return InputPassword2; + } + }, + ImageScrollBar: () => { + { + return ImageScrollBar2; + } + }, + ImageBasedSlider: () => { + { + return ImageBasedSlider2; + } + }, + Image: () => { + { + return Image3; + } + }, + HolographicSlate: () => { + { + return HolographicSlate2; + } + }, + HolographicButton: () => { + { + return HolographicButton; + } + }, + HolographicBackplate: () => { + { + return HolographicBackplate2; + } + }, + HandleState: () => { + { + return HandleState2; + } + }, + HandleMaterial: () => { + { + return HandleMaterial2; + } + }, + HandMenu: () => { + { + return HandMenu; + } + }, + Grid: () => { + { + return Grid2; + } + }, + GizmoHandle: () => { + { + return GizmoHandle2; + } + }, + GUI3DManager: () => { + { + return GUI3DManager2; + } + }, + FocusableButton: () => { + { + return FocusableButton2; + } + }, + FluentMaterialDefines: () => { + { + return FluentMaterialDefines2; + } + }, + FluentMaterial: () => { + { + return FluentMaterial2; + } + }, + FluentButtonMaterial: () => { + { + return FluentButtonMaterial2; + } + }, + FluentBackplateMaterial: () => { + { + return FluentBackplateMaterial2; + } + }, + Ellipse: () => { + { + return Ellipse2; + } + }, + DisplayGrid: () => { + { + return DisplayGrid2; + } + }, + CylinderPanel: () => { + { + return CylinderPanel; + } + }, + CornerHandle: () => { + { + return CornerHandle2; + } + }, + Control3D: () => { + { + return Control3D2; + } + }, + Control: () => { + { + return Control2; + } + }, + Container3D: () => { + { + return Container3D2; + } + }, + Container: () => { + { + return Container2; + } + }, + ColorPicker: () => { + { + return ColorPicker2; + } + }, + CheckboxGroup: () => { + { + return CheckboxGroup; + } + }, + Checkbox: () => { + { + return Checkbox2; + } + }, + Button3D: () => { + { + return Button3D2; + } + }, + Button: () => { + { + return Button2; + } + }, + BaseSlider: () => { + { + return BaseSlider2; + } + }, + BaseGradient: () => { + { + return BaseGradient5; + } + }, + AdvancedDynamicTextureInstrumentation: () => { + { + return AdvancedDynamicTextureInstrumentation; + } + }, + AdvancedDynamicTexture: () => { + { + return AdvancedDynamicTexture2; + } + }, + AbstractButton3D: () => { + { + return AbstractButton3D2; + } + } +}); +var init_gui = __esm(() => { + init_2D(); + init_3D(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/valueAndUnit.js +class ValueAndUnit3 { + constructor(value, unit = ValueAndUnit3.UNITMODE_PIXEL, negativeValueAllowed = true) { + this.negativeValueAllowed = negativeValueAllowed; + this._value = 1; + this._unit = ValueAndUnit3.UNITMODE_PIXEL; + this.ignoreAdaptiveScaling = false; + this.onChangedObservable = new Observable; + this._value = value; + this._unit = unit; + this._originalUnit = unit; + } + get isPercentage() { + return this._unit === ValueAndUnit3.UNITMODE_PERCENTAGE; + } + get isPixel() { + return this._unit === ValueAndUnit3.UNITMODE_PIXEL; + } + get internalValue() { + return this._value; + } + get value() { + return this._value; + } + set value(value) { + if (value !== this._value) { + this._value = value; + this.onChangedObservable.notifyObservers(); + } + } + get unit() { + return this._unit; + } + set unit(value) { + if (value !== this._unit) { + this._unit = value; + this.onChangedObservable.notifyObservers(); + } + } + getValueInPixel(host, refValue) { + if (this.isPixel) { + return this.getValue(host); + } + return this.getValue(host) * refValue; + } + updateInPlace(value, unit = ValueAndUnit3.UNITMODE_PIXEL) { + if (this.value !== value || this.unit !== unit) { + this._value = value; + this._unit = unit; + this.onChangedObservable.notifyObservers(); + } + return this; + } + getValue(host) { + if (host && !this.ignoreAdaptiveScaling && this.unit !== ValueAndUnit3.UNITMODE_PERCENTAGE) { + let width = 0; + let height = 0; + if (host.idealWidth) { + width = Math.ceil(this._value * host.getSize().width / host.idealWidth); + } + if (host.idealHeight) { + height = Math.ceil(this._value * host.getSize().height / host.idealHeight); + } + if (host.useSmallestIdeal && host.idealWidth && host.idealHeight) { + return window.innerWidth < window.innerHeight ? width : height; + } + if (host.idealWidth) { + return width; + } + if (host.idealHeight) { + return height; + } + } + return this._value; + } + toString(host, decimals) { + switch (this._unit) { + case ValueAndUnit3.UNITMODE_PERCENTAGE: { + const percentage = this.getValue(host) * 100; + return (decimals ? percentage.toFixed(decimals) : percentage) + "%"; + } + case ValueAndUnit3.UNITMODE_PIXEL: { + const pixels = this.getValue(host); + return (decimals ? pixels.toFixed(decimals) : pixels) + "px"; + } + } + return this._unit.toString(); + } + fromString(source) { + const match = ValueAndUnit3._Regex.exec(source.toString()); + if (!match || match.length === 0) { + return false; + } + let sourceValue = parseFloat(match[1]); + let sourceUnit = this._originalUnit; + if (!this.negativeValueAllowed) { + if (sourceValue < 0) { + sourceValue = 0; + } + } + if (match.length === 4) { + switch (match[3]) { + case "px": + sourceUnit = ValueAndUnit3.UNITMODE_PIXEL; + break; + case "%": + sourceUnit = ValueAndUnit3.UNITMODE_PERCENTAGE; + sourceValue /= 100; + break; + } + } + if (sourceValue === this._value && sourceUnit === this._unit) { + return false; + } + this._value = sourceValue; + this._unit = sourceUnit; + this.onChangedObservable.notifyObservers(); + return true; + } + static get UNITMODE_PERCENTAGE() { + return ValueAndUnit3._UNITMODE_PERCENTAGE; + } + static get UNITMODE_PIXEL() { + return ValueAndUnit3._UNITMODE_PIXEL; + } +} +var init_valueAndUnit2 = __esm(() => { + init_observable(); + ValueAndUnit3._Regex = /(^-?\d*(\.\d+)?)(%|px)?/; + ValueAndUnit3._UNITMODE_PERCENTAGE = 0; + ValueAndUnit3._UNITMODE_PIXEL = 1; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/measure.js +class Measure3 { + constructor(left, top, width, height) { + this.left = left; + this.top = top; + this.width = width; + this.height = height; + } + copyFrom(other) { + this.left = other.left; + this.top = other.top; + this.width = other.width; + this.height = other.height; + } + copyFromFloats(left, top, width, height) { + this.left = left; + this.top = top; + this.width = width; + this.height = height; + } + static CombineToRef(a, b, result) { + const left = Math.min(a.left, b.left); + const top = Math.min(a.top, b.top); + const right = Math.max(a.left + a.width, b.left + b.width); + const bottom = Math.max(a.top + a.height, b.top + b.height); + result.left = left; + result.top = top; + result.width = right - left; + result.height = bottom - top; + } + addAndTransformToRef(transform, addX, addY, addWidth, addHeight, result) { + const left = this.left + addX; + const top = this.top + addY; + const width = this.width + addWidth; + const height = this.height + addHeight; + tmpRect5[0].copyFromFloats(left, top); + tmpRect5[1].copyFromFloats(left + width, top); + tmpRect5[2].copyFromFloats(left + width, top + height); + tmpRect5[3].copyFromFloats(left, top + height); + tmpV13.copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE); + tmpV23.copyFromFloats(0, 0); + for (let i = 0;i < 4; i++) { + transform.transformCoordinates(tmpRect5[i].x, tmpRect5[i].y, tmpRect23[i]); + tmpV13.x = Math.floor(Math.min(tmpV13.x, tmpRect23[i].x)); + tmpV13.y = Math.floor(Math.min(tmpV13.y, tmpRect23[i].y)); + tmpV23.x = Math.ceil(Math.max(tmpV23.x, tmpRect23[i].x)); + tmpV23.y = Math.ceil(Math.max(tmpV23.y, tmpRect23[i].y)); + } + result.left = tmpV13.x; + result.top = tmpV13.y; + result.width = tmpV23.x - tmpV13.x; + result.height = tmpV23.y - tmpV13.y; + } + transformToRef(transform, result) { + this.addAndTransformToRef(transform, 0, 0, 0, 0, result); + } + isEqualsTo(other) { + if (this.left !== other.left) { + return false; + } + if (this.top !== other.top) { + return false; + } + if (this.width !== other.width) { + return false; + } + if (this.height !== other.height) { + return false; + } + return true; + } + static Empty() { + return new Measure3(0, 0, 0, 0); + } +} +var tmpRect5, tmpRect23, tmpV13, tmpV23; +var init_measure2 = __esm(() => { + init_math_vector(); + tmpRect5 = [new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0)]; + tmpRect23 = [new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0)]; + tmpV13 = new Vector2(0, 0); + tmpV23 = new Vector2(0, 0); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/math2D.js +class Vector2WithInfo3 extends Vector2 { + constructor(source, buttonIndex = 0) { + super(source.x, source.y); + this.buttonIndex = buttonIndex; + } +} + +class Matrix2D3 { + constructor(m00, m01, m10, m11, m20, m21) { + this.m = new Float32Array(6); + this.fromValues(m00, m01, m10, m11, m20, m21); + } + fromValues(m00, m01, m10, m11, m20, m21) { + this.m[0] = m00; + this.m[1] = m01; + this.m[2] = m10; + this.m[3] = m11; + this.m[4] = m20; + this.m[5] = m21; + return this; + } + determinant() { + return this.m[0] * this.m[3] - this.m[1] * this.m[2]; + } + invertToRef(result) { + const l0 = this.m[0]; + const l1 = this.m[1]; + const l2 = this.m[2]; + const l3 = this.m[3]; + const l4 = this.m[4]; + const l5 = this.m[5]; + const det = this.determinant(); + if (det < Epsilon * Epsilon) { + result.m[0] = 0; + result.m[1] = 0; + result.m[2] = 0; + result.m[3] = 0; + result.m[4] = 0; + result.m[5] = 0; + return this; + } + const detDiv = 1 / det; + const det4 = l2 * l5 - l3 * l4; + const det5 = l1 * l4 - l0 * l5; + result.m[0] = l3 * detDiv; + result.m[1] = -l1 * detDiv; + result.m[2] = -l2 * detDiv; + result.m[3] = l0 * detDiv; + result.m[4] = det4 * detDiv; + result.m[5] = det5 * detDiv; + return this; + } + multiplyToRef(other, result) { + const l0 = this.m[0]; + const l1 = this.m[1]; + const l2 = this.m[2]; + const l3 = this.m[3]; + const l4 = this.m[4]; + const l5 = this.m[5]; + const r0 = other.m[0]; + const r1 = other.m[1]; + const r2 = other.m[2]; + const r3 = other.m[3]; + const r4 = other.m[4]; + const r5 = other.m[5]; + result.m[0] = l0 * r0 + l1 * r2; + result.m[1] = l0 * r1 + l1 * r3; + result.m[2] = l2 * r0 + l3 * r2; + result.m[3] = l2 * r1 + l3 * r3; + result.m[4] = l4 * r0 + l5 * r2 + r4; + result.m[5] = l4 * r1 + l5 * r3 + r5; + return this; + } + transformCoordinates(x, y, result) { + result.x = x * this.m[0] + y * this.m[2] + this.m[4]; + result.y = x * this.m[1] + y * this.m[3] + this.m[5]; + return this; + } + static Identity() { + return new Matrix2D3(1, 0, 0, 1, 0, 0); + } + static IdentityToRef(result) { + result.m[0] = 1; + result.m[1] = 0; + result.m[2] = 0; + result.m[3] = 1; + result.m[4] = 0; + result.m[5] = 0; + } + static TranslationToRef(x, y, result) { + result.fromValues(1, 0, 0, 1, x, y); + } + static ScalingToRef(x, y, result) { + result.fromValues(x, 0, 0, y, 0, 0); + } + static RotationToRef(angle, result) { + const s = Math.sin(angle); + const c = Math.cos(angle); + result.fromValues(c, s, -s, c, 0, 0); + } + static ComposeToRef(tx, ty, angle, scaleX, scaleY, parentMatrix, result) { + Matrix2D3.TranslationToRef(tx, ty, Matrix2D3._TempPreTranslationMatrix); + Matrix2D3.ScalingToRef(scaleX, scaleY, Matrix2D3._TempScalingMatrix); + Matrix2D3.RotationToRef(angle, Matrix2D3._TempRotationMatrix); + Matrix2D3.TranslationToRef(-tx, -ty, Matrix2D3._TempPostTranslationMatrix); + Matrix2D3._TempPreTranslationMatrix.multiplyToRef(Matrix2D3._TempScalingMatrix, Matrix2D3._TempCompose0); + Matrix2D3._TempCompose0.multiplyToRef(Matrix2D3._TempRotationMatrix, Matrix2D3._TempCompose1); + if (parentMatrix) { + Matrix2D3._TempCompose1.multiplyToRef(Matrix2D3._TempPostTranslationMatrix, Matrix2D3._TempCompose2); + Matrix2D3._TempCompose2.multiplyToRef(parentMatrix, result); + } else { + Matrix2D3._TempCompose1.multiplyToRef(Matrix2D3._TempPostTranslationMatrix, result); + } + } +} + +class MathTools3 { + static Round(value, precision = MathTools3.DefaultRoundingPrecision) { + return Math.round(value * precision) / precision; + } +} +var init_math2D2 = __esm(() => { + init_math_vector(); + init_math_constants(); + Matrix2D3._TempPreTranslationMatrix = Matrix2D3.Identity(); + Matrix2D3._TempPostTranslationMatrix = Matrix2D3.Identity(); + Matrix2D3._TempRotationMatrix = Matrix2D3.Identity(); + Matrix2D3._TempScalingMatrix = Matrix2D3.Identity(); + Matrix2D3._TempCompose0 = Matrix2D3.Identity(); + Matrix2D3._TempCompose1 = Matrix2D3.Identity(); + Matrix2D3._TempCompose2 = Matrix2D3.Identity(); + MathTools3.DefaultRoundingPrecision = 100; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/control.js +class Control3 { + get isReadOnly() { + return this._isReadOnly; + } + set isReadOnly(value) { + this._isReadOnly = value; + } + get transformedMeasure() { + return this._evaluatedMeasure; + } + set clipChildren(value) { + this._clipChildren = value; + } + get clipChildren() { + return this._clipChildren; + } + set clipContent(value) { + this._clipContent = value; + } + get clipContent() { + return this._clipContent; + } + get shadowOffsetX() { + return this._shadowOffsetX; + } + set shadowOffsetX(value) { + if (this._shadowOffsetX === value) { + return; + } + this._shadowOffsetX = value; + this._markAsDirty(); + } + get shadowOffsetY() { + return this._shadowOffsetY; + } + set shadowOffsetY(value) { + if (this._shadowOffsetY === value) { + return; + } + this._shadowOffsetY = value; + this._markAsDirty(); + } + get shadowBlur() { + return this._shadowBlur; + } + set shadowBlur(value) { + if (this._shadowBlur === value) { + return; + } + this._previousShadowBlur = this._shadowBlur; + this._shadowBlur = value; + this._markAsDirty(); + } + get shadowColor() { + return this._shadowColor; + } + set shadowColor(value) { + if (this._shadowColor === value) { + return; + } + this._shadowColor = value; + this._markAsDirty(); + } + get typeName() { + return this._getTypeName(); + } + getClassName() { + return this._getTypeName(); + } + set accessibilityTag(value) { + this._accessibilityTag = value; + this.onAccessibilityTagChangedObservable.notifyObservers(value); + } + get accessibilityTag() { + return this._accessibilityTag; + } + get host() { + return this._host; + } + get fontOffset() { + return this._fontOffset; + } + set fontOffset(offset) { + this._fontOffset = offset; + } + get alpha() { + return this._alpha; + } + set alpha(value) { + if (this._alpha === value) { + return; + } + this._alphaSet = true; + this._alpha = value; + this._markAsDirty(); + } + get highlightLineWidth() { + return this._highlightLineWidth; + } + set highlightLineWidth(value) { + if (this._highlightLineWidth === value) { + return; + } + this._highlightLineWidth = value; + this._markAsDirty(); + } + get isHighlighted() { + return this._isHighlighted; + } + set isHighlighted(value) { + if (this._isHighlighted === value) { + return; + } + this._isHighlighted = value; + this._markAsDirty(); + } + get highlightColor() { + return this._highlightColor; + } + set highlightColor(value) { + if (this._highlightColor === value) { + return; + } + this._highlightColor = value; + this._markAsDirty(); + } + get scaleX() { + return this._scaleX; + } + set scaleX(value) { + if (this._scaleX === value) { + return; + } + this._scaleX = value; + this._markAsDirty(); + this._markMatrixAsDirty(); + } + get scaleY() { + return this._scaleY; + } + set scaleY(value) { + if (this._scaleY === value) { + return; + } + this._scaleY = value; + this._markAsDirty(); + this._markMatrixAsDirty(); + } + get rotation() { + return this._rotation; + } + set rotation(value) { + if (this._rotation === value) { + return; + } + this._rotation = value; + this._markAsDirty(); + this._markMatrixAsDirty(); + } + get transformCenterY() { + return this._transformCenterY; + } + set transformCenterY(value) { + if (this._transformCenterY === value) { + return; + } + this._transformCenterY = value; + this._markAsDirty(); + this._markMatrixAsDirty(); + } + get transformCenterX() { + return this._transformCenterX; + } + set transformCenterX(value) { + if (this._transformCenterX === value) { + return; + } + this._transformCenterX = value; + this._markAsDirty(); + this._markMatrixAsDirty(); + } + get horizontalAlignment() { + return this._horizontalAlignment; + } + set horizontalAlignment(value) { + if (this._horizontalAlignment === value) { + return; + } + this._horizontalAlignment = value; + this._markAsDirty(); + } + get verticalAlignment() { + return this._verticalAlignment; + } + set verticalAlignment(value) { + if (this._verticalAlignment === value) { + return; + } + this._verticalAlignment = value; + this._markAsDirty(); + } + set fixedRatio(value) { + if (this._fixedRatio === value) { + return; + } + this._fixedRatio = value; + this._markAsDirty(); + } + get fixedRatio() { + return this._fixedRatio; + } + set fixedRatioMasterIsWidth(value) { + if (this._fixedRatioMasterIsWidth === value) { + return; + } + this._fixedRatioMasterIsWidth = value; + this._markAsDirty(); + } + get fixedRatioMasterIsWidth() { + return this._fixedRatioMasterIsWidth; + } + get width() { + return this._width.toString(this._host); + } + set width(value) { + this._fixedRatioMasterIsWidth = true; + if (this._width.toString(this._host) === value) { + return; + } + if (this._width.fromString(value)) { + this._markAsDirty(); + } + } + get widthInPixels() { + return this._width.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set widthInPixels(value) { + if (isNaN(value)) { + return; + } + this._fixedRatioMasterIsWidth = true; + this.width = value + "px"; + } + get height() { + return this._height.toString(this._host); + } + set height(value) { + this._fixedRatioMasterIsWidth = false; + if (this._height.toString(this._host) === value) { + return; + } + if (this._height.fromString(value)) { + this._markAsDirty(); + } + } + get heightInPixels() { + return this._height.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + set heightInPixels(value) { + if (isNaN(value)) { + return; + } + this._fixedRatioMasterIsWidth = false; + this.height = value + "px"; + } + get fontFamily() { + return this._fontFamily; + } + set fontFamily(value) { + if (this._fontFamily === value) { + return; + } + this._fontFamily = value; + this._resetFontCache(); + } + get fontStyle() { + return this._fontStyle; + } + set fontStyle(value) { + if (this._fontStyle === value) { + return; + } + this._fontStyle = value; + this._resetFontCache(); + } + get fontWeight() { + return this._fontWeight; + } + set fontWeight(value) { + if (this._fontWeight === value) { + return; + } + this._fontWeight = value; + this._resetFontCache(); + } + get style() { + return this._style; + } + set style(value) { + if (this._style) { + this._style.onChangedObservable.remove(this._styleObserver); + this._styleObserver = null; + } + this._style = value; + if (this._style) { + this._styleObserver = this._style.onChangedObservable.add(() => { + this._markAsDirty(); + this._resetFontCache(); + }); + } + this._markAsDirty(); + this._resetFontCache(); + } + get _isFontSizeInPercentage() { + return this._fontSize.isPercentage; + } + get fontSizeInPixels() { + const fontSizeToUse = this._style ? this._style._fontSize : this._fontSize; + if (fontSizeToUse.isPixel) { + return fontSizeToUse.getValue(this._host); + } + return fontSizeToUse.getValueInPixel(this._host, this._tempParentMeasure.height || this._cachedParentMeasure.height); + } + set fontSizeInPixels(value) { + if (isNaN(value)) { + return; + } + this.fontSize = value + "px"; + } + get fontSize() { + return this._fontSize.toString(this._host); + } + set fontSize(value) { + if (this._fontSize.toString(this._host) === value) { + return; + } + if (this._fontSize.fromString(value)) { + this._markAsDirty(); + this._resetFontCache(); + } + } + get color() { + return this._color; + } + set color(value) { + if (this._color === value) { + return; + } + this._color = value; + this._markAsDirty(); + } + get gradient() { + return this._gradient; + } + set gradient(value) { + if (this._gradient === value) { + return; + } + this._gradient = value; + this._markAsDirty(); + } + get zIndex() { + return this._zIndex; + } + set zIndex(value) { + if (this.zIndex === value) { + return; + } + this._zIndex = value; + if (this.parent) { + this.parent._reOrderControl(this); + } + } + get notRenderable() { + return this._doNotRender; + } + set notRenderable(value) { + if (this._doNotRender === value) { + return; + } + this._doNotRender = value; + this._markAsDirty(); + } + get isVisible() { + return this._isVisible; + } + set isVisible(value) { + if (this._isVisible === value) { + return; + } + this._isVisible = value; + this._markAsDirty(true); + this.onIsVisibleChangedObservable.notifyObservers(value); + } + get isDirty() { + return this._isDirty; + } + get linkedMesh() { + return this._linkedMesh; + } + get descendantsOnlyPadding() { + return this._descendantsOnlyPadding; + } + set descendantsOnlyPadding(value) { + if (this._descendantsOnlyPadding === value) { + return; + } + this._descendantsOnlyPadding = value; + this._markAsDirty(); + } + get paddingLeft() { + return this._paddingLeft.toString(this._host); + } + set paddingLeft(value) { + if (this._paddingLeft.fromString(value)) { + this._markAsDirty(); + } + } + get paddingLeftInPixels() { + return this._paddingLeft.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set paddingLeftInPixels(value) { + if (isNaN(value)) { + return; + } + this.paddingLeft = value + "px"; + } + get _paddingLeftInPixels() { + if (this._descendantsOnlyPadding) { + return 0; + } + return this.paddingLeftInPixels; + } + get paddingRight() { + return this._paddingRight.toString(this._host); + } + set paddingRight(value) { + if (this._paddingRight.fromString(value)) { + this._markAsDirty(); + } + } + get paddingRightInPixels() { + return this._paddingRight.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set paddingRightInPixels(value) { + if (isNaN(value)) { + return; + } + this.paddingRight = value + "px"; + } + get _paddingRightInPixels() { + if (this._descendantsOnlyPadding) { + return 0; + } + return this.paddingRightInPixels; + } + get paddingTop() { + return this._paddingTop.toString(this._host); + } + set paddingTop(value) { + if (this._paddingTop.fromString(value)) { + this._markAsDirty(); + } + } + get paddingTopInPixels() { + return this._paddingTop.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + set paddingTopInPixels(value) { + if (isNaN(value)) { + return; + } + this.paddingTop = value + "px"; + } + get _paddingTopInPixels() { + if (this._descendantsOnlyPadding) { + return 0; + } + return this.paddingTopInPixels; + } + get paddingBottom() { + return this._paddingBottom.toString(this._host); + } + set paddingBottom(value) { + if (this._paddingBottom.fromString(value)) { + this._markAsDirty(); + } + } + get paddingBottomInPixels() { + return this._paddingBottom.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + set paddingBottomInPixels(value) { + if (isNaN(value)) { + return; + } + this.paddingBottom = value + "px"; + } + get _paddingBottomInPixels() { + if (this._descendantsOnlyPadding) { + return 0; + } + return this.paddingBottomInPixels; + } + get left() { + return this._left.toString(this._host); + } + set left(value) { + if (this._left.fromString(value)) { + this._markAsDirty(); + } + } + get leftInPixels() { + return this._left.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set leftInPixels(value) { + if (isNaN(value)) { + return; + } + this.left = value + "px"; + } + get top() { + return this._top.toString(this._host); + } + set top(value) { + if (this._top.fromString(value)) { + this._markAsDirty(); + } + } + get topInPixels() { + return this._top.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + set topInPixels(value) { + if (isNaN(value)) { + return; + } + this.top = value + "px"; + } + get linkOffsetX() { + return this._linkOffsetX.toString(this._host); + } + set linkOffsetX(value) { + if (this._linkOffsetX.fromString(value)) { + this._markAsDirty(); + } + } + get linkOffsetXInPixels() { + return this._linkOffsetX.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set linkOffsetXInPixels(value) { + if (isNaN(value)) { + return; + } + this.linkOffsetX = value + "px"; + } + get linkOffsetY() { + return this._linkOffsetY.toString(this._host); + } + set linkOffsetY(value) { + if (this._linkOffsetY.fromString(value)) { + this._markAsDirty(); + } + } + get linkOffsetYInPixels() { + return this._linkOffsetY.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + set linkOffsetYInPixels(value) { + if (isNaN(value)) { + return; + } + this.linkOffsetY = value + "px"; + } + get centerX() { + return this._currentMeasure.left + this._currentMeasure.width / 2; + } + get centerY() { + return this._currentMeasure.top + this._currentMeasure.height / 2; + } + get isEnabled() { + return this._isEnabled; + } + set isEnabled(value) { + if (this._isEnabled === value) { + return; + } + this._isEnabled = value; + this._markAsDirty(); + const recursivelyFirePointerOut = (control49) => { + if (!control49.host) { + return; + } + for (const pointer in control49.host._lastControlOver) { + if (control49 === this.host._lastControlOver[pointer]) { + control49._onPointerOut(control49, null, true); + delete control49.host._lastControlOver[pointer]; + } + } + if (control49.children !== undefined) { + control49.children.forEach(recursivelyFirePointerOut); + } + }; + recursivelyFirePointerOut(this); + this.onEnabledStateChangedObservable.notifyObservers(value); + } + get disabledColor() { + return this._disabledColor; + } + set disabledColor(value) { + if (this._disabledColor === value) { + return; + } + this._disabledColor = value; + this._markAsDirty(); + } + get disabledColorItem() { + return this._disabledColorItem; + } + set disabledColorItem(value) { + if (this._disabledColorItem === value) { + return; + } + this._disabledColorItem = value; + this._markAsDirty(); + } + constructor(name335) { + this.name = name335; + this._alpha = 1; + this._alphaSet = false; + this._zIndex = 0; + this._currentMeasure = Measure3.Empty(); + this._tempPaddingMeasure = Measure3.Empty(); + this._fontFamily = ""; + this._fontStyle = ""; + this._fontWeight = ""; + this._fontSize = new ValueAndUnit3(18, ValueAndUnit3.UNITMODE_PIXEL, false); + this._width = new ValueAndUnit3(1, ValueAndUnit3.UNITMODE_PERCENTAGE, false); + this._height = new ValueAndUnit3(1, ValueAndUnit3.UNITMODE_PERCENTAGE, false); + this._color = ""; + this._style = null; + this._horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_CENTER; + this._verticalAlignment = Control3.VERTICAL_ALIGNMENT_CENTER; + this._isDirty = true; + this._wasDirty = false; + this._tempParentMeasure = Measure3.Empty(); + this._prevCurrentMeasureTransformedIntoGlobalSpace = Measure3.Empty(); + this._cachedParentMeasure = Measure3.Empty(); + this._descendantsOnlyPadding = false; + this._paddingLeft = new ValueAndUnit3(0); + this._paddingRight = new ValueAndUnit3(0); + this._paddingTop = new ValueAndUnit3(0); + this._paddingBottom = new ValueAndUnit3(0); + this._left = new ValueAndUnit3(0); + this._top = new ValueAndUnit3(0); + this._scaleX = 1; + this._scaleY = 1; + this._rotation = 0; + this._transformCenterX = 0.5; + this._transformCenterY = 0.5; + this._transformMatrix = Matrix2D3.Identity(); + this._invertTransformMatrix = Matrix2D3.Identity(); + this._transformedPosition = Vector2.Zero(); + this._isMatrixDirty = true; + this._isVisible = true; + this._isHighlighted = false; + this._highlightColor = "#4affff"; + this._highlightLineWidth = 2; + this._fontSet = false; + this._dummyVector2 = Vector2.Zero(); + this._downCount = 0; + this._enterCount = -1; + this._doNotRender = false; + this._downPointerIds = {}; + this._evaluatedMeasure = new Measure3(0, 0, 0, 0); + this._evaluatedParentMeasure = new Measure3(0, 0, 0, 0); + this._isEnabled = true; + this._disabledColor = "#9a9a9a"; + this._disabledColorItem = "#6a6a6a"; + this._isReadOnly = false; + this._gradient = null; + this._rebuildLayout = false; + this.onEnabledStateChangedObservable = new Observable; + this._customData = {}; + this._isClipped = false; + this._automaticSize = false; + this.metadata = null; + this.isHitTestVisible = true; + this.isPointerBlocker = false; + this.isFocusInvisible = false; + this._clipChildren = true; + this._clipContent = true; + this.useBitmapCache = false; + this._shadowOffsetX = 0; + this._shadowOffsetY = 0; + this._shadowBlur = 0; + this._previousShadowBlur = 0; + this._shadowColor = "black"; + this.hoverCursor = ""; + this._linkOffsetX = new ValueAndUnit3(0); + this._linkOffsetY = new ValueAndUnit3(0); + this._accessibilityTag = null; + this.onAccessibilityTagChangedObservable = new Observable; + this.onWheelObservable = new Observable; + this.onPointerMoveObservable = new Observable; + this.onPointerOutObservable = new Observable; + this.onPointerDownObservable = new Observable; + this.onPointerUpObservable = new Observable; + this.onPointerClickObservable = new Observable; + this.onPointerEnterObservable = new Observable; + this.onDirtyObservable = new Observable; + this.onBeforeDrawObservable = new Observable; + this.onAfterDrawObservable = new Observable; + this.onDisposeObservable = new Observable; + this.onIsVisibleChangedObservable = new Observable; + this._fixedRatio = 0; + this._fixedRatioMasterIsWidth = true; + this.animations = null; + this._tmpMeasureA = new Measure3(0, 0, 0, 0); + } + _getTypeName() { + return "Control"; + } + getAscendantOfClass(className2) { + if (!this.parent) { + return null; + } + if (this.parent.getClassName() === className2) { + return this.parent; + } + return this.parent.getAscendantOfClass(className2); + } + markAsDirty(force = false) { + this._markAsDirty(force); + } + markAllAsDirty() { + this._markAllAsDirty(); + } + _resetFontCache() { + this._fontSet = true; + this._markAsDirty(); + } + isAscendant(container17) { + if (!this.parent) { + return false; + } + if (this.parent === container17) { + return true; + } + return this.parent.isAscendant(container17); + } + getLocalCoordinates(globalCoordinates) { + const result = Vector2.Zero(); + this.getLocalCoordinatesToRef(globalCoordinates, result); + return result; + } + getLocalCoordinatesToRef(globalCoordinates, result) { + result.x = globalCoordinates.x - this._currentMeasure.left; + result.y = globalCoordinates.y - this._currentMeasure.top; + return this; + } + getParentLocalCoordinates(globalCoordinates) { + const result = Vector2.Zero(); + result.x = globalCoordinates.x - this._cachedParentMeasure.left; + result.y = globalCoordinates.y - this._cachedParentMeasure.top; + return result; + } + moveToVector3(position3, scene50) { + if (!this._host || this.parent !== this._host._rootContainer) { + Tools.Error("Cannot move a control to a vector3 if the control is not at root level"); + return; + } + this.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + this.verticalAlignment = Control3.VERTICAL_ALIGNMENT_TOP; + const globalViewport = this._host._getGlobalViewport(); + const projectedPosition = Vector3.Project(position3, Matrix.IdentityReadOnly, scene50.getTransformMatrix(), globalViewport); + this._moveToProjectedPosition(projectedPosition); + if (projectedPosition.z < 0 || projectedPosition.z > 1) { + this.notRenderable = true; + return; + } + this.notRenderable = false; + } + getDescendantsToRef(results, directDescendantsOnly = false, predicate) { + } + getDescendants(directDescendantsOnly, predicate) { + const results = []; + this.getDescendantsToRef(results, directDescendantsOnly, predicate); + return results; + } + linkWithMesh(mesh84) { + if (!this._host || this.parent && this.parent !== this._host._rootContainer) { + if (mesh84) { + Tools.Error("Cannot link a control to a mesh if the control is not at root level"); + } + return; + } + const index = this._host._linkedControls.indexOf(this); + if (index !== -1) { + this._linkedMesh = mesh84; + if (!mesh84) { + this._host._linkedControls.splice(index, 1); + } + return; + } else if (!mesh84) { + return; + } + this.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + this.verticalAlignment = Control3.VERTICAL_ALIGNMENT_TOP; + this._linkedMesh = mesh84; + this._host._linkedControls.push(this); + } + setPadding(paddingTop, paddingRight, paddingBottom, paddingLeft) { + const top = paddingTop; + const right = paddingRight !== null && paddingRight !== undefined ? paddingRight : top; + const bottom = paddingBottom !== null && paddingBottom !== undefined ? paddingBottom : top; + const left = paddingLeft !== null && paddingLeft !== undefined ? paddingLeft : right; + this.paddingTop = top; + this.paddingRight = right; + this.paddingBottom = bottom; + this.paddingLeft = left; + } + setPaddingInPixels(paddingTop, paddingRight, paddingBottom, paddingLeft) { + const top = paddingTop; + const right = paddingRight !== null && paddingRight !== undefined ? paddingRight : top; + const bottom = paddingBottom !== null && paddingBottom !== undefined ? paddingBottom : top; + const left = paddingLeft !== null && paddingLeft !== undefined ? paddingLeft : right; + this.paddingTopInPixels = top; + this.paddingRightInPixels = right; + this.paddingBottomInPixels = bottom; + this.paddingLeftInPixels = left; + } + _moveToProjectedPosition(projectedPosition) { + var _a; + const oldLeft = this._left.getValue(this._host); + const oldTop = this._top.getValue(this._host); + const parentMeasure = (_a = this.parent) === null || _a === undefined ? undefined : _a._currentMeasure; + if (parentMeasure) { + this._processMeasures(parentMeasure, this._host.getContext()); + } + let newLeft = projectedPosition.x + this._linkOffsetX.getValue(this._host) - this._currentMeasure.width / 2; + let newTop = projectedPosition.y + this._linkOffsetY.getValue(this._host) - this._currentMeasure.height / 2; + const leftAndTopIgnoreAdaptiveScaling = this._left.ignoreAdaptiveScaling && this._top.ignoreAdaptiveScaling; + if (leftAndTopIgnoreAdaptiveScaling) { + if (Math.abs(newLeft - oldLeft) < 0.5) { + newLeft = oldLeft; + } + if (Math.abs(newTop - oldTop) < 0.5) { + newTop = oldTop; + } + } + if (!leftAndTopIgnoreAdaptiveScaling && oldLeft === newLeft && oldTop === newTop) { + return; + } + this.left = newLeft + "px"; + this.top = newTop + "px"; + this._left.ignoreAdaptiveScaling = true; + this._top.ignoreAdaptiveScaling = true; + this._markAsDirty(); + } + _offsetLeft(offset) { + this._isDirty = true; + this._currentMeasure.left += offset; + } + _offsetTop(offset) { + this._isDirty = true; + this._currentMeasure.top += offset; + } + _markMatrixAsDirty() { + this._isMatrixDirty = true; + this._flagDescendantsAsMatrixDirty(); + } + _flagDescendantsAsMatrixDirty() { + } + _intersectsRect(rect, context) { + this._transform(context); + if (this._evaluatedMeasure.left >= rect.left + rect.width) { + return false; + } + if (this._evaluatedMeasure.top >= rect.top + rect.height) { + return false; + } + if (this._evaluatedMeasure.left + this._evaluatedMeasure.width <= rect.left) { + return false; + } + if (this._evaluatedMeasure.top + this._evaluatedMeasure.height <= rect.top) { + return false; + } + return true; + } + _computeAdditionalOffsetX() { + return 0; + } + _computeAdditionalOffsetY() { + return 0; + } + invalidateRect() { + this._transform(); + if (this.host && this.host.useInvalidateRectOptimization) { + this._currentMeasure.transformToRef(this._transformMatrix, this._tmpMeasureA); + Measure3.CombineToRef(this._tmpMeasureA, this._prevCurrentMeasureTransformedIntoGlobalSpace, this._tmpMeasureA); + const shadowOffsetX = this.shadowOffsetX; + const shadowOffsetY = this.shadowOffsetY; + const shadowBlur = Math.max(this._previousShadowBlur, this.shadowBlur); + const leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0); + const rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0); + const topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0); + const bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0); + const offsetX = this._computeAdditionalOffsetX(); + const offsetY = this._computeAdditionalOffsetY(); + this.host.invalidateRect(Math.floor(this._tmpMeasureA.left + leftShadowOffset - offsetX), Math.floor(this._tmpMeasureA.top + topShadowOffset - offsetY), Math.ceil(this._tmpMeasureA.left + this._tmpMeasureA.width + rightShadowOffset + offsetX), Math.ceil(this._tmpMeasureA.top + this._tmpMeasureA.height + bottomShadowOffset + offsetY)); + } + } + _markAsDirty(force = false) { + if (!this._isVisible && !force) { + return; + } + this._isDirty = true; + this._markMatrixAsDirty(); + if (this._host) { + this._host.markAsDirty(); + } + } + _markAllAsDirty() { + this._markAsDirty(); + if (this._font) { + this._prepareFont(); + } + } + _link(host) { + this._host = host; + if (this._host) { + this.uniqueId = this._host.getScene().getUniqueId(); + } + } + _transform(context) { + if (!this._isMatrixDirty && this._scaleX === 1 && this._scaleY === 1 && this._rotation === 0) { + return; + } + const offsetX = this._currentMeasure.width * this._transformCenterX + this._currentMeasure.left; + const offsetY = this._currentMeasure.height * this._transformCenterY + this._currentMeasure.top; + if (context) { + context.translate(offsetX, offsetY); + context.rotate(this._rotation); + context.scale(this._scaleX, this._scaleY); + context.translate(-offsetX, -offsetY); + } + if (this._isMatrixDirty || this._cachedOffsetX !== offsetX || this._cachedOffsetY !== offsetY) { + this._cachedOffsetX = offsetX; + this._cachedOffsetY = offsetY; + this._isMatrixDirty = false; + this._flagDescendantsAsMatrixDirty(); + Matrix2D3.ComposeToRef(-offsetX, -offsetY, this._rotation, this._scaleX, this._scaleY, this.parent ? this.parent._transformMatrix : null, this._transformMatrix); + this._transformMatrix.invertToRef(this._invertTransformMatrix); + this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure); + } + } + _renderHighlight(context) { + if (!this.isHighlighted) { + return; + } + context.save(); + context.strokeStyle = this._highlightColor; + context.lineWidth = this._highlightLineWidth; + this._renderHighlightSpecific(context); + context.restore(); + } + _renderHighlightSpecific(context) { + context.strokeRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + _getColor(context) { + return this.gradient ? this.gradient.getCanvasGradient(context) : this.color; + } + _applyStates(context) { + if (this._isFontSizeInPercentage) { + this._fontSet = true; + } + if (this._host && this._host.useSmallestIdeal && !this._font) { + this._fontSet = true; + } + if (this._fontSet) { + this._prepareFont(); + this._fontSet = false; + } + if (this._font) { + context.font = this._font; + } + if (this._color || this.gradient) { + context.fillStyle = this._getColor(context); + } + if (Control3.AllowAlphaInheritance) { + context.globalAlpha *= this._alpha; + } else if (this._alphaSet) { + context.globalAlpha = this.parent && !this.parent.renderToIntermediateTexture ? this.parent.alpha * this._alpha : this._alpha; + } + } + _layout(parentMeasure, context) { + if (!this.isDirty && (!this.isVisible || this.notRenderable)) { + return false; + } + if (this._isDirty || !this._cachedParentMeasure.isEqualsTo(parentMeasure)) { + this.host._numLayoutCalls++; + this._currentMeasure.addAndTransformToRef(this._transformMatrix, -this._paddingLeftInPixels | 0, -this._paddingTopInPixels | 0, this._paddingRightInPixels | 0, this._paddingBottomInPixels | 0, this._prevCurrentMeasureTransformedIntoGlobalSpace); + context.save(); + this._applyStates(context); + let rebuildCount = 0; + do { + this._rebuildLayout = false; + this._processMeasures(parentMeasure, context); + rebuildCount++; + } while (this._rebuildLayout && rebuildCount < 3); + if (rebuildCount >= 3) { + Logger.Error(`Layout cycle detected in GUI (Control name=${this.name}, uniqueId=${this.uniqueId})`); + } + context.restore(); + this.invalidateRect(); + this._evaluateClippingState(parentMeasure); + } + this._wasDirty = this._isDirty; + this._isDirty = false; + return true; + } + _processMeasures(parentMeasure, context) { + this._tempPaddingMeasure.copyFrom(parentMeasure); + if (this.parent && this.parent.descendantsOnlyPadding) { + this._tempPaddingMeasure.left += this.parent.paddingLeftInPixels; + this._tempPaddingMeasure.top += this.parent.paddingTopInPixels; + this._tempPaddingMeasure.width -= this.parent.paddingLeftInPixels + this.parent.paddingRightInPixels; + this._tempPaddingMeasure.height -= this.parent.paddingTopInPixels + this.parent.paddingBottomInPixels; + } + this._currentMeasure.copyFrom(this._tempPaddingMeasure); + this._preMeasure(this._tempPaddingMeasure, context); + this._measure(); + this._postMeasure(this._tempPaddingMeasure, context); + this._computeAlignment(this._tempPaddingMeasure, context); + this._currentMeasure.left = this._currentMeasure.left | 0; + this._currentMeasure.top = this._currentMeasure.top | 0; + this._currentMeasure.width = this._currentMeasure.width | 0; + this._currentMeasure.height = this._currentMeasure.height | 0; + this._additionalProcessing(this._tempPaddingMeasure, context); + this._cachedParentMeasure.copyFrom(this._tempPaddingMeasure); + this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure); + if (this.onDirtyObservable.hasObservers()) { + this.onDirtyObservable.notifyObservers(this); + } + } + _evaluateClippingState(parentMeasure) { + this._transform(); + this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure); + if (this.parent && this.parent.clipChildren) { + parentMeasure.transformToRef(this.parent._transformMatrix, this._evaluatedParentMeasure); + if (this._evaluatedMeasure.left > this._evaluatedParentMeasure.left + this._evaluatedParentMeasure.width) { + this._isClipped = true; + return; + } + if (this._evaluatedMeasure.left + this._evaluatedMeasure.width < this._evaluatedParentMeasure.left) { + this._isClipped = true; + return; + } + if (this._evaluatedMeasure.top > this._evaluatedParentMeasure.top + this._evaluatedParentMeasure.height) { + this._isClipped = true; + return; + } + if (this._evaluatedMeasure.top + this._evaluatedMeasure.height < this._evaluatedParentMeasure.top) { + this._isClipped = true; + return; + } + } + this._isClipped = false; + } + _measure() { + if (this._width.isPixel) { + this._currentMeasure.width = this._width.getValue(this._host); + } else { + this._currentMeasure.width *= this._width.getValue(this._host); + } + if (this._height.isPixel) { + this._currentMeasure.height = this._height.getValue(this._host); + } else { + this._currentMeasure.height *= this._height.getValue(this._host); + } + if (this._fixedRatio !== 0) { + if (this._fixedRatioMasterIsWidth) { + this._currentMeasure.height = this._currentMeasure.width * this._fixedRatio; + } else { + this._currentMeasure.width = this._currentMeasure.height * this._fixedRatio; + } + } + } + _computeAlignment(parentMeasure, context) { + const width = this._currentMeasure.width; + const height = this._currentMeasure.height; + const parentWidth = parentMeasure.width; + const parentHeight = parentMeasure.height; + let x = 0; + let y = 0; + switch (this.horizontalAlignment) { + case Control3.HORIZONTAL_ALIGNMENT_LEFT: + x = 0; + break; + case Control3.HORIZONTAL_ALIGNMENT_RIGHT: + x = parentWidth - width; + break; + case Control3.HORIZONTAL_ALIGNMENT_CENTER: + x = (parentWidth - width) / 2; + break; + } + switch (this.verticalAlignment) { + case Control3.VERTICAL_ALIGNMENT_TOP: + y = 0; + break; + case Control3.VERTICAL_ALIGNMENT_BOTTOM: + y = parentHeight - height; + break; + case Control3.VERTICAL_ALIGNMENT_CENTER: + y = (parentHeight - height) / 2; + break; + } + if (!this.descendantsOnlyPadding) { + if (this._paddingLeft.isPixel) { + this._currentMeasure.left += this._paddingLeft.getValue(this._host); + this._currentMeasure.width -= this._paddingLeft.getValue(this._host); + } else { + this._currentMeasure.left += parentWidth * this._paddingLeft.getValue(this._host); + this._currentMeasure.width -= parentWidth * this._paddingLeft.getValue(this._host); + } + if (this._paddingRight.isPixel) { + this._currentMeasure.width -= this._paddingRight.getValue(this._host); + } else { + this._currentMeasure.width -= parentWidth * this._paddingRight.getValue(this._host); + } + if (this._paddingTop.isPixel) { + this._currentMeasure.top += this._paddingTop.getValue(this._host); + this._currentMeasure.height -= this._paddingTop.getValue(this._host); + } else { + this._currentMeasure.top += parentHeight * this._paddingTop.getValue(this._host); + this._currentMeasure.height -= parentHeight * this._paddingTop.getValue(this._host); + } + if (this._paddingBottom.isPixel) { + this._currentMeasure.height -= this._paddingBottom.getValue(this._host); + } else { + this._currentMeasure.height -= parentHeight * this._paddingBottom.getValue(this._host); + } + } + if (this._left.isPixel) { + this._currentMeasure.left += this._left.getValue(this._host); + } else { + this._currentMeasure.left += parentWidth * this._left.getValue(this._host); + } + if (this._top.isPixel) { + this._currentMeasure.top += this._top.getValue(this._host); + } else { + this._currentMeasure.top += parentHeight * this._top.getValue(this._host); + } + this._currentMeasure.left += x; + this._currentMeasure.top += y; + } + _preMeasure(parentMeasure, context) { + } + _postMeasure(parentMeasure, context) { + } + _additionalProcessing(parentMeasure, context) { + } + _clipForChildren(context) { + } + _clip(context, invalidatedRectangle) { + context.beginPath(); + Control3._ClipMeasure.copyFrom(this._currentMeasure); + if (invalidatedRectangle) { + invalidatedRectangle.transformToRef(this._invertTransformMatrix, this._tmpMeasureA); + const intersection = new Measure3(0, 0, 0, 0); + intersection.left = Math.max(this._tmpMeasureA.left, this._currentMeasure.left); + intersection.top = Math.max(this._tmpMeasureA.top, this._currentMeasure.top); + intersection.width = Math.min(this._tmpMeasureA.left + this._tmpMeasureA.width, this._currentMeasure.left + this._currentMeasure.width) - intersection.left; + intersection.height = Math.min(this._tmpMeasureA.top + this._tmpMeasureA.height, this._currentMeasure.top + this._currentMeasure.height) - intersection.top; + Control3._ClipMeasure.copyFrom(intersection); + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + const shadowOffsetX = this.shadowOffsetX; + const shadowOffsetY = this.shadowOffsetY; + const shadowBlur = this.shadowBlur; + const leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0); + const rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0); + const topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0); + const bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0); + context.rect(Control3._ClipMeasure.left + leftShadowOffset, Control3._ClipMeasure.top + topShadowOffset, Control3._ClipMeasure.width + rightShadowOffset - leftShadowOffset, Control3._ClipMeasure.height + bottomShadowOffset - topShadowOffset); + } else { + context.rect(Control3._ClipMeasure.left, Control3._ClipMeasure.top, Control3._ClipMeasure.width, Control3._ClipMeasure.height); + } + context.clip(); + } + _render(context, invalidatedRectangle) { + if (!this.isVisible || this.notRenderable || this._isClipped) { + this._isDirty = false; + return false; + } + this.host._numRenderCalls++; + context.save(); + this._applyStates(context); + this._transform(context); + if (this.clipContent) { + this._clip(context, invalidatedRectangle); + } + if (this.onBeforeDrawObservable.hasObservers()) { + this.onBeforeDrawObservable.notifyObservers(this); + } + if (this.useBitmapCache && !this._wasDirty && this._cacheData) { + context.putImageData(this._cacheData, this._currentMeasure.left, this._currentMeasure.top); + } else { + this._draw(context, invalidatedRectangle); + } + if (this.useBitmapCache && this._wasDirty) { + this._cacheData = context.getImageData(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + this._renderHighlight(context); + if (this.onAfterDrawObservable.hasObservers()) { + this.onAfterDrawObservable.notifyObservers(this); + } + context.restore(); + return true; + } + _draw(context, invalidatedRectangle) { + } + contains(x, y) { + this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition); + x = this._transformedPosition.x; + y = this._transformedPosition.y; + if (x < this._currentMeasure.left) { + return false; + } + if (x > this._currentMeasure.left + this._currentMeasure.width) { + return false; + } + if (y < this._currentMeasure.top) { + return false; + } + if (y > this._currentMeasure.top + this._currentMeasure.height) { + return false; + } + if (this.isPointerBlocker) { + this._host._shouldBlockPointer = true; + } + return true; + } + _processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) { + if (!this._isEnabled) { + return false; + } + if (!this.isHitTestVisible || !this.isVisible || this._doNotRender) { + return false; + } + if (!this.contains(x, y)) { + return false; + } + this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY); + return true; + } + _onPointerMove(target, coordinates, pointerId, pi) { + const canNotify = this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this, pi); + if (canNotify && this.parent != null && !this.isPointerBlocker) { + this.parent._onPointerMove(target, coordinates, pointerId, pi); + } + } + _onPointerEnter(target, pi) { + if (!this._isEnabled) { + return false; + } + if (this._enterCount > 0) { + return false; + } + if (this._enterCount === -1) { + this._enterCount = 0; + } + this._enterCount++; + const canNotify = this.onPointerEnterObservable.notifyObservers(this, -1, target, this, pi); + if (canNotify && this.parent != null && !this.isPointerBlocker) { + this.parent._onPointerEnter(target, pi); + } + return true; + } + _onPointerOut(target, pi, force = false) { + if (!force && (!this._isEnabled || target === this)) { + return; + } + this._enterCount = 0; + let canNotify = true; + if (!target.isAscendant(this)) { + canNotify = this.onPointerOutObservable.notifyObservers(this, -1, target, this, pi); + } + if (canNotify && this.parent != null && !this.isPointerBlocker) { + this.parent._onPointerOut(target, pi, force); + } + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + this._onPointerEnter(this, pi); + if (this._downCount !== 0) { + return false; + } + this._downCount++; + this._downPointerIds[pointerId] = true; + const canNotify = this.onPointerDownObservable.notifyObservers(new Vector2WithInfo3(coordinates, buttonIndex), -1, target, this, pi); + if (canNotify && this.parent != null && !this.isPointerBlocker) { + this.parent._onPointerDown(target, coordinates, pointerId, buttonIndex, pi); + } + if (pi && this.uniqueId !== this._host.rootContainer.uniqueId) { + this._host._capturedPointerIds.add(pi.event.pointerId); + } + return true; + } + _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi) { + if (!this._isEnabled) { + return; + } + this._downCount = 0; + delete this._downPointerIds[pointerId]; + let canNotifyClick = notifyClick; + if (notifyClick && (this._enterCount > 0 || this._enterCount === -1)) { + canNotifyClick = this.onPointerClickObservable.notifyObservers(new Vector2WithInfo3(coordinates, buttonIndex), -1, target, this, pi); + } + const canNotify = this.onPointerUpObservable.notifyObservers(new Vector2WithInfo3(coordinates, buttonIndex), -1, target, this, pi); + if (canNotify && this.parent != null && !this.isPointerBlocker) { + this.parent._onPointerUp(target, coordinates, pointerId, buttonIndex, canNotifyClick, pi); + } + if (pi && this.uniqueId !== this._host.rootContainer.uniqueId) { + this._host._capturedPointerIds.delete(pi.event.pointerId); + } + } + _forcePointerUp(pointerId = null) { + if (pointerId !== null) { + this._onPointerUp(this, Vector2.Zero(), pointerId, 0, true); + } else { + for (const key in this._downPointerIds) { + this._onPointerUp(this, Vector2.Zero(), +key, 0, true); + } + } + } + _onWheelScroll(deltaX, deltaY) { + if (!this._isEnabled) { + return; + } + const canNotify = this.onWheelObservable.notifyObservers(new Vector2(deltaX, deltaY)); + if (canNotify && this.parent != null) { + this.parent._onWheelScroll(deltaX, deltaY); + } + } + _onCanvasBlur() { + } + _processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY) { + if (!this._isEnabled) { + return false; + } + this._dummyVector2.copyFromFloats(x, y); + if (type === PointerEventTypes.POINTERMOVE) { + this._onPointerMove(this, this._dummyVector2, pointerId, pi); + const previousControlOver = this._host._lastControlOver[pointerId]; + if (previousControlOver && previousControlOver !== this) { + previousControlOver._onPointerOut(this, pi); + } + if (previousControlOver !== this) { + this._onPointerEnter(this, pi); + } + this._host._lastControlOver[pointerId] = this; + return true; + } + if (type === PointerEventTypes.POINTERDOWN) { + this._onPointerDown(this, this._dummyVector2, pointerId, buttonIndex, pi); + this._host._registerLastControlDown(this, pointerId); + this._host._lastPickedControl = this; + return true; + } + if (type === PointerEventTypes.POINTERUP) { + if (this._host._lastControlDown[pointerId]) { + this._host._lastControlDown[pointerId]._onPointerUp(this, this._dummyVector2, pointerId, buttonIndex, true, pi); + } + delete this._host._lastControlDown[pointerId]; + return true; + } + if (type === PointerEventTypes.POINTERWHEEL) { + if (this._host._lastControlOver[pointerId]) { + this._host._lastControlOver[pointerId]._onWheelScroll(deltaX, deltaY); + return true; + } + } + return false; + } + _getStyleProperty(propName, defaultValue) { + var _a; + const prop = (_a = this._style && this._style[propName]) !== null && _a !== undefined ? _a : this[propName]; + if (!prop && this.parent) { + return this.parent._getStyleProperty(propName, defaultValue); + } else if (!this.parent) { + return defaultValue; + } else { + return prop; + } + } + _prepareFont() { + if (!this._font && !this._fontSet) { + return; + } + this._font = this._getStyleProperty("fontStyle", "") + " " + this._getStyleProperty("fontWeight", "") + " " + this.fontSizeInPixels + "px " + this._getStyleProperty("fontFamily", "Arial"); + this._fontOffset = Control3._GetFontOffset(this._font); + this.getDescendants().forEach((child) => child._markAllAsDirty()); + } + isDimensionFullyDefined(dim) { + return this.getDimension(dim).isPixel; + } + getDimension(dim) { + if (dim === "width") { + return this._width; + } else { + return this._height; + } + } + clone(host) { + const serialization4 = {}; + this.serialize(serialization4); + const controlType = Tools.Instantiate("BABYLON.GUI." + serialization4.className); + const cloned = new controlType; + cloned.parse(serialization4, host); + return cloned; + } + parse(serializedObject, host) { + SerializationHelper.Parse(() => this, serializedObject, null); + this.name = serializedObject.name; + this._parseFromContent(serializedObject, host !== null && host !== undefined ? host : this._host); + return this; + } + serialize(serializationObject) { + SerializationHelper.Serialize(this, serializationObject); + serializationObject.name = this.name; + serializationObject.className = this.getClassName(); + this._prepareFont(); + if (this._font) { + serializationObject.fontFamily = this._fontFamily; + serializationObject.fontSize = this.fontSize; + serializationObject.fontWeight = this.fontWeight; + serializationObject.fontStyle = this.fontStyle; + } + if (this._gradient) { + serializationObject.gradient = {}; + this._gradient.serialize(serializationObject.gradient); + } + SerializationHelper.AppendSerializedAnimations(this, serializationObject); + } + _parseFromContent(serializedObject, host) { + var _a, _b; + if (serializedObject.fontFamily) { + this.fontFamily = serializedObject.fontFamily; + } + if (serializedObject.fontSize) { + this.fontSize = serializedObject.fontSize; + } + if (serializedObject.fontWeight) { + this.fontWeight = serializedObject.fontWeight; + } + if (serializedObject.fontStyle) { + this.fontStyle = serializedObject.fontStyle; + } + if (serializedObject.gradient) { + const className2 = Tools.Instantiate("BABYLON.GUI." + serializedObject.gradient.className); + this._gradient = new className2; + (_a = this._gradient) === null || _a === undefined || _a.parse(serializedObject.gradient); + } + if (serializedObject.animations) { + this.animations = []; + for (let animationIndex = 0;animationIndex < serializedObject.animations.length; animationIndex++) { + const parsedAnimation = serializedObject.animations[animationIndex]; + const internalClass = GetClass("BABYLON.Animation"); + if (internalClass) { + this.animations.push(internalClass.Parse(parsedAnimation)); + } + } + if (serializedObject.autoAnimate && this._host && this._host.getScene()) { + this._host.getScene().beginAnimation(this, serializedObject.autoAnimateFrom, serializedObject.autoAnimateTo, serializedObject.autoAnimateLoop, serializedObject.autoAnimateSpeed || 1); + } + } + this.fixedRatioMasterIsWidth = (_b = serializedObject.fixedRatioMasterIsWidth) !== null && _b !== undefined ? _b : this.fixedRatioMasterIsWidth; + } + dispose() { + this.onDirtyObservable.clear(); + this.onBeforeDrawObservable.clear(); + this.onAfterDrawObservable.clear(); + this.onPointerDownObservable.clear(); + this.onPointerEnterObservable.clear(); + this.onPointerMoveObservable.clear(); + this.onPointerOutObservable.clear(); + this.onPointerUpObservable.clear(); + this.onPointerClickObservable.clear(); + this.onWheelObservable.clear(); + if (this._styleObserver && this._style) { + this._style.onChangedObservable.remove(this._styleObserver); + this._styleObserver = null; + } + if (this.parent) { + this.parent.removeControl(this); + this.parent = null; + } + if (this._host) { + const index = this._host._linkedControls.indexOf(this); + if (index > -1) { + this.linkWithMesh(null); + } + } + this.onDisposeObservable.notifyObservers(this); + this.onDisposeObservable.clear(); + } + static get HORIZONTAL_ALIGNMENT_LEFT() { + return Control3._HORIZONTAL_ALIGNMENT_LEFT; + } + static get HORIZONTAL_ALIGNMENT_RIGHT() { + return Control3._HORIZONTAL_ALIGNMENT_RIGHT; + } + static get HORIZONTAL_ALIGNMENT_CENTER() { + return Control3._HORIZONTAL_ALIGNMENT_CENTER; + } + static get VERTICAL_ALIGNMENT_TOP() { + return Control3._VERTICAL_ALIGNMENT_TOP; + } + static get VERTICAL_ALIGNMENT_BOTTOM() { + return Control3._VERTICAL_ALIGNMENT_BOTTOM; + } + static get VERTICAL_ALIGNMENT_CENTER() { + return Control3._VERTICAL_ALIGNMENT_CENTER; + } + static _GetFontOffset(font) { + if (Control3._FontHeightSizes[font]) { + return Control3._FontHeightSizes[font]; + } + const engine47 = EngineStore.LastCreatedEngine; + if (!engine47) { + throw new Error("Invalid engine. Unable to create a canvas."); + } + const result = engine47.getFontOffset(font); + Control3._FontHeightSizes[font] = result; + return result; + } + static Parse(serializedObject, host) { + const controlType = Tools.Instantiate("BABYLON.GUI." + serializedObject.className); + const control49 = SerializationHelper.Parse(() => new controlType, serializedObject, null); + control49.name = serializedObject.name; + control49._parseFromContent(serializedObject, host); + return control49; + } + static drawEllipse(x, y, width, height, context) { + context.translate(x, y); + context.scale(width, height); + context.beginPath(); + context.arc(0, 0, 1, 0, 2 * Math.PI); + context.closePath(); + context.scale(1 / width, 1 / height); + context.translate(-x, -y); + } + isReady() { + return true; + } +} +var init_control2 = __esm(() => { + init_tslib_es62(); + init_observable(); + init_math_vector(); + init_pointerEvents(); + init_logger(); + init_tools(); + init_valueAndUnit2(); + init_measure2(); + init_math2D2(); + init_typeStore(); + init_decorators(); + init_engineStore(); + Control3.AllowAlphaInheritance = false; + Control3._ClipMeasure = new Measure3(0, 0, 0, 0); + Control3._HORIZONTAL_ALIGNMENT_LEFT = 0; + Control3._HORIZONTAL_ALIGNMENT_RIGHT = 1; + Control3._HORIZONTAL_ALIGNMENT_CENTER = 2; + Control3._VERTICAL_ALIGNMENT_TOP = 0; + Control3._VERTICAL_ALIGNMENT_BOTTOM = 1; + Control3._VERTICAL_ALIGNMENT_CENTER = 2; + Control3._FontHeightSizes = {}; + Control3.AddHeader = () => { + }; + __decorate2([ + serialize() + ], Control3.prototype, "metadata", undefined); + __decorate2([ + serialize() + ], Control3.prototype, "isHitTestVisible", undefined); + __decorate2([ + serialize() + ], Control3.prototype, "isPointerBlocker", undefined); + __decorate2([ + serialize() + ], Control3.prototype, "isFocusInvisible", undefined); + __decorate2([ + serialize() + ], Control3.prototype, "clipChildren", null); + __decorate2([ + serialize() + ], Control3.prototype, "clipContent", null); + __decorate2([ + serialize() + ], Control3.prototype, "useBitmapCache", undefined); + __decorate2([ + serialize() + ], Control3.prototype, "shadowOffsetX", null); + __decorate2([ + serialize() + ], Control3.prototype, "shadowOffsetY", null); + __decorate2([ + serialize() + ], Control3.prototype, "shadowBlur", null); + __decorate2([ + serialize() + ], Control3.prototype, "shadowColor", null); + __decorate2([ + serialize() + ], Control3.prototype, "hoverCursor", undefined); + __decorate2([ + serialize() + ], Control3.prototype, "fontOffset", null); + __decorate2([ + serialize() + ], Control3.prototype, "alpha", null); + __decorate2([ + serialize() + ], Control3.prototype, "scaleX", null); + __decorate2([ + serialize() + ], Control3.prototype, "scaleY", null); + __decorate2([ + serialize() + ], Control3.prototype, "rotation", null); + __decorate2([ + serialize() + ], Control3.prototype, "transformCenterY", null); + __decorate2([ + serialize() + ], Control3.prototype, "transformCenterX", null); + __decorate2([ + serialize() + ], Control3.prototype, "horizontalAlignment", null); + __decorate2([ + serialize() + ], Control3.prototype, "verticalAlignment", null); + __decorate2([ + serialize() + ], Control3.prototype, "fixedRatio", null); + __decorate2([ + serialize() + ], Control3.prototype, "fixedRatioMasterIsWidth", null); + __decorate2([ + serialize() + ], Control3.prototype, "width", null); + __decorate2([ + serialize() + ], Control3.prototype, "height", null); + __decorate2([ + serialize() + ], Control3.prototype, "style", null); + __decorate2([ + serialize() + ], Control3.prototype, "color", null); + __decorate2([ + serialize() + ], Control3.prototype, "gradient", null); + __decorate2([ + serialize() + ], Control3.prototype, "zIndex", null); + __decorate2([ + serialize() + ], Control3.prototype, "notRenderable", null); + __decorate2([ + serialize() + ], Control3.prototype, "isVisible", null); + __decorate2([ + serialize() + ], Control3.prototype, "descendantsOnlyPadding", null); + __decorate2([ + serialize() + ], Control3.prototype, "paddingLeft", null); + __decorate2([ + serialize() + ], Control3.prototype, "paddingRight", null); + __decorate2([ + serialize() + ], Control3.prototype, "paddingTop", null); + __decorate2([ + serialize() + ], Control3.prototype, "paddingBottom", null); + __decorate2([ + serialize() + ], Control3.prototype, "left", null); + __decorate2([ + serialize() + ], Control3.prototype, "top", null); + __decorate2([ + serialize() + ], Control3.prototype, "linkOffsetX", null); + __decorate2([ + serialize() + ], Control3.prototype, "linkOffsetY", null); + __decorate2([ + serialize() + ], Control3.prototype, "isEnabled", null); + __decorate2([ + serialize() + ], Control3.prototype, "disabledColor", null); + __decorate2([ + serialize() + ], Control3.prototype, "disabledColorItem", null); + __decorate2([ + serialize() + ], Control3.prototype, "overlapGroup", undefined); + __decorate2([ + serialize() + ], Control3.prototype, "overlapDeltaMultiplier", undefined); + RegisterClass("BABYLON.GUI.Control", Control3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/container.js +class Container3 extends Control3 { + get renderToIntermediateTexture() { + return this._renderToIntermediateTexture; + } + set renderToIntermediateTexture(value) { + if (this._renderToIntermediateTexture === value) { + return; + } + this._renderToIntermediateTexture = value; + this._markAsDirty(); + } + get adaptHeightToChildren() { + return this._adaptHeightToChildren; + } + set adaptHeightToChildren(value) { + if (this._adaptHeightToChildren === value) { + return; + } + this._adaptHeightToChildren = value; + if (value) { + this.height = "100%"; + } + this._markAsDirty(); + } + get adaptWidthToChildren() { + return this._adaptWidthToChildren; + } + set adaptWidthToChildren(value) { + if (this._adaptWidthToChildren === value) { + return; + } + this._adaptWidthToChildren = value; + if (value) { + this.width = "100%"; + } + this._markAsDirty(); + } + get background() { + return this._background; + } + set background(value) { + if (this._background === value) { + return; + } + this._background = value; + this._markAsDirty(); + } + get backgroundGradient() { + return this._backgroundGradient; + } + set backgroundGradient(value) { + if (this._backgroundGradient === value) { + return; + } + this._backgroundGradient = value; + this._markAsDirty(); + } + get children() { + return this._children; + } + get isReadOnly() { + return this._isReadOnly; + } + set isReadOnly(value) { + this._isReadOnly = value; + for (const child of this._children) { + child.isReadOnly = value; + } + } + constructor(name335) { + super(name335); + this.name = name335; + this._children = new Array; + this._measureForChildren = Measure3.Empty(); + this._background = ""; + this._backgroundGradient = null; + this._adaptWidthToChildren = false; + this._adaptHeightToChildren = false; + this._renderToIntermediateTexture = false; + this._intermediateTexture = null; + this.logLayoutCycleErrors = false; + this.maxLayoutCycle = 3; + this.onControlAddedObservable = new Observable; + this.onControlRemovedObservable = new Observable; + this._inverseTransformMatrix = Matrix2D3.Identity(); + this._inverseMeasure = new Measure3(0, 0, 0, 0); + } + _getTypeName() { + return "Container"; + } + _flagDescendantsAsMatrixDirty() { + for (const child of this.children) { + child._isClipped = false; + child._markMatrixAsDirty(); + } + } + getChildByName(name335) { + for (const child of this.children) { + if (child.name === name335) { + return child; + } + } + return null; + } + getChildByType(name335, type) { + for (const child of this.children) { + if (child.typeName === type) { + return child; + } + } + return null; + } + containsControl(control50) { + return this.children.indexOf(control50) !== -1; + } + addControl(control50) { + if (!control50) { + return this; + } + const index = this._children.indexOf(control50); + if (index !== -1) { + return this; + } + control50._link(this._host); + control50._markAllAsDirty(); + this._reOrderControl(control50); + this._markAsDirty(); + this.onControlAddedObservable.notifyObservers(control50); + return this; + } + clearControls() { + const children = this.children.slice(); + for (const child of children) { + this.removeControl(child); + } + return this; + } + removeControl(control50) { + const index = this._children.indexOf(control50); + if (index !== -1) { + this._children.splice(index, 1); + control50.parent = null; + } + control50.linkWithMesh(null); + if (this._host) { + this._host._cleanControlAfterRemoval(control50); + } + this._markAsDirty(); + this.onControlRemovedObservable.notifyObservers(control50); + return this; + } + _reOrderControl(control50) { + const linkedMesh = control50.linkedMesh; + this.removeControl(control50); + let wasAdded = false; + for (let index = 0;index < this._children.length; index++) { + if (this._children[index].zIndex > control50.zIndex) { + this._children.splice(index, 0, control50); + wasAdded = true; + break; + } + } + if (!wasAdded) { + this._children.push(control50); + } + control50.parent = this; + if (linkedMesh) { + control50.linkWithMesh(linkedMesh); + } + this._markAsDirty(); + } + _offsetLeft(offset) { + super._offsetLeft(offset); + for (const child of this._children) { + child._offsetLeft(offset); + } + } + _offsetTop(offset) { + super._offsetTop(offset); + for (const child of this._children) { + child._offsetTop(offset); + } + } + _markAllAsDirty() { + super._markAllAsDirty(); + for (let index = 0;index < this._children.length; index++) { + this._children[index]._markAllAsDirty(); + } + } + _getBackgroundColor(context) { + return this._backgroundGradient ? this._backgroundGradient.getCanvasGradient(context) : this._background; + } + _localDraw(context) { + if (this._background || this._backgroundGradient) { + context.save(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + context.fillStyle = this._getBackgroundColor(context); + context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + context.restore(); + } + } + _link(host) { + super._link(host); + for (const child of this._children) { + child._link(host); + } + } + _beforeLayout() { + } + _processMeasures(parentMeasure, context) { + if (this._isDirty || !this._cachedParentMeasure.isEqualsTo(parentMeasure)) { + super._processMeasures(parentMeasure, context); + this._evaluateClippingState(parentMeasure); + if (this._renderToIntermediateTexture) { + if (this._intermediateTexture && this._host.getScene() != this._intermediateTexture.getScene()) { + this._intermediateTexture.dispose(); + this._intermediateTexture = null; + } + if (!this._intermediateTexture) { + this._intermediateTexture = new DynamicTexture("", { width: this._currentMeasure.width, height: this._currentMeasure.height }, this._host.getScene(), false, Texture.NEAREST_SAMPLINGMODE, Constants.TEXTUREFORMAT_RGBA, false); + this._intermediateTexture.hasAlpha = true; + } else { + this._intermediateTexture.scaleTo(this._currentMeasure.width, this._currentMeasure.height); + } + } + } + } + _layout(parentMeasure, context) { + var _a, _b; + if (!this.isDirty && (!this.isVisible || this.notRenderable)) { + return false; + } + this.host._numLayoutCalls++; + if (this._isDirty) { + this._currentMeasure.transformToRef(this._transformMatrix, this._prevCurrentMeasureTransformedIntoGlobalSpace); + } + let rebuildCount = 0; + context.save(); + this._applyStates(context); + this._beforeLayout(); + do { + let computedWidth = -1; + let computedHeight = -1; + this._rebuildLayout = false; + this._processMeasures(parentMeasure, context); + if (!this._isClipped) { + for (const child of this._children) { + child._tempParentMeasure.copyFrom(this._measureForChildren); + if (child._layout(this._measureForChildren, context)) { + if (child.isVisible && !child.notRenderable) { + if (this.adaptWidthToChildren && child._width.isPixel) { + computedWidth = Math.max(computedWidth, child._currentMeasure.width + child._paddingLeftInPixels + child._paddingRightInPixels); + } + if (this.adaptHeightToChildren && child._height.isPixel) { + computedHeight = Math.max(computedHeight, child._currentMeasure.height + child._paddingTopInPixels + child._paddingBottomInPixels); + } + } + } + } + if (this.adaptWidthToChildren && computedWidth >= 0) { + computedWidth += this.paddingLeftInPixels + this.paddingRightInPixels; + if (this.width !== computedWidth + "px") { + (_a = this.parent) === null || _a === undefined || _a._markAsDirty(); + this.width = computedWidth + "px"; + this._width.ignoreAdaptiveScaling = true; + this._rebuildLayout = true; + } + } + if (this.adaptHeightToChildren && computedHeight >= 0) { + computedHeight += this.paddingTopInPixels + this.paddingBottomInPixels; + if (this.height !== computedHeight + "px") { + (_b = this.parent) === null || _b === undefined || _b._markAsDirty(); + this.height = computedHeight + "px"; + this._height.ignoreAdaptiveScaling = true; + this._rebuildLayout = true; + } + } + this._postMeasure(); + } + rebuildCount++; + } while (this._rebuildLayout && rebuildCount < this.maxLayoutCycle); + if (rebuildCount >= 3 && this.logLayoutCycleErrors) { + Logger.Error(`Layout cycle detected in GUI (Container name=${this.name}, uniqueId=${this.uniqueId})`); + } + context.restore(); + if (this._isDirty) { + this.invalidateRect(); + this._isDirty = false; + } + return true; + } + _postMeasure() { + } + _draw(context, invalidatedRectangle) { + const renderToIntermediateTextureThisDraw = this._renderToIntermediateTexture && this._intermediateTexture; + const contextToDrawTo = renderToIntermediateTextureThisDraw ? this._intermediateTexture.getContext() : context; + if (renderToIntermediateTextureThisDraw) { + contextToDrawTo.save(); + contextToDrawTo.translate(-this._currentMeasure.left, -this._currentMeasure.top); + if (invalidatedRectangle) { + this._transformMatrix.invertToRef(this._inverseTransformMatrix); + invalidatedRectangle.transformToRef(this._inverseTransformMatrix, this._inverseMeasure); + contextToDrawTo.clearRect(this._inverseMeasure.left, this._inverseMeasure.top, this._inverseMeasure.width, this._inverseMeasure.height); + } else { + contextToDrawTo.clearRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + } + this._localDraw(contextToDrawTo); + context.save(); + if (this.clipChildren) { + this._clipForChildren(contextToDrawTo); + } + for (const child of this._children) { + if (invalidatedRectangle) { + if (!child._intersectsRect(invalidatedRectangle)) { + continue; + } + } + child._render(contextToDrawTo, invalidatedRectangle); + } + if (renderToIntermediateTextureThisDraw) { + contextToDrawTo.restore(); + context.save(); + context.globalAlpha = this.alpha; + context.drawImage(contextToDrawTo.canvas, this._currentMeasure.left, this._currentMeasure.top); + context.restore(); + } + context.restore(); + } + getDescendantsToRef(results, directDescendantsOnly = false, predicate) { + if (!this.children) { + return; + } + for (let index = 0;index < this.children.length; index++) { + const item = this.children[index]; + if (!predicate || predicate(item)) { + results.push(item); + } + if (!directDescendantsOnly) { + item.getDescendantsToRef(results, false, predicate); + } + } + } + _processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) { + if (!this._isEnabled || !this.isVisible || this.notRenderable) { + return false; + } + const contains = super.contains(x, y); + if (!contains && this.clipChildren) { + return false; + } + for (let index = this._children.length - 1;index >= 0; index--) { + const child = this._children[index]; + if (child._processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY)) { + if (child.hoverCursor) { + this._host._changeCursor(child.hoverCursor); + } + return true; + } + } + if (!contains) { + return false; + } + if (!this.isHitTestVisible) { + return false; + } + return this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY); + } + _additionalProcessing(parentMeasure, context) { + super._additionalProcessing(parentMeasure, context); + this._measureForChildren.copyFrom(this._currentMeasure); + } + _getAdaptDimTo(dim) { + if (dim === "width") { + return this.adaptWidthToChildren; + } else { + return this.adaptHeightToChildren; + } + } + isDimensionFullyDefined(dim) { + if (this._getAdaptDimTo(dim)) { + for (const child of this.children) { + if (!child.isDimensionFullyDefined(dim)) { + return false; + } + } + return true; + } + return super.isDimensionFullyDefined(dim); + } + serialize(serializationObject) { + super.serialize(serializationObject); + if (this.backgroundGradient) { + serializationObject.backgroundGradient = {}; + this.backgroundGradient.serialize(serializationObject.backgroundGradient); + } + if (!this.children.length) { + return; + } + serializationObject.children = []; + for (const child of this.children) { + const childSerializationObject = {}; + child.serialize(childSerializationObject); + serializationObject.children.push(childSerializationObject); + } + } + dispose() { + var _a; + super.dispose(); + for (let index = this.children.length - 1;index >= 0; index--) { + this.children[index].dispose(); + } + (_a = this._intermediateTexture) === null || _a === undefined || _a.dispose(); + } + _parseFromContent(serializedObject, host) { + var _a; + super._parseFromContent(serializedObject, host); + this._link(host); + if (serializedObject.backgroundGradient) { + const className2 = Tools.Instantiate("BABYLON.GUI." + serializedObject.backgroundGradient.className); + this._backgroundGradient = new className2; + (_a = this._backgroundGradient) === null || _a === undefined || _a.parse(serializedObject.backgroundGradient); + } + if (!serializedObject.children) { + return; + } + for (const childData of serializedObject.children) { + this.addControl(Control3.Parse(childData, host)); + } + } + isReady() { + for (const child of this.children) { + if (!child.isReady()) { + return false; + } + } + return true; + } +} +var init_container2 = __esm(() => { + init_tslib_es62(); + init_logger(); + init_control2(); + init_measure2(); + init_typeStore(); + init_decorators(); + init_dynamicTexture(); + init_texture(); + init_constants(); + init_observable(); + init_tools(); + init_math2D2(); + __decorate2([ + serialize() + ], Container3.prototype, "renderToIntermediateTexture", null); + __decorate2([ + serialize() + ], Container3.prototype, "maxLayoutCycle", undefined); + __decorate2([ + serialize() + ], Container3.prototype, "adaptHeightToChildren", null); + __decorate2([ + serialize() + ], Container3.prototype, "adaptWidthToChildren", null); + __decorate2([ + serialize() + ], Container3.prototype, "background", null); + __decorate2([ + serialize() + ], Container3.prototype, "backgroundGradient", null); + RegisterClass("BABYLON.GUI.Container", Container3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/rectangle.js +class Rectangle3 extends Container3 { + get thickness() { + return this._thickness; + } + set thickness(value) { + if (this._thickness === value) { + return; + } + this._thickness = value; + this._markAsDirty(); + } + get cornerRadius() { + return this._cornerRadius[0]; + } + set cornerRadius(value) { + if (value < 0) { + value = 0; + } + if (this._cornerRadius[0] === value && this._cornerRadius[1] === value && this._cornerRadius[2] === value && this._cornerRadius[3] === value) { + return; + } + this._cornerRadius[0] = this._cornerRadius[1] = this._cornerRadius[2] = this._cornerRadius[3] = value; + this._markAsDirty(); + } + get cornerRadiusX() { + return this._cornerRadius[0]; + } + set cornerRadiusX(value) { + if (this._cornerRadius[0] === value) { + return; + } + this._cornerRadius[0] = value; + } + get cornerRadiusY() { + return this._cornerRadius[1]; + } + set cornerRadiusY(value) { + if (this._cornerRadius[1] === value) { + return; + } + this._cornerRadius[1] = value; + } + get cornerRadiusZ() { + return this._cornerRadius[2]; + } + set cornerRadiusZ(value) { + if (this._cornerRadius[2] === value) { + return; + } + this._cornerRadius[2] = value; + } + get cornerRadiusW() { + return this._cornerRadius[3]; + } + set cornerRadiusW(value) { + if (this._cornerRadius[3] === value) { + return; + } + this._cornerRadius[3] = value; + } + constructor(name335) { + super(name335); + this.name = name335; + this._thickness = 1; + this._cornerRadius = [0, 0, 0, 0]; + this._cachedRadius = [0, 0, 0, 0]; + } + _getTypeName() { + return "Rectangle"; + } + _computeAdditionalOffsetX() { + let additionalWidth = 0; + if (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) { + additionalWidth += 1; + } + if (this.thickness) { + additionalWidth += this.thickness / 2; + } + return additionalWidth; + } + _computeAdditionalOffsetY() { + let additionalHeight = 0; + if (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) { + additionalHeight += 1; + } + if (this.thickness) { + additionalHeight += this.thickness / 2; + } + return additionalHeight; + } + _getRectangleFill(context) { + return this._getBackgroundColor(context); + } + _localDraw(context) { + context.save(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + if (this._background || this._backgroundGradient) { + context.fillStyle = this._getRectangleFill(context); + if (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) { + this._drawRoundedRect(context, this._thickness / 2); + context.fill(); + } else { + context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + } + if (this._thickness) { + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + if (this.color || this.gradient) { + context.strokeStyle = this.gradient ? this.gradient.getCanvasGradient(context) : this.color; + } + context.lineWidth = this._thickness; + if (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) { + this._drawRoundedRect(context, this._thickness / 2); + context.stroke(); + } else { + context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, this._currentMeasure.width - this._thickness, this._currentMeasure.height - this._thickness); + } + } + context.restore(); + } + _additionalProcessing(parentMeasure, context) { + super._additionalProcessing(parentMeasure, context); + this._measureForChildren.width -= 2 * this._thickness; + this._measureForChildren.height -= 2 * this._thickness; + this._measureForChildren.left += this._thickness; + this._measureForChildren.top += this._thickness; + } + _drawRoundedRect(context, offset = 0) { + const x = this._currentMeasure.left + offset; + const y = this._currentMeasure.top + offset; + const width = this._currentMeasure.width - offset * 2; + const height = this._currentMeasure.height - offset * 2; + for (let index = 0;index < this._cornerRadius.length; index++) { + this._cachedRadius[index] = Math.abs(Math.min(height / 2, Math.min(width / 2, this._cornerRadius[index]))); + } + context.beginPath(); + context.moveTo(x + this._cachedRadius[0], y); + context.lineTo(x + width - this._cachedRadius[1], y); + context.arc(x + width - this._cachedRadius[1], y + this._cachedRadius[1], this._cachedRadius[1], 3 * Math.PI / 2, Math.PI * 2); + context.lineTo(x + width, y + height - this._cachedRadius[2]); + context.arc(x + width - this._cachedRadius[2], y + height - this._cachedRadius[2], this._cachedRadius[2], 0, Math.PI / 2); + context.lineTo(x + this._cachedRadius[3], y + height); + context.arc(x + this._cachedRadius[3], y + height - this._cachedRadius[3], this._cachedRadius[3], Math.PI / 2, Math.PI); + context.lineTo(x, y + this._cachedRadius[0]); + context.arc(x + this._cachedRadius[0], y + this._cachedRadius[0], this._cachedRadius[0], Math.PI, 3 * Math.PI / 2); + context.closePath(); + } + _clipForChildren(context) { + if (this._cornerRadius[0] !== 0 || this._cornerRadius[1] !== 0 || this._cornerRadius[2] !== 0 || this._cornerRadius[3] !== 0) { + this._drawRoundedRect(context, this._thickness); + context.clip(); + } + } +} +var init_rectangle2 = __esm(() => { + init_tslib_es62(); + init_container2(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], Rectangle3.prototype, "thickness", null); + __decorate2([ + serialize() + ], Rectangle3.prototype, "cornerRadius", null); + __decorate2([ + serialize() + ], Rectangle3.prototype, "cornerRadiusX", null); + __decorate2([ + serialize() + ], Rectangle3.prototype, "cornerRadiusY", null); + __decorate2([ + serialize() + ], Rectangle3.prototype, "cornerRadiusZ", null); + __decorate2([ + serialize() + ], Rectangle3.prototype, "cornerRadiusW", null); + RegisterClass("BABYLON.GUI.Rectangle", Rectangle3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/textBlock.js +class TextBlock3 extends Control3 { + get lines() { + return this._lines; + } + get resizeToFit() { + return this._resizeToFit; + } + set resizeToFit(value) { + if (this._resizeToFit === value) { + return; + } + this._resizeToFit = value; + if (this._resizeToFit) { + this._width.ignoreAdaptiveScaling = true; + this._height.ignoreAdaptiveScaling = true; + } + this._markAsDirty(); + } + get textWrapping() { + return this._textWrapping; + } + set textWrapping(value) { + if (this._textWrapping === value) { + return; + } + this._textWrapping = +value; + this._markAsDirty(); + } + get text() { + return this._text; + } + set text(value) { + if (this._text === value) { + return; + } + this._text = value + ""; + this._markAsDirty(); + this.onTextChangedObservable.notifyObservers(this); + } + get textHorizontalAlignment() { + return this._textHorizontalAlignment; + } + set textHorizontalAlignment(value) { + if (this._textHorizontalAlignment === value) { + return; + } + this._textHorizontalAlignment = value; + this._markAsDirty(); + } + get textVerticalAlignment() { + return this._textVerticalAlignment; + } + set textVerticalAlignment(value) { + if (this._textVerticalAlignment === value) { + return; + } + this._textVerticalAlignment = value; + this._markAsDirty(); + } + set lineSpacing(value) { + if (this._lineSpacing.fromString(value)) { + this._markAsDirty(); + } + } + get lineSpacing() { + return this._lineSpacing.toString(this._host); + } + get outlineWidth() { + return this._outlineWidth; + } + set outlineWidth(value) { + if (this._outlineWidth === value) { + return; + } + this._outlineWidth = value; + this._markAsDirty(); + } + get underline() { + return this._underline; + } + set underline(value) { + if (this._underline === value) { + return; + } + this._underline = value; + this._markAsDirty(); + } + get lineThrough() { + return this._lineThrough; + } + set lineThrough(value) { + if (this._lineThrough === value) { + return; + } + this._lineThrough = value; + this._markAsDirty(); + } + get applyOutlineToUnderline() { + return this._applyOutlineToUnderline; + } + set applyOutlineToUnderline(value) { + if (this._applyOutlineToUnderline === value) { + return; + } + this._applyOutlineToUnderline = value; + this._markAsDirty(); + } + get outlineColor() { + return this._outlineColor; + } + set outlineColor(value) { + if (this._outlineColor === value) { + return; + } + this._outlineColor = value; + this._markAsDirty(); + } + get wordDivider() { + return this._wordDivider; + } + set wordDivider(value) { + if (this._wordDivider === value) { + return; + } + this._wordDivider = value; + this._markAsDirty(); + } + get forceResizeWidth() { + return this._forceResizeWidth; + } + set forceResizeWidth(value) { + if (this._forceResizeWidth === value) { + return; + } + this._forceResizeWidth = value; + this._markAsDirty(); + } + constructor(name335, text = "") { + super(name335); + this.name = name335; + this._text = ""; + this._textWrapping = TextWrapping3.Clip; + this._textHorizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_CENTER; + this._textVerticalAlignment = Control3.VERTICAL_ALIGNMENT_CENTER; + this._resizeToFit = false; + this._lineSpacing = new ValueAndUnit3(0); + this._outlineWidth = 0; + this._outlineColor = "white"; + this._underline = false; + this._lineThrough = false; + this._wordDivider = " "; + this._forceResizeWidth = false; + this._applyOutlineToUnderline = false; + this.onTextChangedObservable = new Observable; + this.onLinesReadyObservable = new Observable; + this._linesTemp = []; + this.text = text; + } + _getTypeName() { + return "TextBlock"; + } + _processMeasures(parentMeasure, context) { + if (!this._fontOffset || this.isDirty) { + this._fontOffset = Control3._GetFontOffset(context.font); + } + super._processMeasures(parentMeasure, context); + this._lines = this._breakLines(this._currentMeasure.width, this._currentMeasure.height, context); + this.onLinesReadyObservable.notifyObservers(this); + let maxLineWidth = 0; + for (let i = 0;i < this._lines.length; i++) { + const line3 = this._lines[i]; + if (line3.width > maxLineWidth) { + maxLineWidth = line3.width; + } + } + if (this._resizeToFit) { + if (this._textWrapping === TextWrapping3.Clip || this._forceResizeWidth) { + const newWidth = Math.ceil(this._paddingLeftInPixels) + Math.ceil(this._paddingRightInPixels) + Math.ceil(maxLineWidth); + if (newWidth !== this._width.getValueInPixel(this._host, this._tempParentMeasure.width)) { + this._width.updateInPlace(newWidth, ValueAndUnit3.UNITMODE_PIXEL); + this._rebuildLayout = true; + } + } + let newHeight = this._paddingTopInPixels + this._paddingBottomInPixels + this._fontOffset.height * this._lines.length | 0; + if (this._lines.length > 0 && this._lineSpacing.internalValue !== 0) { + let lineSpacing = 0; + if (this._lineSpacing.isPixel) { + lineSpacing = this._lineSpacing.getValue(this._host); + } else { + lineSpacing = this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + newHeight += (this._lines.length - 1) * lineSpacing; + } + if (newHeight !== this._height.internalValue) { + this._height.updateInPlace(newHeight, ValueAndUnit3.UNITMODE_PIXEL); + this._rebuildLayout = true; + } + } + } + _drawText(text, textWidth, y, context) { + const width = this._currentMeasure.width; + let x = 0; + switch (this._textHorizontalAlignment) { + case Control3.HORIZONTAL_ALIGNMENT_LEFT: + x = 0; + break; + case Control3.HORIZONTAL_ALIGNMENT_RIGHT: + x = width - textWidth; + break; + case Control3.HORIZONTAL_ALIGNMENT_CENTER: + x = (width - textWidth) / 2; + break; + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + if (this.outlineWidth) { + context.strokeText(text, this._currentMeasure.left + x, y); + } + context.fillText(text, this._currentMeasure.left + x, y); + if (this._underline) { + this._drawLine(this._currentMeasure.left + x, y + 3, this._currentMeasure.left + x + textWidth, y + 3, context); + } + if (this._lineThrough) { + this._drawLine(this._currentMeasure.left + x, y - this.fontSizeInPixels / 3, this._currentMeasure.left + x + textWidth, y - this.fontSizeInPixels / 3, context); + } + } + _drawLine(xFrom, yFrom, xTo, yTo, context) { + context.beginPath(); + context.lineWidth = Math.round(this.fontSizeInPixels * 0.05); + context.moveTo(xFrom, yFrom); + context.lineTo(xTo, yTo); + if (this.outlineWidth && this.applyOutlineToUnderline) { + context.stroke(); + context.fill(); + } else { + const currentStroke = context.strokeStyle; + context.strokeStyle = context.fillStyle; + context.stroke(); + context.strokeStyle = currentStroke; + } + context.closePath(); + } + _draw(context) { + context.save(); + this._applyStates(context); + this._renderLines(context); + context.restore(); + } + _applyStates(context) { + super._applyStates(context); + if (this.outlineWidth) { + context.lineWidth = this.outlineWidth; + context.strokeStyle = this.outlineColor; + context.lineJoin = "miter"; + context.miterLimit = 2; + } + } + _breakLines(refWidth, refHeight, context) { + this._linesTemp.length = 0; + const _lines = this.text.split("\n"); + if (this._textWrapping === TextWrapping3.Ellipsis) { + for (const _line of _lines) { + this._linesTemp.push(this._parseLineEllipsis(_line, refWidth, context)); + } + } else if (this._textWrapping === TextWrapping3.WordWrap) { + for (const _line of _lines) { + this._linesTemp.push(...this._parseLineWordWrap(_line, refWidth, context)); + } + } else if (this._textWrapping === TextWrapping3.WordWrapEllipsis) { + for (const _line of _lines) { + this._linesTemp.push(...this._parseLineWordWrapEllipsis(_line, refWidth, refHeight, context)); + } + } else { + for (const _line of _lines) { + this._linesTemp.push(this._parseLine(_line, context)); + } + } + return this._linesTemp; + } + _parseLine(line3 = "", context) { + return { text: line3, width: this._getTextMetricsWidth(context.measureText(line3)) }; + } + _getCharsToRemove(lineWidth, width, lineLength) { + const diff = lineWidth > width ? lineWidth - width : 0; + const charWidth = lineWidth / lineLength; + const removeChars = Math.max(Math.floor(diff / charWidth), 1); + return removeChars; + } + _parseLineEllipsis(line3 = "", width, context) { + let lineWidth = this._getTextMetricsWidth(context.measureText(line3)); + let removeChars = this._getCharsToRemove(lineWidth, width, line3.length); + const characters = Array.from && Array.from(line3); + if (!characters) { + while (line3.length > 2 && lineWidth > width) { + line3 = line3.slice(0, -removeChars); + lineWidth = this._getTextMetricsWidth(context.measureText(line3 + "\u2026")); + removeChars = this._getCharsToRemove(lineWidth, width, line3.length); + } + line3 += "\u2026"; + } else { + while (characters.length && lineWidth > width) { + characters.splice(characters.length - removeChars, removeChars); + line3 = `${characters.join("")}\u2026`; + lineWidth = this._getTextMetricsWidth(context.measureText(line3)); + removeChars = this._getCharsToRemove(lineWidth, width, line3.length); + } + } + return { text: line3, width: lineWidth }; + } + _getTextMetricsWidth(textMetrics) { + if (textMetrics.actualBoundingBoxLeft !== undefined) { + return Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight); + } + return textMetrics.width; + } + _parseLineWordWrap(line3 = "", width, context) { + const lines = []; + const words = this.wordSplittingFunction ? this.wordSplittingFunction(line3) : line3.split(this._wordDivider); + let lineWidth = this._getTextMetricsWidth(context.measureText(line3)); + for (let n = 0;n < words.length; n++) { + const testLine = n > 0 ? line3 + this._wordDivider + words[n] : words[0]; + const testWidth = this._getTextMetricsWidth(context.measureText(testLine)); + if (testWidth > width && n > 0) { + lines.push({ text: line3, width: lineWidth }); + line3 = words[n]; + lineWidth = this._getTextMetricsWidth(context.measureText(line3)); + } else { + lineWidth = testWidth; + line3 = testLine; + } + } + lines.push({ text: line3, width: lineWidth }); + return lines; + } + _parseLineWordWrapEllipsis(line3 = "", width, height, context) { + const lines = this._parseLineWordWrap(line3, width, context); + for (let n = 1;n <= lines.length; n++) { + const currentHeight = this._computeHeightForLinesOf(n); + if (currentHeight > height && n > 1) { + const lastLine = lines[n - 2]; + const currentLine = lines[n - 1]; + lines[n - 2] = this._parseLineEllipsis(lastLine.text + this._wordDivider + currentLine.text, width, context); + const linesToRemove = lines.length - n + 1; + for (let i = 0;i < linesToRemove; i++) { + lines.pop(); + } + return lines; + } + } + return lines; + } + _renderLines(context) { + if (!this._fontOffset || !this._lines) { + return; + } + const height = this._currentMeasure.height; + let rootY = 0; + switch (this._textVerticalAlignment) { + case Control3.VERTICAL_ALIGNMENT_TOP: + rootY = this._fontOffset.ascent; + break; + case Control3.VERTICAL_ALIGNMENT_BOTTOM: + rootY = height - this._fontOffset.height * (this._lines.length - 1) - this._fontOffset.descent; + break; + case Control3.VERTICAL_ALIGNMENT_CENTER: + rootY = this._fontOffset.ascent + (height - this._fontOffset.height * this._lines.length) / 2; + break; + } + rootY += this._currentMeasure.top; + for (let i = 0;i < this._lines.length; i++) { + const line3 = this._lines[i]; + if (i !== 0 && this._lineSpacing.internalValue !== 0) { + if (this._lineSpacing.isPixel) { + rootY += this._lineSpacing.getValue(this._host); + } else { + rootY = rootY + this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + } + this._drawText(line3.text, line3.width, rootY, context); + rootY += this._fontOffset.height; + } + } + _computeHeightForLinesOf(lineCount) { + let newHeight = this._paddingTopInPixels + this._paddingBottomInPixels + this._fontOffset.height * lineCount; + if (lineCount > 0 && this._lineSpacing.internalValue !== 0) { + let lineSpacing = 0; + if (this._lineSpacing.isPixel) { + lineSpacing = this._lineSpacing.getValue(this._host); + } else { + lineSpacing = this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + newHeight += (lineCount - 1) * lineSpacing; + } + return newHeight; + } + isDimensionFullyDefined(dim) { + if (this.resizeToFit) { + return true; + } + return super.isDimensionFullyDefined(dim); + } + computeExpectedHeight() { + var _a; + if (this.text && this.widthInPixels) { + const context = (_a = EngineStore.LastCreatedEngine) === null || _a === undefined ? undefined : _a.createCanvas(0, 0).getContext("2d"); + if (context) { + this._applyStates(context); + if (!this._fontOffset) { + this._fontOffset = Control3._GetFontOffset(context.font); + } + const lines = this._lines ? this._lines : this._breakLines(this.widthInPixels - this._paddingLeftInPixels - this._paddingRightInPixels, this.heightInPixels - this._paddingTopInPixels - this._paddingBottomInPixels, context); + return this._computeHeightForLinesOf(lines.length); + } + } + return 0; + } + dispose() { + super.dispose(); + this.onTextChangedObservable.clear(); + } +} +var TextWrapping3; +var init_textBlock2 = __esm(() => { + init_tslib_es62(); + init_observable(); + init_valueAndUnit2(); + init_control2(); + init_typeStore(); + init_decorators(); + init_engineStore(); + (function(TextWrapping4) { + TextWrapping4[TextWrapping4["Clip"] = 0] = "Clip"; + TextWrapping4[TextWrapping4["WordWrap"] = 1] = "WordWrap"; + TextWrapping4[TextWrapping4["Ellipsis"] = 2] = "Ellipsis"; + TextWrapping4[TextWrapping4["WordWrapEllipsis"] = 3] = "WordWrapEllipsis"; + })(TextWrapping3 || (TextWrapping3 = {})); + __decorate2([ + serialize() + ], TextBlock3.prototype, "resizeToFit", null); + __decorate2([ + serialize() + ], TextBlock3.prototype, "textWrapping", null); + __decorate2([ + serialize() + ], TextBlock3.prototype, "text", null); + __decorate2([ + serialize() + ], TextBlock3.prototype, "textHorizontalAlignment", null); + __decorate2([ + serialize() + ], TextBlock3.prototype, "textVerticalAlignment", null); + __decorate2([ + serialize() + ], TextBlock3.prototype, "lineSpacing", null); + __decorate2([ + serialize() + ], TextBlock3.prototype, "outlineWidth", null); + __decorate2([ + serialize() + ], TextBlock3.prototype, "underline", null); + __decorate2([ + serialize() + ], TextBlock3.prototype, "lineThrough", null); + __decorate2([ + serialize() + ], TextBlock3.prototype, "applyOutlineToUnderline", null); + __decorate2([ + serialize() + ], TextBlock3.prototype, "outlineColor", null); + __decorate2([ + serialize() + ], TextBlock3.prototype, "wordDivider", null); + __decorate2([ + serialize() + ], TextBlock3.prototype, "forceResizeWidth", null); + RegisterClass("BABYLON.GUI.TextBlock", TextBlock3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/image.js +class Image4 extends Control3 { + get isLoaded() { + return this._loaded; + } + isReady() { + return this.isLoaded; + } + get detectPointerOnOpaqueOnly() { + return this._detectPointerOnOpaqueOnly; + } + set detectPointerOnOpaqueOnly(value) { + if (this._detectPointerOnOpaqueOnly === value) { + return; + } + this._detectPointerOnOpaqueOnly = value; + } + get sliceLeft() { + return this._sliceLeft; + } + set sliceLeft(value) { + if (this._sliceLeft === value) { + return; + } + this._sliceLeft = value; + this._markAsDirty(); + } + get sliceRight() { + return this._sliceRight; + } + set sliceRight(value) { + if (this._sliceRight === value) { + return; + } + this._sliceRight = value; + this._markAsDirty(); + } + get sliceTop() { + return this._sliceTop; + } + set sliceTop(value) { + if (this._sliceTop === value) { + return; + } + this._sliceTop = value; + this._markAsDirty(); + } + get sliceBottom() { + return this._sliceBottom; + } + set sliceBottom(value) { + if (this._sliceBottom === value) { + return; + } + this._sliceBottom = value; + this._markAsDirty(); + } + get sourceLeft() { + return this._sourceLeft; + } + set sourceLeft(value) { + if (this._sourceLeft === value) { + return; + } + this._sourceLeft = value; + this._markAsDirty(); + } + get sourceTop() { + return this._sourceTop; + } + set sourceTop(value) { + if (this._sourceTop === value) { + return; + } + this._sourceTop = value; + this._markAsDirty(); + } + get sourceWidth() { + return this._sourceWidth; + } + set sourceWidth(value) { + if (this._sourceWidth === value) { + return; + } + this._sourceWidth = value; + this._markAsDirty(); + } + get sourceHeight() { + return this._sourceHeight; + } + set sourceHeight(value) { + if (this._sourceHeight === value) { + return; + } + this._sourceHeight = value; + this._markAsDirty(); + } + get imageWidth() { + return this._imageWidth; + } + get imageHeight() { + return this._imageHeight; + } + get populateNinePatchSlicesFromImage() { + return this._populateNinePatchSlicesFromImage; + } + set populateNinePatchSlicesFromImage(value) { + if (this._populateNinePatchSlicesFromImage === value) { + return; + } + this._populateNinePatchSlicesFromImage = value; + if (this._populateNinePatchSlicesFromImage && this._loaded) { + this._extractNinePatchSliceDataFromImage(); + } + } + get isSVG() { + return this._isSVG; + } + get svgAttributesComputationCompleted() { + return this._svgAttributesComputationCompleted; + } + get autoScale() { + return this._autoScale; + } + set autoScale(value) { + if (this._autoScale === value) { + return; + } + this._autoScale = value; + if (value && this._loaded) { + this.synchronizeSizeWithContent(); + } + } + get stretch() { + return this._stretch; + } + set stretch(value) { + if (this._stretch === value) { + return; + } + this._stretch = value; + this._markAsDirty(); + } + _rotate90(n, preserveProperties = false) { + var _a, _b; + const width = this._domImage.width; + const height = this._domImage.height; + const engine47 = ((_b = (_a = this._host) === null || _a === undefined ? undefined : _a.getScene()) === null || _b === undefined ? undefined : _b.getEngine()) || EngineStore.LastCreatedEngine; + if (!engine47) { + throw new Error("Invalid engine. Unable to create a canvas."); + } + const canvas = engine47.createCanvas(height, width); + const context = canvas.getContext("2d"); + context.translate(canvas.width / 2, canvas.height / 2); + context.rotate(n * Math.PI / 2); + context.drawImage(this._domImage, 0, 0, width, height, -width / 2, -height / 2, width, height); + const dataUrl = canvas.toDataURL("image/jpg"); + const rotatedImage = new Image4(this.name + "rotated", dataUrl); + if (preserveProperties) { + rotatedImage._stretch = this._stretch; + rotatedImage._autoScale = this._autoScale; + rotatedImage._cellId = this._cellId; + rotatedImage._cellWidth = n % 1 ? this._cellHeight : this._cellWidth; + rotatedImage._cellHeight = n % 1 ? this._cellWidth : this._cellHeight; + } + this._handleRotationForSVGImage(this, rotatedImage, n); + this._imageDataCache.data = null; + return rotatedImage; + } + _handleRotationForSVGImage(srcImage, dstImage, n) { + if (!srcImage._isSVG) { + return; + } + if (srcImage._svgAttributesComputationCompleted) { + this._rotate90SourceProperties(srcImage, dstImage, n); + this._markAsDirty(); + } else { + srcImage.onSVGAttributesComputedObservable.addOnce(() => { + this._rotate90SourceProperties(srcImage, dstImage, n); + this._markAsDirty(); + }); + } + } + _rotate90SourceProperties(srcImage, dstImage, n) { + let { sourceLeft: srcLeft, sourceTop: srcTop } = srcImage, srcWidth = srcImage.domImage.width, srcHeight = srcImage.domImage.height; + let dstLeft = srcLeft, dstTop = srcTop, dstWidth = srcImage.sourceWidth, dstHeight = srcImage.sourceHeight; + if (n != 0) { + const mult = n < 0 ? -1 : 1; + n = n % 4; + for (let i = 0;i < Math.abs(n); ++i) { + dstLeft = -(srcTop - srcHeight / 2) * mult + srcHeight / 2; + dstTop = (srcLeft - srcWidth / 2) * mult + srcWidth / 2; + [dstWidth, dstHeight] = [dstHeight, dstWidth]; + if (n < 0) { + dstTop -= dstHeight; + } else { + dstLeft -= dstWidth; + } + srcLeft = dstLeft; + srcTop = dstTop; + [srcWidth, srcHeight] = [srcHeight, srcWidth]; + } + } + dstImage.sourceLeft = dstLeft; + dstImage.sourceTop = dstTop; + dstImage.sourceWidth = dstWidth; + dstImage.sourceHeight = dstHeight; + } + _extractNinePatchSliceDataFromImage() { + var _a, _b; + const width = this._domImage.width; + const height = this._domImage.height; + if (!this._workingCanvas) { + const engine47 = ((_b = (_a = this._host) === null || _a === undefined ? undefined : _a.getScene()) === null || _b === undefined ? undefined : _b.getEngine()) || EngineStore.LastCreatedEngine; + if (!engine47) { + throw new Error("Invalid engine. Unable to create a canvas."); + } + this._workingCanvas = engine47.createCanvas(width, height); + } + const canvas = this._workingCanvas; + const context = canvas.getContext("2d"); + context.drawImage(this._domImage, 0, 0, width, height); + const imageData = context.getImageData(0, 0, width, height); + this._sliceLeft = -1; + this._sliceRight = -1; + for (let x = 0;x < width; x++) { + const alpha = imageData.data[x * 4 + 3]; + if (alpha > 127 && this._sliceLeft === -1) { + this._sliceLeft = x; + continue; + } + if (alpha < 127 && this._sliceLeft > -1) { + this._sliceRight = x; + break; + } + } + this._sliceTop = -1; + this._sliceBottom = -1; + for (let y = 0;y < height; y++) { + const alpha = imageData.data[y * width * 4 + 3]; + if (alpha > 127 && this._sliceTop === -1) { + this._sliceTop = y; + continue; + } + if (alpha < 127 && this._sliceTop > -1) { + this._sliceBottom = y; + break; + } + } + } + set domImage(value) { + this._domImage = value; + this._loaded = false; + this._imageDataCache.data = null; + if (this._domImage.width) { + this._onImageLoaded(); + } else { + this._domImage.onload = () => { + this._onImageLoaded(); + }; + } + } + get domImage() { + return this._domImage; + } + _onImageLoaded() { + this._imageDataCache.data = null; + this._imageWidth = this._domImage.width; + this._imageHeight = this._domImage.height; + this._loaded = true; + if (this._populateNinePatchSlicesFromImage) { + this._extractNinePatchSliceDataFromImage(); + } + if (this._autoScale) { + this.synchronizeSizeWithContent(); + } + this.onImageLoadedObservable.notifyObservers(this); + this._markAsDirty(); + } + get source() { + return this._source; + } + static ResetImageCache() { + Image4.SourceImgCache.clear(); + } + _removeCacheUsage(source) { + const value = source && Image4.SourceImgCache.get(source); + if (value) { + value.timesUsed -= 1; + if (value.timesUsed === 0) { + Image4.SourceImgCache.delete(source); + } + } + } + set source(value) { + var _a, _b; + if (this._source === value) { + return; + } + this._removeCacheUsage(this._source); + this._loaded = false; + this._source = value; + this._imageDataCache.data = null; + if (value) { + value = this._svgCheck(value); + } + const engine47 = ((_b = (_a = this._host) === null || _a === undefined ? undefined : _a.getScene()) === null || _b === undefined ? undefined : _b.getEngine()) || EngineStore.LastCreatedEngine; + if (!engine47) { + throw new Error("Invalid engine. Unable to create a canvas."); + } + if (value && Image4.SourceImgCache.has(value)) { + const cachedData = Image4.SourceImgCache.get(value); + this._domImage = cachedData.img; + cachedData.timesUsed += 1; + if (cachedData.loaded) { + this._onImageLoaded(); + } else { + cachedData.waitingForLoadCallback.push(this._onImageLoaded.bind(this)); + } + return; + } + this._domImage = engine47.createCanvasImage(); + if (value) { + Image4.SourceImgCache.set(value, { img: this._domImage, timesUsed: 1, loaded: false, waitingForLoadCallback: [this._onImageLoaded.bind(this)] }); + } + this._domImage.onload = () => { + if (value) { + const cachedData = Image4.SourceImgCache.get(value); + if (cachedData) { + cachedData.loaded = true; + for (const waitingCallback of cachedData.waitingForLoadCallback) { + waitingCallback(); + } + cachedData.waitingForLoadCallback.length = 0; + return; + } + } + this._onImageLoaded(); + }; + if (value) { + Tools.SetCorsBehavior(value, this._domImage); + Tools.SetReferrerPolicyBehavior(this.referrerPolicy, this._domImage); + this._domImage.src = value; + } + } + _svgCheck(value) { + if (window.SVGSVGElement && value.search(/.svg#/gi) !== -1 && value.indexOf("#") === value.lastIndexOf("#")) { + this._isSVG = true; + const svgsrc = value.split("#")[0]; + const elemid = value.split("#")[1]; + const svgExist = document.body.querySelector('object[data="' + svgsrc + '"]'); + if (svgExist) { + const svgDoc = svgExist.contentDocument; + if (svgDoc && svgDoc.documentElement) { + const vb = svgDoc.documentElement.getAttribute("viewBox"); + const docwidth = Number(svgDoc.documentElement.getAttribute("width")); + const docheight = Number(svgDoc.documentElement.getAttribute("height")); + const elem = svgDoc.getElementById(elemid); + if (elem && vb && docwidth && docheight) { + this._getSVGAttribs(svgExist, elemid); + return value; + } + } + svgExist.addEventListener("load", () => { + this._getSVGAttribs(svgExist, elemid); + }); + } else { + const svgImage = document.createElement("object"); + svgImage.data = svgsrc; + svgImage.type = "image/svg+xml"; + svgImage.width = "0%"; + svgImage.height = "0%"; + document.body.appendChild(svgImage); + svgImage.onload = () => { + const svgobj = document.body.querySelector('object[data="' + svgsrc + '"]'); + if (svgobj) { + this._getSVGAttribs(svgobj, elemid); + } + }; + } + return svgsrc; + } else { + return value; + } + } + _getSVGAttribs(svgsrc, elemid) { + const svgDoc = svgsrc.contentDocument; + if (svgDoc && svgDoc.documentElement) { + const vb = svgDoc.documentElement.getAttribute("viewBox"); + const docwidth = Number(svgDoc.documentElement.getAttribute("width")); + const docheight = Number(svgDoc.documentElement.getAttribute("height")); + const elem = svgDoc.getElementById(elemid); + if (vb && docwidth && docheight && elem) { + const vb_width = Number(vb.split(" ")[2]); + const vb_height = Number(vb.split(" ")[3]); + const elem_bbox = elem.getBBox(); + let elem_matrix_a = 1; + let elem_matrix_d = 1; + let elem_matrix_e = 0; + let elem_matrix_f = 0; + const mainMatrix = elem.transform.baseVal.consolidate().matrix; + if (elem.transform && elem.transform.baseVal.consolidate()) { + elem_matrix_a = mainMatrix.a; + elem_matrix_d = mainMatrix.d; + elem_matrix_e = mainMatrix.e; + elem_matrix_f = mainMatrix.f; + } + this.sourceLeft = (elem_matrix_a * elem_bbox.x + elem_matrix_e) * docwidth / vb_width; + this.sourceTop = (elem_matrix_d * elem_bbox.y + elem_matrix_f) * docheight / vb_height; + this.sourceWidth = elem_bbox.width * elem_matrix_a * (docwidth / vb_width); + this.sourceHeight = elem_bbox.height * elem_matrix_d * (docheight / vb_height); + this._svgAttributesComputationCompleted = true; + this.onSVGAttributesComputedObservable.notifyObservers(this); + } + } + } + get cellWidth() { + return this._cellWidth; + } + set cellWidth(value) { + if (this._cellWidth === value) { + return; + } + this._cellWidth = value; + this._markAsDirty(); + } + get cellHeight() { + return this._cellHeight; + } + set cellHeight(value) { + if (this._cellHeight === value) { + return; + } + this._cellHeight = value; + this._markAsDirty(); + } + get cellId() { + return this._cellId; + } + set cellId(value) { + if (this._cellId === value) { + return; + } + this._cellId = value; + this._markAsDirty(); + } + constructor(name335, url = null) { + super(name335); + this.name = name335; + this._workingCanvas = null; + this._loaded = false; + this._stretch = Image4.STRETCH_FILL; + this._autoScale = false; + this._sourceLeft = 0; + this._sourceTop = 0; + this._sourceWidth = 0; + this._sourceHeight = 0; + this._svgAttributesComputationCompleted = false; + this._isSVG = false; + this._cellWidth = 0; + this._cellHeight = 0; + this._cellId = -1; + this._populateNinePatchSlicesFromImage = false; + this._imageDataCache = { data: null, key: "" }; + this.onImageLoadedObservable = new Observable; + this.onSVGAttributesComputedObservable = new Observable; + this.source = url; + } + contains(x, y) { + if (!super.contains(x, y)) { + return false; + } + if (!this._detectPointerOnOpaqueOnly || !this._workingCanvas) { + return true; + } + const width = this._currentMeasure.width | 0; + const height = this._currentMeasure.height | 0; + const key = width + "_" + height; + let imageData = this._imageDataCache.data; + if (!imageData || this._imageDataCache.key !== key) { + const canvas = this._workingCanvas; + const context = canvas.getContext("2d"); + this._imageDataCache.data = imageData = context.getImageData(0, 0, width, height).data; + this._imageDataCache.key = key; + } + x = x - this._currentMeasure.left | 0; + y = y - this._currentMeasure.top | 0; + const pickedPixel = imageData[(x + y * width) * 4 + 3]; + return pickedPixel > 0; + } + _getTypeName() { + return "Image"; + } + synchronizeSizeWithContent() { + if (!this._loaded) { + return; + } + this.width = this._domImage.width + "px"; + this.height = this._domImage.height + "px"; + } + _processMeasures(parentMeasure, context) { + if (this._loaded) { + switch (this._stretch) { + case Image4.STRETCH_NONE: + break; + case Image4.STRETCH_FILL: + break; + case Image4.STRETCH_UNIFORM: + break; + case Image4.STRETCH_NINE_PATCH: + break; + case Image4.STRETCH_EXTEND: + if (this._autoScale) { + this.synchronizeSizeWithContent(); + } + if (this.parent && this.parent.parent) { + this.parent.adaptWidthToChildren = true; + this.parent.adaptHeightToChildren = true; + } + break; + } + } + super._processMeasures(parentMeasure, context); + } + _prepareWorkingCanvasForOpaqueDetection() { + var _a, _b; + if (!this._detectPointerOnOpaqueOnly) { + return; + } + const width = this._currentMeasure.width; + const height = this._currentMeasure.height; + if (!this._workingCanvas) { + const engine47 = ((_b = (_a = this._host) === null || _a === undefined ? undefined : _a.getScene()) === null || _b === undefined ? undefined : _b.getEngine()) || EngineStore.LastCreatedEngine; + if (!engine47) { + throw new Error("Invalid engine. Unable to create a canvas."); + } + this._workingCanvas = engine47.createCanvas(width, height); + } + const canvas = this._workingCanvas; + const context = canvas.getContext("2d"); + context.clearRect(0, 0, width, height); + } + _drawImage(context, sx, sy, sw, sh, tx, ty, tw, th) { + context.drawImage(this._domImage, sx, sy, sw, sh, tx, ty, tw, th); + if (!this._detectPointerOnOpaqueOnly) { + return; + } + const transform = context.getTransform(); + const canvas = this._workingCanvas; + const workingCanvasContext = canvas.getContext("2d"); + workingCanvasContext.save(); + const ttx = tx - this._currentMeasure.left; + const tty = ty - this._currentMeasure.top; + workingCanvasContext.setTransform(transform.a, transform.b, transform.c, transform.d, (ttx + tw) / 2, (tty + th) / 2); + workingCanvasContext.translate(-(ttx + tw) / 2, -(tty + th) / 2); + workingCanvasContext.drawImage(this._domImage, sx, sy, sw, sh, ttx, tty, tw, th); + workingCanvasContext.restore(); + } + _draw(context) { + context.save(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + let x, y, width, height; + if (this.cellId == -1) { + x = this._sourceLeft; + y = this._sourceTop; + width = this._sourceWidth ? this._sourceWidth : this._imageWidth; + height = this._sourceHeight ? this._sourceHeight : this._imageHeight; + } else { + const rowCount = this._domImage.naturalWidth / this.cellWidth; + const column = this.cellId / rowCount >> 0; + const row = this.cellId % rowCount; + x = this.cellWidth * row; + y = this.cellHeight * column; + width = this.cellWidth; + height = this.cellHeight; + } + this._prepareWorkingCanvasForOpaqueDetection(); + this._applyStates(context); + if (this._loaded) { + switch (this._stretch) { + case Image4.STRETCH_NONE: + this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + break; + case Image4.STRETCH_FILL: + this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + break; + case Image4.STRETCH_UNIFORM: { + const hRatio = this._currentMeasure.width / width; + const vRatio = this._currentMeasure.height / height; + const ratio = Math.min(hRatio, vRatio); + const centerX = (this._currentMeasure.width - width * ratio) / 2; + const centerY = (this._currentMeasure.height - height * ratio) / 2; + this._drawImage(context, x, y, width, height, this._currentMeasure.left + centerX, this._currentMeasure.top + centerY, width * ratio, height * ratio); + break; + } + case Image4.STRETCH_EXTEND: + this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + break; + case Image4.STRETCH_NINE_PATCH: + this._renderNinePatch(context, x, y, width, height); + break; + } + } + context.restore(); + } + _renderNinePatch(context, sx, sy, sw, sh) { + const leftWidth = this._sliceLeft; + const topHeight = this._sliceTop; + const bottomHeight = sh - this._sliceBottom; + const rightWidth = sw - this._sliceRight; + const centerWidth = this._sliceRight - this._sliceLeft; + const centerHeight = this._sliceBottom - this._sliceTop; + const targetCenterWidth = this._currentMeasure.width - rightWidth - leftWidth + 2; + const targetCenterHeight = this._currentMeasure.height - bottomHeight - topHeight + 2; + const centerLeftOffset = this._currentMeasure.left + leftWidth - 1; + const centerTopOffset = this._currentMeasure.top + topHeight - 1; + const rightOffset = this._currentMeasure.left + this._currentMeasure.width - rightWidth; + const bottomOffset = this._currentMeasure.top + this._currentMeasure.height - bottomHeight; + this._drawImage(context, sx, sy, leftWidth, topHeight, this._currentMeasure.left, this._currentMeasure.top, leftWidth, topHeight); + this._drawImage(context, sx + this._sliceLeft, sy, centerWidth, topHeight, centerLeftOffset + 1, this._currentMeasure.top, targetCenterWidth - 2, topHeight); + this._drawImage(context, sx + this._sliceRight, sy, rightWidth, topHeight, rightOffset, this._currentMeasure.top, rightWidth, topHeight); + this._drawImage(context, sx, sy + this._sliceTop, leftWidth, centerHeight, this._currentMeasure.left, centerTopOffset + 1, leftWidth, targetCenterHeight - 2); + this._drawImage(context, sx + this._sliceLeft, sy + this._sliceTop, centerWidth, centerHeight, centerLeftOffset, centerTopOffset, targetCenterWidth, targetCenterHeight); + this._drawImage(context, sx + this._sliceRight, sy + this._sliceTop, rightWidth, centerHeight, rightOffset, centerTopOffset + 1, rightWidth, targetCenterHeight - 2); + this._drawImage(context, sx, sy + this._sliceBottom, leftWidth, bottomHeight, this._currentMeasure.left, bottomOffset, leftWidth, bottomHeight); + this._drawImage(context, sx + this.sliceLeft, sy + this._sliceBottom, centerWidth, bottomHeight, centerLeftOffset + 1, bottomOffset, targetCenterWidth - 2, bottomHeight); + this._drawImage(context, sx + this._sliceRight, sy + this._sliceBottom, rightWidth, bottomHeight, rightOffset, bottomOffset, rightWidth, bottomHeight); + } + dispose() { + super.dispose(); + this.onImageLoadedObservable.clear(); + this.onSVGAttributesComputedObservable.clear(); + this._removeCacheUsage(this._source); + } +} +var init_image2 = __esm(() => { + init_tslib_es62(); + init_observable(); + init_tools(); + init_control2(); + init_typeStore(); + init_decorators(); + init_engineStore(); + Image4.SourceImgCache = new Map; + Image4.STRETCH_NONE = 0; + Image4.STRETCH_FILL = 1; + Image4.STRETCH_UNIFORM = 2; + Image4.STRETCH_EXTEND = 3; + Image4.STRETCH_NINE_PATCH = 4; + __decorate2([ + serialize() + ], Image4.prototype, "detectPointerOnOpaqueOnly", null); + __decorate2([ + serialize() + ], Image4.prototype, "sliceLeft", null); + __decorate2([ + serialize() + ], Image4.prototype, "sliceRight", null); + __decorate2([ + serialize() + ], Image4.prototype, "sliceTop", null); + __decorate2([ + serialize() + ], Image4.prototype, "sliceBottom", null); + __decorate2([ + serialize() + ], Image4.prototype, "sourceLeft", null); + __decorate2([ + serialize() + ], Image4.prototype, "sourceTop", null); + __decorate2([ + serialize() + ], Image4.prototype, "sourceWidth", null); + __decorate2([ + serialize() + ], Image4.prototype, "sourceHeight", null); + __decorate2([ + serialize() + ], Image4.prototype, "populateNinePatchSlicesFromImage", null); + __decorate2([ + serialize() + ], Image4.prototype, "autoScale", null); + __decorate2([ + serialize() + ], Image4.prototype, "stretch", null); + __decorate2([ + serialize() + ], Image4.prototype, "source", null); + __decorate2([ + serialize() + ], Image4.prototype, "cellWidth", null); + __decorate2([ + serialize() + ], Image4.prototype, "cellHeight", null); + __decorate2([ + serialize() + ], Image4.prototype, "cellId", null); + RegisterClass("BABYLON.GUI.Image", Image4); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/button.js +class Button3 extends Rectangle3 { + get image() { + return this._image; + } + get textBlock() { + return this._textBlock; + } + constructor(name335) { + super(name335); + this.name = name335; + this.delegatePickingToChildren = false; + this.thickness = 1; + this.isPointerBlocker = true; + let alphaStore = null; + this.pointerEnterAnimation = () => { + alphaStore = this.alpha; + this.alpha -= 0.1; + }; + this.pointerOutAnimation = () => { + if (alphaStore !== null) { + this.alpha = alphaStore; + } + }; + this.pointerDownAnimation = () => { + this.scaleX -= 0.05; + this.scaleY -= 0.05; + }; + this.pointerUpAnimation = () => { + this.scaleX += 0.05; + this.scaleY += 0.05; + }; + } + _getTypeName() { + return "Button"; + } + _processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) { + if (!this._isEnabled || !this.isHitTestVisible || !this.isVisible || this.notRenderable) { + return false; + } + if (!super.contains(x, y)) { + return false; + } + if (this.delegatePickingToChildren) { + let contains = false; + for (let index = this._children.length - 1;index >= 0; index--) { + const child = this._children[index]; + if (child.isEnabled && child.isHitTestVisible && child.isVisible && !child.notRenderable && child.contains(x, y)) { + contains = true; + break; + } + } + if (!contains) { + return false; + } + } + this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY); + return true; + } + _onPointerEnter(target, pi) { + if (!super._onPointerEnter(target, pi)) { + return false; + } + if (!this.isReadOnly && this.pointerEnterAnimation) { + this.pointerEnterAnimation(); + } + return true; + } + _onPointerOut(target, pi, force = false) { + if (!this.isReadOnly && this.pointerOutAnimation) { + this.pointerOutAnimation(); + } + super._onPointerOut(target, pi, force); + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { + return false; + } + if (!this.isReadOnly && this.pointerDownAnimation) { + this.pointerDownAnimation(); + } + return true; + } + _getRectangleFill(context) { + if (this.isEnabled) { + return this._getBackgroundColor(context); + } else { + return this._disabledColor; + } + } + _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi) { + if (!this.isReadOnly && this.pointerUpAnimation) { + this.pointerUpAnimation(); + } + super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi); + } + serialize(serializationObject) { + super.serialize(serializationObject); + if (this._textBlock) { + serializationObject.textBlockName = this._textBlock.name; + } + if (this._image) { + serializationObject.imageName = this._image.name; + } + } + _parseFromContent(serializedObject, host) { + super._parseFromContent(serializedObject, host); + if (serializedObject.textBlockName) { + this._textBlock = this.getChildByName(serializedObject.textBlockName); + } + if (serializedObject.imageName) { + this._image = this.getChildByName(serializedObject.imageName); + } + } + static CreateImageButton(name335, text, imageUrl) { + const result = new this(name335); + const textBlock24 = new TextBlock3(name335 + "_button", text); + textBlock24.textWrapping = true; + textBlock24.textHorizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_CENTER; + textBlock24.paddingLeft = "20%"; + result.addControl(textBlock24); + const iconImage = new Image4(name335 + "_icon", imageUrl); + iconImage.width = "20%"; + iconImage.stretch = Image4.STRETCH_UNIFORM; + iconImage.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + result.addControl(iconImage); + result._image = iconImage; + result._textBlock = textBlock24; + return result; + } + static CreateImageOnlyButton(name335, imageUrl) { + const result = new this(name335); + const iconImage = new Image4(name335 + "_icon", imageUrl); + iconImage.stretch = Image4.STRETCH_FILL; + iconImage.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + result.addControl(iconImage); + result._image = iconImage; + return result; + } + static CreateSimpleButton(name335, text) { + const result = new this(name335); + const textBlock24 = new TextBlock3(name335 + "_button", text); + textBlock24.textWrapping = true; + textBlock24.textHorizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_CENTER; + result.addControl(textBlock24); + result._textBlock = textBlock24; + return result; + } + static CreateImageWithCenterTextButton(name335, text, imageUrl) { + const result = new this(name335); + const iconImage = new Image4(name335 + "_icon", imageUrl); + iconImage.stretch = Image4.STRETCH_FILL; + result.addControl(iconImage); + const textBlock24 = new TextBlock3(name335 + "_button", text); + textBlock24.textWrapping = true; + textBlock24.textHorizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_CENTER; + result.addControl(textBlock24); + result._image = iconImage; + result._textBlock = textBlock24; + return result; + } +} +var init_button2 = __esm(() => { + init_rectangle2(); + init_control2(); + init_textBlock2(); + init_image2(); + init_typeStore(); + RegisterClass("BABYLON.GUI.Button", Button3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/stackPanel.js +class StackPanel3 extends Container3 { + get isVertical() { + return this._isVertical; + } + set isVertical(value) { + if (this._isVertical === value) { + return; + } + this._isVertical = value; + this._markAsDirty(); + } + get spacing() { + return this._spacing; + } + set spacing(value) { + if (this._spacing === value) { + return; + } + this._spacing = value; + this._markAsDirty(); + } + set width(value) { + if (!this._doNotTrackManualChanges) { + this._manualWidth = true; + } + if (this._width.toString(this._host) === value) { + return; + } + if (this._width.fromString(value)) { + this._markAsDirty(); + } + } + get width() { + return this._width.toString(this._host); + } + set height(value) { + if (!this._doNotTrackManualChanges) { + this._manualHeight = true; + } + if (this._height.toString(this._host) === value) { + return; + } + if (this._height.fromString(value)) { + this._markAsDirty(); + } + } + get height() { + return this._height.toString(this._host); + } + constructor(name335) { + super(name335); + this.name = name335; + this._isVertical = true; + this._manualWidth = false; + this._manualHeight = false; + this._doNotTrackManualChanges = false; + this._spacing = 0; + this.ignoreLayoutWarnings = false; + } + _getTypeName() { + return "StackPanel"; + } + _preMeasure(parentMeasure, context) { + for (const child of this._children) { + if (this._isVertical) { + child.verticalAlignment = Control3.VERTICAL_ALIGNMENT_TOP; + } else { + child.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + } + } + super._preMeasure(parentMeasure, context); + } + _additionalProcessing(parentMeasure, context) { + super._additionalProcessing(parentMeasure, context); + this._measureForChildren.copyFrom(parentMeasure); + this._measureForChildren.left = this._currentMeasure.left; + this._measureForChildren.top = this._currentMeasure.top; + if (!this.isVertical || this._manualWidth) { + this._measureForChildren.width = this._currentMeasure.width; + } + if (this.isVertical || this._manualHeight) { + this._measureForChildren.height = this._currentMeasure.height; + } + } + _postMeasure() { + let stackWidth = 0; + let stackHeight = 0; + const childrenCount = this._children.length; + for (let index = 0;index < childrenCount; index++) { + const child = this._children[index]; + if (!child.isVisible || child.notRenderable) { + continue; + } + if (this._isVertical) { + if (child.top !== stackHeight + "px") { + child.top = stackHeight + "px"; + this._rebuildLayout = true; + child._top.ignoreAdaptiveScaling = true; + } + if (!this.ignoreLayoutWarnings && !child.isDimensionFullyDefined("height")) { + Logger.Warn(`Control (Name:${child.name}, UniqueId:${child.uniqueId}) is using height in percentage mode inside a vertical StackPanel`, 1); + } else { + stackHeight += child._currentMeasure.height + child._paddingTopInPixels + child._paddingBottomInPixels + (index < childrenCount - 1 ? this._spacing : 0); + } + } else { + if (child.left !== stackWidth + "px") { + child.left = stackWidth + "px"; + this._rebuildLayout = true; + child._left.ignoreAdaptiveScaling = true; + } + if (!this.ignoreLayoutWarnings && !child.isDimensionFullyDefined("width")) { + Logger.Warn(`Control (Name:${child.name}, UniqueId:${child.uniqueId}) is using width in percentage mode inside a horizontal StackPanel`, 1); + } else { + stackWidth += child._currentMeasure.width + child._paddingLeftInPixels + child._paddingRightInPixels + (index < childrenCount - 1 ? this._spacing : 0); + } + } + } + stackWidth += this._paddingLeftInPixels + this._paddingRightInPixels; + stackHeight += this._paddingTopInPixels + this._paddingBottomInPixels; + this._doNotTrackManualChanges = true; + let panelWidthChanged = false; + let panelHeightChanged = false; + if ((!this._manualHeight || this.adaptHeightToChildren) && this._isVertical) { + const previousHeight = this.height; + this.height = stackHeight + "px"; + panelHeightChanged = previousHeight !== this.height || !this._height.ignoreAdaptiveScaling; + } + if ((!this._manualWidth || this.adaptWidthToChildren) && !this._isVertical) { + const previousWidth = this.width; + this.width = stackWidth + "px"; + panelWidthChanged = previousWidth !== this.width || !this._width.ignoreAdaptiveScaling; + } + if (panelHeightChanged) { + this._height.ignoreAdaptiveScaling = true; + } + if (panelWidthChanged) { + this._width.ignoreAdaptiveScaling = true; + } + this._doNotTrackManualChanges = false; + if (panelWidthChanged || panelHeightChanged) { + this._rebuildLayout = true; + } + super._postMeasure(); + } + _getManualDim(dim) { + if (dim === "width") { + return this._manualWidth; + } else { + return this._manualHeight; + } + } + isDimensionFullyDefined(dim) { + if (dim === "height" ? this.isVertical : !this.isVertical && !this._getManualDim(dim)) { + for (const child of this._children) { + if (!child.isDimensionFullyDefined(dim)) { + return false; + } + } + return true; + } + return this.getDimension(dim).isPixel || this._getAdaptDimTo(dim); + } + serialize(serializationObject) { + super.serialize(serializationObject); + serializationObject.manualWidth = this._manualWidth; + serializationObject.manualHeight = this._manualHeight; + } + _parseFromContent(serializedObject, host) { + this._manualWidth = serializedObject.manualWidth; + this._manualHeight = serializedObject.manualHeight; + super._parseFromContent(serializedObject, host); + } +} +var init_stackPanel2 = __esm(() => { + init_tslib_es62(); + init_container2(); + init_control2(); + init_typeStore(); + init_decorators(); + init_logger(); + __decorate2([ + serialize() + ], StackPanel3.prototype, "ignoreLayoutWarnings", undefined); + __decorate2([ + serialize() + ], StackPanel3.prototype, "isVertical", null); + __decorate2([ + serialize() + ], StackPanel3.prototype, "spacing", null); + __decorate2([ + serialize() + ], StackPanel3.prototype, "width", null); + __decorate2([ + serialize() + ], StackPanel3.prototype, "height", null); + RegisterClass("BABYLON.GUI.StackPanel", StackPanel3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/checkbox.js +class Checkbox3 extends Control3 { + get thickness() { + return this._thickness; + } + set thickness(value) { + if (this._thickness === value) { + return; + } + this._thickness = value; + this._markAsDirty(); + } + get checkSizeRatio() { + return this._checkSizeRatio; + } + set checkSizeRatio(value) { + value = Math.max(Math.min(1, value), 0); + if (this._checkSizeRatio === value) { + return; + } + this._checkSizeRatio = value; + this._markAsDirty(); + } + get background() { + return this._background; + } + set background(value) { + if (this._background === value) { + return; + } + this._background = value; + this._markAsDirty(); + } + get isChecked() { + return this._isChecked; + } + set isChecked(value) { + if (this._isChecked === value) { + return; + } + this._isChecked = value; + this._markAsDirty(); + this.onIsCheckedChangedObservable.notifyObservers(value); + } + constructor(name335) { + super(name335); + this.name = name335; + this._isChecked = false; + this._background = "black"; + this._checkSizeRatio = 0.8; + this._thickness = 1; + this.onIsCheckedChangedObservable = new Observable; + this.isPointerBlocker = true; + } + _getTypeName() { + return "Checkbox"; + } + _draw(context) { + context.save(); + this._applyStates(context); + const actualWidth = this._currentMeasure.width - this._thickness; + const actualHeight = this._currentMeasure.height - this._thickness; + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + context.fillStyle = this._isEnabled ? this._background : this._disabledColor; + context.fillRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, actualWidth, actualHeight); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + if (this._isChecked) { + context.fillStyle = this._isEnabled ? this.color : this._disabledColorItem; + const offsetWidth = actualWidth * this._checkSizeRatio; + const offsetHeight = actualHeight * this._checkSizeRatio; + context.fillRect(this._currentMeasure.left + this._thickness / 2 + (actualWidth - offsetWidth) / 2, this._currentMeasure.top + this._thickness / 2 + (actualHeight - offsetHeight) / 2, offsetWidth, offsetHeight); + } + context.strokeStyle = this.color; + context.lineWidth = this._thickness; + context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, actualWidth, actualHeight); + context.restore(); + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { + return false; + } + if (!this.isReadOnly) { + this.isChecked = !this.isChecked; + } + return true; + } + static AddCheckBoxWithHeader(title, onValueChanged) { + const panel = new StackPanel3; + panel.isVertical = false; + panel.height = "30px"; + const checkbox5 = new Checkbox3; + checkbox5.width = "20px"; + checkbox5.height = "20px"; + checkbox5.isChecked = true; + checkbox5.color = "green"; + checkbox5.onIsCheckedChangedObservable.add(onValueChanged); + panel.addControl(checkbox5); + const header = new TextBlock3; + header.text = title; + header.width = "180px"; + header.paddingLeft = "5px"; + header.textHorizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + header.color = "white"; + panel.addControl(header); + return panel; + } +} +var init_checkbox2 = __esm(() => { + init_tslib_es62(); + init_observable(); + init_control2(); + init_stackPanel2(); + init_textBlock2(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], Checkbox3.prototype, "thickness", null); + __decorate2([ + serialize() + ], Checkbox3.prototype, "checkSizeRatio", null); + __decorate2([ + serialize() + ], Checkbox3.prototype, "background", null); + __decorate2([ + serialize() + ], Checkbox3.prototype, "isChecked", null); + RegisterClass("BABYLON.GUI.Checkbox", Checkbox3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/textWrapper.js +class TextWrapper3 { + get text() { + return this._characters ? this._characters.join("") : this._text; + } + set text(txt) { + this._text = txt; + this._characters = Array.from && Array.from(txt); + } + get length() { + return this._characters ? this._characters.length : this._text.length; + } + removePart(idxStart, idxEnd, insertTxt) { + this._text = this._text.slice(0, idxStart) + (insertTxt ? insertTxt : "") + this._text.slice(idxEnd); + if (this._characters) { + const newCharacters = insertTxt ? Array.from(insertTxt) : []; + this._characters.splice(idxStart, idxEnd - idxStart, ...newCharacters); + } + } + charAt(idx) { + return this._characters ? this._characters[idx] : this._text.charAt(idx); + } + substr(from, length) { + if (this._characters) { + if (isNaN(from)) { + from = 0; + } else if (from >= 0) { + from = Math.min(from, this._characters.length); + } else { + from = this._characters.length + Math.max(from, -this._characters.length); + } + if (length === undefined) { + length = this._characters.length - from; + } else if (isNaN(length)) { + length = 0; + } else if (length < 0) { + length = 0; + } + const temp = []; + while (--length >= 0) { + temp[length] = this._characters[from + length]; + } + return temp.join(""); + } + return this._text.substr(from, length); + } + substring(from, to) { + if (this._characters) { + if (isNaN(from)) { + from = 0; + } else if (from > this._characters.length) { + from = this._characters.length; + } else if (from < 0) { + from = 0; + } + if (to === undefined) { + to = this._characters.length; + } else if (isNaN(to)) { + to = 0; + } else if (to > this._characters.length) { + to = this._characters.length; + } else if (to < 0) { + to = 0; + } + const temp = []; + let idx = 0; + while (from < to) { + temp[idx++] = this._characters[from++]; + } + return temp.join(""); + } + return this._text.substring(from, to); + } + isWord(index) { + const rWord = /\w/g; + return this._characters ? this._characters[index].search(rWord) !== -1 : this._text.search(rWord) !== -1; + } +} +var init_textWrapper2 = __esm(() => { +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/inputText.js +class InputText3 extends Control3 { + get maxWidth() { + return this._maxWidth.toString(this._host); + } + get maxWidthInPixels() { + return this._maxWidth.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set maxWidth(value) { + if (this._maxWidth.toString(this._host) === value) { + return; + } + if (this._maxWidth.fromString(value)) { + this._markAsDirty(); + } + } + get highligherOpacity() { + return this._highligherOpacity; + } + set highligherOpacity(value) { + if (this._highligherOpacity === value) { + return; + } + this._highligherOpacity = value; + this._markAsDirty(); + } + get onFocusSelectAll() { + return this._onFocusSelectAll; + } + set onFocusSelectAll(value) { + if (this._onFocusSelectAll === value) { + return; + } + this._onFocusSelectAll = value; + this._markAsDirty(); + } + get textHighlightColor() { + return this._textHighlightColor; + } + set textHighlightColor(value) { + if (this._textHighlightColor === value) { + return; + } + this._textHighlightColor = value; + this._markAsDirty(); + } + get margin() { + return this._margin.toString(this._host); + } + get marginInPixels() { + return this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set margin(value) { + if (this._margin.toString(this._host) === value) { + return; + } + if (this._margin.fromString(value)) { + this._markAsDirty(); + } + } + get autoStretchWidth() { + return this._autoStretchWidth; + } + set autoStretchWidth(value) { + if (this._autoStretchWidth === value) { + return; + } + this._autoStretchWidth = value; + this._markAsDirty(); + } + get thickness() { + return this._thickness; + } + set thickness(value) { + if (this._thickness === value) { + return; + } + this._thickness = value; + this._markAsDirty(); + } + get focusedBackground() { + return this._focusedBackground; + } + set focusedBackground(value) { + if (this._focusedBackground === value) { + return; + } + this._focusedBackground = value; + this._markAsDirty(); + } + get focusedColor() { + return this._focusedColor; + } + set focusedColor(value) { + if (this._focusedColor === value) { + return; + } + this._focusedColor = value; + this._markAsDirty(); + } + get background() { + return this._background; + } + set background(value) { + if (this._background === value) { + return; + } + this._background = value; + this._markAsDirty(); + } + get placeholderColor() { + return this._placeholderColor; + } + set placeholderColor(value) { + if (this._placeholderColor === value) { + return; + } + this._placeholderColor = value; + this._markAsDirty(); + } + get placeholderText() { + return this._placeholderText; + } + set placeholderText(value) { + if (this._placeholderText === value) { + return; + } + this._placeholderText = value; + this._markAsDirty(); + } + get deadKey() { + return this._deadKey; + } + set deadKey(flag) { + this._deadKey = flag; + } + get highlightedText() { + return this._highlightedText; + } + set highlightedText(text) { + if (this._highlightedText === text) { + return; + } + this._highlightedText = text; + this._markAsDirty(); + } + get addKey() { + return this._addKey; + } + set addKey(flag) { + this._addKey = flag; + } + get currentKey() { + return this._currentKey; + } + set currentKey(key) { + this._currentKey = key; + } + get text() { + return this._textWrapper.text; + } + set text(value) { + const valueAsString = value.toString(); + if (!this._textWrapper) { + this._textWrapper = new TextWrapper3; + } + if (this._textWrapper.text === valueAsString) { + return; + } + this._textWrapper.text = valueAsString; + this._textHasChanged(); + } + _textHasChanged() { + this._markAsDirty(); + this.onTextChangedObservable.notifyObservers(this); + } + get width() { + return this._width.toString(this._host); + } + set width(value) { + if (this._width.toString(this._host) === value) { + return; + } + if (this._width.fromString(value)) { + this._markAsDirty(); + } + this.autoStretchWidth = false; + } + constructor(name335, text = "") { + super(name335); + this.name = name335; + this._placeholderText = ""; + this._background = "#222222"; + this._focusedBackground = "#000000"; + this._focusedColor = "white"; + this._placeholderColor = "gray"; + this._thickness = 1; + this._margin = new ValueAndUnit3(10, ValueAndUnit3.UNITMODE_PIXEL); + this._autoStretchWidth = true; + this._maxWidth = new ValueAndUnit3(1, ValueAndUnit3.UNITMODE_PERCENTAGE, false); + this._isFocused = false; + this._blinkIsEven = false; + this._cursorOffset = 0; + this._deadKey = false; + this._addKey = true; + this._currentKey = ""; + this._isTextHighlightOn = false; + this._textHighlightColor = "#d5e0ff"; + this._highligherOpacity = 0.4; + this._highlightedText = ""; + this._startHighlightIndex = 0; + this._endHighlightIndex = 0; + this._cursorIndex = -1; + this._onFocusSelectAll = false; + this._isPointerDown = false; + this.promptMessage = "Please enter text:"; + this.disableMobilePrompt = false; + this.onTextChangedObservable = new Observable; + this.onBeforeKeyAddObservable = new Observable; + this.onFocusObservable = new Observable; + this.onBlurObservable = new Observable; + this.onTextHighlightObservable = new Observable; + this.onTextCopyObservable = new Observable; + this.onTextCutObservable = new Observable; + this.onTextPasteObservable = new Observable; + this.onKeyboardEventProcessedObservable = new Observable; + this.text = text; + this.isPointerBlocker = true; + } + onBlur() { + this._isFocused = false; + this._scrollLeft = null; + this._cursorOffset = 0; + clearTimeout(this._blinkTimeout); + this._markAsDirty(); + this.onBlurObservable.notifyObservers(this); + this._host.unRegisterClipboardEvents(); + if (this._onClipboardObserver) { + this._host.onClipboardObservable.remove(this._onClipboardObserver); + } + const scene50 = this._host.getScene(); + if (this._onPointerDblTapObserver && scene50) { + scene50.onPointerObservable.remove(this._onPointerDblTapObserver); + } + } + onFocus() { + if (!this._isEnabled) { + return; + } + this._scrollLeft = null; + this._isFocused = true; + this._blinkIsEven = false; + this._cursorOffset = 0; + this._markAsDirty(); + this.onFocusObservable.notifyObservers(this); + if (this._focusedBy === "touch" && !this.disableMobilePrompt) { + const value = prompt(this.promptMessage); + if (value !== null) { + this.text = value; + } + this._host.focusedControl = null; + return; + } + this._host.registerClipboardEvents(); + this._onClipboardObserver = this._host.onClipboardObservable.add((clipboardInfo) => { + switch (clipboardInfo.type) { + case ClipboardEventTypes.COPY: + this._onCopyText(clipboardInfo.event); + this.onTextCopyObservable.notifyObservers(this); + break; + case ClipboardEventTypes.CUT: + this._onCutText(clipboardInfo.event); + this.onTextCutObservable.notifyObservers(this); + break; + case ClipboardEventTypes.PASTE: + this._onPasteText(clipboardInfo.event); + this.onTextPasteObservable.notifyObservers(this); + break; + default: + return; + } + }); + const scene50 = this._host.getScene(); + if (scene50) { + this._onPointerDblTapObserver = scene50.onPointerObservable.add((pointerInfo) => { + if (!this._isFocused) { + return; + } + if (pointerInfo.type === PointerEventTypes.POINTERDOUBLETAP) { + this._processDblClick(pointerInfo); + } + }); + } + if (this._onFocusSelectAll) { + this._selectAllText(); + } + } + focus() { + this._host.moveFocusToControl(this); + } + blur() { + this._host.focusedControl = null; + } + _getTypeName() { + return "InputText"; + } + keepsFocusWith() { + if (!this._connectedVirtualKeyboard) { + return null; + } + return [this._connectedVirtualKeyboard]; + } + processKey(keyCode, key, evt) { + var _a; + if (this.isReadOnly) { + return; + } + if (evt && (evt.ctrlKey || evt.metaKey) && (keyCode === 67 || keyCode === 86 || keyCode === 88)) { + return; + } + if (evt && (evt.ctrlKey || evt.metaKey) && keyCode === 65) { + this._selectAllText(); + evt.preventDefault(); + return; + } + switch (keyCode) { + case 32: + key = " "; + break; + case 191: + if (evt) { + evt.preventDefault(); + } + break; + case 8: + if (this._textWrapper.text && this._textWrapper.length > 0) { + if (this.isTextHighlightOn) { + this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex); + this._textHasChanged(); + this.isTextHighlightOn = false; + this._cursorOffset = this._textWrapper.length - this._startHighlightIndex; + this._blinkIsEven = false; + if (evt) { + evt.preventDefault(); + } + return; + } + if (this._cursorOffset === 0) { + this.text = this._textWrapper.substr(0, this._textWrapper.length - 1); + } else { + const deletePosition = this._textWrapper.length - this._cursorOffset; + if (deletePosition > 0) { + this._textWrapper.removePart(deletePosition - 1, deletePosition); + this._textHasChanged(); + } + } + } + if (evt) { + evt.preventDefault(); + } + return; + case 46: + if (this.isTextHighlightOn) { + this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex); + this._textHasChanged(); + this.isTextHighlightOn = false; + this._cursorOffset = this._textWrapper.length - this._startHighlightIndex; + if (evt) { + evt.preventDefault(); + } + return; + } + if (this._textWrapper.text && this._textWrapper.length > 0 && this._cursorOffset > 0) { + const deletePosition = this._textWrapper.length - this._cursorOffset; + this._textWrapper.removePart(deletePosition, deletePosition + 1); + this._textHasChanged(); + this._cursorOffset--; + } + if (evt) { + evt.preventDefault(); + } + return; + case 13: + this._host.focusedControl = null; + this.isTextHighlightOn = false; + return; + case 35: + this._cursorOffset = 0; + this._blinkIsEven = false; + this.isTextHighlightOn = false; + this._markAsDirty(); + return; + case 36: + this._cursorOffset = this._textWrapper.length; + this._blinkIsEven = false; + this.isTextHighlightOn = false; + this._markAsDirty(); + return; + case 37: + this._cursorOffset++; + if (this._cursorOffset > this._textWrapper.length) { + this._cursorOffset = this._textWrapper.length; + } + if (evt && evt.shiftKey) { + this._blinkIsEven = false; + if (evt.ctrlKey || evt.metaKey) { + if (!this.isTextHighlightOn) { + if (this._textWrapper.length === this._cursorOffset) { + return; + } else { + this._endHighlightIndex = this._textWrapper.length - this._cursorOffset + 1; + } + } + this._startHighlightIndex = 0; + this._cursorIndex = this._textWrapper.length - this._endHighlightIndex; + this._cursorOffset = this._textWrapper.length; + this.isTextHighlightOn = true; + this._markAsDirty(); + return; + } + if (!this.isTextHighlightOn) { + this.isTextHighlightOn = true; + this._cursorIndex = this._cursorOffset >= this._textWrapper.length ? this._textWrapper.length : this._cursorOffset - 1; + } else if (this._cursorIndex === -1) { + this._cursorIndex = this._textWrapper.length - this._endHighlightIndex; + this._cursorOffset = this._startHighlightIndex === 0 ? this._textWrapper.length : this._textWrapper.length - this._startHighlightIndex + 1; + } + if (this._cursorIndex < this._cursorOffset) { + this._endHighlightIndex = this._textWrapper.length - this._cursorIndex; + this._startHighlightIndex = this._textWrapper.length - this._cursorOffset; + } else if (this._cursorIndex > this._cursorOffset) { + this._endHighlightIndex = this._textWrapper.length - this._cursorOffset; + this._startHighlightIndex = this._textWrapper.length - this._cursorIndex; + } else { + this.isTextHighlightOn = false; + } + this._markAsDirty(); + return; + } + if (this.isTextHighlightOn) { + this._cursorOffset = this._textWrapper.length - this._startHighlightIndex; + this.isTextHighlightOn = false; + } + if (evt && (evt.ctrlKey || evt.metaKey)) { + this._cursorOffset = this._textWrapper.length; + evt.preventDefault(); + } + this._blinkIsEven = false; + this.isTextHighlightOn = false; + this._cursorIndex = -1; + this._markAsDirty(); + return; + case 39: + this._cursorOffset--; + if (this._cursorOffset < 0) { + this._cursorOffset = 0; + } + if (evt && evt.shiftKey) { + this._blinkIsEven = false; + if (evt.ctrlKey || evt.metaKey) { + if (!this.isTextHighlightOn) { + if (this._cursorOffset === 0) { + return; + } else { + this._startHighlightIndex = this._textWrapper.length - this._cursorOffset - 1; + } + } + this._endHighlightIndex = this._textWrapper.length; + this.isTextHighlightOn = true; + this._cursorIndex = this._textWrapper.length - this._startHighlightIndex; + this._cursorOffset = 0; + this._markAsDirty(); + return; + } + if (!this.isTextHighlightOn) { + this.isTextHighlightOn = true; + this._cursorIndex = this._cursorOffset <= 0 ? 0 : this._cursorOffset + 1; + } else if (this._cursorIndex === -1) { + this._cursorIndex = this._textWrapper.length - this._startHighlightIndex; + this._cursorOffset = this._textWrapper.length === this._endHighlightIndex ? 0 : this._textWrapper.length - this._endHighlightIndex - 1; + } + if (this._cursorIndex < this._cursorOffset) { + this._endHighlightIndex = this._textWrapper.length - this._cursorIndex; + this._startHighlightIndex = this._textWrapper.length - this._cursorOffset; + } else if (this._cursorIndex > this._cursorOffset) { + this._endHighlightIndex = this._textWrapper.length - this._cursorOffset; + this._startHighlightIndex = this._textWrapper.length - this._cursorIndex; + } else { + this.isTextHighlightOn = false; + } + this._markAsDirty(); + return; + } + if (this.isTextHighlightOn) { + this._cursorOffset = this._textWrapper.length - this._endHighlightIndex; + this.isTextHighlightOn = false; + } + if (evt && (evt.ctrlKey || evt.metaKey)) { + this._cursorOffset = 0; + evt.preventDefault(); + } + this._blinkIsEven = false; + this.isTextHighlightOn = false; + this._cursorIndex = -1; + this._markAsDirty(); + return; + } + if (keyCode === 32) { + key = (_a = evt === null || evt === undefined ? undefined : evt.key) !== null && _a !== undefined ? _a : " "; + } + this._deadKey = key === "Dead"; + if (key && (keyCode === -1 || keyCode === 32 || keyCode === 34 || keyCode === 39 || keyCode > 47 && keyCode < 64 || keyCode > 64 && keyCode < 91 || keyCode > 159 && keyCode < 193 || keyCode > 218 && keyCode < 223 || keyCode > 95 && keyCode < 112)) { + this._currentKey = key; + this.onBeforeKeyAddObservable.notifyObservers(this); + key = this._currentKey; + if (this._addKey && !this._deadKey) { + if (this.isTextHighlightOn) { + this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex, key); + this._textHasChanged(); + this._cursorOffset = this._textWrapper.length - (this._startHighlightIndex + 1); + this.isTextHighlightOn = false; + this._blinkIsEven = false; + this._markAsDirty(); + } else if (this._cursorOffset === 0) { + this.text += this._deadKey && (evt === null || evt === undefined ? undefined : evt.key) ? evt.key : key; + } else { + const insertPosition = this._textWrapper.length - this._cursorOffset; + this._textWrapper.removePart(insertPosition, insertPosition, key); + this._textHasChanged(); + } + } + } + } + _updateValueFromCursorIndex(offset) { + this._blinkIsEven = false; + if (this._cursorIndex === -1) { + this._cursorIndex = offset; + } else { + if (this._cursorIndex < this._cursorOffset) { + this._endHighlightIndex = this._textWrapper.length - this._cursorIndex; + this._startHighlightIndex = this._textWrapper.length - this._cursorOffset; + } else if (this._cursorIndex > this._cursorOffset) { + this._endHighlightIndex = this._textWrapper.length - this._cursorOffset; + this._startHighlightIndex = this._textWrapper.length - this._cursorIndex; + } else { + this.isTextHighlightOn = false; + this._markAsDirty(); + return; + } + } + this.isTextHighlightOn = true; + this._markAsDirty(); + } + _processDblClick(evt) { + this._startHighlightIndex = this._textWrapper.length - this._cursorOffset; + this._endHighlightIndex = this._startHighlightIndex; + let moveLeft, moveRight; + do { + moveRight = this._endHighlightIndex < this._textWrapper.length && this._textWrapper.isWord(this._endHighlightIndex) ? ++this._endHighlightIndex : 0; + moveLeft = this._startHighlightIndex > 0 && this._textWrapper.isWord(this._startHighlightIndex - 1) ? --this._startHighlightIndex : 0; + } while (moveLeft || moveRight); + this._cursorOffset = this._textWrapper.length - this._startHighlightIndex; + this.isTextHighlightOn = true; + this._clickedCoordinate = null; + this._blinkIsEven = true; + this._cursorIndex = -1; + this._markAsDirty(); + } + _selectAllText() { + this._blinkIsEven = true; + this.isTextHighlightOn = true; + this._startHighlightIndex = 0; + this._endHighlightIndex = this._textWrapper.length; + this._cursorOffset = this._textWrapper.length; + this._cursorIndex = -1; + this._markAsDirty(); + } + processKeyboard(evt) { + this.processKey(evt.keyCode, evt.key, evt); + this.onKeyboardEventProcessedObservable.notifyObservers(evt); + } + _onCopyText(ev) { + this.isTextHighlightOn = false; + try { + ev.clipboardData && ev.clipboardData.setData("text/plain", this._highlightedText); + } catch (_a) { + } + this._host.clipboardData = this._highlightedText; + } + _onCutText(ev) { + if (!this._highlightedText) { + return; + } + this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex); + this._textHasChanged(); + this.isTextHighlightOn = false; + this._cursorOffset = this._textWrapper.length - this._startHighlightIndex; + try { + ev.clipboardData && ev.clipboardData.setData("text/plain", this._highlightedText); + } catch (_a) { + } + this._host.clipboardData = this._highlightedText; + this._highlightedText = ""; + } + _onPasteText(ev) { + let data = ""; + if (ev.clipboardData && ev.clipboardData.types.indexOf("text/plain") !== -1) { + data = ev.clipboardData.getData("text/plain"); + } else { + data = this._host.clipboardData; + } + const insertPosition = this._textWrapper.length - this._cursorOffset; + this._textWrapper.removePart(insertPosition, insertPosition, data); + this._textHasChanged(); + } + _draw(context) { + context.save(); + this._applyStates(context); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + if (this._isFocused) { + if (this._focusedBackground) { + context.fillStyle = this._isEnabled ? this._focusedBackground : this._disabledColor; + context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + } else if (this._background) { + context.fillStyle = this._isEnabled ? this._background : this._disabledColor; + context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + if (!this._fontOffset || this._wasDirty) { + this._fontOffset = Control3._GetFontOffset(context.font); + } + const clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, this._tempParentMeasure.width); + if (this.color) { + context.fillStyle = this.color; + } + let text = this._beforeRenderText(this._textWrapper); + if (!this._isFocused && !this._textWrapper.text && this._placeholderText) { + text = new TextWrapper3; + text.text = this._placeholderText; + if (this._placeholderColor) { + context.fillStyle = this._placeholderColor; + } + } + this._textWidth = context.measureText(text.text).width; + const marginWidth = this._margin.getValueInPixel(this._host, this._tempParentMeasure.width) * 2; + if (this._autoStretchWidth) { + this.width = Math.min(this._maxWidth.getValueInPixel(this._host, this._tempParentMeasure.width), this._textWidth + marginWidth) + "px"; + this._autoStretchWidth = true; + } + const rootY = this._fontOffset.ascent + (this._currentMeasure.height - this._fontOffset.height) / 2; + const availableWidth = this._width.getValueInPixel(this._host, this._tempParentMeasure.width) - marginWidth; + context.save(); + context.beginPath(); + context.rect(clipTextLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, availableWidth + 2, this._currentMeasure.height); + context.clip(); + if (this._isFocused && this._textWidth > availableWidth) { + const textLeft = clipTextLeft - this._textWidth + availableWidth; + if (!this._scrollLeft) { + this._scrollLeft = textLeft; + } + } else { + this._scrollLeft = clipTextLeft; + } + context.fillText(text.text, this._scrollLeft, this._currentMeasure.top + rootY); + if (this._isFocused) { + if (this._clickedCoordinate) { + const rightPosition = this._scrollLeft + this._textWidth; + const absoluteCursorPosition = rightPosition - this._clickedCoordinate; + let currentSize = 0; + this._cursorOffset = 0; + let previousDist = 0; + do { + if (this._cursorOffset) { + previousDist = Math.abs(absoluteCursorPosition - currentSize); + } + this._cursorOffset++; + currentSize = context.measureText(text.substr(text.length - this._cursorOffset, this._cursorOffset)).width; + } while (currentSize < absoluteCursorPosition && text.length >= this._cursorOffset); + if (Math.abs(absoluteCursorPosition - currentSize) > previousDist) { + this._cursorOffset--; + } + this._blinkIsEven = false; + this._clickedCoordinate = null; + } + if (!this._blinkIsEven) { + const cursorOffsetText = text.substr(text.length - this._cursorOffset); + const cursorOffsetWidth = context.measureText(cursorOffsetText).width; + let cursorLeft = this._scrollLeft + this._textWidth - cursorOffsetWidth; + if (cursorLeft < clipTextLeft) { + this._scrollLeft += clipTextLeft - cursorLeft; + cursorLeft = clipTextLeft; + this._markAsDirty(); + } else if (cursorLeft > clipTextLeft + availableWidth) { + this._scrollLeft += clipTextLeft + availableWidth - cursorLeft; + cursorLeft = clipTextLeft + availableWidth; + this._markAsDirty(); + } + if (!this.isTextHighlightOn) { + context.fillRect(cursorLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, 2, this._fontOffset.height); + } + } + clearTimeout(this._blinkTimeout); + this._blinkTimeout = setTimeout(() => { + this._blinkIsEven = !this._blinkIsEven; + this._markAsDirty(); + }, 500); + if (this.isTextHighlightOn) { + clearTimeout(this._blinkTimeout); + const highlightCursorOffsetWidth = context.measureText(text.substring(this._startHighlightIndex)).width; + let highlightCursorLeft = this._scrollLeft + this._textWidth - highlightCursorOffsetWidth; + this._highlightedText = text.substring(this._startHighlightIndex, this._endHighlightIndex); + let width = context.measureText(text.substring(this._startHighlightIndex, this._endHighlightIndex)).width; + if (highlightCursorLeft < clipTextLeft) { + width = width - (clipTextLeft - highlightCursorLeft); + if (!width) { + width = context.measureText(text.charAt(text.length - this._cursorOffset)).width; + } + highlightCursorLeft = clipTextLeft; + } + context.globalAlpha = this._highligherOpacity; + context.fillStyle = this._textHighlightColor; + context.fillRect(highlightCursorLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, width, this._fontOffset.height); + context.globalAlpha = 1; + } + } + context.restore(); + if (this._thickness) { + if (this._isFocused) { + if (this.focusedColor) { + context.strokeStyle = this.focusedColor; + } + } else { + if (this.color) { + context.strokeStyle = this.color; + } + } + context.lineWidth = this._thickness; + context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, this._currentMeasure.width - this._thickness, this._currentMeasure.height - this._thickness); + } + context.restore(); + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { + return false; + } + if (this.isReadOnly) { + return true; + } + this._clickedCoordinate = coordinates.x; + this.isTextHighlightOn = false; + this._highlightedText = ""; + this._cursorIndex = -1; + this._isPointerDown = true; + this._host._capturingControl[pointerId] = this; + this._focusedBy = pi.event.pointerType; + if (this._host.focusedControl === this) { + clearTimeout(this._blinkTimeout); + this._markAsDirty(); + return true; + } + if (!this._isEnabled) { + return false; + } + this._host.focusedControl = this; + return true; + } + _onPointerMove(target, coordinates, pointerId, pi) { + if (this._host.focusedControl === this && this._isPointerDown && !this.isReadOnly) { + this._clickedCoordinate = coordinates.x; + this._markAsDirty(); + this._updateValueFromCursorIndex(this._cursorOffset); + } + super._onPointerMove(target, coordinates, pointerId, pi); + } + _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick) { + this._isPointerDown = false; + delete this._host._capturingControl[pointerId]; + super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick); + } + _beforeRenderText(textWrapper8) { + return textWrapper8; + } + set isTextHighlightOn(value) { + if (this._isTextHighlightOn === value) { + return; + } + if (value) { + this.onTextHighlightObservable.notifyObservers(this); + } + this._isTextHighlightOn = value; + } + get isTextHighlightOn() { + return this._isTextHighlightOn; + } + dispose() { + super.dispose(); + this.onBlurObservable.clear(); + this.onFocusObservable.clear(); + this.onTextChangedObservable.clear(); + this.onTextCopyObservable.clear(); + this.onTextCutObservable.clear(); + this.onTextPasteObservable.clear(); + this.onTextHighlightObservable.clear(); + this.onKeyboardEventProcessedObservable.clear(); + } +} +var init_inputText2 = __esm(() => { + init_tslib_es62(); + init_observable(); + init_clipboardEvents(); + init_pointerEvents(); + init_control2(); + init_valueAndUnit2(); + init_typeStore(); + init_textWrapper2(); + init_decorators(); + __decorate2([ + serialize() + ], InputText3.prototype, "promptMessage", undefined); + __decorate2([ + serialize() + ], InputText3.prototype, "disableMobilePrompt", undefined); + __decorate2([ + serialize() + ], InputText3.prototype, "maxWidth", null); + __decorate2([ + serialize() + ], InputText3.prototype, "highligherOpacity", null); + __decorate2([ + serialize() + ], InputText3.prototype, "onFocusSelectAll", null); + __decorate2([ + serialize() + ], InputText3.prototype, "textHighlightColor", null); + __decorate2([ + serialize() + ], InputText3.prototype, "margin", null); + __decorate2([ + serialize() + ], InputText3.prototype, "autoStretchWidth", null); + __decorate2([ + serialize() + ], InputText3.prototype, "thickness", null); + __decorate2([ + serialize() + ], InputText3.prototype, "focusedBackground", null); + __decorate2([ + serialize() + ], InputText3.prototype, "focusedColor", null); + __decorate2([ + serialize() + ], InputText3.prototype, "background", null); + __decorate2([ + serialize() + ], InputText3.prototype, "placeholderColor", null); + __decorate2([ + serialize() + ], InputText3.prototype, "placeholderText", null); + __decorate2([ + serialize() + ], InputText3.prototype, "deadKey", null); + __decorate2([ + serialize() + ], InputText3.prototype, "text", null); + __decorate2([ + serialize() + ], InputText3.prototype, "width", null); + RegisterClass("BABYLON.GUI.InputText", InputText3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/grid.js +class Grid3 extends Container3 { + set clipContent(value) { + this._clipContent = value; + for (const key in this._cells) { + this._cells[key].clipContent = value; + } + } + get clipContent() { + return this._clipContent; + } + set clipChildren(value) { + this._clipChildren = value; + for (const key in this._cells) { + this._cells[key].clipChildren = value; + } + } + get clipChildren() { + return this._clipChildren; + } + get columnCount() { + return this._columnDefinitions.length; + } + get rowCount() { + return this._rowDefinitions.length; + } + get children() { + return this._childControls; + } + get cells() { + return this._cells; + } + getRowDefinition(index) { + if (index < 0 || index >= this._rowDefinitions.length) { + return null; + } + return this._rowDefinitions[index]; + } + getColumnDefinition(index) { + if (index < 0 || index >= this._columnDefinitions.length) { + return null; + } + return this._columnDefinitions[index]; + } + addRowDefinition(height, isPixel = false) { + this._rowDefinitions.push(new ValueAndUnit3(height, isPixel ? ValueAndUnit3.UNITMODE_PIXEL : ValueAndUnit3.UNITMODE_PERCENTAGE)); + this._rowDefinitionObservers.push(this._rowDefinitions[this.rowCount - 1].onChangedObservable.add(() => this._markAsDirty())); + this._markAsDirty(); + return this; + } + addColumnDefinition(width, isPixel = false) { + this._columnDefinitions.push(new ValueAndUnit3(width, isPixel ? ValueAndUnit3.UNITMODE_PIXEL : ValueAndUnit3.UNITMODE_PERCENTAGE)); + this._columnDefinitionObservers.push(this._columnDefinitions[this.columnCount - 1].onChangedObservable.add(() => this._markAsDirty())); + this._markAsDirty(); + return this; + } + setRowDefinition(index, height, isPixel = false) { + if (index < 0 || index >= this._rowDefinitions.length) { + return this; + } + const current = this._rowDefinitions[index]; + if (current && current.isPixel === isPixel && current.value === height) { + return this; + } + this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]); + this._rowDefinitions[index] = new ValueAndUnit3(height, isPixel ? ValueAndUnit3.UNITMODE_PIXEL : ValueAndUnit3.UNITMODE_PERCENTAGE); + this._rowDefinitionObservers[index] = this._rowDefinitions[index].onChangedObservable.add(() => this._markAsDirty()); + this._markAsDirty(); + return this; + } + setColumnDefinition(index, width, isPixel = false) { + if (index < 0 || index >= this._columnDefinitions.length) { + return this; + } + const current = this._columnDefinitions[index]; + if (current && current.isPixel === isPixel && current.value === width) { + return this; + } + this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]); + this._columnDefinitions[index] = new ValueAndUnit3(width, isPixel ? ValueAndUnit3.UNITMODE_PIXEL : ValueAndUnit3.UNITMODE_PERCENTAGE); + this._columnDefinitionObservers[index] = this._columnDefinitions[index].onChangedObservable.add(() => this._markAsDirty()); + this._markAsDirty(); + return this; + } + getChildrenAt(row, column) { + const cell2 = this._cells[`${row}:${column}`]; + if (!cell2) { + return null; + } + return cell2.children; + } + getChildCellInfo(child) { + return child._tag; + } + _removeCell(cell2, key) { + if (!cell2) { + return; + } + super.removeControl(cell2); + for (const control57 of cell2.children) { + const childIndex = this._childControls.indexOf(control57); + if (childIndex !== -1) { + this._childControls.splice(childIndex, 1); + } + } + delete this._cells[key]; + } + _offsetCell(previousKey, key) { + if (!this._cells[key]) { + return; + } + this._cells[previousKey] = this._cells[key]; + for (const control57 of this._cells[previousKey].children) { + control57._tag = previousKey; + } + delete this._cells[key]; + } + removeColumnDefinition(index) { + if (index < 0 || index >= this._columnDefinitions.length) { + return this; + } + for (let x = 0;x < this._rowDefinitions.length; x++) { + const key = `${x}:${index}`; + const cell2 = this._cells[key]; + this._removeCell(cell2, key); + } + for (let x = 0;x < this._rowDefinitions.length; x++) { + for (let y = index + 1;y < this._columnDefinitions.length; y++) { + const previousKey = `${x}:${y - 1}`; + const key = `${x}:${y}`; + this._offsetCell(previousKey, key); + } + } + this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]); + this._columnDefinitions.splice(index, 1); + this._columnDefinitionObservers.splice(index, 1); + this._markAsDirty(); + return this; + } + removeRowDefinition(index) { + if (index < 0 || index >= this._rowDefinitions.length) { + return this; + } + for (let y = 0;y < this._columnDefinitions.length; y++) { + const key = `${index}:${y}`; + const cell2 = this._cells[key]; + this._removeCell(cell2, key); + } + for (let y = 0;y < this._columnDefinitions.length; y++) { + for (let x = index + 1;x < this._rowDefinitions.length; x++) { + const previousKey = `${x - 1}:${y}`; + const key = `${x}:${y}`; + this._offsetCell(previousKey, key); + } + } + this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]); + this._rowDefinitions.splice(index, 1); + this._rowDefinitionObservers.splice(index, 1); + this._markAsDirty(); + return this; + } + addControl(control57, row = 0, column = 0) { + if (this._rowDefinitions.length === 0) { + this.addRowDefinition(1, false); + } + if (this._columnDefinitions.length === 0) { + this.addColumnDefinition(1, false); + } + if (this._childControls.indexOf(control57) !== -1) { + Tools.Warn(`Control (Name:${control57.name}, UniqueId:${control57.uniqueId}) is already associated with this grid. You must remove it before reattaching it`); + return this; + } + const x = Math.min(row, this._rowDefinitions.length - 1); + const y = Math.min(column, this._columnDefinitions.length - 1); + const key = `${x}:${y}`; + let goodContainer = this._cells[key]; + if (!goodContainer) { + goodContainer = new Container3(key); + this._cells[key] = goodContainer; + goodContainer.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + goodContainer.verticalAlignment = Control3.VERTICAL_ALIGNMENT_TOP; + goodContainer.clipContent = this.clipContent; + goodContainer.clipChildren = this.clipChildren; + super.addControl(goodContainer); + } + goodContainer.addControl(control57); + this._childControls.push(control57); + control57._tag = key; + control57.parent = this; + this._markAsDirty(); + return this; + } + removeControl(control57) { + const index = this._childControls.indexOf(control57); + if (index !== -1) { + this._childControls.splice(index, 1); + } + const cell2 = this._cells[control57._tag]; + if (cell2) { + cell2.removeControl(control57); + control57._tag = null; + } + this._markAsDirty(); + return this; + } + constructor(name335) { + super(name335); + this.name = name335; + this._rowDefinitions = new Array; + this._rowDefinitionObservers = []; + this._columnDefinitions = new Array; + this._columnDefinitionObservers = []; + this._cells = {}; + this._childControls = new Array; + } + _getTypeName() { + return "Grid"; + } + _getGridDefinitions(definitionCallback) { + const widths = []; + const heights = []; + const lefts = []; + const tops = []; + let availableWidth = this._currentMeasure.width; + let globalWidthPercentage = 0; + let availableHeight = this._currentMeasure.height; + let globalHeightPercentage = 0; + let index = 0; + for (const rowDefinition of this._rowDefinitions) { + if (rowDefinition.isPixel) { + const height = rowDefinition.getValue(this._host); + availableHeight -= height; + heights[index] = height; + } else { + globalHeightPercentage += rowDefinition.value; + } + index++; + } + let top = 0; + index = 0; + for (const rowDefinition of this._rowDefinitions) { + tops.push(top); + if (!rowDefinition.isPixel) { + const height = Math.round(rowDefinition.value / globalHeightPercentage * availableHeight); + top += height; + heights[index] = height; + } else { + top += rowDefinition.getValue(this._host); + } + index++; + } + index = 0; + for (const columnDefinition of this._columnDefinitions) { + if (columnDefinition.isPixel) { + const width = columnDefinition.getValue(this._host); + availableWidth -= width; + widths[index] = width; + } else { + globalWidthPercentage += columnDefinition.value; + } + index++; + } + let left = 0; + index = 0; + for (const columnDefinition of this._columnDefinitions) { + lefts.push(left); + if (!columnDefinition.isPixel) { + const width = Math.round(columnDefinition.value / globalWidthPercentage * availableWidth); + left += width; + widths[index] = width; + } else { + left += columnDefinition.getValue(this._host); + } + index++; + } + definitionCallback(lefts, tops, widths, heights); + } + _additionalProcessing(parentMeasure, context) { + this._getGridDefinitions((lefts, tops, widths, heights) => { + for (const key in this._cells) { + if (!Object.prototype.hasOwnProperty.call(this._cells, key)) { + continue; + } + const split = key.split(":"); + const x = parseInt(split[0]); + const y = parseInt(split[1]); + const cell2 = this._cells[key]; + cell2.leftInPixels = lefts[y]; + cell2.topInPixels = tops[x]; + cell2.widthInPixels = widths[y]; + cell2.heightInPixels = heights[x]; + cell2._left.ignoreAdaptiveScaling = true; + cell2._top.ignoreAdaptiveScaling = true; + cell2._width.ignoreAdaptiveScaling = true; + cell2._height.ignoreAdaptiveScaling = true; + } + }); + super._additionalProcessing(parentMeasure, context); + } + _flagDescendantsAsMatrixDirty() { + for (const key in this._cells) { + if (!Object.prototype.hasOwnProperty.call(this._cells, key)) { + continue; + } + const child = this._cells[key]; + child._markMatrixAsDirty(); + } + } + _renderHighlightSpecific(context) { + super._renderHighlightSpecific(context); + this._getGridDefinitions((lefts, tops, widths, heights) => { + for (let index = 0;index < lefts.length; index++) { + const left = this._currentMeasure.left + lefts[index] + widths[index]; + context.beginPath(); + context.moveTo(left, this._currentMeasure.top); + context.lineTo(left, this._currentMeasure.top + this._currentMeasure.height); + context.stroke(); + } + for (let index = 0;index < tops.length; index++) { + const top = this._currentMeasure.top + tops[index] + heights[index]; + context.beginPath(); + context.moveTo(this._currentMeasure.left, top); + context.lineTo(this._currentMeasure.left + this._currentMeasure.width, top); + context.stroke(); + } + }); + context.restore(); + } + dispose() { + super.dispose(); + for (const control57 of this._childControls) { + control57.dispose(); + } + for (let index = 0;index < this._rowDefinitions.length; index++) { + this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]); + } + for (let index = 0;index < this._columnDefinitions.length; index++) { + this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]); + } + this._rowDefinitionObservers.length = 0; + this._rowDefinitions.length = 0; + this._columnDefinitionObservers.length = 0; + this._columnDefinitions.length = 0; + this._cells = {}; + this._childControls.length = 0; + } + serialize(serializationObject) { + super.serialize(serializationObject); + serializationObject.columnCount = this.columnCount; + serializationObject.rowCount = this.rowCount; + serializationObject.columns = []; + serializationObject.rows = []; + serializationObject.tags = []; + for (let i = 0;i < this.columnCount; ++i) { + const cd = this.getColumnDefinition(i); + const childSerializationObject = { value: cd === null || cd === undefined ? undefined : cd.getValue(this.host), unit: cd === null || cd === undefined ? undefined : cd.unit }; + serializationObject.columns.push(childSerializationObject); + } + for (let i = 0;i < this.rowCount; ++i) { + const rd = this.getRowDefinition(i); + const childSerializationObject = { value: rd === null || rd === undefined ? undefined : rd.getValue(this.host), unit: rd === null || rd === undefined ? undefined : rd.unit }; + serializationObject.rows.push(childSerializationObject); + } + this.children.forEach((child) => { + serializationObject.tags.push(child._tag); + }); + } + _parseFromContent(serializedObject, host) { + super._parseFromContent(serializedObject, host); + const children = []; + this.children.forEach((child) => { + children.push(child); + }); + this.removeRowDefinition(0); + this.removeColumnDefinition(0); + for (let i = 0;i < serializedObject.columnCount; ++i) { + const columnValue = serializedObject.columns[i].value; + const unit = serializedObject.columns[i].unit; + this.addColumnDefinition(columnValue, unit === 1 ? true : false); + } + for (let i = 0;i < serializedObject.rowCount; ++i) { + const rowValue = serializedObject.rows[i].value; + const unit = serializedObject.rows[i].unit; + this.addRowDefinition(rowValue, unit === 1 ? true : false); + } + for (let i = 0;i < children.length; ++i) { + const cellInfo = serializedObject.tags[i]; + let rowNumber = parseInt(cellInfo.substring(0, cellInfo.search(":"))); + if (isNaN(rowNumber)) { + rowNumber = 0; + } + let columnNumber = parseInt(cellInfo.substring(cellInfo.search(":") + 1)); + if (isNaN(columnNumber)) { + columnNumber = 0; + } + this.addControl(children[i], rowNumber, columnNumber); + } + } +} +var init_grid3 = __esm(() => { + init_tslib_es62(); + init_container2(); + init_valueAndUnit2(); + init_control2(); + init_tools(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], Grid3.prototype, "clipContent", null); + RegisterClass("BABYLON.GUI.Grid", Grid3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/colorpicker.js +class ColorPicker3 extends Control3 { + get value() { + return this._value; + } + set value(value) { + if (this._value.equals(value)) { + return; + } + this._value.copyFrom(value); + this._value.toHSVToRef(this._tmpColor); + this._h = this._tmpColor.r; + this._s = Math.max(this._tmpColor.g, 0.00001); + this._v = Math.max(this._tmpColor.b, 0.00001); + this._markAsDirty(); + if (this._value.r <= ColorPicker3._Epsilon) { + this._value.r = 0; + } + if (this._value.g <= ColorPicker3._Epsilon) { + this._value.g = 0; + } + if (this._value.b <= ColorPicker3._Epsilon) { + this._value.b = 0; + } + if (this._value.r >= 1 - ColorPicker3._Epsilon) { + this._value.r = 1; + } + if (this._value.g >= 1 - ColorPicker3._Epsilon) { + this._value.g = 1; + } + if (this._value.b >= 1 - ColorPicker3._Epsilon) { + this._value.b = 1; + } + this.onValueChangedObservable.notifyObservers(this._value); + } + get width() { + return this._width.toString(this._host); + } + set width(value) { + if (this._width.toString(this._host) === value) { + return; + } + if (this._width.fromString(value)) { + if (this._width.getValue(this._host) === 0) { + value = "1px"; + this._width.fromString(value); + } + this._height.fromString(value); + this._markAsDirty(); + } + } + get height() { + return this._height.toString(this._host); + } + set height(value) { + if (this._height.toString(this._host) === value) { + return; + } + if (this._height.fromString(value)) { + if (this._height.getValue(this._host) === 0) { + value = "1px"; + this._height.fromString(value); + } + this._width.fromString(value); + this._markAsDirty(); + } + } + get size() { + return this.width; + } + set size(value) { + this.width = value; + } + constructor(name335) { + super(name335); + this.name = name335; + this._value = Color3.Red(); + this._tmpColor = new Color3; + this._pointerStartedOnSquare = false; + this._pointerStartedOnWheel = false; + this._squareLeft = 0; + this._squareTop = 0; + this._squareSize = 0; + this._h = 360; + this._s = 1; + this._v = 1; + this._lastPointerDownId = -1; + this.onValueChangedObservable = new Observable; + this._pointerIsDown = false; + this.value = new Color3(0.88, 0.1, 0.1); + this.size = "200px"; + this.isPointerBlocker = true; + } + _getTypeName() { + return "ColorPicker"; + } + _preMeasure(parentMeasure) { + if (parentMeasure.width < parentMeasure.height) { + this._currentMeasure.height = parentMeasure.width; + } else { + this._currentMeasure.width = parentMeasure.height; + } + } + _updateSquareProps() { + const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5; + const wheelThickness = radius * 0.2; + const innerDiameter = (radius - wheelThickness) * 2; + const squareSize = innerDiameter / Math.sqrt(2); + const offset = radius - squareSize * 0.5; + this._squareLeft = this._currentMeasure.left + offset; + this._squareTop = this._currentMeasure.top + offset; + this._squareSize = squareSize; + } + _drawGradientSquare(hueValue, left, top, width, height, context) { + const lgh = context.createLinearGradient(left, top, width + left, top); + lgh.addColorStop(0, "#fff"); + lgh.addColorStop(1, "hsl(" + hueValue + ", 100%, 50%)"); + context.fillStyle = lgh; + context.fillRect(left, top, width, height); + const lgv = context.createLinearGradient(left, top, left, height + top); + lgv.addColorStop(0, "rgba(0,0,0,0)"); + lgv.addColorStop(1, "#000"); + context.fillStyle = lgv; + context.fillRect(left, top, width, height); + } + _drawCircle(centerX, centerY, radius, context) { + context.beginPath(); + context.arc(centerX, centerY, radius + 1, 0, 2 * Math.PI, false); + context.lineWidth = 3; + context.strokeStyle = "#333333"; + context.stroke(); + context.beginPath(); + context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false); + context.lineWidth = 3; + context.strokeStyle = "#ffffff"; + context.stroke(); + } + _createColorWheelCanvas(radius, thickness) { + const engine47 = EngineStore.LastCreatedEngine; + if (!engine47) { + throw new Error("Invalid engine. Unable to create a canvas."); + } + const canvas = engine47.createCanvas(radius * 2, radius * 2); + const context = canvas.getContext("2d"); + const image14 = context.getImageData(0, 0, radius * 2, radius * 2); + const data = image14.data; + const color = this._tmpColor; + const maxDistSq = radius * radius; + const innerRadius = radius - thickness; + const minDistSq = innerRadius * innerRadius; + for (let x = -radius;x < radius; x++) { + for (let y = -radius;y < radius; y++) { + const distSq = x * x + y * y; + if (distSq > maxDistSq || distSq < minDistSq) { + continue; + } + const dist = Math.sqrt(distSq); + const ang = Math.atan2(y, x); + Color3.HSVtoRGBToRef(ang * 180 / Math.PI + 180, dist / radius, 1, color); + const index = (x + radius + (y + radius) * 2 * radius) * 4; + data[index] = color.r * 255; + data[index + 1] = color.g * 255; + data[index + 2] = color.b * 255; + let alphaRatio = (dist - innerRadius) / (radius - innerRadius); + let alphaAmount = 0.2; + const maxAlpha = 0.2; + const minAlpha = 0.04; + const lowerRadius = 50; + const upperRadius = 150; + if (radius < lowerRadius) { + alphaAmount = maxAlpha; + } else if (radius > upperRadius) { + alphaAmount = minAlpha; + } else { + alphaAmount = (minAlpha - maxAlpha) * (radius - lowerRadius) / (upperRadius - lowerRadius) + maxAlpha; + } + alphaRatio = (dist - innerRadius) / (radius - innerRadius); + if (alphaRatio < alphaAmount) { + data[index + 3] = 255 * (alphaRatio / alphaAmount); + } else if (alphaRatio > 1 - alphaAmount) { + data[index + 3] = 255 * (1 - (alphaRatio - (1 - alphaAmount)) / alphaAmount); + } else { + data[index + 3] = 255; + } + } + } + context.putImageData(image14, 0, 0); + return canvas; + } + _draw(context) { + context.save(); + this._applyStates(context); + const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5; + const wheelThickness = radius * 0.2; + const left = this._currentMeasure.left; + const top = this._currentMeasure.top; + if (!this._colorWheelCanvas || this._colorWheelCanvas.width != radius * 2) { + this._colorWheelCanvas = this._createColorWheelCanvas(radius, wheelThickness); + } + this._updateSquareProps(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + context.fillRect(this._squareLeft, this._squareTop, this._squareSize, this._squareSize); + } + context.drawImage(this._colorWheelCanvas, left, top); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + this._drawGradientSquare(this._h, this._squareLeft, this._squareTop, this._squareSize, this._squareSize, context); + let cx = this._squareLeft + this._squareSize * this._s; + let cy = this._squareTop + this._squareSize * (1 - this._v); + this._drawCircle(cx, cy, radius * 0.04, context); + const dist = radius - wheelThickness * 0.5; + cx = left + radius + Math.cos((this._h - 180) * Math.PI / 180) * dist; + cy = top + radius + Math.sin((this._h - 180) * Math.PI / 180) * dist; + this._drawCircle(cx, cy, wheelThickness * 0.35, context); + context.restore(); + } + _updateValueFromPointer(x, y) { + if (this._pointerStartedOnWheel) { + const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5; + const centerX = radius + this._currentMeasure.left; + const centerY = radius + this._currentMeasure.top; + this._h = Math.atan2(y - centerY, x - centerX) * 180 / Math.PI + 180; + } else if (this._pointerStartedOnSquare) { + this._updateSquareProps(); + this._s = (x - this._squareLeft) / this._squareSize; + this._v = 1 - (y - this._squareTop) / this._squareSize; + this._s = Math.min(this._s, 1); + this._s = Math.max(this._s, ColorPicker3._Epsilon); + this._v = Math.min(this._v, 1); + this._v = Math.max(this._v, ColorPicker3._Epsilon); + } + Color3.HSVtoRGBToRef(this._h, this._s, this._v, this._tmpColor); + this.value = this._tmpColor; + } + _isPointOnSquare(x, y) { + this._updateSquareProps(); + const left = this._squareLeft; + const top = this._squareTop; + const size = this._squareSize; + if (x >= left && x <= left + size && y >= top && y <= top + size) { + return true; + } + return false; + } + _isPointOnWheel(x, y) { + const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5; + const centerX = radius + this._currentMeasure.left; + const centerY = radius + this._currentMeasure.top; + const wheelThickness = radius * 0.2; + const innerRadius = radius - wheelThickness; + const radiusSq = radius * radius; + const innerRadiusSq = innerRadius * innerRadius; + const dx = x - centerX; + const dy = y - centerY; + const distSq = dx * dx + dy * dy; + if (distSq <= radiusSq && distSq >= innerRadiusSq) { + return true; + } + return false; + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { + return false; + } + if (this.isReadOnly) { + return true; + } + this._pointerIsDown = true; + this._pointerStartedOnSquare = false; + this._pointerStartedOnWheel = false; + this._invertTransformMatrix.transformCoordinates(coordinates.x, coordinates.y, this._transformedPosition); + const x = this._transformedPosition.x; + const y = this._transformedPosition.y; + if (this._isPointOnSquare(x, y)) { + this._pointerStartedOnSquare = true; + } else if (this._isPointOnWheel(x, y)) { + this._pointerStartedOnWheel = true; + } + this._updateValueFromPointer(x, y); + this._host._capturingControl[pointerId] = this; + this._lastPointerDownId = pointerId; + return true; + } + _onPointerMove(target, coordinates, pointerId, pi) { + if (pointerId != this._lastPointerDownId) { + return; + } + if (!this.isReadOnly) { + this._invertTransformMatrix.transformCoordinates(coordinates.x, coordinates.y, this._transformedPosition); + const x = this._transformedPosition.x; + const y = this._transformedPosition.y; + if (this._pointerIsDown) { + this._updateValueFromPointer(x, y); + } + } + super._onPointerMove(target, coordinates, pointerId, pi); + } + _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi) { + this._pointerIsDown = false; + delete this._host._capturingControl[pointerId]; + super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi); + } + _onCanvasBlur() { + this._forcePointerUp(); + super._onCanvasBlur(); + } + static ShowPickerDialogAsync(advancedTexture, options) { + return new Promise((resolve) => { + options.pickerWidth = options.pickerWidth || "640px"; + options.pickerHeight = options.pickerHeight || "400px"; + options.headerHeight = options.headerHeight || "35px"; + options.lastColor = options.lastColor || "#000000"; + options.swatchLimit = options.swatchLimit || 20; + options.numSwatchesPerLine = options.numSwatchesPerLine || 10; + const drawerMaxRows = options.swatchLimit / options.numSwatchesPerLine; + const rawSwatchSize = parseFloat(options.pickerWidth) / options.numSwatchesPerLine; + const gutterSize = Math.floor(rawSwatchSize * 0.25); + const colGutters = gutterSize * (options.numSwatchesPerLine + 1); + const swatchSize = Math.floor((parseFloat(options.pickerWidth) - colGutters) / options.numSwatchesPerLine); + const drawerMaxSize = swatchSize * drawerMaxRows + gutterSize * (drawerMaxRows + 1); + const containerSize = (parseInt(options.pickerHeight) + drawerMaxSize + Math.floor(swatchSize * 0.25)).toString() + "px"; + const buttonColor = "#c0c0c0"; + const buttonBackgroundColor = "#535353"; + const buttonBackgroundHoverColor = "#414141"; + const buttonBackgroundClickColor = "515151"; + const buttonDisabledColor = "#555555"; + const buttonDisabledBackgroundColor = "#454545"; + const currentSwatchesOutlineColor = "#404040"; + const luminanceLimitColor = Color3.FromHexString("#dddddd"); + const luminanceLimit = luminanceLimitColor.r + luminanceLimitColor.g + luminanceLimitColor.b; + const iconColorDark = "#aaaaaa"; + const iconColorLight = "#ffffff"; + let buttonFontSize; + let butEdit; + const inputFieldLabels = ["R", "G", "B"]; + const inputTextBackgroundColor = "#454545"; + const inputTextColor = "#f0f0f0"; + let swatchNumber; + let swatchDrawer; + let editSwatchMode = false; + let butSave; + let lastVal; + let activeField; + const dialogContainer = new Grid3; + dialogContainer.name = "Dialog Container"; + dialogContainer.width = options.pickerWidth; + if (options.savedColors) { + dialogContainer.height = containerSize; + const topRow = parseInt(options.pickerHeight) / parseInt(containerSize); + dialogContainer.addRowDefinition(topRow, false); + dialogContainer.addRowDefinition(1 - topRow, false); + } else { + dialogContainer.height = options.pickerHeight; + dialogContainer.addRowDefinition(1, false); + } + advancedTexture.addControl(dialogContainer); + if (options.savedColors) { + swatchDrawer = new Grid3; + swatchDrawer.name = "Swatch Drawer"; + swatchDrawer.verticalAlignment = Control3.VERTICAL_ALIGNMENT_TOP; + swatchDrawer.background = buttonBackgroundColor; + swatchDrawer.width = options.pickerWidth; + const initialRows = options.savedColors.length / options.numSwatchesPerLine; + let gutterCount; + if (initialRows == 0) { + gutterCount = 0; + } else { + gutterCount = initialRows + 1; + } + swatchDrawer.height = (swatchSize * initialRows + gutterCount * gutterSize).toString() + "px"; + swatchDrawer.top = Math.floor(swatchSize * 0.25).toString() + "px"; + for (let i = 0;i < Math.ceil(options.savedColors.length / options.numSwatchesPerLine) * 2 + 1; i++) { + if (i % 2 != 0) { + swatchDrawer.addRowDefinition(swatchSize, true); + } else { + swatchDrawer.addRowDefinition(gutterSize, true); + } + } + for (let i = 0;i < options.numSwatchesPerLine * 2 + 1; i++) { + if (i % 2 != 0) { + swatchDrawer.addColumnDefinition(swatchSize, true); + } else { + swatchDrawer.addColumnDefinition(gutterSize, true); + } + } + dialogContainer.addControl(swatchDrawer, 1, 0); + } + const pickerPanel = new Grid3; + pickerPanel.name = "Picker Panel"; + pickerPanel.height = options.pickerHeight; + const panelHead = parseInt(options.headerHeight) / parseInt(options.pickerHeight); + const pickerPanelRows = [panelHead, 1 - panelHead]; + pickerPanel.addRowDefinition(pickerPanelRows[0], false); + pickerPanel.addRowDefinition(pickerPanelRows[1], false); + dialogContainer.addControl(pickerPanel, 0, 0); + const header = new Rectangle3; + header.name = "Dialogue Header Bar"; + header.background = "#cccccc"; + header.thickness = 0; + pickerPanel.addControl(header, 0, 0); + const closeButton = Button3.CreateSimpleButton("closeButton", "a"); + closeButton.fontFamily = "coreglyphs"; + const headerColor3 = Color3.FromHexString(header.background); + const closeIconColor = new Color3(1 - headerColor3.r, 1 - headerColor3.g, 1 - headerColor3.b); + closeButton.color = closeIconColor.toHexString(); + closeButton.fontSize = Math.floor(parseInt(options.headerHeight) * 0.6); + closeButton.textBlock.textVerticalAlignment = Control3.VERTICAL_ALIGNMENT_CENTER; + closeButton.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_RIGHT; + closeButton.height = closeButton.width = options.headerHeight; + closeButton.background = header.background; + closeButton.thickness = 0; + closeButton.pointerDownAnimation = () => { + }; + closeButton.pointerUpAnimation = () => { + closeButton.background = header.background; + }; + closeButton.pointerEnterAnimation = () => { + closeButton.color = header.background; + closeButton.background = "red"; + }; + closeButton.pointerOutAnimation = () => { + closeButton.color = closeIconColor.toHexString(); + closeButton.background = header.background; + }; + closeButton.onPointerClickObservable.add(() => { + closePicker(currentSwatch.background); + }); + pickerPanel.addControl(closeButton, 0, 0); + const dialogBody = new Grid3; + dialogBody.name = "Dialogue Body"; + dialogBody.background = buttonBackgroundColor; + const dialogBodyCols = [0.4375, 0.5625]; + dialogBody.addRowDefinition(1, false); + dialogBody.addColumnDefinition(dialogBodyCols[0], false); + dialogBody.addColumnDefinition(dialogBodyCols[1], false); + pickerPanel.addControl(dialogBody, 1, 0); + const pickerGrid = new Grid3; + pickerGrid.name = "Picker Grid"; + pickerGrid.addRowDefinition(0.85, false); + pickerGrid.addRowDefinition(0.15, false); + dialogBody.addControl(pickerGrid, 0, 0); + const picker = new ColorPicker3; + picker.name = "GUI Color Picker"; + if (options.pickerHeight < options.pickerWidth) { + picker.width = 0.89; + } else { + picker.height = 0.89; + } + picker.value = Color3.FromHexString(options.lastColor); + picker.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_CENTER; + picker.verticalAlignment = Control3.VERTICAL_ALIGNMENT_CENTER; + picker.onPointerDownObservable.add(() => { + activeField = picker.name; + lastVal = ""; + editSwatches(false); + }); + picker.onValueChangedObservable.add(function(value) { + if (activeField == picker.name) { + updateValues(value, picker.name); + } + }); + pickerGrid.addControl(picker, 0, 0); + const pickerBodyRight = new Grid3; + pickerBodyRight.name = "Dialogue Right Half"; + pickerBodyRight.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + const pickerBodyRightRows = [0.514, 0.486]; + pickerBodyRight.addRowDefinition(pickerBodyRightRows[0], false); + pickerBodyRight.addRowDefinition(pickerBodyRightRows[1], false); + dialogBody.addControl(pickerBodyRight, 1, 1); + const pickerSwatchesButtons = new Grid3; + pickerSwatchesButtons.name = "Swatches and Buttons"; + const pickerButtonsCol = [0.417, 0.583]; + pickerSwatchesButtons.addRowDefinition(1, false); + pickerSwatchesButtons.addColumnDefinition(pickerButtonsCol[0], false); + pickerSwatchesButtons.addColumnDefinition(pickerButtonsCol[1], false); + pickerBodyRight.addControl(pickerSwatchesButtons, 0, 0); + const pickerSwatches = new Grid3; + pickerSwatches.name = "New and Current Swatches"; + const pickeSwatchesRows = [0.04, 0.16, 0.64, 0.16]; + pickerSwatches.addRowDefinition(pickeSwatchesRows[0], false); + pickerSwatches.addRowDefinition(pickeSwatchesRows[1], false); + pickerSwatches.addRowDefinition(pickeSwatchesRows[2], false); + pickerSwatches.addRowDefinition(pickeSwatchesRows[3], false); + pickerSwatchesButtons.addControl(pickerSwatches, 0, 0); + const activeSwatches = new Grid3; + activeSwatches.name = "Active Swatches"; + activeSwatches.width = 0.67; + activeSwatches.addRowDefinition(0.5, false); + activeSwatches.addRowDefinition(0.5, false); + pickerSwatches.addControl(activeSwatches, 2, 0); + const labelWidth = Math.floor(parseInt(options.pickerWidth) * dialogBodyCols[1] * pickerButtonsCol[0] * 0.11); + const labelHeight = Math.floor(parseInt(options.pickerHeight) * pickerPanelRows[1] * pickerBodyRightRows[0] * pickeSwatchesRows[1] * 0.5); + let labelTextSize; + if (options.pickerWidth > options.pickerHeight) { + labelTextSize = labelHeight; + } else { + labelTextSize = labelWidth; + } + const newText = new TextBlock3; + newText.text = "new"; + newText.name = "New Color Label"; + newText.color = buttonColor; + newText.fontSize = labelTextSize; + pickerSwatches.addControl(newText, 1, 0); + const newSwatch = new Rectangle3; + newSwatch.name = "New Color Swatch"; + newSwatch.background = options.lastColor; + newSwatch.thickness = 0; + activeSwatches.addControl(newSwatch, 0, 0); + const currentSwatch = Button3.CreateSimpleButton("currentSwatch", ""); + currentSwatch.background = options.lastColor; + currentSwatch.thickness = 0; + currentSwatch.onPointerClickObservable.add(() => { + const revertColor = Color3.FromHexString(currentSwatch.background); + updateValues(revertColor, currentSwatch.name); + editSwatches(false); + }); + currentSwatch.pointerDownAnimation = () => { + }; + currentSwatch.pointerUpAnimation = () => { + }; + currentSwatch.pointerEnterAnimation = () => { + }; + currentSwatch.pointerOutAnimation = () => { + }; + activeSwatches.addControl(currentSwatch, 1, 0); + const swatchOutline = new Rectangle3; + swatchOutline.name = "Swatch Outline"; + swatchOutline.width = 0.67; + swatchOutline.thickness = 2; + swatchOutline.color = currentSwatchesOutlineColor; + swatchOutline.isHitTestVisible = false; + pickerSwatches.addControl(swatchOutline, 2, 0); + const currentText = new TextBlock3; + currentText.name = "Current Color Label"; + currentText.text = "current"; + currentText.color = buttonColor; + currentText.fontSize = labelTextSize; + pickerSwatches.addControl(currentText, 3, 0); + const buttonGrid = new Grid3; + buttonGrid.name = "Button Grid"; + buttonGrid.height = 0.8; + const buttonGridRows = 1 / 3; + buttonGrid.addRowDefinition(buttonGridRows, false); + buttonGrid.addRowDefinition(buttonGridRows, false); + buttonGrid.addRowDefinition(buttonGridRows, false); + pickerSwatchesButtons.addControl(buttonGrid, 0, 1); + const buttonWidth = Math.floor(parseInt(options.pickerWidth) * dialogBodyCols[1] * pickerButtonsCol[1] * 0.67).toString() + "px"; + const buttonHeight = Math.floor(parseInt(options.pickerHeight) * pickerPanelRows[1] * pickerBodyRightRows[0] * (parseFloat(buttonGrid.height.toString()) / 100) * buttonGridRows * 0.7).toString() + "px"; + if (parseFloat(buttonWidth) > parseFloat(buttonHeight)) { + buttonFontSize = Math.floor(parseFloat(buttonHeight) * 0.45); + } else { + buttonFontSize = Math.floor(parseFloat(buttonWidth) * 0.11); + } + const butOK = Button3.CreateSimpleButton("butOK", "OK"); + butOK.width = buttonWidth; + butOK.height = buttonHeight; + butOK.verticalAlignment = Control3.VERTICAL_ALIGNMENT_CENTER; + butOK.thickness = 2; + butOK.color = buttonColor; + butOK.fontSize = buttonFontSize; + butOK.background = buttonBackgroundColor; + butOK.onPointerEnterObservable.add(() => { + butOK.background = buttonBackgroundHoverColor; + }); + butOK.onPointerOutObservable.add(() => { + butOK.background = buttonBackgroundColor; + }); + butOK.pointerDownAnimation = () => { + butOK.background = buttonBackgroundClickColor; + }; + butOK.pointerUpAnimation = () => { + butOK.background = buttonBackgroundHoverColor; + }; + butOK.onPointerClickObservable.add(() => { + editSwatches(false); + closePicker(newSwatch.background); + }); + buttonGrid.addControl(butOK, 0, 0); + const butCancel = Button3.CreateSimpleButton("butCancel", "Cancel"); + butCancel.width = buttonWidth; + butCancel.height = buttonHeight; + butCancel.verticalAlignment = Control3.VERTICAL_ALIGNMENT_CENTER; + butCancel.thickness = 2; + butCancel.color = buttonColor; + butCancel.fontSize = buttonFontSize; + butCancel.background = buttonBackgroundColor; + butCancel.onPointerEnterObservable.add(() => { + butCancel.background = buttonBackgroundHoverColor; + }); + butCancel.onPointerOutObservable.add(() => { + butCancel.background = buttonBackgroundColor; + }); + butCancel.pointerDownAnimation = () => { + butCancel.background = buttonBackgroundClickColor; + }; + butCancel.pointerUpAnimation = () => { + butCancel.background = buttonBackgroundHoverColor; + }; + butCancel.onPointerClickObservable.add(() => { + editSwatches(false); + closePicker(currentSwatch.background); + }); + buttonGrid.addControl(butCancel, 1, 0); + if (options.savedColors) { + butSave = Button3.CreateSimpleButton("butSave", "Save"); + butSave.width = buttonWidth; + butSave.height = buttonHeight; + butSave.verticalAlignment = Control3.VERTICAL_ALIGNMENT_CENTER; + butSave.thickness = 2; + butSave.fontSize = buttonFontSize; + if (options.savedColors.length < options.swatchLimit) { + butSave.color = buttonColor; + butSave.background = buttonBackgroundColor; + } else { + disableButton(butSave, true); + } + butSave.onPointerEnterObservable.add(() => { + if (options.savedColors) { + if (options.savedColors.length < options.swatchLimit) { + butSave.background = buttonBackgroundHoverColor; + } + } + }); + butSave.onPointerOutObservable.add(() => { + if (options.savedColors) { + if (options.savedColors.length < options.swatchLimit) { + butSave.background = buttonBackgroundColor; + } + } + }); + butSave.pointerDownAnimation = () => { + if (options.savedColors) { + if (options.savedColors.length < options.swatchLimit) { + butSave.background = buttonBackgroundClickColor; + } + } + }; + butSave.pointerUpAnimation = () => { + if (options.savedColors) { + if (options.savedColors.length < options.swatchLimit) { + butSave.background = buttonBackgroundHoverColor; + } + } + }; + butSave.onPointerClickObservable.add(() => { + if (options.savedColors) { + if (options.savedColors.length == 0) { + setEditButtonVisibility(true); + } + if (options.savedColors.length < options.swatchLimit) { + updateSwatches(newSwatch.background, butSave); + } + editSwatches(false); + } + }); + if (options.savedColors.length > 0) { + setEditButtonVisibility(true); + } + buttonGrid.addControl(butSave, 2, 0); + } + const pickerColorValues = new Grid3; + pickerColorValues.name = "Dialog Lower Right"; + pickerColorValues.addRowDefinition(0.02, false); + pickerColorValues.addRowDefinition(0.63, false); + pickerColorValues.addRowDefinition(0.21, false); + pickerColorValues.addRowDefinition(0.14, false); + pickerBodyRight.addControl(pickerColorValues, 1, 0); + const currentColor = Color3.FromHexString(options.lastColor); + const rgbValuesQuadrant = new Grid3; + rgbValuesQuadrant.name = "RGB Values"; + rgbValuesQuadrant.width = 0.82; + rgbValuesQuadrant.verticalAlignment = Control3.VERTICAL_ALIGNMENT_CENTER; + rgbValuesQuadrant.addRowDefinition(1 / 3, false); + rgbValuesQuadrant.addRowDefinition(1 / 3, false); + rgbValuesQuadrant.addRowDefinition(1 / 3, false); + rgbValuesQuadrant.addColumnDefinition(0.1, false); + rgbValuesQuadrant.addColumnDefinition(0.2, false); + rgbValuesQuadrant.addColumnDefinition(0.7, false); + pickerColorValues.addControl(rgbValuesQuadrant, 1, 0); + for (let i = 0;i < inputFieldLabels.length; i++) { + const labelText2 = new TextBlock3; + labelText2.text = inputFieldLabels[i]; + labelText2.color = buttonColor; + labelText2.fontSize = buttonFontSize; + rgbValuesQuadrant.addControl(labelText2, i, 0); + } + const rValInt = new InputText3; + rValInt.width = 0.83; + rValInt.height = 0.72; + rValInt.name = "rIntField"; + rValInt.fontSize = buttonFontSize; + rValInt.text = (currentColor.r * 255).toString(); + rValInt.color = inputTextColor; + rValInt.background = inputTextBackgroundColor; + rValInt.onFocusObservable.add(() => { + activeField = rValInt.name; + lastVal = rValInt.text; + editSwatches(false); + }); + rValInt.onBlurObservable.add(() => { + if (rValInt.text == "") { + rValInt.text = "0"; + } + updateInt(rValInt, "r"); + if (activeField == rValInt.name) { + activeField = ""; + } + }); + rValInt.onTextChangedObservable.add(() => { + if (activeField == rValInt.name) { + updateInt(rValInt, "r"); + } + }); + rgbValuesQuadrant.addControl(rValInt, 0, 1); + const gValInt = new InputText3; + gValInt.width = 0.83; + gValInt.height = 0.72; + gValInt.name = "gIntField"; + gValInt.fontSize = buttonFontSize; + gValInt.text = (currentColor.g * 255).toString(); + gValInt.color = inputTextColor; + gValInt.background = inputTextBackgroundColor; + gValInt.onFocusObservable.add(() => { + activeField = gValInt.name; + lastVal = gValInt.text; + editSwatches(false); + }); + gValInt.onBlurObservable.add(() => { + if (gValInt.text == "") { + gValInt.text = "0"; + } + updateInt(gValInt, "g"); + if (activeField == gValInt.name) { + activeField = ""; + } + }); + gValInt.onTextChangedObservable.add(() => { + if (activeField == gValInt.name) { + updateInt(gValInt, "g"); + } + }); + rgbValuesQuadrant.addControl(gValInt, 1, 1); + const bValInt = new InputText3; + bValInt.width = 0.83; + bValInt.height = 0.72; + bValInt.name = "bIntField"; + bValInt.fontSize = buttonFontSize; + bValInt.text = (currentColor.b * 255).toString(); + bValInt.color = inputTextColor; + bValInt.background = inputTextBackgroundColor; + bValInt.onFocusObservable.add(() => { + activeField = bValInt.name; + lastVal = bValInt.text; + editSwatches(false); + }); + bValInt.onBlurObservable.add(() => { + if (bValInt.text == "") { + bValInt.text = "0"; + } + updateInt(bValInt, "b"); + if (activeField == bValInt.name) { + activeField = ""; + } + }); + bValInt.onTextChangedObservable.add(() => { + if (activeField == bValInt.name) { + updateInt(bValInt, "b"); + } + }); + rgbValuesQuadrant.addControl(bValInt, 2, 1); + const rValDec = new InputText3; + rValDec.width = 0.95; + rValDec.height = 0.72; + rValDec.name = "rDecField"; + rValDec.fontSize = buttonFontSize; + rValDec.text = currentColor.r.toString(); + rValDec.color = inputTextColor; + rValDec.background = inputTextBackgroundColor; + rValDec.onFocusObservable.add(() => { + activeField = rValDec.name; + lastVal = rValDec.text; + editSwatches(false); + }); + rValDec.onBlurObservable.add(() => { + if (parseFloat(rValDec.text) == 0 || rValDec.text == "") { + rValDec.text = "0"; + updateFloat(rValDec, "r"); + } + if (activeField == rValDec.name) { + activeField = ""; + } + }); + rValDec.onTextChangedObservable.add(() => { + if (activeField == rValDec.name) { + updateFloat(rValDec, "r"); + } + }); + rgbValuesQuadrant.addControl(rValDec, 0, 2); + const gValDec = new InputText3; + gValDec.width = 0.95; + gValDec.height = 0.72; + gValDec.name = "gDecField"; + gValDec.fontSize = buttonFontSize; + gValDec.text = currentColor.g.toString(); + gValDec.color = inputTextColor; + gValDec.background = inputTextBackgroundColor; + gValDec.onFocusObservable.add(() => { + activeField = gValDec.name; + lastVal = gValDec.text; + editSwatches(false); + }); + gValDec.onBlurObservable.add(() => { + if (parseFloat(gValDec.text) == 0 || gValDec.text == "") { + gValDec.text = "0"; + updateFloat(gValDec, "g"); + } + if (activeField == gValDec.name) { + activeField = ""; + } + }); + gValDec.onTextChangedObservable.add(() => { + if (activeField == gValDec.name) { + updateFloat(gValDec, "g"); + } + }); + rgbValuesQuadrant.addControl(gValDec, 1, 2); + const bValDec = new InputText3; + bValDec.width = 0.95; + bValDec.height = 0.72; + bValDec.name = "bDecField"; + bValDec.fontSize = buttonFontSize; + bValDec.text = currentColor.b.toString(); + bValDec.color = inputTextColor; + bValDec.background = inputTextBackgroundColor; + bValDec.onFocusObservable.add(() => { + activeField = bValDec.name; + lastVal = bValDec.text; + editSwatches(false); + }); + bValDec.onBlurObservable.add(() => { + if (parseFloat(bValDec.text) == 0 || bValDec.text == "") { + bValDec.text = "0"; + updateFloat(bValDec, "b"); + } + if (activeField == bValDec.name) { + activeField = ""; + } + }); + bValDec.onTextChangedObservable.add(() => { + if (activeField == bValDec.name) { + updateFloat(bValDec, "b"); + } + }); + rgbValuesQuadrant.addControl(bValDec, 2, 2); + const hexValueQuadrant = new Grid3; + hexValueQuadrant.name = "Hex Value"; + hexValueQuadrant.width = 0.82; + hexValueQuadrant.addRowDefinition(1, false); + hexValueQuadrant.addColumnDefinition(0.1, false); + hexValueQuadrant.addColumnDefinition(0.9, false); + pickerColorValues.addControl(hexValueQuadrant, 2, 0); + const labelText = new TextBlock3; + labelText.text = "#"; + labelText.color = buttonColor; + labelText.fontSize = buttonFontSize; + hexValueQuadrant.addControl(labelText, 0, 0); + const hexVal = new InputText3; + hexVal.width = 0.96; + hexVal.height = 0.72; + hexVal.name = "hexField"; + hexVal.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_CENTER; + hexVal.fontSize = buttonFontSize; + const minusPound = options.lastColor.split("#"); + hexVal.text = minusPound[1]; + hexVal.color = inputTextColor; + hexVal.background = inputTextBackgroundColor; + hexVal.onFocusObservable.add(() => { + activeField = hexVal.name; + lastVal = hexVal.text; + editSwatches(false); + }); + hexVal.onBlurObservable.add(() => { + if (hexVal.text.length == 3) { + const val = hexVal.text.split(""); + hexVal.text = val[0] + val[0] + val[1] + val[1] + val[2] + val[2]; + } + if (hexVal.text == "") { + hexVal.text = "000000"; + updateValues(Color3.FromHexString(hexVal.text), "b"); + } + if (activeField == hexVal.name) { + activeField = ""; + } + }); + hexVal.onTextChangedObservable.add(() => { + let newHexValue = hexVal.text; + const checkHex = /[^0-9A-F]/i.test(newHexValue); + if ((hexVal.text.length > 6 || checkHex) && activeField == hexVal.name) { + hexVal.text = lastVal; + } else { + if (hexVal.text.length < 6) { + const leadingZero = 6 - hexVal.text.length; + for (let i = 0;i < leadingZero; i++) { + newHexValue = "0" + newHexValue; + } + } + if (hexVal.text.length == 3) { + const val = hexVal.text.split(""); + newHexValue = val[0] + val[0] + val[1] + val[1] + val[2] + val[2]; + } + newHexValue = "#" + newHexValue; + if (activeField == hexVal.name) { + lastVal = hexVal.text; + updateValues(Color3.FromHexString(newHexValue), hexVal.name); + } + } + }); + hexValueQuadrant.addControl(hexVal, 0, 1); + if (options.savedColors && options.savedColors.length > 0) { + updateSwatches("", butSave); + } + function updateValues(value, inputField) { + activeField = inputField; + const pickedColor = value.toHexString(); + newSwatch.background = pickedColor; + if (rValInt.name != activeField) { + rValInt.text = Math.floor(value.r * 255).toString(); + } + if (gValInt.name != activeField) { + gValInt.text = Math.floor(value.g * 255).toString(); + } + if (bValInt.name != activeField) { + bValInt.text = Math.floor(value.b * 255).toString(); + } + if (rValDec.name != activeField) { + rValDec.text = value.r.toString(); + } + if (gValDec.name != activeField) { + gValDec.text = value.g.toString(); + } + if (bValDec.name != activeField) { + bValDec.text = value.b.toString(); + } + if (hexVal.name != activeField) { + const minusPound2 = pickedColor.split("#"); + hexVal.text = minusPound2[1]; + } + if (picker.name != activeField) { + picker.value = value; + } + } + function updateInt(field, channel) { + let newValue = field.text; + const checkVal = /[^0-9]/g.test(newValue); + if (checkVal) { + field.text = lastVal; + return; + } else { + if (newValue != "") { + if (Math.floor(parseInt(newValue)) < 0) { + newValue = "0"; + } else if (Math.floor(parseInt(newValue)) > 255) { + newValue = "255"; + } else if (isNaN(parseInt(newValue))) { + newValue = "0"; + } + } + if (activeField == field.name) { + lastVal = newValue; + } + } + if (newValue != "") { + newValue = parseInt(newValue).toString(); + field.text = newValue; + const newSwatchRGB = Color3.FromHexString(newSwatch.background); + if (activeField == field.name) { + if (channel == "r") { + updateValues(new Color3(parseInt(newValue) / 255, newSwatchRGB.g, newSwatchRGB.b), field.name); + } else if (channel == "g") { + updateValues(new Color3(newSwatchRGB.r, parseInt(newValue) / 255, newSwatchRGB.b), field.name); + } else { + updateValues(new Color3(newSwatchRGB.r, newSwatchRGB.g, parseInt(newValue) / 255), field.name); + } + } + } + } + function updateFloat(field, channel) { + let newValue = field.text; + const checkVal = /[^0-9.]/g.test(newValue); + if (checkVal) { + field.text = lastVal; + return; + } else { + if (newValue != "" && newValue != "." && parseFloat(newValue) != 0) { + if (parseFloat(newValue) < 0) { + newValue = "0.0"; + } else if (parseFloat(newValue) > 1) { + newValue = "1.0"; + } else if (isNaN(parseFloat(newValue))) { + newValue = "0.0"; + } + } + if (activeField == field.name) { + lastVal = newValue; + } + } + if (newValue != "" && newValue != "." && parseFloat(newValue) != 0) { + newValue = parseFloat(newValue).toString(); + field.text = newValue; + } else { + newValue = "0.0"; + } + const newSwatchRGB = Color3.FromHexString(newSwatch.background); + if (activeField == field.name) { + if (channel == "r") { + updateValues(new Color3(parseFloat(newValue), newSwatchRGB.g, newSwatchRGB.b), field.name); + } else if (channel == "g") { + updateValues(new Color3(newSwatchRGB.r, parseFloat(newValue), newSwatchRGB.b), field.name); + } else { + updateValues(new Color3(newSwatchRGB.r, newSwatchRGB.g, parseFloat(newValue)), field.name); + } + } + } + function deleteSwatch(index) { + if (options.savedColors) { + options.savedColors.splice(index, 1); + } + if (options.savedColors && options.savedColors.length == 0) { + setEditButtonVisibility(false); + editSwatchMode = false; + } + } + function createSwatch() { + if (options.savedColors && options.savedColors[swatchNumber]) { + let icon; + if (editSwatchMode) { + icon = "b"; + } else { + icon = ""; + } + const swatch = Button3.CreateSimpleButton("Swatch_" + swatchNumber, icon); + swatch.fontFamily = "coreglyphs"; + const swatchColor = Color3.FromHexString(options.savedColors[swatchNumber]); + const swatchLuminence = swatchColor.r + swatchColor.g + swatchColor.b; + if (swatchLuminence > luminanceLimit) { + swatch.color = iconColorDark; + } else { + swatch.color = iconColorLight; + } + swatch.fontSize = Math.floor(swatchSize * 0.7); + swatch.textBlock.verticalAlignment = Control3.VERTICAL_ALIGNMENT_CENTER; + swatch.height = swatch.width = swatchSize.toString() + "px"; + swatch.background = options.savedColors[swatchNumber]; + swatch.thickness = 2; + const metadata = swatchNumber; + swatch.pointerDownAnimation = () => { + swatch.thickness = 4; + }; + swatch.pointerUpAnimation = () => { + swatch.thickness = 3; + }; + swatch.pointerEnterAnimation = () => { + swatch.thickness = 3; + }; + swatch.pointerOutAnimation = () => { + swatch.thickness = 2; + }; + swatch.onPointerClickObservable.add(() => { + if (!editSwatchMode) { + if (options.savedColors) { + updateValues(Color3.FromHexString(options.savedColors[metadata]), swatch.name); + } + } else { + deleteSwatch(metadata); + updateSwatches("", butSave); + } + }); + return swatch; + } else { + return null; + } + } + function editSwatches(mode) { + if (mode !== undefined) { + editSwatchMode = mode; + } + let thisButton; + if (editSwatchMode) { + for (let i = 0;i < swatchDrawer.children.length; i++) { + thisButton = swatchDrawer.children[i]; + thisButton.textBlock.text = "b"; + } + if (butEdit !== undefined) { + butEdit.textBlock.text = "Done"; + } + } else { + for (let i = 0;i < swatchDrawer.children.length; i++) { + thisButton = swatchDrawer.children[i]; + thisButton.textBlock.text = ""; + } + if (butEdit !== undefined) { + butEdit.textBlock.text = "Edit"; + } + } + } + function updateSwatches(color, button10) { + if (options.savedColors) { + if (color != "") { + options.savedColors.push(color); + } + swatchNumber = 0; + swatchDrawer.clearControls(); + const rowCount = Math.ceil(options.savedColors.length / options.numSwatchesPerLine); + let gutterCount; + if (rowCount == 0) { + gutterCount = 0; + } else { + gutterCount = rowCount + 1; + } + if (swatchDrawer.rowCount != rowCount + gutterCount) { + const currentRows = swatchDrawer.rowCount; + for (let i = 0;i < currentRows; i++) { + swatchDrawer.removeRowDefinition(0); + } + for (let i = 0;i < rowCount + gutterCount; i++) { + if (i % 2) { + swatchDrawer.addRowDefinition(swatchSize, true); + } else { + swatchDrawer.addRowDefinition(gutterSize, true); + } + } + } + swatchDrawer.height = (swatchSize * rowCount + gutterCount * gutterSize).toString() + "px"; + for (let y = 1, thisRow = 1;y < rowCount + gutterCount; y += 2, thisRow++) { + let totalButtonsThisRow; + if (options.savedColors.length > thisRow * options.numSwatchesPerLine) { + totalButtonsThisRow = options.numSwatchesPerLine; + } else { + totalButtonsThisRow = options.savedColors.length - (thisRow - 1) * options.numSwatchesPerLine; + } + const buttonIterations = Math.min(Math.max(totalButtonsThisRow, 0), options.numSwatchesPerLine); + for (let x = 0, w = 1;x < buttonIterations; x++) { + if (x > options.numSwatchesPerLine) { + continue; + } + const swatch = createSwatch(); + if (swatch != null) { + swatchDrawer.addControl(swatch, y, w); + w += 2; + swatchNumber++; + } else { + continue; + } + } + } + if (options.savedColors.length >= options.swatchLimit) { + disableButton(button10, true); + } else { + disableButton(button10, false); + } + } + } + function setEditButtonVisibility(enableButton) { + if (enableButton) { + butEdit = Button3.CreateSimpleButton("butEdit", "Edit"); + butEdit.width = buttonWidth; + butEdit.height = buttonHeight; + butEdit.left = Math.floor(parseInt(buttonWidth) * 0.1).toString() + "px"; + butEdit.top = (parseFloat(butEdit.left) * -1).toString() + "px"; + butEdit.verticalAlignment = Control3.VERTICAL_ALIGNMENT_BOTTOM; + butEdit.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + butEdit.thickness = 2; + butEdit.color = buttonColor; + butEdit.fontSize = buttonFontSize; + butEdit.background = buttonBackgroundColor; + butEdit.onPointerEnterObservable.add(() => { + butEdit.background = buttonBackgroundHoverColor; + }); + butEdit.onPointerOutObservable.add(() => { + butEdit.background = buttonBackgroundColor; + }); + butEdit.pointerDownAnimation = () => { + butEdit.background = buttonBackgroundClickColor; + }; + butEdit.pointerUpAnimation = () => { + butEdit.background = buttonBackgroundHoverColor; + }; + butEdit.onPointerClickObservable.add(() => { + if (editSwatchMode) { + editSwatchMode = false; + } else { + editSwatchMode = true; + } + editSwatches(); + }); + pickerGrid.addControl(butEdit, 1, 0); + } else { + pickerGrid.removeControl(butEdit); + } + } + function disableButton(button10, disabled) { + if (disabled) { + button10.color = buttonDisabledColor; + button10.background = buttonDisabledBackgroundColor; + } else { + button10.color = buttonColor; + button10.background = buttonBackgroundColor; + } + } + function closePicker(color) { + if (options.savedColors && options.savedColors.length > 0) { + resolve({ + savedColors: options.savedColors, + pickedColor: color + }); + } else { + resolve({ + pickedColor: color + }); + } + advancedTexture.removeControl(dialogContainer); + } + }); + } +} +var init_colorpicker2 = __esm(() => { + init_tslib_es62(); + init_observable(); + init_control2(); + init_inputText2(); + init_rectangle2(); + init_button2(); + init_grid3(); + init_textBlock2(); + init_typeStore(); + init_math_color(); + init_decorators(); + init_engineStore(); + ColorPicker3._Epsilon = 0.000001; + __decorate2([ + serialize() + ], ColorPicker3.prototype, "value", null); + __decorate2([ + serialize() + ], ColorPicker3.prototype, "width", null); + __decorate2([ + serialize() + ], ColorPicker3.prototype, "height", null); + __decorate2([ + serialize() + ], ColorPicker3.prototype, "size", null); + RegisterClass("BABYLON.GUI.ColorPicker", ColorPicker3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/ellipse.js +class Ellipse3 extends Container3 { + get thickness() { + return this._thickness; + } + set thickness(value) { + if (this._thickness === value) { + return; + } + this._thickness = value; + this._markAsDirty(); + } + constructor(name335) { + super(name335); + this.name = name335; + this._thickness = 1; + } + _getTypeName() { + return "Ellipse"; + } + _localDraw(context) { + context.save(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + Control3.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2 - this._thickness / 2, this._currentMeasure.height / 2 - this._thickness / 2, context); + if (this._backgroundGradient || this._background) { + context.fillStyle = this._getBackgroundColor(context); + context.fill(); + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + if (this._thickness) { + if (this.color) { + context.strokeStyle = this.color; + } + context.lineWidth = this._thickness; + context.stroke(); + } + context.restore(); + } + _additionalProcessing(parentMeasure, context) { + super._additionalProcessing(parentMeasure, context); + this._measureForChildren.width -= 2 * this._thickness; + this._measureForChildren.height -= 2 * this._thickness; + this._measureForChildren.left += this._thickness; + this._measureForChildren.top += this._thickness; + } + _clipForChildren(context) { + Control3.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2, this._currentMeasure.height / 2, context); + context.clip(); + } + _renderHighlightSpecific(context) { + Control3.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2 - this._highlightLineWidth / 2, this._currentMeasure.height / 2 - this._highlightLineWidth / 2, context); + context.stroke(); + } +} +var init_ellipse2 = __esm(() => { + init_tslib_es62(); + init_container2(); + init_control2(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], Ellipse3.prototype, "thickness", null); + RegisterClass("BABYLON.GUI.Ellipse", Ellipse3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/focusableButton.js +class FocusableButton3 extends Button3 { + constructor(name335) { + super(name335); + this.name = name335; + this.focusedColor = null; + this._isFocused = false; + this._unfocusedColor = null; + this.onFocusObservable = new Observable; + this.onBlurObservable = new Observable; + this.onKeyboardEventProcessedObservable = new Observable; + this._unfocusedColor = this.color; + } + onBlur() { + if (this._isFocused) { + this._isFocused = false; + if (this.focusedColor && this._unfocusedColor != null) { + this.color = this._unfocusedColor; + } + this.onBlurObservable.notifyObservers(this); + } + } + onFocus() { + this._isFocused = true; + if (this.focusedColor) { + this._unfocusedColor = this.color; + this.color = this.focusedColor; + } + this.onFocusObservable.notifyObservers(this); + } + keepsFocusWith() { + return null; + } + focus() { + this._host.moveFocusToControl(this); + } + blur() { + this._host.focusedControl = null; + } + processKeyboard(evt) { + this.onKeyboardEventProcessedObservable.notifyObservers(evt, -1, this); + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!this.isReadOnly) { + this.focus(); + } + return super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi); + } + displose() { + super.dispose(); + this.onBlurObservable.clear(); + this.onFocusObservable.clear(); + this.onKeyboardEventProcessedObservable.clear(); + } +} +var init_focusableButton2 = __esm(() => { + init_button2(); + init_typeStore(); + init_observable(); + RegisterClass("BABYLON.GUI.FocusableButton", FocusableButton3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/focusableControl.js +var init_focusableControl2 = __esm(() => { +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/inputTextArea.js +class InputTextArea3 extends InputText3 { + get outlineWidth() { + return this._outlineWidth; + } + set outlineWidth(value) { + if (this._outlineWidth === value) { + return; + } + this._outlineWidth = value; + this._markAsDirty(); + } + get outlineColor() { + return this._outlineColor; + } + set outlineColor(value) { + if (this._outlineColor === value) { + return; + } + this._outlineColor = value; + this._markAsDirty(); + } + get autoStretchHeight() { + return this._autoStretchHeight; + } + set autoStretchHeight(value) { + if (this._autoStretchHeight === value) { + return; + } + this._autoStretchHeight = value; + this._markAsDirty(); + } + set height(value) { + this.fixedRatioMasterIsWidth = false; + if (this._height.toString(this._host) === value) { + return; + } + if (this._height.fromString(value)) { + this._markAsDirty(); + } + this._autoStretchHeight = false; + } + get maxHeight() { + return this._maxHeight.toString(this._host); + } + get maxHeightInPixels() { + return this._maxHeight.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + set maxHeight(value) { + if (this._maxHeight.toString(this._host) === value) { + return; + } + if (this._maxHeight.fromString(value)) { + this._markAsDirty(); + } + } + constructor(name335, text = "") { + super(name335); + this.name = name335; + this._textHorizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + this._textVerticalAlignment = Control3.VERTICAL_ALIGNMENT_TOP; + this._prevText = this.text; + this._lineSpacing = new ValueAndUnit3(0); + this._outlineWidth = 0; + this._outlineColor = "white"; + this._maxHeight = new ValueAndUnit3(1, ValueAndUnit3.UNITMODE_PERCENTAGE, false); + this.onLinesReadyObservable = new Observable; + this.text = text; + this.isPointerBlocker = true; + this.onLinesReadyObservable.add(() => this._updateCursorPosition()); + this._highlightCursorInfo = { + initialStartIndex: -1, + initialRelativeStartIndex: -1, + initialLineIndex: -1 + }; + this._cursorInfo = { + globalStartIndex: 0, + globalEndIndex: 0, + relativeEndIndex: 0, + relativeStartIndex: 0, + currentLineIndex: 0 + }; + } + _getTypeName() { + return "InputTextArea"; + } + processKeyboard(evt) { + if (this.isReadOnly) { + return; + } + this.alternativeProcessKey(evt.code, evt.key, evt); + this.onKeyboardEventProcessedObservable.notifyObservers(evt); + } + alternativeProcessKey(code, key, evt) { + if (evt && (evt.ctrlKey || evt.metaKey) && (code === "KeyC" || code === "KeyV" || code === "KeyX")) { + return; + } + switch (code) { + case "KeyA": + if (evt && (evt.ctrlKey || evt.metaKey)) { + this._selectAllText(); + evt.preventDefault(); + return; + } + break; + case "Period": + if (evt && evt.shiftKey) { + evt.preventDefault(); + } + break; + case "Backspace": + if (!this._isTextHighlightOn && this._cursorInfo.globalStartIndex > 0) { + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + this._cursorInfo.globalStartIndex--; + } + this._prevText = this._textWrapper.text; + this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex); + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + if (evt) { + evt.preventDefault(); + } + this._blinkIsEven = false; + this._isTextHighlightOn = false; + this._textHasChanged(); + break; + case "Delete": + if (!this._isTextHighlightOn && this._cursorInfo.globalEndIndex < this.text.length) { + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex + 1; + } + this._prevText = this._textWrapper.text; + this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex); + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + if (evt) { + evt.preventDefault(); + } + this._blinkIsEven = false; + this._isTextHighlightOn = false; + this._textHasChanged(); + break; + case "Enter": + this._prevText = this._textWrapper.text; + this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, "\n"); + this._cursorInfo.globalStartIndex++; + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + this._blinkIsEven = false; + this._isTextHighlightOn = false; + this._textHasChanged(); + return; + case "End": + this._cursorInfo.globalStartIndex = this.text.length; + this._blinkIsEven = false; + this._isTextHighlightOn = false; + this._markAsDirty(); + return; + case "Home": + this._cursorInfo.globalStartIndex = 0; + this._blinkIsEven = false; + this._isTextHighlightOn = false; + this._markAsDirty(); + return; + case "ArrowLeft": + this._markAsDirty(); + if (evt && evt.shiftKey) { + if (evt.ctrlKey || evt.metaKey) { + this._cursorInfo.globalStartIndex -= this._cursorInfo.relativeStartIndex; + this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex; + } + if (!this._isTextHighlightOn) { + this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; + this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; + this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex; + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + this._cursorInfo.globalStartIndex--; + this._isTextHighlightOn = true; + } else { + if (this._cursorInfo.globalEndIndex > this._highlightCursorInfo.initialStartIndex) { + this._cursorInfo.globalEndIndex--; + } else { + this._cursorInfo.globalStartIndex--; + } + } + this._blinkIsEven = true; + evt.preventDefault(); + return; + } + if (this._isTextHighlightOn) { + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + } else if (evt && (evt.ctrlKey || evt.metaKey)) { + this._cursorInfo.globalStartIndex -= this._cursorInfo.relativeStartIndex; + evt.preventDefault(); + } else if (this._cursorInfo.globalStartIndex > 0) { + this._cursorInfo.globalStartIndex--; + } + this._blinkIsEven = false; + this._isTextHighlightOn = false; + return; + case "ArrowRight": + this._markAsDirty(); + if (evt && evt.shiftKey) { + if (evt.ctrlKey || evt.metaKey) { + const rightDelta = this._lines[this._cursorInfo.currentLineIndex].text.length - this._cursorInfo.relativeEndIndex - 1; + this._cursorInfo.globalEndIndex += rightDelta; + this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex; + } + if (!this._isTextHighlightOn) { + this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; + this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; + this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex; + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + this._cursorInfo.globalEndIndex++; + this._isTextHighlightOn = true; + } else { + if (this._cursorInfo.globalStartIndex < this._highlightCursorInfo.initialStartIndex) { + this._cursorInfo.globalStartIndex++; + } else { + this._cursorInfo.globalEndIndex++; + } + } + this._blinkIsEven = true; + evt.preventDefault(); + return; + } + if (this._isTextHighlightOn) { + this._cursorInfo.globalStartIndex = this._cursorInfo.globalEndIndex; + } else if (evt && (evt.ctrlKey || evt.metaKey)) { + const rightDelta = this._lines[this._cursorInfo.currentLineIndex].text.length - this._cursorInfo.relativeEndIndex; + this._cursorInfo.globalStartIndex += rightDelta; + } else if (this._cursorInfo.globalStartIndex < this.text.length) { + this._cursorInfo.globalStartIndex++; + } + this._blinkIsEven = false; + this._isTextHighlightOn = false; + return; + case "ArrowUp": + this._blinkIsEven = false; + if (evt) { + if (evt.shiftKey) { + if (!this._isTextHighlightOn) { + this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; + this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; + this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex; + } + this._isTextHighlightOn = true; + this._blinkIsEven = true; + } else { + this._isTextHighlightOn = false; + } + evt.preventDefault(); + } + if (this._cursorInfo.currentLineIndex === 0) { + this._cursorInfo.globalStartIndex = 0; + } else { + const currentLine = this._lines[this._cursorInfo.currentLineIndex]; + const upperLine = this._lines[this._cursorInfo.currentLineIndex - 1]; + let tmpIndex = 0; + let relativeIndex = 0; + if (!this._isTextHighlightOn || this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex) { + tmpIndex = this._cursorInfo.globalStartIndex; + relativeIndex = this._cursorInfo.relativeStartIndex; + } else { + tmpIndex = this._cursorInfo.globalEndIndex; + relativeIndex = this._cursorInfo.relativeEndIndex; + } + const currentText = currentLine.text.substr(0, relativeIndex); + const currentWidth = this._contextForBreakLines.measureText(currentText).width; + let upperWidth = 0; + let previousWidth = 0; + tmpIndex -= relativeIndex; + tmpIndex -= upperLine.text.length + upperLine.lineEnding.length; + let upperLineRelativeIndex = 0; + while (upperWidth < currentWidth && upperLineRelativeIndex < upperLine.text.length) { + tmpIndex++; + upperLineRelativeIndex++; + previousWidth = Math.abs(currentWidth - upperWidth); + upperWidth = this._contextForBreakLines.measureText(upperLine.text.substr(0, upperLineRelativeIndex)).width; + } + if (Math.abs(currentWidth - upperWidth) > previousWidth && upperLineRelativeIndex > 0) { + tmpIndex--; + } + if (!this._isTextHighlightOn) { + this._cursorInfo.globalStartIndex = tmpIndex; + } else if (this._cursorInfo.currentLineIndex <= this._highlightCursorInfo.initialLineIndex) { + this._cursorInfo.globalStartIndex = tmpIndex; + this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex; + this._cursorInfo.relativeEndIndex = this._highlightCursorInfo.initialRelativeStartIndex; + } else { + this._cursorInfo.globalEndIndex = tmpIndex; + } + } + this._markAsDirty(); + return; + case "ArrowDown": + this._blinkIsEven = false; + if (evt) { + if (evt.shiftKey) { + if (!this._isTextHighlightOn) { + this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; + this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; + this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex; + } + this._isTextHighlightOn = true; + this._blinkIsEven = true; + } else { + this._isTextHighlightOn = false; + } + evt.preventDefault(); + } + if (this._cursorInfo.currentLineIndex === this._lines.length - 1) { + this._cursorInfo.globalStartIndex = this.text.length; + } else { + const currentLine = this._lines[this._cursorInfo.currentLineIndex]; + const underLine = this._lines[this._cursorInfo.currentLineIndex + 1]; + let tmpIndex = 0; + let relativeIndex = 0; + if (!this._isTextHighlightOn || this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex) { + tmpIndex = this._cursorInfo.globalStartIndex; + relativeIndex = this._cursorInfo.relativeStartIndex; + } else { + tmpIndex = this._cursorInfo.globalEndIndex; + relativeIndex = this._cursorInfo.relativeEndIndex; + } + const currentText = currentLine.text.substr(0, relativeIndex); + const currentWidth = this._contextForBreakLines.measureText(currentText).width; + let underWidth = 0; + let previousWidth = 0; + tmpIndex += currentLine.text.length - relativeIndex + currentLine.lineEnding.length; + let underLineRelativeIndex = 0; + while (underWidth < currentWidth && underLineRelativeIndex < underLine.text.length) { + tmpIndex++; + underLineRelativeIndex++; + previousWidth = Math.abs(currentWidth - underWidth); + underWidth = this._contextForBreakLines.measureText(underLine.text.substr(0, underLineRelativeIndex)).width; + } + if (Math.abs(currentWidth - underWidth) > previousWidth && underLineRelativeIndex > 0) { + tmpIndex--; + } + if (!this._isTextHighlightOn) { + this._cursorInfo.globalStartIndex = tmpIndex; + } else if (this._cursorInfo.currentLineIndex < this._highlightCursorInfo.initialLineIndex) { + this._cursorInfo.globalStartIndex = tmpIndex; + if (this._cursorInfo.globalStartIndex > this._cursorInfo.globalEndIndex) { + this._cursorInfo.globalEndIndex += this._cursorInfo.globalStartIndex; + this._cursorInfo.globalStartIndex = this._cursorInfo.globalEndIndex - this._cursorInfo.globalStartIndex; + this._cursorInfo.globalEndIndex -= this._cursorInfo.globalStartIndex; + } + } else { + this._cursorInfo.globalEndIndex = tmpIndex; + this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex; + } + } + this._markAsDirty(); + return; + } + if ((key === null || key === undefined ? undefined : key.length) === 1) { + evt === null || evt === undefined || evt.preventDefault(); + this._currentKey = key; + this.onBeforeKeyAddObservable.notifyObservers(this); + key = this._currentKey; + if (this._addKey) { + this._isTextHighlightOn = false; + this._blinkIsEven = false; + this._prevText = this._textWrapper.text; + this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, key); + this._cursorInfo.globalStartIndex += key.length; + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + this._textHasChanged(); + } + } + } + _parseLineWordWrap(line3 = "", width, context) { + const lines = []; + const words = line3.split(" "); + let lineWidth = 0; + for (let n = 0;n < words.length; n++) { + const testLine = n > 0 ? line3 + " " + words[n] : words[0]; + const metrics = context.measureText(testLine); + const testWidth = metrics.width; + if (testWidth > width) { + if (n > 0) { + lineWidth = context.measureText(line3).width; + lines.push({ text: line3, width: lineWidth, lineEnding: " " }); + } + line3 = words[n]; + let flushedLine = ""; + line3.split("").map((char) => { + if (context.measureText(flushedLine + char).width > width) { + lines.push({ text: flushedLine, width: context.measureText(flushedLine).width, lineEnding: "" }); + flushedLine = ""; + } + flushedLine += char; + }); + line3 = flushedLine; + lineWidth = context.measureText(line3).width; + } else { + lineWidth = testWidth; + line3 = testLine; + } + } + lines.push({ text: line3, width: lineWidth, lineEnding: " " }); + return lines; + } + _breakLines(refWidth, context) { + const lines = []; + const _lines = (this.text || this.placeholderText).split("\n"); + if (this.clipContent) { + for (const _line of _lines) { + lines.push(...this._parseLineWordWrap(_line, refWidth, context)); + } + } else { + for (const _line of _lines) { + lines.push(this._parseLine(_line, context)); + } + } + lines[lines.length - 1].lineEnding = "\n"; + return lines; + } + _parseLine(line3 = "", context) { + return { text: line3, width: context.measureText(line3).width, lineEnding: " " }; + } + _preMeasure(parentMeasure, context) { + if (!this._fontOffset || this._wasDirty) { + this._fontOffset = Control3._GetFontOffset(context.font); + } + let text = this._beforeRenderText(this._textWrapper).text; + if (!this.text && this._placeholderText) { + text = this._placeholderText; + } + this._textWidth = context.measureText(text).width; + const marginWidth = this._margin.getValueInPixel(this._host, parentMeasure.width) * 2; + if (this._autoStretchWidth) { + const tmpLines = text.split("\n"); + const longerString = tmpLines.reduce((acc, val) => { + const valueLength = context.measureText(val).width; + const accLength = context.measureText(acc).width; + return valueLength > accLength ? val : acc; + }, ""); + const longerStringWidth = context.measureText(longerString).width; + this.width = Math.min(this._maxWidth.getValueInPixel(this._host, parentMeasure.width), longerStringWidth + marginWidth) + "px"; + this.autoStretchWidth = true; + } + this._availableWidth = this._width.getValueInPixel(this._host, parentMeasure.width) - marginWidth; + this._lines = this._breakLines(this._availableWidth, context); + this._contextForBreakLines = context; + if (this._autoStretchHeight) { + const textHeight = this._lines.length * this._fontOffset.height; + const totalHeight = textHeight + this._margin.getValueInPixel(this._host, parentMeasure.height) * 2; + this.height = Math.min(this._maxHeight.getValueInPixel(this._host, parentMeasure.height), totalHeight) + "px"; + this._autoStretchHeight = true; + } + this._availableHeight = this._height.getValueInPixel(this._host, parentMeasure.height) - marginWidth; + if (this._isFocused) { + this._cursorInfo.currentLineIndex = 0; + let lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length; + let tmpLength = 0; + while (tmpLength + lineLength <= this._cursorInfo.globalStartIndex) { + tmpLength += lineLength; + if (this._cursorInfo.currentLineIndex < this._lines.length - 1) { + this._cursorInfo.currentLineIndex++; + lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length; + } + } + } + } + _textHasChanged() { + if (!this._prevText && this._textWrapper.text && this.placeholderText) { + this._cursorInfo.currentLineIndex = 0; + this._cursorInfo.globalStartIndex = 1; + this._cursorInfo.globalEndIndex = 1; + this._cursorInfo.relativeStartIndex = 1; + this._cursorInfo.relativeEndIndex = 1; + } + super._textHasChanged(); + } + _computeScroll() { + this._clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width); + this._clipTextTop = this._currentMeasure.top + this._margin.getValueInPixel(this._host, this._cachedParentMeasure.height); + if (this._isFocused && this._lines[this._cursorInfo.currentLineIndex].width > this._availableWidth) { + const textLeft = this._clipTextLeft - this._lines[this._cursorInfo.currentLineIndex].width + this._availableWidth; + if (!this._scrollLeft) { + this._scrollLeft = textLeft; + } + } else { + this._scrollLeft = this._clipTextLeft; + } + if (this._isFocused && !this._autoStretchHeight) { + const selectedHeight = (this._cursorInfo.currentLineIndex + 1) * this._fontOffset.height; + const textTop = this._clipTextTop - selectedHeight; + if (!this._scrollTop) { + this._scrollTop = textTop; + } + } else { + this._scrollTop = this._clipTextTop; + } + } + _additionalProcessing() { + this.highlightedText = ""; + this.onLinesReadyObservable.notifyObservers(this); + } + _drawText(text, textWidth, y, context) { + const width = this._currentMeasure.width; + let x = this._scrollLeft; + switch (this._textHorizontalAlignment) { + case Control3.HORIZONTAL_ALIGNMENT_LEFT: + x += 0; + break; + case Control3.HORIZONTAL_ALIGNMENT_RIGHT: + x += width - textWidth; + break; + case Control3.HORIZONTAL_ALIGNMENT_CENTER: + x += (width - textWidth) / 2; + break; + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + if (this.outlineWidth) { + context.strokeText(text, this._currentMeasure.left + x, y); + } + context.fillText(text, x, y); + } + _onCopyText(ev) { + this._isTextHighlightOn = false; + try { + ev.clipboardData && ev.clipboardData.setData("text/plain", this._highlightedText); + } catch (_a) { + } + this._host.clipboardData = this._highlightedText; + } + _onCutText(ev) { + if (!this._highlightedText) { + return; + } + try { + ev.clipboardData && ev.clipboardData.setData("text/plain", this._highlightedText); + } catch (_a) { + } + this._host.clipboardData = this._highlightedText; + this._prevText = this._textWrapper.text; + this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex); + this._textHasChanged(); + } + _onPasteText(ev) { + let data = ""; + if (ev.clipboardData && ev.clipboardData.types.indexOf("text/plain") !== -1) { + data = ev.clipboardData.getData("text/plain"); + } else { + data = this._host.clipboardData; + } + this._isTextHighlightOn = false; + this._prevText = this._textWrapper.text; + this._textWrapper.removePart(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex, data); + const deltaIndex = data.length - (this._cursorInfo.globalEndIndex - this._cursorInfo.globalStartIndex); + this._cursorInfo.globalStartIndex += deltaIndex; + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + this._textHasChanged(); + } + _draw(context) { + var _a, _b; + this._computeScroll(); + this._scrollLeft = (_a = this._scrollLeft) !== null && _a !== undefined ? _a : 0; + this._scrollTop = (_b = this._scrollTop) !== null && _b !== undefined ? _b : 0; + context.save(); + this._applyStates(context); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + if (this._isFocused) { + if (this._focusedBackground) { + context.fillStyle = this._isEnabled ? this._focusedBackground : this._disabledColor; + context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + } else if (this._background) { + context.fillStyle = this._isEnabled ? this._background : this._disabledColor; + context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + if (this.color) { + context.fillStyle = this.color; + } + const height = this._currentMeasure.height; + const width = this._currentMeasure.width; + let rootY = 0; + switch (this._textVerticalAlignment) { + case Control3.VERTICAL_ALIGNMENT_TOP: + rootY = this._fontOffset.ascent; + break; + case Control3.VERTICAL_ALIGNMENT_BOTTOM: + rootY = height - this._fontOffset.height * (this._lines.length - 1) - this._fontOffset.descent; + break; + case Control3.VERTICAL_ALIGNMENT_CENTER: + rootY = this._fontOffset.ascent + (height - this._fontOffset.height * this._lines.length) / 2; + break; + } + context.save(); + context.beginPath(); + context.fillStyle = this.fontStyle; + if (!this._textWrapper.text && this.placeholderText) { + context.fillStyle = this._placeholderColor; + } + context.rect(this._clipTextLeft, this._clipTextTop, this._availableWidth + 2, this._availableHeight + 2); + context.clip(); + rootY += this._scrollTop; + for (let i = 0;i < this._lines.length; i++) { + const line3 = this._lines[i]; + if (i !== 0 && this._lineSpacing.internalValue !== 0) { + if (this._lineSpacing.isPixel) { + rootY += this._lineSpacing.getValue(this._host); + } else { + rootY = rootY + this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height); + } + } + this._drawText(line3.text, line3.width, rootY, context); + rootY += this._fontOffset.height; + } + context.restore(); + if (this._isFocused) { + if (!this._blinkIsEven || this._isTextHighlightOn) { + let cursorLeft = this._scrollLeft + context.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0, this._cursorInfo.relativeStartIndex)).width; + if (cursorLeft < this._clipTextLeft) { + this._scrollLeft += this._clipTextLeft - cursorLeft; + cursorLeft = this._clipTextLeft; + this._markAsDirty(); + } else if (cursorLeft > this._clipTextLeft + this._availableWidth) { + this._scrollLeft += this._clipTextLeft + this._availableWidth - cursorLeft; + cursorLeft = this._clipTextLeft + this._availableWidth; + this._markAsDirty(); + } + let cursorTop = this._scrollTop + this._cursorInfo.currentLineIndex * this._fontOffset.height; + if (cursorTop < this._clipTextTop) { + this._scrollTop += this._clipTextTop - cursorTop; + cursorTop = this._clipTextTop; + this._markAsDirty(); + } else if (cursorTop + this._fontOffset.height > this._clipTextTop + this._availableHeight) { + this._scrollTop += this._clipTextTop + this._availableHeight - cursorTop - this._fontOffset.height; + cursorTop = this._clipTextTop + this._availableHeight - this._fontOffset.height; + this._markAsDirty(); + } + if (!this._isTextHighlightOn) { + context.fillRect(cursorLeft, cursorTop, 2, this._fontOffset.height); + } + } + this._resetBlinking(); + if (this._isTextHighlightOn) { + clearTimeout(this._blinkTimeout); + this._highlightedText = this.text.substring(this._cursorInfo.globalStartIndex, this._cursorInfo.globalEndIndex); + context.globalAlpha = this._highligherOpacity; + context.fillStyle = this._textHighlightColor; + const startLineIndex = Math.min(this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialLineIndex); + const endLineIndex = Math.max(this._cursorInfo.currentLineIndex, this._highlightCursorInfo.initialLineIndex); + let highlightRootY = this._scrollTop + startLineIndex * this._fontOffset.height; + for (let i = startLineIndex;i <= endLineIndex; i++) { + const line3 = this._lines[i]; + let highlightRootX = this._scrollLeft; + switch (this._textHorizontalAlignment) { + case Control3.HORIZONTAL_ALIGNMENT_LEFT: + highlightRootX += 0; + break; + case Control3.HORIZONTAL_ALIGNMENT_RIGHT: + highlightRootX += width - line3.width; + break; + case Control3.HORIZONTAL_ALIGNMENT_CENTER: + highlightRootX += (width - line3.width) / 2; + break; + } + const begin = i === startLineIndex ? this._cursorInfo.relativeStartIndex : 0; + const end = i === endLineIndex ? this._cursorInfo.relativeEndIndex : line3.text.length; + const leftOffsetWidth = context.measureText(line3.text.substr(0, begin)).width; + const selectedText = line3.text.substring(begin, end); + const hightlightWidth = context.measureText(selectedText).width; + context.fillRect(highlightRootX + leftOffsetWidth, highlightRootY, hightlightWidth, this._fontOffset.height); + highlightRootY += this._fontOffset.height; + } + if (this._cursorInfo.globalEndIndex === this._cursorInfo.globalStartIndex) { + this._resetBlinking(); + } + } + } + context.restore(); + if (this._thickness) { + if (this._isFocused) { + if (this.focusedColor) { + context.strokeStyle = this.focusedColor; + } + } else { + if (this.color) { + context.strokeStyle = this.color; + } + } + context.lineWidth = this._thickness; + context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, this._currentMeasure.width - this._thickness, this._currentMeasure.height - this._thickness); + } + } + _resetBlinking() { + clearTimeout(this._blinkTimeout); + this._blinkTimeout = setTimeout(() => { + this._blinkIsEven = !this._blinkIsEven; + this._markAsDirty(); + }, 500); + } + _applyStates(context) { + super._applyStates(context); + if (this.outlineWidth) { + context.lineWidth = this.outlineWidth; + context.strokeStyle = this.outlineColor; + } + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { + return false; + } + if (this.isReadOnly) { + return true; + } + this._clickedCoordinateX = coordinates.x; + this._clickedCoordinateY = coordinates.y; + this._isTextHighlightOn = false; + this._highlightedText = ""; + this._isPointerDown = true; + this._host._capturingControl[pointerId] = this; + if (this._host.focusedControl === this) { + clearTimeout(this._blinkTimeout); + this._markAsDirty(); + return true; + } + if (!this._isEnabled) { + return false; + } + this._host.focusedControl = this; + return true; + } + _onPointerMove(target, coordinates, pointerId, pi) { + if (pi.event.movementX === 0 && pi.event.movementY === 0) { + return; + } + if (this._host.focusedControl === this && this._isPointerDown && !this.isReadOnly) { + this._clickedCoordinateX = coordinates.x; + this._clickedCoordinateY = coordinates.y; + if (!this._isTextHighlightOn) { + this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; + this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; + this._highlightCursorInfo.initialRelativeStartIndex = this._cursorInfo.relativeStartIndex; + this._isTextHighlightOn = true; + } + this._markAsDirty(); + } + super._onPointerMove(target, coordinates, pointerId, pi); + } + _updateCursorPosition() { + var _a; + if (!this._isFocused) { + return; + } + if (!this._textWrapper.text && this.placeholderText) { + this._cursorInfo.currentLineIndex = 0; + this._cursorInfo.globalStartIndex = 0; + this._cursorInfo.globalEndIndex = 0; + this._cursorInfo.relativeStartIndex = 0; + this._cursorInfo.relativeEndIndex = 0; + } else { + if (this._clickedCoordinateX && this._clickedCoordinateY) { + if (!this._isTextHighlightOn) { + this._cursorInfo = { + globalStartIndex: 0, + globalEndIndex: 0, + relativeStartIndex: 0, + relativeEndIndex: 0, + currentLineIndex: 0 + }; + } + let globalIndex = 0; + let relativeIndex = 0; + const lastClickedCoordinateY = this._clickedCoordinateY - this._scrollTop; + const relativeCoordinateY = Math.floor(lastClickedCoordinateY / this._fontOffset.height); + this._cursorInfo.currentLineIndex = Math.min(Math.max(relativeCoordinateY, 0), this._lines.length - 1); + let currentSize = 0; + const relativeXPosition = this._clickedCoordinateX - ((_a = this._scrollLeft) !== null && _a !== undefined ? _a : 0); + let previousDist = 0; + for (let index = 0;index < this._cursorInfo.currentLineIndex; index++) { + const line3 = this._lines[index]; + globalIndex += line3.text.length + line3.lineEnding.length; + } + while (currentSize < relativeXPosition && this._lines[this._cursorInfo.currentLineIndex].text.length > relativeIndex) { + relativeIndex++; + previousDist = Math.abs(relativeXPosition - currentSize); + currentSize = this._contextForBreakLines.measureText(this._lines[this._cursorInfo.currentLineIndex].text.substr(0, relativeIndex)).width; + } + if (Math.abs(relativeXPosition - currentSize) > previousDist && relativeIndex > 0) { + relativeIndex--; + } + globalIndex += relativeIndex; + if (!this._isTextHighlightOn) { + this._cursorInfo.globalStartIndex = globalIndex; + this._cursorInfo.relativeStartIndex = relativeIndex; + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + this._cursorInfo.relativeEndIndex = this._cursorInfo.relativeStartIndex; + } else { + if (globalIndex < this._highlightCursorInfo.initialStartIndex) { + this._cursorInfo.globalStartIndex = globalIndex; + this._cursorInfo.relativeStartIndex = relativeIndex; + this._cursorInfo.globalEndIndex = this._highlightCursorInfo.initialStartIndex; + this._cursorInfo.relativeEndIndex = this._highlightCursorInfo.initialRelativeStartIndex; + } else { + this._cursorInfo.globalStartIndex = this._highlightCursorInfo.initialStartIndex; + this._cursorInfo.relativeStartIndex = this._highlightCursorInfo.initialRelativeStartIndex; + this._cursorInfo.globalEndIndex = globalIndex; + this._cursorInfo.relativeEndIndex = relativeIndex; + } + } + this._blinkIsEven = this._isTextHighlightOn; + this._clickedCoordinateX = null; + this._clickedCoordinateY = null; + } else { + this._cursorInfo.relativeStartIndex = 0; + this._cursorInfo.currentLineIndex = 0; + let lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length; + let tmpLength = 0; + while (tmpLength + lineLength <= this._cursorInfo.globalStartIndex) { + tmpLength += lineLength; + if (this._cursorInfo.currentLineIndex < this._lines.length - 1) { + this._cursorInfo.currentLineIndex++; + lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length; + } + } + this._cursorInfo.relativeStartIndex = this._cursorInfo.globalStartIndex - tmpLength; + if (this._highlightCursorInfo.initialStartIndex !== -1 && this._cursorInfo.globalStartIndex >= this._highlightCursorInfo.initialStartIndex) { + while (tmpLength + lineLength <= this._cursorInfo.globalEndIndex) { + tmpLength += lineLength; + if (this._cursorInfo.currentLineIndex < this._lines.length - 1) { + this._cursorInfo.currentLineIndex++; + lineLength = this._lines[this._cursorInfo.currentLineIndex].text.length + this._lines[this._cursorInfo.currentLineIndex].lineEnding.length; + } + } + this._cursorInfo.relativeEndIndex = this._cursorInfo.globalEndIndex - tmpLength; + } else if (!this._isTextHighlightOn) { + this._cursorInfo.relativeEndIndex = this._cursorInfo.relativeStartIndex; + this._cursorInfo.globalEndIndex = this._cursorInfo.globalStartIndex; + } + } + } + } + _updateValueFromCursorIndex(offset) { + } + _processDblClick(_evt) { + let moveLeft, moveRight; + do { + moveLeft = this._cursorInfo.globalStartIndex > 0 && this._textWrapper.isWord(this._cursorInfo.globalStartIndex - 1) ? --this._cursorInfo.globalStartIndex : 0; + moveRight = this._cursorInfo.globalEndIndex < this._textWrapper.length && this._textWrapper.isWord(this._cursorInfo.globalEndIndex) ? ++this._cursorInfo.globalEndIndex : 0; + } while (moveLeft || moveRight); + this._highlightCursorInfo.initialLineIndex = this._cursorInfo.currentLineIndex; + this._highlightCursorInfo.initialStartIndex = this._cursorInfo.globalStartIndex; + this.onTextHighlightObservable.notifyObservers(this); + this._isTextHighlightOn = true; + this._blinkIsEven = true; + this._markAsDirty(); + } + _selectAllText() { + this._isTextHighlightOn = true; + this._blinkIsEven = true; + this._highlightCursorInfo = { + initialStartIndex: 0, + initialRelativeStartIndex: 0, + initialLineIndex: 0 + }; + this._cursorInfo = { + globalStartIndex: 0, + globalEndIndex: this._textWrapper.length, + relativeEndIndex: this._lines[this._lines.length - 1].text.length, + relativeStartIndex: 0, + currentLineIndex: this._lines.length - 1 + }; + this._markAsDirty(); + } + dispose() { + super.dispose(); + this.onLinesReadyObservable.clear(); + } +} +var init_inputTextArea2 = __esm(() => { + init_tslib_es62(); + init_observable(); + init_control2(); + init_valueAndUnit2(); + init_typeStore(); + init_inputText2(); + init_decorators(); + __decorate2([ + serialize() + ], InputTextArea3.prototype, "autoStretchHeight", null); + __decorate2([ + serialize() + ], InputTextArea3.prototype, "maxHeight", null); + RegisterClass("BABYLON.GUI.InputTextArea", InputTextArea3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/inputPassword.js +class InputPassword3 extends InputText3 { + _getTypeName() { + return "InputPassword"; + } + _beforeRenderText(textWrapper9) { + const pwdTextWrapper = new TextWrapper3; + let txt = ""; + for (let i = 0;i < textWrapper9.length; i++) { + txt += "\u2022"; + } + pwdTextWrapper.text = txt; + return pwdTextWrapper; + } +} +var init_inputPassword2 = __esm(() => { + init_inputText2(); + init_typeStore(); + init_textWrapper2(); + RegisterClass("BABYLON.GUI.InputPassword", InputPassword3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/line.js +class Line3 extends Control3 { + get dash() { + return this._dash; + } + set dash(value) { + if (this._dash === value) { + return; + } + this._dash = value; + this._markAsDirty(); + } + get connectedControl() { + return this._connectedControl; + } + set connectedControl(value) { + if (this._connectedControl === value) { + return; + } + if (this._connectedControlDirtyObserver && this._connectedControl) { + this._connectedControl.onDirtyObservable.remove(this._connectedControlDirtyObserver); + this._connectedControlDirtyObserver = null; + } + if (value) { + this._connectedControlDirtyObserver = value.onDirtyObservable.add(() => this._markAsDirty()); + } + this._connectedControl = value; + this._markAsDirty(); + } + get x1() { + return this._x1.toString(this._host); + } + set x1(value) { + if (this._x1.toString(this._host) === value) { + return; + } + if (this._x1.fromString(value)) { + this._markAsDirty(); + } + } + get y1() { + return this._y1.toString(this._host); + } + set y1(value) { + if (this._y1.toString(this._host) === value) { + return; + } + if (this._y1.fromString(value)) { + this._markAsDirty(); + } + } + get x2() { + return this._x2.toString(this._host); + } + set x2(value) { + if (this._x2.toString(this._host) === value) { + return; + } + if (this._x2.fromString(value)) { + this._markAsDirty(); + } + } + get y2() { + return this._y2.toString(this._host); + } + set y2(value) { + if (this._y2.toString(this._host) === value) { + return; + } + if (this._y2.fromString(value)) { + this._markAsDirty(); + } + } + get lineWidth() { + return this._lineWidth; + } + set lineWidth(value) { + if (this._lineWidth === value) { + return; + } + this._lineWidth = value; + this._markAsDirty(); + } + set horizontalAlignment(value) { + return; + } + set verticalAlignment(value) { + return; + } + get _effectiveX2() { + return (this._connectedControl ? this._connectedControl.centerX : 0) + this._x2.getValue(this._host); + } + get _effectiveY2() { + return (this._connectedControl ? this._connectedControl.centerY : 0) + this._y2.getValue(this._host); + } + constructor(name335) { + super(name335); + this.name = name335; + this._lineWidth = 1; + this._x1 = new ValueAndUnit3(0); + this._y1 = new ValueAndUnit3(0); + this._x2 = new ValueAndUnit3(0); + this._y2 = new ValueAndUnit3(0); + this._dash = new Array; + this._automaticSize = true; + this.isHitTestVisible = false; + this._horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + this._verticalAlignment = Control3.VERTICAL_ALIGNMENT_TOP; + } + _getTypeName() { + return "Line"; + } + _draw(context) { + context.save(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + this._applyStates(context); + context.strokeStyle = this._getColor(context); + context.lineWidth = this._lineWidth; + context.setLineDash(this._dash); + context.beginPath(); + context.moveTo(this._cachedParentMeasure.left + this._x1.getValue(this._host), this._cachedParentMeasure.top + this._y1.getValue(this._host)); + context.lineTo(this._cachedParentMeasure.left + this._effectiveX2, this._cachedParentMeasure.top + this._effectiveY2); + context.stroke(); + context.restore(); + } + _measure() { + this._currentMeasure.width = Math.abs(this._x1.getValue(this._host) - this._effectiveX2) + this._lineWidth; + this._currentMeasure.height = Math.abs(this._y1.getValue(this._host) - this._effectiveY2) + this._lineWidth; + } + _computeAlignment(parentMeasure) { + this._currentMeasure.left = parentMeasure.left + Math.min(this._x1.getValue(this._host), this._effectiveX2) - this._lineWidth / 2; + this._currentMeasure.top = parentMeasure.top + Math.min(this._y1.getValue(this._host), this._effectiveY2) - this._lineWidth / 2; + } + moveToVector3(position3, scene50, end = false) { + if (!this._host || this.parent !== this._host._rootContainer) { + Tools.Error("Cannot move a control to a vector3 if the control is not at root level"); + return; + } + const globalViewport = this._host._getGlobalViewport(); + const projectedPosition = Vector3.Project(position3, Matrix.IdentityReadOnly, scene50.getTransformMatrix(), globalViewport); + this._moveToProjectedPosition(projectedPosition, end); + if (projectedPosition.z < 0 || projectedPosition.z > 1) { + this.notRenderable = true; + return; + } + this.notRenderable = false; + } + _moveToProjectedPosition(projectedPosition, end = false) { + const x = projectedPosition.x + this._linkOffsetX.getValue(this._host) + "px"; + const y = projectedPosition.y + this._linkOffsetY.getValue(this._host) + "px"; + if (end) { + this.x2 = x; + this.y2 = y; + this._x2.ignoreAdaptiveScaling = true; + this._y2.ignoreAdaptiveScaling = true; + } else { + this.x1 = x; + this.y1 = y; + this._x1.ignoreAdaptiveScaling = true; + this._y1.ignoreAdaptiveScaling = true; + } + } +} +var init_line2 = __esm(() => { + init_tslib_es62(); + init_math_vector(); + init_tools(); + init_control2(); + init_valueAndUnit2(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], Line3.prototype, "dash", null); + __decorate2([ + serialize() + ], Line3.prototype, "x1", null); + __decorate2([ + serialize() + ], Line3.prototype, "y1", null); + __decorate2([ + serialize() + ], Line3.prototype, "x2", null); + __decorate2([ + serialize() + ], Line3.prototype, "y2", null); + __decorate2([ + serialize() + ], Line3.prototype, "lineWidth", null); + RegisterClass("BABYLON.GUI.Line", Line3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/multiLinePoint.js +class MultiLinePoint3 { + constructor(multiLine3) { + this._multiLine = multiLine3; + this._x = new ValueAndUnit3(0); + this._y = new ValueAndUnit3(0); + this._point = new Vector3(0, 0, 0); + } + get x() { + return this._x.toString(this._multiLine._host); + } + set x(value) { + if (this._x.toString(this._multiLine._host) === value) { + return; + } + if (this._x.fromString(value)) { + this._multiLine._markAsDirty(); + } + } + get y() { + return this._y.toString(this._multiLine._host); + } + set y(value) { + if (this._y.toString(this._multiLine._host) === value) { + return; + } + if (this._y.fromString(value)) { + this._multiLine._markAsDirty(); + } + } + get control() { + return this._control; + } + set control(value) { + if (this._control === value) { + return; + } + if (this._control && this._controlObserver) { + this._control.onDirtyObservable.remove(this._controlObserver); + this._controlObserver = null; + } + this._control = value; + if (this._control) { + this._controlObserver = this._control.onDirtyObservable.add(this._multiLine.onPointUpdate); + } + this._multiLine._markAsDirty(); + } + get mesh() { + return this._mesh; + } + set mesh(value) { + if (this._mesh === value) { + return; + } + if (this._mesh && this._meshObserver) { + this._mesh.getScene().onAfterCameraRenderObservable.remove(this._meshObserver); + } + this._mesh = value; + if (this._mesh) { + this._meshObserver = this._mesh.getScene().onAfterCameraRenderObservable.add(this._multiLine.onPointUpdate); + } + this._multiLine._markAsDirty(); + } + resetLinks() { + this.control = null; + this.mesh = null; + } + translate() { + this._point = this._translatePoint(); + return this._point; + } + _translatePoint() { + if (this._mesh != null) { + return this._multiLine._host.getProjectedPositionWithZ(this._mesh.getBoundingInfo().boundingSphere.center, this._mesh.getWorldMatrix()); + } else if (this._control != null) { + return new Vector3(this._control.centerX, this._control.centerY, 1 - Epsilon); + } else { + const host = this._multiLine._host; + const xValue = this._x.getValueInPixel(host, Number(host._canvas.width)); + const yValue = this._y.getValueInPixel(host, Number(host._canvas.height)); + return new Vector3(xValue, yValue, 1 - Epsilon); + } + } + dispose() { + this.resetLinks(); + } +} +var init_multiLinePoint2 = __esm(() => { + init_math_vector(); + init_math_constants(); + init_valueAndUnit2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/multiLine.js +class MultiLine3 extends Control3 { + constructor(name335) { + super(name335); + this.name = name335; + this._lineWidth = 1; + this.onPointUpdate = () => { + this._markAsDirty(); + }; + this._automaticSize = true; + this.isHitTestVisible = false; + this._horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + this._verticalAlignment = Control3.VERTICAL_ALIGNMENT_TOP; + this._dash = []; + this._points = []; + } + get dash() { + return this._dash; + } + set dash(value) { + if (this._dash === value) { + return; + } + this._dash = value; + this._markAsDirty(); + } + getAt(index) { + if (!this._points[index]) { + this._points[index] = new MultiLinePoint3(this); + } + return this._points[index]; + } + add(...items) { + return items.map((item) => this.push(item)); + } + push(item) { + const point = this.getAt(this._points.length); + if (item == null) { + return point; + } + if (item instanceof AbstractMesh) { + point.mesh = item; + } else if (item instanceof Control3) { + point.control = item; + } else if (item.x != null && item.y != null) { + point.x = item.x; + point.y = item.y; + } + return point; + } + remove(value) { + let index; + if (value instanceof MultiLinePoint3) { + index = this._points.indexOf(value); + if (index === -1) { + return; + } + } else { + index = value; + } + const point = this._points[index]; + if (!point) { + return; + } + point.dispose(); + this._points.splice(index, 1); + } + reset() { + while (this._points.length > 0) { + this.remove(this._points.length - 1); + } + } + resetLinks() { + this._points.forEach((point) => { + if (point != null) { + point.resetLinks(); + } + }); + } + get lineWidth() { + return this._lineWidth; + } + set lineWidth(value) { + if (this._lineWidth === value) { + return; + } + this._lineWidth = value; + this._markAsDirty(); + } + set horizontalAlignment(value) { + return; + } + set verticalAlignment(value) { + return; + } + _getTypeName() { + return "MultiLine"; + } + _draw(context) { + context.save(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + this._applyStates(context); + context.strokeStyle = this.color; + context.lineWidth = this._lineWidth; + context.setLineDash(this._dash); + context.beginPath(); + let first = true; + let previousPoint; + this._points.forEach((point) => { + if (!point) { + return; + } + if (first) { + context.moveTo(point._point.x, point._point.y); + first = false; + } else { + if (point._point.z < 1 && previousPoint.z < 1) { + context.lineTo(point._point.x, point._point.y); + } else { + context.moveTo(point._point.x, point._point.y); + } + } + previousPoint = point._point; + }); + context.stroke(); + context.restore(); + } + _additionalProcessing() { + this._minX = null; + this._minY = null; + this._maxX = null; + this._maxY = null; + this._points.forEach((point) => { + if (!point) { + return; + } + point.translate(); + if (this._minX == null || point._point.x < this._minX) { + this._minX = point._point.x; + } + if (this._minY == null || point._point.y < this._minY) { + this._minY = point._point.y; + } + if (this._maxX == null || point._point.x > this._maxX) { + this._maxX = point._point.x; + } + if (this._maxY == null || point._point.y > this._maxY) { + this._maxY = point._point.y; + } + }); + if (this._minX == null) { + this._minX = 0; + } + if (this._minY == null) { + this._minY = 0; + } + if (this._maxX == null) { + this._maxX = 0; + } + if (this._maxY == null) { + this._maxY = 0; + } + } + _measure() { + if (this._minX == null || this._maxX == null || this._minY == null || this._maxY == null) { + return; + } + this._currentMeasure.width = Math.abs(this._maxX - this._minX) + this._lineWidth; + this._currentMeasure.height = Math.abs(this._maxY - this._minY) + this._lineWidth; + } + _computeAlignment() { + if (this._minX == null || this._minY == null) { + return; + } + this._currentMeasure.left = this._minX - this._lineWidth / 2; + this._currentMeasure.top = this._minY - this._lineWidth / 2; + } + dispose() { + this.reset(); + super.dispose(); + } +} +var init_multiLine2 = __esm(() => { + init_tslib_es62(); + init_abstractMesh(); + init_control2(); + init_multiLinePoint2(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], MultiLine3.prototype, "dash", null); + RegisterClass("BABYLON.GUI.MultiLine", MultiLine3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/radioButton.js +class RadioButton3 extends Control3 { + get thickness() { + return this._thickness; + } + set thickness(value) { + if (this._thickness === value) { + return; + } + this._thickness = value; + this._markAsDirty(); + } + get checkSizeRatio() { + return this._checkSizeRatio; + } + set checkSizeRatio(value) { + value = Math.max(Math.min(1, value), 0); + if (this._checkSizeRatio === value) { + return; + } + this._checkSizeRatio = value; + this._markAsDirty(); + } + get background() { + return this._background; + } + set background(value) { + if (this._background === value) { + return; + } + this._background = value; + this._markAsDirty(); + } + get isChecked() { + return this._isChecked; + } + set isChecked(value) { + if (this._isChecked === value) { + return; + } + this._isChecked = value; + this._markAsDirty(); + this.onIsCheckedChangedObservable.notifyObservers(value); + if (this._isChecked && this._host) { + this._host.executeOnAllControls((control63) => { + if (control63 === this) { + return; + } + if (control63.group === undefined) { + return; + } + const childRadio = control63; + if (childRadio.group === this.group) { + childRadio.isChecked = false; + } + }); + } + } + constructor(name335) { + super(name335); + this.name = name335; + this._isChecked = false; + this._background = "black"; + this._checkSizeRatio = 0.8; + this._thickness = 1; + this.group = ""; + this.onIsCheckedChangedObservable = new Observable; + this.isPointerBlocker = true; + } + _getTypeName() { + return "RadioButton"; + } + _draw(context) { + context.save(); + this._applyStates(context); + const actualWidth = this._currentMeasure.width - this._thickness; + const actualHeight = this._currentMeasure.height - this._thickness; + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + Control3.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2 - this._thickness / 2, this._currentMeasure.height / 2 - this._thickness / 2, context); + context.fillStyle = this._isEnabled ? this._background : this._disabledColor; + context.fill(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + context.strokeStyle = this.color; + context.lineWidth = this._thickness; + context.stroke(); + if (this._isChecked) { + context.fillStyle = this._isEnabled ? this.color : this._disabledColor; + const offsetWidth = actualWidth * this._checkSizeRatio; + const offseHeight = actualHeight * this._checkSizeRatio; + Control3.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, offsetWidth / 2 - this._thickness / 2, offseHeight / 2 - this._thickness / 2, context); + context.fill(); + } + context.restore(); + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { + return false; + } + if (this.isReadOnly) { + return true; + } + if (!this.isChecked) { + this.isChecked = true; + } + return true; + } + static AddRadioButtonWithHeader(title, group, isChecked, onValueChanged) { + const panel = new StackPanel3; + panel.isVertical = false; + panel.height = "30px"; + const radio = new RadioButton3; + radio.width = "20px"; + radio.height = "20px"; + radio.isChecked = isChecked; + radio.color = "green"; + radio.group = group; + radio.onIsCheckedChangedObservable.add((value) => onValueChanged(radio, value)); + panel.addControl(radio); + const header = new TextBlock3; + header.text = title; + header.width = "180px"; + header.paddingLeft = "5px"; + header.textHorizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + header.color = "white"; + panel.addControl(header); + return panel; + } +} +var init_radioButton2 = __esm(() => { + init_tslib_es62(); + init_observable(); + init_control2(); + init_stackPanel2(); + init_textBlock2(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], RadioButton3.prototype, "thickness", null); + __decorate2([ + serialize() + ], RadioButton3.prototype, "group", undefined); + __decorate2([ + serialize() + ], RadioButton3.prototype, "checkSizeRatio", null); + __decorate2([ + serialize() + ], RadioButton3.prototype, "background", null); + __decorate2([ + serialize() + ], RadioButton3.prototype, "isChecked", null); + RegisterClass("BABYLON.GUI.RadioButton", RadioButton3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/sliders/baseSlider.js +class BaseSlider3 extends Control3 { + get displayThumb() { + return this._displayThumb; + } + set displayThumb(value) { + if (this._displayThumb === value) { + return; + } + this._displayThumb = value; + this._markAsDirty(); + } + get step() { + return this._step; + } + set step(value) { + if (this._step === value) { + return; + } + this._step = value; + this._markAsDirty(); + } + get barOffset() { + return this._barOffset.toString(this._host); + } + get barOffsetInPixels() { + return this._barOffset.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set barOffset(value) { + if (this._barOffset.toString(this._host) === value) { + return; + } + if (this._barOffset.fromString(value)) { + this._markAsDirty(); + } + } + get thumbWidth() { + return this._thumbWidth.toString(this._host); + } + get thumbWidthInPixels() { + return this._thumbWidth.getValueInPixel(this._host, this._cachedParentMeasure.width); + } + set thumbWidth(value) { + if (this._thumbWidth.toString(this._host) === value) { + return; + } + if (this._thumbWidth.fromString(value)) { + this._markAsDirty(); + } + } + get minimum() { + return this._minimum; + } + set minimum(value) { + if (this._minimum === value) { + return; + } + this._minimum = value; + this._markAsDirty(); + this.value = Math.max(Math.min(this.value, this._maximum), this._minimum); + } + get maximum() { + return this._maximum; + } + set maximum(value) { + if (this._maximum === value) { + return; + } + this._maximum = value; + this._markAsDirty(); + this.value = Math.max(Math.min(this.value, this._maximum), this._minimum); + } + get value() { + return this._value; + } + set value(value) { + value = Math.max(Math.min(value, this._maximum), this._minimum); + if (this._value === value) { + return; + } + this._value = value; + this._markAsDirty(); + this.onValueChangedObservable.notifyObservers(this._value); + } + get isVertical() { + return this._isVertical; + } + set isVertical(value) { + if (this._isVertical === value) { + return; + } + this._isVertical = value; + this._markAsDirty(); + } + get isThumbClamped() { + return this._isThumbClamped; + } + set isThumbClamped(value) { + if (this._isThumbClamped === value) { + return; + } + this._isThumbClamped = value; + this._markAsDirty(); + } + constructor(name335) { + super(name335); + this.name = name335; + this._thumbWidth = new ValueAndUnit3(20, ValueAndUnit3.UNITMODE_PIXEL, false); + this._minimum = 0; + this._maximum = 100; + this._value = 50; + this._isVertical = false; + this._barOffset = new ValueAndUnit3(5, ValueAndUnit3.UNITMODE_PIXEL, false); + this._isThumbClamped = false; + this._displayThumb = true; + this._step = 0; + this._lastPointerDownId = -1; + this._effectiveBarOffset = 0; + this.onValueChangedObservable = new Observable; + this._pointerIsDown = false; + this.isPointerBlocker = true; + } + _getTypeName() { + return "BaseSlider"; + } + _getThumbPosition() { + if (this.isVertical) { + return (this.maximum - this.value) / (this.maximum - this.minimum) * this._backgroundBoxLength; + } + return (this.value - this.minimum) / (this.maximum - this.minimum) * this._backgroundBoxLength; + } + _getThumbThickness(type) { + let thumbThickness = 0; + switch (type) { + case "circle": + if (this._thumbWidth.isPixel) { + thumbThickness = Math.max(this._thumbWidth.getValue(this._host), this._backgroundBoxThickness); + } else { + thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host); + } + break; + case "rectangle": + if (this._thumbWidth.isPixel) { + thumbThickness = Math.min(this._thumbWidth.getValue(this._host), this._backgroundBoxThickness); + } else { + thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host); + } + } + return thumbThickness; + } + _prepareRenderingData(type) { + this._effectiveBarOffset = 0; + this._renderLeft = this._currentMeasure.left; + this._renderTop = this._currentMeasure.top; + this._renderWidth = this._currentMeasure.width; + this._renderHeight = this._currentMeasure.height; + this._backgroundBoxLength = Math.max(this._currentMeasure.width, this._currentMeasure.height); + this._backgroundBoxThickness = Math.min(this._currentMeasure.width, this._currentMeasure.height); + this._effectiveThumbThickness = this._getThumbThickness(type); + if (this.displayThumb) { + this._backgroundBoxLength -= this._effectiveThumbThickness; + } + if (this.isVertical && this._currentMeasure.height < this._currentMeasure.width) { + console.error("Height should be greater than width"); + return; + } + if (this._barOffset.isPixel) { + this._effectiveBarOffset = Math.min(this._barOffset.getValue(this._host), this._backgroundBoxThickness); + } else { + this._effectiveBarOffset = this._backgroundBoxThickness * this._barOffset.getValue(this._host); + } + this._backgroundBoxThickness -= this._effectiveBarOffset * 2; + if (this.isVertical) { + this._renderLeft += this._effectiveBarOffset; + if (!this.isThumbClamped && this.displayThumb) { + this._renderTop += this._effectiveThumbThickness / 2; + } + this._renderHeight = this._backgroundBoxLength; + this._renderWidth = this._backgroundBoxThickness; + } else { + this._renderTop += this._effectiveBarOffset; + if (!this.isThumbClamped && this.displayThumb) { + this._renderLeft += this._effectiveThumbThickness / 2; + } + this._renderHeight = this._backgroundBoxThickness; + this._renderWidth = this._backgroundBoxLength; + } + } + _updateValueFromPointer(x, y) { + if (this.rotation != 0) { + this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition); + x = this._transformedPosition.x; + y = this._transformedPosition.y; + } + let value; + if (this._isVertical) { + value = this._minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this._maximum - this._minimum); + } else { + value = this._minimum + (x - this._currentMeasure.left) / this._currentMeasure.width * (this._maximum - this._minimum); + } + this.value = this._step ? Math.round(value / this._step) * this._step : value; + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { + return false; + } + if (this.isReadOnly) { + return true; + } + this._pointerIsDown = true; + this._updateValueFromPointer(coordinates.x, coordinates.y); + this._host._capturingControl[pointerId] = this; + this._lastPointerDownId = pointerId; + return true; + } + _onPointerMove(target, coordinates, pointerId, pi) { + if (pointerId != this._lastPointerDownId) { + return; + } + if (this._pointerIsDown && !this.isReadOnly) { + this._updateValueFromPointer(coordinates.x, coordinates.y); + } + super._onPointerMove(target, coordinates, pointerId, pi); + } + _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick) { + this._pointerIsDown = false; + delete this._host._capturingControl[pointerId]; + super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick); + } + _onCanvasBlur() { + this._forcePointerUp(); + super._onCanvasBlur(); + } +} +var init_baseSlider2 = __esm(() => { + init_tslib_es62(); + init_observable(); + init_control2(); + init_valueAndUnit2(); + init_decorators(); + __decorate2([ + serialize() + ], BaseSlider3.prototype, "displayThumb", null); + __decorate2([ + serialize() + ], BaseSlider3.prototype, "step", null); + __decorate2([ + serialize() + ], BaseSlider3.prototype, "barOffset", null); + __decorate2([ + serialize() + ], BaseSlider3.prototype, "thumbWidth", null); + __decorate2([ + serialize() + ], BaseSlider3.prototype, "minimum", null); + __decorate2([ + serialize() + ], BaseSlider3.prototype, "maximum", null); + __decorate2([ + serialize() + ], BaseSlider3.prototype, "value", null); + __decorate2([ + serialize() + ], BaseSlider3.prototype, "isVertical", null); + __decorate2([ + serialize() + ], BaseSlider3.prototype, "isThumbClamped", null); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/sliders/slider.js +class Slider3 extends BaseSlider3 { + get displayValueBar() { + return this._displayValueBar; + } + set displayValueBar(value) { + if (this._displayValueBar === value) { + return; + } + this._displayValueBar = value; + this._markAsDirty(); + } + get borderColor() { + return this._borderColor; + } + set borderColor(value) { + if (this._borderColor === value) { + return; + } + this._borderColor = value; + this._markAsDirty(); + } + get background() { + return this._background; + } + set background(value) { + if (this._background === value) { + return; + } + this._background = value; + this._markAsDirty(); + } + get backgroundGradient() { + return this._backgroundGradient; + } + set backgroundGradient(value) { + if (this._backgroundGradient === value) { + return; + } + this._backgroundGradient = value; + this._markAsDirty(); + } + get thumbColor() { + return this._thumbColor; + } + set thumbColor(value) { + if (this._thumbColor === value) { + return; + } + this._thumbColor = value; + this._markAsDirty(); + } + get isThumbCircle() { + return this._isThumbCircle; + } + set isThumbCircle(value) { + if (this._isThumbCircle === value) { + return; + } + this._isThumbCircle = value; + this._markAsDirty(); + } + constructor(name335) { + super(name335); + this.name = name335; + this._background = "black"; + this._borderColor = "white"; + this._thumbColor = ""; + this._isThumbCircle = false; + this._displayValueBar = true; + this._backgroundGradient = null; + } + _getTypeName() { + return "Slider"; + } + _getBackgroundColor(context) { + return this._backgroundGradient ? this._backgroundGradient.getCanvasGradient(context) : this._background; + } + _draw(context) { + context.save(); + this._applyStates(context); + this._prepareRenderingData(this.isThumbCircle ? "circle" : "rectangle"); + let left = this._renderLeft; + let top = this._renderTop; + const width = this._renderWidth; + const height = this._renderHeight; + let radius = 0; + if (this.isThumbClamped && this.isThumbCircle) { + if (this.isVertical) { + top += this._effectiveThumbThickness / 2; + } else { + left += this._effectiveThumbThickness / 2; + } + radius = this._backgroundBoxThickness / 2; + } else { + radius = (this._effectiveThumbThickness - this._effectiveBarOffset) / 2; + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + const thumbPosition = this._getThumbPosition(); + context.fillStyle = this._getBackgroundColor(context); + if (this.isVertical) { + if (this.isThumbClamped) { + if (this.isThumbCircle) { + context.beginPath(); + context.arc(left + this._backgroundBoxThickness / 2, top, radius, Math.PI, 2 * Math.PI); + context.fill(); + context.fillRect(left, top, width, height); + } else { + context.fillRect(left, top, width, height + this._effectiveThumbThickness); + } + } else { + context.fillRect(left, top, width, height); + } + } else { + if (this.isThumbClamped) { + if (this.isThumbCircle) { + context.beginPath(); + context.arc(left + this._backgroundBoxLength, top + this._backgroundBoxThickness / 2, radius, 0, 2 * Math.PI); + context.fill(); + context.fillRect(left, top, width, height); + } else { + context.fillRect(left, top, width + this._effectiveThumbThickness, height); + } + } else { + context.fillRect(left, top, width, height); + } + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + context.fillStyle = this._getColor(context); + if (this._displayValueBar) { + if (this.isVertical) { + if (this.isThumbClamped) { + if (this.isThumbCircle) { + context.beginPath(); + context.arc(left + this._backgroundBoxThickness / 2, top + this._backgroundBoxLength, radius, 0, 2 * Math.PI); + context.fill(); + context.fillRect(left, top + thumbPosition, width, height - thumbPosition); + } else { + context.fillRect(left, top + thumbPosition, width, height - thumbPosition + this._effectiveThumbThickness); + } + } else { + context.fillRect(left, top + thumbPosition, width, height - thumbPosition); + } + } else { + if (this.isThumbClamped) { + if (this.isThumbCircle) { + context.beginPath(); + context.arc(left, top + this._backgroundBoxThickness / 2, radius, 0, 2 * Math.PI); + context.fill(); + context.fillRect(left, top, thumbPosition, height); + } else { + context.fillRect(left, top, thumbPosition, height); + } + } else { + context.fillRect(left, top, thumbPosition, height); + } + } + } + context.fillStyle = this._thumbColor || this._getColor(context); + if (this.displayThumb) { + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + } + if (this._isThumbCircle) { + context.beginPath(); + if (this.isVertical) { + context.arc(left + this._backgroundBoxThickness / 2, top + thumbPosition, radius, 0, 2 * Math.PI); + } else { + context.arc(left + thumbPosition, top + this._backgroundBoxThickness / 2, radius, 0, 2 * Math.PI); + } + context.fill(); + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + context.strokeStyle = this._borderColor; + context.stroke(); + } else { + if (this.isVertical) { + context.fillRect(left - this._effectiveBarOffset, this._currentMeasure.top + thumbPosition, this._currentMeasure.width, this._effectiveThumbThickness); + } else { + context.fillRect(this._currentMeasure.left + thumbPosition, this._currentMeasure.top, this._effectiveThumbThickness, this._currentMeasure.height); + } + if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) { + context.shadowBlur = 0; + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + } + context.strokeStyle = this._borderColor; + if (this.isVertical) { + context.strokeRect(left - this._effectiveBarOffset, this._currentMeasure.top + thumbPosition, this._currentMeasure.width, this._effectiveThumbThickness); + } else { + context.strokeRect(this._currentMeasure.left + thumbPosition, this._currentMeasure.top, this._effectiveThumbThickness, this._currentMeasure.height); + } + } + } + context.restore(); + } + serialize(serializationObject) { + super.serialize(serializationObject); + if (this.backgroundGradient) { + serializationObject.backgroundGradient = {}; + this.backgroundGradient.serialize(serializationObject.backgroundGradient); + } + } + _parseFromContent(serializedObject, host) { + super._parseFromContent(serializedObject, host); + if (serializedObject.backgroundGradient) { + const className2 = Tools.Instantiate("BABYLON.GUI." + serializedObject.backgroundGradient.className); + this.backgroundGradient = new className2; + this.backgroundGradient.parse(serializedObject.backgroundGradient); + } + } +} +var init_slider2 = __esm(() => { + init_tslib_es62(); + init_baseSlider2(); + init_typeStore(); + init_decorators(); + init_tools(); + __decorate2([ + serialize() + ], Slider3.prototype, "displayValueBar", null); + __decorate2([ + serialize() + ], Slider3.prototype, "borderColor", null); + __decorate2([ + serialize() + ], Slider3.prototype, "background", null); + __decorate2([ + serialize() + ], Slider3.prototype, "thumbColor", null); + __decorate2([ + serialize() + ], Slider3.prototype, "isThumbCircle", null); + RegisterClass("BABYLON.GUI.Slider", Slider3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/selector.js +class SelectorGroup2 { + constructor(name335) { + this.name = name335; + this._groupPanel = new StackPanel3; + this._selectors = new Array; + this._groupPanel.verticalAlignment = Control3.VERTICAL_ALIGNMENT_TOP; + this._groupPanel.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + this._groupHeader = this._addGroupHeader(name335); + } + get groupPanel() { + return this._groupPanel; + } + get selectors() { + return this._selectors; + } + get header() { + return this._groupHeader.text; + } + set header(label) { + if (this._groupHeader.text === "label") { + return; + } + this._groupHeader.text = label; + } + _addGroupHeader(text) { + const groupHeading = new TextBlock3("groupHead", text); + groupHeading.width = 0.9; + groupHeading.height = "30px"; + groupHeading.textWrapping = true; + groupHeading.color = "black"; + groupHeading.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + groupHeading.textHorizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + groupHeading.left = "2px"; + this._groupPanel.addControl(groupHeading); + return groupHeading; + } + _getSelector(selectorNb) { + if (selectorNb < 0 || selectorNb >= this._selectors.length) { + return; + } + return this._selectors[selectorNb]; + } + removeSelector(selectorNb) { + if (selectorNb < 0 || selectorNb >= this._selectors.length) { + return; + } + this._groupPanel.removeControl(this._selectors[selectorNb]); + this._selectors.splice(selectorNb, 1); + } +} + +class CheckboxGroup2 extends SelectorGroup2 { + addCheckbox(text, func = (s) => { + }, checked = false) { + checked = checked || false; + const button11 = new Checkbox3; + button11.width = "20px"; + button11.height = "20px"; + button11.color = "#364249"; + button11.background = "#CCCCCC"; + button11.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + button11.onIsCheckedChangedObservable.add(function(state) { + func(state); + }); + const _selector = Control3.AddHeader(button11, text, "200px", { isHorizontal: true, controlFirst: true }); + _selector.height = "30px"; + _selector.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + _selector.left = "4px"; + this.groupPanel.addControl(_selector); + this.selectors.push(_selector); + button11.isChecked = checked; + if (this.groupPanel.parent && this.groupPanel.parent.parent) { + button11.color = this.groupPanel.parent.parent.buttonColor; + button11.background = this.groupPanel.parent.parent.buttonBackground; + } + } + _setSelectorLabel(selectorNb, label) { + this.selectors[selectorNb].children[1].text = label; + } + _setSelectorLabelColor(selectorNb, color) { + this.selectors[selectorNb].children[1].color = color; + } + _setSelectorButtonColor(selectorNb, color) { + this.selectors[selectorNb].children[0].color = color; + } + _setSelectorButtonBackground(selectorNb, color) { + this.selectors[selectorNb].children[0].background = color; + } +} + +class RadioGroup2 extends SelectorGroup2 { + constructor() { + super(...arguments); + this._selectNb = 0; + } + addRadio(label, func = (n) => { + }, checked = false) { + const nb = this._selectNb++; + const button11 = new RadioButton3; + button11.name = label; + button11.width = "20px"; + button11.height = "20px"; + button11.color = "#364249"; + button11.background = "#CCCCCC"; + button11.group = this.name; + button11.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + button11.onIsCheckedChangedObservable.add(function(state) { + if (state) { + func(nb); + } + }); + const _selector = Control3.AddHeader(button11, label, "200px", { isHorizontal: true, controlFirst: true }); + _selector.height = "30px"; + _selector.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + _selector.left = "4px"; + this.groupPanel.addControl(_selector); + this.selectors.push(_selector); + button11.isChecked = checked; + if (this.groupPanel.parent && this.groupPanel.parent.parent) { + button11.color = this.groupPanel.parent.parent.buttonColor; + button11.background = this.groupPanel.parent.parent.buttonBackground; + } + } + _setSelectorLabel(selectorNb, label) { + this.selectors[selectorNb].children[1].text = label; + } + _setSelectorLabelColor(selectorNb, color) { + this.selectors[selectorNb].children[1].color = color; + } + _setSelectorButtonColor(selectorNb, color) { + this.selectors[selectorNb].children[0].color = color; + } + _setSelectorButtonBackground(selectorNb, color) { + this.selectors[selectorNb].children[0].background = color; + } +} + +class SliderGroup2 extends SelectorGroup2 { + addSlider(label, func = (v) => { + }, unit = "Units", min = 0, max = 0, value = 0, onValueChange = (v) => { + return v | 0; + }) { + const button11 = new Slider3; + button11.name = unit; + button11.value = value; + button11.minimum = min; + button11.maximum = max; + button11.width = 0.9; + button11.height = "20px"; + button11.color = "#364249"; + button11.background = "#CCCCCC"; + button11.borderColor = "black"; + button11.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + button11.left = "4px"; + button11.paddingBottom = "4px"; + button11.onValueChangedObservable.add(function(value2) { + button11.parent.children[0].text = button11.parent.children[0].name + ": " + onValueChange(value2) + " " + button11.name; + func(value2); + }); + const _selector = Control3.AddHeader(button11, label + ": " + onValueChange(value) + " " + unit, "30px", { isHorizontal: false, controlFirst: false }); + _selector.height = "60px"; + _selector.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + _selector.left = "4px"; + _selector.children[0].name = label; + this.groupPanel.addControl(_selector); + this.selectors.push(_selector); + if (this.groupPanel.parent && this.groupPanel.parent.parent) { + button11.color = this.groupPanel.parent.parent.buttonColor; + button11.background = this.groupPanel.parent.parent.buttonBackground; + } + } + _setSelectorLabel(selectorNb, label) { + this.selectors[selectorNb].children[0].name = label; + this.selectors[selectorNb].children[0].text = label + ": " + this.selectors[selectorNb].children[1].value + " " + this.selectors[selectorNb].children[1].name; + } + _setSelectorLabelColor(selectorNb, color) { + this.selectors[selectorNb].children[0].color = color; + } + _setSelectorButtonColor(selectorNb, color) { + this.selectors[selectorNb].children[1].color = color; + } + _setSelectorButtonBackground(selectorNb, color) { + this.selectors[selectorNb].children[1].background = color; + } +} + +class SelectionPanel2 extends Rectangle3 { + constructor(name335, groups = []) { + super(name335); + this.name = name335; + this.groups = groups; + this._buttonColor = "#364249"; + this._buttonBackground = "#CCCCCC"; + this._headerColor = "black"; + this._barColor = "white"; + this._barHeight = "2px"; + this._spacerHeight = "20px"; + this._bars = new Array; + this._groups = groups; + this.thickness = 2; + this._panel = new StackPanel3; + this._panel.verticalAlignment = Control3.VERTICAL_ALIGNMENT_TOP; + this._panel.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + this._panel.top = 5; + this._panel.left = 5; + this._panel.width = 0.95; + if (groups.length > 0) { + for (let i = 0;i < groups.length - 1; i++) { + this._panel.addControl(groups[i].groupPanel); + this._addSpacer(); + } + this._panel.addControl(groups[groups.length - 1].groupPanel); + } + this.addControl(this._panel); + } + _getTypeName() { + return "SelectionPanel"; + } + get panel() { + return this._panel; + } + get headerColor() { + return this._headerColor; + } + set headerColor(color) { + if (this._headerColor === color) { + return; + } + this._headerColor = color; + this._setHeaderColor(); + } + _setHeaderColor() { + for (let i = 0;i < this._groups.length; i++) { + this._groups[i].groupPanel.children[0].color = this._headerColor; + } + } + get buttonColor() { + return this._buttonColor; + } + set buttonColor(color) { + if (this._buttonColor === color) { + return; + } + this._buttonColor = color; + this._setbuttonColor(); + } + _setbuttonColor() { + for (let i = 0;i < this._groups.length; i++) { + for (let j = 0;j < this._groups[i].selectors.length; j++) { + this._groups[i]._setSelectorButtonColor(j, this._buttonColor); + } + } + } + get labelColor() { + return this._labelColor; + } + set labelColor(color) { + if (this._labelColor === color) { + return; + } + this._labelColor = color; + this._setLabelColor(); + } + _setLabelColor() { + for (let i = 0;i < this._groups.length; i++) { + for (let j = 0;j < this._groups[i].selectors.length; j++) { + this._groups[i]._setSelectorLabelColor(j, this._labelColor); + } + } + } + get buttonBackground() { + return this._buttonBackground; + } + set buttonBackground(color) { + if (this._buttonBackground === color) { + return; + } + this._buttonBackground = color; + this._setButtonBackground(); + } + _setButtonBackground() { + for (let i = 0;i < this._groups.length; i++) { + for (let j = 0;j < this._groups[i].selectors.length; j++) { + this._groups[i]._setSelectorButtonBackground(j, this._buttonBackground); + } + } + } + get barColor() { + return this._barColor; + } + set barColor(color) { + if (this._barColor === color) { + return; + } + this._barColor = color; + this._setBarColor(); + } + _setBarColor() { + for (let i = 0;i < this._bars.length; i++) { + this._bars[i].children[0].background = this._barColor; + } + } + get barHeight() { + return this._barHeight; + } + set barHeight(value) { + if (this._barHeight === value) { + return; + } + this._barHeight = value; + this._setBarHeight(); + } + _setBarHeight() { + for (let i = 0;i < this._bars.length; i++) { + this._bars[i].children[0].height = this._barHeight; + } + } + get spacerHeight() { + return this._spacerHeight; + } + set spacerHeight(value) { + if (this._spacerHeight === value) { + return; + } + this._spacerHeight = value; + this._setSpacerHeight(); + } + _setSpacerHeight() { + for (let i = 0;i < this._bars.length; i++) { + this._bars[i].height = this._spacerHeight; + } + } + _addSpacer() { + const separator = new Container3; + separator.width = 1; + separator.height = this._spacerHeight; + separator.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + const bar = new Rectangle3; + bar.width = 1; + bar.height = this._barHeight; + bar.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + bar.verticalAlignment = Control3.VERTICAL_ALIGNMENT_CENTER; + bar.background = this._barColor; + bar.color = "transparent"; + separator.addControl(bar); + this._panel.addControl(separator); + this._bars.push(separator); + } + addGroup(group) { + if (this._groups.length > 0) { + this._addSpacer(); + } + this._panel.addControl(group.groupPanel); + this._groups.push(group); + group.groupPanel.children[0].color = this._headerColor; + for (let j = 0;j < group.selectors.length; j++) { + group._setSelectorButtonColor(j, this._buttonColor); + group._setSelectorButtonBackground(j, this._buttonBackground); + } + } + removeGroup(groupNb) { + if (groupNb < 0 || groupNb >= this._groups.length) { + return; + } + const group = this._groups[groupNb]; + this._panel.removeControl(group.groupPanel); + this._groups.splice(groupNb, 1); + if (groupNb < this._bars.length) { + this._panel.removeControl(this._bars[groupNb]); + this._bars.splice(groupNb, 1); + } + } + setHeaderName(label, groupNb) { + if (groupNb < 0 || groupNb >= this._groups.length) { + return; + } + const group = this._groups[groupNb]; + group.groupPanel.children[0].text = label; + } + relabel(label, groupNb, selectorNb) { + if (groupNb < 0 || groupNb >= this._groups.length) { + return; + } + const group = this._groups[groupNb]; + if (selectorNb < 0 || selectorNb >= group.selectors.length) { + return; + } + group._setSelectorLabel(selectorNb, label); + } + removeFromGroupSelector(groupNb, selectorNb) { + if (groupNb < 0 || groupNb >= this._groups.length) { + return; + } + const group = this._groups[groupNb]; + if (selectorNb < 0 || selectorNb >= group.selectors.length) { + return; + } + group.removeSelector(selectorNb); + } + addToGroupCheckbox(groupNb, label, func = () => { + }, checked = false) { + if (groupNb < 0 || groupNb >= this._groups.length) { + return; + } + const group = this._groups[groupNb]; + group.addCheckbox(label, func, checked); + } + addToGroupRadio(groupNb, label, func = () => { + }, checked = false) { + if (groupNb < 0 || groupNb >= this._groups.length) { + return; + } + const group = this._groups[groupNb]; + group.addRadio(label, func, checked); + } + addToGroupSlider(groupNb, label, func = () => { + }, unit = "Units", min = 0, max = 0, value = 0, onVal = (v) => { + return v | 0; + }) { + if (groupNb < 0 || groupNb >= this._groups.length) { + return; + } + const group = this._groups[groupNb]; + group.addSlider(label, func, unit, min, max, value, onVal); + } +} +var init_selector2 = __esm(() => { + init_rectangle2(); + init_stackPanel2(); + init_control2(); + init_textBlock2(); + init_checkbox2(); + init_radioButton2(); + init_slider2(); + init_container2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/scrollViewers/scrollViewerWindow.js +class _ScrollViewerWindow3 extends Container3 { + get freezeControls() { + return this._freezeControls; + } + set freezeControls(value) { + if (this._freezeControls === value) { + return; + } + if (!value) { + this._restoreMeasures(); + } + this._freezeControls = false; + const textureSize = this.host.getSize(); + const renderWidth = textureSize.width; + const renderHeight = textureSize.height; + const context = this.host.getContext(); + const measure20 = new Measure3(0, 0, renderWidth, renderHeight); + this.host._numLayoutCalls = 0; + this.host._rootContainer._layout(measure20, context); + if (value) { + this._updateMeasures(); + if (this._useBuckets()) { + this._makeBuckets(); + } + } + this._freezeControls = value; + this.host.markAsDirty(); + } + get bucketWidth() { + return this._bucketWidth; + } + get bucketHeight() { + return this._bucketHeight; + } + setBucketSizes(width, height) { + this._bucketWidth = width; + this._bucketHeight = height; + if (this._useBuckets()) { + if (this._freezeControls) { + this._makeBuckets(); + } + } else { + this._buckets = {}; + } + } + _useBuckets() { + return this._bucketWidth > 0 && this._bucketHeight > 0; + } + _makeBuckets() { + this._buckets = {}; + this._bucketLen = Math.ceil(this.widthInPixels / this._bucketWidth); + this._dispatchInBuckets(this._children); + this._oldLeft = null; + this._oldTop = null; + } + _dispatchInBuckets(children) { + for (let i = 0;i < children.length; ++i) { + const child = children[i]; + const bStartX = Math.max(0, Math.floor((child._customData._origLeft - this._customData.origLeft) / this._bucketWidth)), bEndX = Math.floor((child._customData._origLeft - this._customData.origLeft + child._currentMeasure.width - 1) / this._bucketWidth), bEndY = Math.floor((child._customData._origTop - this._customData.origTop + child._currentMeasure.height - 1) / this._bucketHeight); + let bStartY = Math.max(0, Math.floor((child._customData._origTop - this._customData.origTop) / this._bucketHeight)); + while (bStartY <= bEndY) { + for (let x = bStartX;x <= bEndX; ++x) { + const bucket = bStartY * this._bucketLen + x; + let lstc = this._buckets[bucket]; + if (!lstc) { + lstc = []; + this._buckets[bucket] = lstc; + } + lstc.push(child); + } + bStartY++; + } + if (child instanceof Container3 && child._children.length > 0) { + this._dispatchInBuckets(child._children); + } + } + } + _updateMeasures() { + const left = this.leftInPixels | 0, top = this.topInPixels | 0; + this._measureForChildren.left -= left; + this._measureForChildren.top -= top; + this._currentMeasure.left -= left; + this._currentMeasure.top -= top; + this._customData.origLeftForChildren = this._measureForChildren.left; + this._customData.origTopForChildren = this._measureForChildren.top; + this._customData.origLeft = this._currentMeasure.left; + this._customData.origTop = this._currentMeasure.top; + this._updateChildrenMeasures(this._children, left, top); + } + _updateChildrenMeasures(children, left, top) { + for (let i = 0;i < children.length; ++i) { + const child = children[i]; + child._currentMeasure.left -= left; + child._currentMeasure.top -= top; + child._customData._origLeft = child._currentMeasure.left; + child._customData._origTop = child._currentMeasure.top; + if (child instanceof Container3 && child._children.length > 0) { + this._updateChildrenMeasures(child._children, left, top); + } + } + } + _restoreMeasures() { + const left = this.leftInPixels | 0, top = this.topInPixels | 0; + this._measureForChildren.left = this._customData.origLeftForChildren + left; + this._measureForChildren.top = this._customData.origTopForChildren + top; + this._currentMeasure.left = this._customData.origLeft + left; + this._currentMeasure.top = this._customData.origTop + top; + } + constructor(name335) { + super(name335); + this._freezeControls = false; + this._bucketWidth = 0; + this._bucketHeight = 0; + this._buckets = {}; + } + _getTypeName() { + return "ScrollViewerWindow"; + } + _additionalProcessing(parentMeasure, context) { + super._additionalProcessing(parentMeasure, context); + this._parentMeasure = parentMeasure; + this._measureForChildren.left = this._currentMeasure.left; + this._measureForChildren.top = this._currentMeasure.top; + this._measureForChildren.width = parentMeasure.width; + this._measureForChildren.height = parentMeasure.height; + } + _layout(parentMeasure, context) { + if (this._freezeControls) { + this.invalidateRect(); + return false; + } + return super._layout(parentMeasure, context); + } + _scrollChildren(children, left, top) { + for (let i = 0;i < children.length; ++i) { + const child = children[i]; + child._currentMeasure.left = child._customData._origLeft + left; + child._currentMeasure.top = child._customData._origTop + top; + child._isClipped = false; + if (child instanceof Container3 && child._children.length > 0) { + this._scrollChildren(child._children, left, top); + } + } + } + _scrollChildrenWithBuckets(left, top, scrollLeft, scrollTop) { + const bStartX = Math.max(0, Math.floor(-left / this._bucketWidth)), bEndX = Math.floor((-left + this._parentMeasure.width - 1) / this._bucketWidth), bEndY = Math.floor((-top + this._parentMeasure.height - 1) / this._bucketHeight); + let bStartY = Math.max(0, Math.floor(-top / this._bucketHeight)); + while (bStartY <= bEndY) { + for (let x = bStartX;x <= bEndX; ++x) { + const bucket = bStartY * this._bucketLen + x, lstc = this._buckets[bucket]; + if (lstc) { + for (let i = 0;i < lstc.length; ++i) { + const child = lstc[i]; + child._currentMeasure.left = child._customData._origLeft + scrollLeft; + child._currentMeasure.top = child._customData._origTop + scrollTop; + child._isClipped = false; + } + } + } + bStartY++; + } + } + _draw(context, invalidatedRectangle) { + if (!this._freezeControls) { + super._draw(context, invalidatedRectangle); + return; + } + this._localDraw(context); + if (this.clipChildren) { + this._clipForChildren(context); + } + const left = this.leftInPixels | 0, top = this.topInPixels | 0; + if (this._useBuckets()) { + if (this._oldLeft !== null && this._oldTop !== null) { + this._scrollChildrenWithBuckets(this._oldLeft, this._oldTop, left, top); + this._scrollChildrenWithBuckets(left, top, left, top); + } else { + this._scrollChildren(this._children, left, top); + } + } else { + this._scrollChildren(this._children, left, top); + } + this._oldLeft = left; + this._oldTop = top; + for (const child of this._children) { + if (!child._intersectsRect(this._parentMeasure)) { + continue; + } + child._render(context, this._parentMeasure); + } + } + _postMeasure() { + if (this._freezeControls) { + super._postMeasure(); + return; + } + let maxWidth = this.parentClientWidth; + let maxHeight = this.parentClientHeight; + for (const child of this.children) { + if (!child.isVisible || child.notRenderable) { + continue; + } + if (child.horizontalAlignment === Control3.HORIZONTAL_ALIGNMENT_CENTER) { + child._offsetLeft(this._currentMeasure.left - child._currentMeasure.left); + } + if (child.verticalAlignment === Control3.VERTICAL_ALIGNMENT_CENTER) { + child._offsetTop(this._currentMeasure.top - child._currentMeasure.top); + } + maxWidth = Math.max(maxWidth, child._currentMeasure.left - this._currentMeasure.left + child._currentMeasure.width + child.paddingRightInPixels); + maxHeight = Math.max(maxHeight, child._currentMeasure.top - this._currentMeasure.top + child._currentMeasure.height + child.paddingBottomInPixels); + } + if (this._currentMeasure.width !== maxWidth) { + this._width.updateInPlace(maxWidth, ValueAndUnit3.UNITMODE_PIXEL); + this._currentMeasure.width = maxWidth; + this._rebuildLayout = true; + this._isDirty = true; + } + if (this._currentMeasure.height !== maxHeight) { + this._height.updateInPlace(maxHeight, ValueAndUnit3.UNITMODE_PIXEL); + this._currentMeasure.height = maxHeight; + this._rebuildLayout = true; + this._isDirty = true; + } + super._postMeasure(); + } +} +var init_scrollViewerWindow2 = __esm(() => { + init_measure2(); + init_container2(); + init_valueAndUnit2(); + init_control2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/sliders/scrollBar.js +class ScrollBar3 extends BaseSlider3 { + get borderColor() { + return this._borderColor; + } + set borderColor(value) { + if (this._borderColor === value) { + return; + } + this._borderColor = value; + this._markAsDirty(); + } + get background() { + return this._background; + } + set background(value) { + if (this._background === value) { + return; + } + this._background = value; + this._markAsDirty(); + } + get backgroundGradient() { + return this._backgroundGradient; + } + set backgroundGradient(value) { + if (this._backgroundGradient === value) { + return; + } + this._backgroundGradient = value; + this._markAsDirty(); + } + get invertScrollDirection() { + return this._invertScrollDirection; + } + set invertScrollDirection(invert) { + this._invertScrollDirection = invert; + } + constructor(name335) { + super(name335); + this.name = name335; + this._background = "black"; + this._borderColor = "white"; + this._tempMeasure = new Measure3(0, 0, 0, 0); + this._invertScrollDirection = false; + this._backgroundGradient = null; + } + _getTypeName() { + return "Scrollbar"; + } + _getThumbThickness() { + let thumbThickness = 0; + if (this._thumbWidth.isPixel) { + thumbThickness = this._thumbWidth.getValue(this._host); + } else { + thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host); + } + return thumbThickness; + } + _getBackgroundColor(context) { + return this._backgroundGradient ? this._backgroundGradient.getCanvasGradient(context) : this._background; + } + _draw(context) { + context.save(); + this._applyStates(context); + this._prepareRenderingData("rectangle"); + const left = this._renderLeft; + const thumbPosition = this._getThumbPosition(); + context.fillStyle = this._getBackgroundColor(context); + context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + context.fillStyle = this._getColor(context); + if (this.isVertical) { + this._tempMeasure.left = left - this._effectiveBarOffset; + this._tempMeasure.top = this._currentMeasure.top + thumbPosition; + this._tempMeasure.width = this._currentMeasure.width; + this._tempMeasure.height = this._effectiveThumbThickness; + } else { + this._tempMeasure.left = this._currentMeasure.left + thumbPosition; + this._tempMeasure.top = this._currentMeasure.top; + this._tempMeasure.width = this._effectiveThumbThickness; + this._tempMeasure.height = this._currentMeasure.height; + } + context.fillRect(this._tempMeasure.left, this._tempMeasure.top, this._tempMeasure.width, this._tempMeasure.height); + context.restore(); + } + _updateValueFromPointer(x, y) { + if (this.rotation != 0) { + this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition); + x = this._transformedPosition.x; + y = this._transformedPosition.y; + } + const sign = this._invertScrollDirection ? -1 : 1; + if (this._first) { + this._first = false; + this._originX = x; + this._originY = y; + if (x < this._tempMeasure.left || x > this._tempMeasure.left + this._tempMeasure.width || y < this._tempMeasure.top || y > this._tempMeasure.top + this._tempMeasure.height) { + if (this.isVertical) { + this.value = this.minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this.maximum - this.minimum); + } else { + this.value = this.minimum + (x - this._currentMeasure.left) / this._currentMeasure.width * (this.maximum - this.minimum); + } + } + } + let delta = 0; + if (this.isVertical) { + delta = -((y - this._originY) / (this._currentMeasure.height - this._effectiveThumbThickness)); + } else { + delta = (x - this._originX) / (this._currentMeasure.width - this._effectiveThumbThickness); + } + this.value += sign * delta * (this.maximum - this.minimum); + this._originX = x; + this._originY = y; + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + this._first = true; + return super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi); + } + serialize(serializationObject) { + super.serialize(serializationObject); + if (this.backgroundGradient) { + serializationObject.backgroundGradient = {}; + this.backgroundGradient.serialize(serializationObject.backgroundGradient); + } + } + _parseFromContent(serializationObject, host) { + super._parseFromContent(serializationObject, host); + if (serializationObject.backgroundGradient) { + const className2 = Tools.Instantiate("BABYLON.GUI." + serializationObject.backgroundGradient.className); + this.backgroundGradient = new className2; + this.backgroundGradient.parse(serializationObject.backgroundGradient); + } + } +} +var init_scrollBar2 = __esm(() => { + init_tslib_es62(); + init_baseSlider2(); + init_measure2(); + init_decorators(); + init_tools(); + init_typeStore(); + __decorate2([ + serialize() + ], ScrollBar3.prototype, "borderColor", null); + __decorate2([ + serialize() + ], ScrollBar3.prototype, "background", null); + __decorate2([ + serialize() + ], ScrollBar3.prototype, "invertScrollDirection", null); + RegisterClass("BABYLON.GUI.Scrollbar", ScrollBar3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/sliders/imageScrollBar.js +class ImageScrollBar3 extends BaseSlider3 { + get invertScrollDirection() { + return this._invertScrollDirection; + } + set invertScrollDirection(invert) { + this._invertScrollDirection = invert; + } + get backgroundImage() { + return this._backgroundBaseImage; + } + set backgroundImage(value) { + if (this._backgroundBaseImage === value) { + return; + } + this._backgroundBaseImage = value; + if (this.isVertical && this.num90RotationInVerticalMode !== 0) { + if (!value.isLoaded) { + value.onImageLoadedObservable.addOnce(() => { + const rotatedValue = value._rotate90(this.num90RotationInVerticalMode, true); + this._backgroundImage = rotatedValue; + if (!rotatedValue.isLoaded) { + rotatedValue.onImageLoadedObservable.addOnce(() => { + this._markAsDirty(); + }); + } + this._markAsDirty(); + }); + } else { + this._backgroundImage = value._rotate90(this.num90RotationInVerticalMode, true); + this._markAsDirty(); + } + } else { + this._backgroundImage = value; + if (value && !value.isLoaded) { + value.onImageLoadedObservable.addOnce(() => { + this._markAsDirty(); + }); + } + this._markAsDirty(); + } + } + get thumbImage() { + return this._thumbBaseImage; + } + set thumbImage(value) { + if (this._thumbBaseImage === value) { + return; + } + this._thumbBaseImage = value; + if (this.isVertical && this.num90RotationInVerticalMode !== 0) { + if (!value.isLoaded) { + value.onImageLoadedObservable.addOnce(() => { + const rotatedValue = value._rotate90(-this.num90RotationInVerticalMode, true); + this._thumbImage = rotatedValue; + if (!rotatedValue.isLoaded) { + rotatedValue.onImageLoadedObservable.addOnce(() => { + this._markAsDirty(); + }); + } + this._markAsDirty(); + }); + } else { + this._thumbImage = value._rotate90(-this.num90RotationInVerticalMode, true); + this._markAsDirty(); + } + } else { + this._thumbImage = value; + if (value && !value.isLoaded) { + value.onImageLoadedObservable.addOnce(() => { + this._markAsDirty(); + }); + } + this._markAsDirty(); + } + } + get thumbLength() { + return this._thumbLength; + } + set thumbLength(value) { + if (this._thumbLength === value) { + return; + } + this._thumbLength = value; + this._markAsDirty(); + } + get thumbHeight() { + return this._thumbHeight; + } + set thumbHeight(value) { + if (this._thumbLength === value) { + return; + } + this._thumbHeight = value; + this._markAsDirty(); + } + get barImageHeight() { + return this._barImageHeight; + } + set barImageHeight(value) { + if (this._barImageHeight === value) { + return; + } + this._barImageHeight = value; + this._markAsDirty(); + } + constructor(name335) { + super(name335); + this.name = name335; + this._thumbLength = 0.5; + this._thumbHeight = 1; + this._barImageHeight = 1; + this._tempMeasure = new Measure3(0, 0, 0, 0); + this._invertScrollDirection = false; + this.num90RotationInVerticalMode = 1; + } + _getTypeName() { + return "ImageScrollBar"; + } + _getThumbThickness() { + let thumbThickness = 0; + if (this._thumbWidth.isPixel) { + thumbThickness = this._thumbWidth.getValue(this._host); + } else { + thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host); + } + return thumbThickness; + } + _draw(context) { + context.save(); + this._applyStates(context); + this._prepareRenderingData("rectangle"); + const thumbPosition = this._getThumbPosition(); + const left = this._renderLeft; + const top = this._renderTop; + const width = this._renderWidth; + const height = this._renderHeight; + if (this._backgroundImage) { + this._tempMeasure.copyFromFloats(left, top, width, height); + if (this.isVertical) { + this._tempMeasure.copyFromFloats(left + width * (1 - this._barImageHeight) * 0.5, this._currentMeasure.top, width * this._barImageHeight, height); + this._tempMeasure.height += this._effectiveThumbThickness; + this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure); + } else { + this._tempMeasure.copyFromFloats(this._currentMeasure.left, top + height * (1 - this._barImageHeight) * 0.5, width, height * this._barImageHeight); + this._tempMeasure.width += this._effectiveThumbThickness; + this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure); + } + this._backgroundImage._draw(context); + } + if (this.isVertical) { + this._tempMeasure.copyFromFloats(left - this._effectiveBarOffset + this._currentMeasure.width * (1 - this._thumbHeight) * 0.5, this._currentMeasure.top + thumbPosition, this._currentMeasure.width * this._thumbHeight, this._effectiveThumbThickness); + } else { + this._tempMeasure.copyFromFloats(this._currentMeasure.left + thumbPosition, this._currentMeasure.top + this._currentMeasure.height * (1 - this._thumbHeight) * 0.5, this._effectiveThumbThickness, this._currentMeasure.height * this._thumbHeight); + } + if (this._thumbImage) { + this._thumbImage._currentMeasure.copyFrom(this._tempMeasure); + this._thumbImage._draw(context); + } + context.restore(); + } + _updateValueFromPointer(x, y) { + if (this.rotation != 0) { + this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition); + x = this._transformedPosition.x; + y = this._transformedPosition.y; + } + const sign = this._invertScrollDirection ? -1 : 1; + if (this._first) { + this._first = false; + this._originX = x; + this._originY = y; + if (x < this._tempMeasure.left || x > this._tempMeasure.left + this._tempMeasure.width || y < this._tempMeasure.top || y > this._tempMeasure.top + this._tempMeasure.height) { + if (this.isVertical) { + this.value = this.minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this.maximum - this.minimum); + } else { + this.value = this.minimum + (x - this._currentMeasure.left) / this._currentMeasure.width * (this.maximum - this.minimum); + } + } + } + let delta = 0; + if (this.isVertical) { + delta = -((y - this._originY) / (this._currentMeasure.height - this._effectiveThumbThickness)); + } else { + delta = (x - this._originX) / (this._currentMeasure.width - this._effectiveThumbThickness); + } + this.value += sign * delta * (this.maximum - this.minimum); + this._originX = x; + this._originY = y; + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + this._first = true; + return super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi); + } +} +var init_imageScrollBar2 = __esm(() => { + init_tslib_es62(); + init_baseSlider2(); + init_measure2(); + init_decorators(); + __decorate2([ + serialize() + ], ImageScrollBar3.prototype, "num90RotationInVerticalMode", undefined); + __decorate2([ + serialize() + ], ImageScrollBar3.prototype, "invertScrollDirection", null); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/scrollViewers/scrollViewer.js +class ScrollViewer3 extends Rectangle3 { + get horizontalBar() { + return this._horizontalBar; + } + get verticalBar() { + return this._verticalBar; + } + addControl(control67) { + if (!control67) { + return this; + } + this._window.addControl(control67); + return this; + } + removeControl(control67) { + this._window.removeControl(control67); + return this; + } + get children() { + return this._window.children; + } + _flagDescendantsAsMatrixDirty() { + for (const child of this._children) { + child._markMatrixAsDirty(); + } + } + get freezeControls() { + return this._window.freezeControls; + } + set freezeControls(value) { + this._window.freezeControls = value; + } + get bucketWidth() { + return this._window.bucketWidth; + } + get bucketHeight() { + return this._window.bucketHeight; + } + setBucketSizes(width, height) { + this._window.setBucketSizes(width, height); + } + get forceHorizontalBar() { + return this._forceHorizontalBar; + } + set forceHorizontalBar(value) { + this._grid.setRowDefinition(1, value ? this._barSize : 0, true); + this._horizontalBar.isVisible = value; + this._forceHorizontalBar = value; + } + get forceVerticalBar() { + return this._forceVerticalBar; + } + set forceVerticalBar(value) { + this._grid.setColumnDefinition(1, value ? this._barSize : 0, true); + this._verticalBar.isVisible = value; + this._forceVerticalBar = value; + } + constructor(name335, isImageBased) { + super(name335); + this._barSize = 20; + this._pointerIsOver = false; + this._wheelPrecision = 0.05; + this._thumbLength = 0.5; + this._thumbHeight = 1; + this._barImageHeight = 1; + this._horizontalBarImageHeight = 1; + this._verticalBarImageHeight = 1; + this._oldWindowContentsWidth = 0; + this._oldWindowContentsHeight = 0; + this._forceHorizontalBar = false; + this._forceVerticalBar = false; + this._useImageBar = isImageBased ? isImageBased : false; + this.onDirtyObservable.add(() => { + this._horizontalBarSpace.color = this.color; + this._verticalBarSpace.color = this.color; + this._dragSpace.color = this.color; + }); + this.onPointerEnterObservable.add(() => { + this._pointerIsOver = true; + }); + this.onPointerOutObservable.add(() => { + this._pointerIsOver = false; + }); + this._grid = new Grid3; + if (this._useImageBar) { + this._horizontalBar = new ImageScrollBar3; + this._verticalBar = new ImageScrollBar3; + } else { + this._horizontalBar = new ScrollBar3; + this._verticalBar = new ScrollBar3; + } + this._window = new _ScrollViewerWindow3("scrollViewer_window"); + this._window.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + this._window.verticalAlignment = Control3.VERTICAL_ALIGNMENT_TOP; + this._grid.addColumnDefinition(1); + this._grid.addColumnDefinition(0, true); + this._grid.addRowDefinition(1); + this._grid.addRowDefinition(0, true); + super.addControl(this._grid); + this._grid.addControl(this._window, 0, 0); + this._verticalBarSpace = new Rectangle3; + this._verticalBarSpace.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + this._verticalBarSpace.verticalAlignment = Control3.VERTICAL_ALIGNMENT_TOP; + this._verticalBarSpace.thickness = 1; + this._grid.addControl(this._verticalBarSpace, 0, 1); + this._addBar(this._verticalBar, this._verticalBarSpace, true, Math.PI); + this._horizontalBarSpace = new Rectangle3; + this._horizontalBarSpace.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + this._horizontalBarSpace.verticalAlignment = Control3.VERTICAL_ALIGNMENT_TOP; + this._horizontalBarSpace.thickness = 1; + this._grid.addControl(this._horizontalBarSpace, 1, 0); + this._addBar(this._horizontalBar, this._horizontalBarSpace, false, 0); + this._dragSpace = new Rectangle3; + this._dragSpace.thickness = 1; + this._grid.addControl(this._dragSpace, 1, 1); + if (!this._useImageBar) { + this.barColor = "grey"; + this.barBackground = "transparent"; + } + } + resetWindow() { + this._window.width = "100%"; + this._window.height = "100%"; + } + _getTypeName() { + return "ScrollViewer"; + } + _buildClientSizes() { + const ratio = this.host.idealRatio; + this._window.parentClientWidth = this._currentMeasure.width - (this._verticalBar.isVisible || this.forceVerticalBar ? this._barSize * ratio : 0) - 2 * this.thickness; + this._window.parentClientHeight = this._currentMeasure.height - (this._horizontalBar.isVisible || this.forceHorizontalBar ? this._barSize * ratio : 0) - 2 * this.thickness; + this._clientWidth = this._window.parentClientWidth; + this._clientHeight = this._window.parentClientHeight; + } + _additionalProcessing(parentMeasure, context) { + super._additionalProcessing(parentMeasure, context); + this._buildClientSizes(); + } + _postMeasure() { + super._postMeasure(); + this._updateScroller(); + this._setWindowPosition(false); + } + get wheelPrecision() { + return this._wheelPrecision; + } + set wheelPrecision(value) { + if (this._wheelPrecision === value) { + return; + } + if (value < 0) { + value = 0; + } + if (value > 1) { + value = 1; + } + this._wheelPrecision = value; + } + get scrollBackground() { + return this._horizontalBarSpace.background; + } + set scrollBackground(color) { + if (this._horizontalBarSpace.background === color) { + return; + } + this._horizontalBarSpace.background = color; + this._verticalBarSpace.background = color; + } + get barColor() { + return this._barColor; + } + set barColor(color) { + if (this._barColor === color) { + return; + } + this._barColor = color; + this._horizontalBar.color = color; + this._verticalBar.color = color; + } + get thumbImage() { + return this._barImage; + } + set thumbImage(value) { + if (this._barImage === value) { + return; + } + this._barImage = value; + const hb = this._horizontalBar; + const vb = this._verticalBar; + hb.thumbImage = value; + vb.thumbImage = value; + } + get horizontalThumbImage() { + return this._horizontalBarImage; + } + set horizontalThumbImage(value) { + if (this._horizontalBarImage === value) { + return; + } + this._horizontalBarImage = value; + const hb = this._horizontalBar; + hb.thumbImage = value; + } + get verticalThumbImage() { + return this._verticalBarImage; + } + set verticalThumbImage(value) { + if (this._verticalBarImage === value) { + return; + } + this._verticalBarImage = value; + const vb = this._verticalBar; + vb.thumbImage = value; + } + get barSize() { + return this._barSize; + } + set barSize(value) { + if (this._barSize === value) { + return; + } + this._barSize = value; + this._markAsDirty(); + if (this._horizontalBar.isVisible) { + this._grid.setRowDefinition(1, this._barSize, true); + } + if (this._verticalBar.isVisible) { + this._grid.setColumnDefinition(1, this._barSize, true); + } + } + get thumbLength() { + return this._thumbLength; + } + set thumbLength(value) { + if (this._thumbLength === value) { + return; + } + if (value <= 0) { + value = 0.1; + } + if (value > 1) { + value = 1; + } + this._thumbLength = value; + const hb = this._horizontalBar; + const vb = this._verticalBar; + hb.thumbLength = value; + vb.thumbLength = value; + this._markAsDirty(); + } + get thumbHeight() { + return this._thumbHeight; + } + set thumbHeight(value) { + if (this._thumbHeight === value) { + return; + } + if (value <= 0) { + value = 0.1; + } + if (value > 1) { + value = 1; + } + this._thumbHeight = value; + const hb = this._horizontalBar; + const vb = this._verticalBar; + hb.thumbHeight = value; + vb.thumbHeight = value; + this._markAsDirty(); + } + get barImageHeight() { + return this._barImageHeight; + } + set barImageHeight(value) { + if (this._barImageHeight === value) { + return; + } + if (value <= 0) { + value = 0.1; + } + if (value > 1) { + value = 1; + } + this._barImageHeight = value; + const hb = this._horizontalBar; + const vb = this._verticalBar; + hb.barImageHeight = value; + vb.barImageHeight = value; + this._markAsDirty(); + } + get horizontalBarImageHeight() { + return this._horizontalBarImageHeight; + } + set horizontalBarImageHeight(value) { + if (this._horizontalBarImageHeight === value) { + return; + } + if (value <= 0) { + value = 0.1; + } + if (value > 1) { + value = 1; + } + this._horizontalBarImageHeight = value; + const hb = this._horizontalBar; + hb.barImageHeight = value; + this._markAsDirty(); + } + get verticalBarImageHeight() { + return this._verticalBarImageHeight; + } + set verticalBarImageHeight(value) { + if (this._verticalBarImageHeight === value) { + return; + } + if (value <= 0) { + value = 0.1; + } + if (value > 1) { + value = 1; + } + this._verticalBarImageHeight = value; + const vb = this._verticalBar; + vb.barImageHeight = value; + this._markAsDirty(); + } + get barBackground() { + return this._barBackground; + } + set barBackground(color) { + if (this._barBackground === color) { + return; + } + this._barBackground = color; + const hb = this._horizontalBar; + const vb = this._verticalBar; + hb.background = color; + vb.background = color; + this._dragSpace.background = color; + } + get barImage() { + return this._barBackgroundImage; + } + set barImage(value) { + this._barBackgroundImage = value; + const hb = this._horizontalBar; + const vb = this._verticalBar; + hb.backgroundImage = value; + vb.backgroundImage = value; + } + get horizontalBarImage() { + return this._horizontalBarBackgroundImage; + } + set horizontalBarImage(value) { + this._horizontalBarBackgroundImage = value; + const hb = this._horizontalBar; + hb.backgroundImage = value; + } + get verticalBarImage() { + return this._verticalBarBackgroundImage; + } + set verticalBarImage(value) { + this._verticalBarBackgroundImage = value; + const vb = this._verticalBar; + vb.backgroundImage = value; + } + _setWindowPosition(force = true) { + const ratio = this.host.idealRatio; + const windowContentsWidth = this._window._currentMeasure.width; + const windowContentsHeight = this._window._currentMeasure.height; + if (!force && this._oldWindowContentsWidth === windowContentsWidth && this._oldWindowContentsHeight === windowContentsHeight) { + return; + } + this._oldWindowContentsWidth = windowContentsWidth; + this._oldWindowContentsHeight = windowContentsHeight; + const _endLeft = this._clientWidth - windowContentsWidth; + const _endTop = this._clientHeight - windowContentsHeight; + const newLeft = this._horizontalBar.value / ratio * _endLeft + "px"; + const newTop = this._verticalBar.value / ratio * _endTop + "px"; + if (newLeft !== this._window.left) { + this._window.left = newLeft; + if (!this.freezeControls) { + this._rebuildLayout = true; + } + } + if (newTop !== this._window.top) { + this._window.top = newTop; + if (!this.freezeControls) { + this._rebuildLayout = true; + } + } + } + _updateScroller() { + const windowContentsWidth = this._window._currentMeasure.width; + const windowContentsHeight = this._window._currentMeasure.height; + if (this._horizontalBar.isVisible && windowContentsWidth <= this._clientWidth && !this.forceHorizontalBar) { + this._grid.setRowDefinition(1, 0, true); + this._horizontalBar.isVisible = false; + this._horizontalBar.value = 0; + this._rebuildLayout = true; + } else if (!this._horizontalBar.isVisible && (windowContentsWidth > this._clientWidth || this.forceHorizontalBar)) { + this._grid.setRowDefinition(1, this._barSize, true); + this._horizontalBar.isVisible = true; + this._rebuildLayout = true; + } + if (this._verticalBar.isVisible && windowContentsHeight <= this._clientHeight && !this.forceVerticalBar) { + this._grid.setColumnDefinition(1, 0, true); + this._verticalBar.isVisible = false; + this._verticalBar.value = 0; + this._rebuildLayout = true; + } else if (!this._verticalBar.isVisible && (windowContentsHeight > this._clientHeight || this.forceVerticalBar)) { + this._grid.setColumnDefinition(1, this._barSize, true); + this._verticalBar.isVisible = true; + this._rebuildLayout = true; + } + this._buildClientSizes(); + const ratio = this.host.idealRatio; + this._horizontalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientWidth / ratio) + "px"; + this._verticalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientHeight / ratio) + "px"; + } + _link(host) { + super._link(host); + this._attachWheel(); + } + _addBar(barControl, barContainer, isVertical, rotation) { + barControl.paddingLeft = 0; + barControl.width = "100%"; + barControl.height = "100%"; + barControl.barOffset = 0; + barControl.value = 0; + barControl.maximum = 1; + barControl.horizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_CENTER; + barControl.verticalAlignment = Control3.VERTICAL_ALIGNMENT_CENTER; + barControl.isVertical = isVertical; + barControl.rotation = rotation; + barControl.isVisible = false; + barContainer.addControl(barControl); + barControl.onValueChangedObservable.add(() => { + this._setWindowPosition(); + }); + } + _attachWheel() { + if (!this._host || this._onWheelObserver) { + return; + } + this._onWheelObserver = this.onWheelObservable.add((pi) => { + if (!this._pointerIsOver || this.isReadOnly) { + return; + } + if (this._verticalBar.isVisible == true) { + if (pi.y < 0 && this._verticalBar.value > 0) { + this._verticalBar.value -= this._wheelPrecision; + } else if (pi.y > 0 && this._verticalBar.value < this._verticalBar.maximum) { + this._verticalBar.value += this._wheelPrecision; + } + } + if (this._horizontalBar.isVisible == true) { + if (pi.x < 0 && this._horizontalBar.value < this._horizontalBar.maximum) { + this._horizontalBar.value += this._wheelPrecision; + } else if (pi.x > 0 && this._horizontalBar.value > 0) { + this._horizontalBar.value -= this._wheelPrecision; + } + } + }); + } + _renderHighlightSpecific(context) { + if (!this.isHighlighted) { + return; + } + super._renderHighlightSpecific(context); + this._grid._renderHighlightSpecific(context); + context.restore(); + } + dispose() { + this.onWheelObservable.remove(this._onWheelObserver); + this._onWheelObserver = null; + super.dispose(); + } +} +var init_scrollViewer2 = __esm(() => { + init_tslib_es62(); + init_rectangle2(); + init_grid3(); + init_control2(); + init_scrollViewerWindow2(); + init_scrollBar2(); + init_imageScrollBar2(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], ScrollViewer3.prototype, "wheelPrecision", null); + __decorate2([ + serialize() + ], ScrollViewer3.prototype, "scrollBackground", null); + __decorate2([ + serialize() + ], ScrollViewer3.prototype, "barColor", null); + __decorate2([ + serialize() + ], ScrollViewer3.prototype, "barSize", null); + __decorate2([ + serialize() + ], ScrollViewer3.prototype, "barBackground", null); + RegisterClass("BABYLON.GUI.ScrollViewer", ScrollViewer3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/toggleButton.js +class ToggleButton3 extends Rectangle3 { + get group() { + return this._group; + } + set group(value) { + if (this._group === value) { + return; + } + this._group = value; + } + get isActive() { + return this._isActive; + } + set isActive(value) { + var _a, _b; + if (this._isActive === value) { + return; + } + this._isActive = value; + if (this._isActive) { + (_a = this.toActiveAnimation) === null || _a === undefined || _a.call(this); + } else { + (_b = this.toInactiveAnimation) === null || _b === undefined || _b.call(this); + } + this._markAsDirty(); + this.onIsActiveChangedObservable.notifyObservers(value); + if (this._isActive && this._host && this._group) { + this._host.executeOnAllControls((control67) => { + if (control67.typeName === "ToggleButton") { + if (control67 === this) { + return; + } + const childToggle = control67; + if (childToggle.group === this.group) { + childToggle.isActive = false; + } + } + }); + } + } + constructor(name335, group) { + super(name335); + this.name = name335; + this.onIsActiveChangedObservable = new Observable; + this.delegatePickingToChildren = false; + this._isActive = false; + this.group = group !== null && group !== undefined ? group : ""; + this.thickness = 0; + this.isPointerBlocker = true; + let alphaStore = null; + this.toActiveAnimation = () => { + this.thickness = 1; + }; + this.toInactiveAnimation = () => { + this.thickness = 0; + }; + this.pointerEnterActiveAnimation = () => { + alphaStore = this.alpha; + this.alpha -= 0.1; + }; + this.pointerOutActiveAnimation = () => { + if (alphaStore !== null) { + this.alpha = alphaStore; + } + }; + this.pointerDownActiveAnimation = () => { + this.scaleX -= 0.05; + this.scaleY -= 0.05; + }; + this.pointerUpActiveAnimation = () => { + this.scaleX += 0.05; + this.scaleY += 0.05; + }; + this.pointerEnterInactiveAnimation = () => { + alphaStore = this.alpha; + this.alpha -= 0.1; + }; + this.pointerOutInactiveAnimation = () => { + if (alphaStore !== null) { + this.alpha = alphaStore; + } + }; + this.pointerDownInactiveAnimation = () => { + this.scaleX -= 0.05; + this.scaleY -= 0.05; + }; + this.pointerUpInactiveAnimation = () => { + this.scaleX += 0.05; + this.scaleY += 0.05; + }; + } + _getTypeName() { + return "ToggleButton"; + } + _processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) { + if (!this._isEnabled || !this.isHitTestVisible || !this.isVisible || this.notRenderable) { + return false; + } + if (!super.contains(x, y)) { + return false; + } + if (this.delegatePickingToChildren) { + let contains = false; + for (let index = this._children.length - 1;index >= 0; index--) { + const child = this._children[index]; + if (child.isEnabled && child.isHitTestVisible && child.isVisible && !child.notRenderable && child.contains(x, y)) { + contains = true; + break; + } + } + if (!contains) { + return false; + } + } + this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY); + return true; + } + _onPointerEnter(target, pi) { + if (!super._onPointerEnter(target, pi)) { + return false; + } + if (this.isReadOnly) { + return true; + } + if (this._isActive) { + if (this.pointerEnterActiveAnimation) { + this.pointerEnterActiveAnimation(); + } + } else { + if (this.pointerEnterInactiveAnimation) { + this.pointerEnterInactiveAnimation(); + } + } + return true; + } + _onPointerOut(target, pi, force = false) { + if (!this.isReadOnly) { + if (this._isActive) { + if (this.pointerOutActiveAnimation) { + this.pointerOutActiveAnimation(); + } + } else { + if (this.pointerOutInactiveAnimation) { + this.pointerOutInactiveAnimation(); + } + } + } + super._onPointerOut(target, pi, force); + } + _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) { + if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) { + return false; + } + if (this.isReadOnly) { + return true; + } + if (this._isActive) { + if (this.pointerDownActiveAnimation) { + this.pointerDownActiveAnimation(); + } + } else { + if (this.pointerDownInactiveAnimation) { + this.pointerDownInactiveAnimation(); + } + } + return true; + } + _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi) { + if (!this.isReadOnly) { + if (this._isActive) { + if (this.pointerUpActiveAnimation) { + this.pointerUpActiveAnimation(); + } + } else { + if (this.pointerUpInactiveAnimation) { + this.pointerUpInactiveAnimation(); + } + } + } + super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi); + } +} +var init_toggleButton2 = __esm(() => { + init_observable(); + init_rectangle2(); + init_typeStore(); + RegisterClass("BABYLON.GUI.ToggleButton", ToggleButton3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/virtualKeyboard.js +class KeyPropertySet2 { +} + +class VirtualKeyboard3 extends StackPanel3 { + constructor() { + super(...arguments); + this.onKeyPressObservable = new Observable; + this.defaultButtonWidth = "40px"; + this.defaultButtonHeight = "40px"; + this.defaultButtonPaddingLeft = "2px"; + this.defaultButtonPaddingRight = "2px"; + this.defaultButtonPaddingTop = "2px"; + this.defaultButtonPaddingBottom = "2px"; + this.defaultButtonColor = "#DDD"; + this.defaultButtonBackground = "#070707"; + this.shiftButtonColor = "#7799FF"; + this.selectedShiftThickness = 1; + this.shiftState = 0; + this._currentlyConnectedInputText = null; + this._connectedInputTexts = []; + this._onKeyPressObserver = null; + } + _getTypeName() { + return "VirtualKeyboard"; + } + _createKey(key, propertySet) { + const button12 = Button3.CreateSimpleButton(key, key); + button12.width = propertySet && propertySet.width ? propertySet.width : this.defaultButtonWidth; + button12.height = propertySet && propertySet.height ? propertySet.height : this.defaultButtonHeight; + button12.color = propertySet && propertySet.color ? propertySet.color : this.defaultButtonColor; + button12.background = propertySet && propertySet.background ? propertySet.background : this.defaultButtonBackground; + button12.paddingLeft = propertySet && propertySet.paddingLeft ? propertySet.paddingLeft : this.defaultButtonPaddingLeft; + button12.paddingRight = propertySet && propertySet.paddingRight ? propertySet.paddingRight : this.defaultButtonPaddingRight; + button12.paddingTop = propertySet && propertySet.paddingTop ? propertySet.paddingTop : this.defaultButtonPaddingTop; + button12.paddingBottom = propertySet && propertySet.paddingBottom ? propertySet.paddingBottom : this.defaultButtonPaddingBottom; + button12.thickness = 0; + button12.isFocusInvisible = true; + button12.shadowColor = this.shadowColor; + button12.shadowBlur = this.shadowBlur; + button12.shadowOffsetX = this.shadowOffsetX; + button12.shadowOffsetY = this.shadowOffsetY; + button12.onPointerUpObservable.add(() => { + this.onKeyPressObservable.notifyObservers(key); + }); + return button12; + } + addKeysRow(keys4, propertySets) { + const panel = new StackPanel3; + panel.isVertical = false; + panel.isFocusInvisible = true; + let maxKey = null; + for (let i = 0;i < keys4.length; i++) { + let properties = null; + if (propertySets && propertySets.length === keys4.length) { + properties = propertySets[i]; + } + const key = this._createKey(keys4[i], properties); + if (!maxKey || key.heightInPixels > maxKey.heightInPixels) { + maxKey = key; + } + panel.addControl(key); + } + panel.height = maxKey ? maxKey.height : this.defaultButtonHeight; + this.addControl(panel); + } + applyShiftState(shiftState) { + if (!this.children) { + return; + } + for (let i = 0;i < this.children.length; i++) { + const row = this.children[i]; + if (!row || !row.children) { + continue; + } + const rowContainer = row; + for (let j = 0;j < rowContainer.children.length; j++) { + const button12 = rowContainer.children[j]; + if (!button12 || !button12.children[0]) { + continue; + } + const button_tblock = button12.children[0]; + if (button_tblock.text === "\u21E7") { + button12.color = shiftState ? this.shiftButtonColor : this.defaultButtonColor; + button12.thickness = shiftState > 1 ? this.selectedShiftThickness : 0; + } + button_tblock.text = shiftState > 0 ? button_tblock.text.toUpperCase() : button_tblock.text.toLowerCase(); + } + } + } + get connectedInputText() { + return this._currentlyConnectedInputText; + } + connect(input) { + const inputTextAlreadyConnected = this._connectedInputTexts.some((a) => a.input === input); + if (inputTextAlreadyConnected) { + return; + } + if (this._onKeyPressObserver === null) { + this._onKeyPressObserver = this.onKeyPressObservable.add((key) => { + if (!this._currentlyConnectedInputText) { + return; + } + this._currentlyConnectedInputText._host.focusedControl = this._currentlyConnectedInputText; + switch (key) { + case "\u21E7": + this.shiftState++; + if (this.shiftState > 2) { + this.shiftState = 0; + } + this.applyShiftState(this.shiftState); + return; + case "\u2190": + if (this._currentlyConnectedInputText instanceof InputTextArea3) { + this._currentlyConnectedInputText.alternativeProcessKey("Backspace"); + } else { + this._currentlyConnectedInputText.processKey(8); + } + return; + case "\u21B5": + if (this._currentlyConnectedInputText instanceof InputTextArea3) { + this._currentlyConnectedInputText.alternativeProcessKey("Enter"); + } else { + this._currentlyConnectedInputText.processKey(13); + } + return; + } + if (this._currentlyConnectedInputText instanceof InputTextArea3) { + this._currentlyConnectedInputText.alternativeProcessKey("", this.shiftState ? key.toUpperCase() : key); + } else { + this._currentlyConnectedInputText.processKey(-1, this.shiftState ? key.toUpperCase() : key); + } + if (this.shiftState === 1) { + this.shiftState = 0; + this.applyShiftState(this.shiftState); + } + }); + } + this.isVisible = false; + this._currentlyConnectedInputText = input; + input._connectedVirtualKeyboard = this; + const onFocusObserver = input.onFocusObservable.add(() => { + this._currentlyConnectedInputText = input; + input._connectedVirtualKeyboard = this; + this.isVisible = true; + }); + const onBlurObserver = input.onBlurObservable.add(() => { + input._connectedVirtualKeyboard = null; + this._currentlyConnectedInputText = null; + this.isVisible = false; + }); + this._connectedInputTexts.push({ + input, + onBlurObserver, + onFocusObserver + }); + } + disconnect(input) { + if (input) { + const filtered = this._connectedInputTexts.filter((a) => a.input === input); + if (filtered.length === 1) { + this._removeConnectedInputObservables(filtered[0]); + this._connectedInputTexts = this._connectedInputTexts.filter((a) => a.input !== input); + if (this._currentlyConnectedInputText === input) { + this._currentlyConnectedInputText = null; + } + } + } else { + this._connectedInputTexts.forEach((connectedInputText) => { + this._removeConnectedInputObservables(connectedInputText); + }); + this._connectedInputTexts.length = 0; + } + if (this._connectedInputTexts.length === 0) { + this._currentlyConnectedInputText = null; + this.onKeyPressObservable.remove(this._onKeyPressObserver); + this._onKeyPressObserver = null; + } + } + _removeConnectedInputObservables(connectedInputText) { + connectedInputText.input._connectedVirtualKeyboard = null; + connectedInputText.input.onFocusObservable.remove(connectedInputText.onFocusObserver); + connectedInputText.input.onBlurObservable.remove(connectedInputText.onBlurObserver); + } + dispose() { + super.dispose(); + this.disconnect(); + } + static CreateDefaultLayout(name335) { + const returnValue = new VirtualKeyboard3(name335); + returnValue.addKeysRow(["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "\u2190"]); + returnValue.addKeysRow(["q", "w", "e", "r", "t", "y", "u", "i", "o", "p"]); + returnValue.addKeysRow(["a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "\u21B5"]); + returnValue.addKeysRow(["\u21E7", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/"]); + returnValue.addKeysRow([" "], [{ width: "200px" }]); + return returnValue; + } + _parseFromContent(serializedObject, host) { + super._parseFromContent(serializedObject, host); + for (const row of this.children) { + if (row.getClassName() === "StackPanel") { + const stackPanel23 = row; + for (const key of stackPanel23.children) { + if (key.getClassName() === "Button" && key.name) { + key.onPointerUpObservable.add(() => { + this.onKeyPressObservable.notifyObservers(key.name); + }); + } + } + } + } + } +} +var init_virtualKeyboard2 = __esm(() => { + init_observable(); + init_stackPanel2(); + init_button2(); + init_typeStore(); + init_inputTextArea2(); + RegisterClass("BABYLON.GUI.VirtualKeyboard", VirtualKeyboard3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/displayGrid.js +class DisplayGrid3 extends Control3 { + get displayMinorLines() { + return this._displayMinorLines; + } + set displayMinorLines(value) { + if (this._displayMinorLines === value) { + return; + } + this._displayMinorLines = value; + this._markAsDirty(); + } + get displayMajorLines() { + return this._displayMajorLines; + } + set displayMajorLines(value) { + if (this._displayMajorLines === value) { + return; + } + this._displayMajorLines = value; + this._markAsDirty(); + } + get background() { + return this._background; + } + set background(value) { + if (this._background === value) { + return; + } + this._background = value; + this._markAsDirty(); + } + get cellWidth() { + return this._cellWidth; + } + set cellWidth(value) { + this._cellWidth = value; + this._markAsDirty(); + } + get cellHeight() { + return this._cellHeight; + } + set cellHeight(value) { + this._cellHeight = value; + this._markAsDirty(); + } + get minorLineTickness() { + return this._minorLineTickness; + } + set minorLineTickness(value) { + this._minorLineTickness = value; + this._markAsDirty(); + } + get minorLineColor() { + return this._minorLineColor; + } + set minorLineColor(value) { + this._minorLineColor = value; + this._markAsDirty(); + } + get majorLineTickness() { + return this._majorLineTickness; + } + set majorLineTickness(value) { + this._majorLineTickness = value; + this._markAsDirty(); + } + get majorLineColor() { + return this._majorLineColor; + } + set majorLineColor(value) { + this._majorLineColor = value; + this._markAsDirty(); + } + get majorLineFrequency() { + return this._majorLineFrequency; + } + set majorLineFrequency(value) { + this._majorLineFrequency = value; + this._markAsDirty(); + } + constructor(name335) { + super(name335); + this.name = name335; + this._cellWidth = 20; + this._cellHeight = 20; + this._minorLineTickness = 1; + this._minorLineColor = "DarkGray"; + this._majorLineTickness = 2; + this._majorLineColor = "White"; + this._majorLineFrequency = 5; + this._background = "Black"; + this._displayMajorLines = true; + this._displayMinorLines = true; + } + _draw(context) { + context.save(); + this._applyStates(context); + if (this._isEnabled) { + if (this._background) { + context.fillStyle = this._background; + context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height); + } + const cellCountX = this._currentMeasure.width / this._cellWidth; + const cellCountY = this._currentMeasure.height / this._cellHeight; + const left = this._currentMeasure.left + this._currentMeasure.width / 2; + const top = this._currentMeasure.top + this._currentMeasure.height / 2; + if (this._displayMinorLines) { + context.strokeStyle = this._minorLineColor; + context.lineWidth = this._minorLineTickness; + for (let x = -cellCountX / 2 + 1;x < cellCountX / 2; x++) { + const cellX = left + x * this.cellWidth; + context.beginPath(); + context.moveTo(cellX, this._currentMeasure.top); + context.lineTo(cellX, this._currentMeasure.top + this._currentMeasure.height); + context.stroke(); + } + for (let y = -cellCountY / 2 + 1;y < cellCountY / 2; y++) { + const cellY = top + y * this.cellHeight; + context.beginPath(); + context.moveTo(this._currentMeasure.left, cellY); + context.lineTo(this._currentMeasure.left + this._currentMeasure.width, cellY); + context.stroke(); + } + } + if (this._displayMajorLines) { + context.strokeStyle = this._majorLineColor; + context.lineWidth = this._majorLineTickness; + for (let x = -cellCountX / 2 + this._majorLineFrequency;x < cellCountX / 2; x += this._majorLineFrequency) { + const cellX = left + x * this.cellWidth; + context.beginPath(); + context.moveTo(cellX, this._currentMeasure.top); + context.lineTo(cellX, this._currentMeasure.top + this._currentMeasure.height); + context.stroke(); + } + for (let y = -cellCountY / 2 + this._majorLineFrequency;y < cellCountY / 2; y += this._majorLineFrequency) { + const cellY = top + y * this.cellHeight; + context.moveTo(this._currentMeasure.left, cellY); + context.lineTo(this._currentMeasure.left + this._currentMeasure.width, cellY); + context.closePath(); + context.stroke(); + } + } + } + context.restore(); + } + _getTypeName() { + return "DisplayGrid"; + } +} +var init_displayGrid2 = __esm(() => { + init_tslib_es62(); + init_control2(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], DisplayGrid3.prototype, "displayMinorLines", null); + __decorate2([ + serialize() + ], DisplayGrid3.prototype, "displayMajorLines", null); + __decorate2([ + serialize() + ], DisplayGrid3.prototype, "background", null); + __decorate2([ + serialize() + ], DisplayGrid3.prototype, "cellWidth", null); + __decorate2([ + serialize() + ], DisplayGrid3.prototype, "cellHeight", null); + __decorate2([ + serialize() + ], DisplayGrid3.prototype, "minorLineTickness", null); + __decorate2([ + serialize() + ], DisplayGrid3.prototype, "minorLineColor", null); + __decorate2([ + serialize() + ], DisplayGrid3.prototype, "majorLineTickness", null); + __decorate2([ + serialize() + ], DisplayGrid3.prototype, "majorLineColor", null); + __decorate2([ + serialize() + ], DisplayGrid3.prototype, "majorLineFrequency", null); + RegisterClass("BABYLON.GUI.DisplayGrid", DisplayGrid3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/sliders/imageBasedSlider.js +class ImageBasedSlider3 extends BaseSlider3 { + get displayThumb() { + return this._displayThumb && this.thumbImage != null; + } + set displayThumb(value) { + if (this._displayThumb === value) { + return; + } + this._displayThumb = value; + this._markAsDirty(); + } + get backgroundImage() { + return this._backgroundImage; + } + set backgroundImage(value) { + if (this._backgroundImage === value) { + return; + } + this._backgroundImage = value; + if (value && !value.isLoaded) { + value.onImageLoadedObservable.addOnce(() => this._markAsDirty()); + } + this._markAsDirty(); + } + get valueBarImage() { + return this._valueBarImage; + } + set valueBarImage(value) { + if (this._valueBarImage === value) { + return; + } + this._valueBarImage = value; + if (value && !value.isLoaded) { + value.onImageLoadedObservable.addOnce(() => this._markAsDirty()); + } + this._markAsDirty(); + } + get thumbImage() { + return this._thumbImage; + } + set thumbImage(value) { + if (this._thumbImage === value) { + return; + } + this._thumbImage = value; + if (value && !value.isLoaded) { + value.onImageLoadedObservable.addOnce(() => this._markAsDirty()); + } + this._markAsDirty(); + } + constructor(name335) { + super(name335); + this.name = name335; + this._tempMeasure = new Measure3(0, 0, 0, 0); + } + _getTypeName() { + return "ImageBasedSlider"; + } + _draw(context) { + context.save(); + this._applyStates(context); + this._prepareRenderingData("rectangle"); + const thumbPosition = this._getThumbPosition(); + const left = this._renderLeft; + const top = this._renderTop; + const width = this._renderWidth; + const height = this._renderHeight; + if (this._backgroundImage) { + this._tempMeasure.copyFromFloats(left, top, width, height); + if (this.isThumbClamped && this.displayThumb) { + if (this.isVertical) { + this._tempMeasure.height += this._effectiveThumbThickness; + } else { + this._tempMeasure.width += this._effectiveThumbThickness; + } + } + this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure); + this._backgroundImage._draw(context); + } + if (this._valueBarImage) { + if (this.isVertical) { + if (this.isThumbClamped && this.displayThumb) { + this._tempMeasure.copyFromFloats(left, top + thumbPosition, width, height - thumbPosition + this._effectiveThumbThickness); + } else { + this._tempMeasure.copyFromFloats(left, top + thumbPosition, width, height - thumbPosition); + } + } else { + if (this.isThumbClamped && this.displayThumb) { + this._tempMeasure.copyFromFloats(left, top, thumbPosition + this._effectiveThumbThickness / 2, height); + } else { + this._tempMeasure.copyFromFloats(left, top, thumbPosition, height); + } + } + this._valueBarImage._currentMeasure.copyFrom(this._tempMeasure); + this._valueBarImage._draw(context); + } + if (this.displayThumb) { + if (this.isVertical) { + this._tempMeasure.copyFromFloats(left - this._effectiveBarOffset, this._currentMeasure.top + thumbPosition, this._currentMeasure.width, this._effectiveThumbThickness); + } else { + this._tempMeasure.copyFromFloats(this._currentMeasure.left + thumbPosition, this._currentMeasure.top, this._effectiveThumbThickness, this._currentMeasure.height); + } + this._thumbImage._currentMeasure.copyFrom(this._tempMeasure); + this._thumbImage._draw(context); + } + context.restore(); + } + serialize(serializationObject) { + super.serialize(serializationObject); + const backgroundImage = {}; + const thumbImage = {}; + const valueBarImage = {}; + this.backgroundImage.serialize(backgroundImage); + this.thumbImage.serialize(thumbImage); + this.valueBarImage.serialize(valueBarImage); + serializationObject.backgroundImage = backgroundImage; + serializationObject.thumbImage = thumbImage; + serializationObject.valueBarImage = valueBarImage; + } + _parseFromContent(serializedObject, host) { + super._parseFromContent(serializedObject, host); + this.backgroundImage = Image4.Parse(serializedObject.backgroundImage, host); + this.thumbImage = Image4.Parse(serializedObject.thumbImage, host); + this.valueBarImage = Image4.Parse(serializedObject.valueBarImage, host); + } +} +var init_imageBasedSlider2 = __esm(() => { + init_tslib_es62(); + init_baseSlider2(); + init_measure2(); + init_image2(); + init_typeStore(); + init_decorators(); + __decorate2([ + serialize() + ], ImageBasedSlider3.prototype, "displayThumb", null); + RegisterClass("BABYLON.GUI.ImageBasedSlider", ImageBasedSlider3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/statics.js +var name335; +var init_statics2 = __esm(() => { + init_control2(); + init_stackPanel2(); + init_textBlock2(); + name335 = "Statics"; + Control3.AddHeader = function(control69, text, size, options) { + const panel = new StackPanel3("panel"); + const isHorizontal = options ? options.isHorizontal : true; + const controlFirst = options ? options.controlFirst : true; + panel.isVertical = !isHorizontal; + const header = new TextBlock3("header"); + header.text = text; + header.textHorizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + if (isHorizontal) { + header.width = size; + } else { + header.height = size; + } + if (controlFirst) { + panel.addControl(control69); + panel.addControl(header); + header.paddingLeft = "5px"; + } else { + panel.addControl(header); + panel.addControl(control69); + header.paddingRight = "5px"; + } + header.shadowBlur = control69.shadowBlur; + header.shadowColor = control69.shadowColor; + header.shadowOffsetX = control69.shadowOffsetX; + header.shadowOffsetY = control69.shadowOffsetY; + return panel; + }; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/gradient/BaseGradient.js +class BaseGradient9 { + constructor() { + this._colorStops = []; + this._gradientDirty = true; + } + _addColorStopsToCanvasGradient() { + for (const stop of this._colorStops) { + this._canvasGradient.addColorStop(stop.offset, stop.color); + } + } + getCanvasGradient(context) { + if (this._gradientDirty || this._context !== context) { + this._context = context; + this._canvasGradient = this._createCanvasGradient(context); + this._addColorStopsToCanvasGradient(); + this._gradientDirty = false; + } + return this._canvasGradient; + } + addColorStop(offset, color) { + this._colorStops.push({ offset, color }); + this._gradientDirty = true; + } + removeColorStop(offset) { + this._colorStops = this._colorStops.filter((colorStop) => colorStop.offset !== offset); + this._gradientDirty = true; + } + clearColorStops() { + this._colorStops = []; + this._gradientDirty = true; + } + get colorStops() { + return this._colorStops; + } + getClassName() { + return "BaseGradient"; + } + serialize(serializationObject) { + serializationObject.colorStops = this._colorStops; + serializationObject.className = this.getClassName(); + } + parse(serializationObject) { + this._colorStops = serializationObject.colorStops; + } +} +var init_BaseGradient2 = __esm(() => { +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/gradient/LinearGradient.js +class LinearGradient5 extends BaseGradient9 { + constructor(x0, y0, x1, y1) { + super(); + this._x0 = x0 !== null && x0 !== undefined ? x0 : 0; + this._y0 = y0 !== null && y0 !== undefined ? y0 : 0; + this._x1 = x1 !== null && x1 !== undefined ? x1 : 0; + this._y1 = y1 !== null && y1 !== undefined ? y1 : 0; + } + _createCanvasGradient(context) { + return context.createLinearGradient(this._x0, this._y0, this._x1, this._y1); + } + get x0() { + return this._x0; + } + get x1() { + return this._x1; + } + get y0() { + return this._y0; + } + get y1() { + return this._y1; + } + getClassName() { + return "LinearGradient"; + } + serialize(serializationObject) { + super.serialize(serializationObject); + serializationObject.x0 = this._x0; + serializationObject.y0 = this._y0; + serializationObject.x1 = this._x1; + serializationObject.y1 = this._y1; + } + parse(serializationObject) { + super.parse(serializationObject); + this._x0 = serializationObject.x0; + this._y0 = serializationObject.y0; + this._x1 = serializationObject.x1; + this._y1 = serializationObject.y1; + } +} +var init_LinearGradient2 = __esm(() => { + init_BaseGradient2(); + init_typeStore(); + RegisterClass("BABYLON.GUI.LinearGradient", LinearGradient5); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/gradient/RadialGradient.js +class RadialGradient5 extends BaseGradient9 { + constructor(x0, y0, r0, x1, y1, r1) { + super(); + this._x0 = x0 !== null && x0 !== undefined ? x0 : 0; + this._y0 = y0 !== null && y0 !== undefined ? y0 : 0; + this._r0 = r0 !== null && r0 !== undefined ? r0 : 0; + this._x1 = x1 !== null && x1 !== undefined ? x1 : 0; + this._y1 = y1 !== null && y1 !== undefined ? y1 : 0; + this._r1 = r1 !== null && r1 !== undefined ? r1 : 0; + } + _createCanvasGradient(context) { + return context.createRadialGradient(this._x0, this._y0, this._r0, this._x1, this._y1, this._r1); + } + get x0() { + return this._x0; + } + get x1() { + return this._x1; + } + get y0() { + return this._y0; + } + get y1() { + return this._y1; + } + get r0() { + return this._r0; + } + get r1() { + return this._r1; + } + getClassName() { + return "RadialGradient"; + } + serialize(serializationObject) { + super.serialize(serializationObject); + serializationObject.x0 = this._x0; + serializationObject.y0 = this._y0; + serializationObject.r0 = this._r0; + serializationObject.x1 = this._x1; + serializationObject.y1 = this._y1; + serializationObject.r1 = this._r1; + } + parse(serializationObject) { + super.parse(serializationObject); + this._x0 = serializationObject.x0; + this._y0 = serializationObject.y0; + this._r0 = serializationObject.r0; + this._x1 = serializationObject.x1; + this._y1 = serializationObject.y1; + this._r1 = serializationObject.r1; + } +} +var init_RadialGradient2 = __esm(() => { + init_BaseGradient2(); + init_typeStore(); + RegisterClass("BABYLON.GUI.RadialGradient", RadialGradient5); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/controls/index.js +var init_controls3 = __esm(() => { + init_button2(); + init_checkbox2(); + init_colorpicker2(); + init_container2(); + init_control2(); + init_ellipse2(); + init_focusableButton2(); + init_focusableControl2(); + init_grid3(); + init_image2(); + init_inputText2(); + init_inputTextArea2(); + init_inputPassword2(); + init_line2(); + init_multiLine2(); + init_radioButton2(); + init_stackPanel2(); + init_selector2(); + init_scrollViewer2(); + init_textBlock2(); + init_textWrapper2(); + init_toggleButton2(); + init_virtualKeyboard2(); + init_rectangle2(); + init_displayGrid2(); + init_baseSlider2(); + init_slider2(); + init_imageBasedSlider2(); + init_scrollBar2(); + init_imageScrollBar2(); + init_statics2(); + init_BaseGradient2(); + init_LinearGradient2(); + init_RadialGradient2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/style.js +class Style3 { + constructor(host) { + this._fontFamily = "Arial"; + this._fontStyle = ""; + this._fontWeight = ""; + this._fontSize = new ValueAndUnit3(18, ValueAndUnit3.UNITMODE_PIXEL, false); + this.onChangedObservable = new Observable; + this._host = host; + } + get fontSize() { + return this._fontSize.toString(this._host); + } + set fontSize(value) { + if (this._fontSize.toString(this._host) === value) { + return; + } + if (this._fontSize.fromString(value)) { + this.onChangedObservable.notifyObservers(this); + } + } + get fontFamily() { + return this._fontFamily; + } + set fontFamily(value) { + if (this._fontFamily === value) { + return; + } + this._fontFamily = value; + this.onChangedObservable.notifyObservers(this); + } + get fontStyle() { + return this._fontStyle; + } + set fontStyle(value) { + if (this._fontStyle === value) { + return; + } + this._fontStyle = value; + this.onChangedObservable.notifyObservers(this); + } + get fontWeight() { + return this._fontWeight; + } + set fontWeight(value) { + if (this._fontWeight === value) { + return; + } + this._fontWeight = value; + this.onChangedObservable.notifyObservers(this); + } + dispose() { + this.onChangedObservable.clear(); + } +} +var init_style2 = __esm(() => { + init_observable(); + init_valueAndUnit2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/advancedDynamicTexture.js +class AdvancedDynamicTexture3 extends DynamicTexture { + get numLayoutCalls() { + return this._numLayoutCalls; + } + get numRenderCalls() { + return this._numRenderCalls; + } + get renderScale() { + return this._renderScale; + } + set renderScale(value) { + if (value === this._renderScale) { + return; + } + this._renderScale = value; + this._onResize(); + } + get background() { + return this._background; + } + set background(value) { + if (this._background === value) { + return; + } + this._background = value; + this.markAsDirty(); + } + get idealWidth() { + return this._idealWidth; + } + set idealWidth(value) { + if (this._idealWidth === value) { + return; + } + this._idealWidth = value; + this.markAsDirty(); + this._rootContainer._markAllAsDirty(); + } + get idealHeight() { + return this._idealHeight; + } + set idealHeight(value) { + if (this._idealHeight === value) { + return; + } + this._idealHeight = value; + this.markAsDirty(); + this._rootContainer._markAllAsDirty(); + } + get useSmallestIdeal() { + return this._useSmallestIdeal; + } + set useSmallestIdeal(value) { + if (this._useSmallestIdeal === value) { + return; + } + this._useSmallestIdeal = value; + this.markAsDirty(); + this._rootContainer._markAllAsDirty(); + } + get renderAtIdealSize() { + return this._renderAtIdealSize; + } + set renderAtIdealSize(value) { + if (this._renderAtIdealSize === value) { + return; + } + this._renderAtIdealSize = value; + this._onResize(); + } + get idealRatio() { + let rwidth = 0; + let rheight = 0; + if (this._idealWidth) { + rwidth = this.getSize().width / this._idealWidth; + } + if (this._idealHeight) { + rheight = this.getSize().height / this._idealHeight; + } + if (this._useSmallestIdeal && this._idealWidth && this._idealHeight) { + return window.innerWidth < window.innerHeight ? rwidth : rheight; + } + if (this._idealWidth) { + return rwidth; + } + if (this._idealHeight) { + return rheight; + } + return 1; + } + get layer() { + return this._layerToDispose; + } + get rootContainer() { + return this._rootContainer; + } + getChildren() { + return [this._rootContainer]; + } + getDescendants(directDescendantsOnly, predicate) { + return this._rootContainer.getDescendants(directDescendantsOnly, predicate); + } + getControlsByType(typeName) { + return this._rootContainer.getDescendants(false, (control71) => control71.typeName === typeName); + } + getControlByName(name336) { + return this._getControlByKey("name", name336); + } + _getControlByKey(key, value) { + return this._rootContainer.getDescendants().find((control71) => control71[key] === value) || null; + } + get focusedControl() { + return this._focusedControl; + } + set focusedControl(control71) { + if (this._focusedControl == control71) { + return; + } + if (this._focusedControl) { + this._focusedControl.onBlur(); + } + if (control71) { + control71.onFocus(); + } + this._focusedControl = control71; + } + get isForeground() { + if (!this.layer) { + return true; + } + return !this.layer.isBackground; + } + set isForeground(value) { + if (!this.layer) { + return; + } + if (this.layer.isBackground === !value) { + return; + } + this.layer.isBackground = !value; + } + get clipboardData() { + return this._clipboardData; + } + set clipboardData(value) { + this._clipboardData = value; + } + constructor(name336, width = 0, height = 0, scene50, generateMipMaps = false, samplingMode = Texture.NEAREST_SAMPLINGMODE, invertY = true) { + super(name336, { width, height }, scene50, generateMipMaps, samplingMode, Constants.TEXTUREFORMAT_RGBA, invertY); + this.onGuiReadyObservable = new Observable; + this._isDirty = false; + this._rootContainer = new Container3("root"); + this._lastControlOver = {}; + this._lastControlDown = {}; + this._capturingControl = {}; + this._linkedControls = new Array; + this._isFullscreen = false; + this._fullscreenViewport = new Viewport(0, 0, 1, 1); + this._idealWidth = 0; + this._idealHeight = 0; + this._useSmallestIdeal = false; + this._renderAtIdealSize = false; + this._blockNextFocusCheck = false; + this._renderScale = 1; + this._cursorChanged = false; + this._defaultMousePointerId = 0; + this._rootChildrenHaveChanged = false; + this._capturedPointerIds = new Set; + this._numLayoutCalls = 0; + this._numRenderCalls = 0; + this._clipboardData = ""; + this.onClipboardObservable = new Observable; + this.onControlPickedObservable = new Observable; + this.onBeginLayoutObservable = new Observable; + this.onEndLayoutObservable = new Observable; + this.onBeginRenderObservable = new Observable; + this.onEndRenderObservable = new Observable; + this.premulAlpha = false; + this.applyYInversionOnUpdate = true; + this.skipBlockEvents = 0; + this.checkPointerEveryFrame = false; + this._useInvalidateRectOptimization = true; + this._invalidatedRectangle = null; + this._clearMeasure = new Measure3(0, 0, 0, 0); + this._onClipboardCopy = (rawEvt) => { + const evt = rawEvt; + const ev = new ClipboardInfo(ClipboardEventTypes.COPY, evt); + this.onClipboardObservable.notifyObservers(ev); + evt.preventDefault(); + }; + this._onClipboardCut = (rawEvt) => { + const evt = rawEvt; + const ev = new ClipboardInfo(ClipboardEventTypes.CUT, evt); + this.onClipboardObservable.notifyObservers(ev); + evt.preventDefault(); + }; + this._onClipboardPaste = (rawEvt) => { + const evt = rawEvt; + const ev = new ClipboardInfo(ClipboardEventTypes.PASTE, evt); + this.onClipboardObservable.notifyObservers(ev); + evt.preventDefault(); + }; + this.parseContent = this.parseSerializedObject; + scene50 = this.getScene(); + if (!scene50 || !this._texture) { + return; + } + this.applyYInversionOnUpdate = invertY; + this._rootElement = scene50.getEngine().getInputElement(); + this._renderObserver = scene50.onBeforeCameraRenderObservable.add((camera34) => this._checkUpdate(camera34)); + this._controlAddedObserver = this._rootContainer.onControlAddedObservable.add((control71) => { + if (control71) { + this._rootChildrenHaveChanged = true; + } + }); + this._controlRemovedObserver = this._rootContainer.onControlRemovedObservable.add((control71) => { + if (control71) { + this._rootChildrenHaveChanged = true; + } + }); + this._preKeyboardObserver = scene50.onPreKeyboardObservable.add((info) => { + if (!this._focusedControl) { + return; + } + if (info.type === KeyboardEventTypes.KEYDOWN) { + this._focusedControl.processKeyboard(info.event); + } + info.skipOnPointerObservable = true; + }); + this._rootContainer._link(this); + this.hasAlpha = true; + if (!width || !height) { + this._resizeObserver = scene50.getEngine().onResizeObservable.add(() => this._onResize()); + this._onResize(); + } + this._texture.isReady = true; + } + getClassName() { + return "AdvancedDynamicTexture"; + } + executeOnAllControls(func, container25) { + if (!container25) { + container25 = this._rootContainer; + } + func(container25); + for (const child of container25.children) { + if (child.children) { + this.executeOnAllControls(func, child); + continue; + } + func(child); + } + } + get useInvalidateRectOptimization() { + return this._useInvalidateRectOptimization; + } + set useInvalidateRectOptimization(value) { + this._useInvalidateRectOptimization = value; + } + invalidateRect(invalidMinX, invalidMinY, invalidMaxX, invalidMaxY) { + if (!this._useInvalidateRectOptimization) { + return; + } + if (!this._invalidatedRectangle) { + this._invalidatedRectangle = new Measure3(invalidMinX, invalidMinY, invalidMaxX - invalidMinX + 1, invalidMaxY - invalidMinY + 1); + } else { + const maxX = Math.ceil(Math.max(this._invalidatedRectangle.left + this._invalidatedRectangle.width - 1, invalidMaxX)); + const maxY = Math.ceil(Math.max(this._invalidatedRectangle.top + this._invalidatedRectangle.height - 1, invalidMaxY)); + this._invalidatedRectangle.left = Math.floor(Math.min(this._invalidatedRectangle.left, invalidMinX)); + this._invalidatedRectangle.top = Math.floor(Math.min(this._invalidatedRectangle.top, invalidMinY)); + this._invalidatedRectangle.width = maxX - this._invalidatedRectangle.left + 1; + this._invalidatedRectangle.height = maxY - this._invalidatedRectangle.top + 1; + } + } + markAsDirty() { + this._isDirty = true; + } + createStyle() { + return new Style3(this); + } + addControl(control71) { + this._rootContainer.addControl(control71); + return this; + } + removeControl(control71) { + this._rootContainer.removeControl(control71); + return this; + } + moveToNonOverlappedPosition(overlapGroup, deltaStep = 1, repelFactor = 1) { + let controlsForGroup; + if (Array.isArray(overlapGroup)) { + controlsForGroup = overlapGroup; + } else { + const descendants = this.getDescendants(true); + controlsForGroup = overlapGroup === undefined ? descendants.filter((c) => c.overlapGroup !== undefined) : descendants.filter((c) => c.overlapGroup === overlapGroup); + } + controlsForGroup.forEach((control1) => { + var _a; + let velocity = Vector2.Zero(); + const center = new Vector2(control1.centerX, control1.centerY); + controlsForGroup.forEach((control210) => { + if (control1 !== control210 && AdvancedDynamicTexture3._Overlaps(control1, control210)) { + const diff = center.subtract(new Vector2(control210.centerX, control210.centerY)); + const diffLength = diff.length(); + if (diffLength > 0) { + velocity = velocity.add(diff.normalize().scale(repelFactor / diffLength)); + } + } + }); + if (velocity.length() > 0) { + velocity = velocity.normalize().scale(deltaStep * ((_a = control1.overlapDeltaMultiplier) !== null && _a !== undefined ? _a : 1)); + control1.linkOffsetXInPixels += velocity.x; + control1.linkOffsetYInPixels += velocity.y; + } + }); + } + dispose() { + const scene50 = this.getScene(); + if (!scene50) { + return; + } + this._rootElement = null; + scene50.onBeforeCameraRenderObservable.remove(this._renderObserver); + if (this._resizeObserver) { + scene50.getEngine().onResizeObservable.remove(this._resizeObserver); + } + if (this._prePointerObserver) { + scene50.onPrePointerObservable.remove(this._prePointerObserver); + } + if (this._sceneRenderObserver) { + scene50.onBeforeRenderObservable.remove(this._sceneRenderObserver); + } + if (this._pointerObserver) { + scene50.onPointerObservable.remove(this._pointerObserver); + } + if (this._preKeyboardObserver) { + scene50.onPreKeyboardObservable.remove(this._preKeyboardObserver); + } + if (this._canvasPointerOutObserver) { + scene50.getEngine().onCanvasPointerOutObservable.remove(this._canvasPointerOutObserver); + } + if (this._canvasBlurObserver) { + scene50.getEngine().onCanvasBlurObservable.remove(this._canvasBlurObserver); + } + if (this._controlAddedObserver) { + this._rootContainer.onControlAddedObservable.remove(this._controlAddedObserver); + } + if (this._controlRemovedObserver) { + this._rootContainer.onControlRemovedObservable.remove(this._controlRemovedObserver); + } + if (this._layerToDispose) { + this._layerToDispose.texture = null; + this._layerToDispose.dispose(); + this._layerToDispose = null; + } + this._rootContainer.dispose(); + this.onClipboardObservable.clear(); + this.onControlPickedObservable.clear(); + this.onBeginRenderObservable.clear(); + this.onEndRenderObservable.clear(); + this.onBeginLayoutObservable.clear(); + this.onEndLayoutObservable.clear(); + this.onGuiReadyObservable.clear(); + super.dispose(); + } + _onResize() { + const scene50 = this.getScene(); + if (!scene50) { + return; + } + const engine47 = scene50.getEngine(); + const textureSize = this.getSize(); + let renderWidth = engine47.getRenderWidth() * this._renderScale; + let renderHeight = engine47.getRenderHeight() * this._renderScale; + if (this._renderAtIdealSize) { + if (this._idealWidth) { + renderHeight = renderHeight * this._idealWidth / renderWidth; + renderWidth = this._idealWidth; + } else if (this._idealHeight) { + renderWidth = renderWidth * this._idealHeight / renderHeight; + renderHeight = this._idealHeight; + } + } + if (textureSize.width !== renderWidth || textureSize.height !== renderHeight) { + this.scaleTo(renderWidth, renderHeight); + this.markAsDirty(); + if (this._idealWidth || this._idealHeight) { + this._rootContainer._markAllAsDirty(); + } + } + this.invalidateRect(0, 0, textureSize.width - 1, textureSize.height - 1); + } + _getGlobalViewport() { + const size = this.getSize(); + const globalViewPort = this._fullscreenViewport.toGlobal(size.width, size.height); + const targetX = Math.round(globalViewPort.width * (1 / this.rootContainer.scaleX)); + const targetY = Math.round(globalViewPort.height * (1 / this.rootContainer.scaleY)); + globalViewPort.x += (globalViewPort.width - targetX) / 2; + globalViewPort.y += (globalViewPort.height - targetY) / 2; + globalViewPort.width = targetX; + globalViewPort.height = targetY; + return globalViewPort; + } + getProjectedPosition(position3, worldMatrix) { + const result = this.getProjectedPositionWithZ(position3, worldMatrix); + return new Vector2(result.x, result.y); + } + getProjectedPositionWithZ(position3, worldMatrix) { + const scene50 = this.getScene(); + if (!scene50) { + return Vector3.Zero(); + } + const globalViewport = this._getGlobalViewport(); + const projectedPosition = Vector3.Project(position3, worldMatrix, scene50.getTransformMatrix(), globalViewport); + return new Vector3(projectedPosition.x, projectedPosition.y, projectedPosition.z); + } + _checkUpdate(camera34, skipUpdate) { + if (this._layerToDispose) { + if ((camera34.layerMask & this._layerToDispose.layerMask) === 0) { + return; + } + } + if (this._isFullscreen && this._linkedControls.length) { + const scene50 = this.getScene(); + if (!scene50) { + return; + } + const globalViewport = this._getGlobalViewport(); + for (const control71 of this._linkedControls) { + if (!control71.isVisible) { + continue; + } + const mesh84 = control71._linkedMesh; + if (!mesh84 || mesh84.isDisposed()) { + Tools.SetImmediate(() => { + control71.linkWithMesh(null); + }); + continue; + } + const position3 = mesh84.getBoundingInfo ? mesh84.getBoundingInfo().boundingSphere.center : Vector3.ZeroReadOnly; + const projectedPosition = Vector3.Project(position3, mesh84.getWorldMatrix(), scene50.getTransformMatrix(), globalViewport); + if (projectedPosition.z < 0 || projectedPosition.z > 1) { + control71.notRenderable = true; + continue; + } + control71.notRenderable = false; + if (this.useInvalidateRectOptimization) { + control71.invalidateRect(); + } + control71._moveToProjectedPosition(projectedPosition); + } + } + if (!this._isDirty && !this._rootContainer.isDirty) { + return; + } + this._isDirty = false; + this._render(skipUpdate); + if (!skipUpdate) { + this.update(this.applyYInversionOnUpdate, this.premulAlpha, AdvancedDynamicTexture3.AllowGPUOptimizations); + } + } + _render(skipRender) { + var _a; + const textureSize = this.getSize(); + const renderWidth = textureSize.width; + const renderHeight = textureSize.height; + const context = this.getContext(); + context.font = "18px Arial"; + context.strokeStyle = "white"; + if (this.onGuiReadyObservable.hasObservers()) { + this._checkGuiIsReady(); + } + if (this._rootChildrenHaveChanged) { + const camera34 = (_a = this.getScene()) === null || _a === undefined ? undefined : _a.activeCamera; + if (camera34) { + this._rootChildrenHaveChanged = false; + this._checkUpdate(camera34, true); + } + } + this.onBeginLayoutObservable.notifyObservers(this); + const measure24 = new Measure3(0, 0, renderWidth, renderHeight); + this._numLayoutCalls = 0; + this._rootContainer._layout(measure24, context); + this.onEndLayoutObservable.notifyObservers(this); + this._isDirty = false; + if (skipRender) { + return; + } + if (this._invalidatedRectangle) { + this._clearMeasure.copyFrom(this._invalidatedRectangle); + } else { + this._clearMeasure.copyFromFloats(0, 0, renderWidth, renderHeight); + } + context.clearRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height); + if (this._background) { + context.save(); + context.fillStyle = this._background; + context.fillRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height); + context.restore(); + } + this.onBeginRenderObservable.notifyObservers(this); + this._numRenderCalls = 0; + this._rootContainer._render(context, this._invalidatedRectangle); + this.onEndRenderObservable.notifyObservers(this); + this._invalidatedRectangle = null; + } + _changeCursor(cursor) { + if (this._rootElement) { + this._rootElement.style.cursor = cursor; + this._cursorChanged = true; + } + } + _registerLastControlDown(control71, pointerId) { + this._lastControlDown[pointerId] = control71; + this.onControlPickedObservable.notifyObservers(control71); + } + _doPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) { + const scene50 = this.getScene(); + if (!scene50) { + return; + } + const engine47 = scene50.getEngine(); + const textureSize = this.getSize(); + if (this._isFullscreen) { + const camera34 = scene50.cameraToUseForPointers || scene50.activeCamera; + if (!camera34) { + return; + } + const viewport = camera34.viewport; + x = x * (textureSize.width / (engine47.getRenderWidth() * viewport.width)); + y = y * (textureSize.height / (engine47.getRenderHeight() * viewport.height)); + } + if (this._capturingControl[pointerId]) { + if (this._capturingControl[pointerId].isPointerBlocker) { + this._shouldBlockPointer = true; + } + this._capturingControl[pointerId]._processObservables(type, x, y, pi, pointerId, buttonIndex); + return; + } + this._cursorChanged = false; + if (!this._rootContainer._processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY)) { + if (!scene50.doNotHandleCursors) { + this._changeCursor(""); + } + if (type === PointerEventTypes.POINTERMOVE) { + if (this._lastControlOver[pointerId]) { + this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], pi); + delete this._lastControlOver[pointerId]; + } + } + } + if (!this._cursorChanged && !scene50.doNotHandleCursors) { + this._changeCursor(""); + } + this._manageFocus(); + } + _cleanControlAfterRemovalFromList(list, control71) { + for (const pointerId in list) { + if (!Object.prototype.hasOwnProperty.call(list, pointerId)) { + continue; + } + const lastControlOver = list[pointerId]; + if (lastControlOver === control71) { + delete list[pointerId]; + } + } + } + _cleanControlAfterRemoval(control71) { + this._cleanControlAfterRemovalFromList(this._lastControlDown, control71); + this._cleanControlAfterRemovalFromList(this._lastControlOver, control71); + } + pick(x, y, pi = null) { + if (this._isFullscreen && this._scene) { + this._translateToPicking(this._scene, new Viewport(0, 0, 0, 0), pi, x, y); + } + } + _translateToPicking(scene50, tempViewport, pi, x = scene50.pointerX, y = scene50.pointerY) { + const camera34 = scene50.cameraToUseForPointers || scene50.activeCamera; + const engine47 = scene50.getEngine(); + const originalCameraToUseForPointers = scene50.cameraToUseForPointers; + if (!camera34) { + tempViewport.x = 0; + tempViewport.y = 0; + tempViewport.width = engine47.getRenderWidth(); + tempViewport.height = engine47.getRenderHeight(); + } else { + if (camera34.rigCameras.length) { + const rigViewport = new Viewport(0, 0, 1, 1); + camera34.rigCameras.forEach((rigCamera) => { + rigCamera.viewport.toGlobalToRef(engine47.getRenderWidth(), engine47.getRenderHeight(), rigViewport); + const transformedX2 = x / engine47.getHardwareScalingLevel() - rigViewport.x; + const transformedY2 = y / engine47.getHardwareScalingLevel() - (engine47.getRenderHeight() - rigViewport.y - rigViewport.height); + if (transformedX2 < 0 || transformedY2 < 0 || x > rigViewport.width || y > rigViewport.height) { + return; + } + scene50.cameraToUseForPointers = rigCamera; + tempViewport.x = rigViewport.x; + tempViewport.y = rigViewport.y; + tempViewport.width = rigViewport.width; + tempViewport.height = rigViewport.height; + }); + } else { + camera34.viewport.toGlobalToRef(engine47.getRenderWidth(), engine47.getRenderHeight(), tempViewport); + } + } + const transformedX = x / engine47.getHardwareScalingLevel() - tempViewport.x; + const transformedY = y / engine47.getHardwareScalingLevel() - (engine47.getRenderHeight() - tempViewport.y - tempViewport.height); + this._shouldBlockPointer = false; + if (pi) { + const pointerId = pi.event.pointerId || this._defaultMousePointerId; + this._doPicking(transformedX, transformedY, pi, pi.type, pointerId, pi.event.button, pi.event.deltaX, pi.event.deltaY); + if (this._shouldBlockPointer && !(pi.type & this.skipBlockEvents) || this._capturingControl[pointerId]) { + pi.skipOnPointerObservable = true; + } + } else { + this._doPicking(transformedX, transformedY, null, PointerEventTypes.POINTERMOVE, this._defaultMousePointerId, 0); + } + scene50.cameraToUseForPointers = originalCameraToUseForPointers; + } + attach() { + const scene50 = this.getScene(); + if (!scene50) { + return; + } + const tempViewport = new Viewport(0, 0, 0, 0); + this._prePointerObserver = scene50.onPrePointerObservable.add((pi) => { + if (scene50.isPointerCaptured(pi.event.pointerId) && pi.type === PointerEventTypes.POINTERUP && !this._capturedPointerIds.has(pi.event.pointerId)) { + return; + } + if (pi.type !== PointerEventTypes.POINTERMOVE && pi.type !== PointerEventTypes.POINTERUP && pi.type !== PointerEventTypes.POINTERDOWN && pi.type !== PointerEventTypes.POINTERWHEEL) { + return; + } + if (pi.type === PointerEventTypes.POINTERMOVE) { + if (scene50.isPointerCaptured(pi.event.pointerId)) { + return; + } + if (pi.event.pointerId) { + this._defaultMousePointerId = pi.event.pointerId; + } + } + this._translateToPicking(scene50, tempViewport, pi); + }); + this._attachPickingToSceneRender(scene50, () => this._translateToPicking(scene50, tempViewport, null), false); + this._attachToOnPointerOut(scene50); + this._attachToOnBlur(scene50); + } + registerClipboardEvents() { + self.addEventListener("copy", this._onClipboardCopy, false); + self.addEventListener("cut", this._onClipboardCut, false); + self.addEventListener("paste", this._onClipboardPaste, false); + } + unRegisterClipboardEvents() { + self.removeEventListener("copy", this._onClipboardCopy); + self.removeEventListener("cut", this._onClipboardCut); + self.removeEventListener("paste", this._onClipboardPaste); + } + _transformUvs(uv) { + const textureMatrix = this.getTextureMatrix(); + let result; + if (textureMatrix.isIdentityAs3x2()) { + result = uv; + } else { + const homogeneousTextureMatrix = TmpVectors.Matrix[0]; + textureMatrix.getRowToRef(0, TmpVectors.Vector4[0]); + textureMatrix.getRowToRef(1, TmpVectors.Vector4[1]); + textureMatrix.getRowToRef(2, TmpVectors.Vector4[2]); + const r0 = TmpVectors.Vector4[0]; + const r1 = TmpVectors.Vector4[1]; + const r2 = TmpVectors.Vector4[2]; + homogeneousTextureMatrix.setRowFromFloats(0, r0.x, r0.y, 0, 0); + homogeneousTextureMatrix.setRowFromFloats(1, r1.x, r1.y, 0, 0); + homogeneousTextureMatrix.setRowFromFloats(2, 0, 0, 1, 0); + homogeneousTextureMatrix.setRowFromFloats(3, r2.x, r2.y, 0, 1); + result = TmpVectors.Vector2[0]; + Vector2.TransformToRef(uv, homogeneousTextureMatrix, result); + } + if (this.wrapU === Texture.WRAP_ADDRESSMODE || this.wrapU === Texture.MIRROR_ADDRESSMODE) { + if (result.x > 1) { + let fX = result.x - Math.trunc(result.x); + if (this.wrapU === Texture.MIRROR_ADDRESSMODE && Math.trunc(result.x) % 2 === 1) { + fX = 1 - fX; + } + result.x = fX; + } + } + if (this.wrapV === Texture.WRAP_ADDRESSMODE || this.wrapV === Texture.MIRROR_ADDRESSMODE) { + if (result.y > 1) { + let fY = result.y - Math.trunc(result.y); + if (this.wrapV === Texture.MIRROR_ADDRESSMODE && Math.trunc(result.x) % 2 === 1) { + fY = 1 - fY; + } + result.y = fY; + } + } + return result; + } + attachToMesh(mesh84, supportPointerMove = true) { + const scene50 = this.getScene(); + if (!scene50) { + return; + } + if (this._pointerObserver) { + scene50.onPointerObservable.remove(this._pointerObserver); + } + this._pointerObserver = scene50.onPointerObservable.add((pi) => { + if (pi.type !== PointerEventTypes.POINTERMOVE && pi.type !== PointerEventTypes.POINTERUP && pi.type !== PointerEventTypes.POINTERDOWN && pi.type !== PointerEventTypes.POINTERWHEEL) { + return; + } + if (pi.type === PointerEventTypes.POINTERMOVE && pi.event.pointerId) { + this._defaultMousePointerId = pi.event.pointerId; + } + const pointerId = pi.event.pointerId || this._defaultMousePointerId; + if (pi.pickInfo && pi.pickInfo.hit && pi.pickInfo.pickedMesh === mesh84) { + let uv = pi.pickInfo.getTextureCoordinates(); + if (uv) { + uv = this._transformUvs(uv); + const size = this.getSize(); + this._doPicking(uv.x * size.width, (this.applyYInversionOnUpdate ? 1 - uv.y : uv.y) * size.height, pi, pi.type, pointerId, pi.event.button, pi.event.deltaX, pi.event.deltaY); + } + } else if (pi.type === PointerEventTypes.POINTERUP) { + if (this._lastControlDown[pointerId]) { + this._lastControlDown[pointerId]._forcePointerUp(pointerId); + } + delete this._lastControlDown[pointerId]; + if (this.focusedControl) { + const friendlyControls = this.focusedControl.keepsFocusWith(); + let canMoveFocus = true; + if (friendlyControls) { + for (const control71 of friendlyControls) { + if (this === control71._host) { + continue; + } + const otherHost = control71._host; + if (otherHost._lastControlOver[pointerId] && otherHost._lastControlOver[pointerId].isAscendant(control71)) { + canMoveFocus = false; + break; + } + } + } + if (canMoveFocus) { + this.focusedControl = null; + } + } + } else if (pi.type === PointerEventTypes.POINTERMOVE) { + if (this._lastControlOver[pointerId]) { + this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], pi, true); + } + delete this._lastControlOver[pointerId]; + } + }); + mesh84.enablePointerMoveEvents = supportPointerMove; + this._attachPickingToSceneRender(scene50, () => { + const pointerId = this._defaultMousePointerId; + const pick = scene50 === null || scene50 === undefined ? undefined : scene50.pick(scene50.pointerX, scene50.pointerY); + if (pick && pick.hit && pick.pickedMesh === mesh84) { + let uv = pick.getTextureCoordinates(); + if (uv) { + uv = this._transformUvs(uv); + const size = this.getSize(); + this._doPicking(uv.x * size.width, (this.applyYInversionOnUpdate ? 1 - uv.y : uv.y) * size.height, null, PointerEventTypes.POINTERMOVE, pointerId, 0); + } + } else { + if (this._lastControlOver[pointerId]) { + this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], null, true); + } + delete this._lastControlOver[pointerId]; + } + }, true); + this._attachToOnPointerOut(scene50); + this._attachToOnBlur(scene50); + } + moveFocusToControl(control71) { + this.focusedControl = control71; + this._lastPickedControl = control71; + this._blockNextFocusCheck = true; + } + _manageFocus() { + if (this._blockNextFocusCheck) { + this._blockNextFocusCheck = false; + this._lastPickedControl = this._focusedControl; + return; + } + if (this._focusedControl) { + if (this._focusedControl !== this._lastPickedControl) { + if (this._lastPickedControl.isFocusInvisible) { + return; + } + this.focusedControl = null; + } + } + } + _attachPickingToSceneRender(scene50, pickFunction, forcePicking) { + this._sceneRenderObserver = scene50.onBeforeRenderObservable.add(() => { + if (!this.checkPointerEveryFrame) { + return; + } + if (this._linkedControls.length > 0 || forcePicking) { + pickFunction(); + } + }); + } + _attachToOnPointerOut(scene50) { + this._canvasPointerOutObserver = scene50.getEngine().onCanvasPointerOutObservable.add((pointerEvent) => { + if (this._lastControlOver[pointerEvent.pointerId]) { + this._lastControlOver[pointerEvent.pointerId]._onPointerOut(this._lastControlOver[pointerEvent.pointerId], null); + } + delete this._lastControlOver[pointerEvent.pointerId]; + if (this._lastControlDown[pointerEvent.pointerId] && this._lastControlDown[pointerEvent.pointerId] !== this._capturingControl[pointerEvent.pointerId]) { + this._lastControlDown[pointerEvent.pointerId]._forcePointerUp(pointerEvent.pointerId); + delete this._lastControlDown[pointerEvent.pointerId]; + } + }); + } + _attachToOnBlur(scene50) { + this._canvasBlurObserver = scene50.getEngine().onCanvasBlurObservable.add(() => { + Object.entries(this._lastControlDown).forEach(([, value]) => { + value._onCanvasBlur(); + }); + this.focusedControl = null; + this._lastControlDown = {}; + }); + } + serializeContent() { + const size = this.getSize(); + const serializationObject = { + root: {}, + width: size.width, + height: size.height + }; + this._rootContainer.serialize(serializationObject.root); + return serializationObject; + } + parseSerializedObject(serializedObject, scaleToSize) { + this._rootContainer = Control3.Parse(serializedObject.root, this); + if (scaleToSize) { + const width = serializedObject.width; + const height = serializedObject.height; + if (typeof width === "number" && typeof height === "number" && width >= 0 && height >= 0) { + this.scaleTo(width, height); + } else { + this.scaleTo(1920, 1080); + } + } + } + clone(newName) { + const scene50 = this.getScene(); + if (!scene50) { + return this; + } + const size = this.getSize(); + const data = this.serializeContent(); + const clone = new AdvancedDynamicTexture3(newName !== null && newName !== undefined ? newName : "Clone of " + this.name, size.width, size.height, scene50, !this.noMipmap, this.samplingMode); + clone.parseSerializedObject(data); + return clone; + } + static async ParseFromSnippetAsync(snippetId, scaleToSize, appendToAdt) { + const adt = appendToAdt !== null && appendToAdt !== undefined ? appendToAdt : AdvancedDynamicTexture3.CreateFullscreenUI("ADT from snippet"); + if (snippetId === "_BLANK") { + return adt; + } + const serialized = await AdvancedDynamicTexture3._LoadURLContentAsync(AdvancedDynamicTexture3.SnippetUrl + "/" + snippetId.replace(/#/g, "/"), true); + adt.parseSerializedObject(serialized, scaleToSize); + return adt; + } + parseFromSnippetAsync(snippetId, scaleToSize) { + return AdvancedDynamicTexture3.ParseFromSnippetAsync(snippetId, scaleToSize, this); + } + static async ParseFromFileAsync(url, scaleToSize, appendToAdt) { + const adt = appendToAdt !== null && appendToAdt !== undefined ? appendToAdt : AdvancedDynamicTexture3.CreateFullscreenUI("ADT from URL"); + const serialized = await AdvancedDynamicTexture3._LoadURLContentAsync(url); + adt.parseSerializedObject(serialized, scaleToSize); + return adt; + } + parseFromURLAsync(url, scaleToSize) { + return AdvancedDynamicTexture3.ParseFromFileAsync(url, scaleToSize, this); + } + static _LoadURLContentAsync(url, snippet = false) { + if (url === "") { + return Promise.reject("No URL provided"); + } + return new Promise((resolve, reject) => { + const request = new WebRequest; + request.addEventListener("readystatechange", () => { + if (request.readyState == 4) { + if (request.status == 200) { + let gui2; + if (snippet) { + const payload = JSON.parse(JSON.parse(request.responseText).jsonPayload); + gui2 = payload.encodedGui ? new TextDecoder("utf-8").decode(DecodeBase64ToBinary(payload.encodedGui)) : payload.gui; + } else { + gui2 = request.responseText; + } + const serializationObject = JSON.parse(gui2); + resolve(serializationObject); + } else { + reject("Unable to load"); + } + } + }); + request.open("GET", url); + request.send(); + }); + } + static _Overlaps(control1, control210) { + return !(control1.centerX > control210.centerX + control210.widthInPixels || control1.centerX + control1.widthInPixels < control210.centerX || control1.centerY + control1.heightInPixels < control210.centerY || control1.centerY > control210.centerY + control210.heightInPixels); + } + static CreateForMesh(mesh84, width = 1024, height = 1024, supportPointerMove = true, onlyAlphaTesting = false, invertY, materialSetupCallback = this._CreateMaterial) { + const uniqueId = RandomGUID(); + const result = new AdvancedDynamicTexture3(`AdvancedDynamicTexture for ${mesh84.name} [${uniqueId}]`, width, height, mesh84.getScene(), true, Texture.TRILINEAR_SAMPLINGMODE, invertY); + materialSetupCallback(mesh84, uniqueId, result, onlyAlphaTesting); + result.attachToMesh(mesh84, supportPointerMove); + return result; + } + static _CreateMaterial(mesh84, uniqueId, texture101, onlyAlphaTesting) { + const internalClassType = GetClass("BABYLON.StandardMaterial"); + if (!internalClassType) { + throw "StandardMaterial needs to be imported before as it contains a side-effect required by your code."; + } + const material30 = new internalClassType(`AdvancedDynamicTextureMaterial for ${mesh84.name} [${uniqueId}]`, mesh84.getScene()); + material30.backFaceCulling = false; + material30.diffuseColor = Color3.Black(); + material30.specularColor = Color3.Black(); + if (onlyAlphaTesting) { + material30.diffuseTexture = texture101; + material30.emissiveTexture = texture101; + texture101.hasAlpha = true; + } else { + material30.emissiveTexture = texture101; + material30.opacityTexture = texture101; + } + mesh84.material = material30; + } + static CreateForMeshTexture(mesh84, width = 1024, height = 1024, supportPointerMove = true, invertY) { + const result = new AdvancedDynamicTexture3(mesh84.name + " AdvancedDynamicTexture", width, height, mesh84.getScene(), true, Texture.TRILINEAR_SAMPLINGMODE, invertY); + result.attachToMesh(mesh84, supportPointerMove); + return result; + } + static CreateFullscreenUI(name336, foreground = true, scene50 = null, sampling = Texture.BILINEAR_SAMPLINGMODE, adaptiveScaling = false) { + const result = new AdvancedDynamicTexture3(name336, 0, 0, scene50, false, sampling); + const resultScene = result.getScene(); + const layer5 = new Layer(name336 + "_layer", null, resultScene, !foreground); + layer5.texture = result; + result._layerToDispose = layer5; + result._isFullscreen = true; + if (adaptiveScaling && resultScene) { + const newScale = 1 / resultScene.getEngine().getHardwareScalingLevel(); + result._rootContainer.scaleX = newScale; + result._rootContainer.scaleY = newScale; + } + result.attach(); + return result; + } + scale(ratio) { + super.scale(ratio); + this.markAsDirty(); + } + scaleTo(width, height) { + super.scaleTo(width, height); + this.markAsDirty(); + } + _checkGuiIsReady() { + if (this.guiIsReady()) { + this.onGuiReadyObservable.notifyObservers(this); + this.onGuiReadyObservable.clear(); + } + } + guiIsReady() { + return this._rootContainer.isReady(); + } +} +var init_advancedDynamicTexture2 = __esm(() => { + init_observable(); + init_math_vector(); + init_tools(); + init_pointerEvents(); + init_clipboardEvents(); + init_keyboardEvents(); + init_texture(); + init_dynamicTexture(); + init_layer(); + init_container2(); + init_control2(); + init_style2(); + init_measure2(); + init_constants(); + init_math_viewport(); + init_math_color(); + init_webRequest(); + init_guid(); + init_typeStore(); + init_stringTools(); + AdvancedDynamicTexture3.SnippetUrl = Constants.SnippetUrl; + AdvancedDynamicTexture3.AllowGPUOptimizations = true; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/adtInstrumentation.js +class AdvancedDynamicTextureInstrumentation2 { + get renderTimeCounter() { + return this._renderTime; + } + get layoutTimeCounter() { + return this._layoutTime; + } + get captureRenderTime() { + return this._captureRenderTime; + } + set captureRenderTime(value) { + if (value === this._captureRenderTime) { + return; + } + this._captureRenderTime = value; + if (value) { + this._onBeginRenderObserver = this.texture.onBeginRenderObservable.add(() => { + this._renderTime.beginMonitoring(); + }); + this._onEndRenderObserver = this.texture.onEndRenderObservable.add(() => { + this._renderTime.endMonitoring(true); + }); + } else { + this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver); + this._onBeginRenderObserver = null; + this.texture.onEndRenderObservable.remove(this._onEndRenderObserver); + this._onEndRenderObserver = null; + } + } + get captureLayoutTime() { + return this._captureLayoutTime; + } + set captureLayoutTime(value) { + if (value === this._captureLayoutTime) { + return; + } + this._captureLayoutTime = value; + if (value) { + this._onBeginLayoutObserver = this.texture.onBeginLayoutObservable.add(() => { + this._layoutTime.beginMonitoring(); + }); + this._onEndLayoutObserver = this.texture.onEndLayoutObservable.add(() => { + this._layoutTime.endMonitoring(true); + }); + } else { + this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver); + this._onBeginLayoutObserver = null; + this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver); + this._onEndLayoutObserver = null; + } + } + constructor(texture101) { + this.texture = texture101; + this._captureRenderTime = false; + this._renderTime = new PerfCounter; + this._captureLayoutTime = false; + this._layoutTime = new PerfCounter; + this._onBeginRenderObserver = null; + this._onEndRenderObserver = null; + this._onBeginLayoutObserver = null; + this._onEndLayoutObserver = null; + } + dispose() { + this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver); + this._onBeginRenderObserver = null; + this.texture.onEndRenderObservable.remove(this._onEndRenderObserver); + this._onEndRenderObserver = null; + this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver); + this._onBeginLayoutObserver = null; + this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver); + this._onEndLayoutObserver = null; + this.texture = null; + } +} +var init_adtInstrumentation2 = __esm(() => { + init_perfCounter(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/xmlLoader.js +class XmlLoader2 { + constructor(parentClass = null) { + this._nodes = {}; + this._nodeTypes = { + element: 1, + attribute: 2, + text: 3 + }; + this._isLoaded = false; + this._objectAttributes = { + textHorizontalAlignment: 1, + textVerticalAlignment: 2, + horizontalAlignment: 3, + verticalAlignment: 4, + stretch: 5 + }; + if (parentClass) { + this._parentClass = parentClass; + } + } + _getChainElement(attributeValue) { + let element = window; + if (this._parentClass) { + element = this._parentClass; + } + let value = attributeValue; + value = value.split("."); + for (let i = 0;i < value.length; i++) { + element = element[value[i]]; + } + return element; + } + _getClassAttribute(attributeName) { + const attribute = attributeName.split("."); + const className2 = GetClass("BABYLON.GUI." + attribute[0]); + return className2[attribute[1]]; + } + _createGuiElement(node30, parent, linkParent = true) { + try { + const className2 = GetClass("BABYLON.GUI." + node30.nodeName); + const guiNode = new className2; + if (parent && linkParent) { + parent.addControl(guiNode); + } + for (let i = 0;i < node30.attributes.length; i++) { + if (node30.attributes[i].name.toLowerCase().includes("datasource")) { + continue; + } + if (node30.attributes[i].name.toLowerCase().includes("observable")) { + const element = this._getChainElement(node30.attributes[i].value); + guiNode[node30.attributes[i].name].add(element); + continue; + } else if (node30.attributes[i].name == "linkWithMesh") { + if (this._parentClass) { + guiNode.linkWithMesh(this._parentClass[node30.attributes[i].value]); + } else { + guiNode.linkWithMesh(window[node30.attributes[i].value]); + } + } else if (node30.attributes[i].value.startsWith("{{") && node30.attributes[i].value.endsWith("}}")) { + const element = this._getChainElement(node30.attributes[i].value.substring(2, node30.attributes[i].value.length - 2)); + guiNode[node30.attributes[i].name] = element; + } else if (!this._objectAttributes[node30.attributes[i].name]) { + if (node30.attributes[i].value == "true" || node30.attributes[i].value == "false") { + guiNode[node30.attributes[i].name] = node30.attributes[i].value == "true"; + } else { + guiNode[node30.attributes[i].name] = !isNaN(Number(node30.attributes[i].value)) ? Number(node30.attributes[i].value) : node30.attributes[i].value; + } + } else { + guiNode[node30.attributes[i].name] = this._getClassAttribute(node30.attributes[i].value); + } + } + if (!node30.attributes.getNamedItem("id")) { + this._nodes[node30.nodeName + Object.keys(this._nodes).length + "_gen"] = guiNode; + return guiNode; + } + let id = node30.attributes.getNamedItem("id").value; + if (id.startsWith("{{") && id.endsWith("}}")) { + id = this._getChainElement(id.substring(2, id.length - 2)); + } + if (!this._nodes[id]) { + this._nodes[id] = guiNode; + } else { + throw "XmlLoader Exception : Duplicate ID, every element should have an unique ID attribute"; + } + return guiNode; + } catch (exception) { + throw "XmlLoader Exception : Error parsing Control " + node30.nodeName + "," + exception + "."; + } + } + _parseGrid(node30, guiNode, parent) { + let width; + let height; + let columns; + const rows = node30.children; + let cells; + let isPixel = false; + let cellNode; + let rowNumber = -1; + let columnNumber = -1; + let totalColumnsNumber = 0; + for (let i = 0;i < rows.length; i++) { + if (rows[i].nodeType != this._nodeTypes.element) { + continue; + } + if (rows[i].nodeName != "Row") { + throw "XmlLoader Exception : Expecting Row node, received " + rows[i].nodeName; + } + rowNumber += 1; + columns = rows[i].children; + if (!rows[i].attributes.getNamedItem("height")) { + throw "XmlLoader Exception : Height must be defined for grid rows"; + } + height = Number(rows[i].attributes.getNamedItem("height").nodeValue); + isPixel = rows[i].attributes.getNamedItem("isPixel") ? JSON.parse(rows[i].attributes.getNamedItem("isPixel").nodeValue) : false; + guiNode.addRowDefinition(height, isPixel); + for (let j = 0;j < columns.length; j++) { + if (columns[j].nodeType != this._nodeTypes.element) { + continue; + } + if (columns[j].nodeName != "Column") { + throw "XmlLoader Exception : Expecting Column node, received " + columns[j].nodeName; + } + columnNumber += 1; + if (rowNumber > 0 && columnNumber > totalColumnsNumber) { + throw "XmlLoader Exception : In the Grid element, the number of columns is defined in the first row, do not add more columns in the subsequent rows."; + } + if (rowNumber == 0) { + if (!columns[j].attributes.getNamedItem("width")) { + throw "XmlLoader Exception : Width must be defined for all the grid columns in the first row"; + } + width = Number(columns[j].attributes.getNamedItem("width").nodeValue); + isPixel = columns[j].attributes.getNamedItem("isPixel") ? JSON.parse(columns[j].attributes.getNamedItem("isPixel").nodeValue) : false; + guiNode.addColumnDefinition(width, isPixel); + } + cells = columns[j].children; + for (let k = 0;k < cells.length; k++) { + if (cells[k].nodeType != this._nodeTypes.element) { + continue; + } + cellNode = this._createGuiElement(cells[k], guiNode, false); + guiNode.addControl(cellNode, rowNumber, columnNumber); + if (cells[k].firstChild) { + this._parseXml(cells[k].firstChild, cellNode); + } + } + } + if (rowNumber == 0) { + totalColumnsNumber = columnNumber; + } + columnNumber = -1; + } + if (node30.nextSibling) { + this._parseXml(node30.nextSibling, parent); + } + } + _parseElement(node30, guiNode, parent) { + if (node30.firstChild) { + this._parseXml(node30.firstChild, guiNode); + } + if (node30.nextSibling) { + this._parseXml(node30.nextSibling, parent); + } + } + _prepareSourceElement(node30, guiNode, variable, source, iterator) { + if (this._parentClass) { + this._parentClass[variable] = source[iterator]; + } else { + window[variable] = source[iterator]; + } + if (node30.firstChild) { + this._parseXml(node30.firstChild, guiNode, true); + } + } + _parseElementsFromSource(node30, guiNode, parent) { + const dataSource = node30.attributes.getNamedItem("dataSource").value; + if (!dataSource.includes(" in ")) { + throw "XmlLoader Exception : Malformed XML, Data Source must include an in"; + } else { + let isArray = true; + const splittedSource = dataSource.split(" in "); + if (splittedSource.length < 2) { + throw "XmlLoader Exception : Malformed XML, Data Source must have an iterator and a source"; + } + let source = splittedSource[1]; + if (source.startsWith("{") && source.endsWith("}")) { + isArray = false; + } + if (!isArray || source.startsWith("[") && source.endsWith("]")) { + source = source.substring(1, source.length - 1); + } + if (this._parentClass) { + source = this._parentClass[source]; + } else { + source = window[source]; + } + if (isArray) { + for (let i = 0;i < source.length; i++) { + this._prepareSourceElement(node30, guiNode, splittedSource[0], source, i); + } + } else { + for (const i in source) { + this._prepareSourceElement(node30, guiNode, splittedSource[0], source, i); + } + } + if (node30.nextSibling) { + this._parseXml(node30.nextSibling, parent); + } + } + } + _parseXml(node30, parent, generated = false) { + if (node30.nodeType != this._nodeTypes.element) { + if (node30.nextSibling) { + this._parseXml(node30.nextSibling, parent, generated); + } + return; + } + if (generated) { + node30.setAttribute("id", parent.id + (parent._children.length + 1)); + } + const guiNode = this._createGuiElement(node30, parent); + if (!this._rootNode) { + this._rootNode = guiNode; + } + if (node30.nodeName == "Grid") { + this._parseGrid(node30, guiNode, parent); + } else if (!node30.attributes.getNamedItem("dataSource")) { + this._parseElement(node30, guiNode, parent); + } else { + this._parseElementsFromSource(node30, guiNode, parent); + } + } + isLoaded() { + return this._isLoaded; + } + getNodeById(id) { + return this._nodes[id]; + } + getNodes() { + return this._nodes; + } + dispose() { + if (this._rootNode) { + this._rootNode.dispose(); + this._rootNode = null; + this._nodes = {}; + } + } + loadLayout(xmlFile, rootNode, onSuccess = null, onError = null) { + const xhttp = new XMLHttpRequest; + xhttp.onload = () => { + if (xhttp.readyState === 4 && xhttp.status === 200) { + if (!xhttp.responseXML) { + if (onError) { + onError(XmlLoaderError2); + return; + } else { + throw XmlLoaderError2; + } + } + const xmlDoc = xhttp.responseXML.documentElement; + this._parseXml(xmlDoc.firstChild, rootNode); + this._isLoaded = true; + if (onSuccess) { + onSuccess(); + } + } + }; + xhttp.onerror = function() { + if (onError) { + onError("an error occurred during loading the layout"); + } + }; + xhttp.open("GET", xmlFile, true); + xhttp.send(); + } + async loadLayoutAsync(xmlFile, rootNode) { + return new Promise((resolve, reject) => { + this.loadLayout(xmlFile, rootNode, resolve, reject); + }); + } +} +var XmlLoaderError2; +var init_xmlLoader2 = __esm(() => { + init_typeStore(); + XmlLoaderError2 = "XmlLoader Exception : XML file is malformed or corrupted."; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/2D/index.js +var init_2D2 = __esm(() => { + init_controls3(); + init_advancedDynamicTexture2(); + init_adtInstrumentation2(); + init_math2D2(); + init_measure2(); + init_multiLinePoint2(); + init_style2(); + init_valueAndUnit2(); + init_xmlLoader2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/vector3WithInfo.js +class Vector3WithInfo3 extends Vector3 { + constructor(source, buttonIndex = 0) { + super(source.x, source.y, source.z); + this.buttonIndex = buttonIndex; + } +} +var init_vector3WithInfo2 = __esm(() => { + init_math_vector(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/control3D.js +class Control3D3 { + get position() { + if (!this._node) { + return Vector3.Zero(); + } + return this._node.position; + } + set position(value) { + if (!this._node) { + return; + } + this._node.position = value; + } + get scaling() { + if (!this._node) { + return new Vector3(1, 1, 1); + } + return this._node.scaling; + } + set scaling(value) { + if (!this._node) { + return; + } + this._isScaledByManager = false; + this._node.scaling = value; + } + get behaviors() { + return this._behaviors; + } + addBehavior(behavior2) { + const index = this._behaviors.indexOf(behavior2); + if (index !== -1) { + return this; + } + behavior2.init(); + const scene50 = this._host.scene; + if (scene50.isLoading) { + scene50.onDataLoadedObservable.addOnce(() => { + behavior2.attach(this); + }); + } else { + behavior2.attach(this); + } + this._behaviors.push(behavior2); + return this; + } + removeBehavior(behavior2) { + const index = this._behaviors.indexOf(behavior2); + if (index === -1) { + return this; + } + this._behaviors[index].detach(); + this._behaviors.splice(index, 1); + return this; + } + getBehaviorByName(name336) { + for (const behavior2 of this._behaviors) { + if (behavior2.name === name336) { + return behavior2; + } + } + return null; + } + get isVisible() { + return this._isVisible; + } + set isVisible(value) { + if (this._isVisible === value) { + return; + } + this._isVisible = value; + const mesh84 = this.mesh; + if (mesh84) { + mesh84.setEnabled(value); + } + } + constructor(name336) { + this.name = name336; + this._downCount = 0; + this._enterCount = -1; + this._downPointerIds = {}; + this._isVisible = true; + this._isScaledByManager = false; + this.onPointerMoveObservable = new Observable; + this.onPointerOutObservable = new Observable; + this.onPointerDownObservable = new Observable; + this.onPointerUpObservable = new Observable; + this.onPointerClickObservable = new Observable; + this.onPointerEnterObservable = new Observable; + this._behaviors = new Array; + } + get typeName() { + return this._getTypeName(); + } + getClassName() { + return this._getTypeName(); + } + _getTypeName() { + return "Control3D"; + } + get node() { + return this._node; + } + get mesh() { + if (this._node instanceof AbstractMesh) { + return this._node; + } + return null; + } + linkToTransformNode(node30) { + if (this._node) { + this._node.parent = node30; + } + return this; + } + _prepareNode(scene50) { + if (!this._node) { + this._node = this._createNode(scene50); + if (!this.node) { + return; + } + this._injectGUI3DReservedDataStore(this.node).control = this; + const mesh84 = this.mesh; + if (mesh84) { + mesh84.isPickable = true; + this._affectMaterial(mesh84); + } + } + } + _injectGUI3DReservedDataStore(node30) { + var _a, _b; + node30.reservedDataStore = (_a = node30.reservedDataStore) !== null && _a !== undefined ? _a : {}; + node30.reservedDataStore.GUI3D = (_b = node30.reservedDataStore.GUI3D) !== null && _b !== undefined ? _b : {}; + return node30.reservedDataStore.GUI3D; + } + _createNode(scene50) { + return null; + } + _affectMaterial(mesh84) { + mesh84.material = null; + } + _isTouchButton3D(control71) { + return control71._generatePointerEventType !== undefined; + } + _onPointerMove(target, coordinates) { + this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this); + } + _onPointerEnter(target) { + if (this._enterCount === -1) { + this._enterCount = 0; + } + this._enterCount++; + if (this._enterCount > 1) { + return false; + } + this.onPointerEnterObservable.notifyObservers(this, -1, target, this); + if (this.pointerEnterAnimation) { + this.pointerEnterAnimation(); + } + return true; + } + _onPointerOut(target) { + this._enterCount--; + if (this._enterCount > 0) { + return; + } + this._enterCount = 0; + this.onPointerOutObservable.notifyObservers(this, -1, target, this); + if (this.pointerOutAnimation) { + this.pointerOutAnimation(); + } + } + _onPointerDown(target, coordinates, pointerId, buttonIndex) { + this._downCount++; + this._downPointerIds[pointerId] = this._downPointerIds[pointerId] + 1 || 1; + if (this._downCount !== 1) { + return false; + } + this.onPointerDownObservable.notifyObservers(new Vector3WithInfo3(coordinates, buttonIndex), -1, target, this); + if (this.pointerDownAnimation) { + this.pointerDownAnimation(); + } + return true; + } + _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick) { + this._downCount--; + this._downPointerIds[pointerId]--; + if (this._downPointerIds[pointerId] <= 0) { + delete this._downPointerIds[pointerId]; + } + if (this._downCount < 0) { + this._downCount = 0; + return; + } + if (this._downCount == 0) { + if (notifyClick && (this._enterCount > 0 || this._enterCount === -1)) { + this.onPointerClickObservable.notifyObservers(new Vector3WithInfo3(coordinates, buttonIndex), -1, target, this); + } + this.onPointerUpObservable.notifyObservers(new Vector3WithInfo3(coordinates, buttonIndex), -1, target, this); + if (this.pointerUpAnimation) { + this.pointerUpAnimation(); + } + } + } + forcePointerUp(pointerId = null) { + if (pointerId !== null) { + this._onPointerUp(this, Vector3.Zero(), pointerId, 0, true); + } else { + for (const key in this._downPointerIds) { + this._onPointerUp(this, Vector3.Zero(), +key, 0, true); + } + if (this._downCount > 0) { + this._downCount = 1; + this._onPointerUp(this, Vector3.Zero(), 0, 0, true); + } + } + } + _processObservables(type, pickedPoint, originMeshPosition, pointerId, buttonIndex) { + if (this._isTouchButton3D(this) && originMeshPosition) { + type = this._generatePointerEventType(type, originMeshPosition, this._downCount); + } + if (type === PointerEventTypes.POINTERMOVE) { + this._onPointerMove(this, pickedPoint); + const previousControlOver = this._host._lastControlOver[pointerId]; + if (previousControlOver && previousControlOver !== this) { + previousControlOver._onPointerOut(this); + } + if (previousControlOver !== this) { + this._onPointerEnter(this); + } + this._host._lastControlOver[pointerId] = this; + return true; + } + if (type === PointerEventTypes.POINTERDOWN) { + this._onPointerDown(this, pickedPoint, pointerId, buttonIndex); + this._host._lastControlDown[pointerId] = this; + this._host._lastPickedControl = this; + return true; + } + if (type === PointerEventTypes.POINTERUP || type === PointerEventTypes.POINTERDOUBLETAP) { + if (this._host._lastControlDown[pointerId]) { + this._host._lastControlDown[pointerId]._onPointerUp(this, pickedPoint, pointerId, buttonIndex, true); + } + delete this._host._lastControlDown[pointerId]; + return true; + } + return false; + } + _disposeNode() { + if (this._node) { + this._node.dispose(); + this._node = null; + } + } + dispose() { + this.onPointerDownObservable.clear(); + this.onPointerEnterObservable.clear(); + this.onPointerMoveObservable.clear(); + this.onPointerOutObservable.clear(); + this.onPointerUpObservable.clear(); + this.onPointerClickObservable.clear(); + this._disposeNode(); + for (const behavior2 of this._behaviors) { + behavior2.detach(); + } + } +} +var init_control3D2 = __esm(() => { + init_observable(); + init_math_vector(); + init_pointerEvents(); + init_abstractMesh(); + init_vector3WithInfo2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/contentDisplay3D.js +class ContentDisplay3D3 extends Control3D3 { + constructor() { + super(...arguments); + this._contentResolution = 512; + this._contentScaleRatio = 2; + } + get content() { + return this._content; + } + set content(value) { + this._content = value; + if (!value || !this._host || !this._host.utilityLayer) { + return; + } + if (!this._facadeTexture) { + this._facadeTexture = new AdvancedDynamicTexture3("Facade", this._contentResolution, this._contentResolution, this._host.utilityLayer.utilityLayerScene, true, Texture.TRILINEAR_SAMPLINGMODE); + this._setFacadeTextureScaling(); + this._facadeTexture.premulAlpha = true; + } else { + this._facadeTexture.rootContainer.clearControls(); + } + this._facadeTexture.addControl(value); + this._applyFacade(this._facadeTexture); + } + _setFacadeTextureScaling() { + var _a; + if (this._facadeTexture) { + this._facadeTexture.rootContainer.scaleX = this._contentScaleRatio; + this._facadeTexture.rootContainer.scaleY = (_a = this._contentScaleRatioY) !== null && _a !== undefined ? _a : this._contentScaleRatio; + } + } + get contentResolution() { + return this._contentResolution; + } + set contentResolution(value) { + if (this._contentResolution === value) { + return; + } + this._contentResolution = value; + this._resetContent(); + } + _disposeFacadeTexture() { + if (this._facadeTexture) { + this._facadeTexture.dispose(); + this._facadeTexture = null; + } + } + _resetContent() { + this._disposeFacadeTexture(); + this.content = this._content; + } + _applyFacade(facadeTexture) { + } +} +var init_contentDisplay3D2 = __esm(() => { + init_advancedDynamicTexture2(); + init_control3D2(); + init_texture(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/abstractButton3D.js +class AbstractButton3D3 extends ContentDisplay3D3 { + constructor(name336) { + super(name336); + } + _getTypeName() { + return "AbstractButton3D"; + } + _createNode(scene50) { + return new TransformNode("button" + this.name, scene50); + } +} +var init_abstractButton3D2 = __esm(() => { + init_transformNode(); + init_contentDisplay3D2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/button3D.js +class Button3D3 extends AbstractButton3D3 { + constructor(name336, options) { + super(name336); + this._options = { + width: 1, + height: 1, + depth: 0.08, + ...options + }; + this.pointerEnterAnimation = () => { + if (!this.mesh) { + return; + } + this._currentMaterial.emissiveColor = Color3.Red(); + }; + this.pointerOutAnimation = () => { + this._currentMaterial.emissiveColor = Color3.Black(); + }; + this.pointerDownAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(0.95); + }; + this.pointerUpAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(1 / 0.95); + }; + } + _applyFacade(facadeTexture) { + this._currentMaterial.emissiveTexture = facadeTexture; + } + _getTypeName() { + return "Button3D"; + } + _createNode(scene50) { + const faceUV = new Array(6); + for (let i = 0;i < 6; i++) { + faceUV[i] = new Vector4(0, 0, 0, 0); + } + if (scene50.useRightHandedSystem) { + faceUV[0].copyFromFloats(1, 0, 0, 1); + } else { + faceUV[1].copyFromFloats(0, 0, 1, 1); + } + const mesh84 = CreateBox(this.name + "_rootMesh", { + width: this._options.width, + height: this._options.height, + depth: this._options.depth, + faceUV, + wrap: true + }, scene50); + this._contentScaleRatioY = this._contentScaleRatio * this._options.width / this._options.height; + this._setFacadeTextureScaling(); + return mesh84; + } + _affectMaterial(mesh84) { + const material30 = new StandardMaterial(this.name + "Material", mesh84.getScene()); + material30.specularColor = Color3.Black(); + mesh84.material = material30; + this._currentMaterial = material30; + this._resetContent(); + } + dispose() { + super.dispose(); + this._disposeFacadeTexture(); + if (this._currentMaterial) { + this._currentMaterial.dispose(); + } + } +} +var init_button3D2 = __esm(() => { + init_math_vector(); + init_boxBuilder(); + init_standardMaterial(); + init_abstractButton3D2(); + init_math_color(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/container3D.js +class Container3D3 extends Control3D3 { + get children() { + return this._children; + } + get blockLayout() { + return this._blockLayout; + } + set blockLayout(value) { + if (this._blockLayout === value) { + return; + } + this._blockLayout = value; + if (!this._blockLayout) { + this._arrangeChildren(); + } + } + constructor(name336) { + super(name336); + this._blockLayout = false; + this._children = new Array; + } + updateLayout() { + this._arrangeChildren(); + return this; + } + containsControl(control71) { + return this._children.indexOf(control71) !== -1; + } + addControl(control71) { + const index = this._children.indexOf(control71); + if (index !== -1) { + return this; + } + control71.parent = this; + control71._host = this._host; + this._children.push(control71); + if (this._host.utilityLayer) { + control71._prepareNode(this._host.utilityLayer.utilityLayerScene); + if (control71.node) { + control71.node.parent = this.node; + } + if (!this.blockLayout) { + this._arrangeChildren(); + } + } + return this; + } + _arrangeChildren() { + } + _createNode(scene50) { + return new TransformNode("ContainerNode", scene50); + } + removeControl(control71) { + const index = this._children.indexOf(control71); + if (index !== -1) { + this._children.splice(index, 1); + control71.parent = null; + control71._disposeNode(); + } + return this; + } + _getTypeName() { + return "Container3D"; + } + dispose() { + for (const control71 of this._children) { + control71.dispose(); + } + this._children.length = 0; + super.dispose(); + } +} +var init_container3D2 = __esm(() => { + init_transformNode(); + init_control3D2(); + Container3D3.UNSET_ORIENTATION = 0; + Container3D3.FACEORIGIN_ORIENTATION = 1; + Container3D3.FACEORIGINREVERSED_ORIENTATION = 2; + Container3D3.FACEFORWARD_ORIENTATION = 3; + Container3D3.FACEFORWARDREVERSED_ORIENTATION = 4; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/volumeBasedPanel.js +class VolumeBasedPanel3 extends Container3D3 { + get orientation() { + return this._orientation; + } + set orientation(value) { + if (this._orientation === value) { + return; + } + this._orientation = value; + Tools.SetImmediate(() => { + this._arrangeChildren(); + }); + } + get columns() { + return this._columns; + } + set columns(value) { + if (this._columns === value) { + return; + } + this._columns = value; + this._rowThenColum = true; + Tools.SetImmediate(() => { + this._arrangeChildren(); + }); + } + get rows() { + return this._rows; + } + set rows(value) { + if (this._rows === value) { + return; + } + this._rows = value; + this._rowThenColum = false; + Tools.SetImmediate(() => { + this._arrangeChildren(); + }); + } + constructor(name336) { + super(name336); + this._columns = 10; + this._rows = 0; + this._rowThenColum = true; + this._orientation = Container3D3.FACEORIGIN_ORIENTATION; + this.margin = 0; + } + _arrangeChildren() { + this._cellWidth = 0; + this._cellHeight = 0; + let rows = 0; + let columns = 0; + let controlCount = 0; + const currentInverseWorld = Matrix.Invert(this.node.computeWorldMatrix(true)); + for (const child of this._children) { + if (!child.mesh) { + continue; + } + controlCount++; + child.mesh.computeWorldMatrix(true); + const boundingBox5 = child.mesh.getHierarchyBoundingVectors(); + const extendSize = TmpVectors.Vector3[0]; + const diff = TmpVectors.Vector3[1]; + boundingBox5.max.subtractToRef(boundingBox5.min, diff); + diff.scaleInPlace(0.5); + Vector3.TransformNormalToRef(diff, currentInverseWorld, extendSize); + this._cellWidth = Math.max(this._cellWidth, extendSize.x * 2); + this._cellHeight = Math.max(this._cellHeight, extendSize.y * 2); + } + this._cellWidth += this.margin * 2; + this._cellHeight += this.margin * 2; + if (this._rowThenColum) { + columns = this._columns; + rows = Math.ceil(controlCount / this._columns); + } else { + rows = this._rows; + columns = Math.ceil(controlCount / this._rows); + } + const startOffsetX = columns * 0.5 * this._cellWidth; + const startOffsetY = rows * 0.5 * this._cellHeight; + const nodeGrid = []; + let cellCounter = 0; + if (this._rowThenColum) { + for (let r = 0;r < rows; r++) { + for (let c = 0;c < columns; c++) { + nodeGrid.push(new Vector3(c * this._cellWidth - startOffsetX + this._cellWidth / 2, r * this._cellHeight - startOffsetY + this._cellHeight / 2, 0)); + cellCounter++; + if (cellCounter > controlCount) { + break; + } + } + } + } else { + for (let c = 0;c < columns; c++) { + for (let r = 0;r < rows; r++) { + nodeGrid.push(new Vector3(c * this._cellWidth - startOffsetX + this._cellWidth / 2, r * this._cellHeight - startOffsetY + this._cellHeight / 2, 0)); + cellCounter++; + if (cellCounter > controlCount) { + break; + } + } + } + } + cellCounter = 0; + for (const child of this._children) { + if (!child.mesh) { + continue; + } + this._mapGridNode(child, nodeGrid[cellCounter]); + cellCounter++; + } + this._finalProcessing(); + } + _finalProcessing() { + } +} +var init_volumeBasedPanel2 = __esm(() => { + init_tools(); + init_math_vector(); + init_container3D2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/cylinderPanel.js +class CylinderPanel2 extends VolumeBasedPanel3 { + constructor() { + super(...arguments); + this._radius = 5; + } + get radius() { + return this._radius; + } + set radius(value) { + if (this._radius === value) { + return; + } + this._radius = value; + Tools.SetImmediate(() => { + this._arrangeChildren(); + }); + } + _mapGridNode(control71, nodePosition) { + const mesh84 = control71.mesh; + if (!mesh84) { + return; + } + const newPos = this._cylindricalMapping(nodePosition); + control71.position = newPos; + switch (this.orientation) { + case Container3D3.FACEORIGIN_ORIENTATION: + mesh84.lookAt(new Vector3(2 * newPos.x, newPos.y, 2 * newPos.z)); + break; + case Container3D3.FACEORIGINREVERSED_ORIENTATION: + mesh84.lookAt(new Vector3(-newPos.x, newPos.y, -newPos.z)); + break; + case Container3D3.FACEFORWARD_ORIENTATION: + break; + case Container3D3.FACEFORWARDREVERSED_ORIENTATION: + mesh84.rotate(Axis.Y, Math.PI, Space.LOCAL); + break; + } + } + _cylindricalMapping(source) { + const newPos = new Vector3(0, source.y, this._radius); + const yAngle = source.x / this._radius; + Matrix.RotationYawPitchRollToRef(yAngle, 0, 0, TmpVectors.Matrix[0]); + return Vector3.TransformNormal(newPos, TmpVectors.Matrix[0]); + } +} +var init_cylinderPanel2 = __esm(() => { + init_tools(); + init_math_vector(); + init_volumeBasedPanel2(); + init_container3D2(); + init_math_axis(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/fluent/shaders/fluent.vertex.js +var name336, shader333; +var init_fluent_vertex2 = __esm(() => { + init_shaderStore(); + name336 = "fluentVertexShader"; + shader333 = `precision highp float;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;uniform mat4 world;uniform mat4 viewProjection;varying vec2 vUV; +#ifdef BORDER +varying vec2 scaleInfo;uniform float borderWidth;uniform vec3 scaleFactor; +#endif +#ifdef HOVERLIGHT +varying vec3 worldPosition; +#endif +void main(void) {vUV=uv; +#ifdef BORDER +vec3 scale=scaleFactor;float minScale=min(min(scale.x,scale.y),scale.z);float maxScale=max(max(scale.x,scale.y),scale.z);float minOverMiddleScale=minScale/(scale.x+scale.y+scale.z-minScale-maxScale);float areaYZ=scale.y*scale.z;float areaXZ=scale.x*scale.z;float areaXY=scale.x*scale.y;float scaledBorderWidth=borderWidth; +if (abs(normal.x)==1.0) +{scale.x=scale.y;scale.y=scale.z;if (areaYZ>areaXZ && areaYZ>areaXY) +{scaledBorderWidth*=minOverMiddleScale;}} +else if (abs(normal.y)==1.0) +{scale.x=scale.z;if (areaXZ>areaXY && areaXZ>areaYZ) +{scaledBorderWidth*=minOverMiddleScale;}} +else +{if (areaXY>areaYZ && areaXY>areaXZ) +{scaledBorderWidth*=minOverMiddleScale;}} +float scaleRatio=min(scale.x,scale.y)/max(scale.x,scale.y);if (scale.x>scale.y) +{scaleInfo.x=1.0-(scaledBorderWidth*scaleRatio);scaleInfo.y=1.0-scaledBorderWidth;} +else +{scaleInfo.x=1.0-scaledBorderWidth;scaleInfo.y=1.0-(scaledBorderWidth*scaleRatio);} +#endif +vec4 worldPos=world*vec4(position,1.0); +#ifdef HOVERLIGHT +worldPosition=worldPos.xyz; +#endif +gl_Position=viewProjection*worldPos;} +`; + ShaderStore.ShadersStore[name336] = shader333; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/fluent/shaders/fluent.fragment.js +var name337, shader334; +var init_fluent_fragment2 = __esm(() => { + init_shaderStore(); + name337 = "fluentPixelShader"; + shader334 = `precision highp float;varying vec2 vUV;uniform vec4 albedoColor; +#ifdef INNERGLOW +uniform vec4 innerGlowColor; +#endif +#ifdef BORDER +varying vec2 scaleInfo;uniform float edgeSmoothingValue;uniform float borderMinValue; +#endif +#ifdef HOVERLIGHT +varying vec3 worldPosition;uniform vec3 hoverPosition;uniform vec4 hoverColor;uniform float hoverRadius; +#endif +#ifdef TEXTURE +uniform sampler2D albedoSampler;uniform mat4 textureMatrix;vec2 finalUV; +#endif +void main(void) {vec3 albedo=albedoColor.rgb;float alpha=albedoColor.a; +#ifdef TEXTURE +finalUV=vec2(textureMatrix*vec4(vUV,1.0,0.0));albedo=texture2D(albedoSampler,finalUV).rgb; +#endif +#ifdef HOVERLIGHT +float pointToHover=(1.0-clamp(length(hoverPosition-worldPosition)/hoverRadius,0.,1.))*hoverColor.a;albedo=clamp(albedo+hoverColor.rgb*pointToHover,0.,1.); +#else +float pointToHover=1.0; +#endif +#ifdef BORDER +float borderPower=10.0;float inverseBorderPower=1.0/borderPower;vec3 borderColor=albedo*borderPower;vec2 distanceToEdge;distanceToEdge.x=abs(vUV.x-0.5)*2.0;distanceToEdge.y=abs(vUV.y-0.5)*2.0;float borderValue=max(smoothstep(scaleInfo.x-edgeSmoothingValue,scaleInfo.x+edgeSmoothingValue,distanceToEdge.x), +smoothstep(scaleInfo.y-edgeSmoothingValue,scaleInfo.y+edgeSmoothingValue,distanceToEdge.y));borderColor=borderColor*borderValue*max(borderMinValue*inverseBorderPower,pointToHover); +albedo+=borderColor;alpha=max(alpha,borderValue); +#endif +#ifdef INNERGLOW +vec2 uvGlow=(vUV-vec2(0.5,0.5))*(innerGlowColor.a*2.0);uvGlow=uvGlow*uvGlow;uvGlow=uvGlow*uvGlow;albedo+=mix(vec3(0.0,0.0,0.0),innerGlowColor.rgb,uvGlow.x+uvGlow.y); +#endif +gl_FragColor=vec4(albedo,alpha);}`; + ShaderStore.ShadersStore[name337] = shader334; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/fluent/fluentMaterial.js +class FluentMaterialDefines3 extends MaterialDefines { + constructor() { + super(); + this.INNERGLOW = false; + this.BORDER = false; + this.HOVERLIGHT = false; + this.TEXTURE = false; + this.rebuild(); + } +} + +class FluentMaterial3 extends PushMaterial { + constructor(name338, scene50) { + super(name338, scene50); + this.innerGlowColorIntensity = 0.5; + this.innerGlowColor = new Color3(1, 1, 1); + this.albedoColor = new Color3(0.3, 0.35, 0.4); + this.renderBorders = false; + this.borderWidth = 0.5; + this.edgeSmoothingValue = 0.02; + this.borderMinValue = 0.1; + this.renderHoverLight = false; + this.hoverRadius = 0.01; + this.hoverColor = new Color4(0.3, 0.3, 0.3, 1); + this.hoverPosition = Vector3.Zero(); + } + needAlphaBlending() { + return this.alpha !== 1; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh84, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new FluentMaterialDefines3; + } + const scene50 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!this.checkReadyOnEveryCall && subMesh11.effect) { + if (defines._renderId === scene50.getRenderId()) { + return true; + } + } + if (defines._areTexturesDirty) { + defines.INNERGLOW = this.innerGlowColorIntensity > 0; + defines.BORDER = this.renderBorders; + defines.HOVERLIGHT = this.renderHoverLight; + if (this._albedoTexture) { + if (!this._albedoTexture.isReadyOrNotBlocking()) { + return false; + } else { + defines.TEXTURE = true; + } + } else { + defines.TEXTURE = false; + } + } + const engine47 = scene50.getEngine(); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const attribs = [VertexBuffer.PositionKind]; + attribs.push(VertexBuffer.NormalKind); + attribs.push(VertexBuffer.UVKind); + const shaderName = "fluent"; + const uniforms2 = [ + "world", + "viewProjection", + "innerGlowColor", + "albedoColor", + "borderWidth", + "edgeSmoothingValue", + "scaleFactor", + "borderMinValue", + "hoverColor", + "hoverPosition", + "hoverRadius", + "textureMatrix" + ]; + const samplers = ["albedoSampler"]; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + const join = defines.toString(); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks: null, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh84, subMesh11) { + const scene50 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene50.getTransformMatrix()); + if (this._mustRebind(scene50, effect20)) { + this._activeEffect.setColor4("albedoColor", this.albedoColor, this.alpha); + if (defines.INNERGLOW) { + this._activeEffect.setColor4("innerGlowColor", this.innerGlowColor, this.innerGlowColorIntensity); + } + if (defines.BORDER) { + this._activeEffect.setFloat("borderWidth", this.borderWidth); + this._activeEffect.setFloat("edgeSmoothingValue", this.edgeSmoothingValue); + this._activeEffect.setFloat("borderMinValue", this.borderMinValue); + mesh84.getBoundingInfo().boundingBox.extendSize.multiplyToRef(mesh84.scaling, TmpVectors.Vector3[0]); + this._activeEffect.setVector3("scaleFactor", TmpVectors.Vector3[0]); + } + if (defines.HOVERLIGHT) { + this._activeEffect.setDirectColor4("hoverColor", this.hoverColor); + this._activeEffect.setFloat("hoverRadius", this.hoverRadius); + this._activeEffect.setVector3("hoverPosition", this.hoverPosition); + } + if (defines.TEXTURE && this._albedoTexture) { + this._activeEffect.setTexture("albedoSampler", this._albedoTexture); + const matrix = this._albedoTexture.getTextureMatrix(); + this._activeEffect.setMatrix("textureMatrix", matrix); + } + } + this._afterBind(mesh84, this._activeEffect); + } + getActiveTextures() { + const activeTextures = super.getActiveTextures(); + return activeTextures; + } + hasTexture(texture102) { + if (super.hasTexture(texture102)) { + return true; + } + return false; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + } + clone(name338) { + return SerializationHelper.Clone(() => new FluentMaterial3(name338, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.GUI.FluentMaterial"; + return serializationObject; + } + getClassName() { + return "FluentMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new FluentMaterial3(source.name, scene50), source, scene50, rootUrl); + } +} +var init_fluentMaterial2 = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_buffer(); + init_typeStore(); + init_math_color(); + init_fluent_vertex2(); + init_fluent_fragment2(); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], FluentMaterial3.prototype, "innerGlowColorIntensity", undefined); + __decorate2([ + serializeAsColor3() + ], FluentMaterial3.prototype, "innerGlowColor", undefined); + __decorate2([ + serializeAsColor3() + ], FluentMaterial3.prototype, "albedoColor", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], FluentMaterial3.prototype, "renderBorders", undefined); + __decorate2([ + serialize() + ], FluentMaterial3.prototype, "borderWidth", undefined); + __decorate2([ + serialize() + ], FluentMaterial3.prototype, "edgeSmoothingValue", undefined); + __decorate2([ + serialize() + ], FluentMaterial3.prototype, "borderMinValue", undefined); + __decorate2([ + serialize(), + expandToProperty("_markAllSubMeshesAsTexturesDirty") + ], FluentMaterial3.prototype, "renderHoverLight", undefined); + __decorate2([ + serialize() + ], FluentMaterial3.prototype, "hoverRadius", undefined); + __decorate2([ + serializeAsColor4() + ], FluentMaterial3.prototype, "hoverColor", undefined); + __decorate2([ + serializeAsVector3() + ], FluentMaterial3.prototype, "hoverPosition", undefined); + __decorate2([ + serializeAsTexture("albedoTexture") + ], FluentMaterial3.prototype, "_albedoTexture", undefined); + __decorate2([ + expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty") + ], FluentMaterial3.prototype, "albedoTexture", undefined); + RegisterClass("BABYLON.GUI.FluentMaterial", FluentMaterial3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/touchHolographicMenu.js +class TouchHolographicMenu3 extends VolumeBasedPanel3 { + get backPlateMargin() { + return this._backPlateMargin; + } + set backPlateMargin(value) { + this._backPlateMargin = value; + if (this._children.length >= 1) { + this.children.forEach((control71) => { + this._updateCurrentMinMax(control71.position); + }); + this._updateMargins(); + } + } + _createNode(scene50) { + const node30 = new Mesh(`menu_${this.name}`, scene50); + this._backPlate = CreateBox("backPlate" + this.name, { size: 1 }, scene50); + this._backPlate.parent = node30; + return node30; + } + _affectMaterial(mesh85) { + this._backPlateMaterial = new FluentMaterial3(this.name + "backPlateMaterial", mesh85.getScene()); + this._backPlateMaterial.albedoColor = new Color3(0.08, 0.15, 0.55); + this._backPlateMaterial.renderBorders = true; + this._backPlateMaterial.renderHoverLight = true; + this._pickedPointObserver = this._host.onPickedPointChangedObservable.add((pickedPoint) => { + if (pickedPoint) { + this._backPlateMaterial.hoverPosition = pickedPoint; + this._backPlateMaterial.hoverColor.a = 1; + } else { + this._backPlateMaterial.hoverColor.a = 0; + } + }); + this._backPlate.material = this._backPlateMaterial; + } + _mapGridNode(control71, nodePosition) { + const mesh85 = control71.mesh; + if (!mesh85) { + return; + } + control71.position = nodePosition.clone(); + this._updateCurrentMinMax(nodePosition); + } + _finalProcessing() { + this._updateMargins(); + } + _updateCurrentMinMax(nodePosition) { + if (!this._currentMin) { + this._currentMin = nodePosition.clone(); + this._currentMax = nodePosition.clone(); + } + this._currentMin.minimizeInPlace(nodePosition); + this._currentMax.maximizeInPlace(nodePosition); + } + _updateMargins() { + if (this._children.length > 0) { + this._currentMin.addInPlaceFromFloats(-this._cellWidth / 2, -this._cellHeight / 2, 0); + this._currentMax.addInPlaceFromFloats(this._cellWidth / 2, this._cellHeight / 2, 0); + const extendSize = this._currentMax.subtract(this._currentMin); + this._backPlate.scaling.x = extendSize.x + this._cellWidth * this.backPlateMargin; + this._backPlate.scaling.y = extendSize.y + this._cellHeight * this.backPlateMargin; + this._backPlate.scaling.z = 0.001; + for (let i = 0;i < this._children.length; i++) { + this._children[i].position.subtractInPlace(this._currentMin).subtractInPlace(extendSize.scale(0.5)); + this._children[i].position.z -= 0.01; + } + } + this._currentMin = null; + this._currentMax = null; + } + constructor(name338) { + super(name338); + this._backPlateMargin = 1.25; + } + addButton(button13) { + const wasLayoutBlocked = this.blockLayout; + if (!wasLayoutBlocked) { + this.blockLayout = true; + } + super.addControl(button13); + button13.isBackplateVisible = false; + button13.scaling.scaleInPlace(TouchHolographicMenu3.MENU_BUTTON_SCALE); + if (!wasLayoutBlocked) { + this.blockLayout = false; + } + return this; + } + addControl(_control) { + Logger.Warn("TouchHolographicMenu can only contain buttons. Please use the method `addButton` instead."); + return this; + } + dispose() { + super.dispose(); + this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver); + } +} +var init_touchHolographicMenu2 = __esm(() => { + init_volumeBasedPanel2(); + init_mesh(); + init_boxBuilder(); + init_fluentMaterial2(); + init_math_color(); + init_logger(); + TouchHolographicMenu3.MENU_BUTTON_SCALE = 1; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/handMenu.js +class HandMenu2 extends TouchHolographicMenu3 { + get handConstraintBehavior() { + return this._handConstraintBehavior; + } + _createNode(scene50) { + const node30 = super._createNode(scene50); + this._handConstraintBehavior.attach(node30); + return node30; + } + constructor(xr, name338) { + super(name338); + this._handConstraintBehavior = new HandConstraintBehavior; + this._handConstraintBehavior.linkToXRExperience(xr); + this.backPlateMargin = 0.15; + this.rows = 3; + } + dispose() { + super.dispose(); + this._handConstraintBehavior.detach(); + } +} +var init_handMenu2 = __esm(() => { + init_touchHolographicMenu2(); + init_handConstraintBehavior(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js +var name338, shader335; +var init_fluentBackplate_fragment2 = __esm(() => { + init_shaderStore(); + name338 = "fluentBackplatePixelShader"; + shader335 = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform float _Angle_;uniform float _Fade_Out_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform sampler2D _Iridescent_Map_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;void Round_Rect_Fragment_B31( +float Radius, +float Line_Width, +vec4 Line_Color, +float Filter_Width, +vec2 UV, +float Line_Visibility, +vec4 Rect_Parms, +vec4 Fill_Color, +out vec4 Color) +{float d=length(max(abs(UV)-Rect_Parms.xy,0.0));float dx=max(fwidth(d)*Filter_Width,0.00001);float g=min(Rect_Parms.z,Rect_Parms.w);float dgrad=max(fwidth(g)*Filter_Width,0.00001);float Inside_Rect=clamp(g/dgrad,0.0,1.0);float inner=clamp((d+dx*0.5-max(Radius-Line_Width,d-dx*0.5))/dx,0.0,1.0);Color=clamp(mix(Fill_Color,Line_Color,inner),0.0,1.0)*Inside_Rect;} +void Blob_Fragment_B71( +sampler2D Blob_Texture, +vec4 Blob_Info1, +vec4 Blob_Info2, +out vec4 Blob_Color) +{float k1=dot(Blob_Info1.xy,Blob_Info1.xy);float k2=dot(Blob_Info2.xy,Blob_Info2.xy);vec3 closer=k1 { + init_shaderStore(); + name339 = "fluentBackplateVertexShader"; + shader336 = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal; +#ifdef TANGENT +attribute vec3 tangent; +#else +const vec3 tangent=vec3(0.); +#endif +uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform float _Angle_;uniform float _Fade_Out_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform sampler2D _Iridescent_Map_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Object_To_World_Pos_B115( +vec3 Pos_Object, +out vec3 Pos_World) +{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;} +void PickDir_B140( +float Degrees, +vec3 DirX, +vec3 DirY, +out vec3 Dir) +{float a=Degrees*3.14159/180.0;Dir=cos(a)*DirX+sin(a)*DirY;} +void Round_Rect_Vertex_B139( +vec2 UV, +float Radius, +float Margin, +float Anisotropy, +float Gradient1, +float Gradient2, +out vec2 Rect_UV, +out vec4 Rect_Parms, +out vec2 Scale_XY, +out vec2 Line_UV) +{Scale_XY=vec2(Anisotropy,1.0);Line_UV=(UV-vec2(0.5,0.5));Rect_UV=Line_UV*Scale_XY;Rect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius)-vec2(Margin,Margin);Rect_Parms.z=Gradient1; +Rect_Parms.w=Gradient2;} +void Line_Vertex_B135( +vec2 Scale_XY, +vec2 UV, +float Time, +float Rate, +vec4 Highlight_Transform, +out vec3 Line_Vertex) +{float angle2=(Rate*Time)*2.0*3.1416;float sinAngle2=sin(angle2);float cosAngle2=cos(angle2);vec2 xformUV=UV*Highlight_Transform.xy+Highlight_Transform.zw;Line_Vertex.x=0.0;Line_Vertex.y=cosAngle2*xformUV.x-sinAngle2*xformUV.y;Line_Vertex.z=0.0; } +void Blob_Vertex_B180( +vec3 Position, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +vec3 Blob_Position, +float Intensity, +float Blob_Near_Size, +float Blob_Far_Size, +float Blob_Near_Distance, +float Blob_Far_Distance, +float Blob_Fade_Length, +float Blob_Pulse, +float Blob_Fade, +out vec4 Blob_Info) +{vec3 blob=Blob_Position;vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);} +void Move_Verts_B129( +float Anisotropy, +vec3 P, +float Radius, +out vec3 New_P, +out vec2 New_UV, +out float Radial_Gradient, +out vec3 Radial_Dir) +{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);New_UV=center+r2*(UV-2.0*center+0.5);New_P=vec3(New_UV-0.5,P.z);Radial_Gradient=1.0-length(delta)*2.0;Radial_Dir=vec3(delta*r2,0.0);} +void Object_To_World_Dir_B132( +vec3 Dir_Object, +out vec3 Binormal_World, +out vec3 Binormal_World_N, +out float Binormal_Length) +{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;} +void RelativeOrAbsoluteDetail_B147( +float Nominal_Radius, +float Nominal_LineWidth, +bool Absolute_Measurements, +float Height, +out float Radius, +out float Line_Width) +{float scale=Absolute_Measurements ? 1.0/Height : 1.0;Radius=Nominal_Radius*scale;Line_Width=Nominal_LineWidth*scale;} +void Edge_AA_Vertex_B130( +vec3 Position_World, +vec3 Position_Object, +vec3 Normal_Object, +vec3 Eye, +float Radial_Gradient, +vec3 Radial_Dir, +vec3 Tangent, +out float Gradient1, +out float Gradient2) +{vec3 I=(Eye-Position_World);vec3 T=(world* vec4(Tangent,0.0)).xyz;float g=(dot(T,I)<0.0) ? 0.0 : 1.0;if (Normal_Object.z==0.0) { +Gradient1=Position_Object.z>0.0 ? g : 1.0;Gradient2=Position_Object.z>0.0 ? 1.0 : g;} else {Gradient1=g+(1.0-g)*(Radial_Gradient);Gradient2=1.0;}} +void Pick_Radius_B144( +float Radius, +float Radius_Top_Left, +float Radius_Top_Right, +float Radius_Bottom_Left, +float Radius_Bottom_Right, +vec3 Position, +out float Result) +{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;} +void main() +{vec3 Nrm_World_Q128;Nrm_World_Q128=normalize((world*vec4(normal,0.0)).xyz);vec3 Tangent_World_Q131;vec3 Tangent_World_N_Q131;float Tangent_Length_Q131;Tangent_World_Q131=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q131=length(Tangent_World_Q131);Tangent_World_N_Q131=Tangent_World_Q131/Tangent_Length_Q131;vec3 Binormal_World_Q132;vec3 Binormal_World_N_Q132;float Binormal_Length_Q132;Object_To_World_Dir_B132(vec3(0,1,0),Binormal_World_Q132,Binormal_World_N_Q132,Binormal_Length_Q132);float Anisotropy_Q133=Tangent_Length_Q131/Binormal_Length_Q132;vec3 Result_Q177;Result_Q177=mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(_Use_Global_Left_Index_));vec3 Result_Q178;Result_Q178=mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(_Use_Global_Right_Index_));float Result_Q144;Pick_Radius_B144(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q144);vec3 Dir_Q140;PickDir_B140(_Angle_,Tangent_World_N_Q131,Binormal_World_N_Q132,Dir_Q140);float Radius_Q147;float Line_Width_Q147;RelativeOrAbsoluteDetail_B147(Result_Q144,_Line_Width_,_Absolute_Sizes_,Binormal_Length_Q132,Radius_Q147,Line_Width_Q147);vec4 Out_Color_Q145=vec4(Radius_Q147,Line_Width_Q147,0,1);vec3 New_P_Q129;vec2 New_UV_Q129;float Radial_Gradient_Q129;vec3 Radial_Dir_Q129;Move_Verts_B129(Anisotropy_Q133,position,Radius_Q147,New_P_Q129,New_UV_Q129,Radial_Gradient_Q129,Radial_Dir_Q129);vec3 Pos_World_Q115;Object_To_World_Pos_B115(New_P_Q129,Pos_World_Q115);vec4 Blob_Info_Q180; +#if BLOB_ENABLE +Blob_Vertex_B180(Pos_World_Q115,Nrm_World_Q128,Tangent_World_N_Q131,Binormal_World_N_Q132,Result_Q177,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q180); +#else +Blob_Info_Q180=vec4(0,0,0,0); +#endif +vec4 Blob_Info_Q181; +#if BLOB_ENABLE_2 +Blob_Vertex_B180(Pos_World_Q115,Nrm_World_Q128,Tangent_World_N_Q131,Binormal_World_N_Q132,Result_Q178,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q181); +#else +Blob_Info_Q181=vec4(0,0,0,0); +#endif +float Gradient1_Q130;float Gradient2_Q130; +#if SMOOTH_EDGES +Edge_AA_Vertex_B130(Pos_World_Q115,position,normal,cameraPosition,Radial_Gradient_Q129,Radial_Dir_Q129,tangent,Gradient1_Q130,Gradient2_Q130); +#else +Gradient1_Q130=1.0;Gradient2_Q130=1.0; +#endif +vec2 Rect_UV_Q139;vec4 Rect_Parms_Q139;vec2 Scale_XY_Q139;vec2 Line_UV_Q139;Round_Rect_Vertex_B139(New_UV_Q129,Radius_Q147,0.0,Anisotropy_Q133,Gradient1_Q130,Gradient2_Q130,Rect_UV_Q139,Rect_Parms_Q139,Scale_XY_Q139,Line_UV_Q139);vec3 Line_Vertex_Q135;Line_Vertex_B135(Scale_XY_Q139,Line_UV_Q139,0.0,_Rate_,_Highlight_Transform_,Line_Vertex_Q135);vec3 Position=Pos_World_Q115;vec3 Normal=Dir_Q140;vec2 UV=Rect_UV_Q139;vec3 Tangent=Line_Vertex_Q135;vec3 Binormal=Nrm_World_Q128;vec4 Color=Out_Color_Q145;vec4 Extra1=Rect_Parms_Q139;vec4 Extra2=Blob_Info_Q180;vec4 Extra3=Blob_Info_Q181;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}`; + ShaderStore.ShadersStore[name339] = shader336; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/fluentBackplate/fluentBackplateMaterial.js +class FluentBackplateMaterialDefines3 extends MaterialDefines { + constructor() { + super(); + this.BLOB_ENABLE = true; + this.BLOB_ENABLE_2 = true; + this.SMOOTH_EDGES = true; + this.IRIDESCENT_MAP_ENABLE = true; + this._needNormals = true; + this.rebuild(); + } +} + +class FluentBackplateMaterial3 extends PushMaterial { + constructor(name340, scene50) { + super(name340, scene50); + this.radius = 0.03; + this.lineWidth = 0.01; + this.absoluteSizes = false; + this._filterWidth = 1; + this.baseColor = new Color4(0.0392157, 0.0666667, 0.207843, 1); + this.lineColor = new Color4(0.14902, 0.133333, 0.384314, 1); + this.blobIntensity = 0.98; + this.blobFarSize = 0.04; + this.blobNearDistance = 0; + this.blobFarDistance = 0.08; + this.blobFadeLength = 0.08; + this.blobNearSize = 0.22; + this.blobPulse = 0; + this.blobFade = 0; + this.blobNearSize2 = 0.22; + this.blobPulse2 = 0; + this.blobFade2 = 0; + this._rate = 0.135; + this.highlightColor = new Color4(0.98, 0.98, 0.98, 1); + this.highlightWidth = 0.25; + this._highlightTransform = new Vector4(1, 1, 0, 0); + this._highlight = 1; + this.iridescenceIntensity = 0; + this.iridescenceEdgeIntensity = 1; + this._angle = -45; + this.fadeOut = 1; + this._reflected = true; + this._frequency = 1; + this._verticalOffset = 0; + this.globalLeftIndexTipPosition = Vector3.Zero(); + this._globalLeftIndexTipPosition4 = Vector4.Zero(); + this.globalRightIndexTipPosition = Vector3.Zero(); + this._globalRightIndexTipPosition4 = Vector4.Zero(); + this.alphaMode = Constants.ALPHA_DISABLE; + this.backFaceCulling = false; + this._blobTexture = new Texture(FluentBackplateMaterial3.BLOB_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE); + this._iridescentMap = new Texture(FluentBackplateMaterial3.IM_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE); + } + needAlphaBlending() { + return false; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh85, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new FluentBackplateMaterialDefines3; + } + const defines = subMesh11.materialDefines; + const scene50 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene50.getEngine(); + MaterialHelper.PrepareDefinesForAttributes(mesh85, defines, false, false); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + defines.IMAGEPROCESSINGPOSTPROCESS = scene50.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + if (defines.TANGENT) { + attribs.push(VertexBuffer.TangentKind); + } + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "fluentBackplate"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "viewProjection", + "cameraPosition", + "_Radius_", + "_Line_Width_", + "_Absolute_Sizes_", + "_Filter_Width_", + "_Base_Color_", + "_Line_Color_", + "_Radius_Top_Left_", + "_Radius_Top_Right_", + "_Radius_Bottom_Left_", + "_Radius_Bottom_Right_", + "_Blob_Position_", + "_Blob_Intensity_", + "_Blob_Near_Size_", + "_Blob_Far_Size_", + "_Blob_Near_Distance_", + "_Blob_Far_Distance_", + "_Blob_Fade_Length_", + "_Blob_Pulse_", + "_Blob_Fade_", + "_Blob_Texture_", + "_Blob_Position_2_", + "_Blob_Near_Size_2_", + "_Blob_Pulse_2_", + "_Blob_Fade_2_", + "_Rate_", + "_Highlight_Color_", + "_Highlight_Width_", + "_Highlight_Transform_", + "_Highlight_", + "_Iridescence_Intensity_", + "_Iridescence_Edge_Intensity_", + "_Angle_", + "_Fade_Out_", + "_Reflected_", + "_Frequency_", + "_Vertical_Offset_", + "_Iridescent_Map_", + "_Use_Global_Left_Index_", + "_Use_Global_Right_Index_", + "Global_Left_Index_Tip_Position", + "Global_Right_Index_Tip_Position" + ]; + const samplers = ["_Blob_Texture_", "_Iridescent_Map_"]; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh85, subMesh11) { + var _a, _b; + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix()); + this._activeEffect.setVector3("cameraPosition", (_b = (_a = this.getScene().activeCamera) === null || _a === undefined ? undefined : _a.position) !== null && _b !== undefined ? _b : Vector3.ZeroReadOnly); + this._activeEffect.setFloat("_Radius_", this.radius); + this._activeEffect.setFloat("_Line_Width_", this.lineWidth); + this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1 : 0); + this._activeEffect.setFloat("_Filter_Width_", this._filterWidth); + this._activeEffect.setDirectColor4("_Base_Color_", this.baseColor); + this._activeEffect.setDirectColor4("_Line_Color_", this.lineColor); + this._activeEffect.setFloat("_Radius_Top_Left_", 1); + this._activeEffect.setFloat("_Radius_Top_Right_", 1); + this._activeEffect.setFloat("_Radius_Bottom_Left_", 1); + this._activeEffect.setFloat("_Radius_Bottom_Right_", 1); + this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity); + this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize); + this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize); + this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance); + this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance); + this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength); + this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse); + this._activeEffect.setFloat("_Blob_Fade_", this.blobFade); + this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture); + this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2); + this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2); + this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2); + this._activeEffect.setFloat("_Rate_", this._rate); + this._activeEffect.setDirectColor4("_Highlight_Color_", this.highlightColor); + this._activeEffect.setFloat("_Highlight_Width_", this.highlightWidth); + this._activeEffect.setVector4("_Highlight_Transform_", this._highlightTransform); + this._activeEffect.setFloat("_Highlight_", this._highlight); + this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity); + this._activeEffect.setFloat("_Iridescence_Edge_Intensity_", this.iridescenceEdgeIntensity); + this._activeEffect.setFloat("_Angle_", this._angle); + this._activeEffect.setFloat("_Fade_Out_", this.fadeOut); + this._activeEffect.setFloat("_Reflected_", this._reflected ? 1 : 0); + this._activeEffect.setFloat("_Frequency_", this._frequency); + this._activeEffect.setFloat("_Vertical_Offset_", this._verticalOffset); + this._activeEffect.setTexture("_Iridescent_Map_", this._iridescentMap); + this._activeEffect.setFloat("_Use_Global_Left_Index_", 1); + this._activeEffect.setFloat("_Use_Global_Right_Index_", 1); + this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1); + this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this._globalLeftIndexTipPosition4); + this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1); + this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this._globalRightIndexTipPosition4); + this._afterBind(mesh85, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + this._blobTexture.dispose(); + this._iridescentMap.dispose(); + } + clone(name340) { + return SerializationHelper.Clone(() => new FluentBackplateMaterial3(name340, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.FluentBackplateMaterial"; + return serializationObject; + } + getClassName() { + return "FluentBackplateMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new FluentBackplateMaterial3(source.name, scene50), source, scene50, rootUrl); + } +} +var init_fluentBackplateMaterial2 = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_texture(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_buffer(); + init_typeStore(); + init_math_color(); + init_effectFallbacks(); + init_constants(); + init_fluentBackplate_fragment2(); + init_fluentBackplate_vertex2(); + FluentBackplateMaterial3.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-blob.png"; + FluentBackplateMaterial3.IM_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-iridescence.png"; + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "radius", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "lineWidth", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "absoluteSizes", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "baseColor", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "lineColor", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "blobIntensity", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "blobFarSize", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "blobNearDistance", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "blobFarDistance", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "blobFadeLength", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "blobNearSize", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "blobPulse", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "blobFade", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "blobNearSize2", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "blobPulse2", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "blobFade2", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "highlightColor", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "highlightWidth", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "iridescenceIntensity", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "iridescenceEdgeIntensity", undefined); + __decorate2([ + serialize() + ], FluentBackplateMaterial3.prototype, "fadeOut", undefined); + __decorate2([ + serializeAsVector3() + ], FluentBackplateMaterial3.prototype, "globalLeftIndexTipPosition", undefined); + __decorate2([ + serializeAsVector3() + ], FluentBackplateMaterial3.prototype, "globalRightIndexTipPosition", undefined); + RegisterClass("BABYLON.GUI.FluentBackplateMaterial", FluentBackplateMaterial3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/holographicBackplate.js +class HolographicBackplate3 extends Control3D3 { + set renderingGroupId(id) { + this._model.renderingGroupId = id; + } + get renderingGroupId() { + return this._model.renderingGroupId; + } + get material() { + return this._material; + } + get shareMaterials() { + return this._shareMaterials; + } + constructor(name340, _shareMaterials = true) { + super(name340); + this._shareMaterials = _shareMaterials; + } + _getTypeName() { + return "HolographicBackplate"; + } + _createNode(scene50) { + var _a; + const collisionMesh = CreateBox(((_a = this.name) !== null && _a !== undefined ? _a : "HolographicBackplate") + "_CollisionMesh", { + width: 1, + height: 1, + depth: 1 + }, scene50); + collisionMesh.isPickable = true; + collisionMesh.visibility = 0; + SceneLoader.ImportMeshAsync(undefined, HolographicBackplate3.MODEL_BASE_URL, HolographicBackplate3.MODEL_FILENAME, scene50).then((result) => { + const importedModel = result.meshes[1]; + importedModel.name = `${this.name}_frontPlate`; + importedModel.isPickable = false; + importedModel.parent = collisionMesh; + if (this._material) { + importedModel.material = this._material; + } + this._model = importedModel; + }); + return collisionMesh; + } + _createMaterial(mesh85) { + this._material = new FluentBackplateMaterial3(this.name + " Material", mesh85.getScene()); + } + _affectMaterial(mesh85) { + if (this._shareMaterials) { + if (!this._host._touchSharedMaterials["fluentBackplateMaterial"]) { + this._createMaterial(mesh85); + this._host._touchSharedMaterials["fluentBackplateMaterial"] = this._material; + } else { + this._material = this._host._touchSharedMaterials["fluentBackplateMaterial"]; + } + } else { + this._createMaterial(mesh85); + } + } + dispose() { + super.dispose(); + if (!this.shareMaterials) { + this._material.dispose(); + } + this._model.dispose(); + } +} +var init_holographicBackplate2 = __esm(() => { + init_boxBuilder(); + init_fluentBackplateMaterial2(); + init_control3D2(); + init_sceneLoader(); + HolographicBackplate3.MODEL_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/"; + HolographicBackplate3.MODEL_FILENAME = "mrtk-fluent-backplate.glb"; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/holographicButton.js +class HolographicButton2 extends Button3D3 { + _disposeTooltip() { + this._tooltipFade = null; + if (this._tooltipTextBlock) { + this._tooltipTextBlock.dispose(); + } + if (this._tooltipTexture) { + this._tooltipTexture.dispose(); + } + if (this._tooltipMesh) { + this._tooltipMesh.dispose(); + } + this.onPointerEnterObservable.remove(this._tooltipHoverObserver); + this.onPointerOutObservable.remove(this._tooltipOutObserver); + } + set renderingGroupId(id) { + this._backPlate.renderingGroupId = id; + this._textPlate.renderingGroupId = id; + this._frontPlate.renderingGroupId = id; + if (this._tooltipMesh) { + this._tooltipMesh.renderingGroupId = id; + } + } + get renderingGroupId() { + return this._backPlate.renderingGroupId; + } + set tooltipText(text) { + if (!text) { + this._disposeTooltip(); + return; + } + if (!this._tooltipFade) { + const rightHandedScene = this._backPlate._scene.useRightHandedSystem; + this._tooltipMesh = CreatePlane("", { size: 1 }, this._backPlate._scene); + const tooltipBackground = CreatePlane("", { size: 1, sideOrientation: Mesh.DOUBLESIDE }, this._backPlate._scene); + const mat = new StandardMaterial("", this._backPlate._scene); + mat.diffuseColor = Color3.FromHexString("#212121"); + tooltipBackground.material = mat; + tooltipBackground.isPickable = false; + this._tooltipMesh.addChild(tooltipBackground); + tooltipBackground.position = Vector3.Forward(rightHandedScene).scale(0.05); + this._tooltipMesh.scaling.y = 1 / 3; + this._tooltipMesh.position = Vector3.Up().scale(0.7).add(Vector3.Forward(rightHandedScene).scale(-0.15)); + this._tooltipMesh.isPickable = false; + this._tooltipMesh.parent = this._backPlate; + this._tooltipTexture = AdvancedDynamicTexture3.CreateForMesh(this._tooltipMesh); + this._tooltipTextBlock = new TextBlock3; + this._tooltipTextBlock.scaleY = 3; + this._tooltipTextBlock.color = "white"; + this._tooltipTextBlock.fontSize = 130; + this._tooltipTexture.addControl(this._tooltipTextBlock); + this._tooltipFade = new FadeInOutBehavior; + this._tooltipFade.delay = 500; + this._tooltipMesh.addBehavior(this._tooltipFade); + this._tooltipHoverObserver = this.onPointerEnterObservable.add(() => { + if (this._tooltipFade) { + this._tooltipFade.fadeIn(true); + } + }); + this._tooltipOutObserver = this.onPointerOutObservable.add(() => { + if (this._tooltipFade) { + this._tooltipFade.fadeIn(false); + } + }); + } + if (this._tooltipTextBlock) { + this._tooltipTextBlock.text = text; + } + } + get tooltipText() { + if (this._tooltipTextBlock) { + return this._tooltipTextBlock.text; + } + return null; + } + get text() { + return this._text; + } + set text(value) { + if (this._text === value) { + return; + } + this._text = value; + this._rebuildContent(); + } + get imageUrl() { + return this._imageUrl; + } + set imageUrl(value) { + if (this._imageUrl === value) { + return; + } + this._imageUrl = value; + this._rebuildContent(); + } + get backMaterial() { + return this._backMaterial; + } + get frontMaterial() { + return this._frontMaterial; + } + get plateMaterial() { + return this._plateMaterial; + } + get shareMaterials() { + return this._shareMaterials; + } + constructor(name340, shareMaterials = true) { + super(name340); + this._shareMaterials = true; + this._shareMaterials = shareMaterials; + this.pointerEnterAnimation = () => { + if (!this.mesh) { + return; + } + this._frontPlate.setEnabled(true); + }; + this.pointerOutAnimation = () => { + if (!this.mesh) { + return; + } + this._frontPlate.setEnabled(false); + }; + } + _getTypeName() { + return "HolographicButton"; + } + _rebuildContent() { + this._disposeFacadeTexture(); + const panel = new StackPanel3; + panel.isVertical = true; + if (IsDocumentAvailable() && !!document.createElement) { + if (this._imageUrl) { + const image17 = new Image4; + image17.source = this._imageUrl; + image17.paddingTop = "40px"; + image17.height = "180px"; + image17.width = "100px"; + image17.paddingBottom = "40px"; + panel.addControl(image17); + } + } + if (this._text) { + const text = new TextBlock3; + text.text = this._text; + text.color = "white"; + text.height = "30px"; + text.fontSize = 24; + panel.addControl(text); + } + if (this._frontPlate) { + this.content = panel; + } + } + _createNode(scene50) { + this._backPlate = CreateBox(this.name + "BackMesh", { + width: 1, + height: 1, + depth: 0.08 + }, scene50); + this._frontPlate = CreateBox(this.name + "FrontMesh", { + width: 1, + height: 1, + depth: 0.08 + }, scene50); + this._frontPlate.parent = this._backPlate; + this._frontPlate.position = Vector3.Forward(scene50.useRightHandedSystem).scale(-0.08); + this._frontPlate.isPickable = false; + this._frontPlate.setEnabled(false); + this._textPlate = super._createNode(scene50); + this._textPlate.parent = this._backPlate; + this._textPlate.position = Vector3.Forward(scene50.useRightHandedSystem).scale(-0.08); + this._textPlate.isPickable = false; + return this._backPlate; + } + _applyFacade(facadeTexture) { + this._plateMaterial.emissiveTexture = facadeTexture; + this._plateMaterial.opacityTexture = facadeTexture; + } + _createBackMaterial(mesh86) { + this._backMaterial = new FluentMaterial3(this.name + "Back Material", mesh86.getScene()); + this._backMaterial.renderHoverLight = true; + this._pickedPointObserver = this._host.onPickedPointChangedObservable.add((pickedPoint) => { + if (pickedPoint) { + this._backMaterial.hoverPosition = pickedPoint; + this._backMaterial.hoverColor.a = 1; + } else { + this._backMaterial.hoverColor.a = 0; + } + }); + } + _createFrontMaterial(mesh86) { + this._frontMaterial = new FluentMaterial3(this.name + "Front Material", mesh86.getScene()); + this._frontMaterial.innerGlowColorIntensity = 0; + this._frontMaterial.alpha = 0.5; + this._frontMaterial.renderBorders = true; + } + _createPlateMaterial(mesh86) { + this._plateMaterial = new StandardMaterial(this.name + "Plate Material", mesh86.getScene()); + this._plateMaterial.specularColor = Color3.Black(); + } + _affectMaterial(mesh86) { + if (this._shareMaterials) { + if (!this._host._sharedMaterials["backFluentMaterial"]) { + this._createBackMaterial(mesh86); + this._host._sharedMaterials["backFluentMaterial"] = this._backMaterial; + } else { + this._backMaterial = this._host._sharedMaterials["backFluentMaterial"]; + } + if (!this._host._sharedMaterials["frontFluentMaterial"]) { + this._createFrontMaterial(mesh86); + this._host._sharedMaterials["frontFluentMaterial"] = this._frontMaterial; + } else { + this._frontMaterial = this._host._sharedMaterials["frontFluentMaterial"]; + } + } else { + this._createBackMaterial(mesh86); + this._createFrontMaterial(mesh86); + } + this._createPlateMaterial(mesh86); + this._backPlate.material = this._backMaterial; + this._frontPlate.material = this._frontMaterial; + this._textPlate.material = this._plateMaterial; + this._rebuildContent(); + } + dispose() { + super.dispose(); + this._disposeTooltip(); + if (!this.shareMaterials) { + this._backMaterial.dispose(); + this._frontMaterial.dispose(); + this._plateMaterial.dispose(); + if (this._pickedPointObserver) { + this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver); + this._pickedPointObserver = null; + } + } + } +} +var init_holographicButton2 = __esm(() => { + init_button3D2(); + init_math_vector(); + init_standardMaterial(); + init_mesh(); + init_planeBuilder(); + init_boxBuilder(); + init_fadeInOutBehavior(); + init_fluentMaterial2(); + init_stackPanel2(); + init_image2(); + init_textBlock2(); + init_advancedDynamicTexture2(); + init_math_color(); + init_domManagement(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/fluentButton/shaders/fluentButton.fragment.js +var name340, shader337; +var init_fluentButton_fragment2 = __esm(() => { + init_shaderStore(); + name340 = "fluentButtonPixelShader"; + shader337 = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;uniform float _Edge_Width_;uniform vec4 _Edge_Color_;uniform bool _Relative_Width_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Active_Face_Dir_;uniform vec3 _Active_Face_Up_;uniform bool Enable_Fade;uniform float _Fade_Width_;uniform bool _Smooth_Active_Face_;uniform bool _Show_Frame_;uniform bool _Use_Blob_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Holo_Edge_Fragment_B35( +vec4 Edges, +float Edge_Width, +out float NotEdge) +{vec2 c=vec2(min(Edges.r,Edges.g),min(Edges.b,Edges.a));vec2 df=fwidth(c)*Edge_Width;vec2 g=clamp(c/df,0.0,1.0);NotEdge=g.x*g.y;} +void Blob_Fragment_B39( +vec2 UV, +vec3 Blob_Info, +sampler2D Blob_Texture, +out vec4 Blob_Color) +{float k=dot(UV,UV);Blob_Color=Blob_Info.y*texture(Blob_Texture,vec2(vec2(sqrt(k),Blob_Info.x).x,1.0-vec2(sqrt(k),Blob_Info.x).y))*(1.0-clamp(k,0.0,1.0));} +vec2 FilterStep(vec2 Edge,vec2 X) +{vec2 dX=max(fwidth(X),vec2(0.00001,0.00001));return clamp( (X+dX-max(Edge,X-dX))/(dX*2.0),0.0,1.0);} +void Wireframe_Fragment_B59( +vec3 Widths, +vec2 UV, +float Proximity, +vec4 Edge_Color, +out vec4 Wireframe) +{vec2 c=min(UV,vec2(1.0,1.0)-UV);vec2 g=FilterStep(Widths.xy*0.5,c); +Wireframe=(1.0-min(g.x,g.y))*Proximity*Edge_Color;} +void Proximity_B53( +vec3 Proximity_Center, +vec3 Proximity_Center_2, +float Proximity_Max_Intensity, +float Proximity_Near_Radius, +vec3 Position, +vec3 Show_Selection, +vec4 Extra1, +float Dist_To_Face, +float Intensity, +out float Proximity) +{vec2 delta1=Extra1.xy;vec2 delta2=Extra1.zw;float d2=sqrt(min(dot(delta1,delta1),dot(delta2,delta2))+Dist_To_Face*Dist_To_Face);Proximity=Intensity*Proximity_Max_Intensity*(1.0-clamp(d2/Proximity_Near_Radius,0.0,1.0))*(1.0-Show_Selection.x)+Show_Selection.x;} +void To_XYZ_B46( +vec3 Vec3, +out float X, +out float Y, +out float Z) +{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;} +void main() +{float NotEdge_Q35; +#if ENABLE_FADE +Holo_Edge_Fragment_B35(vColor,_Fade_Width_,NotEdge_Q35); +#else +NotEdge_Q35=1.0; +#endif +vec4 Blob_Color_Q39;float k=dot(vUV,vUV);vec2 blobTextureCoord=vec2(vec2(sqrt(k),vTangent.x).x,1.0-vec2(sqrt(k),vTangent.x).y);vec4 blobColor=mix(vec4(1.0,1.0,1.0,1.0)*step(1.0-vTangent.x,clamp(sqrt(k)+0.1,0.0,1.0)),texture(_Blob_Texture_,blobTextureCoord),float(_Use_Blob_Texture_));Blob_Color_Q39=vTangent.y*blobColor*(1.0-clamp(k,0.0,1.0));float Is_Quad_Q24;Is_Quad_Q24=vNormal.z;vec3 Blob_Position_Q41= mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(Use_Global_Left_Index));vec3 Blob_Position_Q42= mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(Use_Global_Right_Index));float X_Q46;float Y_Q46;float Z_Q46;To_XYZ_B46(vBinormal,X_Q46,Y_Q46,Z_Q46);float Proximity_Q53;Proximity_B53(Blob_Position_Q41,Blob_Position_Q42,_Proximity_Max_Intensity_,_Proximity_Near_Radius_,vPosition,vBinormal,vExtra1,Y_Q46,Z_Q46,Proximity_Q53);vec4 Wireframe_Q59;Wireframe_Fragment_B59(vNormal,vUV,Proximity_Q53,_Edge_Color_,Wireframe_Q59);vec4 Wire_Or_Blob_Q23=mix(Wireframe_Q59,Blob_Color_Q39,Is_Quad_Q24);vec4 Result_Q22;Result_Q22=mix(Wire_Or_Blob_Q23,vec4(0.3,0.3,0.3,0.3),float(_Show_Frame_));vec4 Final_Color_Q37=NotEdge_Q35*Result_Q22;vec4 Out_Color=Final_Color_Q37;float Clip_Threshold=0.0;bool To_sRGB=false;gl_FragColor=Out_Color;}`; + ShaderStore.ShadersStore[name340] = shader337; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/fluentButton/shaders/fluentButton.vertex.js +var name341, shader338; +var init_fluentButton_vertex2 = __esm(() => { + init_shaderStore(); + name341 = "fluentButtonVertexShader"; + shader338 = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform float _Edge_Width_;uniform vec4 _Edge_Color_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Active_Face_Dir_;uniform vec3 _Active_Face_Up_;uniform bool _Enable_Fade_;uniform float _Fade_Width_;uniform bool _Smooth_Active_Face_;uniform bool _Show_Frame_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;void Blob_Vertex_B47( +vec3 Position, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +vec3 Blob_Position, +float Intensity, +float Blob_Near_Size, +float Blob_Far_Size, +float Blob_Near_Distance, +float Blob_Far_Distance, +vec4 Vx_Color, +vec2 UV, +vec3 Face_Center, +vec2 Face_Size, +vec2 In_UV, +float Blob_Fade_Length, +float Selection_Fade, +float Selection_Fade_Size, +float Inner_Fade, +vec3 Active_Face_Center, +float Blob_Pulse, +float Blob_Fade, +float Blob_Enabled, +out vec3 Out_Position, +out vec2 Out_UV, +out vec3 Blob_Info) +{float blobSize,fadeIn;vec3 Hit_Position;Blob_Info=vec3(0.0,0.0,0.0);float Hit_Distance=dot(Blob_Position-Face_Center,Normal);Hit_Position=Blob_Position-Hit_Distance*Normal;float absD=abs(Hit_Distance);float lerpVal=clamp((absD-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);fadeIn=1.0-clamp((absD-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float innerFade=1.0-clamp(-Hit_Distance/Inner_Fade,0.0,1.0);float farClip=clamp(1.0-step(Blob_Far_Distance+Blob_Fade_Length,absD),0.0,1.0);float size=mix(Blob_Near_Size,Blob_Far_Size,lerpVal)*farClip;blobSize=mix(size,Selection_Fade_Size,Selection_Fade)*innerFade*Blob_Enabled;Blob_Info.x=lerpVal*0.5+0.5;Blob_Info.y=fadeIn*Intensity*(1.0-Selection_Fade)*Blob_Fade;Blob_Info.x*=(1.0-Blob_Pulse);vec3 delta=Hit_Position-Face_Center;vec2 blobCenterXY=vec2(dot(delta,Tangent),dot(delta,Bitangent));vec2 quadUVin=2.0*UV-1.0; +vec2 blobXY=blobCenterXY+quadUVin*blobSize;vec2 blobClipped=clamp(blobXY,-Face_Size*0.5,Face_Size*0.5);vec2 blobUV=(blobClipped-blobCenterXY)/max(blobSize,0.0001)*2.0;vec3 blobCorner=Face_Center+blobClipped.x*Tangent+blobClipped.y*Bitangent;Out_Position=mix(Position,blobCorner,Vx_Color.rrr);Out_UV=mix(In_UV,blobUV,Vx_Color.rr);} +vec2 ProjectProximity( +vec3 blobPosition, +vec3 position, +vec3 center, +vec3 dir, +vec3 xdir, +vec3 ydir, +out float vdistance +) +{vec3 delta=blobPosition-position;vec2 xy=vec2(dot(delta,xdir),dot(delta,ydir));vdistance=abs(dot(delta,dir));return xy;} +void Proximity_Vertex_B66( +vec3 Blob_Position, +vec3 Blob_Position_2, +vec3 Active_Face_Center, +vec3 Active_Face_Dir, +vec3 Position, +float Proximity_Far_Distance, +float Relative_Scale, +float Proximity_Anisotropy, +vec3 Up, +out vec4 Extra1, +out float Distance_To_Face, +out float Intensity) +{vec3 Active_Face_Dir_X=normalize(cross(Active_Face_Dir,Up));vec3 Active_Face_Dir_Y=cross(Active_Face_Dir,Active_Face_Dir_X);float distz1,distz2;Extra1.xy=ProjectProximity(Blob_Position,Position,Active_Face_Center,Active_Face_Dir,Active_Face_Dir_X*Proximity_Anisotropy,Active_Face_Dir_Y,distz1)/Relative_Scale;Extra1.zw=ProjectProximity(Blob_Position_2,Position,Active_Face_Center,Active_Face_Dir,Active_Face_Dir_X*Proximity_Anisotropy,Active_Face_Dir_Y,distz2)/Relative_Scale;Distance_To_Face=dot(Active_Face_Dir,Position-Active_Face_Center);Intensity=1.0-clamp(min(distz1,distz2)/Proximity_Far_Distance,0.0,1.0);} +void Holo_Edge_Vertex_B44( +vec3 Incident, +vec3 Normal, +vec2 UV, +vec3 Tangent, +vec3 Bitangent, +bool Smooth_Active_Face, +float Active, +out vec4 Holo_Edges) +{float NdotI=dot(Incident,Normal);vec2 flip=(UV-vec2(0.5,0.5));float udot=dot(Incident,Tangent)*flip.x*NdotI;float uval=1.0-float(udot>0.0);float vdot=-dot(Incident,Bitangent)*flip.y*NdotI;float vval=1.0-float(vdot>0.0);float Smooth_And_Active=step(1.0,float(Smooth_Active_Face && Active>0.0));uval=mix(uval,max(1.0,uval),Smooth_And_Active); +vval=mix(vval,max(1.0,vval),Smooth_And_Active);Holo_Edges=vec4(1.0,1.0,1.0,1.0)-vec4(uval*UV.x,uval*(1.0-UV.x),vval*UV.y,vval*(1.0-UV.y));} +void Object_To_World_Pos_B13( +vec3 Pos_Object, +out vec3 Pos_World) +{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;} +void Choose_Blob_B38( +vec4 Vx_Color, +vec3 Position1, +vec3 Position2, +bool Blob_Enable_1, +bool Blob_Enable_2, +float Near_Size_1, +float Near_Size_2, +float Blob_Inner_Fade_1, +float Blob_Inner_Fade_2, +float Blob_Pulse_1, +float Blob_Pulse_2, +float Blob_Fade_1, +float Blob_Fade_2, +out vec3 Position, +out float Near_Size, +out float Inner_Fade, +out float Blob_Enable, +out float Fade, +out float Pulse) +{Position=Position1*(1.0-Vx_Color.g)+Vx_Color.g*Position2;float b1=float(Blob_Enable_1);float b2=float(Blob_Enable_2);Blob_Enable=b1+(b2-b1)*Vx_Color.g;Pulse=Blob_Pulse_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Pulse_2;Fade=Blob_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Fade_2;Near_Size=Near_Size_1*(1.0-Vx_Color.g)+Vx_Color.g*Near_Size_2;Inner_Fade=Blob_Inner_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Inner_Fade_2;} +void Wireframe_Vertex_B51( +vec3 Position, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +float Edge_Width, +vec2 Face_Size, +out vec3 Wire_Vx_Pos, +out vec2 UV, +out vec2 Widths) +{Widths.xy=Edge_Width/Face_Size;float x=dot(Position,Tangent);float y=dot(Position,Bitangent);float dx=0.5-abs(x);float newx=(0.5-dx*Widths.x*2.0)*sign(x);float dy=0.5-abs(y);float newy=(0.5-dy*Widths.y*2.0)*sign(y);Wire_Vx_Pos=Normal*0.5+newx*Tangent+newy*Bitangent;UV.x=dot(Wire_Vx_Pos,Tangent)+0.5;UV.y=dot(Wire_Vx_Pos,Bitangent)+0.5;} +vec2 ramp2(vec2 start,vec2 end,vec2 x) +{return clamp((x-start)/(end-start),vec2(0.0,0.0),vec2(1.0,1.0));} +float computeSelection( +vec3 blobPosition, +vec3 normal, +vec3 tangent, +vec3 bitangent, +vec3 faceCenter, +vec2 faceSize, +float selectionFuzz, +float farDistance, +float fadeLength +) +{vec3 delta=blobPosition-faceCenter;float absD=abs(dot(delta,normal));float fadeIn=1.0-clamp((absD-farDistance)/fadeLength,0.0,1.0);vec2 blobCenterXY=vec2(dot(delta,tangent),dot(delta,bitangent));vec2 innerFace=faceSize*(1.0-selectionFuzz)*0.5;vec2 selectPulse=ramp2(-faceSize*0.5,-innerFace,blobCenterXY)-ramp2(innerFace,faceSize*0.5,blobCenterXY);return selectPulse.x*selectPulse.y*fadeIn;} +void Selection_Vertex_B48( +vec3 Blob_Position, +vec3 Blob_Position_2, +vec3 Face_Center, +vec2 Face_Size, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +float Selection_Fuzz, +float Selected, +float Far_Distance, +float Fade_Length, +vec3 Active_Face_Dir, +out float Show_Selection) +{float select1=computeSelection(Blob_Position,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float select2=computeSelection(Blob_Position_2,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float Active=max(0.0,dot(Active_Face_Dir,Normal));Show_Selection=mix(max(select1,select2),1.0,Selected)*Active;} +void Proximity_Visibility_B54( +float Selection, +vec3 Proximity_Center, +vec3 Proximity_Center_2, +float Input_Width, +float Proximity_Far_Distance, +float Proximity_Radius, +vec3 Active_Face_Center, +vec3 Active_Face_Dir, +out float Width) +{vec3 boxEdges=(world*vec4(vec3(0.5,0.5,0.5),0.0)).xyz;float boxMaxSize=length(boxEdges);float d1=dot(Proximity_Center-Active_Face_Center,Active_Face_Dir);vec3 blob1=Proximity_Center-d1*Active_Face_Dir;float d2=dot(Proximity_Center_2-Active_Face_Center,Active_Face_Dir);vec3 blob2=Proximity_Center_2-d2*Active_Face_Dir;vec3 delta1=blob1-Active_Face_Center;vec3 delta2=blob2-Active_Face_Center;float dist1=dot(delta1,delta1);float dist2=dot(delta2,delta2);float nearestProxDist=sqrt(min(dist1,dist2));Width=Input_Width*(1.0-step(boxMaxSize+Proximity_Radius,nearestProxDist))*(1.0-step(Proximity_Far_Distance,min(d1,d2))*(1.0-step(0.0001,Selection)));} +void Object_To_World_Dir_B67( +vec3 Dir_Object, +out vec3 Dir_World) +{Dir_World=(world*vec4(Dir_Object,0.0)).xyz;} +void main() +{vec3 Active_Face_Center_Q49;Active_Face_Center_Q49=(world*vec4(_Active_Face_Dir_*0.5,1.0)).xyz;vec3 Blob_Position_Q41= mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(Use_Global_Left_Index));vec3 Blob_Position_Q42= mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(Use_Global_Right_Index));vec3 Active_Face_Dir_Q64=normalize((world*vec4(_Active_Face_Dir_,0.0)).xyz);float Relative_Scale_Q57; +#if RELATIVE_WIDTH +Relative_Scale_Q57=length((world*vec4(vec3(0,1,0),0.0)).xyz); +#else +Relative_Scale_Q57=1.0; +#endif +vec3 Tangent_World_Q30;Tangent_World_Q30=(world*vec4(tangent,0.0)).xyz;vec3 Binormal_World_Q31;Binormal_World_Q31=(world*vec4((cross(normal,tangent)),0.0)).xyz;vec3 Normal_World_Q60;Normal_World_Q60=(world*vec4(normal,0.0)).xyz;vec3 Result_Q18=0.5*normal;vec3 Dir_World_Q67;Object_To_World_Dir_B67(_Active_Face_Up_,Dir_World_Q67);float Product_Q56=_Edge_Width_*Relative_Scale_Q57;vec3 Normal_World_N_Q29=normalize(Normal_World_Q60);vec3 Tangent_World_N_Q28=normalize(Tangent_World_Q30);vec3 Binormal_World_N_Q32=normalize(Binormal_World_Q31);vec3 Position_Q38;float Near_Size_Q38;float Inner_Fade_Q38;float Blob_Enable_Q38;float Fade_Q38;float Pulse_Q38;Choose_Blob_B38(color,Blob_Position_Q41,Blob_Position_Q42,_Blob_Enable_,_Blob_Enable_2_,_Blob_Near_Size_,_Blob_Near_Size_2_,_Blob_Inner_Fade_,_Blob_Inner_Fade_2_,_Blob_Pulse_,_Blob_Pulse_2_,_Blob_Fade_,_Blob_Fade_2_,Position_Q38,Near_Size_Q38,Inner_Fade_Q38,Blob_Enable_Q38,Fade_Q38,Pulse_Q38);vec3 Face_Center_Q33;Face_Center_Q33=(world*vec4(Result_Q18,1.0)).xyz;vec2 Face_Size_Q50=vec2(length(Tangent_World_Q30),length(Binormal_World_Q31));float Show_Selection_Q48;Selection_Vertex_B48(Blob_Position_Q41,Blob_Position_Q42,Face_Center_Q33,Face_Size_Q50,Normal_World_N_Q29,Tangent_World_N_Q28,Binormal_World_N_Q32,_Selection_Fuzz_,_Selected_,_Selected_Distance_,_Selected_Fade_Length_,Active_Face_Dir_Q64,Show_Selection_Q48);vec3 Normalized_Q72=normalize(Dir_World_Q67);float Active_Q34=max(0.0,dot(Active_Face_Dir_Q64,Normal_World_N_Q29));float Width_Q54;Proximity_Visibility_B54(Show_Selection_Q48,Blob_Position_Q41,Blob_Position_Q42,Product_Q56,_Proximity_Far_Distance_,_Proximity_Near_Radius_,Active_Face_Center_Q49,Active_Face_Dir_Q64,Width_Q54);vec3 Wire_Vx_Pos_Q51;vec2 UV_Q51;vec2 Widths_Q51;Wireframe_Vertex_B51(position,normal,tangent,(cross(normal,tangent)),Width_Q54,Face_Size_Q50,Wire_Vx_Pos_Q51,UV_Q51,Widths_Q51);vec3 Vec3_Q27=vec3(Widths_Q51.x,Widths_Q51.y,color.r);vec3 Pos_World_Q13;Object_To_World_Pos_B13(Wire_Vx_Pos_Q51,Pos_World_Q13);vec3 Incident_Q36=normalize(Pos_World_Q13-cameraPosition);vec3 Out_Position_Q47;vec2 Out_UV_Q47;vec3 Blob_Info_Q47;Blob_Vertex_B47(Pos_World_Q13,Normal_World_N_Q29,Tangent_World_N_Q28,Binormal_World_N_Q32,Position_Q38,_Blob_Intensity_,Near_Size_Q38,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,color,uv,Face_Center_Q33,Face_Size_Q50,UV_Q51,_Blob_Fade_Length_,_Selection_Fade_,_Selection_Fade_Size_,Inner_Fade_Q38,Active_Face_Center_Q49,Pulse_Q38,Fade_Q38,Blob_Enable_Q38,Out_Position_Q47,Out_UV_Q47,Blob_Info_Q47);vec4 Extra1_Q66;float Distance_To_Face_Q66;float Intensity_Q66;Proximity_Vertex_B66(Blob_Position_Q41,Blob_Position_Q42,Active_Face_Center_Q49,Active_Face_Dir_Q64,Pos_World_Q13,_Proximity_Far_Distance_,Relative_Scale_Q57,_Proximity_Anisotropy_,Normalized_Q72,Extra1_Q66,Distance_To_Face_Q66,Intensity_Q66);vec4 Holo_Edges_Q44;Holo_Edge_Vertex_B44(Incident_Q36,Normal_World_N_Q29,uv,Tangent_World_Q30,Binormal_World_Q31,_Smooth_Active_Face_,Active_Q34,Holo_Edges_Q44);vec3 Vec3_Q19=vec3(Show_Selection_Q48,Distance_To_Face_Q66,Intensity_Q66);vec3 Position=Out_Position_Q47;vec2 UV=Out_UV_Q47;vec3 Tangent=Blob_Info_Q47;vec3 Binormal=Vec3_Q19;vec3 Normal=Vec3_Q27;vec4 Extra1=Extra1_Q66;vec4 Color=Holo_Edges_Q44;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;}`; + ShaderStore.ShadersStore[name341] = shader338; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/fluentButton/fluentButtonMaterial.js +class FluentButtonMaterialDefines3 extends MaterialDefines { + constructor() { + super(); + this.RELATIVE_WIDTH = true; + this.ENABLE_FADE = true; + this._needNormals = true; + this._needUVs = true; + this.rebuild(); + } +} + +class FluentButtonMaterial3 extends PushMaterial { + constructor(name342, scene50) { + super(name342, scene50); + this.edgeWidth = 0.04; + this.edgeColor = new Color4(0.592157, 0.592157, 0.592157, 1); + this.proximityMaxIntensity = 0.45; + this.proximityFarDistance = 0.16; + this.proximityNearRadius = 1.5; + this.proximityAnisotropy = 1; + this.selectionFuzz = 0.5; + this.selected = 0; + this.selectionFade = 0; + this.selectionFadeSize = 0.3; + this.selectedDistance = 0.08; + this.selectedFadeLength = 0.08; + this.blobIntensity = 0.5; + this.blobFarSize = 0.05; + this.blobNearDistance = 0; + this.blobFarDistance = 0.08; + this.blobFadeLength = 0.08; + this.leftBlobEnable = true; + this.leftBlobNearSize = 0.025; + this.leftBlobPulse = 0; + this.leftBlobFade = 1; + this.leftBlobInnerFade = 0.01; + this.rightBlobEnable = true; + this.rightBlobNearSize = 0.025; + this.rightBlobPulse = 0; + this.rightBlobFade = 1; + this.rightBlobInnerFade = 0.01; + this.activeFaceDir = new Vector3(0, 0, -1); + this.activeFaceUp = new Vector3(0, 1, 0); + this.enableFade = true; + this.fadeWidth = 1.5; + this.smoothActiveFace = true; + this.showFrame = false; + this.useBlobTexture = true; + this.globalLeftIndexTipPosition = Vector3.Zero(); + this.globalRightIndexTipPosition = Vector3.Zero(); + this.alphaMode = Constants.ALPHA_ADD; + this.disableDepthWrite = true; + this.backFaceCulling = false; + this._blobTexture = new Texture(FluentButtonMaterial3.BLOB_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE); + } + needAlphaBlending() { + return true; + } + needAlphaTesting() { + return true; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh86, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new FluentButtonMaterialDefines3; + } + const defines = subMesh11.materialDefines; + const scene50 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene50.getEngine(); + MaterialHelper.PrepareDefinesForAttributes(mesh86, defines, true, false); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + defines.IMAGEPROCESSINGPOSTPROCESS = scene50.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + if (defines.TANGENT) { + attribs.push(VertexBuffer.TangentKind); + } + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "fluentButton"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "viewProjection", + "cameraPosition", + "_Edge_Width_", + "_Edge_Color_", + "_Relative_Width_", + "_Proximity_Max_Intensity_", + "_Proximity_Far_Distance_", + "_Proximity_Near_Radius_", + "_Proximity_Anisotropy_", + "_Selection_Fuzz_", + "_Selected_", + "_Selection_Fade_", + "_Selection_Fade_Size_", + "_Selected_Distance_", + "_Selected_Fade_Length_", + "_Blob_Enable_", + "_Blob_Position_", + "_Blob_Intensity_", + "_Blob_Near_Size_", + "_Blob_Far_Size_", + "_Blob_Near_Distance_", + "_Blob_Far_Distance_", + "_Blob_Fade_Length_", + "_Blob_Inner_Fade_", + "_Blob_Pulse_", + "_Blob_Fade_", + "_Blob_Texture_", + "_Blob_Enable_2_", + "_Blob_Position_2_", + "_Blob_Near_Size_2_", + "_Blob_Inner_Fade_2_", + "_Blob_Pulse_2_", + "_Blob_Fade_2_", + "_Active_Face_Dir_", + "_Active_Face_Up_", + "_Enable_Fade_", + "_Fade_Width_", + "_Smooth_Active_Face_", + "_Show_Frame_", + "_Use_Blob_Texture_", + "Use_Global_Left_Index", + "Use_Global_Right_Index", + "Global_Left_Index_Tip_Position", + "Global_Right_Index_Tip_Position", + "Global_Left_Thumb_Tip_Position", + "Global_Right_Thumb_Tip_Position", + "Global_Left_Index_Tip_Proximity", + "Global_Right_Index_Tip_Proximity" + ]; + const samplers = ["_Blob_Texture_"]; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh86, subMesh11) { + const scene50 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene50.getTransformMatrix()); + this._activeEffect.setVector3("cameraPosition", scene50.activeCamera.position); + this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture); + this._activeEffect.setFloat("_Edge_Width_", this.edgeWidth); + this._activeEffect.setColor4("_Edge_Color_", new Color3(this.edgeColor.r, this.edgeColor.g, this.edgeColor.b), this.edgeColor.a); + this._activeEffect.setFloat("_Proximity_Max_Intensity_", this.proximityMaxIntensity); + this._activeEffect.setFloat("_Proximity_Far_Distance_", this.proximityFarDistance); + this._activeEffect.setFloat("_Proximity_Near_Radius_", this.proximityNearRadius); + this._activeEffect.setFloat("_Proximity_Anisotropy_", this.proximityAnisotropy); + this._activeEffect.setFloat("_Selection_Fuzz_", this.selectionFuzz); + this._activeEffect.setFloat("_Selected_", this.selected); + this._activeEffect.setFloat("_Selection_Fade_", this.selectionFade); + this._activeEffect.setFloat("_Selection_Fade_Size_", this.selectionFadeSize); + this._activeEffect.setFloat("_Selected_Distance_", this.selectedDistance); + this._activeEffect.setFloat("_Selected_Fade_Length_", this.selectedFadeLength); + this._activeEffect.setFloat("_Blob_Enable_", this.leftBlobEnable ? 1 : 0); + this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity); + this._activeEffect.setFloat("_Blob_Near_Size_", this.leftBlobNearSize); + this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize); + this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance); + this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance); + this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength); + this._activeEffect.setFloat("_Blob_Inner_Fade_", this.leftBlobInnerFade); + this._activeEffect.setFloat("_Blob_Pulse_", this.leftBlobPulse); + this._activeEffect.setFloat("_Blob_Fade_", this.leftBlobFade); + this._activeEffect.setFloat("_Blob_Enable_2_", this.rightBlobEnable ? 1 : 0); + this._activeEffect.setFloat("_Blob_Near_Size_2_", this.rightBlobNearSize); + this._activeEffect.setFloat("_Blob_Inner_Fade_2_", this.rightBlobInnerFade); + this._activeEffect.setFloat("_Blob_Pulse_2_", this.rightBlobPulse); + this._activeEffect.setFloat("_Blob_Fade_2_", this.rightBlobFade); + this._activeEffect.setVector3("_Active_Face_Dir_", this.activeFaceDir); + this._activeEffect.setVector3("_Active_Face_Up_", this.activeFaceUp); + this._activeEffect.setFloat("_Fade_Width_", this.fadeWidth); + this._activeEffect.setFloat("_Smooth_Active_Face_", this.smoothActiveFace ? 1 : 0); + this._activeEffect.setFloat("_Show_Frame_", this.showFrame ? 1 : 0); + this._activeEffect.setFloat("_Use_Blob_Texture_", this.useBlobTexture ? 1 : 0); + this._activeEffect.setFloat("Use_Global_Left_Index", 1); + this._activeEffect.setFloat("Use_Global_Right_Index", 1); + this._activeEffect.setVector4("Global_Left_Index_Tip_Position", new Vector4(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1)); + this._activeEffect.setVector4("Global_Right_Index_Tip_Position", new Vector4(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1)); + this._afterBind(mesh86, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + } + clone(name342) { + return SerializationHelper.Clone(() => new FluentButtonMaterial3(name342, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.FluentButtonMaterial"; + return serializationObject; + } + getClassName() { + return "FluentButtonMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new FluentButtonMaterial3(source.name, scene50), source, scene50, rootUrl); + } +} +var init_fluentButtonMaterial2 = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_texture(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_buffer(); + init_typeStore(); + init_math_color(); + init_effectFallbacks(); + init_constants(); + init_fluentButton_fragment2(); + init_fluentButton_vertex2(); + FluentButtonMaterial3.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-button-blob.png"; + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "edgeWidth", undefined); + __decorate2([ + serializeAsColor4() + ], FluentButtonMaterial3.prototype, "edgeColor", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "proximityMaxIntensity", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "proximityFarDistance", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "proximityNearRadius", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "proximityAnisotropy", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "selectionFuzz", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "selected", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "selectionFade", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "selectionFadeSize", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "selectedDistance", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "selectedFadeLength", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "blobIntensity", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "blobFarSize", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "blobNearDistance", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "blobFarDistance", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "blobFadeLength", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "leftBlobEnable", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "leftBlobNearSize", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "leftBlobPulse", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "leftBlobFade", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "leftBlobInnerFade", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "rightBlobEnable", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "rightBlobNearSize", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "rightBlobPulse", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "rightBlobFade", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "rightBlobInnerFade", undefined); + __decorate2([ + serializeAsVector3() + ], FluentButtonMaterial3.prototype, "activeFaceDir", undefined); + __decorate2([ + serializeAsVector3() + ], FluentButtonMaterial3.prototype, "activeFaceUp", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "enableFade", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "fadeWidth", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "smoothActiveFace", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "showFrame", undefined); + __decorate2([ + serialize() + ], FluentButtonMaterial3.prototype, "useBlobTexture", undefined); + __decorate2([ + serializeAsVector3() + ], FluentButtonMaterial3.prototype, "globalLeftIndexTipPosition", undefined); + __decorate2([ + serializeAsVector3() + ], FluentButtonMaterial3.prototype, "globalRightIndexTipPosition", undefined); + RegisterClass("BABYLON.GUI.FluentButtonMaterial", FluentButtonMaterial3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/touchButton3D.js +class TouchButton3D3 extends Button3D3 { + constructor(name342, collisionMesh) { + super(name342); + this._isNearPressed = false; + this._interactionSurfaceHeight = 0; + this._isToggleButton = false; + this._toggleState = false; + this._toggleButtonCallback = () => { + this._onToggle(!this._toggleState); + }; + this.onToggleObservable = new Observable; + this.collidableFrontDirection = Vector3.Zero(); + if (collisionMesh) { + this.collisionMesh = collisionMesh; + } + } + get isActiveNearInteraction() { + return this._isNearPressed; + } + set collidableFrontDirection(frontWorldDir) { + this._collidableFrontDirection = frontWorldDir.normalize(); + if (this._collisionMesh) { + const invert = TmpVectors.Matrix[0]; + invert.copyFrom(this._collisionMesh.getWorldMatrix()); + invert.invert(); + Vector3.TransformNormalToRef(this._collidableFrontDirection, invert, this._collidableFrontDirection); + this._collidableFrontDirection.normalize(); + } + } + get collidableFrontDirection() { + if (this._collisionMesh) { + const transformedDirection = TmpVectors.Vector3[0]; + Vector3.TransformNormalToRef(this._collidableFrontDirection, this._collisionMesh.getWorldMatrix(), transformedDirection); + return transformedDirection.normalize(); + } + return this._collidableFrontDirection; + } + set collisionMesh(collisionMesh) { + var _a; + if (this._collisionMesh) { + this._collisionMesh.isNearPickable = false; + if ((_a = this._collisionMesh.reservedDataStore) === null || _a === undefined ? undefined : _a.GUI3D) { + this._collisionMesh.reservedDataStore.GUI3D = {}; + } + this._collisionMesh.getChildMeshes().forEach((mesh86) => { + var _a2; + mesh86.isNearPickable = false; + if ((_a2 = mesh86.reservedDataStore) === null || _a2 === undefined ? undefined : _a2.GUI3D) { + mesh86.reservedDataStore.GUI3D = {}; + } + }); + } + this._collisionMesh = collisionMesh; + this._injectGUI3DReservedDataStore(this._collisionMesh).control = this; + this._collisionMesh.isNearPickable = true; + this._collisionMesh.getChildMeshes().forEach((mesh86) => { + this._injectGUI3DReservedDataStore(mesh86).control = this; + mesh86.isNearPickable = true; + }); + this.collidableFrontDirection = collisionMesh.forward; + } + set isToggleButton(value) { + if (value === this._isToggleButton) { + return; + } + this._isToggleButton = value; + if (value) { + this.onPointerUpObservable.add(this._toggleButtonCallback); + } else { + this.onPointerUpObservable.removeCallback(this._toggleButtonCallback); + if (this._toggleState) { + this._onToggle(false); + } + } + } + get isToggleButton() { + return this._isToggleButton; + } + set isToggled(newState) { + if (this._isToggleButton && this._toggleState !== newState) { + this._onToggle(newState); + } + } + get isToggled() { + return this._toggleState; + } + _onToggle(newState) { + this._toggleState = newState; + this.onToggleObservable.notifyObservers(newState); + } + _isInteractionInFrontOfButton(collidablePos) { + return this._getInteractionHeight(collidablePos, this._collisionMesh.getAbsolutePosition()) > 0; + } + getPressDepth(touchPoint) { + if (!this._isNearPressed) { + return 0; + } + const interactionHeight = this._getInteractionHeight(touchPoint, this._collisionMesh.getAbsolutePosition()); + return this._interactionSurfaceHeight - interactionHeight; + } + _getInteractionHeight(interactionPos, basePos) { + const frontDir = this.collidableFrontDirection; + if (frontDir.length() === 0) { + return Vector3.Distance(interactionPos, basePos); + } + const d = Vector3.Dot(basePos, frontDir); + const abc = Vector3.Dot(interactionPos, frontDir); + return abc - d; + } + _generatePointerEventType(providedType, nearMeshPosition, activeInteractionCount) { + if (providedType === PointerEventTypes.POINTERDOWN || providedType === PointerEventTypes.POINTERMOVE) { + if (!this._isInteractionInFrontOfButton(nearMeshPosition)) { + return PointerEventTypes.POINTERMOVE; + } else { + this._isNearPressed = true; + this._interactionSurfaceHeight = this._getInteractionHeight(nearMeshPosition, this._collisionMesh.getAbsolutePosition()); + } + } + if (providedType === PointerEventTypes.POINTERUP) { + if (activeInteractionCount == 0) { + return PointerEventTypes.POINTERMOVE; + } else { + this._isNearPressed = false; + } + } + return providedType; + } + _getTypeName() { + return "TouchButton3D"; + } + _createNode(scene50) { + return super._createNode(scene50); + } + dispose() { + super.dispose(); + this.onPointerUpObservable.removeCallback(this._toggleButtonCallback); + this.onToggleObservable.clear(); + if (this._collisionMesh) { + this._collisionMesh.dispose(); + } + } +} +var init_touchButton3D2 = __esm(() => { + init_math_vector(); + init_pointerEvents(); + init_observable(); + init_button3D2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/touchHolographicButton.js +class TouchHolographicButton5 extends TouchButton3D3 { + _disposeTooltip() { + this._tooltipFade = null; + if (this._tooltipTextBlock) { + this._tooltipTextBlock.dispose(); + } + if (this._tooltipTexture) { + this._tooltipTexture.dispose(); + } + if (this._tooltipMesh) { + this._tooltipMesh.dispose(); + } + this.onPointerEnterObservable.remove(this._tooltipHoverObserver); + this.onPointerOutObservable.remove(this._tooltipOutObserver); + } + set renderingGroupId(id) { + this._backPlate.renderingGroupId = id; + this._textPlate.renderingGroupId = id; + this._frontPlate.renderingGroupId = id; + if (this._tooltipMesh) { + this._tooltipMesh.renderingGroupId = id; + } + } + get renderingGroupId() { + return this._backPlate.renderingGroupId; + } + get mesh() { + return this._backPlate; + } + set tooltipText(text) { + if (!text) { + this._disposeTooltip(); + return; + } + if (!this._tooltipFade) { + const rightHandedScene = this._backPlate._scene.useRightHandedSystem; + this._tooltipMesh = CreatePlane("", { size: 1 }, this._backPlate._scene); + const tooltipBackground = CreatePlane("", { size: 1, sideOrientation: Mesh.DOUBLESIDE }, this._backPlate._scene); + const mat = new StandardMaterial("", this._backPlate._scene); + mat.diffuseColor = Color3.FromHexString("#212121"); + tooltipBackground.material = mat; + tooltipBackground.isPickable = false; + this._tooltipMesh.addChild(tooltipBackground); + tooltipBackground.position = Vector3.Forward(rightHandedScene).scale(0.05); + this._tooltipMesh.scaling.y = 1 / 3; + this._tooltipMesh.position = Vector3.Up().scale(0.7).add(Vector3.Forward(rightHandedScene).scale(-0.15)); + this._tooltipMesh.isPickable = false; + this._tooltipMesh.parent = this._backPlate; + this._tooltipTexture = AdvancedDynamicTexture3.CreateForMesh(this._tooltipMesh); + this._tooltipTextBlock = new TextBlock3; + this._tooltipTextBlock.scaleY = 3; + this._tooltipTextBlock.color = "white"; + this._tooltipTextBlock.fontSize = 130; + this._tooltipTexture.addControl(this._tooltipTextBlock); + this._tooltipFade = new FadeInOutBehavior; + this._tooltipFade.delay = 500; + this._tooltipMesh.addBehavior(this._tooltipFade); + this._tooltipHoverObserver = this.onPointerEnterObservable.add(() => { + if (this._tooltipFade) { + this._tooltipFade.fadeIn(true); + } + }); + this._tooltipOutObserver = this.onPointerOutObservable.add(() => { + if (this._tooltipFade) { + this._tooltipFade.fadeIn(false); + } + }); + } + if (this._tooltipTextBlock) { + this._tooltipTextBlock.text = text; + } + } + get tooltipText() { + if (this._tooltipTextBlock) { + return this._tooltipTextBlock.text; + } + return null; + } + get text() { + return this._text; + } + set text(value) { + if (this._text === value) { + return; + } + this._text = value; + this._rebuildContent(); + } + get imageUrl() { + return this._imageUrl; + } + set imageUrl(value) { + if (this._imageUrl === value) { + return; + } + this._imageUrl = value; + this._rebuildContent(); + } + get backMaterial() { + return this._backMaterial; + } + get frontMaterial() { + return this._frontMaterial; + } + get plateMaterial() { + return this._plateMaterial; + } + get shareMaterials() { + return this._shareMaterials; + } + set isBackplateVisible(isVisible) { + if (this.mesh && !!this._backMaterial) { + if (isVisible && !this._isBackplateVisible) { + this._backPlate.visibility = 1; + } else if (!isVisible && this._isBackplateVisible) { + this._backPlate.visibility = 0; + } + } + this._isBackplateVisible = isVisible; + } + constructor(name342, shareMaterials = true) { + super(name342); + this._shareMaterials = true; + this._isBackplateVisible = true; + this._frontPlateDepth = 0.5; + this._backPlateDepth = 0.04; + this._backplateColor = new Color3(0.08, 0.15, 0.55); + this._backplateToggledColor = new Color3(0.25, 0.4, 0.95); + this._shareMaterials = shareMaterials; + this.pointerEnterAnimation = () => { + this._frontMaterial.leftBlobEnable = true; + this._frontMaterial.rightBlobEnable = true; + }; + this.pointerOutAnimation = () => { + this._frontMaterial.leftBlobEnable = false; + this._frontMaterial.rightBlobEnable = false; + }; + this.pointerDownAnimation = () => { + if (this._frontPlate && !this.isActiveNearInteraction) { + this._frontPlate.scaling.z = this._frontPlateDepth * 0.2; + this._frontPlate.position = Vector3.Forward(this._frontPlate._scene.useRightHandedSystem).scale((this._frontPlateDepth - 0.2 * this._frontPlateDepth) / 2); + this._textPlate.position = Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-(this._backPlateDepth + 0.2 * this._frontPlateDepth) / 2); + } + }; + this.pointerUpAnimation = () => { + if (this._frontPlate) { + this._frontPlate.scaling.z = this._frontPlateDepth; + this._frontPlate.position = Vector3.Forward(this._frontPlate._scene.useRightHandedSystem).scale((this._frontPlateDepth - this._frontPlateDepth) / 2); + this._textPlate.position = Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-(this._backPlateDepth + this._frontPlateDepth) / 2); + } + }; + this.onPointerMoveObservable.add((position3) => { + if (this._frontPlate && this.isActiveNearInteraction) { + const scale = Vector3.Zero(); + if (this._backPlate.getWorldMatrix().decompose(scale, undefined, undefined)) { + let interactionHeight = this._getInteractionHeight(position3, this._backPlate.getAbsolutePosition()) / scale.z; + interactionHeight = Scalar.Clamp(interactionHeight - this._backPlateDepth / 2, 0.2 * this._frontPlateDepth, this._frontPlateDepth); + this._frontPlate.scaling.z = interactionHeight; + this._frontPlate.position = Vector3.Forward(this._frontPlate._scene.useRightHandedSystem).scale((this._frontPlateDepth - interactionHeight) / 2); + this._textPlate.position = Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-(this._backPlateDepth + interactionHeight) / 2); + } + } + }); + this._pointerHoverObserver = this.onPointerMoveObservable.add((hoverPosition) => { + this._frontMaterial.globalLeftIndexTipPosition = hoverPosition; + }); + } + _getTypeName() { + return "TouchHolographicButton"; + } + _rebuildContent() { + this._disposeFacadeTexture(); + const panel = new StackPanel3; + panel.isVertical = true; + if (IsDocumentAvailable() && !!document.createElement) { + if (this._imageUrl) { + const image18 = new Image4; + image18.source = this._imageUrl; + image18.paddingTop = "40px"; + image18.height = "180px"; + image18.width = "100px"; + image18.paddingBottom = "40px"; + panel.addControl(image18); + } + } + if (this._text) { + const text = new TextBlock3; + text.text = this._text; + text.color = "white"; + text.height = "30px"; + text.fontSize = 24; + panel.addControl(text); + } + this.content = panel; + } + _createNode(scene50) { + var _a; + this.name = (_a = this.name) !== null && _a !== undefined ? _a : "TouchHolographicButton"; + const collisionMesh = CreateBox(`${this.name}_collisionMesh`, { + width: 1, + height: 1, + depth: this._frontPlateDepth + }, scene50); + collisionMesh.isPickable = true; + collisionMesh.isNearPickable = true; + collisionMesh.visibility = 0; + collisionMesh.position = Vector3.Forward(scene50.useRightHandedSystem).scale(-this._frontPlateDepth / 2); + SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton5.MODEL_BASE_URL, TouchHolographicButton5.MODEL_FILENAME, scene50).then((result) => { + const alphaMesh = CreateBox("${this.name}_alphaMesh", { + width: 1, + height: 1, + depth: 1 + }, scene50); + alphaMesh.isPickable = false; + alphaMesh.material = new StandardMaterial("${this.name}_alphaMesh_material", scene50); + alphaMesh.material.alpha = 0.15; + const importedFrontPlate = result.meshes[1]; + importedFrontPlate.name = `${this.name}_frontPlate`; + importedFrontPlate.isPickable = false; + importedFrontPlate.scaling.z = this._frontPlateDepth; + alphaMesh.parent = importedFrontPlate; + importedFrontPlate.parent = collisionMesh; + if (this._frontMaterial) { + importedFrontPlate.material = this._frontMaterial; + } + this._frontPlate = importedFrontPlate; + }); + this._backPlate = CreateBox(`${this.name}_backPlate`, { + width: 1, + height: 1, + depth: this._backPlateDepth + }, scene50); + this._backPlate.position = Vector3.Forward(scene50.useRightHandedSystem).scale(this._backPlateDepth / 2); + this._backPlate.isPickable = false; + this._textPlate = super._createNode(scene50); + this._textPlate.name = `${this.name}_textPlate`; + this._textPlate.isPickable = false; + this._textPlate.position = Vector3.Forward(scene50.useRightHandedSystem).scale(-this._frontPlateDepth / 2); + this._backPlate.addChild(collisionMesh); + this._backPlate.addChild(this._textPlate); + const tn = new TransformNode(`{this.name}_root`, scene50); + this._backPlate.setParent(tn); + this.collisionMesh = collisionMesh; + this.collidableFrontDirection = this._backPlate.forward.negate(); + return tn; + } + _applyFacade(facadeTexture) { + this._plateMaterial.emissiveTexture = facadeTexture; + this._plateMaterial.opacityTexture = facadeTexture; + this._plateMaterial.diffuseColor = new Color3(0.4, 0.4, 0.4); + } + _createBackMaterial(mesh87) { + this._backMaterial = new FluentMaterial3(this.name + "backPlateMaterial", mesh87.getScene()); + this._backMaterial.albedoColor = this._backplateColor; + this._backMaterial.renderBorders = true; + this._backMaterial.renderHoverLight = false; + } + _createFrontMaterial(mesh87) { + this._frontMaterial = new FluentButtonMaterial3(this.name + "Front Material", mesh87.getScene()); + } + _createPlateMaterial(mesh87) { + this._plateMaterial = new StandardMaterial(this.name + "Plate Material", mesh87.getScene()); + this._plateMaterial.specularColor = Color3.Black(); + } + _onToggle(newState) { + if (this._backMaterial) { + if (newState) { + this._backMaterial.albedoColor = this._backplateToggledColor; + } else { + this._backMaterial.albedoColor = this._backplateColor; + } + } + super._onToggle(newState); + } + _affectMaterial(mesh87) { + if (this._shareMaterials) { + if (!this._host._touchSharedMaterials["backFluentMaterial"]) { + this._createBackMaterial(mesh87); + this._host._touchSharedMaterials["backFluentMaterial"] = this._backMaterial; + } else { + this._backMaterial = this._host._touchSharedMaterials["backFluentMaterial"]; + } + if (!this._host._touchSharedMaterials["frontFluentMaterial"]) { + this._createFrontMaterial(mesh87); + this._host._touchSharedMaterials["frontFluentMaterial"] = this._frontMaterial; + } else { + this._frontMaterial = this._host._touchSharedMaterials["frontFluentMaterial"]; + } + } else { + this._createBackMaterial(mesh87); + this._createFrontMaterial(mesh87); + } + this._createPlateMaterial(mesh87); + this._backPlate.material = this._backMaterial; + this._textPlate.material = this._plateMaterial; + if (!this._isBackplateVisible) { + this._backPlate.visibility = 0; + } + if (this._frontPlate) { + this._frontPlate.material = this._frontMaterial; + } + this._rebuildContent(); + } + dispose() { + super.dispose(); + this._disposeTooltip(); + this.onPointerMoveObservable.remove(this._pointerHoverObserver); + if (!this.shareMaterials) { + this._backMaterial.dispose(); + this._frontMaterial.dispose(); + this._plateMaterial.dispose(); + if (this._pickedPointObserver) { + this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver); + this._pickedPointObserver = null; + } + } + } +} +var init_touchHolographicButton3 = __esm(() => { + init_math_vector(); + init_standardMaterial(); + init_transformNode(); + init_mesh(); + init_planeBuilder(); + init_boxBuilder(); + init_fadeInOutBehavior(); + init_fluentMaterial2(); + init_fluentButtonMaterial2(); + init_stackPanel2(); + init_image2(); + init_textBlock2(); + init_advancedDynamicTexture2(); + init_math_color(); + init_touchButton3D2(); + init_sceneLoader(); + init_domManagement(); + init_math_scalar(); + TouchHolographicButton5.MODEL_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/"; + TouchHolographicButton5.MODEL_FILENAME = "mrtk-fluent-button.glb"; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/behaviors/defaultBehavior.js +class DefaultBehavior3 { + constructor() { + this.followBehaviorEnabled = false; + this.sixDofDragBehaviorEnabled = true; + this.surfaceMagnetismBehaviorEnabled = true; + this._followBehavior = new FollowBehavior; + this._sixDofDragBehavior = new SixDofDragBehavior; + this._surfaceMagnetismBehavior = new SurfaceMagnetismBehavior; + } + get name() { + return "Default"; + } + get followBehavior() { + return this._followBehavior; + } + get sixDofDragBehavior() { + return this._sixDofDragBehavior; + } + get surfaceMagnetismBehavior() { + return this._surfaceMagnetismBehavior; + } + init() { + } + attach(ownerMesh, draggablesMeshes, sceneUnderstandingMeshes) { + this._scene = ownerMesh.getScene(); + this.attachedNode = ownerMesh; + this._addObservables(); + this._followBehavior.attach(ownerMesh); + this._sixDofDragBehavior.attach(ownerMesh); + this._sixDofDragBehavior.draggableMeshes = draggablesMeshes || null; + this._sixDofDragBehavior.faceCameraOnDragStart = true; + this._surfaceMagnetismBehavior.attach(ownerMesh, this._scene); + if (sceneUnderstandingMeshes) { + this._surfaceMagnetismBehavior.meshes = sceneUnderstandingMeshes; + } + this._surfaceMagnetismBehavior.enabled = false; + } + detach() { + this.attachedNode = null; + this._removeObservables(); + this._followBehavior.detach(); + this._sixDofDragBehavior.detach(); + this._surfaceMagnetismBehavior.detach(); + } + _addObservables() { + this._onBeforeRenderObserver = this._scene.onBeforeRenderObservable.add(() => { + this._followBehavior._enabled = !this._sixDofDragBehavior.isMoving && this.followBehaviorEnabled; + }); + this._onDragObserver = this._sixDofDragBehavior.onDragObservable.add((event) => { + this._sixDofDragBehavior.disableMovement = this._surfaceMagnetismBehavior.findAndUpdateTarget(event.pickInfo); + }); + } + _removeObservables() { + this._scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserver); + this._sixDofDragBehavior.onDragObservable.remove(this._onDragObserver); + } +} +var init_defaultBehavior2 = __esm(() => { + init_followBehavior(); + init_sixDofDragBehavior(); + init_surfaceMagnetismBehavior(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/handle/shaders/handle.vertex.js +var name342, shader339; +var init_handle_vertex2 = __esm(() => { + init_shaderStore(); + name342 = "handleVertexShader"; + shader339 = `precision highp float;attribute vec3 position;uniform vec3 positionOffset;uniform mat4 worldViewProjection;uniform float scale;void main(void) {vec4 vPos=vec4((vec3(position)+positionOffset)*scale,1.0);gl_Position=worldViewProjection*vPos;}`; + ShaderStore.ShadersStore[name342] = shader339; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/handle/shaders/handle.fragment.js +var name343, shader340; +var init_handle_fragment2 = __esm(() => { + init_shaderStore(); + name343 = "handlePixelShader"; + shader340 = `uniform vec3 color;void main(void) {gl_FragColor=vec4(color,1.0);}`; + ShaderStore.ShadersStore[name343] = shader340; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/handle/handleMaterial.js +class HandleMaterial3 extends ShaderMaterial { + get hover() { + return this._hover; + } + set hover(b) { + this._hover = b; + this._updateInterpolationTarget(); + } + get drag() { + return this._drag; + } + set drag(b) { + this._drag = b; + this._updateInterpolationTarget(); + } + constructor(name344, scene50) { + super(name344, scene50, "handle", { + attributes: ["position"], + uniforms: ["worldViewProjection", "color", "scale", "positionOffset"], + needAlphaBlending: false, + needAlphaTesting: false + }); + this._hover = false; + this._drag = false; + this._color = new Color3; + this._scale = 1; + this._lastTick = -1; + this.animationLength = 100; + this.hoverColor = new Color3(0, 0.467, 0.84); + this.baseColor = new Color3(1, 1, 1); + this.hoverScale = 0.75; + this.baseScale = 0.35; + this.dragScale = 0.55; + this._positionOffset = Vector3.Zero(); + this._updateInterpolationTarget(); + this._lastTick = Date.now(); + this._onBeforeRender = this.getScene().onBeforeRenderObservable.add(() => { + const tick = Date.now(); + const delta = tick - this._lastTick; + const scaleDiff = this._targetScale - this._scale; + const colorDiff = TmpColors.Color3[0].copyFrom(this._targetColor).subtractToRef(this._color, TmpColors.Color3[0]); + this._scale = this._scale + scaleDiff * delta / this.animationLength; + colorDiff.scaleToRef(delta / this.animationLength, colorDiff); + this._color.addToRef(colorDiff, this._color); + this.setColor3("color", this._color); + this.setFloat("scale", this._scale); + this.setVector3("positionOffset", this._positionOffset); + this._lastTick = tick; + }); + } + _updateInterpolationTarget() { + if (this.drag) { + this._targetColor = this.hoverColor; + this._targetScale = this.dragScale; + } else if (this.hover) { + this._targetColor = this.hoverColor; + this._targetScale = this.hoverScale; + } else { + this._targetColor = this.baseColor; + this._targetScale = this.baseScale; + } + } + dispose() { + super.dispose(); + this.getScene().onBeforeRenderObservable.remove(this._onBeforeRender); + } +} +var init_handleMaterial2 = __esm(() => { + init_shaderMaterial(); + init_math_color(); + init_math_vector(); + init_handle_vertex2(); + init_handle_fragment2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/gizmos/gizmoHandle.js +class GizmoHandle3 { + get state() { + return this._state; + } + get gizmo() { + return this._gizmo; + } + set hover(value) { + if (value) { + this._state |= HandleState3.HOVER; + } else { + this._state &= ~HandleState3.HOVER; + } + this._updateMaterial(); + } + set drag(value) { + if (value) { + this._state |= HandleState3.DRAG; + } else { + this._state &= ~HandleState3.DRAG; + } + this._updateMaterial(); + } + constructor(gizmo15, scene50) { + this._state = HandleState3.IDLE; + this._materials = []; + this._scene = scene50; + this._gizmo = gizmo15; + this.node = this.createNode(); + this.node.reservedDataStore = { + handle: this + }; + } + _createMaterial(positionOffset) { + const mat = new HandleMaterial3("handle", this._scene); + if (positionOffset) { + mat._positionOffset = positionOffset; + } + return mat; + } + _updateMaterial() { + const state = this._state; + for (const mat of this._materials) { + mat.hover = false; + mat.drag = false; + } + if (state & HandleState3.DRAG) { + for (const mat of this._materials) { + mat.drag = true; + } + } else if (state & HandleState3.HOVER) { + for (const mat of this._materials) { + mat.hover = true; + } + } + } + setDragBehavior(dragStartFn, dragFn, dragEndFn) { + const dragBehavior = new BaseSixDofDragBehavior; + this._dragBehavior = dragBehavior; + this._dragStartObserver = dragBehavior.onDragStartObservable.add(dragStartFn); + this._draggingObserver = dragBehavior.onDragObservable.add(dragFn); + this._dragEndObserver = dragBehavior.onDragEndObservable.add(dragEndFn); + this._dragBehavior.attach(this.node); + } + dispose() { + this._dragBehavior.onDragStartObservable.remove(this._dragStartObserver); + this._dragBehavior.onDragObservable.remove(this._draggingObserver); + this._dragBehavior.onDragEndObservable.remove(this._dragEndObserver); + this._dragBehavior.detach(); + for (const material30 of this._materials) { + material30.dispose(); + } + this.node.dispose(); + } +} + +class SideHandle3 extends GizmoHandle3 { + createNode() { + const verticalBox = CreateBox("sideVert", { width: 1, height: 10, depth: 0.1 }, this._scene); + const sideNode = new TransformNode("side", this._scene); + verticalBox.parent = sideNode; + const mat = this._createMaterial(); + verticalBox.material = mat; + verticalBox.isNearGrabbable = true; + this._materials.push(mat); + return sideNode; + } +} + +class CornerHandle3 extends GizmoHandle3 { + createNode() { + const horizontalBox = CreateBox("angleHor", { width: 3, height: 1, depth: 0.1 }, this._scene); + const verticalBox = CreateBox("angleVert", { width: 1, height: 3, depth: 0.1 }, this._scene); + const angleNode = new TransformNode("angle", this._scene); + horizontalBox.parent = angleNode; + verticalBox.parent = angleNode; + horizontalBox.material = this._createMaterial(new Vector3(1, 0, 0)); + verticalBox.material = this._createMaterial(new Vector3(0, 1, 0)); + verticalBox.isNearGrabbable = true; + horizontalBox.isNearGrabbable = true; + this._materials.push(horizontalBox.material); + this._materials.push(verticalBox.material); + return angleNode; + } +} +var HandleState3; +var init_gizmoHandle2 = __esm(() => { + init_boxBuilder(); + init_transformNode(); + init_math_vector(); + init_handleMaterial2(); + init_baseSixDofDragBehavior(); + (function(HandleState4) { + HandleState4[HandleState4["IDLE"] = 0] = "IDLE"; + HandleState4[HandleState4["HOVER"] = 1] = "HOVER"; + HandleState4[HandleState4["DRAG"] = 2] = "DRAG"; + })(HandleState3 || (HandleState3 = {})); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/gizmos/slateGizmo.js +class SlateGizmo3 extends Gizmo { + set attachedSlate(control71) { + if (control71) { + this.attachedMesh = control71.mesh; + this.updateBoundingBox(); + this._pickedPointObserver = control71._host.onPickingObservable.add((pickedMesh) => { + if (this._handleHovered && (!pickedMesh || pickedMesh.parent !== this._handleHovered.node)) { + this._handleHovered.hover = false; + this._handleHovered = null; + } + if (pickedMesh && pickedMesh.parent && pickedMesh.parent.reservedDataStore && pickedMesh.parent.reservedDataStore.handle) { + const handle3 = pickedMesh.parent.reservedDataStore.handle; + if (handle3.gizmo === this) { + this._handleHovered = handle3; + this._handleHovered.hover = true; + } + } + }); + } else if (this._attachedSlate) { + this._attachedSlate._host.onPickingObservable.remove(this._pickedPointObserver); + } + this._attachedSlate = control71; + } + get attachedSlate() { + return this._attachedSlate; + } + constructor(utilityLayer) { + super(utilityLayer); + this._boundingDimensions = new Vector3(0, 0, 0); + this._renderObserver = null; + this._tmpQuaternion = new Quaternion; + this._tmpVector = new Vector3(0, 0, 0); + this._corners = []; + this._sides = []; + this._boundingBoxGizmo = { + min: new Vector3, + max: new Vector3 + }; + this._margin = 0.35; + this._handleSize = 0.075; + this._attachedSlate = null; + this._existingSlateScale = new Vector3; + this.fixedScreenSize = false; + this.fixedScreenSizeDistanceFactor = 10; + this._createNode(); + this.updateScale = false; + this._renderObserver = this.gizmoLayer.originalScene.onBeforeRenderObservable.add(() => { + if (this.attachedMesh && !this._existingSlateScale.equals(this.attachedMesh.scaling)) { + this.updateBoundingBox(); + } + }); + } + _createNode() { + this._handlesParent = new TransformNode("handlesParent", this.gizmoLayer.utilityLayerScene); + this._handlesParent.rotationQuaternion = Quaternion.Identity(); + const masksCorners = [ + { + dimensions: new Vector3(-1, -1, 0), + origin: new Vector3(1, 0, 0) + }, + { + dimensions: new Vector3(1, -1, 0), + origin: new Vector3(0, 0, 0) + }, + { + dimensions: new Vector3(1, 1, 0), + origin: new Vector3(0, 1, 0) + }, + { + dimensions: new Vector3(-1, 1, 0), + origin: new Vector3(1, 1, 0) + } + ]; + for (let i = 0;i < 4; i++) { + const corner = new CornerHandle3(this, this.gizmoLayer.utilityLayerScene); + this._corners.push(corner); + corner.node.rotation.z = Math.PI / 2 * i; + corner.node.parent = this._handlesParent; + this._assignDragBehaviorCorners(corner, (originStart, dimensionsStart, offset, masks) => this._moveHandle(originStart, dimensionsStart, offset, masks, true), masksCorners[i]); + } + for (let i = 0;i < 4; i++) { + const side = new SideHandle3(this, this.gizmoLayer.utilityLayerScene); + this._sides.push(side); + side.node.rotation.z = Math.PI / 2 * i; + side.node.parent = this._handlesParent; + this._assignDragBehaviorSides(side, i % 2 === 0 ? new Vector3(0, 1, 0) : new Vector3(1, 0, 0)); + } + this._handlesParent.parent = this._rootMesh; + } + _keepAspectRatio(vector, aspectRatio, invertDiagonal = false) { + const axis = TmpVectors.Vector3[0]; + axis.copyFromFloats(aspectRatio, 1, 0).normalize(); + if (invertDiagonal) { + axis.y *= -1; + } + const dot = Vector3.Dot(vector, axis); + vector.copyFrom(axis).scaleInPlace(dot); + } + _clampDimensions(vector, dimensions, mask, keepAspectRatio = false) { + const impact = TmpVectors.Vector3[0]; + impact.copyFrom(vector).multiplyInPlace(mask); + const clampedDimensions = TmpVectors.Vector3[1]; + clampedDimensions.copyFromFloats(Math.max(this._attachedSlate.minDimensions.x, impact.x + dimensions.x), Math.max(this._attachedSlate.minDimensions.y, impact.y + dimensions.y), 0); + if (keepAspectRatio) { + const ratio = dimensions.x / dimensions.y; + clampedDimensions.x = Math.max(clampedDimensions.x, clampedDimensions.y * ratio); + clampedDimensions.y = Math.max(clampedDimensions.y, clampedDimensions.x / ratio); + } + impact.copyFrom(clampedDimensions).subtractInPlace(dimensions); + vector.x = Math.sign(vector.x) * Math.abs(impact.x); + vector.y = Math.sign(vector.y) * Math.abs(impact.y); + } + _moveHandle(originStart, dimensionsStart, offset, masks, isCorner) { + if (!this._attachedSlate) { + return; + } + if (isCorner) { + const aspectRatio = dimensionsStart.x / dimensionsStart.y; + this._keepAspectRatio(offset, aspectRatio, masks.dimensions.x * masks.dimensions.y < 0); + } + this._clampDimensions(offset, dimensionsStart, masks.dimensions, isCorner); + const offsetOriginMasked = TmpVectors.Vector3[0]; + const offsetDimensionsMasked = TmpVectors.Vector3[1]; + offsetOriginMasked.copyFrom(offset).multiplyInPlace(masks.origin); + offsetDimensionsMasked.copyFrom(offset).multiplyInPlace(masks.dimensions); + this._attachedSlate.origin.copyFrom(originStart).addInPlace(offsetOriginMasked); + this._attachedSlate.dimensions.set(dimensionsStart.x + offsetDimensionsMasked.x, dimensionsStart.y + offsetDimensionsMasked.y); + } + _assignDragBehaviorCorners(handle3, moveFn, masks) { + const dimensionsStart = new Vector3; + const originStart = new Vector3; + const dragOrigin = new Vector3; + const toObjectFrame = new Matrix; + const dragPlaneNormal = new Vector3; + const projectToRef = (position3, normal2, origin, ref) => { + position3.subtractToRef(origin, TmpVectors.Vector3[0]); + const dot = Vector3.Dot(TmpVectors.Vector3[0], normal2); + TmpVectors.Vector3[1].copyFrom(normal2).scaleInPlace(dot); + TmpVectors.Vector3[0].subtractInPlace(TmpVectors.Vector3[1]); + TmpVectors.Vector3[0].addToRef(origin, ref); + }; + const dragStart = (event) => { + if (this.attachedSlate && this.attachedMesh) { + dimensionsStart.set(this.attachedSlate.dimensions.x, this.attachedSlate.dimensions.y, Epsilon); + originStart.copyFrom(this.attachedSlate.origin); + dragOrigin.copyFrom(event.position); + toObjectFrame.copyFrom(this.attachedMesh.computeWorldMatrix(true)); + toObjectFrame.invert(); + this.attachedSlate._followButton.isToggled = false; + Vector3.TransformNormalToRef(Vector3.Forward(), this.attachedMesh.getWorldMatrix(), dragPlaneNormal); + dragPlaneNormal.normalize(); + if (this._handleHovered) { + this._handleDragged = this._handleHovered; + this._handleDragged.drag = true; + } + } + }; + const dragging = (event) => { + if (this.attachedSlate && this.attachedMesh) { + projectToRef(event.position, dragPlaneNormal, dragOrigin, this._tmpVector); + this._tmpVector.subtractInPlace(dragOrigin); + Vector3.TransformNormalToRef(this._tmpVector, toObjectFrame, this._tmpVector); + moveFn(originStart, dimensionsStart, this._tmpVector, masks); + this.attachedSlate._positionElements(); + this.updateBoundingBox(); + } + }; + const dragEnd = () => { + if (this.attachedSlate && this.attachedNode) { + this.attachedSlate._updatePivot(); + if (this._handleDragged) { + this._handleDragged.drag = false; + this._handleDragged = null; + } + } + }; + handle3.setDragBehavior(dragStart, dragging, dragEnd); + } + _assignDragBehaviorSides(handle3, dragPlaneNormal) { + const quaternionOrigin = new Quaternion; + const dragOrigin = new Vector3; + const directionOrigin = new Vector3; + const worldPivot = new Vector3; + const worldPlaneNormal = new Vector3; + const dragStart = (event) => { + if (this.attachedSlate && this.attachedMesh) { + quaternionOrigin.copyFrom(this.attachedMesh.rotationQuaternion); + dragOrigin.copyFrom(event.position); + worldPivot.copyFrom(this.attachedMesh.getAbsolutePivotPoint()); + directionOrigin.copyFrom(dragOrigin).subtractInPlace(worldPivot).normalize(); + this.attachedSlate._followButton.isToggled = false; + Vector3.TransformNormalToRef(dragPlaneNormal, this.attachedMesh.getWorldMatrix(), worldPlaneNormal); + worldPlaneNormal.normalize(); + if (this._handleHovered) { + this._handleDragged = this._handleHovered; + this._handleDragged.drag = true; + } + } + }; + const dragging = (event) => { + if (this.attachedSlate && this.attachedMesh) { + this._tmpVector.copyFrom(event.position); + this._tmpVector.subtractInPlace(worldPivot); + this._tmpVector.normalize(); + const angle = -Vector3.GetAngleBetweenVectorsOnPlane(this._tmpVector, directionOrigin, worldPlaneNormal); + Quaternion.RotationAxisToRef(dragPlaneNormal, angle, this._tmpQuaternion); + quaternionOrigin.multiplyToRef(this._tmpQuaternion, this.attachedMesh.rotationQuaternion); + } + }; + const dragEnd = () => { + if (this.attachedSlate && this.attachedNode) { + this.attachedSlate._updatePivot(); + if (this._handleDragged) { + this._handleDragged.drag = false; + this._handleDragged = null; + } + } + }; + handle3.setDragBehavior(dragStart, dragging, dragEnd); + } + _attachedNodeChanged(value) { + if (value) { + this.updateBoundingBox(); + } + } + updateBoundingBox() { + if (this.attachedMesh) { + PivotTools._RemoveAndStorePivotPoint(this.attachedMesh); + const originalParent = this.attachedMesh.parent; + this.attachedMesh.setParent(null); + this._update(); + if (!this.attachedMesh.rotationQuaternion) { + this.attachedMesh.rotationQuaternion = Quaternion.RotationYawPitchRoll(this.attachedMesh.rotation.y, this.attachedMesh.rotation.x, this.attachedMesh.rotation.z); + } + this._tmpQuaternion.copyFrom(this.attachedMesh.rotationQuaternion); + this._tmpVector.copyFrom(this.attachedMesh.position); + this.attachedMesh.rotationQuaternion.set(0, 0, 0, 1); + this.attachedMesh.position.set(0, 0, 0); + const boundingMinMax = this.attachedMesh.getHierarchyBoundingVectors(); + boundingMinMax.max.subtractToRef(boundingMinMax.min, this._boundingDimensions); + this._boundingBoxGizmo.min = boundingMinMax.min; + this._boundingBoxGizmo.max = boundingMinMax.max; + this._updateHandlesPosition(); + this._updateHandlesScaling(); + this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion); + this.attachedMesh.position.copyFrom(this._tmpVector); + PivotTools._RestorePivotPoint(this.attachedMesh); + this.attachedMesh.setParent(originalParent); + this.attachedMesh.computeWorldMatrix(true); + this._existingSlateScale.copyFrom(this.attachedMesh.scaling); + } + } + _updateHandlesPosition() { + const min = this._boundingBoxGizmo.min.clone(); + const max = this._boundingBoxGizmo.max.clone(); + const handleScaling = this._corners[0].node.scaling.length(); + min.x -= this._margin * handleScaling; + min.y -= this._margin * handleScaling; + max.x += this._margin * handleScaling; + max.y += this._margin * handleScaling; + const center = min.add(max).scaleInPlace(0.5); + this._corners[0].node.position.copyFromFloats(min.x, min.y, 0); + this._corners[1].node.position.copyFromFloats(max.x, min.y, 0); + this._corners[2].node.position.copyFromFloats(max.x, max.y, 0); + this._corners[3].node.position.copyFromFloats(min.x, max.y, 0); + this._sides[0].node.position.copyFromFloats(min.x, center.y, 0); + this._sides[1].node.position.copyFromFloats(center.x, min.y, 0); + this._sides[2].node.position.copyFromFloats(max.x, center.y, 0); + this._sides[3].node.position.copyFromFloats(center.x, max.y, 0); + } + _updateHandlesScaling() { + if (this._attachedSlate && this._attachedSlate.mesh) { + const scaledWidth = this._attachedSlate.mesh.scaling.x * this._attachedSlate.dimensions.x; + const scaledHeight = this._attachedSlate.mesh.scaling.y * this._attachedSlate.dimensions.y; + const scale = Math.min(scaledWidth, scaledHeight) * this._handleSize; + for (let index = 0;index < this._corners.length; index++) { + this._corners[index].node.scaling.setAll(scale); + } + for (let index = 0;index < this._sides.length; index++) { + this._sides[index].node.scaling.setAll(scale); + } + } + } + _update() { + super._update(); + if (!this.gizmoLayer.utilityLayerScene.activeCamera) { + return; + } + if (this._attachedSlate && this._attachedSlate.mesh) { + if (this.fixedScreenSize) { + this._attachedSlate.mesh.absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector); + const distanceFromCamera = this._handleSize * this._tmpVector.length() / this.fixedScreenSizeDistanceFactor; + for (let i = 0;i < this._corners.length; i++) { + this._corners[i].node.scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera); + } + for (let i = 0;i < this._sides.length; i++) { + this._sides[i].node.scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera); + } + } + this._updateHandlesPosition(); + } + } + dispose() { + this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver); + super.dispose(); + for (const corner of this._corners) { + corner.dispose(); + } + for (const side of this._sides) { + side.dispose(); + } + } +} +var init_slateGizmo2 = __esm(() => { + init_gizmo(); + init_math_constants(); + init_math_vector(); + init_transformNode(); + init_pivotTools(); + init_gizmoHandle2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/holographicSlate.js +class HolographicSlate3 extends ContentDisplay3D3 { + get defaultBehavior() { + return this._defaultBehavior; + } + get dimensions() { + return this._dimensions; + } + set dimensions(value) { + let scale = 1; + if (value.x < this.minDimensions.x || value.y < this.minDimensions.y) { + const newRatio = value.x / value.y; + const minRatio = this.minDimensions.x / this.minDimensions.y; + if (minRatio > newRatio) { + scale = this.minDimensions.x / value.x; + } else { + scale = this.minDimensions.y / value.y; + } + } + this._dimensions.copyFrom(value).scaleInPlace(scale); + this._updatePivot(); + this._positionElements(); + } + get titleBarHeight() { + return this._titleBarHeight; + } + set titleBarHeight(value) { + this._titleBarHeight = value; + } + set renderingGroupId(id) { + this._titleBar.renderingGroupId = id; + this._titleBarTitle.renderingGroupId = id; + this._contentPlate.renderingGroupId = id; + this._backPlate.renderingGroupId = id; + } + get renderingGroupId() { + return this._titleBar.renderingGroupId; + } + set title(title) { + this._titleText = title; + if (this._titleTextComponent) { + this._titleTextComponent.text = title; + } + } + get title() { + return this._titleText; + } + constructor(name344) { + super(name344); + this.titleBarMargin = 0.005; + this.origin = new Vector3(0, 0, 0); + this._dimensions = new Vector2(21.875, 12.5); + this._titleBarHeight = 0.625; + this._titleText = ""; + this._contentScaleRatio = 1; + this.minDimensions = new Vector2(15.625, 6.25); + this.defaultDimensions = this._dimensions.clone(); + this._followButton = new TouchHolographicButton5("followButton" + this.name); + this._followButton.isToggleButton = true; + this._closeButton = new TouchHolographicButton5("closeButton" + this.name); + this._contentViewport = new Viewport(0, 0, 1, 1); + this._contentDragBehavior = new PointerDragBehavior({ + dragPlaneNormal: new Vector3(0, 0, -1) + }); + } + _applyFacade(facadeTexture) { + this._contentMaterial.albedoTexture = facadeTexture; + this._resetContentPositionAndZoom(); + this._applyContentViewport(); + facadeTexture.attachToMesh(this._contentPlate, true); + } + _addControl(control72) { + control72._host = this._host; + if (this._host.utilityLayer) { + control72._prepareNode(this._host.utilityLayer.utilityLayerScene); + } + } + _getTypeName() { + return "HolographicSlate"; + } + _positionElements() { + const followButton = this._followButton; + const closeButton = this._closeButton; + const titleBar = this._titleBar; + const titleBarTitle = this._titleBarTitle; + const contentPlate = this._contentPlate; + const backPlate = this._backPlate; + if (followButton && closeButton && titleBar) { + closeButton.scaling.setAll(this.titleBarHeight); + followButton.scaling.setAll(this.titleBarHeight); + closeButton.position.copyFromFloats(this.dimensions.x - this.titleBarHeight / 2, -this.titleBarHeight / 2, 0).addInPlace(this.origin); + followButton.position.copyFromFloats(this.dimensions.x - 3 * this.titleBarHeight / 2, -this.titleBarHeight / 2, 0).addInPlace(this.origin); + const contentPlateHeight = this.dimensions.y - this.titleBarHeight - this.titleBarMargin; + const rightHandScene = contentPlate.getScene().useRightHandedSystem; + titleBar.scaling.set(this.dimensions.x, this.titleBarHeight, Epsilon); + titleBarTitle.scaling.set(this.dimensions.x - 2 * this.titleBarHeight, this.titleBarHeight, Epsilon); + contentPlate.scaling.copyFromFloats(this.dimensions.x, contentPlateHeight, Epsilon); + backPlate.scaling.copyFromFloats(this.dimensions.x, contentPlateHeight, Epsilon); + titleBar.position.copyFromFloats(this.dimensions.x / 2, -(this.titleBarHeight / 2), 0).addInPlace(this.origin); + titleBarTitle.position.copyFromFloats(this.dimensions.x / 2 - this.titleBarHeight, -(this.titleBarHeight / 2), rightHandScene ? Epsilon : -Epsilon).addInPlace(this.origin); + contentPlate.position.copyFromFloats(this.dimensions.x / 2, -(this.titleBarHeight + this.titleBarMargin + contentPlateHeight / 2), 0).addInPlace(this.origin); + backPlate.position.copyFromFloats(this.dimensions.x / 2, -(this.titleBarHeight + this.titleBarMargin + contentPlateHeight / 2), rightHandScene ? -Epsilon : Epsilon).addInPlace(this.origin); + this._titleTextComponent.host.scaleTo(HolographicSlate3._DEFAULT_TEXT_RESOLUTION_Y * titleBarTitle.scaling.x / titleBarTitle.scaling.y, HolographicSlate3._DEFAULT_TEXT_RESOLUTION_Y); + const aspectRatio = this.dimensions.x / contentPlateHeight; + this._contentViewport.width = this._contentScaleRatio; + this._contentViewport.height = this._contentScaleRatio / aspectRatio; + this._applyContentViewport(); + if (this._gizmo) { + this._gizmo.updateBoundingBox(); + } + } + } + _applyContentViewport() { + var _a; + if (((_a = this._contentPlate) === null || _a === undefined ? undefined : _a.material) && this._contentPlate.material.albedoTexture) { + const tex = this._contentPlate.material.albedoTexture; + tex.uScale = this._contentScaleRatio; + tex.vScale = this._contentScaleRatio / this._contentViewport.width * this._contentViewport.height; + tex.uOffset = this._contentViewport.x; + tex.vOffset = this._contentViewport.y; + } + } + _resetContentPositionAndZoom() { + this._contentViewport.x = 0; + this._contentViewport.y = 1 - this._contentViewport.height / this._contentViewport.width; + this._contentScaleRatio = 1; + } + _updatePivot() { + if (!this.mesh) { + return; + } + const center = new Vector3(this.dimensions.x * 0.5, -this.dimensions.y * 0.5, Epsilon); + center.addInPlace(this.origin); + center.z = 0; + const origin = new Vector3(0, 0, 0); + Vector3.TransformCoordinatesToRef(origin, this.mesh.computeWorldMatrix(true), origin); + this.mesh.setPivotPoint(center); + const origin2 = new Vector3(0, 0, 0); + Vector3.TransformCoordinatesToRef(origin2, this.mesh.computeWorldMatrix(true), origin2); + this.mesh.position.addInPlace(origin).subtractInPlace(origin2); + } + _createNode(scene50) { + const node30 = new Mesh("slate_" + this.name, scene50); + this._titleBar = CreateBox("titleBar_" + this.name, { size: 1 }, scene50); + this._titleBarTitle = CreatePlane("titleText_" + this.name, { size: 1 }, scene50); + this._titleBarTitle.parent = node30; + this._titleBarTitle.isPickable = false; + const adt = AdvancedDynamicTexture3.CreateForMesh(this._titleBarTitle); + this._titleTextComponent = new TextBlock3("titleText_" + this.name, this._titleText); + this._titleTextComponent.textWrapping = TextWrapping3.Ellipsis; + this._titleTextComponent.textHorizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + this._titleTextComponent.color = "white"; + this._titleTextComponent.fontSize = HolographicSlate3._DEFAULT_TEXT_RESOLUTION_Y / 2; + this._titleTextComponent.paddingLeft = HolographicSlate3._DEFAULT_TEXT_RESOLUTION_Y / 4; + adt.addControl(this._titleTextComponent); + if (scene50.useRightHandedSystem) { + const faceUV = new Vector4(0, 0, 1, 1); + this._contentPlate = CreatePlane("contentPlate_" + this.name, { size: 1, sideOrientation: VertexData.BACKSIDE, frontUVs: faceUV }, scene50); + this._backPlate = CreatePlane("backPlate_" + this.name, { size: 1, sideOrientation: VertexData.FRONTSIDE }, scene50); + } else { + const faceUV = new Vector4(0, 0, 1, 1); + this._contentPlate = CreatePlane("contentPlate_" + this.name, { size: 1, sideOrientation: VertexData.FRONTSIDE, frontUVs: faceUV }, scene50); + this._backPlate = CreatePlane("backPlate_" + this.name, { size: 1, sideOrientation: VertexData.BACKSIDE }, scene50); + } + this._titleBar.parent = node30; + this._titleBar.isNearGrabbable = true; + this._contentPlate.parent = node30; + this._backPlate.parent = node30; + this._attachContentPlateBehavior(); + this._addControl(this._followButton); + this._addControl(this._closeButton); + const followButton = this._followButton; + const closeButton = this._closeButton; + followButton.node.parent = node30; + closeButton.node.parent = node30; + this._positionElements(); + this._followButton.imageUrl = HolographicSlate3.ASSETS_BASE_URL + HolographicSlate3.FOLLOW_ICON_FILENAME; + this._closeButton.imageUrl = HolographicSlate3.ASSETS_BASE_URL + HolographicSlate3.CLOSE_ICON_FILENAME; + this._followButton.isBackplateVisible = false; + this._closeButton.isBackplateVisible = false; + this._followButton.onToggleObservable.add((isToggled) => { + this._defaultBehavior.followBehaviorEnabled = isToggled; + if (this._defaultBehavior.followBehaviorEnabled) { + this._defaultBehavior.followBehavior.recenter(); + } + }); + this._closeButton.onPointerClickObservable.add(() => { + this.dispose(); + }); + node30.rotationQuaternion = Quaternion.Identity(); + node30.isVisible = false; + return node30; + } + _attachContentPlateBehavior() { + this._contentDragBehavior.attach(this._contentPlate); + this._contentDragBehavior.moveAttached = false; + this._contentDragBehavior.useObjectOrientationForDragging = true; + this._contentDragBehavior.updateDragPlane = false; + const origin = new Vector3; + const worldDimensions = new Vector3; + const upWorld = new Vector3; + const rightWorld = new Vector3; + const projectedOffset = new Vector2; + let startViewport; + let worldMatrix; + this._contentDragBehavior.onDragStartObservable.add((event) => { + if (!this.node) { + return; + } + startViewport = this._contentViewport.clone(); + worldMatrix = this.node.computeWorldMatrix(true); + origin.copyFrom(event.dragPlanePoint); + worldDimensions.set(this.dimensions.x, this.dimensions.y, Epsilon); + worldDimensions.y -= this.titleBarHeight + this.titleBarMargin; + Vector3.TransformNormalToRef(worldDimensions, worldMatrix, worldDimensions); + upWorld.copyFromFloats(0, 1, 0); + Vector3.TransformNormalToRef(upWorld, worldMatrix, upWorld); + rightWorld.copyFromFloats(1, 0, 0); + Vector3.TransformNormalToRef(rightWorld, worldMatrix, rightWorld); + upWorld.normalize(); + upWorld.scaleInPlace(1 / Vector3.Dot(upWorld, worldDimensions)); + rightWorld.normalize(); + rightWorld.scaleInPlace(1 / Vector3.Dot(rightWorld, worldDimensions)); + }); + const offset = new Vector3; + this._contentDragBehavior.onDragObservable.add((event) => { + offset.copyFrom(event.dragPlanePoint); + offset.subtractInPlace(origin); + projectedOffset.copyFromFloats(Vector3.Dot(offset, rightWorld), Vector3.Dot(offset, upWorld)); + this._contentViewport.x = Scalar.Clamp(startViewport.x - offset.x, 0, 1 - this._contentViewport.width * this._contentScaleRatio); + this._contentViewport.y = Scalar.Clamp(startViewport.y - offset.y, 0, 1 - this._contentViewport.height * this._contentScaleRatio); + this._applyContentViewport(); + }); + } + _affectMaterial(mesh88) { + this._titleBarMaterial = new FluentBackplateMaterial3(`${this.name} plateMaterial`, mesh88.getScene()); + this._contentMaterial = new FluentMaterial3(`${this.name} contentMaterial`, mesh88.getScene()); + this._contentMaterial.renderBorders = true; + this._backMaterial = new FluentBackplateMaterial3(`${this.name} backPlate`, mesh88.getScene()); + this._backMaterial.lineWidth = Epsilon; + this._backMaterial.radius = 0.005; + this._backMaterial.backFaceCulling = true; + this._titleBar.material = this._titleBarMaterial; + this._contentPlate.material = this._contentMaterial; + this._backPlate.material = this._backMaterial; + this._resetContent(); + this._applyContentViewport(); + } + _prepareNode(scene50) { + super._prepareNode(scene50); + this._gizmo = new SlateGizmo3(this._host.utilityLayer); + this._gizmo.attachedSlate = this; + this._defaultBehavior = new DefaultBehavior3; + this._defaultBehavior.attach(this.node, [this._titleBar]); + this._defaultBehavior.sixDofDragBehavior.onDragStartObservable.add(() => { + this._followButton.isToggled = false; + }); + this._positionChangedObserver = this._defaultBehavior.sixDofDragBehavior.onPositionChangedObservable.add(() => { + this._gizmo.updateBoundingBox(); + }); + this._updatePivot(); + this.resetDefaultAspectAndPose(false); + } + resetDefaultAspectAndPose(resetAspect = true) { + if (!this._host || !this._host.utilityLayer || !this.node) { + return; + } + const scene50 = this._host.utilityLayer.utilityLayerScene; + const camera34 = scene50.activeCamera; + if (camera34) { + const worldMatrix = camera34.getWorldMatrix(); + const backward = Vector3.TransformNormal(Vector3.Backward(scene50.useRightHandedSystem), worldMatrix); + this.origin.setAll(0); + this._gizmo.updateBoundingBox(); + const pivot = this.node.getAbsolutePivotPoint(); + this.node.position.copyFrom(camera34.position).subtractInPlace(backward).subtractInPlace(pivot); + this.node.rotationQuaternion = Quaternion.FromLookDirectionLH(backward, new Vector3(0, 1, 0)); + if (resetAspect) { + this.dimensions = this.defaultDimensions; + } + } + } + dispose() { + super.dispose(); + this._titleBarMaterial.dispose(); + this._contentMaterial.dispose(); + this._titleBar.dispose(); + this._titleBarTitle.dispose(); + this._contentPlate.dispose(); + this._backPlate.dispose(); + this._followButton.dispose(); + this._closeButton.dispose(); + this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver); + this._defaultBehavior.sixDofDragBehavior.onPositionChangedObservable.remove(this._positionChangedObserver); + this._defaultBehavior.detach(); + this._gizmo.dispose(); + this._contentDragBehavior.detach(); + } +} +var init_holographicSlate2 = __esm(() => { + init_contentDisplay3D2(); + init_touchHolographicButton3(); + init_advancedDynamicTexture2(); + init_control2(); + init_textBlock2(); + init_defaultBehavior2(); + init_slateGizmo2(); + init_fluentMaterial2(); + init_fluentBackplateMaterial2(); + init_pointerDragBehavior(); + init_math(); + init_math_constants(); + init_math_scalar(); + init_math_vector(); + init_math_viewport(); + init_boxBuilder(); + init_planeBuilder(); + init_mesh(); + init_mesh_vertexData(); + HolographicSlate3.ASSETS_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/"; + HolographicSlate3.CLOSE_ICON_FILENAME = "IconClose.png"; + HolographicSlate3.FOLLOW_ICON_FILENAME = "IconFollowMe.png"; + HolographicSlate3._DEFAULT_TEXT_RESOLUTION_Y = 102.4; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/meshButton3D.js +class MeshButton3D2 extends Button3D3 { + constructor(mesh88, name344) { + super(name344); + this._currentMesh = mesh88; + this.pointerEnterAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(1.1); + }; + this.pointerOutAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(1 / 1.1); + }; + this.pointerDownAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(0.95); + }; + this.pointerUpAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(1 / 0.95); + }; + } + _getTypeName() { + return "MeshButton3D"; + } + _createNode(scene50) { + this._currentMesh.getChildMeshes().forEach((mesh88) => { + this._injectGUI3DReservedDataStore(mesh88).control = this; + }); + return this._currentMesh; + } + _affectMaterial(mesh88) { + } +} +var init_meshButton3D2 = __esm(() => { + init_button3D2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/nearMenu.js +class NearMenu3 extends TouchHolographicMenu3 { + get defaultBehavior() { + return this._defaultBehavior; + } + get isPinned() { + return this._isPinned; + } + set isPinned(value) { + if (this._pinButton.isToggled !== value) { + this._pinButton.isToggled = value; + return; + } + this._isPinned = value; + if (value) { + this._defaultBehavior.followBehaviorEnabled = false; + } else { + this._defaultBehavior.followBehaviorEnabled = true; + } + } + _createPinButton(parent) { + const control72 = new TouchHolographicButton5("pin" + this.name, false); + control72.imageUrl = NearMenu3._ASSETS_BASE_URL + NearMenu3._PIN_ICON_FILENAME; + control72.parent = this; + control72._host = this._host; + control72.isToggleButton = true; + control72.onToggleObservable.add((newState) => { + this.isPinned = newState; + }); + if (this._host.utilityLayer) { + control72._prepareNode(this._host.utilityLayer.utilityLayerScene); + control72.scaling.scaleInPlace(TouchHolographicMenu3.MENU_BUTTON_SCALE); + if (control72.node) { + control72.node.parent = parent; + } + } + return control72; + } + _createNode(scene50) { + const node30 = super._createNode(scene50); + this._pinButton = this._createPinButton(node30); + this.isPinned = false; + this._defaultBehavior.attach(node30, [this._backPlate]); + this._defaultBehavior.followBehavior.ignoreCameraPitchAndRoll = true; + this._defaultBehavior.followBehavior.pitchOffset = -15; + this._defaultBehavior.followBehavior.minimumDistance = 0.3; + this._defaultBehavior.followBehavior.defaultDistance = 0.4; + this._defaultBehavior.followBehavior.maximumDistance = 0.6; + this._backPlate.isNearGrabbable = true; + node30.isVisible = false; + return node30; + } + _finalProcessing() { + super._finalProcessing(); + this._pinButton.position.copyFromFloats((this._backPlate.scaling.x + TouchHolographicMenu3.MENU_BUTTON_SCALE) / 2, this._backPlate.scaling.y / 2, 0); + } + constructor(name344) { + super(name344); + this._isPinned = false; + this._defaultBehavior = new DefaultBehavior3; + this._dragObserver = this._defaultBehavior.sixDofDragBehavior.onDragObservable.add(() => { + this.isPinned = true; + }); + this.backPlateMargin = 1; + } + dispose() { + super.dispose(); + this._defaultBehavior.sixDofDragBehavior.onDragObservable.remove(this._dragObserver); + this._defaultBehavior.detach(); + } +} +var init_nearMenu2 = __esm(() => { + init_touchHolographicButton3(); + init_defaultBehavior2(); + init_touchHolographicMenu2(); + NearMenu3._ASSETS_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/"; + NearMenu3._PIN_ICON_FILENAME = "IconPin.png"; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/planePanel.js +class PlanePanel2 extends VolumeBasedPanel3 { + _mapGridNode(control72, nodePosition) { + const mesh88 = control72.mesh; + if (!mesh88) { + return; + } + control72.position = nodePosition.clone(); + const target = TmpVectors.Vector3[0]; + target.copyFrom(nodePosition); + switch (this.orientation) { + case Container3D3.FACEORIGIN_ORIENTATION: + case Container3D3.FACEFORWARD_ORIENTATION: + target.addInPlace(new Vector3(0, 0, 1)); + mesh88.lookAt(target); + break; + case Container3D3.FACEFORWARDREVERSED_ORIENTATION: + case Container3D3.FACEORIGINREVERSED_ORIENTATION: + target.addInPlace(new Vector3(0, 0, -1)); + mesh88.lookAt(target); + break; + } + } +} +var init_planePanel2 = __esm(() => { + init_math_vector(); + init_container3D2(); + init_volumeBasedPanel2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/scatterPanel.js +class ScatterPanel2 extends VolumeBasedPanel3 { + constructor() { + super(...arguments); + this._iteration = 100; + } + get iteration() { + return this._iteration; + } + set iteration(value) { + if (this._iteration === value) { + return; + } + this._iteration = value; + Tools.SetImmediate(() => { + this._arrangeChildren(); + }); + } + _mapGridNode(control72, nodePosition) { + const mesh88 = control72.mesh; + const newPos = this._scatterMapping(nodePosition); + if (!mesh88) { + return; + } + switch (this.orientation) { + case Container3D3.FACEORIGIN_ORIENTATION: + case Container3D3.FACEFORWARD_ORIENTATION: + mesh88.lookAt(new Vector3(0, 0, 1)); + break; + case Container3D3.FACEFORWARDREVERSED_ORIENTATION: + case Container3D3.FACEORIGINREVERSED_ORIENTATION: + mesh88.lookAt(new Vector3(0, 0, -1)); + break; + } + control72.position = newPos; + } + _scatterMapping(source) { + source.x = (1 - Math.random() * 2) * this._cellWidth; + source.y = (1 - Math.random() * 2) * this._cellHeight; + return source; + } + _finalProcessing() { + const meshes = []; + for (const child of this._children) { + if (!child.mesh) { + continue; + } + meshes.push(child.mesh); + } + for (let count = 0;count < this._iteration; count++) { + meshes.sort((a, b) => { + const distance1 = a.position.lengthSquared(); + const distance2 = b.position.lengthSquared(); + if (distance1 < distance2) { + return 1; + } else if (distance1 > distance2) { + return -1; + } + return 0; + }); + const radiusPaddingSquared = Math.pow(this.margin, 2); + const cellSize = Math.max(this._cellWidth, this._cellHeight); + const difference2D = TmpVectors.Vector2[0]; + const difference = TmpVectors.Vector3[0]; + for (let i = 0;i < meshes.length - 1; i++) { + for (let j = i + 1;j < meshes.length; j++) { + if (i != j) { + meshes[j].position.subtractToRef(meshes[i].position, difference); + difference2D.x = difference.x; + difference2D.y = difference.y; + const combinedRadius = cellSize; + let distance = difference2D.lengthSquared() - radiusPaddingSquared; + const minSeparation = Math.min(distance, radiusPaddingSquared); + distance -= minSeparation; + if (distance < Math.pow(combinedRadius, 2)) { + difference2D.normalize(); + difference.scaleInPlace((combinedRadius - Math.sqrt(distance)) * 0.5); + meshes[j].position.addInPlace(difference); + meshes[i].position.subtractInPlace(difference); + } + } + } + } + } + } +} +var init_scatterPanel2 = __esm(() => { + init_tools(); + init_math_vector(); + init_volumeBasedPanel2(); + init_container3D2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js +var name344, shader341; +var init_mrdlSliderBar_fragment2 = __esm(() => { + init_shaderStore(); + name344 = "mrdlSliderBarPixelShader"; + shader341 = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform vec4 Global_Left_Index_Middle_Position;uniform vec4 Global_Right_Index_Middle_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Blob_Fragment_B30( +sampler2D Blob_Texture, +vec4 Blob_Info1, +vec4 Blob_Info2, +out vec4 Blob_Color) +{float k1=dot(Blob_Info1.xy,Blob_Info1.xy);float k2=dot(Blob_Info2.xy,Blob_Info2.xy);vec3 closer=k10.0) {C=mix(H,S,k);} else {C=mix(H,G,k); } +return C;} +void Sky_Environment_B50( +vec3 Normal, +vec3 Reflected, +vec4 Sky_Color, +vec4 Horizon_Color, +vec4 Ground_Color, +float Horizon_Power, +out vec4 Reflected_Color, +out vec4 Indirect_Color) +{Reflected_Color=SampleEnv_Bid50(Reflected,Sky_Color,Horizon_Color,Ground_Color,Horizon_Power);Indirect_Color=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);} +void Min_Segment_Distance_B65( +vec3 P0, +vec3 P1, +vec3 Q0, +vec3 Q1, +out vec3 NearP, +out vec3 NearQ, +out float Distance) +{vec3 u=P1-P0;vec3 v=Q1-Q0;vec3 w=P0-Q0;float a=dot(u,u);float b=dot(u,v);float c=dot(v,v);float d=dot(u,w);float e=dot(v,w);float D=a*c-b*b;float sD=D;float tD=D;float sc,sN,tc,tN;if (D<0.00001) {sN=0.0;sD=1.0;tN=e;tD=c;} else {sN=(b*e-c*d);tN=(a*e-b*d);if (sN<0.0) {sN=0.0;tN=e;tD=c;} else if (sN>sD) {sN=sD;tN=e+b;tD=c;}} +if (tN<0.0) {tN=0.0;if (-d<0.0) {sN=0.0;} else if (-d>a) {sN=sD;} else {sN=-d;sD=a;}} else if (tN>tD) {tN=tD;if ((-d+b)<0.0) {sN=0.0;} else if ((-d+b)>a) {sN=sD;} else {sN=(-d+b);sD=a;}} +sc=abs(sN)<0.000001 ? 0.0 : sN/sD;tc=abs(tN)<0.000001 ? 0.0 : tN/tD;NearP=P0+sc*u;NearQ=Q0+tc*v;Distance=distance(NearP,NearQ);} +void To_XYZ_B74( +vec3 Vec3, +out float X, +out float Y, +out float Z) +{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;} +void Finger_Positions_B64( +vec3 Left_Index_Pos, +vec3 Right_Index_Pos, +vec3 Left_Index_Middle_Pos, +vec3 Right_Index_Middle_Pos, +out vec3 Left_Index, +out vec3 Right_Index, +out vec3 Left_Index_Middle, +out vec3 Right_Index_Middle) +{Left_Index= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Left_Index_Pos);Right_Index= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Right_Index_Pos);Left_Index_Middle= (Use_Global_Left_Index ? Global_Left_Index_Middle_Position.xyz : Left_Index_Middle_Pos);Right_Index_Middle= (Use_Global_Right_Index ? Global_Right_Index_Middle_Position.xyz : Right_Index_Middle_Pos);} +void VaryHSV_B108( +vec3 HSV_In, +float Hue_Shift, +float Saturation_Shift, +float Value_Shift, +out vec3 HSV_Out) +{HSV_Out=vec3(fract(HSV_In.x+Hue_Shift),clamp(HSV_In.y+Saturation_Shift,0.0,1.0),clamp(HSV_In.z+Value_Shift,0.0,1.0));} +void Remap_Range_B114( +float In_Min, +float In_Max, +float Out_Min, +float Out_Max, +float In, +out float Out) +{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));} +void To_HSV_B75( +vec4 Color, +out float Hue, +out float Saturation, +out float Value, +out float Alpha, +out vec3 HSV) +{vec4 K=vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);vec4 p=Color.g { + init_shaderStore(); + name345 = "mrdlSliderBarVertexShader"; + shader342 = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv; +#ifdef TANGENT +attribute vec3 tangent; +#else +const vec3 tangent=vec3(0.); +#endif +uniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Object_To_World_Pos_B12( +vec3 Pos_Object, +out vec3 Pos_World) +{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;} +void Object_To_World_Normal_B32( +vec3 Nrm_Object, +out vec3 Nrm_World) +{Nrm_World=(vec4(Nrm_Object,0.0)).xyz;} +void Blob_Vertex_B23( +vec3 Position, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +vec3 Blob_Position, +float Intensity, +float Blob_Near_Size, +float Blob_Far_Size, +float Blob_Near_Distance, +float Blob_Far_Distance, +float Blob_Fade_Length, +float Blob_Pulse, +float Blob_Fade, +out vec4 Blob_Info) +{vec3 blob= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Blob_Position);vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);} +void Blob_Vertex_B24( +vec3 Position, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +vec3 Blob_Position, +float Intensity, +float Blob_Near_Size, +float Blob_Far_Size, +float Blob_Near_Distance, +float Blob_Far_Distance, +float Blob_Fade_Length, +float Blob_Pulse, +float Blob_Fade, +out vec4 Blob_Info) +{vec3 blob= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Blob_Position);vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);} +void Move_Verts_B130( +float Anisotropy, +vec3 P, +float Radius, +float Bevel, +vec3 Normal_Object, +float ScaleZ, +float Stretch, +out vec3 New_P, +out vec2 New_UV, +out float Radial_Gradient, +out vec3 Radial_Dir, +out vec3 New_Normal) +{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;float deltad=(length(delta)*2.0);float f=(Bevel+(Radius-Bevel)*Stretch)/Radius;float innerd=clamp(deltad*2.0,0.0,1.0);float outerd=clamp(deltad*2.0-1.0,0.0,1.0);float bevelAngle=outerd*3.14159*0.5;float sinb=sin(bevelAngle);float cosb=cos(bevelAngle);float beveld=(1.0-f)*innerd+f*sinb;float br=outerd;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);float dir=P.z<0.0001 ? 1.0 : -1.0;New_UV=center+r2*((0.5-center)+normalize(delta+vec2(0.0,0.000001))*beveld*0.5);New_P=vec3(New_UV-0.5,P.z+dir*(1.0-cosb)*Bevel*ScaleZ);Radial_Gradient=clamp((deltad-0.5)*2.0,0.0,1.0);Radial_Dir=vec3(delta*r2,0.0);vec3 beveledNormal=cosb*Normal_Object+sinb*vec3(delta.x,delta.y,0.0);New_Normal=Normal_Object.z==0.0 ? Normal_Object : beveledNormal;} +void Object_To_World_Dir_B60( +vec3 Dir_Object, +out vec3 Normal_World, +out vec3 Normal_World_N, +out float Normal_Length) +{Normal_World=(world*vec4(Dir_Object,0.0)).xyz;Normal_Length=length(Normal_World);Normal_World_N=Normal_World/Normal_Length;} +void To_XYZ_B78( +vec3 Vec3, +out float X, +out float Y, +out float Z) +{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;} +void Conditional_Float_B93( +bool Which, +float If_True, +float If_False, +out float Result) +{Result=Which ? If_True : If_False;} +void Object_To_World_Dir_B28( +vec3 Dir_Object, +out vec3 Binormal_World, +out vec3 Binormal_World_N, +out float Binormal_Length) +{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;} +void Pick_Radius_B69( +float Radius, +float Radius_Top_Left, +float Radius_Top_Right, +float Radius_Bottom_Left, +float Radius_Bottom_Right, +vec3 Position, +out float Result) +{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;} +void Conditional_Float_B36( +bool Which, +float If_True, +float If_False, +out float Result) +{Result=Which ? If_True : If_False;} +void Greater_Than_B37( +float Left, +float Right, +out bool Not_Greater_Than, +out bool Greater_Than) +{Greater_Than=Left>Right;Not_Greater_Than=!Greater_Than;} +void Remap_Range_B105( +float In_Min, +float In_Max, +float Out_Min, +float Out_Max, +float In, +out float Out) +{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));} +void main() +{vec2 XY_Q85;XY_Q85=(uv-vec2(0.5,0.5))*_Decal_Scale_XY_+vec2(0.5,0.5);vec3 Tangent_World_Q27;vec3 Tangent_World_N_Q27;float Tangent_Length_Q27;Tangent_World_Q27=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q27=length(Tangent_World_Q27);Tangent_World_N_Q27=Tangent_World_Q27/Tangent_Length_Q27;vec3 Normal_World_Q60;vec3 Normal_World_N_Q60;float Normal_Length_Q60;Object_To_World_Dir_B60(vec3(0,0,1),Normal_World_Q60,Normal_World_N_Q60,Normal_Length_Q60);float X_Q78;float Y_Q78;float Z_Q78;To_XYZ_B78(position,X_Q78,Y_Q78,Z_Q78);vec3 Nrm_World_Q26;Nrm_World_Q26=normalize((world*vec4(normal,0.0)).xyz);vec3 Binormal_World_Q28;vec3 Binormal_World_N_Q28;float Binormal_Length_Q28;Object_To_World_Dir_B28(vec3(0,1,0),Binormal_World_Q28,Binormal_World_N_Q28,Binormal_Length_Q28);float Anisotropy_Q29=Tangent_Length_Q27/Binormal_Length_Q28;float Result_Q69;Pick_Radius_B69(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q69);float Anisotropy_Q53=Binormal_Length_Q28/Normal_Length_Q60;bool Not_Greater_Than_Q37;bool Greater_Than_Q37;Greater_Than_B37(Z_Q78,0.0,Not_Greater_Than_Q37,Greater_Than_Q37);vec4 Linear_Q101;Linear_Q101.rgb=clamp(_Left_Color_.rgb*_Left_Color_.rgb,0.0,1.0);Linear_Q101.a=_Left_Color_.a;vec4 Linear_Q102;Linear_Q102.rgb=clamp(_Right_Color_.rgb*_Right_Color_.rgb,0.0,1.0);Linear_Q102.a=_Right_Color_.a;vec3 Difference_Q61=vec3(0,0,0)-Normal_World_N_Q60;vec4 Out_Color_Q34=vec4(X_Q78,Y_Q78,Z_Q78,1);float Result_Q36;Conditional_Float_B36(Greater_Than_Q37,_Bevel_Back_,_Bevel_Front_,Result_Q36);float Result_Q94;Conditional_Float_B36(Greater_Than_Q37,_Bevel_Back_Stretch_,_Bevel_Front_Stretch_,Result_Q94);vec3 New_P_Q130;vec2 New_UV_Q130;float Radial_Gradient_Q130;vec3 Radial_Dir_Q130;vec3 New_Normal_Q130;Move_Verts_B130(Anisotropy_Q29,position,Result_Q69,Result_Q36,normal,Anisotropy_Q53,Result_Q94,New_P_Q130,New_UV_Q130,Radial_Gradient_Q130,Radial_Dir_Q130,New_Normal_Q130);float X_Q98;float Y_Q98;X_Q98=New_UV_Q130.x;Y_Q98=New_UV_Q130.y;vec3 Pos_World_Q12;Object_To_World_Pos_B12(New_P_Q130,Pos_World_Q12);vec3 Nrm_World_Q32;Object_To_World_Normal_B32(New_Normal_Q130,Nrm_World_Q32);vec4 Blob_Info_Q23; +#if BLOB_ENABLE +Blob_Vertex_B23(Pos_World_Q12,Nrm_World_Q26,Tangent_World_N_Q27,Binormal_World_N_Q28,_Blob_Position_,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q23); +#else +Blob_Info_Q23=vec4(0,0,0,0); +#endif +vec4 Blob_Info_Q24; +#if BLOB_ENABLE_2 +Blob_Vertex_B24(Pos_World_Q12,Nrm_World_Q26,Tangent_World_N_Q27,Binormal_World_N_Q28,_Blob_Position_2_,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q24); +#else +Blob_Info_Q24=vec4(0,0,0,0); +#endif +float Out_Q105;Remap_Range_B105(0.0,1.0,0.0,1.0,X_Q98,Out_Q105);float X_Q86;float Y_Q86;float Z_Q86;To_XYZ_B78(Nrm_World_Q32,X_Q86,Y_Q86,Z_Q86);vec4 Color_At_T_Q97=mix(Linear_Q101,Linear_Q102,Out_Q105);float Minus_F_Q87=-Z_Q86;float R_Q99;float G_Q99;float B_Q99;float A_Q99;R_Q99=Color_At_T_Q97.r; G_Q99=Color_At_T_Q97.g; B_Q99=Color_At_T_Q97.b; A_Q99=Color_At_T_Q97.a;float ClampF_Q88=clamp(0.0,Minus_F_Q87,1.0);float Result_Q93;Conditional_Float_B93(_Decal_Front_Only_,ClampF_Q88,1.0,Result_Q93);vec4 Vec4_Q89=vec4(Result_Q93,Radial_Gradient_Q130,G_Q99,B_Q99);vec3 Position=Pos_World_Q12;vec3 Normal=Nrm_World_Q32;vec2 UV=XY_Q85;vec3 Tangent=Tangent_World_N_Q27;vec3 Binormal=Difference_Q61;vec4 Color=Out_Color_Q34;vec4 Extra1=Vec4_Q89;vec4 Extra2=Blob_Info_Q23;vec4 Extra3=Blob_Info_Q24;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}`; + ShaderStore.ShadersStore[name345] = shader342; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/mrdl/mrdlSliderBarMaterial.js +class MRDLSliderBarMaterialDefines3 extends MaterialDefines { + constructor() { + super(); + this.SKY_ENABLED = true; + this.BLOB_ENABLE_2 = true; + this.IRIDESCENCE_ENABLED = true; + this._needNormals = true; + this._needUVs = true; + this.rebuild(); + } +} + +class MRDLSliderBarMaterial3 extends PushMaterial { + constructor(name346, scene50) { + super(name346, scene50); + this.radius = 0.6; + this.bevelFront = 0.6; + this.bevelFrontStretch = 0.077; + this.bevelBack = 0; + this.bevelBackStretch = 0; + this.radiusTopLeft = 1; + this.radiusTopRight = 1; + this.radiusBottomLeft = 1; + this.radiusBottomRight = 1; + this.bulgeEnabled = false; + this.bulgeHeight = -0.323; + this.bulgeRadius = 0.73; + this.sunIntensity = 1.102; + this.sunTheta = 0.76; + this.sunPhi = 0.526; + this.indirectDiffuse = 0.658; + this.albedo = new Color4(0.0117647, 0.505882, 0.996078, 1); + this.specular = 0; + this.shininess = 10; + this.sharpness = 0; + this.subsurface = 0; + this.leftGradientColor = new Color4(0.0117647, 0.505882, 0.996078, 1); + this.rightGradientColor = new Color4(0.0117647, 0.505882, 0.996078, 1); + this.reflection = 0.749; + this.frontReflect = 0; + this.edgeReflect = 0.09; + this.power = 8.13; + this.skyColor = new Color4(0.0117647, 0.964706, 0.996078, 1); + this.horizonColor = new Color4(0.0117647, 0.333333, 0.996078, 1); + this.groundColor = new Color4(0, 0.254902, 0.996078, 1); + this.horizonPower = 1; + this.width = 0.02; + this.fuzz = 0.5; + this.minFuzz = 0.001; + this.clipFade = 0.01; + this.hueShift = 0; + this.saturationShift = 0; + this.valueShift = 0; + this.blobPosition = new Vector3(0, 0, 0.1); + this.blobIntensity = 0.5; + this.blobNearSize = 0.01; + this.blobFarSize = 0.03; + this.blobNearDistance = 0; + this.blobFarDistance = 0.08; + this.blobFadeLength = 0.576; + this.blobPulse = 0; + this.blobFade = 1; + this.blobPosition2 = new Vector3(0.2, 0, 0.1); + this.blobNearSize2 = 0.01; + this.blobPulse2 = 0; + this.blobFade2 = 1; + this.blobTexture = new Texture("", this.getScene()); + this.leftIndexPosition = new Vector3(0, 0, 1); + this.rightIndexPosition = new Vector3(-1, -1, -1); + this.leftIndexMiddlePosition = new Vector3(0, 0, 0); + this.rightIndexMiddlePosition = new Vector3(0, 0, 0); + this.decalScaleXY = new Vector2(1.5, 1.5); + this.decalFrontOnly = true; + this.rimIntensity = 0.287; + this.rimHueShift = 0; + this.rimSaturationShift = 0; + this.rimValueShift = -1; + this.iridescenceIntensity = 0; + this.useGlobalLeftIndex = 1; + this.useGlobalRightIndex = 1; + this.globalLeftIndexTipProximity = 0; + this.globalRightIndexTipProximity = 0; + this.globalLeftIndexTipPosition = new Vector4(0.5, 0, -0.55, 1); + this.globaRightIndexTipPosition = new Vector4(0, 0, 0, 1); + this.globalLeftThumbTipPosition = new Vector4(0.5, 0, -0.55, 1); + this.globalRightThumbTipPosition = new Vector4(0, 0, 0, 1); + this.globalLeftIndexMiddlePosition = new Vector4(0.5, 0, -0.55, 1); + this.globalRightIndexMiddlePosition = new Vector4(0, 0, 0, 1); + this.alphaMode = Constants.ALPHA_DISABLE; + this.backFaceCulling = false; + this._blueGradientTexture = new Texture(MRDLSliderBarMaterial3.BLUE_GRADIENT_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE); + this._decalTexture = new Texture("", this.getScene()); + this._reflectionMapTexture = new Texture("", this.getScene()); + this._indirectEnvTexture = new Texture("", this.getScene()); + } + needAlphaBlending() { + return false; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh88, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new MRDLSliderBarMaterialDefines3; + } + const defines = subMesh11.materialDefines; + const scene50 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene50.getEngine(); + MaterialHelper.PrepareDefinesForAttributes(mesh88, defines, false, false); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + defines.IMAGEPROCESSINGPOSTPROCESS = scene50.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + if (defines.TANGENT) { + attribs.push(VertexBuffer.TangentKind); + } + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "mrdlSliderBar"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "viewProjection", + "cameraPosition", + "_Radius_", + "_Bevel_Front_", + "_Bevel_Front_Stretch_", + "_Bevel_Back_", + "_Bevel_Back_Stretch_", + "_Radius_Top_Left_", + "_Radius_Top_Right_", + "_Radius_Bottom_Left_", + "_Radius_Bottom_Right_", + "_Bulge_Enabled_", + "_Bulge_Height_", + "_Bulge_Radius_", + "_Sun_Intensity_", + "_Sun_Theta_", + "_Sun_Phi_", + "_Indirect_Diffuse_", + "_Albedo_", + "_Specular_", + "_Shininess_", + "_Sharpness_", + "_Subsurface_", + "_Left_Color_", + "_Right_Color_", + "_Reflection_", + "_Front_Reflect_", + "_Edge_Reflect_", + "_Power_", + "_Sky_Color_", + "_Horizon_Color_", + "_Ground_Color_", + "_Horizon_Power_", + "_Reflection_Map_", + "_Indirect_Environment_", + "_Width_", + "_Fuzz_", + "_Min_Fuzz_", + "_Clip_Fade_", + "_Hue_Shift_", + "_Saturation_Shift_", + "_Value_Shift_", + "_Blob_Position_", + "_Blob_Intensity_", + "_Blob_Near_Size_", + "_Blob_Far_Size_", + "_Blob_Near_Distance_", + "_Blob_Far_Distance_", + "_Blob_Fade_Length_", + "_Blob_Pulse_", + "_Blob_Fade_", + "_Blob_Texture_", + "_Blob_Position_2_", + "_Blob_Near_Size_2_", + "_Blob_Pulse_2_", + "_Blob_Fade_2_", + "_Left_Index_Pos_", + "_Right_Index_Pos_", + "_Left_Index_Middle_Pos_", + "_Right_Index_Middle_Pos_", + "_Decal_", + "_Decal_Scale_XY_", + "_Decal_Front_Only_", + "_Rim_Intensity_", + "_Rim_Texture_", + "_Rim_Hue_Shift_", + "_Rim_Saturation_Shift_", + "_Rim_Value_Shift_", + "_Iridescence_Intensity_", + "_Iridescence_Texture_", + "Use_Global_Left_Index", + "Use_Global_Right_Index", + "Global_Left_Index_Tip_Position", + "Global_Right_Index_Tip_Position", + "Global_Left_Thumb_Tip_Position", + "Global_Right_Thumb_Tip_Position", + "Global_Left_Index_Middle_Position;", + "Global_Right_Index_Middle_Position", + "Global_Left_Index_Tip_Proximity", + "Global_Right_Index_Tip_Proximity" + ]; + const samplers = ["_Rim_Texture_", "_Iridescence_Texture_"]; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines, this._materialContext); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh88, subMesh11) { + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix()); + this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera.position); + this._activeEffect.setFloat("_Radius_", this.radius); + this._activeEffect.setFloat("_Bevel_Front_", this.bevelFront); + this._activeEffect.setFloat("_Bevel_Front_Stretch_", this.bevelFrontStretch); + this._activeEffect.setFloat("_Bevel_Back_", this.bevelBack); + this._activeEffect.setFloat("_Bevel_Back_Stretch_", this.bevelBackStretch); + this._activeEffect.setFloat("_Radius_Top_Left_", this.radiusTopLeft); + this._activeEffect.setFloat("_Radius_Top_Right_", this.radiusTopRight); + this._activeEffect.setFloat("_Radius_Bottom_Left_", this.radiusBottomLeft); + this._activeEffect.setFloat("_Radius_Bottom_Right_", this.radiusBottomRight); + this._activeEffect.setFloat("_Bulge_Enabled_", this.bulgeEnabled ? 1 : 0); + this._activeEffect.setFloat("_Bulge_Height_", this.bulgeHeight); + this._activeEffect.setFloat("_Bulge_Radius_", this.bulgeRadius); + this._activeEffect.setFloat("_Sun_Intensity_", this.sunIntensity); + this._activeEffect.setFloat("_Sun_Theta_", this.sunTheta); + this._activeEffect.setFloat("_Sun_Phi_", this.sunPhi); + this._activeEffect.setFloat("_Indirect_Diffuse_", this.indirectDiffuse); + this._activeEffect.setDirectColor4("_Albedo_", this.albedo); + this._activeEffect.setFloat("_Specular_", this.specular); + this._activeEffect.setFloat("_Shininess_", this.shininess); + this._activeEffect.setFloat("_Sharpness_", this.sharpness); + this._activeEffect.setFloat("_Subsurface_", this.subsurface); + this._activeEffect.setDirectColor4("_Left_Color_", this.leftGradientColor); + this._activeEffect.setDirectColor4("_Right_Color_", this.rightGradientColor); + this._activeEffect.setFloat("_Reflection_", this.reflection); + this._activeEffect.setFloat("_Front_Reflect_", this.frontReflect); + this._activeEffect.setFloat("_Edge_Reflect_", this.edgeReflect); + this._activeEffect.setFloat("_Power_", this.power); + this._activeEffect.setDirectColor4("_Sky_Color_", this.skyColor); + this._activeEffect.setDirectColor4("_Horizon_Color_", this.horizonColor); + this._activeEffect.setDirectColor4("_Ground_Color_", this.groundColor); + this._activeEffect.setFloat("_Horizon_Power_", this.horizonPower); + this._activeEffect.setTexture("_Reflection_Map_", this._reflectionMapTexture); + this._activeEffect.setTexture("_Indirect_Environment_", this._indirectEnvTexture); + this._activeEffect.setFloat("_Width_", this.width); + this._activeEffect.setFloat("_Fuzz_", this.fuzz); + this._activeEffect.setFloat("_Min_Fuzz_", this.minFuzz); + this._activeEffect.setFloat("_Clip_Fade_", this.clipFade); + this._activeEffect.setFloat("_Hue_Shift_", this.hueShift); + this._activeEffect.setFloat("_Saturation_Shift_", this.saturationShift); + this._activeEffect.setFloat("_Value_Shift_", this.valueShift); + this._activeEffect.setVector3("_Blob_Position_", this.blobPosition); + this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity); + this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize); + this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize); + this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance); + this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance); + this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength); + this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse); + this._activeEffect.setFloat("_Blob_Fade_", this.blobFade); + this._activeEffect.setTexture("_Blob_Texture_", this.blobTexture); + this._activeEffect.setVector3("_Blob_Position_2_", this.blobPosition2); + this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2); + this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2); + this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2); + this._activeEffect.setVector3("_Left_Index_Pos_", this.leftIndexPosition); + this._activeEffect.setVector3("_Right_Index_Pos_", this.rightIndexPosition); + this._activeEffect.setVector3("_Left_Index_Middle_Pos_", this.leftIndexMiddlePosition); + this._activeEffect.setVector3("_Right_Index_Middle_Pos_", this.rightIndexMiddlePosition); + this._activeEffect.setTexture("_Decal_", this._decalTexture); + this._activeEffect.setVector2("_Decal_Scale_XY_", this.decalScaleXY); + this._activeEffect.setFloat("_Decal_Front_Only_", this.decalFrontOnly ? 1 : 0); + this._activeEffect.setFloat("_Rim_Intensity_", this.rimIntensity); + this._activeEffect.setTexture("_Rim_Texture_", this._blueGradientTexture); + this._activeEffect.setFloat("_Rim_Hue_Shift_", this.rimHueShift); + this._activeEffect.setFloat("_Rim_Saturation_Shift_", this.rimSaturationShift); + this._activeEffect.setFloat("_Rim_Value_Shift_", this.rimValueShift); + this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity); + this._activeEffect.setTexture("_Iridescence_Texture_", this._blueGradientTexture); + this._activeEffect.setFloat("Use_Global_Left_Index", this.useGlobalLeftIndex); + this._activeEffect.setFloat("Use_Global_Right_Index", this.useGlobalRightIndex); + this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this.globalLeftIndexTipPosition); + this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this.globaRightIndexTipPosition); + this._activeEffect.setVector4("Global_Left_Thumb_Tip_Position", this.globalLeftThumbTipPosition); + this._activeEffect.setVector4("Global_Right_Thumb_Tip_Position", this.globalRightThumbTipPosition); + this._activeEffect.setVector4("Global_Left_Index_Middle_Position", this.globalLeftIndexMiddlePosition); + this._activeEffect.setVector4("Global_Right_Index_Middle_Position", this.globalRightIndexMiddlePosition); + this._activeEffect.setFloat("Global_Left_Index_Tip_Proximity", this.globalLeftIndexTipProximity); + this._activeEffect.setFloat("Global_Right_Index_Tip_Proximity", this.globalRightIndexTipProximity); + this._afterBind(mesh88, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + this._reflectionMapTexture.dispose(); + this._indirectEnvTexture.dispose(); + this._blueGradientTexture.dispose(); + this._decalTexture.dispose(); + } + clone(name346) { + return SerializationHelper.Clone(() => new MRDLSliderBarMaterial3(name346, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.MRDLSliderBarMaterial"; + return serializationObject; + } + getClassName() { + return "MRDLSliderBarMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new MRDLSliderBarMaterial3(source.name, scene50), source, scene50, rootUrl); + } +} +var init_mrdlSliderBarMaterial2 = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_texture(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_buffer(); + init_typeStore(); + init_math_color(); + init_effectFallbacks(); + init_constants(); + init_mrdlSliderBar_fragment2(); + init_mrdlSliderBar_vertex2(); + MRDLSliderBarMaterial3.BLUE_GRADIENT_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-blue-gradient.png"; + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "radius", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "bevelFront", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "bevelFrontStretch", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "bevelBack", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "bevelBackStretch", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "radiusTopLeft", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "radiusTopRight", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "radiusBottomLeft", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "radiusBottomRight", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "bulgeEnabled", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "bulgeHeight", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "bulgeRadius", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "sunIntensity", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "sunTheta", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "sunPhi", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "indirectDiffuse", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "albedo", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "specular", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "shininess", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "sharpness", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "subsurface", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "leftGradientColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "rightGradientColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "reflection", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "frontReflect", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "edgeReflect", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "power", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "skyColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "horizonColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "groundColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "horizonPower", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "width", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "fuzz", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "minFuzz", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "clipFade", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "hueShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "saturationShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "valueShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "blobPosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "blobIntensity", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "blobNearSize", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "blobFarSize", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "blobNearDistance", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "blobFarDistance", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "blobFadeLength", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "blobPulse", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "blobFade", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "blobPosition2", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "blobNearSize2", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "blobPulse2", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "blobFade2", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "blobTexture", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "leftIndexPosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "rightIndexPosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "leftIndexMiddlePosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "rightIndexMiddlePosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "decalScaleXY", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "decalFrontOnly", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "rimIntensity", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "rimHueShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "rimSaturationShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "rimValueShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderBarMaterial3.prototype, "iridescenceIntensity", undefined); + RegisterClass("BABYLON.GUI.MRDLSliderBarMaterial", MRDLSliderBarMaterial3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js +var name346, shader343; +var init_mrdlSliderThumb_fragment2 = __esm(() => { + init_shaderStore(); + name346 = "mrdlSliderThumbPixelShader"; + shader343 = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform vec4 Global_Left_Index_Middle_Position;uniform vec4 Global_Right_Index_Middle_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;void Blob_Fragment_B180( +sampler2D Blob_Texture, +vec4 Blob_Info1, +vec4 Blob_Info2, +out vec4 Blob_Color) +{float k1=dot(Blob_Info1.xy,Blob_Info1.xy);float k2=dot(Blob_Info2.xy,Blob_Info2.xy);vec3 closer=k10.0) {C=mix(H,S,k);} else {C=mix(H,G,k); } +return C;} +void Sky_Environment_B200( +vec3 Normal, +vec3 Reflected, +vec4 Sky_Color, +vec4 Horizon_Color, +vec4 Ground_Color, +float Horizon_Power, +out vec4 Reflected_Color, +out vec4 Indirect_Color) +{Reflected_Color=SampleEnv_Bid200(Reflected,Sky_Color,Horizon_Color,Ground_Color,Horizon_Power);Indirect_Color=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);} +void Min_Segment_Distance_B215( +vec3 P0, +vec3 P1, +vec3 Q0, +vec3 Q1, +out vec3 NearP, +out vec3 NearQ, +out float Distance) +{vec3 u=P1-P0;vec3 v=Q1-Q0;vec3 w=P0-Q0;float a=dot(u,u);float b=dot(u,v);float c=dot(v,v);float d=dot(u,w);float e=dot(v,w);float D=a*c-b*b;float sD=D;float tD=D;float sc,sN,tc,tN;if (D<0.00001) {sN=0.0;sD=1.0;tN=e;tD=c;} else {sN=(b*e-c*d);tN=(a*e-b*d);if (sN<0.0) {sN=0.0;tN=e;tD=c;} else if (sN>sD) {sN=sD;tN=e+b;tD=c;}} +if (tN<0.0) {tN=0.0;if (-d<0.0) {sN=0.0;} else if (-d>a) {sN=sD;} else {sN=-d;sD=a;}} else if (tN>tD) {tN=tD;if ((-d+b)<0.0) {sN=0.0;} else if ((-d+b)>a) {sN=sD;} else {sN=(-d+b);sD=a;}} +sc=abs(sN)<0.000001 ? 0.0 : sN/sD;tc=abs(tN)<0.000001 ? 0.0 : tN/tD;NearP=P0+sc*u;NearQ=Q0+tc*v;Distance=distance(NearP,NearQ);} +void To_XYZ_B224( +vec3 Vec3, +out float X, +out float Y, +out float Z) +{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;} +void Finger_Positions_B214( +vec3 Left_Index_Pos, +vec3 Right_Index_Pos, +vec3 Left_Index_Middle_Pos, +vec3 Right_Index_Middle_Pos, +out vec3 Left_Index, +out vec3 Right_Index, +out vec3 Left_Index_Middle, +out vec3 Right_Index_Middle) +{Left_Index= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Left_Index_Pos);Right_Index= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Right_Index_Pos);Left_Index_Middle= (Use_Global_Left_Index ? Global_Left_Index_Middle_Position.xyz : Left_Index_Middle_Pos);Right_Index_Middle= (Use_Global_Right_Index ? Global_Right_Index_Middle_Position.xyz : Right_Index_Middle_Pos);} +void VaryHSV_B258( +vec3 HSV_In, +float Hue_Shift, +float Saturation_Shift, +float Value_Shift, +out vec3 HSV_Out) +{HSV_Out=vec3(fract(HSV_In.x+Hue_Shift),clamp(HSV_In.y+Saturation_Shift,0.0,1.0),clamp(HSV_In.z+Value_Shift,0.0,1.0));} +void Remap_Range_B264( +float In_Min, +float In_Max, +float Out_Min, +float Out_Max, +float In, +out float Out) +{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));} +void To_HSV_B225( +vec4 Color, +out float Hue, +out float Saturation, +out float Value, +out float Alpha, +out vec3 HSV) +{vec4 K=vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);vec4 p=Color.g { + init_shaderStore(); + name347 = "mrdlSliderThumbVertexShader"; + shader344 = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv; +#ifdef TANGENT +attribute vec3 tangent; +#else +const vec3 tangent=vec3(0.); +#endif +uniform float _Radius_;uniform float _Bevel_Front_;uniform float _Bevel_Front_Stretch_;uniform float _Bevel_Back_;uniform float _Bevel_Back_Stretch_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform bool _Bulge_Enabled_;uniform float _Bulge_Height_;uniform float _Bulge_Radius_;uniform float _Sun_Intensity_;uniform float _Sun_Theta_;uniform float _Sun_Phi_;uniform float _Indirect_Diffuse_;uniform vec4 _Albedo_;uniform float _Specular_;uniform float _Shininess_;uniform float _Sharpness_;uniform float _Subsurface_;uniform vec4 _Left_Color_;uniform vec4 _Right_Color_;uniform float _Reflection_;uniform float _Front_Reflect_;uniform float _Edge_Reflect_;uniform float _Power_;uniform vec4 _Sky_Color_;uniform vec4 _Horizon_Color_;uniform vec4 _Ground_Color_;uniform float _Horizon_Power_;uniform sampler2D _Reflection_Map_;uniform sampler2D _Indirect_Environment_;uniform float _Width_;uniform float _Fuzz_;uniform float _Min_Fuzz_;uniform float _Clip_Fade_;uniform float _Hue_Shift_;uniform float _Saturation_Shift_;uniform float _Value_Shift_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform sampler2D _Blob_Texture_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform vec3 _Left_Index_Pos_;uniform vec3 _Right_Index_Pos_;uniform vec3 _Left_Index_Middle_Pos_;uniform vec3 _Right_Index_Middle_Pos_;uniform sampler2D _Decal_;uniform vec2 _Decal_Scale_XY_;uniform bool _Decal_Front_Only_;uniform float _Rim_Intensity_;uniform sampler2D _Rim_Texture_;uniform float _Rim_Hue_Shift_;uniform float _Rim_Saturation_Shift_;uniform float _Rim_Value_Shift_;uniform float _Iridescence_Intensity_;uniform sampler2D _Iridescence_Texture_;uniform bool Use_Global_Left_Index;uniform bool Use_Global_Right_Index;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;uniform vec4 Global_Left_Thumb_Tip_Position;uniform vec4 Global_Right_Thumb_Tip_Position;uniform float Global_Left_Index_Tip_Proximity;uniform float Global_Right_Index_Tip_Proximity;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vColor;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Object_To_World_Pos_B162( +vec3 Pos_Object, +out vec3 Pos_World) +{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;} +void Object_To_World_Normal_B182( +vec3 Nrm_Object, +out vec3 Nrm_World) +{Nrm_World=(vec4(Nrm_Object,0.0)).xyz;} +void Blob_Vertex_B173( +vec3 Position, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +vec3 Blob_Position, +float Intensity, +float Blob_Near_Size, +float Blob_Far_Size, +float Blob_Near_Distance, +float Blob_Far_Distance, +float Blob_Fade_Length, +float Blob_Pulse, +float Blob_Fade, +out vec4 Blob_Info) +{vec3 blob= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Blob_Position);vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);} +void Blob_Vertex_B174( +vec3 Position, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +vec3 Blob_Position, +float Intensity, +float Blob_Near_Size, +float Blob_Far_Size, +float Blob_Near_Distance, +float Blob_Far_Distance, +float Blob_Fade_Length, +float Blob_Pulse, +float Blob_Fade, +out vec4 Blob_Info) +{vec3 blob= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Blob_Position);vec3 delta=blob-Position;float dist=dot(Normal,delta);float lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);float fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;vec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);float Fade=fadeValue*Intensity*Blob_Fade;float Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);Blob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);} +void Move_Verts_B280( +float Anisotropy, +vec3 P, +float Radius, +float Bevel, +vec3 Normal_Object, +float ScaleZ, +float Stretch, +out vec3 New_P, +out vec2 New_UV, +out float Radial_Gradient, +out vec3 Radial_Dir, +out vec3 New_Normal) +{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;float deltad=(length(delta)*2.0);float f=(Bevel+(Radius-Bevel)*Stretch)/Radius;float innerd=clamp(deltad*2.0,0.0,1.0);float outerd=clamp(deltad*2.0-1.0,0.0,1.0);float bevelAngle=outerd*3.14159*0.5;float sinb=sin(bevelAngle);float cosb=cos(bevelAngle);float beveld=(1.0-f)*innerd+f*sinb;float br=outerd;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);float dir=P.z<0.0001 ? 1.0 : -1.0;New_UV=center+r2*((0.5-center)+normalize(delta+vec2(0.0,0.000001))*beveld*0.5);New_P=vec3(New_UV-0.5,P.z+dir*(1.0-cosb)*Bevel*ScaleZ);Radial_Gradient=clamp((deltad-0.5)*2.0,0.0,1.0);Radial_Dir=vec3(delta*r2,0.0);vec3 beveledNormal=cosb*Normal_Object+sinb*vec3(delta.x,delta.y,0.0);New_Normal=Normal_Object.z==0.0 ? Normal_Object : beveledNormal;} +void Object_To_World_Dir_B210( +vec3 Dir_Object, +out vec3 Normal_World, +out vec3 Normal_World_N, +out float Normal_Length) +{Normal_World=(world*vec4(Dir_Object,0.0)).xyz;Normal_Length=length(Normal_World);Normal_World_N=Normal_World/Normal_Length;} +void To_XYZ_B228( +vec3 Vec3, +out float X, +out float Y, +out float Z) +{X=Vec3.x;Y=Vec3.y;Z=Vec3.z;} +void Conditional_Float_B243( +bool Which, +float If_True, +float If_False, +out float Result) +{Result=Which ? If_True : If_False;} +void Object_To_World_Dir_B178( +vec3 Dir_Object, +out vec3 Binormal_World, +out vec3 Binormal_World_N, +out float Binormal_Length) +{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;} +void Pick_Radius_B219( +float Radius, +float Radius_Top_Left, +float Radius_Top_Right, +float Radius_Bottom_Left, +float Radius_Bottom_Right, +vec3 Position, +out float Result) +{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;} +void Conditional_Float_B186( +bool Which, +float If_True, +float If_False, +out float Result) +{Result=Which ? If_True : If_False;} +void Greater_Than_B187( +float Left, +float Right, +out bool Not_Greater_Than, +out bool Greater_Than) +{Greater_Than=Left>Right;Not_Greater_Than=!Greater_Than;} +void Remap_Range_B255( +float In_Min, +float In_Max, +float Out_Min, +float Out_Max, +float In, +out float Out) +{Out=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));} +void main() +{vec2 XY_Q235;XY_Q235=(uv-vec2(0.5,0.5))*_Decal_Scale_XY_+vec2(0.5,0.5);vec3 Tangent_World_Q177;vec3 Tangent_World_N_Q177;float Tangent_Length_Q177;Tangent_World_Q177=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q177=length(Tangent_World_Q177);Tangent_World_N_Q177=Tangent_World_Q177/Tangent_Length_Q177;vec3 Normal_World_Q210;vec3 Normal_World_N_Q210;float Normal_Length_Q210;Object_To_World_Dir_B210(vec3(0,0,1),Normal_World_Q210,Normal_World_N_Q210,Normal_Length_Q210);float X_Q228;float Y_Q228;float Z_Q228;To_XYZ_B228(position,X_Q228,Y_Q228,Z_Q228);vec3 Nrm_World_Q176;Nrm_World_Q176=normalize((world*vec4(normal,0.0)).xyz);vec3 Binormal_World_Q178;vec3 Binormal_World_N_Q178;float Binormal_Length_Q178;Object_To_World_Dir_B178(vec3(0,1,0),Binormal_World_Q178,Binormal_World_N_Q178,Binormal_Length_Q178);float Anisotropy_Q179=Tangent_Length_Q177/Binormal_Length_Q178;float Result_Q219;Pick_Radius_B219(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q219);float Anisotropy_Q203=Binormal_Length_Q178/Normal_Length_Q210;bool Not_Greater_Than_Q187;bool Greater_Than_Q187;Greater_Than_B187(Z_Q228,0.0,Not_Greater_Than_Q187,Greater_Than_Q187);vec4 Linear_Q251;Linear_Q251.rgb=clamp(_Left_Color_.rgb*_Left_Color_.rgb,0.0,1.0);Linear_Q251.a=_Left_Color_.a;vec4 Linear_Q252;Linear_Q252.rgb=clamp(_Right_Color_.rgb*_Right_Color_.rgb,0.0,1.0);Linear_Q252.a=_Right_Color_.a;vec3 Difference_Q211=vec3(0,0,0)-Normal_World_N_Q210;vec4 Out_Color_Q184=vec4(X_Q228,Y_Q228,Z_Q228,1);float Result_Q186;Conditional_Float_B186(Greater_Than_Q187,_Bevel_Back_,_Bevel_Front_,Result_Q186);float Result_Q244;Conditional_Float_B186(Greater_Than_Q187,_Bevel_Back_Stretch_,_Bevel_Front_Stretch_,Result_Q244);vec3 New_P_Q280;vec2 New_UV_Q280;float Radial_Gradient_Q280;vec3 Radial_Dir_Q280;vec3 New_Normal_Q280;Move_Verts_B280(Anisotropy_Q179,position,Result_Q219,Result_Q186,normal,Anisotropy_Q203,Result_Q244,New_P_Q280,New_UV_Q280,Radial_Gradient_Q280,Radial_Dir_Q280,New_Normal_Q280);float X_Q248;float Y_Q248;X_Q248=New_UV_Q280.x;Y_Q248=New_UV_Q280.y;vec3 Pos_World_Q162;Object_To_World_Pos_B162(New_P_Q280,Pos_World_Q162);vec3 Nrm_World_Q182;Object_To_World_Normal_B182(New_Normal_Q280,Nrm_World_Q182);vec4 Blob_Info_Q173; +#if BLOB_ENABLE +Blob_Vertex_B173(Pos_World_Q162,Nrm_World_Q176,Tangent_World_N_Q177,Binormal_World_N_Q178,_Blob_Position_,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q173); +#else +Blob_Info_Q173=vec4(0,0,0,0); +#endif +vec4 Blob_Info_Q174; +#if BLOB_ENABLE_2 +Blob_Vertex_B174(Pos_World_Q162,Nrm_World_Q176,Tangent_World_N_Q177,Binormal_World_N_Q178,_Blob_Position_2_,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q174); +#else +Blob_Info_Q174=vec4(0,0,0,0); +#endif +float Out_Q255;Remap_Range_B255(0.0,1.0,0.0,1.0,X_Q248,Out_Q255);float X_Q236;float Y_Q236;float Z_Q236;To_XYZ_B228(Nrm_World_Q182,X_Q236,Y_Q236,Z_Q236);vec4 Color_At_T_Q247=mix(Linear_Q251,Linear_Q252,Out_Q255);float Minus_F_Q237=-Z_Q236;float R_Q249;float G_Q249;float B_Q249;float A_Q249;R_Q249=Color_At_T_Q247.r; G_Q249=Color_At_T_Q247.g; B_Q249=Color_At_T_Q247.b; A_Q249=Color_At_T_Q247.a;float ClampF_Q238=clamp(0.0,Minus_F_Q237,1.0);float Result_Q243;Conditional_Float_B243(_Decal_Front_Only_,ClampF_Q238,1.0,Result_Q243);vec4 Vec4_Q239=vec4(Result_Q243,Radial_Gradient_Q280,G_Q249,B_Q249);vec3 Position=Pos_World_Q162;vec3 Normal=Nrm_World_Q182;vec2 UV=XY_Q235;vec3 Tangent=Tangent_World_N_Q177;vec3 Binormal=Difference_Q211;vec4 Color=Out_Color_Q184;vec4 Extra1=Vec4_Q239;vec4 Extra2=Blob_Info_Q173;vec4 Extra3=Blob_Info_Q174;gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vColor=Color;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}`; + ShaderStore.ShadersStore[name347] = shader344; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/mrdl/mrdlSliderThumbMaterial.js +class MRDLSliderThumbMaterialDefines3 extends MaterialDefines { + constructor() { + super(); + this.SKY_ENABLED = true; + this.BLOB_ENABLE_2 = true; + this.IRIDESCENCE_ENABLED = true; + this._needNormals = true; + this._needUVs = true; + this.rebuild(); + } +} + +class MRDLSliderThumbMaterial3 extends PushMaterial { + constructor(name348, scene50) { + super(name348, scene50); + this.radius = 0.157; + this.bevelFront = 0.065; + this.bevelFrontStretch = 0.077; + this.bevelBack = 0.031; + this.bevelBackStretch = 0; + this.radiusTopLeft = 1; + this.radiusTopRight = 1; + this.radiusBottomLeft = 1; + this.radiusBottomRight = 1; + this.bulgeEnabled = false; + this.bulgeHeight = -0.323; + this.bulgeRadius = 0.73; + this.sunIntensity = 2; + this.sunTheta = 0.937; + this.sunPhi = 0.555; + this.indirectDiffuse = 1; this.albedo = new Color4(0.0117647, 0.505882, 0.996078, 1); this.specular = 0; this.shininess = 10; this.sharpness = 0; - this.subsurface = 0; + this.subsurface = 0.31; this.leftGradientColor = new Color4(0.0117647, 0.505882, 0.996078, 1); this.rightGradientColor = new Color4(0.0117647, 0.505882, 0.996078, 1); this.reflection = 0.749; this.frontReflect = 0; this.edgeReflect = 0.09; - this.power = 8.13; - this.skyColor = new Color4(0.0117647, 0.964706, 0.996078, 1); + this.power = 8.1; + this.skyColor = new Color4(0.0117647, 0.960784, 0.996078, 1); this.horizonColor = new Color4(0.0117647, 0.333333, 0.996078, 1); this.groundColor = new Color4(0, 0.254902, 0.996078, 1); this.horizonPower = 1; @@ -190003,11798 +261495,148737 @@ class MRDLSliderBarMaterial extends PushMaterial { this.valueShift = 0; this.blobPosition = new Vector3(0, 0, 0.1); this.blobIntensity = 0.5; - this.blobNearSize = 0.01; - this.blobFarSize = 0.03; - this.blobNearDistance = 0; - this.blobFarDistance = 0.08; - this.blobFadeLength = 0.576; + this.blobNearSize = 0.01; + this.blobFarSize = 0.03; + this.blobNearDistance = 0; + this.blobFarDistance = 0.08; + this.blobFadeLength = 0.576; + this.blobPulse = 0; + this.blobFade = 1; + this.blobPosition2 = new Vector3(0.2, 0, 0.1); + this.blobNearSize2 = 0.01; + this.blobPulse2 = 0; + this.blobFade2 = 1; + this.blobTexture = new Texture("", this.getScene()); + this.leftIndexPosition = new Vector3(0, 0, 1); + this.rightIndexPosition = new Vector3(-1, -1, -1); + this.leftIndexMiddlePosition = new Vector3(0, 0, 0); + this.rightIndexMiddlePosition = new Vector3(0, 0, 0); + this.decalScaleXY = new Vector2(1.5, 1.5); + this.decalFrontOnly = true; + this.rimIntensity = 0.287; + this.rimHueShift = 0; + this.rimSaturationShift = 0; + this.rimValueShift = -1; + this.iridescenceIntensity = 0; + this.useGlobalLeftIndex = 1; + this.useGlobalRightIndex = 1; + this.globalLeftIndexTipProximity = 0; + this.globalRightIndexTipProximity = 0; + this.globalLeftIndexTipPosition = new Vector4(0.5, 0, -0.55, 1); + this.globaRightIndexTipPosition = new Vector4(0, 0, 0, 1); + this.globalLeftThumbTipPosition = new Vector4(0.5, 0, -0.55, 1); + this.globalRightThumbTipPosition = new Vector4(0, 0, 0, 1); + this.globalLeftIndexMiddlePosition = new Vector4(0.5, 0, -0.55, 1); + this.globalRightIndexMiddlePosition = new Vector4(0, 0, 0, 1); + this.alphaMode = Constants.ALPHA_DISABLE; + this.backFaceCulling = false; + this._blueGradientTexture = new Texture(MRDLSliderThumbMaterial3.BLUE_GRADIENT_TEXTURE_URL, scene50, true, false, Texture.NEAREST_SAMPLINGMODE); + this._decalTexture = new Texture("", this.getScene()); + this._reflectionMapTexture = new Texture("", this.getScene()); + this._indirectEnvTexture = new Texture("", this.getScene()); + } + needAlphaBlending() { + return false; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh88, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new MRDLSliderThumbMaterialDefines3; + } + const defines = subMesh11.materialDefines; + const scene50 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene50.getEngine(); + MaterialHelper.PrepareDefinesForAttributes(mesh88, defines, false, false); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + defines.IMAGEPROCESSINGPOSTPROCESS = scene50.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + if (defines.TANGENT) { + attribs.push(VertexBuffer.TangentKind); + } + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "mrdlSliderThumb"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "viewProjection", + "cameraPosition", + "_Radius_", + "_Bevel_Front_", + "_Bevel_Front_Stretch_", + "_Bevel_Back_", + "_Bevel_Back_Stretch_", + "_Radius_Top_Left_", + "_Radius_Top_Right_", + "_Radius_Bottom_Left_", + "_Radius_Bottom_Right_", + "_Bulge_Enabled_", + "_Bulge_Height_", + "_Bulge_Radius_", + "_Sun_Intensity_", + "_Sun_Theta_", + "_Sun_Phi_", + "_Indirect_Diffuse_", + "_Albedo_", + "_Specular_", + "_Shininess_", + "_Sharpness_", + "_Subsurface_", + "_Left_Color_", + "_Right_Color_", + "_Reflection_", + "_Front_Reflect_", + "_Edge_Reflect_", + "_Power_", + "_Sky_Color_", + "_Horizon_Color_", + "_Ground_Color_", + "_Horizon_Power_", + "_Reflection_Map_", + "_Indirect_Environment_", + "_Width_", + "_Fuzz_", + "_Min_Fuzz_", + "_Clip_Fade_", + "_Hue_Shift_", + "_Saturation_Shift_", + "_Value_Shift_", + "_Blob_Position_", + "_Blob_Intensity_", + "_Blob_Near_Size_", + "_Blob_Far_Size_", + "_Blob_Near_Distance_", + "_Blob_Far_Distance_", + "_Blob_Fade_Length_", + "_Blob_Pulse_", + "_Blob_Fade_", + "_Blob_Texture_", + "_Blob_Position_2_", + "_Blob_Near_Size_2_", + "_Blob_Pulse_2_", + "_Blob_Fade_2_", + "_Left_Index_Pos_", + "_Right_Index_Pos_", + "_Left_Index_Middle_Pos_", + "_Right_Index_Middle_Pos_", + "_Decal_", + "_Decal_Scale_XY_", + "_Decal_Front_Only_", + "_Rim_Intensity_", + "_Rim_Texture_", + "_Rim_Hue_Shift_", + "_Rim_Saturation_Shift_", + "_Rim_Value_Shift_", + "_Iridescence_Intensity_", + "_Iridescence_Texture_", + "Use_Global_Left_Index", + "Use_Global_Right_Index", + "Global_Left_Index_Tip_Position", + "Global_Right_Index_Tip_Position", + "Global_Left_Thumb_Tip_Position", + "Global_Right_Thumb_Tip_Position", + "Global_Left_Index_Middle_Position;", + "Global_Right_Index_Middle_Position", + "Global_Left_Index_Tip_Proximity", + "Global_Right_Index_Tip_Proximity" + ]; + const samplers = ["_Rim_Texture_", "_Iridescence_Texture_"]; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh88, subMesh11) { + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix()); + this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera.position); + this._activeEffect.setFloat("_Radius_", this.radius); + this._activeEffect.setFloat("_Bevel_Front_", this.bevelFront); + this._activeEffect.setFloat("_Bevel_Front_Stretch_", this.bevelFrontStretch); + this._activeEffect.setFloat("_Bevel_Back_", this.bevelBack); + this._activeEffect.setFloat("_Bevel_Back_Stretch_", this.bevelBackStretch); + this._activeEffect.setFloat("_Radius_Top_Left_", this.radiusTopLeft); + this._activeEffect.setFloat("_Radius_Top_Right_", this.radiusTopRight); + this._activeEffect.setFloat("_Radius_Bottom_Left_", this.radiusBottomLeft); + this._activeEffect.setFloat("_Radius_Bottom_Right_", this.radiusBottomRight); + this._activeEffect.setFloat("_Bulge_Enabled_", this.bulgeEnabled ? 1 : 0); + this._activeEffect.setFloat("_Bulge_Height_", this.bulgeHeight); + this._activeEffect.setFloat("_Bulge_Radius_", this.bulgeRadius); + this._activeEffect.setFloat("_Sun_Intensity_", this.sunIntensity); + this._activeEffect.setFloat("_Sun_Theta_", this.sunTheta); + this._activeEffect.setFloat("_Sun_Phi_", this.sunPhi); + this._activeEffect.setFloat("_Indirect_Diffuse_", this.indirectDiffuse); + this._activeEffect.setDirectColor4("_Albedo_", this.albedo); + this._activeEffect.setFloat("_Specular_", this.specular); + this._activeEffect.setFloat("_Shininess_", this.shininess); + this._activeEffect.setFloat("_Sharpness_", this.sharpness); + this._activeEffect.setFloat("_Subsurface_", this.subsurface); + this._activeEffect.setDirectColor4("_Left_Color_", this.leftGradientColor); + this._activeEffect.setDirectColor4("_Right_Color_", this.rightGradientColor); + this._activeEffect.setFloat("_Reflection_", this.reflection); + this._activeEffect.setFloat("_Front_Reflect_", this.frontReflect); + this._activeEffect.setFloat("_Edge_Reflect_", this.edgeReflect); + this._activeEffect.setFloat("_Power_", this.power); + this._activeEffect.setDirectColor4("_Sky_Color_", this.skyColor); + this._activeEffect.setDirectColor4("_Horizon_Color_", this.horizonColor); + this._activeEffect.setDirectColor4("_Ground_Color_", this.groundColor); + this._activeEffect.setFloat("_Horizon_Power_", this.horizonPower); + this._activeEffect.setTexture("_Reflection_Map_", this._reflectionMapTexture); + this._activeEffect.setTexture("_Indirect_Environment_", this._indirectEnvTexture); + this._activeEffect.setFloat("_Width_", this.width); + this._activeEffect.setFloat("_Fuzz_", this.fuzz); + this._activeEffect.setFloat("_Min_Fuzz_", this.minFuzz); + this._activeEffect.setFloat("_Clip_Fade_", this.clipFade); + this._activeEffect.setFloat("_Hue_Shift_", this.hueShift); + this._activeEffect.setFloat("_Saturation_Shift_", this.saturationShift); + this._activeEffect.setFloat("_Value_Shift_", this.valueShift); + this._activeEffect.setVector3("_Blob_Position_", this.blobPosition); + this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity); + this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize); + this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize); + this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance); + this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance); + this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength); + this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse); + this._activeEffect.setFloat("_Blob_Fade_", this.blobFade); + this._activeEffect.setTexture("_Blob_Texture_", this.blobTexture); + this._activeEffect.setVector3("_Blob_Position_2_", this.blobPosition2); + this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2); + this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2); + this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2); + this._activeEffect.setVector3("_Left_Index_Pos_", this.leftIndexPosition); + this._activeEffect.setVector3("_Right_Index_Pos_", this.rightIndexPosition); + this._activeEffect.setVector3("_Left_Index_Middle_Pos_", this.leftIndexMiddlePosition); + this._activeEffect.setVector3("_Right_Index_Middle_Pos_", this.rightIndexMiddlePosition); + this._activeEffect.setTexture("_Decal_", this._decalTexture); + this._activeEffect.setVector2("_Decal_Scale_XY_", this.decalScaleXY); + this._activeEffect.setFloat("_Decal_Front_Only_", this.decalFrontOnly ? 1 : 0); + this._activeEffect.setFloat("_Rim_Intensity_", this.rimIntensity); + this._activeEffect.setTexture("_Rim_Texture_", this._blueGradientTexture); + this._activeEffect.setFloat("_Rim_Hue_Shift_", this.rimHueShift); + this._activeEffect.setFloat("_Rim_Saturation_Shift_", this.rimSaturationShift); + this._activeEffect.setFloat("_Rim_Value_Shift_", this.rimValueShift); + this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity); + this._activeEffect.setTexture("_Iridescence_Texture_", this._blueGradientTexture); + this._activeEffect.setFloat("Use_Global_Left_Index", this.useGlobalLeftIndex); + this._activeEffect.setFloat("Use_Global_Right_Index", this.useGlobalRightIndex); + this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this.globalLeftIndexTipPosition); + this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this.globaRightIndexTipPosition); + this._activeEffect.setVector4("Global_Left_Thumb_Tip_Position", this.globalLeftThumbTipPosition); + this._activeEffect.setVector4("Global_Right_Thumb_Tip_Position", this.globalRightThumbTipPosition); + this._activeEffect.setVector4("Global_Left_Index_Middle_Position", this.globalLeftIndexMiddlePosition); + this._activeEffect.setVector4("Global_Right_Index_Middle_Position", this.globalRightIndexMiddlePosition); + this._activeEffect.setFloat("Global_Left_Index_Tip_Proximity", this.globalLeftIndexTipProximity); + this._activeEffect.setFloat("Global_Right_Index_Tip_Proximity", this.globalRightIndexTipProximity); + this._afterBind(mesh88, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + this._reflectionMapTexture.dispose(); + this._indirectEnvTexture.dispose(); + this._blueGradientTexture.dispose(); + this._decalTexture.dispose(); + } + clone(name348) { + return SerializationHelper.Clone(() => new MRDLSliderThumbMaterial3(name348, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.MRDLSliderThumbMaterial"; + return serializationObject; + } + getClassName() { + return "MRDLSliderThumbMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new MRDLSliderThumbMaterial3(source.name, scene50), source, scene50, rootUrl); + } +} +var init_mrdlSliderThumbMaterial2 = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_texture(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_buffer(); + init_typeStore(); + init_math_color(); + init_effectFallbacks(); + init_constants(); + init_mrdlSliderThumb_fragment2(); + init_mrdlSliderThumb_vertex2(); + MRDLSliderThumbMaterial3.BLUE_GRADIENT_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-blue-gradient.png"; + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "radius", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "bevelFront", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "bevelFrontStretch", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "bevelBack", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "bevelBackStretch", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "radiusTopLeft", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "radiusTopRight", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "radiusBottomLeft", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "radiusBottomRight", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "bulgeEnabled", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "bulgeHeight", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "bulgeRadius", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "sunIntensity", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "sunTheta", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "sunPhi", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "indirectDiffuse", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "albedo", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "specular", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "shininess", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "sharpness", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "subsurface", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "leftGradientColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "rightGradientColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "reflection", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "frontReflect", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "edgeReflect", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "power", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "skyColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "horizonColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "groundColor", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "horizonPower", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "width", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "fuzz", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "minFuzz", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "clipFade", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "hueShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "saturationShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "valueShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "blobPosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "blobIntensity", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "blobNearSize", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "blobFarSize", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "blobNearDistance", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "blobFarDistance", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "blobFadeLength", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "blobPulse", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "blobFade", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "blobPosition2", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "blobNearSize2", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "blobPulse2", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "blobFade2", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "blobTexture", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "leftIndexPosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "rightIndexPosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "leftIndexMiddlePosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "rightIndexMiddlePosition", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "decalScaleXY", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "decalFrontOnly", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "rimIntensity", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "rimHueShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "rimSaturationShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "rimValueShift", undefined); + __decorate2([ + serialize() + ], MRDLSliderThumbMaterial3.prototype, "iridescenceIntensity", undefined); + RegisterClass("BABYLON.GUI.MRDLSliderThumbMaterial", MRDLSliderThumbMaterial3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js +var name348, shader345; +var init_mrdlBackplate_fragment2 = __esm(() => { + init_shaderStore(); + name348 = "mrdlBackplatePixelShader"; + shader345 = `uniform vec3 cameraPosition;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vExtra1;varying vec4 vExtra2;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform vec4 _Iridescence_Tint_;uniform sampler2D _Iridescent_Map_;uniform float _Angle_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform vec4 _Gradient_Color_;uniform vec4 _Top_Left_;uniform vec4 _Top_Right_;uniform vec4 _Bottom_Left_;uniform vec4 _Bottom_Right_;uniform float _Edge_Width_;uniform float _Edge_Power_;uniform float _Line_Gradient_Blend_;uniform float _Fade_Out_;void FastLinearTosRGB_B353( +vec4 Linear, +out vec4 sRGB) +{sRGB.rgb=sqrt(clamp(Linear.rgb,0.0,1.0));sRGB.a=Linear.a;} +void Round_Rect_Fragment_B332( +float Radius, +float Line_Width, +vec4 Line_Color, +float Filter_Width, +vec2 UV, +float Line_Visibility, +vec4 Rect_Parms, +vec4 Fill_Color, +out vec4 Color) +{float d=length(max(abs(UV)-Rect_Parms.xy,0.0));float dx=max(fwidth(d)*Filter_Width,0.00001);float g=min(Rect_Parms.z,Rect_Parms.w);float dgrad=max(fwidth(g)*Filter_Width,0.00001);float Inside_Rect=clamp(g/dgrad,0.0,1.0);float inner=clamp((d+dx*0.5-max(Radius-Line_Width,d-dx*0.5))/dx,0.0,1.0);Color=clamp(mix(Fill_Color,Line_Color,inner),0.0,1.0)*Inside_Rect;} +void Iridescence_B343( +vec3 Position, +vec3 Normal, +vec2 UV, +vec3 Axis, +vec3 Eye, +vec4 Tint, +sampler2D Texture, +bool Reflected, +float Frequency, +float Vertical_Offset, +out vec4 Color) +{vec3 i=normalize(Position-Eye);vec3 r=reflect(i,Normal);float idota=dot(i,Axis);float idotr=dot(i,r);float x=Reflected ? idotr : idota;vec2 xy;xy.x=fract((x*Frequency+1.0)*0.5+UV.y*Vertical_Offset);xy.y=0.5;Color=texture(Texture,xy);Color.rgb*=Tint.rgb;} +void Scale_RGB_B346( +vec4 Color, +float Scalar, +out vec4 Result) +{Result=vec4(Scalar,Scalar,Scalar,1)*Color;} +void Scale_RGB_B344( +float Scalar, +vec4 Color, +out vec4 Result) +{Result=vec4(Scalar,Scalar,Scalar,1)*Color;} +void Line_Fragment_B362( +vec4 Base_Color, +vec4 Highlight_Color, +float Highlight_Width, +vec3 Line_Vertex, +float Highlight, +out vec4 Line_Color) +{float k2=1.0-clamp(abs(Line_Vertex.y/Highlight_Width),0.0,1.0);Line_Color=mix(Base_Color,Highlight_Color,Highlight*k2);} +void Edge_B356( +vec4 RectParms, +float Radius, +float Line_Width, +vec2 UV, +float Edge_Width, +float Edge_Power, +out float Result) +{float d=length(max(abs(UV)-RectParms.xy,0.0));float edge=1.0-clamp((1.0-d/(Radius-Line_Width))/Edge_Width,0.0,1.0);Result=pow(edge,Edge_Power);} +void Gradient_B355( +vec4 Gradient_Color, +vec4 Top_Left, +vec4 Top_Right, +vec4 Bottom_Left, +vec4 Bottom_Right, +vec2 UV, +out vec4 Result) +{vec3 top=Top_Left.rgb+(Top_Right.rgb-Top_Left.rgb)*UV.x;vec3 bottom=Bottom_Left.rgb+(Bottom_Right.rgb-Bottom_Left.rgb)*UV.x;Result.rgb=Gradient_Color.rgb*(bottom+(top-bottom)*UV.y);Result.a=1.0;} +void main() +{float X_Q338;float Y_Q338;float Z_Q338;float W_Q338;X_Q338=vExtra2.x;Y_Q338=vExtra2.y;Z_Q338=vExtra2.z;W_Q338=vExtra2.w;vec4 Color_Q343; +#if IRIDESCENCE_ENABLE +Iridescence_B343(vPosition,vNormal,vUV,vBinormal,cameraPosition,_Iridescence_Tint_,_Iridescent_Map_,_Reflected_,_Frequency_,_Vertical_Offset_,Color_Q343); +#else +Color_Q343=vec4(0,0,0,0); +#endif +vec4 Result_Q344;Scale_RGB_B344(_Iridescence_Intensity_,Color_Q343,Result_Q344);vec4 Line_Color_Q362;Line_Fragment_B362(_Line_Color_,_Highlight_Color_,_Highlight_Width_,vTangent,_Highlight_,Line_Color_Q362);float Result_Q356; +#if EDGE_ONLY +Edge_B356(vExtra1,Z_Q338,W_Q338,vUV,_Edge_Width_,_Edge_Power_,Result_Q356); +#else +Result_Q356=1.0; +#endif +vec2 Vec2_Q339=vec2(X_Q338,Y_Q338);vec4 Result_Q355;Gradient_B355(_Gradient_Color_,_Top_Left_,_Top_Right_,_Bottom_Left_,_Bottom_Right_,Vec2_Q339,Result_Q355);vec4 Linear_Q348;Linear_Q348.rgb=clamp(Result_Q355.rgb*Result_Q355.rgb,0.0,1.0);Linear_Q348.a=Result_Q355.a;vec4 Result_Q346;Scale_RGB_B346(Linear_Q348,Result_Q356,Result_Q346);vec4 Sum_Q345=Result_Q346+Result_Q344;vec4 Color_At_T_Q347=mix(Line_Color_Q362,Result_Q346,_Line_Gradient_Blend_);vec4 Base_And_Iridescent_Q350;Base_And_Iridescent_Q350=_Base_Color_+vec4(Sum_Q345.rgb,0.0);vec4 Sum_Q349=Color_At_T_Q347+_Iridescence_Edge_Intensity_*Color_Q343;vec4 Result_Q351=Sum_Q349; Result_Q351.a=1.0;vec4 Color_Q332;Round_Rect_Fragment_B332(Z_Q338,W_Q338,Result_Q351,_Filter_Width_,vUV,1.0,vExtra1,Base_And_Iridescent_Q350,Color_Q332);vec4 Result_Q354=_Fade_Out_*Color_Q332;vec4 sRGB_Q353;FastLinearTosRGB_B353(Result_Q354,sRGB_Q353);vec4 Out_Color=sRGB_Q353;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}`; + ShaderStore.ShadersStore[name348] = shader345; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js +var name349, shader346; +var init_mrdlBackplate_vertex2 = __esm(() => { + init_shaderStore(); + name349 = "mrdlBackplateVertexShader"; + shader346 = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec3 tangent;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Filter_Width_;uniform vec4 _Base_Color_;uniform vec4 _Line_Color_;uniform float _Radius_Top_Left_;uniform float _Radius_Top_Right_;uniform float _Radius_Bottom_Left_;uniform float _Radius_Bottom_Right_;uniform float _Rate_;uniform vec4 _Highlight_Color_;uniform float _Highlight_Width_;uniform vec4 _Highlight_Transform_;uniform float _Highlight_;uniform float _Iridescence_Intensity_;uniform float _Iridescence_Edge_Intensity_;uniform vec4 _Iridescence_Tint_;uniform sampler2D _Iridescent_Map_;uniform float _Angle_;uniform bool _Reflected_;uniform float _Frequency_;uniform float _Vertical_Offset_;uniform vec4 _Gradient_Color_;uniform vec4 _Top_Left_;uniform vec4 _Top_Right_;uniform vec4 _Bottom_Left_;uniform vec4 _Bottom_Right_;uniform float _Edge_Width_;uniform float _Edge_Power_;uniform float _Line_Gradient_Blend_;uniform float _Fade_Out_;varying vec3 vPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec3 vBinormal;varying vec4 vExtra1;varying vec4 vExtra2;void Object_To_World_Pos_B314( +vec3 Pos_Object, +out vec3 Pos_World) +{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;} +void Round_Rect_Vertex_B357( +vec2 UV, +float Radius, +float Margin, +float Anisotropy, +float Gradient1, +float Gradient2, +vec3 Normal, +vec4 Color_Scale_Translate, +out vec2 Rect_UV, +out vec4 Rect_Parms, +out vec2 Scale_XY, +out vec2 Line_UV, +out vec2 Color_UV_Info) +{Scale_XY=vec2(Anisotropy,1.0);Line_UV=(UV-vec2(0.5,0.5));Rect_UV=Line_UV*Scale_XY;Rect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius)-vec2(Margin,Margin);Rect_Parms.z=Gradient1; +Rect_Parms.w=Gradient2;Color_UV_Info=(Line_UV+vec2(0.5,0.5))*Color_Scale_Translate.xy+Color_Scale_Translate.zw;} +void Line_Vertex_B333( +vec2 Scale_XY, +vec2 UV, +float Time, +float Rate, +vec4 Highlight_Transform, +out vec3 Line_Vertex) +{float angle2=(Rate*Time)*2.0*3.1416;float sinAngle2=sin(angle2);float cosAngle2=cos(angle2);vec2 xformUV=UV*Highlight_Transform.xy+Highlight_Transform.zw;Line_Vertex.x=0.0;Line_Vertex.y=cosAngle2*xformUV.x-sinAngle2*xformUV.y;Line_Vertex.z=0.0; } +void PickDir_B334( +float Degrees, +vec3 DirX, +vec3 DirY, +out vec3 Dir) +{float a=Degrees*3.14159/180.0;Dir=cos(a)*DirX+sin(a)*DirY;} +void Move_Verts_B327( +float Anisotropy, +vec3 P, +float Radius, +out vec3 New_P, +out vec2 New_UV, +out float Radial_Gradient, +out vec3 Radial_Dir) +{vec2 UV=P.xy*2.0+0.5;vec2 center=clamp(UV,0.0,1.0);vec2 delta=UV-center;vec2 r2=2.0*vec2(Radius/Anisotropy,Radius);New_UV=center+r2*(UV-2.0*center+0.5);New_P=vec3(New_UV-0.5,P.z);Radial_Gradient=1.0-length(delta)*2.0;Radial_Dir=vec3(delta*r2,0.0);} +void Pick_Radius_B336( +float Radius, +float Radius_Top_Left, +float Radius_Top_Right, +float Radius_Bottom_Left, +float Radius_Bottom_Right, +vec3 Position, +out float Result) +{bool whichY=Position.y>0.0;Result=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);Result*=Radius;} +void Edge_AA_Vertex_B328( +vec3 Position_World, +vec3 Position_Object, +vec3 Normal_Object, +vec3 Eye, +float Radial_Gradient, +vec3 Radial_Dir, +vec3 Tangent, +out float Gradient1, +out float Gradient2) +{vec3 I=(Eye-Position_World);vec3 T=(vec4(Tangent,0.0)).xyz;float g=(dot(T,I)<0.0) ? 0.0 : 1.0;if (Normal_Object.z==0.0) { +Gradient1=Position_Object.z>0.0 ? g : 1.0;Gradient2=Position_Object.z>0.0 ? 1.0 : g;} else {Gradient1=g+(1.0-g)*(Radial_Gradient);Gradient2=1.0;}} +void Object_To_World_Dir_B330( +vec3 Dir_Object, +out vec3 Binormal_World, +out vec3 Binormal_World_N, +out float Binormal_Length) +{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;Binormal_Length=length(Binormal_World);Binormal_World_N=Binormal_World/Binormal_Length;} +void RelativeOrAbsoluteDetail_B341( +float Nominal_Radius, +float Nominal_LineWidth, +bool Absolute_Measurements, +float Height, +out float Radius, +out float Line_Width) +{float scale=Absolute_Measurements ? 1.0/Height : 1.0;Radius=Nominal_Radius*scale;Line_Width=Nominal_LineWidth*scale;} +void main() +{vec3 Nrm_World_Q326;Nrm_World_Q326=normalize((world*vec4(normal,0.0)).xyz);vec3 Tangent_World_Q329;vec3 Tangent_World_N_Q329;float Tangent_Length_Q329;Tangent_World_Q329=(world*vec4(vec3(1,0,0),0.0)).xyz;Tangent_Length_Q329=length(Tangent_World_Q329);Tangent_World_N_Q329=Tangent_World_Q329/Tangent_Length_Q329;vec3 Binormal_World_Q330;vec3 Binormal_World_N_Q330;float Binormal_Length_Q330;Object_To_World_Dir_B330(vec3(0,1,0),Binormal_World_Q330,Binormal_World_N_Q330,Binormal_Length_Q330);float Radius_Q341;float Line_Width_Q341;RelativeOrAbsoluteDetail_B341(_Radius_,_Line_Width_,_Absolute_Sizes_,Binormal_Length_Q330,Radius_Q341,Line_Width_Q341);vec3 Dir_Q334;PickDir_B334(_Angle_,Tangent_World_N_Q329,Binormal_World_N_Q330,Dir_Q334);float Result_Q336;Pick_Radius_B336(Radius_Q341,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q336);float Anisotropy_Q331=Tangent_Length_Q329/Binormal_Length_Q330;vec4 Out_Color_Q337=vec4(Result_Q336,Line_Width_Q341,0,1);vec3 New_P_Q327;vec2 New_UV_Q327;float Radial_Gradient_Q327;vec3 Radial_Dir_Q327;Move_Verts_B327(Anisotropy_Q331,position,Result_Q336,New_P_Q327,New_UV_Q327,Radial_Gradient_Q327,Radial_Dir_Q327);vec3 Pos_World_Q314;Object_To_World_Pos_B314(New_P_Q327,Pos_World_Q314);float Gradient1_Q328;float Gradient2_Q328; +#if SMOOTH_EDGES +Edge_AA_Vertex_B328(Pos_World_Q314,position,normal,cameraPosition,Radial_Gradient_Q327,Radial_Dir_Q327,tangent,Gradient1_Q328,Gradient2_Q328); +#else +Gradient1_Q328=1.0;Gradient2_Q328=1.0; +#endif +vec2 Rect_UV_Q357;vec4 Rect_Parms_Q357;vec2 Scale_XY_Q357;vec2 Line_UV_Q357;vec2 Color_UV_Info_Q357;Round_Rect_Vertex_B357(New_UV_Q327,Result_Q336,0.0,Anisotropy_Q331,Gradient1_Q328,Gradient2_Q328,normal,vec4(1,1,0,0),Rect_UV_Q357,Rect_Parms_Q357,Scale_XY_Q357,Line_UV_Q357,Color_UV_Info_Q357);vec3 Line_Vertex_Q333;Line_Vertex_B333(Scale_XY_Q357,Line_UV_Q357,(20.0),_Rate_,_Highlight_Transform_,Line_Vertex_Q333);float X_Q359;float Y_Q359;X_Q359=Color_UV_Info_Q357.x;Y_Q359=Color_UV_Info_Q357.y;vec4 Vec4_Q358=vec4(X_Q359,Y_Q359,Result_Q336,Line_Width_Q341);vec3 Position=Pos_World_Q314;vec3 Normal=Nrm_World_Q326;vec2 UV=Rect_UV_Q357;vec3 Tangent=Line_Vertex_Q333;vec3 Binormal=Dir_Q334;vec4 Color=Out_Color_Q337;vec4 Extra1=Rect_Parms_Q357;vec4 Extra2=Vec4_Q358;vec4 Extra3=vec4(0,0,0,0);gl_Position=viewProjection*vec4(Position,1);vPosition=Position;vNormal=Normal;vUV=UV;vTangent=Tangent;vBinormal=Binormal;vExtra1=Extra1;vExtra2=Extra2;}`; + ShaderStore.ShadersStore[name349] = shader346; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/mrdl/mrdlBackplateMaterial.js +class MRDLBackplateMaterialDefines3 extends MaterialDefines { + constructor() { + super(); + this.IRIDESCENCE_ENABLE = true; + this.SMOOTH_EDGES = true; + this._needNormals = true; + this.rebuild(); + } +} + +class MRDLBackplateMaterial3 extends PushMaterial { + constructor(name350, scene50) { + super(name350, scene50); + this.radius = 0.3; + this.lineWidth = 0.003; + this.absoluteSizes = false; + this._filterWidth = 1; + this.baseColor = new Color4(0, 0, 0, 1); + this.lineColor = new Color4(0.2, 0.262745, 0.4, 1); + this.radiusTopLeft = 1; + this.radiusTopRight = 1; + this.radiusBottomLeft = 1; + this.radiusBottomRight = 1; + this._rate = 0; + this.highlightColor = new Color4(0.239216, 0.435294, 0.827451, 1); + this.highlightWidth = 0; + this._highlightTransform = new Vector4(1, 1, 0, 0); + this._highlight = 1; + this.iridescenceIntensity = 0.45; + this.iridescenceEdgeIntensity = 1; + this.iridescenceTint = new Color4(1, 1, 1, 1); + this._angle = -45; + this.fadeOut = 1; + this._reflected = true; + this._frequency = 1; + this._verticalOffset = 0; + this.gradientColor = new Color4(0.74902, 0.74902, 0.74902, 1); + this.topLeftGradientColor = new Color4(0.00784314, 0.294118, 0.580392, 1); + this.topRightGradientColor = new Color4(0.305882, 0, 1, 1); + this.bottomLeftGradientColor = new Color4(0.133333, 0.258824, 0.992157, 1); + this.bottomRightGradientColor = new Color4(0.176471, 0.176471, 0.619608, 1); + this.edgeWidth = 0.5; + this.edgePower = 1; + this.edgeLineGradientBlend = 0.5; + this.alphaMode = Constants.ALPHA_DISABLE; + this.backFaceCulling = false; + this._iridescentMapTexture = new Texture(MRDLBackplateMaterial3.IRIDESCENT_MAP_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE); + } + needAlphaBlending() { + return false; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh88, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new MRDLBackplateMaterialDefines3; + } + const defines = subMesh11.materialDefines; + const scene50 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene50.getEngine(); + MaterialHelper.PrepareDefinesForAttributes(mesh88, defines, false, false); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + defines.IMAGEPROCESSINGPOSTPROCESS = scene50.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + if (defines.TANGENT) { + attribs.push(VertexBuffer.TangentKind); + } + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "mrdlBackplate"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "viewProjection", + "cameraPosition", + "_Radius_", + "_Line_Width_", + "_Absolute_Sizes_", + "_Filter_Width_", + "_Base_Color_", + "_Line_Color_", + "_Radius_Top_Left_", + "_Radius_Top_Right_", + "_Radius_Bottom_Left_", + "_Radius_Bottom_Right_", + "_Rate_", + "_Highlight_Color_", + "_Highlight_Width_", + "_Highlight_Transform_", + "_Highlight_", + "_Iridescence_Intensity_", + "_Iridescence_Edge_Intensity_", + "_Iridescence_Tint_", + "_Iridescent_Map_", + "_Angle_", + "_Reflected_", + "_Frequency_", + "_Vertical_Offset_", + "_Gradient_Color_", + "_Top_Left_", + "_Top_Right_", + "_Bottom_Left_", + "_Bottom_Right_", + "_Edge_Width_", + "_Edge_Power_", + "_Line_Gradient_Blend_", + "_Fade_Out_" + ]; + const samplers = ["_Iridescent_Map_"]; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh88, subMesh11) { + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix()); + this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera.position); + this._activeEffect.setFloat("_Radius_", this.radius); + this._activeEffect.setFloat("_Line_Width_", this.lineWidth); + this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1 : 0); + this._activeEffect.setFloat("_Filter_Width_", this._filterWidth); + this._activeEffect.setDirectColor4("_Base_Color_", this.baseColor); + this._activeEffect.setDirectColor4("_Line_Color_", this.lineColor); + this._activeEffect.setFloat("_Radius_Top_Left_", this.radiusTopLeft); + this._activeEffect.setFloat("_Radius_Top_Right_", this.radiusTopRight); + this._activeEffect.setFloat("_Radius_Bottom_Left_", this.radiusBottomLeft); + this._activeEffect.setFloat("_Radius_Bottom_Right_", this.radiusBottomRight); + this._activeEffect.setFloat("_Rate_", this._rate); + this._activeEffect.setDirectColor4("_Highlight_Color_", this.highlightColor); + this._activeEffect.setFloat("_Highlight_Width_", this.highlightWidth); + this._activeEffect.setVector4("_Highlight_Transform_", this._highlightTransform); + this._activeEffect.setFloat("_Highlight_", this._highlight); + this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity); + this._activeEffect.setFloat("_Iridescence_Edge_Intensity_", this.iridescenceEdgeIntensity); + this._activeEffect.setDirectColor4("_Iridescence_Tint_", this.iridescenceTint); + this._activeEffect.setTexture("_Iridescent_Map_", this._iridescentMapTexture); + this._activeEffect.setFloat("_Angle_", this._angle); + this._activeEffect.setFloat("_Reflected_", this._reflected ? 1 : 0); + this._activeEffect.setFloat("_Frequency_", this._frequency); + this._activeEffect.setFloat("_Vertical_Offset_", this._verticalOffset); + this._activeEffect.setDirectColor4("_Gradient_Color_", this.gradientColor); + this._activeEffect.setDirectColor4("_Top_Left_", this.topLeftGradientColor); + this._activeEffect.setDirectColor4("_Top_Right_", this.topRightGradientColor); + this._activeEffect.setDirectColor4("_Bottom_Left_", this.bottomLeftGradientColor); + this._activeEffect.setDirectColor4("_Bottom_Right_", this.bottomRightGradientColor); + this._activeEffect.setFloat("_Edge_Width_", this.edgeWidth); + this._activeEffect.setFloat("_Edge_Power_", this.edgePower); + this._activeEffect.setFloat("_Line_Gradient_Blend_", this.edgeLineGradientBlend); + this._activeEffect.setFloat("_Fade_Out_", this.fadeOut); + this._afterBind(mesh88, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + } + clone(name350) { + return SerializationHelper.Clone(() => new MRDLBackplateMaterial3(name350, this.getScene()), this); + } + serialize() { + const serializationObject = super.serialize(); + serializationObject.customType = "BABYLON.MRDLBackplateMaterial"; + return serializationObject; + } + getClassName() { + return "MRDLBackplateMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new MRDLBackplateMaterial3(source.name, scene50), source, scene50, rootUrl); + } +} +var init_mrdlBackplateMaterial2 = __esm(() => { + init_tslib_es62(); + init_decorators(); + init_math_vector(); + init_texture(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_buffer(); + init_typeStore(); + init_math_color(); + init_effectFallbacks(); + init_constants(); + init_mrdlBackplate_fragment2(); + init_mrdlBackplate_vertex2(); + MRDLBackplateMaterial3.IRIDESCENT_MAP_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-backplate-iridescence.png"; + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "radius", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "lineWidth", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "absoluteSizes", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "baseColor", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "lineColor", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "radiusTopLeft", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "radiusTopRight", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "radiusBottomLeft", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "radiusBottomRight", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "highlightColor", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "highlightWidth", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "iridescenceIntensity", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "iridescenceEdgeIntensity", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "iridescenceTint", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "fadeOut", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "gradientColor", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "topLeftGradientColor", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "topRightGradientColor", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "bottomLeftGradientColor", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "bottomRightGradientColor", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "edgeWidth", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "edgePower", undefined); + __decorate2([ + serialize() + ], MRDLBackplateMaterial3.prototype, "edgeLineGradientBlend", undefined); + RegisterClass("BABYLON.GUI.MRDLBackplateMaterial", MRDLBackplateMaterial3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/slider3D.js +class Slider3D3 extends Control3D3 { + constructor(name350, sliderBackplateVisible) { + super(name350); + this.onValueChangedObservable = new Observable; + this._sliderBackplateVisible = sliderBackplateVisible || false; + this._minimum = SLIDER_MIN3; + this._maximum = SLIDER_MAX3; + this._step = SLIDER_STEP3; + this._value = SLIDER_VAL3; + } + get mesh() { + if (this.node) { + return this._sliderThumb; + } + return null; + } + get minimum() { + return this._minimum; + } + set minimum(value) { + if (this._minimum === value) { + return; + } + this._minimum = Math.max(value, SLIDER_MIN3); + this._value = Math.max(Math.min(this._value, this._maximum), this._minimum); + } + get maximum() { + return this._maximum; + } + set maximum(value) { + if (this._maximum === value) { + return; + } + this._maximum = Math.max(value, this._minimum); + this._value = Math.max(Math.min(this._value, this._maximum), this._minimum); + } + get step() { + return this._step; + } + set step(value) { + if (this._step === value) { + return; + } + this._step = Math.max(Math.min(value, this._maximum - this._minimum), SLIDER_STEP3); + } + get value() { + return this._value; + } + set value(value) { + if (this._value === value) { + return; + } + this._value = Math.max(Math.min(value, this._maximum), this._minimum); + if (this._sliderThumb) { + this._sliderThumb.position.x = this._convertToPosition(this.value); + } + this.onValueChangedObservable.notifyObservers(this._value); + } + get start() { + if (!this.node) { + return -SLIDER_SCALING3 / 2; + } + return this._sliderBar.position.x - this._sliderBar.scaling.x / 2; + } + get end() { + if (!this.node) { + return SLIDER_SCALING3 / 2; + } + return this._sliderBar.position.x + this._sliderBar.scaling.x / 2; + } + get sliderBarMaterial() { + return this._sliderBarMaterial; + } + get sliderThumbMaterial() { + return this._sliderThumbMaterial; + } + get sliderBackplateMaterial() { + return this._sliderBackplateMaterial; + } + set isVisible(value) { + var _a; + if (this._isVisible === value) { + return; + } + this._isVisible = value; + (_a = this.node) === null || _a === undefined || _a.setEnabled(value); + } + _createNode(scene50) { + const sliderBackplate = CreateBox(`${this.name}_sliderbackplate`, { + width: 1, + height: 1, + depth: 1 + }, scene50); + sliderBackplate.isPickable = false; + sliderBackplate.visibility = 0; + sliderBackplate.scaling = new Vector3(1, 0.5, 0.8); + SceneLoader.ImportMeshAsync(undefined, Slider3D3.MODEL_BASE_URL, Slider3D3.MODEL_FILENAME, scene50).then((result) => { + result.meshes.forEach((m) => { + m.isPickable = false; + }); + const sliderBackplateModel = result.meshes[1]; + const sliderBarModel = result.meshes[1].clone(`${this.name}_sliderbar`, sliderBackplate); + const sliderThumbModel = result.meshes[1].clone(`${this.name}_sliderthumb`, sliderBackplate); + sliderBackplateModel.visibility = 0; + if (this._sliderBackplateVisible) { + sliderBackplateModel.visibility = 1; + sliderBackplateModel.name = `${this.name}_sliderbackplate`; + sliderBackplateModel.scaling.x = 1; + sliderBackplateModel.scaling.z = 0.2; + sliderBackplateModel.parent = sliderBackplate; + if (this._sliderBackplateMaterial) { + sliderBackplateModel.material = this._sliderBackplateMaterial; + } + this._sliderBackplate = sliderBackplateModel; + } + if (sliderBarModel) { + sliderBarModel.parent = sliderBackplate; + sliderBarModel.position.z = -0.1; + sliderBarModel.scaling = new Vector3(SLIDER_SCALING3 - SLIDER_MARGIN3, 0.04, 0.3); + if (this._sliderBarMaterial) { + sliderBarModel.material = this._sliderBarMaterial; + } + this._sliderBar = sliderBarModel; + } + if (sliderThumbModel) { + sliderThumbModel.parent = sliderBackplate; + sliderThumbModel.isPickable = true; + sliderThumbModel.position.z = -0.115; + sliderThumbModel.scaling = new Vector3(0.025, 0.3, 0.6); + sliderThumbModel.position.x = this._convertToPosition(this.value); + sliderThumbModel.addBehavior(this._createBehavior()); + if (this._sliderThumbMaterial) { + sliderThumbModel.material = this._sliderThumbMaterial; + } + this._sliderThumb = sliderThumbModel; + } + this._injectGUI3DReservedDataStore(sliderBackplate).control = this; + sliderBackplate.getChildMeshes().forEach((mesh88) => { + this._injectGUI3DReservedDataStore(mesh88).control = this; + }); + }); + this._affectMaterial(sliderBackplate); + return sliderBackplate; + } + _affectMaterial(mesh88) { + var _a, _b, _c; + this._sliderBackplateMaterial = (_a = this._sliderBackplateMaterial) !== null && _a !== undefined ? _a : new MRDLBackplateMaterial3(`${this.name}_sliderbackplate_material`, mesh88.getScene()); + this._sliderBarMaterial = (_b = this._sliderBarMaterial) !== null && _b !== undefined ? _b : new MRDLSliderBarMaterial3(`${this.name}_sliderbar_material`, mesh88.getScene()); + this._sliderThumbMaterial = (_c = this._sliderThumbMaterial) !== null && _c !== undefined ? _c : new MRDLSliderThumbMaterial3(`${this.name}_sliderthumb_material`, mesh88.getScene()); + } + _createBehavior() { + const pointerDragBehavior14 = new PointerDragBehavior({ dragAxis: Vector3.Right() }); + pointerDragBehavior14.moveAttached = false; + pointerDragBehavior14.onDragStartObservable.add(() => { + this._draggedPosition = this._sliderThumb.position.x; + }); + pointerDragBehavior14.onDragObservable.add((event) => { + this._draggedPosition += event.dragDistance / this.scaling.x; + this.value = this._convertToValue(this._draggedPosition); + }); + return pointerDragBehavior14; + } + _convertToPosition(value) { + const position3 = (value - this.minimum) / (this.maximum - this.minimum) * (this.end - this.start) + this.start; + return Math.min(Math.max(position3, this.start), this.end); + } + _convertToValue(position3) { + let value = (position3 - this.start) / (this.end - this.start) * (this.maximum - this.minimum); + value = this.step ? Math.round(value / this.step) * this.step : value; + return Math.max(Math.min(this.minimum + value, this._maximum), this._minimum); + } + dispose() { + var _a, _b, _c, _d, _e, _f; + super.dispose(); + (_a = this._sliderBar) === null || _a === undefined || _a.dispose(); + (_b = this._sliderThumb) === null || _b === undefined || _b.dispose(); + (_c = this._sliderBarMaterial) === null || _c === undefined || _c.dispose(); + (_d = this._sliderThumbMaterial) === null || _d === undefined || _d.dispose(); + (_e = this._sliderBackplate) === null || _e === undefined || _e.dispose(); + (_f = this._sliderBackplateMaterial) === null || _f === undefined || _f.dispose(); + } +} +var SLIDER_MIN3, SLIDER_MAX3, SLIDER_VAL3, SLIDER_STEP3, SLIDER_SCALING3, SLIDER_MARGIN3; +var init_slider3D2 = __esm(() => { + init_observable(); + init_math_vector(); + init_control3D2(); + init_boxBuilder(); + init_pointerDragBehavior(); + init_sceneLoader(); + init_mrdlSliderBarMaterial2(); + init_mrdlSliderThumbMaterial2(); + init_mrdlBackplateMaterial2(); + SLIDER_MIN3 = 0; + SLIDER_MAX3 = 100; + SLIDER_VAL3 = 50; + SLIDER_STEP3 = 0; + SLIDER_SCALING3 = 1; + SLIDER_MARGIN3 = 0.2; + Slider3D3.MODEL_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/"; + Slider3D3.MODEL_FILENAME = "mrtk-fluent-backplate.glb"; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/spherePanel.js +class SpherePanel2 extends VolumeBasedPanel3 { + constructor() { + super(...arguments); + this._radius = 5; + } + get radius() { + return this._radius; + } + set radius(value) { + if (this._radius === value) { + return; + } + this._radius = value; + Tools.SetImmediate(() => { + this._arrangeChildren(); + }); + } + _mapGridNode(control72, nodePosition) { + const mesh88 = control72.mesh; + if (!mesh88) { + return; + } + const newPos = this._sphericalMapping(nodePosition); + control72.position = newPos; + switch (this.orientation) { + case Container3D3.FACEORIGIN_ORIENTATION: + mesh88.lookAt(new Vector3(2 * newPos.x, 2 * newPos.y, 2 * newPos.z)); + break; + case Container3D3.FACEORIGINREVERSED_ORIENTATION: + mesh88.lookAt(new Vector3(-newPos.x, -newPos.y, -newPos.z)); + break; + case Container3D3.FACEFORWARD_ORIENTATION: + break; + case Container3D3.FACEFORWARDREVERSED_ORIENTATION: + mesh88.rotate(Axis.Y, Math.PI, Space.LOCAL); + break; + } + } + _sphericalMapping(source) { + const newPos = new Vector3(0, 0, this._radius); + const xAngle = source.y / this._radius; + const yAngle = -(source.x / this._radius); + Matrix.RotationYawPitchRollToRef(yAngle, xAngle, 0, TmpVectors.Matrix[0]); + return Vector3.TransformNormal(newPos, TmpVectors.Matrix[0]); + } +} +var init_spherePanel2 = __esm(() => { + init_tools(); + init_math_vector(); + init_volumeBasedPanel2(); + init_container3D2(); + init_math_axis(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/stackPanel3D.js +class StackPanel3D2 extends Container3D3 { + get isVertical() { + return this._isVertical; + } + set isVertical(value) { + if (this._isVertical === value) { + return; + } + this._isVertical = value; + Tools.SetImmediate(() => { + this._arrangeChildren(); + }); + } + constructor(isVertical = false) { + super(); + this._isVertical = false; + this.margin = 0.1; + this._isVertical = isVertical; + } + _arrangeChildren() { + let width = 0; + let height = 0; + let controlCount = 0; + const extendSizes = []; + const currentInverseWorld = Matrix.Invert(this.node.computeWorldMatrix(true)); + for (const child of this._children) { + if (!child.mesh) { + continue; + } + controlCount++; + child.mesh.computeWorldMatrix(true); + child.mesh.getWorldMatrix().multiplyToRef(currentInverseWorld, TmpVectors.Matrix[0]); + const boundingBox5 = child.mesh.getBoundingInfo().boundingBox; + const extendSize = Vector3.TransformNormal(boundingBox5.extendSize, TmpVectors.Matrix[0]); + extendSizes.push(extendSize); + if (this._isVertical) { + height += extendSize.y; + } else { + width += extendSize.x; + } + } + if (this._isVertical) { + height += (controlCount - 1) * this.margin / 2; + } else { + width += (controlCount - 1) * this.margin / 2; + } + let offset; + if (this._isVertical) { + offset = -height; + } else { + offset = -width; + } + let index = 0; + for (const child of this._children) { + if (!child.mesh) { + continue; + } + controlCount--; + const extendSize = extendSizes[index++]; + if (this._isVertical) { + child.position.y = offset + extendSize.y; + child.position.x = 0; + offset += extendSize.y * 2; + } else { + child.position.x = offset + extendSize.x; + child.position.y = 0; + offset += extendSize.x * 2; + } + offset += controlCount > 0 ? this.margin : 0; + } + } +} +var init_stackPanel3D2 = __esm(() => { + init_tools(); + init_math_vector(); + init_container3D2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/touchMeshButton3D.js +class TouchMeshButton3D2 extends TouchButton3D3 { + constructor(mesh88, name350) { + super(name350, mesh88); + this._currentMesh = mesh88; + this.pointerEnterAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(1.1); + }; + this.pointerOutAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(1 / 1.1); + }; + this.pointerDownAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(0.95); + }; + this.pointerUpAnimation = () => { + if (!this.mesh) { + return; + } + this.mesh.scaling.scaleInPlace(1 / 0.95); + }; + } + _getTypeName() { + return "TouchMeshButton3D"; + } + _createNode() { + this._currentMesh.getChildMeshes().forEach((mesh88) => { + this._injectGUI3DReservedDataStore(mesh88).control = this; + }); + return this._currentMesh; + } + _affectMaterial(mesh88) { + } +} +var init_touchMeshButton3D2 = __esm(() => { + init_touchButton3D2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlBackglow.fragment.js +var name350, shader347; +var init_mrdlBackglow_fragment2 = __esm(() => { + init_shaderStore(); + name350 = "mrdlBackglowPixelShader"; + shader347 = `uniform vec3 cameraPosition;varying vec3 vNormal;varying vec2 vUV;uniform float _Bevel_Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Tuning_Motion_;uniform float _Motion_;uniform float _Max_Intensity_;uniform float _Intensity_Fade_In_Exponent_;uniform float _Outer_Fuzz_Start_;uniform float _Outer_Fuzz_End_;uniform vec4 _Color_;uniform vec4 _Inner_Color_;uniform float _Blend_Exponent_;uniform float _Falloff_;uniform float _Bias_;float BiasFunc(float b,float v) {return pow(v,log(clamp(b,0.001,0.999))/log(0.5));} +void Fuzzy_Round_Rect_B33( +float Size_X, +float Size_Y, +float Radius_X, +float Radius_Y, +float Line_Width, +vec2 UV, +float Outer_Fuzz, +float Max_Outer_Fuzz, +out float Rect_Distance, +out float Inner_Distance) +{vec2 halfSize=vec2(Size_X,Size_Y)*0.5;vec2 r=max(min(vec2(Radius_X,Radius_Y),halfSize),vec2(0.001,0.001));float radius=min(r.x,r.y)-Max_Outer_Fuzz;vec2 v=abs(UV);vec2 nearestp=min(v,halfSize-r);float d=distance(nearestp,v);Inner_Distance=clamp(1.0-(radius-d)/Line_Width,0.0,1.0);Rect_Distance=clamp(1.0-(d-radius)/Outer_Fuzz,0.0,1.0)*Inner_Distance;} +void main() +{float X_Q42;float Y_Q42;X_Q42=vNormal.x;Y_Q42=vNormal.y;float MaxAB_Q24=max(_Tuning_Motion_,_Motion_);float Sqrt_F_Q27=sqrt(MaxAB_Q24);float Power_Q43=pow(MaxAB_Q24,_Intensity_Fade_In_Exponent_);float Value_At_T_Q26=mix(_Outer_Fuzz_Start_,_Outer_Fuzz_End_,Sqrt_F_Q27);float Product_Q23=_Max_Intensity_*Power_Q43;float Rect_Distance_Q33;float Inner_Distance_Q33;Fuzzy_Round_Rect_B33(X_Q42,Y_Q42,_Bevel_Radius_,_Bevel_Radius_,_Line_Width_,vUV,Value_At_T_Q26,_Outer_Fuzz_Start_,Rect_Distance_Q33,Inner_Distance_Q33);float Power_Q44=pow(Inner_Distance_Q33,_Blend_Exponent_);float Result_Q45=pow(BiasFunc(_Bias_,Rect_Distance_Q33),_Falloff_);vec4 Color_At_T_Q25=mix(_Inner_Color_,_Color_,Power_Q44);float Product_Q22=Result_Q45*Product_Q23;vec4 Result_Q28=Product_Q22*Color_At_T_Q25;vec4 Out_Color=Result_Q28;float Clip_Threshold=0.0;gl_FragColor=Out_Color;}`; + ShaderStore.ShadersStore[name350] = shader347; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlBackglow.vertex.js +var name351, shader348; +var init_mrdlBackglow_vertex2 = __esm(() => { + init_shaderStore(); + name351 = "mrdlBackglowVertexShader"; + shader348 = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;uniform float _Bevel_Radius_;uniform float _Line_Width_;uniform bool _Absolute_Sizes_;uniform float _Tuning_Motion_;uniform float _Motion_;uniform float _Max_Intensity_;uniform float _Intensity_Fade_In_Exponent_;uniform float _Outer_Fuzz_Start_;uniform float _Outer_Fuzz_End_;uniform vec4 _Color_;uniform vec4 _Inner_Color_;uniform float _Blend_Exponent_;uniform float _Falloff_;uniform float _Bias_;varying vec3 vNormal;varying vec2 vUV;void main() +{vec3 Dir_World_Q41=(world*vec4(tangent,0.0)).xyz;vec3 Dir_World_Q40=(world*vec4((cross(normal,tangent)),0.0)).xyz;float MaxAB_Q24=max(_Tuning_Motion_,_Motion_);float Length_Q16=length(Dir_World_Q41);float Length_Q17=length(Dir_World_Q40);bool Greater_Than_Q37=MaxAB_Q24>0.0;vec3 Sizes_Q35;vec2 XY_Q35;Sizes_Q35=(_Absolute_Sizes_ ? vec3(Length_Q16,Length_Q17,0) : vec3(Length_Q16/Length_Q17,1,0));XY_Q35=(uv-vec2(0.5,0.5))*Sizes_Q35.xy;vec3 Result_Q38=Greater_Than_Q37 ? position : vec3(0,0,0);vec3 Pos_World_Q39=(world*vec4(Result_Q38,1.0)).xyz;vec3 Position=Pos_World_Q39;vec3 Normal=Sizes_Q35;vec2 UV=XY_Q35;vec3 Tangent=vec3(0,0,0);vec3 Binormal=vec3(0,0,0);vec4 Color=vec4(1,1,1,1);gl_Position=viewProjection*vec4(Position,1);vNormal=Normal;vUV=UV;}`; + ShaderStore.ShadersStore[name351] = shader348; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/mrdl/mrdlBackglowMaterial.js +class MRDLBackglowMaterialDefines3 extends MaterialDefines { + constructor() { + super(); + this._needNormals = true; + this._needUVs = true; + this.rebuild(); + } +} + +class MRDLBackglowMaterial3 extends PushMaterial { + constructor(name352, scene50) { + super(name352, scene50); + this.bevelRadius = 0.16; + this.lineWidth = 0.16; + this.absoluteSizes = false; + this.tuningMotion = 0; + this.motion = 1; + this.maxIntensity = 0.7; + this.intensityFadeInExponent = 2; + this.outerFuzzStart = 0.04; + this.outerFuzzEnd = 0.04; + this.color = new Color4(0.682353, 0.698039, 1, 1); + this.innerColor = new Color4(0.356863, 0.392157, 0.796078, 1); + this.blendExponent = 1.5; + this.falloff = 2; + this.bias = 0.5; + this.alphaMode = Constants.ALPHA_ADD; + this.disableDepthWrite = true; + this.backFaceCulling = false; + } + needAlphaBlending() { + return true; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh88, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new MRDLBackglowMaterialDefines3; + } + const defines = subMesh11.materialDefines; + const scene50 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene50.getEngine(); + MaterialHelper.PrepareDefinesForAttributes(mesh88, defines, false, false); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + defines.IMAGEPROCESSINGPOSTPROCESS = scene50.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + if (defines.TANGENT) { + attribs.push(VertexBuffer.TangentKind); + } + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "mrdlBackglow"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "worldView", + "worldViewProjection", + "view", + "projection", + "viewProjection", + "cameraPosition", + "_Bevel_Radius_", + "_Line_Width_", + "_Absolute_Sizes_", + "_Tuning_Motion_", + "_Motion_", + "_Max_Intensity_", + "_Intensity_Fade_In_Exponent_", + "_Outer_Fuzz_Start_", + "_Outer_Fuzz_End_", + "_Color_", + "_Inner_Color_", + "_Blend_Exponent_", + "_Falloff_", + "_Bias_" + ]; + const samplers = []; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh88, subMesh11) { + const scene50 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene50.getTransformMatrix()); + this._activeEffect.setVector3("cameraPosition", scene50.activeCamera.position); + this._activeEffect.setFloat("_Bevel_Radius_", this.bevelRadius); + this._activeEffect.setFloat("_Line_Width_", this.lineWidth); + this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1 : 0); + this._activeEffect.setFloat("_Tuning_Motion_", this.tuningMotion); + this._activeEffect.setFloat("_Motion_", this.motion); + this._activeEffect.setFloat("_Max_Intensity_", this.maxIntensity); + this._activeEffect.setFloat("_Intensity_Fade_In_Exponent_", this.intensityFadeInExponent); + this._activeEffect.setFloat("_Outer_Fuzz_Start_", this.outerFuzzStart); + this._activeEffect.setFloat("_Outer_Fuzz_End_", this.outerFuzzEnd); + this._activeEffect.setDirectColor4("_Color_", this.color); + this._activeEffect.setDirectColor4("_Inner_Color_", this.innerColor); + this._activeEffect.setFloat("_Blend_Exponent_", this.blendExponent); + this._activeEffect.setFloat("_Falloff_", this.falloff); + this._activeEffect.setFloat("_Bias_", this.bias); + this._afterBind(mesh88, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + } + clone(name352) { + return SerializationHelper.Clone(() => new MRDLBackglowMaterial3(name352, this.getScene()), this); + } + serialize() { + const serializationObject = SerializationHelper.Serialize(this); + serializationObject.customType = "BABYLON.MRDLBackglowMaterial"; + return serializationObject; + } + getClassName() { + return "MRDLBackglowMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new MRDLBackglowMaterial3(source.name, scene50), source, scene50, rootUrl); + } +} +var init_mrdlBackglowMaterial2 = __esm(() => { + init_tslib_es62(); + init_math_color(); + init_constants(); + init_effectFallbacks(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_typeStore(); + init_decorators(); + init_buffer(); + init_mrdlBackglow_fragment2(); + init_mrdlBackglow_vertex2(); + __decorate2([ + serialize() + ], MRDLBackglowMaterial3.prototype, "bevelRadius", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial3.prototype, "lineWidth", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial3.prototype, "absoluteSizes", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial3.prototype, "tuningMotion", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial3.prototype, "motion", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial3.prototype, "maxIntensity", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial3.prototype, "intensityFadeInExponent", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial3.prototype, "outerFuzzStart", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial3.prototype, "outerFuzzEnd", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial3.prototype, "color", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial3.prototype, "innerColor", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial3.prototype, "blendExponent", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial3.prototype, "falloff", undefined); + __decorate2([ + serialize() + ], MRDLBackglowMaterial3.prototype, "bias", undefined); + RegisterClass("BABYLON.GUI.MRDLBackglowMaterial", MRDLBackglowMaterial3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlFrontplate.fragment.js +var name352, shader349; +var init_mrdlFrontplate_fragment2 = __esm(() => { + init_shaderStore(); + name352 = "mrdlFrontplatePixelShader"; + shader349 = `uniform vec3 cameraPosition;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Relative_To_Height_;uniform float _Filter_Width_;uniform vec4 _Edge_Color_;uniform float _Fade_Out_;uniform bool _Smooth_Edges_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform float _Blob_Pulse_Max_Size_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Gaze_Intensity_;uniform float _Gaze_Focus_;uniform sampler2D _Blob_Texture_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;void Scale_Color_B54( +vec4 Color, +float Scalar, +out vec4 Result) +{Result=Scalar*Color;} +void Scale_RGB_B50( +vec4 Color, +float Scalar, +out vec4 Result) +{Result=vec4(Scalar,Scalar,Scalar,1)*Color;} +void Proximity_Fragment_B51( +float Proximity_Max_Intensity, +float Proximity_Near_Radius, +vec4 Deltas, +float Show_Selection, +float Distance_Fade1, +float Distance_Fade2, +float Strength, +out float Proximity) +{float proximity1=(1.0-clamp(length(Deltas.xy)/Proximity_Near_Radius,0.0,1.0))*Distance_Fade1;float proximity2=(1.0-clamp(length(Deltas.zw)/Proximity_Near_Radius,0.0,1.0))*Distance_Fade2;Proximity=Strength*(Proximity_Max_Intensity*max(proximity1,proximity2) *(1.0-Show_Selection)+Show_Selection);} +void Blob_Fragment_B56( +vec2 UV, +vec3 Blob_Info, +sampler2D Blob_Texture, +out vec4 Blob_Color) +{float k=dot(UV,UV);Blob_Color=Blob_Info.y*texture(Blob_Texture,vec2(vec2(sqrt(k),Blob_Info.x).x,1.0-vec2(sqrt(k),Blob_Info.x).y))*(1.0-clamp(k,0.0,1.0));} +void Round_Rect_Fragment_B61( +float Radius, +vec4 Line_Color, +float Filter_Width, +float Line_Visibility, +vec4 Fill_Color, +bool Smooth_Edges, +vec4 Rect_Parms, +out float Inside_Rect) +{float d=length(max(abs(Rect_Parms.zw)-Rect_Parms.xy,0.0));float dx=max(fwidth(d)*Filter_Width,0.00001);Inside_Rect=Smooth_Edges ? clamp((Radius-d)/dx,0.0,1.0) : 1.0-step(Radius,d);} +void main() +{float Is_Quad_Q53;Is_Quad_Q53=vNormal.z;vec4 Blob_Color_Q56;Blob_Fragment_B56(vUV,vTangent,_Blob_Texture_,Blob_Color_Q56);float X_Q52;float Y_Q52;float Z_Q52;float W_Q52;X_Q52=vExtra3.x;Y_Q52=vExtra3.y;Z_Q52=vExtra3.z;W_Q52=vExtra3.w;float Proximity_Q51;Proximity_Fragment_B51(_Proximity_Max_Intensity_,_Proximity_Near_Radius_,vExtra2,X_Q52,Y_Q52,Z_Q52,1.0,Proximity_Q51);float Inside_Rect_Q61;Round_Rect_Fragment_B61(W_Q52,vec4(1,1,1,1),_Filter_Width_,1.0,vec4(0,0,0,0),_Smooth_Edges_,vExtra1,Inside_Rect_Q61);vec4 Result_Q50;Scale_RGB_B50(_Edge_Color_,Proximity_Q51,Result_Q50);vec4 Result_Q47=Inside_Rect_Q61*Blob_Color_Q56;vec4 Color_At_T_Q48=mix(Result_Q50,Result_Q47,Is_Quad_Q53);vec4 Result_Q54;Scale_Color_B54(Color_At_T_Q48,_Fade_Out_,Result_Q54);vec4 Out_Color=Result_Q54;float Clip_Threshold=0.001;bool To_sRGB=false;gl_FragColor=Out_Color;}`; + ShaderStore.ShadersStore[name352] = shader349; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlFrontplate.vertex.js +var name353, shader350; +var init_mrdlFrontplate_vertex2 = __esm(() => { + init_shaderStore(); + name353 = "mrdlFrontplateVertexShader"; + shader350 = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform float _Radius_;uniform float _Line_Width_;uniform bool _Relative_To_Height_;uniform float _Filter_Width_;uniform vec4 _Edge_Color_;uniform float _Fade_Out_;uniform bool _Smooth_Edges_;uniform bool _Blob_Enable_;uniform vec3 _Blob_Position_;uniform float _Blob_Intensity_;uniform float _Blob_Near_Size_;uniform float _Blob_Far_Size_;uniform float _Blob_Near_Distance_;uniform float _Blob_Far_Distance_;uniform float _Blob_Fade_Length_;uniform float _Blob_Inner_Fade_;uniform float _Blob_Pulse_;uniform float _Blob_Fade_;uniform float _Blob_Pulse_Max_Size_;uniform bool _Blob_Enable_2_;uniform vec3 _Blob_Position_2_;uniform float _Blob_Near_Size_2_;uniform float _Blob_Inner_Fade_2_;uniform float _Blob_Pulse_2_;uniform float _Blob_Fade_2_;uniform float _Gaze_Intensity_;uniform float _Gaze_Focus_;uniform sampler2D _Blob_Texture_;uniform float _Selection_Fuzz_;uniform float _Selected_;uniform float _Selection_Fade_;uniform float _Selection_Fade_Size_;uniform float _Selected_Distance_;uniform float _Selected_Fade_Length_;uniform float _Proximity_Max_Intensity_;uniform float _Proximity_Far_Distance_;uniform float _Proximity_Near_Radius_;uniform float _Proximity_Anisotropy_;uniform bool _Use_Global_Left_Index_;uniform bool _Use_Global_Right_Index_;uniform vec4 Global_Left_Index_Tip_Position;uniform vec4 Global_Right_Index_Tip_Position;varying vec3 vNormal;varying vec2 vUV;varying vec3 vTangent;varying vec4 vExtra1;varying vec4 vExtra2;varying vec4 vExtra3;void Blob_Vertex_B40( +vec3 Position, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +vec3 Blob_Position, +float Intensity, +float Blob_Near_Size, +float Blob_Far_Size, +float Blob_Near_Distance, +float Blob_Far_Distance, +vec4 Vx_Color, +vec2 UV, +vec3 Face_Center, +vec2 Face_Size, +vec2 In_UV, +float Blob_Fade_Length, +float Selection_Fade, +float Selection_Fade_Size, +float Inner_Fade, +float Blob_Pulse, +float Blob_Fade, +float Blob_Enabled, +float DistanceOffset, +out vec3 Out_Position, +out vec2 Out_UV, +out vec3 Blob_Info, +out vec2 Blob_Relative_UV) +{float blobSize,fadeIn;vec3 Hit_Position;Blob_Info=vec3(0.0,0.0,0.0);float Hit_Distance=dot(Blob_Position-Face_Center,Normal)+DistanceOffset*Blob_Far_Distance;Hit_Position=Blob_Position-Hit_Distance*Normal;float absD=abs(Hit_Distance);float lerpVal=clamp((absD-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);fadeIn=1.0-clamp((absD-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);float innerFade=1.0-clamp(-Hit_Distance/Inner_Fade,0.0,1.0);float farClip=clamp(1.0-step(Blob_Far_Distance+Blob_Fade_Length,absD),0.0,1.0);float size=mix(Blob_Near_Size,Blob_Far_Size,lerpVal)*farClip;blobSize=mix(size,Selection_Fade_Size,Selection_Fade)*innerFade*Blob_Enabled;Blob_Info.x=lerpVal*0.5+0.5;Blob_Info.y=fadeIn*Intensity*(1.0-Selection_Fade)*Blob_Fade;Blob_Info.x*=(1.0-Blob_Pulse);vec3 delta=Hit_Position-Face_Center;vec2 blobCenterXY=vec2(dot(delta,Tangent),dot(delta,Bitangent));vec2 quadUVin=2.0*UV-1.0; +vec2 blobXY=blobCenterXY+quadUVin*blobSize;vec2 blobClipped=clamp(blobXY,-Face_Size*0.5,Face_Size*0.5);vec2 blobUV=(blobClipped-blobCenterXY)/max(blobSize,0.0001)*2.0;vec3 blobCorner=Face_Center+blobClipped.x*Tangent+blobClipped.y*Bitangent;Out_Position=mix(Position,blobCorner,Vx_Color.rrr);Out_UV=mix(In_UV,blobUV,Vx_Color.rr);Blob_Relative_UV=blobClipped/Face_Size.y;} +void Round_Rect_Vertex_B36( +vec2 UV, +vec3 Tangent, +vec3 Binormal, +float Radius, +float Anisotropy, +vec2 Blob_Center_UV, +out vec2 Rect_UV, +out vec2 Scale_XY, +out vec4 Rect_Parms) +{Scale_XY=vec2(Anisotropy,1.0);Rect_UV=(UV-vec2(0.5,0.5))*Scale_XY;Rect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius);Rect_Parms.zw=Blob_Center_UV;} +vec2 ProjectProximity( +vec3 blobPosition, +vec3 position, +vec3 center, +vec3 dir, +vec3 xdir, +vec3 ydir, +out float vdistance +) +{vec3 delta=blobPosition-position;vec2 xy=vec2(dot(delta,xdir),dot(delta,ydir));vdistance=abs(dot(delta,dir));return xy;} +void Proximity_Vertex_B33( +vec3 Blob_Position, +vec3 Blob_Position_2, +vec3 Face_Center, +vec3 Position, +float Proximity_Far_Distance, +float Relative_Scale, +float Proximity_Anisotropy, +vec3 Normal, +vec3 Tangent, +vec3 Binormal, +out vec4 Extra, +out float Distance_To_Face, +out float Distance_Fade1, +out float Distance_Fade2) +{float distz1,distz2;Extra.xy=ProjectProximity(Blob_Position,Position,Face_Center,Normal,Tangent*Proximity_Anisotropy,Binormal,distz1)/Relative_Scale;Extra.zw=ProjectProximity(Blob_Position_2,Position,Face_Center,Normal,Tangent*Proximity_Anisotropy,Binormal,distz2)/Relative_Scale;Distance_To_Face=dot(Normal,Position-Face_Center);Distance_Fade1=1.0-clamp(distz1/Proximity_Far_Distance,0.0,1.0);Distance_Fade2=1.0-clamp(distz2/Proximity_Far_Distance,0.0,1.0);} +void Object_To_World_Pos_B12( +vec3 Pos_Object, +out vec3 Pos_World) +{Pos_World=(world*vec4(Pos_Object,1.0)).xyz;} +void Choose_Blob_B27( +vec4 Vx_Color, +vec3 Position1, +vec3 Position2, +bool Blob_Enable_1, +bool Blob_Enable_2, +float Near_Size_1, +float Near_Size_2, +float Blob_Inner_Fade_1, +float Blob_Inner_Fade_2, +float Blob_Pulse_1, +float Blob_Pulse_2, +float Blob_Fade_1, +float Blob_Fade_2, +out vec3 Position, +out float Near_Size, +out float Inner_Fade, +out float Blob_Enable, +out float Fade, +out float Pulse) +{Position=Position1*(1.0-Vx_Color.g)+Vx_Color.g*Position2;float b1=Blob_Enable_1 ? 1.0 : 0.0;float b2=Blob_Enable_2 ? 1.0 : 0.0;Blob_Enable=b1+(b2-b1)*Vx_Color.g;Pulse=Blob_Pulse_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Pulse_2;Fade=Blob_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Fade_2;Near_Size=Near_Size_1*(1.0-Vx_Color.g)+Vx_Color.g*Near_Size_2;Inner_Fade=Blob_Inner_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Inner_Fade_2;} +void Move_Verts_B32( +vec2 UV, +float Radius, +float Anisotropy, +float Line_Width, +float Visible, +out vec3 New_P, +out vec2 New_UV) +{vec2 xy=2.0*UV-vec2(0.5,0.5);vec2 center=clamp(xy,0.0,1.0);vec2 delta=2.0*(xy-center);float deltaLength=length(delta);vec2 aniso=vec2(1.0/Anisotropy,1.0);center=(center-vec2(0.5,0.5))*(1.0-2.0*Radius*aniso);New_UV=vec2((2.0-2.0*deltaLength)*Visible,0.0);float deltaRadius= (Radius-Line_Width*New_UV.x);New_P.xy=(center+deltaRadius/deltaLength *aniso*delta);New_P.z=0.0;} +void Object_To_World_Dir_B14( +vec3 Dir_Object, +out vec3 Binormal_World) +{Binormal_World=(world*vec4(Dir_Object,0.0)).xyz;} +void Proximity_Visibility_B55( +float Selection, +vec3 Proximity_Center, +vec3 Proximity_Center_2, +float Proximity_Far_Distance, +float Proximity_Radius, +vec3 Face_Center, +vec3 Normal, +vec2 Face_Size, +float Gaze, +out float Width) +{float boxMaxSize=length(Face_Size)*0.5;float d1=dot(Proximity_Center-Face_Center,Normal);vec3 blob1=Proximity_Center-d1*Normal;float d2=dot(Proximity_Center_2-Face_Center,Normal);vec3 blob2=Proximity_Center_2-d2*Normal;vec3 delta1=blob1-Face_Center;vec3 delta2=blob2-Face_Center;float dist1=dot(delta1,delta1);float dist2=dot(delta2,delta2);float nearestProxDist=sqrt(min(dist1,dist2));Width=(1.0-step(boxMaxSize+Proximity_Radius,nearestProxDist))*(1.0-step(Proximity_Far_Distance,min(d1,d2))*(1.0-step(0.0001,Selection)));Width=max(Gaze,Width);} +vec2 ramp2(vec2 start,vec2 end,vec2 x) +{return clamp((x-start)/(end-start),vec2(0.0,0.0),vec2(1.0,1.0));} +float computeSelection( +vec3 blobPosition, +vec3 normal, +vec3 tangent, +vec3 bitangent, +vec3 faceCenter, +vec2 faceSize, +float selectionFuzz, +float farDistance, +float fadeLength +) +{vec3 delta=blobPosition-faceCenter;float absD=abs(dot(delta,normal));float fadeIn=1.0-clamp((absD-farDistance)/fadeLength,0.0,1.0);vec2 blobCenterXY=vec2(dot(delta,tangent),dot(delta,bitangent));vec2 innerFace=faceSize*(1.0-selectionFuzz)*0.5;vec2 selectPulse=ramp2(-faceSize*0.5,-innerFace,blobCenterXY)-ramp2(innerFace,faceSize*0.5,blobCenterXY);return selectPulse.x*selectPulse.y*fadeIn;} +void Selection_Vertex_B31( +vec3 Blob_Position, +vec3 Blob_Position_2, +vec3 Face_Center, +vec2 Face_Size, +vec3 Normal, +vec3 Tangent, +vec3 Bitangent, +float Selection_Fuzz, +float Selected, +float Far_Distance, +float Fade_Length, +vec3 Active_Face_Dir, +out float Show_Selection) +{float select1=computeSelection(Blob_Position,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);float select2=computeSelection(Blob_Position_2,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);Show_Selection=mix(max(select1,select2),1.0,Selected);} +void main() +{vec3 Vec3_Q29=vec3(vec2(0,0).x,vec2(0,0).y,color.r);vec3 Nrm_World_Q24;Nrm_World_Q24=normalize((world*vec4(normal,0.0)).xyz);vec3 Face_Center_Q30;Face_Center_Q30=(world*vec4(vec3(0,0,0),1.0)).xyz;vec3 Tangent_World_Q13;Tangent_World_Q13=(world*vec4(tangent,0.0)).xyz;vec3 Result_Q42;Result_Q42=_Use_Global_Left_Index_ ? Global_Left_Index_Tip_Position.xyz : _Blob_Position_;vec3 Result_Q43;Result_Q43=_Use_Global_Right_Index_ ? Global_Right_Index_Tip_Position.xyz : _Blob_Position_2_;float Value_At_T_Q58=mix(_Blob_Near_Size_,_Blob_Pulse_Max_Size_,_Blob_Pulse_);float Value_At_T_Q59=mix(_Blob_Near_Size_2_,_Blob_Pulse_Max_Size_,_Blob_Pulse_2_);vec3 Cross_Q70=cross(normal,tangent);float Product_Q45=_Gaze_Intensity_*_Gaze_Focus_;float Step_Q46=step(0.0001,Product_Q45);vec3 Tangent_World_N_Q15=normalize(Tangent_World_Q13);vec3 Position_Q27;float Near_Size_Q27;float Inner_Fade_Q27;float Blob_Enable_Q27;float Fade_Q27;float Pulse_Q27;Choose_Blob_B27(color,Result_Q42,Result_Q43,_Blob_Enable_,_Blob_Enable_2_,Value_At_T_Q58,Value_At_T_Q59,_Blob_Inner_Fade_,_Blob_Inner_Fade_2_,_Blob_Pulse_,_Blob_Pulse_2_,_Blob_Fade_,_Blob_Fade_2_,Position_Q27,Near_Size_Q27,Inner_Fade_Q27,Blob_Enable_Q27,Fade_Q27,Pulse_Q27);vec3 Binormal_World_Q14;Object_To_World_Dir_B14(Cross_Q70,Binormal_World_Q14);float Anisotropy_Q21=length(Tangent_World_Q13)/length(Binormal_World_Q14);vec3 Binormal_World_N_Q16=normalize(Binormal_World_Q14);vec2 Face_Size_Q35;float ScaleY_Q35;Face_Size_Q35=vec2(length(Tangent_World_Q13),length(Binormal_World_Q14));ScaleY_Q35=Face_Size_Q35.y;float Out_Radius_Q38;float Out_Line_Width_Q38;Out_Radius_Q38=_Relative_To_Height_ ? _Radius_ : _Radius_/ScaleY_Q35;Out_Line_Width_Q38=_Relative_To_Height_ ? _Line_Width_ : _Line_Width_/ScaleY_Q35;float Show_Selection_Q31;Selection_Vertex_B31(Result_Q42,Result_Q43,Face_Center_Q30,Face_Size_Q35,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,_Selection_Fuzz_,_Selected_,_Selected_Distance_,_Selected_Fade_Length_,vec3(0,0,-1),Show_Selection_Q31);float MaxAB_Q41=max(Show_Selection_Q31,Product_Q45);float Width_Q55;Proximity_Visibility_B55(Show_Selection_Q31,Result_Q42,Result_Q43,_Proximity_Far_Distance_,_Proximity_Near_Radius_,Face_Center_Q30,Nrm_World_Q24,Face_Size_Q35,Step_Q46,Width_Q55);vec3 New_P_Q32;vec2 New_UV_Q32;Move_Verts_B32(uv,Out_Radius_Q38,Anisotropy_Q21,Out_Line_Width_Q38,Width_Q55,New_P_Q32,New_UV_Q32);vec3 Pos_World_Q12;Object_To_World_Pos_B12(New_P_Q32,Pos_World_Q12);vec3 Out_Position_Q40;vec2 Out_UV_Q40;vec3 Blob_Info_Q40;vec2 Blob_Relative_UV_Q40;Blob_Vertex_B40(Pos_World_Q12,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,Position_Q27,_Blob_Intensity_,Near_Size_Q27,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,color,uv,Face_Center_Q30,Face_Size_Q35,New_UV_Q32,_Blob_Fade_Length_,_Selection_Fade_,_Selection_Fade_Size_,Inner_Fade_Q27,Pulse_Q27,Fade_Q27,Blob_Enable_Q27,0.0,Out_Position_Q40,Out_UV_Q40,Blob_Info_Q40,Blob_Relative_UV_Q40);vec2 Rect_UV_Q36;vec2 Scale_XY_Q36;vec4 Rect_Parms_Q36;Round_Rect_Vertex_B36(New_UV_Q32,Tangent_World_Q13,Binormal_World_Q14,Out_Radius_Q38,Anisotropy_Q21,Blob_Relative_UV_Q40,Rect_UV_Q36,Scale_XY_Q36,Rect_Parms_Q36);vec4 Extra_Q33;float Distance_To_Face_Q33;float Distance_Fade1_Q33;float Distance_Fade2_Q33;Proximity_Vertex_B33(Result_Q42,Result_Q43,Face_Center_Q30,Pos_World_Q12,_Proximity_Far_Distance_,1.0,_Proximity_Anisotropy_,Nrm_World_Q24,Tangent_World_N_Q15,Binormal_World_N_Q16,Extra_Q33,Distance_To_Face_Q33,Distance_Fade1_Q33,Distance_Fade2_Q33);vec4 Vec4_Q37=vec4(MaxAB_Q41,Distance_Fade1_Q33,Distance_Fade2_Q33,Out_Radius_Q38);vec3 Position=Out_Position_Q40;vec3 Normal=Vec3_Q29;vec2 UV=Out_UV_Q40;vec3 Tangent=Blob_Info_Q40;vec3 Binormal=vec3(0,0,0);vec4 Color=vec4(1,1,1,1);vec4 Extra1=Rect_Parms_Q36;vec4 Extra2=Extra_Q33;vec4 Extra3=Vec4_Q37;gl_Position=viewProjection*vec4(Position,1);vNormal=Normal;vUV=UV;vTangent=Tangent;vExtra1=Extra1;vExtra2=Extra2;vExtra3=Extra3;}`; + ShaderStore.ShadersStore[name353] = shader350; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/mrdl/mrdlFrontplateMaterial.js +class MRDLFrontplateMaterialDefines3 extends MaterialDefines { + constructor() { + super(); + this.SMOOTH_EDGES = true; + this._needNormals = true; + this._needUVs = true; + this.rebuild(); + } +} + +class MRDLFrontplateMaterial3 extends PushMaterial { + constructor(name354, scene50) { + super(name354, scene50); + this.radius = 0.12; + this.lineWidth = 0.01; + this.relativeToHeight = false; + this._filterWidth = 1; + this.edgeColor = new Color4(0.53, 0.53, 0.53, 1); + this.blobEnable = true; + this.blobPosition = new Vector3(100, 100, 100); + this.blobIntensity = 0.5; + this.blobNearSize = 0.032; + this.blobFarSize = 0.048; + this.blobNearDistance = 0.008; + this.blobFarDistance = 0.064; + this.blobFadeLength = 0.04; + this.blobInnerFade = 0.01; this.blobPulse = 0; this.blobFade = 1; - this.blobPosition2 = new Vector3(0.2, 0, 0.1); - this.blobNearSize2 = 0.01; + this.blobPulseMaxSize = 0.05; + this.blobEnable2 = true; + this.blobPosition2 = new Vector3(10, 10.1, -0.6); + this.blobNearSize2 = 0.008; + this.blobInnerFade2 = 0.1; this.blobPulse2 = 0; this.blobFade2 = 1; - this.blobTexture = new Texture("", this.getScene()); - this.leftIndexPosition = new Vector3(0, 0, 1); - this.rightIndexPosition = new Vector3(-1, -1, -1); - this.leftIndexMiddlePosition = new Vector3(0, 0, 0); - this.rightIndexMiddlePosition = new Vector3(0, 0, 0); - this.decalScaleXY = new Vector2(1.5, 1.5); - this.decalFrontOnly = true; - this.rimIntensity = 0.287; - this.rimHueShift = 0; - this.rimSaturationShift = 0; - this.rimValueShift = -1; - this.iridescenceIntensity = 0; - this.useGlobalLeftIndex = 1; - this.useGlobalRightIndex = 1; - this.globalLeftIndexTipProximity = 0; - this.globalRightIndexTipProximity = 0; - this.globalLeftIndexTipPosition = new Vector4(0.5, 0, -0.55, 1); - this.globaRightIndexTipPosition = new Vector4(0, 0, 0, 1); - this.globalLeftThumbTipPosition = new Vector4(0.5, 0, -0.55, 1); - this.globalRightThumbTipPosition = new Vector4(0, 0, 0, 1); - this.globalLeftIndexMiddlePosition = new Vector4(0.5, 0, -0.55, 1); - this.globalRightIndexMiddlePosition = new Vector4(0, 0, 0, 1); - this.alphaMode = Constants.ALPHA_DISABLE; + this.gazeIntensity = 0.8; + this.gazeFocus = 0; + this.selectionFuzz = 0.5; + this.selected = 1; + this.selectionFade = 0.2; + this.selectionFadeSize = 0; + this.selectedDistance = 0.08; + this.selectedFadeLength = 0.08; + this.proximityMaxIntensity = 0.45; + this.proximityFarDistance = 0.16; + this.proximityNearRadius = 0.016; + this.proximityAnisotropy = 1; + this.useGlobalLeftIndex = true; + this.useGlobalRightIndex = true; + this.fadeOut = 1; + this.alphaMode = Constants.ALPHA_ADD; + this.disableDepthWrite = true; this.backFaceCulling = false; - this._blueGradientTexture = new Texture(MRDLSliderBarMaterial.BLUE_GRADIENT_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE); - this._decalTexture = new Texture("", this.getScene()); - this._reflectionMapTexture = new Texture("", this.getScene()); - this._indirectEnvTexture = new Texture("", this.getScene()); + this._blobTexture = new Texture(MRDLFrontplateMaterial3.BLOB_TEXTURE_URL, scene50, true, false, Texture.NEAREST_SAMPLINGMODE); + } + needAlphaBlending() { + return true; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh88, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new MRDLFrontplateMaterialDefines3; + } + const defines = subMesh11.materialDefines; + const scene50 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene50.getEngine(); + MaterialHelper.PrepareDefinesForAttributes(mesh88, defines, false, false); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + defines.IMAGEPROCESSINGPOSTPROCESS = scene50.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + if (defines.TANGENT) { + attribs.push(VertexBuffer.TangentKind); + } + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "mrdlFrontplate"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "worldView", + "worldViewProjection", + "view", + "projection", + "viewProjection", + "cameraPosition", + "_Radius_", + "_Line_Width_", + "_Relative_To_Height_", + "_Filter_Width_", + "_Edge_Color_", + "_Fade_Out_", + "_Smooth_Edges_", + "_Blob_Enable_", + "_Blob_Position_", + "_Blob_Intensity_", + "_Blob_Near_Size_", + "_Blob_Far_Size_", + "_Blob_Near_Distance_", + "_Blob_Far_Distance_", + "_Blob_Fade_Length_", + "_Blob_Inner_Fade_", + "_Blob_Pulse_", + "_Blob_Fade_", + "_Blob_Pulse_Max_Size_", + "_Blob_Enable_2_", + "_Blob_Position_2_", + "_Blob_Near_Size_2_", + "_Blob_Inner_Fade_2_", + "_Blob_Pulse_2_", + "_Blob_Fade_2_", + "_Gaze_Intensity_", + "_Gaze_Focus_", + "_Blob_Texture_", + "_Selection_Fuzz_", + "_Selected_", + "_Selection_Fade_", + "_Selection_Fade_Size_", + "_Selected_Distance_", + "_Selected_Fade_Length_", + "_Proximity_Max_Intensity_", + "_Proximity_Far_Distance_", + "_Proximity_Near_Radius_", + "_Proximity_Anisotropy_", + "Global_Left_Index_Tip_Position", + "Global_Right_Index_Tip_Position", + "_Use_Global_Left_Index_", + "_Use_Global_Right_Index_" + ]; + const samplers = []; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh88, subMesh11) { + const scene50 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene50.getTransformMatrix()); + this._activeEffect.setVector3("cameraPosition", scene50.activeCamera.position); + this._activeEffect.setFloat("_Radius_", this.radius); + this._activeEffect.setFloat("_Line_Width_", this.lineWidth); + this._activeEffect.setFloat("_Relative_To_Height_", this.relativeToHeight ? 1 : 0); + this._activeEffect.setFloat("_Filter_Width_", this._filterWidth); + this._activeEffect.setDirectColor4("_Edge_Color_", this.edgeColor); + this._activeEffect.setFloat("_Fade_Out_", this.fadeOut); + this._activeEffect.setFloat("_Blob_Enable_", this.blobEnable ? 1 : 0); + this._activeEffect.setVector3("_Blob_Position_", this.blobPosition); + this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity); + this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize); + this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize); + this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance); + this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance); + this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength); + this._activeEffect.setFloat("_Blob_Inner_Fade_", this.blobInnerFade); + this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse); + this._activeEffect.setFloat("_Blob_Fade_", this.blobFade); + this._activeEffect.setFloat("_Blob_Pulse_Max_Size_", this.blobPulseMaxSize); + this._activeEffect.setFloat("_Blob_Enable_2_", this.blobEnable2 ? 1 : 0); + this._activeEffect.setVector3("_Blob_Position_2_", this.blobPosition2); + this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2); + this._activeEffect.setFloat("_Blob_Inner_Fade_2_", this.blobInnerFade2); + this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2); + this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2); + this._activeEffect.setFloat("_Gaze_Intensity_", this.gazeIntensity); + this._activeEffect.setFloat("_Gaze_Focus_", this.gazeFocus); + this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture); + this._activeEffect.setFloat("_Selection_Fuzz_", this.selectionFuzz); + this._activeEffect.setFloat("_Selected_", this.selected); + this._activeEffect.setFloat("_Selection_Fade_", this.selectionFade); + this._activeEffect.setFloat("_Selection_Fade_Size_", this.selectionFadeSize); + this._activeEffect.setFloat("_Selected_Distance_", this.selectedDistance); + this._activeEffect.setFloat("_Selected_Fade_Length_", this.selectedFadeLength); + this._activeEffect.setFloat("_Proximity_Max_Intensity_", this.proximityMaxIntensity); + this._activeEffect.setFloat("_Proximity_Far_Distance_", this.proximityFarDistance); + this._activeEffect.setFloat("_Proximity_Near_Radius_", this.proximityNearRadius); + this._activeEffect.setFloat("_Proximity_Anisotropy_", this.proximityAnisotropy); + this._activeEffect.setFloat("_Use_Global_Left_Index_", this.useGlobalLeftIndex ? 1 : 0); + this._activeEffect.setFloat("_Use_Global_Right_Index_", this.useGlobalRightIndex ? 1 : 0); + this._afterBind(mesh88, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + } + clone(name354) { + return SerializationHelper.Clone(() => new MRDLFrontplateMaterial3(name354, this.getScene()), this); + } + serialize() { + const serializationObject = SerializationHelper.Serialize(this); + serializationObject.customType = "BABYLON.MRDLFrontplateMaterial"; + return serializationObject; + } + getClassName() { + return "MRDLFrontplateMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new MRDLFrontplateMaterial3(source.name, scene50), source, scene50, rootUrl); + } +} +var init_mrdlFrontplateMaterial2 = __esm(() => { + init_tslib_es62(); + init_math_color(); + init_constants(); + init_effectFallbacks(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_typeStore(); + init_decorators(); + init_math_vector(); + init_buffer(); + init_texture(); + init_mrdlFrontplate_fragment2(); + init_mrdlFrontplate_vertex2(); + MRDLFrontplateMaterial3.BLOB_TEXTURE_URL = ""; + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "radius", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "lineWidth", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "relativeToHeight", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "edgeColor", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobEnable", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobPosition", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobIntensity", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobNearSize", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobFarSize", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobNearDistance", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobFarDistance", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobFadeLength", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobInnerFade", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobPulse", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobFade", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobPulseMaxSize", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobEnable2", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobPosition2", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobNearSize2", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobInnerFade2", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobPulse2", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "blobFade2", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "gazeIntensity", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "gazeFocus", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "selectionFuzz", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "selected", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "selectionFade", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "selectionFadeSize", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "selectedDistance", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "selectedFadeLength", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "proximityMaxIntensity", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "proximityFarDistance", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "proximityNearRadius", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "proximityAnisotropy", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "useGlobalLeftIndex", undefined); + __decorate2([ + serialize() + ], MRDLFrontplateMaterial3.prototype, "useGlobalRightIndex", undefined); + RegisterClass("BABYLON.GUI.MRDLFrontplateMaterial", MRDLFrontplateMaterial3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlInnerquad.fragment.js +var name354, shader351; +var init_mrdlInnerquad_fragment2 = __esm(() => { + init_shaderStore(); + name354 = "mrdlInnerquadPixelShader"; + shader351 = `uniform vec3 cameraPosition;varying vec2 vUV;varying vec3 vTangent;uniform vec4 _Color_;uniform float _Radius_;uniform bool _Fixed_Radius_;uniform float _Filter_Width_;uniform float _Glow_Fraction_;uniform float _Glow_Max_;uniform float _Glow_Falloff_;float FilterStep_Bid194(float edge,float x,float filterWidth) +{float dx=max(1.0E-5,fwidth(x)*filterWidth);return max((x+dx*0.5-max(edge,x-dx*0.5))/dx,0.0);} +void Round_Rect_B194( +float Size_X, +float Size_Y, +float Radius, +vec4 Rect_Color, +float Filter_Width, +vec2 UV, +float Glow_Fraction, +float Glow_Max, +float Glow_Falloff, +out vec4 Color) +{vec2 halfSize=vec2(Size_X,Size_Y)*0.5;vec2 r=max(min(vec2(Radius,Radius),halfSize),vec2(0.01,0.01));vec2 v=abs(UV);vec2 nearestp=min(v,halfSize-r);vec2 delta=(v-nearestp)/max(vec2(0.01,0.01),r);float Distance=length(delta);float insideRect=1.0-FilterStep_Bid194(1.0-Glow_Fraction,Distance,Filter_Width);float glow=clamp((1.0-Distance)/Glow_Fraction,0.0,1.0);glow=pow(glow,Glow_Falloff);Color=Rect_Color*max(insideRect,glow*Glow_Max);} +void main() +{float X_Q192;float Y_Q192;float Z_Q192;X_Q192=vTangent.x;Y_Q192=vTangent.y;Z_Q192=vTangent.z;vec4 Color_Q194;Round_Rect_B194(X_Q192,1.0,Y_Q192,_Color_,_Filter_Width_,vUV,_Glow_Fraction_,_Glow_Max_,_Glow_Falloff_,Color_Q194);vec4 Out_Color=Color_Q194;float Clip_Threshold=0.0;gl_FragColor=Out_Color;} +`; + ShaderStore.ShadersStore[name354] = shader351; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/mrdl/shaders/mrdlInnerquad.vertex.js +var name355, shader352; +var init_mrdlInnerquad_vertex2 = __esm(() => { + init_shaderStore(); + name355 = "mrdlInnerquadVertexShader"; + shader352 = `uniform mat4 world;uniform mat4 viewProjection;uniform vec3 cameraPosition;attribute vec3 position;attribute vec3 normal;attribute vec2 uv;attribute vec3 tangent;attribute vec4 color;uniform vec4 _Color_;uniform float _Radius_;uniform bool _Fixed_Radius_;uniform float _Filter_Width_;uniform float _Glow_Fraction_;uniform float _Glow_Max_;uniform float _Glow_Falloff_;varying vec2 vUV;varying vec3 vTangent;void main() +{vec3 Pos_World_Q189;Pos_World_Q189=(world*vec4(position,1.0)).xyz;vec3 Dir_World_Q190;Dir_World_Q190=(world*vec4(tangent,0.0)).xyz;vec3 Dir_World_Q191;Dir_World_Q191=(world*vec4((cross(normal,tangent)),0.0)).xyz;float Length_Q180=length(Dir_World_Q190);float Length_Q181=length(Dir_World_Q191);float Quotient_Q184=Length_Q180/Length_Q181;float Quotient_Q195=_Radius_/Length_Q181;vec2 Result_Q193;Result_Q193=vec2((uv.x-0.5)*Length_Q180/Length_Q181,(uv.y-0.5));float Result_Q198=_Fixed_Radius_ ? Quotient_Q195 : _Radius_;vec3 Vec3_Q183=vec3(Quotient_Q184,Result_Q198,0);vec3 Position=Pos_World_Q189;vec3 Normal=vec3(0,0,0);vec2 UV=Result_Q193;vec3 Tangent=Vec3_Q183;vec3 Binormal=vec3(0,0,0);vec4 Color=color;gl_Position=viewProjection*vec4(Position,1);vUV=UV;vTangent=Tangent;} +`; + ShaderStore.ShadersStore[name355] = shader352; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/mrdl/mrdlInnerquadMaterial.js +class MRDLInnerquadMaterialDefines3 extends MaterialDefines { + constructor() { + super(); + this._needNormals = true; + this._needUVs = true; + this.rebuild(); + } +} + +class MRDLInnerquadMaterial3 extends PushMaterial { + constructor(name356, scene50) { + super(name356, scene50); + this.color = new Color4(1, 1, 1, 0.05); + this.radius = 0.12; + this.fixedRadius = true; + this._filterWidth = 1; + this.glowFraction = 0; + this.glowMax = 0.5; + this.glowFalloff = 2; + this.alphaMode = Constants.ALPHA_COMBINE; + this.backFaceCulling = false; + } + needAlphaBlending() { + return true; + } + needAlphaTesting() { + return false; + } + getAlphaTestTexture() { + return null; + } + isReadyForSubMesh(mesh88, subMesh11) { + if (this.isFrozen) { + if (subMesh11.effect && subMesh11.effect._wasPreviouslyReady) { + return true; + } + } + if (!subMesh11.materialDefines) { + subMesh11.materialDefines = new MRDLInnerquadMaterialDefines3; + } + const defines = subMesh11.materialDefines; + const scene50 = this.getScene(); + if (this._isReadyForSubMesh(subMesh11)) { + return true; + } + const engine47 = scene50.getEngine(); + MaterialHelper.PrepareDefinesForAttributes(mesh88, defines, true, false); + if (defines.isDirty) { + defines.markAsProcessed(); + scene50.resetCachedMaterial(); + const fallbacks = new EffectFallbacks; + if (defines.FOG) { + fallbacks.addFallback(1, "FOG"); + } + MaterialHelper.HandleFallbacksForShadows(defines, fallbacks); + defines.IMAGEPROCESSINGPOSTPROCESS = scene50.imageProcessingConfiguration.applyByPostProcess; + const attribs = [VertexBuffer.PositionKind]; + if (defines.NORMAL) { + attribs.push(VertexBuffer.NormalKind); + } + if (defines.UV1) { + attribs.push(VertexBuffer.UVKind); + } + if (defines.UV2) { + attribs.push(VertexBuffer.UV2Kind); + } + if (defines.VERTEXCOLOR) { + attribs.push(VertexBuffer.ColorKind); + } + if (defines.TANGENT) { + attribs.push(VertexBuffer.TangentKind); + } + MaterialHelper.PrepareAttributesForInstances(attribs, defines); + const shaderName = "mrdlInnerquad"; + const join = defines.toString(); + const uniforms2 = [ + "world", + "worldView", + "worldViewProjection", + "view", + "projection", + "viewProjection", + "cameraPosition", + "_Color_", + "_Radius_", + "_Fixed_Radius_", + "_Filter_Width_", + "_Glow_Fraction_", + "_Glow_Max_", + "_Glow_Falloff_" + ]; + const samplers = []; + const uniformBuffers = []; + MaterialHelper.PrepareUniformsAndSamplersList({ + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines, + maxSimultaneousLights: 4 + }); + subMesh11.setEffect(scene50.getEngine().createEffect(shaderName, { + attributes: attribs, + uniformsNames: uniforms2, + uniformBuffersNames: uniformBuffers, + samplers, + defines: join, + fallbacks, + onCompiled: this.onCompiled, + onError: this.onError, + indexParameters: { maxSimultaneousLights: 4 } + }, engine47), defines); + } + if (!subMesh11.effect || !subMesh11.effect.isReady()) { + return false; + } + defines._renderId = scene50.getRenderId(); + subMesh11.effect._wasPreviouslyReady = true; + return true; + } + bindForSubMesh(world, mesh88, subMesh11) { + const scene50 = this.getScene(); + const defines = subMesh11.materialDefines; + if (!defines) { + return; + } + const effect20 = subMesh11.effect; + if (!effect20) { + return; + } + this._activeEffect = effect20; + this.bindOnlyWorldMatrix(world); + this._activeEffect.setMatrix("viewProjection", scene50.getTransformMatrix()); + this._activeEffect.setVector3("cameraPosition", scene50.activeCamera.position); + this._activeEffect.setDirectColor4("_Color_", this.color); + this._activeEffect.setFloat("_Radius_", this.radius); + this._activeEffect.setFloat("_Fixed_Radius_", this.fixedRadius ? 1 : 0); + this._activeEffect.setFloat("_Filter_Width_", this._filterWidth); + this._activeEffect.setFloat("_Glow_Fraction_", this.glowFraction); + this._activeEffect.setFloat("_Glow_Max_", this.glowMax); + this._activeEffect.setFloat("_Glow_Falloff_", this.glowFalloff); + this._afterBind(mesh88, this._activeEffect); + } + getAnimatables() { + return []; + } + dispose(forceDisposeEffect) { + super.dispose(forceDisposeEffect); + } + clone(name356) { + return SerializationHelper.Clone(() => new MRDLInnerquadMaterial3(name356, this.getScene()), this); + } + serialize() { + const serializationObject = SerializationHelper.Serialize(this); + serializationObject.customType = "BABYLON.MRDLInnerquadMaterial"; + return serializationObject; + } + getClassName() { + return "MRDLInnerquadMaterial"; + } + static Parse(source, scene50, rootUrl) { + return SerializationHelper.Parse(() => new MRDLInnerquadMaterial3(source.name, scene50), source, scene50, rootUrl); + } +} +var init_mrdlInnerquadMaterial2 = __esm(() => { + init_tslib_es62(); + init_math_color(); + init_constants(); + init_effectFallbacks(); + init_materialDefines(); + init_materialHelper(); + init_pushMaterial(); + init_typeStore(); + init_decorators(); + init_buffer(); + init_mrdlInnerquad_fragment2(); + init_mrdlInnerquad_vertex2(); + __decorate2([ + serialize() + ], MRDLInnerquadMaterial3.prototype, "color", undefined); + __decorate2([ + serialize() + ], MRDLInnerquadMaterial3.prototype, "radius", undefined); + __decorate2([ + serialize() + ], MRDLInnerquadMaterial3.prototype, "fixedRadius", undefined); + __decorate2([ + serialize() + ], MRDLInnerquadMaterial3.prototype, "glowFraction", undefined); + __decorate2([ + serialize() + ], MRDLInnerquadMaterial3.prototype, "glowMax", undefined); + __decorate2([ + serialize() + ], MRDLInnerquadMaterial3.prototype, "glowFalloff", undefined); + RegisterClass("BABYLON.GUI.MRDLInnerquadMaterial", MRDLInnerquadMaterial3); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/MRTK3/touchHolographicButton.js +class TouchHolographicButton6 extends TouchButton3D3 { + _disposeTooltip() { + this._tooltipFade = null; + if (this._tooltipTextBlock) { + this._tooltipTextBlock.dispose(); + } + if (this._tooltipTexture) { + this._tooltipTexture.dispose(); + } + if (this._tooltipMesh) { + this._tooltipMesh.dispose(); + } + this.onPointerEnterObservable.remove(this._tooltipHoverObserver); + this.onPointerOutObservable.remove(this._tooltipOutObserver); + } + set renderingGroupId(id) { + this._backPlate.renderingGroupId = id; + this._textPlate.renderingGroupId = id; + this._frontPlate.renderingGroupId = id; + this._backGlow.renderingGroupId = id; + this._innerQuad.renderingGroupId = id; + if (this._tooltipMesh) { + this._tooltipMesh.renderingGroupId = id; + } + } + get renderingGroupId() { + return this._backPlate.renderingGroupId; + } + get mesh() { + return this._backPlate; + } + set tooltipText(text) { + if (!text) { + this._disposeTooltip(); + return; + } + if (!this._tooltipFade) { + const rightHandedScene = this._backPlate._scene.useRightHandedSystem; + this._tooltipMesh = CreatePlane("", { size: 1 }, this._backPlate._scene); + this._tooltipMesh.position = Vector3.Down().scale(0.7).add(Vector3.Forward(rightHandedScene).scale(-0.15)); + this._tooltipMesh.isPickable = false; + this._tooltipMesh.parent = this._frontPlateCollisionMesh; + this._tooltipTexture = AdvancedDynamicTexture3.CreateForMesh(this._tooltipMesh); + const tooltipBackground = new Rectangle3; + tooltipBackground.height = 0.25; + tooltipBackground.width = 0.8; + tooltipBackground.cornerRadius = 25; + tooltipBackground.color = "#ffffff"; + tooltipBackground.thickness = 20; + tooltipBackground.background = "#060668"; + this._tooltipTexture.addControl(tooltipBackground); + this._tooltipTextBlock = new TextBlock3; + this._tooltipTextBlock.color = "white"; + this._tooltipTextBlock.fontSize = 100; + this._tooltipTexture.addControl(this._tooltipTextBlock); + this._tooltipFade = new FadeInOutBehavior; + this._tooltipFade.delay = 500; + this._tooltipMesh.addBehavior(this._tooltipFade); + this._tooltipHoverObserver = this.onPointerEnterObservable.add(() => { + if (this._tooltipFade) { + this._tooltipFade.fadeIn(true); + } + }); + this._tooltipOutObserver = this.onPointerOutObservable.add(() => { + if (this._tooltipFade) { + this._tooltipFade.fadeIn(false); + } + }); + } + if (this._tooltipTextBlock) { + this._tooltipTextBlock.text = text; + } + } + get tooltipText() { + var _a; + return ((_a = this._tooltipTextBlock) === null || _a === undefined ? undefined : _a.text) || null; + } + get text() { + return this._text; + } + set text(value) { + if (this._text === value) { + return; + } + this._text = value; + this._rebuildContent(); + } + get subtext() { + return this._subtext; + } + set subtext(value) { + if (this._subtext === value) { + return; + } + this._subtext = value; + this._rebuildContent(); + } + get imageUrl() { + return this._imageUrl; + } + set imageUrl(value) { + if (this._imageUrl === value) { + return; + } + this._imageUrl = value; + this._rebuildContent(); + } + get backMaterial() { + return this._backMaterial; + } + get frontMaterial() { + return this._frontMaterial; + } + get backGlowMaterial() { + return this._backGlowMaterial; + } + get innerQuadMaterial() { + return this._innerQuadMaterial; + } + get plateMaterial() { + return this._plateMaterial; + } + get shareMaterials() { + return this._shareMaterials; + } + set isBackplateVisible(isVisible) { + if (this.mesh && this._backMaterial) { + if (isVisible && !this._isBackplateVisible) { + this._backPlate.visibility = 1; + } else if (!isVisible && this._isBackplateVisible) { + this._backPlate.visibility = 0; + } + } + this._isBackplateVisible = isVisible; + } + constructor(name356, shareMaterials = true) { + super(name356); + this.width = 1; + this.height = 1; + this.radius = 0.14; + this.textSizeInPixels = 18; + this.imageSizeInPixels = 40; + this.plateMaterialColor = new Color3(0.4, 0.4, 0.4); + this.frontPlateDepth = 0.2; + this.backPlateDepth = 0.04; + this.backGlowOffset = 0.1; + this.flatPlaneDepth = 0.001; + this.innerQuadRadius = this.radius - 0.04; + this.innerQuadColor = new Color4(0, 0, 0, 0); + this.innerQuadToggledColor = new Color4(0.5197843, 0.6485234, 0.9607843, 0.6); + this.innerQuadHoverColor = new Color4(1, 1, 1, 0.05); + this.innerQuadToggledHoverColor = new Color4(0.5197843, 0.6485234, 0.9607843, 1); + this._isBackplateVisible = true; + this._shareMaterials = true; + this._shareMaterials = shareMaterials; + this.pointerEnterAnimation = () => { + if (this._frontPlate && this._textPlate && !this.isToggleButton) { + this._performEnterExitAnimation(1); + } + if (this.isToggleButton && this._innerQuadMaterial) { + if (this.isToggled) { + this._innerQuadMaterial.color = this.innerQuadToggledHoverColor; + } else { + this._innerQuadMaterial.color = this.innerQuadHoverColor; + } + } + }; + this.pointerOutAnimation = () => { + if (this._frontPlate && this._textPlate && !this.isToggleButton) { + this._performEnterExitAnimation(-0.8); + } + if (this.isToggleButton && this._innerQuadMaterial) { + this._onToggle(this.isToggled); + } + }; + this.pointerDownAnimation = () => { + }; + this.pointerUpAnimation = () => { + }; + this._pointerClickObserver = this.onPointerClickObservable.add(() => { + if (this._frontPlate && this._backGlow && !this.isActiveNearInteraction) { + this._performClickAnimation(); + } + if (this.isToggleButton && this._innerQuadMaterial) { + this._onToggle(this.isToggled); + } + }); + this._pointerEnterObserver = this.onPointerEnterObservable.add(() => { + this.pointerEnterAnimation(); + }); + this._pointerOutObserver = this.onPointerOutObservable.add(() => { + this.pointerOutAnimation(); + }); + this._toggleObserver = this.onToggleObservable.add((isToggled) => { + if (isToggled) { + this._innerQuadMaterial.color = this.innerQuadToggledColor; + } else { + this._innerQuadMaterial.color = this.innerQuadColor; + } + }); + } + _getTypeName() { + return "TouchHolographicButton"; + } + _rebuildContent() { + let content; + if (this._getAspectRatio() <= 1) { + content = this._alignContentVertically(); + } else { + content = this._alignContentHorizontally(); + } + this.content = content; + } + _getAspectRatio() { + return this.width / this.height; + } + _alignContentVertically() { + const panel = new StackPanel3; + panel.isVertical = true; + if (IsDocumentAvailable() && !!document.createElement) { + if (this._imageUrl) { + const image19 = new Image4; + image19.source = this._imageUrl; + image19.heightInPixels = 180; + image19.widthInPixels = 100; + image19.paddingTopInPixels = 40; + image19.paddingBottomInPixels = 40; + panel.addControl(image19); + } + } + if (this._text) { + const text = new TextBlock3; + text.text = this._text; + text.color = "white"; + text.heightInPixels = 30; + text.fontSize = 24; + panel.addControl(text); + } + return panel; + } + _alignContentHorizontally() { + let totalPanelWidthInPixels = 240; + const padding = 15; + const contentContainer = new Rectangle3; + contentContainer.widthInPixels = totalPanelWidthInPixels; + contentContainer.heightInPixels = totalPanelWidthInPixels; + contentContainer.color = "transparent"; + contentContainer.setPaddingInPixels(padding, padding, padding, padding); + totalPanelWidthInPixels -= padding * 2; + const panel = new StackPanel3; + panel.isVertical = false; + panel.scaleY = this._getAspectRatio(); + if (IsDocumentAvailable() && !!document.createElement) { + if (this._imageUrl) { + const imageContainer = new Rectangle3(`${this.name}_image`); + imageContainer.widthInPixels = this.imageSizeInPixels; + imageContainer.heightInPixels = this.imageSizeInPixels; + imageContainer.color = "transparent"; + totalPanelWidthInPixels -= this.imageSizeInPixels; + const image19 = new Image4; + image19.source = this._imageUrl; + imageContainer.addControl(image19); + panel.addControl(imageContainer); + } + } + if (this._text) { + const text = new TextBlock3(`${this.name}_text`); + text.text = this._text; + text.color = "white"; + text.fontSize = this.textSizeInPixels; + text.widthInPixels = totalPanelWidthInPixels; + if (this._imageUrl) { + text.textHorizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + text.paddingLeftInPixels = padding; + } + if (this._subtext) { + const textContainer = new Grid3; + textContainer.addColumnDefinition(1); + textContainer.addRowDefinition(0.5); + textContainer.addRowDefinition(0.5); + textContainer.widthInPixels = totalPanelWidthInPixels; + textContainer.heightInPixels = 45; + const subtext = new TextBlock3(`${this.name}_subtext`); + subtext.text = this._subtext; + subtext.color = "#EEEEEEAB"; + subtext.fontSize = this.textSizeInPixels * 0.75; + subtext.fontWeight = "600"; + if (this._imageUrl) { + subtext.textHorizontalAlignment = Control3.HORIZONTAL_ALIGNMENT_LEFT; + subtext.paddingLeftInPixels = padding; + } + textContainer.addControl(text, 0); + textContainer.addControl(subtext, 1); + panel.addControl(textContainer); + } else { + panel.addControl(text); + } + } + contentContainer.addControl(panel); + return contentContainer; + } + _createNode(scene50) { + var _a; + this.name = (_a = this.name) !== null && _a !== undefined ? _a : "TouchHolographicButton"; + const backPlateMesh = this._createBackPlate(scene50); + const collisionMesh = this._createFrontPlate(scene50); + const innerQuadMesh = this._createInnerQuad(scene50); + const backGlowMesh = this._createBackGlow(scene50); + this._frontPlateCollisionMesh = collisionMesh; + this._textPlate = super._createNode(scene50); + this._textPlate.name = `${this.name}_textPlate`; + this._textPlate.isPickable = false; + this._textPlate.scaling.x = this.width; + this._textPlate.parent = collisionMesh; + this._backPlate = backPlateMesh; + this._backPlate.position = Vector3.Forward(scene50.useRightHandedSystem).scale(this.backPlateDepth / 2); + this._backPlate.isPickable = false; + this._backPlate.addChild(collisionMesh); + this._backPlate.addChild(innerQuadMesh); + if (backGlowMesh) { + this._backPlate.addChild(backGlowMesh); + } + const tn = new TransformNode(`${this.name}_root`, scene50); + this._backPlate.setParent(tn); + this.collisionMesh = collisionMesh; + this.collidableFrontDirection = this._backPlate.forward.negate(); + return tn; + } + _createBackPlate(scene50) { + const backPlateMesh = CreateBox(`${this.name}_backPlate`, {}, scene50); + backPlateMesh.isPickable = false; + backPlateMesh.visibility = 0; + backPlateMesh.scaling.z = 0.2; + SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton6.MRTK_ASSET_BASE_URL, TouchHolographicButton6.BACKPLATE_MODEL_FILENAME, scene50).then((result) => { + const backPlateModel = result.meshes[1]; + backPlateModel.visibility = 0; + if (this._isBackplateVisible) { + backPlateModel.visibility = 1; + backPlateModel.name = `${this.name}_backPlate`; + backPlateModel.isPickable = false; + backPlateModel.scaling.x = this.width; + backPlateModel.scaling.y = this.height; + backPlateModel.parent = backPlateMesh; + } + if (this._backMaterial) { + backPlateModel.material = this._backMaterial; + } + this._backPlate = backPlateModel; + }); + return backPlateMesh; + } + _createFrontPlate(scene50) { + const collisionMesh = CreateBox(`${this.name}_frontPlate`, { + width: this.width, + height: this.height, + depth: this.frontPlateDepth + }, scene50); + collisionMesh.isPickable = true; + collisionMesh.isNearPickable = true; + collisionMesh.visibility = 0; + collisionMesh.position = Vector3.Forward(scene50.useRightHandedSystem).scale((this.backPlateDepth - this.frontPlateDepth) / 2); + SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton6.MRTK_ASSET_BASE_URL, TouchHolographicButton6.FRONTPLATE_MODEL_FILENAME, scene50).then((result) => { + const collisionPlate = CreateBox(`${this.name}_collisionPlate`, { + width: this.width, + height: this.height + }, scene50); + collisionPlate.isPickable = false; + collisionPlate.scaling.z = this.frontPlateDepth; + collisionPlate.visibility = 0; + collisionPlate.parent = collisionMesh; + this._collisionPlate = collisionPlate; + const frontPlateModel = result.meshes[1]; + frontPlateModel.name = `${this.name}_frontPlate`; + frontPlateModel.isPickable = false; + frontPlateModel.scaling.x = this.width - this.backGlowOffset; + frontPlateModel.scaling.y = this.height - this.backGlowOffset; + frontPlateModel.position = Vector3.Forward(scene50.useRightHandedSystem).scale(-0.5); + frontPlateModel.parent = collisionPlate; + if (this.isToggleButton) { + frontPlateModel.visibility = 0; + } + if (this._frontMaterial) { + frontPlateModel.material = this._frontMaterial; + } + this._textPlate.scaling.x = 1; + this._textPlate.parent = frontPlateModel; + this._frontPlate = frontPlateModel; + }); + return collisionMesh; + } + _createInnerQuad(scene50) { + const innerQuadMesh = CreateBox(`${this.name}_innerQuad`, {}, scene50); + innerQuadMesh.isPickable = false; + innerQuadMesh.visibility = 0; + innerQuadMesh.scaling.z = this.flatPlaneDepth; + innerQuadMesh.position.z += this.backPlateDepth / 2 - this.flatPlaneDepth; + SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton6.MRTK_ASSET_BASE_URL, TouchHolographicButton6.INNERQUAD_MODEL_FILENAME, scene50).then((result) => { + const innerQuadModel = result.meshes[1]; + innerQuadModel.name = `${this.name}_innerQuad`; + innerQuadModel.isPickable = false; + innerQuadModel.scaling.x = this.width - this.backGlowOffset; + innerQuadModel.scaling.y = this.height - this.backGlowOffset; + innerQuadModel.parent = innerQuadMesh; + if (this._innerQuadMaterial) { + innerQuadModel.material = this._innerQuadMaterial; + } + this._innerQuad = innerQuadModel; + }); + return innerQuadMesh; + } + _createBackGlow(scene50) { + if (this.isToggleButton) { + return; + } + const backGlowMesh = CreateBox(`${this.name}_backGlow`, {}, scene50); + backGlowMesh.isPickable = false; + backGlowMesh.visibility = 0; + backGlowMesh.scaling.z = this.flatPlaneDepth; + backGlowMesh.position.z += this.backPlateDepth / 2 - this.flatPlaneDepth * 2; + SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton6.MRTK_ASSET_BASE_URL, TouchHolographicButton6.BACKGLOW_MODEL_FILENAME, scene50).then((result) => { + const backGlowModel = result.meshes[1]; + backGlowModel.name = `${this.name}_backGlow`; + backGlowModel.isPickable = false; + backGlowModel.scaling.x = this.width - this.backGlowOffset; + backGlowModel.scaling.y = this.height - this.backGlowOffset; + backGlowModel.parent = backGlowMesh; + if (this._backGlowMaterial) { + backGlowModel.material = this._backGlowMaterial; + } + this._backGlow = backGlowModel; + }); + return backGlowMesh; + } + _applyFacade(facadeTexture) { + this._plateMaterial.emissiveTexture = facadeTexture; + this._plateMaterial.opacityTexture = facadeTexture; + this._plateMaterial.diffuseColor = this.plateMaterialColor; + } + _performClickAnimation() { + const frameRate = 60; + const animationGroup7 = new AnimationGroup("Click Animation Group"); + const animations = [ + { + name: "backGlowMotion", + mesh: this._backGlow, + property: "material.motion", + keys: [ + { + frame: 0, + values: [0, 0, 0] + }, + { + frame: 20, + values: [1, 0.0144, 0.0144] + }, + { + frame: 40, + values: [0.0027713229489760476, 0, 0] + }, + { + frame: 45, + values: [0.0027713229489760476] + } + ] + }, + { + name: "_collisionPlateZSlide", + mesh: this._collisionPlate, + property: "position.z", + keys: [ + { + frame: 0, + values: [0, 0, 0] + }, + { + frame: 20, + values: [Vector3.Forward(this._collisionPlate._scene.useRightHandedSystem).scale(this.frontPlateDepth / 2).z, 0, 0] + }, + { + frame: 40, + values: [0, 0.005403332496794331] + }, + { + frame: 45, + values: [0] + } + ] + }, + { + name: "_collisionPlateZScale", + mesh: this._collisionPlate, + property: "scaling.z", + keys: [ + { + frame: 0, + values: [this.frontPlateDepth, 0, 0] + }, + { + frame: 20, + values: [this.backPlateDepth, 0, 0] + }, + { + frame: 40, + values: [this.frontPlateDepth, 0.0054] + }, + { + frame: 45, + values: [this.frontPlateDepth] + } + ] + } + ]; + for (const animation19 of animations) { + const anim = new Animation(animation19.name, animation19.property, frameRate, Animation.ANIMATIONTYPE_FLOAT, Animation.ANIMATIONLOOPMODE_CYCLE); + const animkeyFrames = []; + for (const key of animation19.keys) { + animkeyFrames.push({ + frame: key.frame, + value: key.values[0], + inTangent: key.values[1], + outTangent: key.values[2], + interpolation: key.values[3] + }); + } + anim.setKeys(animkeyFrames); + if (!animation19.mesh) { + continue; + } + animationGroup7.addTargetedAnimation(anim, animation19.mesh); + } + animationGroup7.normalize(0, 45); + animationGroup7.speedRatio = 1; + animationGroup7.play(); + } + _performEnterExitAnimation(speedRatio) { + const frameRate = 60; + const animationGroup7 = new AnimationGroup("Enter Exit Animation Group"); + const animations = [ + { + name: "frontPlateFadeOut", + mesh: this._frontPlate, + property: "material.fadeOut", + keys: [ + { + frame: 0, + values: [0, 0, 0.025045314830017686, 0] + }, + { + frame: 40, + values: [1.00205599570012, 0.025045314830017686, 0, 0] + } + ] + }, + { + name: "textPlateZSlide", + mesh: this._textPlate, + property: "position.z", + keys: [ + { + frame: 0, + values: [0, 0, 0] + }, + { + frame: 40, + values: [Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-0.15).z, 0, 0] + } + ] + } + ]; + for (const animation19 of animations) { + const anim = new Animation(animation19.name, animation19.property, frameRate, Animation.ANIMATIONTYPE_FLOAT, Animation.ANIMATIONLOOPMODE_CYCLE); + const animkeyFrames = []; + for (const key of animation19.keys) { + animkeyFrames.push({ + frame: key.frame, + value: key.values[0], + inTangent: key.values[1], + outTangent: key.values[2], + interpolation: key.values[3] + }); + } + anim.setKeys(animkeyFrames); + if (!animation19.mesh) { + continue; + } + animationGroup7.addTargetedAnimation(anim, animation19.mesh); + } + animationGroup7.normalize(0, 45); + animationGroup7.speedRatio = speedRatio; + animationGroup7.play(); + } + _createBackMaterial(mesh88) { + var _a; + this._backMaterial = (_a = this._backMaterial) !== null && _a !== undefined ? _a : new MRDLBackplateMaterial3(this.name + "backPlateMaterial", mesh88.getScene()); + this._backMaterial.absoluteSizes = true; + this._backMaterial.radius = this.radius; + this._backMaterial.lineWidth = 0.02; + } + _createFrontMaterial(mesh88) { + var _a; + this._frontMaterial = (_a = this._frontMaterial) !== null && _a !== undefined ? _a : new MRDLFrontplateMaterial3(this.name + "Front Material", mesh88.getScene()); + this.frontMaterial.radius = this.innerQuadRadius; + this.frontMaterial.fadeOut = 0; + } + _createBackGlowMaterial(mesh88) { + var _a; + const glowRadius = this.radius + 0.04; + this._backGlowMaterial = (_a = this._backGlowMaterial) !== null && _a !== undefined ? _a : new MRDLBackglowMaterial3(this.name + "Back Glow Material", mesh88.getScene()); + this._backGlowMaterial.bevelRadius = glowRadius; + this._backGlowMaterial.lineWidth = glowRadius; + this._backGlowMaterial.motion = 0; + } + _createInnerQuadMaterial(mesh88) { + var _a; + this._innerQuadMaterial = (_a = this._innerQuadMaterial) !== null && _a !== undefined ? _a : new MRDLInnerquadMaterial3("inner_quad", mesh88.getScene()); + this._innerQuadMaterial.radius = this.innerQuadRadius; + if (this.isToggleButton) { + this._innerQuadMaterial.color = this.innerQuadColor; + } + } + _createPlateMaterial(mesh88) { + var _a; + this._plateMaterial = (_a = this._plateMaterial) !== null && _a !== undefined ? _a : new StandardMaterial(this.name + "Plate Material", mesh88.getScene()); + this._plateMaterial.specularColor = Color3.Black(); + } + _onToggle(newState) { + super._onToggle(newState); + } + _affectMaterial(mesh88) { + if (this._shareMaterials) { + if (!this._host._touchSharedMaterials["mrdlBackplateMaterial"]) { + this._createBackMaterial(mesh88); + this._host._touchSharedMaterials["mrdlBackplateMaterial"] = this._backMaterial; + } else { + this._backMaterial = this._host._touchSharedMaterials["mrdlBackplateMaterial"]; + } + if (!this._host._touchSharedMaterials["mrdlFrontplateMaterial"]) { + this._createFrontMaterial(mesh88); + this._host._touchSharedMaterials["mrdlFrontplateMaterial"] = this._frontMaterial; + } else { + this._frontMaterial = this._host._touchSharedMaterials["mrdlFrontplateMaterial"]; + } + if (!this._host._touchSharedMaterials["mrdlBackglowMaterial"]) { + this._createBackGlowMaterial(mesh88); + this._host._touchSharedMaterials["mrdlBackglowMaterial"] = this._backGlowMaterial; + } else { + this._backGlowMaterial = this._host._touchSharedMaterials["mrdlBackglowMaterial"]; + } + if (!this._host._touchSharedMaterials["mrdlInnerQuadMaterial"]) { + this._createInnerQuadMaterial(mesh88); + this._host._touchSharedMaterials["mrdlInnerQuadMaterial"] = this._innerQuadMaterial; + } else { + this._innerQuadMaterial = this._host._touchSharedMaterials["mrdlInnerQuadMaterial"]; + } + } else { + this._createBackMaterial(mesh88); + this._createFrontMaterial(mesh88); + this._createBackGlowMaterial(mesh88); + this._createInnerQuadMaterial(mesh88); + } + this._createPlateMaterial(mesh88); + this._backPlate.material = this._backMaterial; + this._textPlate.material = this._plateMaterial; + if (!this._isBackplateVisible) { + this._backPlate.visibility = 0; + } + if (this._frontPlate) { + this._frontPlate.material = this._frontMaterial; + } + if (this._backGlow) { + this._backGlow.material = this._backGlowMaterial; + } + if (this._innerQuad) { + this._innerQuad.material = this._innerQuadMaterial; + } + this._rebuildContent(); + } + dispose() { + super.dispose(); + this._disposeTooltip(); + this.onPointerClickObservable.remove(this._pointerClickObserver); + this.onPointerEnterObservable.remove(this._pointerEnterObserver); + this.onPointerOutObservable.remove(this._pointerOutObserver); + this.onToggleObservable.remove(this._toggleObserver); + if (!this.shareMaterials) { + this._backMaterial.dispose(); + this._frontMaterial.dispose(); + this._plateMaterial.dispose(); + this._backGlowMaterial.dispose(); + this._innerQuadMaterial.dispose(); + if (this._pickedPointObserver) { + this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver); + this._pickedPointObserver = null; + } + } + } +} +var init_touchHolographicButton4 = __esm(() => { + init_advancedDynamicTexture2(); + init_animation(); + init_animationGroup(); + init_math_color(); + init_control2(); + init_planeBuilder(); + init_boxBuilder(); + init_domManagement(); + init_fadeInOutBehavior(); + init_grid3(); + init_image2(); + init_mrdlBackglowMaterial2(); + init_mrdlBackplateMaterial2(); + init_mrdlFrontplateMaterial2(); + init_mrdlInnerquadMaterial2(); + init_rectangle2(); + init_sceneLoader(); + init_stackPanel2(); + init_standardMaterial(); + init_textBlock2(); + init_touchButton3D2(); + init_transformNode(); + init_math_vector(); + TouchHolographicButton6.MRTK_ASSET_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/"; + TouchHolographicButton6.FRONTPLATE_MODEL_FILENAME = "mrtk-fluent-frontplate.glb"; + TouchHolographicButton6.BACKPLATE_MODEL_FILENAME = "mrtk-fluent-backplate.glb"; + TouchHolographicButton6.BACKGLOW_MODEL_FILENAME = "mrtk-fluent-button.glb"; + TouchHolographicButton6.INNERQUAD_MODEL_FILENAME = "SlateProximity.glb"; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/controls/index.js +var init_controls4 = __esm(() => { + init_abstractButton3D2(); + init_button3D2(); + init_container3D2(); + init_control3D2(); + init_cylinderPanel2(); + init_handMenu2(); + init_holographicBackplate2(); + init_holographicButton2(); + init_holographicSlate2(); + init_meshButton3D2(); + init_nearMenu2(); + init_planePanel2(); + init_scatterPanel2(); + init_slider3D2(); + init_spherePanel2(); + init_stackPanel3D2(); + init_touchButton3D2(); + init_touchMeshButton3D2(); + init_touchHolographicButton3(); + init_touchHolographicMenu2(); + init_volumeBasedPanel2(); + init_touchHolographicButton4(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/fluent/index.js +var init_fluent2 = __esm(() => { + init_fluentMaterial2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/fluentButton/index.js +var init_fluentButton2 = __esm(() => { + init_fluentButtonMaterial2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/fluentBackplate/index.js +var init_fluentBackplate2 = __esm(() => { + init_fluentBackplateMaterial2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/handle/index.js +var init_handle2 = __esm(() => { + init_handleMaterial2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/mrdl/index.js +var init_mrdl2 = __esm(() => { + init_mrdlSliderBarMaterial2(); + init_mrdlSliderThumbMaterial2(); + init_mrdlBackplateMaterial2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/materials/index.js +var init_materials3 = __esm(() => { + init_fluent2(); + init_fluentButton2(); + init_fluentBackplate2(); + init_handle2(); + init_mrdl2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/gizmos/index.js +var init_gizmos2 = __esm(() => { + init_slateGizmo2(); + init_gizmoHandle2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/gui3DManager.js +class GUI3DManager3 { + get scene() { + return this._scene; + } + get utilityLayer() { + return this._utilityLayer; + } + get controlScaling() { + return this._customControlScaling; + } + set controlScaling(newScale) { + if (this._customControlScaling !== newScale && newScale > 0) { + const scaleRatio = newScale / this._customControlScaling; + this._customControlScaling = newScale; + this._rootContainer.children.forEach((control73) => { + control73.scaling.scaleInPlace(scaleRatio); + if (newScale !== 1) { + control73._isScaledByManager = true; + } + }); + } + } + get useRealisticScaling() { + return this.controlScaling === GUI3DManager3.MRTK_REALISTIC_SCALING; + } + set useRealisticScaling(newValue) { + this.controlScaling = newValue ? GUI3DManager3.MRTK_REALISTIC_SCALING : 1; + } + constructor(scene50) { + this._customControlScaling = 1; + this._lastControlOver = {}; + this._lastControlDown = {}; + this.onPickedPointChangedObservable = new Observable; + this.onPickingObservable = new Observable; + this._sharedMaterials = {}; + this._touchSharedMaterials = {}; + this._scene = scene50 || EngineStore.LastCreatedScene; + this._sceneDisposeObserver = this._scene.onDisposeObservable.add(() => { + this._sceneDisposeObserver = null; + this._utilityLayer = null; + this.dispose(); + }); + this._utilityLayer = UtilityLayerRenderer._CreateDefaultUtilityLayerFromScene(this._scene); + this._utilityLayer.onlyCheckPointerDownEvents = false; + this._utilityLayer.pickUtilitySceneFirst = false; + this._utilityLayer.mainSceneTrackerPredicate = (mesh88) => { + var _a, _b, _c; + return mesh88 && ((_c = (_b = (_a = mesh88.reservedDataStore) === null || _a === undefined ? undefined : _a.GUI3D) === null || _b === undefined ? undefined : _b.control) === null || _c === undefined ? undefined : _c._node); + }; + this._rootContainer = new Container3D3("RootContainer"); + this._rootContainer._host = this; + const utilityLayerScene = this._utilityLayer.utilityLayerScene; + this._pointerOutObserver = this._utilityLayer.onPointerOutObservable.add((pointerId) => { + this._handlePointerOut(pointerId, true); + }); + this._pointerObserver = utilityLayerScene.onPointerObservable.add((pi) => { + this._doPicking(pi); + }); + this._utilityLayer.utilityLayerScene.autoClear = false; + this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil = false; + new HemisphericLight("hemi", Vector3.Up(), this._utilityLayer.utilityLayerScene); + } + _handlePointerOut(pointerId, isPointerUp) { + const previousControlOver = this._lastControlOver[pointerId]; + if (previousControlOver) { + previousControlOver._onPointerOut(previousControlOver); + delete this._lastControlOver[pointerId]; + } + if (isPointerUp) { + if (this._lastControlDown[pointerId]) { + this._lastControlDown[pointerId].forcePointerUp(); + delete this._lastControlDown[pointerId]; + } + } + this.onPickedPointChangedObservable.notifyObservers(null); + } + _doPicking(pi) { + var _a, _b, _c; + if (!this._utilityLayer || !this._utilityLayer.shouldRender || !this._utilityLayer.utilityLayerScene.activeCamera) { + return false; + } + const pointerEvent = pi.event; + const pointerId = pointerEvent.pointerId || 0; + const buttonIndex = pointerEvent.button; + const pickingInfo12 = pi.pickInfo; + if (pickingInfo12) { + this.onPickingObservable.notifyObservers(pickingInfo12.pickedMesh); + } + if (!pickingInfo12 || !pickingInfo12.hit) { + this._handlePointerOut(pointerId, pi.type === PointerEventTypes.POINTERUP); + return false; + } + if (pickingInfo12.pickedPoint) { + this.onPickedPointChangedObservable.notifyObservers(pickingInfo12.pickedPoint); + } + const control73 = (_b = (_a = pickingInfo12.pickedMesh.reservedDataStore) === null || _a === undefined ? undefined : _a.GUI3D) === null || _b === undefined ? undefined : _b.control; + if (!!control73 && !control73._processObservables(pi.type, pickingInfo12.pickedPoint, ((_c = pickingInfo12.originMesh) === null || _c === undefined ? undefined : _c.position) || null, pointerId, buttonIndex)) { + if (pi.type === PointerEventTypes.POINTERMOVE) { + if (this._lastControlOver[pointerId]) { + this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId]); + } + delete this._lastControlOver[pointerId]; + } + } + if (pi.type === PointerEventTypes.POINTERUP) { + if (this._lastControlDown[pointerEvent.pointerId]) { + this._lastControlDown[pointerEvent.pointerId].forcePointerUp(); + delete this._lastControlDown[pointerEvent.pointerId]; + } + if (pointerEvent.pointerType === "touch" || pointerEvent.pointerType === "xr" && this._scene.getEngine().hostInformation.isMobile) { + this._handlePointerOut(pointerId, false); + } + } + return true; + } + get rootContainer() { + return this._rootContainer; + } + containsControl(control73) { + return this._rootContainer.containsControl(control73); + } + addControl(control73) { + this._rootContainer.addControl(control73); + if (this._customControlScaling !== 1) { + control73.scaling.scaleInPlace(this._customControlScaling); + control73._isScaledByManager = true; + } + return this; + } + removeControl(control73) { + this._rootContainer.removeControl(control73); + if (control73._isScaledByManager) { + control73.scaling.scaleInPlace(1 / this._customControlScaling); + control73._isScaledByManager = false; + } + return this; + } + dispose() { + this._rootContainer.dispose(); + for (const materialName in this._sharedMaterials) { + if (!Object.prototype.hasOwnProperty.call(this._sharedMaterials, materialName)) { + continue; + } + this._sharedMaterials[materialName].dispose(); + } + this._sharedMaterials = {}; + for (const materialName in this._touchSharedMaterials) { + if (!Object.prototype.hasOwnProperty.call(this._touchSharedMaterials, materialName)) { + continue; + } + this._touchSharedMaterials[materialName].dispose(); + } + this._touchSharedMaterials = {}; + if (this._pointerOutObserver && this._utilityLayer) { + this._utilityLayer.onPointerOutObservable.remove(this._pointerOutObserver); + this._pointerOutObserver = null; + } + this.onPickedPointChangedObservable.clear(); + this.onPickingObservable.clear(); + const utilityLayerScene = this._utilityLayer ? this._utilityLayer.utilityLayerScene : null; + if (utilityLayerScene) { + if (this._pointerObserver) { + utilityLayerScene.onPointerObservable.remove(this._pointerObserver); + this._pointerObserver = null; + } + } + if (this._scene) { + if (this._sceneDisposeObserver) { + this._scene.onDisposeObservable.remove(this._sceneDisposeObserver); + this._sceneDisposeObserver = null; + } + } + if (this._utilityLayer) { + this._utilityLayer.dispose(); + } + } +} +var init_gui3DManager2 = __esm(() => { + init_observable(); + init_math_vector(); + init_pointerEvents(); + init_hemisphericLight(); + init_utilityLayerRenderer(); + init_engineStore(); + init_container3D2(); + GUI3DManager3.MRTK_REALISTIC_SCALING = 0.032; +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/3D/index.js +var init_3D2 = __esm(() => { + init_controls4(); + init_materials3(); + init_gizmos2(); + init_gui3DManager2(); + init_vector3WithInfo2(); +}); + +// node_modules/@babylonjs/gui-editor/node_modules/@babylonjs/gui/index.js +var exports_gui2 = {}; +__export(exports_gui2, { + name: () => { + { + return name335; + } + }, + XmlLoader: () => { + { + return XmlLoader2; + } + }, + VolumeBasedPanel: () => { + { + return VolumeBasedPanel3; + } + }, + VirtualKeyboard: () => { + { + return VirtualKeyboard3; + } + }, + Vector3WithInfo: () => { + { + return Vector3WithInfo3; + } + }, + Vector2WithInfo: () => { + { + return Vector2WithInfo3; + } + }, + ValueAndUnit: () => { + { + return ValueAndUnit3; + } + }, + TouchMeshButton3D: () => { + { + return TouchMeshButton3D2; + } + }, + TouchHolographicMenu: () => { + { + return TouchHolographicMenu3; + } + }, + TouchHolographicButtonV3: () => { + { + return TouchHolographicButton6; + } + }, + TouchHolographicButton: () => { + { + return TouchHolographicButton5; + } + }, + TouchButton3D: () => { + { + return TouchButton3D3; + } + }, + ToggleButton: () => { + { + return ToggleButton3; + } + }, + TextWrapping: () => { + { + return TextWrapping3; + } + }, + TextWrapper: () => { + { + return TextWrapper3; + } + }, + TextBlock: () => { + { + return TextBlock3; + } + }, + Style: () => { + { + return Style3; + } + }, + StackPanel3D: () => { + { + return StackPanel3D2; + } + }, + StackPanel: () => { + { + return StackPanel3; + } + }, + SpherePanel: () => { + { + return SpherePanel2; + } + }, + SliderGroup: () => { + { + return SliderGroup2; + } + }, + Slider3D: () => { + { + return Slider3D3; + } + }, + Slider: () => { + { + return Slider3; + } + }, + SlateGizmo: () => { + { + return SlateGizmo3; + } + }, + SideHandle: () => { + { + return SideHandle3; + } + }, + SelectorGroup: () => { + { + return SelectorGroup2; + } + }, + SelectionPanel: () => { + { + return SelectionPanel2; + } + }, + ScrollViewer: () => { + { + return ScrollViewer3; + } + }, + ScrollBar: () => { + { + return ScrollBar3; + } + }, + ScatterPanel: () => { + { + return ScatterPanel2; + } + }, + Rectangle: () => { + { + return Rectangle3; + } + }, + RadioGroup: () => { + { + return RadioGroup2; + } + }, + RadioButton: () => { + { + return RadioButton3; + } + }, + RadialGradient: () => { + { + return RadialGradient5; + } + }, + PlanePanel: () => { + { + return PlanePanel2; + } + }, + NearMenu: () => { + { + return NearMenu3; + } + }, + MultiLinePoint: () => { + { + return MultiLinePoint3; + } + }, + MultiLine: () => { + { + return MultiLine3; + } + }, + MeshButton3D: () => { + { + return MeshButton3D2; + } + }, + Measure: () => { + { + return Measure3; + } + }, + Matrix2D: () => { + { + return Matrix2D3; + } + }, + MathTools: () => { + { + return MathTools3; + } + }, + MRDLSliderThumbMaterial: () => { + { + return MRDLSliderThumbMaterial3; + } + }, + MRDLSliderBarMaterial: () => { + { + return MRDLSliderBarMaterial3; + } + }, + MRDLBackplateMaterial: () => { + { + return MRDLBackplateMaterial3; + } + }, + LinearGradient: () => { + { + return LinearGradient5; + } + }, + Line: () => { + { + return Line3; + } + }, + KeyPropertySet: () => { + { + return KeyPropertySet2; + } + }, + InputTextArea: () => { + { + return InputTextArea3; + } + }, + InputText: () => { + { + return InputText3; + } + }, + InputPassword: () => { + { + return InputPassword3; + } + }, + ImageScrollBar: () => { + { + return ImageScrollBar3; + } + }, + ImageBasedSlider: () => { + { + return ImageBasedSlider3; + } + }, + Image: () => { + { + return Image4; + } + }, + HolographicSlate: () => { + { + return HolographicSlate3; + } + }, + HolographicButton: () => { + { + return HolographicButton2; + } + }, + HolographicBackplate: () => { + { + return HolographicBackplate3; + } + }, + HandleState: () => { + { + return HandleState3; + } + }, + HandleMaterial: () => { + { + return HandleMaterial3; + } + }, + HandMenu: () => { + { + return HandMenu2; + } + }, + Grid: () => { + { + return Grid3; + } + }, + GizmoHandle: () => { + { + return GizmoHandle3; + } + }, + GUI3DManager: () => { + { + return GUI3DManager3; + } + }, + FocusableButton: () => { + { + return FocusableButton3; + } + }, + FluentMaterialDefines: () => { + { + return FluentMaterialDefines3; + } + }, + FluentMaterial: () => { + { + return FluentMaterial3; + } + }, + FluentButtonMaterial: () => { + { + return FluentButtonMaterial3; + } + }, + FluentBackplateMaterial: () => { + { + return FluentBackplateMaterial3; + } + }, + Ellipse: () => { + { + return Ellipse3; + } + }, + DisplayGrid: () => { + { + return DisplayGrid3; + } + }, + CylinderPanel: () => { + { + return CylinderPanel2; + } + }, + CornerHandle: () => { + { + return CornerHandle3; + } + }, + Control3D: () => { + { + return Control3D3; + } + }, + Control: () => { + { + return Control3; + } + }, + Container3D: () => { + { + return Container3D3; + } + }, + Container: () => { + { + return Container3; + } + }, + ColorPicker: () => { + { + return ColorPicker3; + } + }, + CheckboxGroup: () => { + { + return CheckboxGroup2; + } + }, + Checkbox: () => { + { + return Checkbox3; + } + }, + Button3D: () => { + { + return Button3D3; + } + }, + Button: () => { + { + return Button3; + } + }, + BaseSlider: () => { + { + return BaseSlider3; + } + }, + BaseGradient: () => { + { + return BaseGradient9; + } + }, + AdvancedDynamicTextureInstrumentation: () => { + { + return AdvancedDynamicTextureInstrumentation2; + } + }, + AdvancedDynamicTexture: () => { + { + return AdvancedDynamicTexture3; + } + }, + AbstractButton3D: () => { + { + return AbstractButton3D3; + } + } +}); +var init_gui2 = __esm(() => { + init_2D2(); + init_3D2(); +}); + +// node_modules/@babylonjs/gui-editor/dist/babylon.guiEditor.max.js +var require_babylon_guiEditor_max = __commonJS((exports, module) => { + (function webpackUniversalModuleDefinition(root, factory) { + if (typeof exports === "object" && typeof module === "object") + module.exports = factory((init_core(), __toCommonJS(exports_core)), (init_gui2(), __toCommonJS(exports_gui2))); + else if (typeof define === "function" && define.amd) + define("@babylonjs/gui-editor", ["@babylonjs/core", "@babylonjs/gui"], factory); + else if (typeof exports === "object") + exports["@babylonjs/gui-editor"] = factory((init_core(), __toCommonJS(exports_core)), (init_gui2(), __toCommonJS(exports_gui2))); + else + root["GUIEDITOR"] = factory(root["BABYLON"], root["BABYLON"]["GUI"]); + })(typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : exports, (__WEBPACK_EXTERNAL_MODULE_core_Misc_observable__, __WEBPACK_EXTERNAL_MODULE_gui_2D_controls_container__) => { + return (() => { + var __webpack_modules__ = { + "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss": (module2, __webpack_exports__2, __webpack_require__2) => { + /*!**********************************************************************************************************************************************************************************************************************************!*\ + !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss ***! + \**********************************************************************************************************************************************************************************************************************************/ + __webpack_require__2.r(__webpack_exports__2); + __webpack_require__2.d(__webpack_exports__2, { + default: () => __WEBPACK_DEFAULT_EXPORT__ + }); + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/api.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + ___CSS_LOADER_EXPORT___.push([module2.id, `.color-picker-container { + width: 320px; + height: 300px; + background-color: white; + display: grid; + grid-template-columns: 100%; + grid-template-rows: 50% 50px 60px 40px 1fr auto; + font-family: "acumin-pro-condensed"; + font-weight: normal; + font-size: 14px; +} +.color-picker-container.with-hints { + height: 380px; +} +.color-picker-container .color-picker-saturation { + grid-row: 1; + grid-column: 1; + display: grid; + grid-template-columns: 100%; + grid-template-rows: 100%; + position: relative; + cursor: pointer; +} +.color-picker-container .color-picker-saturation .color-picker-saturation-white { + grid-row: 1; + grid-column: 1; + background: -webkit-linear-gradient(to right, #fff, rgba(255, 255, 255, 0)); + background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0)); +} +.color-picker-container .color-picker-saturation .color-picker-saturation-black { + grid-row: 1; + grid-column: 1; + background: -webkit-linear-gradient(to top, #000, rgba(0, 0, 0, 0)); + background: linear-gradient(to top, #000, rgba(0, 0, 0, 0)); +} +.color-picker-container .color-picker-saturation .color-picker-saturation-cursor { + pointer-events: none; + width: 4px; + height: 4px; + box-shadow: 0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0, 0, 0, 0.3), 0 0 1px 2px rgba(0, 0, 0, 0.4); + border-radius: 50%; + transform: translate(-2px, -2px); + position: absolute; +} +.color-picker-container .color-picker-hue { + grid-row: 2; + grid-column: 1; + display: grid; + margin: 10px; + grid-template-columns: 24% 76%; + grid-template-rows: 100%; +} +.color-picker-container .color-picker-hue .color-picker-hue-color { + grid-row: 1; + grid-column: 1; + align-self: center; + justify-self: center; + width: 30px; + height: 30px; + border-radius: 15px; + border: 1px solid black; +} +.color-picker-container .color-picker-hue .color-picker-hue-slider { + grid-row: 1; + grid-column: 2; + align-self: center; + height: 16px; + position: relative; + cursor: pointer; + background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%); + background: -webkit-linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%); +} +.color-picker-container .color-picker-hue .color-picker-hue-slider .color-picker-hue-cursor { + pointer-events: none; + width: 8px; + height: 18px; + transform: translate(-4px, -2px); + background-color: rgb(248, 248, 248); + box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37); + position: absolute; +} +.color-picker-container .color-picker-component { + display: grid; + margin: 5px; + grid-template-columns: 100%; + grid-template-rows: 50% 50%; +} +.color-picker-container .color-picker-component .color-picker-component-value { + justify-self: center; + align-self: center; + grid-row: 1; + grid-column: 1; + margin-bottom: 4px; +} +.color-picker-container .color-picker-component .color-picker-component-value input { + width: 50px; +} +.color-picker-container .color-picker-component .color-picker-component-label { + justify-self: center; + align-self: center; + grid-row: 2; + grid-column: 1; + color: black; +} +.color-picker-container .color-picker-rgb { + grid-row: 3; + grid-column: 1; + display: grid; + margin: 10px; + grid-template-columns: 20% 6.66% 20% 6.66% 20% 6.66% 20%; + grid-template-rows: 100%; +} +.color-picker-container .red { + grid-row: 1; + grid-column: 1; +} +.color-picker-container .green { + grid-row: 1; + grid-column: 3; +} +.color-picker-container .blue { + grid-row: 1; + grid-column: 5; +} +.color-picker-container .alpha { + grid-row: 1; + grid-column: 7; +} +.color-picker-container .alpha.grayed { + opacity: 0.5; +} +.color-picker-container .color-picker-hex { + grid-row: 4; + grid-column: 1; + display: grid; + grid-template-columns: 20% 80%; + grid-template-rows: 100%; +} +.color-picker-container .color-picker-hex .color-picker-hex-label { + justify-self: center; + align-self: center; + grid-row: 1; + grid-column: 1; + margin-left: 10px; + color: black; +} +.color-picker-container .color-picker-hex .color-picker-hex-value { + justify-self: left; + align-self: center; + grid-row: 1; + grid-column: 2; + margin-left: 10px; + margin-right: 10px; +} +.color-picker-container .color-picker-hex .color-picker-hex-value input { + width: 70px; +} +.color-picker-container .color-picker-warning { + color: black; + font-size: 11px; + padding: 4px; + justify-self: left; + align-self: center; + grid-row: 6; + grid-column: 1; +}`, "", { version: 3, sources: ["webpack://./../../../dev/sharedUiComponents/dist/colorPicker/colorPicker.scss"], names: [], mappings: "AAAA;EACI,YAAA;EACA,aAAA;EACA,uBAAA;EACA,aAAA;EACA,2BAAA;EACA,+CAAA;EACA,mCAAA;EACA,mBAAA;EACA,eAAA;AACJ;AACI;EACI,aAAA;AACR;AAEI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,2BAAA;EACA,wBAAA;EACA,kBAAA;EACA,eAAA;AAAR;AAEQ;EACI,WAAA;EACA,cAAA;EAEA,2EAAA;EACA,mEAAA;AADZ;AAIQ;EACI,WAAA;EACA,cAAA;EAEA,mEAAA;EACA,2DAAA;AAHZ;AAMQ;EACI,oBAAA;EACA,UAAA;EACA,WAAA;EACA,kGACI;EAGJ,kBAAA;EACA,gCAAA;EACA,kBAAA;AAPZ;AAWI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,YAAA;EACA,8BAAA;EACA,wBAAA;AATR;AAWQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,oBAAA;EACA,WAAA;EACA,YAAA;EACA,mBAAA;EACA,uBAAA;AATZ;AAYQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,YAAA;EACA,kBAAA;EACA,eAAA;EAEA,2GAAA;EACA,mHAAA;AAXZ;AAaY;EACI,oBAAA;EACA,UAAA;EACA,YAAA;EACA,gCAAA;EACA,oCAAA;EACA,2CAAA;EACA,kBAAA;AAXhB;AAgBI;EACI,aAAA;EACA,WAAA;EACA,2BAAA;EACA,2BAAA;AAdR;AAgBQ;EACI,oBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;EACA,kBAAA;AAdZ;AAgBY;EACI,WAAA;AAdhB;AAkBQ;EACI,oBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;EACA,YAAA;AAhBZ;AAoBI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,YAAA;EACA,wDAAA;EACA,wBAAA;AAlBR;AAqBI;EACI,WAAA;EACA,cAAA;AAnBR;AAsBI;EACI,WAAA;EACA,cAAA;AApBR;AAuBI;EACI,WAAA;EACA,cAAA;AArBR;AAwBI;EACI,WAAA;EACA,cAAA;AAtBR;AAwBQ;EACI,YAAA;AAtBZ;AA0BI;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,8BAAA;EACA,wBAAA;AAxBR;AA0BQ;EACI,oBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;EACA,iBAAA;EACA,YAAA;AAxBZ;AA2BQ;EACI,kBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;AAzBZ;AA2BY;EACI,WAAA;AAzBhB;AA8BI;EACI,YAAA;EACA,eAAA;EACA,YAAA;EACA,kBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;AA5BR", sourcesContent: [".color-picker-container {\r\n width: 320px;\r\n height: 300px;\r\n background-color: white;\r\n display: grid;\r\n grid-template-columns: 100%;\r\n grid-template-rows: 50% 50px 60px 40px 1fr auto;\r\n font-family: \"acumin-pro-condensed\";\r\n font-weight: normal;\r\n font-size: 14px;\r\n\r\n &.with-hints {\r\n height: 380px;\r\n }\r\n\r\n .color-picker-saturation {\r\n grid-row: 1;\r\n grid-column: 1;\r\n display: grid;\r\n grid-template-columns: 100%;\r\n grid-template-rows: 100%;\r\n position: relative;\r\n cursor: pointer;\r\n\r\n .color-picker-saturation-white {\r\n grid-row: 1;\r\n grid-column: 1;\r\n\r\n background: -webkit-linear-gradient(to right, #fff, rgba(255, 255, 255, 0));\r\n background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0));\r\n }\r\n\r\n .color-picker-saturation-black {\r\n grid-row: 1;\r\n grid-column: 1;\r\n\r\n background: -webkit-linear-gradient(to top, #000, rgba(0, 0, 0, 0));\r\n background: linear-gradient(to top, #000, rgba(0, 0, 0, 0));\r\n }\r\n\r\n .color-picker-saturation-cursor {\r\n pointer-events: none;\r\n width: 4px;\r\n height: 4px;\r\n box-shadow:\r\n 0 0 0 1.5px #fff,\r\n inset 0 0 1px 1px rgba(0, 0, 0, 0.3),\r\n 0 0 1px 2px rgba(0, 0, 0, 0.4);\r\n border-radius: 50%;\r\n transform: translate(-2px, -2px);\r\n position: absolute;\r\n }\r\n }\r\n\r\n .color-picker-hue {\r\n grid-row: 2;\r\n grid-column: 1;\r\n display: grid;\r\n margin: 10px;\r\n grid-template-columns: 24% 76%;\r\n grid-template-rows: 100%;\r\n\r\n .color-picker-hue-color {\r\n grid-row: 1;\r\n grid-column: 1;\r\n align-self: center;\r\n justify-self: center;\r\n width: 30px;\r\n height: 30px;\r\n border-radius: 15px;\r\n border: 1px solid black;\r\n }\r\n\r\n .color-picker-hue-slider {\r\n grid-row: 1;\r\n grid-column: 2;\r\n align-self: center;\r\n height: 16px;\r\n position: relative;\r\n cursor: pointer;\r\n\r\n background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\r\n background: -webkit-linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\r\n\r\n .color-picker-hue-cursor {\r\n pointer-events: none;\r\n width: 8px;\r\n height: 18px;\r\n transform: translate(-4px, -2px);\r\n background-color: rgb(248, 248, 248);\r\n box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);\r\n position: absolute;\r\n }\r\n }\r\n }\r\n\r\n .color-picker-component {\r\n display: grid;\r\n margin: 5px;\r\n grid-template-columns: 100%;\r\n grid-template-rows: 50% 50%;\r\n\r\n .color-picker-component-value {\r\n justify-self: center;\r\n align-self: center;\r\n grid-row: 1;\r\n grid-column: 1;\r\n margin-bottom: 4px;\r\n\r\n input {\r\n width: 50px;\r\n }\r\n }\r\n\r\n .color-picker-component-label {\r\n justify-self: center;\r\n align-self: center;\r\n grid-row: 2;\r\n grid-column: 1;\r\n color: black;\r\n }\r\n }\r\n\r\n .color-picker-rgb {\r\n grid-row: 3;\r\n grid-column: 1;\r\n display: grid;\r\n margin: 10px;\r\n grid-template-columns: 20% 6.66% 20% 6.66% 20% 6.66% 20%;\r\n grid-template-rows: 100%;\r\n }\r\n\r\n .red {\r\n grid-row: 1;\r\n grid-column: 1;\r\n }\r\n\r\n .green {\r\n grid-row: 1;\r\n grid-column: 3;\r\n }\r\n\r\n .blue {\r\n grid-row: 1;\r\n grid-column: 5;\r\n }\r\n\r\n .alpha {\r\n grid-row: 1;\r\n grid-column: 7;\r\n\r\n &.grayed {\r\n opacity: 0.5;\r\n }\r\n }\r\n\r\n .color-picker-hex {\r\n grid-row: 4;\r\n grid-column: 1;\r\n display: grid;\r\n grid-template-columns: 20% 80%;\r\n grid-template-rows: 100%;\r\n\r\n .color-picker-hex-label {\r\n justify-self: center;\r\n align-self: center;\r\n grid-row: 1;\r\n grid-column: 1;\r\n margin-left: 10px;\r\n color: black;\r\n }\r\n\r\n .color-picker-hex-value {\r\n justify-self: left;\r\n align-self: center;\r\n grid-row: 1;\r\n grid-column: 2;\r\n margin-left: 10px;\r\n margin-right: 10px;\r\n\r\n input {\r\n width: 70px;\r\n }\r\n }\r\n }\r\n\r\n .color-picker-warning {\r\n color: black;\r\n font-size: 11px;\r\n padding: 4px;\r\n justify-self: left;\r\n align-self: center;\r\n grid-row: 6;\r\n grid-column: 1;\r\n }\r\n}\r\n"], sourceRoot: "" }]); + ___CSS_LOADER_EXPORT___.locals = {}; + const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___; + }, + "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/components/log/log.scss": (module2, __webpack_exports__2, __webpack_require__2) => { + /*!**********************************************************************************************************************************************************************************************************************!*\ + !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/components/log/log.scss ***! + \**********************************************************************************************************************************************************************************************************************/ + __webpack_require__2.r(__webpack_exports__2); + __webpack_require__2.d(__webpack_exports__2, { + default: () => __WEBPACK_DEFAULT_EXPORT__ + }); + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"); + /*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/api.js"); + /*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + ___CSS_LOADER_EXPORT___.push([module2.id, `#log-console { + background: #333333; + height: 120px; + box-sizing: border-box; + margin: 0; + padding: 10px; + width: 100%; + overflow: hidden; + overflow-y: auto; +} +#log-console .log { + color: white; + font-size: 14px; + font-family: "Courier New", Courier, monospace; +} +#log-console .log.error { + color: red; +}`, "", { version: 3, sources: ["webpack://./../../../tools/guiEditor/dist/components/log/log.scss"], names: [], mappings: "AAAA;EACI,mBAAA;EACA,aAAA;EACA,sBAAA;EACA,SAAA;EACA,aAAA;EACA,WAAA;EACA,gBAAA;EACA,gBAAA;AACJ;AACI;EACI,YAAA;EACA,eAAA;EACA,8CAAA;AACR;AACQ;EACI,UAAA;AACZ", sourcesContent: ["#log-console {\r\n background: #333333;\r\n height: 120px;\r\n box-sizing: border-box;\r\n margin: 0;\r\n padding: 10px;\r\n width: 100%;\r\n overflow: hidden;\r\n overflow-y: auto;\r\n\r\n .log {\r\n color: white;\r\n font-size: 14px;\r\n font-family: \"Courier New\", Courier, monospace;\r\n\r\n &.error {\r\n color: red;\r\n }\r\n }\r\n}\r\n"], sourceRoot: "" }]); + ___CSS_LOADER_EXPORT___.locals = {}; + const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___; + }, + "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/components/propertyTab/propertyTab.scss": (module2, __webpack_exports__2, __webpack_require__2) => { + /*!**************************************************************************************************************************************************************************************************************************************!*\ + !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/components/propertyTab/propertyTab.scss ***! + \**************************************************************************************************************************************************************************************************************************************/ + __webpack_require__2.r(__webpack_exports__2); + __webpack_require__2.d(__webpack_exports__2, { + default: () => __WEBPACK_DEFAULT_EXPORT__ + }); + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"); + /*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/api.js"); + /*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + ___CSS_LOADER_EXPORT___.push([module2.id, `:root { + --backgroundGrey: #aaaaaa; + --spacingHeight: 30px; + --button: #333333; + --buttonBackground: #ffffff; + --buttonDisabledBackground: #c8c8c8; + --disabledBackground: #c8c8c8; + --buttonPressed: #ffffff; + --buttonPressedBackground: #606060; + --buttonHoverBackground: #afafaf; +} + +#ge-propertyTab { + user-select: none; + color: black; + background: #e2e2e2; +} +#ge-propertyTab * { + font-family: "acumin-pro-condensed", sans-serif; + font-size: 12px; +} +#ge-propertyTab #header { + height: 32px; + font-size: 16px; + color: white; + background: white; + grid-row: 1; + text-align: center; + display: grid; + grid-template-columns: 30px 1fr; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +#ge-propertyTab #header #logo { + position: relative; + grid-column: 1; + width: 32px; + height: 32px; + left: 0; + display: flex; + align-self: center; + justify-self: center; + filter: invert(1); +} +#ge-propertyTab #header #title { + background: white; + color: black; + grid-column: 2; + display: grid; + align-items: center; + text-align: center; +} +#ge-propertyTab .range { + -webkit-appearance: none; + width: 100%; + height: 2px; + background: #bcbcbc; + border-radius: 5px; + outline: none; + opacity: 0.7; + -webkit-transition: 0.2s; + transition: opacity 0.2s; + padding: 0; +} +#ge-propertyTab .range:hover { + opacity: 1; +} +#ge-propertyTab .range::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 14px; + height: 14px; + border-radius: 50%; + background: #e2e2e2; + border: solid; + border-width: thin; + cursor: pointer; +} +#ge-propertyTab .range::-moz-range-thumb { + width: 14px; + height: 14px; + border-radius: 50%; + background: rgb(0, 0, 0); + cursor: pointer; +} +#ge-propertyTab input[type=color] { + -webkit-appearance: none; + border: 1px solid rgba(255, 255, 255, 0.5); + padding: 0; + width: 30px; + height: 20px; +} +#ge-propertyTab input[type=color]::-webkit-color-swatch-wrapper { + padding: 0; +} +#ge-propertyTab input[type=color]::-webkit-color-swatch { + border: none; +} +#ge-propertyTab hr { + border: 1px solid #d0cece; +} +#ge-propertyTab .icon { + width: 30px; + height: 30px; +} +#ge-propertyTab .unit { + width: 26px; + height: 26px; + color: var(--button); + background-color: var(--buttonBackground); + border: none; + margin-top: 2px; + cursor: pointer; + margin-left: 2px; + font-family: "atten-round-new", sans-serif; + font-weight: 500; + font-style: normal; + display: flex; + justify-content: center; + align-items: center; +} +#ge-propertyTab .unit:disabled { + background-color: var(--buttonDisabledBackground); + cursor: not-allowed; +} +#ge-propertyTab .unit:not(:disabled):hover { + background-color: var(--buttonHoverBackground); +} +#ge-propertyTab .unit:not(:disabled):active { + color: var(--buttonPressed); + background-color: var(--buttonPressedBackground); +} +#ge-propertyTab input, +#ge-propertyTab select { + outline-style: solid; + outline-width: 0px; + outline-color: transparent; + outline-offset: -1px; + outline-width: 1px; + transition: outline-color 0.2s; + border: transparent; + padding-left: 5px; +} +#ge-propertyTab input:focus, +#ge-propertyTab select:focus { + outline-width: 1px; + outline-color: black; +} +#ge-propertyTab .hasArrows input::-webkit-outer-spin-button, +#ge-propertyTab .hasArrows input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} +#ge-propertyTab .hasArrows input[type=number] { + -moz-appearance: textfield; +} +#ge-propertyTab .sliderLine { + height: var(--spacingHeight); + display: grid; + grid-template-rows: 100%; + grid-template-columns: auto 1fr 20px 1fr; + flex-grow: 1; +} +#ge-propertyTab .sliderLine .label { + grid-column: 1; + display: flex; + align-items: center; + min-width: 15px; + font-weight: 600; +} +#ge-propertyTab .sliderLine .img { + grid-column: 1; + display: flex; + align-items: center; +} +#ge-propertyTab .sliderLine .slider { + grid-column: 4; + grid-row: 1; + margin-right: 5px; + display: flex; + align-items: center; + padding-left: 5px; +} +#ge-propertyTab .sliderLine .floatLine { + grid-column: 2; + padding-left: 0px; + grid-template-columns: 1fr auto; +} +#ge-propertyTab .sliderLine .floatLine .label { + grid-column: 1; + display: none; + align-items: center; + font-weight: 600; +} +#ge-propertyTab .sliderLine .floatLine .short { + grid-column: 1; + display: flex; + align-items: center; +} +#ge-propertyTab .sliderLine .floatLine .short input { + width: 100%; + background-color: white; + height: 24px; +} +#ge-propertyTab .sliderLine .floatLine .short input::-webkit-outer-spin-button, +#ge-propertyTab .sliderLine .floatLine .short input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} +#ge-propertyTab .sliderLine .floatLine .short input[type=number] { + -webkit-appearance: textfield; + -moz-appearance: textfield; + appearance: textfield; +} +#ge-propertyTab .ge-divider { + padding-right: 18px; + padding-left: 5px; + display: grid; + grid-template-columns: auto 1fr; + padding-top: 1px; + padding-bottom: 1px; +} +#ge-propertyTab .ge-divider > .textLine + .command-button { + margin-top: -3px; + grid-column: 5; +} +#ge-propertyTab .ge-divider.double { + display: grid; + grid-template-columns: auto 1fr 5px 1fr; +} +#ge-propertyTab .ge-divider.double > .textInputLine:first-of-type, +#ge-propertyTab .ge-divider.double > .floatLine:first-of-type { + grid-column: 2; +} +#ge-propertyTab .ge-divider.double > .textInputLine:nth-of-type(2), +#ge-propertyTab .ge-divider.double > .floatLine:nth-of-type(2) { + grid-column: 4; +} +#ge-propertyTab .ge-divider.double > .command-button { + grid-column: 5; + margin-left: 5px; +} +#ge-propertyTab .ge-divider.quad { + display: grid; + grid-template-columns: 1fr 5px 1fr 5px 1fr 5px 1fr; +} +#ge-propertyTab .ge-divider.quad > .textInputLine:first-of-type, +#ge-propertyTab .ge-divider.quad > .floatLine:first-of-type { + grid-column: 1; +} +#ge-propertyTab .ge-divider.quad > .textInputLine:nth-of-type(2), +#ge-propertyTab .ge-divider.quad > .floatLine:nth-of-type(2) { + grid-column: 3; +} +#ge-propertyTab .ge-divider.quad > .textInputLine:nth-of-type(3), +#ge-propertyTab .ge-divider.quad > .floatLine:nth-of-type(3) { + grid-column: 5; +} +#ge-propertyTab .ge-divider.quad > .textInputLine:nth-of-type(4), +#ge-propertyTab .ge-divider.quad > .floatLine:nth-of-type(4) { + grid-column: 7; +} +#ge-propertyTab .ge-grid-divider { + display: grid; + grid-template-columns: 150px 1fr auto; +} +#ge-propertyTab .ge-grid-divider .textLine { + grid-column: auto; +} +#ge-propertyTab .ge-grid-button-divider { + display: grid; + grid-template-columns: 60px 60px 60px 60px; +} +#ge-propertyTab .ge-grid-remove { + display: grid; + background-color: #c2c2c2; + margin-bottom: 5px; + filter: invert(1); +} +#ge-propertyTab .ge-grid-edit { + display: grid; + background-color: #878787; + margin-bottom: 5px; + filter: invert(1); +} +#ge-propertyTab .ge-grid { + display: grid; + margin-bottom: 5px; +} +#ge-propertyTab .ge-divider.double .textInputLine { + grid-template-columns: auto auto 1fr auto; +} +#ge-propertyTab .textInputLine, +#ge-propertyTab .floatLine { + user-select: none; + padding-bottom: 0px; + padding-top: 0px; + height: var(--spacingHeight); + display: grid; + grid-template-columns: auto auto 1fr; + flex-grow: 1; +} +#ge-propertyTab .textInputLine .label, +#ge-propertyTab .floatLine .label { + grid-column: 2; + display: flex; + align-items: center; + min-width: 15px; + font-weight: 600; +} +#ge-propertyTab .textInputLine .disabled, +#ge-propertyTab .floatLine .disabled { + color: var(--backgroundGrey); + background-color: var(--disabledBackground); +} +#ge-propertyTab .textInputLine img, +#ge-propertyTab .floatLine img { + width: 30px; +} +#ge-propertyTab .textInputLine .img, +#ge-propertyTab .floatLine .img { + grid-column: 1; + display: flex; + align-items: center; +} +#ge-propertyTab .textInputLine .value, +#ge-propertyTab .floatLine .value { + display: flex; + align-items: center; + grid-column: 3; + background: transparent; + height: 26px; + position: relative; + background-color: white; + margin-top: 2px; + overflow-y: hidden; +} +#ge-propertyTab .textInputLine .value input, +#ge-propertyTab .floatLine .value input { + width: 100%; + height: 24px; + color: #333333; +} +#ge-propertyTab .textInputLine .value input.hasArrows, +#ge-propertyTab .floatLine .value input.hasArrows { + padding-right: 15px; +} +#ge-propertyTab .textInputLine .value .arrows, +#ge-propertyTab .floatLine .value .arrows { + display: none; + position: absolute; + right: 0; + flex-direction: column; + cursor: grab; +} +#ge-propertyTab .textInputLine .value .arrows .downArrowIcon, +#ge-propertyTab .textInputLine .value .arrows .upArrowIcon, +#ge-propertyTab .floatLine .value .arrows .downArrowIcon, +#ge-propertyTab .floatLine .value .arrows .upArrowIcon { + width: 13px; + height: 13px; +} +#ge-propertyTab .textInputLine .value:hover .arrows, #ge-propertyTab .textInputLine .value:focus .arrows, #ge-propertyTab .textInputLine .value.dragging .arrows, +#ge-propertyTab .floatLine .value:hover .arrows, +#ge-propertyTab .floatLine .value:focus .arrows, +#ge-propertyTab .floatLine .value.dragging .arrows { + display: flex; +} +#ge-propertyTab .textInputLine .value .arrows:hover, +#ge-propertyTab .floatLine .value .arrows:hover { + background-color: var(--buttonHoverBackground); +} +#ge-propertyTab .textInputLine .value.dragging .arrows, +#ge-propertyTab .floatLine .value.dragging .arrows { + background-color: var(--buttonPressedBackground); +} +#ge-propertyTab .textInputLine .value.dragging .arrows .downArrowIcon, +#ge-propertyTab .textInputLine .value.dragging .arrows .upArrowIcon, +#ge-propertyTab .floatLine .value.dragging .arrows .downArrowIcon, +#ge-propertyTab .floatLine .value.dragging .arrows .upArrowIcon { + filter: brightness(10); +} +#ge-propertyTab .textInputLine.withUnits { + grid-template-columns: auto auto 1fr auto; +} +#ge-propertyTab .textInputArea { + height: 100%; + display: grid; + grid-template-columns: 1fr 120px; +} +#ge-propertyTab .textInputArea .disabled { + color: var(--backgroundGrey); + background-color: var(--disabledBackground); +} +#ge-propertyTab .textInputArea .label { + grid-column: 1; + display: flex; + align-items: center; +} +#ge-propertyTab .textInputArea .value { + display: flex; + align-items: center; + grid-column: 2; +} +#ge-propertyTab .textInputArea .value textarea { + width: calc(150% - 5px); + margin-left: -50%; + height: 40px; +} +#ge-propertyTab .paneContainer { + margin-top: 3px; + display: grid; + grid-template-rows: 100%; + grid-template-columns: 100%; +} +#ge-propertyTab .paneContainer .paneList { + border-left: 3px solid transparent; +} +#ge-propertyTab .paneContainer:hover .paneList { + border-left: 3px solid rgba(51, 122, 183, 0.8); +} +#ge-propertyTab .paneContainer:hover .paneContainer-content .header .title { + border-left: 3px solid rgb(51, 122, 183); +} +#ge-propertyTab .paneContainer .paneContainer-highlight-border { + grid-row: 1; + grid-column: 1; + opacity: 1; + border: 3px solid red; + transition: opacity 250ms; + pointer-events: none; +} +#ge-propertyTab .paneContainer .paneContainer-highlight-border.transparent { + opacity: 0; +} +#ge-propertyTab .paneContainer .paneContainer-content { + grid-row: 1; + grid-column: 1; +} +#ge-propertyTab .paneContainer .paneContainer-content .header { + display: grid; + grid-template-columns: 1fr auto; + background: #cccccc; + height: var(--spacingHeight); + padding-bottom: 0px; + padding-top: 0px; + padding-right: 5px; + cursor: pointer; +} +#ge-propertyTab .paneContainer .paneContainer-content .header .title { + border-left: 3px solid transparent; + padding-left: 5px; + grid-column: 1; + display: flex; + align-items: center; +} +#ge-propertyTab .paneContainer .paneContainer-content .header .collapse { + grid-column: 2; + display: flex; + align-items: center; + justify-items: center; + transform-origin: center; +} +#ge-propertyTab .paneContainer .paneContainer-content .header .collapse.closed { + transform: rotate(180deg); +} +#ge-propertyTab .paneContainer .paneContainer-content .paneList > div:not(:last-child) { + border-bottom: 0.5px solid rgba(255, 255, 255, 0.1); +} +#ge-propertyTab .paneContainer .paneContainer-content .fragment > div:not(:last-child) { + border-bottom: 0.5px solid rgba(255, 255, 255, 0.1); +} +#ge-propertyTab .color-picker { + height: 26px; + width: 26px; +} +#ge-propertyTab .color-picker .color-rect-background { + width: calc(100% - 2px); + height: calc(100% - 2px); + border: 1px black solid; + cursor: pointer; + background: repeating-conic-gradient(#e2e2e2 0% 25%, white 0% 50%) 50%/100% 100%; +} +#ge-propertyTab .color-picker .color-rect-background .color-rect { + height: 100%; +} +#ge-propertyTab .color-picker .color-picker-cover { + z-index: 2; + position: fixed; + top: 0px; + right: 0px; + bottom: 0px; + left: 0px; +} +#ge-propertyTab .color-picker .color-picker-float { + position: absolute; + outline: 1px solid black; +} +#ge-propertyTab .color-picker .color-picker-container { + background-color: #e2e2e2; +} +#ge-propertyTab .gradient-step { + display: grid; + grid-template-rows: 100%; + grid-template-columns: 20px 30px 40px auto 20px 30px; + padding-top: 5px; + padding-left: 5px; + padding-bottom: 5px; +} +#ge-propertyTab .gradient-step .step { + grid-row: 1; + grid-column: 1; +} +#ge-propertyTab .gradient-step .color { + grid-row: 1; + grid-column: 2; + cursor: pointer; +} +#ge-propertyTab .gradient-step .step-value { + margin-left: 5px; + grid-row: 1; + grid-column: 3; + text-align: right; + margin-right: 5px; +} +#ge-propertyTab .gradient-step .step-slider { + grid-row: 1; + grid-column: 4; + display: grid; + justify-content: stretch; + align-content: center; + margin-right: -5px; + padding-left: 12px; +} +#ge-propertyTab .gradient-step .step-slider input { + width: 90%; +} +#ge-propertyTab .gradient-step .gradient-copy { + grid-row: 1; + grid-column: 5; + display: grid; + align-content: center; + justify-content: center; +} +#ge-propertyTab .gradient-step .gradient-copy .img { + height: 20px; + width: 20px; +} +#ge-propertyTab .gradient-step .gradient-copy .img:hover { + cursor: pointer; +} +#ge-propertyTab .gradient-step .gradient-delete { + grid-row: 1; + grid-column: 6; + display: grid; + align-content: center; + justify-content: center; +} +#ge-propertyTab .gradient-step .gradient-delete .img { + height: 20px; + width: 20px; +} +#ge-propertyTab .gradient-step .gradient-delete .img:hover { + cursor: pointer; +} +#ge-propertyTab .alignment-bar { + display: flex; + justify-content: center; + padding-right: 5px; +} +#ge-propertyTab .command-button { + cursor: pointer; + width: 30px; +} +#ge-propertyTab .command-button .command-label { + display: none; +} +#ge-propertyTab .command-button .command-button-icon { + height: 100%; + width: 100%; + display: grid; + color: white; + align-content: center; + justify-content: center; +} +#ge-propertyTab .command-button:hover { + background-color: white; +} +#ge-propertyTab .command-button .active { + transform-origin: center; + background-color: white; +} +#ge-propertyTab .command-button img.active { + background-color: white; +} +#ge-propertyTab .command-button.disabled { + background-color: var(--buttonDisabledBackground); + pointer-events: none; +} +#ge-propertyTab .command-button-alt { + cursor: pointer; + width: 40px; + margin-left: 5px; + margin-right: 5px; + background-color: white; +} +#ge-propertyTab .command-button-alt .command-label { + display: none; +} +#ge-propertyTab .command-button-alt .command-button-icon { + height: 100%; + width: 100%; + display: grid; + align-content: center; + justify-content: center; +} +#ge-propertyTab .command-button-alt:hover { + background-color: #c2c2c2; + filter: invert(1); +} +#ge-propertyTab .command-button-alt-disabled { + cursor: pointer; + pointer-events: none; + width: 40px; + margin-left: 5px; + margin-right: 5px; + background-color: white; +} +#ge-propertyTab .command-button-alt-disabled .command-label { + display: none; +} +#ge-propertyTab .command-button-alt-disabled .command-button-icon { + height: 100%; + width: 100%; + display: grid; + align-content: center; + justify-content: center; +} +#ge-propertyTab .command-button-alt-disabled img { + filter: invert(1); +} +#ge-propertyTab .command-button-alt-active { + cursor: pointer; + pointer-events: none; + width: 40px; + margin-left: 5px; + margin-right: 5px; + background-color: #c2c2c2; + filter: invert(1); +} +#ge-propertyTab .command-button-alt-active .command-label { + display: none; +} +#ge-propertyTab .command-button-alt-active .command-button-icon { + height: 100%; + width: 100%; + display: grid; + align-content: center; + justify-content: center; +} +#ge-propertyTab .floatLine { + user-select: none; + height: var(--spacingHeight); + padding-bottom: 0px; + padding-top: 0px; + display: grid; + grid-template-columns: auto auto 2fr auto; + flex-grow: 1; +} +#ge-propertyTab .floatLine .label { + grid-column: 2; + display: flex; + align-items: center; + min-width: 15px; + font-weight: 600; +} +#ge-propertyTab .floatLine img { + width: 30px; +} +#ge-propertyTab .floatLine .img { + grid-column: 1; + display: flex; + align-items: center; +} +#ge-propertyTab .floatLine .value { + display: flex; + align-items: center; + grid-column: 3; + background: transparent; + height: 26px; +} +#ge-propertyTab .floatLine .value input { + width: 100%; + background-color: white; + height: 24px; +} +#ge-propertyTab .floatLine .short { + grid-column: 2; + display: flex; + align-items: center; +} +#ge-propertyTab .floatLine .short input { + width: 100%; +} +#ge-propertyTab .floatLine .short input::-webkit-outer-spin-button, +#ge-propertyTab .floatLine .short input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} +#ge-propertyTab .floatLine .short input[type=number] { + -moz-appearance: textfield; +} +#ge-propertyTab .vector3Line { + padding-bottom: 0px; + padding-top: 0px; + display: grid; +} +#ge-propertyTab .vector3Line .firstLine { + display: grid; + grid-template-columns: 1fr auto 20px; + height: var(--spacingHeight); +} +#ge-propertyTab .vector3Line .firstLine .label { + grid-column: 1; + display: flex; + align-items: center; +} +#ge-propertyTab .vector3Line .firstLine .vector { + grid-column: 2; + display: flex; + align-items: center; + text-align: right; + opacity: 0.8; +} +#ge-propertyTab .vector3Line .firstLine .expand { + grid-column: 3; + display: grid; + align-items: center; + justify-items: center; + cursor: pointer; +} +#ge-propertyTab .vector3Line .secondLine { + display: grid; + padding-right: 5px; + border-left: 1px solid rgb(51, 122, 183); +} +#ge-propertyTab .vector3Line .secondLine .no-right-margin { + margin-right: 0; +} +#ge-propertyTab .vector3Line .secondLine .numeric { + display: grid; + grid-template-columns: 1fr auto; +} +#ge-propertyTab .vector3Line .secondLine .numeric-label { + text-align: right; + grid-column: 1; + display: flex; + align-items: center; + justify-self: right; + margin-right: 10px; +} +#ge-propertyTab .vector3Line .secondLine .numeric-value { + width: 120px; + grid-column: 2; + display: flex; + align-items: center; + border: 1px solid rgb(51, 122, 183); +} +#ge-propertyTab .buttonLine { + height: var(--spacingHeight); + padding-bottom: 0px; + padding-top: 0px; + display: grid; + align-items: center; + justify-items: stretch; + padding-bottom: 5px; +} +#ge-propertyTab .buttonLine input[type=file] { + display: none; +} +#ge-propertyTab .buttonLine .file-upload { + background: var(--backgroundGrey); + border: 1px solid #424242; + margin: 5px 10px; + color: white; + padding: 4px 5px; + opacity: 0.9; + cursor: pointer; + text-align: center; + border-radius: 4px; +} +#ge-propertyTab .buttonLine .file-upload:hover { + opacity: 1; +} +#ge-propertyTab .buttonLine .file-upload:active { + transform: scale(0.98); + transform-origin: 0.5 0.5; +} +#ge-propertyTab .buttonLine button { + background: var(--backgroundGrey); + border: 1px solid #424242; + margin: 5px 10px 5px 10px; + color: white; + padding: 4px 5px; + opacity: 0.9; + border-radius: 4px; +} +#ge-propertyTab .buttonLine button:hover { + opacity: 1; +} +#ge-propertyTab .buttonLine button:active { + background: #282828; +} +#ge-propertyTab .buttonLine button:focus { + border: 1px solid #424242; + outline: 0px; +} +#ge-propertyTab .numeric { + padding-bottom: 0px; + padding-top: 0px; + height: var(--spacingHeight); + display: grid; + grid-template-columns: 1fr 120px auto; +} +#ge-propertyTab .numeric .numeric-label { + grid-column: 1; + display: flex; + align-items: center; +} +#ge-propertyTab .numeric .number { + display: flex; + align-items: center; + grid-column: 2; + height: 10px; +} +#ge-propertyTab .numeric .number .input { + width: calc(100% - 5px); + height: 10px; +} +#ge-propertyTab .checkBoxLine { + padding-bottom: 0px; + padding-top: 0px; + height: var(--spacingHeight); + display: grid; + grid-template-columns: auto 1fr auto; + flex-grow: 1; +} +#ge-propertyTab .checkBoxLine .label { + grid-column: 2; + display: flex; + align-items: center; + min-width: 100px; + margin-left: 15px; + height: var(--spacingHeight); + font-weight: 600; +} +#ge-propertyTab .checkBoxLine img { + width: 30px; +} +#ge-propertyTab .checkBoxLine .img { + grid-column: 1; + display: flex; + align-items: center; +} +#ge-propertyTab .checkBoxLine .hidden { + display: none; +} +#ge-propertyTab .listLine { + padding-bottom: 0px; + padding-top: 0px; + height: var(--spacingHeight); + display: grid; + grid-template-columns: auto 1fr auto; + flex-grow: 1; +} +#ge-propertyTab .listLine .label { + grid-column: 2; + display: none; + align-items: center; +} +#ge-propertyTab .listLine img { + width: 30px; +} +#ge-propertyTab .listLine .img { + grid-column: 1; + display: flex; + align-items: center; +} +#ge-propertyTab .listLine .options { + grid-column: 2; + padding-left: 15px; + display: flex; + align-items: center; +} +#ge-propertyTab .listLine .options select { + width: 100%; + height: 25px; + border: transparent; +} +#ge-propertyTab .listLine .options input { + width: 100%; + height: 24px; + color: #333333; +} +#ge-propertyTab .color3Line { + padding-left: 15px; + padding-bottom: 0px; + padding-top: 0px; + display: grid; + flex-grow: 1; +} +#ge-propertyTab .color3Line .firstLine { + height: var(--spacingHeight); + display: flex; + align-items: center; +} +#ge-propertyTab .color3Line .firstLine .label { + grid-column: 2; + padding-left: 5px; + display: none; + align-items: center; + min-width: 15px; +} +#ge-propertyTab .color3Line .firstLine .img { + grid-column: 1; + display: flex; + align-items: center; +} +#ge-propertyTab .color3Line .firstLine img { + width: 30px; + height: 30px; +} +#ge-propertyTab .color3Line .firstLine .textInputLine { + grid-column: 3; + padding-left: 2px; + flex-grow: 1; +} +#ge-propertyTab .color3Line .firstLine .color3 { + display: flex; + align-items: center; +} +#ge-propertyTab .color3Line .firstLine .color3 input { + margin-right: 5px; +} +#ge-propertyTab .color3Line .firstLine .copy { + grid-column: 4; + display: none; + align-items: center; + justify-items: center; + cursor: pointer; + color: black; +} +#ge-propertyTab .color3Line .firstLine .copy img { + height: 100%; + width: 20px; +} +#ge-propertyTab .color3Line .firstLine .expand { + grid-column: 4; + display: none; + align-items: center; + justify-items: center; + cursor: pointer; +} +#ge-propertyTab .color3Line .firstLine .expand img { + height: 100%; + width: 20px; +} +#ge-propertyTab .color3Line .secondLine { + display: grid; + padding-right: 5px; + border-left: 1px solid rgb(51, 122, 183); +} +#ge-propertyTab .color3Line .secondLine .numeric { + display: grid; + grid-template-columns: 1fr auto; +} +#ge-propertyTab .color3Line .secondLine .numeric-label { + text-align: right; + grid-column: 1; + display: flex; + align-items: center; + justify-self: right; + margin-right: 10px; +} +#ge-propertyTab .color3Line .secondLine .numeric-value { + width: 120px; + grid-column: 2; + display: flex; + align-items: center; + border: 1px solid rgb(51, 122, 183); +} +#ge-propertyTab .textLine { + padding-left: 5px; + padding-bottom: 0px; + padding-top: 0px; + padding-right: 18px; + height: auto; + display: grid; + grid-template-columns: auto auto 2fr 1fr; +} +#ge-propertyTab .textLine .label { + grid-column: 2; + padding-left: 5px; + padding-top: 4px; + display: flex; + align-items: left; + min-width: 15px; + color: #a9a9a9; + font-size: 10px; + font-family: "acumin-pro-semi-condensed", sans-serif; + font-weight: 600; +} +#ge-propertyTab .textLine img { + width: 30px; +} +#ge-propertyTab .textLine .img { + grid-column: 1; + display: flex; + align-items: center; +} +#ge-propertyTab .textLine .link-value { + grid-column: 2; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + text-align: end; + opacity: 0.8; + margin: 5px; + margin-top: 6px; + max-width: 140px; + text-decoration: underline; + cursor: pointer; +} +#ge-propertyTab .textLine .value { + display: none; + grid-column: 3; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + text-align: end; + opacity: 0.8; + margin: 5px; + margin-top: 6px; + max-width: 200px; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; +} +#ge-propertyTab .textLine .value.check { + color: green; +} +#ge-propertyTab .textLine .value.uncheck { + color: red; +}`, "", { version: 3, sources: ["webpack://./../../../tools/guiEditor/dist/components/propertyTab/propertyTab.scss"], names: [], mappings: "AAAA;EACI,yBAAA;EACA,qBAAA;EACA,iBAAA;EACA,2BAAA;EACA,mCAAA;EACA,6BAAA;EACA,wBAAA;EACA,kCAAA;EACA,gCAAA;AACJ;;AAEA;EACI,iBAAA;EAKA,YAAA;EACA,mBAAA;AAHJ;AAII;EACI,+CAAA;EACA,eAAA;AAFR;AAII;EACI,YAAA;EACA,eAAA;EACA,YAAA;EACA,iBAAA;EACA,WAAA;EACA,kBAAA;EACA,aAAA;EACA,+BAAA;EACA,yBAAA;EACA,sBAAA;EACA,qBAAA;EACA,iBAAA;AAFR;AAIQ;EACI,kBAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,OAAA;EACA,aAAA;EACA,kBAAA;EACA,oBAAA;EACA,iBAAA;AAFZ;AAKQ;EACI,iBAAA;EACA,YAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,kBAAA;AAHZ;AAOI;EACI,wBAAA;EACA,WAAA;EACA,WAAA;EACA,mBAAA;EACA,kBAAA;EACA,aAAA;EACA,YAAA;EACA,wBAAA;EACA,wBAAA;EACA,UAAA;AALR;AAQI;EACI,UAAA;AANR;AASI;EACI,wBAAA;EACA,gBAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;EACA,mBAAA;EACA,aAAA;EACA,kBAAA;EACA,eAAA;AAPR;AAUI;EACI,WAAA;EACA,YAAA;EACA,kBAAA;EACA,wBAAA;EACA,eAAA;AARR;AAWI;EACI,wBAAA;EACA,0CAAA;EACA,UAAA;EACA,WAAA;EACA,YAAA;AATR;AAWI;EACI,UAAA;AATR;AAWI;EACI,YAAA;AATR;AAYI;EACI,yBAAA;AAVR;AAaI;EACI,WAAA;EACA,YAAA;AAXR;AAcI;EACI,WAAA;EACA,YAAA;EACA,oBAAA;EACA,yCAAA;EACA,YAAA;EACA,eAAA;EACA,eAAA;EACA,gBAAA;EACA,0CAAA;EACA,gBAAA;EACA,kBAAA;EACA,aAAA;EACA,uBAAA;EACA,mBAAA;AAZR;AAeI;EACI,iDAAA;EACA,mBAAA;AAbR;AAgBI;EACI,8CAAA;AAdR;AAiBI;EACI,2BAAA;EACA,gDAAA;AAfR;AAkBI;;EAEI,oBAAA;EACA,kBAAA;EACA,0BAAA;EACA,oBAAA;EACA,kBAAA;EACA,8BAAA;EACA,mBAAA;EACA,iBAAA;AAhBR;AAkBQ;;EACI,kBAAA;EACA,oBAAA;AAfZ;AAmBI;;EAEI,wBAAA;EACA,SAAA;AAjBR;AAoBI;EACI,0BAAA;AAlBR;AAqBI;EACI,4BAAA;EACA,aAAA;EACA,wBAAA;EACA,wCAAA;EACA,YAAA;AAnBR;AAqBQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;EACA,gBAAA;AAnBZ;AAsBQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AApBZ;AAuBQ;EACI,cAAA;EACA,WAAA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,iBAAA;AArBZ;AAwBQ;EACI,cAAA;EACA,iBAAA;EACA,+BAAA;AAtBZ;AAwBY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,gBAAA;AAtBhB;AAyBY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAvBhB;AAyBgB;EACI,WAAA;EACA,uBAAA;EACA,YAAA;AAvBpB;AA0BgB;;EAEI,wBAAA;EACA,SAAA;AAxBpB;AA2BgB;EACI,6BAAA;EACA,0BAAA;EACA,qBAAA;AAzBpB;AA+BI;EACI,mBAtOiB;EAuOjB,iBAAA;EACA,aAAA;EACA,+BAAA;EACA,gBAAA;EACA,mBAAA;AA7BR;AA+BQ;EACI,gBAAA;EACA,cAAA;AA7BZ;AAgCI;EACI,aAAA;EACA,uCAAA;AA9BR;AAiCY;;EACI,cAAA;AA9BhB;AAgCY;;EACI,cAAA;AA7BhB;AAgCQ;EACI,cAAA;EACA,gBAAA;AA9BZ;AAiCI;EACI,aAAA;EACA,kDAAA;AA/BR;AAkCY;;EACI,cAAA;AA/BhB;AAiCY;;EACI,cAAA;AA9BhB;AAgCY;;EACI,cAAA;AA7BhB;AA+BY;;EACI,cAAA;AA5BhB;AAgCI;EACI,aAAA;EACA,qCAAA;AA9BR;AAgCQ;EACI,iBAAA;AA9BZ;AAkCI;EACI,aAAA;EACA,0CAAA;AAhCR;AAmCI;EACI,aAAA;EACA,yBAAA;EACA,kBAAA;EACA,iBAAA;AAjCR;AAoCI;EACI,aAAA;EACA,yBAAA;EACA,kBAAA;EACA,iBAAA;AAlCR;AAqCI;EACI,aAAA;EACA,kBAAA;AAnCR;AAsCI;EACI,yCAAA;AApCR;AAuCI;;EAEI,iBAAA;EACA,mBAhUkB;EAiUlB,gBAhUe;EAiUf,4BAAA;EACA,aAAA;EACA,oCAAA;EACA,YAAA;AArCR;AAsCQ;;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;EACA,gBAAA;AAnCZ;AAsCQ;;EACI,4BAAA;EACA,2CAAA;AAnCZ;AAsCQ;;EACI,WAAA;AAnCZ;AAsCQ;;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAnCZ;AAsCQ;;EACI,aAAA;EACA,mBAAA;EACA,cAAA;EACA,uBAAA;EACA,YAAA;EACA,kBAAA;EACA,uBAAA;EACA,eAAA;EACA,kBAAA;AAnCZ;AAoCY;;EACI,WAAA;EACA,YAAA;EACA,cAAA;AAjChB;AAmCY;;EACI,mBAAA;AAhChB;AAkCY;;EACI,aAAA;EACA,kBAAA;EACA,QAAA;EACA,sBAAA;EACA,YAAA;AA/BhB;AAgCgB;;;;EAEI,WAAA;EACA,YAAA;AA5BpB;AA+BY;;;;EAGI,aAAA;AA5BhB;AA8BY;;EACI,8CAAA;AA3BhB;AA6BY;;EACI,gDAAA;AA1BhB;AA2BgB;;;;EAEI,sBAAA;AAvBpB;AA6BI;EACI,yCAAA;AA3BR;AA8BI;EACI,YAAA;EACA,aAAA;EACA,gCAAA;AA5BR;AA8BQ;EACI,4BAAA;EACA,2CAAA;AA5BZ;AA+BQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AA7BZ;AAgCQ;EACI,aAAA;EACA,mBAAA;EACA,cAAA;AA9BZ;AAgCY;EACI,uBAAA;EACA,iBAAA;EACA,YAAA;AA9BhB;AAmCI;EACI,eAAA;EACA,aAAA;EACA,wBAAA;EACA,2BAAA;AAjCR;AAmCQ;EACI,kCAAA;AAjCZ;AAqCY;EACI,8CAAA;AAnChB;AAwCoB;EACI,wCAAA;AAtCxB;AA4CQ;EACI,WAAA;EACA,cAAA;EACA,UAAA;EACA,qBAAA;EACA,yBAAA;EACA,oBAAA;AA1CZ;AA4CY;EACI,UAAA;AA1ChB;AA8CQ;EACI,WAAA;EACA,cAAA;AA5CZ;AA8CY;EACI,aAAA;EACA,+BAAA;EACA,mBAAA;EACA,4BAAA;EACA,mBA5dU;EA6dV,gBA5dO;EA6dP,kBAAA;EACA,eAAA;AA5ChB;AA8CgB;EACI,kCAAA;EACA,iBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;AA5CpB;AA+CgB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,wBAAA;AA7CpB;AA+CoB;EACI,yBAAA;AA7CxB;AAkDY;EACI,mDAAA;AAhDhB;AAmDY;EACI,mDAAA;AAjDhB;AAsDI;EACI,YAAA;EACA,WAAA;AApDR;AAsDQ;EACI,uBAAA;EACA,wBAAA;EACA,uBAAA;EACA,eAAA;EACA,gFAAA;AApDZ;AAqDY;EACI,YAAA;AAnDhB;AAuDQ;EACI,UAAA;EACA,eAAA;EACA,QAAA;EACA,UAAA;EACA,WAAA;EACA,SAAA;AArDZ;AAwDQ;EACI,kBAAA;EACA,wBAAA;AAtDZ;AAyDQ;EACI,yBAAA;AAvDZ;AA2DI;EACI,aAAA;EACA,wBAAA;EACA,oDAAA;EACA,gBAAA;EACA,iBAAA;EACA,mBAAA;AAzDR;AA2DQ;EACI,WAAA;EACA,cAAA;AAzDZ;AA4DQ;EACI,WAAA;EACA,cAAA;EACA,eAAA;AA1DZ;AA6DQ;EACI,gBAAA;EACA,WAAA;EACA,cAAA;EACA,iBAAA;EACA,iBAAA;AA3DZ;AA8DQ;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,wBAAA;EACA,qBAAA;EACA,kBAAA;EACA,kBAAA;AA5DZ;AA8DY;EACI,UAAA;AA5DhB;AAgEQ;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;AA9DZ;AAgEY;EACI,YAAA;EACA,WAAA;AA9DhB;AAgEY;EACI,eAAA;AA9DhB;AAiEQ;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;AA/DZ;AAgEY;EACI,YAAA;EACA,WAAA;AA9DhB;AAgEY;EACI,eAAA;AA9DhB;AAmEI;EACI,aAAA;EACA,uBAAA;EACA,kBAAA;AAjER;AAoEI;EACI,eAAA;EACA,WAAA;AAlER;AAoEQ;EACI,aAAA;AAlEZ;AAqEQ;EACI,YAAA;EACA,WAAA;EACA,aAAA;EACA,YAAA;EACA,qBAAA;EACA,uBAAA;AAnEZ;AAsEQ;EACI,uBAAA;AApEZ;AAuEQ;EACI,wBAAA;EACA,uBAAA;AArEZ;AAyEY;EACI,uBAAA;AAvEhB;AA2EQ;EACI,iDAAA;EACA,oBAAA;AAzEZ;AA6EI;EACI,eAAA;EACA,WAAA;EACA,gBAAA;EACA,iBAAA;EAKA,uBAAA;AA/ER;AA2EQ;EACI,aAAA;AAzEZ;AA6EQ;EACI,YAAA;EACA,WAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;AA3EZ;AA6EQ;EACI,yBAAA;EACA,iBAAA;AA3EZ;AA+EI;EACI,eAAA;EACA,oBAAA;EACA,WAAA;EACA,gBAAA;EACA,iBAAA;EAKA,uBAAA;AAjFR;AA6EQ;EACI,aAAA;AA3EZ;AA+EQ;EACI,YAAA;EACA,WAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;AA7EZ;AAgFQ;EACI,iBAAA;AA9EZ;AAkFI;EACI,eAAA;EACA,oBAAA;EACA,WAAA;EACA,gBAAA;EACA,iBAAA;EAKA,yBAAA;EACA,iBAAA;AApFR;AA+EQ;EACI,aAAA;AA7EZ;AAkFQ;EACI,YAAA;EACA,WAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;AAhFZ;AAoFI;EACI,iBAAA;EACA,4BAAA;EACA,mBA7tBkB;EA8tBlB,gBA7tBe;EA8tBf,aAAA;EACA,yCAAA;EACA,YAAA;AAlFR;AAoFQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;EACA,gBAAA;AAlFZ;AAqFQ;EACI,WAAA;AAnFZ;AAsFQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AApFZ;AAuFQ;EACI,aAAA;EACA,mBAAA;EACA,cAAA;EACA,uBAAA;EACA,YAAA;AArFZ;AAsFY;EACI,WAAA;EACA,uBAAA;EACA,YAAA;AApFhB;AAwFQ;EACI,cAAA;EAEA,aAAA;EACA,mBAAA;AAvFZ;AAyFY;EACI,WAAA;AAvFhB;AA0FY;;EAEI,wBAAA;EACA,SAAA;AAxFhB;AA2FY;EACI,0BAAA;AAzFhB;AA8FI;EACI,mBAzxBkB;EA0xBlB,gBAzxBe;EA0xBf,aAAA;AA5FR;AA6FQ;EACI,aAAA;EACA,oCAAA;EACA,4BAAA;AA3FZ;AA6FY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AA3FhB;AA8FY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,iBAAA;EACA,YAAA;AA5FhB;AA+FY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AA7FhB;AAiGQ;EACI,aAAA;EACA,kBAAA;EACA,wCAAA;AA/FZ;AAiGY;EACI,eAAA;AA/FhB;AAkGY;EACI,aAAA;EACA,+BAAA;AAhGhB;AAmGY;EACI,iBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,kBAAA;AAjGhB;AAoGY;EACI,YAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mCAAA;AAlGhB;AAuGI;EACI,4BAAA;EACA,mBA31BkB;EA41BlB,gBA31Be;EA41Bf,aAAA;EACA,mBAAA;EACA,sBAAA;EACA,mBAAA;AArGR;AAsGQ;EACI,aAAA;AApGZ;AAuGQ;EACI,iCAAA;EACA,yBAAA;EACA,gBAAA;EACA,YAAA;EACA,gBAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;EACA,kBAAA;AArGZ;AAwGQ;EACI,UAAA;AAtGZ;AAyGQ;EACI,sBAAA;EACA,yBAAA;AAvGZ;AA0GQ;EACI,iCAAA;EACA,yBAAA;EACA,yBAAA;EACA,YAAA;EACA,gBAAA;EACA,YAAA;EACA,kBAAA;AAxGZ;AA2GQ;EACI,UAAA;AAzGZ;AA4GQ;EACI,mBAAA;AA1GZ;AA6GQ;EACI,yBAAA;EACA,YAAA;AA3GZ;AA+GI;EACI,mBAn5BkB;EAo5BlB,gBAn5Be;EAo5Bf,4BAAA;EACA,aAAA;EACA,qCAAA;AA7GR;AA+GQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AA7GZ;AAgHQ;EACI,aAAA;EACA,mBAAA;EACA,cAAA;EACA,YAAA;AA9GZ;AA+GY;EACI,uBAAA;EACA,YAAA;AA7GhB;AAkHI;EACI,mBA56BkB;EA66BlB,gBA56Be;EA66Bf,4BAAA;EACA,aAAA;EACA,oCAAA;EACA,YAAA;AAhHR;AAkHQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,gBAAA;EACA,iBAAA;EACA,4BAAA;EACA,gBAAA;AAhHZ;AAmHQ;EACI,WAAA;AAjHZ;AAoHQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAlHZ;AAqHQ;EACI,aAAA;AAnHZ;AAuHI;EACI,mBA78BkB;EA88BlB,gBA78Be;EA88Bf,4BAAA;EACA,aAAA;EACA,oCAAA;EACA,YAAA;AArHR;AAuHQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AArHZ;AAwHQ;EACI,WAAA;AAtHZ;AAyHQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAvHZ;AA0HQ;EACI,cAAA;EACA,kBAAA;EACA,aAAA;EACA,mBAAA;AAxHZ;AA0HY;EACI,WAAA;EACA,YAAA;EACA,mBAAA;AAxHhB;AA2HY;EACI,WAAA;EACA,YAAA;EACA,cAAA;AAzHhB;AA8HI;EACI,kBAAA;EACA,mBA1/BkB;EA2/BlB,gBA1/Be;EA2/Bf,aAAA;EACA,YAAA;AA5HR;AA8HQ;EACI,4BAAA;EACA,aAAA;EACA,mBAAA;AA5HZ;AA8HY;EACI,cAAA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;AA5HhB;AA+HY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AA7HhB;AAgIY;EACI,WAAA;EACA,YAAA;AA9HhB;AAiIY;EACI,cAAA;EACA,iBAAA;EACA,YAAA;AA/HhB;AAkIY;EACI,aAAA;EACA,mBAAA;AAhIhB;AAkIgB;EACI,iBAAA;AAhIpB;AAoIY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;EACA,YAAA;AAlIhB;AAmIgB;EACI,YAAA;EACA,WAAA;AAjIpB;AAqIY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AAnIhB;AAqIgB;EACI,YAAA;EACA,WAAA;AAnIpB;AAwIQ;EACI,aAAA;EACA,kBAAA;EACA,wCAAA;AAtIZ;AAwIY;EACI,aAAA;EACA,+BAAA;AAtIhB;AAyIY;EACI,iBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,kBAAA;AAvIhB;AA0IY;EACI,YAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mCAAA;AAxIhB;AA6II;EACI,iBAhmCgB;EAimChB,mBAhmCkB;EAimClB,gBAhmCe;EAimCf,mBAhmCiB;EAimCjB,YAAA;EACA,aAAA;EACA,wCAAA;AA3IR;AA4IQ;EACI,cAAA;EACA,iBAAA;EACA,gBAAA;EACA,aAAA;EACA,iBAAA;EACA,eAAA;EACA,cAAA;EACA,eAAA;EACA,oDAAA;EACA,gBAAA;AA1IZ;AA6IQ;EACI,WAAA;AA3IZ;AA8IQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AA5IZ;AA+IQ;EACI,cAAA;EACA,mBAAA;EACA,uBAAA;EACA,gBAAA;EACA,eAAA;EACA,YAAA;EACA,WAAA;EACA,eAAA;EACA,gBAAA;EACA,0BAAA;EACA,eAAA;AA7IZ;AAgJQ;EACI,aAAA;EACA,cAAA;EACA,mBAAA;EACA,uBAAA;EACA,gBAAA;EACA,eAAA;EACA,YAAA;EACA,WAAA;EACA,eAAA;EACA,gBAAA;EACA,yBAAA;EACA,sBAAA;EACA,qBAAA;EACA,iBAAA;AA9IZ;AAgJY;EACI,YAAA;AA9IhB;AAiJY;EACI,UAAA;AA/IhB", sourcesContent: [":root {\r\n --backgroundGrey: #aaaaaa;\r\n --spacingHeight: 30px;\r\n --button: #333333;\r\n --buttonBackground: #ffffff;\r\n --buttonDisabledBackground: #c8c8c8;\r\n --disabledBackground: #c8c8c8;\r\n --buttonPressed: #ffffff;\r\n --buttonPressedBackground: #606060;\r\n --buttonHoverBackground: #afafaf;\r\n}\r\n\r\n#ge-propertyTab {\r\n user-select: none;\r\n $line-padding-left: 5px;\r\n $line-padding-bottom: 0px;\r\n $line-padding-top: 0px;\r\n $line-padding-right: 18px;\r\n color: black;\r\n background: #e2e2e2;\r\n * {\r\n font-family: \"acumin-pro-condensed\", sans-serif;\r\n font-size: 12px;\r\n }\r\n #header {\r\n height: 32px;\r\n font-size: 16px;\r\n color: white;\r\n background: white;\r\n grid-row: 1;\r\n text-align: center;\r\n display: grid;\r\n grid-template-columns: 30px 1fr;\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n -ms-user-select: none;\r\n user-select: none;\r\n\r\n #logo {\r\n position: relative;\r\n grid-column: 1;\r\n width: 32px;\r\n height: 32px;\r\n left: 0;\r\n display: flex;\r\n align-self: center;\r\n justify-self: center;\r\n filter: invert(1);\r\n }\r\n\r\n #title {\r\n background: white;\r\n color: black;\r\n grid-column: 2;\r\n display: grid;\r\n align-items: center;\r\n text-align: center;\r\n }\r\n }\r\n\r\n .range {\r\n -webkit-appearance: none;\r\n width: 100%;\r\n height: 2px;\r\n background: #bcbcbc;\r\n border-radius: 5px;\r\n outline: none;\r\n opacity: 0.7;\r\n -webkit-transition: 0.2s;\r\n transition: opacity 0.2s;\r\n padding: 0;\r\n }\r\n\r\n .range:hover {\r\n opacity: 1;\r\n }\r\n\r\n .range::-webkit-slider-thumb {\r\n -webkit-appearance: none;\r\n appearance: none;\r\n width: 14px;\r\n height: 14px;\r\n border-radius: 50%;\r\n background: #e2e2e2;\r\n border: solid;\r\n border-width: thin;\r\n cursor: pointer;\r\n }\r\n\r\n .range::-moz-range-thumb {\r\n width: 14px;\r\n height: 14px;\r\n border-radius: 50%;\r\n background: rgb(0, 0, 0);\r\n cursor: pointer;\r\n }\r\n\r\n input[type=\"color\"] {\r\n -webkit-appearance: none;\r\n border: 1px solid rgba(255, 255, 255, 0.5);\r\n padding: 0;\r\n width: 30px;\r\n height: 20px;\r\n }\r\n input[type=\"color\"]::-webkit-color-swatch-wrapper {\r\n padding: 0;\r\n }\r\n input[type=\"color\"]::-webkit-color-swatch {\r\n border: none;\r\n }\r\n\r\n hr {\r\n border: 1px solid #d0cece;\r\n }\r\n\r\n .icon {\r\n width: 30px;\r\n height: 30px;\r\n }\r\n\r\n .unit {\r\n width: 26px;\r\n height: 26px;\r\n color: var(--button);\r\n background-color: var(--buttonBackground);\r\n border: none;\r\n margin-top: 2px;\r\n cursor: pointer;\r\n margin-left: 2px;\r\n font-family: \"atten-round-new\", sans-serif;\r\n font-weight: 500;\r\n font-style: normal;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n }\r\n\r\n .unit:disabled {\r\n background-color: var(--buttonDisabledBackground);\r\n cursor: not-allowed;\r\n }\r\n\r\n .unit:not(:disabled):hover {\r\n background-color: var(--buttonHoverBackground);\r\n }\r\n\r\n .unit:not(:disabled):active {\r\n color: var(--buttonPressed);\r\n background-color: var(--buttonPressedBackground);\r\n }\r\n\r\n input,\r\n select {\r\n outline-style: solid;\r\n outline-width: 0px;\r\n outline-color: transparent;\r\n outline-offset: -1px;\r\n outline-width: 1px;\r\n transition: outline-color 0.2s;\r\n border: transparent;\r\n padding-left: 5px;\r\n\r\n &:focus {\r\n outline-width: 1px;\r\n outline-color: black;\r\n }\r\n }\r\n\r\n .hasArrows input::-webkit-outer-spin-button,\r\n .hasArrows input::-webkit-inner-spin-button {\r\n -webkit-appearance: none;\r\n margin: 0;\r\n }\r\n\r\n .hasArrows input[type=\"number\"] {\r\n -moz-appearance: textfield;\r\n }\r\n\r\n .sliderLine {\r\n height: var(--spacingHeight);\r\n display: grid;\r\n grid-template-rows: 100%;\r\n grid-template-columns: auto 1fr 20px 1fr;\r\n flex-grow: 1;\r\n\r\n .label {\r\n grid-column: 1;\r\n display: flex;\r\n align-items: center;\r\n min-width: 15px;\r\n font-weight: 600;\r\n }\r\n\r\n .img {\r\n grid-column: 1;\r\n display: flex;\r\n align-items: center;\r\n }\r\n\r\n .slider {\r\n grid-column: 4;\r\n grid-row: 1;\r\n margin-right: 5px;\r\n display: flex;\r\n align-items: center;\r\n padding-left: 5px;\r\n }\r\n\r\n .floatLine {\r\n grid-column: 2;\r\n padding-left: 0px;\r\n grid-template-columns: 1fr auto;\r\n\r\n .label {\r\n grid-column: 1;\r\n display: none;\r\n align-items: center;\r\n font-weight: 600;\r\n }\r\n\r\n .short {\r\n grid-column: 1;\r\n display: flex;\r\n align-items: center;\r\n\r\n input {\r\n width: 100%;\r\n background-color: white;\r\n height: 24px;\r\n }\r\n\r\n input::-webkit-outer-spin-button,\r\n input::-webkit-inner-spin-button {\r\n -webkit-appearance: none;\r\n margin: 0;\r\n }\r\n\r\n input[type=\"number\"] {\r\n -webkit-appearance: textfield;\r\n -moz-appearance: textfield;\r\n appearance: textfield;\r\n }\r\n }\r\n }\r\n }\r\n\r\n .ge-divider {\r\n padding-right: $line-padding-right;\r\n padding-left: 5px;\r\n display: grid;\r\n grid-template-columns: auto 1fr;\r\n padding-top: 1px;\r\n padding-bottom: 1px;\r\n\r\n > .textLine + .command-button {\r\n margin-top: -3px;\r\n grid-column: 5;\r\n }\r\n }\r\n .ge-divider.double {\r\n display: grid;\r\n grid-template-columns: auto 1fr 5px 1fr;\r\n > .textInputLine,\r\n > .floatLine {\r\n &:first-of-type {\r\n grid-column: 2;\r\n }\r\n &:nth-of-type(2) {\r\n grid-column: 4;\r\n }\r\n }\r\n > .command-button {\r\n grid-column: 5;\r\n margin-left: 5px;\r\n }\r\n }\r\n .ge-divider.quad {\r\n display: grid;\r\n grid-template-columns: 1fr 5px 1fr 5px 1fr 5px 1fr;\r\n > .textInputLine,\r\n > .floatLine {\r\n &:first-of-type {\r\n grid-column: 1;\r\n }\r\n &:nth-of-type(2) {\r\n grid-column: 3;\r\n }\r\n &:nth-of-type(3) {\r\n grid-column: 5;\r\n }\r\n &:nth-of-type(4) {\r\n grid-column: 7;\r\n }\r\n }\r\n }\r\n .ge-grid-divider {\r\n display: grid;\r\n grid-template-columns: 150px 1fr auto;\r\n\r\n .textLine {\r\n grid-column: auto;\r\n }\r\n }\r\n\r\n .ge-grid-button-divider {\r\n display: grid;\r\n grid-template-columns: 60px 60px 60px 60px;\r\n }\r\n\r\n .ge-grid-remove {\r\n display: grid;\r\n background-color: #c2c2c2;\r\n margin-bottom: 5px;\r\n filter: invert(1);\r\n }\r\n\r\n .ge-grid-edit {\r\n display: grid;\r\n background-color: #878787;\r\n margin-bottom: 5px;\r\n filter: invert(1);\r\n }\r\n\r\n .ge-grid {\r\n display: grid;\r\n margin-bottom: 5px;\r\n }\r\n\r\n .ge-divider.double .textInputLine {\r\n grid-template-columns: auto auto 1fr auto;\r\n }\r\n\r\n .textInputLine,\r\n .floatLine {\r\n user-select: none;\r\n padding-bottom: $line-padding-bottom;\r\n padding-top: $line-padding-top;\r\n height: var(--spacingHeight);\r\n display: grid;\r\n grid-template-columns: auto auto 1fr;\r\n flex-grow: 1;\r\n .label {\r\n grid-column: 2;\r\n display: flex;\r\n align-items: center;\r\n min-width: 15px;\r\n font-weight: 600;\r\n }\r\n\r\n .disabled {\r\n color: var(--backgroundGrey);\r\n background-color: var(--disabledBackground);\r\n }\r\n\r\n img {\r\n width: 30px;\r\n }\r\n\r\n .img {\r\n grid-column: 1;\r\n display: flex;\r\n align-items: center;\r\n }\r\n\r\n .value {\r\n display: flex;\r\n align-items: center;\r\n grid-column: 3;\r\n background: transparent;\r\n height: 26px;\r\n position: relative;\r\n background-color: white;\r\n margin-top: 2px;\r\n overflow-y: hidden;\r\n input {\r\n width: 100%;\r\n height: 24px;\r\n color: #333333;\r\n }\r\n input.hasArrows {\r\n padding-right: 15px;\r\n }\r\n .arrows {\r\n display: none;\r\n position: absolute;\r\n right: 0;\r\n flex-direction: column;\r\n cursor: grab;\r\n .downArrowIcon,\r\n .upArrowIcon {\r\n width: 13px;\r\n height: 13px;\r\n }\r\n }\r\n &:hover .arrows,\r\n &:focus .arrows,\r\n &.dragging .arrows {\r\n display: flex;\r\n }\r\n .arrows:hover {\r\n background-color: var(--buttonHoverBackground);\r\n }\r\n &.dragging .arrows {\r\n background-color: var(--buttonPressedBackground);\r\n .downArrowIcon,\r\n .upArrowIcon {\r\n filter: brightness(10);\r\n }\r\n }\r\n }\r\n }\r\n\r\n .textInputLine.withUnits {\r\n grid-template-columns: auto auto 1fr auto;\r\n }\r\n\r\n .textInputArea {\r\n height: 100%;\r\n display: grid;\r\n grid-template-columns: 1fr 120px;\r\n\r\n .disabled {\r\n color: var(--backgroundGrey);\r\n background-color: var(--disabledBackground);\r\n }\r\n\r\n .label {\r\n grid-column: 1;\r\n display: flex;\r\n align-items: center;\r\n }\r\n\r\n .value {\r\n display: flex;\r\n align-items: center;\r\n grid-column: 2;\r\n\r\n textarea {\r\n width: calc(150% - 5px);\r\n margin-left: -50%;\r\n height: 40px;\r\n }\r\n }\r\n }\r\n\r\n .paneContainer {\r\n margin-top: 3px;\r\n display: grid;\r\n grid-template-rows: 100%;\r\n grid-template-columns: 100%;\r\n\r\n .paneList {\r\n border-left: 3px solid transparent;\r\n }\r\n\r\n &:hover {\r\n .paneList {\r\n border-left: 3px solid rgba(51, 122, 183, 0.8);\r\n }\r\n\r\n .paneContainer-content {\r\n .header {\r\n .title {\r\n border-left: 3px solid rgb(51, 122, 183);\r\n }\r\n }\r\n }\r\n }\r\n\r\n .paneContainer-highlight-border {\r\n grid-row: 1;\r\n grid-column: 1;\r\n opacity: 1;\r\n border: 3px solid red;\r\n transition: opacity 250ms;\r\n pointer-events: none;\r\n\r\n &.transparent {\r\n opacity: 0;\r\n }\r\n }\r\n\r\n .paneContainer-content {\r\n grid-row: 1;\r\n grid-column: 1;\r\n\r\n .header {\r\n display: grid;\r\n grid-template-columns: 1fr auto;\r\n background: #cccccc;\r\n height: var(--spacingHeight);\r\n padding-bottom: $line-padding-bottom;\r\n padding-top: $line-padding-top;\r\n padding-right: 5px;\r\n cursor: pointer;\r\n\r\n .title {\r\n border-left: 3px solid transparent;\r\n padding-left: 5px;\r\n grid-column: 1;\r\n display: flex;\r\n align-items: center;\r\n }\r\n\r\n .collapse {\r\n grid-column: 2;\r\n display: flex;\r\n align-items: center;\r\n justify-items: center;\r\n transform-origin: center;\r\n\r\n &.closed {\r\n transform: rotate(180deg);\r\n }\r\n }\r\n }\r\n\r\n .paneList > div:not(:last-child) {\r\n border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);\r\n }\r\n\r\n .fragment > div:not(:last-child) {\r\n border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);\r\n }\r\n }\r\n }\r\n\r\n .color-picker {\r\n height: 26px;\r\n width: 26px;\r\n\r\n .color-rect-background {\r\n width: calc(100% - 2px);\r\n height: calc(100% - 2px);\r\n border: 1px black solid;\r\n cursor: pointer;\r\n background: repeating-conic-gradient(#e2e2e2 0% 25%, white 0% 50%) 50% / 100% 100%;\r\n .color-rect {\r\n height: 100%;\r\n }\r\n }\r\n\r\n .color-picker-cover {\r\n z-index: 2;\r\n position: fixed;\r\n top: 0px;\r\n right: 0px;\r\n bottom: 0px;\r\n left: 0px;\r\n }\r\n\r\n .color-picker-float {\r\n position: absolute;\r\n outline: 1px solid black;\r\n }\r\n\r\n .color-picker-container {\r\n background-color: #e2e2e2;\r\n }\r\n }\r\n\r\n .gradient-step {\r\n display: grid;\r\n grid-template-rows: 100%;\r\n grid-template-columns: 20px 30px 40px auto 20px 30px;\r\n padding-top: 5px;\r\n padding-left: 5px;\r\n padding-bottom: 5px;\r\n\r\n .step {\r\n grid-row: 1;\r\n grid-column: 1;\r\n }\r\n\r\n .color {\r\n grid-row: 1;\r\n grid-column: 2;\r\n cursor: pointer;\r\n }\r\n\r\n .step-value {\r\n margin-left: 5px;\r\n grid-row: 1;\r\n grid-column: 3;\r\n text-align: right;\r\n margin-right: 5px;\r\n }\r\n\r\n .step-slider {\r\n grid-row: 1;\r\n grid-column: 4;\r\n display: grid;\r\n justify-content: stretch;\r\n align-content: center;\r\n margin-right: -5px;\r\n padding-left: 12px;\r\n\r\n input {\r\n width: 90%;\r\n }\r\n }\r\n\r\n .gradient-copy {\r\n grid-row: 1;\r\n grid-column: 5;\r\n display: grid;\r\n align-content: center;\r\n justify-content: center;\r\n\r\n .img {\r\n height: 20px;\r\n width: 20px;\r\n }\r\n .img:hover {\r\n cursor: pointer;\r\n }\r\n }\r\n .gradient-delete {\r\n grid-row: 1;\r\n grid-column: 6;\r\n display: grid;\r\n align-content: center;\r\n justify-content: center;\r\n .img {\r\n height: 20px;\r\n width: 20px;\r\n }\r\n .img:hover {\r\n cursor: pointer;\r\n }\r\n }\r\n }\r\n\r\n .alignment-bar {\r\n display: flex;\r\n justify-content: center;\r\n padding-right: 5px;\r\n }\r\n\r\n .command-button {\r\n cursor: pointer;\r\n width: 30px;\r\n\r\n .command-label {\r\n display: none;\r\n }\r\n\r\n .command-button-icon {\r\n height: 100%;\r\n width: 100%;\r\n display: grid;\r\n color: white;\r\n align-content: center;\r\n justify-content: center;\r\n }\r\n\r\n &:hover {\r\n background-color: white;\r\n }\r\n\r\n .active {\r\n transform-origin: center;\r\n background-color: white;\r\n }\r\n\r\n img {\r\n &.active {\r\n background-color: white;\r\n }\r\n }\r\n\r\n &.disabled {\r\n background-color: var(--buttonDisabledBackground);\r\n pointer-events: none;\r\n }\r\n }\r\n\r\n .command-button-alt {\r\n cursor: pointer;\r\n width: 40px;\r\n margin-left: 5px;\r\n margin-right: 5px;\r\n .command-label {\r\n display: none;\r\n }\r\n\r\n background-color: white;\r\n .command-button-icon {\r\n height: 100%;\r\n width: 100%;\r\n display: grid;\r\n align-content: center;\r\n justify-content: center;\r\n }\r\n &:hover {\r\n background-color: #c2c2c2;\r\n filter: invert(1);\r\n }\r\n }\r\n\r\n .command-button-alt-disabled {\r\n cursor: pointer;\r\n pointer-events: none;\r\n width: 40px;\r\n margin-left: 5px;\r\n margin-right: 5px;\r\n .command-label {\r\n display: none;\r\n }\r\n\r\n background-color: white;\r\n .command-button-icon {\r\n height: 100%;\r\n width: 100%;\r\n display: grid;\r\n align-content: center;\r\n justify-content: center;\r\n }\r\n\r\n img {\r\n filter: invert(1);\r\n }\r\n }\r\n\r\n .command-button-alt-active {\r\n cursor: pointer;\r\n pointer-events: none;\r\n width: 40px;\r\n margin-left: 5px;\r\n margin-right: 5px;\r\n .command-label {\r\n display: none;\r\n }\r\n\r\n background-color: #c2c2c2;\r\n filter: invert(1);\r\n .command-button-icon {\r\n height: 100%;\r\n width: 100%;\r\n display: grid;\r\n align-content: center;\r\n justify-content: center;\r\n }\r\n }\r\n\r\n .floatLine {\r\n user-select: none;\r\n height: var(--spacingHeight);\r\n padding-bottom: $line-padding-bottom;\r\n padding-top: $line-padding-top;\r\n display: grid;\r\n grid-template-columns: auto auto 2fr auto;\r\n flex-grow: 1;\r\n\r\n .label {\r\n grid-column: 2;\r\n display: flex;\r\n align-items: center;\r\n min-width: 15px;\r\n font-weight: 600;\r\n }\r\n\r\n img {\r\n width: 30px;\r\n }\r\n\r\n .img {\r\n grid-column: 1;\r\n display: flex;\r\n align-items: center;\r\n }\r\n\r\n .value {\r\n display: flex;\r\n align-items: center;\r\n grid-column: 3;\r\n background: transparent;\r\n height: 26px;\r\n input {\r\n width: 100%;\r\n background-color: white;\r\n height: 24px;\r\n }\r\n }\r\n\r\n .short {\r\n grid-column: 2;\r\n\r\n display: flex;\r\n align-items: center;\r\n\r\n input {\r\n width: 100%;\r\n }\r\n\r\n input::-webkit-outer-spin-button,\r\n input::-webkit-inner-spin-button {\r\n -webkit-appearance: none;\r\n margin: 0;\r\n }\r\n\r\n input[type=\"number\"] {\r\n -moz-appearance: textfield;\r\n }\r\n }\r\n }\r\n\r\n .vector3Line {\r\n padding-bottom: $line-padding-bottom;\r\n padding-top: $line-padding-top;\r\n display: grid;\r\n .firstLine {\r\n display: grid;\r\n grid-template-columns: 1fr auto 20px;\r\n height: var(--spacingHeight);\r\n\r\n .label {\r\n grid-column: 1;\r\n display: flex;\r\n align-items: center;\r\n }\r\n\r\n .vector {\r\n grid-column: 2;\r\n display: flex;\r\n align-items: center;\r\n text-align: right;\r\n opacity: 0.8;\r\n }\r\n\r\n .expand {\r\n grid-column: 3;\r\n display: grid;\r\n align-items: center;\r\n justify-items: center;\r\n cursor: pointer;\r\n }\r\n }\r\n\r\n .secondLine {\r\n display: grid;\r\n padding-right: 5px;\r\n border-left: 1px solid rgb(51, 122, 183);\r\n\r\n .no-right-margin {\r\n margin-right: 0;\r\n }\r\n\r\n .numeric {\r\n display: grid;\r\n grid-template-columns: 1fr auto;\r\n }\r\n\r\n .numeric-label {\r\n text-align: right;\r\n grid-column: 1;\r\n display: flex;\r\n align-items: center;\r\n justify-self: right;\r\n margin-right: 10px;\r\n }\r\n\r\n .numeric-value {\r\n width: 120px;\r\n grid-column: 2;\r\n display: flex;\r\n align-items: center;\r\n border: 1px solid rgb(51, 122, 183);\r\n }\r\n }\r\n }\r\n\r\n .buttonLine {\r\n height: var(--spacingHeight);\r\n padding-bottom: $line-padding-bottom;\r\n padding-top: $line-padding-top;\r\n display: grid;\r\n align-items: center;\r\n justify-items: stretch;\r\n padding-bottom: 5px;\r\n input[type=\"file\"] {\r\n display: none;\r\n }\r\n\r\n .file-upload {\r\n background: var(--backgroundGrey);\r\n border: 1px solid #424242;\r\n margin: 5px 10px;\r\n color: white;\r\n padding: 4px 5px;\r\n opacity: 0.9;\r\n cursor: pointer;\r\n text-align: center;\r\n border-radius: 4px;\r\n }\r\n\r\n .file-upload:hover {\r\n opacity: 1;\r\n }\r\n\r\n .file-upload:active {\r\n transform: scale(0.98);\r\n transform-origin: 0.5 0.5;\r\n }\r\n\r\n button {\r\n background: var(--backgroundGrey);\r\n border: 1px solid #424242;\r\n margin: 5px 10px 5px 10px;\r\n color: white;\r\n padding: 4px 5px;\r\n opacity: 0.9;\r\n border-radius: 4px;\r\n }\r\n\r\n button:hover {\r\n opacity: 1;\r\n }\r\n\r\n button:active {\r\n background: #282828;\r\n }\r\n\r\n button:focus {\r\n border: 1px solid #424242;\r\n outline: 0px;\r\n }\r\n }\r\n\r\n .numeric {\r\n padding-bottom: $line-padding-bottom;\r\n padding-top: $line-padding-top;\r\n height: var(--spacingHeight);\r\n display: grid;\r\n grid-template-columns: 1fr 120px auto;\r\n\r\n .numeric-label {\r\n grid-column: 1;\r\n display: flex;\r\n align-items: center;\r\n }\r\n\r\n .number {\r\n display: flex;\r\n align-items: center;\r\n grid-column: 2;\r\n height: 10px;\r\n .input {\r\n width: calc(100% - 5px);\r\n height: 10px;\r\n }\r\n }\r\n }\r\n\r\n .checkBoxLine {\r\n padding-bottom: $line-padding-bottom;\r\n padding-top: $line-padding-top;\r\n height: var(--spacingHeight);\r\n display: grid;\r\n grid-template-columns: auto 1fr auto;\r\n flex-grow: 1;\r\n\r\n .label {\r\n grid-column: 2;\r\n display: flex;\r\n align-items: center;\r\n min-width: 100px;\r\n margin-left: 15px;\r\n height: var(--spacingHeight);\r\n font-weight: 600;\r\n }\r\n\r\n img {\r\n width: 30px;\r\n }\r\n\r\n .img {\r\n grid-column: 1;\r\n display: flex;\r\n align-items: center;\r\n }\r\n\r\n .hidden {\r\n display: none;\r\n }\r\n }\r\n\r\n .listLine {\r\n padding-bottom: $line-padding-bottom;\r\n padding-top: $line-padding-top;\r\n height: var(--spacingHeight);\r\n display: grid;\r\n grid-template-columns: auto 1fr auto;\r\n flex-grow: 1;\r\n\r\n .label {\r\n grid-column: 2;\r\n display: none;\r\n align-items: center;\r\n }\r\n\r\n img {\r\n width: 30px;\r\n }\r\n\r\n .img {\r\n grid-column: 1;\r\n display: flex;\r\n align-items: center;\r\n }\r\n\r\n .options {\r\n grid-column: 2;\r\n padding-left: 15px;\r\n display: flex;\r\n align-items: center;\r\n\r\n select {\r\n width: 100%;\r\n height: 25px;\r\n border: transparent;\r\n }\r\n\r\n input {\r\n width: 100%;\r\n height: 24px;\r\n color: #333333;\r\n }\r\n }\r\n }\r\n\r\n .color3Line {\r\n padding-left: 15px;\r\n padding-bottom: $line-padding-bottom;\r\n padding-top: $line-padding-top;\r\n display: grid;\r\n flex-grow: 1;\r\n\r\n .firstLine {\r\n height: var(--spacingHeight);\r\n display: flex;\r\n align-items: center;\r\n\r\n .label {\r\n grid-column: 2;\r\n padding-left: 5px;\r\n display: none;\r\n align-items: center;\r\n min-width: 15px;\r\n }\r\n\r\n .img {\r\n grid-column: 1;\r\n display: flex;\r\n align-items: center;\r\n }\r\n\r\n img {\r\n width: 30px;\r\n height: 30px;\r\n }\r\n\r\n .textInputLine {\r\n grid-column: 3;\r\n padding-left: 2px;\r\n flex-grow: 1;\r\n }\r\n\r\n .color3 {\r\n display: flex;\r\n align-items: center;\r\n\r\n input {\r\n margin-right: 5px;\r\n }\r\n }\r\n\r\n .copy {\r\n grid-column: 4;\r\n display: none;\r\n align-items: center;\r\n justify-items: center;\r\n cursor: pointer;\r\n color: black;\r\n img {\r\n height: 100%;\r\n width: 20px;\r\n }\r\n }\r\n\r\n .expand {\r\n grid-column: 4;\r\n display: none;\r\n align-items: center;\r\n justify-items: center;\r\n cursor: pointer;\r\n\r\n img {\r\n height: 100%;\r\n width: 20px;\r\n }\r\n }\r\n }\r\n\r\n .secondLine {\r\n display: grid;\r\n padding-right: 5px;\r\n border-left: 1px solid rgb(51, 122, 183);\r\n\r\n .numeric {\r\n display: grid;\r\n grid-template-columns: 1fr auto;\r\n }\r\n\r\n .numeric-label {\r\n text-align: right;\r\n grid-column: 1;\r\n display: flex;\r\n align-items: center;\r\n justify-self: right;\r\n margin-right: 10px;\r\n }\r\n\r\n .numeric-value {\r\n width: 120px;\r\n grid-column: 2;\r\n display: flex;\r\n align-items: center;\r\n border: 1px solid rgb(51, 122, 183);\r\n }\r\n }\r\n }\r\n\r\n .textLine {\r\n padding-left: $line-padding-left;\r\n padding-bottom: $line-padding-bottom;\r\n padding-top: $line-padding-top;\r\n padding-right: $line-padding-right;\r\n height: auto;\r\n display: grid;\r\n grid-template-columns: auto auto 2fr 1fr;\r\n .label {\r\n grid-column: 2;\r\n padding-left: 5px;\r\n padding-top: 4px;\r\n display: flex;\r\n align-items: left;\r\n min-width: 15px;\r\n color: #a9a9a9;\r\n font-size: 10px;\r\n font-family: \"acumin-pro-semi-condensed\", sans-serif;\r\n font-weight: 600;\r\n }\r\n\r\n img {\r\n width: 30px;\r\n }\r\n\r\n .img {\r\n grid-column: 1;\r\n display: flex;\r\n align-items: center;\r\n }\r\n\r\n .link-value {\r\n grid-column: 2;\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n text-align: end;\r\n opacity: 0.8;\r\n margin: 5px;\r\n margin-top: 6px;\r\n max-width: 140px;\r\n text-decoration: underline;\r\n cursor: pointer;\r\n }\r\n\r\n .value {\r\n display: none;\r\n grid-column: 3;\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n text-align: end;\r\n opacity: 0.8;\r\n margin: 5px;\r\n margin-top: 6px;\r\n max-width: 200px;\r\n -webkit-user-select: text;\r\n -moz-user-select: text;\r\n -ms-user-select: text;\r\n user-select: text;\r\n\r\n &.check {\r\n color: green;\r\n }\r\n\r\n &.uncheck {\r\n color: red;\r\n }\r\n }\r\n }\r\n}\r\n"], sourceRoot: "" }]); + ___CSS_LOADER_EXPORT___.locals = {}; + const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___; + }, + "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/components/sceneExplorer/sceneExplorer.scss": (module2, __webpack_exports__2, __webpack_require__2) => { + /*!******************************************************************************************************************************************************************************************************************************************!*\ + !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/components/sceneExplorer/sceneExplorer.scss ***! + \******************************************************************************************************************************************************************************************************************************************/ + __webpack_require__2.r(__webpack_exports__2); + __webpack_require__2.d(__webpack_exports__2, { + default: () => __WEBPACK_DEFAULT_EXPORT__ + }); + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"); + /*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/api.js"); + /*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + ___CSS_LOADER_EXPORT___.push([module2.id, `#ge-scene-explorer-host { + position: absolute; + left: 0px; + top: 0px; + bottom: 0px; +} +#ge-scene-explorer-host * { + font-family: "acumin-pro-condensed"; +} +#ge-scene-explorer-host:focus { + outline: none; +} + +#ge-__resizable_base__ { + display: none; +} + +.ge-context-menu { + background: #e2e2e2; +} +.ge-context-menu .react-contextmenu-item { + padding: 10px; + cursor: pointer; +} +.ge-context-menu .react-contextmenu-item:hover { + background: #e2e2e2; +} + +.ge-eact-contextmenu.context-menu.react-contextmenu--visible { + z-index: 99; + transform: scale(1); +} + +#ge-sceneExplorer { + background: #e2e2e2; + height: 100%; + margin: 0; + padding: 0; + display: grid; + grid-template-rows: auto 1fr; + font: 16px "acumin-pro-condensed"; +} +#ge-sceneExplorer:focus { + outline: none; +} +#ge-sceneExplorer #header { + height: 30px; + font-size: 16px; + color: black; + background: #e2e2e2; + grid-row: 1; + text-align: center; + display: grid; + grid-template-columns: 30px 1fr 50px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +#ge-sceneExplorer #header #logo { + position: relative; + grid-column: 1; + width: 24px; + height: 24px; + left: 0; + display: flex; + align-self: center; + justify-self: center; +} +#ge-sceneExplorer #header #title { + grid-column: 2; + display: grid; + align-items: center; + text-align: center; +} +#ge-sceneExplorer #header #commands { + grid-column: 3; + display: grid; + align-items: center; + grid-template-columns: 1fr 1fr; +} +#ge-sceneExplorer #header #commands .expand { + grid-column: 1; + display: grid; + align-items: center; + justify-items: center; + cursor: pointer; +} +#ge-sceneExplorer #header #commands .close { + grid-column: 2; + display: grid; + align-items: center; + justify-items: center; + cursor: pointer; +} +#ge-sceneExplorer #tree { + grid-row: 2; + overflow-x: hidden; + overflow-y: auto; +} +#ge-sceneExplorer .filter { + display: flex; + align-items: stretch; +} +#ge-sceneExplorer .filter input { + width: 100%; + margin: 10px 40px 5px 40px; + display: block; + border: none; + padding: 0; + border-bottom: solid 1px rgb(51, 122, 183); + background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 96%, rgb(51, 122, 183) 4%); + background-position: -1000px 0; + background-size: 1000px 100%; + background-repeat: no-repeat; + color: black; +} +#ge-sceneExplorer .filter input::placeholder { + color: lightgray; +} +#ge-sceneExplorer .filter input:focus { + box-shadow: none; + outline: none; + background-position: 0 0; +} +#ge-sceneExplorer .groupContainer { + margin-left: 0px; + color: black; + margin-top: 0px; + margin-bottom: 0px; + height: 24px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + align-self: center; + display: grid; + align-items: center; +} +#ge-sceneExplorer .groupContainer:hover { + background: #bbbbbb; +} +#ge-sceneExplorer .groupContainer .expandableHeader { + display: grid; + grid-template-columns: 1fr 20px; +} +#ge-sceneExplorer .groupContainer .expandableHeader .text { + grid-column: 1; + display: grid; + grid-template-columns: 20px 1fr; +} +#ge-sceneExplorer .groupContainer .expandableHeader .text .arrow { + grid-column: 1; + margin-left: 0px; + color: black; + cursor: pointer; + display: inline-block; + margin-right: 6px; + opacity: 0.5; +} +#ge-sceneExplorer .groupContainer .expandableHeader .text .text-value { + grid-column: 2; + display: flex; + align-items: center; +} +#ge-sceneExplorer .groupContainer .expandableHeader .expandAll { + opacity: 0.5; + grid-column: 2; + margin-right: 10px; +} +#ge-sceneExplorer .icon { + display: grid; + align-items: center; + justify-items: center; + cursor: pointer; +} +#ge-sceneExplorer .addComponent { + display: none; +} +#ge-sceneExplorer .makeChild { + grid-column: 3; +} +#ge-sceneExplorer .itemContainer { + margin-left: 0px; + color: black; + margin-top: 0px; + margin-bottom: 0px; + height: 32px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + display: grid; + grid-template-columns: 20px 1fr; + border: 2px solid transparent; +} +#ge-sceneExplorer .itemContainer.hover { + border: 2px solid #527089; + cursor: pointer; +} +#ge-sceneExplorer .itemContainer.seAbove { + border-top: 2px solid #527089; + cursor: pointer; +} +#ge-sceneExplorer .itemContainer.seBelow { + border-bottom: 2px solid #527089; + cursor: pointer; +} +#ge-sceneExplorer .itemContainer.selected { + background: #bfbebe; + color: black; +} +#ge-sceneExplorer .itemContainer.dragged { + background: transparent; + color: black; +} +#ge-sceneExplorer .itemContainer.parent { + background: #ffffff; + color: black; +} +#ge-sceneExplorer .itemContainer .isNotActive { + opacity: 0.3; +} +#ge-sceneExplorer .itemContainer .arrow { + grid-column: 1; + color: black; + opacity: 0.6; +} +#ge-sceneExplorer .itemContainer .popup { + width: 200px; + visibility: hidden; + background-color: #bbbbbb; + color: #fff; + border: 1px solid rgba(255, 255, 255, 0.5); + position: absolute; + z-index: 1; + margin-left: -180px; + box-sizing: border-box; +} +#ge-sceneExplorer .itemContainer .popup.show { + visibility: visible; +} +#ge-sceneExplorer .itemContainer .popup:focus { + outline: none; +} +#ge-sceneExplorer .itemContainer .popup .popupMenu { + padding: 6px 5px 5px 10px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + height: 18px; +} +#ge-sceneExplorer .itemContainer .popup .popupMenu:hover { + background: white; + color: #333333; +} +#ge-sceneExplorer .itemContainer .sceneNode { + grid-column: 2; + margin-left: -10px; + display: grid; + grid-template-columns: 1fr 20px 20px 20px 20px 10px 20px 20px auto 5px; + align-items: center; + cursor: pointer; +} +#ge-sceneExplorer .itemContainer .sceneNode .sceneTitle { + grid-column: 1; + margin-right: 5px; + display: flex; + align-items: center; + height: 24px; +} +#ge-sceneExplorer .itemContainer .sceneNode .translation { + grid-column: 2; + opacity: 0.6; +} +#ge-sceneExplorer .itemContainer .sceneNode .translation.selected { + opacity: 1; +} +#ge-sceneExplorer .itemContainer .sceneNode .rotation { + grid-column: 3; + opacity: 0.6; +} +#ge-sceneExplorer .itemContainer .sceneNode .rotation.selected { + opacity: 1; +} +#ge-sceneExplorer .itemContainer .sceneNode .scaling { + grid-column: 4; + opacity: 0.6; +} +#ge-sceneExplorer .itemContainer .sceneNode .scaling.selected { + opacity: 1; +} +#ge-sceneExplorer .itemContainer .sceneNode .bounding { + grid-column: 5; + opacity: 0.6; +} +#ge-sceneExplorer .itemContainer .sceneNode .bounding.selected { + opacity: 1; +} +#ge-sceneExplorer .itemContainer .sceneNode .separator { + grid-column: 6; + margin-left: 5px; + width: 5px; + display: flex; + align-items: center; + height: 18px; + border-left: solid 1px rgb(51, 122, 183); +} +#ge-sceneExplorer .itemContainer .sceneNode .pickingMode { + grid-column: 7; + opacity: 0.6; +} +#ge-sceneExplorer .itemContainer .sceneNode .pickingMode.selected { + opacity: 1; +} +#ge-sceneExplorer .itemContainer .sceneNode .refresh { + grid-column: 8; +} +#ge-sceneExplorer .itemContainer .sceneNode .extensions { + width: 20px; + grid-column: 9; +} +#ge-sceneExplorer .itemContainer .adtextureTools { + grid-column: 2; + display: grid; + grid-template-columns: 1fr 20px auto 5px; + align-items: center; +} +#ge-sceneExplorer .itemContainer .adtextureTools .pickingMode { + grid-column: 2; + opacity: 0.6; +} +#ge-sceneExplorer .itemContainer .adtextureTools .pickingMode.selected { + opacity: 1; +} +#ge-sceneExplorer .itemContainer .adtextureTools .extensions { + width: 20px; + grid-column: 3; +} +#ge-sceneExplorer .itemContainer .controlTools { + grid-column: 2; + display: grid; + align-items: center; + grid-template-columns: auto 1fr auto auto auto; +} +#ge-sceneExplorer .itemContainer .controlTools .controlType { + grid-column: 1; +} +#ge-sceneExplorer .itemContainer .controlTools .controlType img { + width: 32px; + height: 32px; + filter: invert(100%); +} +#ge-sceneExplorer .itemContainer .controlTools .highlight { + grid-column: 3; +} +#ge-sceneExplorer .itemContainer .controlTools .visibility { + grid-column: 4; +} +#ge-sceneExplorer .itemContainer .controlTools .extensions { + width: 20px; + grid-column: 5; +} +#ge-sceneExplorer .itemContainer .title { + background: transparent; + white-space: nowrap; + overflow: hidden; + min-width: 0; + margin-right: 5px; + align-items: center; + height: 24px; + cursor: pointer; +} +#ge-sceneExplorer .itemContainer .title .titleText { + font-family: "acumin-pro-condensed", sans-serif; + font-size: 16px; + border: unset; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + outline: none; +}`, "", { version: 3, sources: ["webpack://./../../../tools/guiEditor/dist/components/sceneExplorer/sceneExplorer.scss"], names: [], mappings: "AAAA;EACI,kBAAA;EACA,SAAA;EACA,QAAA;EACA,WAAA;AACJ;AAAI;EACI,mCAAA;AAER;AAAI;EACI,aAAA;AAER;;AAEA;EACI,aAAA;AACJ;;AAEA;EACI,mBAAA;AACJ;AACI;EACI,aAAA;EACA,eAAA;AACR;AACQ;EACI,mBAAA;AACZ;;AAIA;EACI,WAAA;EACA,mBAAA;AADJ;;AAIA;EACI,mBAAA;EACA,YAAA;EACA,SAAA;EACA,UAAA;EACA,aAAA;EACA,4BAAA;EACA,iCAAA;AADJ;AAGI;EACI,aAAA;AADR;AAII;EACI,YAAA;EACA,eAAA;EACA,YAAA;EACA,mBAAA;EACA,WAAA;EACA,kBAAA;EACA,aAAA;EACA,oCAAA;EACA,yBAAA;EACA,sBAAA;EACA,qBAAA;EACA,iBAAA;AAFR;AAIQ;EACI,kBAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,OAAA;EACA,aAAA;EACA,kBAAA;EACA,oBAAA;AAFZ;AAKQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,kBAAA;AAHZ;AAMQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,8BAAA;AAJZ;AAMY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AAJhB;AAOY;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AALhB;AAUI;EACI,WAAA;EAEA,kBAAA;EACA,gBAAA;AATR;AAYI;EACI,aAAA;EACA,oBAAA;AAVR;AAYQ;EACI,WAAA;EACA,0BAAA;EACA,cAAA;EACA,YAAA;EACA,UAAA;EACA,0CAAA;EACA,wFAAA;EACA,8BAAA;EACA,4BAAA;EACA,4BAAA;EACA,YAAA;AAVZ;AAaQ;EACI,gBAAA;AAXZ;AAcQ;EACI,gBAAA;EACA,aAAA;EACA,wBAAA;AAZZ;AAgBI;EACI,gBAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;EACA,YAAA;EAEA,yBAAA;EACA,sBAAA;EACA,qBAAA;EACA,iBAAA;EAEA,kBAAA;EACA,aAAA;EACA,mBAAA;AAhBR;AAkBQ;EACI,mBAAA;AAhBZ;AAmBQ;EACI,aAAA;EACA,+BAAA;AAjBZ;AAmBY;EACI,cAAA;EACA,aAAA;EACA,+BAAA;AAjBhB;AAmBgB;EACI,cAAA;EACA,gBAAA;EACA,YAAA;EACA,eAAA;EACA,qBAAA;EACA,iBAAA;EACA,YAAA;AAjBpB;AAoBgB;EACI,cAAA;EACA,aAAA;EACA,mBAAA;AAlBpB;AAsBY;EACI,YAAA;EACA,cAAA;EACA,kBAAA;AApBhB;AAyBI;EACI,aAAA;EACA,mBAAA;EACA,qBAAA;EACA,eAAA;AAvBR;AA0BI;EACI,aAAA;AAxBR;AA2BI;EACI,cAAA;AAzBR;AA4BI;EACI,gBAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;EACA,YAAA;EACA,yBAAA;EACA,sBAAA;EACA,qBAAA;EACA,iBAAA;EACA,aAAA;EACA,+BAAA;EACA,6BAAA;AA1BR;AA2BQ;EACI,yBAAA;EACA,eAAA;AAzBZ;AA4BQ;EACI,6BAAA;EACA,eAAA;AA1BZ;AA4BQ;EACI,gCAAA;EACA,eAAA;AA1BZ;AA6BQ;EACI,mBAAA;EACA,YAAA;AA3BZ;AA8BQ;EACI,uBAAA;EACA,YAAA;AA5BZ;AA+BQ;EACI,mBAAA;EACA,YAAA;AA7BZ;AAgCQ;EACI,YAAA;AA9BZ;AAgCQ;EACI,cAAA;EACA,YAAA;EACA,YAAA;AA9BZ;AAiCQ;EACI,YAAA;EACA,kBAAA;EACA,yBAAA;EACA,WAAA;EACA,0CAAA;EACA,kBAAA;EACA,UAAA;EACA,mBAAA;EACA,sBAAA;AA/BZ;AAiCY;EACI,mBAAA;AA/BhB;AAkCY;EACI,aAAA;AAhChB;AAmCY;EACI,yBAAA;EACA,gBAAA;EACA,mBAAA;EACA,uBAAA;EACA,YAAA;AAjChB;AAmCgB;EACI,iBAAA;EACA,cAAA;AAjCpB;AAsCQ;EACI,cAAA;EACA,kBAAA;EACA,aAAA;EACA,sEAAA;EACA,mBAAA;EACA,eAAA;AApCZ;AAsCY;EACI,cAAA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,YAAA;AApChB;AAuCY;EACI,cAAA;EACA,YAAA;AArChB;AAuCgB;EACI,UAAA;AArCpB;AAyCY;EACI,cAAA;EACA,YAAA;AAvChB;AAyCgB;EACI,UAAA;AAvCpB;AA2CY;EACI,cAAA;EACA,YAAA;AAzChB;AA0CgB;EACI,UAAA;AAxCpB;AA4CY;EACI,cAAA;EACA,YAAA;AA1ChB;AA2CgB;EACI,UAAA;AAzCpB;AA6CY;EACI,cAAA;EACA,gBAAA;EACA,UAAA;EACA,aAAA;EACA,mBAAA;EACA,YAAA;EACA,wCAAA;AA3ChB;AA8CY;EACI,cAAA;EACA,YAAA;AA5ChB;AA8CgB;EACI,UAAA;AA5CpB;AAgDY;EACI,cAAA;AA9ChB;AAiDY;EACI,WAAA;EACA,cAAA;AA/ChB;AAmDQ;EACI,cAAA;EACA,aAAA;EACA,wCAAA;EACA,mBAAA;AAjDZ;AAmDY;EACI,cAAA;EACA,YAAA;AAjDhB;AAmDgB;EACI,UAAA;AAjDpB;AAqDY;EACI,WAAA;EACA,cAAA;AAnDhB;AAuDQ;EACI,cAAA;EACA,aAAA;EACA,mBAAA;EACA,8CAAA;AArDZ;AAuDY;EACI,cAAA;AArDhB;AAsDgB;EACI,WAAA;EACA,YAAA;EACA,oBAAA;AApDpB;AAwDY;EACI,cAAA;AAtDhB;AAyDY;EACI,cAAA;AAvDhB;AA0DY;EACI,WAAA;EACA,cAAA;AAxDhB;AA4DQ;EACI,uBAAA;EACA,mBAAA;EACA,gBAAA;EACA,YAAA;EACA,iBAAA;EACA,mBAAA;EACA,YAAA;EACA,eAAA;AA1DZ;AA4DY;EACI,+CAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,uBAAA;EACA,gBAAA;EACA,aAAA;AA1DhB", sourcesContent: ["#ge-scene-explorer-host {\r\n position: absolute;\r\n left: 0px;\r\n top: 0px;\r\n bottom: 0px;\r\n * {\r\n font-family: \"acumin-pro-condensed\";\r\n }\r\n &:focus {\r\n outline: none;\r\n }\r\n}\r\n\r\n#ge-__resizable_base__ {\r\n display: none;\r\n}\r\n\r\n.ge-context-menu {\r\n background: #e2e2e2;\r\n\r\n .react-contextmenu-item {\r\n padding: 10px;\r\n cursor: pointer;\r\n\r\n &:hover {\r\n background: #e2e2e2;\r\n }\r\n }\r\n}\r\n\r\n.ge-eact-contextmenu.context-menu.react-contextmenu--visible {\r\n z-index: 99;\r\n transform: scale(1);\r\n}\r\n\r\n#ge-sceneExplorer {\r\n background: #e2e2e2;\r\n height: 100%;\r\n margin: 0;\r\n padding: 0;\r\n display: grid;\r\n grid-template-rows: auto 1fr;\r\n font: 16px \"acumin-pro-condensed\";\r\n\r\n &:focus {\r\n outline: none;\r\n }\r\n\r\n #header {\r\n height: 30px;\r\n font-size: 16px;\r\n color: black;\r\n background: #e2e2e2;\r\n grid-row: 1;\r\n text-align: center;\r\n display: grid;\r\n grid-template-columns: 30px 1fr 50px;\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n -ms-user-select: none;\r\n user-select: none;\r\n\r\n #logo {\r\n position: relative;\r\n grid-column: 1;\r\n width: 24px;\r\n height: 24px;\r\n left: 0;\r\n display: flex;\r\n align-self: center;\r\n justify-self: center;\r\n }\r\n\r\n #title {\r\n grid-column: 2;\r\n display: grid;\r\n align-items: center;\r\n text-align: center;\r\n }\r\n\r\n #commands {\r\n grid-column: 3;\r\n display: grid;\r\n align-items: center;\r\n grid-template-columns: 1fr 1fr;\r\n\r\n .expand {\r\n grid-column: 1;\r\n display: grid;\r\n align-items: center;\r\n justify-items: center;\r\n cursor: pointer;\r\n }\r\n\r\n .close {\r\n grid-column: 2;\r\n display: grid;\r\n align-items: center;\r\n justify-items: center;\r\n cursor: pointer;\r\n }\r\n }\r\n }\r\n\r\n #tree {\r\n grid-row: 2;\r\n\r\n overflow-x: hidden;\r\n overflow-y: auto;\r\n }\r\n\r\n .filter {\r\n display: flex;\r\n align-items: stretch;\r\n\r\n input {\r\n width: 100%;\r\n margin: 10px 40px 5px 40px;\r\n display: block;\r\n border: none;\r\n padding: 0;\r\n border-bottom: solid 1px rgb(51, 122, 183);\r\n background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 96%, rgb(51, 122, 183) 4%);\r\n background-position: -1000px 0;\r\n background-size: 1000px 100%;\r\n background-repeat: no-repeat;\r\n color: black;\r\n }\r\n\r\n input::placeholder {\r\n color: lightgray;\r\n }\r\n\r\n input:focus {\r\n box-shadow: none;\r\n outline: none;\r\n background-position: 0 0;\r\n }\r\n }\r\n\r\n .groupContainer {\r\n margin-left: 0px;\r\n color: black;\r\n margin-top: 0px;\r\n margin-bottom: 0px;\r\n height: 24px;\r\n\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n -ms-user-select: none;\r\n user-select: none;\r\n\r\n align-self: center;\r\n display: grid;\r\n align-items: center;\r\n\r\n &:hover {\r\n background: #bbbbbb;\r\n }\r\n\r\n .expandableHeader {\r\n display: grid;\r\n grid-template-columns: 1fr 20px;\r\n\r\n .text {\r\n grid-column: 1;\r\n display: grid;\r\n grid-template-columns: 20px 1fr;\r\n\r\n .arrow {\r\n grid-column: 1;\r\n margin-left: 0px;\r\n color: black;\r\n cursor: pointer;\r\n display: inline-block;\r\n margin-right: 6px;\r\n opacity: 0.5;\r\n }\r\n\r\n .text-value {\r\n grid-column: 2;\r\n display: flex;\r\n align-items: center;\r\n }\r\n }\r\n\r\n .expandAll {\r\n opacity: 0.5;\r\n grid-column: 2;\r\n margin-right: 10px;\r\n }\r\n }\r\n }\r\n\r\n .icon {\r\n display: grid;\r\n align-items: center;\r\n justify-items: center;\r\n cursor: pointer;\r\n }\r\n\r\n .addComponent {\r\n display: none;\r\n }\r\n\r\n .makeChild {\r\n grid-column: 3;\r\n }\r\n\r\n .itemContainer {\r\n margin-left: 0px;\r\n color: black;\r\n margin-top: 0px;\r\n margin-bottom: 0px;\r\n height: 32px;\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n -ms-user-select: none;\r\n user-select: none;\r\n display: grid;\r\n grid-template-columns: 20px 1fr;\r\n border: 2px solid transparent;\r\n &.hover {\r\n border: 2px solid #527089;\r\n cursor: pointer;\r\n }\r\n\r\n &.seAbove {\r\n border-top: 2px solid #527089;\r\n cursor: pointer;\r\n }\r\n &.seBelow {\r\n border-bottom: 2px solid #527089;\r\n cursor: pointer;\r\n }\r\n\r\n &.selected {\r\n background: #bfbebe;\r\n color: black;\r\n }\r\n\r\n &.dragged {\r\n background: transparent;\r\n color: black;\r\n }\r\n\r\n &.parent {\r\n background: #ffffff;\r\n color: black;\r\n }\r\n\r\n .isNotActive {\r\n opacity: 0.3;\r\n }\r\n .arrow {\r\n grid-column: 1;\r\n color: black;\r\n opacity: 0.6;\r\n }\r\n\r\n .popup {\r\n width: 200px;\r\n visibility: hidden;\r\n background-color: #bbbbbb;\r\n color: #fff;\r\n border: 1px solid rgba(255, 255, 255, 0.5);\r\n position: absolute;\r\n z-index: 1;\r\n margin-left: -180px;\r\n box-sizing: border-box;\r\n\r\n &.show {\r\n visibility: visible;\r\n }\r\n\r\n &:focus {\r\n outline: none;\r\n }\r\n\r\n .popupMenu {\r\n padding: 6px 5px 5px 10px;\r\n overflow: hidden;\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n height: 18px;\r\n\r\n &:hover {\r\n background: white;\r\n color: #333333;\r\n }\r\n }\r\n }\r\n\r\n .sceneNode {\r\n grid-column: 2;\r\n margin-left: -10px;\r\n display: grid;\r\n grid-template-columns: 1fr 20px 20px 20px 20px 10px 20px 20px auto 5px;\r\n align-items: center;\r\n cursor: pointer;\r\n\r\n .sceneTitle {\r\n grid-column: 1;\r\n margin-right: 5px;\r\n display: flex;\r\n align-items: center;\r\n height: 24px;\r\n }\r\n\r\n .translation {\r\n grid-column: 2;\r\n opacity: 0.6;\r\n\r\n &.selected {\r\n opacity: 1;\r\n }\r\n }\r\n\r\n .rotation {\r\n grid-column: 3;\r\n opacity: 0.6;\r\n\r\n &.selected {\r\n opacity: 1;\r\n }\r\n }\r\n\r\n .scaling {\r\n grid-column: 4;\r\n opacity: 0.6;\r\n &.selected {\r\n opacity: 1;\r\n }\r\n }\r\n\r\n .bounding {\r\n grid-column: 5;\r\n opacity: 0.6;\r\n &.selected {\r\n opacity: 1;\r\n }\r\n }\r\n\r\n .separator {\r\n grid-column: 6;\r\n margin-left: 5px;\r\n width: 5px;\r\n display: flex;\r\n align-items: center;\r\n height: 18px;\r\n border-left: solid 1px rgb(51, 122, 183);\r\n }\r\n\r\n .pickingMode {\r\n grid-column: 7;\r\n opacity: 0.6;\r\n\r\n &.selected {\r\n opacity: 1;\r\n }\r\n }\r\n\r\n .refresh {\r\n grid-column: 8;\r\n }\r\n\r\n .extensions {\r\n width: 20px;\r\n grid-column: 9;\r\n }\r\n }\r\n\r\n .adtextureTools {\r\n grid-column: 2;\r\n display: grid;\r\n grid-template-columns: 1fr 20px auto 5px;\r\n align-items: center;\r\n\r\n .pickingMode {\r\n grid-column: 2;\r\n opacity: 0.6;\r\n\r\n &.selected {\r\n opacity: 1;\r\n }\r\n }\r\n\r\n .extensions {\r\n width: 20px;\r\n grid-column: 3;\r\n }\r\n }\r\n\r\n .controlTools {\r\n grid-column: 2;\r\n display: grid;\r\n align-items: center;\r\n grid-template-columns: auto 1fr auto auto auto;\r\n\r\n .controlType {\r\n grid-column: 1;\r\n img {\r\n width: 32px;\r\n height: 32px;\r\n filter: invert(100%);\r\n }\r\n }\r\n\r\n .highlight {\r\n grid-column: 3;\r\n }\r\n\r\n .visibility {\r\n grid-column: 4;\r\n }\r\n\r\n .extensions {\r\n width: 20px;\r\n grid-column: 5;\r\n }\r\n }\r\n\r\n .title {\r\n background: transparent;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n min-width: 0;\r\n margin-right: 5px;\r\n align-items: center;\r\n height: 24px;\r\n cursor: pointer;\r\n\r\n .titleText {\r\n font-family: \"acumin-pro-condensed\", sans-serif;\r\n font-size: 16px;\r\n border: unset;\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n outline: none;\r\n }\r\n }\r\n }\r\n}\r\n"], sourceRoot: "" }]); + ___CSS_LOADER_EXPORT___.locals = {}; + const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___; + }, + "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/diagram/workbenchCanvas.scss": (module2, __webpack_exports__2, __webpack_require__2) => { + /*!***************************************************************************************************************************************************************************************************************************!*\ + !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/diagram/workbenchCanvas.scss ***! + \***************************************************************************************************************************************************************************************************************************/ + __webpack_require__2.r(__webpack_exports__2); + __webpack_require__2.d(__webpack_exports__2, { + default: () => __WEBPACK_DEFAULT_EXPORT__ + }); + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/api.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + ___CSS_LOADER_EXPORT___.push([module2.id, `#workbench-canvas { + grid-column: 1; + grid-row: 1; + width: 100%; + height: 100%; + margin: 0; + padding: 0; + font: 14px "acumin-pro-condensed"; + cursor: default; + user-select: none; + overflow: hidden; + background-image: linear-gradient(to right, #4f4e4f 1px, transparent 1px), linear-gradient(to bottom, #4f4e4f 1px, transparent 1px); +} +#workbench-canvas #selection-container { + pointer-events: none; +} +#workbench-canvas #selection-container .selection-box { + z-index: 10; + background: rgba(72, 72, 196, 0.5); + border: blue solid 2px; +} +#workbench-canvas #workbench-container { + width: 100%; + height: 100%; + left: 0; + top: 0; + transform-origin: left top; + display: grid; + grid-template-rows: 100%; + grid-template-columns: 100%; +} +#workbench-canvas #workbench-container #frame-container { + overflow: visible; + grid-row: 1; + grid-column: 1; + position: relative; + width: 100%; + height: 100%; +} +#workbench-canvas #workbench-container .frame-box { + position: absolute; + background: rgba(72, 72, 72, 0.7); + display: grid; + grid-template-rows: 40px calc(100% - 40px); + grid-template-columns: 100%; + box-sizing: border-box; +} +#workbench-canvas #workbench-container .frame-box.collapsed { + height: auto !important; + width: 200px !important; + z-index: 3; +} +#workbench-canvas #workbench-container .frame-box.collapsed .frame-box-header { + font-size: 16px; + grid-template-columns: calc(100% - 37px) 30px 7px; +} +#workbench-canvas #workbench-container .frame-box.collapsed .frame-box-header .frame-box-header-collapse { + margin-top: -2px; +} +#workbench-canvas #workbench-container .frame-box.collapsed .frame-box-header .frame-box-header-close { + display: none; +} +#workbench-canvas #workbench-container .frame-box.collapsed .frame-comments.has-comments .frame-comment-span { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +#workbench-canvas #workbench-container .frame-box .frame-box-border { + grid-row: 1/span 2; + grid-column: 1; + width: 100%; + height: 100%; + border: transparent solid 4px; + pointer-events: none; + box-sizing: border-box; +} +#workbench-canvas #workbench-container .frame-box .frame-box-header { + grid-row: 1; + grid-column: 1; + background: rgb(72, 72, 72); + color: white; + font-size: 24px; + text-align: center; + display: grid; + grid-template-rows: 100%; + grid-template-columns: calc(100% - 74px) 30px 7px 30px 7px; + align-content: center; + overflow: hidden; +} +#workbench-canvas #workbench-container .frame-box .frame-box-header .frame-box-header-button { + cursor: pointer; + align-self: center; + transform-origin: 50% 50%; + transform: scale(1); + stroke: transparent; + fill: white; + display: grid; +} +#workbench-canvas #workbench-container .frame-box .frame-box-header .frame-box-header-button.down { + transform: scale(0.9); +} +#workbench-canvas #workbench-container .frame-box .frame-box-header .frame-box-header-collapse { + grid-column: 2; + grid-row: 1; +} +#workbench-canvas #workbench-container .frame-box .frame-box-header .frame-box-header-close { + grid-column: 4; + grid-row: 1; +} +#workbench-canvas #workbench-container .frame-box .frame-box-header .frame-box-header-title { + grid-column: 1; + grid-row: 1; + display: grid; + height: 100%; + width: 100%; + align-self: stretch; + align-items: center; + margin-top: -2px; +} +#workbench-canvas #workbench-container .frame-box .frame-comments.has-comments { + display: grid; + grid-row: 2; + grid-column: 1; + padding: 0 10px; + font-style: italic; + word-wrap: break-word; +} +#workbench-canvas #workbench-container .frame-box.selected .frame-box-border { + border-color: white; +} +#workbench-canvas #workbench-container .frame-box .right-handle { + grid-area: 1/2/3/2; + width: 4px; + background-color: transparent; + cursor: ew-resize; +} +#workbench-canvas #workbench-container .frame-box .right-handle::after { + content: ""; + width: 8px; + position: absolute; + top: 0; + bottom: 0; + margin-left: -4px; + cursor: ew-resize; +} +#workbench-canvas #workbench-container .frame-box .right-handle.collapsed { + cursor: pointer; +} +#workbench-canvas #workbench-container .frame-box .top-right-corner-handle { + background-color: transparent; + height: 4px; + z-index: 21; + cursor: ne-resize; + width: 4px; + margin-left: -6px; +} +#workbench-canvas #workbench-container .frame-box .top-right-corner-handle::after { + background-color: transparent; + cursor: ne-resize; + margin-left: unset; + top: -4px; + height: 10px; + width: 10px; +} +#workbench-canvas #workbench-container .frame-box .bottom-right-corner-handle { + background-color: transparent; + height: 0px; + z-index: 21; + cursor: nw-resize; + grid-area: 4/2/4/2; + margin-left: -2px; +} +#workbench-canvas #workbench-container .frame-box .bottom-right-corner-handle::after { + background-color: transparent; + height: 10px; + cursor: nw-resize; + top: unset; + bottom: -4px; + width: 10px; +} +#workbench-canvas #workbench-container .frame-box .left-handle { + grid-area: 1/1/3/1; + width: 4px; + background-color: transparent; + cursor: ew-resize; +} +#workbench-canvas #workbench-container .frame-box .left-handle::before { + content: ""; + width: 8px; + position: absolute; + top: 0; + bottom: 0; + margin-left: -4px; +} +#workbench-canvas #workbench-container .frame-box .top-left-corner-handle { + background-color: transparent; + height: 4px; + z-index: 21; + cursor: nw-resize; + width: 4px; + margin-left: -4px; +} +#workbench-canvas #workbench-container .frame-box .top-left-corner-handle::before { + background-color: transparent; + cursor: nw-resize; + margin-left: unset; + top: -4px; + height: 10px; + width: 10px; +} +#workbench-canvas #workbench-container .frame-box .bottom-left-corner-handle { + background-color: transparent; + height: 0px; + z-index: 21; + cursor: sw-resize; + grid-area: 4/1/4/1; +} +#workbench-canvas #workbench-container .frame-box .bottom-left-corner-handle::before { + background-color: transparent; + height: 10px; + cursor: sw-resize; + top: unset; + bottom: -4px; + width: 10px; +} +#workbench-canvas #workbench-container .frame-box .top-handle { + grid-area: 1/1/1/1; + background-color: transparent; + height: 4px; + cursor: ns-resize; +} +#workbench-canvas #workbench-container .frame-box .top-handle::before { + content: ""; + width: 100%; + position: absolute; + top: -4px; + bottom: 100%; + right: 0; + left: 0; + margin-bottom: -8px; + cursor: ns-resize; + height: 8px; +} +#workbench-canvas #workbench-container .frame-box .bottom-handle { + grid-area: 3/1/3/1; + background-color: transparent; + height: 4px; + cursor: ns-resize; +} +#workbench-canvas #workbench-container .frame-box .bottom-handle::after { + content: ""; + width: 100%; + position: absolute; + top: 100%; + bottom: 0; + right: 0; + left: 0; + margin-top: -8px; + cursor: ns-resize; + height: 12px; +} +#workbench-canvas #workbench-container .frame-box.collapsed .top-handle, +#workbench-canvas #workbench-container .frame-box.collapsed .top-right-corner-handle, +#workbench-canvas #workbench-container .frame-box.collapsed .right-handle, +#workbench-canvas #workbench-container .frame-box.collapsed .bottom-right-corner-handle, +#workbench-canvas #workbench-container .frame-box.collapsed .bottom-handle, +#workbench-canvas #workbench-container .frame-box.collapsed .bottom-left-corner-handle, +#workbench-canvas #workbench-container .frame-box.collapsed .left-handle, +#workbench-canvas #workbench-container .frame-box.collapsed .top-left-corner-handle { + cursor: default; +} +#workbench-canvas #workbench-container .frame-box.collapsed .right-handle::after, +#workbench-canvas #workbench-container .frame-box.collapsed .bottom-handle::after, +#workbench-canvas #workbench-container .frame-box.collapsed .top-right-corner-handle::after, +#workbench-canvas #workbench-container .frame-box.collapsed .bottom-right-corner-handle::after { + cursor: default; +} +#workbench-canvas #workbench-container .frame-box.collapsed .left-handle::before, +#workbench-canvas #workbench-container .frame-box.collapsed .top-handle::before, +#workbench-canvas #workbench-container .frame-box.collapsed .top-left-corner-handle::before, +#workbench-canvas #workbench-container .frame-box.collapsed .bottom-left-corner-handle::before { + cursor: default; +} +#workbench-canvas #workbench-container #workbench-svg-container { + grid-row: 1; + grid-column: 1; + position: relative; + width: 100%; + height: 100%; + overflow: visible; + pointer-events: none; + z-index: 2; +} +#workbench-canvas #workbench-container #workbench-svg-container .link { + stroke-width: 4px; +} +#workbench-canvas #workbench-container #workbench-svg-container .link.selected { + stroke: white !important; + stroke-dasharray: 10, 2; +} +#workbench-canvas #workbench-container #workbench-svg-container .link.hidden { + display: none; +} +#workbench-canvas #workbench-container #workbench-svg-container .selection-link { + pointer-events: all; + stroke-width: 16px; + opacity: 0; + transition: opacity 75ms; + stroke: transparent; + cursor: pointer; +} +#workbench-canvas #workbench-container #workbench-svg-container .selection-link.hidden { + display: none; +} +#workbench-canvas #workbench-container #workbench-svg-container .selection-link:hover, #workbench-canvas #workbench-container #workbench-svg-container .selection-link.selected { + stroke: white !important; + opacity: 0.4; +} +#workbench-canvas #workbench-container #workbench-canvas-container { + grid-row: 1; + grid-column: 1; + position: relative; + width: 100%; + height: 100%; +} +#workbench-canvas #workbench-container #workbench-canvas-container .visual { + z-index: 4; + width: 200px; + position: absolute; + left: 0; + top: 0; + background: gray; + border: 4px solid black; + border-radius: 12px; + display: grid; + grid-template-rows: 30px auto; + grid-template-columns: 100%; + color: white; +} +#workbench-canvas #workbench-container #workbench-canvas-container .visual.hidden { + display: none; +} +#workbench-canvas #workbench-container #workbench-canvas-container .visual .comments { + position: absolute; + top: -50px; + width: 200px; + height: 45px; + overflow: hidden; + font-style: italic; + opacity: 0.8; + display: grid; + align-items: flex-end; + pointer-events: none; +} +#workbench-canvas #workbench-container #workbench-canvas-container .visual .selection-border { + grid-row: 1/span 3; + grid-column: 1; + margin: -4px; + transition: border-color 100ms; + border: 4px solid black; + border-radius: 12px; +} +#workbench-canvas #workbench-container #workbench-canvas-container .visual.selected .selection-border { + border-color: white; +} +#workbench-canvas #workbench-container #workbench-canvas-container .visual .header { + grid-row: 1; + grid-column: 1; + border: 4px solid black; + border-top-right-radius: 7px; + border-top-left-radius: 7px; + font-size: 16px; + text-align: center; + margin-top: -1px; + margin-left: -1px; + margin-right: -1px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + background: black; + color: white; +} +#workbench-canvas #workbench-container #workbench-canvas-container .visual .header.constant { + border-color: #464348; + background: #464348; +} +#workbench-canvas #workbench-container #workbench-canvas-container .visual .header.inspector { + border-color: #66491b; + background: #66491b; +}`, "", { version: 3, sources: ["webpack://./../../../tools/guiEditor/dist/diagram/workbenchCanvas.scss"], names: [], mappings: "AAAA;EACI,cAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,SAAA;EACA,UAAA;EACA,iCAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;EAEA,mIAAA;AAAJ;AAEI;EACI,oBAAA;AAAR;AAEQ;EACI,WAAA;EACA,kCAAA;EACA,sBAAA;AAAZ;AAII;EACI,WAAA;EACA,YAAA;EACA,OAAA;EACA,MAAA;EACA,0BAAA;EACA,aAAA;EACA,wBAAA;EACA,2BAAA;AAFR;AAIQ;EACI,iBAAA;EACA,WAAA;EACA,cAAA;EACA,kBAAA;EACA,WAAA;EACA,YAAA;AAFZ;AAKQ;EACI,kBAAA;EACA,iCAAA;EACA,aAAA;EACA,0CAAA;EACA,2BAAA;EACA,sBAAA;AAHZ;AAKY;EACI,uBAAA;EACA,uBAAA;EACA,UAAA;AAHhB;AAKgB;EACI,eAAA;EACA,iDAAA;AAHpB;AAKoB;EACI,gBAAA;AAHxB;AAMoB;EACI,aAAA;AAJxB;AASoB;EACI,mBAAA;EACA,uBAAA;EACA,gBAAA;AAPxB;AAYY;EACI,kBAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,6BAAA;EACA,oBAAA;EACA,sBAAA;AAVhB;AAaY;EACI,WAAA;EACA,cAAA;EACA,2BAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;EACA,aAAA;EACA,wBAAA;EACA,0DAAA;EACA,qBAAA;EACA,gBAAA;AAXhB;AAagB;EACI,eAAA;EACA,kBAAA;EACA,yBAAA;EACA,mBAAA;EACA,mBAAA;EACA,WAAA;EACA,aAAA;AAXpB;AAaoB;EACI,qBAAA;AAXxB;AAegB;EACI,cAAA;EACA,WAAA;AAbpB;AAgBgB;EACI,cAAA;EACA,WAAA;AAdpB;AAiBgB;EACI,cAAA;EACA,WAAA;EACA,aAAA;EACA,YAAA;EACA,WAAA;EACA,mBAAA;EACA,mBAAA;EACA,gBAAA;AAfpB;AAmBY;EACI,aAAA;EACA,WAAA;EACA,cAAA;EACA,eAAA;EACA,kBAAA;EACA,qBAAA;AAjBhB;AAqBgB;EACI,mBAAA;AAnBpB;AAuBY;EACI,kBAAA;EACA,UAAA;EACA,6BAAA;EACA,iBAAA;AArBhB;AAuBgB;EACI,WAAA;EACA,UAAA;EACA,kBAAA;EACA,MAAA;EACA,SAAA;EACA,iBAAA;EACA,iBAAA;AArBpB;AAwBgB;EACI,eAAA;AAtBpB;AA0BY;EACI,6BAAA;EACA,WAAA;EACA,WAAA;EACA,iBAAA;EACA,UAAA;EACA,iBAAA;AAxBhB;AA0BgB;EACI,6BAAA;EACA,iBAAA;EACA,kBAAA;EACA,SAAA;EACA,YAAA;EACA,WAAA;AAxBpB;AA4BY;EACI,6BAAA;EACA,WAAA;EACA,WAAA;EACA,iBAAA;EACA,kBAAA;EACA,iBAAA;AA1BhB;AA4BgB;EACI,6BAAA;EACA,YAAA;EACA,iBAAA;EACA,UAAA;EACA,YAAA;EACA,WAAA;AA1BpB;AA8BY;EACI,kBAAA;EACA,UAAA;EACA,6BAAA;EACA,iBAAA;AA5BhB;AA8BgB;EACI,WAAA;EACA,UAAA;EACA,kBAAA;EACA,MAAA;EACA,SAAA;EACA,iBAAA;AA5BpB;AAgCY;EACI,6BAAA;EACA,WAAA;EACA,WAAA;EACA,iBAAA;EACA,UAAA;EACA,iBAAA;AA9BhB;AAgCgB;EACI,6BAAA;EACA,iBAAA;EACA,kBAAA;EACA,SAAA;EACA,YAAA;EACA,WAAA;AA9BpB;AAkCY;EACI,6BAAA;EACA,WAAA;EACA,WAAA;EACA,iBAAA;EACA,kBAAA;AAhChB;AAkCgB;EACI,6BAAA;EACA,YAAA;EACA,iBAAA;EACA,UAAA;EACA,YAAA;EACA,WAAA;AAhCpB;AAoCY;EACI,kBAAA;EACA,6BAAA;EACA,WAAA;EACA,iBAAA;AAlChB;AAoCgB;EACI,WAAA;EACA,WAAA;EACA,kBAAA;EACA,SAAA;EACA,YAAA;EACA,QAAA;EACA,OAAA;EACA,mBAAA;EACA,iBAAA;EACA,WAAA;AAlCpB;AAsCY;EACI,kBAAA;EACA,6BAAA;EACA,WAAA;EACA,iBAAA;AApChB;AAsCgB;EACI,WAAA;EACA,WAAA;EACA,kBAAA;EACA,SAAA;EACA,SAAA;EACA,QAAA;EACA,OAAA;EACA,gBAAA;EACA,iBAAA;EACA,YAAA;AApCpB;AAyCgB;;;;;;;;EAQI,eAAA;AAvCpB;AA8CoB;;;;EACI,eAAA;AAzCxB;AAiDoB;;;;EACI,eAAA;AA5CxB;AAkDQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,WAAA;EACA,YAAA;EACA,iBAAA;EACA,oBAAA;EACA,UAAA;AAhDZ;AAkDY;EACI,iBAAA;AAhDhB;AAiDgB;EACI,wBAAA;EACA,uBAAA;AA/CpB;AAkDgB;EACI,aAAA;AAhDpB;AAoDY;EACI,mBAAA;EACA,kBAAA;EACA,UAAA;EACA,wBAAA;EACA,mBAAA;EACA,eAAA;AAlDhB;AAoDgB;EACI,aAAA;AAlDpB;AAqDgB;EAEI,wBAAA;EACA,YAAA;AApDpB;AAyDQ;EACI,WAAA;EACA,cAAA;EACA,kBAAA;EACA,WAAA;EACA,YAAA;AAvDZ;AAyDY;EACI,UAAA;EACA,YAAA;EACA,kBAAA;EACA,OAAA;EACA,MAAA;EACA,gBAAA;EACA,uBAAA;EACA,mBAAA;EACA,aAAA;EACA,6BAAA;EACA,2BAAA;EACA,YAAA;AAvDhB;AAyDgB;EACI,aAAA;AAvDpB;AA0DgB;EACI,kBAAA;EACA,UAAA;EACA,YAAA;EACA,YAAA;EACA,gBAAA;EACA,kBAAA;EACA,YAAA;EACA,aAAA;EACA,qBAAA;EACA,oBAAA;AAxDpB;AA2DgB;EACI,kBAAA;EACA,cAAA;EACA,YAAA;EAEA,8BAAA;EAEA,uBAAA;EACA,mBAAA;AA3DpB;AA+DoB;EACI,mBAAA;AA7DxB;AAiEgB;EACI,WAAA;EACA,cAAA;EACA,uBAAA;EACA,4BAAA;EACA,2BAAA;EACA,eAAA;EACA,kBAAA;EACA,gBAAA;EACA,iBAAA;EACA,kBAAA;EACA,mBAAA;EACA,uBAAA;EACA,gBAAA;EACA,iBAAA;EACA,YAAA;AA/DpB;AAiEoB;EACI,qBAAA;EACA,mBAAA;AA/DxB;AAkEoB;EACI,qBAAA;EACA,mBAAA;AAhExB", sourcesContent: ["#workbench-canvas {\r\n grid-column: 1;\r\n grid-row: 1;\r\n width: 100%;\r\n height: 100%;\r\n margin: 0;\r\n padding: 0;\r\n font: 14px \"acumin-pro-condensed\";\r\n cursor: default;\r\n user-select: none;\r\n overflow: hidden;\r\n\r\n background-image: linear-gradient(to right, #4f4e4f 1px, transparent 1px), linear-gradient(to bottom, #4f4e4f 1px, transparent 1px);\r\n\r\n #selection-container {\r\n pointer-events: none;\r\n\r\n .selection-box {\r\n z-index: 10;\r\n background: rgba(72, 72, 196, 0.5);\r\n border: blue solid 2px;\r\n }\r\n }\r\n\r\n #workbench-container {\r\n width: 100%;\r\n height: 100%;\r\n left: 0;\r\n top: 0;\r\n transform-origin: left top;\r\n display: grid;\r\n grid-template-rows: 100%;\r\n grid-template-columns: 100%;\r\n\r\n #frame-container {\r\n overflow: visible;\r\n grid-row: 1;\r\n grid-column: 1;\r\n position: relative;\r\n width: 100%;\r\n height: 100%;\r\n }\r\n\r\n .frame-box {\r\n position: absolute;\r\n background: rgba(72, 72, 72, 0.7);\r\n display: grid;\r\n grid-template-rows: 40px calc(100% - 40px);\r\n grid-template-columns: 100%;\r\n box-sizing: border-box;\r\n\r\n &.collapsed {\r\n height: auto !important;\r\n width: 200px !important;\r\n z-index: 3;\r\n\r\n .frame-box-header {\r\n font-size: 16px;\r\n grid-template-columns: calc(100% - 37px) 30px 7px;\r\n\r\n .frame-box-header-collapse {\r\n margin-top: -2px;\r\n }\r\n\r\n .frame-box-header-close {\r\n display: none;\r\n }\r\n }\r\n\r\n .frame-comments.has-comments {\r\n .frame-comment-span {\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n }\r\n }\r\n }\r\n\r\n .frame-box-border {\r\n grid-row: 1 / span 2;\r\n grid-column: 1;\r\n width: 100%;\r\n height: 100%;\r\n border: transparent solid 4px;\r\n pointer-events: none;\r\n box-sizing: border-box;\r\n }\r\n\r\n .frame-box-header {\r\n grid-row: 1;\r\n grid-column: 1;\r\n background: rgba(72, 72, 72, 1);\r\n color: white;\r\n font-size: 24px;\r\n text-align: center;\r\n display: grid;\r\n grid-template-rows: 100%;\r\n grid-template-columns: calc(100% - 74px) 30px 7px 30px 7px;\r\n align-content: center;\r\n overflow: hidden;\r\n\r\n .frame-box-header-button {\r\n cursor: pointer;\r\n align-self: center;\r\n transform-origin: 50% 50%;\r\n transform: scale(1);\r\n stroke: transparent;\r\n fill: white;\r\n display: grid;\r\n\r\n &.down {\r\n transform: scale(0.9);\r\n }\r\n }\r\n\r\n .frame-box-header-collapse {\r\n grid-column: 2;\r\n grid-row: 1;\r\n }\r\n\r\n .frame-box-header-close {\r\n grid-column: 4;\r\n grid-row: 1;\r\n }\r\n\r\n .frame-box-header-title {\r\n grid-column: 1;\r\n grid-row: 1;\r\n display: grid;\r\n height: 100%;\r\n width: 100%;\r\n align-self: stretch;\r\n align-items: center;\r\n margin-top: -2px;\r\n }\r\n }\r\n\r\n .frame-comments.has-comments {\r\n display: grid;\r\n grid-row: 2;\r\n grid-column: 1;\r\n padding: 0 10px;\r\n font-style: italic;\r\n word-wrap: break-word;\r\n }\r\n\r\n &.selected {\r\n .frame-box-border {\r\n border-color: white;\r\n }\r\n }\r\n\r\n .right-handle {\r\n grid-area: 1 / 2 / 3 / 2;\r\n width: 4px;\r\n background-color: transparent;\r\n cursor: ew-resize;\r\n\r\n &::after {\r\n content: \"\";\r\n width: 8px;\r\n position: absolute;\r\n top: 0;\r\n bottom: 0;\r\n margin-left: -4px;\r\n cursor: ew-resize;\r\n }\r\n\r\n &.collapsed {\r\n cursor: pointer;\r\n }\r\n }\r\n\r\n .top-right-corner-handle {\r\n background-color: transparent;\r\n height: 4px;\r\n z-index: 21;\r\n cursor: ne-resize;\r\n width: 4px;\r\n margin-left: -6px;\r\n\r\n &::after {\r\n background-color: transparent;\r\n cursor: ne-resize;\r\n margin-left: unset;\r\n top: -4px;\r\n height: 10px;\r\n width: 10px;\r\n }\r\n }\r\n\r\n .bottom-right-corner-handle {\r\n background-color: transparent;\r\n height: 0px;\r\n z-index: 21;\r\n cursor: nw-resize;\r\n grid-area: 4 / 2 / 4 / 2;\r\n margin-left: -2px;\r\n\r\n &::after {\r\n background-color: transparent;\r\n height: 10px;\r\n cursor: nw-resize;\r\n top: unset;\r\n bottom: -4px;\r\n width: 10px;\r\n }\r\n }\r\n\r\n .left-handle {\r\n grid-area: 1 / 1 / 3 / 1;\r\n width: 4px;\r\n background-color: transparent;\r\n cursor: ew-resize;\r\n\r\n &::before {\r\n content: \"\";\r\n width: 8px;\r\n position: absolute;\r\n top: 0;\r\n bottom: 0;\r\n margin-left: -4px;\r\n }\r\n }\r\n\r\n .top-left-corner-handle {\r\n background-color: transparent;\r\n height: 4px;\r\n z-index: 21;\r\n cursor: nw-resize;\r\n width: 4px;\r\n margin-left: -4px;\r\n\r\n &::before {\r\n background-color: transparent;\r\n cursor: nw-resize;\r\n margin-left: unset;\r\n top: -4px;\r\n height: 10px;\r\n width: 10px;\r\n }\r\n }\r\n\r\n .bottom-left-corner-handle {\r\n background-color: transparent;\r\n height: 0px;\r\n z-index: 21;\r\n cursor: sw-resize;\r\n grid-area: 4 / 1 / 4 / 1;\r\n\r\n &::before {\r\n background-color: transparent;\r\n height: 10px;\r\n cursor: sw-resize;\r\n top: unset;\r\n bottom: -4px;\r\n width: 10px;\r\n }\r\n }\r\n\r\n .top-handle {\r\n grid-area: 1 / 1 / 1 / 1;\r\n background-color: transparent;\r\n height: 4px;\r\n cursor: ns-resize;\r\n\r\n &::before {\r\n content: \"\";\r\n width: 100%;\r\n position: absolute;\r\n top: -4px;\r\n bottom: 100%;\r\n right: 0;\r\n left: 0;\r\n margin-bottom: -8px;\r\n cursor: ns-resize;\r\n height: 8px;\r\n }\r\n }\r\n\r\n .bottom-handle {\r\n grid-area: 3 / 1 / 3 / 1;\r\n background-color: transparent;\r\n height: 4px;\r\n cursor: ns-resize;\r\n\r\n &::after {\r\n content: \"\";\r\n width: 100%;\r\n position: absolute;\r\n top: 100%;\r\n bottom: 0;\r\n right: 0;\r\n left: 0;\r\n margin-top: -8px;\r\n cursor: ns-resize;\r\n height: 12px;\r\n }\r\n }\r\n\r\n &.collapsed {\r\n .top-handle,\r\n .top-right-corner-handle,\r\n .right-handle,\r\n .bottom-right-corner-handle,\r\n .bottom-handle,\r\n .bottom-left-corner-handle,\r\n .left-handle,\r\n .top-left-corner-handle {\r\n cursor: default;\r\n }\r\n\r\n .right-handle,\r\n .bottom-handle,\r\n .top-right-corner-handle,\r\n .bottom-right-corner-handle {\r\n &::after {\r\n cursor: default;\r\n }\r\n }\r\n\r\n .left-handle,\r\n .top-handle,\r\n .top-left-corner-handle,\r\n .bottom-left-corner-handle {\r\n &::before {\r\n cursor: default;\r\n }\r\n }\r\n }\r\n }\r\n\r\n #workbench-svg-container {\r\n grid-row: 1;\r\n grid-column: 1;\r\n position: relative;\r\n width: 100%;\r\n height: 100%;\r\n overflow: visible;\r\n pointer-events: none;\r\n z-index: 2;\r\n\r\n .link {\r\n stroke-width: 4px;\r\n &.selected {\r\n stroke: white !important;\r\n stroke-dasharray: 10, 2;\r\n }\r\n\r\n &.hidden {\r\n display: none;\r\n }\r\n }\r\n\r\n .selection-link {\r\n pointer-events: all;\r\n stroke-width: 16px;\r\n opacity: 0;\r\n transition: opacity 75ms;\r\n stroke: transparent;\r\n cursor: pointer;\r\n\r\n &.hidden {\r\n display: none;\r\n }\r\n\r\n &:hover,\r\n &.selected {\r\n stroke: white !important;\r\n opacity: 0.4;\r\n }\r\n }\r\n }\r\n\r\n #workbench-canvas-container {\r\n grid-row: 1;\r\n grid-column: 1;\r\n position: relative;\r\n width: 100%;\r\n height: 100%;\r\n\r\n .visual {\r\n z-index: 4;\r\n width: 200px;\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n background: gray;\r\n border: 4px solid black;\r\n border-radius: 12px;\r\n display: grid;\r\n grid-template-rows: 30px auto;\r\n grid-template-columns: 100%;\r\n color: white;\r\n\r\n &.hidden {\r\n display: none;\r\n }\r\n\r\n .comments {\r\n position: absolute;\r\n top: -50px;\r\n width: 200px;\r\n height: 45px;\r\n overflow: hidden;\r\n font-style: italic;\r\n opacity: 0.8;\r\n display: grid;\r\n align-items: flex-end;\r\n pointer-events: none;\r\n }\r\n\r\n .selection-border {\r\n grid-row: 1 / span 3;\r\n grid-column: 1;\r\n margin: -4px;\r\n\r\n transition: border-color 100ms;\r\n\r\n border: 4px solid black;\r\n border-radius: 12px;\r\n }\r\n\r\n &.selected {\r\n .selection-border {\r\n border-color: white;\r\n }\r\n }\r\n\r\n .header {\r\n grid-row: 1;\r\n grid-column: 1;\r\n border: 4px solid black;\r\n border-top-right-radius: 7px;\r\n border-top-left-radius: 7px;\r\n font-size: 16px;\r\n text-align: center;\r\n margin-top: -1px;\r\n margin-left: -1px;\r\n margin-right: -1px;\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n background: black;\r\n color: white;\r\n\r\n &.constant {\r\n border-color: #464348;\r\n background: #464348;\r\n }\r\n\r\n &.inspector {\r\n border-color: #66491b;\r\n background: #66491b;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n"], sourceRoot: "" }]); + ___CSS_LOADER_EXPORT___.locals = {}; + const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___; + }, + "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/main.scss": (module2, __webpack_exports__2, __webpack_require__2) => { + /*!********************************************************************************************************************************************************************************************************!*\ + !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/main.scss ***! + \********************************************************************************************************************************************************************************************************/ + __webpack_require__2.r(__webpack_exports__2); + __webpack_require__2.d(__webpack_exports__2, { + default: () => __WEBPACK_DEFAULT_EXPORT__ + }); + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"); + /*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/api.js"); + /*! ../../../../node_modules/css-loader/dist/runtime/api.js */ + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + ___CSS_LOADER_EXPORT___.push([module2.id, `:root { + --blackBarHeight: 55px; +} + +#gui-editor-workbench-root { + display: grid; + grid-template-rows: calc(100% - 55px); + height: 100%; + width: 100%; + background: #e2e2e2; + font: 14px "acumin-pro-condensed"; +} + +.wait-screen { + display: grid; + justify-content: center; + align-content: center; + height: 100%; + width: 100%; + background: #464646; + opacity: 0.95; + color: white; + font: 24px "acumin-pro-condensed"; + position: absolute; + top: 0; + left: 0; +} +.wait-screen.hidden { + visibility: hidden; +} + +#leftGrab { + width: 5px; + height: 100%; + cursor: ew-resize; + position: absolute; + right: -1px; + top: 0; +} + +#rightGrab { + cursor: ew-resize; + width: 5px; + bottom: 0; + position: absolute; + top: 0; + left: 0; +} + +.toolbarGrab { + background: #333333; + grid-row: 1/span 3; + grid-column: 2; + height: 100%; + overflow-y: auto; +} +.toolbarGrab .blackLine { + height: 16px; + background: black; + position: relative; +} +.toolbarGrab .arrow { + color: white; + position: absolute; +} +.toolbarGrab .toolbar-label { + color: white; + font-size: 18px; + display: grid; + align-items: center; + cursor: pointer; + user-select: none; + grid-template-columns: 1fr 20px; + grid-template-rows: 100%; + position: relative; +} +.toolbarGrab .toolbar-label.active { + font-weight: bold; + font-size: 20px; +} +.toolbarGrab .toolbar-label:hover { + background: var(--selectionGrey); +} +.toolbarGrab .toolbar-label:hover .sub-items { + display: block; +} +.toolbarGrab .toolbar-icon { + width: 40px; + height: 40px; +} +.toolbarGrab.expanded .toolbar-content-sub1 { + column-count: 2; +} + +.diagram-container { + position: relative; + display: grid; + grid-row: 1; + grid-column: 2; + background: #cccccc; + width: 100%; + height: 100%; + overflow: hidden; +} +.diagram-container .diagram { + display: none; + width: 100%; + height: 100%; +} + +.left-panel { + grid-row: 1/span 2; + grid-column: 1; + display: grid; + grid-template-rows: 100%; + grid-template-columns: 1fr 50px; + position: relative; + overflow: hidden; +} +.left-panel.expand { + grid-template-columns: 1fr 100px; +} + +.right-panel { + grid-row: 1/span 2; + grid-column: 3; + display: grid; + grid-template-rows: 1fr 40px auto 40px; + grid-template-columns: 100%; + overflow-y: auto; + position: relative; +} +.right-panel #propertyTab { + grid-row: 1; + grid-column: 1; +} +.right-panel .button { + display: grid; + justify-content: center; + align-content: center; + height: auto; + width: 14.2857142857%; + cursor: pointer; +} +.right-panel .button:hover { + background: rgb(51, 122, 183); + color: white; + opacity: 0.8; +} +.right-panel .button.selected { + background: rgb(51, 122, 183); + color: white; +} +.right-panel .button.align { + justify-content: stretch; + text-align: center; +} + +.blocker { + visibility: hidden; + position: absolute; + width: calc(100% - 40px); + height: 100%; + top: 0; + left: 0; + background: rgba(20, 20, 20, 0.95); + font-family: "acumin-pro-condensed", sans-serif; + color: white; + font-size: 24px; + display: grid; + align-content: center; + justify-content: center; + user-select: none; + padding: 20px; + text-align: center; +} + +#log-console { + grid-row: 2; + grid-column: 4; + display: none; +} + +.gizmo * { + user-select: none; +} +.gizmo .bounding-box-line { + background-color: black; + position: absolute; + line-height: 1px; + height: 1px; + pointer-events: none; +} +.gizmo .scale-point-container { + position: absolute; + width: 30px; + height: 30px; +} +.gizmo .scale-point-container .scale-point { + top: 10px; + left: 10px; + position: absolute; + width: 10px; + height: 10px; + background: transparent; + outline: rgb(125, 125, 125) 2px solid; +} +.gizmo .scale-point-container .rotate-click-area { + width: 20px; + height: 20px; + position: absolute; +} +.gizmo .scale-point-container .scale-click-area { + width: 20px; + height: 20px; + position: absolute; +} +.gizmo .pivot-point { + width: 30px; + height: 30px; + background: transparent; + position: absolute; +} + +#workbench-canvas { + position: relative; +} + +.artboard-stroke { + outline: 1px solid black; + position: absolute; + z-index: 2; + pointer-events: none; +} + +.artboard-background { + position: absolute; + background: repeating-conic-gradient(#e2e2e2 0% 25%, white 0% 50%) 50%/10px 10px; + width: 100%; + height: 100%; +}`, "", { version: 3, sources: ["webpack://./../../../tools/guiEditor/dist/main.scss"], names: [], mappings: "AAAA;EACI,sBAAA;AACJ;;AAEA;EACI,aAAA;EACA,qCAAA;EACA,YAAA;EACA,WAAA;EACA,mBAAA;EACA,iCAAA;AACJ;;AAEA;EACI,aAAA;EACA,uBAAA;EACA,qBAAA;EACA,YAAA;EACA,WAAA;EACA,mBAAA;EACA,aAAA;EACA,YAAA;EACA,iCAAA;EACA,kBAAA;EACA,MAAA;EACA,OAAA;AACJ;AACI;EACI,kBAAA;AACR;;AAGA;EACI,UAAA;EACA,YAAA;EACA,iBAAA;EACA,kBAAA;EACA,WAAA;EACA,MAAA;AAAJ;;AAGA;EACI,iBAAA;EACA,UAAA;EACA,SAAA;EACA,kBAAA;EACA,MAAA;EACA,OAAA;AAAJ;;AAGA;EACI,mBAAA;EACA,kBAAA;EACA,cAAA;EACA,YAAA;EACA,gBAAA;AAAJ;AAEI;EACI,YAAA;EACA,iBAAA;EACA,kBAAA;AAAR;AAEI;EACI,YAAA;EACA,kBAAA;AAAR;AAEI;EACI,YAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;EACA,iBAAA;EACA,+BAAA;EACA,wBAAA;EACA,kBAAA;AAAR;AAEQ;EACI,iBAAA;EACA,eAAA;AAAZ;AAGQ;EACI,gCAAA;AADZ;AAEY;EACI,cAAA;AAAhB;AAII;EACI,WAAA;EACA,YAAA;AAFR;AAKQ;EACI,eAAA;AAHZ;;AAQA;EACI,kBAAA;EACA,aAAA;EACA,WAAA;EACA,cAAA;EACA,mBAAA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;AALJ;AAOI;EACI,aAAA;EACA,WAAA;EACA,YAAA;AALR;;AASA;EACI,kBAAA;EACA,cAAA;EACA,aAAA;EACA,wBAAA;EACA,+BAAA;EACA,kBAAA;EACA,gBAAA;AANJ;AAOI;EACI,gCAAA;AALR;;AASA;EACI,kBAAA;EACA,cAAA;EACA,aAAA;EACA,sCAAA;EACA,2BAAA;EACA,gBAAA;EACA,kBAAA;AANJ;AAQI;EACI,WAAA;EACA,cAAA;AANR;AASI;EACI,aAAA;EACA,uBAAA;EACA,qBAAA;EACA,YAAA;EACA,qBAAA;EACA,eAAA;AAPR;AASQ;EACI,6BAAA;EACA,YAAA;EACA,YAAA;AAPZ;AAUQ;EACI,6BAAA;EACA,YAAA;AARZ;AAWQ;EACI,wBAAA;EACA,kBAAA;AATZ;;AAcA;EACI,kBAAA;EACA,kBAAA;EACA,wBAAA;EACA,YAAA;EACA,MAAA;EACA,OAAA;EAEA,kCAAA;EACA,+CAAA;EACA,YAAA;EACA,eAAA;EAEA,aAAA;EACA,qBAAA;EACA,uBAAA;EAEA,iBAAA;EAEA,aAAA;EACA,kBAAA;AAfJ;;AAkBA;EACI,WAAA;EACA,cAAA;EACA,aAAA;AAfJ;;AAmBI;EACI,iBAAA;AAhBR;AAkBI;EACI,uBAAA;EACA,kBAAA;EACA,gBAAA;EACA,WAAA;EACA,oBAAA;AAhBR;AAkBI;EACI,kBAAA;EACA,WAAA;EACA,YAAA;AAhBR;AAiBQ;EACI,SAAA;EACA,UAAA;EACA,kBAAA;EACA,WAAA;EACA,YAAA;EACA,uBAAA;EACA,qCAAA;AAfZ;AAiBQ;EACI,WAAA;EACA,YAAA;EACA,kBAAA;AAfZ;AAiBQ;EACI,WAAA;EACA,YAAA;EACA,kBAAA;AAfZ;AAkBI;EACI,WAAA;EACA,YAAA;EACA,uBAAA;EACA,kBAAA;AAhBR;;AAmBA;EACI,kBAAA;AAhBJ;;AAkBA;EACI,wBAAA;EACA,kBAAA;EACA,UAAA;EACA,oBAAA;AAfJ;;AAiBA;EACI,kBAAA;EACA,gFAAA;EACA,WAAA;EACA,YAAA;AAdJ", sourcesContent: [":root {\r\n --blackBarHeight: 55px;\r\n}\r\n\r\n#gui-editor-workbench-root {\r\n display: grid;\r\n grid-template-rows: calc(100% - 55px);\r\n height: 100%;\r\n width: 100%;\r\n background: #e2e2e2;\r\n font: 14px \"acumin-pro-condensed\";\r\n}\r\n\r\n.wait-screen {\r\n display: grid;\r\n justify-content: center;\r\n align-content: center;\r\n height: 100%;\r\n width: 100%;\r\n background: #464646;\r\n opacity: 0.95;\r\n color: white;\r\n font: 24px \"acumin-pro-condensed\";\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n\r\n &.hidden {\r\n visibility: hidden;\r\n }\r\n}\r\n\r\n#leftGrab {\r\n width: 5px;\r\n height: 100%;\r\n cursor: ew-resize;\r\n position: absolute;\r\n right: -1px;\r\n top: 0;\r\n}\r\n\r\n#rightGrab {\r\n cursor: ew-resize;\r\n width: 5px;\r\n bottom: 0;\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n}\r\n\r\n.toolbarGrab {\r\n background: #333333;\r\n grid-row: 1 / span 3;\r\n grid-column: 2;\r\n height: 100%;\r\n overflow-y: auto;\r\n\r\n .blackLine {\r\n height: 16px;\r\n background: black;\r\n position: relative;\r\n }\r\n .arrow {\r\n color: white;\r\n position: absolute;\r\n }\r\n .toolbar-label {\r\n color: white;\r\n font-size: 18px;\r\n display: grid;\r\n align-items: center;\r\n cursor: pointer;\r\n user-select: none;\r\n grid-template-columns: 1fr 20px;\r\n grid-template-rows: 100%;\r\n position: relative;\r\n\r\n &.active {\r\n font-weight: bold;\r\n font-size: 20px;\r\n }\r\n\r\n &:hover {\r\n background: var(--selectionGrey);\r\n .sub-items {\r\n display: block;\r\n }\r\n }\r\n }\r\n .toolbar-icon {\r\n width: 40px;\r\n height: 40px;\r\n }\r\n &.expanded {\r\n .toolbar-content-sub1 {\r\n column-count: 2;\r\n }\r\n }\r\n}\r\n\r\n.diagram-container {\r\n position: relative;\r\n display: grid;\r\n grid-row: 1;\r\n grid-column: 2;\r\n background: #cccccc;\r\n width: 100%;\r\n height: 100%;\r\n overflow: hidden;\r\n\r\n .diagram {\r\n display: none;\r\n width: 100%;\r\n height: 100%;\r\n }\r\n}\r\n\r\n.left-panel {\r\n grid-row: 1 / span 2;\r\n grid-column: 1;\r\n display: grid;\r\n grid-template-rows: 100%;\r\n grid-template-columns: 1fr 50px;\r\n position: relative;\r\n overflow: hidden;\r\n &.expand {\r\n grid-template-columns: 1fr 100px;\r\n }\r\n}\r\n\r\n.right-panel {\r\n grid-row: 1 / span 2;\r\n grid-column: 3;\r\n display: grid;\r\n grid-template-rows: 1fr 40px auto 40px;\r\n grid-template-columns: 100%;\r\n overflow-y: auto;\r\n position: relative;\r\n\r\n #propertyTab {\r\n grid-row: 1;\r\n grid-column: 1;\r\n }\r\n\r\n .button {\r\n display: grid;\r\n justify-content: center;\r\n align-content: center;\r\n height: auto;\r\n width: calc(100% / 7);\r\n cursor: pointer;\r\n\r\n &:hover {\r\n background: rgb(51, 122, 183);\r\n color: white;\r\n opacity: 0.8;\r\n }\r\n\r\n &.selected {\r\n background: rgb(51, 122, 183);\r\n color: white;\r\n }\r\n\r\n &.align {\r\n justify-content: stretch;\r\n text-align: center;\r\n }\r\n }\r\n}\r\n\r\n.blocker {\r\n visibility: hidden;\r\n position: absolute;\r\n width: calc(100% - 40px);\r\n height: 100%;\r\n top: 0;\r\n left: 0;\r\n\r\n background: rgba(20, 20, 20, 0.95);\r\n font-family: \"acumin-pro-condensed\", sans-serif;\r\n color: white;\r\n font-size: 24px;\r\n\r\n display: grid;\r\n align-content: center;\r\n justify-content: center;\r\n\r\n user-select: none;\r\n\r\n padding: 20px;\r\n text-align: center;\r\n}\r\n\r\n#log-console {\r\n grid-row: 2;\r\n grid-column: 4;\r\n display: none;\r\n}\r\n\r\n.gizmo {\r\n * {\r\n user-select: none;\r\n }\r\n .bounding-box-line {\r\n background-color: black;\r\n position: absolute;\r\n line-height: 1px;\r\n height: 1px;\r\n pointer-events: none;\r\n }\r\n .scale-point-container {\r\n position: absolute;\r\n width: 30px;\r\n height: 30px;\r\n .scale-point {\r\n top: 10px;\r\n left: 10px;\r\n position: absolute;\r\n width: 10px;\r\n height: 10px;\r\n background: transparent;\r\n outline: rgb(125, 125, 125) 2px solid;\r\n }\r\n .rotate-click-area {\r\n width: 20px;\r\n height: 20px;\r\n position: absolute;\r\n }\r\n .scale-click-area {\r\n width: 20px;\r\n height: 20px;\r\n position: absolute;\r\n }\r\n }\r\n .pivot-point {\r\n width: 30px;\r\n height: 30px;\r\n background: transparent;\r\n position: absolute;\r\n }\r\n}\r\n#workbench-canvas {\r\n position: relative;\r\n}\r\n.artboard-stroke {\r\n outline: 1px solid black;\r\n position: absolute;\r\n z-index: 2;\r\n pointer-events: none;\r\n}\r\n.artboard-background {\r\n position: absolute;\r\n background: repeating-conic-gradient(#e2e2e2 0% 25%, white 0% 50%) 50% / 10px 10px;\r\n width: 100%;\r\n height: 100%;\r\n}\r\n"], sourceRoot: "" }]); + ___CSS_LOADER_EXPORT___.locals = {}; + const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___; + }, + "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/scss/commandBar.scss": (module2, __webpack_exports__2, __webpack_require__2) => { + /*!*******************************************************************************************************************************************************************************************************************!*\ + !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/scss/commandBar.scss ***! + \*******************************************************************************************************************************************************************************************************************/ + __webpack_require__2.r(__webpack_exports__2); + __webpack_require__2.d(__webpack_exports__2, { + default: () => __WEBPACK_DEFAULT_EXPORT__ + }); + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/api.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + ___CSS_LOADER_EXPORT___.push([module2.id, `:root { + --selectionGrey: #666666; +} + +.ge-commands { + grid-row: 1; + grid-column: 1; + user-select: none; +} +.ge-commands * { + font-family: "acumin-pro-condensed"; + font-weight: 600; + font-size: 12px; +} +.ge-commands .commands-left { + float: left; + display: flex; +} +.ge-commands .commands-right { + float: right; + display: flex; +} +.ge-commands .commands-right .beta-flag { + height: 30px; + position: relative; + left: -15px; +} +.ge-commands.background-ts .command-button img, +.ge-commands.background-ts .command-dropdown img { + filter: invert(64%) sepia(78%) saturate(940%) hue-rotate(323deg) brightness(105%) contrast(103%); +} +.ge-commands.background-ts .command-button .command-dropdown-active, +.ge-commands.background-ts .command-dropdown .command-dropdown-active { + color: #333333; +} +.ge-commands.background-ts .command-button:hover img, .ge-commands.background-ts .command-button.activated img, +.ge-commands.background-ts .command-dropdown:hover img, +.ge-commands.background-ts .command-dropdown.activated img { + filter: invert(34%) sepia(21%) saturate(3832%) hue-rotate(324deg) brightness(88%) contrast(82%) !important; +} +.ge-commands.background-js .command-button img, +.ge-commands.background-js .command-dropdown img { + filter: invert(57%) sepia(80%) saturate(2031%) hue-rotate(215deg); +} +.ge-commands.background-js .command-button .command-dropdown-active, +.ge-commands.background-js .command-dropdown .command-dropdown-active { + color: #333333; +} +.ge-commands.background-js .command-button:hover img, .ge-commands.background-js .command-button.activated img, +.ge-commands.background-js .command-dropdown:hover img, +.ge-commands.background-js .command-dropdown.activated img { + filter: invert(17%) !important; +} +.ge-commands .command-button { + cursor: pointer; + width: 55px; + height: 55px; +} +.ge-commands .command-button .command-label { + display: none; +} +.ge-commands .command-button .command-button-icon { + height: 100%; + width: 100%; + display: grid; + color: white; + align-content: center; + justify-content: center; +} +.ge-commands .command-button .active { + transform-origin: center; + background-color: var(--selectionGrey); +} +.ge-commands .command-button img.active { + background-color: var(--selectionGrey); +} +.ge-commands .command-button:hover { + background-color: var(--selectionGrey); +} +.ge-commands .copyAndDeleteDisabled { + pointer-events: none; + color: black; +} +.ge-commands .pasteDisabled { + pointer-events: none; + color: black; +} +.ge-commands .command-dropdown-root { + position: relative; + text-transform: uppercase; + z-index: 1; +} +.ge-commands .command-dropdown { + cursor: pointer; + width: 55px; + height: 55px; +} +.ge-commands .command-dropdown .command-dropdown-icon { + height: 100%; + width: 100%; + display: grid; + align-content: center; + justify-content: center; +} +.ge-commands .command-dropdown .command-dropdown-active { + height: 100%; + width: 100%; + display: grid; + align-content: center; + justify-content: center; + font-size: 14px; +} +.ge-commands .command-dropdown:hover, .ge-commands .command-dropdown.activated { + background-color: #666666; + color: black; +} +.ge-commands .command-dropdown:active { + transform-origin: center; + transform: scale(0.95); +} +.ge-commands .command-dropdown-blocker { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + transform: scale(1); + z-index: 1; +} +.ge-commands.background-js .command-dropdown-content { + background: #333333; +} +.ge-commands.background-js .command-dropdown-content .command-dropdown-label:hover { + background: #333333; +} +.ge-commands.background-ts .command-dropdown-content .command-dropdown-label:hover { + background: #333333; +} +.ge-commands .command-dropdown-content { + background: #333333; + position: absolute; + top: 55px; + width: 55px; + transform: scale(1); +} +.ge-commands .command-dropdown-content.toRight { + width: 120px; +} +.ge-commands .command-dropdown-content .command-dropdown-label { + color: white; + padding: 5px; + padding-left: 7px; + height: 35px; + font-size: 18px; + display: grid; + align-items: center; + cursor: pointer; + user-select: none; + grid-template-columns: 1fr 20px; + grid-template-rows: 100%; + position: relative; +} +.ge-commands .command-dropdown-content .command-dropdown-label.active { + font-weight: bold; + font-size: 20px; +} +.ge-commands .command-dropdown-content .command-dropdown-label:hover { + background: var(--selectionGrey); +} +.ge-commands .command-dropdown-content .command-dropdown-label:hover .sub-items { + display: block; +} +.ge-commands .command-dropdown-content .command-dropdown-label .command-dropdown-label-text { + font-size: 12px; + grid-column: 1; + grid-row: 1; +} +.ge-commands .command-dropdown-content .command-dropdown-label .command-dropdown-label-check { + grid-column: 2; + grid-row: 1; +} +.ge-commands .command-dropdown-content .command-dropdown-label .command-dropdown-arrow { + grid-column: 2; + grid-row: 1; + font-size: 20px; + font-weight: bold; + padding-bottom: 10px; + padding-left: 4px; +} +.ge-commands .command-dropdown-content .command-dropdown-label .sub-items { + position: absolute; + left: 200px; + top: 0; + width: 150px; + display: none; +} +.ge-commands .command-dropdown-content .command-dropdown-label .sub-items.background-js { + background: #bfabff; +} +.ge-commands .command-dropdown-content .command-dropdown-label .sub-items.background-js .sub-item:hover { + background-color: #333333; + color: white; +} +.ge-commands .command-dropdown-content .command-dropdown-label .sub-items.background-ts { + background: #333333; +} +.ge-commands .command-dropdown-content .command-dropdown-label .sub-items.background-ts .sub-item:hover { + background-color: #333333; + color: white; +} +.ge-commands .command-dropdown-content .command-dropdown-label .sub-items .sub-item { + color: white; + padding: 5px; + padding-left: 10px; + height: 35px; + display: grid; +} +.ge-commands .command-dropdown-content .command-dropdown-label .sub-items .sub-item.checked { + background: white; + color: black; +} +.ge-commands .command-dropdown-content .buttonLine { + color: white; + padding: 5px; + padding-left: 7px; + height: 35px; + font-size: 18px; + display: grid; + align-items: center; + cursor: pointer; + user-select: none; + grid-template-columns: 1fr 20px; + grid-template-rows: 100%; + position: relative; + font-size: 12px; + grid-column: 1; + grid-row: 1; +} +.ge-commands .command-dropdown-content .buttonLine input[type=file] { + display: none; +} +.ge-commands .command-dropdown-content .buttonLine.active { + font-weight: bold; + font-size: 20px; + cursor: pointer; +} +.ge-commands .command-dropdown-content .buttonLine:hover { + background: var(--selectionGrey); + cursor: pointer; +} +.ge-commands .command-dropdown-content .buttonLine:hover .sub-items { + display: block; +} +.ge-commands .command-dropdown-content .buttonLine .file-upload { + cursor: pointer; +} +.ge-commands .divider { + display: flex; + align-items: center; + border-right: 1px solid black; + color: white; +} +.ge-commands .divider:last-of-type { + border-right: none; +} +.ge-commands .divider.padded { + padding-left: 10px; + padding-right: 10px; +} +.ge-commands .floatLine, +.ge-commands .checkBoxLine { + display: flex; + align-items: center; +} +.ge-commands .checkBoxLine .icon { + filter: brightness(10); +} +.ge-commands .checkBoxLine .hidden { + display: none; +} +.ge-commands .checkBoxLine .checkBox { + height: 40px; +} +.ge-commands .color3Line { + display: grid; +} +.ge-commands .color3Line .firstLine { + display: flex; + align-items: center; +} +.ge-commands .color3Line .firstLine .label { + padding-right: 5px; +} +.ge-commands .color3Line .firstLine .floatLine .value { + padding-left: 2px; +} +.ge-commands .color3Line .firstLine .copy { + display: none; +} +.ge-commands .color3Line .firstLine .expand { + display: none; +} +.ge-commands .color3Line .secondLine { + display: grid; + padding-right: 5px; + border-left: 1px solid rgb(51, 122, 183); +} +.ge-commands .color3Line .secondLine .numeric { + display: grid; + grid-template-columns: 1fr auto; +} +.ge-commands .color3Line .secondLine .numeric-label { + text-align: right; + grid-column: 1; + display: flex; + align-items: center; + justify-self: right; + margin-right: 10px; +} +.ge-commands .color3Line .secondLine .numeric-value { + width: 120px; + grid-column: 2; + display: flex; + align-items: center; + border: 1px solid rgb(51, 122, 183); +} +.ge-commands .color-picker { + height: 26px; + width: 26px; +} +.ge-commands .color-picker .color-rect-background { + width: calc(100% - 2px); + height: calc(100% - 2px); + border: 1px solid white; + cursor: pointer; + background: repeating-conic-gradient(#e2e2e2 0% 25%, white 0% 50%) 50%/100% 100%; +} +.ge-commands .color-picker .color-rect-background .color-rect { + height: 100%; +} +.ge-commands .color-picker .color-picker-cover { + position: fixed; + top: 0px; + right: 0px; + bottom: 0px; + left: 0px; + z-index: 2; +} +.ge-commands .color-picker .color-picker-float { + position: absolute; + outline: 1px solid black; +} +.ge-commands .color-picker .color-picker-container { + background-color: #e2e2e2; +} +.ge-commands .color-picker input:focus { + outline-color: black; +} +.ge-commands .floatLine input, +.ge-commands .listLine select { + background-color: #000000; + color: white; + padding: 5px; + border: none; +} +.ge-commands input, +.ge-commands .listLine select { + outline-color: transparent; + outline-width: 1px; + outline-offset: -1px; + outline-style: solid; + transition: 0.2s outline; + border: none; +} +.ge-commands .floatLine .value { + position: relative; + margin: 5px; +} +.ge-commands .floatLine input:focus { + outline-color: white; +} +.ge-commands .listLine select { + width: 150px; +} +.ge-commands .hasArrows .arrows { + display: none; + position: absolute; + right: 0; + top: 0; + flex-direction: column; + cursor: grab; + filter: brightness(10); +} +.ge-commands .hasArrows .arrows .downArrowIcon, +.ge-commands .hasArrows .arrows .upArrowIcon { + width: 13px; + height: 13px; +} +.ge-commands .hasArrows:hover .arrows, .ge-commands .hasArrows:focus .arrows, .ge-commands .hasArrows.dragging .arrows { + display: flex; +} +.ge-commands .hasArrows .arrows:hover { + background-color: var(--buttonHoverBackground); + filter: none; +} +.ge-commands .hasArrows.dragging .arrows { + background-color: var(--buttonPressedBackground); +} +.ge-commands .hasArrows.dragging .arrows .downArrowIcon, +.ge-commands .hasArrows.dragging .arrows .upArrowIcon { + filter: none; +} +.ge-commands .hasArrows input::-webkit-outer-spin-button, +.ge-commands .hasArrows input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} +.ge-commands .hasArrows input[type=number] { + -moz-appearance: textfield; +}`, "", { version: 3, sources: ["webpack://./../../../tools/guiEditor/dist/scss/commandBar.scss"], names: [], mappings: "AAAA;EACI,wBAAA;AACJ;;AAEA;EAMI,WAAA;EACA,cAAA;EACA,iBAAA;AAJJ;AAHI;EACI,mCAAA;EACA,gBAAA;EACA,eAAA;AAKR;AACI;EACI,WAAA;EACA,aAAA;AACR;AAEI;EACI,YAAA;EACA,aAAA;AAAR;AACQ;EACI,YAAA;EACA,kBAAA;EACA,WAAA;AACZ;AAMY;;EACI,gGAAA;AAHhB;AAMY;;EACI,cAAA;AAHhB;AAQgB;;;EACI,0GAAA;AAJpB;AAaY;;EACI,iEAAA;AAVhB;AAaY;;EACI,cAAA;AAVhB;AAegB;;;EACI,8BAAA;AAXpB;AAiBI;EACI,eAAA;EACA,WAAA;EACA,YAAA;AAfR;AAiBQ;EACI,aAAA;AAfZ;AAkBQ;EACI,YAAA;EACA,WAAA;EACA,aAAA;EACA,YAAA;EACA,qBAAA;EACA,uBAAA;AAhBZ;AAmBQ;EACI,wBAAA;EACA,sCAAA;AAjBZ;AAqBY;EACI,sCAAA;AAnBhB;AAuBI;EACI,sCAAA;AArBR;AAuBI;EACI,oBAAA;EACA,YAAA;AArBR;AAuBI;EACI,oBAAA;EACA,YAAA;AArBR;AAuBI;EACI,kBAAA;EACA,yBAAA;EACA,UAAA;AArBR;AAwBI;EACI,eAAA;EACA,WAAA;EACA,YAAA;AAtBR;AAwBQ;EACI,YAAA;EACA,WAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;AAtBZ;AAyBQ;EACI,YAAA;EACA,WAAA;EACA,aAAA;EACA,qBAAA;EACA,uBAAA;EACA,eAAA;AAvBZ;AA0BQ;EAEI,yBAAA;EACA,YAAA;AAzBZ;AA4BQ;EACI,wBAAA;EACA,sBAAA;AA1BZ;AA8BI;EACI,kBAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;EACA,mBAAA;EACA,UAAA;AA5BR;AAgCQ;EACI,mBAAA;AA9BZ;AAgCgB;EACI,mBAAA;AA9BpB;AAuCgB;EACI,mBAAA;AArCpB;AA2CI;EACI,mBAAA;EACA,kBAAA;EACA,SAAA;EACA,WAAA;EACA,mBAAA;AAzCR;AA2CQ;EACI,YAAA;AAzCZ;AA4CQ;EACI,YAAA;EACA,YAAA;EACA,iBAAA;EACA,YAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;EACA,iBAAA;EACA,+BAAA;EACA,wBAAA;EACA,kBAAA;AA1CZ;AA4CY;EACI,iBAAA;EACA,eAAA;AA1ChB;AA6CY;EACI,gCAAA;AA3ChB;AA4CgB;EACI,cAAA;AA1CpB;AA8CY;EACI,eAAA;EACA,cAAA;EACA,WAAA;AA5ChB;AA+CY;EACI,cAAA;EACA,WAAA;AA7ChB;AAgDY;EACI,cAAA;EACA,WAAA;EACA,eAAA;EACA,iBAAA;EACA,oBAAA;EACA,iBAAA;AA9ChB;AAiDY;EACI,kBAAA;EACA,WAAA;EACA,MAAA;EACA,YAAA;EACA,aAAA;AA/ChB;AAiDgB;EACI,mBAAA;AA/CpB;AAiDwB;EACI,yBAAA;EACA,YAAA;AA/C5B;AAoDgB;EACI,mBAAA;AAlDpB;AAoDwB;EACI,yBAAA;EACA,YAAA;AAlD5B;AAuDgB;EACI,YAAA;EACA,YAAA;EACA,kBAAA;EACA,YAAA;EACA,aAAA;AArDpB;AAuDoB;EACI,iBAAA;EACA,YAAA;AArDxB;AA2DQ;EACI,YAAA;EACA,YAAA;EACA,iBAAA;EACA,YAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,eAAA;EACA,iBAAA;EACA,+BAAA;EACA,wBAAA;EACA,kBAAA;EACA,eAAA;EACA,cAAA;EACA,WAAA;AAzDZ;AA0DY;EACI,aAAA;AAxDhB;AA2DY;EACI,iBAAA;EACA,eAAA;EACA,eAAA;AAzDhB;AA4DY;EACI,gCAAA;EAIA,eAAA;AA7DhB;AA0DgB;EACI,cAAA;AAxDpB;AA6DY;EACI,eAAA;AA3DhB;AAgEI;EACI,aAAA;EACA,mBAAA;EACA,6BAAA;EACA,YAAA;AA9DR;AA+DQ;EACI,kBAAA;AA7DZ;AA+DQ;EACI,kBAAA;EACA,mBAAA;AA7DZ;AAiEI;;EAEI,aAAA;EACA,mBAAA;AA/DR;AAmEQ;EACI,sBAAA;AAjEZ;AAoEQ;EACI,aAAA;AAlEZ;AAqEQ;EACI,YAAA;AAnEZ;AAuEI;EACI,aAAA;AArER;AAuEQ;EACI,aAAA;EACA,mBAAA;AArEZ;AAuEY;EACI,kBAAA;AArEhB;AAyEgB;EACI,iBAAA;AAvEpB;AA2EY;EACI,aAAA;AAzEhB;AA4EY;EACI,aAAA;AA1EhB;AA8EQ;EACI,aAAA;EACA,kBAAA;EACA,wCAAA;AA5EZ;AA8EY;EACI,aAAA;EACA,+BAAA;AA5EhB;AA+EY;EACI,iBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,kBAAA;AA7EhB;AAgFY;EACI,YAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,mCAAA;AA9EhB;AAmFI;EACI,YAAA;EACA,WAAA;AAjFR;AAmFQ;EACI,uBAAA;EACA,wBAAA;EACA,uBAAA;EACA,eAAA;EACA,gFAAA;AAjFZ;AAkFY;EACI,YAAA;AAhFhB;AAoFQ;EACI,eAAA;EACA,QAAA;EACA,UAAA;EACA,WAAA;EACA,SAAA;EACA,UAAA;AAlFZ;AAqFQ;EACI,kBAAA;EACA,wBAAA;AAnFZ;AAsFQ;EACI,yBAAA;AApFZ;AAuFQ;EACI,oBAAA;AArFZ;AAyFI;;EAEI,yBAAA;EACA,YAAA;EACA,YAAA;EACA,YAAA;AAvFR;AA0FI;;EAEI,0BAAA;EACA,kBAAA;EACA,oBAAA;EACA,oBAAA;EACA,wBAAA;EACA,YAAA;AAxFR;AA2FI;EACI,kBAAA;EACA,WAAA;AAzFR;AA4FI;EACI,oBAAA;AA1FR;AA6FI;EACI,YAAA;AA3FR;AA+FQ;EACI,aAAA;EACA,kBAAA;EACA,QAAA;EACA,MAAA;EACA,sBAAA;EACA,YAAA;EAMA,sBAAA;AAlGZ;AA6FY;;EAEI,WAAA;EACA,YAAA;AA3FhB;AA+FQ;EAGI,aAAA;AA/FZ;AAiGQ;EACI,8CAAA;EACA,YAAA;AA/FZ;AAiGQ;EACI,gDAAA;AA/FZ;AAgGY;;EAEI,YAAA;AA9FhB;AAkGI;;EAEI,wBAAA;EACA,SAAA;AAhGR;AAmGI;EACI,0BAAA;AAjGR", sourcesContent: [":root {\r\n --selectionGrey: #666666;\r\n}\r\n\r\n.ge-commands {\r\n * {\r\n font-family: \"acumin-pro-condensed\";\r\n font-weight: 600;\r\n font-size: 12px;\r\n }\r\n grid-row: 1;\r\n grid-column: 1;\r\n user-select: none;\r\n\r\n .commands-left {\r\n float: left;\r\n display: flex;\r\n }\r\n\r\n .commands-right {\r\n float: right;\r\n display: flex;\r\n .beta-flag {\r\n height: 30px;\r\n position: relative;\r\n left: -15px;\r\n }\r\n }\r\n\r\n &.background-ts {\r\n .command-button,\r\n .command-dropdown {\r\n img {\r\n filter: invert(64%) sepia(78%) saturate(940%) hue-rotate(323deg) brightness(105%) contrast(103%);\r\n }\r\n\r\n .command-dropdown-active {\r\n color: #333333;\r\n }\r\n\r\n &:hover,\r\n &.activated {\r\n img {\r\n filter: invert(34%) sepia(21%) saturate(3832%) hue-rotate(324deg) brightness(88%) contrast(82%) !important;\r\n }\r\n }\r\n }\r\n }\r\n\r\n &.background-js {\r\n .command-button,\r\n .command-dropdown {\r\n img {\r\n filter: invert(57%) sepia(80%) saturate(2031%) hue-rotate(215deg);\r\n }\r\n\r\n .command-dropdown-active {\r\n color: #333333;\r\n }\r\n\r\n &:hover,\r\n &.activated {\r\n img {\r\n filter: invert(17%) !important;\r\n }\r\n }\r\n }\r\n }\r\n\r\n .command-button {\r\n cursor: pointer;\r\n width: 55px;\r\n height: 55px;\r\n\r\n .command-label {\r\n display: none;\r\n }\r\n\r\n .command-button-icon {\r\n height: 100%;\r\n width: 100%;\r\n display: grid;\r\n color: white;\r\n align-content: center;\r\n justify-content: center;\r\n }\r\n\r\n .active {\r\n transform-origin: center;\r\n background-color: var(--selectionGrey);\r\n }\r\n\r\n img {\r\n &.active {\r\n background-color: var(--selectionGrey);\r\n }\r\n }\r\n }\r\n .command-button:hover {\r\n background-color: var(--selectionGrey);\r\n }\r\n .copyAndDeleteDisabled {\r\n pointer-events: none;\r\n color: black;\r\n }\r\n .pasteDisabled {\r\n pointer-events: none;\r\n color: black;\r\n }\r\n .command-dropdown-root {\r\n position: relative;\r\n text-transform: uppercase;\r\n z-index: 1;\r\n }\r\n\r\n .command-dropdown {\r\n cursor: pointer;\r\n width: 55px;\r\n height: 55px;\r\n\r\n .command-dropdown-icon {\r\n height: 100%;\r\n width: 100%;\r\n display: grid;\r\n align-content: center;\r\n justify-content: center;\r\n }\r\n\r\n .command-dropdown-active {\r\n height: 100%;\r\n width: 100%;\r\n display: grid;\r\n align-content: center;\r\n justify-content: center;\r\n font-size: 14px;\r\n }\r\n\r\n &:hover,\r\n &.activated {\r\n background-color: #666666;\r\n color: black;\r\n }\r\n\r\n &:active {\r\n transform-origin: center;\r\n transform: scale(0.95);\r\n }\r\n }\r\n\r\n .command-dropdown-blocker {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n transform: scale(1);\r\n z-index: 1;\r\n }\r\n\r\n &.background-js {\r\n .command-dropdown-content {\r\n background: #333333;\r\n .command-dropdown-label {\r\n &:hover {\r\n background: #333333;\r\n }\r\n }\r\n }\r\n }\r\n\r\n &.background-ts {\r\n .command-dropdown-content {\r\n .command-dropdown-label {\r\n &:hover {\r\n background: #333333;\r\n }\r\n }\r\n }\r\n }\r\n\r\n .command-dropdown-content {\r\n background: #333333;\r\n position: absolute;\r\n top: 55px;\r\n width: 55px;\r\n transform: scale(1);\r\n\r\n &.toRight {\r\n width: 120px;\r\n }\r\n\r\n .command-dropdown-label {\r\n color: white;\r\n padding: 5px;\r\n padding-left: 7px;\r\n height: 35px;\r\n font-size: 18px;\r\n display: grid;\r\n align-items: center;\r\n cursor: pointer;\r\n user-select: none;\r\n grid-template-columns: 1fr 20px;\r\n grid-template-rows: 100%;\r\n position: relative;\r\n\r\n &.active {\r\n font-weight: bold;\r\n font-size: 20px;\r\n }\r\n\r\n &:hover {\r\n background: var(--selectionGrey);\r\n .sub-items {\r\n display: block;\r\n }\r\n }\r\n\r\n .command-dropdown-label-text {\r\n font-size: 12px;\r\n grid-column: 1;\r\n grid-row: 1;\r\n }\r\n\r\n .command-dropdown-label-check {\r\n grid-column: 2;\r\n grid-row: 1;\r\n }\r\n\r\n .command-dropdown-arrow {\r\n grid-column: 2;\r\n grid-row: 1;\r\n font-size: 20px;\r\n font-weight: bold;\r\n padding-bottom: 10px;\r\n padding-left: 4px;\r\n }\r\n\r\n .sub-items {\r\n position: absolute;\r\n left: 200px;\r\n top: 0;\r\n width: 150px;\r\n display: none;\r\n\r\n &.background-js {\r\n background: #bfabff;\r\n .sub-item {\r\n &:hover {\r\n background-color: #333333;\r\n color: white;\r\n }\r\n }\r\n }\r\n\r\n &.background-ts {\r\n background: #333333;\r\n .sub-item {\r\n &:hover {\r\n background-color: #333333;\r\n color: white;\r\n }\r\n }\r\n }\r\n\r\n .sub-item {\r\n color: white;\r\n padding: 5px;\r\n padding-left: 10px;\r\n height: 35px;\r\n display: grid;\r\n\r\n &.checked {\r\n background: white;\r\n color: black;\r\n }\r\n }\r\n }\r\n }\r\n\r\n .buttonLine {\r\n color: white;\r\n padding: 5px;\r\n padding-left: 7px;\r\n height: 35px;\r\n font-size: 18px;\r\n display: grid;\r\n align-items: center;\r\n cursor: pointer;\r\n user-select: none;\r\n grid-template-columns: 1fr 20px;\r\n grid-template-rows: 100%;\r\n position: relative;\r\n font-size: 12px;\r\n grid-column: 1;\r\n grid-row: 1;\r\n input[type=\"file\"] {\r\n display: none;\r\n }\r\n\r\n &.active {\r\n font-weight: bold;\r\n font-size: 20px;\r\n cursor: pointer;\r\n }\r\n\r\n &:hover {\r\n background: var(--selectionGrey);\r\n .sub-items {\r\n display: block;\r\n }\r\n cursor: pointer;\r\n }\r\n\r\n .file-upload {\r\n cursor: pointer;\r\n }\r\n }\r\n }\r\n\r\n .divider {\r\n display: flex;\r\n align-items: center;\r\n border-right: 1px solid black;\r\n color: white;\r\n &:last-of-type {\r\n border-right: none;\r\n }\r\n &.padded {\r\n padding-left: 10px;\r\n padding-right: 10px;\r\n }\r\n }\r\n\r\n .floatLine,\r\n .checkBoxLine {\r\n display: flex;\r\n align-items: center;\r\n }\r\n\r\n .checkBoxLine {\r\n .icon {\r\n filter: brightness(10);\r\n }\r\n\r\n .hidden {\r\n display: none;\r\n }\r\n\r\n .checkBox {\r\n height: 40px;\r\n }\r\n }\r\n\r\n .color3Line {\r\n display: grid;\r\n\r\n .firstLine {\r\n display: flex;\r\n align-items: center;\r\n\r\n .label {\r\n padding-right: 5px;\r\n }\r\n\r\n .floatLine {\r\n .value {\r\n padding-left: 2px;\r\n }\r\n }\r\n\r\n .copy {\r\n display: none;\r\n }\r\n\r\n .expand {\r\n display: none;\r\n }\r\n }\r\n\r\n .secondLine {\r\n display: grid;\r\n padding-right: 5px;\r\n border-left: 1px solid rgb(51, 122, 183);\r\n\r\n .numeric {\r\n display: grid;\r\n grid-template-columns: 1fr auto;\r\n }\r\n\r\n .numeric-label {\r\n text-align: right;\r\n grid-column: 1;\r\n display: flex;\r\n align-items: center;\r\n justify-self: right;\r\n margin-right: 10px;\r\n }\r\n\r\n .numeric-value {\r\n width: 120px;\r\n grid-column: 2;\r\n display: flex;\r\n align-items: center;\r\n border: 1px solid rgb(51, 122, 183);\r\n }\r\n }\r\n }\r\n\r\n .color-picker {\r\n height: 26px;\r\n width: 26px;\r\n\r\n .color-rect-background {\r\n width: calc(100% - 2px);\r\n height: calc(100% - 2px);\r\n border: 1px solid white;\r\n cursor: pointer;\r\n background: repeating-conic-gradient(#e2e2e2 0% 25%, white 0% 50%) 50% / 100% 100%;\r\n .color-rect {\r\n height: 100%;\r\n }\r\n }\r\n\r\n .color-picker-cover {\r\n position: fixed;\r\n top: 0px;\r\n right: 0px;\r\n bottom: 0px;\r\n left: 0px;\r\n z-index: 2;\r\n }\r\n\r\n .color-picker-float {\r\n position: absolute;\r\n outline: 1px solid black;\r\n }\r\n\r\n .color-picker-container {\r\n background-color: #e2e2e2;\r\n }\r\n\r\n input:focus {\r\n outline-color: black;\r\n }\r\n }\r\n\r\n .floatLine input,\r\n .listLine select {\r\n background-color: #000000;\r\n color: white;\r\n padding: 5px;\r\n border: none;\r\n }\r\n\r\n input,\r\n .listLine select {\r\n outline-color: transparent;\r\n outline-width: 1px;\r\n outline-offset: -1px;\r\n outline-style: solid;\r\n transition: 0.2s outline;\r\n border: none;\r\n }\r\n\r\n .floatLine .value {\r\n position: relative;\r\n margin: 5px;\r\n }\r\n\r\n .floatLine input:focus {\r\n outline-color: white;\r\n }\r\n\r\n .listLine select {\r\n width: 150px;\r\n }\r\n\r\n .hasArrows {\r\n .arrows {\r\n display: none;\r\n position: absolute;\r\n right: 0;\r\n top: 0;\r\n flex-direction: column;\r\n cursor: grab;\r\n .downArrowIcon,\r\n .upArrowIcon {\r\n width: 13px;\r\n height: 13px;\r\n }\r\n filter: brightness(10);\r\n }\r\n &:hover .arrows,\r\n &:focus .arrows,\r\n &.dragging .arrows {\r\n display: flex;\r\n }\r\n .arrows:hover {\r\n background-color: var(--buttonHoverBackground);\r\n filter: none;\r\n }\r\n &.dragging .arrows {\r\n background-color: var(--buttonPressedBackground);\r\n .downArrowIcon,\r\n .upArrowIcon {\r\n filter: none;\r\n }\r\n }\r\n }\r\n .hasArrows input::-webkit-outer-spin-button,\r\n .hasArrows input::-webkit-inner-spin-button {\r\n -webkit-appearance: none;\r\n margin: 0;\r\n }\r\n\r\n .hasArrows input[type=\"number\"] {\r\n -moz-appearance: textfield;\r\n }\r\n}\r\n"], sourceRoot: "" }]); + ___CSS_LOADER_EXPORT___.locals = {}; + const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___; + }, + "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/scss/header.scss": (module2, __webpack_exports__2, __webpack_require__2) => { + /*!***************************************************************************************************************************************************************************************************************!*\ + !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../../tools/guiEditor/dist/scss/header.scss ***! + \***************************************************************************************************************************************************************************************************************/ + __webpack_require__2.r(__webpack_exports__2); + __webpack_require__2.d(__webpack_exports__2, { + default: () => __WEBPACK_DEFAULT_EXPORT__ + }); + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/api.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + ___CSS_LOADER_EXPORT___.push([module2.id, `#ge-header { + width: 100%; + grid-column: 2/4; + grid-row: 1; + padding: 0; + margin: 0; + display: grid; + grid-template-columns: auto 1fr; + grid-template-rows: 100%; + background: #333333; +} +#ge-header .command-bar { + padding-left: 15px; + grid-row: 1; + grid-column: 2; + width: 100%; +} +#ge-header .command-bar .language-button { + grid-row: 1; + grid-column: 2; + color: white; + width: 144px; + font-size: 18px; + text-align: center; + display: grid; + align-content: center; + border-top-left-radius: 14px; + transform: scale(1); + user-select: none; +} +#ge-header .command-bar .language-button.active { + width: 74px; + cursor: pointer; + grid-column: 1; + margin-right: -5px; + transform: translateX(10px); +}`, "", { version: 3, sources: ["webpack://./../../../tools/guiEditor/dist/scss/header.scss"], names: [], mappings: "AAAA;EACI,WAAA;EACA,gBAAA;EACA,WAAA;EACA,UAAA;EACA,SAAA;EACA,aAAA;EACA,+BAAA;EACA,wBAAA;EACA,mBAAA;AACJ;AACI;EACI,kBAAA;EACA,WAAA;EACA,cAAA;EACA,WAAA;AACR;AACQ;EACI,WAAA;EACA,cAAA;EACA,YAAA;EACA,YAAA;EACA,eAAA;EACA,kBAAA;EACA,aAAA;EACA,qBAAA;EACA,4BAAA;EACA,mBAAA;EACA,iBAAA;AACZ;AACY;EACI,WAAA;EACA,eAAA;EACA,cAAA;EACA,kBAAA;EACA,2BAAA;AAChB", sourcesContent: ["#ge-header {\r\n width: 100%;\r\n grid-column: 2 / 4;\r\n grid-row: 1;\r\n padding: 0;\r\n margin: 0;\r\n display: grid;\r\n grid-template-columns: auto 1fr;\r\n grid-template-rows: 100%;\r\n background: #333333;\r\n\r\n .command-bar {\r\n padding-left: 15px;\r\n grid-row: 1;\r\n grid-column: 2;\r\n width: 100%;\r\n\r\n .language-button {\r\n grid-row: 1;\r\n grid-column: 2;\r\n color: white;\r\n width: 144px;\r\n font-size: 18px;\r\n text-align: center;\r\n display: grid;\r\n align-content: center;\r\n border-top-left-radius: 14px;\r\n transform: scale(1);\r\n user-select: none;\r\n\r\n &.active {\r\n width: 74px;\r\n cursor: pointer;\r\n grid-column: 1;\r\n margin-right: -5px;\r\n transform: translateX(10px);\r\n }\r\n }\r\n }\r\n}\r\n"], sourceRoot: "" }]); + ___CSS_LOADER_EXPORT___.locals = {}; + const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___; + }, + "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/Button.modules.scss": (module2, __webpack_exports__2, __webpack_require__2) => { + /*!************************************************************************************************************************************************************************************************************************************!*\ + !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/Button.modules.scss ***! + \************************************************************************************************************************************************************************************************************************************/ + __webpack_require__2.r(__webpack_exports__2); + __webpack_require__2.d(__webpack_exports__2, { + default: () => __WEBPACK_DEFAULT_EXPORT__ + }); + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/api.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_Fonts_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../dev/sharedUiComponents/dist/components/Fonts.scss"); + /*! -!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./Fonts.scss */ + var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + ___CSS_LOADER_EXPORT___.i(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_Fonts_scss__WEBPACK_IMPORTED_MODULE_2__["default"], "", true); + ___CSS_LOADER_EXPORT___.push([module2.id, `.\\---------dev-sharedUiComponents-dist-components-Button-modules__button { + width: 55px; + height: 55px; + border: none; + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0 0; +} +.\\---------dev-sharedUiComponents-dist-components-Button-modules__button.\\---------dev-sharedUiComponents-dist-components-Button-modules__wide { + width: 120px; + height: 45px; + justify-content: start; +} +.\\---------dev-sharedUiComponents-dist-components-Button-modules__button.\\---------dev-sharedUiComponents-dist-components-Button-modules__small { + width: 30px; + height: 30px; +} +.\\---------dev-sharedUiComponents-dist-components-Button-modules__button.\\---------dev-sharedUiComponents-dist-components-Button-modules__smaller { + width: 25px; + height: 25px; +} +.\\---------dev-sharedUiComponents-dist-components-Button-modules__button.\\---------dev-sharedUiComponents-dist-components-Button-modules__light { + background-color: #E2E2E2; + color: #333333; +} +.\\---------dev-sharedUiComponents-dist-components-Button-modules__button.\\---------dev-sharedUiComponents-dist-components-Button-modules__light:hover, .\\---------dev-sharedUiComponents-dist-components-Button-modules__button.\\---------dev-sharedUiComponents-dist-components-Button-modules__light.\\---------dev-sharedUiComponents-dist-components-Button-modules__active { + background-color: #FFFFFF; +} +.\\---------dev-sharedUiComponents-dist-components-Button-modules__button.\\---------dev-sharedUiComponents-dist-components-Button-modules__light:disabled { + background-color: #FFFFFF; +} +.\\---------dev-sharedUiComponents-dist-components-Button-modules__button.\\---------dev-sharedUiComponents-dist-components-Button-modules__dark { + background-color: #333333; + color: #FFFFFF; +} +.\\---------dev-sharedUiComponents-dist-components-Button-modules__button.\\---------dev-sharedUiComponents-dist-components-Button-modules__dark:hover, .\\---------dev-sharedUiComponents-dist-components-Button-modules__button.\\---------dev-sharedUiComponents-dist-components-Button-modules__dark.\\---------dev-sharedUiComponents-dist-components-Button-modules__active { + background-color: #666666; +}`, "", { version: 3, sources: ["webpack://./../../../dev/sharedUiComponents/dist/components/Button.modules.scss"], names: [], mappings: "AACA;EAEI,WAAA;EACA,YAAA;EACA,YAAA;EACA,oBAAA;EACA,mBAAA;EACA,uBAAA;EACA,YAAA;AAOJ;AANI;EACI,YAAA;EACA,YAAA;EACA,sBAAA;AAQR;AANI;EACI,WAAA;EACA,YAAA;AAQR;AANI;EACI,WAAA;EACA,YAAA;AAQR;AANI;EACI,yBAAA;EACA,cAAA;AAQR;AAPQ;EAEI,yBAAA;AAQZ;AANQ;EACI,yBAAA;AAQZ;AALI;EACI,yBAAA;EACA,cAAA;AAOR;AANQ;EAEI,yBAAA;AAOZ", sourcesContent: ["@import \"Colors.scss\";\r\n:local .button {\r\n composes: fontRegular from \"Fonts.scss\";\r\n width: 55px;\r\n height: 55px;\r\n border: none;\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n padding: 0 0;\r\n &.wide {\r\n width: 120px;\r\n height: 45px;\r\n justify-content: start;\r\n }\r\n &.small {\r\n width: 30px;\r\n height: 30px;\r\n }\r\n &.smaller {\r\n width: 25px;\r\n height: 25px;\r\n }\r\n &.light {\r\n background-color: light-background;\r\n color: dark-color;\r\n &:hover,\r\n &.active {\r\n background-color: light-active-background;\r\n }\r\n &:disabled {\r\n background-color: light-color;\r\n }\r\n }\r\n &.dark {\r\n background-color: dark-background;\r\n color: light-color;\r\n &:hover,\r\n &.active {\r\n background-color: dark-active-background;\r\n }\r\n }\r\n}\r\n"], sourceRoot: "" }]); + ___CSS_LOADER_EXPORT___.locals = { + "light-background": `#E2E2E2`, + "light-active-background": `#FFFFFF`, + "light-disabled-background": `#C8C8C8`, + "light-color": `#FFFFFF`, + "dark-background": `#333333`, + "dark-active-background": `#666666`, + "dark-color": `#333333`, + button: `---------dev-sharedUiComponents-dist-components-Button-modules__button ${_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_4_use_1_Fonts_scss__WEBPACK_IMPORTED_MODULE_2__["default"].locals["fontRegular"]}`, + wide: `---------dev-sharedUiComponents-dist-components-Button-modules__wide`, + small: `---------dev-sharedUiComponents-dist-components-Button-modules__small`, + smaller: `---------dev-sharedUiComponents-dist-components-Button-modules__smaller`, + light: `---------dev-sharedUiComponents-dist-components-Button-modules__light`, + active: `---------dev-sharedUiComponents-dist-components-Button-modules__active`, + dark: `---------dev-sharedUiComponents-dist-components-Button-modules__dark` + }; + const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___; + }, + "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/Icon.modules.scss": (module2, __webpack_exports__2, __webpack_require__2) => { + /*!**********************************************************************************************************************************************************************************************************************************!*\ + !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/Icon.modules.scss ***! + \**********************************************************************************************************************************************************************************************************************************/ + __webpack_require__2.r(__webpack_exports__2); + __webpack_require__2.d(__webpack_exports__2, { + default: () => __WEBPACK_DEFAULT_EXPORT__ + }); + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/api.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + ___CSS_LOADER_EXPORT___.push([module2.id, `.\\---------dev-sharedUiComponents-dist-components-Icon-modules__light { + filter: brightness(10); +}`, "", { version: 3, sources: ["webpack://./../../../dev/sharedUiComponents/dist/components/Icon.modules.scss"], names: [], mappings: "AAAA;EACI,sBAAA;AACJ", sourcesContent: [":local .light {\r\n filter: brightness(10);\r\n}\r\n"], sourceRoot: "" }]); + ___CSS_LOADER_EXPORT___.locals = { + light: `---------dev-sharedUiComponents-dist-components-Icon-modules__light` + }; + const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___; + }, + "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/MessageDialog.modules.scss": (module2, __webpack_exports__2, __webpack_require__2) => { + /*!*******************************************************************************************************************************************************************************************************************************************!*\ + !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/MessageDialog.modules.scss ***! + \*******************************************************************************************************************************************************************************************************************************************/ + __webpack_require__2.r(__webpack_exports__2); + __webpack_require__2.d(__webpack_exports__2, { + default: () => __WEBPACK_DEFAULT_EXPORT__ + }); + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/api.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + ___CSS_LOADER_EXPORT___.push([module2.id, `.\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-container { + position: absolute; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.6); + display: grid; + font-family: "acumin-pro"; + top: 0; +} +.\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog { + align-self: center; + justify-self: center; + min-height: 140px; + max-width: 400px; + border-radius: 10px; + background: white; + padding: 10px; + display: grid; + grid-template-columns: 100%; + grid-template-rows: 1fr 50px; +} +.\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-message { + grid-row: 1; + grid-column: 1; + margin-top: 20px; + padding: 10px; + font-size: 18px; + color: black; +} +.\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-buttons { + grid-row: 2; + grid-column: 1; + display: grid; + grid-template-rows: 100%; + grid-template-columns: 100%; + color: white; +} +.\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-buttons .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-button-ok { + cursor: pointer; + justify-self: center; + background: green; + min-width: 80px; + justify-content: center; + display: grid; + align-content: center; + align-self: center; + height: 35px; + border-radius: 10px; +} +.\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-buttons .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-button-ok:hover { + opacity: 0.8; +} +.\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-container .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-buttons .\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-button-ok.\\---------dev-sharedUiComponents-dist-components-MessageDialog-modules__error { + background: red; +}`, "", { version: 3, sources: ["webpack://./../../../dev/sharedUiComponents/dist/components/MessageDialog.modules.scss"], names: [], mappings: "AAAA;EACI,kBAAA;EACA,WAAA;EACA,YAAA;EACA,8BAAA;EACA,aAAA;EACA,yBAAA;EACA,MAAA;AACJ;AACI;EACI,kBAAA;EACA,oBAAA;EACA,iBAAA;EACA,gBAAA;EACA,mBAAA;EACA,iBAAA;EACA,aAAA;EAEA,aAAA;EACA,2BAAA;EACA,4BAAA;AAAR;AAEQ;EACI,WAAA;EACA,cAAA;EACA,gBAAA;EACA,aAAA;EACA,eAAA;EACA,YAAA;AAAZ;AAGQ;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,wBAAA;EACA,2BAAA;EACA,YAAA;AADZ;AAGY;EACI,eAAA;EACA,oBAAA;EACA,iBAAA;EACA,eAAA;EACA,uBAAA;EACA,aAAA;EACA,qBAAA;EACA,kBAAA;EACA,YAAA;EACA,mBAAA;AADhB;AAGgB;EACI,YAAA;AADpB;AAIgB;EACI,eAAA;AAFpB", sourcesContent: [":local .dialog-container {\r\n position: absolute;\r\n width: 100%;\r\n height: 100%;\r\n background: rgba(0.1, 0.1, 0.1, 0.6);\r\n display: grid;\r\n font-family: \"acumin-pro\";\r\n top: 0;\r\n\r\n .dialog {\r\n align-self: center;\r\n justify-self: center;\r\n min-height: 140px;\r\n max-width: 400px;\r\n border-radius: 10px;\r\n background: white;\r\n padding: 10px;\r\n\r\n display: grid;\r\n grid-template-columns: 100%;\r\n grid-template-rows: 1fr 50px;\r\n\r\n .dialog-message {\r\n grid-row: 1;\r\n grid-column: 1;\r\n margin-top: 20px;\r\n padding: 10px;\r\n font-size: 18px;\r\n color: black;\r\n }\r\n\r\n .dialog-buttons {\r\n grid-row: 2;\r\n grid-column: 1;\r\n display: grid;\r\n grid-template-rows: 100%;\r\n grid-template-columns: 100%;\r\n color: white;\r\n\r\n .dialog-button-ok {\r\n cursor: pointer;\r\n justify-self: center;\r\n background: green;\r\n min-width: 80px;\r\n justify-content: center;\r\n display: grid;\r\n align-content: center;\r\n align-self: center;\r\n height: 35px;\r\n border-radius: 10px;\r\n\r\n &:hover {\r\n opacity: 0.8;\r\n }\r\n\r\n &.error {\r\n background: red;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n"], sourceRoot: "" }]); + ___CSS_LOADER_EXPORT___.locals = { + "dialog-container": `---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-container`, + dialog: `---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog`, + "dialog-message": `---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-message`, + "dialog-buttons": `---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-buttons`, + "dialog-button-ok": `---------dev-sharedUiComponents-dist-components-MessageDialog-modules__dialog-button-ok`, + error: `---------dev-sharedUiComponents-dist-components-MessageDialog-modules__error` + }; + const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___; + }, + "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/TextInputWithSubmit.modules.scss": (module2, __webpack_exports__2, __webpack_require__2) => { + /*!*************************************************************************************************************************************************************************************************************************************************!*\ + !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/TextInputWithSubmit.modules.scss ***! + \*************************************************************************************************************************************************************************************************************************************************/ + __webpack_require__2.r(__webpack_exports__2); + __webpack_require__2.d(__webpack_exports__2, { + default: () => __WEBPACK_DEFAULT_EXPORT__ + }); + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/api.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + ___CSS_LOADER_EXPORT___.push([module2.id, `.\\---------dev-sharedUiComponents-dist-components-TextInputWithSubmit-modules__line { + width: 100%; + height: 100%; + display: flex; + justify-content: space-between; + align-items: center; +} + +.\\---------dev-sharedUiComponents-dist-components-TextInputWithSubmit-modules__input { + border: unset; + background-color: inherit; + flex-grow: 1; + width: 100px; +} + +.\\---------dev-sharedUiComponents-dist-components-TextInputWithSubmit-modules__valid { + background-color: white; +} + +.\\---------dev-sharedUiComponents-dist-components-TextInputWithSubmit-modules__invalid { + background-color: rgba(255, 204, 204, 0.8); +}`, "", { version: 3, sources: ["webpack://./../../../dev/sharedUiComponents/dist/components/TextInputWithSubmit.modules.scss"], names: [], mappings: "AAAA;EACI,WAAA;EACA,YAAA;EACA,aAAA;EACA,8BAAA;EACA,mBAAA;AACJ;;AAEA;EACI,aAAA;EACA,yBAAA;EACA,YAAA;EACA,YAAA;AACJ;;AAEA;EACI,uBAAA;AACJ;;AAEA;EACI,0CAAA;AACJ", sourcesContent: [".line {\r\n width: 100%;\r\n height: 100%;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n}\r\n\r\n.input {\r\n border: unset;\r\n background-color: inherit;\r\n flex-grow: 1;\r\n width: 100px;\r\n}\r\n\r\n.valid {\r\n background-color: white;\r\n}\r\n\r\n.invalid {\r\n background-color: rgba(255, 204, 204, 0.8);\r\n}\r\n"], sourceRoot: "" }]); + ___CSS_LOADER_EXPORT___.locals = { + line: `---------dev-sharedUiComponents-dist-components-TextInputWithSubmit-modules__line`, + input: `---------dev-sharedUiComponents-dist-components-TextInputWithSubmit-modules__input`, + valid: `---------dev-sharedUiComponents-dist-components-TextInputWithSubmit-modules__valid`, + invalid: `---------dev-sharedUiComponents-dist-components-TextInputWithSubmit-modules__invalid` + }; + const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___; + }, + "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/lines/OptionsLineComponent.modules.scss": (module2, __webpack_exports__2, __webpack_require__2) => { + /*!********************************************************************************************************************************************************************************************************************************************************!*\ + !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!../../../dev/sharedUiComponents/dist/components/lines/OptionsLineComponent.modules.scss ***! + \********************************************************************************************************************************************************************************************************************************************************/ + __webpack_require__2.r(__webpack_exports__2); + __webpack_require__2.d(__webpack_exports__2, { + default: () => __WEBPACK_DEFAULT_EXPORT__ + }); + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"); + /*! ../../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/api.js"); + /*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + ___CSS_LOADER_EXPORT___.push([module2.id, `.\\---------dev-sharedUiComponents-dist-components-lines-OptionsLineComponent-modules__optionsLine { + font-family: "acumin-pro-condensed", sans-serif; + font-size: 12px; + height: 25px; + padding-left: 15px; +} + +.\\---------dev-sharedUiComponents-dist-components-lines-OptionsLineComponent-modules__optionsSelect { + width: 100%; + height: 100%; + border: unset; +}`, "", { version: 3, sources: ["webpack://./../../../dev/sharedUiComponents/dist/components/lines/OptionsLineComponent.modules.scss"], names: [], mappings: "AAAA;EACI,+CAAA;EACA,eAAA;EACA,YAAA;EACA,kBAAA;AACJ;;AAEA;EACI,WAAA;EACA,YAAA;EACA,aAAA;AACJ", sourcesContent: [".optionsLine {\r\n font-family: \"acumin-pro-condensed\", sans-serif;\r\n font-size: 12px;\r\n height: 25px;\r\n padding-left: 15px;\r\n}\r\n\r\n.optionsSelect {\r\n width: 100%;\r\n height: 100%;\r\n border: unset;\r\n}\r\n"], sourceRoot: "" }]); + ___CSS_LOADER_EXPORT___.locals = { + optionsLine: `---------dev-sharedUiComponents-dist-components-lines-OptionsLineComponent-modules__optionsLine`, + optionsSelect: `---------dev-sharedUiComponents-dist-components-lines-OptionsLineComponent-modules__optionsSelect` + }; + const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___; + }, + "../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../dev/sharedUiComponents/dist/components/Fonts.scss": (module2, __webpack_exports__2, __webpack_require__2) => { + /*!**********************************************************************************************************************************************!*\ + !*** ../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!../../../dev/sharedUiComponents/dist/components/Fonts.scss ***! + \**********************************************************************************************************************************************/ + __webpack_require__2.r(__webpack_exports__2); + __webpack_require__2.d(__webpack_exports__2, { + default: () => __WEBPACK_DEFAULT_EXPORT__ + }); + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/sourceMaps.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ + var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("../../../../node_modules/css-loader/dist/runtime/api.js"); + /*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ + var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__2.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + ___CSS_LOADER_EXPORT___.push([module2.id, "@import url(https://use.typekit.net/xfi0rwe.css);"]); + ___CSS_LOADER_EXPORT___.push([module2.id, `.\\---------dev-sharedUiComponents-dist-components-Fonts__fontRegular { + font-family: "acumin-pro-condensed"; + font-size: 14px; +} +`, "", { version: 3, sources: ["webpack://./../../../dev/sharedUiComponents/dist/components/Fonts.scss"], names: [], mappings: "AACA;IACI,mCAAmC;IACnC,eAAe;AACnB", sourcesContent: ["@import url(https://use.typekit.net/xfi0rwe.css);\r\n:local(.fontRegular) {\r\n font-family: \"acumin-pro-condensed\";\r\n font-size: 14px;\r\n}\r\n"], sourceRoot: "" }]); + ___CSS_LOADER_EXPORT___.locals = { + fontRegular: `---------dev-sharedUiComponents-dist-components-Fonts__fontRegular` + }; + const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___; + }, + "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js": (__unused_webpack_module, __webpack_exports__2, __webpack_require__2) => { + /*!***************************************************************************!*\ + !*** ../../../../node_modules/@fortawesome/react-fontawesome/index.es.js ***! + \***************************************************************************/ + __webpack_require__2.r(__webpack_exports__2); + __webpack_require__2.d(__webpack_exports__2, { + FontAwesomeIcon: () => FontAwesomeIcon + }); + var _fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("../../../../node_modules/@fortawesome/fontawesome-svg-core/index.mjs"); + /*! @fortawesome/fontawesome-svg-core */ + var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("../../../../node_modules/prop-types/index.js"); + /*! prop-types */ + var prop_types__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__2.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); + var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("../../../../node_modules/react/index.js"); + /*! react */ + function ownKeys(object, enumerableOnly) { + var keys4 = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys4.push.apply(keys4, symbols); + } + return keys4; + } + function _objectSpread2(target) { + for (var i = 1;i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + i % 2 ? ownKeys(Object(source), true).forEach(function(key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + return target; + } + function _typeof(obj) { + "@babel/helpers - typeof"; + return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof(obj); + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) + return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + for (i = 0;i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) + continue; + target[key] = source[key]; + } + return target; + } + function _objectWithoutProperties(source, excluded) { + if (source == null) + return {}; + var target = _objectWithoutPropertiesLoose(source, excluded); + var key, i; + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + for (i = 0;i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) + continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) + continue; + target[key] = source[key]; + } + } + return target; + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) + return _arrayLikeToArray(arr); + } + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) + return Array.from(iter); + } + function _unsupportedIterableToArray(o, minLen) { + if (!o) + return; + if (typeof o === "string") + return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) + n = o.constructor.name; + if (n === "Map" || n === "Set") + return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) + return _arrayLikeToArray(o, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i = 0, arr2 = new Array(len);i < len; i++) + arr2[i] = arr[i]; + return arr2; + } + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function classList(props) { + var _classes; + var { beat, fade, beatFade, bounce, shake, flash, spin, spinPulse, spinReverse, pulse, fixedWidth, inverse, border, listItem, flip, size, rotation, pull } = props; + var classes = (_classes = { + "fa-beat": beat, + "fa-fade": fade, + "fa-beat-fade": beatFade, + "fa-bounce": bounce, + "fa-shake": shake, + "fa-flash": flash, + "fa-spin": spin, + "fa-spin-reverse": spinReverse, + "fa-spin-pulse": spinPulse, + "fa-pulse": pulse, + "fa-fw": fixedWidth, + "fa-inverse": inverse, + "fa-border": border, + "fa-li": listItem, + "fa-flip": flip === true, + "fa-flip-horizontal": flip === "horizontal" || flip === "both", + "fa-flip-vertical": flip === "vertical" || flip === "both" + }, _defineProperty(_classes, "fa-".concat(size), typeof size !== "undefined" && size !== null), _defineProperty(_classes, "fa-rotate-".concat(rotation), typeof rotation !== "undefined" && rotation !== null && rotation !== 0), _defineProperty(_classes, "fa-pull-".concat(pull), typeof pull !== "undefined" && pull !== null), _defineProperty(_classes, "fa-swap-opacity", props.swapOpacity), _classes); + return Object.keys(classes).map(function(key) { + return classes[key] ? key : null; + }).filter(function(key) { + return key; + }); + } + function _isNumerical(obj) { + obj = obj - 0; + return obj === obj; + } + function camelize(string) { + if (_isNumerical(string)) { + return string; + } + string = string.replace(/[\-_\s]+(.)?/g, function(match, chr) { + return chr ? chr.toUpperCase() : ""; + }); + return string.substr(0, 1).toLowerCase() + string.substr(1); + } + var _excluded = ["style"]; + function capitalize(val) { + return val.charAt(0).toUpperCase() + val.slice(1); + } + function styleToObject(style7) { + return style7.split(";").map(function(s) { + return s.trim(); + }).filter(function(s) { + return s; + }).reduce(function(acc, pair) { + var i = pair.indexOf(":"); + var prop = camelize(pair.slice(0, i)); + var value = pair.slice(i + 1).trim(); + prop.startsWith("webkit") ? acc[capitalize(prop)] = value : acc[prop] = value; + return acc; + }, {}); + } + function convert(createElement, element) { + var extraProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + if (typeof element === "string") { + return element; + } + var children = (element.children || []).map(function(child) { + return convert(createElement, child); + }); + var mixins = Object.keys(element.attributes || {}).reduce(function(acc, key) { + var val = element.attributes[key]; + switch (key) { + case "class": + acc.attrs["className"] = val; + delete element.attributes["class"]; + break; + case "style": + acc.attrs["style"] = styleToObject(val); + break; + default: + if (key.indexOf("aria-") === 0 || key.indexOf("data-") === 0) { + acc.attrs[key.toLowerCase()] = val; + } else { + acc.attrs[camelize(key)] = val; + } + } + return acc; + }, { + attrs: {} + }); + var _extraProps$style = extraProps.style, existingStyle = _extraProps$style === undefined ? {} : _extraProps$style, remaining = _objectWithoutProperties(extraProps, _excluded); + mixins.attrs["style"] = _objectSpread2(_objectSpread2({}, mixins.attrs["style"]), existingStyle); + return createElement.apply(undefined, [element.tag, _objectSpread2(_objectSpread2({}, mixins.attrs), remaining)].concat(_toConsumableArray(children))); + } + var PRODUCTION = false; + try { + PRODUCTION = false; + } catch (e) { + } + function log() { + if (!PRODUCTION && console && typeof console.error === "function") { + var _console; + (_console = console).error.apply(_console, arguments); + } + } + function normalizeIconArgs(icon) { + if (icon && _typeof(icon) === "object" && icon.prefix && icon.iconName && icon.icon) { + return icon; + } + if (_fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__.parse.icon) { + return _fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__.parse.icon(icon); + } + if (icon === null) { + return null; + } + if (icon && _typeof(icon) === "object" && icon.prefix && icon.iconName) { + return icon; + } + if (Array.isArray(icon) && icon.length === 2) { + return { + prefix: icon[0], + iconName: icon[1] + }; + } + if (typeof icon === "string") { + return { + prefix: "fas", + iconName: icon + }; + } + } + function objectWithKey(key, value) { + return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty({}, key, value) : {}; + } + var FontAwesomeIcon = react__WEBPACK_IMPORTED_MODULE_2__.forwardRef(function(props, ref) { + var { icon: iconArgs, mask: maskArgs, symbol, className: className2, title, titleId, maskId } = props; + var iconLookup = normalizeIconArgs(iconArgs); + var classes = objectWithKey("classes", [].concat(_toConsumableArray(classList(props)), _toConsumableArray(className2.split(" ")))); + var transform = objectWithKey("transform", typeof props.transform === "string" ? _fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__.parse.transform(props.transform) : props.transform); + var mask = objectWithKey("mask", normalizeIconArgs(maskArgs)); + var renderedIcon = (0, _fortawesome_fontawesome_svg_core__WEBPACK_IMPORTED_MODULE_0__.icon)(iconLookup, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, classes), transform), mask), {}, { + symbol, + title, + titleId, + maskId + })); + if (!renderedIcon) { + log("Could not find icon", iconLookup); + return null; + } + var abstract = renderedIcon.abstract; + var extraProps = { + ref + }; + Object.keys(props).forEach(function(key) { + if (!FontAwesomeIcon.defaultProps.hasOwnProperty(key)) { + extraProps[key] = props[key]; + } + }); + return convertCurry(abstract[0], extraProps); + }); + FontAwesomeIcon.displayName = "FontAwesomeIcon"; + FontAwesomeIcon.propTypes = { + beat: prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool, + border: prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool, + beatFade: prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool, + bounce: prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool, + className: prop_types__WEBPACK_IMPORTED_MODULE_1___default().string, + fade: prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool, + flash: prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool, + mask: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default().object, prop_types__WEBPACK_IMPORTED_MODULE_1___default().array, prop_types__WEBPACK_IMPORTED_MODULE_1___default().string]), + maskId: prop_types__WEBPACK_IMPORTED_MODULE_1___default().string, + fixedWidth: prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool, + inverse: prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool, + flip: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf([true, false, "horizontal", "vertical", "both"]), + icon: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default().object, prop_types__WEBPACK_IMPORTED_MODULE_1___default().array, prop_types__WEBPACK_IMPORTED_MODULE_1___default().string]), + listItem: prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool, + pull: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(["right", "left"]), + pulse: prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool, + rotation: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf([0, 90, 180, 270]), + shake: prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool, + size: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(["2xs", "xs", "sm", "lg", "xl", "2xl", "1x", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x"]), + spin: prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool, + spinPulse: prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool, + spinReverse: prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool, + symbol: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool, prop_types__WEBPACK_IMPORTED_MODULE_1___default().string]), + title: prop_types__WEBPACK_IMPORTED_MODULE_1___default().string, + titleId: prop_types__WEBPACK_IMPORTED_MODULE_1___default().string, + transform: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default().string, prop_types__WEBPACK_IMPORTED_MODULE_1___default().object]), + swapOpacity: prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool + }; + FontAwesomeIcon.defaultProps = { + border: false, + className: "", + mask: null, + maskId: null, + fixedWidth: false, + inverse: false, + flip: false, + icon: null, + listItem: false, + pull: null, + pulse: false, + rotation: null, + size: null, + spin: false, + spinPulse: false, + spinReverse: false, + beat: false, + fade: false, + beatFade: false, + bounce: false, + shake: false, + symbol: false, + title: "", + titleId: null, + transform: null, + swapOpacity: false + }; + var convertCurry = convert.bind(null, react__WEBPACK_IMPORTED_MODULE_2__.createElement); + }, + "../../../../node_modules/classnames/index.js": (module2, exports2) => { + /*!****************************************************!*\ + !*** ../../../../node_modules/classnames/index.js ***! + \****************************************************/ + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; + /*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames + */ + (function() { + var hasOwn = {}.hasOwnProperty; + var nativeCodeString = "[native code]"; + function classNames() { + var classes = []; + for (var i = 0;i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) + continue; + var argType = typeof arg; + if (argType === "string" || argType === "number") { + classes.push(arg); + } else if (Array.isArray(arg)) { + if (arg.length) { + var inner = classNames.apply(null, arg); + if (inner) { + classes.push(inner); + } + } + } else if (argType === "object") { + if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) { + classes.push(arg.toString()); + continue; + } + for (var key in arg) { + if (hasOwn.call(arg, key) && arg[key]) { + classes.push(key); + } + } + } + } + return classes.join(" "); + } + if (module2.exports) { + classNames.default = classNames; + module2.exports = classNames; + } else if (true) { + __WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { + return classNames; + }.apply(exports2, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module2.exports = __WEBPACK_AMD_DEFINE_RESULT__); + } else { + } + })(); + }, + "../../../../node_modules/css-loader/dist/runtime/api.js": (module2) => { + /*!***************************************************************!*\ + !*** ../../../../node_modules/css-loader/dist/runtime/api.js ***! + \***************************************************************/ + module2.exports = function(cssWithMappingToString) { + var list = []; + list.toString = function toString() { + return this.map(function(item) { + var content = ""; + var needLayer = typeof item[5] !== "undefined"; + if (item[4]) { + content += "@supports (".concat(item[4], ") {"); + } + if (item[2]) { + content += "@media ".concat(item[2], " {"); + } + if (needLayer) { + content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {"); + } + content += cssWithMappingToString(item); + if (needLayer) { + content += "}"; + } + if (item[2]) { + content += "}"; + } + if (item[4]) { + content += "}"; + } + return content; + }).join(""); + }; + list.i = function i(modules, media, dedupe, supports, layer5) { + if (typeof modules === "string") { + modules = [[null, modules, undefined]]; + } + var alreadyImportedModules = {}; + if (dedupe) { + for (var k = 0;k < this.length; k++) { + var id = this[k][0]; + if (id != null) { + alreadyImportedModules[id] = true; + } + } + } + for (var _k = 0;_k < modules.length; _k++) { + var item = [].concat(modules[_k]); + if (dedupe && alreadyImportedModules[item[0]]) { + continue; + } + if (typeof layer5 !== "undefined") { + if (typeof item[5] === "undefined") { + item[5] = layer5; + } else { + item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}"); + item[5] = layer5; + } + } + if (media) { + if (!item[2]) { + item[2] = media; + } else { + item[1] = "@media ".concat(item[2], " {").concat(item[1], "}"); + item[2] = media; + } + } + if (supports) { + if (!item[4]) { + item[4] = "".concat(supports); + } else { + item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}"); + item[4] = supports; + } + } + list.push(item); + } + }; + return list; + }; + }, + "../../../../node_modules/css-loader/dist/runtime/sourceMaps.js": (module2) => { + /*!**********************************************************************!*\ + !*** ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js ***! + \**********************************************************************/ + module2.exports = function(item) { + var content = item[1]; + var cssMapping = item[3]; + if (!cssMapping) { + return content; + } + if (typeof btoa === "function") { + var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping)))); + var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64); + var sourceMapping = "/*# ".concat(data, " */"); + return [content].concat([sourceMapping]).join("\n"); + } + return [content].join("\n"); + }; + }, + "../../../../node_modules/object-assign/index.js": (module2) => { + /*!*******************************************************!*\ + !*** ../../../../node_modules/object-assign/index.js ***! + \*******************************************************/ + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError("Object.assign cannot be called with null or undefined"); + } + return Object(val); + } + function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + var test1 = new String("abc"); + test1[5] = "de"; + if (Object.getOwnPropertyNames(test1)[0] === "5") { + return false; + } + var test2 = {}; + for (var i = 0;i < 10; i++) { + test2["_" + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function(n) { + return test2[n]; + }); + if (order2.join("") !== "0123456789") { + return false; + } + var test3 = {}; + "abcdefghijklmnopqrst".split("").forEach(function(letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") { + return false; + } + return true; + } catch (err) { + return false; + } + } + module2.exports = shouldUseNative() ? Object.assign : function(target, source) { + var from; + var to = toObject(target); + var symbols; + for (var s = 1;s < arguments.length; s++) { + from = Object(arguments[s]); + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0;i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + return to; + }; + }, + "../../../../node_modules/prop-types/checkPropTypes.js": (module2, __unused_webpack_exports, __webpack_require__2) => { + /*!*************************************************************!*\ + !*** ../../../../node_modules/prop-types/checkPropTypes.js ***! + \*************************************************************/ + var printWarning = function() { + }; + if (true) { + var ReactPropTypesSecret = __webpack_require__2("../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js"); + /*! ./lib/ReactPropTypesSecret */ + var loggedTypeFailures = {}; + var has = __webpack_require__2("../../../../node_modules/prop-types/lib/has.js"); + /*! ./lib/has */ + printWarning = function(text) { + var message = "Warning: " + text; + if (typeof console !== "undefined") { + console.error(message); + } + try { + throw new Error(message); + } catch (x) { + } + }; + } + function checkPropTypes(typeSpecs, values, location2, componentName, getStack) { + if (true) { + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error7; + try { + if (typeof typeSpecs[typeSpecName] !== "function") { + var err = Error((componentName || "React class") + ": " + location2 + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); + err.name = "Invariant Violation"; + throw err; + } + error7 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location2, null, ReactPropTypesSecret); + } catch (ex) { + error7 = ex; + } + if (error7 && !(error7 instanceof Error)) { + printWarning((componentName || "React class") + ": type specification of " + location2 + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error7 + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."); + } + if (error7 instanceof Error && !(error7.message in loggedTypeFailures)) { + loggedTypeFailures[error7.message] = true; + var stack = getStack ? getStack() : ""; + printWarning("Failed " + location2 + " type: " + error7.message + (stack != null ? stack : "")); + } + } + } + } + } + checkPropTypes.resetWarningCache = function() { + if (true) { + loggedTypeFailures = {}; + } + }; + module2.exports = checkPropTypes; + }, + "../../../../node_modules/prop-types/factoryWithTypeCheckers.js": (module2, __unused_webpack_exports, __webpack_require__2) => { + /*!**********************************************************************!*\ + !*** ../../../../node_modules/prop-types/factoryWithTypeCheckers.js ***! + \**********************************************************************/ + var ReactIs = __webpack_require__2("../../../../node_modules/prop-types/node_modules/react-is/index.js"); + /*! react-is */ + var assign = __webpack_require__2("../../../../node_modules/object-assign/index.js"); + /*! object-assign */ + var ReactPropTypesSecret = __webpack_require__2("../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js"); + /*! ./lib/ReactPropTypesSecret */ + var has = __webpack_require__2("../../../../node_modules/prop-types/lib/has.js"); + /*! ./lib/has */ + var checkPropTypes = __webpack_require__2("../../../../node_modules/prop-types/checkPropTypes.js"); + /*! ./checkPropTypes */ + var printWarning = function() { + }; + if (true) { + printWarning = function(text) { + var message = "Warning: " + text; + if (typeof console !== "undefined") { + console.error(message); + } + try { + throw new Error(message); + } catch (x) { + } + }; + } + function emptyFunctionThatReturnsNull() { + return null; + } + module2.exports = function(isValidElement, throwOnDirectAccess) { + var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = "@@iterator"; + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === "function") { + return iteratorFn; + } + } + var ANONYMOUS = "<>"; + var ReactPropTypes = { + array: createPrimitiveTypeChecker("array"), + bigint: createPrimitiveTypeChecker("bigint"), + bool: createPrimitiveTypeChecker("boolean"), + func: createPrimitiveTypeChecker("function"), + number: createPrimitiveTypeChecker("number"), + object: createPrimitiveTypeChecker("object"), + string: createPrimitiveTypeChecker("string"), + symbol: createPrimitiveTypeChecker("symbol"), + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + elementType: createElementTypeTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker + }; + function is(x, y) { + if (x === y) { + return x !== 0 || 1 / x === 1 / y; + } else { + return x !== x && y !== y; + } + } + function PropTypeError(message, data) { + this.message = message; + this.data = data && typeof data === "object" ? data : {}; + this.stack = ""; + } + PropTypeError.prototype = Error.prototype; + function createChainableTypeChecker(validate) { + if (true) { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location2, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + var err = new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"); + err.name = "Invariant Violation"; + throw err; + } else if (typeof console !== "undefined") { + var cacheKey = componentName + ":" + propName; + if (!manualPropTypeCallCache[cacheKey] && manualPropTypeWarningCount < 3) { + printWarning("You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError("The " + location2 + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`.")); + } + return new PropTypeError("The " + location2 + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`.")); + } + return null; + } else { + return validate(props, propName, componentName, location2, propFullName); + } + } + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + return chainedCheckType; + } + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location2, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + var preciseType = getPreciseType(propValue); + return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."), { expectedType }); + } + return null; + } + return createChainableTypeChecker(validate); + } + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); + } + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location2, propFullName) { + if (typeof typeChecker !== "function") { + return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf."); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array.")); + } + for (var i = 0;i < propValue.length; i++) { + var error7 = typeChecker(propValue, i, componentName, location2, propFullName + "[" + i + "]", ReactPropTypesSecret); + if (error7 instanceof Error) { + return error7; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + function createElementTypeChecker() { + function validate(props, propName, componentName, location2, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement.")); + } + return null; + } + return createChainableTypeChecker(validate); + } + function createElementTypeTypeChecker() { + function validate(props, propName, componentName, location2, propFullName) { + var propValue = props[propName]; + if (!ReactIs.isValidElementType(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type.")); + } + return null; + } + return createChainableTypeChecker(validate); + } + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location2, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`.")); + } + return null; + } + return createChainableTypeChecker(validate); + } + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + if (true) { + if (arguments.length > 1) { + printWarning("Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."); + } else { + printWarning("Invalid argument supplied to oneOf, expected an array."); + } + } + return emptyFunctionThatReturnsNull; + } + function validate(props, propName, componentName, location2, propFullName) { + var propValue = props[propName]; + for (var i = 0;i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { + var type = getPreciseType(value); + if (type === "symbol") { + return String(value); + } + return value; + }); + return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + ".")); + } + return createChainableTypeChecker(validate); + } + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location2, propFullName) { + if (typeof typeChecker !== "function") { + return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf."); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== "object") { + return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object.")); + } + for (var key in propValue) { + if (has(propValue, key)) { + var error7 = typeChecker(propValue, key, componentName, location2, propFullName + "." + key, ReactPropTypesSecret); + if (error7 instanceof Error) { + return error7; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + printWarning("Invalid argument supplied to oneOfType, expected an instance of array."); + return emptyFunctionThatReturnsNull; + } + for (var i = 0;i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== "function") { + printWarning("Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."); + return emptyFunctionThatReturnsNull; + } + } + function validate(props, propName, componentName, location2, propFullName) { + var expectedTypes = []; + for (var i2 = 0;i2 < arrayOfTypeCheckers.length; i2++) { + var checker2 = arrayOfTypeCheckers[i2]; + var checkerResult = checker2(props, propName, componentName, location2, propFullName, ReactPropTypesSecret); + if (checkerResult == null) { + return null; + } + if (checkerResult.data && has(checkerResult.data, "expectedType")) { + expectedTypes.push(checkerResult.data.expectedType); + } + } + var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : ""; + return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + ".")); + } + return createChainableTypeChecker(validate); + } + function createNodeChecker() { + function validate(props, propName, componentName, location2, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode.")); + } + return null; + } + return createChainableTypeChecker(validate); + } + function invalidValidatorError(componentName, location2, propFullName, key, type) { + return new PropTypeError((componentName || "React class") + ": " + location2 + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."); + } + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location2, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== "object") { + return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (typeof checker !== "function") { + return invalidValidatorError(componentName, location2, propFullName, key, getPreciseType(checker)); + } + var error7 = checker(propValue, key, componentName, location2, propFullName + "." + key, ReactPropTypesSecret); + if (error7) { + return error7; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location2, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== "object") { + return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); + } + var allKeys = assign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (has(shapeTypes, key) && typeof checker !== "function") { + return invalidValidatorError(componentName, location2, propFullName, key, getPreciseType(checker)); + } + if (!checker) { + return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")); + } + var error7 = checker(propValue, key, componentName, location2, propFullName + "." + key, ReactPropTypesSecret); + if (error7) { + return error7; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + function isNode(propValue) { + switch (typeof propValue) { + case "number": + case "string": + case "undefined": + return true; + case "boolean": + return !propValue; + case "object": + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + return true; + default: + return false; + } + } + function isSymbol(propType, propValue) { + if (propType === "symbol") { + return true; + } + if (!propValue) { + return false; + } + if (propValue["@@toStringTag"] === "Symbol") { + return true; + } + if (typeof Symbol === "function" && propValue instanceof Symbol) { + return true; + } + return false; + } + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return "array"; + } + if (propValue instanceof RegExp) { + return "object"; + } + if (isSymbol(propType, propValue)) { + return "symbol"; + } + return propType; + } + function getPreciseType(propValue) { + if (typeof propValue === "undefined" || propValue === null) { + return "" + propValue; + } + var propType = getPropType(propValue); + if (propType === "object") { + if (propValue instanceof Date) { + return "date"; + } else if (propValue instanceof RegExp) { + return "regexp"; + } + } + return propType; + } + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case "array": + case "object": + return "an " + type; + case "boolean": + case "date": + case "regexp": + return "a " + type; + default: + return type; + } + } + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; + ReactPropTypes.PropTypes = ReactPropTypes; + return ReactPropTypes; + }; + }, + "../../../../node_modules/prop-types/index.js": (module2, __unused_webpack_exports, __webpack_require__2) => { + /*!****************************************************!*\ + !*** ../../../../node_modules/prop-types/index.js ***! + \****************************************************/ + if (true) { + var ReactIs = __webpack_require__2("../../../../node_modules/prop-types/node_modules/react-is/index.js"); + /*! react-is */ + var throwOnDirectAccess = true; + module2.exports = __webpack_require__2("../../../../node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess); + /*! ./factoryWithTypeCheckers */ + } else { + } + }, + "../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js": (module2) => { + /*!***********************************************************************!*\ + !*** ../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js ***! + \***********************************************************************/ + var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; + module2.exports = ReactPropTypesSecret; + }, + "../../../../node_modules/prop-types/lib/has.js": (module2) => { + /*!******************************************************!*\ + !*** ../../../../node_modules/prop-types/lib/has.js ***! + \******************************************************/ + module2.exports = Function.call.bind(Object.prototype.hasOwnProperty); + }, + "../../../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js": (__unused_webpack_module, exports2) => { + /*!*********************************************************************************************!*\ + !*** ../../../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js ***! + \*********************************************************************************************/ + if (true) { + (function() { + var hasSymbol = typeof Symbol === "function" && Symbol.for; + var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103; + var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106; + var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107; + var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108; + var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114; + var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109; + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110; + var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111; + var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111; + var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112; + var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113; + var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120; + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115; + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116; + var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121; + var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117; + var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118; + var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119; + function isValidElementType(type) { + return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); + } + function typeOf(object) { + if (typeof object === "object" && object !== null) { + var $$typeof = object.$$typeof; + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; + switch (type) { + case REACT_ASYNC_MODE_TYPE: + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + case REACT_SUSPENSE_TYPE: + return type; + default: + var $$typeofType = type && type.$$typeof; + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; + default: + return $$typeof; + } + } + case REACT_PORTAL_TYPE: + return $$typeof; + } + } + return; + } + var AsyncMode = REACT_ASYNC_MODE_TYPE; + var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; + var ContextConsumer = REACT_CONTEXT_TYPE; + var ContextProvider = REACT_PROVIDER_TYPE; + var Element = REACT_ELEMENT_TYPE; + var ForwardRef = REACT_FORWARD_REF_TYPE; + var Fragment2 = REACT_FRAGMENT_TYPE; + var Lazy = REACT_LAZY_TYPE; + var Memo = REACT_MEMO_TYPE; + var Portal = REACT_PORTAL_TYPE; + var Profiler = REACT_PROFILER_TYPE; + var StrictMode = REACT_STRICT_MODE_TYPE; + var Suspense = REACT_SUSPENSE_TYPE; + var hasWarnedAboutDeprecatedIsAsyncMode = false; + function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; + console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API."); + } + } + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; + } + function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; + } + function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; + } + function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; + } + function isElement(object) { + return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } + function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; + } + function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; + } + function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; + } + function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; + } + function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; + } + function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; + } + function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; + } + function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; + } + exports2.AsyncMode = AsyncMode; + exports2.ConcurrentMode = ConcurrentMode; + exports2.ContextConsumer = ContextConsumer; + exports2.ContextProvider = ContextProvider; + exports2.Element = Element; + exports2.ForwardRef = ForwardRef; + exports2.Fragment = Fragment2; + exports2.Lazy = Lazy; + exports2.Memo = Memo; + exports2.Portal = Portal; + exports2.Profiler = Profiler; + exports2.StrictMode = StrictMode; + exports2.Suspense = Suspense; + exports2.isAsyncMode = isAsyncMode; + exports2.isConcurrentMode = isConcurrentMode; + exports2.isContextConsumer = isContextConsumer; + exports2.isContextProvider = isContextProvider; + exports2.isElement = isElement; + exports2.isForwardRef = isForwardRef; + exports2.isFragment = isFragment; + exports2.isLazy = isLazy; + exports2.isMemo = isMemo; + exports2.isPortal = isPortal; + exports2.isProfiler = isProfiler; + exports2.isStrictMode = isStrictMode; + exports2.isSuspense = isSuspense; + exports2.isValidElementType = isValidElementType; + exports2.typeOf = typeOf; + })(); + } + }, + "../../../../node_modules/prop-types/node_modules/react-is/index.js": (module2, __unused_webpack_exports, __webpack_require__2) => { + /*!**************************************************************************!*\ + !*** ../../../../node_modules/prop-types/node_modules/react-is/index.js ***! + \**************************************************************************/ + if (false) { + } else { + module2.exports = __webpack_require__2("../../../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"); + /*! ./cjs/react-is.development.js */ + } + }, + "../../../../node_modules/react-contextmenu/es6/AbstractMenu.js": (__unused_webpack_module, exports2, __webpack_require__2) => { + /*!**********************************************************************!*\ + !*** ../../../../node_modules/react-contextmenu/es6/AbstractMenu.js ***! + \**********************************************************************/ + function _typeof(obj) { + "@babel/helpers - typeof"; + return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof(obj); + } + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2["default"] = undefined; + var _react = _interopRequireWildcard(__webpack_require__2("../../../../node_modules/react/index.js")); + /*! react */ + var _propTypes = _interopRequireDefault(__webpack_require__2("../../../../node_modules/prop-types/index.js")); + /*! prop-types */ + var _MenuItem = _interopRequireDefault(__webpack_require__2("../../../../node_modules/react-contextmenu/es6/MenuItem.js")); + /*! ./MenuItem */ + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") + return null; + var cacheBabelInterop = new WeakMap; + var cacheNodeInterop = new WeakMap; + return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop2) { + return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { + return { default: obj }; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj["default"] = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _defineProperties(target, props) { + for (var i = 0;i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); + Object.defineProperty(subClass, "prototype", { writable: false }); + if (superClass) + _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o2, p2) { + o2.__proto__ = p2; + return o2; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); + return function _createSuperInternal() { + var Super = _getPrototypeOf(Derived), result; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self2, call) { + if (call && (_typeof(call) === "object" || typeof call === "function")) { + return call; + } else if (call !== undefined) { + throw new TypeError("Derived constructors may only return object or undefined"); + } + return _assertThisInitialized(self2); + } + function _assertThisInitialized(self2) { + if (self2 === undefined) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self2; + } + function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e) { + return false; + } + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o2) { + return o2.__proto__ || Object.getPrototypeOf(o2); + }; + return _getPrototypeOf(o); + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + var AbstractMenu = function(_Component) { + _inherits(AbstractMenu2, _Component); + var _super = _createSuper(AbstractMenu2); + function AbstractMenu2(_props) { + var _this; + _classCallCheck(this, AbstractMenu2); + _this = _super.call(this, _props); + _defineProperty(_assertThisInitialized(_this), "handleKeyNavigation", function(e) { + if (_this.state.isVisible === false) { + return; + } + switch (e.keyCode) { + case 37: + case 27: + e.preventDefault(); + _this.hideMenu(e); + break; + case 38: + e.preventDefault(); + _this.selectChildren(true); + break; + case 40: + e.preventDefault(); + _this.selectChildren(false); + break; + case 39: + _this.tryToOpenSubMenu(e); + break; + case 13: + e.preventDefault(); + _this.tryToOpenSubMenu(e); + { + var disabled = _this.seletedItemRef && _this.seletedItemRef.props && _this.seletedItemRef.props.disabled; + if (_this.seletedItemRef && _this.seletedItemRef.ref instanceof HTMLElement && !disabled) { + _this.seletedItemRef.ref.click(); + } else { + _this.hideMenu(e); + } + } + break; + default: + } + }); + _defineProperty(_assertThisInitialized(_this), "handleForceClose", function() { + _this.setState({ + forceSubMenuOpen: false + }); + }); + _defineProperty(_assertThisInitialized(_this), "tryToOpenSubMenu", function(e) { + if (_this.state.selectedItem && _this.state.selectedItem.type === _this.getSubMenuType()) { + e.preventDefault(); + _this.setState({ + forceSubMenuOpen: true + }); + } + }); + _defineProperty(_assertThisInitialized(_this), "selectChildren", function(forward) { + var selectedItem = _this.state.selectedItem; + var children = []; + var disabledChildrenCount = 0; + var disabledChildIndexes = {}; + var childCollector = function childCollector(child, index) { + if (!child) { + return; + } + if ([_MenuItem["default"], _this.getSubMenuType()].indexOf(child.type) < 0) { + _react["default"].Children.forEach(child.props.children, childCollector); + } else if (!child.props.divider) { + if (child.props.disabled) { + ++disabledChildrenCount; + disabledChildIndexes[index] = true; + } + children.push(child); + } + }; + _react["default"].Children.forEach(_this.props.children, childCollector); + if (disabledChildrenCount === children.length) { + return; + } + function findNextEnabledChildIndex(currentIndex2) { + var i = currentIndex2; + var incrementCounter = function incrementCounter() { + if (forward) { + --i; + } else { + ++i; + } + if (i < 0) { + i = children.length - 1; + } else if (i >= children.length) { + i = 0; + } + }; + do { + incrementCounter(); + } while (i !== currentIndex2 && disabledChildIndexes[i]); + return i === currentIndex2 ? null : i; + } + var currentIndex = children.indexOf(selectedItem); + var nextEnabledChildIndex = findNextEnabledChildIndex(currentIndex); + if (nextEnabledChildIndex !== null) { + _this.setState({ + selectedItem: children[nextEnabledChildIndex], + forceSubMenuOpen: false + }); + } + }); + _defineProperty(_assertThisInitialized(_this), "onChildMouseMove", function(child) { + if (_this.state.selectedItem !== child) { + _this.setState({ + selectedItem: child, + forceSubMenuOpen: false + }); + } + }); + _defineProperty(_assertThisInitialized(_this), "onChildMouseLeave", function() { + _this.setState({ + selectedItem: null, + forceSubMenuOpen: false + }); + }); + _defineProperty(_assertThisInitialized(_this), "renderChildren", function(children) { + return _react["default"].Children.map(children, function(child) { + var props = {}; + if (!_react["default"].isValidElement(child)) + return child; + if ([_MenuItem["default"], _this.getSubMenuType()].indexOf(child.type) < 0) { + props.children = _this.renderChildren(child.props.children); + return _react["default"].cloneElement(child, props); + } + props.onMouseLeave = _this.onChildMouseLeave.bind(_assertThisInitialized(_this)); + if (child.type === _this.getSubMenuType()) { + props.forceOpen = _this.state.forceSubMenuOpen && _this.state.selectedItem === child; + props.forceClose = _this.handleForceClose; + props.parentKeyNavigationHandler = _this.handleKeyNavigation; + } + if (!child.props.divider && _this.state.selectedItem === child) { + props.selected = true; + props.ref = function(ref) { + _this.seletedItemRef = ref; + }; + return _react["default"].cloneElement(child, props); + } + props.onMouseMove = function() { + return _this.onChildMouseMove(child); + }; + return _react["default"].cloneElement(child, props); + }); + }); + _this.seletedItemRef = null; + _this.state = { + selectedItem: null, + forceSubMenuOpen: false + }; + return _this; + } + return _createClass(AbstractMenu2); + }(_react.Component); + exports2["default"] = AbstractMenu; + _defineProperty(AbstractMenu, "propTypes", { + children: _propTypes["default"].node.isRequired + }); + }, + "../../../../node_modules/react-contextmenu/es6/ContextMenu.js": (__unused_webpack_module, exports2, __webpack_require__2) => { + /*!*********************************************************************!*\ + !*** ../../../../node_modules/react-contextmenu/es6/ContextMenu.js ***! + \*********************************************************************/ + function _typeof(obj) { + "@babel/helpers - typeof"; + return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof(obj); + } + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2["default"] = undefined; + var _react = _interopRequireDefault(__webpack_require__2("../../../../node_modules/react/index.js")); + /*! react */ + var _propTypes = _interopRequireDefault(__webpack_require__2("../../../../node_modules/prop-types/index.js")); + /*! prop-types */ + var _classnames = _interopRequireDefault(__webpack_require__2("../../../../node_modules/classnames/index.js")); + /*! classnames */ + var _objectAssign = _interopRequireDefault(__webpack_require__2("../../../../node_modules/object-assign/index.js")); + /*! object-assign */ + var _globalEventListener = _interopRequireDefault(__webpack_require__2("../../../../node_modules/react-contextmenu/es6/globalEventListener.js")); + /*! ./globalEventListener */ + var _AbstractMenu2 = _interopRequireDefault(__webpack_require__2("../../../../node_modules/react-contextmenu/es6/AbstractMenu.js")); + /*! ./AbstractMenu */ + var _SubMenu = _interopRequireDefault(__webpack_require__2("../../../../node_modules/react-contextmenu/es6/SubMenu.js")); + /*! ./SubMenu */ + var _actions = __webpack_require__2("../../../../node_modules/react-contextmenu/es6/actions.js"); + /*! ./actions */ + var _helpers = __webpack_require__2("../../../../node_modules/react-contextmenu/es6/helpers.js"); + /*! ./helpers */ + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0;i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); + Object.defineProperty(subClass, "prototype", { writable: false }); + if (superClass) + _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o2, p2) { + o2.__proto__ = p2; + return o2; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); + return function _createSuperInternal() { + var Super = _getPrototypeOf(Derived), result; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self2, call) { + if (call && (_typeof(call) === "object" || typeof call === "function")) { + return call; + } else if (call !== undefined) { + throw new TypeError("Derived constructors may only return object or undefined"); + } + return _assertThisInitialized(self2); + } + function _assertThisInitialized(self2) { + if (self2 === undefined) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self2; + } + function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e) { + return false; + } + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o2) { + return o2.__proto__ || Object.getPrototypeOf(o2); + }; + return _getPrototypeOf(o); + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + var ContextMenu = function(_AbstractMenu) { + _inherits(ContextMenu2, _AbstractMenu); + var _super = _createSuper(ContextMenu2); + function ContextMenu2(props) { + var _this; + _classCallCheck(this, ContextMenu2); + _this = _super.call(this, props); + _defineProperty(_assertThisInitialized(_this), "registerHandlers", function() { + document.addEventListener("mousedown", _this.handleOutsideClick); + document.addEventListener("touchstart", _this.handleOutsideClick); + if (!_this.props.preventHideOnScroll) + document.addEventListener("scroll", _this.handleHide); + if (!_this.props.preventHideOnContextMenu) + document.addEventListener("contextmenu", _this.handleHide); + document.addEventListener("keydown", _this.handleKeyNavigation); + if (!_this.props.preventHideOnResize) + window.addEventListener("resize", _this.handleHide); + }); + _defineProperty(_assertThisInitialized(_this), "unregisterHandlers", function() { + document.removeEventListener("mousedown", _this.handleOutsideClick); + document.removeEventListener("touchstart", _this.handleOutsideClick); + document.removeEventListener("scroll", _this.handleHide); + document.removeEventListener("contextmenu", _this.handleHide); + document.removeEventListener("keydown", _this.handleKeyNavigation); + window.removeEventListener("resize", _this.handleHide); + }); + _defineProperty(_assertThisInitialized(_this), "handleShow", function(e) { + if (e.detail.id !== _this.props.id || _this.state.isVisible) + return; + var _e$detail$position = e.detail.position, x = _e$detail$position.x, y = _e$detail$position.y; + _this.setState({ + isVisible: true, + x, + y + }); + _this.registerHandlers(); + (0, _helpers.callIfExists)(_this.props.onShow, e); + }); + _defineProperty(_assertThisInitialized(_this), "handleHide", function(e) { + if (_this.state.isVisible && (!e.detail || !e.detail.id || e.detail.id === _this.props.id)) { + _this.unregisterHandlers(); + _this.setState({ + isVisible: false, + selectedItem: null, + forceSubMenuOpen: false + }); + (0, _helpers.callIfExists)(_this.props.onHide, e); + } + }); + _defineProperty(_assertThisInitialized(_this), "handleOutsideClick", function(e) { + if (!_this.menu.contains(e.target)) + (0, _actions.hideMenu)(); + }); + _defineProperty(_assertThisInitialized(_this), "handleMouseLeave", function(event) { + event.preventDefault(); + (0, _helpers.callIfExists)(_this.props.onMouseLeave, event, (0, _objectAssign["default"])({}, _this.props.data, _helpers.store.data), _helpers.store.target); + if (_this.props.hideOnLeave) + (0, _actions.hideMenu)(); + }); + _defineProperty(_assertThisInitialized(_this), "handleContextMenu", function(e) { + if (false) { + } + _this.handleHide(e); + }); + _defineProperty(_assertThisInitialized(_this), "hideMenu", function(e) { + if (e.keyCode === 27 || e.keyCode === 13) { + (0, _actions.hideMenu)(); + } + }); + _defineProperty(_assertThisInitialized(_this), "getMenuPosition", function() { + var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var menuStyles = { + top: y, + left: x + }; + if (!_this.menu) + return menuStyles; + var _window = window, innerWidth = _window.innerWidth, innerHeight = _window.innerHeight; + var rect = _this.menu.getBoundingClientRect(); + if (y + rect.height > innerHeight) { + menuStyles.top -= rect.height; + } + if (x + rect.width > innerWidth) { + menuStyles.left -= rect.width; + } + if (menuStyles.top < 0) { + menuStyles.top = rect.height < innerHeight ? (innerHeight - rect.height) / 2 : 0; + } + if (menuStyles.left < 0) { + menuStyles.left = rect.width < innerWidth ? (innerWidth - rect.width) / 2 : 0; + } + return menuStyles; + }); + _defineProperty(_assertThisInitialized(_this), "getRTLMenuPosition", function() { + var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var menuStyles = { + top: y, + left: x + }; + if (!_this.menu) + return menuStyles; + var _window2 = window, innerWidth = _window2.innerWidth, innerHeight = _window2.innerHeight; + var rect = _this.menu.getBoundingClientRect(); + menuStyles.left = x - rect.width; + if (y + rect.height > innerHeight) { + menuStyles.top -= rect.height; + } + if (menuStyles.left < 0) { + menuStyles.left += rect.width; + } + if (menuStyles.top < 0) { + menuStyles.top = rect.height < innerHeight ? (innerHeight - rect.height) / 2 : 0; + } + if (menuStyles.left + rect.width > innerWidth) { + menuStyles.left = rect.width < innerWidth ? (innerWidth - rect.width) / 2 : 0; + } + return menuStyles; + }); + _defineProperty(_assertThisInitialized(_this), "menuRef", function(c) { + _this.menu = c; + }); + _this.state = (0, _objectAssign["default"])({}, _this.state, { + x: 0, + y: 0, + isVisible: false + }); + return _this; + } + _createClass(ContextMenu2, [{ + key: "getSubMenuType", + value: function getSubMenuType() { + return _SubMenu["default"]; + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + this.listenId = _globalEventListener["default"].register(this.handleShow, this.handleHide); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate() { + var _this2 = this; + var wrapper = window.requestAnimationFrame || setTimeout; + if (this.state.isVisible) { + wrapper(function() { + var _this2$state = _this2.state, x = _this2$state.x, y = _this2$state.y; + var _ref = _this2.props.rtl ? _this2.getRTLMenuPosition(x, y) : _this2.getMenuPosition(x, y), top = _ref.top, left = _ref.left; + wrapper(function() { + if (!_this2.menu) + return; + _this2.menu.style.top = "".concat(top, "px"); + _this2.menu.style.left = "".concat(left, "px"); + _this2.menu.style.opacity = 1; + _this2.menu.style.pointerEvents = "auto"; + }); + }); + } else { + wrapper(function() { + if (!_this2.menu) + return; + _this2.menu.style.opacity = 0; + _this2.menu.style.pointerEvents = "none"; + }); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this.listenId) { + _globalEventListener["default"].unregister(this.listenId); + } + this.unregisterHandlers(); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, children = _this$props.children, className2 = _this$props.className, style7 = _this$props.style; + var isVisible = this.state.isVisible; + var inlineStyle = (0, _objectAssign["default"])({}, style7, { + position: "fixed", + opacity: 0, + pointerEvents: "none" + }); + var menuClassnames = (0, _classnames["default"])(_helpers.cssClasses.menu, className2, _defineProperty({}, _helpers.cssClasses.menuVisible, isVisible)); + return _react["default"].createElement("nav", { + role: "menu", + tabIndex: "-1", + ref: this.menuRef, + style: inlineStyle, + className: menuClassnames, + onContextMenu: this.handleContextMenu, + onMouseLeave: this.handleMouseLeave + }, this.renderChildren(children)); + } + }]); + return ContextMenu2; + }(_AbstractMenu2["default"]); + exports2["default"] = ContextMenu; + _defineProperty(ContextMenu, "propTypes", { + id: _propTypes["default"].string.isRequired, + children: _propTypes["default"].node.isRequired, + data: _propTypes["default"].object, + className: _propTypes["default"].string, + hideOnLeave: _propTypes["default"].bool, + rtl: _propTypes["default"].bool, + onHide: _propTypes["default"].func, + onMouseLeave: _propTypes["default"].func, + onShow: _propTypes["default"].func, + preventHideOnContextMenu: _propTypes["default"].bool, + preventHideOnResize: _propTypes["default"].bool, + preventHideOnScroll: _propTypes["default"].bool, + style: _propTypes["default"].object + }); + _defineProperty(ContextMenu, "defaultProps", { + className: "", + data: {}, + hideOnLeave: false, + rtl: false, + onHide: function onHide() { + return null; + }, + onMouseLeave: function onMouseLeave() { + return null; + }, + onShow: function onShow() { + return null; + }, + preventHideOnContextMenu: false, + preventHideOnResize: false, + preventHideOnScroll: false, + style: {} + }); + }, + "../../../../node_modules/react-contextmenu/es6/ContextMenuTrigger.js": (__unused_webpack_module, exports2, __webpack_require__2) => { + /*!****************************************************************************!*\ + !*** ../../../../node_modules/react-contextmenu/es6/ContextMenuTrigger.js ***! + \****************************************************************************/ + function _typeof(obj) { + "@babel/helpers - typeof"; + return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof(obj); + } + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2["default"] = undefined; + var _react = _interopRequireWildcard(__webpack_require__2("../../../../node_modules/react/index.js")); + /*! react */ + var _propTypes = _interopRequireDefault(__webpack_require__2("../../../../node_modules/prop-types/index.js")); + /*! prop-types */ + var _classnames = _interopRequireDefault(__webpack_require__2("../../../../node_modules/classnames/index.js")); + /*! classnames */ + var _objectAssign = _interopRequireDefault(__webpack_require__2("../../../../node_modules/object-assign/index.js")); + /*! object-assign */ + var _actions = __webpack_require__2("../../../../node_modules/react-contextmenu/es6/actions.js"); + /*! ./actions */ + var _helpers = __webpack_require__2("../../../../node_modules/react-contextmenu/es6/helpers.js"); + /*! ./helpers */ + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") + return null; + var cacheBabelInterop = new WeakMap; + var cacheNodeInterop = new WeakMap; + return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop2) { + return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { + return { default: obj }; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj["default"] = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0;i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); + Object.defineProperty(subClass, "prototype", { writable: false }); + if (superClass) + _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o2, p2) { + o2.__proto__ = p2; + return o2; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); + return function _createSuperInternal() { + var Super = _getPrototypeOf(Derived), result; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self2, call) { + if (call && (_typeof(call) === "object" || typeof call === "function")) { + return call; + } else if (call !== undefined) { + throw new TypeError("Derived constructors may only return object or undefined"); + } + return _assertThisInitialized(self2); + } + function _assertThisInitialized(self2) { + if (self2 === undefined) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self2; + } + function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e) { + return false; + } + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o2) { + return o2.__proto__ || Object.getPrototypeOf(o2); + }; + return _getPrototypeOf(o); + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + var ContextMenuTrigger = function(_Component) { + _inherits(ContextMenuTrigger2, _Component); + var _super = _createSuper(ContextMenuTrigger2); + function ContextMenuTrigger2() { + var _this; + _classCallCheck(this, ContextMenuTrigger2); + for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _super.call.apply(_super, [this].concat(args)); + _defineProperty(_assertThisInitialized(_this), "touchHandled", false); + _defineProperty(_assertThisInitialized(_this), "handleMouseDown", function(event) { + if (_this.props.holdToDisplay >= 0 && event.button === 0) { + event.persist(); + event.stopPropagation(); + _this.mouseDownTimeoutId = setTimeout(function() { + return _this.handleContextClick(event); + }, _this.props.holdToDisplay); + } + (0, _helpers.callIfExists)(_this.props.attributes.onMouseDown, event); + }); + _defineProperty(_assertThisInitialized(_this), "handleMouseUp", function(event) { + if (event.button === 0) { + clearTimeout(_this.mouseDownTimeoutId); + } + (0, _helpers.callIfExists)(_this.props.attributes.onMouseUp, event); + }); + _defineProperty(_assertThisInitialized(_this), "handleMouseOut", function(event) { + if (event.button === 0) { + clearTimeout(_this.mouseDownTimeoutId); + } + (0, _helpers.callIfExists)(_this.props.attributes.onMouseOut, event); + }); + _defineProperty(_assertThisInitialized(_this), "handleTouchstart", function(event) { + _this.touchHandled = false; + if (_this.props.holdToDisplay >= 0) { + event.persist(); + event.stopPropagation(); + _this.touchstartTimeoutId = setTimeout(function() { + _this.handleContextClick(event); + _this.touchHandled = true; + }, _this.props.holdToDisplay); + } + (0, _helpers.callIfExists)(_this.props.attributes.onTouchStart, event); + }); + _defineProperty(_assertThisInitialized(_this), "handleTouchEnd", function(event) { + if (_this.touchHandled) { + event.preventDefault(); + } + clearTimeout(_this.touchstartTimeoutId); + (0, _helpers.callIfExists)(_this.props.attributes.onTouchEnd, event); + }); + _defineProperty(_assertThisInitialized(_this), "handleContextMenu", function(event) { + if (event.button === _this.props.mouseButton) { + _this.handleContextClick(event); + } + (0, _helpers.callIfExists)(_this.props.attributes.onContextMenu, event); + }); + _defineProperty(_assertThisInitialized(_this), "handleMouseClick", function(event) { + if (event.button === _this.props.mouseButton) { + _this.handleContextClick(event); + } + (0, _helpers.callIfExists)(_this.props.attributes.onClick, event); + }); + _defineProperty(_assertThisInitialized(_this), "handleContextClick", function(event) { + if (_this.props.disable) + return; + if (_this.props.disableIfShiftIsPressed && event.shiftKey) + return; + event.preventDefault(); + event.stopPropagation(); + var x = event.clientX || event.touches && event.touches[0].pageX; + var y = event.clientY || event.touches && event.touches[0].pageY; + if (_this.props.posX) { + x -= _this.props.posX; + } + if (_this.props.posY) { + y -= _this.props.posY; + } + (0, _actions.hideMenu)(); + var data = (0, _helpers.callIfExists)(_this.props.collect, _this.props); + var showMenuConfig = { + position: { + x, + y + }, + target: _this.elem, + id: _this.props.id + }; + if (data && typeof data.then === "function") { + data.then(function(resp) { + showMenuConfig.data = (0, _objectAssign["default"])({}, resp, { + target: event.target + }); + (0, _actions.showMenu)(showMenuConfig); + }); + } else { + showMenuConfig.data = (0, _objectAssign["default"])({}, data, { + target: event.target + }); + (0, _actions.showMenu)(showMenuConfig); + } + }); + _defineProperty(_assertThisInitialized(_this), "elemRef", function(c) { + _this.elem = c; + }); + return _this; + } + _createClass(ContextMenuTrigger2, [{ + key: "render", + value: function render() { + var _this$props = this.props, renderTag = _this$props.renderTag, attributes = _this$props.attributes, children = _this$props.children; + var newAttrs = (0, _objectAssign["default"])({}, attributes, { + className: (0, _classnames["default"])(_helpers.cssClasses.menuWrapper, attributes.className), + onContextMenu: this.handleContextMenu, + onClick: this.handleMouseClick, + onMouseDown: this.handleMouseDown, + onMouseUp: this.handleMouseUp, + onTouchStart: this.handleTouchstart, + onTouchEnd: this.handleTouchEnd, + onMouseOut: this.handleMouseOut, + ref: this.elemRef + }); + return _react["default"].createElement(renderTag, newAttrs, children); + } + }]); + return ContextMenuTrigger2; + }(_react.Component); + exports2["default"] = ContextMenuTrigger; + _defineProperty(ContextMenuTrigger, "propTypes", { + id: _propTypes["default"].string.isRequired, + children: _propTypes["default"].node.isRequired, + attributes: _propTypes["default"].object, + collect: _propTypes["default"].func, + disable: _propTypes["default"].bool, + holdToDisplay: _propTypes["default"].number, + posX: _propTypes["default"].number, + posY: _propTypes["default"].number, + renderTag: _propTypes["default"].elementType, + mouseButton: _propTypes["default"].number, + disableIfShiftIsPressed: _propTypes["default"].bool + }); + _defineProperty(ContextMenuTrigger, "defaultProps", { + attributes: {}, + collect: function collect() { + return null; + }, + disable: false, + holdToDisplay: 1000, + renderTag: "div", + posX: 0, + posY: 0, + mouseButton: 2, + disableIfShiftIsPressed: false + }); + }, + "../../../../node_modules/react-contextmenu/es6/MenuItem.js": (__unused_webpack_module, exports2, __webpack_require__2) => { + /*!******************************************************************!*\ + !*** ../../../../node_modules/react-contextmenu/es6/MenuItem.js ***! + \******************************************************************/ + function _typeof(obj) { + "@babel/helpers - typeof"; + return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof(obj); + } + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2["default"] = undefined; + var _react = _interopRequireWildcard(__webpack_require__2("../../../../node_modules/react/index.js")); + /*! react */ + var _propTypes = _interopRequireDefault(__webpack_require__2("../../../../node_modules/prop-types/index.js")); + /*! prop-types */ + var _classnames = _interopRequireDefault(__webpack_require__2("../../../../node_modules/classnames/index.js")); + /*! classnames */ + var _objectAssign = _interopRequireDefault(__webpack_require__2("../../../../node_modules/object-assign/index.js")); + /*! object-assign */ + var _actions = __webpack_require__2("../../../../node_modules/react-contextmenu/es6/actions.js"); + /*! ./actions */ + var _helpers = __webpack_require__2("../../../../node_modules/react-contextmenu/es6/helpers.js"); + /*! ./helpers */ + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") + return null; + var cacheBabelInterop = new WeakMap; + var cacheNodeInterop = new WeakMap; + return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop2) { + return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { + return { default: obj }; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj["default"] = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _extends() { + _extends = Object.assign || function(target) { + for (var i = 1;i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends.apply(this, arguments); + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0;i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); + Object.defineProperty(subClass, "prototype", { writable: false }); + if (superClass) + _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o2, p2) { + o2.__proto__ = p2; + return o2; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); + return function _createSuperInternal() { + var Super = _getPrototypeOf(Derived), result; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self2, call) { + if (call && (_typeof(call) === "object" || typeof call === "function")) { + return call; + } else if (call !== undefined) { + throw new TypeError("Derived constructors may only return object or undefined"); + } + return _assertThisInitialized(self2); + } + function _assertThisInitialized(self2) { + if (self2 === undefined) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self2; + } + function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e) { + return false; + } + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o2) { + return o2.__proto__ || Object.getPrototypeOf(o2); + }; + return _getPrototypeOf(o); + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + var MenuItem = function(_Component) { + _inherits(MenuItem2, _Component); + var _super = _createSuper(MenuItem2); + function MenuItem2() { + var _this; + _classCallCheck(this, MenuItem2); + for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _super.call.apply(_super, [this].concat(args)); + _defineProperty(_assertThisInitialized(_this), "handleClick", function(event) { + if (event.button !== 0 && event.button !== 1) { + event.preventDefault(); + } + if (_this.props.disabled || _this.props.divider) + return; + (0, _helpers.callIfExists)(_this.props.onClick, event, (0, _objectAssign["default"])({}, _this.props.data, _helpers.store.data), _helpers.store.target); + if (_this.props.preventClose) + return; + (0, _actions.hideMenu)(); + }); + return _this; + } + _createClass(MenuItem2, [{ + key: "render", + value: function render() { + var _cx, _this2 = this; + var _this$props = this.props, attributes = _this$props.attributes, children = _this$props.children, className2 = _this$props.className, disabled = _this$props.disabled, divider = _this$props.divider, selected = _this$props.selected; + var menuItemClassNames = (0, _classnames["default"])(className2, _helpers.cssClasses.menuItem, attributes.className, (_cx = {}, _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemDisabled, attributes.disabledClassName), disabled), _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemDivider, attributes.dividerClassName), divider), _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemSelected, attributes.selectedClassName), selected), _cx)); + return _react["default"].createElement("div", _extends({}, attributes, { + className: menuItemClassNames, + role: "menuitem", + tabIndex: "-1", + "aria-disabled": disabled ? "true" : "false", + "aria-orientation": divider ? "horizontal" : null, + ref: function ref(_ref) { + _this2.ref = _ref; + }, + onMouseMove: this.props.onMouseMove, + onMouseLeave: this.props.onMouseLeave, + onTouchEnd: this.handleClick, + onClick: this.handleClick + }), divider ? null : children); + } + }]); + return MenuItem2; + }(_react.Component); + exports2["default"] = MenuItem; + _defineProperty(MenuItem, "propTypes", { + attributes: _propTypes["default"].object, + children: _propTypes["default"].node, + className: _propTypes["default"].string, + data: _propTypes["default"].object, + disabled: _propTypes["default"].bool, + divider: _propTypes["default"].bool, + onClick: _propTypes["default"].func, + onMouseLeave: _propTypes["default"].func, + onMouseMove: _propTypes["default"].func, + preventClose: _propTypes["default"].bool, + selected: _propTypes["default"].bool + }); + _defineProperty(MenuItem, "defaultProps", { + attributes: {}, + children: null, + className: "", + data: {}, + disabled: false, + divider: false, + onClick: function onClick() { + return null; + }, + onMouseMove: function onMouseMove() { + return null; + }, + onMouseLeave: function onMouseLeave() { + return null; + }, + preventClose: false, + selected: false + }); + }, + "../../../../node_modules/react-contextmenu/es6/SubMenu.js": (__unused_webpack_module, exports2, __webpack_require__2) => { + /*!*****************************************************************!*\ + !*** ../../../../node_modules/react-contextmenu/es6/SubMenu.js ***! + \*****************************************************************/ + function _typeof(obj) { + "@babel/helpers - typeof"; + return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof(obj); + } + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2["default"] = undefined; + var _react = _interopRequireDefault(__webpack_require__2("../../../../node_modules/react/index.js")); + /*! react */ + var _propTypes = _interopRequireDefault(__webpack_require__2("../../../../node_modules/prop-types/index.js")); + /*! prop-types */ + var _classnames = _interopRequireDefault(__webpack_require__2("../../../../node_modules/classnames/index.js")); + /*! classnames */ + var _objectAssign = _interopRequireDefault(__webpack_require__2("../../../../node_modules/object-assign/index.js")); + /*! object-assign */ + var _actions = __webpack_require__2("../../../../node_modules/react-contextmenu/es6/actions.js"); + /*! ./actions */ + var _AbstractMenu2 = _interopRequireDefault(__webpack_require__2("../../../../node_modules/react-contextmenu/es6/AbstractMenu.js")); + /*! ./AbstractMenu */ + var _helpers = __webpack_require__2("../../../../node_modules/react-contextmenu/es6/helpers.js"); + /*! ./helpers */ + var _globalEventListener = _interopRequireDefault(__webpack_require__2("../../../../node_modules/react-contextmenu/es6/globalEventListener.js")); + /*! ./globalEventListener */ + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function _extends() { + _extends = Object.assign || function(target) { + for (var i = 1;i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends.apply(this, arguments); + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0;i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); + Object.defineProperty(subClass, "prototype", { writable: false }); + if (superClass) + _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o2, p2) { + o2.__proto__ = p2; + return o2; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); + return function _createSuperInternal() { + var Super = _getPrototypeOf(Derived), result; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self2, call) { + if (call && (_typeof(call) === "object" || typeof call === "function")) { + return call; + } else if (call !== undefined) { + throw new TypeError("Derived constructors may only return object or undefined"); + } + return _assertThisInitialized(self2); + } + function _assertThisInitialized(self2) { + if (self2 === undefined) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self2; + } + function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e) { + return false; + } + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o2) { + return o2.__proto__ || Object.getPrototypeOf(o2); + }; + return _getPrototypeOf(o); + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + var SubMenu = function(_AbstractMenu) { + _inherits(SubMenu2, _AbstractMenu); + var _super = _createSuper(SubMenu2); + function SubMenu2(props) { + var _this; + _classCallCheck(this, SubMenu2); + _this = _super.call(this, props); + _defineProperty(_assertThisInitialized(_this), "getMenuPosition", function() { + var _window = window, innerWidth = _window.innerWidth, innerHeight = _window.innerHeight; + var rect = _this.subMenu.getBoundingClientRect(); + var position3 = {}; + if (rect.bottom > innerHeight) { + position3.bottom = 0; + } else { + position3.top = 0; + } + if (rect.right < innerWidth) { + position3.left = "100%"; + } else { + position3.right = "100%"; + } + return position3; + }); + _defineProperty(_assertThisInitialized(_this), "getRTLMenuPosition", function() { + var _window2 = window, innerHeight = _window2.innerHeight; + var rect = _this.subMenu.getBoundingClientRect(); + var position3 = {}; + if (rect.bottom > innerHeight) { + position3.bottom = 0; + } else { + position3.top = 0; + } + if (rect.left < 0) { + position3.left = "100%"; + } else { + position3.right = "100%"; + } + return position3; + }); + _defineProperty(_assertThisInitialized(_this), "hideMenu", function(e) { + e.preventDefault(); + _this.hideSubMenu(e); + }); + _defineProperty(_assertThisInitialized(_this), "hideSubMenu", function(e) { + if (e.detail && e.detail.id && _this.menu && e.detail.id !== _this.menu.id) { + return; + } + if (_this.props.forceOpen) { + _this.props.forceClose(); + } + _this.setState({ + visible: false, + selectedItem: null + }); + _this.unregisterHandlers(); + }); + _defineProperty(_assertThisInitialized(_this), "handleClick", function(event) { + event.preventDefault(); + if (_this.props.disabled) + return; + (0, _helpers.callIfExists)(_this.props.onClick, event, (0, _objectAssign["default"])({}, _this.props.data, _helpers.store.data), _helpers.store.target); + if (!_this.props.onClick || _this.props.preventCloseOnClick) + return; + (0, _actions.hideMenu)(); + }); + _defineProperty(_assertThisInitialized(_this), "handleMouseEnter", function() { + if (_this.closetimer) + clearTimeout(_this.closetimer); + if (_this.props.disabled || _this.state.visible) + return; + _this.opentimer = setTimeout(function() { + return _this.setState({ + visible: true, + selectedItem: null + }); + }, _this.props.hoverDelay); + }); + _defineProperty(_assertThisInitialized(_this), "handleMouseLeave", function() { + if (_this.opentimer) + clearTimeout(_this.opentimer); + if (!_this.state.visible) + return; + _this.closetimer = setTimeout(function() { + return _this.setState({ + visible: false, + selectedItem: null + }); + }, _this.props.hoverDelay); + }); + _defineProperty(_assertThisInitialized(_this), "menuRef", function(c) { + _this.menu = c; + }); + _defineProperty(_assertThisInitialized(_this), "subMenuRef", function(c) { + _this.subMenu = c; + }); + _defineProperty(_assertThisInitialized(_this), "registerHandlers", function() { + document.removeEventListener("keydown", _this.props.parentKeyNavigationHandler); + document.addEventListener("keydown", _this.handleKeyNavigation); + }); + _defineProperty(_assertThisInitialized(_this), "unregisterHandlers", function(dismounting) { + document.removeEventListener("keydown", _this.handleKeyNavigation); + if (!dismounting) { + document.addEventListener("keydown", _this.props.parentKeyNavigationHandler); + } + }); + _this.state = (0, _objectAssign["default"])({}, _this.state, { + visible: false + }); + return _this; + } + _createClass(SubMenu2, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.listenId = _globalEventListener["default"].register(function() { + }, this.hideSubMenu); + } + }, { + key: "getSubMenuType", + value: function getSubMenuType() { + return SubMenu2; + } + }, { + key: "shouldComponentUpdate", + value: function shouldComponentUpdate(nextProps, nextState) { + this.isVisibilityChange = (this.state.visible !== nextState.visible || this.props.forceOpen !== nextProps.forceOpen) && !(this.state.visible && nextProps.forceOpen) && !(this.props.forceOpen && nextState.visible); + return true; + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate() { + var _this2 = this; + if (!this.isVisibilityChange) + return; + if (this.props.forceOpen || this.state.visible) { + var wrapper = window.requestAnimationFrame || setTimeout; + wrapper(function() { + var styles = _this2.props.rtl ? _this2.getRTLMenuPosition() : _this2.getMenuPosition(); + _this2.subMenu.style.removeProperty("top"); + _this2.subMenu.style.removeProperty("bottom"); + _this2.subMenu.style.removeProperty("left"); + _this2.subMenu.style.removeProperty("right"); + if ((0, _helpers.hasOwnProp)(styles, "top")) + _this2.subMenu.style.top = styles.top; + if ((0, _helpers.hasOwnProp)(styles, "left")) + _this2.subMenu.style.left = styles.left; + if ((0, _helpers.hasOwnProp)(styles, "bottom")) + _this2.subMenu.style.bottom = styles.bottom; + if ((0, _helpers.hasOwnProp)(styles, "right")) + _this2.subMenu.style.right = styles.right; + _this2.subMenu.classList.add(_helpers.cssClasses.menuVisible); + _this2.registerHandlers(); + _this2.setState({ + selectedItem: null + }); + }); + } else { + var cleanup = function cleanup() { + _this2.subMenu.removeEventListener("transitionend", cleanup); + _this2.subMenu.style.removeProperty("bottom"); + _this2.subMenu.style.removeProperty("right"); + _this2.subMenu.style.top = 0; + _this2.subMenu.style.left = "100%"; + _this2.unregisterHandlers(); + }; + this.subMenu.addEventListener("transitionend", cleanup); + this.subMenu.classList.remove(_helpers.cssClasses.menuVisible); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this.listenId) { + _globalEventListener["default"].unregister(this.listenId); + } + if (this.opentimer) + clearTimeout(this.opentimer); + if (this.closetimer) + clearTimeout(this.closetimer); + this.unregisterHandlers(true); + } + }, { + key: "render", + value: function render() { + var _cx; + var _this$props = this.props, children = _this$props.children, attributes = _this$props.attributes, disabled = _this$props.disabled, title = _this$props.title, selected = _this$props.selected; + var visible = this.state.visible; + var menuProps = { + ref: this.menuRef, + onMouseEnter: this.handleMouseEnter, + onMouseLeave: this.handleMouseLeave, + className: (0, _classnames["default"])(_helpers.cssClasses.menuItem, _helpers.cssClasses.subMenu, attributes.listClassName), + style: { + position: "relative" + } + }; + var menuItemProps = { + className: (0, _classnames["default"])(_helpers.cssClasses.menuItem, attributes.className, (_cx = {}, _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemDisabled, attributes.disabledClassName), disabled), _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemActive, attributes.visibleClassName), visible), _defineProperty(_cx, (0, _classnames["default"])(_helpers.cssClasses.menuItemSelected, attributes.selectedClassName), selected), _cx)), + onMouseMove: this.props.onMouseMove, + onMouseOut: this.props.onMouseOut, + onClick: this.handleClick + }; + var subMenuProps = { + ref: this.subMenuRef, + style: { + position: "absolute", + transition: "opacity 1ms", + top: 0, + left: "100%" + }, + className: (0, _classnames["default"])(_helpers.cssClasses.menu, this.props.className) + }; + return _react["default"].createElement("nav", _extends({}, menuProps, { + role: "menuitem", + tabIndex: "-1", + "aria-haspopup": "true" + }), _react["default"].createElement("div", _extends({}, attributes, menuItemProps), title), _react["default"].createElement("nav", _extends({}, subMenuProps, { + role: "menu", + tabIndex: "-1" + }), this.renderChildren(children))); + } + }]); + return SubMenu2; + }(_AbstractMenu2["default"]); + exports2["default"] = SubMenu; + _defineProperty(SubMenu, "propTypes", { + children: _propTypes["default"].node.isRequired, + attributes: _propTypes["default"].object, + title: _propTypes["default"].node.isRequired, + className: _propTypes["default"].string, + disabled: _propTypes["default"].bool, + hoverDelay: _propTypes["default"].number, + rtl: _propTypes["default"].bool, + selected: _propTypes["default"].bool, + onMouseMove: _propTypes["default"].func, + onMouseOut: _propTypes["default"].func, + forceOpen: _propTypes["default"].bool, + forceClose: _propTypes["default"].func, + parentKeyNavigationHandler: _propTypes["default"].func + }); + _defineProperty(SubMenu, "defaultProps", { + disabled: false, + hoverDelay: 500, + attributes: {}, + className: "", + rtl: false, + selected: false, + onMouseMove: function onMouseMove() { + return null; + }, + onMouseOut: function onMouseOut() { + return null; + }, + forceOpen: false, + forceClose: function forceClose() { + return null; + }, + parentKeyNavigationHandler: function parentKeyNavigationHandler() { + return null; + } + }); + }, + "../../../../node_modules/react-contextmenu/es6/actions.js": (__unused_webpack_module, exports2, __webpack_require__2) => { + /*!*****************************************************************!*\ + !*** ../../../../node_modules/react-contextmenu/es6/actions.js ***! + \*****************************************************************/ + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2.MENU_SHOW = exports2.MENU_HIDE = undefined; + exports2.dispatchGlobalEvent = dispatchGlobalEvent; + exports2.hideMenu = hideMenu; + exports2.showMenu = showMenu; + var _objectAssign = _interopRequireDefault(__webpack_require__2("../../../../node_modules/object-assign/index.js")); + /*! object-assign */ + var _helpers = __webpack_require__2("../../../../node_modules/react-contextmenu/es6/helpers.js"); + /*! ./helpers */ + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var MENU_SHOW = "REACT_CONTEXTMENU_SHOW"; + exports2.MENU_SHOW = MENU_SHOW; + var MENU_HIDE = "REACT_CONTEXTMENU_HIDE"; + exports2.MENU_HIDE = MENU_HIDE; + function dispatchGlobalEvent(eventName, opts) { + var target = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : window; + var event; + if (typeof window.CustomEvent === "function") { + event = new window.CustomEvent(eventName, { + detail: opts + }); + } else { + event = document.createEvent("CustomEvent"); + event.initCustomEvent(eventName, false, true, opts); + } + if (target) { + target.dispatchEvent(event); + (0, _objectAssign["default"])(_helpers.store, opts); + } + } + function showMenu() { + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var target = arguments.length > 1 ? arguments[1] : undefined; + dispatchGlobalEvent(MENU_SHOW, (0, _objectAssign["default"])({}, opts, { + type: MENU_SHOW + }), target); + } + function hideMenu() { + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var target = arguments.length > 1 ? arguments[1] : undefined; + dispatchGlobalEvent(MENU_HIDE, (0, _objectAssign["default"])({}, opts, { + type: MENU_HIDE + }), target); + } + }, + "../../../../node_modules/react-contextmenu/es6/connectMenu.js": (__unused_webpack_module, exports2, __webpack_require__2) => { + /*!*********************************************************************!*\ + !*** ../../../../node_modules/react-contextmenu/es6/connectMenu.js ***! + \*********************************************************************/ + function _typeof(obj) { + "@babel/helpers - typeof"; + return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof(obj); + } + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2["default"] = _default; + var _react = _interopRequireWildcard(__webpack_require__2("../../../../node_modules/react/index.js")); + /*! react */ + var _ContextMenuTrigger = _interopRequireDefault(__webpack_require__2("../../../../node_modules/react-contextmenu/es6/ContextMenuTrigger.js")); + /*! ./ContextMenuTrigger */ + var _globalEventListener = _interopRequireDefault(__webpack_require__2("../../../../node_modules/react-contextmenu/es6/globalEventListener.js")); + /*! ./globalEventListener */ + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") + return null; + var cacheBabelInterop = new WeakMap; + var cacheNodeInterop = new WeakMap; + return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop2) { + return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { + return { default: obj }; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj["default"] = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } + function _extends() { + _extends = Object.assign || function(target) { + for (var i = 1;i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends.apply(this, arguments); + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0;i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); + Object.defineProperty(subClass, "prototype", { writable: false }); + if (superClass) + _setPrototypeOf(subClass, superClass); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o2, p2) { + o2.__proto__ = p2; + return o2; + }; + return _setPrototypeOf(o, p); + } + function _createSuper(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); + return function _createSuperInternal() { + var Super = _getPrototypeOf(Derived), result; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + function _possibleConstructorReturn(self2, call) { + if (call && (_typeof(call) === "object" || typeof call === "function")) { + return call; + } else if (call !== undefined) { + throw new TypeError("Derived constructors may only return object or undefined"); + } + return _assertThisInitialized(self2); + } + function _assertThisInitialized(self2) { + if (self2 === undefined) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self2; + } + function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e) { + return false; + } + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o2) { + return o2.__proto__ || Object.getPrototypeOf(o2); + }; + return _getPrototypeOf(o); + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _unsupportedIterableToArray(o, minLen) { + if (!o) + return; + if (typeof o === "string") + return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) + n = o.constructor.name; + if (n === "Map" || n === "Set") + return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) + return _arrayLikeToArray(o, minLen); + } + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) + return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) + return _arrayLikeToArray(arr); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i = 0, arr2 = new Array(len);i < len; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + var ignoredTriggerProps = [].concat(_toConsumableArray(Object.keys(_ContextMenuTrigger["default"].propTypes)), ["children"]); + function _default(menuId) { + return function connect(Child) { + return function(_Component) { + _inherits(ConnectMenu, _Component); + var _super = _createSuper(ConnectMenu); + function ConnectMenu(props) { + var _this; + _classCallCheck(this, ConnectMenu); + _this = _super.call(this, props); + _defineProperty(_assertThisInitialized(_this), "handleShow", function(e) { + if (e.detail.id !== menuId) + return; + var data = e.detail.data; + var filteredData = {}; + for (var key in data) { + if (!ignoredTriggerProps.includes(key)) { + filteredData[key] = data[key]; + } + } + _this.setState({ + trigger: filteredData + }); + }); + _defineProperty(_assertThisInitialized(_this), "handleHide", function() { + _this.setState({ + trigger: null + }); + }); + _this.state = { + trigger: null + }; + return _this; + } + _createClass(ConnectMenu, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.listenId = _globalEventListener["default"].register(this.handleShow, this.handleHide); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this.listenId) { + _globalEventListener["default"].unregister(this.listenId); + } + } + }, { + key: "render", + value: function render() { + return _react["default"].createElement(Child, _extends({}, this.props, { + id: menuId, + trigger: this.state.trigger + })); + } + }]); + return ConnectMenu; + }(_react.Component); + }; + } + }, + "../../../../node_modules/react-contextmenu/es6/globalEventListener.js": (__unused_webpack_module, exports2, __webpack_require__2) => { + /*!*****************************************************************************!*\ + !*** ../../../../node_modules/react-contextmenu/es6/globalEventListener.js ***! + \*****************************************************************************/ + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2["default"] = undefined; + var _actions = __webpack_require__2("../../../../node_modules/react-contextmenu/es6/actions.js"); + /*! ./actions */ + var _helpers = __webpack_require__2("../../../../node_modules/react-contextmenu/es6/helpers.js"); + /*! ./helpers */ + function _defineProperties(target, props) { + for (var i = 0;i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + var GlobalEventListener = _createClass(function GlobalEventListener() { + var _this = this; + _classCallCheck(this, GlobalEventListener); + _defineProperty(this, "handleShowEvent", function(event) { + for (var id in _this.callbacks) { + if ((0, _helpers.hasOwnProp)(_this.callbacks, id)) + _this.callbacks[id].show(event); + } + }); + _defineProperty(this, "handleHideEvent", function(event) { + for (var id in _this.callbacks) { + if ((0, _helpers.hasOwnProp)(_this.callbacks, id)) + _this.callbacks[id].hide(event); + } + }); + _defineProperty(this, "register", function(showCallback, hideCallback) { + var id = (0, _helpers.uniqueId)(); + _this.callbacks[id] = { + show: showCallback, + hide: hideCallback + }; + return id; + }); + _defineProperty(this, "unregister", function(id) { + if (id && _this.callbacks[id]) { + delete _this.callbacks[id]; + } + }); + this.callbacks = {}; + if (_helpers.canUseDOM) { + window.addEventListener(_actions.MENU_SHOW, this.handleShowEvent); + window.addEventListener(_actions.MENU_HIDE, this.handleHideEvent); + } + }); + var _default = new GlobalEventListener; + exports2["default"] = _default; + }, + "../../../../node_modules/react-contextmenu/es6/helpers.js": (__unused_webpack_module, exports2) => { + /*!*****************************************************************!*\ + !*** ../../../../node_modules/react-contextmenu/es6/helpers.js ***! + \*****************************************************************/ + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2.callIfExists = callIfExists; + exports2.cssClasses = exports2.canUseDOM = undefined; + exports2.hasOwnProp = hasOwnProp; + exports2.store = undefined; + exports2.uniqueId = uniqueId; + function callIfExists(func) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1;_key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + return typeof func === "function" && func.apply(undefined, args); + } + function hasOwnProp(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + function uniqueId() { + return Math.random().toString(36).substring(7); + } + var cssClasses = { + menu: "react-contextmenu", + menuVisible: "react-contextmenu--visible", + menuWrapper: "react-contextmenu-wrapper", + menuItem: "react-contextmenu-item", + menuItemActive: "react-contextmenu-item--active", + menuItemDisabled: "react-contextmenu-item--disabled", + menuItemDivider: "react-contextmenu-item--divider", + menuItemSelected: "react-contextmenu-item--selected", + subMenu: "react-contextmenu-submenu" + }; + exports2.cssClasses = cssClasses; + var store = {}; + exports2.store = store; + var canUseDOM = Boolean(typeof window !== "undefined" && window.document && window.document.createElement); + exports2.canUseDOM = canUseDOM; + }, + "../../../../node_modules/react-contextmenu/es6/index.js": (__unused_webpack_module, exports2, __webpack_require__2) => { + /*!***************************************************************!*\ + !*** ../../../../node_modules/react-contextmenu/es6/index.js ***! + \***************************************************************/ + Object.defineProperty(exports2, "__esModule", { + value: true + }); + Object.defineProperty(exports2, "ContextMenu", { + enumerable: true, + get: function get() { + return _ContextMenu["default"]; + } + }); + Object.defineProperty(exports2, "ContextMenuTrigger", { + enumerable: true, + get: function get() { + return _ContextMenuTrigger["default"]; + } + }); + Object.defineProperty(exports2, "MenuItem", { + enumerable: true, + get: function get() { + return _MenuItem["default"]; + } + }); + Object.defineProperty(exports2, "SubMenu", { + enumerable: true, + get: function get() { + return _SubMenu["default"]; + } + }); + Object.defineProperty(exports2, "connectMenu", { + enumerable: true, + get: function get() { + return _connectMenu["default"]; + } + }); + Object.defineProperty(exports2, "hideMenu", { + enumerable: true, + get: function get() { + return _actions.hideMenu; + } + }); + Object.defineProperty(exports2, "showMenu", { + enumerable: true, + get: function get() { + return _actions.showMenu; + } + }); + var _ContextMenu = _interopRequireDefault(__webpack_require__2("../../../../node_modules/react-contextmenu/es6/ContextMenu.js")); + /*! ./ContextMenu */ + var _ContextMenuTrigger = _interopRequireDefault(__webpack_require__2("../../../../node_modules/react-contextmenu/es6/ContextMenuTrigger.js")); + /*! ./ContextMenuTrigger */ + var _MenuItem = _interopRequireDefault(__webpack_require__2("../../../../node_modules/react-contextmenu/es6/MenuItem.js")); + /*! ./MenuItem */ + var _SubMenu = _interopRequireDefault(__webpack_require__2("../../../../node_modules/react-contextmenu/es6/SubMenu.js")); + /*! ./SubMenu */ + var _connectMenu = _interopRequireDefault(__webpack_require__2("../../../../node_modules/react-contextmenu/es6/connectMenu.js")); + /*! ./connectMenu */ + var _actions = __webpack_require__2("../../../../node_modules/react-contextmenu/es6/actions.js"); + /*! ./actions */ + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + }, + "../../../../node_modules/react-dom/cjs/react-dom.development.js": (__unused_webpack_module, exports2, __webpack_require__2) => { + /*!***********************************************************************!*\ + !*** ../../../../node_modules/react-dom/cjs/react-dom.development.js ***! + \***********************************************************************/ + if (true) { + (function() { + var React = __webpack_require__2("../../../../node_modules/react/index.js"); + /*! react */ + var _assign = __webpack_require__2("../../../../node_modules/object-assign/index.js"); + /*! object-assign */ + var Scheduler = __webpack_require__2("../../../../node_modules/scheduler/index.js"); + /*! scheduler */ + var tracing = __webpack_require__2("../../../../node_modules/scheduler/tracing.js"); + /*! scheduler/tracing */ + var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + function warn(format) { + { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1;_key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + printWarning("warn", format, args); + } + } + function error7(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + printWarning("error", format, args); + } + } + function printWarning(level, format, args) { + { + var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame2.getStackAddendum(); + if (stack !== "") { + format += "%s"; + args = args.concat([stack]); + } + var argsWithFormat = args.map(function(item) { + return "" + item; + }); + argsWithFormat.unshift("Warning: " + format); + Function.prototype.apply.call(console[level], console, argsWithFormat); + } + } + if (!React) { + { + throw Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM."); + } + } + var FunctionComponent = 0; + var ClassComponent = 1; + var IndeterminateComponent = 2; + var HostRoot = 3; + var HostPortal = 4; + var HostComponent = 5; + var HostText = 6; + var Fragment2 = 7; + var Mode = 8; + var ContextConsumer = 9; + var ContextProvider = 10; + var ForwardRef = 11; + var Profiler = 12; + var SuspenseComponent = 13; + var MemoComponent = 14; + var SimpleMemoComponent = 15; + var LazyComponent = 16; + var IncompleteClassComponent = 17; + var DehydratedFragment = 18; + var SuspenseListComponent = 19; + var FundamentalComponent = 20; + var ScopeComponent = 21; + var Block = 22; + var OffscreenComponent = 23; + var LegacyHiddenComponent = 24; + var enableProfilerTimer = true; + var enableFundamentalAPI = false; + var enableNewReconciler = false; + var warnAboutStringRefs = false; + var allNativeEvents = new Set; + var registrationNameDependencies = {}; + var possibleRegistrationNames = {}; + function registerTwoPhaseEvent(registrationName, dependencies) { + registerDirectEvent(registrationName, dependencies); + registerDirectEvent(registrationName + "Capture", dependencies); + } + function registerDirectEvent(registrationName, dependencies) { + { + if (registrationNameDependencies[registrationName]) { + error7("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", registrationName); + } + } + registrationNameDependencies[registrationName] = dependencies; + { + var lowerCasedName = registrationName.toLowerCase(); + possibleRegistrationNames[lowerCasedName] = registrationName; + if (registrationName === "onDoubleClick") { + possibleRegistrationNames.ondblclick = registrationName; + } + } + for (var i = 0;i < dependencies.length; i++) { + allNativeEvents.add(dependencies[i]); + } + } + var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"); + var RESERVED = 0; + var STRING = 1; + var BOOLEANISH_STRING = 2; + var BOOLEAN = 3; + var OVERLOADED_BOOLEAN = 4; + var NUMERIC = 5; + var POSITIVE_NUMERIC = 6; + var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; + var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; + var ROOT_ATTRIBUTE_NAME = "data-reactroot"; + var VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$"); + var hasOwnProperty = Object.prototype.hasOwnProperty; + var illegalAttributeNameCache = {}; + var validatedAttributeNameCache = {}; + function isAttributeNameSafe(attributeName) { + if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { + return true; + } + if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { + return false; + } + if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { + validatedAttributeNameCache[attributeName] = true; + return true; + } + illegalAttributeNameCache[attributeName] = true; + { + error7("Invalid attribute name: `%s`", attributeName); + } + return false; + } + function shouldIgnoreAttribute(name356, propertyInfo, isCustomComponentTag) { + if (propertyInfo !== null) { + return propertyInfo.type === RESERVED; + } + if (isCustomComponentTag) { + return false; + } + if (name356.length > 2 && (name356[0] === "o" || name356[0] === "O") && (name356[1] === "n" || name356[1] === "N")) { + return true; + } + return false; + } + function shouldRemoveAttributeWithWarning(name356, value, propertyInfo, isCustomComponentTag) { + if (propertyInfo !== null && propertyInfo.type === RESERVED) { + return false; + } + switch (typeof value) { + case "function": + case "symbol": + return true; + case "boolean": { + if (isCustomComponentTag) { + return false; + } + if (propertyInfo !== null) { + return !propertyInfo.acceptsBooleans; + } else { + var prefix2 = name356.toLowerCase().slice(0, 5); + return prefix2 !== "data-" && prefix2 !== "aria-"; + } + } + default: + return false; + } + } + function shouldRemoveAttribute(name356, value, propertyInfo, isCustomComponentTag) { + if (value === null || typeof value === "undefined") { + return true; + } + if (shouldRemoveAttributeWithWarning(name356, value, propertyInfo, isCustomComponentTag)) { + return true; + } + if (isCustomComponentTag) { + return false; + } + if (propertyInfo !== null) { + switch (propertyInfo.type) { + case BOOLEAN: + return !value; + case OVERLOADED_BOOLEAN: + return value === false; + case NUMERIC: + return isNaN(value); + case POSITIVE_NUMERIC: + return isNaN(value) || value < 1; + } + } + return false; + } + function getPropertyInfo(name356) { + return properties.hasOwnProperty(name356) ? properties[name356] : null; + } + function PropertyInfoRecord(name356, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL2, removeEmptyString) { + this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; + this.attributeName = attributeName; + this.attributeNamespace = attributeNamespace; + this.mustUseProperty = mustUseProperty; + this.propertyName = name356; + this.type = type; + this.sanitizeURL = sanitizeURL2; + this.removeEmptyString = removeEmptyString; + } + var properties = {}; + var reservedProps = [ + "children", + "dangerouslySetInnerHTML", + "defaultValue", + "defaultChecked", + "innerHTML", + "suppressContentEditableWarning", + "suppressHydrationWarning", + "style" + ]; + reservedProps.forEach(function(name356) { + properties[name356] = new PropertyInfoRecord(name356, RESERVED, false, name356, null, false, false); + }); + [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(_ref) { + var name356 = _ref[0], attributeName = _ref[1]; + properties[name356] = new PropertyInfoRecord(name356, STRING, false, attributeName, null, false, false); + }); + ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(name356) { + properties[name356] = new PropertyInfoRecord(name356, BOOLEANISH_STRING, false, name356.toLowerCase(), null, false, false); + }); + ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(name356) { + properties[name356] = new PropertyInfoRecord(name356, BOOLEANISH_STRING, false, name356, null, false, false); + }); + [ + "allowFullScreen", + "async", + "autoFocus", + "autoPlay", + "controls", + "default", + "defer", + "disabled", + "disablePictureInPicture", + "disableRemotePlayback", + "formNoValidate", + "hidden", + "loop", + "noModule", + "noValidate", + "open", + "playsInline", + "readOnly", + "required", + "reversed", + "scoped", + "seamless", + "itemScope" + ].forEach(function(name356) { + properties[name356] = new PropertyInfoRecord(name356, BOOLEAN, false, name356.toLowerCase(), null, false, false); + }); + [ + "checked", + "multiple", + "muted", + "selected" + ].forEach(function(name356) { + properties[name356] = new PropertyInfoRecord(name356, BOOLEAN, true, name356, null, false, false); + }); + [ + "capture", + "download" + ].forEach(function(name356) { + properties[name356] = new PropertyInfoRecord(name356, OVERLOADED_BOOLEAN, false, name356, null, false, false); + }); + [ + "cols", + "rows", + "size", + "span" + ].forEach(function(name356) { + properties[name356] = new PropertyInfoRecord(name356, POSITIVE_NUMERIC, false, name356, null, false, false); + }); + ["rowSpan", "start"].forEach(function(name356) { + properties[name356] = new PropertyInfoRecord(name356, NUMERIC, false, name356.toLowerCase(), null, false, false); + }); + var CAMELIZE = /[\-\:]([a-z])/g; + var capitalize = function(token) { + return token[1].toUpperCase(); + }; + [ + "accent-height", + "alignment-baseline", + "arabic-form", + "baseline-shift", + "cap-height", + "clip-path", + "clip-rule", + "color-interpolation", + "color-interpolation-filters", + "color-profile", + "color-rendering", + "dominant-baseline", + "enable-background", + "fill-opacity", + "fill-rule", + "flood-color", + "flood-opacity", + "font-family", + "font-size", + "font-size-adjust", + "font-stretch", + "font-style", + "font-variant", + "font-weight", + "glyph-name", + "glyph-orientation-horizontal", + "glyph-orientation-vertical", + "horiz-adv-x", + "horiz-origin-x", + "image-rendering", + "letter-spacing", + "lighting-color", + "marker-end", + "marker-mid", + "marker-start", + "overline-position", + "overline-thickness", + "paint-order", + "panose-1", + "pointer-events", + "rendering-intent", + "shape-rendering", + "stop-color", + "stop-opacity", + "strikethrough-position", + "strikethrough-thickness", + "stroke-dasharray", + "stroke-dashoffset", + "stroke-linecap", + "stroke-linejoin", + "stroke-miterlimit", + "stroke-opacity", + "stroke-width", + "text-anchor", + "text-decoration", + "text-rendering", + "underline-position", + "underline-thickness", + "unicode-bidi", + "unicode-range", + "units-per-em", + "v-alphabetic", + "v-hanging", + "v-ideographic", + "v-mathematical", + "vector-effect", + "vert-adv-y", + "vert-origin-x", + "vert-origin-y", + "word-spacing", + "writing-mode", + "xmlns:xlink", + "x-height" + ].forEach(function(attributeName) { + var name356 = attributeName.replace(CAMELIZE, capitalize); + properties[name356] = new PropertyInfoRecord(name356, STRING, false, attributeName, null, false, false); + }); + [ + "xlink:actuate", + "xlink:arcrole", + "xlink:role", + "xlink:show", + "xlink:title", + "xlink:type" + ].forEach(function(attributeName) { + var name356 = attributeName.replace(CAMELIZE, capitalize); + properties[name356] = new PropertyInfoRecord(name356, STRING, false, attributeName, "http://www.w3.org/1999/xlink", false, false); + }); + [ + "xml:base", + "xml:lang", + "xml:space" + ].forEach(function(attributeName) { + var name356 = attributeName.replace(CAMELIZE, capitalize); + properties[name356] = new PropertyInfoRecord(name356, STRING, false, attributeName, "http://www.w3.org/XML/1998/namespace", false, false); + }); + ["tabIndex", "crossOrigin"].forEach(function(attributeName) { + properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, attributeName.toLowerCase(), null, false, false); + }); + var xlinkHref = "xlinkHref"; + properties[xlinkHref] = new PropertyInfoRecord("xlinkHref", STRING, false, "xlink:href", "http://www.w3.org/1999/xlink", true, false); + ["src", "href", "action", "formAction"].forEach(function(attributeName) { + properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, attributeName.toLowerCase(), null, true, true); + }); + var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i; + var didWarn = false; + function sanitizeURL(url) { + { + if (!didWarn && isJavaScriptProtocol.test(url)) { + didWarn = true; + error7("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(url)); + } + } + } + function getValueForProperty(node30, name356, expected, propertyInfo) { + { + if (propertyInfo.mustUseProperty) { + var propertyName = propertyInfo.propertyName; + return node30[propertyName]; + } else { + if (propertyInfo.sanitizeURL) { + sanitizeURL("" + expected); + } + var attributeName = propertyInfo.attributeName; + var stringValue = null; + if (propertyInfo.type === OVERLOADED_BOOLEAN) { + if (node30.hasAttribute(attributeName)) { + var value = node30.getAttribute(attributeName); + if (value === "") { + return true; + } + if (shouldRemoveAttribute(name356, expected, propertyInfo, false)) { + return value; + } + if (value === "" + expected) { + return expected; + } + return value; + } + } else if (node30.hasAttribute(attributeName)) { + if (shouldRemoveAttribute(name356, expected, propertyInfo, false)) { + return node30.getAttribute(attributeName); + } + if (propertyInfo.type === BOOLEAN) { + return expected; + } + stringValue = node30.getAttribute(attributeName); + } + if (shouldRemoveAttribute(name356, expected, propertyInfo, false)) { + return stringValue === null ? expected : stringValue; + } else if (stringValue === "" + expected) { + return expected; + } else { + return stringValue; + } + } + } + } + function getValueForAttribute(node30, name356, expected) { + { + if (!isAttributeNameSafe(name356)) { + return; + } + if (isOpaqueHydratingObject(expected)) { + return expected; + } + if (!node30.hasAttribute(name356)) { + return expected === undefined ? undefined : null; + } + var value = node30.getAttribute(name356); + if (value === "" + expected) { + return expected; + } + return value; + } + } + function setValueForProperty(node30, name356, value, isCustomComponentTag) { + var propertyInfo = getPropertyInfo(name356); + if (shouldIgnoreAttribute(name356, propertyInfo, isCustomComponentTag)) { + return; + } + if (shouldRemoveAttribute(name356, value, propertyInfo, isCustomComponentTag)) { + value = null; + } + if (isCustomComponentTag || propertyInfo === null) { + if (isAttributeNameSafe(name356)) { + var _attributeName = name356; + if (value === null) { + node30.removeAttribute(_attributeName); + } else { + node30.setAttribute(_attributeName, "" + value); + } + } + return; + } + var mustUseProperty = propertyInfo.mustUseProperty; + if (mustUseProperty) { + var propertyName = propertyInfo.propertyName; + if (value === null) { + var type = propertyInfo.type; + node30[propertyName] = type === BOOLEAN ? false : ""; + } else { + node30[propertyName] = value; + } + return; + } + var { attributeName, attributeNamespace } = propertyInfo; + if (value === null) { + node30.removeAttribute(attributeName); + } else { + var _type = propertyInfo.type; + var attributeValue; + if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) { + attributeValue = ""; + } else { + { + attributeValue = "" + value; + } + if (propertyInfo.sanitizeURL) { + sanitizeURL(attributeValue.toString()); + } + } + if (attributeNamespace) { + node30.setAttributeNS(attributeNamespace, attributeName, attributeValue); + } else { + node30.setAttribute(attributeName, attributeValue); + } + } + } + var REACT_ELEMENT_TYPE = 60103; + var REACT_PORTAL_TYPE = 60106; + var REACT_FRAGMENT_TYPE = 60107; + var REACT_STRICT_MODE_TYPE = 60108; + var REACT_PROFILER_TYPE = 60114; + var REACT_PROVIDER_TYPE = 60109; + var REACT_CONTEXT_TYPE = 60110; + var REACT_FORWARD_REF_TYPE = 60112; + var REACT_SUSPENSE_TYPE = 60113; + var REACT_SUSPENSE_LIST_TYPE = 60120; + var REACT_MEMO_TYPE = 60115; + var REACT_LAZY_TYPE = 60116; + var REACT_BLOCK_TYPE = 60121; + var REACT_SERVER_BLOCK_TYPE = 60122; + var REACT_FUNDAMENTAL_TYPE = 60117; + var REACT_SCOPE_TYPE = 60119; + var REACT_OPAQUE_ID_TYPE = 60128; + var REACT_DEBUG_TRACING_MODE_TYPE = 60129; + var REACT_OFFSCREEN_TYPE = 60130; + var REACT_LEGACY_HIDDEN_TYPE = 60131; + if (typeof Symbol === "function" && Symbol.for) { + var symbolFor = Symbol.for; + REACT_ELEMENT_TYPE = symbolFor("react.element"); + REACT_PORTAL_TYPE = symbolFor("react.portal"); + REACT_FRAGMENT_TYPE = symbolFor("react.fragment"); + REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode"); + REACT_PROFILER_TYPE = symbolFor("react.profiler"); + REACT_PROVIDER_TYPE = symbolFor("react.provider"); + REACT_CONTEXT_TYPE = symbolFor("react.context"); + REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref"); + REACT_SUSPENSE_TYPE = symbolFor("react.suspense"); + REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list"); + REACT_MEMO_TYPE = symbolFor("react.memo"); + REACT_LAZY_TYPE = symbolFor("react.lazy"); + REACT_BLOCK_TYPE = symbolFor("react.block"); + REACT_SERVER_BLOCK_TYPE = symbolFor("react.server.block"); + REACT_FUNDAMENTAL_TYPE = symbolFor("react.fundamental"); + REACT_SCOPE_TYPE = symbolFor("react.scope"); + REACT_OPAQUE_ID_TYPE = symbolFor("react.opaque.id"); + REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode"); + REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen"); + REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden"); + } + var MAYBE_ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = "@@iterator"; + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== "object") { + return null; + } + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + if (typeof maybeIterator === "function") { + return maybeIterator; + } + return null; + } + var disabledDepth = 0; + var prevLog; + var prevInfo; + var prevWarn; + var prevError; + var prevGroup; + var prevGroupCollapsed; + var prevGroupEnd; + function disabledLog() { + } + disabledLog.__reactDisabledLog = true; + function disableLogs() { + { + if (disabledDepth === 0) { + prevLog = console.log; + prevInfo = console.info; + prevWarn = console.warn; + prevError = console.error; + prevGroup = console.group; + prevGroupCollapsed = console.groupCollapsed; + prevGroupEnd = console.groupEnd; + var props = { + configurable: true, + enumerable: true, + value: disabledLog, + writable: true + }; + Object.defineProperties(console, { + info: props, + log: props, + warn: props, + error: props, + group: props, + groupCollapsed: props, + groupEnd: props + }); + } + disabledDepth++; + } + } + function reenableLogs() { + { + disabledDepth--; + if (disabledDepth === 0) { + var props = { + configurable: true, + enumerable: true, + writable: true + }; + Object.defineProperties(console, { + log: _assign({}, props, { + value: prevLog + }), + info: _assign({}, props, { + value: prevInfo + }), + warn: _assign({}, props, { + value: prevWarn + }), + error: _assign({}, props, { + value: prevError + }), + group: _assign({}, props, { + value: prevGroup + }), + groupCollapsed: _assign({}, props, { + value: prevGroupCollapsed + }), + groupEnd: _assign({}, props, { + value: prevGroupEnd + }) + }); + } + if (disabledDepth < 0) { + error7("disabledDepth fell below zero. This is a bug in React. Please file an issue."); + } + } + } + var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; + var prefix; + function describeBuiltInComponentFrame(name356, source, ownerFn) { + { + if (prefix === undefined) { + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = match && match[1] || ""; + } + } + return "\n" + prefix + name356; + } + } + var reentry = false; + var componentFrameCache; + { + var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap; + } + function describeNativeComponentFrame(fn, construct) { + if (!fn || reentry) { + return ""; + } + { + var frame3 = componentFrameCache.get(fn); + if (frame3 !== undefined) { + return frame3; + } + } + var control73; + reentry = true; + var previousPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = undefined; + var previousDispatcher; + { + previousDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = null; + disableLogs(); + } + try { + if (construct) { + var Fake = function() { + throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function() { + throw Error(); + } + }); + if (typeof Reflect === "object" && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + control73 = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x) { + control73 = x; + } + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x) { + control73 = x; + } + fn(); + } + } catch (sample) { + if (sample && control73 && typeof sample.stack === "string") { + var sampleLines = sample.stack.split("\n"); + var controlLines = control73.stack.split("\n"); + var s = sampleLines.length - 1; + var c = controlLines.length - 1; + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + c--; + } + for (;s >= 1 && c >= 0; s--, c--) { + if (sampleLines[s] !== controlLines[c]) { + if (s !== 1 || c !== 1) { + do { + s--; + c--; + if (c < 0 || sampleLines[s] !== controlLines[c]) { + var _frame = "\n" + sampleLines[s].replace(" at new ", " at "); + { + if (typeof fn === "function") { + componentFrameCache.set(fn, _frame); + } + } + return _frame; + } + } while (s >= 1 && c >= 0); + } + break; + } + } + } + } finally { + reentry = false; + { + ReactCurrentDispatcher.current = previousDispatcher; + reenableLogs(); + } + Error.prepareStackTrace = previousPrepareStackTrace; + } + var name356 = fn ? fn.displayName || fn.name : ""; + var syntheticFrame = name356 ? describeBuiltInComponentFrame(name356) : ""; + { + if (typeof fn === "function") { + componentFrameCache.set(fn, syntheticFrame); + } + } + return syntheticFrame; + } + function describeClassComponentFrame(ctor, source, ownerFn) { + { + return describeNativeComponentFrame(ctor, true); + } + } + function describeFunctionComponentFrame(fn, source, ownerFn) { + { + return describeNativeComponentFrame(fn, false); + } + } + function shouldConstruct(Component) { + var prototype = Component.prototype; + return !!(prototype && prototype.isReactComponent); + } + function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { + if (type == null) { + return ""; + } + if (typeof type === "function") { + { + return describeNativeComponentFrame(type, shouldConstruct(type)); + } + } + if (typeof type === "string") { + return describeBuiltInComponentFrame(type); + } + switch (type) { + case REACT_SUSPENSE_TYPE: + return describeBuiltInComponentFrame("Suspense"); + case REACT_SUSPENSE_LIST_TYPE: + return describeBuiltInComponentFrame("SuspenseList"); + } + if (typeof type === "object") { + switch (type.$$typeof) { + case REACT_FORWARD_REF_TYPE: + return describeFunctionComponentFrame(type.render); + case REACT_MEMO_TYPE: + return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); + case REACT_BLOCK_TYPE: + return describeFunctionComponentFrame(type._render); + case REACT_LAZY_TYPE: { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); + } catch (x) { + } + } + } + } + return ""; + } + function describeFiber(fiber) { + var owner = fiber._debugOwner ? fiber._debugOwner.type : null; + var source = fiber._debugSource; + switch (fiber.tag) { + case HostComponent: + return describeBuiltInComponentFrame(fiber.type); + case LazyComponent: + return describeBuiltInComponentFrame("Lazy"); + case SuspenseComponent: + return describeBuiltInComponentFrame("Suspense"); + case SuspenseListComponent: + return describeBuiltInComponentFrame("SuspenseList"); + case FunctionComponent: + case IndeterminateComponent: + case SimpleMemoComponent: + return describeFunctionComponentFrame(fiber.type); + case ForwardRef: + return describeFunctionComponentFrame(fiber.type.render); + case Block: + return describeFunctionComponentFrame(fiber.type._render); + case ClassComponent: + return describeClassComponentFrame(fiber.type); + default: + return ""; + } + } + function getStackByFiberInDevAndProd(workInProgress2) { + try { + var info = ""; + var node30 = workInProgress2; + do { + info += describeFiber(node30); + node30 = node30.return; + } while (node30); + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; + } + } + function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ""; + return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName); + } + function getContextName(type) { + return type.displayName || "Context"; + } + function getComponentName(type) { + if (type == null) { + return null; + } + { + if (typeof type.tag === "number") { + error7("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."); + } + } + if (typeof type === "function") { + return type.displayName || type.name || null; + } + if (typeof type === "string") { + return type; + } + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + } + if (typeof type === "object") { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + var context = type; + return getContextName(context) + ".Consumer"; + case REACT_PROVIDER_TYPE: + var provider = type; + return getContextName(provider._context) + ".Provider"; + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, "ForwardRef"); + case REACT_MEMO_TYPE: + return getComponentName(type.type); + case REACT_BLOCK_TYPE: + return getComponentName(type._render); + case REACT_LAZY_TYPE: { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + return getComponentName(init(payload)); + } catch (x) { + return null; + } + } + } + } + return null; + } + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var current = null; + var isRendering = false; + function getCurrentFiberOwnerNameInDevOrNull() { + { + if (current === null) { + return null; + } + var owner = current._debugOwner; + if (owner !== null && typeof owner !== "undefined") { + return getComponentName(owner.type); + } + } + return null; + } + function getCurrentFiberStackInDev() { + { + if (current === null) { + return ""; + } + return getStackByFiberInDevAndProd(current); + } + } + function resetCurrentFiber() { + { + ReactDebugCurrentFrame.getCurrentStack = null; + current = null; + isRendering = false; + } + } + function setCurrentFiber(fiber) { + { + ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev; + current = fiber; + isRendering = false; + } + } + function setIsRendering(rendering) { + { + isRendering = rendering; + } + } + function getIsRendering() { + { + return isRendering; + } + } + function toString(value) { + return "" + value; + } + function getToStringValue(value) { + switch (typeof value) { + case "boolean": + case "number": + case "object": + case "string": + case "undefined": + return value; + default: + return ""; + } + } + var hasReadOnlyValue = { + button: true, + checkbox: true, + image: true, + hidden: true, + radio: true, + reset: true, + submit: true + }; + function checkControlledValueProps(tagName, props) { + { + if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) { + error7("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."); + } + if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) { + error7("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`."); + } + } + } + function isCheckable(elem) { + var type = elem.type; + var nodeName = elem.nodeName; + return nodeName && nodeName.toLowerCase() === "input" && (type === "checkbox" || type === "radio"); + } + function getTracker(node30) { + return node30._valueTracker; + } + function detachTracker(node30) { + node30._valueTracker = null; + } + function getValueFromNode(node30) { + var value = ""; + if (!node30) { + return value; + } + if (isCheckable(node30)) { + value = node30.checked ? "true" : "false"; + } else { + value = node30.value; + } + return value; + } + function trackValueOnNode(node30) { + var valueField = isCheckable(node30) ? "checked" : "value"; + var descriptor = Object.getOwnPropertyDescriptor(node30.constructor.prototype, valueField); + var currentValue = "" + node30[valueField]; + if (node30.hasOwnProperty(valueField) || typeof descriptor === "undefined" || typeof descriptor.get !== "function" || typeof descriptor.set !== "function") { + return; + } + var { get: get2, set: set2 } = descriptor; + Object.defineProperty(node30, valueField, { + configurable: true, + get: function() { + return get2.call(this); + }, + set: function(value) { + currentValue = "" + value; + set2.call(this, value); + } + }); + Object.defineProperty(node30, valueField, { + enumerable: descriptor.enumerable + }); + var tracker = { + getValue: function() { + return currentValue; + }, + setValue: function(value) { + currentValue = "" + value; + }, + stopTracking: function() { + detachTracker(node30); + delete node30[valueField]; + } + }; + return tracker; + } + function track4(node30) { + if (getTracker(node30)) { + return; + } + node30._valueTracker = trackValueOnNode(node30); + } + function updateValueIfChanged(node30) { + if (!node30) { + return false; + } + var tracker = getTracker(node30); + if (!tracker) { + return true; + } + var lastValue = tracker.getValue(); + var nextValue = getValueFromNode(node30); + if (nextValue !== lastValue) { + tracker.setValue(nextValue); + return true; + } + return false; + } + function getActiveElement(doc) { + doc = doc || (typeof document !== "undefined" ? document : undefined); + if (typeof doc === "undefined") { + return null; + } + try { + return doc.activeElement || doc.body; + } catch (e) { + return doc.body; + } + } + var didWarnValueDefaultValue = false; + var didWarnCheckedDefaultChecked = false; + var didWarnControlledToUncontrolled = false; + var didWarnUncontrolledToControlled = false; + function isControlled(props) { + var usesChecked = props.type === "checkbox" || props.type === "radio"; + return usesChecked ? props.checked != null : props.value != null; + } + function getHostProps(element, props) { + var node30 = element; + var checked = props.checked; + var hostProps = _assign({}, props, { + defaultChecked: undefined, + defaultValue: undefined, + value: undefined, + checked: checked != null ? checked : node30._wrapperState.initialChecked + }); + return hostProps; + } + function initWrapperState(element, props) { + { + checkControlledValueProps("input", props); + if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { + error7("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type); + didWarnCheckedDefaultChecked = true; + } + if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { + error7("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type); + didWarnValueDefaultValue = true; + } + } + var node30 = element; + var defaultValue = props.defaultValue == null ? "" : props.defaultValue; + node30._wrapperState = { + initialChecked: props.checked != null ? props.checked : props.defaultChecked, + initialValue: getToStringValue(props.value != null ? props.value : defaultValue), + controlled: isControlled(props) + }; + } + function updateChecked(element, props) { + var node30 = element; + var checked = props.checked; + if (checked != null) { + setValueForProperty(node30, "checked", checked, false); + } + } + function updateWrapper(element, props) { + var node30 = element; + { + var controlled = isControlled(props); + if (!node30._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { + error7("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"); + didWarnUncontrolledToControlled = true; + } + if (node30._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { + error7("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"); + didWarnControlledToUncontrolled = true; + } + } + updateChecked(element, props); + var value = getToStringValue(props.value); + var type = props.type; + if (value != null) { + if (type === "number") { + if (value === 0 && node30.value === "" || node30.value != value) { + node30.value = toString(value); + } + } else if (node30.value !== toString(value)) { + node30.value = toString(value); + } + } else if (type === "submit" || type === "reset") { + node30.removeAttribute("value"); + return; + } + { + if (props.hasOwnProperty("value")) { + setDefaultValue(node30, props.type, value); + } else if (props.hasOwnProperty("defaultValue")) { + setDefaultValue(node30, props.type, getToStringValue(props.defaultValue)); + } + } + { + if (props.checked == null && props.defaultChecked != null) { + node30.defaultChecked = !!props.defaultChecked; + } + } + } + function postMountWrapper(element, props, isHydrating2) { + var node30 = element; + if (props.hasOwnProperty("value") || props.hasOwnProperty("defaultValue")) { + var type = props.type; + var isButton = type === "submit" || type === "reset"; + if (isButton && (props.value === undefined || props.value === null)) { + return; + } + var initialValue = toString(node30._wrapperState.initialValue); + if (!isHydrating2) { + { + if (initialValue !== node30.value) { + node30.value = initialValue; + } + } + } + { + node30.defaultValue = initialValue; + } + } + var name356 = node30.name; + if (name356 !== "") { + node30.name = ""; + } + { + node30.defaultChecked = !node30.defaultChecked; + node30.defaultChecked = !!node30._wrapperState.initialChecked; + } + if (name356 !== "") { + node30.name = name356; + } + } + function restoreControlledState(element, props) { + var node30 = element; + updateWrapper(node30, props); + updateNamedCousins(node30, props); + } + function updateNamedCousins(rootNode, props) { + var name356 = props.name; + if (props.type === "radio" && name356 != null) { + var queryRoot = rootNode; + while (queryRoot.parentNode) { + queryRoot = queryRoot.parentNode; + } + var group = queryRoot.querySelectorAll("input[name=" + JSON.stringify("" + name356) + '][type="radio"]'); + for (var i = 0;i < group.length; i++) { + var otherNode = group[i]; + if (otherNode === rootNode || otherNode.form !== rootNode.form) { + continue; + } + var otherProps = getFiberCurrentPropsFromNode(otherNode); + if (!otherProps) { + { + throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."); + } + } + updateValueIfChanged(otherNode); + updateWrapper(otherNode, otherProps); + } + } + } + function setDefaultValue(node30, type, value) { + if (type !== "number" || getActiveElement(node30.ownerDocument) !== node30) { + if (value == null) { + node30.defaultValue = toString(node30._wrapperState.initialValue); + } else if (node30.defaultValue !== toString(value)) { + node30.defaultValue = toString(value); + } + } + } + var didWarnSelectedSetOnOption = false; + var didWarnInvalidChild = false; + function flattenChildren(children) { + var content = ""; + React.Children.forEach(children, function(child) { + if (child == null) { + return; + } + content += child; + }); + return content; + } + function validateProps(element, props) { + { + if (typeof props.children === "object" && props.children !== null) { + React.Children.forEach(props.children, function(child) { + if (child == null) { + return; + } + if (typeof child === "string" || typeof child === "number") { + return; + } + if (typeof child.type !== "string") { + return; + } + if (!didWarnInvalidChild) { + didWarnInvalidChild = true; + error7("Only strings and numbers are supported as