summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-03-02 00:23:11 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-03-02 00:23:11 +0100
commitf5ce4029d6f5c0659eba8dedbd5238527867460b (patch)
treef7df2f38352a7683f63964f329d103d30927fcc7 /tracker-pt
parente842451d8e8f77f2ab2b4537d4619611b61c8c48 (diff)
tracker/pt: avoid float division by zero
Diffstat (limited to 'tracker-pt')
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp
index c3b6c6e3..3854e531 100644
--- a/tracker-pt/ftnoir_tracker_pt.cpp
+++ b/tracker-pt/ftnoir_tracker_pt.cpp
@@ -101,7 +101,8 @@ void Tracker_PT::run()
Affine X_GH = X_CM * X_MH;
vec3 p = X_GH.t; // head (center?) position in global space
- preview_frame->draw_head_center((p[0] * fx) / p[2], (p[1] * fx) / p[2]);
+ if (p[2] > f(.1))
+ preview_frame->draw_head_center((p[0] * fx) / p[2], (p[1] * fx) / p[2]);
widget->update_image(preview_frame->get_bitmap());
{