Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(704)

Side by Side Diff: chrome/browser/resources/vr_shell/vr_shell_ui_scene.js

Issue 2698623007: Change how the VR reticle distance is determined. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var scene = {}; 5 var scene = {};
6 6
7 /** 7 /**
8 * The scene class assists in managing element and animations in the UI. It 8 * The scene class assists in managing element and animations in the UI. It
9 * allows UI update API commands to be queued in batches, and manages allocation 9 * allows UI update API commands to be queued in batches, and manages allocation
10 * of element and animation IDs. 10 * of element and animation IDs.
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 */ 122 */
123 removeAnimation(id) { 123 removeAnimation(id) {
124 // To-do: Make sure ID exists. 124 // To-do: Make sure ID exists.
125 this.commands.push({ 125 this.commands.push({
126 'type': api.Command.REMOVE_ANIMATION, 126 'type': api.Command.REMOVE_ANIMATION,
127 'data': {'id': id, 'meshId': this.animations[id]} 127 'data': {'id': id, 'meshId': this.animations[id]}
128 }); 128 });
129 delete this.animations[id]; 129 delete this.animations[id];
130 } 130 }
131 131
132 /**
133 * Set the background color of the scene.
134 * @param {{r: number, b: number, g: number, a: number}} color
cjgrant 2017/02/16 22:53:39 Note that this works, for future reference. If th
135 */
132 setBackgroundColor(color) { 136 setBackgroundColor(color) {
133 this.commands.push( 137 this.commands.push(
134 {'type': api.Command.UPDATE_BACKGROUND, 'data': {'color': color}}); 138 {'type': api.Command.UPDATE_BACKGROUND, 'data': {'color': color}});
135 } 139 }
136 140
137 /** 141 /**
142 * Set the radius of background-bounding sphere.
143 * @param {number} distance
144 */
145 setBackgroundDistance(distance) {
146 this.commands.push({
147 'type': api.Command.UPDATE_BACKGROUND,
148 'data': {'distance': distance}
149 });
150 }
151 /**
138 * Purge all elements in the scene. 152 * Purge all elements in the scene.
139 */ 153 */
140 purge() { 154 purge() {
141 var ids = Object.keys(this.animations); 155 var ids = Object.keys(this.animations);
142 for (let id_key of ids) { 156 for (let id_key of ids) {
143 var id = parseInt(id_key, 10); 157 var id = parseInt(id_key, 10);
144 this.removeAnimation(id); 158 this.removeAnimation(id);
145 } 159 }
146 var ids = this.elements.values(); 160 var ids = this.elements.values();
147 for (let id of ids) { 161 for (let id of ids) {
148 this.removeElement(id); 162 this.removeElement(id);
149 } 163 }
150 this.flush(); 164 this.flush();
151 } 165 }
152 }; 166 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698