爆炸
接口列表
| 接口名称 | 说明 |
|---|---|
| 执行爆炸 | 执行爆炸 |
| 设置爆炸方向 | 设置爆炸方向 |
| 设置爆炸进度 | 设置爆炸进度 |
| 重置爆炸 | 重置爆炸 |
执行爆炸
若需要爆炸工具栏,则直接执行爆炸命令即可,方向、进度可通过工具栏进行设置
buttonClickFunc('explosive', SView.Commands.ExplosiveMenu)
以下方法为不使用爆炸工具栏进行爆炸的接口
//执行爆炸需先初始化爆炸action
let action = new SView.Actions.ExplosiveAction();
action.setScene(scene);
let topModel = scene.getTopModel();
action.setExplosiveModel([topModel]);
action.execute();
设置爆炸方向和进度
//direction取值为0:中心爆炸,1:X轴线性爆炸,2:Y轴线性爆炸,3:Z轴线性爆炸;percent取值范围0-2,
action.setPercent(direction,percent);
重置爆炸
//仅重置爆炸参数,并不会重置爆炸效果,爆炸效果需要复位命令
action.reset();