Roaming
Interface List
| Interface Name | Description |
|---|---|
| Toggle Roaming | Turn roaming on or off |
| Set Roaming Speed | Set the roaming speed |
| Set Field of View Size | Set the field of view size during roaming |
| Set Mouse Operations During Roaming | Set whether the mouse can be used for operations during roaming |
| Toggle Perspective Projection | Turn perspective projection on or off |
Toggling Roaming
let array = new Map();
//Composite command related parameters
array.set("fullClassName", "SView.Commands.RoamCommand");
commandManager.execute("RoamCommand", array);
Setting the Roaming Speed
//The second parameter is the speed value
M3D.Config.SceneParameters.getInstance().setParameter(M3D.Config.roamingSpeed, 1);
Setting the Field of View Size
//The second parameter is the camera angle value
M3D.Config.SceneParameters.getInstance().setParameter(M3D.Config.fieldSize, 50);
//Also set the roaming service related parameters
let roamService = frame.getServiceManager()
.getService(SView.Services.ServiceType.RoamService, SView.Services);
if (roamService) {
roamService.setCameraFov(50);
}
Setting Mouse Operations During Roaming
//Set whether mouse operations are allowed in the roaming service
let roamService = frame.getServiceManager()
.getService(SView.Services.ServiceType.RoamService, SView.Services);
if (roamService) {
roamService.setIsMouseswitch(true);
}
Toggling Perspective Projection
Enabling perspective projection does not simultaneously enable roaming, but disabling perspective projection also disables roaming
//Executing this command toggles the perspective projection state
commandManager.execute("Projection");