52049578e29325d3d2a5759ade90b68f2299d1decf50c2de8071bf72a733c71f.json 3.2 KB

1
  1. {"ast":null,"code":"import { Observable } from \"../../Misc/observable.js\";\n/**\n * Class that handles all input for a specific device\n */\nexport class DeviceSource {\n /**\n * Default Constructor\n * @param deviceInputSystem - Reference to DeviceInputSystem\n * @param deviceType - Type of device\n * @param deviceSlot - \"Slot\" or index that device is referenced in\n */\n constructor(deviceInputSystem, /** Type of device */\n deviceType, /** [0] \"Slot\" or index that device is referenced in */\n deviceSlot = 0) {\n this.deviceType = deviceType;\n this.deviceSlot = deviceSlot;\n // Public Members\n /**\n * Observable to handle device input changes per device\n */\n this.onInputChangedObservable = new Observable();\n this._deviceInputSystem = deviceInputSystem;\n }\n /**\n * Get input for specific input\n * @param inputIndex - index of specific input on device\n * @returns Input value from DeviceInputSystem\n */\n getInput(inputIndex) {\n return this._deviceInputSystem.pollInput(this.deviceType, this.deviceSlot, inputIndex);\n }\n}","map":{"version":3,"names":["Observable","DeviceSource","constructor","deviceInputSystem","deviceType","deviceSlot","onInputChangedObservable","_deviceInputSystem","getInput","inputIndex","pollInput"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSource.js"],"sourcesContent":["import { Observable } from \"../../Misc/observable.js\";\n/**\n * Class that handles all input for a specific device\n */\nexport class DeviceSource {\n /**\n * Default Constructor\n * @param deviceInputSystem - Reference to DeviceInputSystem\n * @param deviceType - Type of device\n * @param deviceSlot - \"Slot\" or index that device is referenced in\n */\n constructor(deviceInputSystem, \n /** Type of device */\n deviceType, \n /** [0] \"Slot\" or index that device is referenced in */\n deviceSlot = 0) {\n this.deviceType = deviceType;\n this.deviceSlot = deviceSlot;\n // Public Members\n /**\n * Observable to handle device input changes per device\n */\n this.onInputChangedObservable = new Observable();\n this._deviceInputSystem = deviceInputSystem;\n }\n /**\n * Get input for specific input\n * @param inputIndex - index of specific input on device\n * @returns Input value from DeviceInputSystem\n */\n getInput(inputIndex) {\n return this._deviceInputSystem.pollInput(this.deviceType, this.deviceSlot, inputIndex);\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,0BAA0B;AACrD;AACA;AACA;AACA,OAAO,MAAMC,YAAY,CAAC;EACtB;AACJ;AACA;AACA;AACA;AACA;EACIC,WAAWA,CAACC,iBAAiB,EAC7B;EACAC,UAAU,EACV;EACAC,UAAU,GAAG,CAAC,EAAE;IACZ,IAAI,CAACD,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACC,UAAU,GAAGA,UAAU;IAC5B;IACA;AACR;AACA;IACQ,IAAI,CAACC,wBAAwB,GAAG,IAAIN,UAAU,CAAC,CAAC;IAChD,IAAI,CAACO,kBAAkB,GAAGJ,iBAAiB;EAC/C;EACA;AACJ;AACA;AACA;AACA;EACIK,QAAQA,CAACC,UAAU,EAAE;IACjB,OAAO,IAAI,CAACF,kBAAkB,CAACG,SAAS,CAAC,IAAI,CAACN,UAAU,EAAE,IAAI,CAACC,UAAU,EAAEI,UAAU,CAAC;EAC1F;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}