diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-04-19 09:15:29 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-04-19 09:15:29 (GMT) |
commit | 8101d4c77c6babf125dbe8d4a40f1b2a72a70376 (patch) | |
tree | 44d0b8f4409eb7fd20118fe4c1b3799fb9496377 /apps/samples/vrml/viewer.js | |
parent | 34a0e939c0e5b54e6de18b23d38e56ba327c5c24 (diff) | |
download | uscxml-8101d4c77c6babf125dbe8d4a40f1b2a72a70376.zip uscxml-8101d4c77c6babf125dbe8d4a40f1b2a72a70376.tar.gz uscxml-8101d4c77c6babf125dbe8d4a40f1b2a72a70376.tar.bz2 |
Reset controls when setting the pose
Diffstat (limited to 'apps/samples/vrml/viewer.js')
-rw-r--r-- | apps/samples/vrml/viewer.js | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/apps/samples/vrml/viewer.js b/apps/samples/vrml/viewer.js index 75b7b90..dedeb44 100644 --- a/apps/samples/vrml/viewer.js +++ b/apps/samples/vrml/viewer.js @@ -7,7 +7,8 @@ function VRMLViewer(element, params) { if (!VRMLViewer.instances) VRMLViewer.instances = 0; var instanceId = VRMLViewer.instances++; - + var batchChanges = false; + // public attributes this.pose = {}; this.pose.pitch = 0; @@ -325,7 +326,7 @@ function VRMLViewer(element, params) { // privileged public methods this.updateScene = function() { - if (self.imageURL) { + if (self.imageURL && !self.batchChanges) { self.imgElem.src = self.imageURL + '?width=' + self.pose.width + '&height=' + self.pose.height + @@ -341,8 +342,8 @@ function VRMLViewer(element, params) { } this.refreshServer = function(server) { - serverURL = server; - self.localStorage.put("vrmlServer", serverURL, null); + self.serverURL = server; + self.localStorage.put("vrmlServer", self.serverURL, null); self.xhr.get({ // The URL to request url: server, @@ -365,6 +366,23 @@ function VRMLViewer(element, params) { }); } + this.setPose = function(imageURL, pose) { + self.imageURL = imageURL; + self.pose = pose; + + self.batchChanges = true; +// self.fileList.set('item', imageURL); + self.xSpinner.set('value',pose.x); + self.ySpinner.set('value',pose.y); + self.zSpinner.set('value',pose.z); + self.pitchSlide.attr('value',pose.pitch); + self.rollSlide.attr('value',pose.roll); + self.yawSlide.attr('value',pose.yaw); + self.zoomSlide.attr('value',pose.zoom); + self.batchChanges = false; + updateScene(); + } + /* view = "normal"; // if (params.view == "maximized") { |