Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-02-05 02:29:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-05 02:29:19 +0300
commit2c84c23a074e315581f374c93039c2ebfa56a947 (patch)
tree0b92528be0f90152f45e7db40ece23b2554fbfe3 /source
parent40f2afcf1d271e14c196116d86ddee3569d41c0a (diff)
Fix T61163: Single sided images show when viewed from side
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/object.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 39972fa84c2..d8bc27fa596 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2608,15 +2608,16 @@ bool BKE_object_empty_image_is_visible_in_view3d(const Object *ob, const RegionV
char visibility_flag = ob->empty_image_visibility_flag;
if ((visibility_flag & (OB_EMPTY_IMAGE_HIDE_BACK | OB_EMPTY_IMAGE_HIDE_FRONT)) != 0) {
+ const float eps = 1e-5f;
/* TODO: this isn't correct with perspective projection. */
const float dot = dot_v3v3((float *)&ob->obmat[2], (float *)&rv3d->viewinv[2]);
if (visibility_flag & OB_EMPTY_IMAGE_HIDE_BACK) {
- if (dot < 0.0f) {
+ if (dot < eps) {
return false;
}
}
if (visibility_flag & OB_EMPTY_IMAGE_HIDE_FRONT) {
- if (dot > 0.0f) {
+ if (dot > -eps) {
return false;
}
}