@babylonjs/core 5.19.0 → 5.20.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.
Files changed (67) hide show
  1. package/DeviceInput/InputDevices/deviceSource.d.ts +1 -1
  2. package/DeviceInput/InputDevices/deviceSource.js.map +1 -1
  3. package/DeviceInput/InputDevices/deviceSourceManager.d.ts +1 -1
  4. package/DeviceInput/InputDevices/deviceSourceManager.js +1 -1
  5. package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
  6. package/DeviceInput/{Helpers/eventFactory.d.ts → eventFactory.d.ts} +4 -4
  7. package/DeviceInput/{Helpers/eventFactory.js → eventFactory.js} +2 -2
  8. package/DeviceInput/eventFactory.js.map +1 -0
  9. package/DeviceInput/{InputDevices/inputInterfaces.d.ts → inputInterfaces.d.ts} +2 -2
  10. package/DeviceInput/{InputDevices/inputInterfaces.js → inputInterfaces.js} +0 -0
  11. package/DeviceInput/inputInterfaces.js.map +1 -0
  12. package/DeviceInput/{InputDevices/internalDeviceSourceManager.d.ts → internalDeviceSourceManager.d.ts} +7 -7
  13. package/DeviceInput/{InputDevices/internalDeviceSourceManager.js → internalDeviceSourceManager.js} +2 -2
  14. package/DeviceInput/internalDeviceSourceManager.js.map +1 -0
  15. package/DeviceInput/{InputDevices/nativeDeviceInputSystem.d.ts → nativeDeviceInputSystem.d.ts} +2 -2
  16. package/DeviceInput/{InputDevices/nativeDeviceInputSystem.js → nativeDeviceInputSystem.js} +2 -2
  17. package/DeviceInput/nativeDeviceInputSystem.js.map +1 -0
  18. package/DeviceInput/{InputDevices/webDeviceInputSystem.d.ts → webDeviceInputSystem.d.ts} +3 -3
  19. package/DeviceInput/{InputDevices/webDeviceInputSystem.js → webDeviceInputSystem.js} +4 -4
  20. package/DeviceInput/webDeviceInputSystem.js.map +1 -0
  21. package/Engines/Native/nativeInterfaces.d.ts +1 -1
  22. package/Engines/Native/nativeInterfaces.js.map +1 -1
  23. package/Engines/thinEngine.js +2 -2
  24. package/Engines/thinEngine.js.map +1 -1
  25. package/Loading/Plugins/babylonFileLoader.js +16 -4
  26. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  27. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.d.ts +39 -0
  28. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +97 -0
  29. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -0
  30. package/Materials/Node/Blocks/Fragment/index.d.ts +1 -0
  31. package/Materials/Node/Blocks/Fragment/index.js +1 -0
  32. package/Materials/Node/Blocks/Fragment/index.js.map +1 -1
  33. package/Materials/Textures/Procedurals/proceduralTexture.js +5 -1
  34. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  35. package/Materials/Textures/texture.js +9 -5
  36. package/Materials/Textures/texture.js.map +1 -1
  37. package/Maths/math.vector.d.ts +116 -5
  38. package/Maths/math.vector.js +116 -5
  39. package/Maths/math.vector.js.map +1 -1
  40. package/Meshes/mesh.js +1 -0
  41. package/Meshes/mesh.js.map +1 -1
  42. package/Meshes/transformNode.js +1 -0
  43. package/Meshes/transformNode.js.map +1 -1
  44. package/Misc/iInspectable.d.ts +12 -2
  45. package/Misc/iInspectable.js +4 -0
  46. package/Misc/iInspectable.js.map +1 -1
  47. package/Misc/sceneSerializer.js +1 -1
  48. package/Misc/sceneSerializer.js.map +1 -1
  49. package/Particles/solidParticleSystem.d.ts +1 -0
  50. package/Particles/solidParticleSystem.js +4 -1
  51. package/Particles/solidParticleSystem.js.map +1 -1
  52. package/XR/webXRDefaultExperience.d.ts +10 -0
  53. package/XR/webXRDefaultExperience.js +2 -12
  54. package/XR/webXRDefaultExperience.js.map +1 -1
  55. package/XR/webXRExperienceHelper.js +12 -12
  56. package/XR/webXRExperienceHelper.js.map +1 -1
  57. package/node.d.ts +2 -0
  58. package/node.js +2 -0
  59. package/node.js.map +1 -1
  60. package/package.json +1 -1
  61. package/scene.d.ts +1 -1
  62. package/scene.js.map +1 -1
  63. package/DeviceInput/Helpers/eventFactory.js.map +0 -1
  64. package/DeviceInput/InputDevices/inputInterfaces.js.map +0 -1
  65. package/DeviceInput/InputDevices/internalDeviceSourceManager.js.map +0 -1
  66. package/DeviceInput/InputDevices/nativeDeviceInputSystem.js.map +0 -1
  67. package/DeviceInput/InputDevices/webDeviceInputSystem.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import type { DeviceType } from "./deviceEnums";
2
2
  import { Observable } from "../../Misc/observable";
3
3
  import type { DeviceInput } from "./deviceTypes";
4
- import type { IDeviceInputSystem } from "./inputInterfaces";
4
+ import type { IDeviceInputSystem } from "../inputInterfaces";
5
5
  import type { IKeyboardEvent, IPointerEvent, IWheelEvent } from "../../Events/deviceInputEvents";
6
6
  /**
7
7
  * Subset of DeviceInput that only handles pointers and keyboard
@@ -1 +1 @@
1
- {"version":3,"file":"deviceSource.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/DeviceInput/InputDevices/deviceSource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAgBnD;;GAEG;AACH;IAUI;;;;;OAKG;IACH,sBACI,iBAAqC;IACrC,qBAAqB;IACL,UAAa;IAC7B,mDAAmD;IACnC,UAAsB;QAAtB,2BAAA,EAAA,cAAsB;QAFtB,eAAU,GAAV,UAAU,CAAG;QAEb,eAAU,GAAV,UAAU,CAAY;QApB1C,iBAAiB;QACjB;;WAEG;QACa,6BAAwB,GAAG,IAAI,UAAU,EAAwB,CAAC;QAkB9E,IAAI,CAAC,kBAAkB,GAAG,iBAAiB,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACI,+BAAQ,GAAf,UAAgB,UAA0B;QACtC,OAAO,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC3F,CAAC;IACL,mBAAC;AAAD,CAAC,AAlCD,IAkCC","sourcesContent":["import type { DeviceType } from \"./deviceEnums\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport type { DeviceInput } from \"./deviceTypes\";\r\nimport type { IDeviceInputSystem } from \"./inputInterfaces\";\r\nimport type { IKeyboardEvent, IPointerEvent, IWheelEvent } from \"../../Events/deviceInputEvents\";\r\n\r\n/**\r\n * Subset of DeviceInput that only handles pointers and keyboard\r\n */\r\nexport type DeviceSourceEvent<T extends DeviceType> = T extends DeviceType.Keyboard\r\n ? IKeyboardEvent\r\n : T extends DeviceType.Mouse\r\n ? IWheelEvent | IPointerEvent\r\n : T extends DeviceType.Touch\r\n ? IPointerEvent\r\n : never;\r\n\r\n/**\r\n * Class that handles all input for a specific device\r\n */\r\nexport class DeviceSource<T extends DeviceType> {\r\n // Public Members\r\n /**\r\n * Observable to handle device input changes per device\r\n */\r\n public readonly onInputChangedObservable = new Observable<DeviceSourceEvent<T>>();\r\n\r\n // Private Members\r\n private readonly _deviceInputSystem: IDeviceInputSystem;\r\n\r\n /**\r\n * Default Constructor\r\n * @param deviceInputSystem - Reference to DeviceInputSystem\r\n * @param deviceType - Type of device\r\n * @param deviceSlot - \"Slot\" or index that device is referenced in\r\n */\r\n constructor(\r\n deviceInputSystem: IDeviceInputSystem,\r\n /** Type of device */\r\n public readonly deviceType: T,\r\n /** \"Slot\" or index that device is referenced in */\r\n public readonly deviceSlot: number = 0\r\n ) {\r\n this._deviceInputSystem = deviceInputSystem;\r\n }\r\n\r\n /**\r\n * Get input for specific input\r\n * @param inputIndex - index of specific input on device\r\n * @returns Input value from DeviceInputSystem\r\n */\r\n public getInput(inputIndex: DeviceInput<T>): number {\r\n return this._deviceInputSystem.pollInput(this.deviceType, this.deviceSlot, inputIndex);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"deviceSource.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/DeviceInput/InputDevices/deviceSource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAgBnD;;GAEG;AACH;IAUI;;;;;OAKG;IACH,sBACI,iBAAqC;IACrC,qBAAqB;IACL,UAAa;IAC7B,mDAAmD;IACnC,UAAsB;QAAtB,2BAAA,EAAA,cAAsB;QAFtB,eAAU,GAAV,UAAU,CAAG;QAEb,eAAU,GAAV,UAAU,CAAY;QApB1C,iBAAiB;QACjB;;WAEG;QACa,6BAAwB,GAAG,IAAI,UAAU,EAAwB,CAAC;QAkB9E,IAAI,CAAC,kBAAkB,GAAG,iBAAiB,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACI,+BAAQ,GAAf,UAAgB,UAA0B;QACtC,OAAO,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC3F,CAAC;IACL,mBAAC;AAAD,CAAC,AAlCD,IAkCC","sourcesContent":["import type { DeviceType } from \"./deviceEnums\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport type { DeviceInput } from \"./deviceTypes\";\r\nimport type { IDeviceInputSystem } from \"../inputInterfaces\";\r\nimport type { IKeyboardEvent, IPointerEvent, IWheelEvent } from \"../../Events/deviceInputEvents\";\r\n\r\n/**\r\n * Subset of DeviceInput that only handles pointers and keyboard\r\n */\r\nexport type DeviceSourceEvent<T extends DeviceType> = T extends DeviceType.Keyboard\r\n ? IKeyboardEvent\r\n : T extends DeviceType.Mouse\r\n ? IWheelEvent | IPointerEvent\r\n : T extends DeviceType.Touch\r\n ? IPointerEvent\r\n : never;\r\n\r\n/**\r\n * Class that handles all input for a specific device\r\n */\r\nexport class DeviceSource<T extends DeviceType> {\r\n // Public Members\r\n /**\r\n * Observable to handle device input changes per device\r\n */\r\n public readonly onInputChangedObservable = new Observable<DeviceSourceEvent<T>>();\r\n\r\n // Private Members\r\n private readonly _deviceInputSystem: IDeviceInputSystem;\r\n\r\n /**\r\n * Default Constructor\r\n * @param deviceInputSystem - Reference to DeviceInputSystem\r\n * @param deviceType - Type of device\r\n * @param deviceSlot - \"Slot\" or index that device is referenced in\r\n */\r\n constructor(\r\n deviceInputSystem: IDeviceInputSystem,\r\n /** Type of device */\r\n public readonly deviceType: T,\r\n /** \"Slot\" or index that device is referenced in */\r\n public readonly deviceSlot: number = 0\r\n ) {\r\n this._deviceInputSystem = deviceInputSystem;\r\n }\r\n\r\n /**\r\n * Get input for specific input\r\n * @param inputIndex - index of specific input on device\r\n * @returns Input value from DeviceInputSystem\r\n */\r\n public getInput(inputIndex: DeviceInput<T>): number {\r\n return this._deviceInputSystem.pollInput(this.deviceType, this.deviceSlot, inputIndex);\r\n }\r\n}\r\n"]}
@@ -3,7 +3,7 @@ import { DeviceType } from "./deviceEnums";
3
3
  import type { Nullable } from "../../types";
4
4
  import { Observable } from "../../Misc/observable";
5
5
  import type { DeviceSource } from "./deviceSource";
6
- import type { IObservableManager, DeviceSourceType } from "./internalDeviceSourceManager";
6
+ import type { IObservableManager, DeviceSourceType } from "../internalDeviceSourceManager";
7
7
  import type { IDisposable } from "../../scene";
8
8
  import type { IUIEvent } from "../../Events/deviceInputEvents";
9
9
  /**
@@ -1,6 +1,6 @@
1
1
  import { DeviceType } from "./deviceEnums.js";
2
2
  import { Observable } from "../../Misc/observable.js";
3
- import { InternalDeviceSourceManager } from "./internalDeviceSourceManager.js";
3
+ import { InternalDeviceSourceManager } from "../internalDeviceSourceManager.js";
4
4
  /**
5
5
  * Class to keep track of devices
6
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"deviceSourceManager.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/DeviceInput/InputDevices/deviceSourceManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAK5E;;GAEG;AACH;IAuDI;;;OAGG;IACH,6BAAY,MAAc;QAA1B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;OAKG;IACI,6CAAe,GAAtB,UAA6C,UAAa,EAAE,UAAkB,EAAE,SAAmB;;QAC/F,MAAA,MAAA,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,0CAAG,UAAU,CAAC,0CAAE,wBAAwB,CAAC,eAAe,CAAC,SAAyD,CAAC,CAAC;IACjJ,CAAC;IAED,oBAAoB;IACZ,iDAAmB,GAA3B,UAA4B,IAAgB;QACxC,QAAQ,IAAI,EAAE;YACV,KAAK,UAAU,CAAC,QAAQ,CAAC;YACzB,KAAK,UAAU,CAAC,KAAK;gBACjB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC5B,MAAM;YACV,KAAK,UAAU,CAAC,KAAK,CAAC;YACtB,KAAK,UAAU,CAAC,SAAS,CAAC;YAC1B,KAAK,UAAU,CAAC,SAAS,CAAC;YAC1B,KAAK,UAAU,CAAC,IAAI,CAAC;YACrB,KAAK,UAAU,CAAC,MAAM,CAAC;YACvB,KAAK,UAAU,CAAC,OAAO,CAAC,CAAC;gBACrB,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;gBAC/B,gDAAgD;gBAChD,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;gBACpC,IAAI,OAAO,EAAE;oBACT,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;wBACrC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE;4BACZ,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;4BAC5B,MAAM;yBACT;qBACJ;iBACJ;gBACD,MAAM;aACT;SACJ;IACL,CAAC;IACL,0BAAC;AAAD,CAAC,AApLD,IAoLC","sourcesContent":["import type { Engine } from \"../../Engines/engine\";\r\nimport { DeviceType } from \"./deviceEnums\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Observer } from \"../../Misc/observable\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport type { DeviceSource } from \"./deviceSource\";\r\nimport type { IObservableManager, DeviceSourceType } from \"./internalDeviceSourceManager\";\r\nimport { InternalDeviceSourceManager } from \"./internalDeviceSourceManager\";\r\nimport type { IDisposable } from \"../../scene\";\r\nimport type { ThinEngine } from \"../../Engines/thinEngine\";\r\nimport type { IKeyboardEvent, IPointerEvent, IUIEvent, IWheelEvent } from \"../../Events/deviceInputEvents\";\r\n\r\n/**\r\n * Class to keep track of devices\r\n */\r\nexport class DeviceSourceManager implements IDisposable, IObservableManager {\r\n // Public Members\r\n /**\r\n * Observable to be triggered when after a device is connected, any new observers added will be triggered against already connected devices\r\n */\r\n public readonly onDeviceConnectedObservable: Observable<DeviceSourceType>;\r\n\r\n /**\r\n * Observable to be triggered when after a device is disconnected\r\n */\r\n public readonly onDeviceDisconnectedObservable: Observable<DeviceSourceType>;\r\n\r\n // Private Members\r\n private _engine: Engine;\r\n private _onDisposeObserver: Nullable<Observer<ThinEngine>>;\r\n private readonly _devices: Array<Array<DeviceSource<DeviceType>>>;\r\n private readonly _firstDevice: Array<number>;\r\n\r\n // Public Functions\r\n /**\r\n * Gets a DeviceSource, given a type and slot\r\n * @param deviceType - Type of Device\r\n * @param deviceSlot - Slot or ID of device\r\n * @returns DeviceSource\r\n */\r\n public getDeviceSource<T extends DeviceType>(deviceType: T, deviceSlot?: number): Nullable<DeviceSource<T>> {\r\n if (deviceSlot === undefined) {\r\n if (this._firstDevice[deviceType] === undefined) {\r\n return null;\r\n }\r\n\r\n deviceSlot = this._firstDevice[deviceType];\r\n }\r\n\r\n if (!this._devices[deviceType] || this._devices[deviceType][deviceSlot] === undefined) {\r\n return null;\r\n }\r\n\r\n return this._devices[deviceType][deviceSlot] as DeviceSource<T>;\r\n }\r\n /**\r\n * Gets an array of DeviceSource objects for a given device type\r\n * @param deviceType - Type of Device\r\n * @returns All available DeviceSources of a given type\r\n */\r\n public getDeviceSources<T extends DeviceType>(deviceType: T): ReadonlyArray<DeviceSource<T>> {\r\n // If device type hasn't had any devices connected yet, return empty array.\r\n if (!this._devices[deviceType]) {\r\n return [];\r\n }\r\n return this._devices[deviceType].filter((source) => {\r\n return !!source;\r\n }) as Array<DeviceSource<T>>;\r\n }\r\n\r\n /**\r\n * Default constructor\r\n * @param engine - Used to get canvas (if applicable)\r\n */\r\n constructor(engine: Engine) {\r\n const numberOfDeviceTypes = Object.keys(DeviceType).length / 2;\r\n this._devices = new Array(numberOfDeviceTypes);\r\n this._firstDevice = new Array(numberOfDeviceTypes);\r\n this._engine = engine;\r\n\r\n if (!this._engine._deviceSourceManager) {\r\n this._engine._deviceSourceManager = new InternalDeviceSourceManager(engine);\r\n }\r\n this._engine._deviceSourceManager._refCount++;\r\n\r\n // Observables\r\n this.onDeviceConnectedObservable = new Observable((observer) => {\r\n for (const devices of this._devices) {\r\n if (devices) {\r\n for (const device of devices) {\r\n if (device) {\r\n this.onDeviceConnectedObservable.notifyObserver(observer, device as DeviceSourceType);\r\n }\r\n }\r\n }\r\n }\r\n });\r\n this.onDeviceDisconnectedObservable = new Observable();\r\n\r\n this._engine._deviceSourceManager.registerManager(this);\r\n\r\n this._onDisposeObserver = engine.onDisposeObservable.add(() => {\r\n this.dispose();\r\n });\r\n }\r\n\r\n /**\r\n * Dispose of DeviceSourceManager\r\n */\r\n public dispose(): void {\r\n // Null out observable refs\r\n this.onDeviceConnectedObservable.clear();\r\n this.onDeviceDisconnectedObservable.clear();\r\n\r\n if (this._engine._deviceSourceManager) {\r\n this._engine._deviceSourceManager.unregisterManager(this);\r\n if (--this._engine._deviceSourceManager._refCount < 1) {\r\n this._engine._deviceSourceManager.dispose();\r\n delete this._engine._deviceSourceManager;\r\n }\r\n }\r\n this._engine.onDisposeObservable.remove(this._onDisposeObserver);\r\n }\r\n\r\n // Hidden Functions\r\n /**\r\n * @param deviceSource - Source to add\r\n * @hidden\r\n */\r\n public _addDevice(deviceSource: DeviceSourceType): void {\r\n if (!this._devices[deviceSource.deviceType]) {\r\n this._devices[deviceSource.deviceType] = new Array();\r\n }\r\n\r\n if (!this._devices[deviceSource.deviceType][deviceSource.deviceSlot]) {\r\n this._devices[deviceSource.deviceType][deviceSource.deviceSlot] = deviceSource;\r\n this._updateFirstDevices(deviceSource.deviceType);\r\n }\r\n\r\n this.onDeviceConnectedObservable.notifyObservers(deviceSource);\r\n }\r\n\r\n /**\r\n * @param deviceType - DeviceType\r\n * @param deviceSlot - DeviceSlot\r\n * @hidden\r\n */\r\n public _removeDevice(deviceType: DeviceType, deviceSlot: number): void {\r\n const deviceSource = this._devices[deviceType]?.[deviceSlot]; // Grab local reference to use before removing from devices\r\n this.onDeviceDisconnectedObservable.notifyObservers(deviceSource as DeviceSourceType);\r\n if (this._devices[deviceType]?.[deviceSlot]) {\r\n delete this._devices[deviceType][deviceSlot];\r\n }\r\n // Even if we don't delete a device, we should still check for the first device as things may have gotten out of sync.\r\n this._updateFirstDevices(deviceType);\r\n }\r\n\r\n /**\r\n * @param deviceType - DeviceType\r\n * @param deviceSlot - DeviceSlot\r\n * @param eventData - Event\r\n * @hidden\r\n */\r\n public _onInputChanged<T extends DeviceType>(deviceType: T, deviceSlot: number, eventData: IUIEvent): void {\r\n this._devices[deviceType]?.[deviceSlot]?.onInputChangedObservable.notifyObservers(eventData as IKeyboardEvent | IWheelEvent | IPointerEvent);\r\n }\r\n\r\n // Private Functions\r\n private _updateFirstDevices(type: DeviceType): void {\r\n switch (type) {\r\n case DeviceType.Keyboard:\r\n case DeviceType.Mouse:\r\n this._firstDevice[type] = 0;\r\n break;\r\n case DeviceType.Touch:\r\n case DeviceType.DualSense:\r\n case DeviceType.DualShock:\r\n case DeviceType.Xbox:\r\n case DeviceType.Switch:\r\n case DeviceType.Generic: {\r\n delete this._firstDevice[type];\r\n // eslint-disable-next-line no-case-declarations\r\n const devices = this._devices[type];\r\n if (devices) {\r\n for (let i = 0; i < devices.length; i++) {\r\n if (devices[i]) {\r\n this._firstDevice[type] = i;\r\n break;\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"deviceSourceManager.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/DeviceInput/InputDevices/deviceSourceManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAK7E;;GAEG;AACH;IAuDI;;;OAGG;IACH,6BAAY,MAAc;QAA1B,iBA8BC;QA7BG,IAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAC/D,IAAI,CAAC,QAAQ,GAAG,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC/C,IAAI,CAAC,YAAY,GAAG,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QACnD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAEtB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE;YACpC,IAAI,CAAC,OAAO,CAAC,oBAAoB,GAAG,IAAI,2BAA2B,CAAC,MAAM,CAAC,CAAC;SAC/E;QACD,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,SAAS,EAAE,CAAC;QAE9C,cAAc;QACd,IAAI,CAAC,2BAA2B,GAAG,IAAI,UAAU,CAAC,UAAC,QAAQ;YACvD,KAAsB,UAAa,EAAb,KAAA,KAAI,CAAC,QAAQ,EAAb,cAAa,EAAb,IAAa,EAAE;gBAAhC,IAAM,OAAO,SAAA;gBACd,IAAI,OAAO,EAAE;oBACT,KAAqB,UAAO,EAAP,mBAAO,EAAP,qBAAO,EAAP,IAAO,EAAE;wBAAzB,IAAM,MAAM,gBAAA;wBACb,IAAI,MAAM,EAAE;4BACR,KAAI,CAAC,2BAA2B,C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CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;wBACrC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE;4BACZ,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;4BAC5B,MAAM;yBACT;qBACJ;iBACJ;gBACD,MAAM;aACT;SACJ;IACL,CAAC;IACL,0BAAC;AAAD,CAAC,AApLD,IAoLC","sourcesContent":["import type { Engine } from \"../../Engines/engine\";\r\nimport { DeviceType } from \"./deviceEnums\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Observer } from \"../../Misc/observable\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport type { DeviceSource } from \"./deviceSource\";\r\nimport type { IObservableManager, DeviceSourceType } from \"../internalDeviceSourceManager\";\r\nimport { InternalDeviceSourceManager } from \"../internalDeviceSourceManager\";\r\nimport type { IDisposable } from \"../../scene\";\r\nimport type { ThinEngine } from \"../../Engines/thinEngine\";\r\nimport type { IKeyboardEvent, IPointerEvent, IUIEvent, IWheelEvent } from \"../../Events/deviceInputEvents\";\r\n\r\n/**\r\n * Class to keep track of devices\r\n */\r\nexport class DeviceSourceManager implements IDisposable, IObservableManager {\r\n // Public Members\r\n /**\r\n * Observable to be triggered when after a device is connected, any new observers added will be triggered against already connected devices\r\n */\r\n public readonly onDeviceConnectedObservable: Observable<DeviceSourceType>;\r\n\r\n /**\r\n * Observable to be triggered when after a device is disconnected\r\n */\r\n public readonly onDeviceDisconnectedObservable: Observable<DeviceSourceType>;\r\n\r\n // Private Members\r\n private _engine: Engine;\r\n private _onDisposeObserver: Nullable<Observer<ThinEngine>>;\r\n private readonly _devices: Array<Array<DeviceSource<DeviceType>>>;\r\n private readonly _firstDevice: Array<number>;\r\n\r\n // Public Functions\r\n /**\r\n * Gets a DeviceSource, given a type and slot\r\n * @param deviceType - Type of Device\r\n * @param deviceSlot - Slot or ID of device\r\n * @returns DeviceSource\r\n */\r\n public getDeviceSource<T extends DeviceType>(deviceType: T, deviceSlot?: number): Nullable<DeviceSource<T>> {\r\n if (deviceSlot === undefined) {\r\n if (this._firstDevice[deviceType] === undefined) {\r\n return null;\r\n }\r\n\r\n deviceSlot = this._firstDevice[deviceType];\r\n }\r\n\r\n if (!this._devices[deviceType] || this._devices[deviceType][deviceSlot] === undefined) {\r\n return null;\r\n }\r\n\r\n return this._devices[deviceType][deviceSlot] as DeviceSource<T>;\r\n }\r\n /**\r\n * Gets an array of DeviceSource objects for a given device type\r\n * @param deviceType - Type of Device\r\n * @returns All available DeviceSources of a given type\r\n */\r\n public getDeviceSources<T extends DeviceType>(deviceType: T): ReadonlyArray<DeviceSource<T>> {\r\n // If device type hasn't had any devices connected yet, return empty array.\r\n if (!this._devices[deviceType]) {\r\n return [];\r\n }\r\n return this._devices[deviceType].filter((source) => {\r\n return !!source;\r\n }) as Array<DeviceSource<T>>;\r\n }\r\n\r\n /**\r\n * Default constructor\r\n * @param engine - Used to get canvas (if applicable)\r\n */\r\n constructor(engine: Engine) {\r\n const numberOfDeviceTypes = Object.keys(DeviceType).length / 2;\r\n this._devices = new Array(numberOfDeviceTypes);\r\n this._firstDevice = new Array(numberOfDeviceTypes);\r\n this._engine = engine;\r\n\r\n if (!this._engine._deviceSourceManager) {\r\n this._engine._deviceSourceManager = new InternalDeviceSourceManager(engine);\r\n }\r\n this._engine._deviceSourceManager._refCount++;\r\n\r\n // Observables\r\n this.onDeviceConnectedObservable = new Observable((observer) => {\r\n for (const devices of this._devices) {\r\n if (devices) {\r\n for (const device of devices) {\r\n if (device) {\r\n this.onDeviceConnectedObservable.notifyObserver(observer, device as DeviceSourceType);\r\n }\r\n }\r\n }\r\n }\r\n });\r\n this.onDeviceDisconnectedObservable = new Observable();\r\n\r\n this._engine._deviceSourceManager.registerManager(this);\r\n\r\n this._onDisposeObserver = engine.onDisposeObservable.add(() => {\r\n this.dispose();\r\n });\r\n }\r\n\r\n /**\r\n * Dispose of DeviceSourceManager\r\n */\r\n public dispose(): void {\r\n // Null out observable refs\r\n this.onDeviceConnectedObservable.clear();\r\n this.onDeviceDisconnectedObservable.clear();\r\n\r\n if (this._engine._deviceSourceManager) {\r\n this._engine._deviceSourceManager.unregisterManager(this);\r\n if (--this._engine._deviceSourceManager._refCount < 1) {\r\n this._engine._deviceSourceManager.dispose();\r\n delete this._engine._deviceSourceManager;\r\n }\r\n }\r\n this._engine.onDisposeObservable.remove(this._onDisposeObserver);\r\n }\r\n\r\n // Hidden Functions\r\n /**\r\n * @param deviceSource - Source to add\r\n * @hidden\r\n */\r\n public _addDevice(deviceSource: DeviceSourceType): void {\r\n if (!this._devices[deviceSource.deviceType]) {\r\n this._devices[deviceSource.deviceType] = new Array();\r\n }\r\n\r\n if (!this._devices[deviceSource.deviceType][deviceSource.deviceSlot]) {\r\n this._devices[deviceSource.deviceType][deviceSource.deviceSlot] = deviceSource;\r\n this._updateFirstDevices(deviceSource.deviceType);\r\n }\r\n\r\n this.onDeviceConnectedObservable.notifyObservers(deviceSource);\r\n }\r\n\r\n /**\r\n * @param deviceType - DeviceType\r\n * @param deviceSlot - DeviceSlot\r\n * @hidden\r\n */\r\n public _removeDevice(deviceType: DeviceType, deviceSlot: number): void {\r\n const deviceSource = this._devices[deviceType]?.[deviceSlot]; // Grab local reference to use before removing from devices\r\n this.onDeviceDisconnectedObservable.notifyObservers(deviceSource as DeviceSourceType);\r\n if (this._devices[deviceType]?.[deviceSlot]) {\r\n delete this._devices[deviceType][deviceSlot];\r\n }\r\n // Even if we don't delete a device, we should still check for the first device as things may have gotten out of sync.\r\n this._updateFirstDevices(deviceType);\r\n }\r\n\r\n /**\r\n * @param deviceType - DeviceType\r\n * @param deviceSlot - DeviceSlot\r\n * @param eventData - Event\r\n * @hidden\r\n */\r\n public _onInputChanged<T extends DeviceType>(deviceType: T, deviceSlot: number, eventData: IUIEvent): void {\r\n this._devices[deviceType]?.[deviceSlot]?.onInputChangedObservable.notifyObservers(eventData as IKeyboardEvent | IWheelEvent | IPointerEvent);\r\n }\r\n\r\n // Private Functions\r\n private _updateFirstDevices(type: DeviceType): void {\r\n switch (type) {\r\n case DeviceType.Keyboard:\r\n case DeviceType.Mouse:\r\n this._firstDevice[type] = 0;\r\n break;\r\n case DeviceType.Touch:\r\n case DeviceType.DualSense:\r\n case DeviceType.DualShock:\r\n case DeviceType.Xbox:\r\n case DeviceType.Switch:\r\n case DeviceType.Generic: {\r\n delete this._firstDevice[type];\r\n // eslint-disable-next-line no-case-declarations\r\n const devices = this._devices[type];\r\n if (devices) {\r\n for (let i = 0; i < devices.length; i++) {\r\n if (devices[i]) {\r\n this._firstDevice[type] = i;\r\n break;\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n"]}
@@ -1,7 +1,7 @@
1
- import type { IUIEvent } from "../../Events/deviceInputEvents";
2
- import type { Nullable } from "../../types";
3
- import { DeviceType } from "../InputDevices/deviceEnums";
4
- import type { IDeviceInputSystem } from "../InputDevices/inputInterfaces";
1
+ import type { IUIEvent } from "../Events/deviceInputEvents";
2
+ import type { Nullable } from "../types";
3
+ import { DeviceType } from "./InputDevices/deviceEnums";
4
+ import type { IDeviceInputSystem } from "./inputInterfaces";
5
5
  /**
6
6
  * Class to wrap DeviceInputSystem data into an event object
7
7
  */
@@ -1,6 +1,6 @@
1
1
 
2
- import { EventConstants } from "../../Events/deviceInputEvents.js";
3
- import { DeviceType, NativePointerInput, PointerInput } from "../InputDevices/deviceEnums.js";
2
+ import { EventConstants } from "../Events/deviceInputEvents.js";
3
+ import { DeviceType, NativePointerInput, PointerInput } from "./InputDevices/deviceEnums.js";
4
4
  /**
5
5
  * Class to wrap DeviceInputSystem data into an event object
6
6
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventFactory.js","sourceRoot":"","sources":["../../../../../lts/core/generated/DeviceInput/eventFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,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AM,GAAG,iBAAiB,CAAC;QAE/B,OAAO,GAAG,CAAC;IACf,CAAC;IACL,yBAAC;AAAD,CAAC,AA7ND,IA6NC","sourcesContent":["import { Constants } from \"../Engines/constants\";\r\nimport type { IUIEvent } from \"../Events/deviceInputEvents\";\r\nimport { EventConstants } from \"../Events/deviceInputEvents\";\r\nimport type { Nullable } from \"../types\";\r\nimport { DeviceType, NativePointerInput, PointerInput } from \"./InputDevices/deviceEnums\";\r\nimport type { IDeviceInputSystem } from \"./inputInterfaces\";\r\n\r\n/**\r\n * Class to wrap DeviceInputSystem data into an event object\r\n */\r\nexport class DeviceEventFactory {\r\n /**\r\n * Create device input events based on provided type and slot\r\n *\r\n * @param deviceType Type of device\r\n * @param deviceSlot \"Slot\" or index that device is referenced in\r\n * @param inputIndex Id of input to be checked\r\n * @param currentState Current value for given input\r\n * @param deviceInputSystem Reference to DeviceInputSystem\r\n * @param elementToAttachTo HTMLElement to reference as target for inputs\r\n * @returns IUIEvent object\r\n */\r\n public static CreateDeviceEvent(\r\n deviceType: DeviceType,\r\n deviceSlot: number,\r\n inputIndex: number,\r\n currentState: Nullable<number>,\r\n deviceInputSystem: IDeviceInputSystem,\r\n elementToAttachTo?: any\r\n ): IUIEvent {\r\n switch (deviceType) {\r\n case DeviceType.Keyboard:\r\n return this._CreateKeyboardEvent(inputIndex, currentState, deviceInputSystem, elementToAttachTo);\r\n case DeviceType.Mouse:\r\n if (inputIndex === PointerInput.MouseWheelX || inputIndex === PointerInput.MouseWheelY || inputIndex === PointerInput.MouseWheelZ) {\r\n return this._CreateWheelEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo);\r\n }\r\n // eslint-disable-next-line no-fallthrough\r\n case DeviceType.Touch:\r\n return this._CreatePointerEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo);\r\n default:\r\n throw `Unable to generate event for device ${DeviceType[deviceType]}`;\r\n }\r\n }\r\n\r\n /**\r\n * Creates pointer event\r\n *\r\n * @param deviceType Type of device\r\n * @param deviceSlot \"Slot\" or index that device is referenced in\r\n * @param inputIndex Id of input to be checked\r\n * @param currentState Current value for given input\r\n * @param deviceInputSystem Reference to DeviceInputSystem\r\n * @param elementToAttachTo HTMLElement to reference as target for inputs\r\n * @returns IUIEvent object (Pointer)\r\n */\r\n private static _CreatePointerEvent(\r\n deviceType: DeviceType,\r\n deviceSlot: number,\r\n inputIndex: number,\r\n currentState: Nullable<number>,\r\n deviceInputSystem: IDeviceInputSystem,\r\n elementToAttachTo?: any\r\n ): any {\r\n const evt = this._CreateMouseEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo);\r\n\r\n if (deviceType === DeviceType.Mouse) {\r\n evt.deviceType = DeviceType.Mouse;\r\n evt.pointerId = 1;\r\n evt.pointerType = \"mouse\";\r\n } else {\r\n evt.deviceType = DeviceType.Touch;\r\n evt.pointerId = deviceSlot;\r\n evt.pointerType = \"touch\";\r\n }\r\n\r\n if (inputIndex === PointerInput.Move) {\r\n evt.type = \"pointermove\";\r\n } else if (inputIndex >= PointerInput.LeftClick && inputIndex <= PointerInput.RightClick) {\r\n evt.type = currentState === 1 ? \"pointerdown\" : \"pointerup\";\r\n evt.button = inputIndex - 2;\r\n }\r\n\r\n return evt;\r\n }\r\n\r\n /**\r\n * Create Mouse Wheel Event\r\n * @param deviceType Type of device\r\n * @param deviceSlot \"Slot\" or index that device is referenced in\r\n * @param inputIndex Id of input to be checked\r\n * @param currentState Current value for given input\r\n * @param deviceInputSystem Reference to DeviceInputSystem\r\n * @param elementToAttachTo HTMLElement to reference as target for inputs\r\n * @returns IUIEvent object (Wheel)\r\n */\r\n private static _CreateWheelEvent(\r\n deviceType: DeviceType,\r\n deviceSlot: number,\r\n inputIndex: number,\r\n currentState: Nullable<number>,\r\n deviceInputSystem: IDeviceInputSystem,\r\n elementToAttachTo: any\r\n ): any {\r\n const evt = this._CreateMouseEvent(deviceType, deviceSlot, inputIndex, currentState, deviceInputSystem, elementToAttachTo);\r\n\r\n evt.type = \"wheel\";\r\n evt.deltaMode = EventConstants.DOM_DELTA_PIXEL;\r\n evt.deltaX = 0;\r\n evt.deltaY = 0;\r\n evt.deltaZ = 0;\r\n\r\n switch (inputIndex) {\r\n case PointerInput.MouseWheelX:\r\n evt.deltaX = currentState;\r\n break;\r\n case PointerInput.MouseWheelY:\r\n evt.deltaY = currentState;\r\n break;\r\n case PointerInput.MouseWheelZ:\r\n evt.deltaZ = currentState;\r\n break;\r\n }\r\n\r\n return evt;\r\n }\r\n\r\n /**\r\n * Create Mouse Event\r\n * @param deviceType Type of device\r\n * @param deviceSlot \"Slot\" or index that device is referenced in\r\n * @param inputIndex Id of input to be checked\r\n * @param currentState Current value for given input\r\n * @param deviceInputSystem Reference to DeviceInputSystem\r\n * @param elementToAttachTo HTMLElement to reference as target for inputs\r\n * @returns IUIEvent object (Mouse)\r\n */\r\n private static _CreateMouseEvent(\r\n deviceType: DeviceType,\r\n deviceSlot: number,\r\n inputIndex: number,\r\n currentState: Nullable<number>,\r\n deviceInputSystem: IDeviceInputSystem,\r\n elementToAttachTo?: any\r\n ): any {\r\n const evt = this._CreateEvent(elementToAttachTo);\r\n const pointerX = deviceInputSystem.pollInput(deviceType, deviceSlot, PointerInput.Horizontal);\r\n const pointerY = deviceInputSystem.pollInput(deviceType, deviceSlot, PointerInput.Vertical);\r\n\r\n // Handle offsets/deltas based on existence of HTMLElement\r\n if (elementToAttachTo) {\r\n evt.movementX = 0;\r\n evt.movementY = 0;\r\n evt.offsetX = evt.movementX - elementToAttachTo.getBoundingClientRect().x;\r\n evt.offsetY = evt.movementY - elementToAttachTo.getBoundingClientRect().y;\r\n } else {\r\n evt.movementX = deviceInputSystem.pollInput(deviceType, deviceSlot, NativePointerInput.DeltaHorizontal); // DeltaHorizontal\r\n evt.movementY = deviceInputSystem.pollInput(deviceType, deviceSlot, NativePointerInput.DeltaVertical); // DeltaVertical\r\n evt.offsetX = 0;\r\n evt.offsetY = 0;\r\n }\r\n this._CheckNonCharacterKeys(evt, deviceInputSystem);\r\n\r\n evt.clientX = pointerX;\r\n evt.clientY = pointerY;\r\n evt.x = pointerX;\r\n evt.y = pointerY;\r\n\r\n evt.deviceType = deviceType;\r\n evt.deviceSlot = deviceSlot;\r\n evt.inputIndex = inputIndex;\r\n\r\n return evt;\r\n }\r\n\r\n /**\r\n * Create Keyboard Event\r\n * @param inputIndex Id of input to be checked\r\n * @param currentState Current value for given input\r\n * @param deviceInputSystem Reference to DeviceInputSystem\r\n * @param elementToAttachTo HTMLElement to reference as target for inputs\r\n * @returns IEvent object (Keyboard)\r\n */\r\n private static _CreateKeyboardEvent(inputIndex: number, currentState: Nullable<number>, deviceInputSystem: IDeviceInputSystem, elementToAttachTo?: any): any {\r\n const evt = this._CreateEvent(elementToAttachTo);\r\n this._CheckNonCharacterKeys(evt, deviceInputSystem);\r\n evt.deviceType = DeviceType.Keyboard;\r\n evt.deviceSlot = 0;\r\n evt.inputIndex = inputIndex;\r\n\r\n evt.type = currentState === 1 ? \"keydown\" : \"keyup\";\r\n evt.key = String.fromCharCode(inputIndex);\r\n evt.keyCode = inputIndex;\r\n\r\n return evt;\r\n }\r\n\r\n /**\r\n * Add parameters for non-character keys (Ctrl, Alt, Meta, Shift)\r\n * @param evt Event object to add parameters to\r\n * @param deviceInputSystem DeviceInputSystem to pull values from\r\n */\r\n private static _CheckNonCharacterKeys(evt: any, deviceInputSystem: IDeviceInputSystem): void {\r\n const isKeyboardActive = deviceInputSystem.isDeviceAvailable(DeviceType.Keyboard);\r\n const altKey = isKeyboardActive && deviceInputSystem.pollInput(DeviceType.Keyboard, 0, Constants.INPUT_ALT_KEY) === 1;\r\n const ctrlKey = isKeyboardActive && deviceInputSystem.pollInput(DeviceType.Keyboard, 0, Constants.INPUT_CTRL_KEY) === 1;\r\n const metaKey =\r\n isKeyboardActive &&\r\n (deviceInputSystem.pollInput(DeviceType.Keyboard, 0, Constants.INPUT_META_KEY1) === 1 ||\r\n deviceInputSystem.pollInput(DeviceType.Keyboard, 0, Constants.INPUT_META_KEY2) === 1 ||\r\n deviceInputSystem.pollInput(DeviceType.Keyboard, 0, Constants.INPUT_META_KEY3) === 1);\r\n const shiftKey = isKeyboardActive && deviceInputSystem.pollInput(DeviceType.Keyboard, 0, Constants.INPUT_SHIFT_KEY) === 1;\r\n\r\n evt.altKey = altKey;\r\n evt.ctrlKey = ctrlKey;\r\n evt.metaKey = metaKey;\r\n evt.shiftKey = shiftKey;\r\n }\r\n\r\n /**\r\n * Create base event object\r\n * @param elementToAttachTo Value to use as event target\r\n * @returns\r\n */\r\n private static _CreateEvent(elementToAttachTo: any): any {\r\n const evt: { [k: string]: any } = {};\r\n evt.preventDefault = () => {};\r\n evt.target = elementToAttachTo;\r\n\r\n return evt;\r\n }\r\n}\r\n"]}
@@ -1,5 +1,5 @@
1
- import type { IDisposable } from "../../scene";
2
- import type { DeviceType } from "./deviceEnums";
1
+ import type { IDisposable } from "../scene";
2
+ import type { DeviceType } from "./InputDevices/deviceEnums";
3
3
  /**
4
4
  * Interface for DeviceInputSystem implementations (JS and Native)
5
5
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inputInterfaces.js","sourceRoot":"","sources":["../../../../../lts/core/generated/DeviceInput/inputInterfaces.ts"],"names":[],"mappings":"","sourcesContent":["import type { IDisposable } from \"../scene\";\r\nimport type { DeviceType } from \"./InputDevices/deviceEnums\";\r\n\r\n/**\r\n * Interface for DeviceInputSystem implementations (JS and Native)\r\n */\r\nexport interface IDeviceInputSystem extends IDisposable {\r\n /**\r\n * Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.\r\n * @param deviceType Enum specifying device type\r\n * @param deviceSlot \"Slot\" or index that device is referenced in\r\n * @param inputIndex Id of input to be checked\r\n * @returns Current value of input\r\n */\r\n pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): number;\r\n\r\n /**\r\n * Check for a specific device in the DeviceInputSystem\r\n * @param deviceType Type of device to check for\r\n * @returns bool with status of device's existence\r\n */\r\n isDeviceAvailable(deviceType: DeviceType): boolean;\r\n}\r\n"]}
@@ -1,13 +1,13 @@
1
- import type { IDisposable } from "../../scene";
2
- import { DeviceType } from "./deviceEnums";
3
- import type { Observable } from "../../Misc/observable";
1
+ import type { IDisposable } from "../scene";
2
+ import { DeviceType } from "./InputDevices/deviceEnums";
3
+ import type { Observable } from "../Misc/observable";
4
4
  import type { IDeviceInputSystem } from "./inputInterfaces";
5
- import { DeviceSource } from "./deviceSource";
6
- import type { Engine } from "../../Engines/engine";
7
- import type { IUIEvent } from "../../Events/deviceInputEvents";
5
+ import { DeviceSource } from "./InputDevices/deviceSource";
6
+ import type { Engine } from "../Engines/engine";
7
+ import type { IUIEvent } from "../Events/deviceInputEvents";
8
8
  declare type Distribute<T> = T extends DeviceType ? DeviceSource<T> : never;
9
9
  export declare type DeviceSourceType = Distribute<DeviceType>;
10
- declare module "../../Engines/engine" {
10
+ declare module "../Engines/engine" {
11
11
  interface Engine {
12
12
  /** @hidden */
13
13
  _deviceSourceManager?: InternalDeviceSourceManager;
@@ -1,7 +1,7 @@
1
- import { DeviceType } from "./deviceEnums.js";
1
+ import { DeviceType } from "./InputDevices/deviceEnums.js";
2
2
  import { NativeDeviceInputSystem } from "./nativeDeviceInputSystem.js";
3
3
  import { WebDeviceInputSystem } from "./webDeviceInputSystem.js";
4
- import { DeviceSource } from "./deviceSource.js";
4
+ import { DeviceSource } from "./InputDevices/deviceSource.js";
5
5
  /** @hidden */
6
6
  var InternalDeviceSourceManager = /** @class */ (function () {
7
7
  function InternalDeviceSourceManager(engine) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internalDeviceSourceManager.js","sourceRoot":"","sources":["../../../../../lts/core/generated/DeviceInput/internalDeviceSourceManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAGxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,oBA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E,UAAU,EAAE,SAAS,CAAC,CAAC;iBAC9D;aACJ;QACL,CAAC,CAAC;QAEF,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;YAChC,IAAI,CAAC,kBAAkB,GAAG,IAAI,uBAAuB,CAAC,iBAAiB,EAAE,oBAAoB,EAAE,cAAc,CAAC,CAAC;SAClH;aAAM;YACH,IAAI,CAAC,kBAAkB,GAAG,IAAI,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,cAAc,CAAC,CAAC;SACvH;IACL,CAAC;IAsBM,6CAAO,GAAd;QACI,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,CAAC;IACtC,CAAC;IACL,kCAAC;AAAD,CAAC,AA7ED,IA6EC","sourcesContent":["import type { IDisposable } from \"../scene\";\r\nimport { DeviceType } from \"./InputDevices/deviceEnums\";\r\nimport type { Observable } from \"../Misc/observable\";\r\nimport type { IDeviceInputSystem } from \"./inputInterfaces\";\r\nimport { NativeDeviceInputSystem } from \"./nativeDeviceInputSystem\";\r\nimport { WebDeviceInputSystem } from \"./webDeviceInputSystem\";\r\nimport { DeviceSource } from \"./InputDevices/deviceSource\";\r\nimport type { INative } from \"../Engines/Native/nativeInterfaces\";\r\nimport type { Engine } from \"../Engines/engine\";\r\nimport type { IUIEvent } from \"../Events/deviceInputEvents\";\r\n\r\ntype Distribute<T> = T extends DeviceType ? DeviceSource<T> : never;\r\n\r\nexport type DeviceSourceType = Distribute<DeviceType>;\r\n\r\ndeclare const _native: INative;\r\n\r\ndeclare module \"../Engines/engine\" {\r\n interface Engine {\r\n /** @hidden */\r\n _deviceSourceManager?: InternalDeviceSourceManager;\r\n }\r\n}\r\n\r\n/** @hidden */\r\nexport interface IObservableManager {\r\n onDeviceConnectedObservable: Observable<DeviceSourceType>;\r\n onDeviceDisconnectedObservable: Observable<DeviceSourceType>;\r\n\r\n // Functions\r\n _onInputChanged(deviceType: DeviceType, deviceSlot: number, eventData: IUIEvent): void;\r\n _addDevice(deviceSource: DeviceSource<DeviceType>): void;\r\n _removeDevice(deviceType: DeviceType, deviceSlot: number): void;\r\n}\r\n\r\n/** @hidden */\r\nexport class InternalDeviceSourceManager implements IDisposable {\r\n // Public Members\r\n public readonly _deviceInputSystem: IDeviceInputSystem;\r\n\r\n // Private Members\r\n // This is a master list of all device type/slot combos\r\n private readonly _devices: Array<Array<number>>;\r\n\r\n private readonly _registeredManagers = new Array<IObservableManager>();\r\n\r\n public _refCount = 0;\r\n\r\n public constructor(engine: Engine) {\r\n const numberOfDeviceTypes = Object.keys(DeviceType).length / 2;\r\n this._devices = new Array<Array<number>>(numberOfDeviceTypes);\r\n\r\n const onDeviceConnected = (deviceType: DeviceType, deviceSlot: number) => {\r\n if (!this._devices[deviceType]) {\r\n this._devices[deviceType] = new Array<number>();\r\n }\r\n\r\n if (!this._devices[deviceType][deviceSlot]) {\r\n this._devices[deviceType][deviceSlot] = deviceSlot;\r\n }\r\n for (const manager of this._registeredManagers) {\r\n const deviceSource = new DeviceSource(this._deviceInputSystem, deviceType, deviceSlot);\r\n manager._addDevice(deviceSource);\r\n }\r\n };\r\n\r\n const onDeviceDisconnected = (deviceType: DeviceType, deviceSlot: number) => {\r\n if (this._devices[deviceType]?.[deviceSlot]) {\r\n delete this._devices[deviceType][deviceSlot];\r\n }\r\n for (const manager of this._registeredManagers) {\r\n manager._removeDevice(deviceType, deviceSlot);\r\n }\r\n };\r\n\r\n const onInputChanged = (deviceType: DeviceType, deviceSlot: number, eventData: IUIEvent) => {\r\n if (eventData) {\r\n for (const manager of this._registeredManagers) {\r\n manager._onInputChanged(deviceType, deviceSlot, eventData);\r\n }\r\n }\r\n };\r\n\r\n if (typeof _native !== \"undefined\") {\r\n this._deviceInputSystem = new NativeDeviceInputSystem(onDeviceConnected, onDeviceDisconnected, onInputChanged);\r\n } else {\r\n this._deviceInputSystem = new WebDeviceInputSystem(engine, onDeviceConnected, onDeviceDisconnected, onInputChanged);\r\n }\r\n }\r\n\r\n // Public Functions\r\n public readonly registerManager = (manager: IObservableManager): void => {\r\n for (let deviceType = 0; deviceType < this._devices.length; deviceType++) {\r\n const device = this._devices[deviceType];\r\n for (const deviceSlotKey in device) {\r\n const deviceSlot = +deviceSlotKey;\r\n manager._addDevice(new DeviceSource(this._deviceInputSystem, deviceType, deviceSlot));\r\n }\r\n }\r\n this._registeredManagers.push(manager);\r\n };\r\n\r\n public readonly unregisterManager = (manager: IObservableManager): void => {\r\n const idx = this._registeredManagers.indexOf(manager);\r\n\r\n if (idx > -1) {\r\n this._registeredManagers.splice(idx, 1);\r\n }\r\n };\r\n\r\n public dispose(): void {\r\n this._deviceInputSystem.dispose();\r\n }\r\n}\r\n"]}
@@ -1,5 +1,5 @@
1
- import type { IUIEvent } from "../../Events/deviceInputEvents";
2
- import { DeviceType } from "./deviceEnums";
1
+ import type { IUIEvent } from "../Events/deviceInputEvents";
2
+ import { DeviceType } from "./InputDevices/deviceEnums";
3
3
  import type { IDeviceInputSystem } from "./inputInterfaces";
4
4
  /** @hidden */
5
5
  export declare class NativeDeviceInputSystem implements IDeviceInputSystem {
@@ -1,5 +1,5 @@
1
- import { DeviceEventFactory } from "../Helpers/eventFactory.js";
2
- import { DeviceType } from "./deviceEnums.js";
1
+ import { DeviceEventFactory } from "./eventFactory.js";
2
+ import { DeviceType } from "./InputDevices/deviceEnums.js";
3
3
  /** @hidden */
4
4
  var NativeDeviceInputSystem = /** @class */ (function () {
5
5
  function NativeDeviceInputSystem(onDeviceConnected, onDeviceDisconnected, onInputChanged) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nativeDeviceInputSystem.js","sourceRoot":"","sources":["../../../../../lts/core/generated/DeviceInput/nativeDeviceInputSystem.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAKxD,cAAc;AACd;IAGI,iCACI,iBAAuE,EACvE,oBAA0E,EAC1E,c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";\r\nimport type { IUIEvent } from \"../Events/deviceInputEvents\";\r\nimport { DeviceEventFactory } from \"./eventFactory\";\r\nimport { DeviceType } from \"./InputDevices/deviceEnums\";\r\nimport type { IDeviceInputSystem } from \"./inputInterfaces\";\r\n\r\ndeclare const _native: INative;\r\n\r\n/** @hidden */\r\nexport class NativeDeviceInputSystem implements IDeviceInputSystem {\r\n private readonly _nativeInput: IDeviceInputSystem;\r\n\r\n public constructor(\r\n onDeviceConnected: (deviceType: DeviceType, deviceSlot: number) => void,\r\n onDeviceDisconnected: (deviceType: DeviceType, deviceSlot: number) => void,\r\n onInputChanged: (deviceType: DeviceType, deviceSlot: number, eventData: IUIEvent) => void\r\n ) {\r\n this._nativeInput = _native.DeviceInputSystem\r\n ? new _native.DeviceInputSystem(onDeviceConnected, onDeviceDisconnected, (deviceType, deviceSlot, inputIndex, currentState) => {\r\n const evt = DeviceEventFactory.CreateDeviceEvent(deviceType, deviceSlot, inputIndex, currentState, this);\r\n\r\n onInputChanged(deviceType, deviceSlot, evt);\r\n })\r\n : this._createDummyNativeInput();\r\n }\r\n\r\n // Public functions\r\n /**\r\n * Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.\r\n * @param deviceType Enum specifying device type\r\n * @param deviceSlot \"Slot\" or index that device is referenced in\r\n * @param inputIndex Id of input to be checked\r\n * @returns Current value of input\r\n */\r\n public pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): number {\r\n return this._nativeInput.pollInput(deviceType, deviceSlot, inputIndex);\r\n }\r\n\r\n /**\r\n * Check for a specific device in the DeviceInputSystem\r\n * @param deviceType Type of device to check for\r\n * @returns bool with status of device's existence\r\n */\r\n public isDeviceAvailable(deviceType: DeviceType): boolean {\r\n //TODO: FIx native side first\r\n return deviceType === DeviceType.Mouse || deviceType === DeviceType.Touch;\r\n }\r\n\r\n /**\r\n * Dispose of all the observables\r\n */\r\n public dispose(): void {\r\n this._nativeInput.dispose();\r\n }\r\n\r\n /**\r\n * For versions of BabylonNative that don't have the NativeInput plugin initialized, create a dummy version\r\n * @returns Object with dummy functions\r\n */\r\n private _createDummyNativeInput() {\r\n const nativeInput = {\r\n pollInput: () => {\r\n return 0;\r\n },\r\n isDeviceAvailable: () => {\r\n return false;\r\n },\r\n dispose: () => {},\r\n };\r\n\r\n return nativeInput;\r\n }\r\n}\r\n"]}
@@ -1,6 +1,6 @@
1
- import type { Engine } from "../../Engines/engine";
2
- import type { IUIEvent } from "../../Events/deviceInputEvents";
3
- import { DeviceType } from "./deviceEnums";
1
+ import type { Engine } from "../Engines/engine";
2
+ import type { IUIEvent } from "../Events/deviceInputEvents";
3
+ import { DeviceType } from "./InputDevices/deviceEnums";
4
4
  import type { IDeviceInputSystem } from "./inputInterfaces";
5
5
  /** @hidden */
6
6
  export declare class WebDeviceInputSystem implements IDeviceInputSystem {
@@ -1,7 +1,7 @@
1
- import { DomManagement } from "../../Misc/domManagement.js";
2
- import { Tools } from "../../Misc/tools.js";
3
- import { DeviceEventFactory } from "../Helpers/eventFactory.js";
4
- import { DeviceType, PointerInput } from "./deviceEnums.js";
1
+ import { DomManagement } from "../Misc/domManagement.js";
2
+ import { Tools } from "../Misc/tools.js";
3
+ import { DeviceEventFactory } from "./eventFactory.js";
4
+ import { DeviceType, PointerInput } from "./InputDevices/deviceEnums.js";
5
5
  // eslint-disable-next-line @typescript-eslint/naming-convention
6
6
  var MAX_KEYCODES = 255;
7
7
  // eslint-disable-next-line @typescript-eslint/naming-convention
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webDeviceInputSystem.js","sourceRoot":"","sources":["../../../../../lts/core/generated/DeviceInput/webDeviceInputSystem.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,4BAA4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KAAK,IAAI,GAAG,CAAC,OAAO,EAAE;YACzE,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC;SACjC;QAED,OAAO,UAAU,CAAC;IACtB,CAAC;IACL,2BAAC;AAAD,CAAC,AAtxBD,IAsxBC","sourcesContent":["import type { Engine } from \"../Engines/engine\";\r\nimport type { IUIEvent } from \"../Events/deviceInputEvents\";\r\nimport { DomManagement } from \"../Misc/domManagement\";\r\nimport type { Observer } from \"../Misc/observable\";\r\nimport { Tools } from \"../Misc/tools\";\r\nimport type { Nullable } from \"../types\";\r\nimport { DeviceEventFactory } from \"./eventFactory\";\r\nimport { DeviceType, PointerInput } from \"./InputDevices/deviceEnums\";\r\nimport type { IDeviceInputSystem } from \"./inputInterfaces\";\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nconst MAX_KEYCODES = 255;\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nconst MAX_POINTER_INPUTS = Object.keys(PointerInput).length / 2;\r\n\r\n/** @hidden */\r\nexport class WebDeviceInputSystem implements IDeviceInputSystem {\r\n // Private Members\r\n private _inputs: Array<{ [deviceSlot: number]: Array<number> }> = [];\r\n private _gamepads: Array<DeviceType>;\r\n private _keyboardActive: boolean = false;\r\n private _pointerActive: boolean = false;\r\n private _elementToAttachTo: HTMLElement;\r\n private _metaKeys: Array<number>;\r\n private readonly _engine: Engine;\r\n private readonly _usingSafari: boolean = Tools.IsSafari();\r\n // Found solution for determining if MacOS is being used here:\r\n // https://stackoverflow.com/questions/10527983/best-way-to-detect-mac-os-x-or-windows-computers-with-javascript-or-jquery\r\n private readonly _usingMacOS: boolean = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);\r\n\r\n private _onDeviceConnected: (deviceType: DeviceType, deviceSlot: number) => void;\r\n private _onDeviceDisconnected: (deviceType: DeviceType, deviceSlot: number) => void;\r\n private _onInputChanged: (deviceType: DeviceType, deviceSlot: number, eventData: IUIEvent) => void;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n private _keyboardDownEvent = (evt: any) => {};\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n private _keyboardUpEvent = (evt: any) => {};\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n private _keyboardBlurEvent = (evt: any) => {};\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n private _pointerMoveEvent = (evt: any) => {};\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n private _pointerDownEvent = (evt: any) => {};\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n private _pointerUpEvent = (evt: any) => {};\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n private _pointerCancelEvent = (evt: any) => {};\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n private _pointerWheelEvent = (evt: any) => {};\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n private _pointerBlurEvent = (evt: any) => {};\r\n private _wheelEventName: string;\r\n private _eventsAttached: boolean = false;\r\n\r\n private _mouseId = -1;\r\n private readonly _isUsingFirefox = DomManagement.IsNavigatorAvailable() && navigator.userAgent && navigator.userAgent.indexOf(\"Firefox\") !== -1;\r\n\r\n // Array to store active Pointer ID values; prevents issues with negative pointerIds\r\n private _activeTouchIds: Array<number>;\r\n private _maxTouchPoints: number = 0;\r\n\r\n private _pointerInputClearObserver: Nullable<Observer<Engine>> = null;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n private _gamepadConnectedEvent = (evt: any) => {};\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n private _gamepadDisconnectedEvent = (evt: any) => {};\r\n\r\n private _eventPrefix: string;\r\n\r\n constructor(\r\n engine: Engine,\r\n onDeviceConnected: (deviceType: DeviceType, deviceSlot: number) => void,\r\n onDeviceDisconnected: (deviceType: DeviceType, deviceSlot: number) => void,\r\n onInputChanged: (deviceType: DeviceType, deviceSlot: number, eventData: IUIEvent) => void\r\n ) {\r\n this._eventPrefix = Tools.GetPointerPrefix(engine);\r\n this._engine = engine;\r\n\r\n this._onDeviceConnected = onDeviceConnected;\r\n this._onDeviceDisconnected = onDeviceDisconnected;\r\n this._onInputChanged = onInputChanged;\r\n\r\n this._enableEvents();\r\n\r\n if (this._usingMacOS) {\r\n this._metaKeys = [];\r\n }\r\n\r\n // Set callback to enable event handler switching when inputElement changes\r\n if (!this._engine._onEngineViewChanged) {\r\n this._engine._onEngineViewChanged = () => {\r\n this._enableEvents();\r\n };\r\n }\r\n }\r\n\r\n // Public functions\r\n /**\r\n * Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.\r\n * @param deviceType Enum specifying device type\r\n * @param deviceSlot \"Slot\" or index that device is referenced in\r\n * @param inputIndex Id of input to be checked\r\n * @returns Current value of input\r\n */\r\n public pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): number {\r\n const device = this._inputs[deviceType][deviceSlot];\r\n\r\n if (!device) {\r\n throw `Unable to find device ${DeviceType[deviceType]}`;\r\n }\r\n\r\n if (deviceType >= DeviceType.DualShock && deviceType <= DeviceType.DualSense) {\r\n this._updateDevice(deviceType, deviceSlot, inputIndex);\r\n }\r\n\r\n const currentValue = device[inputIndex];\r\n if (currentValue === undefined) {\r\n throw `Unable to find input ${inputIndex} for device ${DeviceType[deviceType]} in slot ${deviceSlot}`;\r\n }\r\n\r\n if (inputIndex === PointerInput.Move) {\r\n Tools.Warn(`Unable to provide information for PointerInput.Move. Try using PointerInput.Horizontal or PointerInput.Vertical for move data.`);\r\n }\r\n\r\n return currentValue;\r\n }\r\n\r\n /**\r\n * Check for a specific device in the DeviceInputSystem\r\n * @param deviceType Type of device to check for\r\n * @returns bool with status of device's existence\r\n */\r\n public isDeviceAvailable(deviceType: DeviceType): boolean {\r\n return this._inputs[deviceType] !== undefined;\r\n }\r\n\r\n /**\r\n * Dispose of all the eventlisteners\r\n */\r\n public dispose(): void {\r\n // Callbacks\r\n this._onDeviceConnected = () => {};\r\n this._onDeviceDisconnected = () => {};\r\n this._onInputChanged = () => {};\r\n delete this._engine._onEngineViewChanged;\r\n\r\n if (this._elementToAttachTo) {\r\n this._disableEvents();\r\n }\r\n }\r\n\r\n /**\r\n * Enable listening for user input events\r\n */\r\n private _enableEvents(): void {\r\n const inputElement = this?._engine.getInputElement();\r\n if (inputElement && (!this._eventsAttached || this._elementToAttachTo !== inputElement)) {\r\n // Remove events before adding to avoid double events or simultaneous events on multiple canvases\r\n this._disableEvents();\r\n\r\n // If the inputs array has already been created, zero it out to before setting up events\r\n if (this._inputs) {\r\n for (const inputs of this._inputs) {\r\n if (inputs) {\r\n for (const deviceSlotKey in inputs) {\r\n const deviceSlot = +deviceSlotKey;\r\n const device = inputs[deviceSlot];\r\n if (device) {\r\n for (let inputIndex = 0; inputIndex < device.length; inputIndex++) {\r\n device[inputIndex] = 0;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n this._elementToAttachTo = inputElement;\r\n // Set tab index for the inputElement to the engine's canvasTabIndex, if and only if the element's tab index is -1\r\n this._elementToAttachTo.tabIndex = this._elementToAttachTo.tabIndex !== -1 ? this._elementToAttachTo.tabIndex : this._engine.canvasTabIndex;\r\n this._handleKeyActions();\r\n this._handlePointerActions();\r\n this._handleGamepadActions();\r\n this._eventsAttached = true;\r\n\r\n // Check for devices that are already connected but aren't registered. Currently, only checks for gamepads and mouse\r\n this._checkForConnectedDevices();\r\n }\r\n }\r\n\r\n /**\r\n * Disable listening for user input events\r\n */\r\n private _disableEvents(): void {\r\n if (this._elementToAttachTo) {\r\n // Blur Events\r\n this._elementToAttachTo.removeEventListener(\"blur\", this._keyboardBlurEvent);\r\n this._elementToAttachTo.removeEventListener(\"blur\", this._pointerBlurEvent);\r\n\r\n // Keyboard Events\r\n this._elementToAttachTo.removeEventListener(\"keydown\", this._keyboardDownEvent);\r\n this._elementToAttachTo.removeEventListener(\"keyup\", this._keyboardUpEvent);\r\n\r\n // Pointer Events\r\n this._elementToAttachTo.removeEventListener(this._eventPrefix + \"move\", this._pointerMoveEvent);\r\n this._elementToAttachTo.removeEventListener(this._eventPrefix + \"down\", this._pointerDownEvent);\r\n this._elementToAttachTo.removeEventListener(this._eventPrefix + \"up\", this._pointerUpEvent);\r\n this._elementToAttachTo.removeEventListener(this._eventPrefix + \"cancel\", this._pointerCancelEvent);\r\n this._elementToAttachTo.removeEventListener(this._wheelEventName, this._pointerWheelEvent);\r\n\r\n // Gamepad Events\r\n window.removeEventListener(\"gamepadconnected\", this._gamepadConnectedEvent);\r\n window.removeEventListener(\"gamepaddisconnected\", this._gamepadDisconnectedEvent);\r\n }\r\n\r\n if (this._pointerInputClearObserver) {\r\n this._engine.onEndFrameObservable.remove(this._pointerInputClearObserver);\r\n }\r\n\r\n this._eventsAttached = false;\r\n }\r\n\r\n /**\r\n * Checks for existing connections to devices and register them, if necessary\r\n * Currently handles gamepads and mouse\r\n */\r\n private _checkForConnectedDevices(): void {\r\n if (navigator.getGamepads) {\r\n const gamepads = navigator.getGamepads();\r\n\r\n for (const gamepad of gamepads) {\r\n if (gamepad) {\r\n this._addGamePad(gamepad);\r\n }\r\n }\r\n }\r\n\r\n // If the device in use has mouse capabilities, pre-register mouse\r\n if (typeof matchMedia === \"function\" && matchMedia(\"(pointer:fine)\").matches) {\r\n // This will provide a dummy value for the cursor position and is expected to be overridden when the first mouse event happens.\r\n // There isn't any good way to get the current position outside of a pointer event so that's why this was done.\r\n this._addPointerDevice(DeviceType.Mouse, 0, 0, 0);\r\n }\r\n }\r\n\r\n // Private functions\r\n /**\r\n * Add a gamepad to the DeviceInputSystem\r\n * @param gamepad A single DOM Gamepad object\r\n */\r\n private _addGamePad(gamepad: any): void {\r\n const deviceType = this._getGamepadDeviceType(gamepad.id);\r\n const deviceSlot = gamepad.index;\r\n\r\n this._gamepads = this._gamepads || new Array<DeviceType>(gamepad.index + 1);\r\n this._registerDevice(deviceType, deviceSlot, gamepad.buttons.length + gamepad.axes.length);\r\n\r\n this._gamepads[deviceSlot] = deviceType;\r\n }\r\n\r\n /**\r\n * Add pointer device to DeviceInputSystem\r\n * @param deviceType Type of Pointer to add\r\n * @param deviceSlot Pointer ID (0 for mouse, pointerId for Touch)\r\n * @param currentX Current X at point of adding\r\n * @param currentY Current Y at point of adding\r\n */\r\n private _addPointerDevice(deviceType: DeviceType, deviceSlot: number, currentX: number, currentY: number): void {\r\n if (!this._pointerActive) {\r\n this._pointerActive = true;\r\n }\r\n this._registerDevice(deviceType, deviceSlot, MAX_POINTER_INPUTS);\r\n const pointer = this._inputs[deviceType][deviceSlot]; /* initialize our pointer position immediately after registration */\r\n pointer[0] = currentX;\r\n pointer[1] = currentY;\r\n }\r\n\r\n /**\r\n * Add device and inputs to device array\r\n * @param deviceType Enum specifying device type\r\n * @param deviceSlot \"Slot\" or index that device is referenced in\r\n * @param numberOfInputs Number of input entries to create for given device\r\n */\r\n private _registerDevice(deviceType: DeviceType, deviceSlot: number, numberOfInputs: number): void {\r\n if (deviceSlot === undefined) {\r\n throw `Unable to register device ${DeviceType[deviceType]} to undefined slot.`;\r\n }\r\n\r\n if (!this._inputs[deviceType]) {\r\n this._inputs[deviceType] = {};\r\n }\r\n\r\n if (!this._inputs[deviceType][deviceSlot]) {\r\n const device = new Array<number>(numberOfInputs);\r\n\r\n device.fill(0);\r\n\r\n this._inputs[deviceType][deviceSlot] = device;\r\n this._onDeviceConnected(deviceType, deviceSlot);\r\n }\r\n }\r\n\r\n /**\r\n * Given a specific device name, remove that device from the device map\r\n * @param deviceType Enum specifying device type\r\n * @param deviceSlot \"Slot\" or index that device is referenced in\r\n */\r\n private _unregisterDevice(deviceType: DeviceType, deviceSlot: number): void {\r\n if (this._inputs[deviceType][deviceSlot]) {\r\n delete this._inputs[deviceType][deviceSlot];\r\n this._onDeviceDisconnected(deviceType, deviceSlot);\r\n }\r\n }\r\n\r\n /**\r\n * Handle all actions that come from keyboard interaction\r\n */\r\n private _handleKeyActions(): void {\r\n this._keyboardDownEvent = (evt) => {\r\n if (!this._keyboardActive) {\r\n this._keyboardActive = true;\r\n this._registerDevice(DeviceType.Keyboard, 0, MAX_KEYCODES);\r\n }\r\n\r\n const kbKey = this._inputs[DeviceType.Keyboard][0];\r\n if (kbKey) {\r\n kbKey[evt.keyCode] = 1;\r\n\r\n const deviceEvent = evt as IUIEvent;\r\n deviceEvent.inputIndex = evt.keyCode;\r\n\r\n if (this._usingMacOS && evt.metaKey && evt.key !== \"Meta\") {\r\n if (!this._metaKeys.includes(evt.keyCode)) {\r\n this._metaKeys.push(evt.keyCode);\r\n }\r\n }\r\n\r\n this._onInputChanged(DeviceType.Keyboard, 0, deviceEvent);\r\n }\r\n };\r\n\r\n this._keyboardUpEvent = (evt) => {\r\n if (!this._keyboardActive) {\r\n this._keyboardActive = true;\r\n this._registerDevice(DeviceType.Keyboard, 0, MAX_KEYCODES);\r\n }\r\n\r\n const kbKey = this._inputs[DeviceType.Keyboard][0];\r\n if (kbKey) {\r\n kbKey[evt.keyCode] = 0;\r\n\r\n const deviceEvent = evt as IUIEvent;\r\n deviceEvent.inputIndex = evt.keyCode;\r\n\r\n if (this._usingMacOS && evt.key === \"Meta\" && this._metaKeys.length > 0) {\r\n for (const keyCode of this._metaKeys) {\r\n const deviceEvent: IUIEvent = DeviceEventFactory.CreateDeviceEvent(DeviceType.Keyboard, 0, keyCode, 0, this, this._elementToAttachTo);\r\n kbKey[keyCode] = 0;\r\n this._onInputChanged(DeviceType.Keyboard, 0, deviceEvent);\r\n }\r\n this._metaKeys.splice(0, this._metaKeys.length);\r\n }\r\n\r\n this._onInputChanged(DeviceType.Keyboard, 0, deviceEvent);\r\n }\r\n };\r\n\r\n this._keyboardBlurEvent = () => {\r\n if (this._keyboardActive) {\r\n const kbKey = this._inputs[DeviceType.Keyboard][0];\r\n\r\n for (let i = 0; i < kbKey.length; i++) {\r\n if (kbKey[i] !== 0) {\r\n kbKey[i] = 0;\r\n\r\n const deviceEvent: IUIEvent = DeviceEventFactory.CreateDeviceEvent(DeviceType.Keyboard, 0, i, 0, this, this._elementToAttachTo);\r\n\r\n this._onInputChanged(DeviceType.Keyboard, 0, deviceEvent);\r\n }\r\n }\r\n if (this._usingMacOS) {\r\n this._metaKeys.splice(0, this._metaKeys.length);\r\n }\r\n }\r\n };\r\n\r\n this._elementToAttachTo.addEventListener(\"keydown\", this._keyboardDownEvent);\r\n this._elementToAttachTo.addEventListener(\"keyup\", this._keyboardUpEvent);\r\n this._elementToAttachTo.addEventListener(\"blur\", this._keyboardBlurEvent);\r\n }\r\n\r\n /**\r\n * Handle all actions that come from pointer interaction\r\n */\r\n private _handlePointerActions(): void {\r\n // If maxTouchPoints is defined, use that value. Otherwise, allow for a minimum for supported gestures like pinch\r\n this._maxTouchPoints = (DomManagement.IsNavigatorAvailable() && navigator.maxTouchPoints) || 2;\r\n if (!this._activeTouchIds) {\r\n this._activeTouchIds = new Array<number>(this._maxTouchPoints);\r\n }\r\n\r\n for (let i = 0; i < this._maxTouchPoints; i++) {\r\n this._activeTouchIds[i] = -1;\r\n }\r\n\r\n this._pointerMoveEvent = (evt) => {\r\n const deviceType = this._getPointerType(evt);\r\n const deviceSlot = deviceType === DeviceType.Mouse ? 0 : this._activeTouchIds.indexOf(evt.pointerId);\r\n\r\n if (!this._inputs[deviceType]) {\r\n this._inputs[deviceType] = {};\r\n }\r\n\r\n if (!this._inputs[deviceType][deviceSlot]) {\r\n this._addPointerDevice(deviceType, deviceSlot, evt.clientX, evt.clientY);\r\n }\r\n\r\n const pointer = this._inputs[deviceType][deviceSlot];\r\n if (pointer) {\r\n pointer[PointerInput.Horizontal] = evt.clientX;\r\n pointer[PointerInput.Vertical] = evt.clientY;\r\n\r\n const deviceEvent = evt as IUIEvent;\r\n deviceEvent.inputIndex = PointerInput.Move;\r\n\r\n this._onInputChanged(deviceType, deviceSlot, deviceEvent);\r\n\r\n // Lets Propagate the event for move with same position.\r\n if (!this._usingSafari && evt.button !== -1) {\r\n deviceEvent.inputIndex = evt.button + 2;\r\n pointer[evt.button + 2] = pointer[evt.button + 2] ? 0 : 1; // Reverse state of button if evt.button has value\r\n this._onInputChanged(deviceType, deviceSlot, deviceEvent);\r\n }\r\n }\r\n };\r\n\r\n this._pointerDownEvent = (evt) => {\r\n const deviceType = this._getPointerType(evt);\r\n let deviceSlot = deviceType === DeviceType.Mouse ? 0 : evt.pointerId;\r\n\r\n if (deviceType === DeviceType.Touch) {\r\n const idx = this._activeTouchIds.indexOf(-1);\r\n\r\n if (idx >= 0) {\r\n deviceSlot = idx;\r\n this._activeTouchIds[idx] = evt.pointerId;\r\n } else {\r\n // We can't find an open slot to store new pointer so just return (can only support max number of touches)\r\n Tools.Warn(`Max number of touches exceeded. Ignoring touches in excess of ${this._maxTouchPoints}`);\r\n return;\r\n }\r\n }\r\n\r\n if (!this._inputs[deviceType]) {\r\n this._inputs[deviceType] = {};\r\n }\r\n\r\n if (!this._inputs[deviceType][deviceSlot]) {\r\n this._addPointerDevice(deviceType, deviceSlot, evt.clientX, evt.clientY);\r\n } else if (deviceType === DeviceType.Touch) {\r\n this._onDeviceConnected(deviceType, deviceSlot);\r\n }\r\n\r\n const pointer = this._inputs[deviceType][deviceSlot];\r\n if (pointer) {\r\n const previousHorizontal = pointer[PointerInput.Horizontal];\r\n const previousVertical = pointer[PointerInput.Vertical];\r\n\r\n if (deviceType === DeviceType.Mouse) {\r\n // Mouse; Among supported browsers, value is either 1 or 0 for mouse\r\n if (this._mouseId === -1) {\r\n if (evt.pointerId === undefined) {\r\n // If there is no pointerId (eg. manually dispatched MouseEvent)\r\n this._mouseId = this._isUsingFirefox ? 0 : 1;\r\n } else {\r\n this._mouseId = evt.pointerId;\r\n }\r\n }\r\n\r\n if (!document.pointerLockElement) {\r\n try {\r\n this._elementToAttachTo.setPointerCapture(this._mouseId);\r\n } catch (e) {\r\n // DO NOTHING\r\n }\r\n }\r\n } else {\r\n // Touch; Since touches are dynamically assigned, only set capture if we have an id\r\n if (evt.pointerId && !document.pointerLockElement) {\r\n try {\r\n this._elementToAttachTo.setPointerCapture(evt.pointerId);\r\n } catch (e) {\r\n // DO NOTHING\r\n }\r\n }\r\n }\r\n\r\n pointer[PointerInput.Horizontal] = evt.clientX;\r\n pointer[PointerInput.Vertical] = evt.clientY;\r\n pointer[evt.button + 2] = 1;\r\n\r\n const deviceEvent = evt as IUIEvent;\r\n\r\n // NOTE: The +2 used here to is because PointerInput has the same value progression for its mouse buttons as PointerEvent.button\r\n // However, we have our X and Y values front-loaded to group together the touch inputs but not break this progression\r\n // EG. ([X, Y, Left-click], Middle-click, etc...)\r\n deviceEvent.inputIndex = evt.button + 2;\r\n\r\n this._onInputChanged(deviceType, deviceSlot, deviceEvent);\r\n\r\n if (previousHorizontal !== evt.clientX || previousVertical !== evt.clientY) {\r\n deviceEvent.inputIndex = PointerInput.Move;\r\n this._onInputChanged(deviceType, deviceSlot, deviceEvent);\r\n }\r\n }\r\n };\r\n\r\n this._pointerUpEvent = (evt) => {\r\n const deviceType = this._getPointerType(evt);\r\n const deviceSlot = deviceType === DeviceType.Mouse ? 0 : this._activeTouchIds.indexOf(evt.pointerId);\r\n\r\n if (deviceType === DeviceType.Touch) {\r\n if (deviceSlot === -1) {\r\n return;\r\n } else {\r\n this._activeTouchIds[deviceSlot] = -1;\r\n }\r\n }\r\n\r\n const pointer = this._inputs[deviceType]?.[deviceSlot];\r\n if (pointer && pointer[evt.button + 2] !== 0) {\r\n const previousHorizontal = pointer[PointerInput.Horizontal];\r\n const previousVertical = pointer[PointerInput.Vertical];\r\n\r\n pointer[PointerInput.Horizontal] = evt.clientX;\r\n pointer[PointerInput.Vertical] = evt.clientY;\r\n pointer[evt.button + 2] = 0;\r\n\r\n const deviceEvent = evt as IUIEvent;\r\n\r\n if (previousHorizontal !== evt.clientX || previousVertical !== evt.clientY) {\r\n deviceEvent.inputIndex = PointerInput.Move;\r\n this._onInputChanged(deviceType, deviceSlot, deviceEvent);\r\n }\r\n\r\n // NOTE: The +2 used here to is because PointerInput has the same value progression for its mouse buttons as PointerEvent.button\r\n // However, we have our X and Y values front-loaded to group together the touch inputs but not break this progression\r\n // EG. ([X, Y, Left-click], Middle-click, etc...)\r\n deviceEvent.inputIndex = evt.button + 2;\r\n\r\n if (deviceType === DeviceType.Mouse && this._mouseId >= 0 && this._elementToAttachTo.hasPointerCapture?.(this._mouseId)) {\r\n this._elementToAttachTo.releasePointerCapture(this._mouseId);\r\n } else if (evt.pointerId && this._elementToAttachTo.hasPointerCapture?.(evt.pointerId)) {\r\n this._elementToAttachTo.releasePointerCapture(evt.pointerId);\r\n }\r\n\r\n this._onInputChanged(deviceType, deviceSlot, deviceEvent);\r\n\r\n if (deviceType === DeviceType.Touch) {\r\n this._onDeviceDisconnected(deviceType, deviceSlot);\r\n }\r\n }\r\n };\r\n\r\n this._pointerCancelEvent = (evt) => {\r\n if (evt.pointerType === \"mouse\") {\r\n const pointer = this._inputs[DeviceType.Mouse][0];\r\n\r\n if (this._mouseId >= 0 && this._elementToAttachTo.hasPointerCapture?.(this._mouseId)) {\r\n this._elementToAttachTo.releasePointerCapture(this._mouseId);\r\n }\r\n\r\n for (let inputIndex = PointerInput.LeftClick; inputIndex <= PointerInput.BrowserForward; inputIndex++) {\r\n if (pointer[inputIndex] === 1) {\r\n pointer[inputIndex] = 0;\r\n\r\n const deviceEvent: IUIEvent = DeviceEventFactory.CreateDeviceEvent(DeviceType.Mouse, 0, inputIndex, 0, this, this._elementToAttachTo);\r\n\r\n this._onInputChanged(DeviceType.Mouse, 0, deviceEvent);\r\n }\r\n }\r\n } else {\r\n const deviceSlot = this._activeTouchIds.indexOf(evt.pointerId);\r\n\r\n if (this._elementToAttachTo.hasPointerCapture?.(evt.pointerId)) {\r\n this._elementToAttachTo.releasePointerCapture(evt.pointerId);\r\n }\r\n\r\n this._inputs[DeviceType.Touch][deviceSlot][PointerInput.LeftClick] = 0;\r\n\r\n const deviceEvent: IUIEvent = DeviceEventFactory.CreateDeviceEvent(DeviceType.Touch, deviceSlot, PointerInput.LeftClick, 0, this, this._elementToAttachTo);\r\n\r\n this._onInputChanged(DeviceType.Touch, deviceSlot, deviceEvent);\r\n\r\n this._activeTouchIds[deviceSlot] = -1;\r\n this._onDeviceDisconnected(DeviceType.Touch, deviceSlot);\r\n }\r\n };\r\n\r\n // Set Wheel Event Name, code originally from scene.inputManager\r\n this._wheelEventName =\r\n \"onwheel\" in document.createElement(\"div\")\r\n ? \"wheel\" // Modern browsers support \"wheel\"\r\n : (<any>document).onmousewheel !== undefined\r\n ? \"mousewheel\" // Webkit and IE support at least \"mousewheel\"\r\n : \"DOMMouseScroll\"; // let's assume that remaining browsers are older Firefox\r\n\r\n // Code originally in scene.inputManager.ts\r\n // Chrome reports warning in console if wheel listener doesn't set an explicit passive option.\r\n // IE11 only supports captureEvent:boolean, not options:object, and it defaults to false.\r\n // Feature detection technique copied from: https://github.com/github/eventlistener-polyfill (MIT license)\r\n let passiveSupported = false;\r\n const noop = function () {};\r\n\r\n try {\r\n const options = Object.defineProperty({}, \"passive\", {\r\n get: function () {\r\n passiveSupported = true;\r\n },\r\n });\r\n\r\n this._elementToAttachTo.addEventListener(\"test\", noop, options);\r\n this._elementToAttachTo.removeEventListener(\"test\", noop, options);\r\n } catch (e) {\r\n /* */\r\n }\r\n\r\n this._pointerBlurEvent = () => {\r\n // Handle mouse buttons\r\n if (this.isDeviceAvailable(DeviceType.Mouse)) {\r\n const pointer = this._inputs[DeviceType.Mouse][0];\r\n\r\n if (this._mouseId >= 0 && this._elementToAttachTo.hasPointerCapture?.(this._mouseId)) {\r\n this._elementToAttachTo.releasePointerCapture(this._mouseId);\r\n }\r\n\r\n for (let inputIndex = PointerInput.LeftClick; inputIndex <= PointerInput.BrowserForward; inputIndex++) {\r\n if (pointer[inputIndex] === 1) {\r\n pointer[inputIndex] = 0;\r\n\r\n const deviceEvent: IUIEvent = DeviceEventFactory.CreateDeviceEvent(DeviceType.Mouse, 0, inputIndex, 0, this, this._elementToAttachTo);\r\n\r\n this._onInputChanged(DeviceType.Mouse, 0, deviceEvent);\r\n }\r\n }\r\n }\r\n\r\n // Handle Active Touches\r\n if (this.isDeviceAvailable(DeviceType.Touch)) {\r\n const pointer = this._inputs[DeviceType.Touch];\r\n\r\n for (let deviceSlot = 0; deviceSlot < this._activeTouchIds.length; deviceSlot++) {\r\n const pointerId = this._activeTouchIds[deviceSlot];\r\n\r\n if (this._elementToAttachTo.hasPointerCapture?.(pointerId)) {\r\n this._elementToAttachTo.releasePointerCapture(pointerId);\r\n }\r\n\r\n if (pointerId !== -1 && pointer[deviceSlot]?.[PointerInput.LeftClick] === 1) {\r\n pointer[deviceSlot][PointerInput.LeftClick] = 0;\r\n\r\n const deviceEvent: IUIEvent = DeviceEventFactory.CreateDeviceEvent(DeviceType.Touch, deviceSlot, PointerInput.LeftClick, 0, this, this._elementToAttachTo);\r\n\r\n this._onInputChanged(DeviceType.Touch, deviceSlot, deviceEvent);\r\n\r\n this._activeTouchIds[deviceSlot] = -1;\r\n this._onDeviceDisconnected(DeviceType.Touch, deviceSlot);\r\n }\r\n }\r\n }\r\n };\r\n\r\n this._pointerWheelEvent = (evt) => {\r\n const deviceType = DeviceType.Mouse;\r\n const deviceSlot = 0;\r\n\r\n if (!this._inputs[deviceType]) {\r\n this._inputs[deviceType] = [];\r\n }\r\n\r\n if (!this._inputs[deviceType][deviceSlot]) {\r\n this._pointerActive = true;\r\n this._registerDevice(deviceType, deviceSlot, MAX_POINTER_INPUTS);\r\n }\r\n\r\n const pointer = this._inputs[deviceType][deviceSlot];\r\n if (pointer) {\r\n pointer[PointerInput.MouseWheelX] = evt.deltaX || 0;\r\n pointer[PointerInput.MouseWheelY] = evt.deltaY || evt.wheelDelta || 0;\r\n pointer[PointerInput.MouseWheelZ] = evt.deltaZ || 0;\r\n\r\n const deviceEvent = evt as IUIEvent;\r\n\r\n if (pointer[PointerInput.MouseWheelX] !== 0) {\r\n deviceEvent.inputIndex = PointerInput.MouseWheelX;\r\n this._onInputChanged(deviceType, deviceSlot, deviceEvent);\r\n }\r\n if (pointer[PointerInput.MouseWheelY] !== 0) {\r\n deviceEvent.inputIndex = PointerInput.MouseWheelY;\r\n this._onInputChanged(deviceType, deviceSlot, deviceEvent);\r\n }\r\n if (pointer[PointerInput.MouseWheelZ] !== 0) {\r\n deviceEvent.inputIndex = PointerInput.MouseWheelZ;\r\n this._onInputChanged(deviceType, deviceSlot, deviceEvent);\r\n }\r\n }\r\n };\r\n\r\n this._elementToAttachTo.addEventListener(this._eventPrefix + \"move\", this._pointerMoveEvent);\r\n this._elementToAttachTo.addEventListener(this._eventPrefix + \"down\", this._pointerDownEvent);\r\n this._elementToAttachTo.addEventListener(this._eventPrefix + \"up\", this._pointerUpEvent);\r\n this._elementToAttachTo.addEventListener(this._eventPrefix + \"cancel\", this._pointerCancelEvent);\r\n this._elementToAttachTo.addEventListener(\"blur\", this._pointerBlurEvent);\r\n this._elementToAttachTo.addEventListener(this._wheelEventName, this._pointerWheelEvent, passiveSupported ? { passive: false } : false);\r\n\r\n // Since there's no up or down event for mouse wheel or delta x/y, clear mouse values at end of frame\r\n this._pointerInputClearObserver = this._engine.onEndFrameObservable.add(() => {\r\n if (this.isDeviceAvailable(DeviceType.Mouse)) {\r\n const pointer = this._inputs[DeviceType.Mouse][0];\r\n pointer[PointerInput.MouseWheelX] = 0;\r\n pointer[PointerInput.MouseWheelY] = 0;\r\n pointer[PointerInput.MouseWheelZ] = 0;\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Handle all actions that come from gamepad interaction\r\n */\r\n private _handleGamepadActions(): void {\r\n this._gamepadConnectedEvent = (evt: any) => {\r\n this._addGamePad(evt.gamepad);\r\n };\r\n\r\n this._gamepadDisconnectedEvent = (evt: any) => {\r\n if (this._gamepads) {\r\n const deviceType = this._getGamepadDeviceType(evt.gamepad.id);\r\n const deviceSlot = evt.gamepad.index;\r\n\r\n this._unregisterDevice(deviceType, deviceSlot);\r\n delete this._gamepads[deviceSlot];\r\n }\r\n };\r\n\r\n window.addEventListener(\"gamepadconnected\", this._gamepadConnectedEvent);\r\n window.addEventListener(\"gamepaddisconnected\", this._gamepadDisconnectedEvent);\r\n }\r\n\r\n /**\r\n * Update all non-event based devices with each frame\r\n * @param deviceType Enum specifying device type\r\n * @param deviceSlot \"Slot\" or index that device is referenced in\r\n * @param inputIndex Id of input to be checked\r\n */\r\n private _updateDevice(deviceType: DeviceType, deviceSlot: number, inputIndex: number): void {\r\n // Gamepads\r\n const gp = navigator.getGamepads()[deviceSlot];\r\n\r\n if (gp && deviceType === this._gamepads[deviceSlot]) {\r\n const device = this._inputs[deviceType][deviceSlot];\r\n\r\n if (inputIndex >= gp.buttons.length) {\r\n device[inputIndex] = gp.axes[inputIndex - gp.buttons.length].valueOf();\r\n } else {\r\n device[inputIndex] = gp.buttons[inputIndex].value;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets DeviceType from the device name\r\n * @param deviceName Name of Device from DeviceInputSystem\r\n * @returns DeviceType enum value\r\n */\r\n private _getGamepadDeviceType(deviceName: string): DeviceType {\r\n if (deviceName.indexOf(\"054c\") !== -1) {\r\n // DualShock 4 Gamepad\r\n return deviceName.indexOf(\"0ce6\") !== -1 ? DeviceType.DualSense : DeviceType.DualShock;\r\n } else if (deviceName.indexOf(\"Xbox One\") !== -1 || deviceName.search(\"Xbox 360\") !== -1 || deviceName.search(\"xinput\") !== -1) {\r\n // Xbox Gamepad\r\n return DeviceType.Xbox;\r\n } else if (deviceName.indexOf(\"057e\") !== -1) {\r\n // Switch Gamepad\r\n return DeviceType.Switch;\r\n }\r\n\r\n return DeviceType.Generic;\r\n }\r\n\r\n /**\r\n * Get DeviceType from a given pointer/mouse/touch event.\r\n * @param evt PointerEvent to evaluate\r\n * @returns DeviceType interpreted from event\r\n */\r\n private _getPointerType(evt: any): DeviceType {\r\n let deviceType = DeviceType.Mouse;\r\n\r\n if (evt.pointerType === \"touch\" || evt.pointerType === \"pen\" || evt.touches) {\r\n deviceType = DeviceType.Touch;\r\n }\r\n\r\n return deviceType;\r\n }\r\n}\r\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { DeviceType } from "../../DeviceInput/InputDevices/deviceEnums";
2
- import type { IDeviceInputSystem } from "../../DeviceInput/InputDevices/inputInterfaces";
2
+ import type { IDeviceInputSystem } from "../../DeviceInput/inputInterfaces";
3
3
  import type { InternalTexture } from "../../Materials/Textures/internalTexture";
4
4
  import type { Nullable } from "../../types";
5
5
  import type { ICanvas, IImage } from "../ICanvas";
@@ -1 +1 @@
1
- {"version":3,"file":"nativeInterfaces.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Engines/Native/nativeInterfaces.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { DeviceType } from \"../../DeviceInput/InputDevices/deviceEnums\";\r\nimport type { IDeviceInputSystem } from \"../../DeviceInput/InputDevices/inputInterfaces\";\r\nimport type { InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { ICanvas, IImage } from \"../ICanvas\";\r\nimport type { NativeData, NativeDataStream } from \"./nativeDataStream\";\r\n\r\n/** @hidden */\r\nexport interface INativeEngine {\r\n dispose(): void;\r\n\r\n requestAnimationFrame(callback: () => void): void;\r\n\r\n createVertexArray(): NativeData;\r\n\r\n createIndexBuffer(bytes: ArrayBuffer, byteOffset: number, byteLength: number, is32Bits: boolean, dynamic: boolean): NativeData;\r\n recordIndexBuffer(vertexArray: NativeData, indexBuffer: NativeData): void;\r\n updateDynamicIndexBuffer(buffer: NativeData, bytes: ArrayBuffer, byteOffset: number, byteLength: number, startIndex: number): void;\r\n\r\n createVertexBuffer(bytes: ArrayBuffer, byteOffset: number, byteLength: number, dynamic: boolean): NativeData;\r\n recordVertexBuffer(\r\n vertexArray: NativeData,\r\n vertexBuffer: NativeData,\r\n location: number,\r\n byteOffset: number,\r\n byteStride: number,\r\n numElements: number,\r\n type: number,\r\n normalized: boolean,\r\n instanceDivisor: number\r\n ): void;\r\n updateDynamicVertexBuffer(vertexBuffer: NativeData, bytes: ArrayBuffer, byteOffset: number, byteLength: number): void;\r\n\r\n createProgram(vertexShader: string, fragmentShader: string): any;\r\n getUniforms(shaderProgram: any, uniformsNames: string[]): WebGLUniformLocation[];\r\n getAttributes(shaderProgram: any, attributeNames: string[]): number[];\r\n\r\n createTexture(): WebGLTexture;\r\n loadTexture(texture: WebGLTexture, data: ArrayBufferView, generateMips: boolean, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n loadRawTexture(texture: WebGLTexture, data: ArrayBufferView, width: number, height: number, format: number, generateMips: boolean, invertY: boolean): void;\r\n loadRawTexture2DArray(\r\n texture: WebGLTexture,\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean\r\n ): void;\r\n loadCubeTexture(texture: WebGLTexture, data: Array<ArrayBufferView>, generateMips: boolean, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n loadCubeTextureWithMips(texture: WebGLTexture, data: Array<Array<ArrayBufferView>>, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n getTextureWidth(texture: WebGLTexture): number;\r\n getTextureHeight(texture: WebGLTexture): number;\r\n copyTexture(desination: Nullable<WebGLTexture>, source: Nullable<WebGLTexture>): void;\r\n deleteTexture(texture: Nullable<WebGLTexture>): void;\r\n readTexture(\r\n texture: WebGLTexture,\r\n mipLevel: number,\r\n x: number,\r\n y: number,\r\n width: number,\r\n height: number,\r\n buffer: Nullable<ArrayBuffer>,\r\n bufferOffset: number,\r\n bufferLength: number\r\n ): Promise<ArrayBuffer>;\r\n\r\n createImageBitmap(data: ArrayBufferView | IImage): ImageBitmap;\r\n resizeImageBitmap(image: ImageBitmap, bufferWidth: number, bufferHeight: number): Uint8Array;\r\n\r\n createFrameBuffer(\r\n texture: WebGLTexture,\r\n width: number,\r\n height: number,\r\n format: number,\r\n generateStencilBuffer: boolean,\r\n generateDepthBuffer: boolean,\r\n generateMips: boolean\r\n ): WebGLFramebuffer;\r\n\r\n getRenderWidth(): number;\r\n getRenderHeight(): number;\r\n getHardwareScalingLevel(): number;\r\n setHardwareScalingLevel(level: number): void;\r\n\r\n setViewPort(x: number, y: number, width: number, height: number): void;\r\n\r\n setCommandDataStream(dataStream: NativeDataStream): void;\r\n submitCommands(): void;\r\n}\r\n\r\n/** @hidden */\r\ninterface INativeEngineConstructor {\r\n prototype: INativeEngine;\r\n new (): INativeEngine;\r\n\r\n readonly PROTOCOL_VERSION: number;\r\n\r\n readonly CAPS_LIMITS_MAX_TEXTURE_SIZE: number;\r\n readonly CAPS_LIMITS_MAX_TEXTURE_LAYERS: number;\r\n\r\n readonly TEXTURE_NEAREST_NEAREST: number;\r\n readonly TEXTURE_LINEAR_LINEAR: number;\r\n readonly TEXTURE_LINEAR_LINEAR_MIPLINEAR: number;\r\n readonly TEXTURE_NEAREST_NEAREST_MIPNEAREST: number;\r\n readonly TEXTURE_NEAREST_LINEAR_MIPNEAREST: number;\r\n readonly TEXTURE_NEAREST_LINEAR_MIPLINEAR: number;\r\n readonly TEXTURE_NEAREST_LINEAR: number;\r\n readonly TEXTURE_NEAREST_NEAREST_MIPLINEAR: number;\r\n readonly TEXTURE_LINEAR_NEAREST_MIPNEAREST: number;\r\n readonly TEXTURE_LINEAR_NEAREST_MIPLINEAR: number;\r\n readonly TEXTURE_LINEAR_LINEAR_MIPNEAREST: number;\r\n readonly TEXTURE_LINEAR_NEAREST: number;\r\n\r\n readonly DEPTH_TEST_LESS: number;\r\n readonly DEPTH_TEST_LEQUAL: number;\r\n readonly DEPTH_TEST_EQUAL: number;\r\n readonly DEPTH_TEST_GEQUAL: number;\r\n readonly DEPTH_TEST_GREATER: number;\r\n readonly DEPTH_TEST_NOTEQUAL: number;\r\n readonly DEPTH_TEST_NEVER: number;\r\n readonly DEPTH_TEST_ALWAYS: number;\r\n\r\n readonly ADDRESS_MODE_WRAP: number;\r\n readonly ADDRESS_MODE_MIRROR: number;\r\n readonly ADDRESS_MODE_CLAMP: number;\r\n readonly ADDRESS_MODE_BORDER: number;\r\n readonly ADDRESS_MODE_MIRROR_ONCE: number;\r\n\r\n readonly TEXTURE_FORMAT_RGB8: number;\r\n readonly TEXTURE_FORMAT_RGBA8: number;\r\n readonly TEXTURE_FORMAT_RGBA32F: number;\r\n\r\n readonly ATTRIB_TYPE_INT8: number;\r\n readonly ATTRIB_TYPE_UINT8: number;\r\n readonly ATTRIB_TYPE_INT16: number;\r\n readonly ATTRIB_TYPE_UINT16: number;\r\n readonly ATTRIB_TYPE_FLOAT: number;\r\n\r\n readonly ALPHA_DISABLE: number;\r\n readonly ALPHA_ADD: number;\r\n readonly ALPHA_COMBINE: number;\r\n readonly ALPHA_SUBTRACT: number;\r\n readonly ALPHA_MULTIPLY: number;\r\n readonly ALPHA_MAXIMIZED: number;\r\n readonly ALPHA_ONEONE: number;\r\n readonly ALPHA_PREMULTIPLIED: number;\r\n readonly ALPHA_PREMULTIPLIED_PORTERDUFF: number;\r\n readonly ALPHA_INTERPOLATE: number;\r\n readonly ALPHA_SCREENMODE: number;\r\n\r\n readonly STENCIL_TEST_LESS: number;\r\n readonly STENCIL_TEST_LEQUAL: number;\r\n readonly STENCIL_TEST_EQUAL: number;\r\n readonly STENCIL_TEST_GEQUAL: number;\r\n readonly STENCIL_TEST_GREATER: number;\r\n readonly STENCIL_TEST_NOTEQUAL: number;\r\n readonly STENCIL_TEST_NEVER: number;\r\n readonly STENCIL_TEST_ALWAYS: number;\r\n\r\n readonly STENCIL_OP_FAIL_S_ZERO: number;\r\n readonly STENCIL_OP_FAIL_S_KEEP: number;\r\n readonly STENCIL_OP_FAIL_S_REPLACE: number;\r\n readonly STENCIL_OP_FAIL_S_INCR: number;\r\n readonly STENCIL_OP_FAIL_S_INCRSAT: number;\r\n readonly STENCIL_OP_FAIL_S_DECR: number;\r\n readonly STENCIL_OP_FAIL_S_DECRSAT: number;\r\n readonly STENCIL_OP_FAIL_S_INVERT: number;\r\n\r\n readonly STENCIL_OP_FAIL_Z_ZERO: number;\r\n readonly STENCIL_OP_FAIL_Z_KEEP: number;\r\n readonly STENCIL_OP_FAIL_Z_REPLACE: number;\r\n readonly STENCIL_OP_FAIL_Z_INCR: number;\r\n readonly STENCIL_OP_FAIL_Z_INCRSAT: number;\r\n readonly STENCIL_OP_FAIL_Z_DECR: number;\r\n readonly STENCIL_OP_FAIL_Z_DECRSAT: number;\r\n readonly STENCIL_OP_FAIL_Z_INVERT: number;\r\n\r\n readonly STENCIL_OP_PASS_Z_ZERO: number;\r\n readonly STENCIL_OP_PASS_Z_KEEP: number;\r\n readonly STENCIL_OP_PASS_Z_REPLACE: number;\r\n readonly STENCIL_OP_PASS_Z_INCR: number;\r\n readonly STENCIL_OP_PASS_Z_INCRSAT: number;\r\n readonly STENCIL_OP_PASS_Z_DECR: number;\r\n readonly STENCIL_OP_PASS_Z_DECRSAT: number;\r\n readonly STENCIL_OP_PASS_Z_INVERT: number;\r\n\r\n readonly COMMAND_DELETEVERTEXARRAY: NativeData;\r\n readonly COMMAND_DELETEINDEXBUFFER: NativeData;\r\n readonly COMMAND_DELETEVERTEXBUFFER: NativeData;\r\n readonly COMMAND_SETPROGRAM: NativeData;\r\n readonly COMMAND_SETMATRIX: NativeData;\r\n readonly COMMAND_SETMATRIX3X3: NativeData;\r\n readonly COMMAND_SETMATRIX2X2: NativeData;\r\n readonly COMMAND_SETMATRICES: NativeData;\r\n readonly COMMAND_SETINT: NativeData;\r\n readonly COMMAND_SETINTARRAY: NativeData;\r\n readonly COMMAND_SETINTARRAY2: NativeData;\r\n readonly COMMAND_SETINTARRAY3: NativeData;\r\n readonly COMMAND_SETINTARRAY4: NativeData;\r\n readonly COMMAND_SETFLOATARRAY: NativeData;\r\n readonly COMMAND_SETFLOATARRAY2: NativeData;\r\n readonly COMMAND_SETFLOATARRAY3: NativeData;\r\n readonly COMMAND_SETFLOATARRAY4: NativeData;\r\n readonly COMMAND_SETTEXTURESAMPLING: NativeData;\r\n readonly COMMAND_SETTEXTUREWRAPMODE: NativeData;\r\n readonly COMMAND_SETTEXTUREANISOTROPICLEVEL: NativeData;\r\n readonly COMMAND_SETTEXTURE: NativeData;\r\n readonly COMMAND_BINDVERTEXARRAY: NativeData;\r\n readonly COMMAND_SETSTATE: NativeData;\r\n readonly COMMAND_DELETEPROGRAM: NativeData;\r\n readonly COMMAND_SETZOFFSET: NativeData;\r\n readonly COMMAND_SETZOFFSETUNITS: NativeData;\r\n readonly COMMAND_SETDEPTHTEST: NativeData;\r\n readonly COMMAND_SETDEPTHWRITE: NativeData;\r\n readonly COMMAND_SETCOLORWRITE: NativeData;\r\n readonly COMMAND_SETBLENDMODE: NativeData;\r\n readonly COMMAND_SETFLOAT: NativeData;\r\n readonly COMMAND_SETFLOAT2: NativeData;\r\n readonly COMMAND_SETFLOAT3: NativeData;\r\n readonly COMMAND_SETFLOAT4: NativeData;\r\n readonly COMMAND_BINDFRAMEBUFFER: NativeData;\r\n readonly COMMAND_UNBINDFRAMEBUFFER: NativeData;\r\n readonly COMMAND_DELETEFRAMEBUFFER: NativeData;\r\n readonly COMMAND_DRAWINDEXED: NativeData;\r\n readonly COMMAND_DRAW: NativeData;\r\n readonly COMMAND_CLEAR: NativeData;\r\n readonly COMMAND_SETSTENCIL: NativeData;\r\n}\r\n\r\n/** @hidden */\r\nexport interface INativeCamera {\r\n createVideo(constraints: MediaTrackConstraints): any;\r\n updateVideoTexture(texture: Nullable<InternalTexture>, video: HTMLVideoElement, invertY: boolean): void;\r\n}\r\n\r\n/** @hidden */\r\ninterface INativeCameraConstructor {\r\n prototype: INativeCamera;\r\n new (): INativeCamera;\r\n}\r\n\r\n/** @hidden */\r\ninterface INativeCanvasConstructor {\r\n prototype: ICanvas;\r\n new (): ICanvas;\r\n\r\n loadTTFAsync(fontName: string, buffer: ArrayBuffer): void;\r\n}\r\n\r\n/** @hidden */\r\ninterface INativeImageConstructor {\r\n prototype: IImage;\r\n new (): IImage;\r\n}\r\n\r\n/** @hidden */\r\ninterface IDeviceInputSystemConstructor {\r\n prototype: IDeviceInputSystem;\r\n new (\r\n onDeviceConnected: (deviceType: DeviceType, deviceSlot: number) => void,\r\n onDeviceDisconnected: (deviceType: DeviceType, deviceSlot: number) => void,\r\n onInputChanged: (deviceType: DeviceType, deviceSlot: number, inputIndex: number, currentState: number) => void\r\n ): IDeviceInputSystem;\r\n}\r\n\r\n/** @hidden */\r\nexport interface INativeDataStream {\r\n writeBuffer(buffer: ArrayBuffer, length: number): void;\r\n}\r\n\r\n/** @hidden */\r\ninterface INativeDataStreamConstructor {\r\n prototype: INativeDataStream;\r\n new (requestFlushCallback: () => void): INativeDataStream;\r\n\r\n readonly VALIDATION_ENABLED: boolean;\r\n readonly VALIDATION_UINT_32: number;\r\n readonly VALIDATION_INT_32: number;\r\n readonly VALIDATION_FLOAT_32: number;\r\n readonly VALIDATION_UINT_32_ARRAY: number;\r\n readonly VALIDATION_INT_32_ARRAY: number;\r\n readonly VALIDATION_FLOAT_32_ARRAY: number;\r\n readonly VALIDATION_NATIVE_DATA: number;\r\n readonly VALIDATION_BOOLEAN: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface INative {\r\n Engine: INativeEngineConstructor;\r\n Camera: INativeCameraConstructor;\r\n Canvas: INativeCanvasConstructor;\r\n Image: INativeImageConstructor;\r\n XMLHttpRequest: any; // TODO: how to do this?\r\n DeviceInputSystem: IDeviceInputSystemConstructor;\r\n NativeDataStream: INativeDataStreamConstructor;\r\n}\r\n"]}
1
+ {"version":3,"file":"nativeInterfaces.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Engines/Native/nativeInterfaces.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { DeviceType } from \"../../DeviceInput/InputDevices/deviceEnums\";\r\nimport type { IDeviceInputSystem } from \"../../DeviceInput/inputInterfaces\";\r\nimport type { InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { ICanvas, IImage } from \"../ICanvas\";\r\nimport type { NativeData, NativeDataStream } from \"./nativeDataStream\";\r\n\r\n/** @hidden */\r\nexport interface INativeEngine {\r\n dispose(): void;\r\n\r\n requestAnimationFrame(callback: () => void): void;\r\n\r\n createVertexArray(): NativeData;\r\n\r\n createIndexBuffer(bytes: ArrayBuffer, byteOffset: number, byteLength: number, is32Bits: boolean, dynamic: boolean): NativeData;\r\n recordIndexBuffer(vertexArray: NativeData, indexBuffer: NativeData): void;\r\n updateDynamicIndexBuffer(buffer: NativeData, bytes: ArrayBuffer, byteOffset: number, byteLength: number, startIndex: number): void;\r\n\r\n createVertexBuffer(bytes: ArrayBuffer, byteOffset: number, byteLength: number, dynamic: boolean): NativeData;\r\n recordVertexBuffer(\r\n vertexArray: NativeData,\r\n vertexBuffer: NativeData,\r\n location: number,\r\n byteOffset: number,\r\n byteStride: number,\r\n numElements: number,\r\n type: number,\r\n normalized: boolean,\r\n instanceDivisor: number\r\n ): void;\r\n updateDynamicVertexBuffer(vertexBuffer: NativeData, bytes: ArrayBuffer, byteOffset: number, byteLength: number): void;\r\n\r\n createProgram(vertexShader: string, fragmentShader: string): any;\r\n getUniforms(shaderProgram: any, uniformsNames: string[]): WebGLUniformLocation[];\r\n getAttributes(shaderProgram: any, attributeNames: string[]): number[];\r\n\r\n createTexture(): WebGLTexture;\r\n loadTexture(texture: WebGLTexture, data: ArrayBufferView, generateMips: boolean, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n loadRawTexture(texture: WebGLTexture, data: ArrayBufferView, width: number, height: number, format: number, generateMips: boolean, invertY: boolean): void;\r\n loadRawTexture2DArray(\r\n texture: WebGLTexture,\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean\r\n ): void;\r\n loadCubeTexture(texture: WebGLTexture, data: Array<ArrayBufferView>, generateMips: boolean, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n loadCubeTextureWithMips(texture: WebGLTexture, data: Array<Array<ArrayBufferView>>, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n getTextureWidth(texture: WebGLTexture): number;\r\n getTextureHeight(texture: WebGLTexture): number;\r\n copyTexture(desination: Nullable<WebGLTexture>, source: Nullable<WebGLTexture>): void;\r\n deleteTexture(texture: Nullable<WebGLTexture>): void;\r\n readTexture(\r\n texture: WebGLTexture,\r\n mipLevel: number,\r\n x: number,\r\n y: number,\r\n width: number,\r\n height: number,\r\n buffer: Nullable<ArrayBuffer>,\r\n bufferOffset: number,\r\n bufferLength: number\r\n ): Promise<ArrayBuffer>;\r\n\r\n createImageBitmap(data: ArrayBufferView | IImage): ImageBitmap;\r\n resizeImageBitmap(image: ImageBitmap, bufferWidth: number, bufferHeight: number): Uint8Array;\r\n\r\n createFrameBuffer(\r\n texture: WebGLTexture,\r\n width: number,\r\n height: number,\r\n format: number,\r\n generateStencilBuffer: boolean,\r\n generateDepthBuffer: boolean,\r\n generateMips: boolean\r\n ): WebGLFramebuffer;\r\n\r\n getRenderWidth(): number;\r\n getRenderHeight(): number;\r\n getHardwareScalingLevel(): number;\r\n setHardwareScalingLevel(level: number): void;\r\n\r\n setViewPort(x: number, y: number, width: number, height: number): void;\r\n\r\n setCommandDataStream(dataStream: NativeDataStream): void;\r\n submitCommands(): void;\r\n}\r\n\r\n/** @hidden */\r\ninterface INativeEngineConstructor {\r\n prototype: INativeEngine;\r\n new (): INativeEngine;\r\n\r\n readonly PROTOCOL_VERSION: number;\r\n\r\n readonly CAPS_LIMITS_MAX_TEXTURE_SIZE: number;\r\n readonly CAPS_LIMITS_MAX_TEXTURE_LAYERS: number;\r\n\r\n readonly TEXTURE_NEAREST_NEAREST: number;\r\n readonly TEXTURE_LINEAR_LINEAR: number;\r\n readonly TEXTURE_LINEAR_LINEAR_MIPLINEAR: number;\r\n readonly TEXTURE_NEAREST_NEAREST_MIPNEAREST: number;\r\n readonly TEXTURE_NEAREST_LINEAR_MIPNEAREST: number;\r\n readonly TEXTURE_NEAREST_LINEAR_MIPLINEAR: number;\r\n readonly TEXTURE_NEAREST_LINEAR: number;\r\n readonly TEXTURE_NEAREST_NEAREST_MIPLINEAR: number;\r\n readonly TEXTURE_LINEAR_NEAREST_MIPNEAREST: number;\r\n readonly TEXTURE_LINEAR_NEAREST_MIPLINEAR: number;\r\n readonly TEXTURE_LINEAR_LINEAR_MIPNEAREST: number;\r\n readonly TEXTURE_LINEAR_NEAREST: number;\r\n\r\n readonly DEPTH_TEST_LESS: number;\r\n readonly DEPTH_TEST_LEQUAL: number;\r\n readonly DEPTH_TEST_EQUAL: number;\r\n readonly DEPTH_TEST_GEQUAL: number;\r\n readonly DEPTH_TEST_GREATER: number;\r\n readonly DEPTH_TEST_NOTEQUAL: number;\r\n readonly DEPTH_TEST_NEVER: number;\r\n readonly DEPTH_TEST_ALWAYS: number;\r\n\r\n readonly ADDRESS_MODE_WRAP: number;\r\n readonly ADDRESS_MODE_MIRROR: number;\r\n readonly ADDRESS_MODE_CLAMP: number;\r\n readonly ADDRESS_MODE_BORDER: number;\r\n readonly ADDRESS_MODE_MIRROR_ONCE: number;\r\n\r\n readonly TEXTURE_FORMAT_RGB8: number;\r\n readonly TEXTURE_FORMAT_RGBA8: number;\r\n readonly TEXTURE_FORMAT_RGBA32F: number;\r\n\r\n readonly ATTRIB_TYPE_INT8: number;\r\n readonly ATTRIB_TYPE_UINT8: number;\r\n readonly ATTRIB_TYPE_INT16: number;\r\n readonly ATTRIB_TYPE_UINT16: number;\r\n readonly ATTRIB_TYPE_FLOAT: number;\r\n\r\n readonly ALPHA_DISABLE: number;\r\n readonly ALPHA_ADD: number;\r\n readonly ALPHA_COMBINE: number;\r\n readonly ALPHA_SUBTRACT: number;\r\n readonly ALPHA_MULTIPLY: number;\r\n readonly ALPHA_MAXIMIZED: number;\r\n readonly ALPHA_ONEONE: number;\r\n readonly ALPHA_PREMULTIPLIED: number;\r\n readonly ALPHA_PREMULTIPLIED_PORTERDUFF: number;\r\n readonly ALPHA_INTERPOLATE: number;\r\n readonly ALPHA_SCREENMODE: number;\r\n\r\n readonly STENCIL_TEST_LESS: number;\r\n readonly STENCIL_TEST_LEQUAL: number;\r\n readonly STENCIL_TEST_EQUAL: number;\r\n readonly STENCIL_TEST_GEQUAL: number;\r\n readonly STENCIL_TEST_GREATER: number;\r\n readonly STENCIL_TEST_NOTEQUAL: number;\r\n readonly STENCIL_TEST_NEVER: number;\r\n readonly STENCIL_TEST_ALWAYS: number;\r\n\r\n readonly STENCIL_OP_FAIL_S_ZERO: number;\r\n readonly STENCIL_OP_FAIL_S_KEEP: number;\r\n readonly STENCIL_OP_FAIL_S_REPLACE: number;\r\n readonly STENCIL_OP_FAIL_S_INCR: number;\r\n readonly STENCIL_OP_FAIL_S_INCRSAT: number;\r\n readonly STENCIL_OP_FAIL_S_DECR: number;\r\n readonly STENCIL_OP_FAIL_S_DECRSAT: number;\r\n readonly STENCIL_OP_FAIL_S_INVERT: number;\r\n\r\n readonly STENCIL_OP_FAIL_Z_ZERO: number;\r\n readonly STENCIL_OP_FAIL_Z_KEEP: number;\r\n readonly STENCIL_OP_FAIL_Z_REPLACE: number;\r\n readonly STENCIL_OP_FAIL_Z_INCR: number;\r\n readonly STENCIL_OP_FAIL_Z_INCRSAT: number;\r\n readonly STENCIL_OP_FAIL_Z_DECR: number;\r\n readonly STENCIL_OP_FAIL_Z_DECRSAT: number;\r\n readonly STENCIL_OP_FAIL_Z_INVERT: number;\r\n\r\n readonly STENCIL_OP_PASS_Z_ZERO: number;\r\n readonly STENCIL_OP_PASS_Z_KEEP: number;\r\n readonly STENCIL_OP_PASS_Z_REPLACE: number;\r\n readonly STENCIL_OP_PASS_Z_INCR: number;\r\n readonly STENCIL_OP_PASS_Z_INCRSAT: number;\r\n readonly STENCIL_OP_PASS_Z_DECR: number;\r\n readonly STENCIL_OP_PASS_Z_DECRSAT: number;\r\n readonly STENCIL_OP_PASS_Z_INVERT: number;\r\n\r\n readonly COMMAND_DELETEVERTEXARRAY: NativeData;\r\n readonly COMMAND_DELETEINDEXBUFFER: NativeData;\r\n readonly COMMAND_DELETEVERTEXBUFFER: NativeData;\r\n readonly COMMAND_SETPROGRAM: NativeData;\r\n readonly COMMAND_SETMATRIX: NativeData;\r\n readonly COMMAND_SETMATRIX3X3: NativeData;\r\n readonly COMMAND_SETMATRIX2X2: NativeData;\r\n readonly COMMAND_SETMATRICES: NativeData;\r\n readonly COMMAND_SETINT: NativeData;\r\n readonly COMMAND_SETINTARRAY: NativeData;\r\n readonly COMMAND_SETINTARRAY2: NativeData;\r\n readonly COMMAND_SETINTARRAY3: NativeData;\r\n readonly COMMAND_SETINTARRAY4: NativeData;\r\n readonly COMMAND_SETFLOATARRAY: NativeData;\r\n readonly COMMAND_SETFLOATARRAY2: NativeData;\r\n readonly COMMAND_SETFLOATARRAY3: NativeData;\r\n readonly COMMAND_SETFLOATARRAY4: NativeData;\r\n readonly COMMAND_SETTEXTURESAMPLING: NativeData;\r\n readonly COMMAND_SETTEXTUREWRAPMODE: NativeData;\r\n readonly COMMAND_SETTEXTUREANISOTROPICLEVEL: NativeData;\r\n readonly COMMAND_SETTEXTURE: NativeData;\r\n readonly COMMAND_BINDVERTEXARRAY: NativeData;\r\n readonly COMMAND_SETSTATE: NativeData;\r\n readonly COMMAND_DELETEPROGRAM: NativeData;\r\n readonly COMMAND_SETZOFFSET: NativeData;\r\n readonly COMMAND_SETZOFFSETUNITS: NativeData;\r\n readonly COMMAND_SETDEPTHTEST: NativeData;\r\n readonly COMMAND_SETDEPTHWRITE: NativeData;\r\n readonly COMMAND_SETCOLORWRITE: NativeData;\r\n readonly COMMAND_SETBLENDMODE: NativeData;\r\n readonly COMMAND_SETFLOAT: NativeData;\r\n readonly COMMAND_SETFLOAT2: NativeData;\r\n readonly COMMAND_SETFLOAT3: NativeData;\r\n readonly COMMAND_SETFLOAT4: NativeData;\r\n readonly COMMAND_BINDFRAMEBUFFER: NativeData;\r\n readonly COMMAND_UNBINDFRAMEBUFFER: NativeData;\r\n readonly COMMAND_DELETEFRAMEBUFFER: NativeData;\r\n readonly COMMAND_DRAWINDEXED: NativeData;\r\n readonly COMMAND_DRAW: NativeData;\r\n readonly COMMAND_CLEAR: NativeData;\r\n readonly COMMAND_SETSTENCIL: NativeData;\r\n}\r\n\r\n/** @hidden */\r\nexport interface INativeCamera {\r\n createVideo(constraints: MediaTrackConstraints): any;\r\n updateVideoTexture(texture: Nullable<InternalTexture>, video: HTMLVideoElement, invertY: boolean): void;\r\n}\r\n\r\n/** @hidden */\r\ninterface INativeCameraConstructor {\r\n prototype: INativeCamera;\r\n new (): INativeCamera;\r\n}\r\n\r\n/** @hidden */\r\ninterface INativeCanvasConstructor {\r\n prototype: ICanvas;\r\n new (): ICanvas;\r\n\r\n loadTTFAsync(fontName: string, buffer: ArrayBuffer): void;\r\n}\r\n\r\n/** @hidden */\r\ninterface INativeImageConstructor {\r\n prototype: IImage;\r\n new (): IImage;\r\n}\r\n\r\n/** @hidden */\r\ninterface IDeviceInputSystemConstructor {\r\n prototype: IDeviceInputSystem;\r\n new (\r\n onDeviceConnected: (deviceType: DeviceType, deviceSlot: number) => void,\r\n onDeviceDisconnected: (deviceType: DeviceType, deviceSlot: number) => void,\r\n onInputChanged: (deviceType: DeviceType, deviceSlot: number, inputIndex: number, currentState: number) => void\r\n ): IDeviceInputSystem;\r\n}\r\n\r\n/** @hidden */\r\nexport interface INativeDataStream {\r\n writeBuffer(buffer: ArrayBuffer, length: number): void;\r\n}\r\n\r\n/** @hidden */\r\ninterface INativeDataStreamConstructor {\r\n prototype: INativeDataStream;\r\n new (requestFlushCallback: () => void): INativeDataStream;\r\n\r\n readonly VALIDATION_ENABLED: boolean;\r\n readonly VALIDATION_UINT_32: number;\r\n readonly VALIDATION_INT_32: number;\r\n readonly VALIDATION_FLOAT_32: number;\r\n readonly VALIDATION_UINT_32_ARRAY: number;\r\n readonly VALIDATION_INT_32_ARRAY: number;\r\n readonly VALIDATION_FLOAT_32_ARRAY: number;\r\n readonly VALIDATION_NATIVE_DATA: number;\r\n readonly VALIDATION_BOOLEAN: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface INative {\r\n Engine: INativeEngineConstructor;\r\n Camera: INativeCameraConstructor;\r\n Canvas: INativeCanvasConstructor;\r\n Image: INativeImageConstructor;\r\n XMLHttpRequest: any; // TODO: how to do this?\r\n DeviceInputSystem: IDeviceInputSystemConstructor;\r\n NativeDataStream: INativeDataStreamConstructor;\r\n}\r\n"]}
@@ -409,7 +409,7 @@ var ThinEngine = /** @class */ (function () {
409
409
  */
410
410
  // Not mixed with Version for tooling purpose.
411
411
  get: function () {
412
- return "babylonjs@5.19.0";
412
+ return "babylonjs@5.20.0";
413
413
  },
414
414
  enumerable: false,
415
415
  configurable: true
@@ -419,7 +419,7 @@ var ThinEngine = /** @class */ (function () {
419
419
  * Returns the current version of the framework
420
420
  */
421
421
  get: function () {
422
- return "5.19.0";
422
+ return "5.20.0";
423
423
  },
424
424
  enumerable: false,
425
425
  configurable: true