Permalink
Browse files

more work

  • Loading branch information...
1 parent 2f402a2 commit a368fd484fac5c5d88c338fa84ad820bde5793e2 @jeromeetienne committed Aug 16, 2012
View
61 Makefile
@@ -1,5 +1,4 @@
-# makefile to automatize simple operations
-
+# makefile to automatize simple operations
server:
python -m SimpleHTTPServer
@@ -50,7 +49,7 @@ boilerplateBuild:
#################################################################################
BANNER="// tquery.js - https://github.com/jeromeetienne/tquery - MIT License"
-build: minifyCore minifyBundle minifyAll
+build: minifyCore minifyBundle minifyBundleRequire
buildCore:
echo $(BANNER) > build/tquery.js
@@ -110,60 +109,4 @@ minifyBundleRequire: buildBundleRequire
>> build/tquery-bundle-require.min.js
@echo size minified + gzip is `gzip -c build/tquery-bundle-require.min.js | wc -c` byte
-buildAll: buildBundle
- echo $(BANNER) > build/tquery-all.js
- cat build/tquery-bundle.js >> build/tquery-all.js
- cat plugins/requirejs/tquery.norequirejs.js >> build/tquery-all.js
- # plugins/keyboard
- cat vendor/threex/THREEx.KeyboardState.js >> build/tquery-all.js
- cat plugins/keyboard/tquery.keyboard.js >> build/tquery-all.js
- # plugins/shape
- cat plugins/shape/tquery.shape.js >> build/tquery-all.js
- cat plugins/shape/tquery.shape.create.js >> build/tquery-all.js
- # plugins/dollar3d
- cat plugins/dollar3d/tquery.dollar3d.js >> build/tquery-all.js
- # plugins/deviceOrientation
- #cat vendor/threex/THREEx.DeviceOrientationState.js >> build/tquery-all.js
- #cat plugins/deviceorientation/tquery.deviceorientation.js >> build/tquery-all.js
- # plugins/wobble
- cat vendor/threex/THREEx.GeometryWobble.js >> build/tquery-all.js
- cat plugins/wobble/tquery.geometry.wobble.js >> build/tquery-all.js
- # plugins/terrainGenerator
- cat vendor/three.js/ImprovedNoise.js >> build/tquery-all.js
- cat plugins/terrainGenerator/tquery.terrainGenerator.js >> build/tquery-all.js
- # plugins/domevent
- #cat plugins/domevent/threex.domevent.js >> build/tquery-all.js
- #cat plugins/domevent/tquery.object3d.domevent.js >> build/tquery-all.js
- # plugins/csg
- cat plugins/csg/csg.js >> build/tquery-all.js
- cat plugins/csg/ThreeCSG.js >> build/tquery-all.js
- cat plugins/csg/tquery.geometry.csg.js >> build/tquery-all.js
- cat plugins/csg/tquery.object3d.csg.js >> build/tquery-all.js
- # plugins/fireball
- cat plugins/fireball/tquery.fireballmaterial.js >> build/tquery-all.js
- # plugins/fireball
- cat plugins/checkerboard/tquery.checkerboard.js >> build/tquery-all.js
- # plugins/videos
- cat plugins/videos/*.js >> build/tquery-all.js
- # plugins/text
- cat plugins/text/fonts/droid/droid_serif_bold.typeface.js >> build/tquery-all.js
- cat plugins/text/tquery.text.js >> build/tquery-all.js
- # plugins/linkify
- cat plugins/linkify/tquery.mesh.linkify.js >> build/tquery-all.js
- # plugins/lights
- cat plugins/light/*.js >> build/tquery-all.js
- # plugins/materials
- cat plugins/materials/*.js >> build/tquery-all.js
- # plugins/minecraft
- cat plugins/minecraft/*.js >> build/tquery-all.js
-
-
-minifyAll: buildAll
- echo $(BANNER) > build/tquery-all.min.js
- curl --data-urlencode "js_code@build/tquery-all.js" \
- -d "output_format=text&output_info=compiled_code&compilation_level=SIMPLE_OPTIMIZATIONS" \
- http://closure-compiler.appspot.com/compile \
- >> build/tquery-all.min.js
- @echo size minified + gzip is `gzip -c build/tquery-all.min.js | wc -c` byte
-
.PHONY: docs buildCore buildBundle minifyCore minifyBundle
View
24 build/tquery-bundle-require.js
@@ -2986,19 +2986,27 @@ tQuery.World.prototype.destroy = function(){
/**
* true if webgl is available, false otherwise
*/
-tQuery.World._hasWebGL = (function(){
- // test from Detector.js
- try{
- return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' );
- } catch( e ){
- return false;
- }
-})();
+// tQuery.World._hasWebGL = (function(){
+// // test from Detector.js
+// try{
+// return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' );
+// } catch( e ){
+// return false;
+// }
+// })();
/**
* @returns {Boolean} true if webgl is available, false otherwise
*/
tQuery.World.hasWebGL = function(){
+ if( tQuery.World._hasWebGL !== undefined ) return tQuery.World._hasWebGL;
+
+ // test from Detector.js
+ try{
+ tQuery.World._hasWebGL = !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' );
+ } catch( e ){
+ tQuery.World._hasWebGL = false;
+ }
return tQuery.World._hasWebGL;
};
View
854 build/tquery-bundle-require.min.js
854 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
24 build/tquery-bundle.js
@@ -2986,19 +2986,27 @@ tQuery.World.prototype.destroy = function(){
/**
* true if webgl is available, false otherwise
*/
-tQuery.World._hasWebGL = (function(){
- // test from Detector.js
- try{
- return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' );
- } catch( e ){
- return false;
- }
-})();
+// tQuery.World._hasWebGL = (function(){
+// // test from Detector.js
+// try{
+// return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' );
+// } catch( e ){
+// return false;
+// }
+// })();
/**
* @returns {Boolean} true if webgl is available, false otherwise
*/
tQuery.World.hasWebGL = function(){
+ if( tQuery.World._hasWebGL !== undefined ) return tQuery.World._hasWebGL;
+
+ // test from Detector.js
+ try{
+ tQuery.World._hasWebGL = !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' );
+ } catch( e ){
+ tQuery.World._hasWebGL = false;
+ }
return tQuery.World._hasWebGL;
};
View
48 build/tquery-bundle.min.js
@@ -1,4 +1,3 @@
-// tquery.js - https://github.com/jeromeetienne/tquery - MIT License
(function(a){"function"==typeof define?define(a):a()})(function(){function a(a){try{return Object.defineProperty(a,"sentinel",{}),"sentinel"in a}catch(b){}}Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError("Function.prototype.bind called on incompatible "+b);var c=d.call(arguments,1),e=function(){if(this instanceof e){var f=function(){};f.prototype=b.prototype;var f=new f,g=b.apply(f,c.concat(d.call(arguments)));return Object(g)===
g?g:f}return b.apply(a,c.concat(d.call(arguments)))};return e});var b=Function.prototype.call,c=Object.prototype,d=Array.prototype.slice,e=b.bind(c.toString),f=b.bind(c.hasOwnProperty),g,h,i,l,k;if(k=f(c,"__defineGetter__"))g=b.bind(c.__defineGetter__),h=b.bind(c.__defineSetter__),i=b.bind(c.__lookupGetter__),l=b.bind(c.__lookupSetter__);Array.isArray||(Array.isArray=function(a){return e(a)=="[object Array]"});Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c=y(this),d=-1,f=c.length>>>
0;if(e(a)!="[object Function]")throw new TypeError;for(;++d<f;)d in c&&a.call(b,c[d],d,c)});Array.prototype.map||(Array.prototype.map=function(a,b){var c=y(this),d=c.length>>>0,f=Array(d);if(e(a)!="[object Function]")throw new TypeError(a+" is not a function");for(var g=0;g<d;g++)g in c&&(f[g]=a.call(b,c[g],g,c));return f});Array.prototype.filter||(Array.prototype.filter=function(a,b){var c=y(this),d=c.length>>>0,f=[],g;if(e(a)!="[object Function]")throw new TypeError(a+" is not a function");for(var i=
@@ -19,7 +18,7 @@ if(!String.prototype.trim||x.trim()){x="["+x+"]";var E=RegExp("^"+x+x+"*"),w=Reg
Object(a)}});"use strict";var THREE=THREE||{REVISION:"49"};self.Int32Array||(self.Int32Array=Array,self.Float32Array=Array);
(function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c<b.length&&!window.requestAnimationFrame;++c)window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]||window[b[c]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(b){var c=Date.now(),f=Math.max(0,16-(c-a)),g=window.setTimeout(function(){b(c+f)},f);a=c+f;return g});window.cancelAnimationFrame||(window.cancelAnimationFrame=
function(a){clearTimeout(a)})})();THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1};THREE.Clock.prototype.start=function(){this.oldTime=this.startTime=Date.now();this.running=!0};THREE.Clock.prototype.stop=function(){this.getElapsedTime();this.running=!1};THREE.Clock.prototype.getElapsedTime=function(){return this.elapsedTime+=this.getDelta()};
-THREE.Clock.prototype.getDelta=function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=Date.now(),a=0.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a};THREE.Color=function(a){void 0!==a&&this.setHex(a);return this};
+THREE.Clock.prototype.getDelta=function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=Date.now(),a=0.0010*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a};THREE.Color=function(a){void 0!==a&&this.setHex(a);return this};
THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},copyGammaToLinear:function(a){this.r=a.r*a.r;this.g=a.g*a.g;this.b=a.b*a.b;return this},copyLinearToGamma:function(a){this.r=Math.sqrt(a.r);this.g=Math.sqrt(a.g);this.b=Math.sqrt(a.b);return this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;this.r=a*a;this.g=b*b;this.b=c*c;return this},convertLinearToGamma:function(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);
this.b=Math.sqrt(this.b);return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,e,f;if(0===c)this.r=this.g=this.b=0;else switch(d=Math.floor(6*a),e=6*a-d,a=c*(1-b),f=c*(1-b*e),b=c*(1-b*(1-e)),d){case 1:this.r=f;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=f;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r=c;this.g=a;this.b=f;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=
Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},lerpSelf:function(a,b){this.r+=(a.r-this.r)*b;this.g+=(a.g-this.g)*b;this.b+=(a.b-this.b)*b;return this},getHex:function(){return Math.floor(255*this.r)<<16^Math.floor(255*this.g)<<8^Math.floor(255*this.b)},getContextStyle:function(){return"rgb("+Math.floor(255*this.r)+","+Math.floor(255*this.g)+","+Math.floor(255*this.b)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
@@ -96,7 +95,7 @@ this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRo
Math.abs(this.x);this.y=0>a.elements[8]-a.elements[2]?-Math.abs(this.y):Math.abs(this.y);this.z=0>a.elements[1]-a.elements[4]?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*
this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===a?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,f=a.x,g=a.y,h=a.z,a=a.w;this.x=b*a+e*f+c*h-d*g;this.y=c*a+e*g+d*f-b*h;this.z=d*a+e*h+b*g-c*f;this.w=
e*a-b*f-c*g-d*h;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,f=this.x,g=this.y,h=this.z,i=this.w,l=i*c+g*e-h*d,k=i*d+h*c-f*e,p=i*e+f*d-g*c,c=-f*c-g*d-h*e;b.x=l*i+c*-f+k*-h-p*-g;b.y=k*i+c*-g+p*-f-l*-h;b.z=p*i+c*-h+l*-g-k*-f;return b},clone:function(){return new THREE.Quaternion(this.x,this.y,this.z,this.w)}};
-THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;0>e?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,e=-e):c.copy(b);if(1<=Math.abs(e))return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var f=Math.acos(e),e=Math.sqrt(1-e*e);if(0.001>Math.abs(e))return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(){console.warn("THREE.Vertex has been DEPRECATED. Use THREE.Vector3 instead.")};
+THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;0>e?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,e=-e):c.copy(b);if(1<=Math.abs(e))return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var f=Math.acos(e),e=Math.sqrt(1-e*e);if(0.0010>Math.abs(e))return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(){console.warn("THREE.Vertex has been DEPRECATED. Use THREE.Vector3 instead.")};
THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=f;this.centroid=new THREE.Vector3};
THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
return a}};THREE.Face4=function(a,b,c,d,e,f,g){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};
@@ -548,7 +547,7 @@ c?THREE.Quaternion.slerp(e,f,a.quaternion,d):"scl"===c&&(c=a.scale,c.x=e[0]+(f[0
THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],d=[],e,f,g,h,i,l;e=(a.length-1)*b;f=Math.floor(e);e-=f;c[0]=0===f?f:f-1;c[1]=f;c[2]=f>a.length-2?f:f+1;c[3]=f>a.length-3?f:f+2;f=a[c[0]];h=a[c[1]];i=a[c[2]];l=a[c[3]];c=e*e;g=e*c;d[0]=this.interpolate(f[0],h[0],i[0],l[0],e,c,g);d[1]=this.interpolate(f[1],h[1],i[1],l[1],e,c,g);d[2]=this.interpolate(f[2],h[2],i[2],l[2],e,c,g);return d};
THREE.Animation.prototype.interpolate=function(a,b,c,d,e,f,g){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]};
THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]};
-THREE.KeyFrameAnimation=function(a,b,c){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=0.001;this.isPlaying=!1;this.loop=this.isPaused=!0;this.JITCompile=void 0!==c?c:!0;a=0;for(b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var f=c[e],g=this.getNextKeyWith(f,a,0);g&&g.apply(f)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
+THREE.KeyFrameAnimation=function(a,b,c){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=0.0010;this.isPlaying=!1;this.loop=this.isPaused=!0;this.JITCompile=void 0!==c?c:!0;a=0;for(b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var f=c[e],g=this.getNextKeyWith(f,a,0);g&&g.apply(f)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
d.matrixWorldNeedsUpdate=!0}}};
THREE.KeyFrameAnimation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=void 0!==a?a:!0;this.currentTime=void 0!==b?b:0;this.startTimeMs=b;this.startTime=1E7;this.endTime=-this.startTime;var c,d=this.hierarchy.length,e,f;for(c=0;c<d;c++)if(e=this.hierarchy[c],f=this.data.hierarchy[c],e.useQuaternion=!0,void 0===f.animationCache&&(f.animationCache={},f.animationCache.prevKey=null,f.animationCache.nextKey=null,f.animationCache.originalMatrix=e instanceof THREE.Bone?e.skinMatrix:
e.matrix),e=this.data.hierarchy[c].keys,e.length)f.animationCache.prevKey=e[0],f.animationCache.nextKey=e[1],this.startTime=Math.min(e[0].time,this.startTime),this.endTime=Math.max(e[e.length-1].time,this.endTime);this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};THREE.KeyFrameAnimation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
@@ -567,7 +566,7 @@ THREE.CombinedCamera.prototype.setSize=function(a,b){this.cameraP.aspect=a/b;thi
THREE.CombinedCamera.prototype.setLens=function(a,b){var c=2*Math.atan((void 0!==b?b:24)/(2*a))*(180/Math.PI);this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPersepectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};
THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};
THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};
-THREE.FirstPersonControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.target=new THREE.Vector3(0,0,0);this.domElement=void 0!==b?b:document;this.movementSpeed=1;this.lookSpeed=0.005;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=Math.PI;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=
+THREE.FirstPersonControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.target=new THREE.Vector3(0,0,0);this.domElement=void 0!==b?b:document;this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=Math.PI;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=
0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));this.onMouseDown=function(a){this.domElement!==document&&this.domElement.focus();a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=
true;break;case 2:this.moveBackward=true}this.mouseDragOn=true};this.onMouseUp=function(a){a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=false;break;case 2:this.moveBackward=false}this.mouseDragOn=false};this.onMouseMove=function(a){if(this.domElement===document){this.mouseX=a.pageX-this.viewHalfX;this.mouseY=a.pageY-this.viewHalfY}else{this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX;this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY}};
this.onKeyDown=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=true;break;case 37:case 65:this.moveLeft=true;break;case 40:case 83:this.moveBackward=true;break;case 39:case 68:this.moveRight=true;break;case 82:this.moveUp=true;break;case 70:this.moveDown=true;break;case 81:this.freeze=!this.freeze}};this.onKeyUp=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=false;break;case 37:case 65:this.moveLeft=false;break;case 40:case 83:this.moveBackward=false;break;case 39:case 68:this.moveRight=
@@ -578,14 +577,14 @@ Math.sin(this.theta);b=1;this.constrainVertical&&(b=Math.PI/(this.verticalMax-th
c(this,this.onKeyUp),!1)};
THREE.PathControls=function(a,b){function c(a){return 1>(a*=2)?0.5*a*a:-0.5*(--a*(a-2)-1)}function d(a,b){return function(){b.apply(a,arguments)}}function e(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},f,g=b.getControlPointsArray(),h=b.getLength(),r=g.length,u=0;f=r-1;b={parent:-1,keys:[]};b.keys[0]={time:0,pos:g[0],rot:[0,0,0,1],scl:[1,1,1]};b.keys[f]={time:d,pos:g[f],rot:[0,0,0,1],scl:[1,1,1]};for(f=1;f<r-1;f++)u=d*h.chunks[f]/h.total,b.keys[f]={time:u,pos:g[f]};e.hierarchy[0]=b;THREE.AnimationHandler.add(e);
return new THREE.Animation(a,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function f(a,b){var c,d,e=new THREE.Geometry;for(c=0;c<a.points.length*b;c++)d=c/(a.points.length*b),d=a.getPoint(d),e.vertices[c]=new THREE.Vector3(d.x,d.y,d.z);return e}this.object=a;this.domElement=void 0!==b?b:document;this.id="PathControls"+THREE.PathControlsIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;
-this.animationParent=new THREE.Object3D;this.lookSpeed=0.005;this.lookHorizontal=this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.horizontalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.target=new THREE.Object3D;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/
-2,this.domElement.setAttribute("tabindex",-1));var g=2*Math.PI,h=Math.PI/180;this.update=function(a){var b;if(this.lookHorizontal)this.lon=this.lon+this.mouseX*this.lookSpeed*a;if(this.lookVertical)this.lat=this.lat-this.mouseY*this.lookSpeed*a;this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*h;this.theta=this.lon*h;a=this.phi%g;this.phi=a>=0?a:a+g;b=this.verticalAngleMap.srcRange;a=this.verticalAngleMap.dstRange;b=THREE.Math.mapLinear(this.phi,
-b[0],b[1],a[0],a[1]);var d=a[1]-a[0];this.phi=c((b-a[0])/d)*d+a[0];b=this.horizontalAngleMap.srcRange;a=this.horizontalAngleMap.dstRange;b=THREE.Math.mapLinear(this.theta,b[0],b[1],a[0],a[1]);d=a[1]-a[0];this.theta=c((b-a[0])/d)*d+a[0];a=this.target.position;a.x=100*Math.sin(this.phi)*Math.cos(this.theta);a.y=100*Math.cos(this.phi);a.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove=function(a){if(this.domElement===document){this.mouseX=a.pageX-
-this.viewHalfX;this.mouseY=a.pageY-this.viewHalfY}else{this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX;this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY}};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),b=new THREE.MeshLambertMaterial({color:65280}),c=new THREE.CubeGeometry(10,
-10,20),g=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(c,a);a=new THREE.Mesh(g,b);a.position.set(0,10,0);this.animation=e(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(a)}else{this.animation=e(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.target);this.animationParent.add(this.object)}if(this.createDebugPath){var a=this.debugPath,
-b=this.spline,g=f(b,10),c=f(b,10),h=new THREE.LineBasicMaterial({color:16711680,linewidth:3}),g=new THREE.Line(g,h),c=new THREE.ParticleSystem(c,new THREE.ParticleBasicMaterial({color:16755200,size:3}));g.scale.set(1,1,1);a.add(g);c.scale.set(1,1,1);a.add(c);for(var g=new THREE.SphereGeometry(1,16,8),h=new THREE.MeshBasicMaterial({color:65280}),o=0;o<b.points.length;o++){c=new THREE.Mesh(g,h);c.position.copy(b.points[o]);a.add(c)}}this.domElement.addEventListener("mousemove",d(this,this.onMouseMove),
-false)}};THREE.PathControlsIdCounter=0;
-THREE.FlyControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.domElement=void 0!==b?b:document;b&&this.domElement.setAttribute("tabindex",-1);this.movementSpeed=1;this.rollSpeed=0.005;this.autoForward=this.dragToLook=!1;this.object.useQuaternion=!0;this.tmpQuaternion=new THREE.Quaternion;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,
+this.animationParent=new THREE.Object3D;this.lookSpeed=0.0050;this.lookHorizontal=this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.horizontalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.target=new THREE.Object3D;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=
+this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var g=2*Math.PI,h=Math.PI/180;this.update=function(a){var b;if(this.lookHorizontal)this.lon=this.lon+this.mouseX*this.lookSpeed*a;if(this.lookVertical)this.lat=this.lat-this.mouseY*this.lookSpeed*a;this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*h;this.theta=this.lon*h;a=this.phi%g;this.phi=a>=0?a:a+g;b=this.verticalAngleMap.srcRange;a=this.verticalAngleMap.dstRange;
+b=THREE.Math.mapLinear(this.phi,b[0],b[1],a[0],a[1]);var d=a[1]-a[0];this.phi=c((b-a[0])/d)*d+a[0];b=this.horizontalAngleMap.srcRange;a=this.horizontalAngleMap.dstRange;b=THREE.Math.mapLinear(this.theta,b[0],b[1],a[0],a[1]);d=a[1]-a[0];this.theta=c((b-a[0])/d)*d+a[0];a=this.target.position;a.x=100*Math.sin(this.phi)*Math.cos(this.theta);a.y=100*Math.cos(this.phi);a.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove=function(a){if(this.domElement===
+document){this.mouseX=a.pageX-this.viewHalfX;this.mouseY=a.pageY-this.viewHalfY}else{this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX;this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY}};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),b=new THREE.MeshLambertMaterial({color:65280}),
+c=new THREE.CubeGeometry(10,10,20),g=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(c,a);a=new THREE.Mesh(g,b);a.position.set(0,10,0);this.animation=e(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(a)}else{this.animation=e(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.target);this.animationParent.add(this.object)}if(this.createDebugPath){var a=
+this.debugPath,b=this.spline,g=f(b,10),c=f(b,10),h=new THREE.LineBasicMaterial({color:16711680,linewidth:3}),g=new THREE.Line(g,h),c=new THREE.ParticleSystem(c,new THREE.ParticleBasicMaterial({color:16755200,size:3}));g.scale.set(1,1,1);a.add(g);c.scale.set(1,1,1);a.add(c);for(var g=new THREE.SphereGeometry(1,16,8),h=new THREE.MeshBasicMaterial({color:65280}),o=0;o<b.points.length;o++){c=new THREE.Mesh(g,h);c.position.copy(b.points[o]);a.add(c)}}this.domElement.addEventListener("mousemove",d(this,
+this.onMouseMove),false)}};THREE.PathControlsIdCounter=0;
+THREE.FlyControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.domElement=void 0!==b?b:document;b&&this.domElement.setAttribute("tabindex",-1);this.movementSpeed=1;this.rollSpeed=0.0050;this.autoForward=this.dragToLook=!1;this.object.useQuaternion=!0;this.tmpQuaternion=new THREE.Quaternion;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,
0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.handleEvent=function(a){if("function"==typeof this[a.type])this[a.type](a)};this.keydown=function(a){if(!a.altKey){switch(a.keyCode){case 16:this.movementSpeedMultiplier=0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=
1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};this.keyup=function(a){switch(a.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=
0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector();this.updateRotationVector()};this.mousedown=function(a){this.domElement!==document&&this.domElement.focus();a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus++;else switch(a.button){case 0:this.object.moveForward=
@@ -703,7 +702,7 @@ b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b
"color");n.scale=b.getUniformLocation(k,"scale");n.rotation=b.getUniformLocation(k,"rotation");n.screenPosition=b.getUniformLocation(k,"screenPosition");o=!1};this.render=function(a,d,e,u){var a=a.__webglFlares,t=a.length;if(t){var s=new THREE.Vector3,v=u/e,x=0.5*e,E=0.5*u,w=16/u,z=new THREE.Vector2(w*v,w),B=new THREE.Vector3(1,1,0),y=new THREE.Vector2(1,1),M=n,w=p;b.useProgram(k);o||(b.enableVertexAttribArray(p.vertex),b.enableVertexAttribArray(p.uv),o=!0);b.uniform1i(M.occlusionMap,0);b.uniform1i(M.map,
1);b.bindBuffer(b.ARRAY_BUFFER,f);b.vertexAttribPointer(w.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(w.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.disable(b.CULL_FACE);b.depthMask(!1);var J,S,P,C,H;for(J=0;J<t;J++)if(w=16/u,z.set(w*v,w),C=a[J],s.set(C.matrixWorld.elements[12],C.matrixWorld.elements[13],C.matrixWorld.elements[14]),d.matrixWorldInverse.multiplyVector3(s),d.projectionMatrix.multiplyVector3(s),B.copy(s),y.x=B.x*x+x,y.y=B.y*E+E,l||0<y.x&&y.x<e&&0<y.y&&y.y<u){b.activeTexture(b.TEXTURE1);
b.bindTexture(b.TEXTURE_2D,h);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,y.x-8,y.y-8,16,16,0);b.uniform1i(M.renderType,0);b.uniform2f(M.scale,z.x,z.y);b.uniform3f(M.screenPosition,B.x,B.y,B.z);b.disable(b.BLEND);b.enable(b.DEPTH_TEST);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,i);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,y.x-8,y.y-8,16,16,0);b.uniform1i(M.renderType,1);b.disable(b.DEPTH_TEST);b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,
-h);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);C.positionScreen.copy(B);C.customUpdateCallback?C.customUpdateCallback(C):C.updateLensFlares();b.uniform1i(M.renderType,2);b.enable(b.BLEND);S=0;for(P=C.lensFlares.length;S<P;S++)H=C.lensFlares[S],0.001<H.opacity&&0.001<H.scale&&(B.x=H.x,B.y=H.y,B.z=H.z,w=H.size*H.scale/u,z.x=w*v,z.y=w,b.uniform3f(M.screenPosition,B.x,B.y,B.z),b.uniform2f(M.scale,z.x,z.y),b.uniform1f(M.rotation,H.rotation),b.uniform1f(M.opacity,H.opacity),b.uniform3f(M.color,H.color.r,
+h);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);C.positionScreen.copy(B);C.customUpdateCallback?C.customUpdateCallback(C):C.updateLensFlares();b.uniform1i(M.renderType,2);b.enable(b.BLEND);S=0;for(P=C.lensFlares.length;S<P;S++)H=C.lensFlares[S],0.0010<H.opacity&&0.0010<H.scale&&(B.x=H.x,B.y=H.y,B.z=H.z,w=H.size*H.scale/u,z.x=w*v,z.y=w,b.uniform3f(M.screenPosition,B.x,B.y,B.z),b.uniform2f(M.scale,z.x,z.y),b.uniform1f(M.rotation,H.rotation),b.uniform1f(M.opacity,H.opacity),b.uniform3f(M.color,H.color.r,
H.color.g,H.color.b),c.setBlending(H.blending,H.blendEquation,H.blendSrc,H.blendDst),c.setTexture(H.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0))}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};
THREE.ShadowMapPlugin=function(){var a,b,c,d,e=new THREE.Frustum,f=new THREE.Matrix4,g=new THREE.Vector3,h=new THREE.Vector3;this.init=function(e){a=e.context;b=e;var e=THREE.ShaderLib.depthRGBA,f=THREE.UniformsUtils.clone(e.uniforms);c=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f});d=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f,morphTargets:!0});c._shadowPass=!0;d._shadowPass=!0};this.render=function(a,
c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(i,l){var k,p,n,o,q,m,r,u,t,s=[];o=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);b.shadowMapCullFrontFaces?a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(!0);k=0;for(p=i.__lights.length;k<p;k++)if(n=i.__lights[k],n.castShadow)if(n instanceof THREE.DirectionalLight&&n.shadowCascade)for(q=0;q<n.shadowCascadeCount;q++){var v;if(n.shadowCascadeArray[q])v=n.shadowCascadeArray[q];else{t=n;r=q;v=
@@ -740,13 +739,13 @@ tQuery.pluginsInstanceOn=function(a){return tQuery._pluginsOn(a)};tQuery.plugins
tQuery.mixinAttributes=function(a,b){a.prototype._attrProps=tQuery.extend(a.prototype._attrProps,b);a.prototype.attr=function(a,b){a instanceof Object&&void 0===b?Object.keys(a).forEach(function(b){this.attr(b,a[b])}.bind(this)):"string"===typeof a?console.assert(-1!==Object.keys(this._attrProps).indexOf(a),"invalid property name:"+a):console.assert(!1,"invalid parameter");return void 0!==b?(b=(0,this._attrProps[a])(b),this.each(function(e){e[a]=b}),this):0===this.length?void 0:this.get(0)[a]};Object.keys(b).forEach(function(b){a.prototype[b]=
function(a){return this.attr(b,a)}}.bind(this))};tQuery.Flow=function(){var a,b=[],c=setTimeout(function(){c=null;a._next()},0);return a={destroy:function(){c&&clearTimeout(c)},par:function(c,e){(e||!(b[b.length-1]instanceof Array))&&b.push([]);b[b.length-1].push(c);return a},seq:function(b){return a.par(b,!0)},_next:function(c,e){var f=[],g=[],h=b.shift()||[],i=h.length,l=1==i;h&&h.forEach(function(b,h){b(function(b,c){f[h]=b;g[h]=c;0==--i&&a._next(l?f[0]:f,l?g[0]:g)},c,e)})}}};
tQuery.MicroeventMixin=function(a){a.bind=function(a,c){void 0===this._events&&(this._events={});this._events[a]=this._events[a]||[];this._events[a].push(c);return c};a.unbind=function(a,c){void 0===this._events&&(this._events={});!1!==a in this._events&&this._events[a].splice(this._events[a].indexOf(c),1)};a.trigger=function(a){void 0===this._events&&(this._events={});if(void 0!==this._events[a])for(var c=this._events[a].slice(),d=0;d<c.length;d++)c[d].apply(this,Array.prototype.slice.call(arguments,
-1))};a.addEventListener=function(b,c){a.bind(b,c);return this};a.removeEventListener=function(b,c){a.unbind(b,c);return this};a.dispatchEvent=function(b){a.trigger(b);return this}};tQuery.convert={};tQuery.convert.toThreeColor=function(a){if(1===arguments.length&&"number"===typeof a)return new THREE.Color(a);if(1===arguments.length&&a instanceof THREE.Color)return a;console.assert(!1,"invalid parameter")};
+1))};a.addEventListener=function(a,c){this.bind(a,c);return this};a.removeEventListener=function(a,c){this.unbind(a,c);return this};a.dispatchEvent=function(a){this.trigger.apply(this,arguments);return this}};tQuery.convert={};tQuery.convert.toThreeColor=function(a){if(1===arguments.length&&"number"===typeof a)return new THREE.Color(a);if(1===arguments.length&&a instanceof THREE.Color)return a;console.assert(!1,"invalid parameter")};
tQuery.convert.toNumber=function(a){if(1===arguments.length&&"number"===typeof a)return a;console.assert(!1,"invalid parameter")};tQuery.convert.toNumberZeroToOne=function(a){if(1===arguments.length&&"number"===typeof a)return a=Math.min(a,1),a=Math.max(a,0);console.assert(!1,"invalid parameter")};tQuery.convert.toInteger=function(a){if(1===arguments.length&&"number"===typeof a)return a=Math.floor(a);console.assert(!1,"invalid parameter")};tQuery.convert.identity=function(a){return a};
-tQuery.convert.toBool=function(a){if(1===arguments.length&&"boolean"===typeof a)return a;console.assert(!1,"invalid parameter")};tQuery.convert.toString=function(a){if(1===arguments.length&&"string"===typeof a)return a;console.assert(!1,"invalid parameter")};
+tQuery.convert.toBoolean=function(a){if(1===arguments.length&&"boolean"===typeof a)return a;console.assert(!1,"invalid parameter")};tQuery.convert.toString=function(a){if(1===arguments.length&&"string"===typeof a)return a;console.assert(!1,"invalid parameter")};
tQuery.convert.toTexture=function(a){if(1===arguments.length&&a instanceof THREE.Texture)return a;if(1===arguments.length&&"string"===typeof a)return THREE.ImageUtils.loadTexture(a);if(1===arguments.length&&(a instanceof Image||a instanceof HTMLCanvasElement)){var b=new THREE.Texture(a);b.needsUpdate=!0;return b}console.assert(!1,"invalid parameter")};tQuery.Node=function(a){this._lists=a instanceof Array?a:a?[a]:[];this.length=this._lists.length};
tQuery.Node.prototype.get=function(a){if(void 0===a)return this._lists;console.assert(this._lists[a],"element not defined");return this._lists[a]};tQuery.Node.prototype.each=function(a){return tQuery.each(this._lists,a)};tQuery.Node.prototype.back=function(a){if(void 0===a)return this._back;this._back=a;return this};tQuery.Node.prototype.data=function(a,b){if(b)return this.each(function(c){tQuery.data(c,a,b)}),this;if(0<this.length)return tQuery.data(this.get(0),a);console.assert(0===this.length)};
tQuery.Node.prototype.removeData=function(a){this.each(function(b){tQuery.removeData(b,a)});return this};tQuery.Object3D=function(a,b){"string"===typeof a&&(a=tQuery.Object3D._select(a,b));tQuery.Object3D.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.Object3D)})};tQuery.inherit(tQuery.Object3D,tQuery.Node);tQuery.pluginsInstanceOn(tQuery.Object3D);
-tQuery.mixinAttributes(tQuery.Object3D,{eulerOrder:tQuery.convert.toString,doubleSided:tQuery.convert.toBool,flipSided:tQuery.convert.toBool,rotationAutoUpdate:tQuery.convert.toBool,matrixAutoUpdate:tQuery.convert.toBool,matrixWorldNeedsUpdate:tQuery.convert.toBool,useQuaternion:tQuery.convert.toBool,visible:tQuery.convert.toBool,receiveShadow:tQuery.convert.toBool,castShadow:tQuery.convert.toBool});
+tQuery.mixinAttributes(tQuery.Object3D,{eulerOrder:tQuery.convert.toString,doubleSided:tQuery.convert.toBoolean,flipSided:tQuery.convert.toBoolean,rotationAutoUpdate:tQuery.convert.toBoolean,matrixAutoUpdate:tQuery.convert.toBoolean,matrixWorldNeedsUpdate:tQuery.convert.toBoolean,useQuaternion:tQuery.convert.toBoolean,visible:tQuery.convert.toBoolean,receiveShadow:tQuery.convert.toBoolean,castShadow:tQuery.convert.toBoolean});
tQuery.Object3D.prototype.traverseHierarchy=function(a){this.each(function(b){THREE.SceneUtils.traverseHierarchy(b,function(b){a(b)})});return this};tQuery.Object3D.prototype.geometry=function(){var a=[];this.each(function(b){a.push(b.geometry)});return(new tQuery.Geometry(a)).back(this)};tQuery.Object3D.prototype.material=function(){var a=[];this.each(function(b){a.push(b.material)});return new tQuery.Material(a)};
tQuery.Object3D.prototype.clone=function(){var a=[];this._lists.forEach(function(b){b=THREE.SceneUtils.cloneObject(b);a.push(b)});return tQuery(a)};tQuery.Object3D.prototype.addTo=function(a){console.assert(a instanceof tQuery.World||a instanceof tQuery.Object3D||a instanceof THREE.Object3D);this.each(function(b){a.add(b)}.bind(this));return this};
tQuery.Object3D.prototype.removeFrom=function(a){console.assert(a instanceof tQuery.World||a instanceof tQuery.Object3D);this.each(function(b){a.remove(b)}.bind(this));return this};tQuery.Object3D.prototype.add=function(a){a instanceof tQuery.Object3D?this.each(function(b){a.each(function(a){b.add(a)})}.bind(this)):a instanceof THREE.Object3D?this.each(function(b){b.add(a)}):console.assert(!1,"invalid parameter");return this};
@@ -758,17 +757,18 @@ tQuery.Object3D._crawls=function(a,b){var c=[];console.assert(1<=b.length);var d
tQuery.Object3D._selectableLights=Object.keys(THREE).filter(function(a){return a.match(/.+Light$/)}).map(function(a){return a.replace(/Light$/,"").toLowerCase()});tQuery.Object3D._selectableClasses=["mesh","light"];
tQuery.Object3D._selectItemMatch=function(a,b){console.assert(a instanceof THREE.Object3D);console.assert("string"===typeof b);var c=b.match(RegExp("([^.#]+|.[^.#]+|#[^.#]+)","g"));return tQuery.each(c,function(b){var c=b.charAt(0),f=b.slice(1);if("."===c)return tQuery.Object3D._hasClassOne(a,f)?!0:!1;if("#"===c)return a._tqId===f?!0:!1;if("*"===b)return!0;if(-1!==this._selectableGeometries.indexOf(b))return c=a.geometry,b=b.charAt(0).toUpperCase()+b.slice(1)+"Geometry",c instanceof THREE[b];if(-1!==
this._selectableLights.indexOf(b))return b=b.charAt(0).toUpperCase()+b.slice(1)+"Light",a instanceof THREE[b];if(-1!==this._selectableClasses.indexOf(b))return b=b.charAt(0).toUpperCase()+b.slice(1),a instanceof THREE[b];console.assert(!1,"invalid selector: "+b);return!0}.bind(this))?!0:!1};tQuery.Geometry=function(a){tQuery.Geometry.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.Geometry)})};tQuery.inherit(tQuery.Geometry,tQuery.Node);tQuery.pluginsInstanceOn(tQuery.Geometry);
-tQuery.mixinAttributes(tQuery.Geometry,{hasTangents:tQuery.convert.toBool,dynamic:tQuery.convert.toBool});tQuery.Material=function(a){tQuery.Material.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.Material)})};tQuery.inherit(tQuery.Material,tQuery.Node);tQuery.pluginsInstanceOn(tQuery.Material);tQuery.mixinAttributes(tQuery.Material,{opacity:tQuery.convert.toNumber,transparent:tQuery.convert.toBool});
+tQuery.mixinAttributes(tQuery.Geometry,{hasTangents:tQuery.convert.toBoolean,dynamic:tQuery.convert.toBoolean});tQuery.Material=function(a){tQuery.Material.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.Material)})};tQuery.inherit(tQuery.Material,tQuery.Node);tQuery.pluginsInstanceOn(tQuery.Material);tQuery.mixinAttributes(tQuery.Material,{opacity:tQuery.convert.toNumber,transparent:tQuery.convert.toBoolean});
tQuery.Light=function(a){tQuery.Light.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.Light)})};tQuery.inherit(tQuery.Light,tQuery.Object3D);tQuery.pluginsInstanceOn(tQuery.Light);tQuery.mixinAttributes(tQuery.Light,{color:tQuery.convert.toThreeColor});tQuery.Mesh=function(a){tQuery.Mesh.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.Mesh)})};tQuery.inherit(tQuery.Mesh,tQuery.Object3D);tQuery.pluginsInstanceOn(tQuery.Mesh);
tQuery.Mesh.prototype.material=function(a){var b=tQuery.Mesh.parent;if(void 0==a)return b.material.call(this);this.each(function(b){b.material=a});return this};
tQuery.World=function(a){a=a||{};this._opts=a=tQuery.extend(a,{renderW:window.innerWidth,renderH:window.innerHeight,webGLNeeded:!0,autoRendering:!0,scene:null,camera:null,renderer:null});console.assert(!tQuery.word);tQuery.world=this;this._autoRendering=!0;this._scene=a.scene||new THREE.Scene;a.camera?this._camera=a.camera:(this._camera=new THREE.PerspectiveCamera(35,a.renderW/a.renderH,0.01,1E4),this._camera.position.set(0,0,3),this._scene.add(this._camera));this._loop=new tQuery.Loop;this._loop.hookOnRender(this._$loopCb=
function(){this.render()}.bind(this));if(a.renderer)this._renderer=a.renderer;else if(tQuery.World.hasWebGL())this._renderer=new THREE.WebGLRenderer({antialias:!0,preserveDrawingBuffer:!0});else{if(a.webGLNeeded)throw this._addGetWebGLMessage(),Error("WebGL required and not available");this._renderer=new THREE.CanvasRenderer}this._renderer.setClearColorHex(12303291,1);this._renderer.setSize(a.renderW,a.renderH)};tQuery.pluginsInstanceOn(tQuery.World);tQuery.MicroeventMixin(tQuery.World.prototype);
-tQuery.World.prototype.destroy=function(){this.trigger("destroy");this._loop.unhookOnRender(this._$loopCb);this._loop.destroy();this.removeCameraControls();var a=this._renderer.domElement.parentElement;a&&a.removeChild(this._renderer.domElement);tQuery.world===this&&(tQuery.world=null)};tQuery.World._hasWebGL=function(){try{return!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(a){return!1}}();tQuery.World.hasWebGL=function(){return tQuery.World._hasWebGL};
+tQuery.World.prototype.destroy=function(){this.trigger("destroy");this._loop.unhookOnRender(this._$loopCb);this._loop.destroy();this.removeCameraControls();var a=this._renderer.domElement.parentElement;a&&a.removeChild(this._renderer.domElement);tQuery.world===this&&(tQuery.world=null)};
+tQuery.World.hasWebGL=function(){if(void 0!==tQuery.World._hasWebGL)return tQuery.World._hasWebGL;try{tQuery.World._hasWebGL=!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(a){tQuery.World._hasWebGL=!1}return tQuery.World._hasWebGL};
tQuery.World.prototype._addGetWebGLMessage=function(a){var a=a||document.body,b=document.createElement("div");b.style.fontFamily="monospace";b.style.fontSize="13px";b.style.textAlign="center";b.style.background="#eee";b.style.color="#000";b.style.padding="1em";b.style.width="475px";b.style.margin="5em auto 0";b.innerHTML=window.WebGLRenderingContext?'Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a>.<br />\nFind out how to get it <a href="http://get.webgl.org/">here</a>.':
-'Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a>.<br/>\nFind out how to get it <a href="http://get.webgl.org/">here</a>.';a.appendChild(b)};tQuery.World.prototype.setCameraControls=function(a){this.hasCameraControls()&&this.removeCameraControls();this._cameraControls=a;return this};tQuery.World.prototype.removeCameraControls=function(){if(!1===this.hasCameraControls())return this;this._cameraControls=void 0;return this};
-tQuery.World.prototype.getCameraControls=function(){return this._cameraControls};tQuery.World.prototype.hasCameraControls=function(){return void 0!==this._cameraControls?!0:!1};tQuery.World.prototype.add=function(a){a instanceof tQuery.Object3D?a.each(function(a){this._scene.add(a)}.bind(this)):a instanceof THREE.Object3D?this._scene.add(a):console.assert(!1,"invalid type");return this};
+'Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a>.<br/>\nFind out how to get it <a href="http://get.webgl.org/">here</a>.';a.appendChild(b)};tQuery.World.prototype.setCameraControls=function(a){this.hasCameraControls()&&this.removeCameraControls();this._cameraControls=a;return this};tQuery.World.prototype.getCameraControls=function(){return this._cameraControls};
+tQuery.World.prototype.removeCameraControls=function(){if(!1===this.hasCameraControls())return this;this._cameraControls=void 0;return this};tQuery.World.prototype.hasCameraControls=function(){return void 0!==this._cameraControls?!0:!1};tQuery.World.prototype.add=function(a){a instanceof tQuery.Object3D?a.each(function(a){this._scene.add(a)}.bind(this)):a instanceof THREE.Object3D?this._scene.add(a):console.assert(!1,"invalid type");return this};
tQuery.World.prototype.remove=function(a){a instanceof tQuery.Object3D?a.each(function(a){this._scene.remove(a)}.bind(this)):a instanceof THREE.Object3D?this._scene.remove(a):console.assert(!1,"invalid type");return this};tQuery.World.prototype.appendTo=function(a){a.appendChild(this._renderer.domElement);return this};tQuery.World.prototype.start=function(){this._loop.start();return this};tQuery.World.prototype.stop=function(){this._loop.stop();return this};tQuery.World.prototype.loop=function(){return this._loop};
-tQuery.World.prototype.tRenderer=function(){return this._renderer};tQuery.World.prototype.tCamera=function(){return this._camera};tQuery.World.prototype.tScene=function(){return this._scene};tQuery.World.prototype.renderer=function(){console.trace();console.warn("world.renderer() is ovbslete, use .tRenderer() instead");return this._renderer};tQuery.World.prototype.camera=function(){console.trace();console.warn("world.camera() is obsolete, use .tCamerar() instead");return this._camera};
+tQuery.World.prototype.tRenderer=function(){return this._renderer};tQuery.World.prototype.tScene=function(){return this._scene};tQuery.World.prototype.tCamera=function(){return this._camera};tQuery.World.prototype.renderer=function(){console.trace();console.warn("world.renderer() is ovbslete, use .tRenderer() instead");return this._renderer};tQuery.World.prototype.camera=function(){console.trace();console.warn("world.camera() is obsolete, use .tCamerar() instead");return this._camera};
tQuery.World.prototype.scene=function(){console.trace();console.warn("world.scene() is obsolete, use .tScene() instead");return this._scene};tQuery.World.prototype.get=function(){return this._scene};tQuery.World.prototype.autoRendering=function(a){if(void 0===a)return this._autoRendering;this._autoRendering=a;return this};tQuery.World.prototype.render=function(){this.hasCameraControls()&&this._cameraControls.update();this._autoRendering&&this._renderer.render(this._scene,this._camera)};
tQuery.Loop=function(){this._hooks=[];this._lastTime=null};tQuery.pluginsInstanceOn(tQuery.Loop);tQuery.Loop.prototype.destroy=function(){this.stop()};tQuery.Loop.prototype.start=function(){this._timerId&&this.stop();this._timerId=requestAnimationFrame(this._onAnimationFrame.bind(this));return this};tQuery.Loop.prototype.stop=function(){cancelAnimationFrame(this._timerId);this._timerId=null;return this};
tQuery.Loop.prototype._onAnimationFrame=function(a){this._timerId=requestAnimationFrame(this._onAnimationFrame.bind(this));a/=1E3;this._lastTime||(this._lastTime=a-1/60);var b=a-this._lastTime;this._lastTime=a;for(var c=0;c<=this._hooks.length;c++)if(void 0!==this._hooks[c])for(var d=this._hooks[c].slice(0),e=0;e<d.length;e++)d[e](b,a)};tQuery.Loop.prototype.PRE_RENDER=20;tQuery.Loop.prototype.ON_RENDER=50;tQuery.Loop.prototype.POST_RENDER=80;
@@ -780,10 +780,10 @@ tQuery.Geometry.prototype.toMesh=function(a){var b=[];this.each(function(c){a=a|
tQuery.register("createSphere",function(){return this._createMesh(THREE.SphereGeometry,[0.5,32,16],arguments)});tQuery.register("createPlane",function(){return this._createMesh(THREE.PlaneGeometry,[1,1,16,16],arguments)});tQuery.register("createCylinder",function(){return this._createMesh(THREE.CylinderGeometry,[0.5,0.5,1,16,4],arguments)});
tQuery.register("_createMesh",function(a,b,c){var c=Array.prototype.slice.call(c),d=tQuery.defaultObject3DMaterial;c.length&&c[c.length-1]instanceof THREE.Material&&(d=c.pop());0===c.length&&(c=b.slice());c.unshift(a);a=function(a,b,c,d,i,l,k,p,n){console.assert(9>=arguments.length);return new a(b,c,d,i,l,k,p,n)}.apply(this,c);a.dynamic=!0;d=new THREE.Mesh(a,d);return tQuery(d)});tQuery.register("createAxis",function(){var a=new THREE.AxisHelper;a.scale.multiplyScalar(0.01);return tQuery(a)});
tQuery.AmbientLight=function(a){tQuery.AmbientLight.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.AmbientLight)})};tQuery.inherit(tQuery.AmbientLight,tQuery.Light);tQuery.pluginsInstanceOn(tQuery.AmbientLight);tQuery.DirectionalLight=function(a){tQuery.DirectionalLight.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.DirectionalLight)})};tQuery.inherit(tQuery.DirectionalLight,tQuery.Light);tQuery.pluginsInstanceOn(tQuery.DirectionalLight);
-tQuery.mixinAttributes(tQuery.DirectionalLight,{intensity:tQuery.convert.toNumber,distance:tQuery.convert.toNumber,shadowDarkness:tQuery.convert.toNumberZeroToOne,shadowBias:tQuery.convert.toNumber,shadowMapWidth:tQuery.convert.toInteger,shadowMapHeight:tQuery.convert.toInteger,shadowCameraRight:tQuery.convert.toNumber,shadowCameraLeft:tQuery.convert.toNumber,shadowCameraTop:tQuery.convert.toNumber,shadowCameraBottom:tQuery.convert.toNumber,shadowCameraVisible:tQuery.convert.toBool,shadowCameraNear:tQuery.convert.toNumber,
+tQuery.mixinAttributes(tQuery.DirectionalLight,{intensity:tQuery.convert.toNumber,distance:tQuery.convert.toNumber,shadowDarkness:tQuery.convert.toNumberZeroToOne,shadowBias:tQuery.convert.toNumber,shadowMapWidth:tQuery.convert.toInteger,shadowMapHeight:tQuery.convert.toInteger,shadowCameraRight:tQuery.convert.toNumber,shadowCameraLeft:tQuery.convert.toNumber,shadowCameraTop:tQuery.convert.toNumber,shadowCameraBottom:tQuery.convert.toNumber,shadowCameraVisible:tQuery.convert.toBoolean,shadowCameraNear:tQuery.convert.toNumber,
shadowCameraFar:tQuery.convert.toNumber});tQuery.PointLight=function(a){tQuery.PointLight.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.PointLight)})};tQuery.inherit(tQuery.PointLight,tQuery.Light);tQuery.pluginsInstanceOn(tQuery.PointLight);tQuery.mixinAttributes(tQuery.PointLight,{intensity:tQuery.convert.toNumber,distance:tQuery.convert.toNumber});
tQuery.SpotLight=function(a){tQuery.SpotLight.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.SpotLight)})};tQuery.inherit(tQuery.SpotLight,tQuery.Light);tQuery.pluginsInstanceOn(tQuery.SpotLight);
-tQuery.mixinAttributes(tQuery.SpotLight,{intensity:tQuery.convert.toNumber,distance:tQuery.convert.toNumber,shadowDarkness:tQuery.convert.toNumberZeroToOne,shadowBias:tQuery.convert.toNumber,shadowMapWidth:tQuery.convert.toInteger,shadowMapHeight:tQuery.convert.toInteger,shadowCameraRight:tQuery.convert.toNumber,shadowCameraLeft:tQuery.convert.toNumber,shadowCameraTop:tQuery.convert.toNumber,shadowCameraBottom:tQuery.convert.toNumber,shadowCameraVisible:tQuery.convert.toBool});
+tQuery.mixinAttributes(tQuery.SpotLight,{intensity:tQuery.convert.toNumber,distance:tQuery.convert.toNumber,shadowDarkness:tQuery.convert.toNumberZeroToOne,shadowBias:tQuery.convert.toNumber,shadowMapWidth:tQuery.convert.toInteger,shadowMapHeight:tQuery.convert.toInteger,shadowCameraRight:tQuery.convert.toNumber,shadowCameraLeft:tQuery.convert.toNumber,shadowCameraTop:tQuery.convert.toNumber,shadowCameraBottom:tQuery.convert.toNumber,shadowCameraVisible:tQuery.convert.toBoolean});
(function(){tQuery.Geometry.register("computeAll",function(){this.each(function(a){a.computeBoundingBox();a.computeCentroids();a.computeFaceNormals();a.computeVertexNormals()});return this});tQuery.Geometry.register("scaleBy",function(a){"number"===typeof a&&1===arguments.length?a=new THREE.Vector3(a,a,a):"number"===typeof a&&3===arguments.length&&(a=new THREE.Vector3(arguments[0],arguments[1],arguments[2]));console.assert(a instanceof THREE.Vector3,"Geometry.vector3 parameter error");this.each(function(b){for(var c=
0;c<b.vertices.length;c++)b.vertices[c].multiplySelf(a);b.verticesNeedUpdate=!0;b.computeBoundingBox()});return this});tQuery.Geometry.register("size",function(){console.assert(1>=this.length);if(0!==this.length){var a=this.get(0),b=new THREE.Vector3;b.x=a.boundingBox.max.x-a.boundingBox.min.x;b.y=a.boundingBox.max.y-a.boundingBox.min.y;b.z=a.boundingBox.max.z-a.boundingBox.min.z;return b}});tQuery.Geometry.register("normalize",function(){this.each(function(a){var a=tQuery(a),b=a.size();b.x>=b.y&&
b.x>=b.z?a.zoom(1/b.x):b.y>=b.x&&b.y>=b.z?a.zoom(1/b.y):a.zoom(1/b.z)});return this});tQuery.Geometry.register("middlePoint",function(){console.assert(1>=this.length);if(0!==this.length){var a=this.get(0),b=new THREE.Vector3;b.x=(a.boundingBox.max.x+a.boundingBox.min.x)/2;b.y=(a.boundingBox.max.y+a.boundingBox.min.y)/2;b.z=(a.boundingBox.max.z+a.boundingBox.min.z)/2;return b}});tQuery.Geometry.register("translate",function(a){"number"===typeof a&&3===arguments.length&&(a=new THREE.Vector3(arguments[0],
View
17 build/tquery.js
@@ -1148,22 +1148,19 @@ tQuery.World.prototype.destroy = function(){
// WebGL Support //
//////////////////////////////////////////////////////////////////////////////////
+tQuery.World._hasWebGL = undefined;
/**
- * true if webgl is available, false otherwise
+ * @returns {Boolean} true if webgl is available, false otherwise
*/
-tQuery.World._hasWebGL = (function(){
+tQuery.World.hasWebGL = function(){
+ if( tQuery.World._hasWebGL !== undefined ) return tQuery.World._hasWebGL;
+
// test from Detector.js
try{
- return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' );
+ tQuery.World._hasWebGL = !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' );
} catch( e ){
- return false;
+ tQuery.World._hasWebGL = false;
}
-})();
-
-/**
- * @returns {Boolean} true if webgl is available, false otherwise
-*/
-tQuery.World.hasWebGL = function(){
return tQuery.World._hasWebGL;
};
View
22 build/tquery.min.js
@@ -1,4 +1,3 @@
-// tquery.js - https://github.com/jeromeetienne/tquery - MIT License
var tQuery=function(a,b){if(2===arguments.length&&(arguments[0]instanceof THREE.Geometry||arguments[0]instanceof tQuery.Geometry)&&(arguments[1]instanceof THREE.Material||arguments[1]instanceof tQuery.Material)){var c=arguments[0]instanceof tQuery.Geometry?arguments[0].get(0):arguments[0],d=arguments[1]instanceof tQuery.Material?arguments[1].get(0):arguments[1],c=new THREE.Mesh(c,d);return tQuery(c)}c=Array.isArray(a)?a[0]:a;if(c instanceof THREE.Mesh&&tQuery.Mesh)return new tQuery.Mesh(a);if(c instanceof
THREE.DirectionalLight&&tQuery.DirectionalLight)return new tQuery.DirectionalLight(a);if(c instanceof THREE.AmbientLight&&tQuery.AmbientLight)return new tQuery.AmbientLight(a);if(c instanceof THREE.Light&&tQuery.Light)return new tQuery.Light(a);if(c instanceof THREE.Object3D&&tQuery.Object3D)return new tQuery.Object3D(a);if(c instanceof THREE.Geometry&&tQuery.Geometry)return new tQuery.Geometry(a);if(c instanceof THREE.Material&&tQuery.Material)return new tQuery.Material(a);if("string"===typeof c&&
tQuery.Object3D)return new tQuery.Object3D(a,b);console.assert(!1,"unsupported type")};tQuery.VERSION="r49.1";tQuery.data=function(a,b,c,d){console.assert(a,"invalid parameters");console.assert("string"===typeof b,"invalid parameters");a._tqData=a._tqData||{};d&&console.assert(void 0===a._tqData[b],"This key already exists "+b);c&&(a._tqData[b]=c);return a._tqData[b]};
@@ -8,13 +7,13 @@ tQuery.pluginsInstanceOn=function(a){return tQuery._pluginsOn(a)};tQuery.plugins
tQuery.mixinAttributes=function(a,b){a.prototype._attrProps=tQuery.extend(a.prototype._attrProps,b);a.prototype.attr=function(a,b){a instanceof Object&&void 0===b?Object.keys(a).forEach(function(b){this.attr(b,a[b])}.bind(this)):"string"===typeof a?console.assert(-1!==Object.keys(this._attrProps).indexOf(a),"invalid property name:"+a):console.assert(!1,"invalid parameter");return void 0!==b?(b=(0,this._attrProps[a])(b),this.each(function(e){e[a]=b}),this):0===this.length?void 0:this.get(0)[a]};Object.keys(b).forEach(function(b){a.prototype[b]=
function(a){return this.attr(b,a)}}.bind(this))};tQuery.Flow=function(){var a,b=[],c=setTimeout(function(){c=null;a._next()},0);return a={destroy:function(){c&&clearTimeout(c)},par:function(c,e){(e||!(b[b.length-1]instanceof Array))&&b.push([]);b[b.length-1].push(c);return a},seq:function(b){return a.par(b,!0)},_next:function(c,e){var f=[],j=[],g=b.shift()||[],h=g.length,i=1==h;g&&g.forEach(function(b,g){b(function(b,c){f[g]=b;j[g]=c;0==--h&&a._next(i?f[0]:f,i?j[0]:j)},c,e)})}}};
tQuery.MicroeventMixin=function(a){a.bind=function(a,c){void 0===this._events&&(this._events={});this._events[a]=this._events[a]||[];this._events[a].push(c);return c};a.unbind=function(a,c){void 0===this._events&&(this._events={});!1!==a in this._events&&this._events[a].splice(this._events[a].indexOf(c),1)};a.trigger=function(a){void 0===this._events&&(this._events={});if(void 0!==this._events[a])for(var c=this._events[a].slice(),d=0;d<c.length;d++)c[d].apply(this,Array.prototype.slice.call(arguments,
-1))};a.addEventListener=function(b,c){a.bind(b,c);return this};a.removeEventListener=function(b,c){a.unbind(b,c);return this};a.dispatchEvent=function(b){a.trigger(b);return this}};tQuery.convert={};tQuery.convert.toThreeColor=function(a){if(1===arguments.length&&"number"===typeof a)return new THREE.Color(a);if(1===arguments.length&&a instanceof THREE.Color)return a;console.assert(!1,"invalid parameter")};
+1))};a.addEventListener=function(a,c){this.bind(a,c);return this};a.removeEventListener=function(a,c){this.unbind(a,c);return this};a.dispatchEvent=function(a){this.trigger.apply(this,arguments);return this}};tQuery.convert={};tQuery.convert.toThreeColor=function(a){if(1===arguments.length&&"number"===typeof a)return new THREE.Color(a);if(1===arguments.length&&a instanceof THREE.Color)return a;console.assert(!1,"invalid parameter")};
tQuery.convert.toNumber=function(a){if(1===arguments.length&&"number"===typeof a)return a;console.assert(!1,"invalid parameter")};tQuery.convert.toNumberZeroToOne=function(a){if(1===arguments.length&&"number"===typeof a)return a=Math.min(a,1),a=Math.max(a,0);console.assert(!1,"invalid parameter")};tQuery.convert.toInteger=function(a){if(1===arguments.length&&"number"===typeof a)return a=Math.floor(a);console.assert(!1,"invalid parameter")};tQuery.convert.identity=function(a){return a};
-tQuery.convert.toBool=function(a){if(1===arguments.length&&"boolean"===typeof a)return a;console.assert(!1,"invalid parameter")};tQuery.convert.toString=function(a){if(1===arguments.length&&"string"===typeof a)return a;console.assert(!1,"invalid parameter")};
+tQuery.convert.toBoolean=function(a){if(1===arguments.length&&"boolean"===typeof a)return a;console.assert(!1,"invalid parameter")};tQuery.convert.toString=function(a){if(1===arguments.length&&"string"===typeof a)return a;console.assert(!1,"invalid parameter")};
tQuery.convert.toTexture=function(a){if(1===arguments.length&&a instanceof THREE.Texture)return a;if(1===arguments.length&&"string"===typeof a)return THREE.ImageUtils.loadTexture(a);if(1===arguments.length&&(a instanceof Image||a instanceof HTMLCanvasElement)){var b=new THREE.Texture(a);b.needsUpdate=!0;return b}console.assert(!1,"invalid parameter")};tQuery.Node=function(a){this._lists=a instanceof Array?a:a?[a]:[];this.length=this._lists.length};
tQuery.Node.prototype.get=function(a){if(void 0===a)return this._lists;console.assert(this._lists[a],"element not defined");return this._lists[a]};tQuery.Node.prototype.each=function(a){return tQuery.each(this._lists,a)};tQuery.Node.prototype.back=function(a){if(void 0===a)return this._back;this._back=a;return this};tQuery.Node.prototype.data=function(a,b){if(b)return this.each(function(c){tQuery.data(c,a,b)}),this;if(0<this.length)return tQuery.data(this.get(0),a);console.assert(0===this.length)};
tQuery.Node.prototype.removeData=function(a){this.each(function(b){tQuery.removeData(b,a)});return this};tQuery.Object3D=function(a,b){"string"===typeof a&&(a=tQuery.Object3D._select(a,b));tQuery.Object3D.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.Object3D)})};tQuery.inherit(tQuery.Object3D,tQuery.Node);tQuery.pluginsInstanceOn(tQuery.Object3D);
-tQuery.mixinAttributes(tQuery.Object3D,{eulerOrder:tQuery.convert.toString,doubleSided:tQuery.convert.toBool,flipSided:tQuery.convert.toBool,rotationAutoUpdate:tQuery.convert.toBool,matrixAutoUpdate:tQuery.convert.toBool,matrixWorldNeedsUpdate:tQuery.convert.toBool,useQuaternion:tQuery.convert.toBool,visible:tQuery.convert.toBool,receiveShadow:tQuery.convert.toBool,castShadow:tQuery.convert.toBool});
+tQuery.mixinAttributes(tQuery.Object3D,{eulerOrder:tQuery.convert.toString,doubleSided:tQuery.convert.toBoolean,flipSided:tQuery.convert.toBoolean,rotationAutoUpdate:tQuery.convert.toBoolean,matrixAutoUpdate:tQuery.convert.toBoolean,matrixWorldNeedsUpdate:tQuery.convert.toBoolean,useQuaternion:tQuery.convert.toBoolean,visible:tQuery.convert.toBoolean,receiveShadow:tQuery.convert.toBoolean,castShadow:tQuery.convert.toBoolean});
tQuery.Object3D.prototype.traverseHierarchy=function(a){this.each(function(b){THREE.SceneUtils.traverseHierarchy(b,function(b){a(b)})});return this};tQuery.Object3D.prototype.geometry=function(){var a=[];this.each(function(b){a.push(b.geometry)});return(new tQuery.Geometry(a)).back(this)};tQuery.Object3D.prototype.material=function(){var a=[];this.each(function(b){a.push(b.material)});return new tQuery.Material(a)};
tQuery.Object3D.prototype.clone=function(){var a=[];this._lists.forEach(function(b){b=THREE.SceneUtils.cloneObject(b);a.push(b)});return tQuery(a)};tQuery.Object3D.prototype.addTo=function(a){console.assert(a instanceof tQuery.World||a instanceof tQuery.Object3D||a instanceof THREE.Object3D);this.each(function(b){a.add(b)}.bind(this));return this};
tQuery.Object3D.prototype.removeFrom=function(a){console.assert(a instanceof tQuery.World||a instanceof tQuery.Object3D);this.each(function(b){a.remove(b)}.bind(this));return this};tQuery.Object3D.prototype.add=function(a){a instanceof tQuery.Object3D?this.each(function(b){a.each(function(a){b.add(a)})}.bind(this)):a instanceof THREE.Object3D?this.each(function(b){b.add(a)}):console.assert(!1,"invalid parameter");return this};
@@ -26,17 +25,18 @@ tQuery.Object3D._crawls=function(a,b){var c=[];console.assert(1<=b.length);var d
tQuery.Object3D._selectableLights=Object.keys(THREE).filter(function(a){return a.match(/.+Light$/)}).map(function(a){return a.replace(/Light$/,"").toLowerCase()});tQuery.Object3D._selectableClasses=["mesh","light"];
tQuery.Object3D._selectItemMatch=function(a,b){console.assert(a instanceof THREE.Object3D);console.assert("string"===typeof b);var c=b.match(RegExp("([^.#]+|.[^.#]+|#[^.#]+)","g"));return tQuery.each(c,function(b){var c=b.charAt(0),f=b.slice(1);if("."===c)return tQuery.Object3D._hasClassOne(a,f)?!0:!1;if("#"===c)return a._tqId===f?!0:!1;if("*"===b)return!0;if(-1!==this._selectableGeometries.indexOf(b))return c=a.geometry,b=b.charAt(0).toUpperCase()+b.slice(1)+"Geometry",c instanceof THREE[b];if(-1!==
this._selectableLights.indexOf(b))return b=b.charAt(0).toUpperCase()+b.slice(1)+"Light",a instanceof THREE[b];if(-1!==this._selectableClasses.indexOf(b))return b=b.charAt(0).toUpperCase()+b.slice(1),a instanceof THREE[b];console.assert(!1,"invalid selector: "+b);return!0}.bind(this))?!0:!1};tQuery.Geometry=function(a){tQuery.Geometry.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.Geometry)})};tQuery.inherit(tQuery.Geometry,tQuery.Node);tQuery.pluginsInstanceOn(tQuery.Geometry);
-tQuery.mixinAttributes(tQuery.Geometry,{hasTangents:tQuery.convert.toBool,dynamic:tQuery.convert.toBool});tQuery.Material=function(a){tQuery.Material.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.Material)})};tQuery.inherit(tQuery.Material,tQuery.Node);tQuery.pluginsInstanceOn(tQuery.Material);tQuery.mixinAttributes(tQuery.Material,{opacity:tQuery.convert.toNumber,transparent:tQuery.convert.toBool});
+tQuery.mixinAttributes(tQuery.Geometry,{hasTangents:tQuery.convert.toBoolean,dynamic:tQuery.convert.toBoolean});tQuery.Material=function(a){tQuery.Material.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.Material)})};tQuery.inherit(tQuery.Material,tQuery.Node);tQuery.pluginsInstanceOn(tQuery.Material);tQuery.mixinAttributes(tQuery.Material,{opacity:tQuery.convert.toNumber,transparent:tQuery.convert.toBoolean});
tQuery.Light=function(a){tQuery.Light.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.Light)})};tQuery.inherit(tQuery.Light,tQuery.Object3D);tQuery.pluginsInstanceOn(tQuery.Light);tQuery.mixinAttributes(tQuery.Light,{color:tQuery.convert.toThreeColor});tQuery.Mesh=function(a){tQuery.Mesh.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.Mesh)})};tQuery.inherit(tQuery.Mesh,tQuery.Object3D);tQuery.pluginsInstanceOn(tQuery.Mesh);
tQuery.Mesh.prototype.material=function(a){var b=tQuery.Mesh.parent;if(void 0==a)return b.material.call(this);this.each(function(b){b.material=a});return this};
tQuery.World=function(a){a=a||{};this._opts=a=tQuery.extend(a,{renderW:window.innerWidth,renderH:window.innerHeight,webGLNeeded:!0,autoRendering:!0,scene:null,camera:null,renderer:null});console.assert(!tQuery.word);tQuery.world=this;this._autoRendering=!0;this._scene=a.scene||new THREE.Scene;a.camera?this._camera=a.camera:(this._camera=new THREE.PerspectiveCamera(35,a.renderW/a.renderH,0.01,1E4),this._camera.position.set(0,0,3),this._scene.add(this._camera));this._loop=new tQuery.Loop;this._loop.hookOnRender(this._$loopCb=
function(){this.render()}.bind(this));if(a.renderer)this._renderer=a.renderer;else if(tQuery.World.hasWebGL())this._renderer=new THREE.WebGLRenderer({antialias:!0,preserveDrawingBuffer:!0});else{if(a.webGLNeeded)throw this._addGetWebGLMessage(),Error("WebGL required and not available");this._renderer=new THREE.CanvasRenderer}this._renderer.setClearColorHex(12303291,1);this._renderer.setSize(a.renderW,a.renderH)};tQuery.pluginsInstanceOn(tQuery.World);tQuery.MicroeventMixin(tQuery.World.prototype);
-tQuery.World.prototype.destroy=function(){this.trigger("destroy");this._loop.unhookOnRender(this._$loopCb);this._loop.destroy();this.removeCameraControls();var a=this._renderer.domElement.parentElement;a&&a.removeChild(this._renderer.domElement);tQuery.world===this&&(tQuery.world=null)};tQuery.World._hasWebGL=function(){try{return!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(a){return!1}}();tQuery.World.hasWebGL=function(){return tQuery.World._hasWebGL};
+tQuery.World.prototype.destroy=function(){this.trigger("destroy");this._loop.unhookOnRender(this._$loopCb);this._loop.destroy();this.removeCameraControls();var a=this._renderer.domElement.parentElement;a&&a.removeChild(this._renderer.domElement);tQuery.world===this&&(tQuery.world=null)};tQuery.World._hasWebGL=void 0;
+tQuery.World.hasWebGL=function(){if(void 0!==tQuery.World._hasWebGL)return tQuery.World._hasWebGL;try{tQuery.World._hasWebGL=!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(a){tQuery.World._hasWebGL=!1}return tQuery.World._hasWebGL};
tQuery.World.prototype._addGetWebGLMessage=function(a){var a=a||document.body,b=document.createElement("div");b.style.fontFamily="monospace";b.style.fontSize="13px";b.style.textAlign="center";b.style.background="#eee";b.style.color="#000";b.style.padding="1em";b.style.width="475px";b.style.margin="5em auto 0";b.innerHTML=window.WebGLRenderingContext?'Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a>.<br />\nFind out how to get it <a href="http://get.webgl.org/">here</a>.':
-'Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a>.<br/>\nFind out how to get it <a href="http://get.webgl.org/">here</a>.';a.appendChild(b)};tQuery.World.prototype.setCameraControls=function(a){this.hasCameraControls()&&this.removeCameraControls();this._cameraControls=a;return this};tQuery.World.prototype.removeCameraControls=function(){if(!1===this.hasCameraControls())return this;this._cameraControls=void 0;return this};
-tQuery.World.prototype.getCameraControls=function(){return this._cameraControls};tQuery.World.prototype.hasCameraControls=function(){return void 0!==this._cameraControls?!0:!1};tQuery.World.prototype.add=function(a){a instanceof tQuery.Object3D?a.each(function(a){this._scene.add(a)}.bind(this)):a instanceof THREE.Object3D?this._scene.add(a):console.assert(!1,"invalid type");return this};
+'Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a>.<br/>\nFind out how to get it <a href="http://get.webgl.org/">here</a>.';a.appendChild(b)};tQuery.World.prototype.setCameraControls=function(a){this.hasCameraControls()&&this.removeCameraControls();this._cameraControls=a;return this};tQuery.World.prototype.getCameraControls=function(){return this._cameraControls};
+tQuery.World.prototype.removeCameraControls=function(){if(!1===this.hasCameraControls())return this;this._cameraControls=void 0;return this};tQuery.World.prototype.hasCameraControls=function(){return void 0!==this._cameraControls?!0:!1};tQuery.World.prototype.add=function(a){a instanceof tQuery.Object3D?a.each(function(a){this._scene.add(a)}.bind(this)):a instanceof THREE.Object3D?this._scene.add(a):console.assert(!1,"invalid type");return this};
tQuery.World.prototype.remove=function(a){a instanceof tQuery.Object3D?a.each(function(a){this._scene.remove(a)}.bind(this)):a instanceof THREE.Object3D?this._scene.remove(a):console.assert(!1,"invalid type");return this};tQuery.World.prototype.appendTo=function(a){a.appendChild(this._renderer.domElement);return this};tQuery.World.prototype.start=function(){this._loop.start();return this};tQuery.World.prototype.stop=function(){this._loop.stop();return this};tQuery.World.prototype.loop=function(){return this._loop};
-tQuery.World.prototype.tRenderer=function(){return this._renderer};tQuery.World.prototype.tCamera=function(){return this._camera};tQuery.World.prototype.tScene=function(){return this._scene};tQuery.World.prototype.renderer=function(){console.trace();console.warn("world.renderer() is ovbslete, use .tRenderer() instead");return this._renderer};tQuery.World.prototype.camera=function(){console.trace();console.warn("world.camera() is obsolete, use .tCamerar() instead");return this._camera};
+tQuery.World.prototype.tRenderer=function(){return this._renderer};tQuery.World.prototype.tScene=function(){return this._scene};tQuery.World.prototype.tCamera=function(){return this._camera};tQuery.World.prototype.renderer=function(){console.trace();console.warn("world.renderer() is ovbslete, use .tRenderer() instead");return this._renderer};tQuery.World.prototype.camera=function(){console.trace();console.warn("world.camera() is obsolete, use .tCamerar() instead");return this._camera};
tQuery.World.prototype.scene=function(){console.trace();console.warn("world.scene() is obsolete, use .tScene() instead");return this._scene};tQuery.World.prototype.get=function(){return this._scene};tQuery.World.prototype.autoRendering=function(a){if(void 0===a)return this._autoRendering;this._autoRendering=a;return this};tQuery.World.prototype.render=function(){this.hasCameraControls()&&this._cameraControls.update();this._autoRendering&&this._renderer.render(this._scene,this._camera)};
tQuery.Loop=function(){this._hooks=[];this._lastTime=null};tQuery.pluginsInstanceOn(tQuery.Loop);tQuery.Loop.prototype.destroy=function(){this.stop()};tQuery.Loop.prototype.start=function(){this._timerId&&this.stop();this._timerId=requestAnimationFrame(this._onAnimationFrame.bind(this));return this};tQuery.Loop.prototype.stop=function(){cancelAnimationFrame(this._timerId);this._timerId=null;return this};
tQuery.Loop.prototype._onAnimationFrame=function(a){this._timerId=requestAnimationFrame(this._onAnimationFrame.bind(this));a/=1E3;this._lastTime||(this._lastTime=a-1/60);var b=a-this._lastTime;this._lastTime=a;for(var c=0;c<=this._hooks.length;c++)if(void 0!==this._hooks[c])for(var d=this._hooks[c].slice(0),e=0;e<d.length;e++)d[e](b,a)};tQuery.Loop.prototype.PRE_RENDER=20;tQuery.Loop.prototype.ON_RENDER=50;tQuery.Loop.prototype.POST_RENDER=80;
@@ -48,10 +48,10 @@ tQuery.Geometry.prototype.toMesh=function(a){var b=[];this.each(function(c){a=a|
tQuery.register("createSphere",function(){return this._createMesh(THREE.SphereGeometry,[0.5,32,16],arguments)});tQuery.register("createPlane",function(){return this._createMesh(THREE.PlaneGeometry,[1,1,16,16],arguments)});tQuery.register("createCylinder",function(){return this._createMesh(THREE.CylinderGeometry,[0.5,0.5,1,16,4],arguments)});
tQuery.register("_createMesh",function(a,b,c){var c=Array.prototype.slice.call(c),d=tQuery.defaultObject3DMaterial;c.length&&c[c.length-1]instanceof THREE.Material&&(d=c.pop());0===c.length&&(c=b.slice());c.unshift(a);a=function(a,b,c,d,h,i,k,l,m){console.assert(9>=arguments.length);return new a(b,c,d,h,i,k,l,m)}.apply(this,c);a.dynamic=!0;d=new THREE.Mesh(a,d);return tQuery(d)});tQuery.register("createAxis",function(){var a=new THREE.AxisHelper;a.scale.multiplyScalar(0.01);return tQuery(a)});
tQuery.AmbientLight=function(a){tQuery.AmbientLight.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.AmbientLight)})};tQuery.inherit(tQuery.AmbientLight,tQuery.Light);tQuery.pluginsInstanceOn(tQuery.AmbientLight);tQuery.DirectionalLight=function(a){tQuery.DirectionalLight.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.DirectionalLight)})};tQuery.inherit(tQuery.DirectionalLight,tQuery.Light);tQuery.pluginsInstanceOn(tQuery.DirectionalLight);
-tQuery.mixinAttributes(tQuery.DirectionalLight,{intensity:tQuery.convert.toNumber,distance:tQuery.convert.toNumber,shadowDarkness:tQuery.convert.toNumberZeroToOne,shadowBias:tQuery.convert.toNumber,shadowMapWidth:tQuery.convert.toInteger,shadowMapHeight:tQuery.convert.toInteger,shadowCameraRight:tQuery.convert.toNumber,shadowCameraLeft:tQuery.convert.toNumber,shadowCameraTop:tQuery.convert.toNumber,shadowCameraBottom:tQuery.convert.toNumber,shadowCameraVisible:tQuery.convert.toBool,shadowCameraNear:tQuery.convert.toNumber,
+tQuery.mixinAttributes(tQuery.DirectionalLight,{intensity:tQuery.convert.toNumber,distance:tQuery.convert.toNumber,shadowDarkness:tQuery.convert.toNumberZeroToOne,shadowBias:tQuery.convert.toNumber,shadowMapWidth:tQuery.convert.toInteger,shadowMapHeight:tQuery.convert.toInteger,shadowCameraRight:tQuery.convert.toNumber,shadowCameraLeft:tQuery.convert.toNumber,shadowCameraTop:tQuery.convert.toNumber,shadowCameraBottom:tQuery.convert.toNumber,shadowCameraVisible:tQuery.convert.toBoolean,shadowCameraNear:tQuery.convert.toNumber,
shadowCameraFar:tQuery.convert.toNumber});tQuery.PointLight=function(a){tQuery.PointLight.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.PointLight)})};tQuery.inherit(tQuery.PointLight,tQuery.Light);tQuery.pluginsInstanceOn(tQuery.PointLight);tQuery.mixinAttributes(tQuery.PointLight,{intensity:tQuery.convert.toNumber,distance:tQuery.convert.toNumber});
tQuery.SpotLight=function(a){tQuery.SpotLight.parent.constructor.call(this,a);this._lists.forEach(function(a){console.assert(a instanceof THREE.SpotLight)})};tQuery.inherit(tQuery.SpotLight,tQuery.Light);tQuery.pluginsInstanceOn(tQuery.SpotLight);
-tQuery.mixinAttributes(tQuery.SpotLight,{intensity:tQuery.convert.toNumber,distance:tQuery.convert.toNumber,shadowDarkness:tQuery.convert.toNumberZeroToOne,shadowBias:tQuery.convert.toNumber,shadowMapWidth:tQuery.convert.toInteger,shadowMapHeight:tQuery.convert.toInteger,shadowCameraRight:tQuery.convert.toNumber,shadowCameraLeft:tQuery.convert.toNumber,shadowCameraTop:tQuery.convert.toNumber,shadowCameraBottom:tQuery.convert.toNumber,shadowCameraVisible:tQuery.convert.toBool});
+tQuery.mixinAttributes(tQuery.SpotLight,{intensity:tQuery.convert.toNumber,distance:tQuery.convert.toNumber,shadowDarkness:tQuery.convert.toNumberZeroToOne,shadowBias:tQuery.convert.toNumber,shadowMapWidth:tQuery.convert.toInteger,shadowMapHeight:tQuery.convert.toInteger,shadowCameraRight:tQuery.convert.toNumber,shadowCameraLeft:tQuery.convert.toNumber,shadowCameraTop:tQuery.convert.toNumber,shadowCameraBottom:tQuery.convert.toNumber,shadowCameraVisible:tQuery.convert.toBoolean});
(function(){tQuery.Geometry.register("computeAll",function(){this.each(function(a){a.computeBoundingBox();a.computeCentroids();a.computeFaceNormals();a.computeVertexNormals()});return this});tQuery.Geometry.register("scaleBy",function(a){"number"===typeof a&&1===arguments.length?a=new THREE.Vector3(a,a,a):"number"===typeof a&&3===arguments.length&&(a=new THREE.Vector3(arguments[0],arguments[1],arguments[2]));console.assert(a instanceof THREE.Vector3,"Geometry.vector3 parameter error");this.each(function(b){for(var c=
0;c<b.vertices.length;c++)b.vertices[c].multiplySelf(a);b.verticesNeedUpdate=!0;b.computeBoundingBox()});return this});tQuery.Geometry.register("size",function(){console.assert(1>=this.length);if(0!==this.length){var a=this.get(0),b=new THREE.Vector3;b.x=a.boundingBox.max.x-a.boundingBox.min.x;b.y=a.boundingBox.max.y-a.boundingBox.min.y;b.z=a.boundingBox.max.z-a.boundingBox.min.z;return b}});tQuery.Geometry.register("normalize",function(){this.each(function(a){var a=tQuery(a),b=a.size();b.x>=b.y&&
b.x>=b.z?a.zoom(1/b.x):b.y>=b.x&&b.y>=b.z?a.zoom(1/b.y):a.zoom(1/b.z)});return this});tQuery.Geometry.register("middlePoint",function(){console.assert(1>=this.length);if(0!==this.length){var a=this.get(0),b=new THREE.Vector3;b.x=(a.boundingBox.max.x+a.boundingBox.min.x)/2;b.y=(a.boundingBox.max.y+a.boundingBox.min.y)/2;b.z=(a.boundingBox.max.z+a.boundingBox.min.z)/2;return b}});tQuery.Geometry.register("translate",function(a){"number"===typeof a&&3===arguments.length&&(a=new THREE.Vector3(arguments[0],
View
2 index.html
@@ -352,7 +352,7 @@
jQuery(function(){
jQuery('a').filter(function(index){
if( this.href.match(/\#/) ) return;
- jQuery(this).attr('target', '_blank');
+ jQuery(this).attr('target', '_blank' );
});
});
</script>
View
1 js/tquery.world.js
@@ -99,6 +99,7 @@ tQuery.World.prototype.destroy = function(){
// WebGL Support //
//////////////////////////////////////////////////////////////////////////////////
+tQuery.World._hasWebGL = undefined;
/**
* @returns {Boolean} true if webgl is available, false otherwise
*/
View
76 plugins/laserbeam/examples/index.html
@@ -0,0 +1,76 @@
+<!doctype html><title>Minimal tQuery Page</title>
+<script src="../../../build/tquery-bundle.js"></script>
+<script src="../../skymap/tquery.skymap.js"></script>
+<script src="../../skymap/tquery.cubetexture.js"></script>
+<body><script>
+ var world = tQuery.createWorld().boilerplate().start();
+ var skymap = tQuery.createSkymap('pisa').addTo(world);
+
+ var material = new THREE.MeshBasicMaterial({
+ envMap : tQuery.createCubeTexture('skybox')
+ });
+
+ //var object = tQuery.createSphere(material).addTo(world).scaleBy(3);
+
+
+ var object = tQuery.createTorus().addTo(world);
+
+
+ var canvas = generateCanvas();
+ //document.body.appendChild(canvas)
+
+ var texture = new THREE.Texture( canvas );
+ texture.needsUpdate = true;
+
+ var material = new THREE.MeshBasicMaterial({
+ map : texture,
+ blending : THREE.AdditiveBlending,
+ opacity : 0.8,
+ color : 0x00BFFF,
+ depthWrite : false,
+ transparent : true
+ })
+
+ var saber = tQuery.createObject3D().addTo(world)
+ .scale(10, 1, 1)
+ .rotateY(Math.PI/2)
+
+ tQuery.createPlane().addTo(saber)
+ .material(material)
+ .doubleSided(true)
+ tQuery.createPlane().addTo(saber)
+ .rotateX(2*Math.PI/3)
+ .material(material)
+ .doubleSided(true)
+ tQuery.createPlane().addTo(saber)
+ .rotateX(-2*Math.PI/3)
+ .material(material)
+ .doubleSided(true)
+
+
+ function generateCanvas(){
+ var canvas = document.createElement( 'canvas' );
+ var context = canvas.getContext( '2d' );
+ canvas.width = 256;
+ canvas.height = 256;
+
+ context.fillStyle = 'rgba(0,0,0,0)';
+ context.fillRect(0,0, canvas.width, canvas.height);
+
+ var gradient = context.createRadialGradient( canvas.width/2, canvas.height /2, 0, canvas.width /2, canvas.height /2, canvas.width /2 );
+ gradient.addColorStop( 0 , 'rgba(255,255,255,0.5)' );
+ gradient.addColorStop( 0.5, 'rgba(255,255,255,0.5)' );
+ gradient.addColorStop( 0.7, 'rgba(128,128,128,0.7)' );
+ gradient.addColorStop( 1 , 'rgba(0,0,0,0)' );
+
+ context.fillStyle = gradient;
+ context.beginPath();
+ //context.arc(canvas.width/2, canvas.height/2, 1 * canvas.width/2, 0, Math.PI*2, false);
+ context.arc(canvas.width, canvas.height/2, 1 * canvas.width, 0, Math.PI*2, false);
+ context.closePath();
+ //context.fillStyle = 'rgba(128,128,128,1)';
+ context.fill();
+
+ return canvas;
+ }
+</script></body>
View
3 www/live/playground/index.html
@@ -25,9 +25,6 @@
<link rel="stylesheet" href="css/main.css" />
<link rel="stylesheet" href="css/editor.css" />
<link rel="stylesheet" href="css/preview.css" />
-
-
- <script src="vendor/LZMA-JS/src/lzma.js"></script>
</head>
<body>
<div id="osdContainer">

0 comments on commit a368fd4

Please sign in to comment.