Explosion
Interface List
| Interface Name | Description |
|---|---|
| Execute Explosion | Execute an explosion |
| Set Explosion Direction | Set the explosion direction |
| Set Explosion Progress | Set the explosion progress |
| Reset Explosion | Reset the explosion |
Executing an Explosion
If you need the explosion toolbar, just execute the explosion command; the direction and progress can be set through the toolbar.
buttonClickFunc('explosive', SView.Commands.ExplosiveMenu)
The following method is the interface for performing an explosion without the explosion toolbar.
//To perform an explosion, first initialize the explosion action
let action = new SView.Actions.ExplosiveAction();
action.setScene(scene);
let topModel = scene.getTopModel();
action.setExplosiveModel([topModel]);
action.execute();
Setting the Explosion Direction and Progress
//direction: 0 = center explosion, 1 = X-axis linear explosion, 2 = Y-axis linear explosion, 3 = Z-axis linear explosion; percent: 0–2
action.setPercent(direction,percent);
Resetting the Explosion
//Only the explosion parameters are reset; the explosion effect is not reset. To reset the explosion effect, use the reset command.
action.reset();