From 41f1f1909d8ba1147a1a4d461a53f86b713bba8d Mon Sep 17 00:00:00 2001 From: Vaios Kalpias-Ilias Date: Wed, 17 Jun 2015 13:17:34 +0300 Subject: [PATCH 01/21] Can now load materials using a dictionary format --- src/resources/resources_material.js | 140 ++++++++++++++++++++++++++-- 1 file changed, 134 insertions(+), 6 deletions(-) diff --git a/src/resources/resources_material.js b/src/resources/resources_material.js index 32ab590dff2..e69c66d5a9d 100644 --- a/src/resources/resources_material.js +++ b/src/resources/resources_material.js @@ -1,6 +1,100 @@ pc.extend(pc, function () { 'use strict'; + var PARAMETER_TYPES = { + ambient: 'vec3', + ambientTnumber: 'boolean', + aoMap: 'texture', + aoMapVertexColor: 'boolean', + aoMapChannel: 'string', + aoMapUv: 'number', + aoMapTiling: 'vec2', + aoMapOffset: 'vec2', + occludeSpecular: 'boolean', + diffuse: 'vec3', + diffuseMap: 'texture', + diffuseMapVertexColor: 'boolean', + diffuseMapChannel: 'string', + diffuseMapUv: 'number', + diffuseMapTiling: 'vec2', + diffuseMapOffset: 'vec2', + diffuseMapTnumber: 'boolean', + specular: 'vec3', + specularMapVertexColor: 'boolean', + specularMapChannel: 'string', + specularMapUv: 'number', + specularMap: 'texture', + specularMapTiling: 'vec2', + specularMapOffset: 'vec2', + specularMapTnumber: 'boolean', + specularAntialias: 'boolean', + useMetalness: 'boolean', + metalnessMap: 'texture', + metalnessMapVertexColor: 'boolean', + metalnessMapChannel: 'string', + metalnessMapUv: 'number', + metalnessMapTiling: 'vec2', + metalnessMapOffset: 'vec2', + metalnessMapTnumber: 'boolean', + metalness: 'number', + conserveEnergy: 'boolean', + shininess: 'number', + glossMap: 'texture', + glossMapVertexColor: 'boolean', + glossMapChannel: 'string', + glossMapUv: 'number', + glossMapTiling: 'vec2', + glossMapOffset: 'vec2', + fresnelModel: 'number', + fresnelFactor: 'float', + emissive: 'vec3', + emissiveMap: 'texture', + emissiveMapVertexColor: 'boolean', + emissiveMapChannel: 'string', + emissiveMapUv: 'number', + emissiveMapTiling: 'vec2', + emissiveMapOffset: 'vec2' , + emissiveMapTint: 'boolean', + emissiveIntensity: 'number', + normalMap: 'texture', + normalMapTiling: 'vec2', + normalMapOffset: 'vec2', + normalMapUv: 'number', + bumpMapFactor: 'number', + heightMap: 'texture', + heightMapChannel: 'string', + heightMapUv: 'number', + heightMapTiling: 'vec2', + heightMapOffset: 'vec2', + heightMapFactor: 'number', + alphaTest: 'number', + opacity: 'number', + opacityMap: 'texture', + opacityMapVertexColor: 'boolean', + opacityMapChannel: 'string', + opacityMapUv: 'number', + opacityMapTiling: 'vec2', + opacityMapOffset: 'vec2', + reflectivity: 'number', + refraction: 'number', + refractionIndex: 'number', + sphereMap: 'texture', + cubeMap: 'cubemap', + cubeMapProjection: 'boolean', + lightMap: 'texture', + lightMapVertexColor: 'boolean', + lightMapChannel: 'string', + lightMapUv: 'number', + lightMapTiling: 'vec2', + lightMapOffset: 'vec2', + depthTest: 'boolean' , + depthWrite: 'boolean', + cull: 'number', + blendType: 'number', + shadowSampleType: 'number', + shadingModel: 'number' + }; + var onTextureAssetChanged = function (asset, attribute, newValue, oldValue) { if (attribute !== 'resource') { return; @@ -53,11 +147,44 @@ pc.extend(pc, function () { open: function (url, data) { var material = new pc.PhongMaterial(); + + if (!data.parameters) { + this._createParameters(data); + } + material.init(data); material._data = data; // temp storage in case we need this during patching (engine-only) return material; }, + // creates parameters array from data dictionary + _createParameters: function (data) { + var parameters = []; + + if (!data.shadingModel) { + data.shadingModel = data.shader === 'blinn' ? pc.SPECULAR_BLINN : pc.SPECULAR_PHONG; + } + + var shader = data.shader; + + // remove shader for the following loop + delete data.shader; + + for (var key in data) { + if (!data.hasOwnProperty(key)) continue; + + parameters.push({ + name: key, + type: PARAMETER_TYPES[key], + data: data[key] + }); + } + + data.shader = shader; + + data.parameters = parameters; + }, + patch: function (asset, assets) { if (asset.data.shader === undefined) { // for engine-only users restore original material data @@ -79,16 +206,17 @@ pc.extend(pc, function () { _updatePhongMaterial: function (asset, data, assets) { var material = asset.resource; + var dir; if (asset.file) { - var dir = pc.path.getDirectory(asset.getFileUrl()); + dir = pc.path.getDirectory(asset.getFileUrl()); } - data.parameters.push({ - name: 'shadingModel', - type: 'float', - data: data.shader === 'blinn' ? pc.SPECULAR_BLINN : pc.SPECULAR_PHONG - }); + data.name = asset.name; + + if (!data.parameters) { + this._createParameters(data); + } var pathMapping = (data.mapping_format === "path"); var id; From 52cbfed798527e78575af16973b757268462f089 Mon Sep 17 00:00:00 2001 From: Maksims Mihejevs Date: Thu, 18 Jun 2015 11:04:17 +0100 Subject: [PATCH 02/21] add assetRegistry.filter method --- src/asset/asset_registry.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/asset/asset_registry.js b/src/asset/asset_registry.js index 0e26e7e02e2..dd167cfddae 100644 --- a/src/asset/asset_registry.js +++ b/src/asset/asset_registry.js @@ -417,6 +417,27 @@ pc.extend(pc, function () { } }, + /** + * @function + * @name pc.AssetRegistry#filter + * @description Return all Assets that satisfy filter callback + * @param {Function} callback The callback function that is used to filter assets, return `true` to include asset to result list + * @returns {[pc.Asset]} A list of all Assets found + * @example + * var assets = app.assets.filter(function(asset) { + * return asset.name.indexOf('monster') !== -1; + * }); + * console.log("Found " + assets.length + " assets, where names contains 'monster'"); + */ + filter: function (callback) { + var items = [ ]; + for(var i = 0, len = this._assets.length; i < len; i++) { + if (callback(this._assets[i])) + items.push(this._assets[i]); + } + return items; + }, + /** * @function * @name pc.AssetRegistry#find From 31239b81b83fa257319b24d233735eb75a58f1fb Mon Sep 17 00:00:00 2001 From: Mr F Date: Thu, 18 Jun 2015 14:23:58 +0300 Subject: [PATCH 03/21] remove seams from skybox when using lower mips --- src/graphics/programlib/programlib_skybox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphics/programlib/programlib_skybox.js b/src/graphics/programlib/programlib_skybox.js index 9e3276f9834..06e57505f2a 100644 --- a/src/graphics/programlib/programlib_skybox.js +++ b/src/graphics/programlib/programlib_skybox.js @@ -8,7 +8,7 @@ pc.programlib.skybox = { createShaderDefinition: function (device, options) { var getSnippet = pc.programlib.getSnippet; var chunks = pc.shaderChunks; - var mip2size = [128, 64, 32, 16, 8, 4]; + var mip2size = [128, 64, 16, 8, 4, 2]; return { attributes: { From 88727b672a1eb407554c07bf552d75842191023c Mon Sep 17 00:00:00 2001 From: Mr F Date: Thu, 18 Jun 2015 15:26:26 +0300 Subject: [PATCH 04/21] switch horizontal/vertical fov --- .../components/camera/camera_component.js | 5 ++++ src/math/math_mat4.js | 29 +++++++++++-------- src/scene/scene_camera.js | 15 +++++++++- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/src/framework/components/camera/camera_component.js b/src/framework/components/camera/camera_component.js index 5eab1c892e0..721f9479a1b 100644 --- a/src/framework/components/camera/camera_component.js +++ b/src/framework/components/camera/camera_component.js @@ -45,6 +45,7 @@ pc.extend(pc, function () { this.on("set_clearDepthBuffer", this.updateClearFlags, this); this.on("set_renderTarget", this.onSetRenderTarget, this); this.on("set_rect", this.onSetRect, this); + this.on("set_horizontalFov", this.onSetHorizontalFov, this); this.on("set_frustumCulling", this.onSetFrustumCulling, this); }; CameraComponent = pc.inherits(CameraComponent, pc.Component); @@ -148,6 +149,10 @@ pc.extend(pc, function () { this.data.camera.setFarClip(newValue); }, + onSetHorizontalFov: function (name, oldValue, newValue) { + this.data.camera.setHorizontalFov(newValue); + }, + onSetFrustumCulling: function (name, oldValue, newValue) { this.data.camera.frustumCulling = newValue; }, diff --git a/src/math/math_mat4.js b/src/math/math_mat4.js index c8ac139c5c0..a517c5f2b8c 100644 --- a/src/math/math_mat4.js +++ b/src/math/math_mat4.js @@ -29,7 +29,7 @@ pc.extend(pc, (function () { * var m = new pc.Mat4(); * * m.add2(pc.Mat4.INDENTITY, pc.Mat4.ONE); - * + * * console.log("The result of the addition is: " a.toString()); */ add2: function (lhs, rhs) { @@ -67,7 +67,7 @@ pc.extend(pc, (function () { * var m = new pc.Mat4(); * * m.add(pc.Mat4.ONE); - * + * * console.log("The result of the addition is: " a.toString()); */ add: function (rhs) { @@ -200,7 +200,7 @@ pc.extend(pc, (function () { * * // r = a * b * r.mul2(a, b); - * + * * console.log("The result of the multiplication is: " r.toString()); */ mul2: function (lhs, rhs) { @@ -281,7 +281,7 @@ pc.extend(pc, (function () { * * // a = a * b * a.mul(b); - * + * * console.log("The result of the multiplication is: " a.toString()); */ mul: function (rhs) { @@ -422,7 +422,7 @@ pc.extend(pc, (function () { return this; }; - }()), + }()), /** * @private @@ -475,7 +475,7 @@ pc.extend(pc, (function () { * @name pc.Mat4#setPerspective * @description Sets the specified matrix to a persective projection matrix. The function's * parameters define the shape of a frustum. - * @param {Number} fovy The field of view in the frustum in the Y-axis of eye space. + * @param {Number} fovy The field of view in the frustum in the Y-axis of eye space (or X axis if fovIsHorizontal is true). * @param {Number} aspect The aspect ratio of the frustum's projection plane (width / height). * @param {Number} znear The near clip plane in eye coordinates. * @param {Number} zfar The far clip plane in eye coordinates. @@ -484,11 +484,16 @@ pc.extend(pc, (function () { * // Create a 4x4 persepctive projection matrix * var persp = pc.Mat4().setPerspective(45, 16 / 9, 1, 1000); */ - setPerspective: function (fovy, aspect, znear, zfar) { + setPerspective: function (fovy, aspect, znear, zfar, fovIsHorizontal) { var xmax, ymax; - ymax = znear * Math.tan(fovy * Math.PI / 360); - xmax = ymax * aspect; + if (!fovIsHorizontal) { + ymax = znear * Math.tan(fovy * Math.PI / 360); + xmax = ymax * aspect; + } else { + xmax = znear * Math.tan(fovy * Math.PI / 360); + ymax = xmax / aspect; + } return this.setFrustum(-xmax, xmax, -ymax, ymax, znear, zfar); }, @@ -1034,7 +1039,7 @@ pc.extend(pc, (function () { * m.setFromEulerAngles(45, 90, 180); */ // http://en.wikipedia.org/wiki/Rotation_matrix#Conversion_from_and_to_axis-angle - // The 3D space is right-handed, so the rotation around each axis will be counterclockwise + // The 3D space is right-handed, so the rotation around each axis will be counterclockwise // for an observer placed so that the axis goes in his or her direction (Right-hand rule). setFromEulerAngles: function (ex, ey, ez) { var s1, c1, s2, c2, s3, c3, m; @@ -1080,7 +1085,7 @@ pc.extend(pc, (function () { /** * @function * @name pc.Mat4#getEulerAngles - * @description Extracts the Euler angles equivalent to the rotational portion + * @description Extracts the Euler angles equivalent to the rotational portion * of the specified matrix. The returned Euler angles are in XYZ order an in degrees. * @param {pc.Vec3} [eulers] A 3-d vector to receive the Euler angles. * @returns {pc.Vec3} A 3-d vector containing the Euler angles. @@ -1187,4 +1192,4 @@ pc.extend(pc, (function () { return { Mat4: Mat4 }; -}())); \ No newline at end of file +}())); diff --git a/src/scene/scene_camera.js b/src/scene/scene_camera.js index 917d18c7938..c3661489127 100644 --- a/src/scene/scene_camera.js +++ b/src/scene/scene_camera.js @@ -11,6 +11,7 @@ pc.extend(pc, function () { this._fov = 45; this._orthoHeight = 10; this._aspect = 16 / 9; + this._horizontalFov = false; this.frustumCulling = false; this._projMatDirty = true; @@ -250,7 +251,7 @@ pc.extend(pc, function () { getProjectionMatrix: function () { if (this._projMatDirty) { if (this._projection === pc.PROJECTION_PERSPECTIVE) { - this._projMat.setPerspective(this._fov, this._aspect, this._nearClip, this._farClip); + this._projMat.setPerspective(this._fov, this._aspect, this._nearClip, this._farClip, this._horizontalFov); } else { var y = this._orthoHeight; var x = y * this._aspect; @@ -354,6 +355,18 @@ pc.extend(pc, function () { this._projMatDirty = true; }, + /** + * @private + * @function + * @name pc.Camera#setHorizontalFov + * @description Toggles horizontal/vertical FOV + * @param {Number} value true (horizontal) or false (vertical). + */ + setHorizontalFov: function (value) { + this._horizontalFov = value; + this._projMatDirty = true; + }, + /** * @private * @function From 1459411edc36fbc181d09174c1e08541d5e3d6b0 Mon Sep 17 00:00:00 2001 From: Mr F Date: Thu, 18 Jun 2015 18:48:55 +0300 Subject: [PATCH 05/21] fix ENTER keycode --- src/input/input_input.js | 58 ++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/input/input_input.js b/src/input/input_input.js index 638e3eebb30..eaecb4e111f 100644 --- a/src/input/input_input.js +++ b/src/input/input_input.js @@ -72,9 +72,9 @@ /** * @enum pc.EVENT * @name pc.EVENT_TOUCHCANCEL - * @description Name of event fired when a touch point is interupted in some way. - * The exact reasons for cancelling a touch can vary from device to device. - * For example, a modal alert pops up during the interaction; the touch point leaves the document area; + * @description Name of event fired when a touch point is interupted in some way. + * The exact reasons for cancelling a touch can vary from device to device. + * For example, a modal alert pops up during the interaction; the touch point leaves the document area; * or there are more touch points than the device supports, in which case the earliest touch point is canceled. */ EVENT_TOUCHCANCEL: 'touchcancel', @@ -98,7 +98,7 @@ * @enum pc.KEY * @name pc.KEY_ENTER */ - KEY_ENTER: 14, + KEY_ENTER: 13, /** * @enum pc.KEY * @name pc.KEY_SHIFT @@ -599,111 +599,111 @@ */ MOUSEBUTTON_RIGHT: 2, - /** + /** * @description Index for pad 1 */ PAD_1: 0, - /** + /** * @description Index for pad 2 */ PAD_2: 1, - /** + /** * @description Index for pad 3 */ PAD_3: 2, - /** + /** * @description Index for pad 4 */ PAD_4: 3, - /** + /** * @description The first face button, from bottom going clockwise */ PAD_FACE_1: 0, - /** + /** * @description The second face button, from bottom going clockwise */ PAD_FACE_2: 1, - /** + /** * @description The third face button, from bottom going clockwise */ PAD_FACE_3: 2, - /** + /** * @description The fourth face button, from bottom going clockwise */ PAD_FACE_4: 3, - /** + /** * @description The first shoulder button on the left */ PAD_L_SHOULDER_1: 4, - /** + /** * @description The first shoulder button on the right */ PAD_R_SHOULDER_1: 5, - /** + /** * @description The second shoulder button on the left */ PAD_L_SHOULDER_2: 6, - /** + /** * @description The second shoulder button on the right */ PAD_R_SHOULDER_2: 7, - /** + /** * @description The select button */ PAD_SELECT: 8, - /** + /** * @description The start button */ PAD_START: 9, - /** + /** * @description The button when depressing the left analogue stick */ PAD_L_STICK_BUTTON: 10, - /** + /** * @description The button when depressing the right analogue stick */ PAD_R_STICK_BUTTON: 11, - /** + /** * @description Direction pad up */ PAD_UP: 12, - /** + /** * @description Direction pad down */ PAD_DOWN: 13, - /** + /** * @description Direction pad left */ PAD_LEFT: 14, - /** + /** * @description Direction pad right */ PAD_RIGHT: 15, - /** + /** * @description Vendor specific button */ PAD_VENDOR: 16, - /** + /** * @description Horizontal axis on the left analogue stick */ PAD_L_STICK_X: 0, - /** + /** * @description Vertical axis on the left analogue stick */ PAD_L_STICK_Y: 1, - /** + /** * @description Horizontal axis on the right analogue stick */ PAD_R_STICK_X: 2, - /** + /** * @description Vertical axis on the right analogue stick */ PAD_R_STICK_Y: 3 From 02c2b07b5bee09cb1e74ea0172f9121c08ddf531 Mon Sep 17 00:00:00 2001 From: Vaios Kalpias-Ilias Date: Thu, 18 Jun 2015 19:13:35 +0300 Subject: [PATCH 06/21] Fix errors when cubemap is changed --- src/asset/asset_registry.js | 52 ++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/asset/asset_registry.js b/src/asset/asset_registry.js index 0e26e7e02e2..e14e6f0eb72 100644 --- a/src/asset/asset_registry.js +++ b/src/asset/asset_registry.js @@ -174,32 +174,6 @@ pc.extend(pc, function () { var load = !!(asset.file); var open = !load; - // check for special case for cubemaps - if (asset.file && asset.type === "cubemap") { - load = false; - open = false; - // loading prefiltered cubemap data - this._loader.load(asset.file.url, "texture", function (err, texture) { - if (!err) { - // Fudging an asset so that we can apply texture settings from the cubemap to the DDS texture - self._loader.patch({ - resource: texture, - type: "texture", - data: asset.data - }, self); - - // store in asset data - asset.data.dds = texture; - _open(); - } else { - self.fire("error", err, asset); - self.fire("error:" + asset.id, err, asset); - asset.fire("error", err, asset); - return; - } - }); - } - var _load = function () { var url = asset.file.url; @@ -247,6 +221,32 @@ pc.extend(pc, function () { asset.fire("load", asset); }; + // check for special case for cubemaps + if (asset.file && asset.type === "cubemap") { + load = false; + open = false; + // loading prefiltered cubemap data + this._loader.load(asset.file.url, "texture", function (err, texture) { + if (!err) { + // Fudging an asset so that we can apply texture settings from the cubemap to the DDS texture + self._loader.patch({ + resource: texture, + type: "texture", + data: asset.data + }, self); + + // store in asset data + asset.data.dds = texture; + _open(); + } else { + self.fire("error", err, asset); + self.fire("error:" + asset.id, err, asset); + asset.fire("error", err, asset); + return; + } + }); + } + if (!asset.file) { _open(); } else if (load) { From 4a4bf3af22933857783727a23c07da7c8d26d62d Mon Sep 17 00:00:00 2001 From: Vaios Kalpias-Ilias Date: Thu, 18 Jun 2015 19:14:12 +0300 Subject: [PATCH 07/21] Remove skybox event handlers when scene skybox is removed --- src/scene/scene_scene.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/scene/scene_scene.js b/src/scene/scene_scene.js index 4bacbe1c448..b794d99cceb 100644 --- a/src/scene/scene_scene.js +++ b/src/scene/scene_scene.js @@ -606,7 +606,12 @@ pc.extend(pc, function () { return; } - this.setSkybox(newValue); + if (oldValue === this.skybox) { + this.setSkybox(newValue); + } else { + asset.off('change', this._onSkyBoxChanged, this); + asset.off('remove', this._onSkyBoxRemoved, this); + } }; Scene.prototype._onSkyBoxRemoved = function (asset) { From c266fb332be42f23e10b2b6b758d49c819f3edb3 Mon Sep 17 00:00:00 2001 From: Vaios Kalpias-Ilias Date: Thu, 18 Jun 2015 19:14:33 +0300 Subject: [PATCH 08/21] Handle cubemap changes when material references a cubemap --- src/resources/resources_material.js | 50 +++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/src/resources/resources_material.js b/src/resources/resources_material.js index e69c66d5a9d..bbf95d7021d 100644 --- a/src/resources/resources_material.js +++ b/src/resources/resources_material.js @@ -121,6 +121,44 @@ pc.extend(pc, function () { } }; + var onCubemapAssetChanged = function (asset, attribute, newValue, oldValue) { + if (attribute !== 'resources') { + return; + } + + var material = this; + var dirty = false; + + var props = [ + 'cubeMap', + 'prefilteredCubeMap128', + 'prefilteredCubeMap64', + 'prefilteredCubeMap32', + 'prefilteredCubeMap16', + 'prefilteredCubeMap8', + 'prefilteredCubeMap4' + ]; + + if (!newValue) + newValue = []; + + if (!oldValue) + oldValue = []; + + for (var i = 0; i < props.length; i++) { + if (material[props[i]] === oldValue[i]) { + material[props[i]] = newValue[i]; + dirty = true; + } + } + + if (dirty) { + material.update(); + } else { + asset.off('change', onCubemapAssetChanged, material); + } + }; + var MaterialHandler = function (assets) { this._assets = assets; }; @@ -305,8 +343,8 @@ pc.extend(pc, function () { } material.init(data); - asset.off('change', onTextureAssetChanged, material); - asset.on('change', onTextureAssetChanged, material); + asset.off('change', onCubemapAssetChanged, material); + asset.on('change', onCubemapAssetChanged, material); }); assets.load(asset); } else if (id) { @@ -342,8 +380,8 @@ pc.extend(pc, function () { } material.init(data); - asset.off('change', onTextureAssetChanged, material); - asset.on('change', onTextureAssetChanged, material); + asset.off('change', onCubemapAssetChanged, material); + asset.on('change', onCubemapAssetChanged, material); }); assets.load(asset); }); @@ -353,8 +391,8 @@ pc.extend(pc, function () { data.parameters[i].data = asset.resource; material.init(data); - asset.off('change', onTextureAssetChanged, material); - asset.on('change', onTextureAssetChanged, material); + asset.off('change', onCubemapAssetChanged, material); + asset.on('change', onCubemapAssetChanged, material); }); assets.load(asset); }); From fa47fed78c777541a282db08a2e31ec8b6839970 Mon Sep 17 00:00:00 2001 From: Vaios Kalpias-Ilias Date: Thu, 18 Jun 2015 19:57:36 +0300 Subject: [PATCH 09/21] [RELEASE] v0.169.2 --- CHANGES.md | 6 ++++++ VERSION | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index ca97d63f3d0..09c419ea9a5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # PlayCanvas Engine Changes +### v0.169.2 +* Added asset_registry#filter method +* Added camera_component#horizontalFov to allow the fov to be either horizontal or vertical +* [FIX] Changed Enter key code to 13 +* [FIX] Removed seams from skybox when using lower mips + ### v0.169.1 * [FIX] Absolute script URLs diff --git a/VERSION b/VERSION index e9d5c31c064..50ebb03aa90 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.170.0-dev +0.169.2 From 1d9915c255bb32af2b68ba271e1e1e276d29e2b9 Mon Sep 17 00:00:00 2001 From: Vaios Kalpias-Ilias Date: Thu, 18 Jun 2015 19:58:13 +0300 Subject: [PATCH 10/21] [VERSION] v0.170.0dev --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 50ebb03aa90..e9d5c31c064 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.169.2 +0.170.0-dev From b79500a43cccc7fd1532cfc0c4e403e9001ebb9c Mon Sep 17 00:00:00 2001 From: Vaios Kalpias-Ilias Date: Mon, 22 Jun 2015 13:55:48 +0300 Subject: [PATCH 11/21] Fix skybox change handler --- src/scene/scene_scene.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scene/scene_scene.js b/src/scene/scene_scene.js index b794d99cceb..b38b9284ddd 100644 --- a/src/scene/scene_scene.js +++ b/src/scene/scene_scene.js @@ -606,7 +606,7 @@ pc.extend(pc, function () { return; } - if (oldValue === this.skybox) { + if (oldValue && oldValue[0] === this.skybox) { this.setSkybox(newValue); } else { asset.off('change', this._onSkyBoxChanged, this); From 85e48f6755be26818b3fca816ed0be3a3e381ab5 Mon Sep 17 00:00:00 2001 From: Vaios Kalpias-Ilias Date: Mon, 22 Jun 2015 17:13:51 +0300 Subject: [PATCH 12/21] [RELEASE] v0.169.3 --- CHANGES.md | 5 +++++ VERSION | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 09c419ea9a5..a49b5220498 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,10 @@ # PlayCanvas Engine Changes +### v0.169.3 +* Can now load materials using a dictionary format +* [FIX] Remove skybox event handlers when scene skybox is removed +* [FIX] Handle cubemap changes when material references a cubemap + ### v0.169.2 * Added asset_registry#filter method * Added camera_component#horizontalFov to allow the fov to be either horizontal or vertical diff --git a/VERSION b/VERSION index e9d5c31c064..02beae2f042 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.170.0-dev +0.169.3 From dfc7f389e66ad807b74a8f1c405e1fe0036be08b Mon Sep 17 00:00:00 2001 From: Vaios Kalpias-Ilias Date: Mon, 22 Jun 2015 17:14:22 +0300 Subject: [PATCH 13/21] [VERSION] v0.170.0dev --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 02beae2f042..e9d5c31c064 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.169.3 +0.170.0-dev From 06eb4389e6f6652bc8abdc3af8cc3d7682c623ff Mon Sep 17 00:00:00 2001 From: Vaios Kalpias-Ilias Date: Tue, 23 Jun 2015 14:07:46 +0300 Subject: [PATCH 14/21] [FIX] Error when loading audio source assets --- .../components/audiosource/audiosource_component.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/framework/components/audiosource/audiosource_component.js b/src/framework/components/audiosource/audiosource_component.js index 4fd27f94c22..cae85d29261 100644 --- a/src/framework/components/audiosource/audiosource_component.js +++ b/src/framework/components/audiosource/audiosource_component.js @@ -293,16 +293,16 @@ pc.extend(pc, function () { }); } else { // don't wait for assets that aren't in the registry - count-- + count--; if (count === 0) { _done(); } // but if they are added insert them into source list - assets.on("add:" + ids[index], function (asset) { + this.system.app.assets.on("add:" + ids[index], function (asset) { asset.ready(function (asset) { this.data.sources[asset.name] = asset.resource; }); - }) + }); } }, this); } From 3ae3c4b4485586acbd1d8b59ef7f2a7525fd6a1a Mon Sep 17 00:00:00 2001 From: Vaios Kalpias-Ilias Date: Tue, 23 Jun 2015 14:08:22 +0300 Subject: [PATCH 15/21] withCredentials is now an option in pc.net.http.request --- src/net/net_http.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/net_http.js b/src/net/net_http.js index 5c0c78a31d0..008e40fe2b5 100644 --- a/src/net/net_http.js +++ b/src/net/net_http.js @@ -239,7 +239,7 @@ pc.extend(pc.net, function () { } xhr.open(method, url, options.async); - xhr.withCredentials = true; + xhr.withCredentials = options.withCredentials !== undefined ? options.withCredentials : true; xhr.responseType = options.responseType || this.guessResponseType(url); // Set the http headers From 94756123973835f649647a62b09c104221ee2618 Mon Sep 17 00:00:00 2001 From: Vaios Kalpias-Ilias Date: Tue, 23 Jun 2015 14:09:49 +0300 Subject: [PATCH 16/21] [RELEASE] v0.169.4 --- CHANGES.md | 4 ++++ VERSION | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index a49b5220498..52511f70359 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # PlayCanvas Engine Changes +### v0.169.4 +* [FIX] Error when loading audiosource assets +* withCredentials is now an option when making a request via pc.net.http + ### v0.169.3 * Can now load materials using a dictionary format * [FIX] Remove skybox event handlers when scene skybox is removed diff --git a/VERSION b/VERSION index e9d5c31c064..7e602d99025 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.170.0-dev +0.169.4 From 9564abc9a36b079a0e058d9434dacc3bdf335f91 Mon Sep 17 00:00:00 2001 From: Vaios Kalpias-Ilias Date: Tue, 23 Jun 2015 14:10:20 +0300 Subject: [PATCH 17/21] [VERSION] v0.170.0-dev --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7e602d99025..e9d5c31c064 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.169.4 +0.170.0-dev From b73ac0f0e553ffda45dd8f01d86e0fa44e5905de Mon Sep 17 00:00:00 2001 From: Dave Evans Date: Wed, 24 Jun 2015 12:48:06 +0100 Subject: [PATCH 18/21] [FIX] Non-preloaded skyboxes are loaded when accessed by the scene settings --- src/resources/resources_scene.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/resources/resources_scene.js b/src/resources/resources_scene.js index b09acae95a6..ec9cd3aa8c0 100644 --- a/src/resources/resources_scene.js +++ b/src/resources/resources_scene.js @@ -49,11 +49,13 @@ pc.extend(pc, function () { asset.on('change', this._onSkyBoxChanged, this); asset.on('remove', this._onSkyBoxRemoved, this); }); + assets.load(asset); } else { assets.once("add:" + scene.skyboxAsset, function (asset) { asset.ready(function (asset) { scene.attachSkyboxAsset(asset); }); + assets.load(asset); }); } } From 69887c7f7970909318a08b0bcb47f662098e4817 Mon Sep 17 00:00:00 2001 From: Dave Evans Date: Wed, 24 Jun 2015 15:14:59 +0100 Subject: [PATCH 19/21] Remove unused documentation --- src/resources/resources_script.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/resources/resources_script.js b/src/resources/resources_script.js index e497a38b609..e7ba51c02f1 100644 --- a/src/resources/resources_script.js +++ b/src/resources/resources_script.js @@ -7,7 +7,6 @@ pc.extend(pc, function () { * Two types of javascript file can be loaded, PlayCanvas ScriptType files which must contain a call to pc.script.create() to be called when the script executes, * or regular javascript files, such as third-party libraries. * @param {pc.Application} app The running {pc.Application} - * @param {String} prefix Prefix for script urls, so that script resources can be located in a variety of places including localhost */ var ScriptHandler = function (app) { this._app = app; From 2de5d538d51035e28cd29598028d8b45a57cb99a Mon Sep 17 00:00:00 2001 From: Dave Evans Date: Wed, 24 Jun 2015 15:18:12 +0100 Subject: [PATCH 20/21] [RELEASE] v0.169.5 --- CHANGES.md | 3 +++ VERSION | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 52511f70359..12c0021e284 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ # PlayCanvas Engine Changes +### v0.169.5 +* [FIX] Load cubemap for scene skybox if not preloaded + ### v0.169.4 * [FIX] Error when loading audiosource assets * withCredentials is now an option when making a request via pc.net.http diff --git a/VERSION b/VERSION index e9d5c31c064..4019928624f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.170.0-dev +0.169.5 From 69f9fd476fb3ddc469919be8db949e80228fb864 Mon Sep 17 00:00:00 2001 From: Dave Evans Date: Wed, 24 Jun 2015 15:18:41 +0100 Subject: [PATCH 21/21] [VERSION] v0.170.0-dev --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4019928624f..e9d5c31c064 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.169.5 +0.170.0-dev