视锥体由6个平面定义。
每个平面由一个
Cartesian4 对象表示,其中 x、y 和 z 组件
定义平面的单位法向量,w 组件是平面离原点/摄像机位置的距离。
| Name | Type | Description | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
optional
一个具有以下属性的对象:
|
Example:
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;
Members
下侧裁剪平面。
-
Default Value:
undefined
远平面的距离。
-
Default Value:
500000000.0
左侧裁剪平面。
-
Default Value:
undefined
近平面的距离。
-
Default Value:
1.0
readonly projectionMatrix : Matrix4
获取从视锥体计算的正交投影矩阵
右侧裁剪平面。
-
Default Value:
undefined
上侧裁剪平面。
-
Default Value:
undefined
Methods
返回一个定向偏中心包围盒实例的副本。
| Name | Type | Description |
|---|---|---|
result |
OrthographicOffCenterFrustum | optional 存储结果的对象。 |
Returns:
修改后的结果参数,如果未提供则返回一个新的 OrthographicOffCenterFrustum 实例。
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);
分别比较提供的定向偏中心包围盒,并返回
如果相等则为
true,否则为 false。
| Name | Type | Description |
|---|---|---|
other |
OrthographicOffCenterFrustum | optional 右侧的定向偏中心包围盒。 |
Returns:
如果相等则为
true,否则为 false。
分别比较提供的定向偏中心包围盒,并返回
如果通过绝对或相对公差测试,则为
true,否则为 false。
| Name | Type | Default | Description |
|---|---|---|---|
other |
OrthographicOffCenterFrustum | 右侧的定向偏中心包围盒。 | |
relativeEpsilon |
number | 用于相等性测试的相对 epsilon 容差。 | |
absoluteEpsilon |
number |
relativeEpsilon
|
optional 用于平等测试的绝对 epsilon 容差。 |
Returns:
如果 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:
-
DeveloperError : drawingBufferWidth 必须大于零。
-
DeveloperError : drawingBufferHeight 必须
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());
