Skip to content

KBE3D / KBCore / Cesium / OrthographicOffCenterFrustum

类: OrthographicOffCenterFrustum

The viewing frustum is defined by 6 planes. Each plane is represented by a Cartesian4 object, where the x, y, and z components define the unit vector normal to the plane, and the w component is the distance of the plane from the origin/camera position.

示例

ts
const maxRadii = ellipsoid.maximumRadius;

const frustum = new Cesium.OrthographicOffCenterFrustum();
frustum.right = maxRadii * Cesium.Math.PI;
frustum.left = -c.frustum.right;
frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth);
frustum.bottom = -c.frustum.top;
frustum.near = 0.01 * maxRadii;
frustum.far = 50.0 * maxRadii;

参数

An object with the following properties:

参数

The left clipping plane distance.

参数

The right clipping plane distance.

参数

The top clipping plane distance.

参数

The bottom clipping plane distance.

参数

The near clipping plane distance.

参数

The far clipping plane distance.

属性

left

left: number | undefined

The left clipping plane.


right: number | undefined

The right clipping plane.


top

top: number | undefined

The top clipping plane.


bottom

bottom: number | undefined

The bottom clipping plane.


near

near: number

The distance of the near plane.


far

far: number

The distance of the far plane.


projectionMatrix

readonly projectionMatrix: Matrix4

Gets the orthographic projection matrix computed from the view frustum.

方法

computeCullingVolume()

computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume

Creates a culling volume for this frustum.

参数

position

Cartesian3

The eye position.

direction

Cartesian3

The view direction.

up

Cartesian3

The up direction.

返回

CullingVolume

A culling volume at the given position and orientation.

示例

ts
// Check if a bounding volume intersects the frustum.
const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
const intersect = cullingVolume.computeVisibility(boundingVolume);

getPixelDimensions()

getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2

Returns the pixel's width and height in meters.

参数

drawingBufferWidth

number

The width of the drawing buffer.

drawingBufferHeight

number

The height of the drawing buffer.

distance

number

The distance to the near plane in meters.

pixelRatio

number

The scaling factor from pixel space to coordinate space.

result

Cartesian2

The object onto which to store the result.

返回

Cartesian2

The modified result parameter or a new instance of Cartesian2 with the pixel's width and height in the x and y properties, respectively.

示例

ts
// Example 1
// Get the width and height of a pixel.
const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());

clone()

clone(result?: OrthographicOffCenterFrustum): OrthographicOffCenterFrustum

Returns a duplicate of a OrthographicOffCenterFrustum instance.

参数

result?

OrthographicOffCenterFrustum

The object onto which to store the result.

返回

OrthographicOffCenterFrustum

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


equals()

equals(other?: OrthographicOffCenterFrustum): boolean

Compares the provided OrthographicOffCenterFrustum componentwise and returns <code>true</code> if they are equal, <code>false</code> otherwise.

参数

other?

OrthographicOffCenterFrustum

The right hand side OrthographicOffCenterFrustum.

返回

boolean

true if they are equal, false otherwise.


equalsEpsilon()

equalsEpsilon(other: OrthographicOffCenterFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean

Compares the provided OrthographicOffCenterFrustum componentwise and returns <code>true</code> if they pass an absolute or relative tolerance test, <code>false</code> otherwise.

参数

other

OrthographicOffCenterFrustum

The right hand side OrthographicOffCenterFrustum.

relativeEpsilon

number

The relative epsilon tolerance to use for equality testing.

absoluteEpsilon?

number

The absolute epsilon tolerance to use for equality testing.

返回

boolean

true if this and other are within the provided epsilon, false otherwise.

构造函数

构造函数

new OrthographicOffCenterFrustum(options?: { left?: number; right?: number; top?: number; bottom?: number; near?: number; far?: number; }): OrthographicOffCenterFrustum

参数

options?
left?

number

right?

number

top?

number

bottom?

number

near?

number

far?

number

返回

OrthographicOffCenterFrustum

KBE3D @3.0.0 Copyright © 2024-present KBE3D