Index: chrome/browser/resources/vr_shell/vr_shell_ui_scene.js |
diff --git a/chrome/browser/resources/vr_shell/vr_shell_ui_scene.js b/chrome/browser/resources/vr_shell/vr_shell_ui_scene.js |
index 4ed691a93cc894c83b28809237952bf18e246741..1b9c1f59aa5e6f14390edd98f01b3267d1ade599 100644 |
--- a/chrome/browser/resources/vr_shell/vr_shell_ui_scene.js |
+++ b/chrome/browser/resources/vr_shell/vr_shell_ui_scene.js |
@@ -130,23 +130,50 @@ scene.Scene = class { |
} |
/** |
- * Set the background color of the scene. |
cjgrant
2017/03/16 15:44:37
Dropping comments as these are direct wrappers on
tiborg
2017/03/16 19:40:23
Acknowledged.
|
+ * Configure scene parameters. |
+ * @param {api.SceneConfiguration} configuration |
+ */ |
+ configureScene(configuration) { |
+ this.commands.push({ |
+ 'type': api.Command.CONFIGURE_SCENE, |
+ 'data': configuration.getCommandPayload(), |
+ }); |
+ } |
+ |
+ /** |
* @param {{r: number, b: number, g: number, a: number}} color |
*/ |
setBackgroundColor(color) { |
- this.commands.push( |
- {'type': api.Command.UPDATE_BACKGROUND, 'data': {'color': color}}); |
+ let configuration = new api.SceneConfiguration(); |
+ configuration.setBackgroundColor(color); |
+ this.configureScene(configuration); |
} |
/** |
- * Set the radius of background-bounding sphere. |
* @param {number} distance |
*/ |
setBackgroundDistance(distance) { |
- this.commands.push({ |
- 'type': api.Command.UPDATE_BACKGROUND, |
- 'data': {'distance': distance} |
- }); |
+ let configuration = new api.SceneConfiguration(); |
+ configuration.setBackgroundDistance(distance); |
+ this.configureScene(configuration); |
+ } |
+ |
+ /** |
+ * @param {boolean} enabled |
+ */ |
+ setCursorEnabled(enabled) { |
+ let configuration = new api.SceneConfiguration(); |
+ configuration.setCursorEnabled(enabled); |
+ this.configureScene(configuration); |
+ } |
+ |
+ /** |
+ * @param {boolean} enabled |
+ */ |
+ setWebVrRenderingEnabled(enabled) { |
+ let configuration = new api.SceneConfiguration(); |
+ configuration.setWebVrRenderingEnabled(enabled); |
+ this.configureScene(configuration); |
} |
/** |