Box裁剪
Name | Type | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
参数选项:
|
Example:
var boxClipping = new Cesium.GeoClipping.BoxClipping({
viewer : viewer,
polygon : [new Cesium.Cartesian3(...), new Cesium.Cartesian3(...), new Cesium.Cartesian3(...)],
targets : [tileset, model]
});
Demo:
Members
center : Cartesian3
裁剪Box的中心
最后被更改时的对应帧数
销毁事件
是否激活
-
Default Value:
[true]
裁剪Box的高度
交互时的最小响应间隙
唯一名称标识
裁剪Box的示意Box图元的颜色
是否就绪
是否在场景中显示裁剪Box的示意Box图元
-
Default Value:
[true]
对应的BOX裁剪源数据
目标集
Methods
通过交互方式,获取创建裁剪Box的点集,当交互完成时,将点集传送给回调函数
Name | Type | Description |
---|---|---|
viewer |
Viewer | 当前viewer |
callback |
function | 交互完成时的回调函数 |
Example:
Cesium.GeoClipping.BoxClipping.getPositions(viewer, function(positions){
if (positions && positions.length >= 3){
clippingBox = new Cesium.GeoClipping.BoxClipping({
viewer : viewer,
polygon : positions,
targets : [...]
});
viewer.scene.clippingCollection.push(clippingBox);
}
});
初始化Box裁剪环境, 这个接口必须在使用前调用,否则裁剪无效果
Name | Type | Description |
---|---|---|
scene |
Scene | 当前场景 |
Example:
Cesium.GeoClipping.BoxClipping.initialize(viewer.scene);
缩放BOX
Name | Type | Description |
---|---|---|
value |
Number | 缩放参数,单位米 |
判断对象是否匹配
Name | Type | Description |
---|---|---|
primitive |
Model | Cesium3DTileset |
判断对象是否在指定帧数之后被更改
Name | Type | Description |
---|---|---|
primitive |
Model | Cesium3DTileset | |
number |
Number |
将裁剪Box的中心沿法线移动一定距离
Name | Type | Description |
---|---|---|
distance |
Number | 要移动的距离,单位为米;当距离为负值时,反向移动 |
Example:
clippingBox.moveWithDistance(5);