From fb0a659c9ca3479fd6799325498b11f074689936 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Mon, 2 Apr 2012 14:57:31 -0700 Subject: -Namespaced all RDGE javascript. -Removed the following unused files from the build script /core/script/fx/blur.js /core/script/fx/ssao.js /core/script/animation.js - Fully removed the following from the build and from source control as they are unused or no longer needed /core/script/util/dbgpanel.js /core/script/util/fpsTracker.js /core/script/util/statTracker.js /core/script/input.js /core/script/TextureManager.js /core/script/ubershader.js --- .../RDGE/src/core/script/shadowLight.js | 90 +++++++++++----------- 1 file changed, 44 insertions(+), 46 deletions(-) (limited to 'js/helper-classes/RDGE/src/core/script/shadowLight.js') diff --git a/js/helper-classes/RDGE/src/core/script/shadowLight.js b/js/helper-classes/RDGE/src/core/script/shadowLight.js index 80d9331a..3d6e42f6 100755 --- a/js/helper-classes/RDGE/src/core/script/shadowLight.js +++ b/js/helper-classes/RDGE/src/core/script/shadowLight.js @@ -4,51 +4,49 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ +// RDGE namespaces +var RDGE = RDGE || {}; + /* - * shadow light - a modified camera used to describe a shadow casting light - */ -shadowLight = function() -{ - // inherit from the base class - this.inheritedFrom = camera; - this.inheritedFrom(); - - // matrices needed for shadow projection - this.invViewMatrix=mat4.identity(); - this.mvpMatrix=mat4.identity(); - - // texture matrix - this.shadowMatrix=mat4.identity(); - this.shadowMatrix=mat4.scale(this.shadowMatrix,[0.5,0.5,0.5]); - this.shadowMatrix=mat4.translate(this.shadowMatrix,[0.5,0.5,0.5]); - - // cached references - this.renderer = null; - this.cameraManager = null; - - // shadow bias offset - this.shadowBias = 0.0195; - - this.init = function () - { - this.renderer = g_Engine.getContext().renderer; - this.cameraManager = this.renderer.cameraManager(); - } - - /* - * makes the light the current 'camera' - */ - this.activate = function() - { - this.cameraManager.pushCamera(this); - } - - /* - * restores the camera stack - */ - this.deactivate = function() - { - this.cameraManager.popCamera(); - } - +* shadow light - a modified camera used to describe a shadow casting light +*/ +RDGE.shadowLight = function () { + // inherit from the base class + this.inheritedFrom = RDGE.camera; + this.inheritedFrom(); + + // matrices needed for shadow projection + this.invViewMatrix = RDGE.mat4.identity(); + this.mvpMatrix = RDGE.mat4.identity(); + + // texture matrix + this.shadowMatrix = RDGE.mat4.identity(); + this.shadowMatrix = RDGE.mat4.scale(this.shadowMatrix, [0.5, 0.5, 0.5]); + this.shadowMatrix = RDGE.mat4.translate(this.shadowMatrix, [0.5, 0.5, 0.5]); + + // cached references + this.renderer = null; + this.cameraManager = null; + + // shadow bias offset + this.shadowBias = 0.0195; + + this.init = function () { + this.renderer = RDGE.globals.engine.getContext().renderer; + this.cameraManager = this.renderer.cameraManager(); + }; + + /* + * makes the light the current 'camera' + */ + this.activate = function () { + this.cameraManager.pushCamera(this); + }; + + /* + * restores the camera stack + */ + this.deactivate = function () { + this.cameraManager.popCamera(); + }; } -- cgit v1.2.3