define(["exports","./Matrix2-ccd5b911","./RuntimeError-346a3079","./when-4bbc8319","./WebGLConstants-1c8239cc","./Transforms-d5c6ad6e"],function(t,d,e,n,a,x){"use strict";var r=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3}),i={POINTS:a.WebGLConstants.POINTS,LINES:a.WebGLConstants.LINES,LINE_LOOP:a.WebGLConstants.LINE_LOOP,LINE_STRIP:a.WebGLConstants.LINE_STRIP,TRIANGLES:a.WebGLConstants.TRIANGLES,TRIANGLE_STRIP:a.WebGLConstants.TRIANGLE_STRIP,TRIANGLE_FAN:a.WebGLConstants.TRIANGLE_FAN,validate:function(t){return t===i.POINTS||t===i.LINES||t===i.LINE_LOOP||t===i.LINE_STRIP||t===i.TRIANGLES||t===i.TRIANGLE_STRIP||t===i.TRIANGLE_FAN}},o=Object.freeze(i);function s(t){t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=n.defaultValue(t.primitiveType,o.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=n.defaultValue(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}s.computeNumberOfVertices=function(t){var e,a,r=-1;for(e in t.attributes)t.attributes.hasOwnProperty(e)&&n.defined(t.attributes[e])&&n.defined(t.attributes[e].values)&&(r=(a=t.attributes[e]).values.length/a.componentsPerAttribute);return r};var A=new d.Cartographic,P=new d.Cartesian3,S=new d.Matrix4,G=[new d.Cartographic,new d.Cartographic,new d.Cartographic],w=[new d.Cartesian2,new d.Cartesian2,new d.Cartesian2],R=[new d.Cartesian2,new d.Cartesian2,new d.Cartesian2],O=new d.Cartesian3,_=new x.Quaternion,g=new d.Matrix4,v=new d.Matrix2;s._textureCoordinateRotationPoints=function(t,e,a,r){var n=d.Rectangle.center(r,A),i=d.Cartographic.toCartesian(n,a,P),n=x.Transforms.eastNorthUpToFixedFrame(i,a,S),o=d.Matrix4.inverse(n,S),s=w,u=G;u[0].longitude=r.west,u[0].latitude=r.south,u[1].longitude=r.west,u[1].latitude=r.north,u[2].longitude=r.east,u[2].latitude=r.south;for(var I=O,N=0;N<3;N++)d.Cartographic.toCartesian(u[N],a,I),I=d.Matrix4.multiplyByPointAsVector(o,I,I),s[N].x=I.x,s[N].y=I.y;var i=x.Quaternion.fromAxisAngle(d.Cartesian3.UNIT_Z,-e,_),T=d.Matrix3.fromQuaternion(i,g),c=t.length,l=Number.POSITIVE_INFINITY,m=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY,b=Number.NEGATIVE_INFINITY;for(N=0;N