aboutsummaryrefslogtreecommitdiff
path: root/tools/viz/survive_viewer.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/viz/survive_viewer.js')
-rw-r--r--tools/viz/survive_viewer.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/viz/survive_viewer.js b/tools/viz/survive_viewer.js
index 56ef47f..075e56a 100644
--- a/tools/viz/survive_viewer.js
+++ b/tools/viz/survive_viewer.js
@@ -49,6 +49,9 @@ function add_lighthouse(idx, p, q) {
}
function recolorTrackers(when) {
+ if(ctx == undefined)
+ return;
+
for (var key in angles) {
var colors = [];
@@ -143,7 +146,7 @@ function redrawCanvas(when) {
ang[0][1] < when[key] - visible_tolerance)
continue;
- var half_fov = 1.0472 * 2 / 5.;
+ var half_fov = 1.0472 * 2.;
var x = ang[0][0] / half_fov * canvas.width / 2 + canvas.width / 2;
var y = -ang[1][0] / half_fov * canvas.height / 2 + canvas.height / 2;
@@ -501,6 +504,6 @@ function animate() {
}
function render() {
- var use_fpv = $("#fpv")[0].checked;
+ var use_fpv = $("#fpv").length > 0 && $("#fpv")[0].checked;
renderer.render(scene, use_fpv ? fpv_camera : camera);
}