English中文

WallGeometry

new Cesium.WallGeometry(options)

对墙的描述,类似于 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:
名称 Name 类型 Type 默认值 Default 说明 Description
positions Array.<Cartesian3> 笛卡尔对象的数组,它们是墙的点。 An array of Cartesian objects, which are the points of the wall.
granularity number CesiumMath.RADIANS_PER_DEGREE 可选 optional 每个纬度和经度之间的距离(以弧度为单位)。确定缓冲区中的位置数。 The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
maximumHeights Array.<number> 可选 optional 一个数组平行于 An array parallel to positions 给出了墙的最大高度 that give the maximum height of the wall at positions。如果未定义,则使用每个位置的高度。 . If undefined, the height of each position in used.
minimumHeights Array.<number> 可选 optional 一个数组平行于 An array parallel to positions 给出了墙的最小高度 that give the minimum height of the wall at positions。如果未定义,则每个位置的高度均为 0.0。 . If undefined, the height at each position is 0.0.
ellipsoid Ellipsoid Ellipsoid.default 可选 optional 用于坐标操纵的椭球体 The ellipsoid for coordinate manipulation
vertexFormat VertexFormat VertexFormat.DEFAULT 可选 optional 要计算的顶点属性。 The vertex attributes to be computed.
抛出: 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.
示例: 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:
  • WallGeometry#createGeometry
  • WallGeometry#fromConstantHeight

成员 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:
名称 Name 类型 Type 默认值 Default 说明 Description
positions Array.<Cartesian3> 笛卡尔对象的数组,它们是墙的点。 An array of Cartesian objects, which are the points of the wall.
maximumHeight number 可选 optional 定义墙的最大高度的常数 A constant that defines the maximum height of the wall at positions。如果未定义,则使用每个位置的高度。 . If undefined, the height of each position in used.
minimumHeight number 可选 optional 定义墙的最小高度的常数 A constant that defines the minimum height of the wall at positions。如果未定义,则每个位置的高度均为 0.0。 . If undefined, the height at each position is 0.0.
ellipsoid Ellipsoid Ellipsoid.default 可选 optional 用于坐标操纵的椭球体 The ellipsoid for coordinate manipulation
vertexFormat VertexFormat VertexFormat.DEFAULT 可选 optional 要计算的顶点属性。 The vertex attributes to be computed.
返回: Returns:
示例: 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:
  • WallGeometry#createGeometry

static Cesium.WallGeometry.pack(value, array, startingIndex)Array.<number>

将提供的实例存储到提供的数组中。 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.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.