@babylonjs/core 5.2.0 → 5.3.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 (37) hide show
  1. package/Behaviors/Meshes/pointerDragBehavior.js +1 -0
  2. package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
  3. package/Bones/skeleton.js +2 -0
  4. package/Bones/skeleton.js.map +1 -1
  5. package/DeviceInput/Helpers/eventFactory.js +14 -3
  6. package/DeviceInput/Helpers/eventFactory.js.map +1 -1
  7. package/DeviceInput/InputDevices/deviceTypes.d.ts +1 -1
  8. package/DeviceInput/InputDevices/deviceTypes.js.map +1 -1
  9. package/DeviceInput/InputDevices/nativeDeviceInputSystem.js +2 -8
  10. package/DeviceInput/InputDevices/nativeDeviceInputSystem.js.map +1 -1
  11. package/Engines/engine.js +1 -0
  12. package/Engines/engine.js.map +1 -1
  13. package/Engines/thinEngine.js +2 -2
  14. package/Engines/thinEngine.js.map +1 -1
  15. package/Gizmos/axisScaleGizmo.js +3 -2
  16. package/Gizmos/axisScaleGizmo.js.map +1 -1
  17. package/Gizmos/boundingBoxGizmo.js +5 -5
  18. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  19. package/Gizmos/gizmo.js +3 -2
  20. package/Gizmos/gizmo.js.map +1 -1
  21. package/Gizmos/planeRotationGizmo.js +3 -3
  22. package/Gizmos/planeRotationGizmo.js.map +1 -1
  23. package/Lights/Shadows/shadowGenerator.d.ts +4 -0
  24. package/Lights/Shadows/shadowGenerator.js +5 -1
  25. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  26. package/Loading/Plugins/babylonFileLoader.js +2 -2
  27. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  28. package/Materials/uniformBuffer.d.ts +2 -1
  29. package/Materials/uniformBuffer.js +2 -1
  30. package/Materials/uniformBuffer.js.map +1 -1
  31. package/Misc/screenshotTools.js +6 -6
  32. package/Misc/screenshotTools.js.map +1 -1
  33. package/PostProcesses/volumetricLightScatteringPostProcess.js +6 -1
  34. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  35. package/Shaders/spriteMap.fragment.js +1 -1
  36. package/Shaders/spriteMap.fragment.js.map +1 -1
  37. package/package.json +1 -1
@@ -2,4 +2,4 @@ import type { DeviceType, PointerInput, DualShockInput, XboxInput, SwitchInput,
2
2
  /**
3
3
  * Type to handle enforcement of inputs
4
4
  */
5
- export declare type DeviceInput<T extends DeviceType> = T extends DeviceType.Keyboard | DeviceType.Generic ? number : T extends DeviceType.Mouse | DeviceType.Touch ? Exclude<PointerInput, PointerInput.Move> : T extends DeviceType.DualShock ? DualShockInput : T extends DeviceType.Xbox ? XboxInput : T extends DeviceType.Switch ? SwitchInput : T extends DeviceType.DualSense ? DualSenseInput : never;
5
+ export declare type DeviceInput<T extends DeviceType> = T extends DeviceType.Keyboard | DeviceType.Generic ? number : T extends DeviceType.Mouse | DeviceType.Touch ? Exclude<PointerInput, PointerInput.Move | PointerInput.MouseWheelX | PointerInput.MouseWheelY | PointerInput.MouseWheelZ> : T extends DeviceType.DualShock ? DualShockInput : T extends DeviceType.Xbox ? XboxInput : T extends DeviceType.Switch ? SwitchInput : T extends DeviceType.DualSense ? DualSenseInput : never;
@@ -1 +1 @@
1
- {"version":3,"file":"deviceTypes.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/DeviceInput/InputDevices/deviceTypes.ts"],"names":[],"mappings":"","sourcesContent":["import type { DeviceType, PointerInput, DualShockInput, XboxInput, SwitchInput, DualSenseInput } from \"./deviceEnums\";\r\n\r\n/**\r\n * Type to handle enforcement of inputs\r\n */\r\nexport type DeviceInput<T extends DeviceType> = T extends DeviceType.Keyboard | DeviceType.Generic\r\n ? number\r\n : T extends DeviceType.Mouse | DeviceType.Touch\r\n ? Exclude<PointerInput, PointerInput.Move>\r\n : T extends DeviceType.DualShock\r\n ? DualShockInput\r\n : T extends DeviceType.Xbox\r\n ? XboxInput\r\n : T extends DeviceType.Switch\r\n ? SwitchInput\r\n : T extends DeviceType.DualSense\r\n ? DualSenseInput\r\n : never;\r\n"]}
1
+ {"version":3,"file":"deviceTypes.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/DeviceInput/InputDevices/deviceTypes.ts"],"names":[],"mappings":"","sourcesContent":["import type { DeviceType, PointerInput, DualShockInput, XboxInput, SwitchInput, DualSenseInput } from \"./deviceEnums\";\r\n\r\n/**\r\n * Type to handle enforcement of inputs\r\n */\r\nexport type DeviceInput<T extends DeviceType> = T extends DeviceType.Keyboard | DeviceType.Generic\r\n ? number\r\n : T extends DeviceType.Mouse | DeviceType.Touch\r\n ? Exclude<PointerInput, PointerInput.Move | PointerInput.MouseWheelX | PointerInput.MouseWheelY | PointerInput.MouseWheelZ>\r\n : T extends DeviceType.DualShock\r\n ? DualShockInput\r\n : T extends DeviceType.Xbox\r\n ? XboxInput\r\n : T extends DeviceType.Switch\r\n ? SwitchInput\r\n : T extends DeviceType.DualSense\r\n ? DualSenseInput\r\n : never;\r\n"]}
@@ -1,18 +1,12 @@
1
1
  import { DeviceEventFactory } from "../Helpers/eventFactory.js";
2
- import { DeviceType, NativePointerInput, PointerInput } from "./deviceEnums.js";
2
+ import { DeviceType } from "./deviceEnums.js";
3
3
  /** @hidden */
4
4
  var NativeDeviceInputSystem = /** @class */ (function () {
5
5
  function NativeDeviceInputSystem(onDeviceConnected, onDeviceDisconnected, onInputChanged) {
6
6
  var _this = this;
7
7
  this._nativeInput = _native.DeviceInputSystem
8
8
  ? new _native.DeviceInputSystem(onDeviceConnected, onDeviceDisconnected, function (deviceType, deviceSlot, inputIndex, currentState) {
9
- var idx = inputIndex === NativePointerInput.Horizontal ||
10
- inputIndex === NativePointerInput.Vertical ||
11
- inputIndex === NativePointerInput.DeltaHorizontal ||
12
- inputIndex === NativePointerInput.DeltaVertical
13
- ? PointerInput.Move
14
- : inputIndex;
15
- var evt = DeviceEventFactory.CreateDeviceEvent(deviceType, deviceSlot, idx, currentState, _this);
9
+ var evt = DeviceEventFactory.CreateDeviceEvent(deviceType, deviceSlot, inputIndex, currentState, _this);
16
10
  onInputChanged(deviceType, deviceSlot, evt);
17
11
  })
18
12
  : this._createDummyNativeInput();
@@ -1 +1 @@
1
- {"version":3,"file":"nativeDeviceInputSystem.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/DeviceInput/InputDevices/nativeDeviceInputSystem.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAK7E,cAAc;AACd;IAGI,iCACI,iBAAuE,EACvE,oBAA0E,EAC1E,cAAyF;QAH7F,iBAmBC;QAdG,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,iBAAiB;YACzC,CAAC,CAAC,IAAI,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,oBAAoB,EAAE,UAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY;gBACpH,IAAM,GAAG,GACL,UAAU,KAAK,kBAAkB,CAAC,UAAU;oBAC5C,UAAU,KAAK,kBAAkB,CAAC,QAAQ;oBAC1C,UAAU,KAAK,kBAAkB,CAAC,eAAe;oBACjD,UAAU,KAAK,kBAAkB,CAAC,aAAa;oBAC3C,CAAC,CAAC,YAAY,CAAC,IAAI;oBACnB,CAAC,CAAC,UAAU,CAAC;gBACrB,IAAM,GAAG,GAAG,kBAAkB,CAAC,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,EAAE,KAAI,CAAC,CAAC;gBAElG,cAAc,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;YAChD,CAAC,CAAC;YACJ,CAAC,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC;IACzC,CAAC;IAED,mBAAmB;IACnB;;;;;;OAMG;IACI,2CAAS,GAAhB,UAAiB,UAAsB,EAAE,UAAkB,EAAE,UAAkB;QAC3E,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAC3E,CAAC;IAED;;;;OAIG;IACI,mDAAiB,GAAxB,UAAyB,UAAsB;QAC3C,6BAA6B;QAC7B,OAAO,UAAU,KAAK,UAAU,CAAC,KAAK,IAAI,UAAU,KAAK,UAAU,CAAC,KAAK,CAAC;IAC9E,CAAC;IAED;;OAEG;IACI,yCAAO,GAAd;QACI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC;IAED;;;OAGG;IACK,yDAAuB,GAA/B;QACI,IAAM,WAAW,GAAG;YAChB,SAAS,EAAE;gBACP,OAAO,CAAC,CAAC;YACb,CAAC;YACD,iBAAiB,EAAE;gBACf,OAAO,KAAK,CAAC;YACjB,CAAC;YACD,OAAO,EAAE,cAAO,CAAC;SACpB,CAAC;QAEF,OAAO,WAAW,CAAC;IACvB,CAAC;IACL,8BAAC;AAAD,CAAC,AAtED,IAsEC","sourcesContent":["import type { INative } from \"../../Engines/Native/nativeInterfaces\";\r\nimport type { IUIEvent } from \"../../Events/deviceInputEvents\";\r\nimport { DeviceEventFactory } from \"../Helpers/eventFactory\";\r\nimport { DeviceType, NativePointerInput, PointerInput } from \"./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 idx =\r\n inputIndex === NativePointerInput.Horizontal ||\r\n inputIndex === NativePointerInput.Vertical ||\r\n inputIndex === NativePointerInput.DeltaHorizontal ||\r\n inputIndex === NativePointerInput.DeltaVertical\r\n ? PointerInput.Move\r\n : inputIndex;\r\n const evt = DeviceEventFactory.CreateDeviceEvent(deviceType, deviceSlot, idx, 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
+ {"version":3,"file":"nativeDeviceInputSystem.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/DeviceInput/InputDevices/nativeDeviceInputSystem.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAA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AAC;QAEF,OAAO,WAAW,CAAC;IACvB,CAAC;IACL,8BAAC;AAAD,CAAC,AA/DD,IA+DC","sourcesContent":["import type { INative } from \"../../Engines/Native/nativeInterfaces\";\r\nimport type { IUIEvent } from \"../../Events/deviceInputEvents\";\r\nimport { DeviceEventFactory } from \"../Helpers/eventFactory\";\r\nimport { DeviceType } from \"./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"]}
package/Engines/engine.js CHANGED
@@ -1552,6 +1552,7 @@ var Engine = /** @class */ (function (_super) {
1552
1552
  element.requestPointerLock || element.msRequestPointerLock || element.mozRequestPointerLock || element.webkitRequestPointerLock;
1553
1553
  if (element.requestPointerLock) {
1554
1554
  element.requestPointerLock();
1555
+ element.focus();
1555
1556
  }
1556
1557
  };
1557
1558
  /**