qd-changjing/public/static/Build/CesiumUnminified/Workers/createFrustumOutlineGeometr...

1 line
16 KiB
Plaintext
Raw Normal View History

2022-07-05 16:56:29 +08:00
{"version":3,"file":"createFrustumOutlineGeometry.js","sources":["../../../../Source/Core/FrustumOutlineGeometry.js","../../../../Source/WorkersES6/createFrustumOutlineGeometry.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport FrustumGeometry from \"./FrustumGeometry.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport OrthographicFrustum from \"./OrthographicFrustum.js\";\nimport PerspectiveFrustum from \"./PerspectiveFrustum.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Quaternion from \"./Quaternion.js\";\n\nconst PERSPECTIVE = 0;\nconst ORTHOGRAPHIC = 1;\n\n/**\n * A description of the outline of a frustum with the given the origin and orientation.\n *\n * @alias FrustumOutlineGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {PerspectiveFrustum|OrthographicFrustum} options.frustum The frustum.\n * @param {Cartesian3} options.origin The origin of the frustum.\n * @param {Quaternion} options.orientation The orientation of the frustum.\n */\nfunction FrustumOutlineGeometry(options) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"options\", options);\n Check.typeOf.object(\"options.frustum\", options.frustum);\n Check.typeOf.object(\"options.origin\", options.origin);\n Check.typeOf.object(\"options.orientation\", options.orientation);\n //>>includeEnd('debug');\n\n const frustum = options.frustum;\n const orientation = options.orientation;\n const origin = options.origin;\n\n // This is private because it is used by DebugCameraPrimitive to draw a multi-frustum by\n // creating multiple FrustumOutlineGeometrys. This way the near plane of one frustum doesn't overlap\n // the far plane of another.\n const drawNearPlane = defaultValue(options._drawNearPlane, true);\n\n let frustumType;\n let frustumPackedLength;\n if (frustum instanceof PerspectiveFrustum) {\n frustumType = PERSPECTIVE;\n frustumPackedLength = PerspectiveFrustum.packedLength;\n } else if (frustum instanceof OrthographicFrustum) {\n frustumType = ORTHOGRAPHIC;\n frustumPackedLength = OrthographicFrustum.packedLength;\n }\n\n this._frustumType = frustumType;\n this._frustum = frustum.clone();\n this._origin = Cartesian3.clone(origin);\n this._orientation = Quaternion.clone(orientation);\n this._drawNearPlane = drawNearPlane;\n this._workerName = \"createFrustumOutlineGeometry\";\n\n /**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\n this.packedLength =\n 2 + frustumPackedLength + Cartesian3.packedLength + Quaternion.packedLength;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {FrustumOutlineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nFrustumOutlineGeometry.pack = function (value, array, startingIndex) {\n //>>includeStart('debug', pragmas.debug);\n Check.typeOf.object(\"value\", value);\n Check.defined(\"array\", array);\n //>>includeEnd('debug');\n\n startingIndex = defaultValue(startingIndex, 0);\n\n const frustumType = value._frustumType;\n const frustum = value._frustum;\n\n array[startingIndex++] = frustumType;\n\n if (frustumType === PERSPECTIVE) {\n PerspectiveFrustum.pack(frustum, array, startingIndex);\n startingIndex += PerspectiveFrustum.packedLength;\n } else {\n OrthographicFrustum.pack(frustum, array, startingIndex);\n startingIndex += OrthographicFrustum.packedLength;\n }\n\n Cartesian3.pack(value._origin, array, s