Skip to content

KBE3D / KBCore / Cesium / WallOutlineGeometry

类: WallOutlineGeometry

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.

示例

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

参数

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

属性

packedLength

packedLength: number

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

方法

pack()

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

Stores the provided instance into the provided array.

参数

value

WallOutlineGeometry

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?: WallOutlineGeometry): WallOutlineGeometry

Retrieves an instance from a packed array.

参数

array

number[]

The packed array.

startingIndex?

number

The starting index of the element to be unpacked.

result?

WallOutlineGeometry

The object into which to store the result.

返回

WallOutlineGeometry

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


fromConstantHeights()

static fromConstantHeights(options: { positions: Cartesian3[]; maximumHeight?: number; minimumHeight?: number; ellipsoid?: Ellipsoid; }): 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.

参数

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

返回

WallOutlineGeometry

示例

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

createGeometry()

static createGeometry(wallGeometry: WallOutlineGeometry): Geometry | undefined

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

参数

wallGeometry

WallOutlineGeometry

A description of the wall outline.

返回

Geometry | undefined

The computed vertices and indices.

构造函数

构造函数

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

参数

options
positions

Cartesian3[]

granularity?

number

maximumHeights?

number[]

minimumHeights?

number[]

ellipsoid?

Ellipsoid

返回

WallOutlineGeometry

KBE3D @3.0.0 Copyright © 2024-present KBE3D