David `Deltakosh` Catuhe 5 年之前
父節點
當前提交
92efad22d1

+ 2 - 2
dist/preview release/babylon.d.ts

@@ -51394,13 +51394,13 @@ declare module BABYLON {
          * @returns Current value of input
          */
         /**
-         * Checks for current device input value, given an id and input index
+         * Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.
          * @param deviceType Enum specifiying device type
          * @param deviceSlot "Slot" or index that device is referenced in
          * @param inputIndex Id of input to be checked
          * @returns Current value of input
          */
-        pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): Nullable<number>;
+        pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): number;
         /**
          * Dispose of all the eventlisteners
          */

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/babylon.js


+ 9 - 2
dist/preview release/babylon.max.js

@@ -30598,7 +30598,7 @@ var DeviceInputSystem = /** @class */ (function () {
      * @returns Current value of input
      */
     /**
-     * Checks for current device input value, given an id and input index
+     * Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.
      * @param deviceType Enum specifiying device type
      * @param deviceSlot "Slot" or index that device is referenced in
      * @param inputIndex Id of input to be checked
@@ -30648,7 +30648,7 @@ var DeviceInputSystem = /** @class */ (function () {
         if (!this._inputs[deviceType][deviceSlot]) {
             var device = new Array(numberOfInputs);
             for (var i = 0; i < numberOfInputs; i++) {
-                device[i] = null;
+                device[i] = 0; /* set device input as unpressed */
             }
             this._inputs[deviceType][deviceSlot] = device;
             this.onDeviceConnected(deviceType, deviceSlot);
@@ -30709,6 +30709,9 @@ var DeviceInputSystem = /** @class */ (function () {
             if (!_this._inputs[deviceType][deviceSlot]) {
                 _this._pointerActive = true;
                 _this._registerDevice(deviceType, deviceSlot, DeviceInputSystem._MAX_POINTER_INPUTS);
+                var pointer_1 = _this._inputs[deviceType][deviceSlot]; /* initalize our pointer position immediately after registration */
+                pointer_1[0] = evt.clientX;
+                pointer_1[1] = evt.clientY;
             }
             var pointer = _this._inputs[deviceType][deviceSlot];
             if (pointer) {
@@ -30729,6 +30732,9 @@ var DeviceInputSystem = /** @class */ (function () {
             if (!_this._inputs[deviceType][deviceSlot]) {
                 _this._pointerActive = true;
                 _this._registerDevice(deviceType, deviceSlot, DeviceInputSystem._MAX_POINTER_INPUTS);
+                var pointer_2 = _this._inputs[deviceType][deviceSlot]; /* initalize our pointer position immediately after registration */
+                pointer_2[0] = evt.clientX;
+                pointer_2[1] = evt.clientY;
             }
             var pointer = _this._inputs[deviceType][deviceSlot];
             if (pointer) {
@@ -182580,6 +182586,7 @@ var SpriteManager = /** @class */ (function () {
         if (this._scene.useRightHandedSystem) {
             engine.setState(culling, zOffset, false, true);
         }
+        engine.unbindInstanceAttributes();
     };
     /**
      * Release associated resources

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/babylon.max.js.map


+ 4 - 4
dist/preview release/babylon.module.d.ts

@@ -53466,13 +53466,13 @@ declare module "babylonjs/DeviceInput/deviceInputSystem" {
          * @returns Current value of input
          */
         /**
-         * Checks for current device input value, given an id and input index
+         * Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.
          * @param deviceType Enum specifiying device type
          * @param deviceSlot "Slot" or index that device is referenced in
          * @param inputIndex Id of input to be checked
          * @returns Current value of input
          */
-        pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): Nullable<number>;
+        pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): number;
         /**
          * Dispose of all the eventlisteners
          */
@@ -130667,13 +130667,13 @@ declare module BABYLON {
          * @returns Current value of input
          */
         /**
-         * Checks for current device input value, given an id and input index
+         * Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.
          * @param deviceType Enum specifiying device type
          * @param deviceSlot "Slot" or index that device is referenced in
          * @param inputIndex Id of input to be checked
          * @returns Current value of input
          */
-        pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): Nullable<number>;
+        pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): number;
         /**
          * Dispose of all the eventlisteners
          */

+ 2 - 2
dist/preview release/documentation.d.ts

@@ -51394,13 +51394,13 @@ declare module BABYLON {
          * @returns Current value of input
          */
         /**
-         * Checks for current device input value, given an id and input index
+         * Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.
          * @param deviceType Enum specifiying device type
          * @param deviceSlot "Slot" or index that device is referenced in
          * @param inputIndex Id of input to be checked
          * @returns Current value of input
          */
-        pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): Nullable<number>;
+        pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): number;
         /**
          * Dispose of all the eventlisteners
          */

+ 4 - 4
dist/preview release/viewer/babylon.module.d.ts

@@ -53466,13 +53466,13 @@ declare module "babylonjs/DeviceInput/deviceInputSystem" {
          * @returns Current value of input
          */
         /**
-         * Checks for current device input value, given an id and input index
+         * Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.
          * @param deviceType Enum specifiying device type
          * @param deviceSlot "Slot" or index that device is referenced in
          * @param inputIndex Id of input to be checked
          * @returns Current value of input
          */
-        pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): Nullable<number>;
+        pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): number;
         /**
          * Dispose of all the eventlisteners
          */
@@ -130667,13 +130667,13 @@ declare module BABYLON {
          * @returns Current value of input
          */
         /**
-         * Checks for current device input value, given an id and input index
+         * Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.
          * @param deviceType Enum specifiying device type
          * @param deviceSlot "Slot" or index that device is referenced in
          * @param inputIndex Id of input to be checked
          * @returns Current value of input
          */
-        pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): Nullable<number>;
+        pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): number;
         /**
          * Dispose of all the eventlisteners
          */

File diff suppressed because it is too large
+ 2 - 2
dist/preview release/viewer/babylon.viewer.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


+ 1 - 1
src/Sprites/spriteManager.ts

@@ -780,7 +780,7 @@ export class SpriteManager implements ISpriteManager {
         if (this._scene.useRightHandedSystem) {
             engine.setState(culling, zOffset, false, true);
         }
-        
+
         engine.unbindInstanceAttributes();
     }