4737afe219f7f23fa51af4360273061a93056b4ad91f8e012b3780878f82324f.json 5.6 KB

1
  1. {"ast":null,"code":"const growthFactor = 1.5;\n/**\n * A class acting as a dynamic float32array used in the performance viewer\n */\nexport class DynamicFloat32Array {\n /**\n * Creates a new DynamicFloat32Array with the desired item capacity.\n * @param itemCapacity The initial item capacity you would like to set for the array.\n */\n constructor(itemCapacity) {\n this._view = new Float32Array(itemCapacity);\n this._itemLength = 0;\n }\n /**\n * The number of items currently in the array.\n */\n get itemLength() {\n return this._itemLength;\n }\n /**\n * Gets value at index, NaN if no such index exists.\n * @param index the index to get the value at.\n * @returns the value at the index provided.\n */\n at(index) {\n if (index < 0 || index >= this._itemLength) {\n return NaN;\n }\n return this._view[index];\n }\n /**\n * Gets a view of the original array from start to end (exclusive of end).\n * @param start starting index.\n * @param end ending index.\n * @returns a subarray of the original array.\n */\n subarray(start, end) {\n if (start >= end || start < 0) {\n return new Float32Array(0);\n }\n if (end > this._itemLength) {\n end = this._itemLength;\n }\n return this._view.subarray(start, end);\n }\n /**\n * Pushes items to the end of the array.\n * @param item The item to push into the array.\n */\n push(item) {\n this._view[this._itemLength] = item;\n this._itemLength++;\n if (this._itemLength >= this._view.length) {\n this._growArray();\n }\n }\n /**\n * Grows the array by the growth factor when necessary.\n */\n _growArray() {\n const newCapacity = Math.floor(this._view.length * growthFactor);\n const view = new Float32Array(newCapacity);\n view.set(this._view);\n this._view = view;\n }\n}","map":{"version":3,"names":["growthFactor","DynamicFloat32Array","constructor","itemCapacity","_view","Float32Array","_itemLength","itemLength","at","index","NaN","subarray","start","end","push","item","length","_growArray","newCapacity","Math","floor","view","set"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Misc/PerformanceViewer/dynamicFloat32Array.js"],"sourcesContent":["const growthFactor = 1.5;\n/**\n * A class acting as a dynamic float32array used in the performance viewer\n */\nexport class DynamicFloat32Array {\n /**\n * Creates a new DynamicFloat32Array with the desired item capacity.\n * @param itemCapacity The initial item capacity you would like to set for the array.\n */\n constructor(itemCapacity) {\n this._view = new Float32Array(itemCapacity);\n this._itemLength = 0;\n }\n /**\n * The number of items currently in the array.\n */\n get itemLength() {\n return this._itemLength;\n }\n /**\n * Gets value at index, NaN if no such index exists.\n * @param index the index to get the value at.\n * @returns the value at the index provided.\n */\n at(index) {\n if (index < 0 || index >= this._itemLength) {\n return NaN;\n }\n return this._view[index];\n }\n /**\n * Gets a view of the original array from start to end (exclusive of end).\n * @param start starting index.\n * @param end ending index.\n * @returns a subarray of the original array.\n */\n subarray(start, end) {\n if (start >= end || start < 0) {\n return new Float32Array(0);\n }\n if (end > this._itemLength) {\n end = this._itemLength;\n }\n return this._view.subarray(start, end);\n }\n /**\n * Pushes items to the end of the array.\n * @param item The item to push into the array.\n */\n push(item) {\n this._view[this._itemLength] = item;\n this._itemLength++;\n if (this._itemLength >= this._view.length) {\n this._growArray();\n }\n }\n /**\n * Grows the array by the growth factor when necessary.\n */\n _growArray() {\n const newCapacity = Math.floor(this._view.length * growthFactor);\n const view = new Float32Array(newCapacity);\n view.set(this._view);\n this._view = view;\n }\n}\n"],"mappings":"AAAA,MAAMA,YAAY,GAAG,GAAG;AACxB;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,CAAC;EAC7B;AACJ;AACA;AACA;EACIC,WAAWA,CAACC,YAAY,EAAE;IACtB,IAAI,CAACC,KAAK,GAAG,IAAIC,YAAY,CAACF,YAAY,CAAC;IAC3C,IAAI,CAACG,WAAW,GAAG,CAAC;EACxB;EACA;AACJ;AACA;EACI,IAAIC,UAAUA,CAAA,EAAG;IACb,OAAO,IAAI,CAACD,WAAW;EAC3B;EACA;AACJ;AACA;AACA;AACA;EACIE,EAAEA,CAACC,KAAK,EAAE;IACN,IAAIA,KAAK,GAAG,CAAC,IAAIA,KAAK,IAAI,IAAI,CAACH,WAAW,EAAE;MACxC,OAAOI,GAAG;IACd;IACA,OAAO,IAAI,CAACN,KAAK,CAACK,KAAK,CAAC;EAC5B;EACA;AACJ;AACA;AACA;AACA;AACA;EACIE,QAAQA,CAACC,KAAK,EAAEC,GAAG,EAAE;IACjB,IAAID,KAAK,IAAIC,GAAG,IAAID,KAAK,GAAG,CAAC,EAAE;MAC3B,OAAO,IAAIP,YAAY,CAAC,CAAC,CAAC;IAC9B;IACA,IAAIQ,GAAG,GAAG,IAAI,CAACP,WAAW,EAAE;MACxBO,GAAG,GAAG,IAAI,CAACP,WAAW;IAC1B;IACA,OAAO,IAAI,CAACF,KAAK,CAACO,QAAQ,CAACC,KAAK,EAAEC,GAAG,CAAC;EAC1C;EACA;AACJ;AACA;AACA;EACIC,IAAIA,CAACC,IAAI,EAAE;IACP,IAAI,CAACX,KAAK,CAAC,IAAI,CAACE,WAAW,CAAC,GAAGS,IAAI;IACnC,IAAI,CAACT,WAAW,EAAE;IAClB,IAAI,IAAI,CAACA,WAAW,IAAI,IAAI,CAACF,KAAK,CAACY,MAAM,EAAE;MACvC,IAAI,CAACC,UAAU,CAAC,CAAC;IACrB;EACJ;EACA;AACJ;AACA;EACIA,UAAUA,CAAA,EAAG;IACT,MAAMC,WAAW,GAAGC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAChB,KAAK,CAACY,MAAM,GAAGhB,YAAY,CAAC;IAChE,MAAMqB,IAAI,GAAG,IAAIhB,YAAY,CAACa,WAAW,CAAC;IAC1CG,IAAI,CAACC,GAAG,CAAC,IAAI,CAAClB,KAAK,CAAC;IACpB,IAAI,CAACA,KAAK,GAAGiB,IAAI;EACrB;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}