From 7bee50379c1df86bb571e0e8d6c08e24d25231f5 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Mon, 9 Jul 2012 16:38:08 -0700 Subject: BSD License --- js/lib/NJUtils.js | 63 ++++++++-------- js/lib/drawing/world.js | 89 ++++++++++++----------- js/lib/geom/anchor-point.js | 35 ++++----- js/lib/geom/brush-stroke.js | 29 ++++---- js/lib/geom/circle.js | 25 ++++--- js/lib/geom/geom-obj.js | 25 ++++--- js/lib/geom/line.js | 23 +++--- js/lib/geom/rectangle.js | 23 +++--- js/lib/geom/shape-primitive.js | 25 ++++--- js/lib/geom/sub-path.js | 27 +++---- js/lib/math/matrix.js | 27 +++---- js/lib/rdge/materials/bump-metal-material.js | 39 +++++----- js/lib/rdge/materials/cloud-material.js | 43 +++++------ js/lib/rdge/materials/deform-material.js | 33 +++++---- js/lib/rdge/materials/flag-material.js | 35 ++++----- js/lib/rdge/materials/flat-material.js | 31 ++++---- js/lib/rdge/materials/fly-material.js | 33 +++++---- js/lib/rdge/materials/julia-material.js | 33 +++++---- js/lib/rdge/materials/keleidoscope-material.js | 33 +++++---- js/lib/rdge/materials/linear-gradient-material.js | 55 +++++++------- js/lib/rdge/materials/mandel-material.js | 33 +++++---- js/lib/rdge/materials/material-parser.js | 23 +++--- js/lib/rdge/materials/material.js | 35 ++++----- js/lib/rdge/materials/plasma-material.js | 33 +++++---- js/lib/rdge/materials/pulse-material.js | 35 ++++----- js/lib/rdge/materials/radial-blur-material.js | 23 +++--- js/lib/rdge/materials/radial-gradient-material.js | 29 ++++---- js/lib/rdge/materials/relief-tunnel-material.js | 23 +++--- js/lib/rdge/materials/square-tunnel-material.js | 23 +++--- js/lib/rdge/materials/star-material.js | 23 +++--- js/lib/rdge/materials/taper-material.js | 25 ++++--- js/lib/rdge/materials/tunnel-material.js | 33 +++++---- js/lib/rdge/materials/twist-material.js | 23 +++--- js/lib/rdge/materials/twist-vert-material.js | 27 +++---- js/lib/rdge/materials/uber-material.js | 37 +++++----- js/lib/rdge/materials/water-material.js | 25 ++++--- js/lib/rdge/materials/z-invert-material.js | 23 +++--- js/lib/rdge/texture.js | 41 ++++++----- 38 files changed, 639 insertions(+), 601 deletions(-) (limited to 'js/lib') diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js index 1406ad98..cbd936a6 100755 --- a/js/lib/NJUtils.js +++ b/js/lib/NJUtils.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 @@ -39,7 +40,7 @@ var Montage = require("montage/core/core").Montage, exports.NJUtils = Montage.create(Component, { /* =============== DOM Access ================ */ - + ///// Quick "getElementById" $ : { value: function(id, doc) { @@ -47,7 +48,7 @@ exports.NJUtils = Montage.create(Component, { return doc.getElementById(id); } }, - + ///// Quick "getElementsByClassName" which also returns as an Array ///// Can return as NodeList by passing true as second argument $$ : { @@ -57,7 +58,7 @@ exports.NJUtils = Montage.create(Component, { return (asNodeList) ? list : this.toArray(list); } }, - + ///// Get child nodes of element ///// Omit filter to only return element nodes ///// Pass in filter function to minimize collection, or @@ -70,9 +71,9 @@ exports.NJUtils = Montage.create(Component, { return this.toArray(el.childNodes).filter(f); } }, - + /* ============= DOM Manipulation ============= */ - + ///// Creates and returns text node from string textNode : { value: function(text) { @@ -95,7 +96,7 @@ exports.NJUtils = Montage.create(Component, { return el; } }, - + decor: { value: function(el, attr) { if (typeof attr === 'object') { @@ -183,7 +184,7 @@ exports.NJUtils = Montage.create(Component, { return node; } }, - + queryParentSelector : { value: function(el, strSelector) { // queryParentSelector: @@ -191,7 +192,7 @@ exports.NJUtils = Montage.create(Component, { // and find the first parent that matches selector strSelector (required). // Returns: The element that matches, or false if there is no match // or if insufficient parameters are supplied. - + if ((typeof(el) === "undefined") || (typeof(strSelector) === "undefined")) { // Parameters are required, m'kay? return false; @@ -199,26 +200,26 @@ exports.NJUtils = Montage.create(Component, { // You also have to use the right parameters. return false; } - + // First, get an empty clone of the parent. var myParent = el.parentNode; var clone = myParent.cloneNode(false); if (clone === null) { return false; } - + // If we're at the top of the DOM, our clone will be an htmlDocument. // htmlDocument has no tagName. if (typeof(clone.tagName) !== "undefined") { // create a bogus div to use as a base for querySelector var temp = document.createElement("div"); - + // Append the clone to the bogus div temp.appendChild(clone); - + // Now we can use querySelector! Sweet. var selectorTest = temp.querySelector(strSelector); - + // What has querySelector returned? if (selectorTest === null) { // No match, so recurse. @@ -232,7 +233,7 @@ exports.NJUtils = Montage.create(Component, { return false; } } - + }, // Returns the numerical value and unit string from a string. @@ -257,14 +258,14 @@ exports.NJUtils = Montage.create(Component, { }, /* ================= Style methods ================= */ - + ///// Get computed height of element height : { value: function(node, pseudo) { return node.ownerDocument.defaultView.getComputedStyle(node, pseudo).getPropertyValue('height'); } }, - + /* ================= Array methods ================= */ ///// Return an array from an array-like object @@ -273,9 +274,9 @@ exports.NJUtils = Montage.create(Component, { return Array.prototype.slice.call(arrayLikeObj); } }, - + /* ================= String methods ================= */ - + ///// Return the last part of a path (e.g. filename) getFileNameFromPath : { value: function(path) { @@ -310,9 +311,9 @@ exports.NJUtils = Montage.create(Component, { value: function(len) { var length; len ? length = len : length = 8; - + return Uuid.generate().substring(0,length); } } - + }); diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js index fb70d18c..0c11726f 100755 --- a/js/lib/drawing/world.js +++ b/js/lib/drawing/world.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 @@ -68,7 +69,7 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) { { this._2DContext = canvas.getContext( "2d" ); } - + this._viewportWidth = canvas.width; this._viewportHeight = canvas.height; @@ -152,7 +153,7 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) { // Flag to play/pause animation at authortime this._previewAnimation = true; - + //////////////////////////////////////////////////////////////////////////////////// // RDGE // local variables @@ -175,7 +176,7 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) { var camMat = Matrix.I(4); camMat[14] = this.getViewDistance(); this.setCameraMat( camMat ); - + // post-load processing of the scene this.init = function() { @@ -184,13 +185,13 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) { if (ctx1 != ctx2) console.log( "***** different contexts *****" ); this.renderer = ctx1.renderer; this.renderer._world = this; - + // create a camera, set its perspective, and then point it at the origin var cam = new RDGE.camera(); this._camera = cam; cam.setPerspective(this.getFOV(), this.getAspect(), this.getZNear(), this.getZFar()); cam.setLookAt([0, 0, this.getViewDistance()], [0, 0, 0], RDGE.vec3.up()); - + // make this camera the active camera this.renderer.cameraManager().setActiveCamera(cam); @@ -198,61 +199,61 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) { //this.renderer.setClearFlags(RDGE.globals.engine.getContext().DEPTH_BUFFER_BIT); this.renderer.setClearColor([0.0, 0.0, 0.0, 0.0]); //this.renderer.NinjaWorld = this; - + // create an empty scene graph this.myScene = new RDGE.SceneGraph(); - + // create some lights // light 1 // this.light = RDGE.createLightNode("myLight"); // this.light.setPosition([0,0,1.2]); // this.light.setDiffuseColor([0.75,0.9,1.0,1.0]); - + // light 2 // this.light2 = RDGE.createLightNode("myLight2"); // this.light2.setPosition([-0.5,0,1.2]); // this.light2.setDiffuseColor([1.0,0.9,0.75,1.0]); - + // create a light transform var lightTr = RDGE.createTransformNode("lightTr"); - + // create and attach a material - materials hold the light data lightTr.attachMaterial(RDGE.createMaterialNode("lights")); - + // enable light channels 1, 2 - channel 0 is used by the default shader // lightTr.materialNode.enableLightChannel(1, this.light); // lightTr.materialNode.enableLightChannel(2, this.light2); - + // all added objects are parented to the light node this._rootNode = lightTr; - + // add the light node to the scene this.myScene.addNode(lightTr); - + // Add the scene to the engine - necessary if you want the engine to draw for you //RDGE.globals.engine.AddScene("myScene" + this._canvas.id, this.myScene); - var name = this._canvas.getAttribute( "data-RDGE-id" ); + var name = this._canvas.getAttribute( "data-RDGE-id" ); RDGE.globals.engine.AddScene("myScene" + name, this.myScene); }; - - // main code for handling user interaction and updating the scene + + // main code for handling user interaction and updating the scene this.update = function(dt) { if (!dt) dt = 0.2; - + dt = 0.01; // use our own internal throttle this.elapsed += dt; - + if (this._useWebGL) { // changed the global position uniform of light 0, another way to change behavior of a light RDGE.rdgeGlobalParameters.u_light0Pos.set([5 * Math.cos(this.elapsed), 5 * Math.sin(this.elapsed), 20]); - + // orbit the light nodes around the boxes // this.light.setPosition([1.2*Math.cos(this.elapsed*2.0), 1.2*Math.sin(this.elapsed*2.0), 1.2*Math.cos(this.elapsed*2.0)]); // this.light2.setPosition([-1.2*Math.cos(this.elapsed*2.0), 1.2*Math.sin(this.elapsed*2.0), -1.2*Math.cos(this.elapsed)]); } - + this.updateMaterials( this.getGeomRoot(), this.elapsed ); // now update all the nodes in the scene @@ -260,7 +261,7 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) { this.myScene.update(dt); }; - // defining the draw function to control how the scene is rendered + // defining the draw function to control how the scene is rendered this.draw = function() { if (this._useWebGL) @@ -306,12 +307,12 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) { this.render(); } }; - + this.onRunState = function() { // console.log( "GLWorld.onRunState" ); this.restartRenderLoop(); }; - + this.onLoadState = function() { // console.log( "GLWorld.onLoadState" ); }; @@ -375,7 +376,7 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) { world.textureMapLoaded( name ); } }; - + this.hasAnimatedMaterials = function() { var root = this.getGeomRoot(); var rtnVal = false; @@ -433,7 +434,7 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) { { this._notifier.removeListener( obj ); } - + // start RDGE passing your runtime object, and false to indicate we don't need a an initialization state // in the case of a procedurally built scene an init state is not needed for loading data this._canvas.rdgeid = this._canvas.getAttribute( "data-RDGE-id" ); @@ -486,7 +487,7 @@ World.prototype.updateObject = function (obj) { ctrTrNode.attachMeshNode(this.renderer.id + "_prim_" + this._nodeCounter++, prims[0]); ctrTrNode.attachMaterial(materialNodes[0]); } - + // delete all of the child nodes var i; var childTrNode; @@ -803,11 +804,11 @@ World.prototype.render = function() var ctx = this.get2DContext(); if (!ctx) return; ctx.clearRect(0, 0, this.getViewportWidth(), this.getViewportHeight()); - + // render the geometry var root = this.getGeomRoot(); this.hRender( root ); - } + } else { RDGE.globals.engine.setContext( this._canvas.rdgeid ); @@ -834,7 +835,7 @@ World.prototype.setViewportFromCanvas = function(canvas) { this._glContext.viewportHeight = canvas.height; this.getCamera().setPerspective(this.getFOV(), this.getAspect(), this.getZNear(), this.getZFar()); - + this.renderer.setViewPort(0, 0, canvas.width, canvas.height); } }; @@ -863,7 +864,7 @@ World.prototype.getShapeFromPoint = function( offsetX, offsetY ) { World.prototype.exportJSON = function () { // world properties - var worldObj = + var worldObj = { 'version' : 1.1, 'id' : this.getCanvas().getAttribute( "data-RDGE-id" ), @@ -900,7 +901,7 @@ World.prototype.exportJSON = function () // and pre-JSON versions of fileIO. // the ending ';' in the version string is necessary jStr = "v1.0;" + jStr; - + return jStr; }; @@ -963,7 +964,7 @@ World.prototype.importJSON = function (jObj) { // start RDGE rdgeStarted = true; - var id = this._canvas.getAttribute( "data-RDGE-id" ); + var id = this._canvas.getAttribute( "data-RDGE-id" ); this._canvas.rdgeid = id; RDGE.globals.engine.registerCanvas(this._canvas, this); RDGE.RDGEStart(this._canvas); diff --git a/js/lib/geom/anchor-point.js b/js/lib/geom/anchor-point.js index a1fcfc0d..3eb829f8 100755 --- a/js/lib/geom/anchor-point.js +++ b/js/lib/geom/anchor-point.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 @@ -30,14 +31,14 @@ POSSIBILITY OF SUCH DAMAGE. ///////////////////////////////////////////// // Class GLAnchorPoint -// GL representation of a point clicked +// GL representation of a point clicked // and dragged during pen tool -// -// +// +// ///////////////////////////////////////////// var GLAnchorPoint = function GLAnchorPoint() { ///////////////////////////////////////// - // Instance variables + // Instance variables ///////////////////////////////////////// this._x = 0.0; this._y = 0.0; @@ -99,7 +100,7 @@ GLAnchorPoint.prototype.translateNextFromPrev = function (tx, ty, tz) { if (totalTransSq < 0.0000001) { return; } - + // *** compute the rotation of the prev vector *** var oldP = [this._prevX + tx - this._x, this._prevY + ty - this._y, this._prevZ + tz - this._z]; var newP = [this._prevX - this._x, this._prevY - this._y, this._prevZ - this._z]; @@ -133,7 +134,7 @@ GLAnchorPoint.prototype.translatePrevFromNext = function (tx, ty, tz) { if (totalTransSq < 0.0000001) { return; } - + // *** compute the rotation of the next vector *** var oldN = [this._nextX + tx - this._x, this._nextY + ty - this._y, this._nextZ + tz - this._z]; var newN = [this._nextX - this._x, this._nextY - this._y, this._nextZ - this._z]; diff --git a/js/lib/geom/brush-stroke.js b/js/lib/geom/brush-stroke.js index e553a1c6..12f5c5a1 100755 --- a/js/lib/geom/brush-stroke.js +++ b/js/lib/geom/brush-stroke.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 @@ -52,7 +53,7 @@ var BrushStroke = function GLBrushStroke() { this._BBoxMax = [0, 0, 0]; this._isDirty = true; this._isInit = false; - + //the HTML5 canvas that holds this brush stroke this._canvas = null; //flag indicating whether or not to freeze the size and position of canvas @@ -312,7 +313,7 @@ BrushStroke.prototype.setWidth = function (newW) { } var minWidth = 1+this._strokeWidth; if (newW -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 @@ -861,7 +862,7 @@ exports.Circle = Object.create(GeomObj, { var ivrt = 0, iuv = 0; var uMin = 1.e8, uMax = -1.e8, vMin = 1.e8, vMax = -1.e8; - + var i, index = 3; var xMin = vrts[0], xMax = vrts[0], yMin = vrts[1], yMax = vrts[1]; diff --git a/js/lib/geom/geom-obj.js b/js/lib/geom/geom-obj.js index 4b8e1c69..06c3cdc2 100755 --- a/js/lib/geom/geom-obj.js +++ b/js/lib/geom/geom-obj.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 @@ -332,7 +333,7 @@ exports.GeomObj = Object.create(Object.prototype, { this._materialArray.push(fillMaterial); this._materialTypeArray.push("fill"); - + // don't set the value here. The material editor may set a color directly // to the material without setting this value in the obj. The following // lines of code will clobber the value in the material diff --git a/js/lib/geom/line.js b/js/lib/geom/line.js index a44026eb..87c8799e 100755 --- a/js/lib/geom/line.js +++ b/js/lib/geom/line.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 diff --git a/js/lib/geom/rectangle.js b/js/lib/geom/rectangle.js index 0d302d50..94e66eb6 100755 --- a/js/lib/geom/rectangle.js +++ b/js/lib/geom/rectangle.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 diff --git a/js/lib/geom/shape-primitive.js b/js/lib/geom/shape-primitive.js index 34db60e8..e1b3f844 100644 --- a/js/lib/geom/shape-primitive.js +++ b/js/lib/geom/shape-primitive.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 @@ -183,7 +184,7 @@ ShapePrimitive.refineMesh = function( verts, norms, uvs, indices, nVertices, pa var x0 = verts[iPt0], y0 = verts[iPt0+1], z0 = verts[iPt0+2], x1 = verts[iPt1], y1 = verts[iPt1+1], z1 = verts[iPt1+2], x2 = verts[iPt2], y2 = verts[iPt2+1], z2 = verts[iPt2+2]; - + // calculate the midpoints of the edges var xA = (x0 + x1)/2.0, yA = (y0 + y1)/2.0, zA = (z0 + z1)/2.0, xB = (x1 + x2)/2.0, yB = (y1 + y2)/2.0, zB = (z1 + z2)/2.0, diff --git a/js/lib/geom/sub-path.js b/js/lib/geom/sub-path.js index f047224d..92f3df64 100755 --- a/js/lib/geom/sub-path.js +++ b/js/lib/geom/sub-path.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 @@ -78,7 +79,7 @@ var GLSubpath = function GLSubpath() { //drawing context this._world = null; this._canvas = null; //todo this might be unnecessary (but faster) since we can get it from the world - + //tool that owns this subpath this._drawingTool = null; @@ -380,7 +381,7 @@ GLSubpath.prototype.removeAnchor = function (index) { retAnchor = this._Anchors.splice(index, 1); } this.makeDirty(); - + } //deselect any selected anchor point this.deselectAnchorPoint(); diff --git a/js/lib/math/matrix.js b/js/lib/math/matrix.js index 067f83e2..fcb26bc2 100755 --- a/js/lib/math/matrix.js +++ b/js/lib/math/matrix.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 @@ -57,8 +58,8 @@ Matrix.I = function(dimen) { mat[index] = 1.0; index += dimen + 1; } - - return mat; + + return mat; }; Matrix.Translation = function (vec) { diff --git a/js/lib/rdge/materials/bump-metal-material.js b/js/lib/rdge/materials/bump-metal-material.js index 3db3df1d..cb346d0d 100755 --- a/js/lib/rdge/materials/bump-metal-material.js +++ b/js/lib/rdge/materials/bump-metal-material.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 @@ -100,7 +101,7 @@ var BumpMetalMaterial = function BumpMetalMaterial() { /////////////////////////////////////////////////////////////////////////////////////// // RDGE shader - + // shader spec (can also be loaded from a .JSON file, or constructed at runtime) var bumpMetalMaterialDef = bumpMetalShaderDef = { @@ -109,7 +110,7 @@ var bumpMetalMaterialDef = bumpMetalShaderDef = // this shader is being referenced by file 'defaultVShader':"assets/shaders/test_vshader.glsl", 'defaultFShader':"assets/shaders/test_fshader.glsl", - + // this shader is inline 'dirLightVShader': "\ uniform mat4 u_mvMatrix;\ @@ -124,7 +125,7 @@ var bumpMetalMaterialDef = bumpMetalShaderDef = vNormal.xyz = (u_normalMatrix*vec4(a_nrm, 0.0)).xyz;\ gl_Position = u_projMatrix * u_mvMatrix * vec4(a_pos,1.0);\ vPos = (u_worldMatrix * vec4(a_pos,1.0)).xyz;\ - }", + }", 'dirLightFShader': "\ precision highp float;\ uniform vec4 u_light1Diff;\ @@ -144,7 +145,7 @@ var bumpMetalMaterialDef = bumpMetalShaderDef = }" }, 'techniques': - { + { 'default': [ { @@ -158,7 +159,7 @@ var bumpMetalMaterialDef = bumpMetalShaderDef = 'texcoord' : { 'type' : 'vec2' } }, // parameters - 'params' : + 'params' : { 'u_light0Diff' : { 'type' : 'vec4' }, 'u_colMap': { 'type' : 'tex2d' }, @@ -167,7 +168,7 @@ var bumpMetalMaterialDef = bumpMetalShaderDef = }, // render states - 'states' : + 'states' : { 'depthEnable' : true, 'offset':[1.0, 0.1] @@ -183,12 +184,12 @@ var bumpMetalMaterialDef = bumpMetalShaderDef = 'a_nrm' : { 'type' : 'vec3' } }, // parameters - 'params' : + 'params' : { }, // render states - 'states' : + 'states' : { 'depthEnable' : true, "blendEnable" : true, diff --git a/js/lib/rdge/materials/cloud-material.js b/js/lib/rdge/materials/cloud-material.js index 4e2a1a7c..46731fbd 100644 --- a/js/lib/rdge/materials/cloud-material.js +++ b/js/lib/rdge/materials/cloud-material.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 @@ -225,7 +226,7 @@ var CloudMaterial = function CloudMaterial() } var technique, renderer, tex; - + // update the cloud map material var material = this._materialNode; if (material) @@ -261,7 +262,7 @@ var CloudMaterial = function CloudMaterial() { // save the current RDGE context so we can reset it later var saveContext = RDGE.globals.engine.getContext(); - this.getWorld().stop(); + this.getWorld().stop(); // build a world to do the rendering if (!GLWorld) GLWorld = require("js/lib/drawing/world").World; @@ -349,7 +350,7 @@ var CloudMaterial = function CloudMaterial() var hWidth = -z*(r-l)/(2.0*zn)*xFillNDC, hHeight = -z*(t-b)/(2.0*zn)*yFillNDC; - + //this.createFill([x,y], 2*xFill, 2*yFill, tlRadius, blRadius, brRadius, trRadius, fillMaterial); var ctr = [x,y], width = 2*hWidth, height = 2*hHeight; var cloudSize = width > height ? 0.25*width : 0.25*height; @@ -377,12 +378,12 @@ var CloudMaterial = function CloudMaterial() this._adjustedZMin = zMin; this._adjustedZMax = zMax; - + // build the polygons var verts = [], normals = [ [0,0,1], [0,0,1], [0,0,1], [0,0,1] ], uvs = [ [0,0], [1,0], [1,1], [0,1] ]; - + for ( i = 0; i < 20; i++ ) { // var x = hWidth*2*(Math.random() - 0.5), @@ -496,17 +497,17 @@ var cloudMaterialDef = ] } }; - + // the cloud map material def is used to map the cloud image onto // the destination geometry var cloudMapMaterialDef = -{'shaders': +{'shaders': { 'defaultVShader':"assets/shaders/Basic.vert.glsl", 'defaultFShader':"assets/shaders/BasicTex.frag.glsl" }, 'techniques': - { + { 'default': [ { @@ -520,13 +521,13 @@ var cloudMapMaterialDef = 'texcoord' : { 'type' : 'vec2' } }, // parameters - 'params' : + 'params' : { 'u_tex0' : { 'type' : 'tex2d' }, }, // render states - 'states' : + 'states' : { 'depthEnable' : true, 'offset':[1.0, 0.1] diff --git a/js/lib/rdge/materials/deform-material.js b/js/lib/rdge/materials/deform-material.js index 234f22e4..68084d0e 100644 --- a/js/lib/rdge/materials/deform-material.js +++ b/js/lib/rdge/materials/deform-material.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 @@ -102,16 +103,16 @@ var DeformMaterial = function DeformMaterial() { /////////////////////////////////////////////////////////////////////////////////////// // RDGE shader - + // shader spec (can also be loaded from a .JSON file, or constructed at runtime) var deformMaterialDef = -{'shaders': +{'shaders': { 'defaultVShader':"assets/shaders/Basic.vert.glsl", 'defaultFShader':"assets/shaders/Deform.frag.glsl" }, 'techniques': - { + { 'default': [ { @@ -125,7 +126,7 @@ var deformMaterialDef = 'texcoord' : { 'type' : 'vec2' } }, // parameters - 'params' : + 'params' : { 'u_tex0': { 'type' : 'tex2d' }, 'u_time' : { 'type' : 'float' }, @@ -134,7 +135,7 @@ var deformMaterialDef = }, // render states - 'states' : + 'states' : { 'depthEnable' : true, 'offset':[1.0, 0.1] diff --git a/js/lib/rdge/materials/flag-material.js b/js/lib/rdge/materials/flag-material.js index b87013ba..9d1c67d9 100644 --- a/js/lib/rdge/materials/flag-material.js +++ b/js/lib/rdge/materials/flag-material.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 @@ -70,7 +71,7 @@ var FlagMaterial = function FlagMaterial() { this._propValues[ this._propNames[3] ] = this._speed; - // a material can be animated or not. default is not. + // a material can be animated or not. default is not. // Any material needing continuous rendering should override this method this.isAnimated = function() { return true; }; this.getShaderDef = function() { return flagMaterialDef; } @@ -106,16 +107,16 @@ var FlagMaterial = function FlagMaterial() { /////////////////////////////////////////////////////////////////////////////////////// // RDGE shader - + // shader spec (can also be loaded from a .JSON file, or constructed at runtime) var flagMaterialDef = -{'shaders': +{'shaders': { 'defaultVShader':"assets/shaders/Flag.vert.glsl", 'defaultFShader':"assets/shaders/Flag.frag.glsl" }, 'techniques': - { + { 'default': [ { @@ -129,7 +130,7 @@ var flagMaterialDef = 'texcoord' : { 'type' : 'vec2' } }, // parameters - 'params' : + 'params' : { 'u_tex0': { 'type' : 'tex2d' }, 'u_time' : { 'type' : 'float' }, @@ -139,7 +140,7 @@ var flagMaterialDef = }, // render states - 'states' : + 'states' : { 'depthEnable' : true, 'offset':[1.0, 0.1] diff --git a/js/lib/rdge/materials/flat-material.js b/js/lib/rdge/materials/flat-material.js index 6b8bd2c5..14eddadb 100755 --- a/js/lib/rdge/materials/flat-material.js +++ b/js/lib/rdge/materials/flat-material.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 @@ -70,7 +71,7 @@ var FlatMaterial = function FlatMaterial() // set up the material node this._materialNode = RDGE.createMaterialNode("flatMaterial_" + world.generateUniqueNodeID()); this._materialNode.setShader(this._shader); - + this.setShaderValues(); } else @@ -91,9 +92,9 @@ var FlatMaterial = function FlatMaterial() /////////////////////////////////////////////////////////////////////////////////////// // RDGE shader - + // shader spec (can also be loaded from a .JSON file, or constructed at runtime) -flatShaderDef = +flatShaderDef = { 'shaders': { // shader files 'defaultVShader':"assets/shaders/Basic.vert.glsl", @@ -104,7 +105,7 @@ flatShaderDef = { 'vshader' : 'defaultVShader', 'fshader' : 'defaultFShader', - + // attributes 'attributes' : { diff --git a/js/lib/rdge/materials/fly-material.js b/js/lib/rdge/materials/fly-material.js index b4bf0972..839561d0 100644 --- a/js/lib/rdge/materials/fly-material.js +++ b/js/lib/rdge/materials/fly-material.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 @@ -97,17 +98,17 @@ var FlyMaterial = function FlyMaterial() { /////////////////////////////////////////////////////////////////////////////////////// // RDGE shader - + // shader spec (can also be loaded from a .JSON file, or constructed at runtime) var flyMaterialDef = { - 'shaders': + 'shaders': { 'defaultVShader':"assets/shaders/Basic.vert.glsl", 'defaultFShader':"assets/shaders/Fly.frag.glsl" }, 'techniques': - { + { 'default': [ { @@ -121,7 +122,7 @@ var flyMaterialDef = 'texcoord' : { 'type' : 'vec2' } }, // parameters - 'params' : + 'params' : { 'u_tex0': { 'type' : 'tex2d' }, 'u_time' : { 'type' : 'float' }, @@ -130,7 +131,7 @@ var flyMaterialDef = }, // render states - 'states' : + 'states' : { 'depthEnable' : true, 'offset':[1.0, 0.1] diff --git a/js/lib/rdge/materials/julia-material.js b/js/lib/rdge/materials/julia-material.js index eed9e79a..c1d6d1f8 100644 --- a/js/lib/rdge/materials/julia-material.js +++ b/js/lib/rdge/materials/julia-material.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