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(-) 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