Files
td_official/public/Cesium/Workers/createPlaneOutlineGeometry.js
2025-06-18 19:56:54 +08:00

26 lines
1.9 KiB
JavaScript

/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.98
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
define(["./defaultValue-50f7432c","./Transforms-c9e418cb","./Matrix2-cf4c6e69","./ComponentDatatype-9b23164a","./GeometryAttribute-b84ffce6","./GeometryAttributes-8bab1b25","./combine-8462e002","./RuntimeError-48e1f06d","./WebGLConstants-58abc51a"],(function(e,t,n,r,i,a,o,c,u){"use strict";function s(){this._workerName="createPlaneOutlineGeometry"}s.packedLength=0,s.pack=function(e,t){return t},s.unpack=function(t,n,r){return e.defined(r)?r:new s};const y=new n.Cartesian3(-.5,-.5,0),m=new n.Cartesian3(.5,.5,0);return s.createGeometry=function(){const e=new a.GeometryAttributes,o=new Uint16Array(8),c=new Float64Array(12);return c[0]=y.x,c[1]=y.y,c[2]=y.z,c[3]=m.x,c[4]=y.y,c[5]=y.z,c[6]=m.x,c[7]=m.y,c[8]=y.z,c[9]=y.x,c[10]=m.y,c[11]=y.z,e.position=new i.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c}),o[0]=0,o[1]=1,o[2]=1,o[3]=2,o[4]=2,o[5]=3,o[6]=3,o[7]=0,new i.Geometry({attributes:e,indices:o,primitiveType:i.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere(n.Cartesian3.ZERO,Math.sqrt(2))})},function(t,n){return e.defined(n)&&(t=s.unpack(t,n)),s.createGeometry(t)}}));