aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes
diff options
context:
space:
mode:
authorhwc4872012-04-19 13:01:43 -0700
committerhwc4872012-04-19 13:01:43 -0700
commite6a20fe64574763483dc602bd759278ccf5e5e68 (patch)
tree69defe7200206f0257fe90697136fadef59d521e /js/helper-classes
parentae7eb87564632ce7c676bd728b8ff2710ff0bb83 (diff)
parent9284c19f076dec3b47ece7dc7bcd22d74e4246c3 (diff)
downloadninja-e6a20fe64574763483dc602bd759278ccf5e5e68.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Conflicts: js/lib/drawing/world.js js/lib/geom/geom-obj.js js/lib/rdge/materials/cloud-material.js js/lib/rdge/materials/deform-material.js js/lib/rdge/materials/flat-material.js js/lib/rdge/materials/material.js js/lib/rdge/materials/pulse-material.js js/lib/rdge/materials/relief-tunnel-material.js js/lib/rdge/materials/square-tunnel-material.js js/lib/rdge/materials/star-material.js js/lib/rdge/materials/taper-material.js js/lib/rdge/materials/tunnel-material.js js/lib/rdge/materials/twist-material.js js/lib/rdge/materials/twist-vert-material.js js/lib/rdge/materials/uber-material.js js/lib/rdge/materials/water-material.js js/lib/rdge/materials/z-invert-material.js
Diffstat (limited to 'js/helper-classes')
-rwxr-xr-xjs/helper-classes/3D/draw-utils.js129
-rwxr-xr-xjs/helper-classes/3D/hit-record.js10
-rwxr-xr-xjs/helper-classes/3D/snap-manager.js44
-rwxr-xr-xjs/helper-classes/3D/vec-utils.js2
-rwxr-xr-xjs/helper-classes/3D/view-utils.js270
-rwxr-xr-xjs/helper-classes/RDGE/precompiled.js17
-rwxr-xr-xjs/helper-classes/RDGE/rdge-compiled.js777
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/MeshManager.js131
-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.js417
-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.js249
-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.js272
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/lightmanager.js148
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/math/mat4.js1085
-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.js451
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/renderer.js2310
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/run_state.js275
-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.js463
-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.js110
46 files changed, 7862 insertions, 9667 deletions
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js
index d6334e6c..ec8eea0f 100755
--- a/js/helper-classes/3D/draw-utils.js
+++ b/js/helper-classes/3D/draw-utils.js
@@ -109,10 +109,11 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
109 this._gridOrigin = [0,0]; // 2D plane space point 109 this._gridOrigin = [0,0]; // 2D plane space point
110 110
111 this.eventManager.addEventListener("elementAdded", this, false); 111 this.eventManager.addEventListener("elementAdded", this, false);
112 this.eventManager.addEventListener("elementDeleted", this, false); 112 this.eventManager.addEventListener("elementsRemoved", this, false);
113 this.eventManager.addEventListener("deleteSelection", this, false);
114 this.eventManager.addEventListener("elementChange", this, false); 113 this.eventManager.addEventListener("elementChange", this, false);
114 this.eventManager.addEventListener("elementChanging", this, false);
115 this.eventManager.addEventListener("closeDocument", this, false); 115 this.eventManager.addEventListener("closeDocument", this, false);
116 this.eventManager.addEventListener("elementReplaced", this, false);
116 } 117 }
117 }, 118 },
118 119
@@ -147,38 +148,75 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
147 148
148 handleElementAdded: { 149 handleElementAdded: {
149 value: function(event) { 150 value: function(event) {
150 this.addElement(event.detail); 151 var elements = event.detail;
152
153 if(Array.isArray(elements)) {
154 elements.forEach(function(element) {
155 this.addElement(element);
156 }, this);
157 } else {
158 this.addElement(elements);
159 }
160
151 this.drawWorkingPlane(); 161 this.drawWorkingPlane();
152 } 162 }
153 }, 163 },
154 164
155 handleElementDeleted: { 165 handleElementsRemoved: {
156 value: function(event) { 166 value: function(event) {
157 this.removeElement(event.detail); 167 var elements = event.detail;
168
169 if(Array.isArray(elements)) {
170 elements = Array.prototype.slice.call(elements, 0);
171 elements.forEach(function(element) {
172 this.removeElement(element);
173 }, this);
174 } else {
175 this.removeElement(elements);
176 }
177
178 this.drawWorkingPlane();
158 } 179 }
159 }, 180 },
160 181
161 handleDeleteSelection: { 182 handleElementReplaced: {
162 value: function(event) { 183 value: function(event) {
163 this.drawWorkingPlane(); 184 var oldElement = event.detail.data.oldChild;
185 var newElement = event.detail.data.newChild;
186
187 // check if we already know about this object
188 var n = this._eltArray.length,
189 plane;
190 for (var i=0; i<n; i++) {
191 if (oldElement === this._eltArray[i]) {
192 this._eltArray[i] = newElement;
193 plane = this._planesArray[i];
194 break;
195 }
196 }
197
198 if(!plane) {
199 this._eltArray.push( newElement );
200 plane = Object.create(this.ElementPlanes, {});
201 this._planesArray.push( plane );
202 }
203
204 plane.setElement( newElement );
205 plane.init();
206 newElement.elementModel.props3D.elementPlane = plane;
164 } 207 }
165 }, 208 },
166 209
167 _shouldUpdatePlanes: { 210 _shouldUpdatePlanes: {
168 value: function(props) { 211 value: function(props) {
169 if(!props) 212 if(!props) {
170 {
171 return false; 213 return false;
172 } 214 } else if (typeof props === "string") {
173 else if (typeof props === "string")
174 {
175 return (this._updatePlaneProps.indexOf(props) !== -1); 215 return (this._updatePlaneProps.indexOf(props) !== -1);
176 } 216 }
177 217
178 for (var p in props) 218 for (var p in props) {
179 { 219 if(this._updatePlaneProps.indexOf(p) !== -1) {
180 if(this._updatePlaneProps.indexOf(p) !== -1)
181 {
182 return true; 220 return true;
183 } 221 }
184 } 222 }
@@ -190,24 +228,27 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
190 // TODO - Check why handleElementChange is being fired before handleAddElement 228 // TODO - Check why handleElementChange is being fired before handleAddElement
191 handleElementChange: { 229 handleElementChange: {
192 value: function(event) { 230 value: function(event) {
193 if(!event.detail || !event.detail.data) 231 this._elementChangeHelper(event);
194 { 232 }
233 },
234
235 handleElementChanging: {
236 value: function(event) {
237 this._elementChangeHelper(event);
238 }
239 },
240
241 _elementChangeHelper: {
242 value: function(event) {
243 if(!event.detail || !event.detail.data) {
195 return; 244 return;
196 } 245 }
197 var els = event.detail.data.els; 246 var els = event.detail.data.els;