aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJustin Berger <j.david.berger@gmail.com>2018-05-07 10:39:01 -0600
committerJustin Berger <j.david.berger@gmail.com>2018-05-07 10:39:01 -0600
commit9224b6e2ce9747f09d154be2117a43f0d14511ac (patch)
tree9775cde50e6de5ffa1a0c590efc5f7ebdadc058b /tools
parent0cb304caa5311e5cd59ab89ec6ff129b65423f8c (diff)
downloadlibsurvive-9224b6e2ce9747f09d154be2117a43f0d14511ac.tar.gz
libsurvive-9224b6e2ce9747f09d154be2117a43f0d14511ac.tar.bz2
Added basic checks for using viz tool as library
Diffstat (limited to 'tools')
-rw-r--r--tools/viz/survive_viewer.js5
1 files changed, 4 insertions, 1 deletions
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);
}