aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/RDGE
diff options
context:
space:
mode:
Diffstat (limited to 'js/helper-classes/RDGE')
-rw-r--r--js/helper-classes/RDGE/runtime/GLRuntime.js26
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/MeshManager.js255
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/RenderInitProcs.js476
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/RenderProcs.js787
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/ScreenQuad.js32
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/ShaderManager.js124
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/TextureManager.js6
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/animation.js191
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/box.js181
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/camera.js468
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/engine.js513
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/fx/blur.js283
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/fx/ssao.js211
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/init_state.js553
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/input.js117
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/jpass.js771
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/jshader.js260
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/lightmanager.js148
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/math/mat4.js1055
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/math/quat.js237
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/math/vec2.js229
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/math/vec3.js423
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/math/vec4.js315
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/objectManager.js8
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/particle.js1591
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/precompiled.js123
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/renderUtils.js644
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/rendercontext.js454
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/renderer.js2299
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/run_state.js711
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/runtime.js280
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/scenegraph.js1754
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/scenegraphNodes.js1016
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/shadowLight.js90
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/sockets.js243
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/ubershader.js159
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/util/dbgpanel.js237
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/util/fpsTracker.js51
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/util/statTracker.js338
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/utilities.js282
-rw-r--r--js/helper-classes/RDGE/src/tools/compile-rdge-core.bat2
-rw-r--r--js/helper-classes/RDGE/src/tools/compile-rdge-core.sh2
42 files changed, 8090 insertions, 9855 deletions
diff --git a/js/helper-classes/RDGE/runtime/GLRuntime.js b/js/helper-classes/RDGE/runtime/GLRuntime.js
index 5c99be02..80162f91 100644
--- a/js/helper-classes/RDGE/runtime/GLRuntime.js
+++ b/js/helper-classes/RDGE/runtime/GLRuntime.js
@@ -31,8 +31,8 @@ function GLRuntime( canvas, importStr )
31 /////////////////////////////////////////////////////////////////////// 31 ///////////////////////////////////////////////////////////////////////
32 var id = canvas.getAttribute( "data-RDGE-id" ); 32 var id = canvas.getAttribute( "data-RDGE-id" );
33 canvas.rdgeid = id; 33 canvas.rdgeid = id;
34 g_Engine.registerCanvas(canvas, this); 34 RDGE.globals.engine.registerCanvas(canvas, this);
35 RDGEStart( canvas ); 35 RDGE.RDGEStart( canvas );
36 36
37 this.loadScene = function() 37 this.loadScene = function()
38 { 38 {
@@ -53,16 +53,16 @@ function GLRuntime( canvas, importStr )
53 53
54 this.init = function() 54 this.init = function()
55 { 55 {
56 var ctx1 = g_Engine.ctxMan.handleToObject(this._canvas.rdgeCtxHandle), 56 var ctx1 = RDGE.globals.engine.ctxMan.handleToObject(this._canvas.rdgeCtxHandle),
57 ctx2 = g_Engine.getContext(); 57 ctx2 = RDGE.globals.engine.getContext();
58 if (ctx1 != ctx2) console.log( "***** different contexts *****" ); 58 if (ctx1 != ctx2) console.log( "***** different contexts *****" );
59 this.renderer = ctx1.renderer; 59 this.renderer = ctx1.renderer;
60 60
61 // create a camera, set its perspective, and then point it at the origin 61 // create a camera, set its perspective, and then point it at the origin
62 var cam = new camera(); 62 var cam = new RDGE.camera();
63 this._camera = cam; 63 this._camera = cam;
64 cam.setPerspective(this.getFOV(), this.getAspect(), this.getZNear(), this.getZFar()); 64 cam.setPerspective(this.getFOV(), this.getAspect(), this.getZNear(), this.getZFar());
65 cam.setLookAt([0, 0, this.getViewDistance()], [0, 0, 0], vec3.up()); 65 cam.setLookAt([0, 0, this.getViewDistance()], [0, 0, 0], RDGE.vec3.up());
66 66
67 // make this camera the active camera 67 // make this camera the active camera
68 this.renderer.cameraManager().setActiveCamera(cam); 68 this.renderer.cameraManager().setActiveCamera(cam);
@@ -77,17 +77,17 @@ function GLRuntime( canvas, importStr )
77 /* 77 /*
78 // create some lights 78 // create some lights
79 // light 1 79 // light 1
80 this.light = createLightNode("myLight"); 80 this.light = RDGE.createLightNode("myLight");
81 this.light.setPosition([0,0,1.2]); 81 this.light.setPosition([0,0,1.2]);
82 this.light.setDiffuseColor([0.75,0.9,1.0,1.0]); 82 this.light.setDiffuseColor([0.75,0.9,1.0,1.0]);
83 83
84 // light 2 84 // light 2
85 this.light2 = createLightNode("myLight2"); 85 this.light2 = RDGE.createLightNode("myLight2");
86 this.light2.setPosition([-0.5,0,1.2]); 86 this.light2.setPosition([-0.5,0,1.2]);
87 this.light2.setDiffuseColor([1.0,0.9,0.75,1.0]); 87 this.light2.setDiffuseColor([1.0,0.9,0.75,1.0]);
88 88
89 // create a light transform 89 // create a light transform
90 var lightTr = createTransformNode("lightTr"); 90 var lightTr = RDGE.createTransformNode("lightTr");
91 91
92 // create and attach a material - materials hold the light data 92 // create and attach a material - materials hold the light data
93 lightTr.attachMaterial(createMaterialNode("lights")); 93 lightTr.attachMaterial(createMaterialNode("lights"));
@@ -107,7 +107,7 @@ function GLRuntime( canvas, importStr )
107 107
108 // Add the scene to the engine - necessary if you want the engine to draw for you 108 // Add the scene to the engine - necessary if you want the engine to draw for you
109 var name = "myScene" + this._canvas.getAttribute( "data-RDGE-id" ); 109 var name = "myScene" + this._canvas.getAttribute( "data-RDGE-id" );
110 g_Engine.AddScene(name, this.myScene); 110 RDGE.globals.engine.AddScene(name, this.myScene);
111 } 111 }
112 112
113 // main code for handling user interaction and updating the scene 113 // main code for handling user interaction and updating the scene
@@ -119,7 +119,7 @@ function GLRuntime( canvas, importStr )
119 this.elapsed += dt; 119 this.elapsed += dt;
120 120
121 // changed the global position uniform of light 0, another way to change behavior of a light 121 // changed the global position uniform of light 0, another way to change behavior of a light
122 rdgeGlobalParameters.u_light0Pos.set( [5*Math.cos(this.elapsed), 5*Math.sin(this.elapsed), 20]); 122 RDGE.rdgeGlobalParameters.u_light0Pos.set([5 * Math.cos(this.elapsed), 5 * Math.sin(this.elapsed), 20]);
123 123
124 // orbit the light nodes around the boxes 124 // orbit the light nodes around the boxes
125 this.light.setPosition([1.2*Math.cos(this.elapsed*2.0), 1.2*Math.sin(this.elapsed*2.0), 1.2*Math.cos(this.elapsed*2.0)]); 125 this.light.setPosition([1.2*Math.cos(this.elapsed*2.0), 1.2*Math.sin(this.elapsed*2.0), 1.2*Math.cos(this.elapsed*2.0)]);
@@ -132,9 +132,9 @@ function GLRuntime( canvas, importStr )
132 // defining the draw function to control how the scene is rendered 132 // defining the draw function to control how the scene is rendered
133 this.draw = function() 133 this.draw = function()
134 { 134 {
135 g_Engine.setContext( this._canvas.rdgeid ); 135 RDGE.globals.engine.setContext( this._canvas.rdgeid );
136 136
137 var ctx = g_Engine.getContext(); 137 var ctx = RDGE.globals.engine.getContext();
138 var renderer = ctx.renderer; 138 var renderer = ctx.renderer;
139 if (renderer.unloadedTextureCount <= 0) 139 if (renderer.unloadedTextureCount <= 0)
140 { 140 {
diff --git a/js/helper-classes/RDGE/src/core/script/MeshManager.js b/js/helper-classes/RDGE/src/core/script/MeshManager.js
index 43813078..2c31781e 100755
--- a/js/helper-classes/RDGE/src/core/script/MeshManager.js
+++ b/js/helper-classes/RDGE/src/core/script/MeshManager.js
@@ -4,86 +4,80 @@ 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
7function Model(name, mesh) 7// RDGE namespaces
8{ 8var RDGE = RDGE || {};
9
10RDGE.Model = function (name, mesh) {
9 this.name = name; 11 this.name = name;
10 this.mesh = mesh; 12 this.mesh = mesh;
11 this.camera = null; 13 this.camera = null;
12} 14};
13 15
14/* 16/*
15 * Maintains a list of meshes to allow instancing of data 17* Maintains a list of meshes to allow instancing of data
16 */ 18*/
17function MeshManager() { 19RDGE.MeshManager = function () {
18 this.contentUrl = "assets_web/mesh/"; 20 this.contentUrl = "assets_web/mesh/";
19 this.modelMap = {}; 21 this.modelMap = {};
20 this.readyList = []; // meshes that have data ready 22 this.readyList = []; // meshes that have data ready
21 this.meshesLoading = true; // indicates that no meshes have loaded or that they are still loading 23 this.meshesLoading = true; // indicates that no meshes have loaded or that they are still loading
22 this.postMeshLoadCallbackList = []; 24 this.postMeshLoadCallbackList = [];
23 this.tempSphere = null; 25 this.tempSphere = null;
24 this.requestCounter = 0; 26 this.requestCounter = 0;
25} 27};
26 28