function drawScene(){var d=new Date();nowTime=d.getTime()/1000.0-startTime;timeTaken=nowTime-prevTime;if(timemoving===true){realtime+=timeTaken;realtimetaken=realtime-realtimeprev}else{realtimetaken=0}timemoving=true;controlRealtime();gl.viewportWidth=window.innerWidth;gl.viewportHeight=window.innerHeight;if(realtime<260.5){bgR=0.99+Math.abs(Math.cos(realtime*0.15)*0.01);bgG=0.99+Math.abs(Math.cos(realtime*0.18)*0.01);bgB=0.7+Math.abs(Math.cos(realtime*0.05)*0.3);document.body.style.cursor='none'}else if(Math.ceil(realtime)===270){if(document.cancelFullScreen){document.cancelFullScreen()}else if(document.mozCancelFullScreen){document.mozCancelFullScreen()}else if(document.webkitCancelFullScreen){document.webkitCancelFullScreen()}}else{if(bgR>0)bgR=bgR*(260-realtime)/100;if(bgG>0)bgG=bgG*(260-realtime)/100;if(bgB>0)bgB=bgB*(260-realtime)/100}gl.clearColor(bgR,bgG,bgB,1.0);gl.viewport(0,0,gl.viewportWidth,gl.viewportHeight);gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);mat4.perspective(45,gl.viewportWidth/gl.viewportHeight,0.1,200.0,pMat);mat4.identity(mvMat);gl.enable(gl.DEPTH_TEST);gl.depthFunc(gl.LESS);if(Math.ceil(realtime)%70===0)scene=1;if(Math.ceil(realtime)%70===35)scene=0;if(scene===1){cx=0;cy=0;cz=Math.sin(realtime*0.2)*10;cangle=realtime;cyaw=1;cpitch=0.3;croll=2}else{cx=objects[0].x;cy=objects[0].y;cz=objects[0].z;cangle=30-realtime*0.3;cyaw=0.4;cpitch=1.3;croll=0}gl.uniform2f(shaderProgram.randomseedUniform,Math.random(),Math.random());for(var i=0;i<objectsSize;i++){objects[i].update(realtime,realtimetaken);objects[i].draw()}prevTime=nowTime;realtimeprev=realtime}function importFunction(timefunctions,who,funcwhen){if(who<0)who=0;objects[who].timefunctions.push(false);objects[who].timefunctions.push(funcwhen);objects[who].timefunctions.push(timefunctions);objects[who].timefunctionsSize+=3;organizeAndListFuncAtTime()}function resetFuncAtTime(){}function swap(i,a,b){var temp;temp=i[a];i[a]=i[b];i[b]=temp}function organizeAndListFuncAtTime(){var pileup=new Array();var i,j,k;var ordered;for(i=0;i<objectsSize;i++){do{ordered=true;for(j=0;j<objects[i].timefunctionsSize;j+=3)if(eval(objects[i].timefunctions[j+1])>eval(objects[i].timefunctions[j+4])){swap(objects[i].timefunctions,j+0,j+3);swap(objects[i].timefunctions,j+1,j+4);swap(objects[i].timefunctions,j+2,j+5);ordered=false}}while(ordered===false)}}function getMethods(obj){var methods=[];for(var m in obj){if(typeof obj[m]=="function"){methods.push(m)}}return methods}function getParamNames(func){var funStr=func.toString();return funStr.slice(funStr.indexOf('(')+1,funStr.indexOf(')')).match(/([^\s,]+)/g)}function getTypeName(type){return/(\w+)\(/.exec(type.constructor.toString())[1];}function updateObjectAdd(){}function updateRemovelist(){}function controlRealtime(){if(timemoving===true){doonce=true;}else{doonce=false;realtime=Math.floor(1000*(Math.ceil(document.getElementById('second').value)*1000000+Math.ceil(document.getElementById('milli').value*1000)))/1000000000.0}}