Skip to content

KBE3D / KBCore / Cesium / RectangleGeometry

类: RectangleGeometry

A description of a cartographic rectangle on an ellipsoid centered at the origin. Rectangle geometry can be rendered with both Primitive and GroundPrimitive.

示例

ts
// 1. create a rectangle
const rectangle = new Cesium.RectangleGeometry({
  ellipsoid : Cesium.Ellipsoid.default,
  rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  height : 10000.0
});
const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);

// 2. create an extruded rectangle without a top
const rectangle = new Cesium.RectangleGeometry({
  ellipsoid : Cesium.Ellipsoid.default,
  rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  height : 10000.0,
  extrudedHeight: 300000
});
const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);

参数

Object with the following properties:

参数

A cartographic rectangle with north, south, east and west properties in radians.

参数

The vertex attributes to be computed.

参数

The ellipsoid on which the rectangle lies.

参数

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

参数

The distance in meters between the rectangle and the ellipsoid surface.

参数

The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.

参数

The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.

参数

The distance in meters between the rectangle's extruded face and the ellipsoid surface.

属性

packedLength

static packedLength: number

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

方法

pack()

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

Stores the provided instance into the provided array.

参数

value

RectangleGeometry

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

Retrieves an instance from a packed array.

参数

array

number[]

The packed array.

startingIndex?

number

The starting index of the element to be unpacked.

result?

RectangleGeometry

The object into which to store the result.

返回

RectangleGeometry

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


computeRectangle()

static computeRectangle(options: { rectangle: Rectangle; ellipsoid?: Ellipsoid; granularity?: number; rotation?: number; }, result?: Rectangle): Rectangle

Computes the bounding rectangle based on the provided options

参数

options

Object with the following properties:

rectangle

Rectangle

A cartographic rectangle with north, south, east and west properties in radians.

ellipsoid?

Ellipsoid

The ellipsoid on which the rectangle lies.

granularity?

number

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

rotation?

number

The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.

result?

Rectangle

An object in which to store the result.

返回

Rectangle

The result rectangle


createGeometry()

static createGeometry(rectangleGeometry: RectangleGeometry): Geometry | undefined

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

参数

rectangleGeometry

RectangleGeometry

A description of the rectangle.

返回

Geometry | undefined

The computed vertices and indices.

构造函数

构造函数

new RectangleGeometry(options: { rectangle: Rectangle; vertexFormat?: VertexFormat; ellipsoid?: Ellipsoid; granularity?: number; height?: number; rotation?: number; stRotation?: number; extrudedHeight?: number; }): RectangleGeometry

参数

options
rectangle

Rectangle

vertexFormat?

VertexFormat

ellipsoid?

Ellipsoid

granularity?

number

height?

number

rotation?

number

stRotation?

number

extrudedHeight?

number

返回

RectangleGeometry

KBE3D @3.0.0 Copyright © 2024-present KBE3D