e2f14d0baea1461a9a338998a0d421e824c1a38ec41e2862380b8c976ce874b2.json 5.2 KB

1
  1. {"ast":null,"code":"import { AxesViewer } from \"../Debug/axesViewer.js\";\nimport { Vector3 } from \"../Maths/math.vector.js\";\nimport { Axis } from \"../Maths/math.axis.js\";\n/**\n * The BoneAxesViewer will attach 3 axes to a specific bone of a specific mesh\n * @see demo here: https://www.babylonjs-playground.com/#0DE8F4#8\n */\nexport class BoneAxesViewer extends AxesViewer {\n /**\n * Creates a new BoneAxesViewer\n * @param scene defines the hosting scene\n * @param bone defines the target bone\n * @param mesh defines the target mesh\n * @param scaleLines defines a scaling factor for line length (1 by default)\n */\n constructor(scene, bone, mesh, scaleLines = 1) {\n super(scene, scaleLines);\n /** Gets current position */\n this.pos = Vector3.Zero();\n /** Gets direction of X axis */\n this.xaxis = Vector3.Zero();\n /** Gets direction of Y axis */\n this.yaxis = Vector3.Zero();\n /** Gets direction of Z axis */\n this.zaxis = Vector3.Zero();\n this.mesh = mesh;\n this.bone = bone;\n }\n /**\n * Force the viewer to update\n */\n update() {\n if (!this.mesh || !this.bone) {\n return;\n }\n const bone = this.bone;\n bone.getAbsolutePositionToRef(this.mesh, this.pos);\n bone.getDirectionToRef(Axis.X, this.mesh, this.xaxis);\n bone.getDirectionToRef(Axis.Y, this.mesh, this.yaxis);\n bone.getDirectionToRef(Axis.Z, this.mesh, this.zaxis);\n super.update(this.pos, this.xaxis, this.yaxis, this.zaxis);\n }\n /** Releases resources */\n dispose() {\n if (this.mesh) {\n this.mesh = null;\n this.bone = null;\n super.dispose();\n }\n }\n}","map":{"version":3,"names":["AxesViewer","Vector3","Axis","BoneAxesViewer","constructor","scene","bone","mesh","scaleLines","pos","Zero","xaxis","yaxis","zaxis","update","getAbsolutePositionToRef","getDirectionToRef","X","Y","Z","dispose"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Debug/boneAxesViewer.js"],"sourcesContent":["import { AxesViewer } from \"../Debug/axesViewer.js\";\nimport { Vector3 } from \"../Maths/math.vector.js\";\nimport { Axis } from \"../Maths/math.axis.js\";\n/**\n * The BoneAxesViewer will attach 3 axes to a specific bone of a specific mesh\n * @see demo here: https://www.babylonjs-playground.com/#0DE8F4#8\n */\nexport class BoneAxesViewer extends AxesViewer {\n /**\n * Creates a new BoneAxesViewer\n * @param scene defines the hosting scene\n * @param bone defines the target bone\n * @param mesh defines the target mesh\n * @param scaleLines defines a scaling factor for line length (1 by default)\n */\n constructor(scene, bone, mesh, scaleLines = 1) {\n super(scene, scaleLines);\n /** Gets current position */\n this.pos = Vector3.Zero();\n /** Gets direction of X axis */\n this.xaxis = Vector3.Zero();\n /** Gets direction of Y axis */\n this.yaxis = Vector3.Zero();\n /** Gets direction of Z axis */\n this.zaxis = Vector3.Zero();\n this.mesh = mesh;\n this.bone = bone;\n }\n /**\n * Force the viewer to update\n */\n update() {\n if (!this.mesh || !this.bone) {\n return;\n }\n const bone = this.bone;\n bone.getAbsolutePositionToRef(this.mesh, this.pos);\n bone.getDirectionToRef(Axis.X, this.mesh, this.xaxis);\n bone.getDirectionToRef(Axis.Y, this.mesh, this.yaxis);\n bone.getDirectionToRef(Axis.Z, this.mesh, this.zaxis);\n super.update(this.pos, this.xaxis, this.yaxis, this.zaxis);\n }\n /** Releases resources */\n dispose() {\n if (this.mesh) {\n this.mesh = null;\n this.bone = null;\n super.dispose();\n }\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,wBAAwB;AACnD,SAASC,OAAO,QAAQ,yBAAyB;AACjD,SAASC,IAAI,QAAQ,uBAAuB;AAC5C;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,SAASH,UAAU,CAAC;EAC3C;AACJ;AACA;AACA;AACA;AACA;AACA;EACII,WAAWA,CAACC,KAAK,EAAEC,IAAI,EAAEC,IAAI,EAAEC,UAAU,GAAG,CAAC,EAAE;IAC3C,KAAK,CAACH,KAAK,EAAEG,UAAU,CAAC;IACxB;IACA,IAAI,CAACC,GAAG,GA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},"sourceType":"module","externalDependencies":[]}