OrthographicFrustum

new Cesium.OrthographicFrustum ( options )

视锥体由 6 个平面定义。每个平面由一个 Cartesian4 对象表示,其中 x、y 和 z 分量定义垂直于平面的单位矢量,w 分量是平面到原点/相机位置的距离。
Name Type Description
options Object 可选 具有以下属性的对象:
姓名 类型 默认 描述
width 数字 可选 截头体的宽度,以米为单位。
aspectRatio 数字 可选 截锥体宽度与其高度的纵横比。
near 数字 1.0 可选 近平面的距离。
far 数字 500000000.0 可选 远平面的距离。
Example:
const maxRadii = ellipsoid.maximumRadius;

const frustum = new Cesium.OrthographicFrustum();
frustum.near = 0.01 * maxRadii;
frustum.far = 50.0 * maxRadii;

Members

static Cesium.OrthographicFrustum.packedLength : Number

用于将对象打包到数组中的元素数。
截锥体宽度与其高度的纵横比。
Default Value: undefined
远平面的距离。
Default Value: 500000000.0;
近平面的距离。
Default Value: 1.0
获取从视锥计算的正交投影矩阵。
平截头体的水平宽度,以米为单位。
Default Value: undefined

Methods

static Cesium.OrthographicFrustum.pack (value, array, startingIndex ) → Array.<Number>

将提供的实例存储到提供的数组中。
Name Type Default Description
value OrthographicFrustum 要打包的值。
array Array.<Number> 要打包的数组。
startingIndex Number 0 可选 开始打包元素的数组索引。
Returns:
装入的数组

static Cesium.OrthographicFrustum.unpack (array, startingIndex , result ) → OrthographicFrustum

从打包数组中检索实例。
Name Type Default Description
array Array.<Number> 打包的数组。
startingIndex Number 0 可选 要解包的元素的起始索引。
result OrthographicFrustum 可选 存储结果的对象。
Returns:
修改后的结果参数或新的 OrthographicFrustum 实例(如果未提供)。
返回 OrthographicFrustum 实例的副本。
Name Type Description
result OrthographicFrustum 可选 存储结果的对象。
Returns:
修改后的结果参数或新的 OrthographicFrustum 实例(如果未提供)。

computeCullingVolume (position, direction, up) → CullingVolume

为此平截头体创建一个剔除体积。
Name Type Description
position Cartesian3 眼位。
direction Cartesian3 视图方向。
up Cartesian3 向上的方向。
Returns:
给定位置和方向的剔除体积。
Example:
// Check if a bounding volume intersects the frustum.
const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
const intersect = cullingVolume.computeVisibility(boundingVolume);

equals ( other ) → Boolean

比较提供的 OrthographicFrustum 组件,如果它们相等则返回 true ,否则返回 false 。
Name Type Description
other OrthographicFrustum 可选 右手边的OrthographicFrustum。
Returns:
如果它们相等,则为 true ,否则为 false 。

equalsEpsilon (other, relativeEpsilon, absoluteEpsilon ) → Boolean

比较提供的 OrthographicFrustum 组件,如果它们通过绝对或相对容差测试,则返回 true ,否则返回 false 。
Name Type Default Description
other OrthographicFrustum 右手边的 OrthographicFrustum。
relativeEpsilon Number 用于相等性测试的相对 epsilon 容差。
absoluteEpsilon Number relativeEpsilon 可选 用于相等测试的绝对 epsilon 容差。
Returns:
true this 和 other 在提供的 epsilon 内,则为 true,否则为 false 。

getPixelDimensions (drawingBufferWidth, drawingBufferHeight, distance, pixelRatio, result) → Cartesian2

返回像素的宽度和高度(以米为单位)。
Name Type Description
drawingBufferWidth Number 绘图缓冲区的宽度。
drawingBufferHeight Number 绘图缓冲区的高度。
distance Number 到近平面的距离(以米为单位)。
pixelRatio Number 从像素空间到坐标空间的比例因子。
result Cartesian2 存储结果的对象。
Returns:
修改后的结果参数或 Cartesian2 的新实例,分别在 x 和 y 属性中具有像素的宽度和高度。
Throws:
Example:
// 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());