learning_cesium/XbsjCesium/Workers/createCircleGeometry.js

2 lines
2.9 KiB
JavaScript
Raw Normal View History

2024-03-19 18:06:25 +08:00
define(["./Cartesian2-697a9954","./Check-f3fec9b0","./when-54335d57","./EllipseGeometry-83e0cc91","./VertexFormat-acf45ede","./Math-737a2579","./GeometryOffsetAttribute-6e5d8e16","./Transforms-251ff661","./RuntimeError-88a32665","./ComponentDatatype-417761a2","./WebGLConstants-4739ce15","./EllipseGeometryLibrary-0f7e8266","./GeometryAttribute-7ca1c9e4","./GeometryAttributes-caa08d6c","./GeometryInstance-1bb3fb4a","./GeometryPipeline-1dd54e44","./AttributeCompression-ab5c33b7","./EncodedCartesian3-0ae9fe5e","./IndexDatatype-c134ea39","./IntersectionTests-3e34a0aa","./Plane-d4cb7bb3"],function(r,e,o,a,n,t,i,s,l,m,d,c,u,p,y,_,h,G,x,f,g){"use strict";function E(e){var t=(e=o.defaultValue(e,o.defaultValue.EMPTY_OBJECT)).radius,e={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new a.EllipseGeometry(e),this._workerName="createCircleGeometry"}E.packedLength=a.EllipseGeometry.packedLength,E.pack=function(e,t,i){return a.EllipseGeometry.pack(e._ellipseGeometry,t,i)};var v=new a.EllipseGeometry({center:new r.Cartesian3,semiMajorAxis:1,semiMinorAxis:1}),w={center:new r.Cartesian3,radius:void 0,ellipsoid:r.Ellipsoid.clone(r.Ellipsoid.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new n.VertexFormat,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};return E.unpack=function(e,t,i){t=a.EllipseGeometry.unpack(e,t,v);return w.center=r.Cartesian3.clone(t._center,w.center),w.ellipsoid=r.Ellipsoid.clone(t._ellipsoid,w.ellipsoid),w.height=t._height,w.extrudedHeight=t._extrudedHeight,w.granularity=t._granularity,w.vertexFormat=n.VertexFormat.clone(t._vertexFormat,w.vertexFormat),w.stRotation=t._stRotation,w.shadowVolume=t._shadowVolume,o.defined(i)?(w.semiMajorAxis=t._semiMajorAxis,w.semiMinorAxis=t._semiMinorAxis,i._ellipseGeometry=new a.EllipseGeometry(w),i):(w.radius=t._semiMajorAxis,new E(w))},E.createGeometry=function(e){return a.EllipseGeometry.createGeometry(e._ellipseGeometry)},E.createShadowVolume=function(e,t,i){var r=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,t=t(r,o),i=i(r,o);return new E({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:r,extrudedHeight:t,height:i,vertexFormat:n.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(E.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}}),function(e,t){return(e=o.defined(t)?E.unpack(e,t):e)._ellipseGeometry._center=r.Cartesian3.clone(e._ellipseGeometry._center),e._ellipseGeometry._ellipsoid=r.Ellipsoid.clone(e._ellipseGeometry._ellipsoid),E.createGeometry(e)}});