ClippingPlaneCollection

new Cesium.ClippingPlaneCollection(options)

指定一组剪裁平面。剪切平面有选择地禁用 在单个gltf模型、3D平铺集或球体的指定ClippingPlane个对象列表之外。

In general the clipping planes' coordinates are relative to the object they're attached to, so a plane with distance set to 0 will clip through the center of the object.

For 3D Tiles, the root tile's transform is used to position the clipping planes. If a transform is not defined, the root tile's Cesium3DTile#boundingSphere is used instead.

Name Type Description
options Object optional 具有以下属性的对象:
Name Type Default Description
planes Array.<ClippingPlane> [] optional ClippingPlane个对象的数组,用于有选择地禁用每个平面外部的渲染。
enabled Boolean true optional 确定剪裁平面是否处于活动状态。
modelMatrix Matrix4 Matrix4.IDENTITY optional 4x4变换矩阵,指定相对于剪裁平面原始坐标系的附加变换。
unionClippingRegions Boolean false optional 如果为true,则如果某个区域位于集合中任何平面的外部,则该区域将被剪裁。否则,仅当某个区域位于每个平面的外部时,才会对其进行剪裁。
edgeColor Color Color.WHITE optional 用于高亮显示对象沿其剪裁的边的颜色。
edgeWidth Number 0.0 optional 应用于剪裁对象的边的高光的宽度(以像素为单位)。
Example:
// This clipping plane's distance is positive, which means its normal
// is facing the origin. This will clip everything that is behind
// the plane, which is anything with y coordinate < -5.
var clippingPlanes = new Cesium.ClippingPlaneCollection({
    planes : [
        new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 5.0)
    ],
});
// Create an entity and attach the ClippingPlaneCollection to the model.
var entity = viewer.entities.add({
    position : Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 10000),
    model : {
        uri : 'model.gltf',
        minimumPixelSize : 128,
        maximumScale : 20000,
        clippingPlanes : clippingPlanes
    }
});
viewer.zoomTo(entity);
Demo:

Members

用于高亮显示对象沿其剪裁的边的颜色。
Default Value: Color.WHITE
应用于剪裁对象的边的高光的宽度(以像素为单位)。
Default Value: 0.0
如果为true,将启用剪切。
Default Value: true

readonly length : Number

返回此集合中的平面数。通常用于 ClippingPlaneCollection#get遍历所有平面 收藏中。
4x4变换矩阵,指定相对于剪裁平面的附加变换 原始坐标系。
Default Value: Matrix4.IDENTITY
将新剪裁平面添加到集合时触发的事件。事件处理 索引被添加到新的平面上。
Default Value: Event()
从集合中删除新剪裁平面时触发的事件。事件处理 传递新平面及其从中删除的索引。
Default Value: Event()

unionClippingRegions : Boolean

如果为true,则如果区域位于 收藏。否则,仅当区域位于 在飞机外面。
Default Value: false

Methods

将指定的ClippingPlane添加到要用于选择性禁用呈现的集合 在每架飞机的外面。使用ClippingPlaneCollection#unionClippingRegions修改 如何修改多个平面的剪裁行为。
Name Type Description
plane ClippingPlane 要添加到集合中的剪贴平面。
See:

contains(clippingPlane)Boolean

检查此集合是否包含与给定剪辑平面相等的剪辑平面。
Name Type Description
clippingPlane ClippingPlane optional 要检查的剪辑平面。
Returns:
如果此集合包含ClippingPlane,则为true,否则为false。
See:


销毁此对象持有的WebGL资源。销毁一个对象允许确定性 释放WebGL资源,而不是依赖垃圾回收器销毁此对象。 一旦一个对象被销毁,就不应该使用它;调用除 isDestroyed将导致DeveloperError异常。因此, 如示例所示,将返回值(undefined)分配给对象。
Throws:
Example:
clippingPlanes = clippingPlanes && clippingPlanes.destroy();
See:
返回集合中指定索引处的平面。指数以零为基础 随着平面的增加而增加。删除一个平面后,所有平面都会随之移动 它在左边,改变他们的指数。此函数常用于 ClippingPlaneCollection#length遍历所有平面 收藏中。
Name Type Description
index Number 平面的从零开始的索引。
Returns:
指定索引处的剪辑平面。
See:

isDestroyed()Boolean



如果此对象已销毁,则返回true;否则返回false。 如果此对象已被销毁,则不应使用它;调用除 isDestroyed将导致DeveloperError异常。
Returns:
如果此对象被销毁,则为true;否则为false
See:

remove(clippingPlane)Boolean

从集合中移除给定剪贴平面的第一个实例。
Name Type Description
clippingPlane ClippingPlane
Returns:
如果飞机被移走了,则为true;如果在收藏品中找不到飞机,则为false
See:
从集合中删除所有平面。
See:
ViewerCesiumWidget将场景渲染到 生成用于剪切平面的资源。

Do not call this function directly.