From 9224b6e2ce9747f09d154be2117a43f0d14511ac Mon Sep 17 00:00:00 2001 From: Justin Berger Date: Mon, 7 May 2018 10:39:01 -0600 Subject: Added basic checks for using viz tool as library --- tools/viz/survive_viewer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools/viz/survive_viewer.js') diff --git a/tools/viz/survive_viewer.js b/tools/viz/survive_viewer.js index 56ef47f..cbd4fce 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 = []; @@ -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); } -- cgit v1.2.3 From fcf3528bfeba5e4646dbb0626a87c297d940a787 Mon Sep 17 00:00:00 2001 From: Justin Berger Date: Thu, 7 Jun 2018 23:42:05 -0600 Subject: Added debug message to ootx; mag reading to playback --- tools/viz/survive_viewer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/viz/survive_viewer.js') diff --git a/tools/viz/survive_viewer.js b/tools/viz/survive_viewer.js index cbd4fce..075e56a 100644 --- a/tools/viz/survive_viewer.js +++ b/tools/viz/survive_viewer.js @@ -146,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; -- cgit v1.2.3