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:
authorCampbell Barton <ideasman42@gmail.com>2015-07-16 21:15:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-07-16 21:15:24 +0300
commit9d090c4717f349e027cd68bcdcbd3e54639b6757 (patch)
tree8b92c3a4964f893d3b0585342a9209d66a4dfc33 /source/blender/blenkernel/intern/pbvh_bmesh.c
parent595a491e63d6f3f3462675d38cfa71b4e784fe9c (diff)
Split ray_face_intersection into quad/tri versions
Since many callers only need a single triangle
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh_bmesh.c')
-rw-r--r--source/blender/blenkernel/intern/pbvh_bmesh.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 9f092bd651f..3e236079a66 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -1358,11 +1358,12 @@ bool pbvh_bmesh_node_raycast(
int i;
for (i = 0; i < node->bm_tot_ortri; i++) {
const int *t = node->bm_ortri[i];
- hit |= ray_face_intersection(ray_start, ray_normal,
- node->bm_orco[t[0]],
- node->bm_orco[t[1]],
- node->bm_orco[t[2]],
- NULL, dist);
+ hit |= ray_face_intersection_tri(
+ ray_start, ray_normal,
+ node->bm_orco[t[0]],
+ node->bm_orco[t[1]],
+ node->bm_orco[t[2]],
+ dist);
}
}
else {
@@ -1376,11 +1377,12 @@ bool pbvh_bmesh_node_raycast(
BMVert *v_tri[3];
BM_face_as_array_vert_tri(f, v_tri);
- hit |= ray_face_intersection(ray_start, ray_normal,
- v_tri[0]->co,
- v_tri[1]->co,
- v_tri[2]->co,
- NULL, dist);
+ hit |= ray_face_intersection_tri(
+ ray_start, ray_normal,
+ v_tri[0]->co,
+ v_tri[1]->co,
+ v_tri[2]->co,
+ dist);
}
}
}
@@ -1391,7 +1393,7 @@ bool pbvh_bmesh_node_raycast(
bool BKE_pbvh_bmesh_node_raycast_detail(
PBVHNode *node,
const float ray_start[3], const float ray_normal[3],
- float *detail, float *dist)
+ float *dist, float *r_detail)
{
GSetIterator gs_iter;
bool hit = false;
@@ -1408,12 +1410,12 @@ bool BKE_pbvh_bmesh_node_raycast_detail(
BMVert *v_tri[3];
bool hit_local;
BM_face_as_array_vert_tri(f, v_tri);
- hit_local = ray_face_intersection(
+ hit_local = ray_face_intersection_tri(
ray_start, ray_normal,
v_tri[0]->co,
v_tri[1]->co,
v_tri[2]->co,
- NULL, dist);
+ dist);
if (hit_local) {
f_hit = f;
@@ -1431,7 +1433,7 @@ bool BKE_pbvh_bmesh_node_raycast_detail(
len3 = len_squared_v3v3(v_tri[2]->co, v_tri[0]->co);
/* detail returned will be set to the maximum allowed size, so take max here */
- *detail = sqrtf(max_fff(len1, len2, len3));
+ *r_detail = sqrtf(max_fff(len1, len2, len3));
}
return hit;