Skip to content

KBE3D / KBCore / Cesium / CylinderGeometry

类: CylinderGeometry

A description of a cylinder.

示例

ts
// create cylinder geometry
const cylinder = new Cesium.CylinderGeometry({
    length: 200000,
    topRadius: 80000,
    bottomRadius: 200000,
});
const geometry = Cesium.CylinderGeometry.createGeometry(cylinder);

参数

Object with the following properties:

参数

The length of the cylinder.

参数

The radius of the top of the cylinder.

参数

The radius of the bottom of the cylinder.

参数

The number of edges around the perimeter of the cylinder.

参数

The vertex attributes to be computed.

属性

packedLength

static packedLength: number

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

方法

pack()

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

Stores the provided instance into the provided array.

参数

value

CylinderGeometry

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

Retrieves an instance from a packed array.

参数

array

number[]

The packed array.

startingIndex?

number

The starting index of the element to be unpacked.

result?

CylinderGeometry

The object into which to store the result.

返回

CylinderGeometry

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


createGeometry()

static createGeometry(cylinderGeometry: CylinderGeometry): Geometry | undefined

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

参数

cylinderGeometry

CylinderGeometry

A description of the cylinder.

返回

Geometry | undefined

The computed vertices and indices.

构造函数

构造函数

new CylinderGeometry(options: { length: number; topRadius: number; bottomRadius: number; slices?: number; vertexFormat?: VertexFormat; }): CylinderGeometry

参数

options
length

number

topRadius

number

bottomRadius

number

slices?

number

vertexFormat?

VertexFormat

返回

CylinderGeometry

KBE3D @3.0.0 Copyright © 2024-present KBE3D