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