babylonjs-loaders 8.41.2 → 8.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"babylon.bvhFileLoader.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,cACR,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,oBAAqB,CAAC,aAAcJ,GACjB,iBAAZC,QACdA,QAAQ,qBAAuBD,EAAQG,QAAQ,cAE/CJ,EAAc,QAAIC,EAAQD,EAAc,QACzC,CATD,CASoB,oBAATO,KAAuBA,KAAyB,oBAAXC,OAAyBA,OAASC,MAAQC,G,kCCT1FP,EAAOD,QAAUQ,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaZ,QAGrB,IAAIC,EAASQ,EAAyBE,GAAY,CAGjDX,QAAS,CAAC,GAOX,OAHAc,EAAoBH,GAAUV,EAAQA,EAAOD,QAASU,GAG/CT,EAAOD,OACf,CCrBAU,EAAoBK,EAAI,CAACf,EAASgB,KACjC,IAAI,IAAIC,KAAOD,EACXN,EAAoBQ,EAAEF,EAAYC,KAASP,EAAoBQ,EAAElB,EAASiB,IAC5EE,OAAOC,eAAepB,EAASiB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EP,EAAoBa,EAAI,WACvB,GAA0B,iBAAfC,WAAyB,OAAOA,WAC3C,IACC,OAAOjB,MAAQ,IAAIkB,SAAS,cAAb,EAChB,CAAE,MAAOC,GACR,GAAsB,iBAAXC,OAAqB,OAAOA,MACxC,CACA,CAPuB,GCAxBjB,EAAoBQ,EAAI,CAACU,EAAKC,IAAUV,OAAOW,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFnB,EAAoBuB,EA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AMhI,EAAWsF,EAAQnC,EAAMqC,EAAO,KAAM9H,KAAK2J,iBACjD,OAAOU,QAAQE,QAAQ,CACnBC,OAAQ,GACRC,gBAAiB,GACjBC,UAAW,CAACpI,GACZqI,gBAAiB,GACjBC,eAAgB,GAChBC,WAAY,GACZC,OAAQ,GACRC,eAAgB,IAExB,CAAE,MAAO5J,GAEL,OAAOkJ,QAAQC,OAAOnJ,EAC1B,CACJ,EASO,YAAA6J,UAAP,SAAiBlD,EAAcrC,GAC3B,MAAoB,iBAATA,EAEA4E,QAAQC,OAAO,mCAEtBtK,KAAKkK,eAAezE,GAEb4E,QAAQC,OAAO,wCAInBtK,KAAKmK,gBAAgB,KAAMrC,EAAOrC,GAAMwF,MAAK,WAEpD,GACJ,EASO,YAAAC,wBAAP,SAA+BpD,EAAcrC,GACzC,GAAoB,iBAATA,EAEP,OAAO4E,QAAQC,OAAO,mCAE1B,GAAItK,KAAKkK,eAAezE,GAEpB,OAAO4E,QAAQC,OAAO,wCAE1B,IAAMvC,EAAiB,IAAI,EAAAoD,eAAerD,GAC1C,IACI,IAAMxF,EAAWsF,EAAQnC,EAAMqC,EAAOC,EAAgB/H,KAAK2J,iBAE3D,OADA5B,EAAe2C,UAAUzF,KAAK3C,GACvB+H,QAAQE,QAAQxC,EAC3B,CAAE,MAAO5G,GAEL,OAAOkJ,QAAQC,OAAOnJ,EAC1B,CACJ,EACJ,EAnIA,IAqIA,IAAAiK,2BAA0B,IAAIxB,GCtJ9B,IAAMyB,OAAiC,IAAX,EAAArK,EAAyB,EAAAA,EAA2B,oBAAXI,OAAyBA,YAASd,EACvG,QAA4B,IAAjB+K,EACP,IAAK,IAAM3K,KAAO,EACH2K,EAAcC,QAAQ5K,KACvB2K,EAAcC,QAAQ5K,GAAa,EAASA,ICT9D,U","sources":["webpack://LOADERS/webpack/universalModuleDefinition","webpack://LOADERS/external umd {\"root\":\"BABYLON\",\"commonjs\":\"babylonjs\",\"commonjs2\":\"babylonjs\",\"amd\":\"babylonjs\"}","webpack://LOADERS/webpack/bootstrap","webpack://LOADERS/webpack/runtime/define property getters","webpack://LOADERS/webpack/runtime/global","webpack://LOADERS/webpack/runtime/hasOwnProperty shorthand","webpack://LOADERS/webpack/runtime/make namespace object","webpack://LOADERS/../../../dev/loaders/src/BVH/bvhLoader.ts","webpack://LOADERS/../../../../node_modules/tslib/tslib.es6.mjs","webpack://LOADERS/../../../dev/loaders/src/BVH/bvhFileLoader.metadata.ts","webpack://LOADERS/../../../dev/loaders/src/BVH/bvhFileLoader.ts","webpack://LOADERS/../../../lts/loaders/src/legacy/legacy-bvhFileLoader.ts","webpack://LOADERS/./src/bvhFileLoader.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"babylonjs\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"babylonjs-loaders\", [\"babylonjs\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"babylonjs-loaders\"] = factory(require(\"babylonjs\"));\n\telse\n\t\troot[\"LOADERS\"] = factory(root[\"BABYLON\"]);\n})((typeof self !== \"undefined\" ? self : typeof global !== \"undefined\" ? global : this), (__WEBPACK_EXTERNAL_MODULE__597__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__597__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { IAnimationKey } from \"core/Animations\";\nimport { Animation } from \"core/Animations/animation\";\nimport { Bone } from \"core/Bones/bone\";\nimport { Skeleton } from \"core/Bones/skeleton\";\nimport { Matrix, Quaternion, Vector3 } from \"core/Maths/math.vector\";\nimport type { Scene } from \"core/scene\";\nimport type { Nullable } from \"core/types\";\nimport type { BVHLoadingOptions } from \"./bvhLoadingOptions\";\nimport { Tools } from \"core/Misc/tools\";\nimport type { AssetContainer } from \"core/assetContainer\";\n\nconst _XPosition = \"Xposition\";\nconst _YPosition = \"Yposition\";\nconst _ZPosition = \"Zposition\";\nconst _XRotation = \"Xrotation\";\nconst _YRotation = \"Yrotation\";\nconst _ZRotation = \"Zrotation\";\n\nconst _HierarchyNode = \"HIERARCHY\";\nconst _MotionNode = \"MOTION\";\n\nclass LoaderContext {\n loopMode: number = Animation.ANIMATIONLOOPMODE_CYCLE;\n list: IBVHNode[] = [];\n root: IBVHNode = CreateBVHNode();\n numFrames: number = 0;\n frameRate: number = 0;\n skeleton: Skeleton;\n\n constructor(skeleton: Skeleton) {\n this.skeleton = skeleton;\n }\n}\n\ninterface IBVHNode {\n name: string;\n type: string;\n offset: Vector3;\n channels: string[];\n children: IBVHNode[];\n frames: IBVHKeyFrame[];\n parent: Nullable<IBVHNode>;\n}\n\ninterface IBVHKeyFrame {\n frame: number;\n position: Vector3;\n rotation: Quaternion;\n}\n\nfunction CreateBVHNode(): IBVHNode {\n return {\n name: \"\",\n type: \"\",\n offset: new Vector3(),\n channels: [],\n children: [],\n frames: [],\n parent: null,\n };\n}\n\nfunction CreateBVHKeyFrame(): IBVHKeyFrame {\n return {\n frame: 0,\n position: new Vector3(),\n rotation: new Quaternion(),\n };\n}\n\n/**\n * Converts the BVH node's offset to a Babylon matrix\n * @param node - The BVH node to convert\n * @returns The converted matrix\n */\nfunction BoneOffset(node: IBVHNode): Matrix {\n const x = node.offset.x;\n const y = node.offset.y;\n const z = node.offset.z;\n return Matrix.Translation(x, y, z);\n}\n\n/**\n * Creates animations for the BVH node\n * @param node - The BVH node to create animations for\n * @param context - The loader context\n * @returns The created animations\n */\nfunction CreateAnimations(node: IBVHNode, context: LoaderContext): Animation[] {\n if (node.frames.length === 0) {\n return [];\n }\n\n const animations: Animation[] = [];\n\n // Create position animation if there are position channels\n const hasPosition = node.channels.some((c) => c === _XPosition || c === _YPosition || c === _ZPosition);\n\n // Create rotation animation if there are rotation channels\n const hasRotation = node.channels.some((c) => c === _XRotation || c === _YRotation || c === _ZRotation);\n\n const posAnim = new Animation(`${node.name}_pos`, \"position\", context.frameRate, Animation.ANIMATIONTYPE_VECTOR3, context.loopMode);\n\n const rotAnim = new Animation(`${node.name}_rot`, \"rotationQuaternion\", context.frameRate, Animation.ANIMATIONTYPE_QUATERNION, context.loopMode);\n\n const posKeys: IAnimationKey[] = [];\n const rotKeys: IAnimationKey[] = [];\n\n for (let i = 0; i < node.frames.length; i++) {\n const frame = node.frames[i];\n\n if (hasPosition && frame.position) {\n posKeys.push({\n frame: frame.frame,\n value: frame.position.clone(),\n });\n }\n\n if (hasRotation) {\n rotKeys.push({\n frame: frame.frame,\n value: frame.rotation.clone(),\n });\n }\n }\n\n if (posKeys.length > 0) {\n posAnim.setKeys(posKeys);\n animations.push(posAnim);\n }\n\n if (rotKeys.length > 0) {\n rotAnim.setKeys(rotKeys);\n animations.push(rotAnim);\n }\n\n return animations;\n}\n\n/**\n * Converts a BVH node to a Babylon bone\n * @param node - The BVH node to convert\n * @param parent - The parent bone\n * @param context - The loader context\n */\nfunction ConvertNode(node: IBVHNode, parent: Nullable<Bone>, context: LoaderContext) {\n const matrix = BoneOffset(node);\n const bone = new Bone(node.name, context.skeleton, parent, matrix);\n\n // Create animation for this bone\n const animations = CreateAnimations(node, context);\n for (const animation of animations) {\n if (animation.getKeys() && animation.getKeys().length > 0) {\n bone.animations.push(animation);\n }\n }\n\n for (const child of node.children) {\n ConvertNode(child, bone, context);\n }\n}\n\n/**\n * Recursively reads data from a single frame into the bone hierarchy.\n * The bone hierarchy has to be structured in the same order as the BVH file.\n * keyframe data is stored in bone.frames.\n * @param data - splitted string array (frame values), values are shift()ed\n * @param frameNumber - playback time for this keyframe\n * @param bone - the bone to read frame data from\n * @param tokenIndex - the index of the token to read\n */\nfunction ReadFrameData(data: string[], frameNumber: number, bone: IBVHNode, tokenIndex: { i: number }) {\n if (bone.type === \"ENDSITE\") {\n // end sites have no motion data\n return;\n }\n\n // add keyframe\n const keyframe = CreateBVHKeyFrame();\n keyframe.frame = frameNumber;\n keyframe.position = new Vector3();\n keyframe.rotation = new Quaternion();\n\n bone.frames.push(keyframe);\n\n let combinedRotation = Matrix.Identity();\n\n // parse values for each channel in node\n for (let i = 0; i < bone.channels.length; ++i) {\n const channel = bone.channels[i];\n const value = data[tokenIndex.i++];\n if (!value) {\n continue;\n }\n const parsedValue = parseFloat(value.trim());\n if (channel.endsWith(\"position\")) {\n switch (channel) {\n case _XPosition:\n keyframe.position.x = parsedValue;\n break;\n case _YPosition:\n keyframe.position.y = parsedValue;\n break;\n case _ZPosition:\n keyframe.position.z = parsedValue;\n break;\n }\n } else if (channel.endsWith(\"rotation\")) {\n const angle = Tools.ToRadians(parsedValue);\n let rotationMatrix: Matrix;\n switch (channel) {\n case _XRotation:\n rotationMatrix = Matrix.RotationX(angle);\n break;\n case _YRotation:\n rotationMatrix = Matrix.RotationY(angle);\n break;\n case _ZRotation:\n rotationMatrix = Matrix.RotationZ(angle);\n break;\n }\n combinedRotation = rotationMatrix!.multiply(combinedRotation);\n }\n }\n\n Quaternion.FromRotationMatrixToRef(combinedRotation, keyframe.rotation);\n\n // parse child nodes\n for (const child of bone.children) {\n ReadFrameData(data, frameNumber, child, tokenIndex);\n }\n}\n\n/**\n * Recursively parses the HIERARCHY section of the BVH file\n * @param lines - all lines of the file. lines are consumed as we go along\n * @param firstLine - line containing the node type and name e.g. \"JOINT hip\"\n * @param parent - the parent node for hierarchy\n * @param context - the loader context containing the list of nodes and other data\n * @returns a BVH node including children\n */\nfunction ReadNode(lines: string[], firstLine: string, parent: Nullable<IBVHNode>, context: LoaderContext): IBVHNode {\n const node = CreateBVHNode();\n node.parent = parent;\n context.list.push(node);\n\n // parse node type and name.\n let tokens: string[] | undefined = firstLine.trim().split(/\\s+/);\n\n if (tokens[0].toUpperCase() === \"END\" && tokens[1].toUpperCase() === \"SITE\") {\n node.type = \"ENDSITE\";\n node.name = \"ENDSITE\"; // bvh end sites have no name\n } else {\n node.name = tokens[1];\n node.type = tokens[0].toUpperCase();\n }\n\n // opening bracket\n if (lines.shift()?.trim() != \"{\") {\n throw new Error(\"Expected opening { after type & name\");\n }\n\n // parse OFFSET\n const tokensSplit = lines.shift()?.trim().split(/\\s+/);\n if (!tokensSplit) {\n throw new Error(\"Unexpected end of file: missing OFFSET\");\n }\n tokens = tokensSplit;\n\n if (tokens[0].toUpperCase() != \"OFFSET\") {\n throw new Error(\"Expected OFFSET, but got: \" + tokens[0]);\n }\n if (tokens.length != 4) {\n throw new Error(\"OFFSET: Invalid number of values\");\n }\n\n const offset = new Vector3(parseFloat(tokens[1]), parseFloat(tokens[2]), parseFloat(tokens[3]));\n\n if (isNaN(offset.x) || isNaN(offset.y) || isNaN(offset.z)) {\n throw new Error(\"OFFSET: Invalid values\");\n }\n\n node.offset = offset;\n\n // parse CHANNELS definitions\n if (node.type != \"ENDSITE\") {\n tokens = lines.shift()?.trim().split(/\\s+/);\n if (!tokens) {\n throw new Error(\"Unexpected end of file: missing CHANNELS\");\n }\n\n if (tokens[0].toUpperCase() != \"CHANNELS\") {\n throw new Error(\"Expected CHANNELS definition\");\n }\n\n const numChannels = parseInt(tokens[1]);\n // Skip CHANNELS and the number of channels\n node.channels = tokens.splice(2, numChannels);\n node.children = [];\n }\n\n // read children\n while (lines.length > 0) {\n const line = lines.shift()?.trim();\n\n if (line === \"}\") {\n // Finish reading the node\n return node;\n } else if (line) {\n node.children.push(ReadNode(lines, line, node, context));\n }\n }\n\n throw new Error(\"Unexpected end of file: missing closing brace\");\n}\n\n/**\n * Reads a BVH file, returns a skeleton\n * @param text - The BVH file content\n * @param scene - The scene to add the skeleton to\n * @param assetContainer - The asset container to add the skeleton to\n * @param loadingOptions - The loading options\n * @returns The skeleton\n */\nexport function ReadBvh(text: string, scene: Scene, assetContainer: Nullable<AssetContainer>, loadingOptions: BVHLoadingOptions): Skeleton {\n const lines = text.split(\"\\n\");\n\n const { loopMode } = loadingOptions;\n\n scene._blockEntityCollection = !!assetContainer;\n const skeleton = new Skeleton(\"\", \"\", scene);\n skeleton._parentContainer = assetContainer;\n scene._blockEntityCollection = false;\n\n const context = new LoaderContext(skeleton);\n context.loopMode = loopMode;\n\n // read model structure\n const firstLine = lines.shift();\n if (!firstLine || firstLine.trim().toUpperCase() !== _HierarchyNode) {\n throw new Error(\"HIERARCHY expected\");\n }\n\n const nodeLine = lines.shift();\n if (!nodeLine) {\n throw new Error(\"Unexpected end of file after HIERARCHY\");\n }\n const root = ReadNode(lines, nodeLine.trim(), null, context);\n\n // read motion data\n const motionLine = lines.shift();\n if (!motionLine || motionLine.trim().toUpperCase() !== _MotionNode) {\n throw new Error(\"MOTION expected\");\n }\n\n const framesLine = lines.shift();\n if (!framesLine) {\n throw new Error(\"Unexpected end of file before frame count\");\n }\n const framesTokens = framesLine.trim().split(/[\\s]+/);\n if (framesTokens.length < 2) {\n throw new Error(\"Invalid frame count line\");\n }\n\n // number of frames\n const numFrames = parseInt(framesTokens[1]);\n if (isNaN(numFrames)) {\n throw new Error(\"Failed to read number of frames.\");\n }\n context.numFrames = numFrames;\n\n // frame time\n const frameTimeLine = lines.shift();\n if (!frameTimeLine) {\n throw new Error(\"Unexpected end of file before frame time\");\n }\n const frameTimeTokens = frameTimeLine.trim().split(/[\\s]+/);\n if (frameTimeTokens.length < 3) {\n throw new Error(\"Invalid frame time line\");\n }\n const frameTime = parseFloat(frameTimeTokens[2]);\n if (isNaN(frameTime)) {\n throw new Error(\"Failed to read frame time.\");\n }\n if (frameTime <= 0) {\n throw new Error(\"Failed to read frame time. Invalid value \" + frameTime);\n }\n\n context.frameRate = 1 / frameTime;\n\n // read frame data line by line\n for (let i = 0; i < numFrames; ++i) {\n const frameLine = lines.shift();\n if (!frameLine) {\n continue;\n }\n const tokens = frameLine.trim().split(/[\\s]+/) || [];\n ReadFrameData(tokens, i, root, { i: 0 });\n }\n\n context.root = root;\n\n ConvertNode(context.root, null, context);\n\n context.skeleton.returnToRest();\n return context.skeleton;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","import type { ISceneLoaderPluginExtensions, ISceneLoaderPluginMetadata } from \"core/index\";\r\n\r\nexport const BVHFileLoaderMetadata = {\r\n name: \"bvh\",\r\n extensions: {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \".bvh\": { isBinary: false },\r\n } as const satisfies ISceneLoaderPluginExtensions,\r\n} as const satisfies ISceneLoaderPluginMetadata;\r\n","import type { ISceneLoaderPluginAsync, ISceneLoaderPluginFactory, ISceneLoaderAsyncResult, SceneLoaderPluginOptions } from \"core/Loading/sceneLoader\";\nimport { RegisterSceneLoaderPlugin } from \"core/Loading/sceneLoader\";\nimport { AssetContainer } from \"core/assetContainer\";\nimport { Animation } from \"core/Animations/animation\";\nimport type { Scene } from \"core/scene\";\nimport type { BVHLoadingOptions } from \"./bvhLoadingOptions\";\nimport { BVHFileLoaderMetadata } from \"./bvhFileLoader.metadata\";\nimport { ReadBvh } from \"./bvhLoader\";\n\ndeclare module \"core/Loading/sceneLoader\" {\n // eslint-disable-next-line jsdoc/require-jsdoc, @typescript-eslint/naming-convention\n export interface SceneLoaderPluginOptions {\n /**\n * Defines options for the bvh loader.\n */\n [BVHFileLoaderMetadata.name]: Partial<BVHLoadingOptions>;\n }\n}\n\n/**\n * @experimental\n * BVH file type loader.\n * This is a babylon scene loader plugin.\n */\nexport class BVHFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {\n /**\n * Name of the loader (\"bvh\")\n */\n public readonly name = BVHFileLoaderMetadata.name;\n\n /** @internal */\n public readonly extensions = BVHFileLoaderMetadata.extensions;\n\n private readonly _loadingOptions: BVHLoadingOptions;\n\n /**\n * Creates loader for bvh motion files\n * @param loadingOptions - Options for the bvh loader\n */\n constructor(loadingOptions?: Partial<Readonly<BVHLoadingOptions>>) {\n this._loadingOptions = { ...BVHFileLoader._DefaultLoadingOptions, ...(loadingOptions ?? {}) };\n }\n\n private static get _DefaultLoadingOptions(): BVHLoadingOptions {\n return {\n loopMode: Animation.ANIMATIONLOOPMODE_CYCLE,\n };\n }\n\n /** @internal */\n public createPlugin(options: SceneLoaderPluginOptions): ISceneLoaderPluginAsync {\n return new BVHFileLoader(options[BVHFileLoaderMetadata.name]);\n }\n\n /**\n * If the data string can be loaded directly.\n * @param data - direct load data\n * @returns if the data can be loaded directly\n */\n public canDirectLoad(data: string): boolean {\n return this.isBvhHeader(data);\n }\n\n public isBvhHeader(text: string): boolean {\n return text.split(\"\\n\")[0] == \"HIERARCHY\";\n }\n\n public isNotBvhHeader(text: string): boolean {\n return !this.isBvhHeader(text);\n }\n\n /**\n * Imports from the loaded gaussian splatting data and adds them to the scene\n * @param _meshesNames a string or array of strings of the mesh names that should be loaded from the file\n * @param scene the scene the meshes should be added to\n * @param data the bvh data to load\n * @returns a promise containing the loaded skeletons and animations\n */\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\n public importMeshAsync(_meshesNames: string | readonly string[] | null | undefined, scene: Scene, data: unknown): Promise<ISceneLoaderAsyncResult> {\n if (typeof data !== \"string\") {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(\"BVH loader expects string data.\");\n }\n if (this.isNotBvhHeader(data as string)) {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(\"BVH loader expects HIERARCHY header.\");\n }\n try {\n const skeleton = ReadBvh(data, scene, null, this._loadingOptions);\n return Promise.resolve({\n meshes: [],\n particleSystems: [],\n skeletons: [skeleton],\n animationGroups: [],\n transformNodes: [],\n geometries: [],\n lights: [],\n spriteManagers: [],\n } as ISceneLoaderAsyncResult);\n } catch (e) {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(e);\n }\n }\n\n /**\n * Imports all objects from the loaded bvh data and adds them to the scene\n * @param scene the scene the objects should be added to\n * @param data the bvh data to load\n * @returns a promise which completes when objects have been loaded to the scene\n */\n // eslint-disable-next-line no-restricted-syntax, @typescript-eslint/promise-function-async\n public loadAsync(scene: Scene, data: unknown): Promise<void> {\n if (typeof data !== \"string\") {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(\"BVH loader expects string data.\");\n }\n if (this.isNotBvhHeader(data as string)) {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(\"BVH loader expects HIERARCHY header.\");\n }\n\n // eslint-disable-next-line github/no-then\n return this.importMeshAsync(null, scene, data).then(() => {\n // return void\n });\n }\n\n /**\n * Load into an asset container.\n * @param scene The scene to load into\n * @param data The data to import\n * @returns The loaded asset container\n */\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\n public loadAssetContainerAsync(scene: Scene, data: unknown): Promise<AssetContainer> {\n if (typeof data !== \"string\") {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(\"BVH loader expects string data.\");\n }\n if (this.isNotBvhHeader(data as string)) {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(\"BVH loader expects HIERARCHY header.\");\n }\n const assetContainer = new AssetContainer(scene);\n try {\n const skeleton = ReadBvh(data, scene, assetContainer, this._loadingOptions);\n assetContainer.skeletons.push(skeleton);\n return Promise.resolve(assetContainer);\n } catch (e) {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(e);\n }\n }\n}\n\nRegisterSceneLoaderPlugin(new BVHFileLoader());\n","/* eslint-disable @typescript-eslint/no-restricted-imports */\r\nimport * as Loaders from \"loaders/BVH/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nconst GlobalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\r\nif (typeof GlobalObject !== \"undefined\") {\r\n for (const key in Loaders) {\r\n if (!(<any>GlobalObject).BABYLON[key]) {\r\n (<any>GlobalObject).BABYLON[key] = (<any>Loaders)[key];\r\n }\r\n }\r\n}\r\n\r\nexport * from \"loaders/BVH/index\";\r\n","import * as loaders from \"@lts/loaders/legacy/legacy-bvhFileLoader\";\r\nexport { loaders };\r\nexport default loaders;\r\n"],"names":["root","factory","exports","module","require","define","amd","self","global","this","__WEBPACK_EXTERNAL_MODULE__597__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","Function","e","window","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","_XPosition","_YPosition","_ZPosition","_XRotation","_YRotation","_ZRotation","_HierarchyNode","_MotionNode","skeleton","loopMode","Animation","ANIMATIONLOOPMODE_CYCLE","list","CreateBVHNode","numFrames","frameRate","name","type","offset","Vector3","channels","children","frames","parent","ConvertNode","node","context","matrix","x","y","z","Matrix","Translation","BoneOffset","bone","Bone","animations","length","hasPosition","some","c","hasRotation","posAnim","ANIMATIONTYPE_VECTOR3","rotAnim","ANIMATIONTYPE_QUATERNION","posKeys","rotKeys","i","frame","position","push","clone","rotation","setKeys","CreateAnimations","animation","getKeys","ReadFrameData","data","frameNumber","tokenIndex","keyframe","Quaternion","combinedRotation","Identity","channel","parsedValue","parseFloat","trim","endsWith","angle","Tools","ToRadians","rotationMatrix","RotationX","RotationY","RotationZ","multiply","FromRotationMatrixToRef","ReadNode","lines","firstLine","tokens","split","toUpperCase","shift","Error","tokensSplit","isNaN","numChannels","parseInt","splice","line","ReadBvh","text","scene","assetContainer","loadingOptions","_blockEntityCollection","Skeleton","_parentContainer","LoaderContext","nodeLine","motionLine","framesLine","framesTokens","frameTimeLine","frameTimeTokens","frameTime","frameLine","returnToRest","__assign","assign","t","s","n","arguments","p","apply","create","SuppressedError","BVHFileLoaderMetadata","isBinary","extensions","_loadingOptions","BVHFileLoader","_DefaultLoadingOptions","createPlugin","options","canDirectLoad","isBvhHeader","isNotBvhHeader","importMeshAsync","_meshesNames","Promise","reject","resolve","meshes","particleSystems","skeletons","animationGroups","transformNodes","geometries","lights","spriteManagers","loadAsync","then","loadAssetContainerAsync","AssetContainer","RegisterSceneLoaderPlugin","GlobalObject","BABYLON"],"sourceRoot":""}
1
+ {"version":3,"file":"babylon.bvhFileLoader.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,cACR,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,oBAAqB,CAAC,aAAcJ,GACjB,iBAAZC,QACdA,QAAQ,qBAAuBD,EAAQG,QAAQ,cAE/CJ,EAAc,QAAIC,EAAQD,EAAc,QACzC,CATD,CASoB,oBAATO,KAAuBA,KAAyB,oBAAXC,OAAyBA,OAASC,MAAQC,G,kCCT1FP,EAAOD,QAAUQ,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaZ,QAGrB,IAAIC,EAASQ,EAAyBE,GAAY,CAGjDX,QAAS,CAAC,GAOX,OAHAc,EAAoBH,GAAUV,EA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gB/H,KAAK2J,iBAE3D,OADA5B,EAAe2C,UAAUzF,KAAK3C,GACvB+H,QAAQE,QAAQxC,EAC3B,CAAE,MAAO5G,GAEL,OAAOkJ,QAAQC,OAAOnJ,EAC1B,CACJ,EACJ,EAnIA,IAqIA,IAAAiK,2BAA0B,IAAIxB,GCtJ9B,IAAMyB,OAAiC,IAAX,EAAArK,EAAyB,EAAAA,EAA2B,oBAAXI,OAAyBA,YAASd,EACvG,QAA4B,IAAjB+K,EACP,IAAK,IAAM3K,KAAO,EACH2K,EAAcC,QAAQ5K,KACvB2K,EAAcC,QAAQ5K,GAAa,EAASA,ICT9D,U","sources":["webpack://LOADERS/webpack/universalModuleDefinition","webpack://LOADERS/external umd {\"root\":\"BABYLON\",\"commonjs\":\"babylonjs\",\"commonjs2\":\"babylonjs\",\"amd\":\"babylonjs\"}","webpack://LOADERS/webpack/bootstrap","webpack://LOADERS/webpack/runtime/define property getters","webpack://LOADERS/webpack/runtime/global","webpack://LOADERS/webpack/runtime/hasOwnProperty shorthand","webpack://LOADERS/webpack/runtime/make namespace object","webpack://LOADERS/../../../dev/loaders/src/BVH/bvhLoader.ts","webpack://LOADERS/../../../../node_modules/tslib/tslib.es6.mjs","webpack://LOADERS/../../../dev/loaders/src/BVH/bvhFileLoader.metadata.ts","webpack://LOADERS/../../../dev/loaders/src/BVH/bvhFileLoader.ts","webpack://LOADERS/../../../lts/loaders/src/legacy/legacy-bvhFileLoader.ts","webpack://LOADERS/./src/bvhFileLoader.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"babylonjs\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"babylonjs-loaders\", [\"babylonjs\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"babylonjs-loaders\"] = factory(require(\"babylonjs\"));\n\telse\n\t\troot[\"LOADERS\"] = factory(root[\"BABYLON\"]);\n})((typeof self !== \"undefined\" ? self : typeof global !== \"undefined\" ? global : this), (__WEBPACK_EXTERNAL_MODULE__597__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__597__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { IAnimationKey } from \"core/Animations\";\nimport { Animation } from \"core/Animations/animation\";\nimport { Bone } from \"core/Bones/bone\";\nimport { Skeleton } from \"core/Bones/skeleton\";\nimport { Matrix, Quaternion, Vector3 } from \"core/Maths/math.vector\";\nimport type { Scene } from \"core/scene\";\nimport type { Nullable } from \"core/types\";\nimport type { BVHLoadingOptions } from \"./bvhLoadingOptions\";\nimport { Tools } from \"core/Misc/tools\";\nimport type { AssetContainer } from \"core/assetContainer\";\n\nconst _XPosition = \"Xposition\";\nconst _YPosition = \"Yposition\";\nconst _ZPosition = \"Zposition\";\nconst _XRotation = \"Xrotation\";\nconst _YRotation = \"Yrotation\";\nconst _ZRotation = \"Zrotation\";\n\nconst _HierarchyNode = \"HIERARCHY\";\nconst _MotionNode = \"MOTION\";\n\nclass LoaderContext {\n loopMode: number = Animation.ANIMATIONLOOPMODE_CYCLE;\n list: IBVHNode[] = [];\n root: IBVHNode = CreateBVHNode();\n numFrames: number = 0;\n frameRate: number = 0;\n skeleton: Skeleton;\n\n constructor(skeleton: Skeleton) {\n this.skeleton = skeleton;\n }\n}\n\ninterface IBVHNode {\n name: string;\n type: string;\n offset: Vector3;\n channels: string[];\n children: IBVHNode[];\n frames: IBVHKeyFrame[];\n parent: Nullable<IBVHNode>;\n}\n\ninterface IBVHKeyFrame {\n frame: number;\n position: Vector3;\n rotation: Quaternion;\n}\n\nfunction CreateBVHNode(): IBVHNode {\n return {\n name: \"\",\n type: \"\",\n offset: new Vector3(),\n channels: [],\n children: [],\n frames: [],\n parent: null,\n };\n}\n\nfunction CreateBVHKeyFrame(): IBVHKeyFrame {\n return {\n frame: 0,\n position: new Vector3(),\n rotation: new Quaternion(),\n };\n}\n\n/**\n * Converts the BVH node's offset to a Babylon matrix\n * @param node - The BVH node to convert\n * @returns The converted matrix\n */\nfunction BoneOffset(node: IBVHNode): Matrix {\n const x = node.offset.x;\n const y = node.offset.y;\n const z = node.offset.z;\n return Matrix.Translation(x, y, z);\n}\n\n/**\n * Creates animations for the BVH node\n * @param node - The BVH node to create animations for\n * @param context - The loader context\n * @returns The created animations\n */\nfunction CreateAnimations(node: IBVHNode, context: LoaderContext): Animation[] {\n if (node.frames.length === 0) {\n return [];\n }\n\n const animations: Animation[] = [];\n\n // Create position animation if there are position channels\n const hasPosition = node.channels.some((c) => c === _XPosition || c === _YPosition || c === _ZPosition);\n\n // Create rotation animation if there are rotation channels\n const hasRotation = node.channels.some((c) => c === _XRotation || c === _YRotation || c === _ZRotation);\n\n const posAnim = new Animation(`${node.name}_pos`, \"position\", context.frameRate, Animation.ANIMATIONTYPE_VECTOR3, context.loopMode);\n\n const rotAnim = new Animation(`${node.name}_rot`, \"rotationQuaternion\", context.frameRate, Animation.ANIMATIONTYPE_QUATERNION, context.loopMode);\n\n const posKeys: IAnimationKey[] = [];\n const rotKeys: IAnimationKey[] = [];\n\n for (let i = 0; i < node.frames.length; i++) {\n const frame = node.frames[i];\n\n if (hasPosition && frame.position) {\n posKeys.push({\n frame: frame.frame,\n value: frame.position.clone(),\n });\n }\n\n if (hasRotation) {\n rotKeys.push({\n frame: frame.frame,\n value: frame.rotation.clone(),\n });\n }\n }\n\n if (posKeys.length > 0) {\n posAnim.setKeys(posKeys);\n animations.push(posAnim);\n }\n\n if (rotKeys.length > 0) {\n rotAnim.setKeys(rotKeys);\n animations.push(rotAnim);\n }\n\n return animations;\n}\n\n/**\n * Converts a BVH node to a Babylon bone\n * @param node - The BVH node to convert\n * @param parent - The parent bone\n * @param context - The loader context\n */\nfunction ConvertNode(node: IBVHNode, parent: Nullable<Bone>, context: LoaderContext) {\n const matrix = BoneOffset(node);\n const bone = new Bone(node.name, context.skeleton, parent, matrix);\n\n // Create animation for this bone\n const animations = CreateAnimations(node, context);\n for (const animation of animations) {\n if (animation.getKeys() && animation.getKeys().length > 0) {\n bone.animations.push(animation);\n }\n }\n\n for (const child of node.children) {\n ConvertNode(child, bone, context);\n }\n}\n\n/**\n * Recursively reads data from a single frame into the bone hierarchy.\n * The bone hierarchy has to be structured in the same order as the BVH file.\n * keyframe data is stored in bone.frames.\n * @param data - splitted string array (frame values), values are shift()ed\n * @param frameNumber - playback time for this keyframe\n * @param bone - the bone to read frame data from\n * @param tokenIndex - the index of the token to read\n */\nfunction ReadFrameData(data: string[], frameNumber: number, bone: IBVHNode, tokenIndex: { i: number }) {\n if (bone.type === \"ENDSITE\") {\n // end sites have no motion data\n return;\n }\n\n // add keyframe\n const keyframe = CreateBVHKeyFrame();\n keyframe.frame = frameNumber;\n keyframe.position = new Vector3();\n keyframe.rotation = new Quaternion();\n\n bone.frames.push(keyframe);\n\n let combinedRotation = Matrix.Identity();\n\n // parse values for each channel in node\n for (let i = 0; i < bone.channels.length; ++i) {\n const channel = bone.channels[i];\n const value = data[tokenIndex.i++];\n if (!value) {\n continue;\n }\n const parsedValue = parseFloat(value.trim());\n if (channel.endsWith(\"position\")) {\n switch (channel) {\n case _XPosition:\n keyframe.position.x = parsedValue;\n break;\n case _YPosition:\n keyframe.position.y = parsedValue;\n break;\n case _ZPosition:\n keyframe.position.z = parsedValue;\n break;\n }\n } else if (channel.endsWith(\"rotation\")) {\n const angle = Tools.ToRadians(parsedValue);\n let rotationMatrix: Matrix;\n switch (channel) {\n case _XRotation:\n rotationMatrix = Matrix.RotationX(angle);\n break;\n case _YRotation:\n rotationMatrix = Matrix.RotationY(angle);\n break;\n case _ZRotation:\n rotationMatrix = Matrix.RotationZ(angle);\n break;\n }\n combinedRotation = rotationMatrix!.multiply(combinedRotation);\n }\n }\n\n Quaternion.FromRotationMatrixToRef(combinedRotation, keyframe.rotation);\n\n // parse child nodes\n for (const child of bone.children) {\n ReadFrameData(data, frameNumber, child, tokenIndex);\n }\n}\n\n/**\n * Recursively parses the HIERARCHY section of the BVH file\n * @param lines - all lines of the file. lines are consumed as we go along\n * @param firstLine - line containing the node type and name e.g. \"JOINT hip\"\n * @param parent - the parent node for hierarchy\n * @param context - the loader context containing the list of nodes and other data\n * @returns a BVH node including children\n */\nfunction ReadNode(lines: string[], firstLine: string, parent: Nullable<IBVHNode>, context: LoaderContext): IBVHNode {\n const node = CreateBVHNode();\n node.parent = parent;\n context.list.push(node);\n\n // parse node type and name.\n let tokens: string[] | undefined = firstLine.trim().split(/\\s+/);\n\n if (tokens[0].toUpperCase() === \"END\" && tokens[1].toUpperCase() === \"SITE\") {\n node.type = \"ENDSITE\";\n node.name = \"ENDSITE\"; // bvh end sites have no name\n } else {\n node.name = tokens[1];\n node.type = tokens[0].toUpperCase();\n }\n\n // opening bracket\n if (lines.shift()?.trim() != \"{\") {\n throw new Error(\"Expected opening { after type & name\");\n }\n\n // parse OFFSET\n const tokensSplit = lines.shift()?.trim().split(/\\s+/);\n if (!tokensSplit) {\n throw new Error(\"Unexpected end of file: missing OFFSET\");\n }\n tokens = tokensSplit;\n\n if (tokens[0].toUpperCase() != \"OFFSET\") {\n throw new Error(\"Expected OFFSET, but got: \" + tokens[0]);\n }\n if (tokens.length != 4) {\n throw new Error(\"OFFSET: Invalid number of values\");\n }\n\n const offset = new Vector3(parseFloat(tokens[1]), parseFloat(tokens[2]), parseFloat(tokens[3]));\n\n if (isNaN(offset.x) || isNaN(offset.y) || isNaN(offset.z)) {\n throw new Error(\"OFFSET: Invalid values\");\n }\n\n node.offset = offset;\n\n // parse CHANNELS definitions\n if (node.type != \"ENDSITE\") {\n tokens = lines.shift()?.trim().split(/\\s+/);\n if (!tokens) {\n throw new Error(\"Unexpected end of file: missing CHANNELS\");\n }\n\n if (tokens[0].toUpperCase() != \"CHANNELS\") {\n throw new Error(\"Expected CHANNELS definition\");\n }\n\n const numChannels = parseInt(tokens[1]);\n // Skip CHANNELS and the number of channels\n node.channels = tokens.splice(2, numChannels);\n node.children = [];\n }\n\n // read children\n while (lines.length > 0) {\n const line = lines.shift()?.trim();\n\n if (line === \"}\") {\n // Finish reading the node\n return node;\n } else if (line) {\n node.children.push(ReadNode(lines, line, node, context));\n }\n }\n\n throw new Error(\"Unexpected end of file: missing closing brace\");\n}\n\n/**\n * Reads a BVH file, returns a skeleton\n * @param text - The BVH file content\n * @param scene - The scene to add the skeleton to\n * @param assetContainer - The asset container to add the skeleton to\n * @param loadingOptions - The loading options\n * @returns The skeleton\n */\nexport function ReadBvh(text: string, scene: Scene, assetContainer: Nullable<AssetContainer>, loadingOptions: BVHLoadingOptions): Skeleton {\n const lines = text.split(\"\\n\");\n\n const { loopMode } = loadingOptions;\n\n scene._blockEntityCollection = !!assetContainer;\n const skeleton = new Skeleton(\"\", \"\", scene);\n skeleton._parentContainer = assetContainer;\n scene._blockEntityCollection = false;\n\n const context = new LoaderContext(skeleton);\n context.loopMode = loopMode;\n\n // read model structure\n const firstLine = lines.shift();\n if (!firstLine || firstLine.trim().toUpperCase() !== _HierarchyNode) {\n throw new Error(\"HIERARCHY expected\");\n }\n\n const nodeLine = lines.shift();\n if (!nodeLine) {\n throw new Error(\"Unexpected end of file after HIERARCHY\");\n }\n const root = ReadNode(lines, nodeLine.trim(), null, context);\n\n // read motion data\n const motionLine = lines.shift();\n if (!motionLine || motionLine.trim().toUpperCase() !== _MotionNode) {\n throw new Error(\"MOTION expected\");\n }\n\n const framesLine = lines.shift();\n if (!framesLine) {\n throw new Error(\"Unexpected end of file before frame count\");\n }\n const framesTokens = framesLine.trim().split(/[\\s]+/);\n if (framesTokens.length < 2) {\n throw new Error(\"Invalid frame count line\");\n }\n\n // number of frames\n const numFrames = parseInt(framesTokens[1]);\n if (isNaN(numFrames)) {\n throw new Error(\"Failed to read number of frames.\");\n }\n context.numFrames = numFrames;\n\n // frame time\n const frameTimeLine = lines.shift();\n if (!frameTimeLine) {\n throw new Error(\"Unexpected end of file before frame time\");\n }\n const frameTimeTokens = frameTimeLine.trim().split(/[\\s]+/);\n if (frameTimeTokens.length < 3) {\n throw new Error(\"Invalid frame time line\");\n }\n const frameTime = parseFloat(frameTimeTokens[2]);\n if (isNaN(frameTime)) {\n throw new Error(\"Failed to read frame time.\");\n }\n if (frameTime <= 0) {\n throw new Error(\"Failed to read frame time. Invalid value \" + frameTime);\n }\n\n context.frameRate = 1 / frameTime;\n\n // read frame data line by line\n for (let i = 0; i < numFrames; ++i) {\n const frameLine = lines.shift();\n if (!frameLine) {\n continue;\n }\n const tokens = frameLine.trim().split(/[\\s]+/) || [];\n ReadFrameData(tokens, i, root, { i: 0 });\n }\n\n context.root = root;\n\n ConvertNode(context.root, null, context);\n\n context.skeleton.returnToRest();\n return context.skeleton;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","import type { ISceneLoaderPluginExtensions, ISceneLoaderPluginMetadata } from \"core/index\";\r\n\r\nexport const BVHFileLoaderMetadata = {\r\n name: \"bvh\",\r\n extensions: {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n \".bvh\": { isBinary: false },\r\n } as const satisfies ISceneLoaderPluginExtensions,\r\n} as const satisfies ISceneLoaderPluginMetadata;\r\n","import type { ISceneLoaderPluginAsync, ISceneLoaderPluginFactory, ISceneLoaderAsyncResult, SceneLoaderPluginOptions } from \"core/Loading/sceneLoader\";\nimport { RegisterSceneLoaderPlugin } from \"core/Loading/sceneLoader\";\nimport { AssetContainer } from \"core/assetContainer\";\nimport { Animation } from \"core/Animations/animation\";\nimport type { Scene } from \"core/scene\";\nimport type { BVHLoadingOptions } from \"./bvhLoadingOptions\";\nimport { BVHFileLoaderMetadata } from \"./bvhFileLoader.metadata\";\nimport { ReadBvh } from \"./bvhLoader\";\n\ndeclare module \"core/Loading/sceneLoader\" {\n // eslint-disable-next-line jsdoc/require-jsdoc, @typescript-eslint/naming-convention\n export interface SceneLoaderPluginOptions {\n /**\n * Defines options for the bvh loader.\n */\n [BVHFileLoaderMetadata.name]: Partial<BVHLoadingOptions>;\n }\n}\n\n/**\n * @experimental\n * BVH file type loader.\n * This is a babylon scene loader plugin.\n */\nexport class BVHFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {\n /**\n * Name of the loader (\"bvh\")\n */\n public readonly name = BVHFileLoaderMetadata.name;\n\n /** @internal */\n public readonly extensions = BVHFileLoaderMetadata.extensions;\n\n private readonly _loadingOptions: BVHLoadingOptions;\n\n /**\n * Creates loader for bvh motion files\n * @param loadingOptions - Options for the bvh loader\n */\n constructor(loadingOptions?: Partial<Readonly<BVHLoadingOptions>>) {\n this._loadingOptions = { ...BVHFileLoader._DefaultLoadingOptions, ...(loadingOptions ?? {}) };\n }\n\n private static get _DefaultLoadingOptions(): BVHLoadingOptions {\n return {\n loopMode: Animation.ANIMATIONLOOPMODE_CYCLE,\n };\n }\n\n /** @internal */\n public createPlugin(options: SceneLoaderPluginOptions): ISceneLoaderPluginAsync {\n return new BVHFileLoader(options[BVHFileLoaderMetadata.name]);\n }\n\n /**\n * If the data string can be loaded directly.\n * @param data - direct load data\n * @returns if the data can be loaded directly\n */\n public canDirectLoad(data: string): boolean {\n return this.isBvhHeader(data);\n }\n\n public isBvhHeader(text: string): boolean {\n return text.split(\"\\n\")[0] == \"HIERARCHY\";\n }\n\n public isNotBvhHeader(text: string): boolean {\n return !this.isBvhHeader(text);\n }\n\n /**\n * Imports from the loaded gaussian splatting data and adds them to the scene\n * @param _meshesNames a string or array of strings of the mesh names that should be loaded from the file\n * @param scene the scene the meshes should be added to\n * @param data the bvh data to load\n * @returns a promise containing the loaded skeletons and animations\n */\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\n public importMeshAsync(_meshesNames: string | readonly string[] | null | undefined, scene: Scene, data: unknown): Promise<ISceneLoaderAsyncResult> {\n if (typeof data !== \"string\") {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(\"BVH loader expects string data.\");\n }\n if (this.isNotBvhHeader(data as string)) {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(\"BVH loader expects HIERARCHY header.\");\n }\n try {\n const skeleton = ReadBvh(data, scene, null, this._loadingOptions);\n return Promise.resolve({\n meshes: [],\n particleSystems: [],\n skeletons: [skeleton],\n animationGroups: [],\n transformNodes: [],\n geometries: [],\n lights: [],\n spriteManagers: [],\n } as ISceneLoaderAsyncResult);\n } catch (e) {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(e);\n }\n }\n\n /**\n * Imports all objects from the loaded bvh data and adds them to the scene\n * @param scene the scene the objects should be added to\n * @param data the bvh data to load\n * @returns a promise which completes when objects have been loaded to the scene\n */\n // eslint-disable-next-line no-restricted-syntax, @typescript-eslint/promise-function-async\n public loadAsync(scene: Scene, data: unknown): Promise<void> {\n if (typeof data !== \"string\") {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(\"BVH loader expects string data.\");\n }\n if (this.isNotBvhHeader(data as string)) {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(\"BVH loader expects HIERARCHY header.\");\n }\n\n // eslint-disable-next-line github/no-then\n return this.importMeshAsync(null, scene, data).then(() => {\n // return void\n });\n }\n\n /**\n * Load into an asset container.\n * @param scene The scene to load into\n * @param data The data to import\n * @returns The loaded asset container\n */\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\n public loadAssetContainerAsync(scene: Scene, data: unknown): Promise<AssetContainer> {\n if (typeof data !== \"string\") {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(\"BVH loader expects string data.\");\n }\n if (this.isNotBvhHeader(data as string)) {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(\"BVH loader expects HIERARCHY header.\");\n }\n const assetContainer = new AssetContainer(scene);\n try {\n const skeleton = ReadBvh(data, scene, assetContainer, this._loadingOptions);\n assetContainer.skeletons.push(skeleton);\n return Promise.resolve(assetContainer);\n } catch (e) {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(e);\n }\n }\n}\n\nRegisterSceneLoaderPlugin(new BVHFileLoader());\n","/* eslint-disable @typescript-eslint/no-restricted-imports */\r\nimport * as Loaders from \"loaders/BVH/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nconst GlobalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\r\nif (typeof GlobalObject !== \"undefined\") {\r\n for (const key in Loaders) {\r\n if (!(<any>GlobalObject).BABYLON[key]) {\r\n (<any>GlobalObject).BABYLON[key] = (<any>Loaders)[key];\r\n }\r\n }\r\n}\r\n\r\nexport * from \"loaders/BVH/index\";\r\n","import * as loaders from \"@lts/loaders/legacy/legacy-bvhFileLoader\";\r\nexport { loaders };\r\nexport default loaders;\r\n"],"names":["root","factory","exports","module","require","define","amd","self","global","this","__WEBPACK_EXTERNAL_MODULE__597__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","Function","e","window","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","_XPosition","_YPosition","_ZPosition","_XRotation","_YRotation","_ZRotation","_HierarchyNode","_MotionNode","skeleton","loopMode","Animation","ANIMATIONLOOPMODE_CYCLE","list","CreateBVHNode","numFrames","frameRate","name","type","offset","Vector3","channels","children","frames","parent","ConvertNode","node","context","matrix","x","y","z","Matrix","Translation","BoneOffset","bone","Bone","animations","length","hasPosition","some","c","hasRotation","posAnim","ANIMATIONTYPE_VECTOR3","rotAnim","ANIMATIONTYPE_QUATERNION","posKeys","rotKeys","i","frame","position","push","clone","rotation","setKeys","CreateAnimations","animation","getKeys","ReadFrameData","data","frameNumber","tokenIndex","keyframe","Quaternion","combinedRotation","Identity","channel","parsedValue","parseFloat","trim","endsWith","angle","Tools","ToRadians","rotationMatrix","RotationX","RotationY","RotationZ","multiply","FromRotationMatrixToRef","ReadNode","lines","firstLine","tokens","split","toUpperCase","shift","Error","tokensSplit","isNaN","numChannels","parseInt","splice","line","ReadBvh","text","scene","assetContainer","loadingOptions","_blockEntityCollection","Skeleton","_parentContainer","LoaderContext","nodeLine","motionLine","framesLine","framesTokens","frameTimeLine","frameTimeTokens","frameTime","frameLine","returnToRest","__assign","assign","t","s","n","arguments","p","apply","create","SuppressedError","BVHFileLoaderMetadata","isBinary","extensions","_loadingOptions","BVHFileLoader","_DefaultLoadingOptions","createPlugin","options","canDirectLoad","isBvhHeader","isNotBvhHeader","importMeshAsync","_meshesNames","Promise","reject","resolve","meshes","particleSystems","skeletons","animationGroups","transformNodes","geometries","lights","spriteManagers","loadAsync","then","loadAssetContainerAsync","AssetContainer","RegisterSceneLoaderPlugin","GlobalObject","BABYLON"],"ignoreList":[],"sourceRoot":""}