From 648ee61ae84216d0236e0dbc211addc13b2cfa3a Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 6 Jul 2012 11:52:06 -0700 Subject: Expand tabs --- js/models/materials-model.js | 252 +++++++++++++++++++++---------------------- 1 file changed, 126 insertions(+), 126 deletions(-) (limited to 'js/models/materials-model.js') diff --git a/js/models/materials-model.js b/js/models/materials-model.js index 244db3c5..1fd52721 100755 --- a/js/models/materials-model.js +++ b/js/models/materials-model.js @@ -69,37 +69,37 @@ exports.MaterialsModel = Montage.create(Component, { value: false }, - deserializedFromTemplate: { - value: function() { - // Load all the materials - this.addMaterial(new FlatMaterial()); - this.addMaterial(new BumpMetalMaterial()); - //this.addMaterial(new CloudMaterial()); - this.addMaterial(new DeformMaterial()); - this.addMaterial(new FlagMaterial()); - this.addMaterial(new FlyMaterial()); - this.addMaterial(new JuliaMaterial()); - this.addMaterial(new KeleidoscopeMaterial()); - this.addMaterial(new LinearGradientMaterial()); - this.addMaterial(new MandelMaterial()); - this.addMaterial(new ParisMaterial()); - this.addMaterial(new PlasmaMaterial()); - this.addMaterial(new PulseMaterial()); - this.addMaterial(new RadialBlurMaterial()); - this.addMaterial(new RadialGradientMaterial()); - this.addMaterial(new RaidersMaterial()); - this.addMaterial(new ReliefTunnelMaterial()); - this.addMaterial(new SquareTunnelMaterial()); - this.addMaterial(new StarMaterial()); - this.addMaterial(new TaperMaterial()); - this.addMaterial(new TunnelMaterial()); - this.addMaterial(new TwistMaterial()); - this.addMaterial(new TwistVertMaterial()); - this.addMaterial(new UberMaterial()); - this.addMaterial(new WaterMaterial()); - this.addMaterial(new ZInvertMaterial()); - } - }, + deserializedFromTemplate: { + value: function() { + // Load all the materials + this.addMaterial(new FlatMaterial()); + this.addMaterial(new BumpMetalMaterial()); + //this.addMaterial(new CloudMaterial()); + this.addMaterial(new DeformMaterial()); + this.addMaterial(new FlagMaterial()); + this.addMaterial(new FlyMaterial()); + this.addMaterial(new JuliaMaterial()); + this.addMaterial(new KeleidoscopeMaterial()); + this.addMaterial(new LinearGradientMaterial()); + this.addMaterial(new MandelMaterial()); + this.addMaterial(new ParisMaterial()); + this.addMaterial(new PlasmaMaterial()); + this.addMaterial(new PulseMaterial()); + this.addMaterial(new RadialBlurMaterial()); + this.addMaterial(new RadialGradientMaterial()); + this.addMaterial(new RaidersMaterial()); + this.addMaterial(new ReliefTunnelMaterial()); + this.addMaterial(new SquareTunnelMaterial()); + this.addMaterial(new StarMaterial()); + this.addMaterial(new TaperMaterial()); + this.addMaterial(new TunnelMaterial()); + this.addMaterial(new TwistMaterial()); + this.addMaterial(new TwistVertMaterial()); + this.addMaterial(new UberMaterial()); + this.addMaterial(new WaterMaterial()); + this.addMaterial(new ZInvertMaterial()); + } + }, _materials : { value: AppModel.materials @@ -152,16 +152,16 @@ exports.MaterialsModel = Montage.create(Component, { } } }, - - getMaterialByShader: - { - value: function( shaderName ) - { - var index = this.getIndexOfMaterialByShader( shaderName ); - if (index >= 0) - return this._materials[index]; - } - }, + + getMaterialByShader: + { + value: function( shaderName ) + { + var index = this.getIndexOfMaterialByShader( shaderName ); + if (index >= 0) + return this._materials[index]; + } + }, getIndexOfMaterialByShader: { value: function (shaderName) { @@ -191,11 +191,11 @@ exports.MaterialsModel = Montage.create(Component, { } }, - clearAllMaterials: { - value: function() { - this._materials = []; - } - }, + clearAllMaterials: { + value: function() { + this._materials = []; + } + }, exportFlatMaterial: { value: function() { @@ -203,25 +203,25 @@ exports.MaterialsModel = Montage.create(Component, { } }, - getDefaultMaterialName: { - value: function() { - return "Flat"; - } - }, + getDefaultMaterialName: { + value: function() { + return "Flat"; + } + }, - exportMaterials: { - value: function() + exportMaterials: { + value: function() { var matArray = []; - var nMats = this._materials.length; - for (var i=0; i= 0) return this._materials[index]; } - }, + }, getIndexOfMaterialByShader: { value: function (shaderName) { @@ -220,13 +220,13 @@ exports.MaterialsModel = Montage.create(Component, { matArray.push( matObj ); } - var jObj = + var jObj = { 'materialLibrary': 1.0, 'materials': matArray }; - // prepend an identifiable string to aid parsing when the + // prepend an identifiable string to aid parsing when the // material model is loaded. var jStr = "materialLibrary;" + JSON.stringify( jObj ); @@ -285,7 +285,7 @@ exports.MaterialsModel = Montage.create(Component, { // make sure we have some materials to import before doing anything var matArray = jObj.materials; if (!matArray) return; - + // we replace allmaterials, so remove anything // that is currently there. this.clearAllMaterials(); -- cgit v1.2.3 From fdbec324dad4ab33d97282ab021d2c1661bc097c Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Mon, 9 Jul 2012 16:27:52 -0700 Subject: BSD License --- js/models/materials-model.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'js/models/materials-model.js') diff --git a/js/models/materials-model.js b/js/models/materials-model.js index b8500234..833eb08f 100755 --- a/js/models/materials-model.js +++ b/js/models/materials-model.js @@ -1,24 +1,25 @@ /* -Copyright (c) 2012, Motorola Mobility, Inc +Copyright (c) 2012, Motorola Mobility LLC. All Rights Reserved. -BSD License. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of Motorola Mobility nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Motorola Mobility LLC nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- cgit v1.2.3