CorridorGeometry

new Cesium.CorridorGeometry(options)

描述一条走廊。走廊几何可以同时用 PrimitiveGroundPrimitive 渲染。
Name Type Description
options object 具有以下属性的对象:
Name Type Default Description
positions Array.<Cartesian3> 定义走廊中心的笛卡尔坐标数组。
width number 走廊两侧边缘之间的距离(以米为单位)。
ellipsoid Ellipsoid Ellipsoid.default optional 要用作参考的椭球体。
granularity number CesiumMath.RADIANS_PER_DEGREE optional 每个纬度和经度之间的距离(以弧度为单位)。决定缓冲区中的位置数量。
height number 0.0 optional 椭球表面与坐标之间的距离(以米为单位)。
extrudedHeight number optional 椭球表面与拉伸面之间的距离(以米为单位)。
vertexFormat VertexFormat VertexFormat.DEFAULT optional 要计算的顶点属性。
cornerType CornerType CornerType.ROUNDED optional 决定角落的样式。
Example:
const corridor = new Cesium.CorridorGeometry({
  vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
  width : 100000
});
Demo:
See:

Members

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

Methods

static Cesium.CorridorGeometry.computeRectangle(options, result)Rectangle

Computes the bounding rectangle given the provided options
Name Type Description
options object Object with the following properties:
Name Type Default Description
positions Array.<Cartesian3> An array of positions that define the center of the corridor.
width number The distance between the edges of the corridor in meters.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid to be used as a reference.
cornerType CornerType CornerType.ROUNDED optional Determines the style of the corners.
result Rectangle optional An object in which to store the result.
Returns:
The result rectangle.

static Cesium.CorridorGeometry.createGeometry(corridorGeometry)Geometry|undefined

Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
Name Type Description
corridorGeometry CorridorGeometry A description of the corridor.
Returns:
The computed vertices and indices.

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

Stores the provided instance into the provided array.
Name Type Default Description
value CorridorGeometry 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.CorridorGeometry.unpack(array, startingIndex, result)CorridorGeometry

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 CorridorGeometry optional The object into which to store the result.
Returns:
The modified result parameter or a new CorridorGeometry instance if one was not provided.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.