Changeset 208 for js/viewer-f0/js/graphicsEngine.js
- Timestamp:
- 04/03/14 17:07:28 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
js/viewer-f0/js/graphicsEngine.js
r193 r208 1 function GraphicsEngine(context ) {1 function GraphicsEngine(context, width, height) { 2 2 this._scene = undefined; 3 3 this._camera = undefined; 4 4 this._renderer = undefined; 5 this._canvasWidth = 400;6 this._canvasHeight = 400;7 this._containerContext = context;5 this._canvasWidth = width; 6 this._canvasHeight = height; 7 this._containerContextName = context; 8 8 this._BALL_RADIUS = 0.25; 9 9 this._controls = undefined; … … 11 11 this._debug1 = 0 12 12 this._showAxis = false; 13 this._render = true; 13 14 } 14 15 … … 21 22 this._renderer.setClearColor(0x000000, 1); 22 23 this._renderer.setSize(this._canvasWidth, this._canvasHeight); 23 //this._containerContext = $("#container"); 24 this._containerContext.append(this._renderer.domElement); 24 this._containerContextName.append(this._renderer.domElement); 25 26 var self = this; 27 this._renderer.domElement.addEventListener('mousemove', function(evt){ 28 self._render = true; 29 }); 25 30 } 26 31 … … 138 143 139 144 GraphicsEngine.prototype.addPart = function (part) { 140 console.log(part.getX(),part.getY(),part.getZ(), "|", part.getXshape(),part.getYshape(),part.getZshape(),"|",part.getXrot(),part.getYrot(),part.getZrot())145 //console.log(part.getX(),part.getY(),part.getZ(), "|", part.getXshape(),part.getYshape(),part.getZshape(),"|",part.getXrot(),part.getYrot(),part.getZrot()) 141 146 switch (part.getType()) { 142 147 case 0: … … 257 262 self.renderScene(); 258 263 }); 264 265 if(!this._render) 266 { 267 return; 268 } 269 259 270 this._renderer.render(this._scene, this._camera); 260 271 this._controls.update(); 261 272 this._render = false; 262 273 } 263 274 264 275 GraphicsEngine.prototype._debug = function() 265 276 { 266 267 this._scene.add( new THREE.AxisHelper( 20 ) ); 277 this._scene.add(new THREE.AxisHelper( 20 )); 268 278 } 269 279
Note: See TracChangeset
for help on using the changeset viewer.