2fed0591f6b1cc78012dd6b38db52184250f525546c30832d8d656d874091280.json 5.0 KB

1
  1. {"ast":null,"code":"/**\n * Class used to represent a viewport on screen\n */\nexport class Viewport {\n /**\n * Creates a Viewport object located at (x, y) and sized (width, height)\n * @param x defines viewport left coordinate\n * @param y defines viewport top coordinate\n * @param width defines the viewport width\n * @param height defines the viewport height\n */\n constructor( /** viewport left coordinate */\n x, /** viewport top coordinate */\n y, /**viewport width */\n width, /** viewport height */\n height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n /**\n * Creates a new viewport using absolute sizing (from 0-> width, 0-> height instead of 0->1)\n * @param renderWidth defines the rendering width\n * @param renderHeight defines the rendering height\n * @returns a new Viewport\n */\n toGlobal(renderWidth, renderHeight) {\n return new Viewport(this.x * renderWidth, this.y * renderHeight, this.width * renderWidth, this.height * renderHeight);\n }\n /**\n * Stores absolute viewport value into a target viewport (from 0-> width, 0-> height instead of 0->1)\n * @param renderWidth defines the rendering width\n * @param renderHeight defines the rendering height\n * @param ref defines the target viewport\n * @returns the current viewport\n */\n toGlobalToRef(renderWidth, renderHeight, ref) {\n ref.x = this.x * renderWidth;\n ref.y = this.y * renderHeight;\n ref.width = this.width * renderWidth;\n ref.height = this.height * renderHeight;\n return this;\n }\n /**\n * Returns a new Viewport copied from the current one\n * @returns a new Viewport\n */\n clone() {\n return new Viewport(this.x, this.y, this.width, this.height);\n }\n}","map":{"version":3,"names":["Viewport","constructor","x","y","width","height","toGlobal","renderWidth","renderHeight","toGlobalToRef","ref","clone"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Maths/math.viewport.js"],"sourcesContent":["/**\n * Class used to represent a viewport on screen\n */\nexport class Viewport {\n /**\n * Creates a Viewport object located at (x, y) and sized (width, height)\n * @param x defines viewport left coordinate\n * @param y defines viewport top coordinate\n * @param width defines the viewport width\n * @param height defines the viewport height\n */\n constructor(\n /** viewport left coordinate */\n x, \n /** viewport top coordinate */\n y, \n /**viewport width */\n width, \n /** viewport height */\n height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n /**\n * Creates a new viewport using absolute sizing (from 0-> width, 0-> height instead of 0->1)\n * @param renderWidth defines the rendering width\n * @param renderHeight defines the rendering height\n * @returns a new Viewport\n */\n toGlobal(renderWidth, renderHeight) {\n return new Viewport(this.x * renderWidth, this.y * renderHeight, this.width * renderWidth, this.height * renderHeight);\n }\n /**\n * Stores absolute viewport value into a target viewport (from 0-> width, 0-> height instead of 0->1)\n * @param renderWidth defines the rendering width\n * @param renderHeight defines the rendering height\n * @param ref defines the target viewport\n * @returns the current viewport\n */\n toGlobalToRef(renderWidth, renderHeight, ref) {\n ref.x = this.x * renderWidth;\n ref.y = this.y * renderHeight;\n ref.width = this.width * renderWidth;\n ref.height = this.height * renderHeight;\n return this;\n }\n /**\n * Returns a new Viewport copied from the current one\n * @returns a new Viewport\n */\n clone() {\n return new Viewport(this.x, this.y, this.width, this.height);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,MAAMA,QAAQ,CAAC;EAClB;AACJ;AACA;AACA;AACA;AACA;AACA;EACIC,WAAWA,CAAA,CACX;EACAC,CAAC,EACD;EACAC,CAAC,EACD;EACAC,KAAK,EACL;EACAC,MAAM,EAAE;IACJ,IAAI,CAACH,CAAC,GAAGA,CAAC;IACV,IAAI,CAACC,CAAC,GAAGA,CAAC;IACV,IAAI,CAACC,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,MAAM,GAAGA,MAAM;EACxB;EACA;AACJ;AACA;AACA;AACA;AACA;EACIC,QAAQA,CAACC,WAAW,EAAEC,YAAY,EAAE;IAChC,OAAO,IAAIR,QAAQ,CAAC,IAAI,CAACE,CAAC,GAAGK,WAAW,EAAE,IAAI,CAACJ,CAAC,GAAGK,YAAY,EAAE,IAAI,CAACJ,KAAK,GAAGG,WAAW,EAAE,IAAI,CAACF,MAAM,GAAGG,YAAY,CAAC;EAC1H;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;EACIC,aAAaA,CAACF,WAAW,EAAEC,YAAY,EAAEE,GAAG,EAAE;IAC1CA,GAAG,CAACR,CAAC,GAAG,IAAI,CAACA,CAAC,GAAGK,WAAW;IAC5BG,GAAG,CAACP,CAAC,GAAG,IAAI,CAACA,CAAC,GAAGK,YAAY;IAC7BE,GAAG,CAACN,KAAK,GAAG,IAAI,CAACA,KAAK,GAAGG,WAAW;IACpCG,GAAG,CAACL,MAAM,GAAG,IAAI,CAACA,MAAM,GAAGG,YAAY;IACvC,OAAO,IAAI;EACf;EACA;AACJ;AACA;AACA;EACIG,KAAKA,CAAA,EAAG;IACJ,OAAO,IAAIX,QAAQ,CAAC,IAAI,CAACE,CAAC,EAAE,IAAI,CAACC,CAAC,EAAE,IAAI,CAACC,KAAK,EAAE,IAAI,CAACC,MAAM,CAAC;EAChE;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}