From e9d08c7af751d75af16371fcac06fd1af8a60fac Mon Sep 17 00:00:00 2001 From: hwc487 Date: Mon, 23 Jul 2012 14:37:51 -0700 Subject: Bugs fixed: 1915 - Data.JSON too large. Reduced mesh size and limited precision of fp numbers 1381 - Background transparency in preview. 1740 - File Save As caused WebGL to stop animating. Crossed RDGE IDs 1954 - Texture change from material popup broke screen rendering. Set correct context on property change. --- js/lib/drawing/world.js | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'js/lib/drawing/world.js') diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js index ca2f07cc..b9f9863f 100755 --- a/js/lib/drawing/world.js +++ b/js/lib/drawing/world.js @@ -439,6 +439,11 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) { // in the case of a procedurally built scene an init state is not needed for loading data this._canvas.rdgeid = this._canvas.getAttribute( "data-RDGE-id" ); if (this._useWebGL) { + // make sure the id is unique + var id = this.uniqueifyID( this._canvas.rdgeid ); + this._canvas.rdgeid = id; + this._canvas.setAttribute( "data-rdge-id", id ); + rdgeStarted = true; RDGE.globals.engine.unregisterCanvas( this._canvas ); RDGE.globals.engine.registerCanvas(this._canvas, this); @@ -673,13 +678,35 @@ World.prototype.updateMaterials = function( obj, time ) { var n = matArray.length; for (var i=0; i= 0) + { + var subStr = id.substr( index+1); + num = Number( subStr ) + 1; + id = id.substr( 0, index ); + } + + id = id + "_" + num; + ctx = RDGE.globals.engine.getContext( id ); + } + + return id; +} + // return the origin of the world in NDC World.prototype.getNDCOrigin = function() { var pt = MathUtils.transformPoint( [0,0,0], this.getCameraMatInverse() ); @@ -973,7 +1000,6 @@ World.prototype.importJSON = function (jObj) // start RDGE rdgeStarted = true; var id = this._canvas.getAttribute( "data-RDGE-id" ); - this._canvas.rdgeid = id; RDGE.globals.engine.registerCanvas(this._canvas, this); RDGE.RDGEStart(this._canvas); this._canvas.task.stop() -- cgit v1.2.3