指定一组剪裁平面。剪切平面有选择地禁用
在单个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
具有以下属性的对象:
|
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
edgeColor : Color
用于高亮显示对象沿其剪裁的边的颜色。
-
Default Value:
Color.WHITE
应用于剪裁对象的边的高光的宽度(以像素为单位)。
-
Default Value:
0.0
如果为true,将启用剪切。
-
Default Value:
true
返回此集合中的平面数。通常用于
ClippingPlaneCollection#get
遍历所有平面
收藏中。modelMatrix : Matrix4
4x4变换矩阵,指定相对于剪裁平面的附加变换
原始坐标系。
-
Default Value:
Matrix4.IDENTITY
planeAdded : Event
将新剪裁平面添加到集合时触发的事件。事件处理
索引被添加到新的平面上。
-
Default Value:
Event()
planeRemoved : Event
从集合中删除新剪裁平面时触发的事件。事件处理
传递新平面及其从中删除的索引。
-
Default Value:
Event()
如果为true,则如果区域位于
收藏。否则,仅当区域位于
在飞机外面。
-
Default Value:
false
Methods
将指定的
ClippingPlane
添加到要用于选择性禁用呈现的集合
在每架飞机的外面。使用ClippingPlaneCollection#unionClippingRegions
修改
如何修改多个平面的剪裁行为。Name | Type | Description |
---|---|---|
plane |
ClippingPlane | 要添加到集合中的剪贴平面。 |
See:
检查此集合是否包含与给定剪辑平面相等的剪辑平面。
Name | Type | Description |
---|---|---|
clippingPlane |
ClippingPlane | optional 要检查的剪辑平面。 |
Returns:
如果此集合包含ClippingPlane,则为true,否则为false。
销毁此对象持有的WebGL资源。销毁一个对象允许确定性 释放WebGL资源,而不是依赖垃圾回收器销毁此对象。 一旦一个对象被销毁,就不应该使用它;调用除
isDestroyed
将导致DeveloperError
异常。因此,
如示例所示,将返回值(undefined
)分配给对象。Throws:
-
DeveloperError :此对象已销毁,即调用destroy()。
Example:
clippingPlanes = clippingPlanes && clippingPlanes.destroy();
See:
get(index) → ClippingPlane
返回集合中指定索引处的平面。指数以零为基础
随着平面的增加而增加。删除一个平面后,所有平面都会随之移动
它在左边,改变他们的指数。此函数常用于
ClippingPlaneCollection#length
遍历所有平面
收藏中。Name | Type | Description |
---|---|---|
index |
Number | 平面的从零开始的索引。 |
Returns:
指定索引处的剪辑平面。
Returns:
如果此对象被销毁,则为
true
;否则为false
。从集合中移除给定剪贴平面的第一个实例。
Name | Type | Description |
---|---|---|
clippingPlane |
ClippingPlane |
Returns:
如果飞机被移走了,则为
true
;如果在收藏品中找不到飞机,则为false
。从集合中删除所有平面。