From 7bee50379c1df86bb571e0e8d6c08e24d25231f5 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Mon, 9 Jul 2012 16:38:08 -0700 Subject: BSD License --- .../RDGE/src/core/script/MeshManager.js | 65 ++++--- .../RDGE/src/core/script/RenderInitProcs.js | 27 +-- .../RDGE/src/core/script/RenderProcs.js | 23 +-- .../RDGE/src/core/script/ScreenQuad.js | 23 +-- .../RDGE/src/core/script/ShaderManager.js | 23 +-- .../RDGE/src/core/script/animation.js | 77 ++++---- js/helper-classes/RDGE/src/core/script/box.js | 23 +-- js/helper-classes/RDGE/src/core/script/camera.js | 47 ++--- js/helper-classes/RDGE/src/core/script/engine.js | 67 +++---- js/helper-classes/RDGE/src/core/script/fx/blur.js | 31 +-- js/helper-classes/RDGE/src/core/script/fx/ssao.js | 31 +-- .../RDGE/src/core/script/init_state.js | 23 +-- js/helper-classes/RDGE/src/core/script/jpass.js | 31 +-- js/helper-classes/RDGE/src/core/script/jshader.js | 43 +++-- .../RDGE/src/core/script/lightmanager.js | 23 +-- .../RDGE/src/core/script/math/mat4.js | 49 ++--- .../RDGE/src/core/script/math/quat.js | 29 +-- .../RDGE/src/core/script/math/vec2.js | 29 +-- .../RDGE/src/core/script/math/vec3.js | 45 ++--- .../RDGE/src/core/script/math/vec4.js | 27 +-- .../RDGE/src/core/script/objectManager.js | 47 ++--- js/helper-classes/RDGE/src/core/script/particle.js | 35 ++-- .../RDGE/src/core/script/precompiled.js | 33 ++-- .../RDGE/src/core/script/renderUtils.js | 29 +-- .../RDGE/src/core/script/rendercontext.js | 23 +-- js/helper-classes/RDGE/src/core/script/renderer.js | 49 ++--- .../RDGE/src/core/script/run_state.js | 23 +-- js/helper-classes/RDGE/src/core/script/runtime.js | 23 +-- .../RDGE/src/core/script/scenegraph.js | 45 ++--- .../RDGE/src/core/script/scenegraphNodes.js | 215 +++++++++++---------- .../RDGE/src/core/script/shadowLight.js | 25 +-- js/helper-classes/RDGE/src/core/script/sockets.js | 31 +-- .../RDGE/src/core/script/utilities.js | 49 ++--- 33 files changed, 698 insertions(+), 665 deletions(-) (limited to 'js/helper-classes/RDGE/src') diff --git a/js/helper-classes/RDGE/src/core/script/MeshManager.js b/js/helper-classes/RDGE/src/core/script/MeshManager.js index 768b7213..cb73a71a 100755 --- a/js/helper-classes/RDGE/src/core/script/MeshManager.js +++ b/js/helper-classes/RDGE/src/core/script/MeshManager.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 @@ -73,7 +74,7 @@ RDGE.MeshManager.prototype.loadMesh = function (meshStump, tempMesh) { // add the temp mesh to the map of loaded meshes this.modelMap[meshStump.name] = tempMesh; - + // update the request counter - we now have one more mesh to load this.requestCounter++; @@ -87,7 +88,7 @@ RDGE.MeshManager.prototype.loadMesh = function (meshStump, tempMesh) { */ RDGE.MeshManager.prototype.deleteMesh = function (name) { var model = this.modelMap[name]; - + if (model) { RDGE.globals.engine.ctxMan.forEach(function (context) { context.renderer.deletePrimitive(model.primitive); @@ -113,20 +114,20 @@ RDGE.MeshManager.prototype.getModelNames = function () { RDGE.MeshManager.prototype.processMeshData = function () { var renderer = RDGE.globals.engine.getContext().renderer; - + // loop through meshes and load ready data for (var index in this.readyList) { // if item is ready load it if (this.readyList[index] && this.readyList[index].ready && renderer.id === this.readyList[index].ctxID) { - + // pop the item var model = this.readyList[index]; this.readyList.splice(index, 1); - + var primset = new RDGE.rdgePrimitiveDefinition(); - - primset.vertexDefinition = + + primset.vertexDefinition = { // this shows two ways to map this data to an attribute "vert": { 'type': RDGE.rdgeConstants.VS_ELEMENT_POS, 'bufferIndex': 0, 'bufferUsage': RDGE.rdgeConstants.BUFFER_STATIC }, @@ -139,27 +140,27 @@ RDGE.MeshManager.prototype.processMeshData = function () { "a_texcoords": { 'type': RDGE.rdgeConstants.VS_ELEMENT_FLOAT2, 'bufferIndex': 2, 'bufferUsage': RDGE.rdgeConstants.BUFFER_STATIC }, "a_uv": { 'type': RDGE.rdgeConstants.VS_ELEMENT_FLOAT2, 'bufferIndex': 2, 'bufferUsage': RDGE.rdgeConstants.BUFFER_STATIC } }; - - primset.bufferStreams = + + primset.bufferStreams = [ model.root.data.coords, model.root.data.normals, model.root.data.uvs ]; - - primset.streamUsage = + + primset.streamUsage = [ RDGE.rdgeConstants.BUFFER_STATIC, RDGE.rdgeConstants.BUFFER_STATIC, RDGE.rdgeConstants.BUFFER_STATIC ]; - + primset.indexUsage = RDGE.rdgeConstants.BUFFER_STREAM; - + primset.indexBuffer = model.root.data.indices; renderer.createPrimitive( primset ); - + model.root.primitive = primset; // generate a bounding box for this mesh @@ -173,10 +174,10 @@ RDGE.MeshManager.prototype.processMeshData = function () { } this.modelMap[model.root.attribs.name] = model.root; - + // now that the model is load reduce the request count this.requestCounter--; - + this.onLoaded(model.root.attribs.name); //break; } @@ -185,7 +186,7 @@ RDGE.MeshManager.prototype.processMeshData = function () { }; RDGE.MeshManager.prototype.isReady = function () { - return this.readyList.length == 0; + return this.readyList.length == 0; }; RDGE.MeshManager.prototype.addOnLoadedCallback = function (callback) { @@ -203,14 +204,14 @@ RDGE.MeshManager.prototype.exportJSON = function () { for (var m in this.modelMap) { this.modelMap[m].primitive.built = false; } - + return JSON.stringify(this.modelMap); }; RDGE.MeshManager.prototype.importJSON = function (jsonMeshExport) { try { var tempModelMap = JSON.parse(jsonMeshExport); - + for (var m in tempModelMap) { if (!this.modelMap[m]) { this.modelMap[m] = tempModelMap[m]; @@ -218,13 +219,13 @@ RDGE.MeshManager.prototype.importJSON = function (jsonMeshExport) { } window.console.log("meshes imported"); } catch (e) { - window.console.error("error importing meshes: " + e.description ); + window.console.error("error importing meshes: " + e.description ); } }; /* * global function for the mesh manager to make mesh file requests - */ + */ RDGE.requestMesh = function (mesh) { var request = new XMLHttpRequest(); request.mesh = mesh; diff --git a/js/helper-classes/RDGE/src/core/script/RenderInitProcs.js b/js/helper-classes/RDGE/src/core/script/RenderInitProcs.js index a374efa6..2014fa76 100755 --- a/js/helper-classes/RDGE/src/core/script/RenderInitProcs.js +++ b/js/helper-classes/RDGE/src/core/script/RenderInitProcs.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 @@ -141,7 +142,7 @@ RDGE.renderInitProcDepthMap = function (renderObj) { // renderObj.addUniform("u_WTF2", g_lightMat[1], RDGE.UNIFORMTYPE.FLOAT4); // renderObj.addUniform("u_WTF3", g_lightMat[2], RDGE.UNIFORMTYPE.FLOAT4); // renderObj.addUniform("u_WTF4", g_lightMat[3], RDGE.UNIFORMTYPE.FLOAT4); - // + // // since the uniform data references should not change we can just bind one time renderObj.bindUniforms(); @@ -227,7 +228,7 @@ RDGE.renderInitShadowProjection = function (primSet, vertexData) { arrayPeek(material.renderObj).addBuffers(vertexData.indexObject, gl.ELEMENT_ARRAY_BUFFER); - gl.useProgram(null); + gl.useProgram(null); }; RDGE.renderInitRadialBlur = function(quad, shader) { diff --git a/js/helper-classes/RDGE/src/core/script/RenderProcs.js b/js/helper-classes/RDGE/src/core/script/RenderProcs.js index 1583ea14..b8c06b2c 100755 --- a/js/helper-classes/RDGE/src/core/script/RenderProcs.js +++ b/js/helper-classes/RDGE/src/core/script/RenderProcs.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/helper-classes/RDGE/src/core/script/ScreenQuad.js b/js/helper-classes/RDGE/src/core/script/ScreenQuad.js index eb3f29a0..d1cf4594 100755 --- a/js/helper-classes/RDGE/src/core/script/ScreenQuad.js +++ b/js/helper-classes/RDGE/src/core/script/ScreenQuad.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/helper-classes/RDGE/src/core/script/ShaderManager.js b/js/helper-classes/RDGE/src/core/script/ShaderManager.js index 06d44da5..e31f0297 100755 --- a/js/helper-classes/RDGE/src/core/script/ShaderManager.js +++ b/js/helper-classes/RDGE/src/core/script/ShaderManager.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/helper-classes/RDGE/src/core/script/animation.js b/js/helper-classes/RDGE/src/core/script/animation.js index 2e13cce6..9eee36ba 100755 --- a/js/helper-classes/RDGE/src/core/script/animation.js +++ b/js/helper-classes/RDGE/src/core/script/animation.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 @@ -32,11 +33,11 @@ POSSIBILITY OF SUCH DAMAGE. var RDGE = RDGE || {}; RDGE.animation = RDGE.animation || {}; -/** - * channelController - * The channel controller is really the workhorse of the RDGE animation system. It handles timing, - * interpolation, and sampling of attributes over the lifetime of an animation. Each channel controller - * is responsible for animating a single attribute. The current implementation supports animating vector, +/** + * channelController + * The channel controller is really the workhorse of the RDGE animation system. It handles timing, + * interpolation, and sampling of attributes over the lifetime of an animation. Each channel controller + * is responsible for animating a single attribute. The current implementation supports animating vector, * boolean, or quaternion attributes. This class is used internally by the animation system. * * @param _animation - the animation resource @@ -44,16 +45,16 @@ RDGE.animation = RDGE.animation || {}; * */ RDGE.animation.channelController = function (_animation, _channel) { - /** - * this.interpolate - Enable/Disable interpolation between animation frames. - * Typically this should be enabled for smoother looking animation. However, - * there may be applications where interpolation is undesireable. + /** + * this.interpolate - Enable/Disable interpolation between animation frames. + * Typically this should be enabled for smoother looking animation. However, + * there may be applications where interpolation is undesireable. */ this.interpolate = false; - /** - * this.animation - the animation resource. - * This is where the keyframes for the channel are stored. + /** + * this.animation - the animation resource. + * This is where the keyframes for the channel are stored. */ this.animation = _animation; @@ -77,20 +78,20 @@ RDGE.animation.channelController = function (_animation, _channel) { */ this.endTime = this.animation.clipEnd / this.animation.framesPerSec; - /** + /** * this.cachedFrame - cached frame index, this optimizes best case scenario computeFrame calls. */ this.cachedFrame = -1; - /** + /** * oneFrameInSecs - stores the interval of a single frame in seconds. This is used for internal calculations. */ oneFrameInSecs = 1.0 / _animation.framesPerSec; - /** - * this.channel.timeline - stores the animation timeline. - * Currently this is calculated based on the framePerSec settings of the animation. - * Eventually the timeline should be exported with the animation. Individual channels + /** + * this.channel.timeline - stores the animation timeline. + * Currently this is calculated based on the framePerSec settings of the animation. + * Eventually the timeline should be exported with the animation. Individual channels * may have different timelines depending on which frames are keyed. */ this.channel.timeline = new Array(this.channel.numKeys + 1); @@ -98,11 +99,11 @@ RDGE.animation.channelController = function (_animation, _channel) { this.channel.timeline[i] = i / this.animation.framesPerSec; } - /** this.computeFrame - * Calculates the current frame index of the animation at the current time. - * In the worst case, this function will perform a binary search for the frame - * whose time is closest to and less than the current time. In the best case, - * the current frame is near the most recently cached frame, or it remains unchanged. + /** this.computeFrame + * Calculates the current frame index of the animation at the current time. + * In the worst case, this function will perform a binary search for the frame + * whose time is closest to and less than the current time. In the best case, + * the current frame is near the most recently cached frame, or it remains unchanged. */ this.computeFrame = function () { var absTime = this.localTime + this.startTime; @@ -146,7 +147,7 @@ RDGE.animation.channelController = function (_animation, _channel) { } } - // binary search... + // binary search... while (start + 1 < end) { var mid = Math.floor((start + end) / 2); if (absTime > this.channel.timeline[mid]) { @@ -262,9 +263,9 @@ RDGE.animation.channelController = function (_animation, _channel) { }; }; -/** - * track - * Each track advances and samples from a list of channel controllers, and is assigned to a scene graph node. +/** + * track + * Each track advances and samples from a list of channel controllers, and is assigned to a scene graph node. * * @param _animation - the animation resource * @param _track - the track id diff --git a/js/helper-classes/RDGE/src/core/script/box.js b/js/helper-classes/RDGE/src/core/script/box.js index d33907a0..fe57d097 100755 --- a/js/helper-classes/RDGE/src/core/script/box.js +++ b/js/helper-classes/RDGE/src/core/script/box.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/helper-classes/RDGE/src/core/script/camera.js b/js/helper-classes/RDGE/src/core/script/camera.js index da9aff3d..290be1ef 100755 --- a/js/helper-classes/RDGE/src/core/script/camera.js +++ b/js/helper-classes/RDGE/src/core/script/camera.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 @@ -27,8 +28,8 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - * camera class +/* + * camera class */ var RDGE = RDGE || {}; @@ -84,7 +85,7 @@ RDGE.camera = function () { return p; }; - /* This is the old way + /* This is the old way var t = this.persp.near * Math.tan(0.017453292519943295769236 * this.persp.fov * 0.5); var r = t * this.persp.aratio; var u = t; @@ -204,7 +205,7 @@ RDGE.camera = function () { return 0.0; }; - // this is used by ambient occlusion... + // this is used by ambient occlusion... this.getFTR = function () { var fovyRad = (this.persp.fov * 0.5) * Math.PI / 180.0; return [ @@ -220,15 +221,15 @@ RDGE.camera = function () { /** Camera Manager - * This class is used to manage the active camera. It provides functionality - * for getting and setting the active camera, as well as providing stack operations - * to switch to and from multiple cameras. + * This class is used to manage the active camera. It provides functionality + * for getting and setting the active camera, as well as providing stack operations + * to switch to and from multiple cameras. */ RDGE.cameraManager = function () { this.stack = []; /* Set the active camera. - * This function sets the active camera to the given camera. + * This function sets the active camera to the given camera. */ this.setActiveCamera = function (c) { // pop the active camera off the stack. @@ -239,8 +240,8 @@ RDGE.cameraManager = function () { this.stack.push(c); }; - /* Get the active camera. - * The active camera always resides at the top of the stack. + /* Get the active camera. + * The active camera always resides at the top of the stack. */ this.getActiveCamera = function () { if (this.stack.length > 0) { @@ -250,14 +251,14 @@ RDGE.cameraManager = function () { } }; - /* Push a camera onto the stack. + /* Push a camera onto the stack. * The given camera becomes the active camera. */ this.pushCamera = function (c) { this.stack.push(c); }; - /* Pop a camera off the stack. + /* Pop a camera off the stack. * Returns the camera that was popped. * The next camera on the stack becomes active. */ diff --git a/js/helper-classes/RDGE/src/core/script/engine.js b/js/helper-classes/RDGE/src/core/script/engine.js index 36a34689..333d8437 100755 --- a/js/helper-classes/RDGE/src/core/script/engine.js +++ b/js/helper-classes/RDGE/src/core/script/engine.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 @@ -36,21 +37,21 @@ var RDGE = RDGE || {}; RDGE.stateManager = function () { // a stack of states this.stateStack = []; - + // number of states on the stack this.stateTop = undefined; - + // the states of the context this.RDGEInitState = null; this.RDGERunState = null; - + this.currentState = function () { if(this.stateTop != undefined) return this.stateStack[this.stateTop]; - + return null; }; - + /* * Push new IRuntime state - engine executes the new state */ @@ -58,10 +59,10 @@ RDGE.stateManager = function () { if (state != null && typeof state.Init == 'function') { if(this.stateTop != undefined) this.stateStack[this.stateTop].LeaveState(); - + if(flags == undefined || flags != "noInit") state.Init(); - + this.stateTop = this.stateStack.push(state) - 1; } }; @@ -74,9 +75,9 @@ RDGE.stateManager = function () { if (state != null) { state.Shutdown(); } - + this.stateTop = this.stateTop > 0 ? this.stateTop - 1 : 0; - + if (this.stateStack[this.stateTop]) { this.stateStack[this.stateTop].ReInit(); } @@ -90,7 +91,7 @@ RDGE.stateManager = function () { this.PopState(); } }; - + this.tick = function (dt) { if (this.stateStack[this.stateTop] != null) { this.stateStack[this.stateTop].Update(dt); @@ -256,7 +257,7 @@ RDGE.Engine.prototype.init = function (userInitState, userRunState, canvasObject globalParamFuncSet = function (param) { this.data = param.data; this.type =param.type; - + this.set = function (v) { var len = this.data ? this.data.length : 0; for(var i=0;i -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 @@ -38,7 +39,7 @@ RDGE.fx = RDGE.fx || {}; * See http://prideout.net/archive/bloom/ * @param mipSizes - up to three pow2 mip sizes to be separately blurred * and combined with the src image, e.g. [256,128,64] -* @param enAuxTexture - true to enable an extra texture to be added to +* @param enAuxTexture - true to enable an extra texture to be added to * the weighted blur mips (see doBlur) */ RDGE.fx.fxBlur = function (mipSizes, enAuxTexture) { @@ -140,10 +141,10 @@ RDGE.fx.fxBlur = function (mipSizes, enAuxTexture) { * See http://prideout.net/archive/bloom/ * @param srcTexture - source image to blur * @param dstRenderTarget - where to put the result of the blur -* @param weights - array of 4 blend weights for the blurred mip levels -* levels in the form [srcTexture-weight, mip0-weight, +* @param weights - array of 4 blend weights for the blurred mip levels +* levels in the form [srcTexture-weight, mip0-weight, * mip1-weight, mip2-weight] -* @param auxTexture - null, else an extra texture to be added to the +* @param auxTexture - null, else an extra texture to be added to the * weighted blur mips */ RDGE.fx.fxBlur.prototype.doBlur = function (srcTexture, dstRenderTarget, weights, auxTexture) { diff --git a/js/helper-classes/RDGE/src/core/script/fx/ssao.js b/js/helper-classes/RDGE/src/core/script/fx/ssao.js index e88beef5..23cbc247 100755 --- a/js/helper-classes/RDGE/src/core/script/fx/ssao.js +++ b/js/helper-classes/RDGE/src/core/script/fx/ssao.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 @@ -90,10 +91,10 @@ RDGE.fx.fxSSAO = function (enHRDepth) { * @param srcTexColor - color surface of rendered scene * @param srcTexNormDepth - screenspace normal+depth surface for scene; {nx, ny, nz, depth} * @param dstRenderTarget - where to put the result of SSAO -* @param sampleRadius - -* @param intensity - -* @param distScale - -* @param bias - +* @param sampleRadius - +* @param intensity - +* @param distScale - +* @param bias - */ RDGE.fx.fxSSAO.prototype.doSSAO = function (srcTexColor, srcTexNormDepth, srcTexHRDepth, dstRenderTarget, sampleRadius, intensity, distScale, bias) { // Set art params and other uniforms diff --git a/js/helper-classes/RDGE/src/core/script/init_state.js b/js/helper-classes/RDGE/src/core/script/init_state.js index d8d6d4c5..2afd8522 100755 --- a/js/helper-classes/RDGE/src/core/script/init_state.js +++ b/js/helper-classes/RDGE/src/core/script/init_state.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/helper-classes/RDGE/src/core/script/jpass.js b/js/helper-classes/RDGE/src/core/script/jpass.js index e3c5a342..47988fc8 100755 --- a/js/helper-classes/RDGE/src/core/script/jpass.js +++ b/js/helper-classes/RDGE/src/core/script/jpass.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 @@ -73,7 +74,7 @@ RDGE._jpassBaseClass = function () { // the name of this pass this.name = "renderPass_" + RDGE.nodeIdGen.getId(); - /* + /* * if 0 this pass and children are culled from rendering */ this.visibility = 1; @@ -431,8 +432,8 @@ RDGE.jpass = function (def) { else if ("renderList" == obj) { // put the items listed into their buckets var renderList = new Array(RDGE.rdgeConstants.categoryEnumeration.MAX_CAT); - renderList[RDGE.rdgeConstants.categoryEnumeration.BACKGROUND] = []; //BACKGROUND - renderList[RDGE.rdgeConstants.categoryEnumeration.OPAQUE] = []; //OPAQUE + renderList[RDGE.rdgeConstants.categoryEnumeration.BACKGROUND] = []; //BACKGROUND + renderList[RDGE.rdgeConstants.categoryEnumeration.OPAQUE] = []; //OPAQUE renderList[RDGE.rdgeConstants.categoryEnumeration.TRANSPARENT] = []; //TRANSPARENT renderList[RDGE.rdgeConstants.categoryEnumeration.ADDITIVE] = []; //ADDITIVE renderList[RDGE.rdgeConstants.categoryEnumeration.TRANSLUCENT] = []; //TRANSLUCENT @@ -593,7 +594,7 @@ RDGE.jpassGraph = function (def) { /* * Traverse the render graph, breadth first to produce the final render output - * note: breadth first is used to allow generation of an entire level at once, + * note: breadth first is used to allow generation of an entire level at once, * the peers in one level could, in theory, be processed in parallel */ this.render = function (sceneGraph) { diff --git a/js/helper-classes/RDGE/src/core/script/jshader.js b/js/helper-classes/RDGE/src/core/script/jshader.js index b9170857..b8cf24d4 100755 --- a/js/helper-classes/RDGE/src/core/script/jshader.js +++ b/js/helper-classes/RDGE/src/core/script/jshader.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 @@ -31,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. // RDGE namespaces var RDGE = RDGE || {}; -/* +/* this API should be familiar to anyone who has worked with HLSL effect files. */ @@ -45,27 +46,27 @@ RDGE.bindMap['vec2'] = function(ctx, a,b) { ctx.uniform2fv(a,b); }; RDGE.bindMap['vec3'] = function(ctx, a,b) { ctx.uniform3fv(a,b); }; RDGE.bindMap['vec4'] = function(ctx, a,b) { ctx.uniform4fv(a,b); }; RDGE.bindMap['mat3'] = function(ctx, a,b) { ctx.uniformMatrix3fv(a,false,b); }; -RDGE.bindMap['mat4'] = function(ctx, a,b) -{ - ctx.uniformMatrix4fv(a,false,b); +RDGE.bindMap['mat4'] = function(ctx, a,b) +{ + ctx.uniformMatrix4fv(a,false,b); RDGE.globals.engine.getContext().debug.mat4CallCount++; }; -RDGE.bindMap['tex2d'] = function(ctx, a,b) +RDGE.bindMap['tex2d'] = function(ctx, a,b) { ctx.activeTexture(ctx.TEXTURE0+b[0]); ctx.bindTexture(ctx.TEXTURE_2D, b[1]); ctx.uniform1iv(a,[b[0]]); }; -RDGE.bindMap['texCube']=function(ctx, a,b) +RDGE.bindMap['texCube']=function(ctx, a,b) { ctx.activeTexture(ctx.TEXTURE0+b[0]); ctx.bindTexture(ctx.TEXTURE_CUBE_MAP, b[1]); ctx.uniform1iv(a,[b[0]]); }; -RDGE.lightDataMap = +RDGE.lightDataMap = [ function(ctx, loc, lightNode) { ctx.uniform3fv(loc, lightNode.position); }, function(ctx, loc, lightNode) { ctx.uniform4fv(loc, lightNode.lightDiffuse); }, @@ -410,7 +411,7 @@ RDGE.jshader = function (addr) { // link up aliases for (var p in curTechnique[i].params) { if (typeof curTechnique[i].params[p] == 'string') { - // this just redirects to an already existing parameter. + // this just redirects to an already existing parameter. this[t][p] = this[t].passes[i].params[p]; } } @@ -446,7 +447,7 @@ RDGE.jshader = function (addr) { /* * Init a local parameter at any time during the life of the jshader. - * This will add the parameter to the list of parameters to be bound + * This will add the parameter to the list of parameters to be bound * before rendering */ this.initLocalParameter = function (name, param) { @@ -518,7 +519,7 @@ RDGE.jshader = function (addr) { source = vShaderDef; } else { var vshaderRequest = new XMLHttpRequest(); - var urlVertShader = vShaderDef; + var urlVertShader = vShaderDef; vshaderRequest.open("GET", urlVertShader, false); vshaderRequest.send(null); source = vshaderRequest.responseText; diff --git a/js/helper-classes/RDGE/src/core/script/lightmanager.js b/js/helper-classes/RDGE/src/core/script/lightmanager.js index e38418f5..ef4f63d8 100755 --- a/js/helper-classes/RDGE/src/core/script/lightmanager.js +++ b/js/helper-classes/RDGE/src/core/script/lightmanager.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/helper-classes/RDGE/src/core/script/math/mat4.js b/js/helper-classes/RDGE/src/core/script/math/mat4.js index 32c7111c..a0f47bcf 100755 --- a/js/helper-classes/RDGE/src/core/script/math/mat4.js +++ b/js/helper-classes/RDGE/src/core/script/math/mat4.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 @@ -29,8 +30,8 @@ POSSIBILITY OF SUCH DAMAGE. */ /** -* This library contains functions for operating on 4x4 matrices. Any JS array -* containing at least 16 numeric components can represent a 4x4 matrix. +* This library contains functions for operating on 4x4 matrices. Any JS array +* containing at least 16 numeric components can represent a 4x4 matrix. * * For example, all of these are valid matrix construction methods: * ... @@ -39,15 +40,15 @@ POSSIBILITY OF SUCH DAMAGE. * var c = mat4.lookAt( [0, 0, 0], [1, 0, 0], [ 0, 1, 0 ] ); * var d = mat4.basis( [1, 0, 0], [0, 1, 0], [ 0, 0, 1 ] ); * -* This library is implemented assuming components are arranged -* contiguously in memory as such: +* This library is implemented assuming components are arranged +* contiguously in memory as such: * M = [ x0, x1, x2, x3, * y0, y1, y2, y3, * z0, z1, z2, z3, * w0, w1, w2, w3 ]; -* The translation components of a transformation matrix would be stored in -* w0, w1, w2, or at indices 12, 13, and 14 of the array, as is consistent -* with OpenGL. +* The translation components of a transformation matrix would be stored in +* w0, w1, w2, or at indices 12, 13, and 14 of the array, as is consistent +* with OpenGL. */ // RDGE namespaces var RDGE = RDGE || {}; @@ -81,7 +82,7 @@ RDGE.mat4.toCSSString = function (m, conversionConstant) { /** * RDGE.mat4.verify -* This function is provided for debugging purposes only. It is not recommended +* This function is provided for debugging purposes only. It is not recommended * to be used in performance critical areas of the code. */ RDGE.mat4.verify = function (m) { @@ -231,10 +232,10 @@ RDGE.mat4.angleAxis = function (angle, axis) { RDGE.mat4.lookAt = function (eye, at, up) { /* var w_axis = new RDGE.vec3(posVec.x, posVec.y, posVec.z); - + var z_axis = subVec3(targetVec, w_axis); z_axis.normalize(); - + var x_axis = crossVec3(upVec, z_axis); x_axis.normalize(); @@ -522,7 +523,7 @@ RDGE.mat4._adjoint = function (m) { */ RDGE.mat4.inverse = function (m) { // Calculate the 4x4 determinant - // If the determinant is zero, + // If the determinant is zero, // then the inverse matrix is not unique. var det = RDGE.mat4._det4x4(m); @@ -580,7 +581,7 @@ RDGE.mat4.transformPoint = function (m, v) { m[1] * x + m[5] * y + m[9] * z + m[1