|
@@ -8014,7 +8014,7 @@ var BABYLON;
|
|
this._alphaMode = Engine.ALPHA_DISABLE;
|
|
this._alphaMode = Engine.ALPHA_DISABLE;
|
|
// Cache
|
|
// Cache
|
|
this._internalTexturesCache = new Array();
|
|
this._internalTexturesCache = new Array();
|
|
- this._activeTexturesCache = {};
|
|
|
|
|
|
+ this._boundTexturesCache = {};
|
|
this._compiledEffects = {};
|
|
this._compiledEffects = {};
|
|
this._vertexAttribArraysEnabled = [];
|
|
this._vertexAttribArraysEnabled = [];
|
|
this._uintIndicesCurrentlySet = false;
|
|
this._uintIndicesCurrentlySet = false;
|
|
@@ -8872,8 +8872,8 @@ var BABYLON;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
Engine.prototype.resetTextureCache = function () {
|
|
Engine.prototype.resetTextureCache = function () {
|
|
- for (var key in this._activeTexturesCache) {
|
|
|
|
- this._activeTexturesCache[key] = null;
|
|
|
|
|
|
+ for (var key in this._boundTexturesCache) {
|
|
|
|
+ this._boundTexturesCache[key] = null;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
Engine.prototype.isDeterministicLockStep = function () {
|
|
Engine.prototype.isDeterministicLockStep = function () {
|
|
@@ -10447,7 +10447,7 @@ var BABYLON;
|
|
if (!hostingScene) {
|
|
if (!hostingScene) {
|
|
hostingScene = _this.scenes[_this.scenes.length - 1];
|
|
hostingScene = _this.scenes[_this.scenes.length - 1];
|
|
}
|
|
}
|
|
- hostingScene.postProcessManager.directRender([_this._rescalePostProcess], rtt);
|
|
|
|
|
|
+ hostingScene.postProcessManager.directRender([_this._rescalePostProcess], rtt, true);
|
|
_this._bindTextureDirectly(_this._gl.TEXTURE_2D, destination);
|
|
_this._bindTextureDirectly(_this._gl.TEXTURE_2D, destination);
|
|
_this._gl.copyTexImage2D(_this._gl.TEXTURE_2D, 0, internalFormat, 0, 0, destination.width, destination.height, 0);
|
|
_this._gl.copyTexImage2D(_this._gl.TEXTURE_2D, 0, internalFormat, 0, 0, destination.width, destination.height, 0);
|
|
_this.unBindFramebuffer(rtt);
|
|
_this.unBindFramebuffer(rtt);
|
|
@@ -11518,9 +11518,9 @@ var BABYLON;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
Engine.prototype._bindTextureDirectly = function (target, texture) {
|
|
Engine.prototype._bindTextureDirectly = function (target, texture) {
|
|
- if (this._activeTexturesCache[this._activeTextureChannel] !== texture) {
|
|
|
|
|
|
+ if (this._boundTexturesCache[this._activeTextureChannel] !== texture) {
|
|
this._gl.bindTexture(target, texture ? texture._webGLTexture : null);
|
|
this._gl.bindTexture(target, texture ? texture._webGLTexture : null);
|
|
- this._activeTexturesCache[this._activeTextureChannel] = texture;
|
|
|
|
|
|
+ this._boundTexturesCache[this._activeTextureChannel] = texture;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
Engine.prototype._bindTexture = function (channel, texture) {
|
|
Engine.prototype._bindTexture = function (channel, texture) {
|
|
@@ -11554,7 +11554,7 @@ var BABYLON;
|
|
Engine.prototype._setTexture = function (channel, texture) {
|
|
Engine.prototype._setTexture = function (channel, texture) {
|
|
// Not ready?
|
|
// Not ready?
|
|
if (!texture) {
|
|
if (!texture) {
|
|
- if (this._activeTexturesCache[channel] != null) {
|
|
|
|
|
|
+ if (this._boundTexturesCache[channel] != null) {
|
|
this.activateTextureChannel(this._gl.TEXTURE0 + channel);
|
|
this.activateTextureChannel(this._gl.TEXTURE0 + channel);
|
|
this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
|
|
this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
|
|
this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);
|
|
this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);
|
|
@@ -11591,7 +11591,7 @@ var BABYLON;
|
|
if (!alreadyActivated) {
|
|
if (!alreadyActivated) {
|
|
this.activateTextureChannel(this._gl.TEXTURE0 + channel);
|
|
this.activateTextureChannel(this._gl.TEXTURE0 + channel);
|
|
}
|
|
}
|
|
- if (this._activeTexturesCache[this._activeTextureChannel] === internalTexture) {
|
|
|
|
|
|
+ if (this._boundTexturesCache[this._activeTextureChannel] === internalTexture) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
if (internalTexture && internalTexture.is3D) {
|
|
if (internalTexture && internalTexture.is3D) {
|
|
@@ -15600,6 +15600,26 @@ var BABYLON;
|
|
BABYLON.VertexData.ComputeNormals(positions, indices, normals, { useRightHandedSystem: this.getScene().useRightHandedSystem });
|
|
BABYLON.VertexData.ComputeNormals(positions, indices, normals, { useRightHandedSystem: this.getScene().useRightHandedSystem });
|
|
this.setVerticesData(BABYLON.VertexBuffer.NormalKind, normals, updatable);
|
|
this.setVerticesData(BABYLON.VertexBuffer.NormalKind, normals, updatable);
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Align the mesh with a normal.
|
|
|
|
+ * Returns the mesh.
|
|
|
|
+ */
|
|
|
|
+ AbstractMesh.prototype.alignWithNormal = function (normal, upDirection) {
|
|
|
|
+ if (!upDirection) {
|
|
|
|
+ upDirection = BABYLON.Axis.Y;
|
|
|
|
+ }
|
|
|
|
+ var axisX = BABYLON.Tmp.Vector3[0];
|
|
|
|
+ var axisZ = BABYLON.Tmp.Vector3[1];
|
|
|
|
+ BABYLON.Vector3.CrossToRef(upDirection, normal, axisZ);
|
|
|
|
+ BABYLON.Vector3.CrossToRef(normal, axisZ, axisX);
|
|
|
|
+ if (this.rotationQuaternion) {
|
|
|
|
+ BABYLON.Quaternion.RotationQuaternionFromAxisToRef(axisX, normal, axisZ, this.rotationQuaternion);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ BABYLON.Vector3.RotationFromAxisToRef(axisX, normal, axisZ, this.rotation);
|
|
|
|
+ }
|
|
|
|
+ return this;
|
|
|
|
+ };
|
|
AbstractMesh.prototype.checkOcclusionQuery = function () {
|
|
AbstractMesh.prototype.checkOcclusionQuery = function () {
|
|
var engine = this.getEngine();
|
|
var engine = this.getEngine();
|
|
if (engine.webGLVersion < 2 || this.occlusionType === AbstractMesh.OCCLUSION_TYPE_NONE) {
|
|
if (engine.webGLVersion < 2 || this.occlusionType === AbstractMesh.OCCLUSION_TYPE_NONE) {
|
|
@@ -47413,14 +47433,16 @@ var BABYLON;
|
|
var options = {
|
|
var options = {
|
|
attributes: [BABYLON.VertexBuffer.PositionKind],
|
|
attributes: [BABYLON.VertexBuffer.PositionKind],
|
|
uniforms: ["world", "viewProjection"],
|
|
uniforms: ["world", "viewProjection"],
|
|
- needAlphaBlending: false,
|
|
|
|
|
|
+ needAlphaBlending: true,
|
|
defines: defines
|
|
defines: defines
|
|
};
|
|
};
|
|
|
|
+ if (useVertexAlpha === false) {
|
|
|
|
+ options.needAlphaBlending = false;
|
|
|
|
+ }
|
|
if (!useVertexColor) {
|
|
if (!useVertexColor) {
|
|
options.uniforms.push("color");
|
|
options.uniforms.push("color");
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- options.needAlphaBlending = (useVertexAlpha) ? true : false;
|
|
|
|
options.defines.push("#define VERTEXCOLOR");
|
|
options.defines.push("#define VERTEXCOLOR");
|
|
options.attributes.push(BABYLON.VertexBuffer.ColorKind);
|
|
options.attributes.push(BABYLON.VertexBuffer.ColorKind);
|
|
}
|
|
}
|
|
@@ -48376,7 +48398,7 @@ var BABYLON;
|
|
* The parameter `lines` is an array of lines, each line being an array of successive Vector3.
|
|
* The parameter `lines` is an array of lines, each line being an array of successive Vector3.
|
|
* The optional parameter `instance` is an instance of an existing LineSystem object to be updated with the passed `lines` parameter. The way to update it is the same than for
|
|
* The optional parameter `instance` is an instance of an existing LineSystem object to be updated with the passed `lines` parameter. The way to update it is the same than for
|
|
* The optional parameter `colors` is an array of line colors, each line colors being an array of successive Color4, one per line point.
|
|
* The optional parameter `colors` is an array of line colors, each line colors being an array of successive Color4, one per line point.
|
|
- * The optional parameter `useVertexAlpha' is to be set to `true` (default `false`) when the alpha value from the former `Color4` array must be used.
|
|
|
|
|
|
+ * The optional parameter `useVertexAlpha' is to be set to `false` (default `true`) when you don't need the alpha blending (faster).
|
|
* updating a simple Line mesh, you just need to update every line in the `lines` array : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#lines-and-dashedlines
|
|
* updating a simple Line mesh, you just need to update every line in the `lines` array : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#lines-and-dashedlines
|
|
* When updating an instance, remember that only line point positions can change, not the number of points, neither the number of lines.
|
|
* When updating an instance, remember that only line point positions can change, not the number of points, neither the number of lines.
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
@@ -48432,7 +48454,7 @@ var BABYLON;
|
|
* The parameter `points` is an array successive Vector3.
|
|
* The parameter `points` is an array successive Vector3.
|
|
* The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#lines-and-dashedlines
|
|
* The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#lines-and-dashedlines
|
|
* The optional parameter `colors` is an array of successive Color4, one per line point.
|
|
* The optional parameter `colors` is an array of successive Color4, one per line point.
|
|
- * The optional parameter `useVertexAlpha' is to be set to `true` (default `false`) when the alpha value from the former `Color4` array must be used.
|
|
|
|
|
|
+ * The optional parameter `useVertexAlpha' is to be set to `false` (default `true`) when you don't need alpha blending (faster).
|
|
* When updating an instance, remember that only point positions can change, not the number of points.
|
|
* When updating an instance, remember that only point positions can change, not the number of points.
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
*/
|
|
*/
|
|
@@ -60323,6 +60345,9 @@ var BABYLON;
|
|
this.addEffect(new BABYLON.PostProcessRenderEffect(engine, this.FxaaPostProcessId, function () { return _this.fxaa; }, true));
|
|
this.addEffect(new BABYLON.PostProcessRenderEffect(engine, this.FxaaPostProcessId, function () { return _this.fxaa; }, true));
|
|
this.fxaa.autoClear = !this.bloomEnabled && (!this._hdr || !this.imageProcessing);
|
|
this.fxaa.autoClear = !this.bloomEnabled && (!this._hdr || !this.imageProcessing);
|
|
}
|
|
}
|
|
|
|
+ else if (this._hdr && this.imageProcessing) {
|
|
|
|
+ this.finalMerge = this.imageProcessing;
|
|
|
|
+ }
|
|
else {
|
|
else {
|
|
this.finalMerge = new BABYLON.PassPostProcess("finalMerge", 1.0, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false, this._defaultPipelineTextureType);
|
|
this.finalMerge = new BABYLON.PassPostProcess("finalMerge", 1.0, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false, this._defaultPipelineTextureType);
|
|
this.addEffect(new BABYLON.PostProcessRenderEffect(engine, this.FinalMergePostProcessId, function () { return _this.finalMerge; }, true));
|
|
this.addEffect(new BABYLON.PostProcessRenderEffect(engine, this.FinalMergePostProcessId, function () { return _this.finalMerge; }, true));
|
|
@@ -61233,7 +61258,7 @@ var BABYLON;
|
|
(function (BABYLON) {
|
|
(function (BABYLON) {
|
|
var ImageProcessingPostProcess = /** @class */ (function (_super) {
|
|
var ImageProcessingPostProcess = /** @class */ (function (_super) {
|
|
__extends(ImageProcessingPostProcess, _super);
|
|
__extends(ImageProcessingPostProcess, _super);
|
|
- function ImageProcessingPostProcess(name, options, camera, samplingMode, engine, reusable, textureType) {
|
|
|
|
|
|
+ function ImageProcessingPostProcess(name, options, camera, samplingMode, engine, reusable, textureType, imageProcessingConfiguration) {
|
|
if (camera === void 0) { camera = null; }
|
|
if (camera === void 0) { camera = null; }
|
|
if (textureType === void 0) { textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; }
|
|
if (textureType === void 0) { textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; }
|
|
var _this = _super.call(this, name, "imageProcessing", [], [], options, camera, samplingMode, engine, reusable, null, textureType, "postprocess", null, true) || this;
|
|
var _this = _super.call(this, name, "imageProcessing", [], [], options, camera, samplingMode, engine, reusable, null, textureType, "postprocess", null, true) || this;
|
|
@@ -61257,9 +61282,17 @@ var BABYLON;
|
|
IMAGEPROCESSINGPOSTPROCESS: false,
|
|
IMAGEPROCESSINGPOSTPROCESS: false,
|
|
EXPOSURE: false,
|
|
EXPOSURE: false,
|
|
};
|
|
};
|
|
- // Setup the default processing configuration to the scene.
|
|
|
|
- _this._attachImageProcessingConfiguration(null, true);
|
|
|
|
- _this.imageProcessingConfiguration.applyByPostProcess = true;
|
|
|
|
|
|
+ // Setup the configuration as forced by the constructor. This would then not force the
|
|
|
|
+ // scene materials output in linear space and let untouched the default forward pass.
|
|
|
|
+ if (imageProcessingConfiguration) {
|
|
|
|
+ _this._attachImageProcessingConfiguration(imageProcessingConfiguration, true);
|
|
|
|
+ _this.imageProcessingConfiguration.applyByPostProcess = false;
|
|
|
|
+ _this.fromLinearSpace = false;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ _this._attachImageProcessingConfiguration(null, true);
|
|
|
|
+ _this.imageProcessingConfiguration.applyByPostProcess = true;
|
|
|
|
+ }
|
|
_this.onApply = function (effect) {
|
|
_this.onApply = function (effect) {
|
|
_this.imageProcessingConfiguration.bind(effect, _this.aspectRatio);
|
|
_this.imageProcessingConfiguration.bind(effect, _this.aspectRatio);
|
|
};
|
|
};
|
|
@@ -67410,7 +67443,7 @@ var BABYLON;
|
|
}
|
|
}
|
|
impostor.applyImpulse(impostorForceAndContactPoint.force, impostorForceAndContactPoint.contactPoint);
|
|
impostor.applyImpulse(impostorForceAndContactPoint.force, impostorForceAndContactPoint.contactPoint);
|
|
});
|
|
});
|
|
- event.cleanup(false);
|
|
|
|
|
|
+ event.dispose(false);
|
|
return event;
|
|
return event;
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
@@ -67437,7 +67470,7 @@ var BABYLON;
|
|
}
|
|
}
|
|
impostor.applyForce(impostorForceAndContactPoint.force, impostorForceAndContactPoint.contactPoint);
|
|
impostor.applyForce(impostorForceAndContactPoint.force, impostorForceAndContactPoint.contactPoint);
|
|
});
|
|
});
|
|
- event.cleanup(false);
|
|
|
|
|
|
+ event.dispose(false);
|
|
return event;
|
|
return event;
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
@@ -67457,7 +67490,7 @@ var BABYLON;
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
var event = new PhysicsGravitationalFieldEvent(this, this._scene, origin, radius, strength, falloff);
|
|
var event = new PhysicsGravitationalFieldEvent(this, this._scene, origin, radius, strength, falloff);
|
|
- event.cleanup(false);
|
|
|
|
|
|
+ event.dispose(false);
|
|
return event;
|
|
return event;
|
|
};
|
|
};
|
|
return PhysicsHelper;
|
|
return PhysicsHelper;
|
|
@@ -67521,7 +67554,7 @@ var BABYLON;
|
|
* Disposes the radialSphere.
|
|
* Disposes the radialSphere.
|
|
* @param {bolean} force
|
|
* @param {bolean} force
|
|
*/
|
|
*/
|
|
- PhysicsRadialExplosionEvent.prototype.cleanup = function (force) {
|
|
|
|
|
|
+ PhysicsRadialExplosionEvent.prototype.dispose = function (force) {
|
|
var _this = this;
|
|
var _this = this;
|
|
if (force === void 0) { force = true; }
|
|
if (force === void 0) { force = true; }
|
|
if (force) {
|
|
if (force) {
|
|
@@ -67594,7 +67627,7 @@ var BABYLON;
|
|
* Disposes the radialSphere.
|
|
* Disposes the radialSphere.
|
|
* @param {bolean} force
|
|
* @param {bolean} force
|
|
*/
|
|
*/
|
|
- PhysicsGravitationalFieldEvent.prototype.cleanup = function (force) {
|
|
|
|
|
|
+ PhysicsGravitationalFieldEvent.prototype.dispose = function (force) {
|
|
var _this = this;
|
|
var _this = this;
|
|
if (force === void 0) { force = true; }
|
|
if (force === void 0) { force = true; }
|
|
if (force) {
|
|
if (force) {
|
|
@@ -71717,13 +71750,14 @@ var BABYLON;
|
|
this._teleportationAllowed = false;
|
|
this._teleportationAllowed = false;
|
|
this._rotationAllowed = true;
|
|
this._rotationAllowed = true;
|
|
this._teleportationRequestInitiated = false;
|
|
this._teleportationRequestInitiated = false;
|
|
- //private _classicGamepadTeleportationRequestInitiated = false;
|
|
|
|
this._rotationRightAsked = false;
|
|
this._rotationRightAsked = false;
|
|
this._rotationLeftAsked = false;
|
|
this._rotationLeftAsked = false;
|
|
this._teleportationFillColor = "#444444";
|
|
this._teleportationFillColor = "#444444";
|
|
this._teleportationBorderColor = "#FFFFFF";
|
|
this._teleportationBorderColor = "#FFFFFF";
|
|
this._rotationAngle = 0;
|
|
this._rotationAngle = 0;
|
|
this._haloCenter = new BABYLON.Vector3(0, 0, 0);
|
|
this._haloCenter = new BABYLON.Vector3(0, 0, 0);
|
|
|
|
+ this._padSensibilityUp = 0.7;
|
|
|
|
+ this._padSensibilityDown = 0.3;
|
|
this._scene = scene;
|
|
this._scene = scene;
|
|
if (!this._scene.activeCamera || isNaN(this._scene.activeCamera.position.x)) {
|
|
if (!this._scene.activeCamera || isNaN(this._scene.activeCamera.position.x)) {
|
|
this._position = new BABYLON.Vector3(0, 2, 0);
|
|
this._position = new BABYLON.Vector3(0, 2, 0);
|
|
@@ -71958,7 +71992,6 @@ var BABYLON;
|
|
if (!this._webVRpresenting) {
|
|
if (!this._webVRpresenting) {
|
|
this._webVRCamera.position = this._position;
|
|
this._webVRCamera.position = this._position;
|
|
this._scene.activeCamera = this._webVRCamera;
|
|
this._scene.activeCamera = this._webVRCamera;
|
|
- this._scene.imageProcessingConfiguration.isEnabled = true;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
@@ -71986,7 +72019,6 @@ var BABYLON;
|
|
}
|
|
}
|
|
this._deviceOrientationCamera.position = this._position;
|
|
this._deviceOrientationCamera.position = this._position;
|
|
this._scene.activeCamera = this._deviceOrientationCamera;
|
|
this._scene.activeCamera = this._deviceOrientationCamera;
|
|
- this._scene.imageProcessingConfiguration.isEnabled = false;
|
|
|
|
if (this._canvas) {
|
|
if (this._canvas) {
|
|
this._scene.activeCamera.attachControl(this._canvas);
|
|
this._scene.activeCamera.attachControl(this._canvas);
|
|
}
|
|
}
|
|
@@ -72021,17 +72053,25 @@ var BABYLON;
|
|
this._enableTeleportationOnController(this._webVRCamera.rightController);
|
|
this._enableTeleportationOnController(this._webVRCamera.rightController);
|
|
}
|
|
}
|
|
this._scene.gamepadManager.onGamepadConnectedObservable.add(function (pad) { return _this._onNewGamepadConnected(pad); });
|
|
this._scene.gamepadManager.onGamepadConnectedObservable.add(function (pad) { return _this._onNewGamepadConnected(pad); });
|
|
- this._postProcessMove = new BABYLON.ImageProcessingPostProcess("postProcessMove", 1.0, this._webVRCamera);
|
|
|
|
|
|
+ // Creates an image processing post process for the vignette not relying
|
|
|
|
+ // on the main scene configuration for image processing to reduce setup and spaces
|
|
|
|
+ // (gamma/linear) conflicts.
|
|
|
|
+ var imageProcessingConfiguration = new BABYLON.ImageProcessingConfiguration();
|
|
|
|
+ imageProcessingConfiguration.vignetteColor = new BABYLON.Color4(0, 0, 0, 0);
|
|
|
|
+ this._postProcessMove = new BABYLON.ImageProcessingPostProcess("postProcessMove", 1.0, this._webVRCamera, undefined, undefined, undefined, undefined, imageProcessingConfiguration);
|
|
|
|
+ // Force recompilation of the postprocess to be ready before hand and not block the animation.
|
|
|
|
+ // Simply touching the property forces recompilation of the effect.
|
|
|
|
+ this._postProcessMove.imageProcessingConfiguration.vignetteEnabled = true;
|
|
|
|
+ // Go back to default (both variants would be compiled).
|
|
|
|
+ this._postProcessMove.imageProcessingConfiguration.vignetteEnabled = false;
|
|
this._passProcessMove = new BABYLON.PassPostProcess("pass", 1.0, this._webVRCamera);
|
|
this._passProcessMove = new BABYLON.PassPostProcess("pass", 1.0, this._webVRCamera);
|
|
- this._scene.imageProcessingConfiguration.vignetteColor = new BABYLON.Color4(0, 0, 0, 0);
|
|
|
|
- this._scene.imageProcessingConfiguration.vignetteEnabled = true;
|
|
|
|
- this._scene.imageProcessingConfiguration.isEnabled = false;
|
|
|
|
this._createGazeTracker();
|
|
this._createGazeTracker();
|
|
this._createTeleportationCircles();
|
|
this._createTeleportationCircles();
|
|
this.meshSelectionPredicate = function (mesh) {
|
|
this.meshSelectionPredicate = function (mesh) {
|
|
if (mesh.isVisible && mesh.name.indexOf("gazeTracker") === -1
|
|
if (mesh.isVisible && mesh.name.indexOf("gazeTracker") === -1
|
|
&& mesh.name.indexOf("teleportationCircle") === -1
|
|
&& mesh.name.indexOf("teleportationCircle") === -1
|
|
- && mesh.name.indexOf("torusTeleportation") === -1) {
|
|
|
|
|
|
+ && mesh.name.indexOf("torusTeleportation") === -1
|
|
|
|
+ && mesh.name.indexOf("ray") === -1) {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
@@ -72045,12 +72085,12 @@ var BABYLON;
|
|
if (gamepad.leftStick) {
|
|
if (gamepad.leftStick) {
|
|
gamepad.onleftstickchanged(function (stickValues) {
|
|
gamepad.onleftstickchanged(function (stickValues) {
|
|
if (!_this._teleportationRequestInitiated) {
|
|
if (!_this._teleportationRequestInitiated) {
|
|
- if (stickValues.y < -0.6) {
|
|
|
|
|
|
+ if (stickValues.y < -_this._padSensibilityUp) {
|
|
_this._teleportationRequestInitiated = true;
|
|
_this._teleportationRequestInitiated = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- if (stickValues.y > -0.4) {
|
|
|
|
|
|
+ if (stickValues.y > -_this._padSensibilityDown) {
|
|
if (_this._teleportationAllowed) {
|
|
if (_this._teleportationAllowed) {
|
|
_this._teleportCamera();
|
|
_this._teleportCamera();
|
|
}
|
|
}
|
|
@@ -72062,7 +72102,7 @@ var BABYLON;
|
|
if (gamepad.rightStick) {
|
|
if (gamepad.rightStick) {
|
|
gamepad.onrightstickchanged(function (stickValues) {
|
|
gamepad.onrightstickchanged(function (stickValues) {
|
|
if (!_this._rotationLeftAsked) {
|
|
if (!_this._rotationLeftAsked) {
|
|
- if (stickValues.x < -0.6) {
|
|
|
|
|
|
+ if (stickValues.x < -_this._padSensibilityUp) {
|
|
_this._rotationLeftAsked = true;
|
|
_this._rotationLeftAsked = true;
|
|
if (_this._rotationAllowed) {
|
|
if (_this._rotationAllowed) {
|
|
_this._rotateCamera(false);
|
|
_this._rotateCamera(false);
|
|
@@ -72070,12 +72110,12 @@ var BABYLON;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- if (stickValues.x > -0.4) {
|
|
|
|
|
|
+ if (stickValues.x > -_this._padSensibilityDown) {
|
|
_this._rotationLeftAsked = false;
|
|
_this._rotationLeftAsked = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (!_this._rotationRightAsked) {
|
|
if (!_this._rotationRightAsked) {
|
|
- if (stickValues.x > 0.6) {
|
|
|
|
|
|
+ if (stickValues.x > _this._padSensibilityUp) {
|
|
_this._rotationRightAsked = true;
|
|
_this._rotationRightAsked = true;
|
|
if (_this._rotationAllowed) {
|
|
if (_this._rotationAllowed) {
|
|
_this._rotateCamera(true);
|
|
_this._rotateCamera(true);
|
|
@@ -72083,7 +72123,7 @@ var BABYLON;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- if (stickValues.x < 0.4) {
|
|
|
|
|
|
+ if (stickValues.x < _this._padSensibilityDown) {
|
|
_this._rotationRightAsked = false;
|
|
_this._rotationRightAsked = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -72101,14 +72141,14 @@ var BABYLON;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- var laserPointer = BABYLON.Mesh.CreateCylinder("laserPointer", 3, 0.004, 0.0001, 20, 1, this._scene, false);
|
|
|
|
|
|
+ var laserPointer = BABYLON.Mesh.CreateCylinder("laserPointer", 1, 0.004, 0.0001, 20, 1, this._scene, false);
|
|
var laserPointerMaterial = new BABYLON.StandardMaterial("laserPointerMat", this._scene);
|
|
var laserPointerMaterial = new BABYLON.StandardMaterial("laserPointerMat", this._scene);
|
|
laserPointerMaterial.emissiveColor = new BABYLON.Color3(0.7, 0.7, 0.7);
|
|
laserPointerMaterial.emissiveColor = new BABYLON.Color3(0.7, 0.7, 0.7);
|
|
laserPointerMaterial.alpha = 0.6;
|
|
laserPointerMaterial.alpha = 0.6;
|
|
laserPointer.material = laserPointerMaterial;
|
|
laserPointer.material = laserPointerMaterial;
|
|
laserPointer.rotation.x = Math.PI / 2;
|
|
laserPointer.rotation.x = Math.PI / 2;
|
|
laserPointer.parent = controllerMesh;
|
|
laserPointer.parent = controllerMesh;
|
|
- laserPointer.position.z = -1.5;
|
|
|
|
|
|
+ laserPointer.position.z = -0.5;
|
|
laserPointer.position.y = 0;
|
|
laserPointer.position.y = 0;
|
|
laserPointer.isVisible = false;
|
|
laserPointer.isVisible = false;
|
|
webVRController.onMainButtonStateChangedObservable.add(function (stateObject) {
|
|
webVRController.onMainButtonStateChangedObservable.add(function (stateObject) {
|
|
@@ -72120,22 +72160,23 @@ var BABYLON;
|
|
webVRController.onPadValuesChangedObservable.add(function (stateObject) {
|
|
webVRController.onPadValuesChangedObservable.add(function (stateObject) {
|
|
// on pressed
|
|
// on pressed
|
|
if (!_this._teleportationRequestInitiated) {
|
|
if (!_this._teleportationRequestInitiated) {
|
|
- if (stateObject.y < -0.6) {
|
|
|
|
- laserPointer.isVisible = true;
|
|
|
|
|
|
+ if (stateObject.y < -_this._padSensibilityUp) {
|
|
|
|
+ //laserPointer.isVisible = true;
|
|
_this._teleportationRequestInitiated = true;
|
|
_this._teleportationRequestInitiated = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- if (stateObject.y > -0.4) {
|
|
|
|
|
|
+ if (stateObject.y > -_this._padSensibilityDown) {
|
|
if (_this._teleportationAllowed) {
|
|
if (_this._teleportationAllowed) {
|
|
|
|
+ _this._teleportationAllowed = false;
|
|
_this._teleportCamera();
|
|
_this._teleportCamera();
|
|
}
|
|
}
|
|
_this._teleportationRequestInitiated = false;
|
|
_this._teleportationRequestInitiated = false;
|
|
- laserPointer.isVisible = false;
|
|
|
|
|
|
+ //laserPointer.isVisible = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (!_this._rotationLeftAsked) {
|
|
if (!_this._rotationLeftAsked) {
|
|
- if (stateObject.x < -0.6) {
|
|
|
|
|
|
+ if (stateObject.x < -_this._padSensibilityUp) {
|
|
_this._rotationLeftAsked = true;
|
|
_this._rotationLeftAsked = true;
|
|
if (_this._rotationAllowed) {
|
|
if (_this._rotationAllowed) {
|
|
_this._rotateCamera(false);
|
|
_this._rotateCamera(false);
|
|
@@ -72143,12 +72184,12 @@ var BABYLON;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- if (stateObject.x > -0.4) {
|
|
|
|
|
|
+ if (stateObject.x > -_this._padSensibilityDown) {
|
|
_this._rotationLeftAsked = false;
|
|
_this._rotationLeftAsked = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (!_this._rotationRightAsked) {
|
|
if (!_this._rotationRightAsked) {
|
|
- if (stateObject.x > 0.6) {
|
|
|
|
|
|
+ if (stateObject.x > _this._padSensibilityUp) {
|
|
_this._rotationRightAsked = true;
|
|
_this._rotationRightAsked = true;
|
|
if (_this._rotationAllowed) {
|
|
if (_this._rotationAllowed) {
|
|
_this._rotateCamera(true);
|
|
_this._rotateCamera(true);
|
|
@@ -72156,7 +72197,7 @@ var BABYLON;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- if (stateObject.x < 0.4) {
|
|
|
|
|
|
+ if (stateObject.x < _this._padSensibilityDown) {
|
|
_this._rotationRightAsked = false;
|
|
_this._rotationRightAsked = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -72176,6 +72217,7 @@ var BABYLON;
|
|
};
|
|
};
|
|
VRExperienceHelper.prototype._createTeleportationCircles = function () {
|
|
VRExperienceHelper.prototype._createTeleportationCircles = function () {
|
|
this._teleportationCircle = BABYLON.Mesh.CreateGround("teleportationCircle", 2, 2, 2, this._scene);
|
|
this._teleportationCircle = BABYLON.Mesh.CreateGround("teleportationCircle", 2, 2, 2, this._scene);
|
|
|
|
+ this._teleportationCircle.isPickable = false;
|
|
var length = 512;
|
|
var length = 512;
|
|
var dynamicTexture = new BABYLON.DynamicTexture("DynamicTexture", length, this._scene, true);
|
|
var dynamicTexture = new BABYLON.DynamicTexture("DynamicTexture", length, this._scene, true);
|
|
dynamicTexture.hasAlpha = true;
|
|
dynamicTexture.hasAlpha = true;
|
|
@@ -72196,6 +72238,7 @@ var BABYLON;
|
|
teleportationCircleMaterial.diffuseTexture = dynamicTexture;
|
|
teleportationCircleMaterial.diffuseTexture = dynamicTexture;
|
|
this._teleportationCircle.material = teleportationCircleMaterial;
|
|
this._teleportationCircle.material = teleportationCircleMaterial;
|
|
var torus = BABYLON.Mesh.CreateTorus("torusTeleportation", 0.75, 0.1, 25, this._scene, false);
|
|
var torus = BABYLON.Mesh.CreateTorus("torusTeleportation", 0.75, 0.1, 25, this._scene, false);
|
|
|
|
+ torus.isPickable = false;
|
|
torus.parent = this._teleportationCircle;
|
|
torus.parent = this._teleportationCircle;
|
|
var animationInnerCircle = new BABYLON.Animation("animationInnerCircle", "position.y", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
|
|
var animationInnerCircle = new BABYLON.Animation("animationInnerCircle", "position.y", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
|
|
var keys = [];
|
|
var keys = [];
|
|
@@ -72288,11 +72331,11 @@ var BABYLON;
|
|
animationPP2.setKeys(vignetteStretchKeys);
|
|
animationPP2.setKeys(vignetteStretchKeys);
|
|
animationPP2.setEasingFunction(easingFunction);
|
|
animationPP2.setEasingFunction(easingFunction);
|
|
this._postProcessMove.animations.push(animationPP2);
|
|
this._postProcessMove.animations.push(animationPP2);
|
|
- this._scene.imageProcessingConfiguration.vignetteWeight = 0;
|
|
|
|
- this._scene.imageProcessingConfiguration.vignetteStretch = 0;
|
|
|
|
- this._scene.imageProcessingConfiguration.vignetteEnabled = true;
|
|
|
|
|
|
+ this._postProcessMove.imageProcessingConfiguration.vignetteWeight = 0;
|
|
|
|
+ this._postProcessMove.imageProcessingConfiguration.vignetteStretch = 0;
|
|
|
|
+ this._postProcessMove.imageProcessingConfiguration.vignetteEnabled = true;
|
|
this._scene.beginAnimation(this._postProcessMove, 0, 6, false, 1, function () {
|
|
this._scene.beginAnimation(this._postProcessMove, 0, 6, false, 1, function () {
|
|
- _this._scene.imageProcessingConfiguration.vignetteEnabled = false;
|
|
|
|
|
|
+ _this._postProcessMove.imageProcessingConfiguration.vignetteEnabled = false;
|
|
});
|
|
});
|
|
this._scene.beginAnimation(this.currentVRCamera, 0, 6, false, 1);
|
|
this._scene.beginAnimation(this.currentVRCamera, 0, 6, false, 1);
|
|
};
|
|
};
|
|
@@ -72372,11 +72415,11 @@ var BABYLON;
|
|
});
|
|
});
|
|
animationPP2.setKeys(vignetteStretchKeys);
|
|
animationPP2.setKeys(vignetteStretchKeys);
|
|
this._postProcessMove.animations.push(animationPP2);
|
|
this._postProcessMove.animations.push(animationPP2);
|
|
- this._scene.imageProcessingConfiguration.vignetteWeight = 8;
|
|
|
|
- this._scene.imageProcessingConfiguration.vignetteStretch = 10;
|
|
|
|
- this._scene.imageProcessingConfiguration.vignetteEnabled = true;
|
|
|
|
|
|
+ this._postProcessMove.imageProcessingConfiguration.vignetteWeight = 8;
|
|
|
|
+ this._postProcessMove.imageProcessingConfiguration.vignetteStretch = 10;
|
|
|
|
+ this._postProcessMove.imageProcessingConfiguration.vignetteEnabled = true;
|
|
this._scene.beginAnimation(this._postProcessMove, 0, 11, false, 1, function () {
|
|
this._scene.beginAnimation(this._postProcessMove, 0, 11, false, 1, function () {
|
|
- _this._scene.imageProcessingConfiguration.vignetteEnabled = false;
|
|
|
|
|
|
+ _this._postProcessMove.imageProcessingConfiguration.vignetteEnabled = false;
|
|
});
|
|
});
|
|
this._scene.beginAnimation(this.currentVRCamera, 0, 11, false, 1);
|
|
this._scene.beginAnimation(this.currentVRCamera, 0, 11, false, 1);
|
|
};
|
|
};
|
|
@@ -72419,6 +72462,7 @@ var BABYLON;
|
|
else {
|
|
else {
|
|
this._gazeTracker.position.z -= deltaFighting;
|
|
this._gazeTracker.position.z -= deltaFighting;
|
|
}
|
|
}
|
|
|
|
+ ray.length = hit.distance;
|
|
}
|
|
}
|
|
if (this._rayHelper) {
|
|
if (this._rayHelper) {
|
|
this._rayHelper.dispose();
|
|
this._rayHelper.dispose();
|
|
@@ -72432,6 +72476,7 @@ var BABYLON;
|
|
this._moveTeleportationSelectorTo(hit.pickedPoint);
|
|
this._moveTeleportationSelectorTo(hit.pickedPoint);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ console.log(hit.pickedMesh.name);
|
|
// If not, we're in a selection scenario
|
|
// If not, we're in a selection scenario
|
|
this._hideTeleportationCircle();
|
|
this._hideTeleportationCircle();
|
|
this._teleportationAllowed = false;
|
|
this._teleportationAllowed = false;
|
|
@@ -77090,8 +77135,8 @@ var BABYLON;
|
|
NullEngine.prototype.updateDynamicVertexBuffer = function (vertexBuffer, vertices, offset, count) {
|
|
NullEngine.prototype.updateDynamicVertexBuffer = function (vertexBuffer, vertices, offset, count) {
|
|
};
|
|
};
|
|
NullEngine.prototype._bindTextureDirectly = function (target, texture) {
|
|
NullEngine.prototype._bindTextureDirectly = function (target, texture) {
|
|
- if (this._activeTexturesCache[this._activeTextureChannel] !== texture) {
|
|
|
|
- this._activeTexturesCache[this._activeTextureChannel] = texture;
|
|
|
|
|
|
+ if (this._boundTexturesCache[this._activeTextureChannel] !== texture) {
|
|
|
|
+ this._boundTexturesCache[this._activeTextureChannel] = texture;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
NullEngine.prototype._bindTexture = function (channel, texture) {
|
|
NullEngine.prototype._bindTexture = function (channel, texture) {
|
|
@@ -79004,10 +79049,12 @@ var BABYLON;
|
|
* Setup the ground according to the specified options.
|
|
* Setup the ground according to the specified options.
|
|
*/
|
|
*/
|
|
EnvironmentHelper.prototype._setupGround = function (sceneSize) {
|
|
EnvironmentHelper.prototype._setupGround = function (sceneSize) {
|
|
|
|
+ var _this = this;
|
|
if (!this._ground) {
|
|
if (!this._ground) {
|
|
this._ground = BABYLON.Mesh.CreatePlane("BackgroundPlane", sceneSize.groundSize, this._scene);
|
|
this._ground = BABYLON.Mesh.CreatePlane("BackgroundPlane", sceneSize.groundSize, this._scene);
|
|
this._ground.rotation.x = Math.PI / 2; // Face up by default.
|
|
this._ground.rotation.x = Math.PI / 2; // Face up by default.
|
|
this._ground.parent = this._rootMesh;
|
|
this._ground.parent = this._rootMesh;
|
|
|
|
+ this._ground.onDisposeObservable.add(function () { _this._ground = null; });
|
|
}
|
|
}
|
|
this._ground.receiveShadows = this._options.enableGroundShadow;
|
|
this._ground.receiveShadows = this._options.enableGroundShadow;
|
|
};
|
|
};
|
|
@@ -79092,8 +79139,10 @@ var BABYLON;
|
|
* Setup the skybox according to the specified options.
|
|
* Setup the skybox according to the specified options.
|
|
*/
|
|
*/
|
|
EnvironmentHelper.prototype._setupSkybox = function (sceneSize) {
|
|
EnvironmentHelper.prototype._setupSkybox = function (sceneSize) {
|
|
|
|
+ var _this = this;
|
|
if (!this._skybox) {
|
|
if (!this._skybox) {
|
|
this._skybox = BABYLON.Mesh.CreateBox("BackgroundSkybox", sceneSize.skyboxSize, this._scene, undefined, BABYLON.Mesh.BACKSIDE);
|
|
this._skybox = BABYLON.Mesh.CreateBox("BackgroundSkybox", sceneSize.skyboxSize, this._scene, undefined, BABYLON.Mesh.BACKSIDE);
|
|
|
|
+ this._skybox.onDisposeObservable.add(function () { _this._skybox = null; });
|
|
}
|
|
}
|
|
this._skybox.parent = this._rootMesh;
|
|
this._skybox.parent = this._rootMesh;
|
|
};
|
|
};
|
|
@@ -79144,7 +79193,7 @@ var BABYLON;
|
|
if (this._skyboxMaterial) {
|
|
if (this._skyboxMaterial) {
|
|
this._skyboxMaterial.dispose(true, true);
|
|
this._skyboxMaterial.dispose(true, true);
|
|
}
|
|
}
|
|
- this._rootMesh.dispose(true);
|
|
|
|
|
|
+ this._rootMesh.dispose(false);
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
* Default ground texture URL.
|
|
* Default ground texture URL.
|