diff options
author | cnlohr <lohr85@gmail.com> | 2018-06-23 12:11:33 -0400 |
---|---|---|
committer | cnlohr <lohr85@gmail.com> | 2018-06-23 12:11:33 -0400 |
commit | 9291b950c5508513ea261059229e19760c050a47 (patch) | |
tree | 2cb0217e67896382c3bc395ad91d438c779a32cf /tools | |
parent | 86bbd12c3889db3290e22ff61934ca1a218ce114 (diff) | |
parent | 87b6229f6fc4e434b9472e6c7722e40497ac97a1 (diff) | |
download | libsurvive-9291b950c5508513ea261059229e19760c050a47.tar.gz libsurvive-9291b950c5508513ea261059229e19760c050a47.tar.bz2 |
Merge branch 'master' into new_config_system
Diffstat (limited to 'tools')
-rw-r--r-- | tools/viz/survive_viewer.js | 7 |
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); } |