Mode
Enumerations
Observables
Methods
Types
MoveToModeOptions
MoveToModeOptions: object
| Property | Type |
|---|---|
| position? | Vector3 | undefined |
| rotation? | Rotation | undefined |
| transition? | Camera.TransitionType | undefined |
| zoom? | number | undefined |
Enumerations
Mode
Mode: enum
| Member | Value |
|---|---|
| DOLLHOUSE | "mode.dollhouse" |
| FLOORPLAN | "mode.floorplan" |
| INSIDE | "mode.inside" |
| OUTSIDE | "mode.outside" |
| TRANSITIONING | "mode.transitioning" |
TransitionType
TransitionType: enum
Transition types for camera movements. This is the canonical transition type enum.
Used for Mode.moveTo, Sweep.moveTo, Mattertag.navigateToTag, and other camera movement methods.
Note: not all values are supported, refer to per-method documentation for details.
| Member | Value |
|---|---|
| FADEOUT | "transition.fade" Fade to black transition |
| FLY | "transition.fly" Fly transition |
| INSTANT | "transition.instant" Instant transition |
| MOVEFADE | "transition.movefade" experimental Move with fade transition |
| ORBIT | "transition.orbit" experimental Orbit transition |
Observables
current
current: IObservable<Mode.Mode | null>
Bundle
Introduced 3.1.68.12-7-g858688944a
The current view mode.
mpSdk.Mode.current.subscribe(function (mode) {
// the view mode has changed
console.log('Current view mode is is ', mode);
});
transition
transition: IObservable<Mode.TransitionData>
Bundle
Introduced 3.1.68.12-7-g858688944a
An observable transition of the current viewmode. from and to will be null
if there is no active transition.
mpSdk.Mode.transition.subscribe(function (transition) {
// the transition has changed
console.log(transition.from, transition.to, transition.progress);
});
Methods
moveTo
Change the viewing mode in 3D Showcase.
const mode = mpSdk.Mode.Mode.FLOORPLAN;
const position = {x: 0, y: 0, z: 0};
const rotation = {x: -90, y: 0};
const transition = mpSdk.Camera.TransitionType.FLY;
const zoom = 5;
mpSdk.Mode.moveTo(mode, {
position: position,
rotation: rotation,
transition: transition,
zoom,
})
.then(function(nextMode){
// Move successful.
console.log('Arrived at new view mode ' + nextMode);
})
.catch(function(error){
// Error with moveTo command
});
Notes about transitions to Floorplan mode:
zoomoption is only taken into account in Floorplan transitions, the lower the number, the further the camera is zoomed in- The position of a floorplan view is determined by the X and Z arguments of the optional position object.
- The rotation of a floorplan view is determined by the X and Y of the optional rotation object, changing X changes the 'roll' of the view, similar to hitting the LEFT/RIGHT arrow keys in Showcase floorplan view, changing the Y value has no analog in showcase, but changes the 'tilt' of the view.
| Parameter | Type |
|---|---|
| mode | Mode.Mode The mode. |
| options? | Mode.MoveToModeOptions Options object, containing optional position, rotation, transition type |
Returns: Promise<Mode.Mode>
A promise that resolves with the new mode once the mode has transitioned.