|
@@ -43342,20 +43342,10 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
};
|
|
};
|
|
NativeEngine.prototype.clear = function (color, backBuffer, depth, stencil) {
|
|
NativeEngine.prototype.clear = function (color, backBuffer, depth, stencil) {
|
|
if (stencil === void 0) { stencil = false; }
|
|
if (stencil === void 0) { stencil = false; }
|
|
- var mode = 0;
|
|
|
|
- if (backBuffer && color) {
|
|
|
|
- this._native.clearColor(color.r, color.g, color.b, color.a !== undefined ? color.a : 1.0);
|
|
|
|
- mode |= this._native.CLEAR_FLAG_COLOR;
|
|
|
|
- }
|
|
|
|
- if (depth) {
|
|
|
|
- this._native.clearDepth(1.0);
|
|
|
|
- mode |= this._native.CLEAR_FLAG_DEPTH;
|
|
|
|
- }
|
|
|
|
- if (stencil) {
|
|
|
|
- this._native.clearStencil(0);
|
|
|
|
- mode |= this._native.CLEAR_FLAG_STENCIL;
|
|
|
|
|
|
+ if (this.useReverseDepthBuffer) {
|
|
|
|
+ throw new Error("reverse depth buffer is not currently implemented");
|
|
}
|
|
}
|
|
- this._native.clear(mode);
|
|
|
|
|
|
+ this._native.clear(backBuffer ? color : null, depth ? 1.0 : undefined, stencil ? 0 : undefined);
|
|
};
|
|
};
|
|
NativeEngine.prototype.createIndexBuffer = function (indices, updateable) {
|
|
NativeEngine.prototype.createIndexBuffer = function (indices, updateable) {
|
|
var data = this._normalizeIndexData(indices);
|
|
var data = this._normalizeIndexData(indices);
|
|
@@ -45718,12 +45708,7 @@ var ThinEngine = /** @class */ (function () {
|
|
this._currentBufferPointers[i] = new BufferPointer();
|
|
this._currentBufferPointers[i] = new BufferPointer();
|
|
}
|
|
}
|
|
// Shader processor
|
|
// Shader processor
|
|
- if (this.webGLVersion > 1) {
|
|
|
|
- this._shaderProcessor = new _WebGL_webGL2ShaderProcessors__WEBPACK_IMPORTED_MODULE_12__["WebGL2ShaderProcessor"]();
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- this._shaderProcessor = new _WebGL_webGLShaderProcessors__WEBPACK_IMPORTED_MODULE_11__["WebGLShaderProcessor"]();
|
|
|
|
- }
|
|
|
|
|
|
+ this._shaderProcessor = this._getShaderProcessor();
|
|
// Detect if we are running on a faulty buggy OS.
|
|
// Detect if we are running on a faulty buggy OS.
|
|
this._badOS = /iPad/i.test(navigator.userAgent) || /iPhone/i.test(navigator.userAgent);
|
|
this._badOS = /iPad/i.test(navigator.userAgent) || /iPhone/i.test(navigator.userAgent);
|
|
// Starting with iOS 14, we can trust the browser
|
|
// Starting with iOS 14, we can trust the browser
|
|
@@ -45744,7 +45729,7 @@ var ThinEngine = /** @class */ (function () {
|
|
*/
|
|
*/
|
|
// Not mixed with Version for tooling purpose.
|
|
// Not mixed with Version for tooling purpose.
|
|
get: function () {
|
|
get: function () {
|
|
- return "babylonjs@5.0.0-alpha.4";
|
|
|
|
|
|
+ return "babylonjs@5.0.0-alpha.5";
|
|
},
|
|
},
|
|
enumerable: false,
|
|
enumerable: false,
|
|
configurable: true
|
|
configurable: true
|
|
@@ -45754,7 +45739,7 @@ var ThinEngine = /** @class */ (function () {
|
|
* Returns the current version of the framework
|
|
* Returns the current version of the framework
|
|
*/
|
|
*/
|
|
get: function () {
|
|
get: function () {
|
|
- return "5.0.0-alpha.4";
|
|
|
|
|
|
+ return "5.0.0-alpha.5";
|
|
},
|
|
},
|
|
enumerable: false,
|
|
enumerable: false,
|
|
configurable: true
|
|
configurable: true
|
|
@@ -45986,18 +45971,13 @@ var ThinEngine = /** @class */ (function () {
|
|
*/
|
|
*/
|
|
ThinEngine.prototype._sharedInit = function (canvas, doNotHandleTouchAction, audioEngine) {
|
|
ThinEngine.prototype._sharedInit = function (canvas, doNotHandleTouchAction, audioEngine) {
|
|
this._renderingCanvas = canvas;
|
|
this._renderingCanvas = canvas;
|
|
- // Shader processor
|
|
|
|
- this._shaderProcessor = this._getShaderProcessor();
|
|
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
* Gets a shader processor implementation fitting with the current engine type.
|
|
* Gets a shader processor implementation fitting with the current engine type.
|
|
* @returns The shader processor implementation.
|
|
* @returns The shader processor implementation.
|
|
*/
|
|
*/
|
|
ThinEngine.prototype._getShaderProcessor = function () {
|
|
ThinEngine.prototype._getShaderProcessor = function () {
|
|
- if (this.webGLVersion > 1) {
|
|
|
|
- return new _WebGL_webGL2ShaderProcessors__WEBPACK_IMPORTED_MODULE_12__["WebGL2ShaderProcessor"]();
|
|
|
|
- }
|
|
|
|
- return null;
|
|
|
|
|
|
+ return (this.webGLVersion > 1 ? new _WebGL_webGL2ShaderProcessors__WEBPACK_IMPORTED_MODULE_12__["WebGL2ShaderProcessor"]() : new _WebGL_webGLShaderProcessors__WEBPACK_IMPORTED_MODULE_11__["WebGLShaderProcessor"]());
|
|
};
|
|
};
|
|
/** @hidden */
|
|
/** @hidden */
|
|
ThinEngine.prototype._getShaderProcessingContext = function () {
|
|
ThinEngine.prototype._getShaderProcessingContext = function () {
|
|
@@ -91629,6 +91609,7 @@ var NodeMaterialBlock = /** @class */ (function () {
|
|
/** Gets or sets a boolean indicating that this input can be edited from a collapsed frame*/
|
|
/** Gets or sets a boolean indicating that this input can be edited from a collapsed frame*/
|
|
this.visibleOnFrame = false;
|
|
this.visibleOnFrame = false;
|
|
this._target = target;
|
|
this._target = target;
|
|
|
|
+ this._originalTargetIsNeutral = target === _Enums_nodeMaterialBlockTargets__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockTargets"].Neutral;
|
|
this._isFinalMerger = isFinalMerger;
|
|
this._isFinalMerger = isFinalMerger;
|
|
this._isInput = isInput;
|
|
this._isInput = isInput;
|
|
this._name = name;
|
|
this._name = name;
|
|
@@ -92226,6 +92207,7 @@ var NodeMaterialBlock = /** @class */ (function () {
|
|
serializationObject.comments = this.comments;
|
|
serializationObject.comments = this.comments;
|
|
serializationObject.visibleInInspector = this.visibleInInspector;
|
|
serializationObject.visibleInInspector = this.visibleInInspector;
|
|
serializationObject.visibleOnFrame = this.visibleOnFrame;
|
|
serializationObject.visibleOnFrame = this.visibleOnFrame;
|
|
|
|
+ serializationObject.target = this.target;
|
|
serializationObject.inputs = [];
|
|
serializationObject.inputs = [];
|
|
serializationObject.outputs = [];
|
|
serializationObject.outputs = [];
|
|
for (var _i = 0, _a = this.inputs; _i < _a.length; _i++) {
|
|
for (var _i = 0, _a = this.inputs; _i < _a.length; _i++) {
|
|
@@ -92240,10 +92222,12 @@ var NodeMaterialBlock = /** @class */ (function () {
|
|
};
|
|
};
|
|
/** @hidden */
|
|
/** @hidden */
|
|
NodeMaterialBlock.prototype._deserialize = function (serializationObject, scene, rootUrl) {
|
|
NodeMaterialBlock.prototype._deserialize = function (serializationObject, scene, rootUrl) {
|
|
|
|
+ var _a;
|
|
this.name = serializationObject.name;
|
|
this.name = serializationObject.name;
|
|
this.comments = serializationObject.comments;
|
|
this.comments = serializationObject.comments;
|
|
this.visibleInInspector = !!serializationObject.visibleInInspector;
|
|
this.visibleInInspector = !!serializationObject.visibleInInspector;
|
|
this.visibleOnFrame = !!serializationObject.visibleOnFrame;
|
|
this.visibleOnFrame = !!serializationObject.visibleOnFrame;
|
|
|
|
+ this._target = (_a = serializationObject.target) !== null && _a !== void 0 ? _a : this.target;
|
|
this._deserializePortDisplayNamesAndExposedOnFrame(serializationObject);
|
|
this._deserializePortDisplayNamesAndExposedOnFrame(serializationObject);
|
|
};
|
|
};
|
|
NodeMaterialBlock.prototype._deserializePortDisplayNamesAndExposedOnFrame = function (serializationObject) {
|
|
NodeMaterialBlock.prototype._deserializePortDisplayNamesAndExposedOnFrame = function (serializationObject) {
|
|
@@ -202600,6 +202584,10 @@ var WebXRControllerPointerSelection = /** @class */ (function (_super) {
|
|
discMesh.parent = controllerData.selectionMesh;
|
|
discMesh.parent = controllerData.selectionMesh;
|
|
var timer = 0;
|
|
var timer = 0;
|
|
var downTriggered = false;
|
|
var downTriggered = false;
|
|
|
|
+ var pointerEventInit = {
|
|
|
|
+ pointerId: controllerData.id,
|
|
|
|
+ pointerType: "xr",
|
|
|
|
+ };
|
|
controllerData.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(function () {
|
|
controllerData.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(function () {
|
|
if (!controllerData.pick) {
|
|
if (!controllerData.pick) {
|
|
return;
|
|
return;
|
|
@@ -202613,11 +202601,11 @@ var WebXRControllerPointerSelection = /** @class */ (function (_super) {
|
|
}
|
|
}
|
|
timer += _this._scene.getEngine().getDeltaTime();
|
|
timer += _this._scene.getEngine().getDeltaTime();
|
|
if (timer >= timeToSelect) {
|
|
if (timer >= timeToSelect) {
|
|
- _this._scene.simulatePointerDown(controllerData.pick, { pointerId: controllerData.id });
|
|
|
|
|
|
+ _this._scene.simulatePointerDown(controllerData.pick, pointerEventInit);
|
|
downTriggered = true;
|
|
downTriggered = true;
|
|
// pointer up right after down, if disable on touch out
|
|
// pointer up right after down, if disable on touch out
|
|
if (_this._options.disablePointerUpOnTouchOut) {
|
|
if (_this._options.disablePointerUpOnTouchOut) {
|
|
- _this._scene.simulatePointerUp(controllerData.pick, { pointerId: controllerData.id });
|
|
|
|
|
|
+ _this._scene.simulatePointerUp(controllerData.pick, pointerEventInit);
|
|
}
|
|
}
|
|
discMesh.isVisible = false;
|
|
discMesh.isVisible = false;
|
|
}
|
|
}
|
|
@@ -202629,7 +202617,7 @@ var WebXRControllerPointerSelection = /** @class */ (function (_super) {
|
|
else {
|
|
else {
|
|
if (downTriggered) {
|
|
if (downTriggered) {
|
|
if (!_this._options.disablePointerUpOnTouchOut) {
|
|
if (!_this._options.disablePointerUpOnTouchOut) {
|
|
- _this._scene.simulatePointerUp(controllerData.pick, { pointerId: controllerData.id });
|
|
|
|
|
|
+ _this._scene.simulatePointerUp(controllerData.pick, pointerEventInit);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
downTriggered = false;
|
|
downTriggered = false;
|
|
@@ -202640,7 +202628,7 @@ var WebXRControllerPointerSelection = /** @class */ (function (_super) {
|
|
downTriggered = false;
|
|
downTriggered = false;
|
|
timer = 0;
|
|
timer = 0;
|
|
}
|
|
}
|
|
- _this._scene.simulatePointerMove(controllerData.pick, { pointerId: controllerData.id });
|
|
|
|
|
|
+ _this._scene.simulatePointerMove(controllerData.pick, pointerEventInit);
|
|
oldPick = controllerData.pick;
|
|
oldPick = controllerData.pick;
|
|
});
|
|
});
|
|
if (this._options.renderingGroupId !== undefined) {
|
|
if (this._options.renderingGroupId !== undefined) {
|
|
@@ -202649,7 +202637,7 @@ var WebXRControllerPointerSelection = /** @class */ (function (_super) {
|
|
if (xrController) {
|
|
if (xrController) {
|
|
xrController.onDisposeObservable.addOnce(function () {
|
|
xrController.onDisposeObservable.addOnce(function () {
|
|
if (controllerData.pick && !_this._options.disablePointerUpOnTouchOut && downTriggered) {
|
|
if (controllerData.pick && !_this._options.disablePointerUpOnTouchOut && downTriggered) {
|
|
- _this._scene.simulatePointerUp(controllerData.pick, { pointerId: controllerData.id });
|
|
|
|
|
|
+ _this._scene.simulatePointerUp(controllerData.pick, pointerEventInit);
|
|
}
|
|
}
|
|
discMesh.dispose();
|
|
discMesh.dispose();
|
|
});
|
|
});
|
|
@@ -202659,24 +202647,28 @@ var WebXRControllerPointerSelection = /** @class */ (function (_super) {
|
|
var _this = this;
|
|
var _this = this;
|
|
var controllerData = this._controllers[xrController.uniqueId];
|
|
var controllerData = this._controllers[xrController.uniqueId];
|
|
var downTriggered = false;
|
|
var downTriggered = false;
|
|
|
|
+ var pointerEventInit = {
|
|
|
|
+ pointerId: controllerData.id,
|
|
|
|
+ pointerType: "xr",
|
|
|
|
+ };
|
|
controllerData.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(function () {
|
|
controllerData.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(function () {
|
|
if (!controllerData.pick || (_this._options.disablePointerUpOnTouchOut && downTriggered)) {
|
|
if (!controllerData.pick || (_this._options.disablePointerUpOnTouchOut && downTriggered)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (!downTriggered) {
|
|
if (!downTriggered) {
|
|
- _this._scene.simulatePointerDown(controllerData.pick, { pointerId: controllerData.id });
|
|
|
|
|
|
+ _this._scene.simulatePointerDown(controllerData.pick, pointerEventInit);
|
|
downTriggered = true;
|
|
downTriggered = true;
|
|
if (_this._options.disablePointerUpOnTouchOut) {
|
|
if (_this._options.disablePointerUpOnTouchOut) {
|
|
- _this._scene.simulatePointerUp(controllerData.pick, { pointerId: controllerData.id });
|
|
|
|
|
|
+ _this._scene.simulatePointerUp(controllerData.pick, pointerEventInit);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- _this._scene.simulatePointerMove(controllerData.pick, { pointerId: controllerData.id });
|
|
|
|
|
|
+ _this._scene.simulatePointerMove(controllerData.pick, pointerEventInit);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
xrController.onDisposeObservable.addOnce(function () {
|
|
xrController.onDisposeObservable.addOnce(function () {
|
|
if (controllerData.pick && downTriggered && !_this._options.disablePointerUpOnTouchOut) {
|
|
if (controllerData.pick && downTriggered && !_this._options.disablePointerUpOnTouchOut) {
|
|
- _this._scene.simulatePointerUp(controllerData.pick, { pointerId: controllerData.id });
|
|
|
|
|
|
+ _this._scene.simulatePointerUp(controllerData.pick, pointerEventInit);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
};
|
|
};
|
|
@@ -202686,11 +202678,15 @@ var WebXRControllerPointerSelection = /** @class */ (function (_super) {
|
|
if (this._options.forceGazeMode) {
|
|
if (this._options.forceGazeMode) {
|
|
return this._attachGazeMode(xrController);
|
|
return this._attachGazeMode(xrController);
|
|
}
|
|
}
|
|
|
|
+ var pointerEventInit = {
|
|
|
|
+ pointerId: controllerData.id,
|
|
|
|
+ pointerType: "xr",
|
|
|
|
+ };
|
|
controllerData.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(function () {
|
|
controllerData.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(function () {
|
|
controllerData.laserPointer.material.disableLighting = _this.disablePointerLighting;
|
|
controllerData.laserPointer.material.disableLighting = _this.disablePointerLighting;
|
|
controllerData.selectionMesh.material.disableLighting = _this.disableSelectionMeshLighting;
|
|
controllerData.selectionMesh.material.disableLighting = _this.disableSelectionMeshLighting;
|
|
if (controllerData.pick) {
|
|
if (controllerData.pick) {
|
|
- _this._scene.simulatePointerMove(controllerData.pick, { pointerId: controllerData.id });
|
|
|
|
|
|
+ _this._scene.simulatePointerMove(controllerData.pick, pointerEventInit);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
if (xrController.inputSource.gamepad) {
|
|
if (xrController.inputSource.gamepad) {
|
|
@@ -202707,12 +202703,12 @@ var WebXRControllerPointerSelection = /** @class */ (function (_super) {
|
|
if (controllerData.pick) {
|
|
if (controllerData.pick) {
|
|
if (_this._options.enablePointerSelectionOnAllControllers || xrController.uniqueId === _this._attachedController) {
|
|
if (_this._options.enablePointerSelectionOnAllControllers || xrController.uniqueId === _this._attachedController) {
|
|
if (pressed) {
|
|
if (pressed) {
|
|
- _this._scene.simulatePointerDown(controllerData.pick, { pointerId: controllerData.id });
|
|
|
|
|
|
+ _this._scene.simulatePointerDown(controllerData.pick, pointerEventInit);
|
|
controllerData.selectionMesh.material.emissiveColor = _this.selectionMeshPickedColor;
|
|
controllerData.selectionMesh.material.emissiveColor = _this.selectionMeshPickedColor;
|
|
controllerData.laserPointer.material.emissiveColor = _this.laserPointerPickedColor;
|
|
controllerData.laserPointer.material.emissiveColor = _this.laserPointerPickedColor;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- _this._scene.simulatePointerUp(controllerData.pick, { pointerId: controllerData.id });
|
|
|
|
|
|
+ _this._scene.simulatePointerUp(controllerData.pick, pointerEventInit);
|
|
controllerData.selectionMesh.material.emissiveColor = _this.selectionMeshDefaultColor;
|
|
controllerData.selectionMesh.material.emissiveColor = _this.selectionMeshDefaultColor;
|
|
controllerData.laserPointer.material.emissiveColor = _this.laserPointerDefaultColor;
|
|
controllerData.laserPointer.material.emissiveColor = _this.laserPointerDefaultColor;
|
|
}
|
|
}
|
|
@@ -202739,14 +202735,14 @@ var WebXRControllerPointerSelection = /** @class */ (function (_super) {
|
|
// use the select and squeeze events
|
|
// use the select and squeeze events
|
|
var selectStartListener = function (event) {
|
|
var selectStartListener = function (event) {
|
|
if (controllerData.xrController && event.inputSource === controllerData.xrController.inputSource && controllerData.pick) {
|
|
if (controllerData.xrController && event.inputSource === controllerData.xrController.inputSource && controllerData.pick) {
|
|
- _this._scene.simulatePointerDown(controllerData.pick, { pointerId: controllerData.id });
|
|
|
|
|
|
+ _this._scene.simulatePointerDown(controllerData.pick, pointerEventInit);
|
|
controllerData.selectionMesh.material.emissiveColor = _this.selectionMeshPickedColor;
|
|
controllerData.selectionMesh.material.emissiveColor = _this.selectionMeshPickedColor;
|
|
controllerData.laserPointer.material.emissiveColor = _this.laserPointerPickedColor;
|
|
controllerData.laserPointer.material.emissiveColor = _this.laserPointerPickedColor;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
var selectEndListener = function (event) {
|
|
var selectEndListener = function (event) {
|
|
if (controllerData.xrController && event.inputSource === controllerData.xrController.inputSource && controllerData.pick) {
|
|
if (controllerData.xrController && event.inputSource === controllerData.xrController.inputSource && controllerData.pick) {
|
|
- _this._scene.simulatePointerUp(controllerData.pick, { pointerId: controllerData.id });
|
|
|
|
|
|
+ _this._scene.simulatePointerUp(controllerData.pick, pointerEventInit);
|
|
controllerData.selectionMesh.material.emissiveColor = _this.selectionMeshDefaultColor;
|
|
controllerData.selectionMesh.material.emissiveColor = _this.selectionMeshDefaultColor;
|
|
controllerData.laserPointer.material.emissiveColor = _this.laserPointerDefaultColor;
|
|
controllerData.laserPointer.material.emissiveColor = _this.laserPointerDefaultColor;
|
|
}
|
|
}
|