new Cesium.Occluder(occluderBoundingSphere, cameraPosition)

创建由对象位置和半径以及相机位置衍生的Occluder. 操作器可用于确定其他物体是否可见或隐藏在 由闭合器和相机位置定义的可见视野.
Name Type Description
occluderBoundingSphere BoundingSphere 包围着占地者的圈圈.
cameraPosition Cartesian3 观众/摄像头的坐标.
Example:
// Construct an occluder one unit away from the origin with a radius of one.
const cameraPosition = Cesium.Cartesian3.ZERO;
const occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 1);
const occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);

Members

cameraPosition : Cartesian3

摄像头的位置.

position : Cartesian3

占者之职.

radius : number

占卜者半径.

Methods

static Cesium.Occluder.computeOccludeePoint(occluderBoundingSphere, occludeePosition, positions)object

计算一个点,可以用作可见函数的占位点. Occlude半径使用0半径. 通常,用户会计算周围的边框 用于可见度的物体;但也可以计算出如果 可见/未见也表示物体是否可见/未见。 这个功能更好 调用不相对于占地器移动且大小的物体,例如 地势。 最好不要打这个电话,用对象的边框 例如卫星或地面飞行器.
Name Type Description
occluderBoundingSphere BoundingSphere 包围着占地者的圈圈.
occludeePosition Cartesian3 Occlude(半径0的边界范围)所在的点.
positions Array.<Cartesian3> 占领者表面附近地平线上的高度点列表.
Returns:
包含两个属性的天体: NT 0 occludePoint NT 1 和 NT 2 valid NT 3 它是一个布尔值.
Throws:
  • DeveloperError : positions must contain at least one element.
  • DeveloperError : occludeePosition must have a value other than occluderBoundingSphere.center.
Example:
const cameraPosition = new Cesium.Cartesian3(0, 0, 0);
const occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -8), 2);
const occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);
const positions = [new Cesium.Cartesian3(-0.25, 0, -5.3), new Cesium.Cartesian3(0.25, 0, -5.3)];
const tileOccluderSphere = Cesium.BoundingSphere.fromPoints(positions);
const occludeePosition = tileOccluderSphere.center;
const occludeePt = Cesium.Occluder.computeOccludeePoint(occluderBoundingSphere, occludeePosition, positions);

static Cesium.Occluder.computeOccludeePointFromRectangle(rectangle, ellipsoid)object

从矩形计算出一个点作为占位点到能见度函数.
Name Type Default Description
rectangle Rectangle 矩形用来创建边框球体.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid used to determine positions of the rectangle.
Returns:
包含两个属性的天体: NT 0 occludePoint NT 1 和 NT 2 valid NT 3 它是一个布尔值.

static Cesium.Occluder.fromBoundingSphere(occluderBoundingSphere, cameraPosition, result)Occluder

从边际球体和相机位置创建占位器.
Name Type Description
occluderBoundingSphere BoundingSphere 包围着占地者的圈圈.
cameraPosition Cartesian3 观众/摄像头的坐标.
result Occluder optional 存储结果的对象 .
Returns:
占星器源于物体的位置和半径,以及相机位置.

computeVisibility(occludeeBS)Visibility

确定占有物的可见程度(不可见、部分可见或完全可见).
Name Type Description
occludeeBS BoundingSphere 毗卢遮那法界.
Returns:
-NT=0== -=YTET -伊甸园字幕组=- 翻译:, 如果占卜部分可见 Visibility.FULL if the occludee is fully visible.
Example:
const sphere1 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1.5), 0.5);
const sphere2 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -2.5), 0.5);
const cameraPosition = new Cesium.Cartesian3(0, 0, 0);
const occluder = new Cesium.Occluder(sphere1, cameraPosition);
occluder.computeVisibility(sphere2); //returns Visibility.NONE

isBoundingSphereVisible(occludee)boolean

确定一个球体, NT 0 occlude NT 1 ,是否隐藏在占地者视野中.
Name Type Description
occludee BoundingSphere 围绕 Occulate 对象的界限球 .
Returns:
NT+0 real NT+1 如果出现;否则 NT+2 假 NT+3 .
Example:
const cameraPosition = new Cesium.Cartesian3(0, 0, 0);
const littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);
const occluder = new Cesium.Occluder(littleSphere, cameraPosition);
const bigSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -3), 1);
occluder.isBoundingSphereVisible(bigSphere); //returns true
See:

isPointVisible(occludee)boolean

确定一个点, occlude NT 0 occlude NT 1 , 是否被 occluder 隐藏在视图中 .
Name Type Description
occludee Cartesian3 围绕 occlude 对象的点 .
Returns:
NT+0 real NT+1 如果出现;否则 NT+2 假 NT+3 .
Example:
const cameraPosition = new Cesium.Cartesian3(0, 0, 0);
const littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);
const occluder = new Cesium.Occluder(littleSphere, cameraPosition);
const point = new Cesium.Cartesian3(0, 0, -3);
occluder.isPointVisible(point); //returns true
See:
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.