docstring_tokens stringlengths 0 76.5k | code_tokens stringlengths 75 1.81M | label_window listlengths 4 2.12k | html_url stringlengths 74 116 | file_name stringlengths 3 311 |
|---|---|---|---|---|
export { ${exportedItems} };`*/
/*if (moduleName === "core") {
exportsText = `(function() {
var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
globalObject["BABYLON"] = BABYLON;
})();
`*/
| <mask> }
<mask> });
<mask>
<mask> exportsText += `
<mask> export { ${exportedItems} };`
<mask>
<mask> if (file.isNull()) {
<mask> cb(null, file);
<mask> return;
<mask> }
</s> major changes to the way modules are built
Former-commit-id: 0e13708320e88245b64ac4341a2177e94bc3c78c </s> remove })();;
</s> add })();
</s> remove if (dependencies) {
/*if (dependencies.length > 1) {
dependenciesText += 'function nse(ns1, ns2) { Object.keys(ns2).forEach(function(c) {if(!ns1[c]) {ns1[c] = ns2[c]}}) };\n';
}*/
</s> add </s> remove } else {
</s> add /*} else {
</s> remove function processDependency(kind, dependency, filesToLoad) {
if (dependency.dependUpon) {
</s> add function processDependency(kind, dependency, filesToLoad, firstLevelOnly) {
if (!firstLevelOnly && dependency.dependUpon) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/f8ff650e620a101cc541a96277fcdb5d503c4fae | Tools/Gulp/gulp-es6ModuleExports.js |
file.contents = new Buffer(dependenciesText.concat(new Buffer(String(content).concat(exportsText))));
| <mask> return;
<mask> }
<mask>
<mask> try {
<mask> file.contents = new Buffer(dependenciesText.concat(new Buffer(String(file.contents).concat(exportsText))));
<mask> this.push(file);
<mask> } catch (err) {
<mask> this.emit('error', new gutil.PluginError('gulp-es6-module-exports', err, { fileName: file.path }));
<mask> }
<mask> cb();
</s> major changes to the way modules are built
Former-commit-id: 0e13708320e88245b64ac4341a2177e94bc3c78c </s> remove export { ${exportedItems} };`
</s> add export { ${exportedItems} };`*/
/*if (moduleName === "core") {
exportsText = `(function() {
var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
globalObject["BABYLON"] = BABYLON;
})();
`*/
</s> remove `var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
</s> add `var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)o.hasOwnProperty(n)&&(t[n]=o[n])};return function(o,n){function r(){this.constructor=o}t(o,n),o.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();
</s> remove if (dependencies) {
/*if (dependencies.length > 1) {
dependenciesText += 'function nse(ns1, ns2) { Object.keys(ns2).forEach(function(c) {if(!ns1[c]) {ns1[c] = ns2[c]}}) };\n';
}*/
</s> add </s> remove } else {
</s> add /*} else {
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/f8ff650e620a101cc541a96277fcdb5d503c4fae | Tools/Gulp/gulp-es6ModuleExports.js |
function processDependency(kind, dependency, filesToLoad, firstLevelOnly) {
if (!firstLevelOnly && dependency.dependUpon) { | <mask> var commandLineOptions = minimist(process.argv.slice(2), {
<mask> boolean: "public"
<mask> });
<mask>
<mask> function processDependency(kind, dependency, filesToLoad) {
<mask> if (dependency.dependUpon) {
<mask> for (var i = 0; i < dependency.dependUpon.length; i++) {
<mask> var dependencyName = dependency.dependUpon[i];
<mask> var parent = config.workloads[dependencyName];
<mask> processDependency(kind, parent, filesToLoad);
<mask> }
</s> major changes to the way modules are built
Former-commit-id: 0e13708320e88245b64ac4341a2177e94bc3c78c </s> remove 'var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n' +
'var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n' +
'if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);\n' +
'else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n' +
'return c > 3 && r && Object.defineProperty(target, key, r), r;\n' +
'};\n';
</s> add 'var __decorate=this&&this.__decorate||function(e,t,r,c){var o,f=arguments.length,n=f<3?t:null===c?c=Object.getOwnPropertyDescriptor(t,r):c;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,r,c);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(f<3?o(n):f>3?o(t,r,n):o(t,r))||n);return f>3&&n&&Object.defineProperty(t,r,n),n};\n';
</s> remove processDependency("shaders", config.workloads[moduleName], shadersFiles);
</s> add processDependency("shaders", config.workloads[moduleName], shadersFiles, true); </s> remove processDependency("shaderIncludes", config.workloads[moduleName], shaderIncludeFiles);
</s> add processDependency("shaderIncludes", config.workloads[moduleName], shaderIncludeFiles, true); </s> remove `var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
</s> add `var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)o.hasOwnProperty(n)&&(t[n]=o[n])};return function(o,n){function r(){this.constructor=o}t(o,n),o.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();
</s> remove export { ${exportedItems} };`
</s> add export { ${exportedItems} };`*/
/*if (moduleName === "core") {
exportsText = `(function() {
var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
globalObject["BABYLON"] = BABYLON;
})();
`*/
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/f8ff650e620a101cc541a96277fcdb5d503c4fae | Tools/Gulp/gulpfile.js |
processDependency("shaders", config.workloads[moduleName], shadersFiles, true); | <mask>
<mask> Object.keys(config.workloads)
<mask> .forEach((moduleName) => {
<mask> let shadersFiles = [];
<mask> processDependency("shaders", config.workloads[moduleName], shadersFiles);
<mask> for (var index = 0; index < shadersFiles.length; index++) {
<mask> shadersFiles[index] = "../../src/Shaders/" + shadersFiles[index] + ".fx";
<mask> }
<mask>
<mask> let shaderIncludeFiles = [];
</s> major changes to the way modules are built
Former-commit-id: 0e13708320e88245b64ac4341a2177e94bc3c78c </s> remove processDependency("shaderIncludes", config.workloads[moduleName], shaderIncludeFiles);
</s> add processDependency("shaderIncludes", config.workloads[moduleName], shaderIncludeFiles, true); </s> remove function processDependency(kind, dependency, filesToLoad) {
if (dependency.dependUpon) {
</s> add function processDependency(kind, dependency, filesToLoad, firstLevelOnly) {
if (!firstLevelOnly && dependency.dependUpon) { </s> remove 'var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n' +
'var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n' +
'if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);\n' +
'else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n' +
'return c > 3 && r && Object.defineProperty(target, key, r), r;\n' +
'};\n';
</s> add 'var __decorate=this&&this.__decorate||function(e,t,r,c){var o,f=arguments.length,n=f<3?t:null===c?c=Object.getOwnPropertyDescriptor(t,r):c;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,r,c);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(f<3?o(n):f>3?o(t,r,n):o(t,r))||n);return f>3&&n&&Object.defineProperty(t,r,n),n};\n';
</s> remove })();;
</s> add })();
</s> remove let jsTask = merge2([
</s> add /*let jsTask = merge2([ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/f8ff650e620a101cc541a96277fcdb5d503c4fae | Tools/Gulp/gulpfile.js |
processDependency("shaderIncludes", config.workloads[moduleName], shaderIncludeFiles, true); | <mask> shadersFiles[index] = "../../src/Shaders/" + shadersFiles[index] + ".fx";
<mask> }
<mask>
<mask> let shaderIncludeFiles = [];
<mask> processDependency("shaderIncludes", config.workloads[moduleName], shaderIncludeFiles);
<mask> for (var index = 0; index < shaderIncludeFiles.length; index++) {
<mask> shaderIncludeFiles[index] = "../../src/Shaders/ShadersInclude/" + shaderIncludeFiles[index] + ".fx";
<mask> }
<mask>
<mask> //commonjs js generation task
</s> major changes to the way modules are built
Former-commit-id: 0e13708320e88245b64ac4341a2177e94bc3c78c </s> remove processDependency("shaders", config.workloads[moduleName], shadersFiles);
</s> add processDependency("shaders", config.workloads[moduleName], shadersFiles, true); </s> remove let jsTask = merge2([
</s> add /*let jsTask = merge2([ </s> remove 'var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n' +
'var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n' +
'if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);\n' +
'else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n' +
'return c > 3 && r && Object.defineProperty(target, key, r), r;\n' +
'};\n';
</s> add 'var __decorate=this&&this.__decorate||function(e,t,r,c){var o,f=arguments.length,n=f<3?t:null===c?c=Object.getOwnPropertyDescriptor(t,r):c;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,r,c);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(f<3?o(n):f>3?o(t,r,n):o(t,r))||n);return f>3&&n&&Object.defineProperty(t,r,n),n};\n';
</s> remove let es6Task = merge2([
</s> add /*let es6Task = merge2([ </s> remove .pipe(gulp.dest(config.build.outputDirectory + '/modules/' + moduleName + '/'));
</s> add .pipe(gulp.dest(config.build.outputDirectory + '/modules/' + moduleName + '/'));*/
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/f8ff650e620a101cc541a96277fcdb5d503c4fae | Tools/Gulp/gulpfile.js |
/*let jsTask = merge2([ | <mask> shaderIncludeFiles[index] = "../../src/Shaders/ShadersInclude/" + shaderIncludeFiles[index] + ".fx";
<mask> }
<mask>
<mask> //commonjs js generation task
<mask> let jsTask = merge2([
<mask> gulp.src(config.workloads[moduleName].files),
<mask> gulp.src(shadersFiles).
<mask> //pipe(expect.real({ errorOnFailure: true }, shadersFiles)).
<mask> pipe(uncommentShader()).
<mask> pipe(appendSrcToVariable("BABYLON.Effect.ShadersStore", shadersName, config.build.outputDirectory + '/commonjs/' + moduleName + ".fx", true)),
</s> major changes to the way modules are built
Former-commit-id: 0e13708320e88245b64ac4341a2177e94bc3c78c </s> remove let es6Task = merge2([
</s> add /*let es6Task = merge2([ </s> remove processDependency("shaderIncludes", config.workloads[moduleName], shaderIncludeFiles);
</s> add processDependency("shaderIncludes", config.workloads[moduleName], shaderIncludeFiles, true); </s> remove .pipe(gulp.dest(config.build.outputDirectory + '/modules/' + moduleName + '/'));
</s> add .pipe(gulp.dest(config.build.outputDirectory + '/modules/' + moduleName + '/'));*/
</s> remove processDependency("shaders", config.workloads[moduleName], shadersFiles);
</s> add processDependency("shaders", config.workloads[moduleName], shadersFiles, true); </s> remove console.log("Compiling es6 module: " + moduleName);
</s> add let basename = (path.basename(file.path, ".js"));
//console.log("Compiling es6 module: " + moduleName + "/" + basename.replace("babylon.", ""));
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/f8ff650e620a101cc541a96277fcdb5d503c4fae | Tools/Gulp/gulpfile.js |
.pipe(gulp.dest(config.build.outputDirectory + '/modules/' + moduleName + '/'));*/
| <mask> .pipe(replace(extendsSearchRegex, ""))
<mask> .pipe(replace(decorateSearchRegex, ""))
<mask> .pipe(replace(referenceSearchRegex, ""))
<mask> .pipe(babylonModuleExports(moduleName, config.workloads[moduleName].dependUpon))
<mask> .pipe(gulp.dest(config.build.outputDirectory + '/modules/' + moduleName + '/'));
<mask>
<mask> // es6 modules generation task
<mask> let es6Task = merge2([
<mask> gulp.src(config.workloads[moduleName].files),
<mask> gulp.src(shadersFiles).
</s> major changes to the way modules are built
Former-commit-id: 0e13708320e88245b64ac4341a2177e94bc3c78c </s> remove let es6Task = merge2([
</s> add /*let es6Task = merge2([ </s> remove let jsTask = merge2([
</s> add /*let jsTask = merge2([ </s> remove
tasks.push(jsTask, es6Task, dtsTask);
</s> add */
tasks.push(commonJsTask, es6Tasks); </s> remove processDependency("shaderIncludes", config.workloads[moduleName], shaderIncludeFiles);
</s> add processDependency("shaderIncludes", config.workloads[moduleName], shaderIncludeFiles, true); </s> remove console.log("Compiling es6 module: " + moduleName);
</s> add let basename = (path.basename(file.path, ".js"));
//console.log("Compiling es6 module: " + moduleName + "/" + basename.replace("babylon.", ""));
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/f8ff650e620a101cc541a96277fcdb5d503c4fae | Tools/Gulp/gulpfile.js |
/*let es6Task = merge2([ | <mask> .pipe(babylonModuleExports(moduleName, config.workloads[moduleName].dependUpon))
<mask> .pipe(gulp.dest(config.build.outputDirectory + '/modules/' + moduleName + '/'));
<mask>
<mask> // es6 modules generation task
<mask> let es6Task = merge2([
<mask> gulp.src(config.workloads[moduleName].files),
<mask> gulp.src(shadersFiles).
<mask> //pipe(expect.real({ errorOnFailure: true }, shadersFiles)).
<mask> pipe(uncommentShader()).
<mask> pipe(appendSrcToVariable("BABYLON.Effect.ShadersStore", shadersName, config.build.outputDirectory + '/commonjs/' + moduleName + ".fx", true)),
</s> major changes to the way modules are built
Former-commit-id: 0e13708320e88245b64ac4341a2177e94bc3c78c </s> remove let jsTask = merge2([
</s> add /*let jsTask = merge2([ </s> remove .pipe(gulp.dest(config.build.outputDirectory + '/modules/' + moduleName + '/'));
</s> add .pipe(gulp.dest(config.build.outputDirectory + '/modules/' + moduleName + '/'));*/
</s> remove
tasks.push(jsTask, es6Task, dtsTask);
</s> add */
tasks.push(commonJsTask, es6Tasks); </s> remove processDependency("shaderIncludes", config.workloads[moduleName], shaderIncludeFiles);
</s> add processDependency("shaderIncludes", config.workloads[moduleName], shaderIncludeFiles, true); </s> remove console.log("Compiling es6 module: " + moduleName);
</s> add let basename = (path.basename(file.path, ".js"));
//console.log("Compiling es6 module: " + moduleName + "/" + basename.replace("babylon.", ""));
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/f8ff650e620a101cc541a96277fcdb5d503c4fae | Tools/Gulp/gulpfile.js |
*/
tasks.push(commonJsTask, es6Tasks); | <mask> .pipe(replace(/declare module BABYLON {/g, `declare module 'babylonjs/${moduleName}' {`))
<mask> .pipe(replace(/\ninterface /g, `\nexport interface `))
<mask> .pipe(dtsModuleSupport(moduleName, true, declared, perFile, dependencyTree))
<mask> .pipe(gulp.dest(config.build.outputDirectory + '/modules/' + moduleName + '/'));
<mask>
<mask> tasks.push(jsTask, es6Task, dtsTask);
<mask> });
<mask>
<mask> // run da tasks man!
<mask> return merge2(tasks);
<mask> })
</s> major changes to the way modules are built
Former-commit-id: 0e13708320e88245b64ac4341a2177e94bc3c78c </s> remove .pipe(gulp.dest(config.build.outputDirectory + '/modules/' + moduleName + '/'));
</s> add .pipe(gulp.dest(config.build.outputDirectory + '/modules/' + moduleName + '/'));*/
</s> remove let es6Task = merge2([
</s> add /*let es6Task = merge2([ </s> remove console.log("Compiling es6 module: " + moduleName);
</s> add let basename = (path.basename(file.path, ".js"));
//console.log("Compiling es6 module: " + moduleName + "/" + basename.replace("babylon.", ""));
</s> remove let jsTask = merge2([
</s> add /*let jsTask = merge2([ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/f8ff650e620a101cc541a96277fcdb5d503c4fae | Tools/Gulp/gulpfile.js |
mesh = GroundMesh.Parse(parsedMesh, scene);
| <mask> public static Parse(parsedMesh: any, scene: Scene, rootUrl: string): Mesh {
<mask> var mesh : Mesh;
<mask>
<mask> if (parsedMesh.type && parsedMesh.type === "GroundMesh") {
<mask> mesh = new GroundMesh(parsedMesh.name, scene);
<mask> } else {
<mask> mesh = new Mesh(parsedMesh.name, scene);
<mask> }
<mask> mesh.id = parsedMesh.id;
<mask>
</s> fixed groundMesh serialization
Former-commit-id: d7e023c99860586f69e1042a7e68fd18b4103000 </s> remove // Material
if (mesh.material) {
serializationObject.materialId = mesh.material.id;
} else {
mesh.material = null;
}
// Skeleton
if (mesh.skeleton) {
serializationObject.skeletonId = mesh.skeleton.id;
}
// Physics
//TODO implement correct serialization for physics impostors.
if (mesh.getPhysicsImpostor()) {
serializationObject.physicsMass = mesh.getPhysicsMass();
serializationObject.physicsFriction = mesh.getPhysicsFriction();
serializationObject.physicsRestitution = mesh.getPhysicsRestitution();
serializationObject.physicsImpostor = mesh.getPhysicsImpostor().type;
}
// Metadata
if (mesh.metadata) {
serializationObject.metadata = mesh.metadata;
}
// Instances
serializationObject.instances = [];
for (var index = 0; index < mesh.instances.length; index++) {
var instance = mesh.instances[index];
var serializationInstance: any = {
name: instance.name,
position: instance.position.asArray(),
scaling: instance.scaling.asArray()
};
if (instance.rotationQuaternion) {
serializationInstance.rotationQuaternion = instance.rotationQuaternion.asArray();
} else if (instance.rotation) {
serializationInstance.rotation = instance.rotation.asArray();
}
serializationObject.instances.push(serializationInstance);
// Animations
Animation.AppendSerializedAnimations(instance, serializationInstance);
serializationInstance.ranges = instance.serializeAnimationRanges();
}
// Animations
Animation.AppendSerializedAnimations(mesh, serializationObject);
serializationObject.ranges = mesh.serializeAnimationRanges();
// Layer mask
serializationObject.layerMask = mesh.layerMask;
// Alpha
serializationObject.alphaIndex = mesh.alphaIndex;
serializationObject.hasVertexAlpha = mesh.hasVertexAlpha;
// Overlay
serializationObject.overlayAlpha = mesh.overlayAlpha;
serializationObject.overlayColor = mesh.overlayColor.asArray();
serializationObject.renderOverlay = mesh.renderOverlay;
// Fog
serializationObject.applyFog = mesh.applyFog;
// Action Manager
if (mesh.actionManager) {
serializationObject.actions = mesh.actionManager.serialize(mesh.name);
</s> add // Custom
if (mesh.serialize) {
mesh.serialize(serializationObject);
</s> remove serializationObject.name = mesh.name;
serializationObject.id = mesh.id;
serializationObject.type = mesh.getClassName();
if (Tags.HasTags(mesh)) {
serializationObject.tags = Tags.GetTags(mesh);
}
serializationObject.position = mesh.position.asArray();
if (mesh.rotationQuaternion) {
serializationObject.rotationQuaternion = mesh.rotationQuaternion.asArray();
} else if (mesh.rotation) {
serializationObject.rotation = mesh.rotation.asArray();
}
serializationObject.scaling = mesh.scaling.asArray();
serializationObject.localMatrix = mesh.getPivotMatrix().asArray();
serializationObject.isEnabled = mesh.isEnabled();
serializationObject.isVisible = mesh.isVisible;
serializationObject.infiniteDistance = mesh.infiniteDistance;
serializationObject.pickable = mesh.isPickable;
serializationObject.receiveShadows = mesh.receiveShadows;
serializationObject.billboardMode = mesh.billboardMode;
serializationObject.visibility = mesh.visibility;
serializationObject.checkCollisions = mesh.checkCollisions;
serializationObject.isBlocker = mesh.isBlocker;
// Parent
if (mesh.parent) {
serializationObject.parentId = mesh.parent.id;
}
// Geometry
var geometry = mesh._geometry;
</s> add // Geometry
var geometry = mesh._geometry;
</s> remove
// SubMeshes
serializationObject.subMeshes = [];
for (var subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) {
var subMesh = mesh.subMeshes[subIndex];
serializationObject.subMeshes.push({
materialIndex: subMesh.materialIndex,
verticesStart: subMesh.verticesStart,
verticesCount: subMesh.verticesCount,
indexStart: subMesh.indexStart,
indexCount: subMesh.indexCount
});
}
</s> add </s> remove var geometryId = geometry.id;
serializationObject.geometryId = geometryId;
if (!mesh.getScene().getGeometryByID(geometryId)) {
// geometry was in the memory but not added to the scene, nevertheless it's better to serialize to be able to reload the mesh with its geometry
</s> add if (!mesh.getScene().getGeometryByID(geometry.id)) {
// Geometry was in the memory but not added to the scene, nevertheless it's better to serialize to be able to reload the mesh with its geometry
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/f965af501c7e936487421c272bd754f87a6110f2 | src/Mesh/babylon.mesh.ts |
// Geometry
var geometry = mesh._geometry;
| <mask>
<mask> var serializeMesh = (mesh: Mesh, serializationScene: any): any => {
<mask> var serializationObject: any = {};
<mask>
<mask> serializationObject.name = mesh.name;
<mask> serializationObject.id = mesh.id;
<mask> serializationObject.type = mesh.getClassName();
<mask>
<mask> if (Tags.HasTags(mesh)) {
<mask> serializationObject.tags = Tags.GetTags(mesh);
<mask> }
<mask>
<mask> serializationObject.position = mesh.position.asArray();
<mask>
<mask> if (mesh.rotationQuaternion) {
<mask> serializationObject.rotationQuaternion = mesh.rotationQuaternion.asArray();
<mask> } else if (mesh.rotation) {
<mask> serializationObject.rotation = mesh.rotation.asArray();
<mask> }
<mask>
<mask> serializationObject.scaling = mesh.scaling.asArray();
<mask> serializationObject.localMatrix = mesh.getPivotMatrix().asArray();
<mask>
<mask> serializationObject.isEnabled = mesh.isEnabled();
<mask> serializationObject.isVisible = mesh.isVisible;
<mask> serializationObject.infiniteDistance = mesh.infiniteDistance;
<mask> serializationObject.pickable = mesh.isPickable;
<mask>
<mask> serializationObject.receiveShadows = mesh.receiveShadows;
<mask>
<mask> serializationObject.billboardMode = mesh.billboardMode;
<mask> serializationObject.visibility = mesh.visibility;
<mask>
<mask> serializationObject.checkCollisions = mesh.checkCollisions;
<mask> serializationObject.isBlocker = mesh.isBlocker;
<mask>
<mask> // Parent
<mask> if (mesh.parent) {
<mask> serializationObject.parentId = mesh.parent.id;
<mask> }
<mask>
<mask> // Geometry
<mask> var geometry = mesh._geometry;
<mask> if (geometry) {
<mask> var geometryId = geometry.id;
<mask> serializationObject.geometryId = geometryId;
<mask>
<mask> if (!mesh.getScene().getGeometryByID(geometryId)) {
</s> fixed groundMesh serialization
Former-commit-id: d7e023c99860586f69e1042a7e68fd18b4103000 </s> remove // Material
if (mesh.material) {
serializationObject.materialId = mesh.material.id;
} else {
mesh.material = null;
}
// Skeleton
if (mesh.skeleton) {
serializationObject.skeletonId = mesh.skeleton.id;
}
// Physics
//TODO implement correct serialization for physics impostors.
if (mesh.getPhysicsImpostor()) {
serializationObject.physicsMass = mesh.getPhysicsMass();
serializationObject.physicsFriction = mesh.getPhysicsFriction();
serializationObject.physicsRestitution = mesh.getPhysicsRestitution();
serializationObject.physicsImpostor = mesh.getPhysicsImpostor().type;
}
// Metadata
if (mesh.metadata) {
serializationObject.metadata = mesh.metadata;
}
// Instances
serializationObject.instances = [];
for (var index = 0; index < mesh.instances.length; index++) {
var instance = mesh.instances[index];
var serializationInstance: any = {
name: instance.name,
position: instance.position.asArray(),
scaling: instance.scaling.asArray()
};
if (instance.rotationQuaternion) {
serializationInstance.rotationQuaternion = instance.rotationQuaternion.asArray();
} else if (instance.rotation) {
serializationInstance.rotation = instance.rotation.asArray();
}
serializationObject.instances.push(serializationInstance);
// Animations
Animation.AppendSerializedAnimations(instance, serializationInstance);
serializationInstance.ranges = instance.serializeAnimationRanges();
}
// Animations
Animation.AppendSerializedAnimations(mesh, serializationObject);
serializationObject.ranges = mesh.serializeAnimationRanges();
// Layer mask
serializationObject.layerMask = mesh.layerMask;
// Alpha
serializationObject.alphaIndex = mesh.alphaIndex;
serializationObject.hasVertexAlpha = mesh.hasVertexAlpha;
// Overlay
serializationObject.overlayAlpha = mesh.overlayAlpha;
serializationObject.overlayColor = mesh.overlayColor.asArray();
serializationObject.renderOverlay = mesh.renderOverlay;
// Fog
serializationObject.applyFog = mesh.applyFog;
// Action Manager
if (mesh.actionManager) {
serializationObject.actions = mesh.actionManager.serialize(mesh.name);
</s> add // Custom
if (mesh.serialize) {
mesh.serialize(serializationObject);
</s> remove var geometryId = geometry.id;
serializationObject.geometryId = geometryId;
if (!mesh.getScene().getGeometryByID(geometryId)) {
// geometry was in the memory but not added to the scene, nevertheless it's better to serialize to be able to reload the mesh with its geometry
</s> add if (!mesh.getScene().getGeometryByID(geometry.id)) {
// Geometry was in the memory but not added to the scene, nevertheless it's better to serialize to be able to reload the mesh with its geometry
</s> remove
// SubMeshes
serializationObject.subMeshes = [];
for (var subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) {
var subMesh = mesh.subMeshes[subIndex];
serializationObject.subMeshes.push({
materialIndex: subMesh.materialIndex,
verticesStart: subMesh.verticesStart,
verticesCount: subMesh.verticesCount,
indexStart: subMesh.indexStart,
indexCount: subMesh.indexCount
});
}
</s> add </s> remove mesh = new GroundMesh(parsedMesh.name, scene);
</s> add mesh = GroundMesh.Parse(parsedMesh, scene);
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/BabylonJS/Babylon.js/commit/f965af501c7e936487421c272bd754f87a6110f2 | src/Tools/babylon.sceneSerializer.ts |
if (!mesh.getScene().getGeometryByID(geometry.id)) {
// Geometry was in the memory but not added to the scene, nevertheless it's better to serialize to be able to reload the mesh with its geometry
| <mask>
<mask> // Geometry
<mask> var geometry = mesh._geometry;
<mask> if (geometry) {
<mask> var geometryId = geometry.id;
<mask> serializationObject.geometryId = geometryId;
<mask>
<mask> if (!mesh.getScene().getGeometryByID(geometryId)) {
<mask> // geometry was in the memory but not added to the scene, nevertheless it's better to serialize to be able to reload the mesh with its geometry
<mask> serializeGeometry(geometry, serializationScene.geometries);
<mask> }
<mask>
<mask> // SubMeshes
<mask> serializationObject.subMeshes = [];
</s> fixed groundMesh serialization
Former-commit-id: d7e023c99860586f69e1042a7e68fd18b4103000 </s> remove
// SubMeshes
serializationObject.subMeshes = [];
for (var subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) {
var subMesh = mesh.subMeshes[subIndex];
serializationObject.subMeshes.push({
materialIndex: subMesh.materialIndex,
verticesStart: subMesh.verticesStart,
verticesCount: subMesh.verticesCount,
indexStart: subMesh.indexStart,
indexCount: subMesh.indexCount
});
}
</s> add </s> remove serializationObject.name = mesh.name;
serializationObject.id = mesh.id;
serializationObject.type = mesh.getClassName();
if (Tags.HasTags(mesh)) {
serializationObject.tags = Tags.GetTags(mesh);
}
serializationObject.position = mesh.position.asArray();
if (mesh.rotationQuaternion) {
serializationObject.rotationQuaternion = mesh.rotationQuaternion.asArray();
} else if (mesh.rotation) {
serializationObject.rotation = mesh.rotation.asArray();
}
serializationObject.scaling = mesh.scaling.asArray();
serializationObject.localMatrix = mesh.getPivotMatrix().asArray();
serializationObject.isEnabled = mesh.isEnabled();
serializationObject.isVisible = mesh.isVisible;
serializationObject.infiniteDistance = mesh.infiniteDistance;
serializationObject.pickable = mesh.isPickable;
serializationObject.receiveShadows = mesh.receiveShadows;
serializationObject.billboardMode = mesh.billboardMode;
serializationObject.visibility = mesh.visibility;
serializationObject.checkCollisions = mesh.checkCollisions;
serializationObject.isBlocker = mesh.isBlocker;
// Parent
if (mesh.parent) {
serializationObject.parentId = mesh.parent.id;
}
// Geometry
var geometry = mesh._geometry;
</s> add // Geometry
var geometry = mesh._geometry;
</s> remove // Material
if (mesh.material) {
serializationObject.materialId = mesh.material.id;
} else {
mesh.material = null;
}
// Skeleton
if (mesh.skeleton) {
serializationObject.skeletonId = mesh.skeleton.id;
}
// Physics
//TODO implement correct serialization for physics impostors.
if (mesh.getPhysicsImpostor()) {
serializationObject.physicsMass = mesh.getPhysicsMass();
serializationObject.physicsFriction = mesh.getPhysicsFriction();
serializationObject.physicsRestitution = mesh.getPhysicsRestitution();
serializationObject.physicsImpostor = mesh.getPhysicsImpostor().type;
}
// Metadata
if (mesh.metadata) {
serializationObject.metadata = mesh.metadata;
}
// Instances
serializationObject.instances = [];
for (var index = 0; index < mesh.instances.length; index++) {
var instance = mesh.instances[index];
var serializationInstance: any = {
name: instance.name,
position: instance.position.asArray(),
scaling: instance.scaling.asArray()
};
if (instance.rotationQuaternion) {
serializationInstance.rotationQuaternion = instance.rotationQuaternion.asArray();
} else if (instance.rotation) {
serializationInstance.rotation = instance.rotation.asArray();
}
serializationObject.instances.push(serializationInstance);
// Animations
Animation.AppendSerializedAnimations(instance, serializationInstance);
serializationInstance.ranges = instance.serializeAnimationRanges();
}
// Animations
Animation.AppendSerializedAnimations(mesh, serializationObject);
serializationObject.ranges = mesh.serializeAnimationRanges();
// Layer mask
serializationObject.layerMask = mesh.layerMask;
// Alpha
serializationObject.alphaIndex = mesh.alphaIndex;
serializationObject.hasVertexAlpha = mesh.hasVertexAlpha;
// Overlay
serializationObject.overlayAlpha = mesh.overlayAlpha;
serializationObject.overlayColor = mesh.overlayColor.asArray();
serializationObject.renderOverlay = mesh.renderOverlay;
// Fog
serializationObject.applyFog = mesh.applyFog;
// Action Manager
if (mesh.actionManager) {
serializationObject.actions = mesh.actionManager.serialize(mesh.name);
</s> add // Custom
if (mesh.serialize) {
mesh.serialize(serializationObject);
</s> remove mesh = new GroundMesh(parsedMesh.name, scene);
</s> add mesh = GroundMesh.Parse(parsedMesh, scene);
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/f965af501c7e936487421c272bd754f87a6110f2 | src/Tools/babylon.sceneSerializer.ts |
<mask> if (!mesh.getScene().getGeometryByID(geometryId)) {
<mask> // geometry was in the memory but not added to the scene, nevertheless it's better to serialize to be able to reload the mesh with its geometry
<mask> serializeGeometry(geometry, serializationScene.geometries);
<mask> }
<mask>
<mask> // SubMeshes
<mask> serializationObject.subMeshes = [];
<mask> for (var subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) {
<mask> var subMesh = mesh.subMeshes[subIndex];
<mask>
<mask> serializationObject.subMeshes.push({
<mask> materialIndex: subMesh.materialIndex,
<mask> verticesStart: subMesh.verticesStart,
<mask> verticesCount: subMesh.verticesCount,
<mask> indexStart: subMesh.indexStart,
<mask> indexCount: subMesh.indexCount
<mask> });
<mask> }
<mask> }
<mask>
<mask> // Material
<mask> if (mesh.material) {
<mask> serializationObject.materialId = mesh.material.id;
</s> fixed groundMesh serialization
Former-commit-id: d7e023c99860586f69e1042a7e68fd18b4103000 </s> remove var geometryId = geometry.id;
serializationObject.geometryId = geometryId;
if (!mesh.getScene().getGeometryByID(geometryId)) {
// geometry was in the memory but not added to the scene, nevertheless it's better to serialize to be able to reload the mesh with its geometry
</s> add if (!mesh.getScene().getGeometryByID(geometry.id)) {
// Geometry was in the memory but not added to the scene, nevertheless it's better to serialize to be able to reload the mesh with its geometry
</s> remove // Material
if (mesh.material) {
serializationObject.materialId = mesh.material.id;
} else {
mesh.material = null;
}
// Skeleton
if (mesh.skeleton) {
serializationObject.skeletonId = mesh.skeleton.id;
}
// Physics
//TODO implement correct serialization for physics impostors.
if (mesh.getPhysicsImpostor()) {
serializationObject.physicsMass = mesh.getPhysicsMass();
serializationObject.physicsFriction = mesh.getPhysicsFriction();
serializationObject.physicsRestitution = mesh.getPhysicsRestitution();
serializationObject.physicsImpostor = mesh.getPhysicsImpostor().type;
}
// Metadata
if (mesh.metadata) {
serializationObject.metadata = mesh.metadata;
}
// Instances
serializationObject.instances = [];
for (var index = 0; index < mesh.instances.length; index++) {
var instance = mesh.instances[index];
var serializationInstance: any = {
name: instance.name,
position: instance.position.asArray(),
scaling: instance.scaling.asArray()
};
if (instance.rotationQuaternion) {
serializationInstance.rotationQuaternion = instance.rotationQuaternion.asArray();
} else if (instance.rotation) {
serializationInstance.rotation = instance.rotation.asArray();
}
serializationObject.instances.push(serializationInstance);
// Animations
Animation.AppendSerializedAnimations(instance, serializationInstance);
serializationInstance.ranges = instance.serializeAnimationRanges();
}
// Animations
Animation.AppendSerializedAnimations(mesh, serializationObject);
serializationObject.ranges = mesh.serializeAnimationRanges();
// Layer mask
serializationObject.layerMask = mesh.layerMask;
// Alpha
serializationObject.alphaIndex = mesh.alphaIndex;
serializationObject.hasVertexAlpha = mesh.hasVertexAlpha;
// Overlay
serializationObject.overlayAlpha = mesh.overlayAlpha;
serializationObject.overlayColor = mesh.overlayColor.asArray();
serializationObject.renderOverlay = mesh.renderOverlay;
// Fog
serializationObject.applyFog = mesh.applyFog;
// Action Manager
if (mesh.actionManager) {
serializationObject.actions = mesh.actionManager.serialize(mesh.name);
</s> add // Custom
if (mesh.serialize) {
mesh.serialize(serializationObject);
</s> remove serializationObject.name = mesh.name;
serializationObject.id = mesh.id;
serializationObject.type = mesh.getClassName();
if (Tags.HasTags(mesh)) {
serializationObject.tags = Tags.GetTags(mesh);
}
serializationObject.position = mesh.position.asArray();
if (mesh.rotationQuaternion) {
serializationObject.rotationQuaternion = mesh.rotationQuaternion.asArray();
} else if (mesh.rotation) {
serializationObject.rotation = mesh.rotation.asArray();
}
serializationObject.scaling = mesh.scaling.asArray();
serializationObject.localMatrix = mesh.getPivotMatrix().asArray();
serializationObject.isEnabled = mesh.isEnabled();
serializationObject.isVisible = mesh.isVisible;
serializationObject.infiniteDistance = mesh.infiniteDistance;
serializationObject.pickable = mesh.isPickable;
serializationObject.receiveShadows = mesh.receiveShadows;
serializationObject.billboardMode = mesh.billboardMode;
serializationObject.visibility = mesh.visibility;
serializationObject.checkCollisions = mesh.checkCollisions;
serializationObject.isBlocker = mesh.isBlocker;
// Parent
if (mesh.parent) {
serializationObject.parentId = mesh.parent.id;
}
// Geometry
var geometry = mesh._geometry;
</s> add // Geometry
var geometry = mesh._geometry;
</s> remove mesh = new GroundMesh(parsedMesh.name, scene);
</s> add mesh = GroundMesh.Parse(parsedMesh, scene);
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/f965af501c7e936487421c272bd754f87a6110f2 | src/Tools/babylon.sceneSerializer.ts | |
// Custom
if (mesh.serialize) {
mesh.serialize(serializationObject);
| <mask> });
<mask> }
<mask> }
<mask>
<mask> // Material
<mask> if (mesh.material) {
<mask> serializationObject.materialId = mesh.material.id;
<mask> } else {
<mask> mesh.material = null;
<mask> }
<mask>
<mask> // Skeleton
<mask> if (mesh.skeleton) {
<mask> serializationObject.skeletonId = mesh.skeleton.id;
<mask> }
<mask>
<mask> // Physics
<mask> //TODO implement correct serialization for physics impostors.
<mask> if (mesh.getPhysicsImpostor()) {
<mask> serializationObject.physicsMass = mesh.getPhysicsMass();
<mask> serializationObject.physicsFriction = mesh.getPhysicsFriction();
<mask> serializationObject.physicsRestitution = mesh.getPhysicsRestitution();
<mask> serializationObject.physicsImpostor = mesh.getPhysicsImpostor().type;
<mask> }
<mask>
<mask> // Metadata
<mask> if (mesh.metadata) {
<mask> serializationObject.metadata = mesh.metadata;
<mask> }
<mask>
<mask> // Instances
<mask> serializationObject.instances = [];
<mask> for (var index = 0; index < mesh.instances.length; index++) {
<mask> var instance = mesh.instances[index];
<mask> var serializationInstance: any = {
<mask> name: instance.name,
<mask> position: instance.position.asArray(),
<mask> scaling: instance.scaling.asArray()
<mask> };
<mask> if (instance.rotationQuaternion) {
<mask> serializationInstance.rotationQuaternion = instance.rotationQuaternion.asArray();
<mask> } else if (instance.rotation) {
<mask> serializationInstance.rotation = instance.rotation.asArray();
<mask> }
<mask> serializationObject.instances.push(serializationInstance);
<mask>
<mask> // Animations
<mask> Animation.AppendSerializedAnimations(instance, serializationInstance);
<mask> serializationInstance.ranges = instance.serializeAnimationRanges();
<mask> }
<mask>
<mask> // Animations
<mask> Animation.AppendSerializedAnimations(mesh, serializationObject);
<mask> serializationObject.ranges = mesh.serializeAnimationRanges();
<mask>
<mask> // Layer mask
<mask> serializationObject.layerMask = mesh.layerMask;
<mask>
<mask> // Alpha
<mask> serializationObject.alphaIndex = mesh.alphaIndex;
<mask> serializationObject.hasVertexAlpha = mesh.hasVertexAlpha;
<mask>
<mask> // Overlay
<mask> serializationObject.overlayAlpha = mesh.overlayAlpha;
<mask> serializationObject.overlayColor = mesh.overlayColor.asArray();
<mask> serializationObject.renderOverlay = mesh.renderOverlay;
<mask>
<mask> // Fog
<mask> serializationObject.applyFog = mesh.applyFog;
<mask>
<mask> // Action Manager
<mask> if (mesh.actionManager) {
<mask> serializationObject.actions = mesh.actionManager.serialize(mesh.name);
<mask> }
<mask>
<mask> return serializationObject;
<mask> };
<mask>
</s> fixed groundMesh serialization
Former-commit-id: d7e023c99860586f69e1042a7e68fd18b4103000 </s> remove
// SubMeshes
serializationObject.subMeshes = [];
for (var subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) {
var subMesh = mesh.subMeshes[subIndex];
serializationObject.subMeshes.push({
materialIndex: subMesh.materialIndex,
verticesStart: subMesh.verticesStart,
verticesCount: subMesh.verticesCount,
indexStart: subMesh.indexStart,
indexCount: subMesh.indexCount
});
}
</s> add </s> remove serializationObject.name = mesh.name;
serializationObject.id = mesh.id;
serializationObject.type = mesh.getClassName();
if (Tags.HasTags(mesh)) {
serializationObject.tags = Tags.GetTags(mesh);
}
serializationObject.position = mesh.position.asArray();
if (mesh.rotationQuaternion) {
serializationObject.rotationQuaternion = mesh.rotationQuaternion.asArray();
} else if (mesh.rotation) {
serializationObject.rotation = mesh.rotation.asArray();
}
serializationObject.scaling = mesh.scaling.asArray();
serializationObject.localMatrix = mesh.getPivotMatrix().asArray();
serializationObject.isEnabled = mesh.isEnabled();
serializationObject.isVisible = mesh.isVisible;
serializationObject.infiniteDistance = mesh.infiniteDistance;
serializationObject.pickable = mesh.isPickable;
serializationObject.receiveShadows = mesh.receiveShadows;
serializationObject.billboardMode = mesh.billboardMode;
serializationObject.visibility = mesh.visibility;
serializationObject.checkCollisions = mesh.checkCollisions;
serializationObject.isBlocker = mesh.isBlocker;
// Parent
if (mesh.parent) {
serializationObject.parentId = mesh.parent.id;
}
// Geometry
var geometry = mesh._geometry;
</s> add // Geometry
var geometry = mesh._geometry;
</s> remove var geometryId = geometry.id;
serializationObject.geometryId = geometryId;
if (!mesh.getScene().getGeometryByID(geometryId)) {
// geometry was in the memory but not added to the scene, nevertheless it's better to serialize to be able to reload the mesh with its geometry
</s> add if (!mesh.getScene().getGeometryByID(geometry.id)) {
// Geometry was in the memory but not added to the scene, nevertheless it's better to serialize to be able to reload the mesh with its geometry
</s> remove mesh = new GroundMesh(parsedMesh.name, scene);
</s> add mesh = GroundMesh.Parse(parsedMesh, scene);
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/BabylonJS/Babylon.js/commit/f965af501c7e936487421c272bd754f87a6110f2 | src/Tools/babylon.sceneSerializer.ts |
@serialize()
public get autoGenerateTime(): boolean {
return this._autoGenerateTime;
}
public set autoGenerateTime(value: boolean) {
this._autoGenerateTime = value;
}
| <mask> new Color3(0.0, 0.2, 0.9)
<mask> ];
<mask> }
<mask>
<mask> @serializeAsColor3()
<mask> public get fireColors(): Color3[] {
<mask> return this._fireColors;
<mask> }
<mask>
<mask> public set fireColors(value: Color3[]) {
</s> Fixing some serialization issues (fixed collisions with properties)
Former-commit-id: a3c7ee49f0533671f5e7b793b423abf75c8b6af7 </s> remove @serializeAsColor3()
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fa451edde5bfd065139a530a181543aa8acb7cc5 | proceduralTexturesLibrary/src/fire/babylon.fireProceduralTexture.ts |
serializationObject.fireColors = [];
for (var i = 0; i < this._fireColors.length; i++) {
serializationObject.fireColors.push(this._fireColors[i].asArray());
}
| <mask> var serializationObject = SerializationHelper.Serialize(this, super.serialize());
<mask> serializationObject.customType = "BABYLON.FireProceduralTexture";
<mask>
<mask> return serializationObject;
<mask> }
<mask>
<mask> /**
<mask> * Creates a Fire Procedural Texture from parsed fire procedural texture data
<mask> * @param parsedTexture defines parsed texture data
</s> Fixing some serialization issues (fixed collisions with properties)
Former-commit-id: a3c7ee49f0533671f5e7b793b423abf75c8b6af7 </s> remove this.setFloat("time", this.time * this.speed / 1000);
</s> add this.setFloat("time", this.time * this.timeScale / 1000); </s> remove @serializeAsColor3()
</s> add @serialize()
public get autoGenerateTime(): boolean {
return this._autoGenerateTime;
}
public set autoGenerateTime(value: boolean) {
this._autoGenerateTime = value;
}
| [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fa451edde5bfd065139a530a181543aa8acb7cc5 | proceduralTexturesLibrary/src/fire/babylon.fireProceduralTexture.ts |
var colors: Color3[] = [];
for (var i = 0; i < parsedTexture.fireColors.length; i++) {
colors.push(Color3.FromArray(parsedTexture.fireColors[i]));
}
texture.fireColors = colors;
| <mask> public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): FireProceduralTexture {
<mask> var texture = SerializationHelper.Parse(() => new FireProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps), parsedTexture, scene, rootUrl);
<mask>
<mask> return texture;
<mask> }
<mask> }
<mask> } </s> Fixing some serialization issues (fixed collisions with properties)
Former-commit-id: a3c7ee49f0533671f5e7b793b423abf75c8b6af7 </s> remove @serializeAsColor3()
</s> add @serialize()
public get autoGenerateTime(): boolean {
return this._autoGenerateTime;
}
public set autoGenerateTime(value: boolean) {
this._autoGenerateTime = value;
}
</s> remove @serializeAsColor3()
</s> add | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fa451edde5bfd065139a530a181543aa8acb7cc5 | proceduralTexturesLibrary/src/fire/babylon.fireProceduralTexture.ts |
<mask> this.setColor3("herb3Color", this._grassColors[2]);
<mask> this.setColor3("groundColor", this._groundColor);
<mask> }
<mask>
<mask> @serializeAsColor3()
<mask> public get grassColors(): Color3[] {
<mask> return this._grassColors;
<mask> }
<mask>
<mask> public set grassColors(value: Color3[]) {
</s> Fixing some serialization issues (fixed collisions with properties)
Former-commit-id: a3c7ee49f0533671f5e7b793b423abf75c8b6af7 </s> remove @serializeAsColor3()
</s> add @serialize()
public get autoGenerateTime(): boolean {
return this._autoGenerateTime;
}
public set autoGenerateTime(value: boolean) {
this._autoGenerateTime = value;
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fa451edde5bfd065139a530a181543aa8acb7cc5 | proceduralTexturesLibrary/src/grass/babylon.grassProceduralTexture.ts | |
serializationObject.grassColors = [];
for (var i = 0; i < this._grassColors.length; i++) {
serializationObject.grassColors.push(this._grassColors[i].asArray());
}
| <mask> serializationObject.customType = "BABYLON.GrassProceduralTexture";
<mask>
<mask> return serializationObject;
<mask> }
<mask>
<mask> /**
<mask> * Creates a Grass Procedural Texture from parsed grass procedural texture data
<mask> * @param parsedTexture defines parsed texture data
</s> Fixing some serialization issues (fixed collisions with properties)
Former-commit-id: a3c7ee49f0533671f5e7b793b423abf75c8b6af7 </s> remove this.setFloat("time", this.time * this.speed / 1000);
</s> add this.setFloat("time", this.time * this.timeScale / 1000); </s> remove @serializeAsColor3()
</s> add @serialize()
public get autoGenerateTime(): boolean {
return this._autoGenerateTime;
}
public set autoGenerateTime(value: boolean) {
this._autoGenerateTime = value;
}
| [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fa451edde5bfd065139a530a181543aa8acb7cc5 | proceduralTexturesLibrary/src/grass/babylon.grassProceduralTexture.ts |
var colors: Color3[] = [];
for (var i = 0; i < parsedTexture.grassColors.length; i++) {
colors.push(Color3.FromArray(parsedTexture.grassColors[i]));
}
texture.grassColors = colors;
| <mask> */
<mask> public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): GrassProceduralTexture {
<mask> var texture = SerializationHelper.Parse(() => new GrassProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps), parsedTexture, scene, rootUrl);
<mask>
<mask> return texture;
<mask> }
<mask> }
<mask> }
</s> Fixing some serialization issues (fixed collisions with properties)
Former-commit-id: a3c7ee49f0533671f5e7b793b423abf75c8b6af7 </s> remove @serializeAsColor3()
</s> add @serialize()
public get autoGenerateTime(): boolean {
return this._autoGenerateTime;
}
public set autoGenerateTime(value: boolean) {
this._autoGenerateTime = value;
}
</s> remove @serializeAsColor3()
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fa451edde5bfd065139a530a181543aa8acb7cc5 | proceduralTexturesLibrary/src/grass/babylon.grassProceduralTexture.ts |
public timeScale: number = 1.0; | <mask> @serialize()
<mask> public time: number = 0.0;
<mask>
<mask> @serialize()
<mask> public speed: number = 1.0;
<mask>
<mask> @serialize()
<mask> public translationSpeed: number = 1.0;
<mask>
<mask> private _currentTranslation: number = 0;
</s> Fixing some serialization issues (fixed collisions with properties)
Former-commit-id: a3c7ee49f0533671f5e7b793b423abf75c8b6af7 </s> remove @serializeAsColor3()
</s> add @serialize()
public get autoGenerateTime(): boolean {
return this._autoGenerateTime;
}
public set autoGenerateTime(value: boolean) {
this._autoGenerateTime = value;
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fa451edde5bfd065139a530a181543aa8acb7cc5 | proceduralTexturesLibrary/src/perlinNoise/babylon.perlinNoiseProceduralTexture.ts |
this.setFloat("time", this.time * this.timeScale / 1000); | <mask> }
<mask> var deltaTime = scene.getEngine().getDeltaTime();
<mask>
<mask> this.time += deltaTime;
<mask> this.setFloat("time", this.time * this.speed / 1000);
<mask>
<mask> this._currentTranslation += deltaTime * this.translationSpeed / 1000.0;
<mask> this.setFloat("translationSpeed", this._currentTranslation);
<mask> }
<mask>
</s> Fixing some serialization issues (fixed collisions with properties)
Former-commit-id: a3c7ee49f0533671f5e7b793b423abf75c8b6af7 </s> remove @serializeAsColor3()
</s> add @serialize()
public get autoGenerateTime(): boolean {
return this._autoGenerateTime;
}
public set autoGenerateTime(value: boolean) {
this._autoGenerateTime = value;
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fa451edde5bfd065139a530a181543aa8acb7cc5 | proceduralTexturesLibrary/src/perlinNoise/babylon.perlinNoiseProceduralTexture.ts |
effect.setTextureFromPostProcessOutput("originalColor", this._originalColorPostProcess);
| <mask>
<mask> this._ssaoCombinePostProcess.onApply = (effect: Effect) => {
<mask> let viewport = this._scene.activeCamera!.viewport;
<mask> effect.setVector4("viewport", TmpVectors.Vector4[0].copyFromFloats(viewport.x, viewport.y, viewport.width, viewport.height));
<mask> effect.setTextureFromPostProcess("originalColor", this._originalColorPostProcess);
<mask> };
<mask> this._ssaoCombinePostProcess.samples = this.textureSamples;
<mask>
<mask> if (!this._forceGeometryBuffer) {
<mask> this._ssaoCombinePostProcess._prePassEffectConfiguration = new SSAO2Configuration();
</s> fixing double iPP
Former-commit-id: 2026e552d1ea0d28fba1df940c5f0ddb8c4cc240 </s> remove this._postProcesses.push(this.imageProcessingPostProcess);
</s> add let isIPPAlreadyPresent = false;
if (this._scene.activeCamera?._postProcesses) {
for (let i = 0; i < this._scene.activeCamera._postProcesses.length; i++) {
if (this._scene.activeCamera._postProcesses[i] instanceof ImageProcessingPostProcess) {
isIPPAlreadyPresent = true;
}
}
}
if (!isIPPAlreadyPresent) {
this._postProcesses.push(this.imageProcessingPostProcess);
}
</s> remove this._postProcesses[0].inputTexture = this.prePassRT.getInternalTexture()!;
</s> add if (this._postProcesses.length) {
this._postProcesses[0].inputTexture = this.prePassRT.getInternalTexture()!;
} else {
const pp = this._scene.activeCamera?._getFirstPostProcess();
if (pp) {
pp.inputTexture = this.prePassRT.getInternalTexture()!;
}
}
</s> remove if (firstCameraPP) {
</s> add if (firstCameraPP && this._postProcesses.length) {
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/facf3dda8ec5f2d494eb1ea95bee557ebed00eb4 | src/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.ts |
if (firstCameraPP && this._postProcesses.length) {
| <mask> */
<mask> public _afterCameraDraw() {
<mask> if (this._enabled) {
<mask> const firstCameraPP = this._scene.activeCamera && this._scene.activeCamera._getFirstPostProcess();
<mask> if (firstCameraPP) {
<mask> this._scene.postProcessManager._prepareFrame();
<mask> }
<mask> this._scene.postProcessManager.directRender(this._postProcesses, firstCameraPP ? firstCameraPP.inputTexture : null);
<mask> }
<mask> }
</s> fixing double iPP
Former-commit-id: 2026e552d1ea0d28fba1df940c5f0ddb8c4cc240 </s> remove this._postProcesses.push(this.imageProcessingPostProcess);
</s> add let isIPPAlreadyPresent = false;
if (this._scene.activeCamera?._postProcesses) {
for (let i = 0; i < this._scene.activeCamera._postProcesses.length; i++) {
if (this._scene.activeCamera._postProcesses[i] instanceof ImageProcessingPostProcess) {
isIPPAlreadyPresent = true;
}
}
}
if (!isIPPAlreadyPresent) {
this._postProcesses.push(this.imageProcessingPostProcess);
}
</s> remove this._postProcesses[0].inputTexture = this.prePassRT.getInternalTexture()!;
</s> add if (this._postProcesses.length) {
this._postProcesses[0].inputTexture = this.prePassRT.getInternalTexture()!;
} else {
const pp = this._scene.activeCamera?._getFirstPostProcess();
if (pp) {
pp.inputTexture = this.prePassRT.getInternalTexture()!;
}
}
</s> remove effect.setTextureFromPostProcess("originalColor", this._originalColorPostProcess);
</s> add effect.setTextureFromPostProcessOutput("originalColor", this._originalColorPostProcess);
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/facf3dda8ec5f2d494eb1ea95bee557ebed00eb4 | src/Rendering/prePassRenderer.ts |
let isIPPAlreadyPresent = false;
if (this._scene.activeCamera?._postProcesses) {
for (let i = 0; i < this._scene.activeCamera._postProcesses.length; i++) {
if (this._scene.activeCamera._postProcesses[i] instanceof ImageProcessingPostProcess) {
isIPPAlreadyPresent = true;
}
}
}
if (!isIPPAlreadyPresent) {
this._postProcesses.push(this.imageProcessingPostProcess);
}
| <mask> if (!this.imageProcessingPostProcess) {
<mask> this._createCompositionEffect();
<mask> }
<mask>
<mask> this._postProcesses.push(this.imageProcessingPostProcess);
<mask> this._bindPostProcessChain();
<mask> this._setState(true);
<mask> }
<mask>
<mask> private _disable() {
</s> fixing double iPP
Former-commit-id: 2026e552d1ea0d28fba1df940c5f0ddb8c4cc240 </s> remove if (firstCameraPP) {
</s> add if (firstCameraPP && this._postProcesses.length) {
</s> remove this._postProcesses[0].inputTexture = this.prePassRT.getInternalTexture()!;
</s> add if (this._postProcesses.length) {
this._postProcesses[0].inputTexture = this.prePassRT.getInternalTexture()!;
} else {
const pp = this._scene.activeCamera?._getFirstPostProcess();
if (pp) {
pp.inputTexture = this.prePassRT.getInternalTexture()!;
}
}
</s> remove effect.setTextureFromPostProcess("originalColor", this._originalColorPostProcess);
</s> add effect.setTextureFromPostProcessOutput("originalColor", this._originalColorPostProcess);
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/facf3dda8ec5f2d494eb1ea95bee557ebed00eb4 | src/Rendering/prePassRenderer.ts |
if (this._postProcesses.length) {
this._postProcesses[0].inputTexture = this.prePassRT.getInternalTexture()!;
} else {
const pp = this._scene.activeCamera?._getFirstPostProcess();
if (pp) {
pp.inputTexture = this.prePassRT.getInternalTexture()!;
}
}
| <mask> }
<mask> }
<mask>
<mask> private _bindPostProcessChain() {
<mask> this._postProcesses[0].inputTexture = this.prePassRT.getInternalTexture()!;
<mask> }
<mask>
<mask> /**
<mask> * Marks the prepass renderer as dirty, triggering a check if the prepass is necessary for the next rendering.
<mask> */
</s> fixing double iPP
Former-commit-id: 2026e552d1ea0d28fba1df940c5f0ddb8c4cc240 </s> remove this._postProcesses.push(this.imageProcessingPostProcess);
</s> add let isIPPAlreadyPresent = false;
if (this._scene.activeCamera?._postProcesses) {
for (let i = 0; i < this._scene.activeCamera._postProcesses.length; i++) {
if (this._scene.activeCamera._postProcesses[i] instanceof ImageProcessingPostProcess) {
isIPPAlreadyPresent = true;
}
}
}
if (!isIPPAlreadyPresent) {
this._postProcesses.push(this.imageProcessingPostProcess);
}
</s> remove if (firstCameraPP) {
</s> add if (firstCameraPP && this._postProcesses.length) {
</s> remove effect.setTextureFromPostProcess("originalColor", this._originalColorPostProcess);
</s> add effect.setTextureFromPostProcessOutput("originalColor", this._originalColorPostProcess);
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/facf3dda8ec5f2d494eb1ea95bee557ebed00eb4 | src/Rendering/prePassRenderer.ts |
this._debugCanvasWidth = 320;
this._debugCanvasHeight = 200; | <mask> function Analyser(scene) {
<mask> this.SMOOTHING = 0.75;
<mask> this.FFT_SIZE = 512;
<mask> this.BARGRAPHAMPLITUDE = 256;
<mask> this.DEBUGCANVASPOS = { x: 20, y: 20 };
<mask> this.DEBUGCANVASSIZE = { width: 320, height: 200 };
<mask> this._scene = scene;
<mask> this._audioEngine = scene.getEngine().getAudioEngine();
<mask> if (this._audioEngine.canUseWebAudio) {
<mask> this._webAudioAnalyser = this._audioEngine.audioContext.createAnalyser();
<mask> this._webAudioAnalyser.minDecibels = -140;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove
SoundTrack.prototype.connectToAnalyser = function (analyser) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this._connectedAnalyser = analyser;
if (this._audioEngine.canUseWebAudio) {
this._trackGain.disconnect();
this._connectedAnalyser.connectAudioNodes(this._trackGain, this._audioEngine.masterGain);
}
};
</s> add </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
} </s> remove this.name = name;
</s> add this._name = name; </s> remove this._debugCanvas.width = this.DEBUGCANVASSIZE.width;
this._debugCanvas.height = this.DEBUGCANVASSIZE.height;
</s> add this._debugCanvas.width = this._debugCanvasWidth;
this._debugCanvas.height = this._debugCanvasHeight; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.analyser.js |
this._debugCanvas.width = this._debugCanvasWidth;
this._debugCanvas.height = this._debugCanvasHeight; | <mask> var _this = this;
<mask> if (this._audioEngine.canUseWebAudio) {
<mask> if (!this._debugCanvas) {
<mask> this._debugCanvas = document.createElement("canvas");
<mask> this._debugCanvas.width = this.DEBUGCANVASSIZE.width;
<mask> this._debugCanvas.height = this.DEBUGCANVASSIZE.height;
<mask> this._debugCanvas.style.position = "absolute";
<mask> this._debugCanvas.style.top = this.DEBUGCANVASPOS.y + "px";
<mask> this._debugCanvas.style.left = this.DEBUGCANVASPOS.x + "px";
<mask> this._debugCanvasContext = this._debugCanvas.getContext("2d");
<mask> document.body.appendChild(this._debugCanvas);
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this._debugCanvas.style.top = this.DEBUGCANVASPOS.y + "px";
this._debugCanvas.style.left = this.DEBUGCANVASPOS.x + "px";
</s> add this._debugCanvas.style.top = "30px";
this._debugCanvas.style.left = "10px"; </s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add </s> remove Mesh.prototype.applyDisplacementMap = function (url, minHeight, maxHeight, onSuccess) {
</s> add Mesh.prototype.applyDisplacementMap = function (url, minHeight, maxHeight) {
</s> remove }, function (error) {
BABYLON.Tools.Error("Error while decoding audio data: " + error.err);
});
</s> add }, (error) => { Tools.Error("Error while decoding audio data: " + error.err); }); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.analyser.js |
this._debugCanvas.style.top = "30px";
this._debugCanvas.style.left = "10px"; | <mask> this._debugCanvas = document.createElement("canvas");
<mask> this._debugCanvas.width = this.DEBUGCANVASSIZE.width;
<mask> this._debugCanvas.height = this.DEBUGCANVASSIZE.height;
<mask> this._debugCanvas.style.position = "absolute";
<mask> this._debugCanvas.style.top = this.DEBUGCANVASPOS.y + "px";
<mask> this._debugCanvas.style.left = this.DEBUGCANVASPOS.x + "px";
<mask> this._debugCanvasContext = this._debugCanvas.getContext("2d");
<mask> document.body.appendChild(this._debugCanvas);
<mask> this._registerFunc = function () {
<mask> _this.drawDebugCanvas();
<mask> };
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this._debugCanvas.width = this.DEBUGCANVASSIZE.width;
this._debugCanvas.height = this.DEBUGCANVASSIZE.height;
</s> add this._debugCanvas.width = this._debugCanvasWidth;
this._debugCanvas.height = this._debugCanvasHeight; </s> remove this._startTime = startTime;
this._soundSource.start(startTime, this._startOffset % this._soundSource.buffer.duration);
</s> add this.startTime = startTime;
this._soundSource.start(startTime, this.startOffset % this._soundSource.buffer.duration); </s> remove var height = this.DEBUGCANVASSIZE.height * percent;
var offset = this.DEBUGCANVASSIZE.height - height - 1;
var barWidth = this.DEBUGCANVASSIZE.width / this.getFrequencyBinCount();
</s> add var height = this._debugCanvasHeight * percent;
var offset = this._debugCanvasHeight - height - 1;
var barWidth = this._debugCanvasWidth / this.getFrequencyBinCount(); </s> remove BABYLON.Tools.Error("Error while trying to play audio: " + this.name + ", " + ex.message);
</s> add BABYLON.Tools.Error("Error while trying to play audio: " + this._name + ", " + ex.message); </s> remove }, function (error) {
BABYLON.Tools.Error("Error while decoding audio data: " + error.err);
});
</s> add }, (error) => { Tools.Error("Error while decoding audio data: " + error.err); }); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.analyser.js |
this._debugCanvasContext.fillRect(0, 0, this._debugCanvasWidth, this._debugCanvasHeight); | <mask> if (this._registerFunc) {
<mask> var workingArray = this.getByteFrequencyData();
<mask>
<mask> this._debugCanvasContext.fillStyle = 'rgb(0, 0, 0)';
<mask> this._debugCanvasContext.fillRect(0, 0, this.DEBUGCANVASSIZE.width, this.DEBUGCANVASSIZE.height);
<mask>
<mask> for (var i = 0; i < this.getFrequencyBinCount(); i++) {
<mask> var value = workingArray[i];
<mask> var percent = value / this.BARGRAPHAMPLITUDE;
<mask> var height = this.DEBUGCANVASSIZE.height * percent;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove var height = this.DEBUGCANVASSIZE.height * percent;
var offset = this.DEBUGCANVASSIZE.height - height - 1;
var barWidth = this.DEBUGCANVASSIZE.width / this.getFrequencyBinCount();
</s> add var height = this._debugCanvasHeight * percent;
var offset = this._debugCanvasHeight - height - 1;
var barWidth = this._debugCanvasWidth / this.getFrequencyBinCount(); </s> remove for (i = 0; i < this.soundTracks.length; i++) {
</s> add for (var i = 0; i < this.soundTracks.length; i++) {
</s> remove sound = this.soundTracks[i].soundCollection[j];
</s> add var sound = this.soundTracks[i].soundCollection[j];
</s> remove forEach = forEach || (function (item) {
return;
});
</s> add </s> remove var currentRenderList = this.renderList ? this.renderList : scene.getActiveMeshes().data;
for (var meshIndex = 0; meshIndex < currentRenderList.length; meshIndex++) {
var mesh = currentRenderList[meshIndex];
</s> add for (var meshIndex = 0; meshIndex < this.renderList.length; meshIndex++) {
var mesh = this.renderList[meshIndex]; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.analyser.js |
var height = this._debugCanvasHeight * percent;
var offset = this._debugCanvasHeight - height - 1;
var barWidth = this._debugCanvasWidth / this.getFrequencyBinCount(); | <mask>
<mask> for (var i = 0; i < this.getFrequencyBinCount(); i++) {
<mask> var value = workingArray[i];
<mask> var percent = value / this.BARGRAPHAMPLITUDE;
<mask> var height = this.DEBUGCANVASSIZE.height * percent;
<mask> var offset = this.DEBUGCANVASSIZE.height - height - 1;
<mask> var barWidth = this.DEBUGCANVASSIZE.width / this.getFrequencyBinCount();
<mask> var hue = i / this.getFrequencyBinCount() * 360;
<mask> this._debugCanvasContext.fillStyle = 'hsl(' + hue + ', 100%, 50%)';
<mask> this._debugCanvasContext.fillRect(i * barWidth, offset, barWidth, height);
<mask> }
<mask> }
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this._debugCanvasContext.fillRect(0, 0, this.DEBUGCANVASSIZE.width, this.DEBUGCANVASSIZE.height);
</s> add this._debugCanvasContext.fillRect(0, 0, this._debugCanvasWidth, this._debugCanvasHeight); </s> remove /**
* force a specific size of the canvas
* @param {number} width - the new canvas' width
* @param {number} height - the new canvas' height
*/
</s> add </s> remove sound = this.soundTracks[i].soundCollection[j];
</s> add var sound = this.soundTracks[i].soundCollection[j];
</s> remove for (i = 0; i < this.soundTracks.length; i++) {
</s> add for (var i = 0; i < this.soundTracks.length; i++) {
</s> remove /**
* Set the WebGL's viewport
* @param {BABYLON.Viewport} viewport - the viewport element to be used.
* @param {number} [requiredWidth] - the width required for rendering. If not provided the rendering canvas' width is used.
* @param {number} [requiredHeight] - the height required for rendering. If not provided the rendering canvas' height is used.
*/
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.analyser.js |
if (this._audioEngine.canUseWebAudio) {
return this._webAudioAnalyser.frequencyBinCount;
}
else {
return 0;
} | <mask> }
<mask> }
<mask>
<mask> public getFrequencyBinCount(): number {
<mask> return this._webAudioAnalyser.frequencyBinCount;
<mask> }
<mask>
<mask> public getByteFrequencyData(): Uint8Array {
<mask> this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
<mask> this._webAudioAnalyser.fftSize = this.FFT_SIZE;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs);
} </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteTimeDomainData(this._byteTime);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteTimeDomainData(this._byteTime);
} </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
} </s> remove public attachToMesh(meshToConnectTo: BABYLON.AbstractMesh) {
</s> add public attachToMesh(meshToConnectTo: AbstractMesh) { </s> remove var direction = BABYLON.Vector3.TransformNormal(this._localDirection, mat);
</s> add var direction = Vector3.TransformNormal(this._localDirection, mat); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.analyser.ts |
if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs);
} | <mask> return this._webAudioAnalyser.frequencyBinCount;
<mask> }
<mask>
<mask> public getByteFrequencyData(): Uint8Array {
<mask> this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
<mask> this._webAudioAnalyser.fftSize = this.FFT_SIZE;
<mask> this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs);
<mask> return this._byteFreqs;
<mask> }
<mask>
<mask> public getByteTimeDomainData(): Uint8Array {
<mask> this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteTimeDomainData(this._byteTime);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteTimeDomainData(this._byteTime);
} </s> remove return this._webAudioAnalyser.frequencyBinCount;
</s> add if (this._audioEngine.canUseWebAudio) {
return this._webAudioAnalyser.frequencyBinCount;
}
else {
return 0;
} </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
} </s> remove public attachToMesh(meshToConnectTo: BABYLON.AbstractMesh) {
</s> add public attachToMesh(meshToConnectTo: AbstractMesh) { </s> remove var direction = BABYLON.Vector3.TransformNormal(this._localDirection, mat);
</s> add var direction = Vector3.TransformNormal(this._localDirection, mat); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.analyser.ts |
if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteTimeDomainData(this._byteTime);
} | <mask> return this._byteFreqs;
<mask> }
<mask>
<mask> public getByteTimeDomainData(): Uint8Array {
<mask> this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
<mask> this._webAudioAnalyser.fftSize = this.FFT_SIZE;
<mask> this._webAudioAnalyser.getByteTimeDomainData(this._byteTime);
<mask> return this._byteTime;
<mask> }
<mask>
<mask> public getFloatFrequencyData(): Uint8Array {
<mask> this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs);
} </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
} </s> remove return this._webAudioAnalyser.frequencyBinCount;
</s> add if (this._audioEngine.canUseWebAudio) {
return this._webAudioAnalyser.frequencyBinCount;
}
else {
return 0;
} </s> remove public attachToMesh(meshToConnectTo: BABYLON.AbstractMesh) {
</s> add public attachToMesh(meshToConnectTo: AbstractMesh) { </s> remove var direction = BABYLON.Vector3.TransformNormal(this._localDirection, mat);
</s> add var direction = Vector3.TransformNormal(this._localDirection, mat); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.analyser.ts |
if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
} | <mask> return this._byteTime;
<mask> }
<mask>
<mask> public getFloatFrequencyData(): Uint8Array {
<mask> this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
<mask> this._webAudioAnalyser.fftSize = this.FFT_SIZE;
<mask> this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
<mask> return this._floatFreqs;
<mask> }
<mask>
<mask> public drawDebugCanvas() {
<mask> if (this._audioEngine.canUseWebAudio) {
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteTimeDomainData(this._byteTime);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteTimeDomainData(this._byteTime);
} </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs);
} </s> remove return this._webAudioAnalyser.frequencyBinCount;
</s> add if (this._audioEngine.canUseWebAudio) {
return this._webAudioAnalyser.frequencyBinCount;
}
else {
return 0;
} </s> remove public attachToMesh(meshToConnectTo: BABYLON.AbstractMesh) {
</s> add public attachToMesh(meshToConnectTo: AbstractMesh) { </s> remove
SoundTrack.prototype.connectToAnalyser = function (analyser) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this._connectedAnalyser = analyser;
if (this._audioEngine.canUseWebAudio) {
this._trackGain.disconnect();
this._connectedAnalyser.connectAudioNodes(this._trackGain, this._audioEngine.masterGain);
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.analyser.ts |
<mask> this.masterGain.gain.value = 1;
<mask> this.masterGain.connect(this.audioContext.destination);
<mask> }
<mask> }
<mask> AudioEngine.prototype.dispose = function () {
<mask> if (this.canUseWebAudio) {
<mask> if (this._connectedAnalyser) {
<mask> this._connectedAnalyser.stopDebugCanvas();
<mask> }
<mask> this.canUseWebAudio = false;
<mask> this.masterGain.disconnect();
<mask> this.masterGain = null;
<mask> this.audioContext = null;
<mask> }
<mask> };
<mask>
<mask> AudioEngine.prototype.getGlobalVolume = function () {
<mask> if (this.canUseWebAudio) {
<mask> return this.masterGain.gain.value;
<mask> } else {
<mask> return -1;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this._connectedAnalyser = analyser;
</s> add </s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add </s> remove SoundTrack.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
while (this.soundCollection.length) {
this.soundCollection[0].dispose();
}
this._trackGain.disconnect();
this._trackGain = null;
}
};
</s> add </s> remove Scene.prototype.enableDepthRenderer = function () {
if (this._depthRenderer) {
return this._depthRenderer;
}
this._depthRenderer = new BABYLON.DepthRenderer(this);
return this._depthRenderer;
};
Scene.prototype.disableDepthRenderer = function () {
if (!this._depthRenderer) {
return;
}
this._depthRenderer.dispose();
this._depthRenderer = null;
};
</s> add </s> remove this._connectedAnalyser.connectAudioNodes(this.masterGain, this.audioContext.destination);
</s> add analyser.connectAudioNodes(this.masterGain, this.audioContext.destination); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.audioengine.js | |
<mask> }
<mask> };
<mask>
<mask> AudioEngine.prototype.connectToAnalyser = function (analyser) {
<mask> if (this._connectedAnalyser) {
<mask> this._connectedAnalyser.stopDebugCanvas();
<mask> }
<mask> this._connectedAnalyser = analyser;
<mask> if (this.canUseWebAudio) {
<mask> this.masterGain.disconnect();
<mask> this._connectedAnalyser.connectAudioNodes(this.masterGain, this.audioContext.destination);
<mask> }
<mask> };
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this._connectedAnalyser.connectAudioNodes(this.masterGain, this.audioContext.destination);
</s> add analyser.connectAudioNodes(this.masterGain, this.audioContext.destination); </s> remove
SoundTrack.prototype.connectToAnalyser = function (analyser) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this._connectedAnalyser = analyser;
if (this._audioEngine.canUseWebAudio) {
this._trackGain.disconnect();
this._connectedAnalyser.connectAudioNodes(this._trackGain, this._audioEngine.masterGain);
}
};
</s> add </s> remove AudioEngine.prototype.dispose = function () {
if (this.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this.canUseWebAudio = false;
this.masterGain.disconnect();
this.masterGain = null;
this.audioContext = null;
}
};
</s> add </s> remove SoundTrack.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
while (this.soundCollection.length) {
this.soundCollection[0].dispose();
}
this._trackGain.disconnect();
this._trackGain = null;
}
};
</s> add </s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.audioengine.js | |
analyser.connectAudioNodes(this.masterGain, this.audioContext.destination); | <mask> }
<mask> this._connectedAnalyser = analyser;
<mask> if (this.canUseWebAudio) {
<mask> this.masterGain.disconnect();
<mask> this._connectedAnalyser.connectAudioNodes(this.masterGain, this.audioContext.destination);
<mask> }
<mask> };
<mask> return AudioEngine;
<mask> })();
<mask> BABYLON.AudioEngine = AudioEngine;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this._connectedAnalyser = analyser;
</s> add </s> remove
SoundTrack.prototype.connectToAnalyser = function (analyser) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this._connectedAnalyser = analyser;
if (this._audioEngine.canUseWebAudio) {
this._trackGain.disconnect();
this._connectedAnalyser.connectAudioNodes(this._trackGain, this._audioEngine.masterGain);
}
};
</s> add </s> remove AudioEngine.prototype.dispose = function () {
if (this.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this.canUseWebAudio = false;
this.masterGain.disconnect();
this.masterGain = null;
this.audioContext = null;
}
};
</s> add </s> remove Scene.prototype.enableDepthRenderer = function () {
if (this._depthRenderer) {
return this._depthRenderer;
}
this._depthRenderer = new BABYLON.DepthRenderer(this);
return this._depthRenderer;
};
Scene.prototype.disableDepthRenderer = function () {
if (!this._depthRenderer) {
return;
}
this._depthRenderer.dispose();
this._depthRenderer = null;
};
</s> add </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.audioengine.js |
this.startTime = 0;
this.startOffset = 0; | <mask> this.rolloffFactor = 1;
<mask> this.maxDistance = 100;
<mask> this.distanceModel = "linear";
<mask> this.panningModel = "HRTF";
<mask> this._startTime = 0;
<mask> this._startOffset = 0;
<mask> this._position = BABYLON.Vector3.Zero();
<mask> this._localDirection = new BABYLON.Vector3(1, 0, 0);
<mask> this._volume = 1;
<mask> this._isLoaded = false;
<mask> this._isReadyToPlay = false;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this.definedFacingForward = true;
</s> add </s> remove AudioEngine.prototype.dispose = function () {
if (this.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this.canUseWebAudio = false;
this.masterGain.disconnect();
this.masterGain = null;
this.audioContext = null;
}
};
</s> add </s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add </s> remove private _audioEngine: BABYLON.AudioEngine;
</s> add private _audioEngine: AudioEngine; </s> remove Scene.prototype.getMaterialByTags = function (tagsQuery, forEach) {
return this._getByTags(this.materials, tagsQuery, forEach).concat(this._getByTags(this.multiMaterials, tagsQuery, forEach));
</s> add Scene.prototype.getMaterialByTags = function (tagsQuery) {
return this._getByTags(this.materials, tagsQuery).concat(this._getByTags(this.multiMaterials, tagsQuery));
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.js |
this._name = name; | <mask> // If not set, the sound will be omnidirectional
<mask> this._coneInnerAngle = 360;
<mask> this._coneOuterAngle = 360;
<mask> this._coneOuterGain = 0;
<mask> this.name = name;
<mask> this._scene = scene;
<mask> this._audioEngine = this._scene.getEngine().getAudioEngine();
<mask> this._readyToPlayCallback = readyToPlayCallback;
<mask>
<mask> // Default custom attenuation function is a linear attenuation
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove constructor(name: string, urlOrArrayBuffer: any, scene: BABYLON.Scene, readyToPlayCallback?: () => void, options?) {
</s> add constructor(name: string, urlOrArrayBuffer: any, scene: Scene, readyToPlayCallback?: () => void, options?) { </s> remove private _scene: BABYLON.Scene;
private _connectedMesh: BABYLON.AbstractMesh;
</s> add private _scene: Scene;
private _connectedMesh: AbstractMesh; </s> remove /**
* stop executing a render loop function and remove it from the execution array
* @param {Function} [renderFunction] the function to be removed. If not provided all functions will be removed.
*/
</s> add </s> remove BABYLON.Tools.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle.");
</s> add Tools.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle."); </s> remove /**
* Set the WebGL's viewport
* @param {BABYLON.Viewport} viewport - the viewport element to be used.
* @param {number} [requiredWidth] - the width required for rendering. If not provided the rendering canvas' width is used.
* @param {number} [requiredHeight] - the height required for rendering. If not provided the rendering canvas' height is used.
*/
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.js |
<mask> }
<mask> }
<mask> }
<mask> }
<mask> Sound.prototype.dispose = function () {
<mask> if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
<mask> if (this._isPlaying) {
<mask> this.stop();
<mask> }
<mask> this._isReadyToPlay = false;
<mask> if (this.soundTrackId === -1) {
<mask> this._scene.mainSoundTrack.RemoveSound(this);
<mask> } else {
<mask> this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
<mask> }
<mask> this._soundGain.disconnect();
<mask> this._soundSource.disconnect();
<mask> this._audioBuffer = null;
<mask> this._soundGain = null;
<mask> this._soundSource = null;
<mask> if (this._soundPanner) {
<mask> this._soundPanner.disconnect();
<mask> this._soundPanner = null;
<mask> }
<mask> this._audioNode.disconnect();
<mask> if (this._connectedMesh) {
<mask> this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
<mask> this._connectedMesh = null;
<mask> }
<mask> }
<mask> };
<mask>
<mask> Sound.prototype._soundLoaded = function (audioData) {
<mask> var _this = this;
<mask> this._isLoaded = true;
<mask> this._audioEngine.audioContext.decodeAudioData(audioData, function (buffer) {
<mask> _this._audioBuffer = buffer;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove AudioEngine.prototype.dispose = function () {
if (this.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this.canUseWebAudio = false;
this.masterGain.disconnect();
this.masterGain = null;
this.audioContext = null;
}
};
</s> add </s> remove Scene.prototype.enableDepthRenderer = function () {
if (this._depthRenderer) {
return this._depthRenderer;
}
this._depthRenderer = new BABYLON.DepthRenderer(this);
return this._depthRenderer;
};
Scene.prototype.disableDepthRenderer = function () {
if (!this._depthRenderer) {
return;
}
this._depthRenderer.dispose();
this._depthRenderer = null;
};
</s> add </s> remove this._audioEngine.audioContext.decodeAudioData(audioData,(buffer) => {
</s> add this._audioEngine.audioContext.decodeAudioData(audioData, (buffer) => { </s> remove SoundTrack.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
while (this.soundCollection.length) {
this.soundCollection[0].dispose();
}
this._trackGain.disconnect();
this._trackGain = null;
}
};
</s> add </s> remove Scene.prototype.getSoundByName = function (name) {
for (var index = 0; index < this.mainSoundTrack.soundCollection.length; index++) {
if (this.mainSoundTrack.soundCollection[index].name === name) {
return this.mainSoundTrack.soundCollection[index];
}
}
for (var sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) {
for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) {
if (this.soundTracks[sdIndex].soundCollection[index].name === name) {
return this.soundTracks[sdIndex].soundCollection[index];
}
}
}
return null;
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.js | |
this.startTime = startTime;
this._soundSource.start(startTime, this.startOffset % this._soundSource.buffer.duration); | <mask> }
<mask> }
<mask> this._soundSource.connect(this._audioNode);
<mask> this._soundSource.loop = this.loop;
<mask> this._startTime = startTime;
<mask> this._soundSource.start(startTime, this._startOffset % this._soundSource.buffer.duration);
<mask> this._isPlaying = true;
<mask> } catch (ex) {
<mask> BABYLON.Tools.Error("Error while trying to play audio: " + this.name + ", " + ex.message);
<mask> }
<mask> }
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove BABYLON.Tools.Error("Error while trying to play audio: " + this.name + ", " + ex.message);
</s> add BABYLON.Tools.Error("Error while trying to play audio: " + this._name + ", " + ex.message); </s> remove BABYLON.Tools.Error("Error while trying to play audio: " + this.name + ", " + ex.message);
</s> add Tools.Error("Error while trying to play audio: " + this.name + ", " + ex.message); </s> remove }, function (error) {
BABYLON.Tools.Error("Error while decoding audio data: " + error.err);
});
</s> add }, (error) => { Tools.Error("Error while decoding audio data: " + error.err); }); </s> remove var height = this.DEBUGCANVASSIZE.height * percent;
var offset = this.DEBUGCANVASSIZE.height - height - 1;
var barWidth = this.DEBUGCANVASSIZE.width / this.getFrequencyBinCount();
</s> add var height = this._debugCanvasHeight * percent;
var offset = this._debugCanvasHeight - height - 1;
var barWidth = this._debugCanvasWidth / this.getFrequencyBinCount(); </s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.js |
BABYLON.Tools.Error("Error while trying to play audio: " + this._name + ", " + ex.message); | <mask> this._startTime = startTime;
<mask> this._soundSource.start(startTime, this._startOffset % this._soundSource.buffer.duration);
<mask> this._isPlaying = true;
<mask> } catch (ex) {
<mask> BABYLON.Tools.Error("Error while trying to play audio: " + this.name + ", " + ex.message);
<mask> }
<mask> }
<mask> };
<mask>
<mask> /**
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove BABYLON.Tools.Error("Error while trying to play audio: " + this.name + ", " + ex.message);
</s> add Tools.Error("Error while trying to play audio: " + this.name + ", " + ex.message); </s> remove this._startTime = startTime;
this._soundSource.start(startTime, this._startOffset % this._soundSource.buffer.duration);
</s> add this.startTime = startTime;
this._soundSource.start(startTime, this.startOffset % this._soundSource.buffer.duration); </s> remove }, function (error) {
BABYLON.Tools.Error("Error while decoding audio data: " + error.err);
});
</s> add }, (error) => { Tools.Error("Error while decoding audio data: " + error.err); }); </s> remove this._debugCanvas.width = this.DEBUGCANVASSIZE.width;
this._debugCanvas.height = this.DEBUGCANVASSIZE.height;
</s> add this._debugCanvas.width = this._debugCanvasWidth;
this._debugCanvas.height = this._debugCanvasHeight; </s> remove this._debugCanvas.style.top = this.DEBUGCANVASPOS.y + "px";
this._debugCanvas.style.left = this.DEBUGCANVASPOS.x + "px";
</s> add this._debugCanvas.style.top = "30px";
this._debugCanvas.style.left = "10px"; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.js |
this.startOffset += this._audioEngine.audioContext.currentTime - this.startTime; | <mask>
<mask> Sound.prototype.pause = function () {
<mask> if (this._isPlaying) {
<mask> this._soundSource.stop(0);
<mask> this._startOffset += this._audioEngine.audioContext.currentTime - this._startTime;
<mask> }
<mask> };
<mask>
<mask> Sound.prototype.setVolume = function (newVolume) {
<mask> this._volume = newVolume;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add </s> remove
SoundTrack.prototype.connectToAnalyser = function (analyser) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this._connectedAnalyser = analyser;
if (this._audioEngine.canUseWebAudio) {
this._trackGain.disconnect();
this._connectedAnalyser.connectAudioNodes(this._trackGain, this._audioEngine.masterGain);
}
};
</s> add </s> remove SoundTrack.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
while (this.soundCollection.length) {
this.soundCollection[0].dispose();
}
this._trackGain.disconnect();
this._trackGain = null;
}
};
</s> add </s> remove AudioEngine.prototype.dispose = function () {
if (this.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this.canUseWebAudio = false;
this.masterGain.disconnect();
this.masterGain = null;
this.audioContext = null;
}
};
</s> add </s> remove Scene.prototype.enableDepthRenderer = function () {
if (this._depthRenderer) {
return this._depthRenderer;
}
this._depthRenderer = new BABYLON.DepthRenderer(this);
return this._depthRenderer;
};
Scene.prototype.disableDepthRenderer = function () {
if (!this._depthRenderer) {
return;
}
this._depthRenderer.dispose();
this._depthRenderer = null;
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.js |
meshToConnectTo.registerAfterWorldMatrixUpdate(function (connectedMesh) { | <mask> this.stop();
<mask> this.play();
<mask> }
<mask> }
<mask> this._registerFunc = function (connectedMesh) {
<mask> return _this._onRegisterAfterWorldMatrixUpdate(connectedMesh);
<mask> };
<mask> meshToConnectTo.registerAfterWorldMatrixUpdate(this._registerFunc);
<mask> };
<mask>
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove };
meshToConnectTo.registerAfterWorldMatrixUpdate(this._registerFunc);
</s> add }); </s> remove this._registerFunc = (connectedMesh: BABYLON.AbstractMesh) => this._onRegisterAfterWorldMatrixUpdate(connectedMesh);
</s> add this._registerFunc = (connectedMesh: AbstractMesh) => this._onRegisterAfterWorldMatrixUpdate(connectedMesh); </s> remove private _onRegisterAfterWorldMatrixUpdate(connectedMesh: BABYLON.AbstractMesh) {
</s> add private _onRegisterAfterWorldMatrixUpdate(connectedMesh: AbstractMesh) { </s> remove this._audioEngine.audioContext.decodeAudioData(audioData,(buffer) => {
</s> add this._audioEngine.audioContext.decodeAudioData(audioData, (buffer) => { </s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.js |
}); | <mask> }
<mask> }
<mask> this._registerFunc = function (connectedMesh) {
<mask> return _this._onRegisterAfterWorldMatrixUpdate(connectedMesh);
<mask> };
<mask> meshToConnectTo.registerAfterWorldMatrixUpdate(this._registerFunc);
<mask> };
<mask>
<mask> Sound.prototype._onRegisterAfterWorldMatrixUpdate = function (connectedMesh) {
<mask> this.setPosition(connectedMesh.position);
<mask> if (this._isDirectional && this._isPlaying) {
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this._registerFunc = function (connectedMesh) {
</s> add meshToConnectTo.registerAfterWorldMatrixUpdate(function (connectedMesh) { </s> remove private _onRegisterAfterWorldMatrixUpdate(connectedMesh: BABYLON.AbstractMesh) {
</s> add private _onRegisterAfterWorldMatrixUpdate(connectedMesh: AbstractMesh) { </s> remove this._registerFunc = (connectedMesh: BABYLON.AbstractMesh) => this._onRegisterAfterWorldMatrixUpdate(connectedMesh);
</s> add this._registerFunc = (connectedMesh: AbstractMesh) => this._onRegisterAfterWorldMatrixUpdate(connectedMesh); </s> remove var parseSound = function (parsedSound, scene, rootUrl) {
var soundName = parsedSound.name;
var soundUrl = rootUrl + soundName;
var options = {
autoplay: parsedSound.autoplay, loop: parsedSound.loop, volume: parsedSound.volume,
spatialSound: parsedSound.spatialSound, maxDistance: parsedSound.maxDistance,
rolloffFactor: parsedSound.rolloffFactor,
refDistance: parsedSound.refDistance,
distanceModel: parsedSound.distanceModel,
panningModel: parsedSound.panningModel
};
var newSound = new BABYLON.Sound(soundName, soundUrl, scene, function () {
scene._removePendingData(newSound);
}, options);
scene._addPendingData(newSound);
if (parsedSound.position) {
var soundPosition = BABYLON.Vector3.FromArray(parsedSound.position);
newSound.setPosition(soundPosition);
}
if (parsedSound.isDirectional) {
newSound.setDirectionalCone(parsedSound.coneInnerAngle || 360, parsedSound.coneOuterAngle || 360, parsedSound.coneOuterGain || 0);
if (parsedSound.localDirectionToMesh) {
var localDirectionToMesh = BABYLON.Vector3.FromArray(parsedSound.localDirectionToMesh);
newSound.setLocalDirectionToMesh(localDirectionToMesh);
}
}
if (parsedSound.connectedMeshId) {
var connectedMesh = scene.getMeshByID(parsedSound.connectedMeshId);
if (connectedMesh) {
newSound.attachToMesh(connectedMesh);
}
}
};
</s> add </s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.js |
private _audioEngine: AudioEngine; | <mask> private _isLoaded: boolean = false;
<mask> private _isReadyToPlay: boolean = false;
<mask> private _isPlaying: boolean = false;
<mask> private _isDirectional: boolean = false;
<mask> private _audioEngine: BABYLON.AudioEngine;
<mask> private _readyToPlayCallback;
<mask> private _audioBuffer;
<mask> private _soundSource: AudioBufferSourceNode;
<mask> private _soundPanner: PannerNode;
<mask> private _soundGain: GainNode;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove private _scene: BABYLON.Scene;
private _connectedMesh: BABYLON.AbstractMesh;
</s> add private _scene: Scene;
private _connectedMesh: AbstractMesh; </s> remove private _onRegisterAfterWorldMatrixUpdate(connectedMesh: BABYLON.AbstractMesh) {
</s> add private _onRegisterAfterWorldMatrixUpdate(connectedMesh: AbstractMesh) { </s> remove this._registerFunc = (connectedMesh: BABYLON.AbstractMesh) => this._onRegisterAfterWorldMatrixUpdate(connectedMesh);
</s> add this._registerFunc = (connectedMesh: AbstractMesh) => this._onRegisterAfterWorldMatrixUpdate(connectedMesh); </s> remove var direction = BABYLON.Vector3.TransformNormal(this._localDirection, mat);
</s> add var direction = Vector3.TransformNormal(this._localDirection, mat); </s> remove this._audioEngine.audioContext.decodeAudioData(audioData,(buffer) => {
</s> add this._audioEngine.audioContext.decodeAudioData(audioData, (buffer) => { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.ts |
private _scene: Scene;
private _connectedMesh: AbstractMesh; | <mask> // If not set, the sound will be omnidirectional
<mask> private _coneInnerAngle: number = 360;
<mask> private _coneOuterAngle: number = 360;
<mask> private _coneOuterGain: number = 0;
<mask> private _scene: BABYLON.Scene;
<mask> private _connectedMesh: BABYLON.AbstractMesh;
<mask> private _customAttenuationFunction: (currentVolume: number, currentDistance: number, maxDistance: number, refDistance: number, rolloffFactor: number) => number;
<mask> private _registerFunc;
<mask>
<mask> /**
<mask> * Create a sound and attach it to a scene
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this.name = name;
</s> add this._name = name; </s> remove private _audioEngine: BABYLON.AudioEngine;
</s> add private _audioEngine: AudioEngine; </s> remove BABYLON.Tools.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle.");
</s> add Tools.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle."); </s> remove private _onRegisterAfterWorldMatrixUpdate(connectedMesh: BABYLON.AbstractMesh) {
</s> add private _onRegisterAfterWorldMatrixUpdate(connectedMesh: AbstractMesh) { </s> remove this._registerFunc = (connectedMesh: BABYLON.AbstractMesh) => this._onRegisterAfterWorldMatrixUpdate(connectedMesh);
</s> add this._registerFunc = (connectedMesh: AbstractMesh) => this._onRegisterAfterWorldMatrixUpdate(connectedMesh); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.ts |
constructor(name: string, urlOrArrayBuffer: any, scene: Scene, readyToPlayCallback?: () => void, options?) { | <mask> * @param urlOrArrayBuffer Url to the sound to load async or ArrayBuffer
<mask> * @param readyToPlayCallback Provide a callback function if you'd like to load your code once the sound is ready to be played
<mask> * @param options Objects to provide with the current available options: autoplay, loop, volume, spatialSound, maxDistance, rolloffFactor, refDistance, distanceModel, panningModel
<mask> */
<mask> constructor(name: string, urlOrArrayBuffer: any, scene: BABYLON.Scene, readyToPlayCallback?: () => void, options?) {
<mask> this.name = name;
<mask> this._scene = scene;
<mask> this._audioEngine = this._scene.getEngine().getAudioEngine();
<mask> this._readyToPlayCallback = readyToPlayCallback;
<mask> // Default custom attenuation function is a linear attenuation
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this.name = name;
</s> add this._name = name; </s> remove /**
* @constructor
* @param {HTMLCanvasElement} canvas - the canvas to be used for rendering
* @param {boolean} [antialias] - enable antialias
* @param options - further options to be sent to the getContext function
*/
</s> add </s> remove BABYLON.Tools.Error("Parameter must be a URL to the sound or an ArrayBuffer of the sound.");
</s> add Tools.Error("Parameter must be a URL to the sound or an ArrayBuffer of the sound."); </s> remove /**
* The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio.
*/
</s> add </s> remove BABYLON.Tools.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle.");
</s> add Tools.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle."); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.ts |
Tools.LoadFile(urlOrArrayBuffer, (data) => { this._soundLoaded(data); }, null, null, true); | <mask> this._audioNode = this._soundGain;
<mask> }
<mask> this._scene.mainSoundTrack.AddSound(this);
<mask> if (typeof (urlOrArrayBuffer) === "string") {
<mask> BABYLON.Tools.LoadFile(urlOrArrayBuffer,(data) => { this._soundLoaded(data); }, null, null, true);
<mask> }
<mask> else {
<mask> if (urlOrArrayBuffer instanceof ArrayBuffer) {
<mask> this._soundLoaded(urlOrArrayBuffer);
<mask> }
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove BABYLON.Tools.Error("Parameter must be a URL to the sound or an ArrayBuffer of the sound.");
</s> add Tools.Error("Parameter must be a URL to the sound or an ArrayBuffer of the sound."); </s> remove this._audioEngine.audioContext.decodeAudioData(audioData,(buffer) => {
</s> add this._audioEngine.audioContext.decodeAudioData(audioData, (buffer) => { </s> remove var parseSound = function (parsedSound, scene, rootUrl) {
var soundName = parsedSound.name;
var soundUrl = rootUrl + soundName;
var options = {
autoplay: parsedSound.autoplay, loop: parsedSound.loop, volume: parsedSound.volume,
spatialSound: parsedSound.spatialSound, maxDistance: parsedSound.maxDistance,
rolloffFactor: parsedSound.rolloffFactor,
refDistance: parsedSound.refDistance,
distanceModel: parsedSound.distanceModel,
panningModel: parsedSound.panningModel
};
var newSound = new BABYLON.Sound(soundName, soundUrl, scene, function () {
scene._removePendingData(newSound);
}, options);
scene._addPendingData(newSound);
if (parsedSound.position) {
var soundPosition = BABYLON.Vector3.FromArray(parsedSound.position);
newSound.setPosition(soundPosition);
}
if (parsedSound.isDirectional) {
newSound.setDirectionalCone(parsedSound.coneInnerAngle || 360, parsedSound.coneOuterAngle || 360, parsedSound.coneOuterGain || 0);
if (parsedSound.localDirectionToMesh) {
var localDirectionToMesh = BABYLON.Vector3.FromArray(parsedSound.localDirectionToMesh);
newSound.setLocalDirectionToMesh(localDirectionToMesh);
}
}
if (parsedSound.connectedMeshId) {
var connectedMesh = scene.getMeshByID(parsedSound.connectedMeshId);
if (connectedMesh) {
newSound.attachToMesh(connectedMesh);
}
}
};
</s> add </s> remove // Sounds
if (parsedData.sounds && scene.getEngine().getAudioEngine().canUseWebAudio) {
for (index = 0; index < parsedData.sounds.length; index++) {
var parsedSound = parsedData.sounds[index];
parseSound(parsedSound, scene, rootUrl);
}
}
</s> add </s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.ts |
Tools.Error("Parameter must be a URL to the sound or an ArrayBuffer of the sound."); | <mask> if (urlOrArrayBuffer instanceof ArrayBuffer) {
<mask> this._soundLoaded(urlOrArrayBuffer);
<mask> }
<mask> else {
<mask> BABYLON.Tools.Error("Parameter must be a URL to the sound or an ArrayBuffer of the sound.");
<mask> }
<mask> }
<mask> }
<mask> }
<mask>
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove BABYLON.Tools.LoadFile(urlOrArrayBuffer,(data) => { this._soundLoaded(data); }, null, null, true);
</s> add Tools.LoadFile(urlOrArrayBuffer, (data) => { this._soundLoaded(data); }, null, null, true); </s> remove BABYLON.Tools.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle.");
</s> add Tools.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle."); </s> remove /**
* Toggle full screen mode.
* @param {boolean} requestPointerLock - should a pointer lock be requested from the user
*/
</s> add </s> remove Scene.prototype._getByTags = function (list, tagsQuery, forEach) {
</s> add Scene.prototype._getByTags = function (list, tagsQuery) {
</s> remove /**
* Add a mesh as LOD level triggered at the given distance.
* @param {number} distance - the distance from the center of the object to show this level
* @param {BABYLON.Mesh} mesh - the mesh to be added as LOD level
* @return {BABYLON.Mesh} this mesh (for chaining)
*/
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.ts |
this._audioEngine.audioContext.decodeAudioData(audioData, (buffer) => { | <mask> }
<mask>
<mask> private _soundLoaded(audioData: ArrayBuffer) {
<mask> this._isLoaded = true;
<mask> this._audioEngine.audioContext.decodeAudioData(audioData,(buffer) => {
<mask> this._audioBuffer = buffer;
<mask> this._isReadyToPlay = true;
<mask> if (this.autoplay) { this.play(); }
<mask> if (this._readyToPlayCallback) { this._readyToPlayCallback(); }
<mask> }, function (error) {
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove }, function (error) {
BABYLON.Tools.Error("Error while decoding audio data: " + error.err);
});
</s> add }, (error) => { Tools.Error("Error while decoding audio data: " + error.err); }); </s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add </s> remove BABYLON.Tools.LoadFile(urlOrArrayBuffer,(data) => { this._soundLoaded(data); }, null, null, true);
</s> add Tools.LoadFile(urlOrArrayBuffer, (data) => { this._soundLoaded(data); }, null, null, true); </s> remove if (this.refreshRate === this._currentRefreshId) {
</s> add if (this.refreshRate == this._currentRefreshId) { </s> remove private _onRegisterAfterWorldMatrixUpdate(connectedMesh: BABYLON.AbstractMesh) {
</s> add private _onRegisterAfterWorldMatrixUpdate(connectedMesh: AbstractMesh) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.ts |
}, (error) => { Tools.Error("Error while decoding audio data: " + error.err); }); | <mask> this._audioBuffer = buffer;
<mask> this._isReadyToPlay = true;
<mask> if (this.autoplay) { this.play(); }
<mask> if (this._readyToPlayCallback) { this._readyToPlayCallback(); }
<mask> }, function (error) {
<mask> BABYLON.Tools.Error("Error while decoding audio data: " + error.err);
<mask> });
<mask> }
<mask>
<mask> public updateOptions(options) {
<mask> if (options) {
<mask> this.loop = options.loop || this.loop;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this._audioEngine.audioContext.decodeAudioData(audioData,(buffer) => {
</s> add this._audioEngine.audioContext.decodeAudioData(audioData, (buffer) => { </s> remove this._startTime = startTime;
this._soundSource.start(startTime, this._startOffset % this._soundSource.buffer.duration);
</s> add this.startTime = startTime;
this._soundSource.start(startTime, this.startOffset % this._soundSource.buffer.duration); </s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add </s> remove BABYLON.Tools.Error("Error while trying to play audio: " + this.name + ", " + ex.message);
</s> add BABYLON.Tools.Error("Error while trying to play audio: " + this._name + ", " + ex.message); </s> remove BABYLON.Tools.Error("Error while trying to play audio: " + this.name + ", " + ex.message);
</s> add Tools.Error("Error while trying to play audio: " + this.name + ", " + ex.message); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.ts |
Tools.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle."); | <mask> * @param coneOuterGain Volume of the sound outside the outer cone (between 0.0 and 1.0)
<mask> */
<mask> public setDirectionalCone(coneInnerAngle: number, coneOuterAngle: number, coneOuterGain: number) {
<mask> if (coneOuterAngle < coneInnerAngle) {
<mask> BABYLON.Tools.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle.");
<mask> return;
<mask> }
<mask> this._coneInnerAngle = coneInnerAngle;
<mask> this._coneOuterAngle = coneOuterAngle;
<mask> this._coneOuterGain = coneOuterGain;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove BABYLON.Tools.Error("Parameter must be a URL to the sound or an ArrayBuffer of the sound.");
</s> add Tools.Error("Parameter must be a URL to the sound or an ArrayBuffer of the sound."); </s> remove private _scene: BABYLON.Scene;
private _connectedMesh: BABYLON.AbstractMesh;
</s> add private _scene: Scene;
private _connectedMesh: AbstractMesh; </s> remove // ================================== Point of View Movement =================================
/**
* Perform relative position change from the point of view of behind the front of the mesh.
* This is performed taking into account the meshes current rotation, so you do not have to care.
* Supports definition of mesh facing forward or backward.
* @param {number} amountRight
* @param {number} amountUp
* @param {number} amountForward
*/
AbstractMesh.prototype.movePOV = function (amountRight, amountUp, amountForward) {
this.position.addInPlace(this.calcMovePOV(amountRight, amountUp, amountForward));
};
/**
* Calculate relative position change from the point of view of behind the front of the mesh.
* This is performed taking into account the meshes current rotation, so you do not have to care.
* Supports definition of mesh facing forward or backward.
* @param {number} amountRight
* @param {number} amountUp
* @param {number} amountForward
*/
AbstractMesh.prototype.calcMovePOV = function (amountRight, amountUp, amountForward) {
var rotMatrix = new BABYLON.Matrix();
var rotQuaternion = (this.rotationQuaternion) ? this.rotationQuaternion : BABYLON.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z);
rotQuaternion.toRotationMatrix(rotMatrix);
var translationDelta = BABYLON.Vector3.Zero();
var defForwardMult = this.definedFacingForward ? -1 : 1;
BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(amountRight * defForwardMult, amountUp, amountForward * defForwardMult, rotMatrix, translationDelta);
return translationDelta;
};
// ================================== Point of View Rotation =================================
/**
* Perform relative rotation change from the point of view of behind the front of the mesh.
* Supports definition of mesh facing forward or backward.
* @param {number} flipBack
* @param {number} twirlClockwise
* @param {number} tiltRight
*/
AbstractMesh.prototype.rotatePOV = function (flipBack, twirlClockwise, tiltRight) {
this.rotation.addInPlace(this.calcRotatePOV(flipBack, twirlClockwise, tiltRight));
};
/**
* Calculate relative rotation change from the point of view of behind the front of the mesh.
* Supports definition of mesh facing forward or backward.
* @param {number} flipBack
* @param {number} twirlClockwise
* @param {number} tiltRight
*/
AbstractMesh.prototype.calcRotatePOV = function (flipBack, twirlClockwise, tiltRight) {
var defForwardMult = this.definedFacingForward ? 1 : -1;
return new BABYLON.Vector3(flipBack * defForwardMult, twirlClockwise, tiltRight * defForwardMult);
};
</s> add </s> remove /**
* stop executing a render loop function and remove it from the execution array
* @param {Function} [renderFunction] the function to be removed. If not provided all functions will be removed.
*/
</s> add </s> remove this.name = name;
</s> add this._name = name; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.ts |
var direction = Vector3.TransformNormal(this._localDirection, mat); | <mask> }
<mask>
<mask> private _updateDirection() {
<mask> var mat = this._connectedMesh.getWorldMatrix();
<mask> var direction = BABYLON.Vector3.TransformNormal(this._localDirection, mat);
<mask> direction.normalize();
<mask> this._soundPanner.setOrientation(direction.x, direction.y, direction.z);
<mask> }
<mask>
<mask> public updateDistanceFromListener() {
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove return this._webAudioAnalyser.frequencyBinCount;
</s> add if (this._audioEngine.canUseWebAudio) {
return this._webAudioAnalyser.frequencyBinCount;
}
else {
return 0;
} </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
} </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs);
} </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteTimeDomainData(this._byteTime);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteTimeDomainData(this._byteTime);
} </s> remove private _onRegisterAfterWorldMatrixUpdate(connectedMesh: BABYLON.AbstractMesh) {
</s> add private _onRegisterAfterWorldMatrixUpdate(connectedMesh: AbstractMesh) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.ts |
Tools.Error("Error while trying to play audio: " + this.name + ", " + ex.message); | <mask> this._soundSource.start(startTime, this._startOffset % this._soundSource.buffer.duration);
<mask> this._isPlaying = true;
<mask> }
<mask> catch (ex) {
<mask> BABYLON.Tools.Error("Error while trying to play audio: " + this.name + ", " + ex.message);
<mask> }
<mask> }
<mask> }
<mask>
<mask> /**
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove BABYLON.Tools.Error("Error while trying to play audio: " + this.name + ", " + ex.message);
</s> add BABYLON.Tools.Error("Error while trying to play audio: " + this._name + ", " + ex.message); </s> remove this._startTime = startTime;
this._soundSource.start(startTime, this._startOffset % this._soundSource.buffer.duration);
</s> add this.startTime = startTime;
this._soundSource.start(startTime, this.startOffset % this._soundSource.buffer.duration); </s> remove }, function (error) {
BABYLON.Tools.Error("Error while decoding audio data: " + error.err);
});
</s> add }, (error) => { Tools.Error("Error while decoding audio data: " + error.err); }); </s> remove var height = this.DEBUGCANVASSIZE.height * percent;
var offset = this.DEBUGCANVASSIZE.height - height - 1;
var barWidth = this.DEBUGCANVASSIZE.width / this.getFrequencyBinCount();
</s> add var height = this._debugCanvasHeight * percent;
var offset = this._debugCanvasHeight - height - 1;
var barWidth = this._debugCanvasWidth / this.getFrequencyBinCount(); </s> remove SoundTrack.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
while (this.soundCollection.length) {
this.soundCollection[0].dispose();
}
this._trackGain.disconnect();
this._trackGain = null;
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.ts |
public attachToMesh(meshToConnectTo: AbstractMesh) { | <mask> public getVolume(): number {
<mask> return this._volume;
<mask> }
<mask>
<mask> public attachToMesh(meshToConnectTo: BABYLON.AbstractMesh) {
<mask> this._connectedMesh = meshToConnectTo;
<mask> if (!this.spatialSound) {
<mask> this._createSpatialParameters();
<mask> this.spatialSound = true;
<mask> if (this._isPlaying && this.loop) {
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove return this._webAudioAnalyser.frequencyBinCount;
</s> add if (this._audioEngine.canUseWebAudio) {
return this._webAudioAnalyser.frequencyBinCount;
}
else {
return 0;
} </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
} </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs);
} </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteTimeDomainData(this._byteTime);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getByteTimeDomainData(this._byteTime);
} </s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.ts |
this._registerFunc = (connectedMesh: AbstractMesh) => this._onRegisterAfterWorldMatrixUpdate(connectedMesh); | <mask> this.stop();
<mask> this.play();
<mask> }
<mask> }
<mask> this._registerFunc = (connectedMesh: BABYLON.AbstractMesh) => this._onRegisterAfterWorldMatrixUpdate(connectedMesh);
<mask> meshToConnectTo.registerAfterWorldMatrixUpdate(this._registerFunc);
<mask> }
<mask>
<mask> private _onRegisterAfterWorldMatrixUpdate(connectedMesh: BABYLON.AbstractMesh) {
<mask> this.setPosition(connectedMesh.position);
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove private _onRegisterAfterWorldMatrixUpdate(connectedMesh: BABYLON.AbstractMesh) {
</s> add private _onRegisterAfterWorldMatrixUpdate(connectedMesh: AbstractMesh) { </s> remove this._registerFunc = function (connectedMesh) {
</s> add meshToConnectTo.registerAfterWorldMatrixUpdate(function (connectedMesh) { </s> remove };
meshToConnectTo.registerAfterWorldMatrixUpdate(this._registerFunc);
</s> add }); </s> remove this._audioEngine.audioContext.decodeAudioData(audioData,(buffer) => {
</s> add this._audioEngine.audioContext.decodeAudioData(audioData, (buffer) => { </s> remove public attachToMesh(meshToConnectTo: BABYLON.AbstractMesh) {
</s> add public attachToMesh(meshToConnectTo: AbstractMesh) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.ts |
private _onRegisterAfterWorldMatrixUpdate(connectedMesh: AbstractMesh) { | <mask> this._registerFunc = (connectedMesh: BABYLON.AbstractMesh) => this._onRegisterAfterWorldMatrixUpdate(connectedMesh);
<mask> meshToConnectTo.registerAfterWorldMatrixUpdate(this._registerFunc);
<mask> }
<mask>
<mask> private _onRegisterAfterWorldMatrixUpdate(connectedMesh: BABYLON.AbstractMesh) {
<mask> this.setPosition(connectedMesh.position);
<mask> if (this._isDirectional && this._isPlaying) {
<mask> this._updateDirection();
<mask> }
<mask> }
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this._registerFunc = (connectedMesh: BABYLON.AbstractMesh) => this._onRegisterAfterWorldMatrixUpdate(connectedMesh);
</s> add this._registerFunc = (connectedMesh: AbstractMesh) => this._onRegisterAfterWorldMatrixUpdate(connectedMesh); </s> remove };
meshToConnectTo.registerAfterWorldMatrixUpdate(this._registerFunc);
</s> add }); </s> remove public attachToMesh(meshToConnectTo: BABYLON.AbstractMesh) {
</s> add public attachToMesh(meshToConnectTo: AbstractMesh) { </s> remove this._audioEngine.audioContext.decodeAudioData(audioData,(buffer) => {
</s> add this._audioEngine.audioContext.decodeAudioData(audioData, (buffer) => { </s> remove this._registerFunc = function (connectedMesh) {
</s> add meshToConnectTo.registerAfterWorldMatrixUpdate(function (connectedMesh) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.sound.ts |
//this._trackConvolver = this._audioEngine.audioContext.createConvolver();
//this._trackConvolver.connect(this._trackGain); | <mask> this.soundCollection = new Array();
<mask> if (this._audioEngine.canUseWebAudio) {
<mask> this._trackGain = this._audioEngine.audioContext.createGain();
<mask> this._trackGain.connect(this._audioEngine.masterGain);
<mask>
<mask> if (options) {
<mask> if (options.volume) {
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove SoundTrack.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
while (this.soundCollection.length) {
this.soundCollection[0].dispose();
}
this._trackGain.disconnect();
this._trackGain = null;
}
};
</s> add </s> remove
SoundTrack.prototype.connectToAnalyser = function (analyser) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this._connectedAnalyser = analyser;
if (this._audioEngine.canUseWebAudio) {
this._trackGain.disconnect();
this._connectedAnalyser.connectAudioNodes(this._trackGain, this._audioEngine.masterGain);
}
};
</s> add </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
} </s> remove }, function (error) {
BABYLON.Tools.Error("Error while decoding audio data: " + error.err);
});
</s> add }, (error) => { Tools.Error("Error while decoding audio data: " + error.err); }); </s> remove Scene.prototype.enableDepthRenderer = function () {
if (this._depthRenderer) {
return this._depthRenderer;
}
this._depthRenderer = new BABYLON.DepthRenderer(this);
return this._depthRenderer;
};
Scene.prototype.disableDepthRenderer = function () {
if (!this._depthRenderer) {
return;
}
this._depthRenderer.dispose();
this._depthRenderer = null;
};
</s> add | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.soundtrack.js |
<mask> this._scene.soundTracks.push(this);
<mask> this.id = this._scene.soundTracks.length - 1;
<mask> }
<mask> }
<mask> SoundTrack.prototype.dispose = function () {
<mask> if (this._audioEngine.canUseWebAudio) {
<mask> if (this._connectedAnalyser) {
<mask> this._connectedAnalyser.stopDebugCanvas();
<mask> }
<mask> while (this.soundCollection.length) {
<mask> this.soundCollection[0].dispose();
<mask> }
<mask> this._trackGain.disconnect();
<mask> this._trackGain = null;
<mask> }
<mask> };
<mask>
<mask> SoundTrack.prototype.AddSound = function (sound) {
<mask> sound.connectToSoundTrackAudioNode(this._trackGain);
<mask> if (sound.soundTrackId) {
<mask> if (sound.soundTrackId === -1) {
<mask> this._scene.mainSoundTrack.RemoveSound(sound);
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove AudioEngine.prototype.dispose = function () {
if (this.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this.canUseWebAudio = false;
this.masterGain.disconnect();
this.masterGain = null;
this.audioContext = null;
}
};
</s> add </s> remove
SoundTrack.prototype.connectToAnalyser = function (analyser) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this._connectedAnalyser = analyser;
if (this._audioEngine.canUseWebAudio) {
this._trackGain.disconnect();
this._connectedAnalyser.connectAudioNodes(this._trackGain, this._audioEngine.masterGain);
}
};
</s> add </s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add </s> remove if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this._connectedAnalyser = analyser;
</s> add </s> remove Scene.prototype.getSoundByName = function (name) {
for (var index = 0; index < this.mainSoundTrack.soundCollection.length; index++) {
if (this.mainSoundTrack.soundCollection[index].name === name) {
return this.mainSoundTrack.soundCollection[index];
}
}
for (var sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) {
for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) {
if (this.soundTracks[sdIndex].soundCollection[index].name === name) {
return this.soundTracks[sdIndex].soundCollection[index];
}
}
}
return null;
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.soundtrack.js | |
<mask> if (this._audioEngine.canUseWebAudio) {
<mask> this._trackGain.gain.value = newVolume;
<mask> }
<mask> };
<mask>
<mask> SoundTrack.prototype.connectToAnalyser = function (analyser) {
<mask> if (this._connectedAnalyser) {
<mask> this._connectedAnalyser.stopDebugCanvas();
<mask> }
<mask> this._connectedAnalyser = analyser;
<mask> if (this._audioEngine.canUseWebAudio) {
<mask> this._trackGain.disconnect();
<mask> this._connectedAnalyser.connectAudioNodes(this._trackGain, this._audioEngine.masterGain);
<mask> }
<mask> };
<mask> return SoundTrack;
<mask> })();
<mask> BABYLON.SoundTrack = SoundTrack;
<mask> })(BABYLON || (BABYLON = {}));
<mask> //# sourceMappingURL=babylon.soundtrack.js.map
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this._connectedAnalyser = analyser;
</s> add </s> remove SoundTrack.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
while (this.soundCollection.length) {
this.soundCollection[0].dispose();
}
this._trackGain.disconnect();
this._trackGain = null;
}
};
</s> add </s> remove this._connectedAnalyser.connectAudioNodes(this.masterGain, this.audioContext.destination);
</s> add analyser.connectAudioNodes(this.masterGain, this.audioContext.destination); </s> remove AudioEngine.prototype.dispose = function () {
if (this.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this.canUseWebAudio = false;
this.masterGain.disconnect();
this.masterGain = null;
this.audioContext = null;
}
};
</s> add </s> remove this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
</s> add if (this._audioEngine.canUseWebAudio) {
this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;
this._webAudioAnalyser.fftSize = this.FFT_SIZE;
this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs);
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Audio/babylon.soundtrack.js | |
<mask> traverse(trigger.children[j], triggerParams, null, null);
<mask> }
<mask> };
<mask>
<mask> var parseSound = function (parsedSound, scene, rootUrl) {
<mask> var soundName = parsedSound.name;
<mask> var soundUrl = rootUrl + soundName;
<mask>
<mask> var options = {
<mask> autoplay: parsedSound.autoplay, loop: parsedSound.loop, volume: parsedSound.volume,
<mask> spatialSound: parsedSound.spatialSound, maxDistance: parsedSound.maxDistance,
<mask> rolloffFactor: parsedSound.rolloffFactor,
<mask> refDistance: parsedSound.refDistance,
<mask> distanceModel: parsedSound.distanceModel,
<mask> panningModel: parsedSound.panningModel
<mask> };
<mask>
<mask> var newSound = new BABYLON.Sound(soundName, soundUrl, scene, function () {
<mask> scene._removePendingData(newSound);
<mask> }, options);
<mask> scene._addPendingData(newSound);
<mask>
<mask> if (parsedSound.position) {
<mask> var soundPosition = BABYLON.Vector3.FromArray(parsedSound.position);
<mask> newSound.setPosition(soundPosition);
<mask> }
<mask> if (parsedSound.isDirectional) {
<mask> newSound.setDirectionalCone(parsedSound.coneInnerAngle || 360, parsedSound.coneOuterAngle || 360, parsedSound.coneOuterGain || 0);
<mask> if (parsedSound.localDirectionToMesh) {
<mask> var localDirectionToMesh = BABYLON.Vector3.FromArray(parsedSound.localDirectionToMesh);
<mask> newSound.setLocalDirectionToMesh(localDirectionToMesh);
<mask> }
<mask> }
<mask> if (parsedSound.connectedMeshId) {
<mask> var connectedMesh = scene.getMeshByID(parsedSound.connectedMeshId);
<mask> if (connectedMesh) {
<mask> newSound.attachToMesh(connectedMesh);
<mask> }
<mask> }
<mask> };
<mask>
<mask> var isDescendantOf = function (mesh, names, hierarchyIds) {
<mask> names = (names instanceof Array) ? names : [names];
<mask> for (var i in names) {
<mask> if (mesh.name === names[i]) {
<mask> hierarchyIds.push(mesh.id);
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove var newSound = new BABYLON.Sound(soundName, soundUrl, scene, function () {
scene._removePendingData(newSound);
}, options);
</s> add var newSound = new BABYLON.Sound(soundName, soundUrl, scene, () => { scene._removePendingData(newSound); }, options); </s> remove forEach = forEach || (function (item) {
return;
});
</s> add </s> remove var currentRenderList = this.renderList ? this.renderList : scene.getActiveMeshes().data;
for (var meshIndex = 0; meshIndex < currentRenderList.length; meshIndex++) {
var mesh = currentRenderList[meshIndex];
</s> add for (var meshIndex = 0; meshIndex < this.renderList.length; meshIndex++) {
var mesh = this.renderList[meshIndex]; </s> remove // Sounds
if (parsedData.sounds && scene.getEngine().getAudioEngine().canUseWebAudio) {
for (index = 0; index < parsedData.sounds.length; index++) {
var parsedSound = parsedData.sounds[index];
parseSound(parsedSound, scene, rootUrl);
}
}
</s> add </s> remove if (mesh.parent === this) {
</s> add if (mesh.parent == this) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Loading/Plugins/babylon.babylonFileLoader.js | |
<mask> parseShadowGenerator(parsedShadowGenerator, scene);
<mask> }
<mask> }
<mask>
<mask> // Sounds
<mask> if (parsedData.sounds && scene.getEngine().getAudioEngine().canUseWebAudio) {
<mask> for (index = 0; index < parsedData.sounds.length; index++) {
<mask> var parsedSound = parsedData.sounds[index];
<mask> parseSound(parsedSound, scene, rootUrl);
<mask> }
<mask> }
<mask>
<mask> // Actions (scene)
<mask> if (parsedData.actions) {
<mask> parseActions(parsedData.actions, null, scene);
<mask> }
<mask>
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove Scene.prototype.getSoundByName = function (name) {
for (var index = 0; index < this.mainSoundTrack.soundCollection.length; index++) {
if (this.mainSoundTrack.soundCollection[index].name === name) {
return this.mainSoundTrack.soundCollection[index];
}
}
for (var sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) {
for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) {
if (this.soundTracks[sdIndex].soundCollection[index].name === name) {
return this.soundTracks[sdIndex].soundCollection[index];
}
}
}
return null;
};
</s> add </s> remove if (mesh.parent === this) {
</s> add if (mesh.parent == this) { </s> remove // Release sounds & sounds tracks
this.mainSoundTrack.dispose();
for (var scIndex = 0; scIndex < this.soundTracks.length; scIndex++) {
this.soundTracks[scIndex].dispose();
}
</s> add </s> remove sound = this.soundTracks[i].soundCollection[j];
</s> add var sound = this.soundTracks[i].soundCollection[j];
</s> remove for (i = 0; i < this.soundTracks.length; i++) {
</s> add for (var i = 0; i < this.soundTracks.length; i++) {
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Loading/Plugins/babylon.babylonFileLoader.js | |
var newSound = new BABYLON.Sound(soundName, soundUrl, scene, () => { scene._removePendingData(newSound); }, options); | <mask> distanceModel: parsedSound.distanceModel,
<mask> panningModel: parsedSound.panningModel
<mask> };
<mask>
<mask> var newSound = new BABYLON.Sound(soundName, soundUrl, scene, function () {
<mask> scene._removePendingData(newSound);
<mask> }, options);
<mask> scene._addPendingData(newSound);
<mask>
<mask> if (parsedSound.position) {
<mask> var soundPosition = BABYLON.Vector3.FromArray(parsedSound.position);
<mask> newSound.setPosition(soundPosition);
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove var parseSound = function (parsedSound, scene, rootUrl) {
var soundName = parsedSound.name;
var soundUrl = rootUrl + soundName;
var options = {
autoplay: parsedSound.autoplay, loop: parsedSound.loop, volume: parsedSound.volume,
spatialSound: parsedSound.spatialSound, maxDistance: parsedSound.maxDistance,
rolloffFactor: parsedSound.rolloffFactor,
refDistance: parsedSound.refDistance,
distanceModel: parsedSound.distanceModel,
panningModel: parsedSound.panningModel
};
var newSound = new BABYLON.Sound(soundName, soundUrl, scene, function () {
scene._removePendingData(newSound);
}, options);
scene._addPendingData(newSound);
if (parsedSound.position) {
var soundPosition = BABYLON.Vector3.FromArray(parsedSound.position);
newSound.setPosition(soundPosition);
}
if (parsedSound.isDirectional) {
newSound.setDirectionalCone(parsedSound.coneInnerAngle || 360, parsedSound.coneOuterAngle || 360, parsedSound.coneOuterGain || 0);
if (parsedSound.localDirectionToMesh) {
var localDirectionToMesh = BABYLON.Vector3.FromArray(parsedSound.localDirectionToMesh);
newSound.setLocalDirectionToMesh(localDirectionToMesh);
}
}
if (parsedSound.connectedMeshId) {
var connectedMesh = scene.getMeshByID(parsedSound.connectedMeshId);
if (connectedMesh) {
newSound.attachToMesh(connectedMesh);
}
}
};
</s> add </s> remove Mesh.CreateGroundFromHeightMap = function (name, url, width, height, subdivisions, minHeight, maxHeight, scene, updatable, onReady) {
</s> add Mesh.CreateGroundFromHeightMap = function (name, url, width, height, subdivisions, minHeight, maxHeight, scene, updatable) {
</s> remove var newTexture = new RenderTargetTexture(this.name, textureSize.width, this.getScene(), this._generateMipMaps);
</s> add var newTexture = new BABYLON.RenderTargetTexture(this.name, textureSize.width, this.getScene(), this._generateMipMaps); </s> remove Scene.prototype.enableDepthRenderer = function () {
if (this._depthRenderer) {
return this._depthRenderer;
}
this._depthRenderer = new BABYLON.DepthRenderer(this);
return this._depthRenderer;
};
Scene.prototype.disableDepthRenderer = function () {
if (!this._depthRenderer) {
return;
}
this._depthRenderer.dispose();
this._depthRenderer = null;
};
</s> add </s> remove // Sounds
if (parsedData.sounds && scene.getEngine().getAudioEngine().canUseWebAudio) {
for (index = 0; index < parsedData.sounds.length; index++) {
var parsedSound = parsedData.sounds[index];
parseSound(parsedSound, scene, rootUrl);
}
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Loading/Plugins/babylon.babylonFileLoader.ts |
if (this.refreshRate == this._currentRefreshId) { | <mask> this._currentRefreshId = 1;
<mask> return true;
<mask> }
<mask>
<mask> if (this.refreshRate === this._currentRefreshId) {
<mask> this._currentRefreshId = 1;
<mask> return true;
<mask> }
<mask>
<mask> this._currentRefreshId++;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove Scene.prototype.getSoundByName = function (name) {
for (var index = 0; index < this.mainSoundTrack.soundCollection.length; index++) {
if (this.mainSoundTrack.soundCollection[index].name === name) {
return this.mainSoundTrack.soundCollection[index];
}
}
for (var sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) {
for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) {
if (this.soundTracks[sdIndex].soundCollection[index].name === name) {
return this.soundTracks[sdIndex].soundCollection[index];
}
}
}
return null;
};
</s> add </s> remove AudioEngine.prototype.dispose = function () {
if (this.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this.canUseWebAudio = false;
this.masterGain.disconnect();
this.masterGain = null;
this.audioContext = null;
}
};
</s> add </s> remove SoundTrack.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
while (this.soundCollection.length) {
this.soundCollection[0].dispose();
}
this._trackGain.disconnect();
this._trackGain = null;
}
};
</s> add </s> remove this._audioEngine.audioContext.decodeAudioData(audioData,(buffer) => {
</s> add this._audioEngine.audioContext.decodeAudioData(audioData, (buffer) => { </s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Materials/Textures/babylon.renderTargetTexture.js |
if (!this.renderList) { | <mask>
<mask> delete this._waitingRenderList;
<mask> }
<mask>
<mask> if (this.renderList && this.renderList.length === 0) {
<mask> return;
<mask> }
<mask>
<mask> // Bind
<mask> if (!useCameraPostProcess || !scene.postProcessManager._prepareFrame(this._texture)) {
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove // Depth renderer
if (this._depthRenderer) {
this._renderTargets.push(this._depthRenderer.getDepthMap());
}
</s> add </s> remove // Sounds
if (parsedData.sounds && scene.getEngine().getAudioEngine().canUseWebAudio) {
for (index = 0; index < parsedData.sounds.length; index++) {
var parsedSound = parsedData.sounds[index];
parseSound(parsedSound, scene, rootUrl);
}
}
</s> add </s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add </s> remove forEach = forEach || (function (item) {
return;
});
</s> add </s> remove var parseSound = function (parsedSound, scene, rootUrl) {
var soundName = parsedSound.name;
var soundUrl = rootUrl + soundName;
var options = {
autoplay: parsedSound.autoplay, loop: parsedSound.loop, volume: parsedSound.volume,
spatialSound: parsedSound.spatialSound, maxDistance: parsedSound.maxDistance,
rolloffFactor: parsedSound.rolloffFactor,
refDistance: parsedSound.refDistance,
distanceModel: parsedSound.distanceModel,
panningModel: parsedSound.panningModel
};
var newSound = new BABYLON.Sound(soundName, soundUrl, scene, function () {
scene._removePendingData(newSound);
}, options);
scene._addPendingData(newSound);
if (parsedSound.position) {
var soundPosition = BABYLON.Vector3.FromArray(parsedSound.position);
newSound.setPosition(soundPosition);
}
if (parsedSound.isDirectional) {
newSound.setDirectionalCone(parsedSound.coneInnerAngle || 360, parsedSound.coneOuterAngle || 360, parsedSound.coneOuterGain || 0);
if (parsedSound.localDirectionToMesh) {
var localDirectionToMesh = BABYLON.Vector3.FromArray(parsedSound.localDirectionToMesh);
newSound.setLocalDirectionToMesh(localDirectionToMesh);
}
}
if (parsedSound.connectedMeshId) {
var connectedMesh = scene.getMeshByID(parsedSound.connectedMeshId);
if (connectedMesh) {
newSound.attachToMesh(connectedMesh);
}
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Materials/Textures/babylon.renderTargetTexture.js |
for (var meshIndex = 0; meshIndex < this.renderList.length; meshIndex++) {
var mesh = this.renderList[meshIndex]; | <mask> engine.clear(scene.clearColor, true, true);
<mask>
<mask> this._renderingManager.reset();
<mask>
<mask> var currentRenderList = this.renderList ? this.renderList : scene.getActiveMeshes().data;
<mask>
<mask> for (var meshIndex = 0; meshIndex < currentRenderList.length; meshIndex++) {
<mask> var mesh = currentRenderList[meshIndex];
<mask>
<mask> if (mesh) {
<mask> if (!mesh.isReady() || (mesh.material && !mesh.material.isReady())) {
<mask> // Reset _currentRefreshId
<mask> this.resetRefreshCounter();
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove if (mesh.isEnabled() && mesh.isVisible && mesh.subMeshes && ((mesh.layerMask & scene.activeCamera.layerMask) !== 0)) {
</s> add if (mesh.isEnabled() && mesh.isVisible && mesh.subMeshes && ((mesh.layerMask & scene.activeCamera.layerMask) != 0)) { </s> remove /**
* Remove a mesh from the LOD array
* @param {BABYLON.Mesh} mesh - the mesh to be removed.
* @return {BABYLON.Mesh} this mesh (for chaining)
*/
</s> add </s> remove if (mesh.parent === this) {
</s> add if (mesh.parent == this) { </s> remove var parseSound = function (parsedSound, scene, rootUrl) {
var soundName = parsedSound.name;
var soundUrl = rootUrl + soundName;
var options = {
autoplay: parsedSound.autoplay, loop: parsedSound.loop, volume: parsedSound.volume,
spatialSound: parsedSound.spatialSound, maxDistance: parsedSound.maxDistance,
rolloffFactor: parsedSound.rolloffFactor,
refDistance: parsedSound.refDistance,
distanceModel: parsedSound.distanceModel,
panningModel: parsedSound.panningModel
};
var newSound = new BABYLON.Sound(soundName, soundUrl, scene, function () {
scene._removePendingData(newSound);
}, options);
scene._addPendingData(newSound);
if (parsedSound.position) {
var soundPosition = BABYLON.Vector3.FromArray(parsedSound.position);
newSound.setPosition(soundPosition);
}
if (parsedSound.isDirectional) {
newSound.setDirectionalCone(parsedSound.coneInnerAngle || 360, parsedSound.coneOuterAngle || 360, parsedSound.coneOuterGain || 0);
if (parsedSound.localDirectionToMesh) {
var localDirectionToMesh = BABYLON.Vector3.FromArray(parsedSound.localDirectionToMesh);
newSound.setLocalDirectionToMesh(localDirectionToMesh);
}
}
if (parsedSound.connectedMeshId) {
var connectedMesh = scene.getMeshByID(parsedSound.connectedMeshId);
if (connectedMesh) {
newSound.attachToMesh(connectedMesh);
}
}
};
</s> add </s> remove for (i = 0; i < this.soundTracks.length; i++) {
</s> add for (var i = 0; i < this.soundTracks.length; i++) {
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Materials/Textures/babylon.renderTargetTexture.js |
if (mesh.isEnabled() && mesh.isVisible && mesh.subMeshes && ((mesh.layerMask & scene.activeCamera.layerMask) != 0)) { | <mask> this.resetRefreshCounter();
<mask> continue;
<mask> }
<mask>
<mask> if (mesh.isEnabled() && mesh.isVisible && mesh.subMeshes && ((mesh.layerMask & scene.activeCamera.layerMask) !== 0)) {
<mask> mesh._activate(scene.getRenderId());
<mask>
<mask> for (var subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) {
<mask> var subMesh = mesh.subMeshes[subIndex];
<mask> scene._activeVertices += subMesh.indexCount;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove var currentRenderList = this.renderList ? this.renderList : scene.getActiveMeshes().data;
for (var meshIndex = 0; meshIndex < currentRenderList.length; meshIndex++) {
var mesh = currentRenderList[meshIndex];
</s> add for (var meshIndex = 0; meshIndex < this.renderList.length; meshIndex++) {
var mesh = this.renderList[meshIndex]; </s> remove // Sounds
if (parsedData.sounds && scene.getEngine().getAudioEngine().canUseWebAudio) {
for (index = 0; index < parsedData.sounds.length; index++) {
var parsedSound = parsedData.sounds[index];
parseSound(parsedSound, scene, rootUrl);
}
}
</s> add </s> remove // Release sounds & sounds tracks
this.mainSoundTrack.dispose();
for (var scIndex = 0; scIndex < this.soundTracks.length; scIndex++) {
this.soundTracks[scIndex].dispose();
}
</s> add </s> remove for (i = 0; i < this.soundTracks.length; i++) {
</s> add for (var i = 0; i < this.soundTracks.length; i++) {
</s> remove sound = this.soundTracks[i].soundCollection[j];
</s> add var sound = this.soundTracks[i].soundCollection[j];
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Materials/Textures/babylon.renderTargetTexture.js |
this._renderingManager.render(this.customRenderFunction, this.renderList, this.renderParticles, this.renderSprites); | <mask> this.onBeforeRender();
<mask> }
<mask>
<mask> // Render
<mask> this._renderingManager.render(this.customRenderFunction, currentRenderList, this.renderParticles, this.renderSprites);
<mask>
<mask> if (useCameraPostProcess) {
<mask> scene.postProcessManager._finalizeFrame(false, this._texture);
<mask> }
<mask>
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove // Depth renderer
if (this._depthRenderer) {
this._renderTargets.push(this._depthRenderer.getDepthMap());
}
</s> add </s> remove // Sounds
if (parsedData.sounds && scene.getEngine().getAudioEngine().canUseWebAudio) {
for (index = 0; index < parsedData.sounds.length; index++) {
var parsedSound = parsedData.sounds[index];
parseSound(parsedSound, scene, rootUrl);
}
}
</s> add </s> remove if (this.renderList && this.renderList.length === 0) {
</s> add if (!this.renderList) { </s> remove if (this._depthRenderer) {
this._depthRenderer.dispose();
}
</s> add </s> remove this._renderSprites(index);
</s> add if (renderSprites) {
this._renderSprites(index);
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Materials/Textures/babylon.renderTargetTexture.js |
var newTexture = new BABYLON.RenderTargetTexture(this.name, textureSize.width, this.getScene(), this._generateMipMaps); | <mask> };
<mask>
<mask> RenderTargetTexture.prototype.clone = function () {
<mask> var textureSize = this.getSize();
<mask> var newTexture = new RenderTargetTexture(this.name, textureSize.width, this.getScene(), this._generateMipMaps);
<mask>
<mask> // Base texture
<mask> newTexture.hasAlpha = this.hasAlpha;
<mask> newTexture.level = this.level;
<mask>
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove var newSound = new BABYLON.Sound(soundName, soundUrl, scene, function () {
scene._removePendingData(newSound);
}, options);
</s> add var newSound = new BABYLON.Sound(soundName, soundUrl, scene, () => { scene._removePendingData(newSound); }, options); </s> remove Scene.prototype.enableDepthRenderer = function () {
if (this._depthRenderer) {
return this._depthRenderer;
}
this._depthRenderer = new BABYLON.DepthRenderer(this);
return this._depthRenderer;
};
Scene.prototype.disableDepthRenderer = function () {
if (!this._depthRenderer) {
return;
}
this._depthRenderer.dispose();
this._depthRenderer = null;
};
</s> add </s> remove Mesh.prototype.applyDisplacementMap = function (url, minHeight, maxHeight, onSuccess) {
</s> add Mesh.prototype.applyDisplacementMap = function (url, minHeight, maxHeight) {
</s> remove this.definedFacingForward = true;
</s> add </s> remove var parseSound = function (parsedSound, scene, rootUrl) {
var soundName = parsedSound.name;
var soundUrl = rootUrl + soundName;
var options = {
autoplay: parsedSound.autoplay, loop: parsedSound.loop, volume: parsedSound.volume,
spatialSound: parsedSound.spatialSound, maxDistance: parsedSound.maxDistance,
rolloffFactor: parsedSound.rolloffFactor,
refDistance: parsedSound.refDistance,
distanceModel: parsedSound.distanceModel,
panningModel: parsedSound.panningModel
};
var newSound = new BABYLON.Sound(soundName, soundUrl, scene, function () {
scene._removePendingData(newSound);
}, options);
scene._addPendingData(newSound);
if (parsedSound.position) {
var soundPosition = BABYLON.Vector3.FromArray(parsedSound.position);
newSound.setPosition(soundPosition);
}
if (parsedSound.isDirectional) {
newSound.setDirectionalCone(parsedSound.coneInnerAngle || 360, parsedSound.coneOuterAngle || 360, parsedSound.coneOuterGain || 0);
if (parsedSound.localDirectionToMesh) {
var localDirectionToMesh = BABYLON.Vector3.FromArray(parsedSound.localDirectionToMesh);
newSound.setLocalDirectionToMesh(localDirectionToMesh);
}
}
if (parsedSound.connectedMeshId) {
var connectedMesh = scene.getMeshByID(parsedSound.connectedMeshId);
if (connectedMesh) {
newSound.attachToMesh(connectedMesh);
}
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Materials/Textures/babylon.renderTargetTexture.js |
<mask> d.prototype = new __();
<mask> };
<mask> var BABYLON;
<mask> (function (BABYLON) {
<mask> /**
<mask> * Creates an instance based on a source mesh.
<mask> */
<mask> var InstancedMesh = (function (_super) {
<mask> __extends(InstancedMesh, _super);
<mask> function InstancedMesh(name, source) {
<mask> _super.call(this, name, source.getScene());
<mask>
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this.definedFacingForward = true;
</s> add </s> remove * @constructor
</s> add </s> remove /**
* @constructor
* @param {HTMLCanvasElement} canvas - the canvas to be used for rendering
* @param {boolean} [antialias] - enable antialias
* @param options - further options to be sent to the getContext function
*/
</s> add </s> remove forEach = forEach || (function (item) {
return;
});
</s> add </s> remove /**
* The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio.
*/
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Mesh/babylon.InstancedMesh.js | |
if (mesh.parent == this) { | <mask> if (!doNotCloneChildren) {
<mask> for (var index = 0; index < this.getScene().meshes.length; index++) {
<mask> var mesh = this.getScene().meshes[index];
<mask>
<mask> if (mesh.parent === this) {
<mask> mesh.clone(mesh.name, result);
<mask> }
<mask> }
<mask> }
<mask>
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove Scene.prototype.getSoundByName = function (name) {
for (var index = 0; index < this.mainSoundTrack.soundCollection.length; index++) {
if (this.mainSoundTrack.soundCollection[index].name === name) {
return this.mainSoundTrack.soundCollection[index];
}
}
for (var sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) {
for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) {
if (this.soundTracks[sdIndex].soundCollection[index].name === name) {
return this.soundTracks[sdIndex].soundCollection[index];
}
}
}
return null;
};
</s> add </s> remove /**
* Remove a mesh from the LOD array
* @param {BABYLON.Mesh} mesh - the mesh to be removed.
* @return {BABYLON.Mesh} this mesh (for chaining)
*/
</s> add </s> remove // Sounds
if (parsedData.sounds && scene.getEngine().getAudioEngine().canUseWebAudio) {
for (index = 0; index < parsedData.sounds.length; index++) {
var parsedSound = parsedData.sounds[index];
parseSound(parsedSound, scene, rootUrl);
}
}
</s> add </s> remove // Release sounds & sounds tracks
this.mainSoundTrack.dispose();
for (var scIndex = 0; scIndex < this.soundTracks.length; scIndex++) {
this.soundTracks[scIndex].dispose();
}
</s> add </s> remove for (i = 0; i < this.soundTracks.length; i++) {
</s> add for (var i = 0; i < this.soundTracks.length; i++) {
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Mesh/babylon.InstancedMesh.js |
<mask> __extends(AbstractMesh, _super);
<mask> function AbstractMesh(name, scene) {
<mask> _super.call(this, name, scene);
<mask> // Properties
<mask> this.definedFacingForward = true;
<mask> this.position = new BABYLON.Vector3(0, 0, 0);
<mask> this.rotation = new BABYLON.Vector3(0, 0, 0);
<mask> this.scaling = new BABYLON.Vector3(1, 1, 1);
<mask> this.billboardMode = AbstractMesh.BILLBOARDMODE_NONE;
<mask> this.visibility = 1.0;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this._startTime = 0;
this._startOffset = 0;
</s> add this.startTime = 0;
this.startOffset = 0; </s> remove /**
* Creates an instance based on a source mesh.
*/
</s> add </s> remove var newTexture = new RenderTargetTexture(this.name, textureSize.width, this.getScene(), this._generateMipMaps);
</s> add var newTexture = new BABYLON.RenderTargetTexture(this.name, textureSize.width, this.getScene(), this._generateMipMaps); </s> remove this._debugCanvasContext.fillRect(0, 0, this.DEBUGCANVASSIZE.width, this.DEBUGCANVASSIZE.height);
</s> add this._debugCanvasContext.fillRect(0, 0, this._debugCanvasWidth, this._debugCanvasHeight); </s> remove Mesh.CreateGroundFromHeightMap = function (name, url, width, height, subdivisions, minHeight, maxHeight, scene, updatable, onReady) {
</s> add Mesh.CreateGroundFromHeightMap = function (name, url, width, height, subdivisions, minHeight, maxHeight, scene, updatable) {
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Mesh/babylon.abstractMesh.js | |
<mask> this.position.z = absolutePositionZ;
<mask> }
<mask> };
<mask>
<mask> // ================================== Point of View Movement =================================
<mask> /**
<mask> * Perform relative position change from the point of view of behind the front of the mesh.
<mask> * This is performed taking into account the meshes current rotation, so you do not have to care.
<mask> * Supports definition of mesh facing forward or backward.
<mask> * @param {number} amountRight
<mask> * @param {number} amountUp
<mask> * @param {number} amountForward
<mask> */
<mask> AbstractMesh.prototype.movePOV = function (amountRight, amountUp, amountForward) {
<mask> this.position.addInPlace(this.calcMovePOV(amountRight, amountUp, amountForward));
<mask> };
<mask>
<mask> /**
<mask> * Calculate relative position change from the point of view of behind the front of the mesh.
<mask> * This is performed taking into account the meshes current rotation, so you do not have to care.
<mask> * Supports definition of mesh facing forward or backward.
<mask> * @param {number} amountRight
<mask> * @param {number} amountUp
<mask> * @param {number} amountForward
<mask> */
<mask> AbstractMesh.prototype.calcMovePOV = function (amountRight, amountUp, amountForward) {
<mask> var rotMatrix = new BABYLON.Matrix();
<mask> var rotQuaternion = (this.rotationQuaternion) ? this.rotationQuaternion : BABYLON.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z);
<mask> rotQuaternion.toRotationMatrix(rotMatrix);
<mask>
<mask> var translationDelta = BABYLON.Vector3.Zero();
<mask> var defForwardMult = this.definedFacingForward ? -1 : 1;
<mask> BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(amountRight * defForwardMult, amountUp, amountForward * defForwardMult, rotMatrix, translationDelta);
<mask> return translationDelta;
<mask> };
<mask>
<mask> // ================================== Point of View Rotation =================================
<mask> /**
<mask> * Perform relative rotation change from the point of view of behind the front of the mesh.
<mask> * Supports definition of mesh facing forward or backward.
<mask> * @param {number} flipBack
<mask> * @param {number} twirlClockwise
<mask> * @param {number} tiltRight
<mask> */
<mask> AbstractMesh.prototype.rotatePOV = function (flipBack, twirlClockwise, tiltRight) {
<mask> this.rotation.addInPlace(this.calcRotatePOV(flipBack, twirlClockwise, tiltRight));
<mask> };
<mask>
<mask> /**
<mask> * Calculate relative rotation change from the point of view of behind the front of the mesh.
<mask> * Supports definition of mesh facing forward or backward.
<mask> * @param {number} flipBack
<mask> * @param {number} twirlClockwise
<mask> * @param {number} tiltRight
<mask> */
<mask> AbstractMesh.prototype.calcRotatePOV = function (flipBack, twirlClockwise, tiltRight) {
<mask> var defForwardMult = this.definedFacingForward ? 1 : -1;
<mask> return new BABYLON.Vector3(flipBack * defForwardMult, twirlClockwise, tiltRight * defForwardMult);
<mask> };
<mask>
<mask> AbstractMesh.prototype.setPivotMatrix = function (matrix) {
<mask> this._pivotMatrix = matrix;
<mask> this._cache.pivotMatrixUpdated = true;
<mask> };
<mask>
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove /**
* force a specific size of the canvas
* @param {number} width - the new canvas' width
* @param {number} height - the new canvas' height
*/
</s> add </s> remove /**
* Add a mesh as LOD level triggered at the given distance.
* @param {number} distance - the distance from the center of the object to show this level
* @param {BABYLON.Mesh} mesh - the mesh to be added as LOD level
* @return {BABYLON.Mesh} this mesh (for chaining)
*/
</s> add </s> remove /**
* Set the WebGL's viewport
* @param {BABYLON.Viewport} viewport - the viewport element to be used.
* @param {number} [requiredWidth] - the width required for rendering. If not provided the rendering canvas' width is used.
* @param {number} [requiredHeight] - the height required for rendering. If not provided the rendering canvas' height is used.
*/
</s> add </s> remove * @constructor
</s> add </s> remove BABYLON.Tools.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle.");
</s> add Tools.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle."); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Mesh/babylon.abstractMesh.js | |
<mask>
<mask> var Mesh = (function (_super) {
<mask> __extends(Mesh, _super);
<mask> /**
<mask> * @constructor
<mask> * @param {string} name - The value used by scene.getMeshByName() to do a lookup.
<mask> * @param {Scene} scene - The scene to add this mesh to.
<mask> * @param {Node} parent - The parent of this mesh, if it has one
<mask> * @param {Mesh} source - An optional Mesh from which geometry is shared, cloned.
<mask> * @param {boolean} doNotCloneChildren - When cloning, skip cloning child meshes of source, default False.
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove /**
* The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio.
*/
</s> add </s> remove /**
* @constructor
* @param {HTMLCanvasElement} canvas - the canvas to be used for rendering
* @param {boolean} [antialias] - enable antialias
* @param options - further options to be sent to the getContext function
*/
</s> add </s> remove /**
* Add a mesh as LOD level triggered at the given distance.
* @param {number} distance - the distance from the center of the object to show this level
* @param {BABYLON.Mesh} mesh - the mesh to be added as LOD level
* @return {BABYLON.Mesh} this mesh (for chaining)
*/
</s> add </s> remove // ================================== Point of View Movement =================================
/**
* Perform relative position change from the point of view of behind the front of the mesh.
* This is performed taking into account the meshes current rotation, so you do not have to care.
* Supports definition of mesh facing forward or backward.
* @param {number} amountRight
* @param {number} amountUp
* @param {number} amountForward
*/
AbstractMesh.prototype.movePOV = function (amountRight, amountUp, amountForward) {
this.position.addInPlace(this.calcMovePOV(amountRight, amountUp, amountForward));
};
/**
* Calculate relative position change from the point of view of behind the front of the mesh.
* This is performed taking into account the meshes current rotation, so you do not have to care.
* Supports definition of mesh facing forward or backward.
* @param {number} amountRight
* @param {number} amountUp
* @param {number} amountForward
*/
AbstractMesh.prototype.calcMovePOV = function (amountRight, amountUp, amountForward) {
var rotMatrix = new BABYLON.Matrix();
var rotQuaternion = (this.rotationQuaternion) ? this.rotationQuaternion : BABYLON.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z);
rotQuaternion.toRotationMatrix(rotMatrix);
var translationDelta = BABYLON.Vector3.Zero();
var defForwardMult = this.definedFacingForward ? -1 : 1;
BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(amountRight * defForwardMult, amountUp, amountForward * defForwardMult, rotMatrix, translationDelta);
return translationDelta;
};
// ================================== Point of View Rotation =================================
/**
* Perform relative rotation change from the point of view of behind the front of the mesh.
* Supports definition of mesh facing forward or backward.
* @param {number} flipBack
* @param {number} twirlClockwise
* @param {number} tiltRight
*/
AbstractMesh.prototype.rotatePOV = function (flipBack, twirlClockwise, tiltRight) {
this.rotation.addInPlace(this.calcRotatePOV(flipBack, twirlClockwise, tiltRight));
};
/**
* Calculate relative rotation change from the point of view of behind the front of the mesh.
* Supports definition of mesh facing forward or backward.
* @param {number} flipBack
* @param {number} twirlClockwise
* @param {number} tiltRight
*/
AbstractMesh.prototype.calcRotatePOV = function (flipBack, twirlClockwise, tiltRight) {
var defForwardMult = this.definedFacingForward ? 1 : -1;
return new BABYLON.Vector3(flipBack * defForwardMult, twirlClockwise, tiltRight * defForwardMult);
};
</s> add </s> remove /**
* Remove a mesh from the LOD array
* @param {BABYLON.Mesh} mesh - the mesh to be removed.
* @return {BABYLON.Mesh} this mesh (for chaining)
*/
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Mesh/babylon.mesh.js | |
Mesh.prototype._clone = function () {
};
| <mask> }
<mask> }
<mask> Object.defineProperty(Mesh.prototype, "hasLODLevels", {
<mask> // Methods
<mask> get: function () {
<mask> return this._LODLevels.length > 0;
<mask> },
<mask> enumerable: true,
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove // Depth renderer
if (this._depthRenderer) {
this._renderTargets.push(this._depthRenderer.getDepthMap());
}
</s> add </s> remove return this._webAudioAnalyser.frequencyBinCount;
</s> add if (this._audioEngine.canUseWebAudio) {
return this._webAudioAnalyser.frequencyBinCount;
}
else {
return 0;
} </s> remove BABYLON.Tools.LoadFile(urlOrArrayBuffer,(data) => { this._soundLoaded(data); }, null, null, true);
</s> add Tools.LoadFile(urlOrArrayBuffer, (data) => { this._soundLoaded(data); }, null, null, true); </s> remove Scene.prototype.getSoundByName = function (name) {
for (var index = 0; index < this.mainSoundTrack.soundCollection.length; index++) {
if (this.mainSoundTrack.soundCollection[index].name === name) {
return this.mainSoundTrack.soundCollection[index];
}
}
for (var sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) {
for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) {
if (this.soundTracks[sdIndex].soundCollection[index].name === name) {
return this.soundTracks[sdIndex].soundCollection[index];
}
}
}
return null;
};
</s> add </s> remove AudioEngine.prototype.dispose = function () {
if (this.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this.canUseWebAudio = false;
this.masterGain.disconnect();
this.masterGain = null;
this.audioContext = null;
}
};
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Mesh/babylon.mesh.js |
<mask> return 0;
<mask> });
<mask> };
<mask>
<mask> /**
<mask> * Add a mesh as LOD level triggered at the given distance.
<mask> * @param {number} distance - the distance from the center of the object to show this level
<mask> * @param {BABYLON.Mesh} mesh - the mesh to be added as LOD level
<mask> * @return {BABYLON.Mesh} this mesh (for chaining)
<mask> */
<mask> Mesh.prototype.addLODLevel = function (distance, mesh) {
<mask> if (mesh && mesh._masterMesh) {
<mask> BABYLON.Tools.Warn("You cannot use a mesh as LOD level twice");
<mask> return this;
<mask> }
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove /**
* Remove a mesh from the LOD array
* @param {BABYLON.Mesh} mesh - the mesh to be removed.
* @return {BABYLON.Mesh} this mesh (for chaining)
*/
</s> add </s> remove // ================================== Point of View Movement =================================
/**
* Perform relative position change from the point of view of behind the front of the mesh.
* This is performed taking into account the meshes current rotation, so you do not have to care.
* Supports definition of mesh facing forward or backward.
* @param {number} amountRight
* @param {number} amountUp
* @param {number} amountForward
*/
AbstractMesh.prototype.movePOV = function (amountRight, amountUp, amountForward) {
this.position.addInPlace(this.calcMovePOV(amountRight, amountUp, amountForward));
};
/**
* Calculate relative position change from the point of view of behind the front of the mesh.
* This is performed taking into account the meshes current rotation, so you do not have to care.
* Supports definition of mesh facing forward or backward.
* @param {number} amountRight
* @param {number} amountUp
* @param {number} amountForward
*/
AbstractMesh.prototype.calcMovePOV = function (amountRight, amountUp, amountForward) {
var rotMatrix = new BABYLON.Matrix();
var rotQuaternion = (this.rotationQuaternion) ? this.rotationQuaternion : BABYLON.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z);
rotQuaternion.toRotationMatrix(rotMatrix);
var translationDelta = BABYLON.Vector3.Zero();
var defForwardMult = this.definedFacingForward ? -1 : 1;
BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(amountRight * defForwardMult, amountUp, amountForward * defForwardMult, rotMatrix, translationDelta);
return translationDelta;
};
// ================================== Point of View Rotation =================================
/**
* Perform relative rotation change from the point of view of behind the front of the mesh.
* Supports definition of mesh facing forward or backward.
* @param {number} flipBack
* @param {number} twirlClockwise
* @param {number} tiltRight
*/
AbstractMesh.prototype.rotatePOV = function (flipBack, twirlClockwise, tiltRight) {
this.rotation.addInPlace(this.calcRotatePOV(flipBack, twirlClockwise, tiltRight));
};
/**
* Calculate relative rotation change from the point of view of behind the front of the mesh.
* Supports definition of mesh facing forward or backward.
* @param {number} flipBack
* @param {number} twirlClockwise
* @param {number} tiltRight
*/
AbstractMesh.prototype.calcRotatePOV = function (flipBack, twirlClockwise, tiltRight) {
var defForwardMult = this.definedFacingForward ? 1 : -1;
return new BABYLON.Vector3(flipBack * defForwardMult, twirlClockwise, tiltRight * defForwardMult);
};
</s> add </s> remove * @constructor
</s> add </s> remove /**
* @constructor
* @param {HTMLCanvasElement} canvas - the canvas to be used for rendering
* @param {boolean} [antialias] - enable antialias
* @param options - further options to be sent to the getContext function
*/
</s> add </s> remove /**
* The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio.
*/
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Mesh/babylon.mesh.js | |
<mask>
<mask> return this;
<mask> };
<mask>
<mask> /**
<mask> * Remove a mesh from the LOD array
<mask> * @param {BABYLON.Mesh} mesh - the mesh to be removed.
<mask> * @return {BABYLON.Mesh} this mesh (for chaining)
<mask> */
<mask> Mesh.prototype.removeLODLevel = function (mesh) {
<mask> for (var index = 0; index < this._LODLevels.length; index++) {
<mask> if (this._LODLevels[index].mesh === mesh) {
<mask> this._LODLevels.splice(index, 1);
<mask> if (mesh) {
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove /**
* Add a mesh as LOD level triggered at the given distance.
* @param {number} distance - the distance from the center of the object to show this level
* @param {BABYLON.Mesh} mesh - the mesh to be added as LOD level
* @return {BABYLON.Mesh} this mesh (for chaining)
*/
</s> add </s> remove if (mesh.parent === this) {
</s> add if (mesh.parent == this) { </s> remove var currentRenderList = this.renderList ? this.renderList : scene.getActiveMeshes().data;
for (var meshIndex = 0; meshIndex < currentRenderList.length; meshIndex++) {
var mesh = currentRenderList[meshIndex];
</s> add for (var meshIndex = 0; meshIndex < this.renderList.length; meshIndex++) {
var mesh = this.renderList[meshIndex]; </s> remove Scene.prototype.getSoundByName = function (name) {
for (var index = 0; index < this.mainSoundTrack.soundCollection.length; index++) {
if (this.mainSoundTrack.soundCollection[index].name === name) {
return this.mainSoundTrack.soundCollection[index];
}
}
for (var sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) {
for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) {
if (this.soundTracks[sdIndex].soundCollection[index].name === name) {
return this.soundTracks[sdIndex].soundCollection[index];
}
}
}
return null;
};
</s> add </s> remove /**
* stop executing a render loop function and remove it from the execution array
* @param {Function} [renderFunction] the function to be removed. If not provided all functions will be removed.
*/
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Mesh/babylon.mesh.js | |
Mesh.prototype.applyDisplacementMap = function (url, minHeight, maxHeight) {
| <mask> _super.prototype.dispose.call(this, doNotRecurse);
<mask> };
<mask>
<mask> // Geometric tools
<mask> Mesh.prototype.applyDisplacementMap = function (url, minHeight, maxHeight, onSuccess) {
<mask> var _this = this;
<mask> var scene = this.getScene();
<mask>
<mask> var onload = function (img) {
<mask> // Getting height map data
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove
//execute success callback, if set
if (onSuccess) {
onSuccess(_this);
}
</s> add </s> remove Mesh.CreateGroundFromHeightMap = function (name, url, width, height, subdivisions, minHeight, maxHeight, scene, updatable, onReady) {
</s> add Mesh.CreateGroundFromHeightMap = function (name, url, width, height, subdivisions, minHeight, maxHeight, scene, updatable) {
</s> remove this._debugCanvas.width = this.DEBUGCANVASSIZE.width;
this._debugCanvas.height = this.DEBUGCANVASSIZE.height;
</s> add this._debugCanvas.width = this._debugCanvasWidth;
this._debugCanvas.height = this._debugCanvasHeight; </s> remove var height = this.DEBUGCANVASSIZE.height * percent;
var offset = this.DEBUGCANVASSIZE.height - height - 1;
var barWidth = this.DEBUGCANVASSIZE.width / this.getFrequencyBinCount();
</s> add var height = this._debugCanvasHeight * percent;
var offset = this._debugCanvasHeight - height - 1;
var barWidth = this._debugCanvasWidth / this.getFrequencyBinCount(); </s> remove this._debugCanvasContext.fillRect(0, 0, this.DEBUGCANVASSIZE.width, this.DEBUGCANVASSIZE.height);
</s> add this._debugCanvasContext.fillRect(0, 0, this._debugCanvasWidth, this._debugCanvasHeight); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Mesh/babylon.mesh.js |
<mask> // Create VertexData from map data
<mask> var buffer = context.getImageData(0, 0, heightMapWidth, heightMapHeight).data;
<mask>
<mask> _this.applyDisplacementMapFromBuffer(buffer, heightMapWidth, heightMapHeight, minHeight, maxHeight);
<mask>
<mask> //execute success callback, if set
<mask> if (onSuccess) {
<mask> onSuccess(_this);
<mask> }
<mask> };
<mask>
<mask> BABYLON.Tools.LoadImage(url, onload, function () {
<mask> }, scene.database);
<mask> };
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove
//execute ready callback, if set
if (onReady) {
onReady(ground);
}
</s> add </s> remove Mesh.prototype.applyDisplacementMap = function (url, minHeight, maxHeight, onSuccess) {
</s> add Mesh.prototype.applyDisplacementMap = function (url, minHeight, maxHeight) {
</s> remove var newSound = new BABYLON.Sound(soundName, soundUrl, scene, function () {
scene._removePendingData(newSound);
}, options);
</s> add var newSound = new BABYLON.Sound(soundName, soundUrl, scene, () => { scene._removePendingData(newSound); }, options); </s> remove var parseSound = function (parsedSound, scene, rootUrl) {
var soundName = parsedSound.name;
var soundUrl = rootUrl + soundName;
var options = {
autoplay: parsedSound.autoplay, loop: parsedSound.loop, volume: parsedSound.volume,
spatialSound: parsedSound.spatialSound, maxDistance: parsedSound.maxDistance,
rolloffFactor: parsedSound.rolloffFactor,
refDistance: parsedSound.refDistance,
distanceModel: parsedSound.distanceModel,
panningModel: parsedSound.panningModel
};
var newSound = new BABYLON.Sound(soundName, soundUrl, scene, function () {
scene._removePendingData(newSound);
}, options);
scene._addPendingData(newSound);
if (parsedSound.position) {
var soundPosition = BABYLON.Vector3.FromArray(parsedSound.position);
newSound.setPosition(soundPosition);
}
if (parsedSound.isDirectional) {
newSound.setDirectionalCone(parsedSound.coneInnerAngle || 360, parsedSound.coneOuterAngle || 360, parsedSound.coneOuterGain || 0);
if (parsedSound.localDirectionToMesh) {
var localDirectionToMesh = BABYLON.Vector3.FromArray(parsedSound.localDirectionToMesh);
newSound.setLocalDirectionToMesh(localDirectionToMesh);
}
}
if (parsedSound.connectedMeshId) {
var connectedMesh = scene.getMeshByID(parsedSound.connectedMeshId);
if (connectedMesh) {
newSound.attachToMesh(connectedMesh);
}
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Mesh/babylon.mesh.js | |
Mesh.CreateGroundFromHeightMap = function (name, url, width, height, subdivisions, minHeight, maxHeight, scene, updatable) {
| <mask>
<mask> return tiledGround;
<mask> };
<mask>
<mask> Mesh.CreateGroundFromHeightMap = function (name, url, width, height, subdivisions, minHeight, maxHeight, scene, updatable, onReady) {
<mask> var ground = new BABYLON.GroundMesh(name, scene);
<mask> ground._subdivisions = subdivisions;
<mask>
<mask> ground._setReady(false);
<mask>
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove Mesh.prototype.applyDisplacementMap = function (url, minHeight, maxHeight, onSuccess) {
</s> add Mesh.prototype.applyDisplacementMap = function (url, minHeight, maxHeight) {
</s> remove var newSound = new BABYLON.Sound(soundName, soundUrl, scene, function () {
scene._removePendingData(newSound);
}, options);
</s> add var newSound = new BABYLON.Sound(soundName, soundUrl, scene, () => { scene._removePendingData(newSound); }, options); </s> remove // Sounds
if (parsedData.sounds && scene.getEngine().getAudioEngine().canUseWebAudio) {
for (index = 0; index < parsedData.sounds.length; index++) {
var parsedSound = parsedData.sounds[index];
parseSound(parsedSound, scene, rootUrl);
}
}
</s> add </s> remove this.definedFacingForward = true;
</s> add </s> remove var parseSound = function (parsedSound, scene, rootUrl) {
var soundName = parsedSound.name;
var soundUrl = rootUrl + soundName;
var options = {
autoplay: parsedSound.autoplay, loop: parsedSound.loop, volume: parsedSound.volume,
spatialSound: parsedSound.spatialSound, maxDistance: parsedSound.maxDistance,
rolloffFactor: parsedSound.rolloffFactor,
refDistance: parsedSound.refDistance,
distanceModel: parsedSound.distanceModel,
panningModel: parsedSound.panningModel
};
var newSound = new BABYLON.Sound(soundName, soundUrl, scene, function () {
scene._removePendingData(newSound);
}, options);
scene._addPendingData(newSound);
if (parsedSound.position) {
var soundPosition = BABYLON.Vector3.FromArray(parsedSound.position);
newSound.setPosition(soundPosition);
}
if (parsedSound.isDirectional) {
newSound.setDirectionalCone(parsedSound.coneInnerAngle || 360, parsedSound.coneOuterAngle || 360, parsedSound.coneOuterGain || 0);
if (parsedSound.localDirectionToMesh) {
var localDirectionToMesh = BABYLON.Vector3.FromArray(parsedSound.localDirectionToMesh);
newSound.setLocalDirectionToMesh(localDirectionToMesh);
}
}
if (parsedSound.connectedMeshId) {
var connectedMesh = scene.getMeshByID(parsedSound.connectedMeshId);
if (connectedMesh) {
newSound.attachToMesh(connectedMesh);
}
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Mesh/babylon.mesh.js |
<mask>
<mask> vertexData.applyToMesh(ground, updatable);
<mask>
<mask> ground._setReady(true);
<mask>
<mask> //execute ready callback, if set
<mask> if (onReady) {
<mask> onReady(ground);
<mask> }
<mask> };
<mask>
<mask> BABYLON.Tools.LoadImage(url, onload, function () {
<mask> }, scene.database);
<mask>
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove
//execute success callback, if set
if (onSuccess) {
onSuccess(_this);
}
</s> add </s> remove BABYLON.Tools.LoadFile(urlOrArrayBuffer,(data) => { this._soundLoaded(data); }, null, null, true);
</s> add Tools.LoadFile(urlOrArrayBuffer, (data) => { this._soundLoaded(data); }, null, null, true); </s> remove }, function (error) {
BABYLON.Tools.Error("Error while decoding audio data: " + error.err);
});
</s> add }, (error) => { Tools.Error("Error while decoding audio data: " + error.err); }); </s> remove this._audioEngine.audioContext.decodeAudioData(audioData,(buffer) => {
</s> add this._audioEngine.audioContext.decodeAudioData(audioData, (buffer) => { </s> remove AudioEngine.prototype.dispose = function () {
if (this.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this.canUseWebAudio = false;
this.masterGain.disconnect();
this.masterGain = null;
this.audioContext = null;
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Mesh/babylon.mesh.js | |
if (renderSprites) {
this._renderSprites(index);
} | <mask> if (!renderingGroup.render(customRenderFunction)) {
<mask> this._renderingGroups.splice(index, 1);
<mask> }
<mask> }
<mask> this._renderSprites(index);
<mask> if (renderParticles) {
<mask> this._renderParticles(index, activeMeshes);
<mask> }
<mask> }
<mask> };
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this._renderSprites(index);
</s> add if (renderSprites) {
this._renderSprites(index);
}
</s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add </s> remove SoundTrack.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
while (this.soundCollection.length) {
this.soundCollection[0].dispose();
}
this._trackGain.disconnect();
this._trackGain = null;
}
};
</s> add </s> remove AudioEngine.prototype.dispose = function () {
if (this.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this.canUseWebAudio = false;
this.masterGain.disconnect();
this.masterGain = null;
this.audioContext = null;
}
};
</s> add </s> remove // Depth renderer
if (this._depthRenderer) {
this._renderTargets.push(this._depthRenderer.getDepthMap());
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Rendering/babylon.renderingManager.js |
if (renderSprites) {
this._renderSprites(index);
}
| <mask> if (!renderingGroup.render(customRenderFunction)) {
<mask> this._renderingGroups.splice(index, 1);
<mask> }
<mask> }
<mask> this._renderSprites(index);
<mask> if (renderParticles) {
<mask> this._renderParticles(index, activeMeshes);
<mask> }
<mask> }
<mask> }
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove this._renderSprites(index);
</s> add if (renderSprites) {
this._renderSprites(index);
} </s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add </s> remove SoundTrack.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
while (this.soundCollection.length) {
this.soundCollection[0].dispose();
}
this._trackGain.disconnect();
this._trackGain = null;
}
};
</s> add </s> remove // Depth renderer
if (this._depthRenderer) {
this._renderTargets.push(this._depthRenderer.getDepthMap());
}
</s> add </s> remove AudioEngine.prototype.dispose = function () {
if (this.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this.canUseWebAudio = false;
this.masterGain.disconnect();
this.masterGain = null;
this.audioContext = null;
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/Rendering/babylon.renderingManager.ts |
<mask> return EngineCapabilities;
<mask> })();
<mask> BABYLON.EngineCapabilities = EngineCapabilities;
<mask>
<mask> /**
<mask> * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio.
<mask> */
<mask> var Engine = (function () {
<mask> /**
<mask> * @constructor
<mask> * @param {HTMLCanvasElement} canvas - the canvas to be used for rendering
<mask> * @param {boolean} [antialias] - enable antialias
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove /**
* @constructor
* @param {HTMLCanvasElement} canvas - the canvas to be used for rendering
* @param {boolean} [antialias] - enable antialias
* @param options - further options to be sent to the getContext function
*/
</s> add </s> remove * @constructor
</s> add </s> remove /**
* Set the WebGL's viewport
* @param {BABYLON.Viewport} viewport - the viewport element to be used.
* @param {number} [requiredWidth] - the width required for rendering. If not provided the rendering canvas' width is used.
* @param {number} [requiredHeight] - the height required for rendering. If not provided the rendering canvas' height is used.
*/
</s> add </s> remove /**
* Register and execute a render loop. The engine can have more than one render function.
* @param {Function} renderFunction - the function to continuesly execute starting the next render loop.
* @example
* engine.runRenderLoop(function () {
* scene.render()
* })
*/
</s> add </s> remove /**
* force a specific size of the canvas
* @param {number} width - the new canvas' width
* @param {number} height - the new canvas' height
*/
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/babylon.engine.js | |
<mask> /**
<mask> * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio.
<mask> */
<mask> var Engine = (function () {
<mask> /**
<mask> * @constructor
<mask> * @param {HTMLCanvasElement} canvas - the canvas to be used for rendering
<mask> * @param {boolean} [antialias] - enable antialias
<mask> * @param options - further options to be sent to the getContext function
<mask> */
<mask> function Engine(canvas, antialias, options) {
<mask> var _this = this;
<mask> // Public members
<mask> this.isFullscreen = false;
<mask> this.isPointerLock = false;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove /**
* The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio.
*/
</s> add </s> remove /**
* Register and execute a render loop. The engine can have more than one render function.
* @param {Function} renderFunction - the function to continuesly execute starting the next render loop.
* @example
* engine.runRenderLoop(function () {
* scene.render()
* })
*/
</s> add </s> remove /**
* Set the WebGL's viewport
* @param {BABYLON.Viewport} viewport - the viewport element to be used.
* @param {number} [requiredWidth] - the width required for rendering. If not provided the rendering canvas' width is used.
* @param {number} [requiredHeight] - the height required for rendering. If not provided the rendering canvas' height is used.
*/
</s> add </s> remove * @constructor
</s> add </s> remove /**
* Add a mesh as LOD level triggered at the given distance.
* @param {number} distance - the distance from the center of the object to show this level
* @param {BABYLON.Mesh} mesh - the mesh to be added as LOD level
* @return {BABYLON.Mesh} this mesh (for chaining)
*/
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/babylon.engine.js | |
<mask> Engine.prototype.setDepthFunctionToLessOrEqual = function () {
<mask> this._depthCullingState.depthFunc = this._gl.LEQUAL;
<mask> };
<mask>
<mask> /**
<mask> * stop executing a render loop function and remove it from the execution array
<mask> * @param {Function} [renderFunction] the function to be removed. If not provided all functions will be removed.
<mask> */
<mask> Engine.prototype.stopRenderLoop = function (renderFunction) {
<mask> if (!renderFunction) {
<mask> this._activeRenderLoops = [];
<mask> return;
<mask> }
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove /**
* Register and execute a render loop. The engine can have more than one render function.
* @param {Function} renderFunction - the function to continuesly execute starting the next render loop.
* @example
* engine.runRenderLoop(function () {
* scene.render()
* })
*/
</s> add </s> remove /**
* Remove a mesh from the LOD array
* @param {BABYLON.Mesh} mesh - the mesh to be removed.
* @return {BABYLON.Mesh} this mesh (for chaining)
*/
</s> add </s> remove /**
* Set the WebGL's viewport
* @param {BABYLON.Viewport} viewport - the viewport element to be used.
* @param {number} [requiredWidth] - the width required for rendering. If not provided the rendering canvas' width is used.
* @param {number} [requiredHeight] - the height required for rendering. If not provided the rendering canvas' height is used.
*/
</s> add </s> remove /**
* @constructor
* @param {HTMLCanvasElement} canvas - the canvas to be used for rendering
* @param {boolean} [antialias] - enable antialias
* @param options - further options to be sent to the getContext function
*/
</s> add </s> remove /**
* Toggle full screen mode.
* @param {boolean} requestPointerLock - should a pointer lock be requested from the user
*/
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/babylon.engine.js | |
<mask> this._renderingQueueLaunched = false;
<mask> }
<mask> };
<mask>
<mask> /**
<mask> * Register and execute a render loop. The engine can have more than one render function.
<mask> * @param {Function} renderFunction - the function to continuesly execute starting the next render loop.
<mask> * @example
<mask> * engine.runRenderLoop(function () {
<mask> * scene.render()
<mask> * })
<mask> */
<mask> Engine.prototype.runRenderLoop = function (renderFunction) {
<mask> var _this = this;
<mask> if (this._activeRenderLoops.indexOf(renderFunction) !== -1) {
<mask> return;
<mask> }
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove /**
* stop executing a render loop function and remove it from the execution array
* @param {Function} [renderFunction] the function to be removed. If not provided all functions will be removed.
*/
</s> add </s> remove /**
* @constructor
* @param {HTMLCanvasElement} canvas - the canvas to be used for rendering
* @param {boolean} [antialias] - enable antialias
* @param options - further options to be sent to the getContext function
*/
</s> add </s> remove /**
* The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio.
*/
</s> add </s> remove /**
* resize the view according to the canvas' size.
* @example
* window.addEventListener("resize", function () {
* engine.resize();
* });
*/
</s> add </s> remove /**
* Remove a mesh from the LOD array
* @param {BABYLON.Mesh} mesh - the mesh to be removed.
* @return {BABYLON.Mesh} this mesh (for chaining)
*/
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/babylon.engine.js | |
<mask> });
<mask> }
<mask> };
<mask>
<mask> /**
<mask> * Toggle full screen mode.
<mask> * @param {boolean} requestPointerLock - should a pointer lock be requested from the user
<mask> */
<mask> Engine.prototype.switchFullscreen = function (requestPointerLock) {
<mask> if (this.isFullscreen) {
<mask> BABYLON.Tools.ExitFullscreen();
<mask> } else {
<mask> this._pointerLockRequested = requestPointerLock;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove /**
* Add a mesh as LOD level triggered at the given distance.
* @param {number} distance - the distance from the center of the object to show this level
* @param {BABYLON.Mesh} mesh - the mesh to be added as LOD level
* @return {BABYLON.Mesh} this mesh (for chaining)
*/
</s> add </s> remove /**
* stop executing a render loop function and remove it from the execution array
* @param {Function} [renderFunction] the function to be removed. If not provided all functions will be removed.
*/
</s> add </s> remove /**
* Remove a mesh from the LOD array
* @param {BABYLON.Mesh} mesh - the mesh to be removed.
* @return {BABYLON.Mesh} this mesh (for chaining)
*/
</s> add </s> remove /**
* @constructor
* @param {HTMLCanvasElement} canvas - the canvas to be used for rendering
* @param {boolean} [antialias] - enable antialias
* @param options - further options to be sent to the getContext function
*/
</s> add </s> remove /**
* Register and execute a render loop. The engine can have more than one render function.
* @param {Function} renderFunction - the function to continuesly execute starting the next render loop.
* @example
* engine.runRenderLoop(function () {
* scene.render()
* })
*/
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/babylon.engine.js | |
<mask>
<mask> this._gl.clear(mode);
<mask> };
<mask>
<mask> /**
<mask> * Set the WebGL's viewport
<mask> * @param {BABYLON.Viewport} viewport - the viewport element to be used.
<mask> * @param {number} [requiredWidth] - the width required for rendering. If not provided the rendering canvas' width is used.
<mask> * @param {number} [requiredHeight] - the height required for rendering. If not provided the rendering canvas' height is used.
<mask> */
<mask> Engine.prototype.setViewport = function (viewport, requiredWidth, requiredHeight) {
<mask> var width = requiredWidth || this._renderingCanvas.width;
<mask> var height = requiredHeight || this._renderingCanvas.height;
<mask> var x = viewport.x || 0;
<mask> var y = viewport.y || 0;
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove /**
* force a specific size of the canvas
* @param {number} width - the new canvas' width
* @param {number} height - the new canvas' height
*/
</s> add </s> remove /**
* @constructor
* @param {HTMLCanvasElement} canvas - the canvas to be used for rendering
* @param {boolean} [antialias] - enable antialias
* @param options - further options to be sent to the getContext function
*/
</s> add </s> remove /**
* The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio.
*/
</s> add </s> remove // ================================== Point of View Movement =================================
/**
* Perform relative position change from the point of view of behind the front of the mesh.
* This is performed taking into account the meshes current rotation, so you do not have to care.
* Supports definition of mesh facing forward or backward.
* @param {number} amountRight
* @param {number} amountUp
* @param {number} amountForward
*/
AbstractMesh.prototype.movePOV = function (amountRight, amountUp, amountForward) {
this.position.addInPlace(this.calcMovePOV(amountRight, amountUp, amountForward));
};
/**
* Calculate relative position change from the point of view of behind the front of the mesh.
* This is performed taking into account the meshes current rotation, so you do not have to care.
* Supports definition of mesh facing forward or backward.
* @param {number} amountRight
* @param {number} amountUp
* @param {number} amountForward
*/
AbstractMesh.prototype.calcMovePOV = function (amountRight, amountUp, amountForward) {
var rotMatrix = new BABYLON.Matrix();
var rotQuaternion = (this.rotationQuaternion) ? this.rotationQuaternion : BABYLON.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z);
rotQuaternion.toRotationMatrix(rotMatrix);
var translationDelta = BABYLON.Vector3.Zero();
var defForwardMult = this.definedFacingForward ? -1 : 1;
BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(amountRight * defForwardMult, amountUp, amountForward * defForwardMult, rotMatrix, translationDelta);
return translationDelta;
};
// ================================== Point of View Rotation =================================
/**
* Perform relative rotation change from the point of view of behind the front of the mesh.
* Supports definition of mesh facing forward or backward.
* @param {number} flipBack
* @param {number} twirlClockwise
* @param {number} tiltRight
*/
AbstractMesh.prototype.rotatePOV = function (flipBack, twirlClockwise, tiltRight) {
this.rotation.addInPlace(this.calcRotatePOV(flipBack, twirlClockwise, tiltRight));
};
/**
* Calculate relative rotation change from the point of view of behind the front of the mesh.
* Supports definition of mesh facing forward or backward.
* @param {number} flipBack
* @param {number} twirlClockwise
* @param {number} tiltRight
*/
AbstractMesh.prototype.calcRotatePOV = function (flipBack, twirlClockwise, tiltRight) {
var defForwardMult = this.definedFacingForward ? 1 : -1;
return new BABYLON.Vector3(flipBack * defForwardMult, twirlClockwise, tiltRight * defForwardMult);
};
</s> add </s> remove /**
* stop executing a render loop function and remove it from the execution array
* @param {Function} [renderFunction] the function to be removed. If not provided all functions will be removed.
*/
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/babylon.engine.js | |
<mask> Engine.prototype.endFrame = function () {
<mask> this.flushFramebuffer();
<mask> };
<mask>
<mask> /**
<mask> * resize the view according to the canvas' size.
<mask> * @example
<mask> * window.addEventListener("resize", function () {
<mask> * engine.resize();
<mask> * });
<mask> */
<mask> Engine.prototype.resize = function () {
<mask> this.setSize(this._renderingCanvas.clientWidth / this._hardwareScalingLevel, this._renderingCanvas.clientHeight / this._hardwareScalingLevel);
<mask> };
<mask>
<mask> /**
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove /**
* force a specific size of the canvas
* @param {number} width - the new canvas' width
* @param {number} height - the new canvas' height
*/
</s> add </s> remove /**
* Register and execute a render loop. The engine can have more than one render function.
* @param {Function} renderFunction - the function to continuesly execute starting the next render loop.
* @example
* engine.runRenderLoop(function () {
* scene.render()
* })
*/
</s> add </s> remove /**
* @constructor
* @param {HTMLCanvasElement} canvas - the canvas to be used for rendering
* @param {boolean} [antialias] - enable antialias
* @param options - further options to be sent to the getContext function
*/
</s> add </s> remove // ================================== Point of View Movement =================================
/**
* Perform relative position change from the point of view of behind the front of the mesh.
* This is performed taking into account the meshes current rotation, so you do not have to care.
* Supports definition of mesh facing forward or backward.
* @param {number} amountRight
* @param {number} amountUp
* @param {number} amountForward
*/
AbstractMesh.prototype.movePOV = function (amountRight, amountUp, amountForward) {
this.position.addInPlace(this.calcMovePOV(amountRight, amountUp, amountForward));
};
/**
* Calculate relative position change from the point of view of behind the front of the mesh.
* This is performed taking into account the meshes current rotation, so you do not have to care.
* Supports definition of mesh facing forward or backward.
* @param {number} amountRight
* @param {number} amountUp
* @param {number} amountForward
*/
AbstractMesh.prototype.calcMovePOV = function (amountRight, amountUp, amountForward) {
var rotMatrix = new BABYLON.Matrix();
var rotQuaternion = (this.rotationQuaternion) ? this.rotationQuaternion : BABYLON.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z);
rotQuaternion.toRotationMatrix(rotMatrix);
var translationDelta = BABYLON.Vector3.Zero();
var defForwardMult = this.definedFacingForward ? -1 : 1;
BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(amountRight * defForwardMult, amountUp, amountForward * defForwardMult, rotMatrix, translationDelta);
return translationDelta;
};
// ================================== Point of View Rotation =================================
/**
* Perform relative rotation change from the point of view of behind the front of the mesh.
* Supports definition of mesh facing forward or backward.
* @param {number} flipBack
* @param {number} twirlClockwise
* @param {number} tiltRight
*/
AbstractMesh.prototype.rotatePOV = function (flipBack, twirlClockwise, tiltRight) {
this.rotation.addInPlace(this.calcRotatePOV(flipBack, twirlClockwise, tiltRight));
};
/**
* Calculate relative rotation change from the point of view of behind the front of the mesh.
* Supports definition of mesh facing forward or backward.
* @param {number} flipBack
* @param {number} twirlClockwise
* @param {number} tiltRight
*/
AbstractMesh.prototype.calcRotatePOV = function (flipBack, twirlClockwise, tiltRight) {
var defForwardMult = this.definedFacingForward ? 1 : -1;
return new BABYLON.Vector3(flipBack * defForwardMult, twirlClockwise, tiltRight * defForwardMult);
};
</s> add </s> remove /**
* The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio.
*/
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/babylon.engine.js | |
<mask> Engine.prototype.resize = function () {
<mask> this.setSize(this._renderingCanvas.clientWidth / this._hardwareScalingLevel, this._renderingCanvas.clientHeight / this._hardwareScalingLevel);
<mask> };
<mask>
<mask> /**
<mask> * force a specific size of the canvas
<mask> * @param {number} width - the new canvas' width
<mask> * @param {number} height - the new canvas' height
<mask> */
<mask> Engine.prototype.setSize = function (width, height) {
<mask> this._renderingCanvas.width = width;
<mask> this._renderingCanvas.height = height;
<mask>
<mask> this._canvasClientRect = this._renderingCanvas.getBoundingClientRect();
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove /**
* Set the WebGL's viewport
* @param {BABYLON.Viewport} viewport - the viewport element to be used.
* @param {number} [requiredWidth] - the width required for rendering. If not provided the rendering canvas' width is used.
* @param {number} [requiredHeight] - the height required for rendering. If not provided the rendering canvas' height is used.
*/
</s> add </s> remove /**
* resize the view according to the canvas' size.
* @example
* window.addEventListener("resize", function () {
* engine.resize();
* });
*/
</s> add </s> remove // ================================== Point of View Movement =================================
/**
* Perform relative position change from the point of view of behind the front of the mesh.
* This is performed taking into account the meshes current rotation, so you do not have to care.
* Supports definition of mesh facing forward or backward.
* @param {number} amountRight
* @param {number} amountUp
* @param {number} amountForward
*/
AbstractMesh.prototype.movePOV = function (amountRight, amountUp, amountForward) {
this.position.addInPlace(this.calcMovePOV(amountRight, amountUp, amountForward));
};
/**
* Calculate relative position change from the point of view of behind the front of the mesh.
* This is performed taking into account the meshes current rotation, so you do not have to care.
* Supports definition of mesh facing forward or backward.
* @param {number} amountRight
* @param {number} amountUp
* @param {number} amountForward
*/
AbstractMesh.prototype.calcMovePOV = function (amountRight, amountUp, amountForward) {
var rotMatrix = new BABYLON.Matrix();
var rotQuaternion = (this.rotationQuaternion) ? this.rotationQuaternion : BABYLON.Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z);
rotQuaternion.toRotationMatrix(rotMatrix);
var translationDelta = BABYLON.Vector3.Zero();
var defForwardMult = this.definedFacingForward ? -1 : 1;
BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(amountRight * defForwardMult, amountUp, amountForward * defForwardMult, rotMatrix, translationDelta);
return translationDelta;
};
// ================================== Point of View Rotation =================================
/**
* Perform relative rotation change from the point of view of behind the front of the mesh.
* Supports definition of mesh facing forward or backward.
* @param {number} flipBack
* @param {number} twirlClockwise
* @param {number} tiltRight
*/
AbstractMesh.prototype.rotatePOV = function (flipBack, twirlClockwise, tiltRight) {
this.rotation.addInPlace(this.calcRotatePOV(flipBack, twirlClockwise, tiltRight));
};
/**
* Calculate relative rotation change from the point of view of behind the front of the mesh.
* Supports definition of mesh facing forward or backward.
* @param {number} flipBack
* @param {number} twirlClockwise
* @param {number} tiltRight
*/
AbstractMesh.prototype.calcRotatePOV = function (flipBack, twirlClockwise, tiltRight) {
var defForwardMult = this.definedFacingForward ? 1 : -1;
return new BABYLON.Vector3(flipBack * defForwardMult, twirlClockwise, tiltRight * defForwardMult);
};
</s> add </s> remove var height = this.DEBUGCANVASSIZE.height * percent;
var offset = this.DEBUGCANVASSIZE.height - height - 1;
var barWidth = this.DEBUGCANVASSIZE.width / this.getFrequencyBinCount();
</s> add var height = this._debugCanvasHeight * percent;
var offset = this._debugCanvasHeight - height - 1;
var barWidth = this._debugCanvasWidth / this.getFrequencyBinCount(); </s> remove /**
* @constructor
* @param {HTMLCanvasElement} canvas - the canvas to be used for rendering
* @param {boolean} [antialias] - enable antialias
* @param options - further options to be sent to the getContext function
*/
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/babylon.engine.js | |
<mask> while (this.scenes.length) {
<mask> this.scenes[0].dispose();
<mask> }
<mask>
<mask> // Release audio engine
<mask> this._audioEngine.dispose();
<mask>
<mask> for (var name in this._compiledEffects) {
<mask> this._gl.deleteProgram(this._compiledEffects[name]._program);
<mask> }
<mask>
<mask> for (var i in this._vertexAttribArrays) {
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove forEach(item);
</s> add </s> remove forEach = forEach || (function (item) {
return;
});
</s> add </s> remove for (i = 0; i < this.soundTracks.length; i++) {
</s> add for (var i = 0; i < this.soundTracks.length; i++) {
</s> remove sound = this.soundTracks[i].soundCollection[j];
</s> add var sound = this.soundTracks[i].soundCollection[j];
</s> remove // Release sounds & sounds tracks
this.mainSoundTrack.dispose();
for (var scIndex = 0; scIndex < this.soundTracks.length; scIndex++) {
this.soundTracks[scIndex].dispose();
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/babylon.engine.js | |
<mask>
<mask> return null;
<mask> };
<mask>
<mask> Scene.prototype.getSoundByName = function (name) {
<mask> for (var index = 0; index < this.mainSoundTrack.soundCollection.length; index++) {
<mask> if (this.mainSoundTrack.soundCollection[index].name === name) {
<mask> return this.mainSoundTrack.soundCollection[index];
<mask> }
<mask> }
<mask>
<mask> for (var sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) {
<mask> for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) {
<mask> if (this.soundTracks[sdIndex].soundCollection[index].name === name) {
<mask> return this.soundTracks[sdIndex].soundCollection[index];
<mask> }
<mask> }
<mask> }
<mask>
<mask> return null;
<mask> };
<mask>
<mask> Scene.prototype.getLastSkeletonByID = function (id) {
<mask> for (var index = this.skeletons.length - 1; index >= 0; index--) {
<mask> if (this.skeletons[index].id === id) {
<mask> return this.skeletons[index];
<mask> }
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove if (mesh.parent === this) {
</s> add if (mesh.parent == this) { </s> remove // Release sounds & sounds tracks
this.mainSoundTrack.dispose();
for (var scIndex = 0; scIndex < this.soundTracks.length; scIndex++) {
this.soundTracks[scIndex].dispose();
}
</s> add </s> remove /**
* Remove a mesh from the LOD array
* @param {BABYLON.Mesh} mesh - the mesh to be removed.
* @return {BABYLON.Mesh} this mesh (for chaining)
*/
</s> add </s> remove // Sounds
if (parsedData.sounds && scene.getEngine().getAudioEngine().canUseWebAudio) {
for (index = 0; index < parsedData.sounds.length; index++) {
var parsedSound = parsedData.sounds[index];
parseSound(parsedSound, scene, rootUrl);
}
}
</s> add </s> remove for (i = 0; i < this.soundTracks.length; i++) {
</s> add for (var i = 0; i < this.soundTracks.length; i++) {
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"k... | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/babylon.scene.js | |
<mask> }
<mask> }
<mask> }
<mask>
<mask> // Depth renderer
<mask> if (this._depthRenderer) {
<mask> this._renderTargets.push(this._depthRenderer.getDepthMap());
<mask> }
<mask>
<mask> // RenderPipeline
<mask> this.postProcessRenderPipelineManager.update();
<mask>
<mask> // Multi-cameras?
<mask> if (this.activeCameras.length > 0) {
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove if (this.renderList && this.renderList.length === 0) {
</s> add if (!this.renderList) { </s> remove if (this._depthRenderer) {
this._depthRenderer.dispose();
}
</s> add </s> remove // Sounds
if (parsedData.sounds && scene.getEngine().getAudioEngine().canUseWebAudio) {
for (index = 0; index < parsedData.sounds.length; index++) {
var parsedSound = parsedData.sounds[index];
parseSound(parsedSound, scene, rootUrl);
}
}
</s> add </s> remove this._renderingManager.render(this.customRenderFunction, currentRenderList, this.renderParticles, this.renderSprites);
</s> add this._renderingManager.render(this.customRenderFunction, this.renderList, this.renderParticles, this.renderSprites); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/babylon.scene.js | |
for (var i = 0; i < this.soundTracks.length; i++) {
| <mask> if (sound.useCustomAttenuation) {
<mask> sound.updateDistanceFromListener();
<mask> }
<mask> }
<mask> for (i = 0; i < this.soundTracks.length; i++) {
<mask> for (var j = 0; j < this.soundTracks[i].soundCollection.length; j++) {
<mask> sound = this.soundTracks[i].soundCollection[j];
<mask> if (sound.useCustomAttenuation) {
<mask> sound.updateDistanceFromListener();
<mask> }
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove sound = this.soundTracks[i].soundCollection[j];
</s> add var sound = this.soundTracks[i].soundCollection[j];
</s> remove Scene.prototype.getSoundByName = function (name) {
for (var index = 0; index < this.mainSoundTrack.soundCollection.length; index++) {
if (this.mainSoundTrack.soundCollection[index].name === name) {
return this.mainSoundTrack.soundCollection[index];
}
}
for (var sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) {
for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) {
if (this.soundTracks[sdIndex].soundCollection[index].name === name) {
return this.soundTracks[sdIndex].soundCollection[index];
}
}
}
return null;
};
</s> add </s> remove if (mesh.parent === this) {
</s> add if (mesh.parent == this) { </s> remove // Release sounds & sounds tracks
this.mainSoundTrack.dispose();
for (var scIndex = 0; scIndex < this.soundTracks.length; scIndex++) {
this.soundTracks[scIndex].dispose();
}
</s> add </s> remove this._debugCanvasContext.fillRect(0, 0, this.DEBUGCANVASSIZE.width, this.DEBUGCANVASSIZE.height);
</s> add this._debugCanvasContext.fillRect(0, 0, this._debugCanvasWidth, this._debugCanvasHeight); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/babylon.scene.js |
var sound = this.soundTracks[i].soundCollection[j];
| <mask> }
<mask> }
<mask> for (i = 0; i < this.soundTracks.length; i++) {
<mask> for (var j = 0; j < this.soundTracks[i].soundCollection.length; j++) {
<mask> sound = this.soundTracks[i].soundCollection[j];
<mask> if (sound.useCustomAttenuation) {
<mask> sound.updateDistanceFromListener();
<mask> }
<mask> }
<mask> }
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove for (i = 0; i < this.soundTracks.length; i++) {
</s> add for (var i = 0; i < this.soundTracks.length; i++) {
</s> remove Scene.prototype.getSoundByName = function (name) {
for (var index = 0; index < this.mainSoundTrack.soundCollection.length; index++) {
if (this.mainSoundTrack.soundCollection[index].name === name) {
return this.mainSoundTrack.soundCollection[index];
}
}
for (var sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) {
for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) {
if (this.soundTracks[sdIndex].soundCollection[index].name === name) {
return this.soundTracks[sdIndex].soundCollection[index];
}
}
}
return null;
};
</s> add </s> remove if (mesh.parent === this) {
</s> add if (mesh.parent == this) { </s> remove // Release sounds & sounds tracks
this.mainSoundTrack.dispose();
for (var scIndex = 0; scIndex < this.soundTracks.length; scIndex++) {
this.soundTracks[scIndex].dispose();
}
</s> add </s> remove // Sounds
if (parsedData.sounds && scene.getEngine().getAudioEngine().canUseWebAudio) {
for (index = 0; index < parsedData.sounds.length; index++) {
var parsedSound = parsedData.sounds[index];
parseSound(parsedSound, scene, rootUrl);
}
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/babylon.scene.js |
<mask> }
<mask> }
<mask> };
<mask>
<mask> Scene.prototype.enableDepthRenderer = function () {
<mask> if (this._depthRenderer) {
<mask> return this._depthRenderer;
<mask> }
<mask>
<mask> this._depthRenderer = new BABYLON.DepthRenderer(this);
<mask>
<mask> return this._depthRenderer;
<mask> };
<mask>
<mask> Scene.prototype.disableDepthRenderer = function () {
<mask> if (!this._depthRenderer) {
<mask> return;
<mask> }
<mask>
<mask> this._depthRenderer.dispose();
<mask> this._depthRenderer = null;
<mask> };
<mask>
<mask> Scene.prototype.dispose = function () {
<mask> this.beforeRender = null;
<mask> this.afterRender = null;
<mask>
<mask> this.skeletons = [];
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove AudioEngine.prototype.dispose = function () {
if (this.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
this.canUseWebAudio = false;
this.masterGain.disconnect();
this.masterGain = null;
this.audioContext = null;
}
};
</s> add </s> remove Sound.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio && this._isReadyToPlay) {
if (this._isPlaying) {
this.stop();
}
this._isReadyToPlay = false;
if (this.soundTrackId === -1) {
this._scene.mainSoundTrack.RemoveSound(this);
} else {
this._scene.soundTracks[this.soundTrackId].RemoveSound(this);
}
this._soundGain.disconnect();
this._soundSource.disconnect();
this._audioBuffer = null;
this._soundGain = null;
this._soundSource = null;
if (this._soundPanner) {
this._soundPanner.disconnect();
this._soundPanner = null;
}
this._audioNode.disconnect();
if (this._connectedMesh) {
this._connectedMesh.unregisterAfterWorldMatrixUpdate(this._registerFunc);
this._connectedMesh = null;
}
}
};
</s> add </s> remove SoundTrack.prototype.dispose = function () {
if (this._audioEngine.canUseWebAudio) {
if (this._connectedAnalyser) {
this._connectedAnalyser.stopDebugCanvas();
}
while (this.soundCollection.length) {
this.soundCollection[0].dispose();
}
this._trackGain.disconnect();
this._trackGain = null;
}
};
</s> add </s> remove if (this._depthRenderer) {
this._depthRenderer.dispose();
}
</s> add </s> remove Scene.prototype.getSoundByName = function (name) {
for (var index = 0; index < this.mainSoundTrack.soundCollection.length; index++) {
if (this.mainSoundTrack.soundCollection[index].name === name) {
return this.mainSoundTrack.soundCollection[index];
}
}
for (var sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) {
for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) {
if (this.soundTracks[sdIndex].soundCollection[index].name === name) {
return this.soundTracks[sdIndex].soundCollection[index];
}
}
}
return null;
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
... | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/babylon.scene.js | |
<mask> this.skeletons = [];
<mask>
<mask> this._boundingBoxRenderer.dispose();
<mask>
<mask> if (this._depthRenderer) {
<mask> this._depthRenderer.dispose();
<mask> }
<mask>
<mask> // Debug layer
<mask> this.debugLayer.hide();
<mask>
<mask> // Events
<mask> if (this.onDispose) {
</s> Fixing issues with sprites and shadows
Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove Scene.prototype.enableDepthRenderer = function () {
if (this._depthRenderer) {
return this._depthRenderer;
}
this._depthRenderer = new BABYLON.DepthRenderer(this);
return this._depthRenderer;
};
Scene.prototype.disableDepthRenderer = function () {
if (!this._depthRenderer) {
return;
}
this._depthRenderer.dispose();
this._depthRenderer = null;
};
</s> add </s> remove // Depth renderer
if (this._depthRenderer) {
this._renderTargets.push(this._depthRenderer.getDepthMap());
}
</s> add </s> remove // Sounds
if (parsedData.sounds && scene.getEngine().getAudioEngine().canUseWebAudio) {
for (index = 0; index < parsedData.sounds.length; index++) {
var parsedSound = parsedData.sounds[index];
parseSound(parsedSound, scene, rootUrl);
}
}
</s> add </s> remove if (this.renderList && this.renderList.length === 0) {
</s> add if (!this.renderList) { </s> remove // Release sounds & sounds tracks
this.mainSoundTrack.dispose();
for (var scIndex = 0; scIndex < this.soundTracks.length; scIndex++) {
this.soundTracks[scIndex].dispose();
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90 | Babylon/babylon.scene.js |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.