diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-08-13 07:56:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-08-13 07:56:53 +0400 |
commit | 3e90d7971adf2ca16790c34520b8d98c0ff85ef8 (patch) | |
tree | ef00fc4137171ff0807f6237fc41e08389a323d2 /source/blender/editors | |
parent | 7c9b8aa6ccb83b92ec8f42594348263e6ff638aa (diff) |
Knife tool: avoid copying vectors
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 7524ef37b18..b14c59f7079 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1088,7 +1088,7 @@ static bool knife_ray_intersect_face(KnifeTool_OpData *kcd, float intersectp[3]) { int tottri, tri_i; - float lv1[3], lv2[3], lv3[3], raydir[3]; + float raydir[3]; float tri_norm[3], tri_plane[4]; float se1[2], se2[2]; float d, lambda; @@ -1104,12 +1104,14 @@ static bool knife_ray_intersect_face(KnifeTool_OpData *kcd, BLI_assert(tri_i >= 0 && tri_i < tottri); for (; tri_i < tottri; tri_i++) { + const float *lv1, *lv2, *lv3; + tri = kcd->em->looptris[tri_i]; if (tri[0]->f != f) break; - copy_v3_v3(lv1, kcd->cagecos[BM_elem_index_get(tri[0]->v)]); - copy_v3_v3(lv2, kcd->cagecos[BM_elem_index_get(tri[1]->v)]); - copy_v3_v3(lv3, kcd->cagecos[BM_elem_index_get(tri[2]->v)]); + lv1 = kcd->cagecos[BM_elem_index_get(tri[0]->v)]; + lv2 = kcd->cagecos[BM_elem_index_get(tri[1]->v)]; + lv3 = kcd->cagecos[BM_elem_index_get(tri[2]->v)]; /* using epsilon test in case ray is directly through an internal * tesselation edge and might not hit either tesselation tri with * an exact test; |