@vtx/cs-map 1.0.123 → 1.0.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_util/EventEmitter.js +3 -3
- package/lib/_util/EventEmitter.js.map +1 -1
- package/lib/_util/StyleCache.js.map +1 -1
- package/lib/_util/http.js.map +1 -1
- package/lib/_util/layer.js +1 -1
- package/lib/_util/layer.js.map +1 -1
- package/lib/assets/grate.png +0 -0
- package/lib/assets/well.png +0 -0
- package/lib/building-tiles-layer/BuildingTilesLayer.js.map +1 -1
- package/lib/cesium-tiles-layer/CesiumTilesLayer.js.map +1 -1
- package/lib/circle/Circle.js.map +1 -1
- package/lib/circle-fly/index.js +4 -4
- package/lib/circle-fly/index.js.map +1 -1
- package/lib/cone-glow-layer/BottomCircle.js.map +1 -1
- package/lib/cone-glow-layer/ButtomRotateCircle.js.map +1 -1
- package/lib/cone-glow-layer/ConeGlowLayer.js.map +1 -1
- package/lib/demand-layer/DemandLayer.js +5 -3
- package/lib/demand-layer/DemandLayer.js.map +1 -1
- package/lib/dom/Dom.js.map +1 -1
- package/lib/events/index.js +2 -2
- package/lib/events/index.js.map +1 -1
- package/lib/excavation-analysis/Cut.js.map +1 -1
- package/lib/excavation-analysis/TilesetCut.js.map +1 -1
- package/lib/feature-layer/FeatureLayer.js +5 -3
- package/lib/feature-layer/FeatureLayer.js.map +1 -1
- package/lib/fence-layer/FenceLayer.js +5 -3
- package/lib/fence-layer/FenceLayer.js.map +1 -1
- package/lib/fence-layer/GradualLightRingMaterialProperty.js.map +1 -1
- package/lib/flight-line-layer/FlightLineLayer.js.map +1 -1
- package/lib/fly-line-layer/FlyLineLayer.js +9 -7
- package/lib/fly-line-layer/FlyLineLayer.js.map +1 -1
- package/lib/fly-line-layer/LineFlowMaterialProperty.js.map +1 -1
- package/lib/gif-dom-layer/GifDomLayer.js.map +1 -1
- package/lib/gradation-line-layer/GradationLineLayer.js.map +1 -1
- package/lib/group-layer/GroupLayer.js.map +1 -1
- package/lib/heatmap-layer/CesiumHeatmap.js +5 -3
- package/lib/heatmap-layer/CesiumHeatmap.js.map +1 -1
- package/lib/heatmap-layer/HeatmapLayer.js.map +1 -1
- package/lib/heatmap-layer/heatmap.js.map +1 -1
- package/lib/highlight-layer/HighlightLayer.js +12 -1
- package/lib/highlight-layer/HighlightLayer.js.map +1 -1
- package/lib/image-layer/ImageLayer.js +4 -2
- package/lib/image-layer/ImageLayer.js.map +1 -1
- package/lib/image-wms-layer/ImageWmsLayer.js.map +1 -1
- package/lib/label/Label.js.map +1 -1
- package/lib/line-flow-layer/LineFlowLayer.js +5 -3
- package/lib/line-flow-layer/LineFlowLayer.js.map +1 -1
- package/lib/map/InfoTool/index.js.map +1 -1
- package/lib/map/InfoTool/util.js.map +1 -1
- package/lib/map/Layers.js +8 -8
- package/lib/map/Layers.js.map +1 -1
- package/lib/map/Popup.js +6 -6
- package/lib/map/Popup.js.map +1 -1
- package/lib/map/base/imagery/baidu/BaiduImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/baidu/BaiduMercatorProjection.js.map +1 -1
- package/lib/map/base/imagery/baidu/BaiduMercatorTilingScheme.js.map +1 -1
- package/lib/map/base/imagery/tdt/JiangSuTdtImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/tdt/TdtImageryProvider.js +4 -4
- package/lib/map/base/imagery/tdt/TdtImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/tencent/TencentImageryProvider.js.map +1 -1
- package/lib/map/base/imagery/transform/CoordTransform.js.map +1 -1
- package/lib/map/base/index.js +23 -8
- package/lib/map/base/index.js.map +1 -1
- package/lib/map/hooks/useGetMapFeatureInfoByText.js +1 -1
- package/lib/map/hooks/useGetMapFeatureInfoByText.js.map +1 -1
- package/lib/map/index.js +1 -1
- package/lib/map/index.js.map +1 -1
- package/lib/map/material/AroundPoint.js.map +1 -1
- package/lib/map/material/CircleRippleMaterialProperty.js.map +1 -1
- package/lib/map/material/ODLineLayer.js.map +1 -1
- package/lib/map/material/PolylineTrailLinkMaterialProperty.js.map +1 -1
- package/lib/map/material/PolylineTrailMaterialProperty.js.map +1 -1
- package/lib/map/material/TilesBuilding.js.map +1 -1
- package/lib/marker/Marker.js.map +1 -1
- package/lib/model/Model.js.map +1 -1
- package/lib/navigation/index.js +6 -6
- package/lib/navigation/index.js.map +1 -1
- package/lib/point/Point.js.map +1 -1
- package/lib/polygon/Polygon.js.map +1 -1
- package/lib/polyline/Polyline.js.map +1 -1
- package/lib/road-line-layer/RoadLineLayer.js +2 -1
- package/lib/road-line-layer/RoadLineLayer.js.map +1 -1
- package/lib/three-line-layer/ThreeLineLayer.js +3 -1
- package/lib/three-line-layer/ThreeLineLayer.js.map +1 -1
- package/lib/three-line-layer/index.js +5 -1
- package/lib/three-line-layer/index.js.map +1 -1
- package/lib/three-point-layer/DiffuseCircle.js.map +1 -1
- package/lib/three-point-layer/Grate.js +774 -0
- package/lib/three-point-layer/Grate.js.map +1 -0
- package/lib/three-point-layer/ThreePointLayer.js +95 -35
- package/lib/three-point-layer/ThreePointLayer.js.map +1 -1
- package/lib/three-point-layer/Well.js +440 -0
- package/lib/three-point-layer/Well.js.map +1 -0
- package/lib/three-point-layer/index.js +5 -1
- package/lib/three-point-layer/index.js.map +1 -1
- package/lib/tools/base-map-switch/index.js.map +1 -1
- package/lib/tools/components/Icon/index.js.map +1 -1
- package/lib/tools/components/item-wrap/index.js.map +1 -1
- package/lib/tools/layer-control/index.js +4 -4
- package/lib/tools/layer-control/index.js.map +1 -1
- package/lib/tools/layer-control-popover/LayersCheckService.js +8 -8
- package/lib/tools/layer-control-popover/LayersCheckService.js.map +1 -1
- package/lib/tools/layer-control-popover/index.js.map +1 -1
- package/lib/tools/map-search/index.js.map +1 -1
- package/lib/tools/tool-box/Measure/Measure.js.map +1 -1
- package/lib/tools/tool-box/Measure/index.js.map +1 -1
- package/lib/tools/tool-box/index.js.map +1 -1
- package/lib/trail-polyline-layer/TrailPolylineLayer.js.map +1 -1
- package/lib/trail-polyline-layer/TrailPolylineMaterial.js.map +1 -1
- package/lib/water-surface-layer/WaterSurfaceLayer.js +6 -4
- package/lib/water-surface-layer/WaterSurfaceLayer.js.map +1 -1
- package/lib/weather/Weather.js.map +1 -1
- package/package.json +2 -2
- package/CHANGELOG.md +0 -124
|
@@ -0,0 +1,774 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _cesium = require("cesium");
|
|
8
|
+
var diffScratch = new _cesium.Cartesian3();
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Describes a cube centered at the origin.
|
|
12
|
+
*
|
|
13
|
+
* @alias BoxGeometry
|
|
14
|
+
* @constructor
|
|
15
|
+
*
|
|
16
|
+
* @param {Object} options Object with the following properties:
|
|
17
|
+
* @param {Cartesian3} options.minimum The minimum x, y, and z coordinates of the box.
|
|
18
|
+
* @param {Cartesian3} options.maximum The maximum x, y, and z coordinates of the box.
|
|
19
|
+
* @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
|
|
20
|
+
*
|
|
21
|
+
* @see Grate.fromDimensions
|
|
22
|
+
* @see Grate.createGeometry
|
|
23
|
+
* @see Packable
|
|
24
|
+
*
|
|
25
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?src=Box.html|Cesium Sandcastle Box Demo}
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* const box = new Cesium.BoxGeometry({
|
|
29
|
+
* vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
|
|
30
|
+
* maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
|
|
31
|
+
* minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
|
|
32
|
+
* });
|
|
33
|
+
* const geometry = Cesium.BoxGeometry.createGeometry(box);
|
|
34
|
+
*/
|
|
35
|
+
function Grate(options) {
|
|
36
|
+
options = (0, _cesium.defaultValue)(options, _cesium.defaultValue.EMPTY_OBJECT);
|
|
37
|
+
var min = options.minimum;
|
|
38
|
+
var max = options.maximum;
|
|
39
|
+
|
|
40
|
+
//>>includeStart('debug', pragmas.debug);
|
|
41
|
+
_cesium.Check.typeOf.object("min", min);
|
|
42
|
+
_cesium.Check.typeOf.object("max", max);
|
|
43
|
+
if ((0, _cesium.defined)(options.offsetAttribute) && options.offsetAttribute === _cesium.GeometryOffsetAttribute.TOP) {
|
|
44
|
+
throw new _cesium.DeveloperError("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");
|
|
45
|
+
}
|
|
46
|
+
//>>includeEnd('debug');
|
|
47
|
+
|
|
48
|
+
var vertexFormat = (0, _cesium.defaultValue)(options.vertexFormat, _cesium.VertexFormat.DEFAULT);
|
|
49
|
+
this._minimum = _cesium.Cartesian3.clone(min);
|
|
50
|
+
this._maximum = _cesium.Cartesian3.clone(max);
|
|
51
|
+
this._vertexFormat = vertexFormat;
|
|
52
|
+
this._offsetAttribute = options.offsetAttribute;
|
|
53
|
+
this._workerName = "createBoxGeometry";
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Creates a cube centered at the origin given its dimensions.
|
|
58
|
+
*
|
|
59
|
+
* @param {Object} options Object with the following properties:
|
|
60
|
+
* @param {Cartesian3} options.dimensions The width, depth, and height of the box stored in the x, y, and z coordinates of the <code>Cartesian3</code>, respectively.
|
|
61
|
+
* @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
|
|
62
|
+
* @returns {Grate}
|
|
63
|
+
*
|
|
64
|
+
* @exception {DeveloperError} All dimensions components must be greater than or equal to zero.
|
|
65
|
+
*
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* const box = Cesium.BoxGeometry.fromDimensions({
|
|
69
|
+
* vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
|
|
70
|
+
* dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
|
|
71
|
+
* });
|
|
72
|
+
* const geometry = Cesium.BoxGeometry.createGeometry(box);
|
|
73
|
+
*
|
|
74
|
+
* @see Grate.createGeometry
|
|
75
|
+
*/
|
|
76
|
+
Grate.fromDimensions = function (options) {
|
|
77
|
+
options = (0, _cesium.defaultValue)(options, _cesium.defaultValue.EMPTY_OBJECT);
|
|
78
|
+
var dimensions = options.dimensions;
|
|
79
|
+
|
|
80
|
+
//>>includeStart('debug', pragmas.debug);
|
|
81
|
+
_cesium.Check.typeOf.object("dimensions", dimensions);
|
|
82
|
+
_cesium.Check.typeOf.number.greaterThanOrEquals("dimensions.x", dimensions.x, 0);
|
|
83
|
+
_cesium.Check.typeOf.number.greaterThanOrEquals("dimensions.y", dimensions.y, 0);
|
|
84
|
+
_cesium.Check.typeOf.number.greaterThanOrEquals("dimensions.z", dimensions.z, 0);
|
|
85
|
+
//>>includeEnd('debug');
|
|
86
|
+
|
|
87
|
+
var corner = _cesium.Cartesian3.multiplyByScalar(dimensions, 0.5, new _cesium.Cartesian3());
|
|
88
|
+
return new Grate({
|
|
89
|
+
minimum: _cesium.Cartesian3.negate(corner, new _cesium.Cartesian3()),
|
|
90
|
+
maximum: corner,
|
|
91
|
+
vertexFormat: options.vertexFormat,
|
|
92
|
+
offsetAttribute: options.offsetAttribute
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Creates a cube from the dimensions of an AxisAlignedBoundingBox.
|
|
98
|
+
*
|
|
99
|
+
* @param {AxisAlignedBoundingBox} boundingBox A description of the AxisAlignedBoundingBox.
|
|
100
|
+
* @returns {Grate}
|
|
101
|
+
*
|
|
102
|
+
*
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* const aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
|
|
106
|
+
* -72.0, 40.0,
|
|
107
|
+
* -70.0, 35.0,
|
|
108
|
+
* -75.0, 30.0,
|
|
109
|
+
* -70.0, 30.0,
|
|
110
|
+
* -68.0, 40.0
|
|
111
|
+
* ]));
|
|
112
|
+
* const box = Cesium.BoxGeometry.fromAxisAlignedBoundingBox(aabb);
|
|
113
|
+
*
|
|
114
|
+
* @see Grate.createGeometry
|
|
115
|
+
*/
|
|
116
|
+
Grate.fromAxisAlignedBoundingBox = function (boundingBox) {
|
|
117
|
+
//>>includeStart('debug', pragmas.debug);
|
|
118
|
+
_cesium.Check.typeOf.object("boundingBox", boundingBox);
|
|
119
|
+
//>>includeEnd('debug');
|
|
120
|
+
|
|
121
|
+
return new Grate({
|
|
122
|
+
minimum: boundingBox.minimum,
|
|
123
|
+
maximum: boundingBox.maximum
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The number of elements used to pack the object into an array.
|
|
129
|
+
* @type {Number}
|
|
130
|
+
*/
|
|
131
|
+
Grate.packedLength = 2 * _cesium.Cartesian3.packedLength + _cesium.VertexFormat.packedLength + 1;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Stores the provided instance into the provided array.
|
|
135
|
+
*
|
|
136
|
+
* @param {Grate} value The value to pack.
|
|
137
|
+
* @param {Number[]} array The array to pack into.
|
|
138
|
+
* @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
|
|
139
|
+
*
|
|
140
|
+
* @returns {Number[]} The array that was packed into
|
|
141
|
+
*/
|
|
142
|
+
Grate.pack = function (value, array, startingIndex) {
|
|
143
|
+
//>>includeStart('debug', pragmas.debug);
|
|
144
|
+
_cesium.Check.typeOf.object("value", value);
|
|
145
|
+
_cesium.Check.defined("array", array);
|
|
146
|
+
//>>includeEnd('debug');
|
|
147
|
+
|
|
148
|
+
startingIndex = (0, _cesium.defaultValue)(startingIndex, 0);
|
|
149
|
+
_cesium.Cartesian3.pack(value._minimum, array, startingIndex);
|
|
150
|
+
_cesium.Cartesian3.pack(value._maximum, array, startingIndex + _cesium.Cartesian3.packedLength);
|
|
151
|
+
_cesium.VertexFormat.pack(value._vertexFormat, array, startingIndex + 2 * _cesium.Cartesian3.packedLength);
|
|
152
|
+
array[startingIndex + 2 * _cesium.Cartesian3.packedLength + _cesium.VertexFormat.packedLength] = (0, _cesium.defaultValue)(value._offsetAttribute, -1);
|
|
153
|
+
return array;
|
|
154
|
+
};
|
|
155
|
+
var scratchMin = new _cesium.Cartesian3();
|
|
156
|
+
var scratchMax = new _cesium.Cartesian3();
|
|
157
|
+
var scratchVertexFormat = new _cesium.VertexFormat();
|
|
158
|
+
var scratchOptions = {
|
|
159
|
+
minimum: scratchMin,
|
|
160
|
+
maximum: scratchMax,
|
|
161
|
+
vertexFormat: scratchVertexFormat,
|
|
162
|
+
offsetAttribute: undefined
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Retrieves an instance from a packed array.
|
|
167
|
+
*
|
|
168
|
+
* @param {Number[]} array The packed array.
|
|
169
|
+
* @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
|
|
170
|
+
* @param {Grate} [result] The object into which to store the result.
|
|
171
|
+
* @returns {Grate} The modified result parameter or a new BoxGeometry instance if one was not provided.
|
|
172
|
+
*/
|
|
173
|
+
Grate.unpack = function (array, startingIndex, result) {
|
|
174
|
+
//>>includeStart('debug', pragmas.debug);
|
|
175
|
+
_cesium.Check.defined("array", array);
|
|
176
|
+
//>>includeEnd('debug');
|
|
177
|
+
|
|
178
|
+
startingIndex = (0, _cesium.defaultValue)(startingIndex, 0);
|
|
179
|
+
var min = _cesium.Cartesian3.unpack(array, startingIndex, scratchMin);
|
|
180
|
+
var max = _cesium.Cartesian3.unpack(array, startingIndex + _cesium.Cartesian3.packedLength, scratchMax);
|
|
181
|
+
var vertexFormat = _cesium.VertexFormat.unpack(array, startingIndex + 2 * _cesium.Cartesian3.packedLength, scratchVertexFormat);
|
|
182
|
+
var offsetAttribute = array[startingIndex + 2 * _cesium.Cartesian3.packedLength + _cesium.VertexFormat.packedLength];
|
|
183
|
+
if (!(0, _cesium.defined)(result)) {
|
|
184
|
+
scratchOptions.offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
|
|
185
|
+
return new Grate(scratchOptions);
|
|
186
|
+
}
|
|
187
|
+
result._minimum = _cesium.Cartesian3.clone(min, result._minimum);
|
|
188
|
+
result._maximum = _cesium.Cartesian3.clone(max, result._maximum);
|
|
189
|
+
result._vertexFormat = _cesium.VertexFormat.clone(vertexFormat, result._vertexFormat);
|
|
190
|
+
result._offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
|
|
191
|
+
return result;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Computes the geometric representation of a box, including its vertices, indices, and a bounding sphere.
|
|
196
|
+
*
|
|
197
|
+
* @param {Grate} boxGeometry A description of the box.
|
|
198
|
+
* @returns {Geometry|undefined} The computed vertices and indices.
|
|
199
|
+
*/
|
|
200
|
+
Grate.createGeometry = function (boxGeometry) {
|
|
201
|
+
var min = boxGeometry._minimum;
|
|
202
|
+
var max = boxGeometry._maximum;
|
|
203
|
+
var vertexFormat = boxGeometry._vertexFormat;
|
|
204
|
+
if (_cesium.Cartesian3.equals(min, max)) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
var attributes = new _cesium.GeometryAttributes();
|
|
208
|
+
var indices;
|
|
209
|
+
var positions;
|
|
210
|
+
if (vertexFormat.position && (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent)) {
|
|
211
|
+
if (vertexFormat.position) {
|
|
212
|
+
// 8 corner points. Duplicated 3 times each for each incident edge/face.
|
|
213
|
+
positions = new Float64Array(6 * 4 * 3);
|
|
214
|
+
|
|
215
|
+
// +z face
|
|
216
|
+
positions[0] = min.x;
|
|
217
|
+
positions[1] = min.y;
|
|
218
|
+
positions[2] = max.z;
|
|
219
|
+
positions[3] = max.x;
|
|
220
|
+
positions[4] = min.y;
|
|
221
|
+
positions[5] = max.z;
|
|
222
|
+
positions[6] = max.x;
|
|
223
|
+
positions[7] = max.y;
|
|
224
|
+
positions[8] = max.z;
|
|
225
|
+
positions[9] = min.x;
|
|
226
|
+
positions[10] = max.y;
|
|
227
|
+
positions[11] = max.z;
|
|
228
|
+
|
|
229
|
+
// -z face
|
|
230
|
+
positions[12] = min.x;
|
|
231
|
+
positions[13] = min.y;
|
|
232
|
+
positions[14] = min.z;
|
|
233
|
+
positions[15] = max.x;
|
|
234
|
+
positions[16] = min.y;
|
|
235
|
+
positions[17] = min.z;
|
|
236
|
+
positions[18] = max.x;
|
|
237
|
+
positions[19] = max.y;
|
|
238
|
+
positions[20] = min.z;
|
|
239
|
+
positions[21] = min.x;
|
|
240
|
+
positions[22] = max.y;
|
|
241
|
+
positions[23] = min.z;
|
|
242
|
+
|
|
243
|
+
// +x face
|
|
244
|
+
positions[24] = max.x;
|
|
245
|
+
positions[25] = min.y;
|
|
246
|
+
positions[26] = min.z;
|
|
247
|
+
positions[27] = max.x;
|
|
248
|
+
positions[28] = max.y;
|
|
249
|
+
positions[29] = min.z;
|
|
250
|
+
positions[30] = max.x;
|
|
251
|
+
positions[31] = max.y;
|
|
252
|
+
positions[32] = max.z;
|
|
253
|
+
positions[33] = max.x;
|
|
254
|
+
positions[34] = min.y;
|
|
255
|
+
positions[35] = max.z;
|
|
256
|
+
|
|
257
|
+
// -x face
|
|
258
|
+
positions[36] = min.x;
|
|
259
|
+
positions[37] = min.y;
|
|
260
|
+
positions[38] = min.z;
|
|
261
|
+
positions[39] = min.x;
|
|
262
|
+
positions[40] = max.y;
|
|
263
|
+
positions[41] = min.z;
|
|
264
|
+
positions[42] = min.x;
|
|
265
|
+
positions[43] = max.y;
|
|
266
|
+
positions[44] = max.z;
|
|
267
|
+
positions[45] = min.x;
|
|
268
|
+
positions[46] = min.y;
|
|
269
|
+
positions[47] = max.z;
|
|
270
|
+
|
|
271
|
+
// +y face
|
|
272
|
+
positions[48] = min.x;
|
|
273
|
+
positions[49] = max.y;
|
|
274
|
+
positions[50] = min.z;
|
|
275
|
+
positions[51] = max.x;
|
|
276
|
+
positions[52] = max.y;
|
|
277
|
+
positions[53] = min.z;
|
|
278
|
+
positions[54] = max.x;
|
|
279
|
+
positions[55] = max.y;
|
|
280
|
+
positions[56] = max.z;
|
|
281
|
+
positions[57] = min.x;
|
|
282
|
+
positions[58] = max.y;
|
|
283
|
+
positions[59] = max.z;
|
|
284
|
+
|
|
285
|
+
// -y face
|
|
286
|
+
positions[60] = min.x;
|
|
287
|
+
positions[61] = min.y;
|
|
288
|
+
positions[62] = min.z;
|
|
289
|
+
positions[63] = max.x;
|
|
290
|
+
positions[64] = min.y;
|
|
291
|
+
positions[65] = min.z;
|
|
292
|
+
positions[66] = max.x;
|
|
293
|
+
positions[67] = min.y;
|
|
294
|
+
positions[68] = max.z;
|
|
295
|
+
positions[69] = min.x;
|
|
296
|
+
positions[70] = min.y;
|
|
297
|
+
positions[71] = max.z;
|
|
298
|
+
attributes.position = new _cesium.GeometryAttribute({
|
|
299
|
+
componentDatatype: _cesium.ComponentDatatype.DOUBLE,
|
|
300
|
+
componentsPerAttribute: 3,
|
|
301
|
+
values: positions
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
if (vertexFormat.normal) {
|
|
305
|
+
var normals = new Float32Array(6 * 4 * 3);
|
|
306
|
+
|
|
307
|
+
// +z face
|
|
308
|
+
normals[0] = 0.0;
|
|
309
|
+
normals[1] = 0.0;
|
|
310
|
+
normals[2] = 1.0;
|
|
311
|
+
normals[3] = 0.0;
|
|
312
|
+
normals[4] = 0.0;
|
|
313
|
+
normals[5] = 1.0;
|
|
314
|
+
normals[6] = 0.0;
|
|
315
|
+
normals[7] = 0.0;
|
|
316
|
+
normals[8] = 1.0;
|
|
317
|
+
normals[9] = 0.0;
|
|
318
|
+
normals[10] = 0.0;
|
|
319
|
+
normals[11] = 1.0;
|
|
320
|
+
|
|
321
|
+
// -z face
|
|
322
|
+
normals[12] = 0.0;
|
|
323
|
+
normals[13] = 0.0;
|
|
324
|
+
normals[14] = -1.0;
|
|
325
|
+
normals[15] = 0.0;
|
|
326
|
+
normals[16] = 0.0;
|
|
327
|
+
normals[17] = -1.0;
|
|
328
|
+
normals[18] = 0.0;
|
|
329
|
+
normals[19] = 0.0;
|
|
330
|
+
normals[20] = -1.0;
|
|
331
|
+
normals[21] = 0.0;
|
|
332
|
+
normals[22] = 0.0;
|
|
333
|
+
normals[23] = -1.0;
|
|
334
|
+
|
|
335
|
+
// +x face
|
|
336
|
+
normals[24] = 1.0;
|
|
337
|
+
normals[25] = 0.0;
|
|
338
|
+
normals[26] = 0.0;
|
|
339
|
+
normals[27] = 1.0;
|
|
340
|
+
normals[28] = 0.0;
|
|
341
|
+
normals[29] = 0.0;
|
|
342
|
+
normals[30] = 1.0;
|
|
343
|
+
normals[31] = 0.0;
|
|
344
|
+
normals[32] = 0.0;
|
|
345
|
+
normals[33] = 1.0;
|
|
346
|
+
normals[34] = 0.0;
|
|
347
|
+
normals[35] = 0.0;
|
|
348
|
+
|
|
349
|
+
// -x face
|
|
350
|
+
normals[36] = -1.0;
|
|
351
|
+
normals[37] = 0.0;
|
|
352
|
+
normals[38] = 0.0;
|
|
353
|
+
normals[39] = -1.0;
|
|
354
|
+
normals[40] = 0.0;
|
|
355
|
+
normals[41] = 0.0;
|
|
356
|
+
normals[42] = -1.0;
|
|
357
|
+
normals[43] = 0.0;
|
|
358
|
+
normals[44] = 0.0;
|
|
359
|
+
normals[45] = -1.0;
|
|
360
|
+
normals[46] = 0.0;
|
|
361
|
+
normals[47] = 0.0;
|
|
362
|
+
|
|
363
|
+
// +y face
|
|
364
|
+
normals[48] = 0.0;
|
|
365
|
+
normals[49] = 1.0;
|
|
366
|
+
normals[50] = 0.0;
|
|
367
|
+
normals[51] = 0.0;
|
|
368
|
+
normals[52] = 1.0;
|
|
369
|
+
normals[53] = 0.0;
|
|
370
|
+
normals[54] = 0.0;
|
|
371
|
+
normals[55] = 1.0;
|
|
372
|
+
normals[56] = 0.0;
|
|
373
|
+
normals[57] = 0.0;
|
|
374
|
+
normals[58] = 1.0;
|
|
375
|
+
normals[59] = 0.0;
|
|
376
|
+
|
|
377
|
+
// -y face
|
|
378
|
+
normals[60] = 0.0;
|
|
379
|
+
normals[61] = -1.0;
|
|
380
|
+
normals[62] = 0.0;
|
|
381
|
+
normals[63] = 0.0;
|
|
382
|
+
normals[64] = -1.0;
|
|
383
|
+
normals[65] = 0.0;
|
|
384
|
+
normals[66] = 0.0;
|
|
385
|
+
normals[67] = -1.0;
|
|
386
|
+
normals[68] = 0.0;
|
|
387
|
+
normals[69] = 0.0;
|
|
388
|
+
normals[70] = -1.0;
|
|
389
|
+
normals[71] = 0.0;
|
|
390
|
+
attributes.normal = new _cesium.GeometryAttribute({
|
|
391
|
+
componentDatatype: _cesium.ComponentDatatype.FLOAT,
|
|
392
|
+
componentsPerAttribute: 3,
|
|
393
|
+
values: normals
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
if (vertexFormat.st) {
|
|
397
|
+
var texCoords = new Float32Array([
|
|
398
|
+
// +z face
|
|
399
|
+
0, 0.75, 1, 0.75, 1, 1, 0, 1,
|
|
400
|
+
// -z face
|
|
401
|
+
0, 0, 1, 0, 1, 0.25, 0, 0.25,
|
|
402
|
+
// +x face
|
|
403
|
+
0, 0.25, 1, 0.25, 1, 0.75, 0, 0.75,
|
|
404
|
+
// -x face
|
|
405
|
+
0, 0.25, 1, 0.25, 1, 0.75, 0, 0.75,
|
|
406
|
+
// +y face
|
|
407
|
+
0, 0.25, 1, 0.25, 1, 0.75, 0, 0.75,
|
|
408
|
+
// -y face
|
|
409
|
+
0, 0.25, 1, 0.25, 1, 0.75, 0, 0.75]);
|
|
410
|
+
attributes.st = new _cesium.GeometryAttribute({
|
|
411
|
+
componentDatatype: _cesium.ComponentDatatype.FLOAT,
|
|
412
|
+
componentsPerAttribute: 2,
|
|
413
|
+
values: texCoords
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
if (vertexFormat.tangent) {
|
|
417
|
+
var tangents = new Float32Array(6 * 4 * 3);
|
|
418
|
+
|
|
419
|
+
// +z face
|
|
420
|
+
tangents[0] = 1.0;
|
|
421
|
+
tangents[1] = 0.0;
|
|
422
|
+
tangents[2] = 0.0;
|
|
423
|
+
tangents[3] = 1.0;
|
|
424
|
+
tangents[4] = 0.0;
|
|
425
|
+
tangents[5] = 0.0;
|
|
426
|
+
tangents[6] = 1.0;
|
|
427
|
+
tangents[7] = 0.0;
|
|
428
|
+
tangents[8] = 0.0;
|
|
429
|
+
tangents[9] = 1.0;
|
|
430
|
+
tangents[10] = 0.0;
|
|
431
|
+
tangents[11] = 0.0;
|
|
432
|
+
|
|
433
|
+
// -z face
|
|
434
|
+
tangents[12] = -1.0;
|
|
435
|
+
tangents[13] = 0.0;
|
|
436
|
+
tangents[14] = 0.0;
|
|
437
|
+
tangents[15] = -1.0;
|
|
438
|
+
tangents[16] = 0.0;
|
|
439
|
+
tangents[17] = 0.0;
|
|
440
|
+
tangents[18] = -1.0;
|
|
441
|
+
tangents[19] = 0.0;
|
|
442
|
+
tangents[20] = 0.0;
|
|
443
|
+
tangents[21] = -1.0;
|
|
444
|
+
tangents[22] = 0.0;
|
|
445
|
+
tangents[23] = 0.0;
|
|
446
|
+
|
|
447
|
+
// +x face
|
|
448
|
+
tangents[24] = 0.0;
|
|
449
|
+
tangents[25] = 1.0;
|
|
450
|
+
tangents[26] = 0.0;
|
|
451
|
+
tangents[27] = 0.0;
|
|
452
|
+
tangents[28] = 1.0;
|
|
453
|
+
tangents[29] = 0.0;
|
|
454
|
+
tangents[30] = 0.0;
|
|
455
|
+
tangents[31] = 1.0;
|
|
456
|
+
tangents[32] = 0.0;
|
|
457
|
+
tangents[33] = 0.0;
|
|
458
|
+
tangents[34] = 1.0;
|
|
459
|
+
tangents[35] = 0.0;
|
|
460
|
+
|
|
461
|
+
// -x face
|
|
462
|
+
tangents[36] = 0.0;
|
|
463
|
+
tangents[37] = -1.0;
|
|
464
|
+
tangents[38] = 0.0;
|
|
465
|
+
tangents[39] = 0.0;
|
|
466
|
+
tangents[40] = -1.0;
|
|
467
|
+
tangents[41] = 0.0;
|
|
468
|
+
tangents[42] = 0.0;
|
|
469
|
+
tangents[43] = -1.0;
|
|
470
|
+
tangents[44] = 0.0;
|
|
471
|
+
tangents[45] = 0.0;
|
|
472
|
+
tangents[46] = -1.0;
|
|
473
|
+
tangents[47] = 0.0;
|
|
474
|
+
|
|
475
|
+
// +y face
|
|
476
|
+
tangents[48] = -1.0;
|
|
477
|
+
tangents[49] = 0.0;
|
|
478
|
+
tangents[50] = 0.0;
|
|
479
|
+
tangents[51] = -1.0;
|
|
480
|
+
tangents[52] = 0.0;
|
|
481
|
+
tangents[53] = 0.0;
|
|
482
|
+
tangents[54] = -1.0;
|
|
483
|
+
tangents[55] = 0.0;
|
|
484
|
+
tangents[56] = 0.0;
|
|
485
|
+
tangents[57] = -1.0;
|
|
486
|
+
tangents[58] = 0.0;
|
|
487
|
+
tangents[59] = 0.0;
|
|
488
|
+
|
|
489
|
+
// -y face
|
|
490
|
+
tangents[60] = 1.0;
|
|
491
|
+
tangents[61] = 0.0;
|
|
492
|
+
tangents[62] = 0.0;
|
|
493
|
+
tangents[63] = 1.0;
|
|
494
|
+
tangents[64] = 0.0;
|
|
495
|
+
tangents[65] = 0.0;
|
|
496
|
+
tangents[66] = 1.0;
|
|
497
|
+
tangents[67] = 0.0;
|
|
498
|
+
tangents[68] = 0.0;
|
|
499
|
+
tangents[69] = 1.0;
|
|
500
|
+
tangents[70] = 0.0;
|
|
501
|
+
tangents[71] = 0.0;
|
|
502
|
+
attributes.tangent = new _cesium.GeometryAttribute({
|
|
503
|
+
componentDatatype: _cesium.ComponentDatatype.FLOAT,
|
|
504
|
+
componentsPerAttribute: 3,
|
|
505
|
+
values: tangents
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
if (vertexFormat.bitangent) {
|
|
509
|
+
var bitangents = new Float32Array(6 * 4 * 3);
|
|
510
|
+
|
|
511
|
+
// +z face
|
|
512
|
+
bitangents[0] = 0.0;
|
|
513
|
+
bitangents[1] = 1.0;
|
|
514
|
+
bitangents[2] = 0.0;
|
|
515
|
+
bitangents[3] = 0.0;
|
|
516
|
+
bitangents[4] = 1.0;
|
|
517
|
+
bitangents[5] = 0.0;
|
|
518
|
+
bitangents[6] = 0.0;
|
|
519
|
+
bitangents[7] = 1.0;
|
|
520
|
+
bitangents[8] = 0.0;
|
|
521
|
+
bitangents[9] = 0.0;
|
|
522
|
+
bitangents[10] = 1.0;
|
|
523
|
+
bitangents[11] = 0.0;
|
|
524
|
+
|
|
525
|
+
// -z face
|
|
526
|
+
bitangents[12] = 0.0;
|
|
527
|
+
bitangents[13] = 1.0;
|
|
528
|
+
bitangents[14] = 0.0;
|
|
529
|
+
bitangents[15] = 0.0;
|
|
530
|
+
bitangents[16] = 1.0;
|
|
531
|
+
bitangents[17] = 0.0;
|
|
532
|
+
bitangents[18] = 0.0;
|
|
533
|
+
bitangents[19] = 1.0;
|
|
534
|
+
bitangents[20] = 0.0;
|
|
535
|
+
bitangents[21] = 0.0;
|
|
536
|
+
bitangents[22] = 1.0;
|
|
537
|
+
bitangents[23] = 0.0;
|
|
538
|
+
|
|
539
|
+
// +x face
|
|
540
|
+
bitangents[24] = 0.0;
|
|
541
|
+
bitangents[25] = 0.0;
|
|
542
|
+
bitangents[26] = 1.0;
|
|
543
|
+
bitangents[27] = 0.0;
|
|
544
|
+
bitangents[28] = 0.0;
|
|
545
|
+
bitangents[29] = 1.0;
|
|
546
|
+
bitangents[30] = 0.0;
|
|
547
|
+
bitangents[31] = 0.0;
|
|
548
|
+
bitangents[32] = 1.0;
|
|
549
|
+
bitangents[33] = 0.0;
|
|
550
|
+
bitangents[34] = 0.0;
|
|
551
|
+
bitangents[35] = 1.0;
|
|
552
|
+
|
|
553
|
+
// -x face
|
|
554
|
+
bitangents[36] = 0.0;
|
|
555
|
+
bitangents[37] = 0.0;
|
|
556
|
+
bitangents[38] = 1.0;
|
|
557
|
+
bitangents[39] = 0.0;
|
|
558
|
+
bitangents[40] = 0.0;
|
|
559
|
+
bitangents[41] = 1.0;
|
|
560
|
+
bitangents[42] = 0.0;
|
|
561
|
+
bitangents[43] = 0.0;
|
|
562
|
+
bitangents[44] = 1.0;
|
|
563
|
+
bitangents[45] = 0.0;
|
|
564
|
+
bitangents[46] = 0.0;
|
|
565
|
+
bitangents[47] = 1.0;
|
|
566
|
+
|
|
567
|
+
// +y face
|
|
568
|
+
bitangents[48] = 0.0;
|
|
569
|
+
bitangents[49] = 0.0;
|
|
570
|
+
bitangents[50] = 1.0;
|
|
571
|
+
bitangents[51] = 0.0;
|
|
572
|
+
bitangents[52] = 0.0;
|
|
573
|
+
bitangents[53] = 1.0;
|
|
574
|
+
bitangents[54] = 0.0;
|
|
575
|
+
bitangents[55] = 0.0;
|
|
576
|
+
bitangents[56] = 1.0;
|
|
577
|
+
bitangents[57] = 0.0;
|
|
578
|
+
bitangents[58] = 0.0;
|
|
579
|
+
bitangents[59] = 1.0;
|
|
580
|
+
|
|
581
|
+
// -y face
|
|
582
|
+
bitangents[60] = 0.0;
|
|
583
|
+
bitangents[61] = 0.0;
|
|
584
|
+
bitangents[62] = 1.0;
|
|
585
|
+
bitangents[63] = 0.0;
|
|
586
|
+
bitangents[64] = 0.0;
|
|
587
|
+
bitangents[65] = 1.0;
|
|
588
|
+
bitangents[66] = 0.0;
|
|
589
|
+
bitangents[67] = 0.0;
|
|
590
|
+
bitangents[68] = 1.0;
|
|
591
|
+
bitangents[69] = 0.0;
|
|
592
|
+
bitangents[70] = 0.0;
|
|
593
|
+
bitangents[71] = 1.0;
|
|
594
|
+
attributes.bitangent = new _cesium.GeometryAttribute({
|
|
595
|
+
componentDatatype: _cesium.ComponentDatatype.FLOAT,
|
|
596
|
+
componentsPerAttribute: 3,
|
|
597
|
+
values: bitangents
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// 12 triangles: 6 faces, 2 triangles each.
|
|
602
|
+
indices = new Uint16Array(6 * 2 * 3);
|
|
603
|
+
|
|
604
|
+
// +z face
|
|
605
|
+
indices[0] = 0;
|
|
606
|
+
indices[1] = 1;
|
|
607
|
+
indices[2] = 2;
|
|
608
|
+
indices[3] = 0;
|
|
609
|
+
indices[4] = 2;
|
|
610
|
+
indices[5] = 3;
|
|
611
|
+
|
|
612
|
+
// -z face
|
|
613
|
+
indices[6] = 4 + 2;
|
|
614
|
+
indices[7] = 4 + 1;
|
|
615
|
+
indices[8] = 4 + 0;
|
|
616
|
+
indices[9] = 4 + 3;
|
|
617
|
+
indices[10] = 4 + 2;
|
|
618
|
+
indices[11] = 4 + 0;
|
|
619
|
+
|
|
620
|
+
// +x face
|
|
621
|
+
indices[12] = 8 + 0;
|
|
622
|
+
indices[13] = 8 + 1;
|
|
623
|
+
indices[14] = 8 + 2;
|
|
624
|
+
indices[15] = 8 + 0;
|
|
625
|
+
indices[16] = 8 + 2;
|
|
626
|
+
indices[17] = 8 + 3;
|
|
627
|
+
|
|
628
|
+
// -x face
|
|
629
|
+
indices[18] = 12 + 2;
|
|
630
|
+
indices[19] = 12 + 1;
|
|
631
|
+
indices[20] = 12 + 0;
|
|
632
|
+
indices[21] = 12 + 3;
|
|
633
|
+
indices[22] = 12 + 2;
|
|
634
|
+
indices[23] = 12 + 0;
|
|
635
|
+
|
|
636
|
+
// +y face
|
|
637
|
+
indices[24] = 16 + 2;
|
|
638
|
+
indices[25] = 16 + 1;
|
|
639
|
+
indices[26] = 16 + 0;
|
|
640
|
+
indices[27] = 16 + 3;
|
|
641
|
+
indices[28] = 16 + 2;
|
|
642
|
+
indices[29] = 16 + 0;
|
|
643
|
+
|
|
644
|
+
// -y face
|
|
645
|
+
indices[30] = 20 + 0;
|
|
646
|
+
indices[31] = 20 + 1;
|
|
647
|
+
indices[32] = 20 + 2;
|
|
648
|
+
indices[33] = 20 + 0;
|
|
649
|
+
indices[34] = 20 + 2;
|
|
650
|
+
indices[35] = 20 + 3;
|
|
651
|
+
} else {
|
|
652
|
+
// Positions only - no need to duplicate corner points
|
|
653
|
+
positions = new Float64Array(8 * 3);
|
|
654
|
+
positions[0] = min.x;
|
|
655
|
+
positions[1] = min.y;
|
|
656
|
+
positions[2] = min.z;
|
|
657
|
+
positions[3] = max.x;
|
|
658
|
+
positions[4] = min.y;
|
|
659
|
+
positions[5] = min.z;
|
|
660
|
+
positions[6] = max.x;
|
|
661
|
+
positions[7] = max.y;
|
|
662
|
+
positions[8] = min.z;
|
|
663
|
+
positions[9] = min.x;
|
|
664
|
+
positions[10] = max.y;
|
|
665
|
+
positions[11] = min.z;
|
|
666
|
+
positions[12] = min.x;
|
|
667
|
+
positions[13] = min.y;
|
|
668
|
+
positions[14] = max.z;
|
|
669
|
+
positions[15] = max.x;
|
|
670
|
+
positions[16] = min.y;
|
|
671
|
+
positions[17] = max.z;
|
|
672
|
+
positions[18] = max.x;
|
|
673
|
+
positions[19] = max.y;
|
|
674
|
+
positions[20] = max.z;
|
|
675
|
+
positions[21] = min.x;
|
|
676
|
+
positions[22] = max.y;
|
|
677
|
+
positions[23] = max.z;
|
|
678
|
+
attributes.position = new _cesium.GeometryAttribute({
|
|
679
|
+
componentDatatype: _cesium.ComponentDatatype.DOUBLE,
|
|
680
|
+
componentsPerAttribute: 3,
|
|
681
|
+
values: positions
|
|
682
|
+
});
|
|
683
|
+
|
|
684
|
+
// 12 triangles: 6 faces, 2 triangles each.
|
|
685
|
+
indices = new Uint16Array(6 * 2 * 3);
|
|
686
|
+
|
|
687
|
+
// plane z = corner.Z
|
|
688
|
+
indices[0] = 4;
|
|
689
|
+
indices[1] = 5;
|
|
690
|
+
indices[2] = 6;
|
|
691
|
+
indices[3] = 4;
|
|
692
|
+
indices[4] = 6;
|
|
693
|
+
indices[5] = 7;
|
|
694
|
+
|
|
695
|
+
// plane z = -corner.Z
|
|
696
|
+
indices[6] = 1;
|
|
697
|
+
indices[7] = 0;
|
|
698
|
+
indices[8] = 3;
|
|
699
|
+
indices[9] = 1;
|
|
700
|
+
indices[10] = 3;
|
|
701
|
+
indices[11] = 2;
|
|
702
|
+
|
|
703
|
+
// plane x = corner.X
|
|
704
|
+
indices[12] = 1;
|
|
705
|
+
indices[13] = 6;
|
|
706
|
+
indices[14] = 5;
|
|
707
|
+
indices[15] = 1;
|
|
708
|
+
indices[16] = 2;
|
|
709
|
+
indices[17] = 6;
|
|
710
|
+
|
|
711
|
+
// plane y = corner.Y
|
|
712
|
+
indices[18] = 2;
|
|
713
|
+
indices[19] = 3;
|
|
714
|
+
indices[20] = 7;
|
|
715
|
+
indices[21] = 2;
|
|
716
|
+
indices[22] = 7;
|
|
717
|
+
indices[23] = 6;
|
|
718
|
+
|
|
719
|
+
// plane x = -corner.X
|
|
720
|
+
indices[24] = 3;
|
|
721
|
+
indices[25] = 0;
|
|
722
|
+
indices[26] = 4;
|
|
723
|
+
indices[27] = 3;
|
|
724
|
+
indices[28] = 4;
|
|
725
|
+
indices[29] = 7;
|
|
726
|
+
|
|
727
|
+
// plane y = -corner.Y
|
|
728
|
+
indices[30] = 0;
|
|
729
|
+
indices[31] = 1;
|
|
730
|
+
indices[32] = 5;
|
|
731
|
+
indices[33] = 0;
|
|
732
|
+
indices[34] = 5;
|
|
733
|
+
indices[35] = 4;
|
|
734
|
+
}
|
|
735
|
+
var diff = _cesium.Cartesian3.subtract(max, min, diffScratch);
|
|
736
|
+
var radius = _cesium.Cartesian3.magnitude(diff) * 0.5;
|
|
737
|
+
if ((0, _cesium.defined)(boxGeometry._offsetAttribute)) {
|
|
738
|
+
var length = positions.length;
|
|
739
|
+
var applyOffset = new Uint8Array(length / 3);
|
|
740
|
+
var offsetValue = boxGeometry._offsetAttribute === _cesium.GeometryOffsetAttribute.NONE ? 0 : 1;
|
|
741
|
+
(0, _cesium.arrayFill)(applyOffset, offsetValue);
|
|
742
|
+
attributes.applyOffset = new _cesium.GeometryAttribute({
|
|
743
|
+
componentDatatype: _cesium.ComponentDatatype.UNSIGNED_BYTE,
|
|
744
|
+
componentsPerAttribute: 1,
|
|
745
|
+
values: applyOffset
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
return new _cesium.Geometry({
|
|
749
|
+
attributes: attributes,
|
|
750
|
+
indices: indices,
|
|
751
|
+
primitiveType: _cesium.PrimitiveType.TRIANGLES,
|
|
752
|
+
boundingSphere: new _cesium.BoundingSphere(_cesium.Cartesian3.ZERO, radius),
|
|
753
|
+
offsetAttribute: boxGeometry._offsetAttribute
|
|
754
|
+
});
|
|
755
|
+
};
|
|
756
|
+
var unitBoxGeometry;
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* Returns the geometric representation of a unit box, including its vertices, indices, and a bounding sphere.
|
|
760
|
+
* @returns {Geometry} The computed vertices and indices.
|
|
761
|
+
*
|
|
762
|
+
* @private
|
|
763
|
+
*/
|
|
764
|
+
Grate.getUnitBox = function () {
|
|
765
|
+
if (!(0, _cesium.defined)(unitBoxGeometry)) {
|
|
766
|
+
unitBoxGeometry = Grate.createGeometry(Grate.fromDimensions({
|
|
767
|
+
dimensions: new _cesium.Cartesian3(1.0, 1.0, 1.0),
|
|
768
|
+
vertexFormat: _cesium.VertexFormat.POSITION_ONLY
|
|
769
|
+
}));
|
|
770
|
+
}
|
|
771
|
+
return unitBoxGeometry;
|
|
772
|
+
};
|
|
773
|
+
var _default = exports["default"] = Grate;
|
|
774
|
+
//# sourceMappingURL=Grate.js.map
|