Skip to content

KBE3D / KBCore / Cesium / WallGeometry

类: WallGeometry

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.

示例

ts
// 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);

参数

Object with the following properties:

参数

An array of Cartesian objects, which are the points of the wall.

参数

The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.

参数

An array parallel to <code>positions</code> that give the maximum height of the wall at <code>positions</code>. If undefined, the height of each position in used.

参数

An array parallel to <code>positions</code> that give the minimum height of the wall at <code>positions</code>. If undefined, the height at each position is 0.0.

参数

The ellipsoid for coordinate manipulation

参数

The vertex attributes to be computed.

属性

packedLength

packedLength: number

The number of elements used to pack the object into an array.

方法

pack()

static pack(value: WallGeometry, array: number[], startingIndex?: number): number[]

Stores the provided instance into the provided array.

参数

value

WallGeometry

The value to pack.

array

number[]

The array to pack into.

startingIndex?

number

The index into the array at which to start packing the elements.

返回

number[]

The array that was packed into


unpack()

static unpack(array: number[], startingIndex?: number, result?: WallGeometry): WallGeometry

Retrieves an instance from a packed array.

参数

array

number[]

The packed array.

startingIndex?

number

The starting index of the element to be unpacked.

result?

WallGeometry

The object into which to store the result.

返回

WallGeometry

The modified result parameter or a new WallGeometry instance if one was not provided.


fromConstantHeights()

static fromConstantHeights(options: { positions: Cartesian3[]; maximumHeight?: number; minimumHeight?: number; ellipsoid?: Ellipsoid; vertexFormat?: VertexFormat; }): WallGeometry

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.

参数

options

Object with the following properties:

positions

Cartesian3[]

An array of Cartesian objects, which are the points of the wall.

maximumHeight?

number

A constant that defines the maximum height of the wall at <code>positions</code>. If undefined, the height of each position in used.

minimumHeight?

number

A constant that defines the minimum height of the wall at <code>positions</code>. If undefined, the height at each position is 0.0.

ellipsoid?

Ellipsoid

The ellipsoid for coordinate manipulation

vertexFormat?

VertexFormat

The vertex attributes to be computed.

返回

WallGeometry

示例

ts
// 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);

createGeometry()

static createGeometry(wallGeometry: WallGeometry): Geometry | undefined

Computes the geometric representation of a wall, including its vertices, indices, and a bounding sphere.

参数

wallGeometry

WallGeometry

A description of the wall.

返回

Geometry | undefined

The computed vertices and indices.

构造函数

构造函数

new WallGeometry(options: { positions: Cartesian3[]; granularity?: number; maximumHeights?: number[]; minimumHeights?: number[]; ellipsoid?: Ellipsoid; vertexFormat?: VertexFormat; }): WallGeometry

参数

options
positions

Cartesian3[]

granularity?

number

maximumHeights?

number[]

minimumHeights?

number[]

ellipsoid?

Ellipsoid

vertexFormat?

VertexFormat

返回

WallGeometry

KBE3D @3.0.0 Copyright © 2024-present KBE3D