Lines Matching full:vec2
7 window.FLATTENED_RAW_SCRIPTS["../third_party/gl-matrix/src/gl-matrix/mat4.js"]=!0;window.FLATTENED_RAW_SCRIPTS["../third_party/gl-matrix/src/gl-matrix/vec2.js"]=!0;window.FLATTENED_RAW_SCRIPTS["../third_party/gl-matrix/src/gl-matrix/vec3.js"]=!0;window.FLATTENED_RAW_SCRIPTS["../third_party/gl-matrix/src/gl-matrix/vec4.js"]=!0;window.FLATTENED["base.gl_matrix"]=!0;window.FLATTENED["base.quad"]=!0;window.FLATTENED["tracing.trace_model.instant_event"]=!0;
223 base.requireRawScript("../third_party/gl-matrix/src/gl-matrix/mat4.js");base.requireRawScript("../third_party/gl-matrix/src/gl-matrix/vec2.js");base.requireRawScript("../third_party/gl-matrix/src/gl-matrix/vec3.js");base.requireRawScript("../third_party/gl-matrix/src/gl-matrix/vec4.js");
224 base.exportTo("base",function(){var d=vec2.create(),b=vec2.create(),a=vec4.create();mat2d.create();vec2.createFromArray=function(a){if(2!=a.length)throw Error("Should be length 2");var b=vec2.create();vec2.set(b,a[0],a[1]);return b};vec2.createXY=function(a,b){var f=vec2.create();vec2.set(f,a,b);return f};vec2.toString=function(a){return"["+a[0]+", "+a[1]+"]"};vec2.addTwoScaledUnitVectors=function(a,e,f,g,h){vec2.scale(d,e,f);vec2.scale(b,g,h);vec2.add(a,d,b)};vec3.createXYZ=function(a,b,f){var g=
225 vec3.create();vec3.set(g,a,b,f);return g};vec3.toString=function(a){return"vec3("+a[0]+", "+a[1]+", "+a[2]+")"};mat2d.translateXY=function(a,b,f){vec2.set(d,b,f);mat2d.translate(a,a,d)};mat2d.scaleXY=function(a,b,f){vec2.set(d,b,f);mat2d.scale(a,a,d)};vec4.unitize=function(a,b){a[0]=b[0]/b[3];a[1]=b[1]/b[3];a[2]=b[2]/b[3];a[3]=1;return a};vec2.copyFromVec4=function(c,b){vec4.unitize(a,b);vec2.copy(c,a)};return{}});"use strict";base.require("base.gl_matrix");
226 base.exportTo("base",function(){function d(a,c,b,e){vec2.scale(h,c,e);vec2.scale(k,b,1-e);vec2.add(a,h,k);vec2.normalize(a,a);return a}function b(){this.p1=vec2.create();this.p2=vec2.create();this.p3=vec2.create();this.p4=vec2.create()}function a(a,c,b){return(a[0]-b[0])*(c[1]-b[1])-(c[0]-b[0])*(a[1]-b[1])}function c(c,b,e,f){var g=0>a(c,b,e);e=0>a(c,e,f);c=0>a(c,f,b);return g==e&&e==c}for(var e=[],f=0;8>f;f++)e[f]=vec2.create();var g=vec4.create();vec4.create();vec4.create();mat4.create();mat4.create();
227 vec2.createXY(0,0);vec2.createXY(1,0);vec2.createXY(0,1);vec2.createXY(1,1);var h=vec2.create(),k=vec2.create();b.FromXYWH=function(a,c,e,f){var g=new b;vec2.set(g.p1,a,c);vec2.set(g.p2,a+e,c);vec2.set(g.p3,a+e,c+f);vec2.set(g.p4,a,c+f);return g};b.FromRect=function(a){return new b.FromXYWH(a.x,a.y,a.width,a.height)};b.From4Vecs=function(a,c,e,f){var g=new b;vec2.set(g.p1,a[0],a[1]);vec2.set(g.p2,c[0],c[1]);vec2.set(g.p3,e[0],e[1]);vec2.set(g.p4,f[0],f[1]);return g};b.From8Array=function(a){if(8!=
229 this.p3[1],this.p4[1]);return new base.Rect.FromXYWH(a,c,b-a,e-c)},clone:function(){var a=new b;vec2.copy(a.p1,this.p1);vec2.copy(a.p2,this.p2);vec2.copy(a.p3,this.p3);vec2.copy(a.p4,this.p4);return a},scale:function(a){var c=new b;this.scaleFast(c,a);return c},scaleFast:function(a,c){vec2.copy(a.p1,this.p1,c);vec2.copy(a.p2,this.p2,c);vec2.copy(a.p3,this.p3,c);vec2.copy(a.p3,this.p3,c)},isRectangle:function(){var a=this.boundingRect();return a.x==this.p1[0]&&a.y==this.p1[1]&&a.width==this.p2[0]-
230 this.p1[0]&&a.y==this.p2[1]&&a.width==this.p3[0]-this.p1[0]&&a.height==this.p3[1]-this.p2[1]&&a.x==this.p4[0]&&a.height==this.p4[1]-this.p2[1]},projectUnitRect:function(a){var c=new b;this.projectUnitRectFast(c,a);return c},projectUnitRectFast:function(a,c){var b=e[0],f=e[1],h=e[2],k=e[3],v,w,s,r;vec2vec2.length(b);vec2.scale(b,b,1/v);vec2.sub(f,this.p4,this.p1);w=vec2.length(f);vec2.scale(f,f,1/w);vec2.sub(h,this.p3,this.p2);s=vec2.length(h);vec2.scale(h,h,1/s);vec2.sub(k,
231 this.p3,this.p4);r=vec2.length(k);vec2.scale(k,k,1/r);var u=e[0],x=e[1],y=e[2],z=e[3];d(u,b,k,c.y);d(z,b,k,1-c.bottom);d(x,f,h,c.x);d(y,f,h,1-c.right);vec2.addTwoScaledUnitVectors(g,u,v*c.x,x,w*c.y);vec2.add(a.p1,this.p1,g);vec2.addTwoScaledUnitVectors(g,u,v*-(1-c.right),y,s*c.y);vec2.add(a.p2,this.p2,g);vec2.addTwoScaledUnitVectors(g,z,r*-(1-c.right),y,s*-(1-c.bottom));vec2.add(a.p3,this.p3,g);vec2.addTwoScaledUnitVectors(g,z,r*c.left,x,w*-(1-c.bottom));vec2.add(a.p4,this.p4,g)},toString:function(){return"Quad("+
232 vec2.toString(this.p1)+", "+vec2.toString(this.p2)+", "+vec2.toString(this.p3)+", "+vec2.toString(this.p4)+")"}};return{vecInTriangle2:c,Quad:b}});"use strict";base.require("tracing.trace_model.trace_model_event");