|
@@ -19372,7 +19372,7 @@ var BABYLON;
|
|
vectors[7].copyFromFloats(maxX, minY, maxZ);
|
|
vectors[7].copyFromFloats(maxX, minY, maxZ);
|
|
// OBB
|
|
// OBB
|
|
max.addToRef(min, this.center).scaleInPlace(0.5);
|
|
max.addToRef(min, this.center).scaleInPlace(0.5);
|
|
- max.subtractToRef(max, this.extendSize).scaleInPlace(0.5);
|
|
|
|
|
|
+ max.subtractToRef(min, this.extendSize).scaleInPlace(0.5);
|
|
this._update(worldMatrix || this._worldMatrix || BABYLON.Matrix.Identity());
|
|
this._update(worldMatrix || this._worldMatrix || BABYLON.Matrix.Identity());
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
@@ -23465,6 +23465,10 @@ var BABYLON;
|
|
*/
|
|
*/
|
|
_this.customRenderTargets = new Array();
|
|
_this.customRenderTargets = new Array();
|
|
/**
|
|
/**
|
|
|
|
+ * When set, the camera will render to this render target instead of the default canvas
|
|
|
|
+ */
|
|
|
|
+ _this.customDefaultRenderTarget = null;
|
|
|
|
+ /**
|
|
* Observable triggered when the camera view matrix has changed.
|
|
* Observable triggered when the camera view matrix has changed.
|
|
*/
|
|
*/
|
|
_this.onViewMatrixChangedObservable = new BABYLON.Observable();
|
|
_this.onViewMatrixChangedObservable = new BABYLON.Observable();
|
|
@@ -24375,6 +24379,10 @@ var BABYLON;
|
|
*/
|
|
*/
|
|
Camera.RIG_MODE_WEBVR = 21;
|
|
Camera.RIG_MODE_WEBVR = 21;
|
|
/**
|
|
/**
|
|
|
|
+ * Custom rig mode allowing rig cameras to be populated manually with any number of cameras
|
|
|
|
+ */
|
|
|
|
+ Camera.RIG_MODE_CUSTOM = 22;
|
|
|
|
+ /**
|
|
* Defines if by default attaching controls should prevent the default javascript event to continue.
|
|
* Defines if by default attaching controls should prevent the default javascript event to continue.
|
|
*/
|
|
*/
|
|
Camera.ForceAttachControlToAlwaysPreventDefault = false;
|
|
Camera.ForceAttachControlToAlwaysPreventDefault = false;
|
|
@@ -26922,6 +26930,7 @@ var BABYLON;
|
|
checkPicking = act.hasPickTriggers;
|
|
checkPicking = act.hasPickTriggers;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ var eventRaised = false;
|
|
if (checkPicking) {
|
|
if (checkPicking) {
|
|
var btn = evt.button;
|
|
var btn = evt.button;
|
|
clickInfo.hasSwiped = _this._isPointerSwiping();
|
|
clickInfo.hasSwiped = _this._isPointerSwiping();
|
|
@@ -26942,6 +26951,7 @@ var BABYLON;
|
|
if (Date.now() - _this._previousStartingPointerTime > Scene.DoubleClickDelay ||
|
|
if (Date.now() - _this._previousStartingPointerTime > Scene.DoubleClickDelay ||
|
|
btn !== _this._previousButtonPressed) {
|
|
btn !== _this._previousButtonPressed) {
|
|
clickInfo.singleClick = true;
|
|
clickInfo.singleClick = true;
|
|
|
|
+ eventRaised = true;
|
|
cb(clickInfo, _this._currentPickResult);
|
|
cb(clickInfo, _this._currentPickResult);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -27007,7 +27017,7 @@ var BABYLON;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ if (!eventRaised) {
|
|
clickInfo.ignore = true;
|
|
clickInfo.ignore = true;
|
|
cb(clickInfo, _this._currentPickResult);
|
|
cb(clickInfo, _this._currentPickResult);
|
|
}
|
|
}
|
|
@@ -29044,7 +29054,18 @@ var BABYLON;
|
|
step.action(this.activeCamera);
|
|
step.action(this.activeCamera);
|
|
}
|
|
}
|
|
this._intermediateRendering = false;
|
|
this._intermediateRendering = false;
|
|
- engine.restoreDefaultFramebuffer(); // Restore back buffer if needed
|
|
|
|
|
|
+ if (this.activeCamera.customDefaultRenderTarget) {
|
|
|
|
+ var internalTexture = this.activeCamera.customDefaultRenderTarget.getInternalTexture();
|
|
|
|
+ if (internalTexture) {
|
|
|
|
+ engine.bindFramebuffer(internalTexture);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ BABYLON.Tools.Error("Camera contains invalid customDefaultRenderTarget");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ engine.restoreDefaultFramebuffer(); // Restore back buffer if needed
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this.onAfterRenderTargetsRenderObservable.notifyObservers(this);
|
|
this.onAfterRenderTargetsRenderObservable.notifyObservers(this);
|
|
// Prepare Frame
|
|
// Prepare Frame
|
|
@@ -61859,10 +61880,10 @@ var BABYLON;
|
|
if (!this.isReady()) {
|
|
if (!this.isReady()) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- if (this._currentRenderId === this._scene.getRenderId()) {
|
|
|
|
|
|
+ if (this._currentRenderId === this._scene.getFrameId()) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- this._currentRenderId = this._scene.getRenderId();
|
|
|
|
|
|
+ this._currentRenderId = this._scene.getFrameId();
|
|
}
|
|
}
|
|
this._scaledUpdateSpeed = this.updateSpeed * (preWarmOnly ? this.preWarmStepOffset : this._scene.getAnimationRatio());
|
|
this._scaledUpdateSpeed = this.updateSpeed * (preWarmOnly ? this.preWarmStepOffset : this._scene.getAnimationRatio());
|
|
// Determine the number of particles we need to create
|
|
// Determine the number of particles we need to create
|
|
@@ -67582,10 +67603,10 @@ var BABYLON;
|
|
}
|
|
}
|
|
this._preWarmDone = true;
|
|
this._preWarmDone = true;
|
|
}
|
|
}
|
|
- if (this._currentRenderId === this._scene.getRenderId()) {
|
|
|
|
|
|
+ if (this._currentRenderId === this._scene.getFrameId()) {
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
- this._currentRenderId = this._scene.getRenderId();
|
|
|
|
|
|
+ this._currentRenderId = this._scene.getFrameId();
|
|
}
|
|
}
|
|
// Get everything ready to render
|
|
// Get everything ready to render
|
|
this._initialize();
|
|
this._initialize();
|
|
@@ -91809,7 +91830,7 @@ var BABYLON;
|
|
* The Motion Blur Post Process which blurs an image based on the objects velocity in scene.
|
|
* The Motion Blur Post Process which blurs an image based on the objects velocity in scene.
|
|
* Velocity can be affected by each object's rotation, position and scale depending on the transformation speed.
|
|
* Velocity can be affected by each object's rotation, position and scale depending on the transformation speed.
|
|
* As an example, all you have to do is to create the post-process:
|
|
* As an example, all you have to do is to create the post-process:
|
|
- * var mb = new BABYLON.MotionBlurProcess(
|
|
|
|
|
|
+ * var mb = new BABYLON.MotionBlurPostProcess(
|
|
* 'mb', // The name of the effect.
|
|
* 'mb', // The name of the effect.
|
|
* scene, // The scene containing the objects to blur according to their velocity.
|
|
* scene, // The scene containing the objects to blur according to their velocity.
|
|
* 1.0, // The required width/height ratio to downsize to before computing the render pass.
|
|
* 1.0, // The required width/height ratio to downsize to before computing the render pass.
|
|
@@ -91817,8 +91838,8 @@ var BABYLON;
|
|
* );
|
|
* );
|
|
* Then, all objects moving, rotating and/or scaling will be blurred depending on the transformation speed.
|
|
* Then, all objects moving, rotating and/or scaling will be blurred depending on the transformation speed.
|
|
*/
|
|
*/
|
|
- var MotionBlurProcess = /** @class */ (function (_super) {
|
|
|
|
- __extends(MotionBlurProcess, _super);
|
|
|
|
|
|
+ var MotionBlurPostProcess = /** @class */ (function (_super) {
|
|
|
|
+ __extends(MotionBlurPostProcess, _super);
|
|
/**
|
|
/**
|
|
* Creates a new instance MotionBlurPostProcess
|
|
* Creates a new instance MotionBlurPostProcess
|
|
* @param name The name of the effect.
|
|
* @param name The name of the effect.
|
|
@@ -91831,7 +91852,7 @@ var BABYLON;
|
|
* @param textureType Type of textures used when performing the post process. (default: 0)
|
|
* @param textureType Type of textures used when performing the post process. (default: 0)
|
|
* @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
|
|
* @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
|
|
*/
|
|
*/
|
|
- function MotionBlurProcess(name, scene, options, camera, samplingMode, engine, reusable, textureType, blockCompilation) {
|
|
|
|
|
|
+ function MotionBlurPostProcess(name, scene, options, camera, samplingMode, engine, reusable, textureType, blockCompilation) {
|
|
if (textureType === void 0) { textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; }
|
|
if (textureType === void 0) { textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; }
|
|
if (blockCompilation === void 0) { blockCompilation = false; }
|
|
if (blockCompilation === void 0) { blockCompilation = false; }
|
|
var _this = _super.call(this, name, "motionBlur", ["motionStrength", "motionScale", "screenSize"], ["velocitySampler"], options, camera, samplingMode, engine, reusable, "#define SAMPLES 64.0", textureType, undefined, null, blockCompilation) || this;
|
|
var _this = _super.call(this, name, "motionBlur", ["motionStrength", "motionScale", "screenSize"], ["velocitySampler"], options, camera, samplingMode, engine, reusable, "#define SAMPLES 64.0", textureType, undefined, null, blockCompilation) || this;
|
|
@@ -91860,7 +91881,7 @@ var BABYLON;
|
|
};
|
|
};
|
|
return _this;
|
|
return _this;
|
|
}
|
|
}
|
|
- Object.defineProperty(MotionBlurProcess.prototype, "motionBlurSamples", {
|
|
|
|
|
|
+ Object.defineProperty(MotionBlurPostProcess.prototype, "motionBlurSamples", {
|
|
/**
|
|
/**
|
|
* Gets the number of iterations are used for motion blur quality. Default value is equal to 32
|
|
* Gets the number of iterations are used for motion blur quality. Default value is equal to 32
|
|
*/
|
|
*/
|
|
@@ -91881,16 +91902,16 @@ var BABYLON;
|
|
* Disposes the post process.
|
|
* Disposes the post process.
|
|
* @param camera The camera to dispose the post process on.
|
|
* @param camera The camera to dispose the post process on.
|
|
*/
|
|
*/
|
|
- MotionBlurProcess.prototype.dispose = function (camera) {
|
|
|
|
|
|
+ MotionBlurPostProcess.prototype.dispose = function (camera) {
|
|
if (this._geometryBufferRenderer) {
|
|
if (this._geometryBufferRenderer) {
|
|
// Clear previous transformation matrices dictionary used to compute objects velocities
|
|
// Clear previous transformation matrices dictionary used to compute objects velocities
|
|
this._geometryBufferRenderer._previousTransformationMatrices = {};
|
|
this._geometryBufferRenderer._previousTransformationMatrices = {};
|
|
}
|
|
}
|
|
_super.prototype.dispose.call(this, camera);
|
|
_super.prototype.dispose.call(this, camera);
|
|
};
|
|
};
|
|
- return MotionBlurProcess;
|
|
|
|
|
|
+ return MotionBlurPostProcess;
|
|
}(BABYLON.PostProcess));
|
|
}(BABYLON.PostProcess));
|
|
- BABYLON.MotionBlurProcess = MotionBlurProcess;
|
|
|
|
|
|
+ BABYLON.MotionBlurPostProcess = MotionBlurPostProcess;
|
|
})(BABYLON || (BABYLON = {}));
|
|
})(BABYLON || (BABYLON = {}));
|
|
|
|
|
|
//# sourceMappingURL=babylon.motionBlurPostProcess.js.map
|
|
//# sourceMappingURL=babylon.motionBlurPostProcess.js.map
|
|
@@ -108208,6 +108229,63 @@ var BABYLON;
|
|
|
|
|
|
//# sourceMappingURL=babylon.vrExperienceHelper.js.map
|
|
//# sourceMappingURL=babylon.vrExperienceHelper.js.map
|
|
|
|
|
|
|
|
+
|
|
|
|
+var BABYLON;
|
|
|
|
+(function (BABYLON) {
|
|
|
|
+ /**
|
|
|
|
+ * WebXR Camera which holds the views for the xrSession
|
|
|
|
+ * @see https://doc.babylonjs.com/how_to/webxr
|
|
|
|
+ */
|
|
|
|
+ var WebXRCamera = /** @class */ (function (_super) {
|
|
|
|
+ __extends(WebXRCamera, _super);
|
|
|
|
+ /**
|
|
|
|
+ * Creates a new webXRCamera, this should only be set at the camera after it has been updated by the xrSessionManager
|
|
|
|
+ * @param name the name of the camera
|
|
|
|
+ * @param scene the scene to add the camera to
|
|
|
|
+ */
|
|
|
|
+ function WebXRCamera(name, scene) {
|
|
|
|
+ var _this = _super.call(this, name, BABYLON.Vector3.Zero(), scene) || this;
|
|
|
|
+ // Initial camera configuration
|
|
|
|
+ _this.minZ = 0;
|
|
|
|
+ _this.rotationQuaternion = new BABYLON.Quaternion();
|
|
|
|
+ _this.cameraRigMode = BABYLON.Camera.RIG_MODE_CUSTOM;
|
|
|
|
+ _this._updateNumberOfRigCameras(1);
|
|
|
|
+ return _this;
|
|
|
|
+ }
|
|
|
|
+ WebXRCamera.prototype._updateNumberOfRigCameras = function (viewCount) {
|
|
|
|
+ if (viewCount === void 0) { viewCount = 1; }
|
|
|
|
+ while (this.rigCameras.length < viewCount) {
|
|
|
|
+ var newCamera = new BABYLON.TargetCamera("view: " + this.rigCameras.length, BABYLON.Vector3.Zero(), this.getScene());
|
|
|
|
+ newCamera.minZ = 0;
|
|
|
|
+ newCamera.parent = this;
|
|
|
|
+ this.rigCameras.push(newCamera);
|
|
|
|
+ }
|
|
|
|
+ while (this.rigCameras.length > viewCount) {
|
|
|
|
+ var removedCamera = this.rigCameras.pop();
|
|
|
|
+ if (removedCamera) {
|
|
|
|
+ removedCamera.dispose();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ /** @hidden */
|
|
|
|
+ WebXRCamera.prototype._updateForDualEyeDebugging = function (pupilDistance) {
|
|
|
|
+ if (pupilDistance === void 0) { pupilDistance = 0.01; }
|
|
|
|
+ // Create initial camera rigs
|
|
|
|
+ this._updateNumberOfRigCameras(2);
|
|
|
|
+ this.rigCameras[0].viewport = new BABYLON.Viewport(0, 0, 0.5, 1.0);
|
|
|
|
+ this.rigCameras[0].position.x = -pupilDistance / 2;
|
|
|
|
+ this.rigCameras[0].customDefaultRenderTarget = null;
|
|
|
|
+ this.rigCameras[1].viewport = new BABYLON.Viewport(0.5, 0, 0.5, 1.0);
|
|
|
|
+ this.rigCameras[1].position.x = pupilDistance / 2;
|
|
|
|
+ this.rigCameras[1].customDefaultRenderTarget = null;
|
|
|
|
+ };
|
|
|
|
+ return WebXRCamera;
|
|
|
|
+ }(BABYLON.FreeCamera));
|
|
|
|
+ BABYLON.WebXRCamera = WebXRCamera;
|
|
|
|
+})(BABYLON || (BABYLON = {}));
|
|
|
|
+
|
|
|
|
+//# sourceMappingURL=babylon.webXRCamera.js.map
|
|
|
|
+
|
|
// Mainly based on these 2 articles :
|
|
// Mainly based on these 2 articles :
|
|
// Creating an universal virtual touch joystick working for all Touch models thanks to Hand.JS : http://blogs.msdn.com/b/davrous/archive/2013/02/22/creating-an-universal-virtual-touch-joystick-working-for-all-touch-models-thanks-to-hand-js.aspx
|
|
// Creating an universal virtual touch joystick working for all Touch models thanks to Hand.JS : http://blogs.msdn.com/b/davrous/archive/2013/02/22/creating-an-universal-virtual-touch-joystick-working-for-all-touch-models-thanks-to-hand-js.aspx
|
|
// & on Seb Lee-Delisle original work: http://seb.ly/2011/04/multi-touch-game-controller-in-javascripthtml5-for-ipad/
|
|
// & on Seb Lee-Delisle original work: http://seb.ly/2011/04/multi-touch-game-controller-in-javascripthtml5-for-ipad/
|