aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/RDGE/GLWorld.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/helper-classes/RDGE/GLWorld.js')
-rw-r--r--js/helper-classes/RDGE/GLWorld.js32
1 files changed, 18 insertions, 14 deletions
diff --git a/js/helper-classes/RDGE/GLWorld.js b/js/helper-classes/RDGE/GLWorld.js
index b84bb585..0dc34034 100644
--- a/js/helper-classes/RDGE/GLWorld.js
+++ b/js/helper-classes/RDGE/GLWorld.js
@@ -240,6 +240,7 @@ function GLWorld( canvas, use3D )
240 if (renderer != aRenderer) console.log( "***** DIFFERENT RENDERERS *****" ); 240 if (renderer != aRenderer) console.log( "***** DIFFERENT RENDERERS *****" );
241 renderer.disableCulling(); 241 renderer.disableCulling();
242 this.myScene.render(); 242 this.myScene.render();
243 console.log( "render" );
243 244
244 if (this._firstRender) 245 if (this._firstRender)
245 { 246 {
@@ -247,15 +248,15 @@ function GLWorld( canvas, use3D )
247 248
248 if (!this.hasAnimatedMaterials()) 249 if (!this.hasAnimatedMaterials())
249 { 250 {
250 this.myScene.render(); 251 //this.myScene.render();
251 //this._canvas.task.stop(); 252 //this._canvas.task.stop();
252 this._renderCount = 3; 253 this._renderCount = 10;
253 } 254 }
254 } 255 }
255 else if (this._renderCount >= 0) 256 else if (this._renderCount >= 0)
256 { 257 {
257 this._renderCount--; 258 this._renderCount--;
258 if (this._renderCount == 0) 259 if (this._renderCount <= 0)
259 this._canvas.task.stop(); 260 this._canvas.task.stop();
260 } 261 }
261 262
@@ -270,6 +271,7 @@ function GLWorld( canvas, use3D )
270 this.onRunState = function() 271 this.onRunState = function()
271 { 272 {
272 console.log( "GLWorld.onRunState" ); 273 console.log( "GLWorld.onRunState" );
274 this.restartRenderLoop();
273 } 275 }
274 276
275 this.onLoadState = function() 277 this.onLoadState = function()
@@ -387,16 +389,13 @@ function GLWorld( canvas, use3D )
387 { 389 {
388 rdgeStarted = true; 390 rdgeStarted = true;
389 391
390 // TODO - temporary fix for RDGE id's 392 this._canvas.rdgeid = this._canvas.uuid;
391 this._canvas.id = this._canvas.uuid;
392
393 g_Engine.registerCanvas(this._canvas, this); 393 g_Engine.registerCanvas(this._canvas, this);
394 RDGEStart( this._canvas ); 394 RDGEStart( this._canvas );
395 395
396 //this._canvas.fpsTracker = new fpsTracker( '0' ); 396 //this._canvas.fpsTracker = new fpsTracker( '0' );
397 this._canvas.task = new RDGETask(this._canvas, false); 397 //this._canvas.task = new RDGETask(this._canvas, false);
398 this._canvas.task.stop() 398 this._canvas.task.stop()
399 //this._canvas.task.start()
400 } 399 }
401} 400}
402 401
@@ -508,11 +507,16 @@ GLWorld.prototype.addObject = function( obj )
508 507
509GLWorld.prototype.restartRenderLoop = function() 508GLWorld.prototype.restartRenderLoop = function()
510{ 509{
510 console.log( "restartRenderLoop" );
511
511 this._firstRender = true; 512 this._firstRender = true;
512 if (this._allMapsLoaded) 513 if (this._canvas.task)
513 this._canvas.task.start(); 514 {
514 else 515 if (this._allMapsLoaded)
515 this._canvas.task.stop(); 516 this._canvas.task.start();
517 else
518 this._canvas.task.stop();
519 }
516} 520}
517 521
518//append to the list of objects if obj doesn't already exist 522//append to the list of objects if obj doesn't already exist
@@ -563,7 +567,7 @@ GLWorld.prototype.clearTree = function()
563 { 567 {
564 var root = this._rootNode; 568 var root = this._rootNode;
565 root.children = new Array(); 569 root.children = new Array();
566 g_Engine.unregisterCanvas( this._canvas.id ) 570 g_Engine.unregisterCanvas( this._canvas.rdgeid )
567 571
568 this.update( 0 ); 572 this.update( 0 );
569 this.draw(); 573 this.draw();
@@ -805,7 +809,7 @@ GLWorld.prototype.getShapeFromPoint = function( offsetX, offsetY )
805GLWorld.prototype.export = function() 809GLWorld.prototype.export = function()
806{ 810{
807 var exportStr = "GLWorld 1.0\n"; 811 var exportStr = "GLWorld 1.0\n";
808 exportStr += "id: " + this._canvas.id + "\n"; 812 exportStr += "id: " + this._canvas.rdgeid + "\n";
809 exportStr += "fov: " + this._fov + "\n"; 813 exportStr += "fov: " + this._fov + "\n";
810 exportStr += "zNear: " + this._zNear + "\n"; 814 exportStr += "zNear: " + this._zNear + "\n";
811 exportStr += "zFar: " + this._zFar + "\n"; 815 exportStr += "zFar: " + this._zFar + "\n";