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
diff options
context:
space:
mode:
authorDaniel Genrich <daniel.genrich@gmx.net>2012-05-30 16:53:13 +0400
committerDaniel Genrich <daniel.genrich@gmx.net>2012-05-30 16:53:13 +0400
commitbe21080cb66194c3ccfe5a6b3ca9853b2b9601de (patch)
tree5fd5de4669e614da9099410f8bf4c3f264d1daac /source/blender/blenkernel/intern
parent8ae1f3881263a92e58872b78418230297c70a76a (diff)
Provide ray hit/nearest information on which side of the quad the ray hit.
Patch by MiikaH.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index 24583c124e6..752bdab2c00 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -383,6 +383,9 @@ static void mesh_faces_nearest_point(void *userdata, int index, const float co[3
nearest->dist = dist;
copy_v3_v3(nearest->co, nearest_tmp);
normal_tri_v3(nearest->no, t0, t1, t2);
+
+ if (t1 == vert[face->v3].co)
+ nearest->flags |= BVH_ONQUAD;
}
t1 = t2;
@@ -420,6 +423,9 @@ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *r
madd_v3_v3v3fl(hit->co, ray->origin, ray->direction, dist);
normal_tri_v3(hit->no, t0, t1, t2);
+
+ if (t1 == vert[face->v3].co)
+ hit->flags |= BVH_ONQUAD;
}
t1 = t2;