From 04343eda8c2f870b0da55cfdc8003c99fe1cc4de Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 6 Jul 2012 11:53:10 -0700 Subject: Remove trailing spaces --- .../RDGE/src/core/script/MeshManager.js | 42 ++--- .../RDGE/src/core/script/RenderInitProcs.js | 4 +- .../RDGE/src/core/script/animation.js | 54 +++--- js/helper-classes/RDGE/src/core/script/camera.js | 24 +-- js/helper-classes/RDGE/src/core/script/engine.js | 44 ++--- js/helper-classes/RDGE/src/core/script/fx/blur.js | 8 +- js/helper-classes/RDGE/src/core/script/fx/ssao.js | 8 +- js/helper-classes/RDGE/src/core/script/jpass.js | 8 +- js/helper-classes/RDGE/src/core/script/jshader.js | 20 +-- .../RDGE/src/core/script/math/mat4.js | 26 +-- .../RDGE/src/core/script/math/quat.js | 6 +- .../RDGE/src/core/script/math/vec2.js | 6 +- .../RDGE/src/core/script/math/vec3.js | 22 +-- .../RDGE/src/core/script/math/vec4.js | 4 +- .../RDGE/src/core/script/objectManager.js | 24 +-- js/helper-classes/RDGE/src/core/script/particle.js | 12 +- .../RDGE/src/core/script/precompiled.js | 10 +- .../RDGE/src/core/script/renderUtils.js | 6 +- js/helper-classes/RDGE/src/core/script/renderer.js | 26 +-- .../RDGE/src/core/script/scenegraph.js | 22 +-- .../RDGE/src/core/script/scenegraphNodes.js | 192 ++++++++++----------- .../RDGE/src/core/script/shadowLight.js | 2 +- js/helper-classes/RDGE/src/core/script/sockets.js | 8 +- .../RDGE/src/core/script/utilities.js | 26 +-- 24 files changed, 302 insertions(+), 302 deletions(-) (limited to 'js/helper-classes/RDGE/src/core/script') diff --git a/js/helper-classes/RDGE/src/core/script/MeshManager.js b/js/helper-classes/RDGE/src/core/script/MeshManager.js index 81359fc4..1fff19c5 100755 --- a/js/helper-classes/RDGE/src/core/script/MeshManager.js +++ b/js/helper-classes/RDGE/src/core/script/MeshManager.js @@ -73,7 +73,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 +87,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 +113,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 +139,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 +173,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 +185,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 +203,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 +218,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..20b37abb 100755 --- a/js/helper-classes/RDGE/src/core/script/RenderInitProcs.js +++ b/js/helper-classes/RDGE/src/core/script/RenderInitProcs.js @@ -141,7 +141,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 +227,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/animation.js b/js/helper-classes/RDGE/src/core/script/animation.js index 2e13cce6..2af5b207 100755 --- a/js/helper-classes/RDGE/src/core/script/animation.js +++ b/js/helper-classes/RDGE/src/core/script/animation.js @@ -32,11 +32,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 +44,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 +77,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 +98,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 +146,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 +262,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/camera.js b/js/helper-classes/RDGE/src/core/script/camera.js index e85fe593..28d307ae 100755 --- a/js/helper-classes/RDGE/src/core/script/camera.js +++ b/js/helper-classes/RDGE/src/core/script/camera.js @@ -27,8 +27,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 +84,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 +204,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 +220,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 +239,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 +250,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 b2191197..96c3d502 100755 --- a/js/helper-classes/RDGE/src/core/script/engine.js +++ b/js/helper-classes/RDGE/src/core/script/engine.js @@ -36,21 +36,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 +58,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 +74,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 +90,7 @@ RDGE.stateManager = function () { this.PopState(); } }; - + this.tick = function (dt) { if (this.stateStack[this.stateTop] != null) { this.stateStack[this.stateTop].Update(dt); @@ -256,7 +256,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 */ /** -* 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 +39,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 +81,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 +231,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 +522,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 +580,7 @@ RDGE.mat4.transformPoint = function (m, v) { m[1] * x + m[5] * y + m[9] * z + m[13] * w, m[2] * x + m[6] * y + m[10] * z + m[14] * w, m[3] * x + m[7] * y + m[11] * z + m[15] * w]; - // 12 adds, 16 multiplies, 16 lookups. + // 12 adds, 16 multiplies, 16 lookups. }; /** @@ -589,7 +589,7 @@ RDGE.mat4.transformPoint = function (m, v) { RDGE.mat4.transformVector = function (m, v) { m = RDGE.mat4.inverse(m); var x = v[0], y = v[1], z = v[2], w = v.length >= 4 ? v[3] : 0.0; - // 12 adds, 16 multiplies, 16 lookups. + // 12 adds, 16 multiplies, 16 lookups. // transpose multiply return [m[0] * x + m[1] * y + m[2] * z + m[3] * w, m[4] * x + m[5] * y + m[6] * z + m[7] * w, diff --git a/js/helper-classes/RDGE/src/core/script/math/quat.js b/js/helper-classes/RDGE/src/core/script/math/quat.js index d243a7ba..d3a3db5c 100755 --- a/js/helper-classes/RDGE/src/core/script/math/quat.js +++ b/js/helper-classes/RDGE/src/core/script/math/quat.js @@ -33,9 +33,9 @@ POSSIBILITY OF SUCH DAMAGE. * RDGE.quat = {} * This library contains utility functions for operating on quaternions. * -- -* TODO: -* -need to add more helper functions for generating quaternions from -* other representations (i.e. - eulers, angle-axis). +* TODO: +* -need to add more helper functions for generating quaternions from +* other representations (i.e. - eulers, angle-axis). */ var RDGE = RDGE || {}; RDGE.quat = {}; diff --git a/js/helper-classes/RDGE/src/core/script/math/vec2.js b/js/helper-classes/RDGE/src/core/script/math/vec2.js index a003130d..e5c7df06 100755 --- a/js/helper-classes/RDGE/src/core/script/math/vec2.js +++ b/js/helper-classes/RDGE/src/core/script/math/vec2.js @@ -31,8 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. /** * RDGE.vec2 = {} -* This library contains functions for operating on 2D vectors. -* A 2D vector can be any array containing at least 2 numeric components. +* This library contains functions for operating on 2D vectors. +* A 2D vector can be any array containing at least 2 numeric components. * All of the following are valid methods for declaring a RDGE.vec2: * var a = [0, 1]; * var b = RDGE.vec2.zero(); @@ -50,7 +50,7 @@ RDGE.vec2.string = function (v) { /** * RDGE.vec2.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.vec2.verify = function (v) { diff --git a/js/helper-classes/RDGE/src/core/script/math/vec3.js b/js/helper-classes/RDGE/src/core/script/math/vec3.js index 72662513..86d17e04 100755 --- a/js/helper-classes/RDGE/src/core/script/math/vec3.js +++ b/js/helper-classes/RDGE/src/core/script/math/vec3.js @@ -31,8 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. /** * RDGE.vec3 = {} - * This library contains functions for operating on 3D vectors. Any JS array - * containing at least 3 numeric components can represent a 3D vector. + * This library contains functions for operating on 3D vectors. Any JS array + * containing at least 3 numeric components can represent a 3D vector. * * For example, all of these are valid RDGE.vec3 declarations: * var a = [0, 0, 1]; @@ -52,7 +52,7 @@ RDGE.vec3.string = function (v) { /** * RDGE.vec3.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.vec3.verify = function (v) { @@ -94,7 +94,7 @@ RDGE.vec3.translation = function (m) { }; /** -* RDGE.vec3.basisX = function( m ) +* RDGE.vec3.basisX = function( m ) * description : returns a vector containing the translation vector of m. */ RDGE.vec3.basisX = function (m) { @@ -102,7 +102,7 @@ RDGE.vec3.basisX = function (m) { }; /** -* RDGE.vec3.basisY = function( m ) +* RDGE.vec3.basisY = function( m ) * description : returns a vector containing the translation vector of m. */ RDGE.vec3.basisY = function (m) { @@ -110,7 +110,7 @@ RDGE.vec3.basisY = function (m) { }; /** -* RDGE.vec3.basisZ = function( m ) +* RDGE.vec3.basisZ = function( m ) * description : returns a vector containing the translation vector of m. */ RDGE.vec3.basisZ = function (m) { @@ -155,14 +155,14 @@ RDGE.vec3.random = function (min, max) { }; /** -* RDGE.vec3.xy +* RDGE.vec3.xy */ RDGE.vec3.xy = function (v) { return [v[0], v[1]]; }; /** -* RDGE.vec3.xz +* RDGE.vec3.xz */ RDGE.vec3.xz = function (v) { return [v[0], v[2]]; @@ -222,7 +222,7 @@ RDGE.vec3.plusEqualMul = function (a, b, s) { }; /** -* RDGE.vec3.scale +* RDGE.vec3.scale */ RDGE.vec3.scale = function (v, s) { if (s.length !== undefined && s.length >= 3) { @@ -264,7 +264,7 @@ RDGE.vec3.normalize = function (v) { }; /** -* RDGE.vec3.cross +* RDGE.vec3.cross */ RDGE.vec3.cross = function (a, b) { return [a[1] * b[2] - b[1] * a[2], @@ -273,7 +273,7 @@ RDGE.vec3.cross = function (a, b) { }; /** -* RDGE.vec3.dot +* RDGE.vec3.dot */ RDGE.vec3.dot = function (a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; diff --git a/js/helper-classes/RDGE/src/core/script/math/vec4.js b/js/helper-classes/RDGE/src/core/script/math/vec4.js index 3c2d96e7..f273c835 100755 --- a/js/helper-classes/RDGE/src/core/script/math/vec4.js +++ b/js/helper-classes/RDGE/src/core/script/math/vec4.js @@ -30,8 +30,8 @@ POSSIBILITY OF SUCH DAMAGE. /** * RDGE.vec4 = {} -* This library contains functions for operating on 4D vectors. Any JS array -* containing at least 4 numeric components can represent a 4D vector. +* This library contains functions for operating on 4D vectors. Any JS array +* containing at least 4 numeric components can represent a 4D vector. * * For example, all of these are valid RDGE.vec4 declarations: * var a = [0, 0, 0, 1]; diff --git a/js/helper-classes/RDGE/src/core/script/objectManager.js b/js/helper-classes/RDGE/src/core/script/objectManager.js index cb9847e6..768768ff 100755 --- a/js/helper-classes/RDGE/src/core/script/objectManager.js +++ b/js/helper-classes/RDGE/src/core/script/objectManager.js @@ -37,18 +37,18 @@ RDGE.objectManager = function() { this.objects = []; this.numObjects = 0; this.freelist = []; - + this.reset = function() { this.objects = []; this.freelist = []; this.guidCounter = 0; } - + // validHandle this.validHandle = function(h) { return this.handleToIndex(h) != -1; } - + // handleToIndex this.handleToIndex = function(h) { var index = ( h >> 16 ) & 0xFFFF; @@ -58,35 +58,35 @@ RDGE.objectManager = function() { return -1; } - // handleToObject + // handleToObject this.handleToObject = function(h) { - var index = this.handleToIndex( h ); + var index = this.handleToIndex( h ); if( index != -1 ) { return this.objects[index]; } return null; } - + // add object this.addObject = function(ob) { var index = this.objects.length; if( this.freelist.length > 0 ) { - index = this.freelist.pop(); + index = this.freelist.pop(); } if( ++this.guidCounter >= 0xFFFF ) { // wrap the counter, zero is reserved for invalid handles. this.guidCounter = 1; } - ob.handle = ( index << 16 | ++this.guidCounter ); + ob.handle = ( index << 16 | ++this.guidCounter ); this.objects[index] = ob; - + return ob.handle; } - + // remove object - this.removeObject = function(h) { - var index = this.handleToIndex( h ); + this.removeObject = function(h) { + var index = this.handleToIndex( h ); if( index != -1 ) { if( this.objects[index].onremove != undefined ) { this.objects[index].onremove(); diff --git a/js/helper-classes/RDGE/src/core/script/particle.js b/js/helper-classes/RDGE/src/core/script/particle.js index 158807bb..1730e823 100755 --- a/js/helper-classes/RDGE/src/core/script/particle.js +++ b/js/helper-classes/RDGE/src/core/script/particle.js @@ -77,7 +77,7 @@ RDGE.particle = function (def, id) { // calculate the initial position in world space. this.pos = RDGE.mat4.transformPoint(spawnMatrix, this.pos); } - // all other values are assumed to be defined in local or world space depending on + // all other values are assumed to be defined in local or world space depending on // the particles worldSpace designation. var toRadians = Math.PI / 180.0; if (this.def.initialsize) { @@ -334,10 +334,10 @@ RDGE.particleBuffer = function (pdef, emitter, size) { var x, y, z, w; var p = this.particles[i]; var age = (p.age / p.lifespan); // normalized age - // combine frame number and age and store in w. - // to decode : - // frame = floor( w ); - // age = fract( w ); + // combine frame number and age and store in w. + // to decode : + // frame = floor( w ); + // age = fract( w ); var pw = Math.min(age, 0.999) + Math.floor(p.frame); if (age < 1.0) { // || (pdef.persist != undefined && pdef.persist == true)) { var px = p.pos[0]; @@ -747,7 +747,7 @@ RDGE.particleSys = function (addr) { var emin = emitter.pbuffer.bounds.min; var emax = emitter.pbuffer.bounds.max; - // calculate a bounds that fits all particles. + // calculate a bounds that fits all particles. if (emin[0] < bmin[0]) { bmin[0] = emin[0]; } if (emin[1] < bmin[1]) { bmin[1] = emin[1]; } if (emin[2] < bmin[2]) { bmin[2] = emin[2]; } diff --git a/js/helper-classes/RDGE/src/core/script/precompiled.js b/js/helper-classes/RDGE/src/core/script/precompiled.js index 22b82adb..59edd395 100755 --- a/js/helper-classes/RDGE/src/core/script/precompiled.js +++ b/js/helper-classes/RDGE/src/core/script/precompiled.js @@ -77,11 +77,11 @@ RDGE.rdgeGlobalParameters = "u_light3Spec": { 'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0] } }, "colMap": { 'type': 'tex2d', 'data': "assets/images/white.png" }, - //"envMap": {'type': 'tex2d', 'data': null}, - //"normalMap": {'type': 'tex2d', 'data': null}, - //"glowMap": {'type': 'tex2d', 'data': "assets/images/black.png"}, - //"u_shadowDepthMap": {'type': 'tex2d', 'data': null}, - //"u_depthMap": {'type': 'tex2d', 'data': null}, + //"envMap": {'type': 'tex2d', 'data': null}, + //"normalMap": {'type': 'tex2d', 'data': null}, + //"glowMap": {'type': 'tex2d', 'data': "assets/images/black.png"}, + //"u_shadowDepthMap": {'type': 'tex2d', 'data': null}, + //"u_depthMap": {'type': 'tex2d', 'data': null}, "u_matAmbient": { 'type': 'vec4', 'data': [1.00, 1.00, 1.00, 1] }, "u_matDiffuse": { 'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0] }, "u_matSpecular": { 'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0] }, diff --git a/js/helper-classes/RDGE/src/core/script/renderUtils.js b/js/helper-classes/RDGE/src/core/script/renderUtils.js index ed3b2cfa..a25b3dec 100755 --- a/js/helper-classes/RDGE/src/core/script/renderUtils.js +++ b/js/helper-classes/RDGE/src/core/script/renderUtils.js @@ -109,10 +109,10 @@ RDGE.renderUtils.createBox = function () { return prim; }; -// +// // makeSphere // -// Create a sphere with the passed number of latitude and longitude bands and the passed radius. +// Create a sphere with the passed number of latitude and longitude bands and the passed radius. // Sphere has vertices, normals and texCoords. Create VBOs for each as well as the index array. // Return an object with the following properties: // @@ -121,7 +121,7 @@ RDGE.renderUtils.createBox = function () { // vertexObject WebGLBuffer object for vertices // indexObject WebGLBuffer object for indices // numIndices The number of indices in the indexObject -// +// RDGE.renderUtils.makeSphere = function (ctx, radius, lats, longs) { var geometryData = []; var normalData = []; diff --git a/js/helper-classes/RDGE/src/core/script/renderer.js b/js/helper-classes/RDGE/src/core/script/renderer.js index 6ad20e57..cac0c33f 100755 --- a/js/helper-classes/RDGE/src/core/script/renderer.js +++ b/js/helper-classes/RDGE/src/core/script/renderer.js @@ -635,7 +635,7 @@ RDGE.rdgeDefaultShaderDefintion = { // 'cullFace': "BACK" // } // }] -// +// // } // }; @@ -669,7 +669,7 @@ RDGE.rdgeDefaultShaderDefintion = { // 'cullFace': "BACK" // } // }] -// +// // } // }; @@ -717,7 +717,7 @@ RDGE.rdgeDefaultShaderDefintion = { // 'screenQuad': [{ // 'vshader': 'screenQuadVShader', // 'fshader': 'screenQuadFShader', -// +// // // attributes // 'attributes': { // 'a_pos': { 'type': 'vec3' }, @@ -764,7 +764,7 @@ RDGE.rdgeDefaultShaderDefintion = { // 'params': // { // }, -// +// // // render states // 'states': // { @@ -778,7 +778,7 @@ RDGE.rdgeDefaultShaderDefintion = { // } // }; -/* +/* * Gaussian blur shader */ // currently not used in Ninja @@ -816,7 +816,7 @@ RDGE.rdgeDefaultShaderDefintion = { // } // }; -/* +/* * Screen space ambient occlusion shader */ // currently not used in Ninja @@ -939,13 +939,13 @@ RDGE.rdgePrimitiveDefinition = function () { /* * The type of primitive * supported types are - * renderer.POINTS - * renderer.LINES - * renderer.LINE_LOOP - * renderer.LINE_STRIP - * renderer.TRIANGLES - * renderer.TRIANGLE_STRIP - * renderer.TRIANGLE_FAN + * renderer.POINTS + * renderer.LINES + * renderer.LINE_LOOP + * renderer.LINE_STRIP + * renderer.TRIANGLES + * renderer.TRIANGLE_STRIP + * renderer.TRIANGLE_FAN */ this.type = RDGE.rdgeConstants.TRIANGLE_STRIP; diff --git a/js/helper-classes/RDGE/src/core/script/scenegraph.js b/js/helper-classes/RDGE/src/core/script/scenegraph.js index 92fe98c8..789f69e5 100755 --- a/js/helper-classes/RDGE/src/core/script/scenegraph.js +++ b/js/helper-classes/RDGE/src/core/script/scenegraph.js @@ -74,8 +74,8 @@ RDGE.SceneGraph = function (scene) { this.bckTypes = RDGE.rdgeConstants.categoryEnumeration; this.renderList = new Array(this.bckTypes.MAX_CAT); - this.renderList[this.bckTypes.BACKGROUND] = []; //BACKGROUND - this.renderList[this.bckTypes.OPAQUE] = []; //OPAQUE + this.renderList[this.bckTypes.BACKGROUND] = []; //BACKGROUND + this.renderList[this.bckTypes.OPAQUE] = []; //OPAQUE this.renderList[this.bckTypes.TRANSPARENT] = []; //TRANSPARENT this.renderList[this.bckTypes.ADDITIVE] = []; //ADDITIVE this.renderList[this.bckTypes.TRANSLUCENT] = []; //TRANSLUCENT @@ -170,7 +170,7 @@ RDGE.SceneGraph = function (scene) { // 'technique': "depthMap", // 'outputs':[{ 'name':"u_depthMap", 'type':"target", 'width':1024, 'height':1024, 'mips':false }], // 'geometrySet':"ALL", - // 'children' : + // 'children' : // [ // // get the normals in view space // { @@ -178,10 +178,10 @@ RDGE.SceneGraph = function (scene) { // 'shader': RDGE.rdgeViewSpaceNormalsShader, // 'outputs':[{ 'name':"u_normalsRT", 'type':"target", 'width':1024, 'height':1024, 'mips':false }], // 'geometrySet':"ALL", - // 'children' : + // 'children' : // [ // // techniques requiring depth and normals in view space go here - // + // // // SSAO map // { // 'name':"SSAO", @@ -198,7 +198,7 @@ RDGE.SceneGraph = function (scene) { // } // ] // }, - // + // // // final pass must always be last in the list // { // // this final pass has no output, its shader, however, will render its input (the previous pass's output) @@ -374,7 +374,7 @@ RDGE.SceneGraph = function (scene) { // get the distance from object to cameras' 'z' plane item.depth = RDGE.vec3.dot(look, toObject); - // walk down the list of object moving the current item into place until the comparison fails + // walk down the list of object moving the current item into place until the comparison fails var i = len - 1; var temp = null; for (; i > 0; --i) { @@ -648,7 +648,7 @@ RDGE.SceneGraph.prototype.BuildBVHHelper = function (node) { curNode.world = RDGE.mat4.mul(curNode.local, parentXfrm); if (bbox) { - // update bounding box position + // update bounding box position curNode.bbox_world = bbox.transform(curNode.world); } @@ -805,8 +805,8 @@ RDGE.SceneGraph.prototype.GetBBoxForNode = function (tr) { RDGE.SceneGraph.prototype._RenderDFHelper = function (renderer, renderProc, node, forceThisProc) { renderList = []; - renderList[this.bckTypes.BACKGROUND] = []; //BACKGROUND - renderList[this.bckTypes.OPAQUE] = []; //OPAQUE + renderList[this.bckTypes.BACKGROUND] = []; //BACKGROUND + renderList[this.bckTypes.OPAQUE] = []; //OPAQUE renderList[this.bckTypes.TRANSPARENT] = []; //TRANSPARENT renderList[this.bckTypes.ADDITIVE] = []; //ADDITIVE renderList[this.bckTypes.TRANSLUCENT] = []; //TRANSLUCENT @@ -959,7 +959,7 @@ RDGE.SceneGraph.prototype.exportJSON = function () { // return 'replaced'; // } // } - // + // // if(value && value.baseURI === undefined && typeof value === "object" && !value.lookUpName) // objMap.push(value); diff --git a/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js b/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js index 5a1e025b..c86dd1e9 100755 --- a/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js +++ b/js/helper-classes/RDGE/src/core/script/scenegraphNodes.js @@ -35,9 +35,9 @@ var RDGE = RDGE || {}; * Creates a unique node id */ RDGE.nodeIdGen = {}; - + RDGE.nodeIdGen.counter = 0; - + RDGE.nodeIdGen.getId = function () { return "gen_" + RDGE.nodeIdGen.counter++; }; @@ -47,9 +47,9 @@ RDGE.nodeIdGen.getId = function () { */ RDGE.createTransformNode = function (nodeName) { node = { 'name': nodeName }; - + node.transformNodeTemplate = new RDGE.transformNodeTemplate(node); - + return node; }; @@ -58,9 +58,9 @@ RDGE.createTransformNode = function (nodeName) { */ RDGE.createMaterialNode = function (nodeName) { node = { 'name': nodeName }; - + node.materialNodeTemplate = new RDGE.materialNodeTemplate(node); - + return node; }; @@ -69,9 +69,9 @@ RDGE.createMaterialNode = function (nodeName) { */ RDGE.createMeshNode = function (nodeName, primitive) { meshNode = { 'mesh':{}, 'meshNodeTemplate':{} }; - + var renderer = RDGE.globals.engine.getContext().renderer; - + if (!primitive.built) { renderer.createPrimitive(primitive); } @@ -86,9 +86,9 @@ RDGE.createMeshNode = function (nodeName, primitive) { else if (!renderer.buffers[model.primitive.buffersID]) { renderer.createPrimitive(model.primitive); } - + meshNode.mesh.meshNodeTemplate = new RDGE.meshNodeTemplate(meshNode.mesh, model.primitive, nodeName); - + return meshNode; }; @@ -98,7 +98,7 @@ RDGE.createMeshNode = function (nodeName, primitive) { RDGE.createLightNode = function (nodeName) { node = { 'name': nodeName }; node.lightNodeTemplate = new RDGE.lightNodeTemplate(node); - + return node; }; @@ -108,7 +108,7 @@ RDGE.createLightNode = function (nodeName) { RDGE.createScreenQuadNode = function () { var trNode = RDGE.createTransformNode(); trNode.attachMeshNode("screenQuad", RDGE.renderUtils.createScreenAlignedQuad()); - return trNode; + return trNode; }; RDGE.verifyTransformNode = function (node) { @@ -135,52 +135,52 @@ RDGE.verifyLightNode = function (node) { */ RDGE.transformNodeTemplate = function (trNode) { // Lots of checking for things that might exist and adding them when they don't - + /* ------------------------------------------- */ if (!trNode.children) { trNode.children = []; } - + if (!trNode.local) { trNode.local = RDGE.mat4.identity(); } - + if (!trNode.world) { trNode.world = RDGE.mat4.identity(); } - + if (!trNode.id) { trNode.id = RDGE.nodeIdGen.getId(); } - + if (!trNode.name) { trNode.name = "xfrmNode" + trNode.id; } - + if (!trNode.parent) { trNode.parent = null; } - + if (!trNode.meshes) { trNode.meshes = []; } - + if (!trNode.nodeType) { trNode.nodeType = RDGE.rdgeConstants.nodeType.TRNODE; } - + /* ------------------------------------------- */ - - // Adding functions to the node none of these exist from export process + + // Adding functions to the node none of these exist from export process /* * Attaches a material to a node */ trNode.attachMaterial = function (matNode) { RDGE.verifyMaterialNode(matNode); - + this.materialNode = matNode; }; - + /* * @param node - the node to attach, can optionally be a node name paired with a primitive that will be built into a meshNode * @param primitive - an optional parameter that must be supplied if the node is a name and not an object @@ -192,32 +192,32 @@ RDGE.transformNodeTemplate = function (trNode) { if (trNode.materialNode == undefined) { trNode.materialNode = RDGE.createMaterialNode(trNode.name + "|defMaterial"); } - + trNode.meshes.push( {'mesh':{'name':node.mesh.attribs.name, 'id':node.mesh.attribs.id}}); }; - + /* * Inserts a node as a child of this node */ trNode.insertAsChild = function (transNode) { if(this == transNode) return; - + RDGE.verifyTransformNode(transNode); - + transNode.parent = this; this.children.push({transformNode:transNode}); }; - + /* * Inserts a node as the parent of this node */ trNode.insertAsParent = function (transNode) { if(this == transNode) return; - + RDGE.verifyTransformNode(transNode); - + if (this.parent) { // remove this node from current parents list var len = this.parent.children.length; @@ -230,19 +230,19 @@ RDGE.transformNodeTemplate = function (trNode) { break; } } - + } - + // set the new parents parent transNode.parent = this.parent; - + // push passed in node into parents list this.parent.children.push({transformNode:transNode}); - + // set the passed in node as the current parent this.parent = transNode; } - + // add this node to the passed in nodes child list transNode.children.push({transformNode:this}); }; @@ -258,15 +258,15 @@ RDGE.materialNodeTemplate = function (matNode) { TEX_SPEC = 1; TEX_NORM = 2; TEX_GLOW = 3; - + if (!matNode.nodeType) { matNode.nodeType = RDGE.rdgeConstants.nodeType.MATNODE; } - + MATERIAL_MAX_LIGHTS = RDGE.rdgeConstants.MAX_MATERIAL_LIGHTS; - + if (!matNode.lightChannel) { - matNode.lightChannel = + matNode.lightChannel = [ null, null, @@ -274,34 +274,34 @@ RDGE.materialNodeTemplate = function (matNode) { null ]; } - + /* * Material categories determine sorting */ if (!matNode.sortCategory) { matNode.sortCategory = RDGE.rdgeConstants.categoryEnumeration.OPAQUE; } - + /* * every node has an id either generated by export or generated here */ if (!matNode.id) { matNode.id = RDGE.nodeIdGen.getId(); } - + /* * every node has an name either setin art pipeline or generated here */ if (!matNode.name) { matNode.name = "matNode" + matNode.id; } - + /* * Default list of textures if nothing is set */ if (!matNode.textureList) { var renderer = RDGE.globals.engine.getContext().renderer; - matNode.textureList = + matNode.textureList = [ // {'name':"colMap", 'handle':renderer.getTextureByName("assets/images/white"), 'unit': TEX_DIF, "type":RDGE.UNIFORMTYPE.TEXTURE2D}, // {'name':"envMap", 'handle':renderer.getTextureByName("assets/images/material_paint"),'unit': TEX_SPEC, "type":RDGE.UNIFORMTYPE.TEXTURE2D}, @@ -309,36 +309,36 @@ RDGE.materialNodeTemplate = function (matNode) { // {'name':"glowMap", 'handle':renderer.getTextureByName("assets/images/black"), 'unit': TEX_GLOW, "type":RDGE.UNIFORMTYPE.TEXTURE2D} ]; } - + if (!matNode.uniforms) { matNode.uniforms = []; } - + matNode.setTexture = function (texType, texName) { var renderer = RDGE.globals.engine.getContext().renderer; this.textureList[texType].handle = renderer.getTextureByName("assets/images/" + texName); this.textureList[texType].handle = renderer.getTextureByName(RDGE.globals.engine._assetPath+"/images/" + texName); this.textureList[texType].unit = texType; this.textureList[texType].type = RDGE.UNIFORMTYPE.TEXTURE2D; - + }; matNode.setDiffuseTexture = function (texName) { this.setTexture(TEX_DIF, texName); }; - + matNode.setSpecTexture = function (texName) { this.setTexture(TEX_SPEC, texName); }; - + matNode.setNormalTexture = function (texName) { this.setTexture(TEX_NORM, texName); }; - + matNode.setGlowTexture = function (texName) { this.setTexture(TEX_GLOW, texName); }; - + matNode.setUniform = function (name, arrValue) { var len = this.uniforms.length; for (var i = 0; i < len; ++i) { @@ -347,18 +347,18 @@ RDGE.materialNodeTemplate = function (matNode) { return; } } - + window.console.log("Could not find uniform: " + name); }; - + matNode.setShader = function (jshaderObject) { this.shaderProgram = jshaderObject; }; - + matNode.setSortCategory = function (materialCat) { matNode.sortCategory = materialCat; }; - + /* * Sets a light channel reference to a lightNode * @param channelNumber a number indicating whick light to turn on (0 - 3), or an array of numbers if multiple lights being set @@ -366,13 +366,13 @@ RDGE.materialNodeTemplate = function (matNode) { */ matNode.enableLightChannel = function (channelNumber, lightNode) { RDGE.verifyLightNode(lightNode); - + // set an array if (typeof channelNumber == "object") { var len = channelNumber.length; var maxLight = lightNode.length != undefined ? lightNode.length : 0; for (var i = 0; i < len; ++i) { - + matNode.lightChannel[channelNumber] = maxLight > 0 ? lightNode[ Math.min(i, maxLight - 1)] : lightNode; } } @@ -383,11 +383,11 @@ RDGE.materialNodeTemplate = function (matNode) { } }; - + matNode.disableLightChannel = function (channelNumber) { if (typeof channelNumber != "object") { var len = channelNumber.length; - + for (var i = 0; i < len; ++i) { if (channelNumber[i] < MATERIAL_MAX_LIGHTS) matNode.lightChannel[channelNumber[i]] = null; @@ -398,22 +398,22 @@ RDGE.materialNodeTemplate = function (matNode) { matNode.lightChannel[channelNumber] = null; } }; - + matNode.disableAllLights = function () { for (var i = 0; i < MATERIAL_MAX_LIGHTS; ++i) { matNode.lightChannel[i] = null; } }; - + matNode.toJSON = function () { var jsonObj = {'jsonExportName':"materialNode"}; for (var member in this) { jsonObj[member] = this[member]; - + if (member === "textureList") { var texList = jsonObj[member]; for (var i = 0, len = texList.length; i < len; ++i) { - texList[i].handle.image = texList[i].handle.lookUpName; + texList[i].handle.image = texList[i].handle.lookUpName; } } else if (member === "shaderProgram") { @@ -423,7 +423,7 @@ RDGE.materialNodeTemplate = function (matNode) { } } } - + return jsonObj; }; }; @@ -432,37 +432,37 @@ RDGE.meshNodeTemplate = function (meshNode, primitive, meshName) { if (!primitive.built) { renderer.createPrimitive(primitive); } - + if (!meshNode.nodeType) { meshNode.nodeType = RDGE.rdgeConstants.nodeType.MESHNODE; } - + if (!meshNode.attribs) { var newID = RDGE.nodeIdGen.getId(); - + meshNode.attribs = { 'id': newID, 'indexCount': primitive.indexCount, 'name': meshName, 'vertCount': primitive.posCount }; - + meshNode.name = meshName; } - + if (!meshNode.bbox) { meshNode.bbox = new RDGE.box(); } - + meshNode.data = null; - + meshNode.primitive = primitive; - + // setup bounding box var numPositions = primitive.posCount; - + if (numPositions > 0) { var positions = primitive.positions; - + var idx = 0; while (idx < numPositions - 2) { var thisPos = [positions[idx+0], positions[idx+1], positions[idx+2]]; @@ -479,89 +479,89 @@ RDGE.lightNodeTemplate = function (lightNode) { if (!lightNode.nodeType) { lightNode.nodeType = RDGE.rdgeConstants.nodeType.LIGHTNODE; } - + if (!lightNode.id) { lightNode.id = RDGE.nodeIdGen.getId(); } - + if (!lightNode.name) { lightNode.name = "light_" + lightNode.id; } - + if (!lightNode.typeName) { lightNode.typeName = "dir_light"; } - + if (!lightNode.castShadow) { lightNode.castShadow = false; } - + if (!lightNode.depthMapBias) { lightNode.depthMapBias = 0.0179; } - + if (!lightNode.depthMapSize) { lightNode.depthMapSize = 1024; } - + if (!lightNode.coneAngle) { lightNode.coneAngle = 0.707; } - + if (!lightNode.penumbraAngle) { lightNode.coneAngle = 0.0; } - + if (!lightNode.dropOff) { lightNode.coneAngle = 0.025; } - + if (!lightNode.color) { lightNode.color = [1,1,1,1]; } - + if (!lightNode.dir) { lightNode.dir = [1,-1,1]; } - + if (!lightNode.links) { lightNode.links = []; } - + if (!lightNode.position) { lightNode.position = [0,0,0]; } - + if (!lightNode.lightDiffuse) { lightNode.lightDiffuse = [1,1,1,1]; } - + if (!lightNode.lightAmbi