English中文

WallOutlineGeometry

new Cesium.WallOutlineGeometry(options)

墙壁轮廓的描述。墙是由一系列延伸到地面的点定义的。或者,它们可以向下伸出到指定的高度。 A description of a wall outline. 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
抛出: 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 outline that spans from ground level to 10000 meters
const wall = new Cesium.WallOutlineGeometry({
  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.WallOutlineGeometry.createGeometry(wall);
另见: See:
  • WallGeometry#createGeometry
  • WallGeometry#fromConstantHeight

成员 Members

用于将对象打包到数组中的元素数量。 The number of elements used to pack the object into an array.

方法 Methods

static Cesium.WallOutlineGeometry.createGeometry(wallGeometry)Geometry|undefined

计算墙轮廓的几何表示,包括其顶点、索引和边界球。 Computes the geometric representation of a wall outline, including its vertices, indices, and a bounding sphere.
名称 Name 类型 Type 说明 Description
wallGeometry WallOutlineGeometry 墙轮廓的描述。 A description of the wall outline.
返回: Returns:
计算的顶点和索引。 The computed vertices and indices.

static Cesium.WallOutlineGeometry.fromConstantHeights(options)WallOutlineGeometry

墙轮廓的描述。墙是由一系列延伸到地面的点定义的。或者,它们可以向下伸出到指定的高度。 A description of a walloutline. 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
返回: Returns:
示例: Example:
// create a wall that spans from 10000 meters to 20000 meters
const wall = Cesium.WallOutlineGeometry.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.WallOutlineGeometry.createGeometry(wall);
另见: See:
  • WallOutlineGeometry#createGeometry

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

将提供的实例存储到提供的数组中。 Stores the provided instance into the provided array.
名称 Name 类型 Type 默认值 Default 说明 Description
value WallOutlineGeometry 包装的价值。 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.WallOutlineGeometry.unpack(array, startingIndex, result)WallOutlineGeometry

从打包数组中检索实例。 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 WallOutlineGeometry 可选 optional 用于存储结果的对象。 The object into which to store the result.
返回: Returns:
修改后的结果参数或新的 WallOutlineGeometry 实例(如果未提供)。 The modified result parameter or a new WallOutlineGeometry instance if one was not provided.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.