Improved database

This commit is contained in:
Thomas FORGIONE
2015-06-22 09:41:59 +02:00
parent 1662a9dd99
commit 55de96688b
9 changed files with 141 additions and 27 deletions

21
js/prototype/main.js vendored
View File

@@ -19,6 +19,8 @@ var container_size = {
height: function() { return 768; }
}
var stats;
// Let's be sure we avoid using global variables
var onWindowResize = (function() {
@@ -33,7 +35,7 @@ var objects = [];
var cameras, cameraSelecter;
var spheres = new Array(mesh_number);
var visible = 0;
var stats;
// stats;
var previewer;
var camera1;
var loader;
@@ -43,8 +45,25 @@ var previousTime;
init();
if (initMainScene !== initPeach && initMainScene !== initSponza)
logfps();
animate();
function logfps() {
// Log fps
if (stats !== undefined) {
var event = new BD.Event.Fps();
event.fps = stats.getFps();
event.send();
}
setTimeout(logfps, 1000);
}
function init() {
// Initialize scene
scene = new THREE.Scene();