|
@@ -1210,14 +1210,7 @@ export class Engine {
|
|
|
|
|
|
// Pointer lock
|
|
|
if (this.isFullscreen && this._pointerLockRequested && canvas) {
|
|
|
- canvas.requestPointerLock = canvas.requestPointerLock ||
|
|
|
- canvas.msRequestPointerLock ||
|
|
|
- canvas.mozRequestPointerLock ||
|
|
|
- canvas.webkitRequestPointerLock;
|
|
|
-
|
|
|
- if (canvas.requestPointerLock) {
|
|
|
- canvas.requestPointerLock();
|
|
|
- }
|
|
|
+ Tools.RequestPointerlock(canvas);
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -2074,6 +2067,22 @@ export class Engine {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Enters Pointerlock mode
|
|
|
+ */
|
|
|
+ public enterPointerlock(): void {
|
|
|
+ if (this._renderingCanvas) {
|
|
|
+ Tools.RequestPointerlock(this._renderingCanvas);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Exits Pointerlock mode
|
|
|
+ */
|
|
|
+ public exitPointerlock(): void {
|
|
|
+ Tools.ExitPointerlock();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* Clear the current render buffer or the current render target (if any is set up)
|
|
|
* @param color defines the color to use
|
|
|
* @param backBuffer defines if the back buffer must be cleared
|
|
@@ -6396,4 +6405,4 @@ export class Engine {
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+}
|