diff options
author | Nivesh Rajbhandari | 2012-04-04 17:24:27 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-04-04 17:24:27 -0700 |
commit | 01cf259da7aaa7d70789d9a7c32111d88b477463 (patch) | |
tree | 0bff3395ac681e5f685d2267f7dbc03a8e32bc4a /js/helper-classes/RDGE/src/core/script/shadowLight.js | |
parent | 331ea08655245e3532e48bf160d5f68a04d8723f (diff) | |
parent | 13368ca6ebbc13adeafccd898dfffd7ce37cb28a (diff) | |
download | ninja-01cf259da7aaa7d70789d9a7c32111d88b477463.tar.gz |
Merge branch 'refs/heads/ToolFixes' into WebGLMaterials
Conflicts:
js/document/templates/montage-html/default_html.css
js/mediators/element-mediator.js
js/panels/properties.reel/properties.js
js/tools/BrushTool.js
js/tools/LineTool.js
js/tools/PenTool.js
js/tools/SelectionTool.js
js/tools/ShapeTool.js
js/tools/TranslateObject3DTool.js
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/helper-classes/RDGE/src/core/script/shadowLight.js')
-rwxr-xr-x | js/helper-classes/RDGE/src/core/script/shadowLight.js | 90 |
1 files changed, 44 insertions, 46 deletions
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 | |||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. |
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | // RDGE namespaces | ||
8 | var RDGE = RDGE || {}; | ||
9 | |||
7 | /* | 10 | /* |
8 | * shadow light - a modified camera used to describe a shadow casting light | 11 | * shadow light - a modified camera used to describe a shadow casting light |
9 | */ | 12 | */ |
10 | shadowLight = function() | 13 | RDGE.shadowLight = function () { |
11 | { | 14 | // inherit from the base class |
12 | // inherit from the base class | 15 | this.inheritedFrom = RDGE.camera; |
13 | this.inheritedFrom = camera; | 16 | this.inheritedFrom(); |
14 | this.inheritedFrom(); | 17 | |
15 | 18 | // matrices needed for shadow projection | |
16 | // matrices needed for shadow projection | 19 | this.invViewMatrix = RDGE.mat4.identity(); |
17 | this.invViewMatrix=mat4.identity(); | 20 | this.mvpMatrix = RDGE.mat4.identity(); |
18 | this.mvpMatrix=mat4.identity(); | 21 | |
19 | 22 | // texture matrix | |
20 | // texture matrix | 23 | this.shadowMatrix = RDGE.mat4.identity(); |
21 | this.shadowMatrix=mat4.identity(); | 24 | this.shadowMatrix = RDGE.mat4.scale(this.shadowMatrix, [0.5, 0.5, 0.5]); |
22 | this.shadowMatrix=mat4.scale(this.shadowMatrix,[0.5,0.5,0.5]); | 25 | this.shadowMatrix = RDGE.mat4.translate(this.shadowMatrix, [0.5, 0.5, 0.5]); |
23 | this.shadowMatrix=mat4.translate(this.shadowMatrix,[0.5,0.5,0.5]); | 26 | |
24 | 27 | // cached references | |
25 | // cached references | 28 | this.renderer = null; |
26 | this.renderer = null; | 29 | this.cameraManager = null; |
27 | this.cameraManager = null; | 30 | |
28 | 31 | // shadow bias offset | |
29 | // shadow bias offset | 32 | this.shadowBias = 0.0195; |
30 | this.shadowBias = 0.0195; | 33 | |
31 | 34 | this.init = function () { | |
32 | this.init = function () | 35 | this.renderer = RDGE.globals.engine.getContext().renderer; |
33 | { | 36 | this.cameraManager = this.renderer.cameraManager(); |
34 | this.renderer = g_Engine.getContext().renderer; | 37 | }; |
35 | this.cameraManager = this.renderer.cameraManager(); | 38 | |
36 | } | 39 | /* |
37 | 40 | * makes the light the current 'camera' | |
38 | /* | 41 | */ |
39 | * makes the light the current 'camera' | 42 | this.activate = function () { |
40 | */ | 43 | this.cameraManager.pushCamera(this); |
41 | this.activate = function() | 44 | }; |
42 | { | 45 | |
43 | this.cameraManager.pushCamera(this); | 46 | /* |
44 | } | 47 | * restores the camera stack |
45 | 48 | */ | |
46 | /* | 49 | this.deactivate = function () { |
47 | * restores the camera stack | 50 | this.cameraManager.popCamera(); |
48 | */ | 51 | }; |
49 | this.deactivate = function() | ||
50 | { | ||
51 | this.cameraManager.popCamera(); | ||
52 | } | ||
53 | |||
54 | } | 52 | } |