diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-07-23 06:20:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-07-23 07:41:09 +0300 |
commit | 60822ec183a514f38f478ec3f3a167f59865f027 (patch) | |
tree | bd8187627cc1c304f96352e4eb1e121c93e0b898 /source | |
parent | 717046ad2a41c5b7d23313c77eca6ffc9f7b8762 (diff) |
Use looptri for BVH raycast (simple cases)
Diffstat (limited to 'source')
5 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 4f086437c50..be466c29a12 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -3438,7 +3438,7 @@ static void shrinkwrap_get_tarmat(bConstraint *con, bConstraintOb *cob, bConstra if (scon->shrinkType == MOD_SHRINKWRAP_NEAREST_VERTEX) bvhtree_from_mesh_verts(&treeData, target, 0.0, 2, 6); else - bvhtree_from_mesh_faces(&treeData, target, 0.0, 2, 6); + bvhtree_from_mesh_looptri(&treeData, target, 0.0, 2, 6); if (treeData.tree == NULL) { fail = true; @@ -3490,7 +3490,7 @@ static void shrinkwrap_get_tarmat(bConstraint *con, bConstraintOb *cob, bConstra break; } - bvhtree_from_mesh_faces(&treeData, target, scon->dist, 4, 6); + bvhtree_from_mesh_looptri(&treeData, target, scon->dist, 4, 6); if (treeData.tree == NULL) { fail = true; break; @@ -4107,7 +4107,7 @@ static void followtrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase sub_v3_v3v3(ray_nor, ray_end, ray_start); - bvhtree_from_mesh_faces(&treeData, target, 0.0f, 4, 6); + bvhtree_from_mesh_looptri(&treeData, target, 0.0f, 4, 6); hit.dist = FLT_MAX; hit.index = -1; diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 2ff81cd5394..5ecd2fc74e8 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -279,8 +279,8 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc, bool for } /* After sucessufuly build the trees, start projection vertexs */ - if (bvhtree_from_mesh_faces(&treeData, calc->target, 0.0, 4, 6) && - (auxMesh == NULL || bvhtree_from_mesh_faces(&auxData, auxMesh, 0.0, 4, 6))) + if (bvhtree_from_mesh_looptri(&treeData, calc->target, 0.0, 4, 6) && + (auxMesh == NULL || bvhtree_from_mesh_looptri(&auxData, auxMesh, 0.0, 4, 6))) { #ifndef __APPLE__ @@ -381,7 +381,7 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) BVHTreeNearest nearest = NULL_BVHTreeNearest; /* Create a bvh-tree of the given target */ - bvhtree_from_mesh_faces(&treeData, calc->target, 0.0, 2, 6); + bvhtree_from_mesh_looptri(&treeData, calc->target, 0.0, 2, 6); if (treeData.tree == NULL) { OUT_OF_MEMORY(); return; diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index d1cd33b5949..3b488fde2b3 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -1533,7 +1533,7 @@ static bool snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMes len_diff = 0.0f; /* In case BVHTree would fail for some reason... */ treeData.em_evil = em; - bvhtree_from_mesh_faces(&treeData, dm, 0.0f, 2, 6); + bvhtree_from_mesh_looptri(&treeData, dm, 0.0f, 2, 6); if (treeData.tree != NULL) { nearest.index = -1; nearest.dist_sq = FLT_MAX; @@ -1575,7 +1575,7 @@ static bool snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMes } treeData.em_evil = em; - bvhtree_from_mesh_faces(&treeData, dm, 0.0f, 4, 6); + bvhtree_from_mesh_looptri(&treeData, dm, 0.0f, 4, 6); hit.index = -1; hit.dist = *r_depth; diff --git a/source/blender/modifiers/intern/MOD_surface.c b/source/blender/modifiers/intern/MOD_surface.c index 3d998f2d95a..abb652c3ea5 100644 --- a/source/blender/modifiers/intern/MOD_surface.c +++ b/source/blender/modifiers/intern/MOD_surface.c @@ -159,7 +159,7 @@ static void deformVerts(ModifierData *md, Object *ob, surmd->bvhtree = MEM_callocN(sizeof(BVHTreeFromMesh), "BVHTreeFromMesh"); if (surmd->dm->getNumTessFaces(surmd->dm)) - bvhtree_from_mesh_faces(surmd->bvhtree, surmd->dm, 0.0, 2, 6); + bvhtree_from_mesh_looptri(surmd->bvhtree, surmd->dm, 0.0, 2, 6); else bvhtree_from_mesh_edges(surmd->bvhtree, surmd->dm, 0.0, 2, 6); } diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index 8d71ddfceaf..08d7d77c74e 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -98,7 +98,7 @@ static void get_vert2geom_distance(int numVerts, float (*v_cos)[3], } if (dist_f) { /* Create a bvh-tree of the given target's faces. */ - bvhtree_from_mesh_faces(&treeData_f, target, 0.0, 2, 6); + bvhtree_from_mesh_looptri(&treeData_f, target, 0.0, 2, 6); if (treeData_f.tree == NULL) { OUT_OF_MEMORY(); return; |