对墙的描述,类似于 KML 线串。墙是由一系列延伸到地面的点定义的。或者,它们可以向下伸出到指定的高度。 A description of a wall, which is similar to a KML line string. A wall is defined by a series of points, which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
| 名称 Name | 类型 Type | 说明 Description | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
具有以下属性的对象: Object with the following properties:
|
抛出: Throws:
-
DeveloperError :仓位长度必须大于或等于2。 : positions length must be greater than or equal to 2.
-
DeveloperError :位置和最大高度必须具有相同的长度。 : positions and maximumHeights must have the same length.
-
DeveloperError : positions and minimumHeights must have the same length.
- WallGeometry#createGeometry
- WallGeometry#fromConstantHeight
示例: Example:
// create a wall that spans from ground level to 10000 meters
const wall = new Cesium.WallGeometry({
positions : Cesium.Cartesian3.fromDegreesArrayHeights([
19.0, 47.0, 10000.0,
19.0, 48.0, 10000.0,
20.0, 48.0, 10000.0,
20.0, 47.0, 10000.0,
19.0, 47.0, 10000.0
])
});
const geometry = Cesium.WallGeometry.createGeometry(wall);
演示: Demo:
另见: See:
成员 Members
用于将对象打包到数组中的元素数量。 The number of elements used to pack the object into an array.
方法 Methods
static Cesium.WallGeometry.createGeometry(wallGeometry) → Geometry|undefined
计算墙的几何表示,包括其顶点、索引和边界球。 Computes the geometric representation of a wall, including its vertices, indices, and a bounding sphere.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
wallGeometry |
WallGeometry | 对墙的描述。 A description of the wall. |
返回: Returns:
计算的顶点和索引。 The computed vertices and indices.
static Cesium.WallGeometry.fromConstantHeights(options) → WallGeometry
对墙的描述,类似于 KML 线串。墙是由一系列延伸到地面的点定义的。或者,它们可以向下伸出到指定的高度。 A description of a wall, which is similar to a KML line string. A wall is defined by a series of points, which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
| 名称 Name | 类型 Type | 说明 Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
具有以下属性的对象: Object with the following properties:
|
返回: Returns:
- WallGeometry#createGeometry
示例: Example:
// create a wall that spans from 10000 meters to 20000 meters
const wall = Cesium.WallGeometry.fromConstantHeights({
positions : Cesium.Cartesian3.fromDegreesArray([
19.0, 47.0,
19.0, 48.0,
20.0, 48.0,
20.0, 47.0,
19.0, 47.0,
]),
minimumHeight : 20000.0,
maximumHeight : 10000.0
});
const geometry = Cesium.WallGeometry.createGeometry(wall);
另见: See:
将提供的实例存储到提供的数组中。 Stores the provided instance into the provided array.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
value |
WallGeometry | 包装的价值。 The value to pack. | |
array |
Array.<number> | 要打包到的数组。 The array to pack into. | |
startingIndex |
number |
0
|
可选 optional 开始打包元素的数组索引。 The index into the array at which to start packing the elements. |
返回: Returns:
被打包成的数组 The array that was packed into
static Cesium.WallGeometry.unpack(array, startingIndex, result) → WallGeometry
从打包数组中检索实例。 Retrieves an instance from a packed array.
| 名称 Name | 类型 Type | 默认值 Default | 说明 Description |
|---|---|---|---|
array |
Array.<number> | 打包的数组。 The packed array. | |
startingIndex |
number |
0
|
可选 optional 要解包的元素的起始索引。 The starting index of the element to be unpacked. |
result |
WallGeometry | 可选 optional 用于存储结果的对象。 The object into which to store the result. |
返回: Returns:
修改后的结果参数或新的 WallGeometry 实例(如果未提供)。 The modified result parameter or a new WallGeometry instance if one was not provided.
