diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-08-01 18:28:31 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-08-01 18:31:06 +0400 |
commit | 3c9e11df37581c6faf937bbe974710a7fc95e380 (patch) | |
tree | bf58ba8f6f6273d65e3903b31babe3f71ddf1290 /source/blender/modifiers/intern | |
parent | c11777b2113276a8376b0e0775f8a1e5220c1dff (diff) |
Cleanup: Move SpaceTransform helpers from `BKE_shrinkwrap` to `BLI_math_matrix`.
Diffstat (limited to 'source/blender/modifiers/intern')
-rw-r--r-- | source/blender/modifiers/intern/MOD_shrinkwrap.c | 1 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_simpledeform.c | 11 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvgproximity.c | 17 |
3 files changed, 15 insertions, 14 deletions
diff --git a/source/blender/modifiers/intern/MOD_shrinkwrap.c b/source/blender/modifiers/intern/MOD_shrinkwrap.c index eebb687aa8d..229f4911ab4 100644 --- a/source/blender/modifiers/intern/MOD_shrinkwrap.c +++ b/source/blender/modifiers/intern/MOD_shrinkwrap.c @@ -37,6 +37,7 @@ #include "DNA_object_types.h" +#include "BLI_math.h" #include "BLI_string.h" #include "BLI_utildefines.h" diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c index ccba2097264..3314196b776 100644 --- a/source/blender/modifiers/intern/MOD_simpledeform.c +++ b/source/blender/modifiers/intern/MOD_simpledeform.c @@ -42,7 +42,6 @@ #include "BKE_cdderivedmesh.h" #include "BKE_modifier.h" #include "BKE_deform.h" -#include "BKE_shrinkwrap.h" #include "depsgraph_private.h" @@ -166,7 +165,7 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object /* Calculate matrixs do convert between coordinate spaces */ if (smd->origin) { transf = &tmp_transf; - space_transform_from_matrixs(transf, ob->obmat, smd->origin->obmat); + BLI_SPACE_TRANSFORM_SETUP(transf, ob, smd->origin); } /* Setup vars, @@ -182,7 +181,9 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object float tmp[3]; copy_v3_v3(tmp, vertexCos[i]); - if (transf) space_transform_apply(transf, tmp); + if (transf) { + BLI_space_transform_apply(transf, tmp); + } lower = min_ff(lower, tmp[limit_axis]); upper = max_ff(upper, tmp[limit_axis]); @@ -220,7 +221,7 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object float co[3], dcut[3] = {0.0f, 0.0f, 0.0f}; if (transf) { - space_transform_apply(transf, vertexCos[i]); + BLI_space_transform_apply(transf, vertexCos[i]); } copy_v3_v3(co, vertexCos[i]); @@ -236,7 +237,7 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object interp_v3_v3v3(vertexCos[i], vertexCos[i], co, weight); /* Use vertex weight has coef of linear interpolation */ if (transf) { - space_transform_invert(transf, vertexCos[i]); + BLI_space_transform_invert(transf, vertexCos[i]); } } } diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index 06b29d15f2e..010fe1d5a29 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -43,7 +43,6 @@ #include "BKE_deform.h" #include "BKE_library.h" #include "BKE_modifier.h" -#include "BKE_shrinkwrap.h" /* For SpaceTransform stuff. */ #include "BKE_texture.h" /* Texture masking. */ #include "depsgraph_private.h" @@ -73,12 +72,12 @@ static void get_vert2geom_distance(int numVerts, float (*v_cos)[3], DerivedMesh *target, const SpaceTransform *loc2trgt) { int i; - BVHTreeFromMesh treeData_v = NULL_BVHTreeFromMesh; - BVHTreeFromMesh treeData_e = NULL_BVHTreeFromMesh; - BVHTreeFromMesh treeData_f = NULL_BVHTreeFromMesh; - BVHTreeNearest nearest_v = NULL_BVHTreeNearest; - BVHTreeNearest nearest_e = NULL_BVHTreeNearest; - BVHTreeNearest nearest_f = NULL_BVHTreeNearest; + BVHTreeFromMesh treeData_v = {0}; + BVHTreeFromMesh treeData_e = {0}; + BVHTreeFromMesh treeData_f = {0}; + BVHTreeNearest nearest_v = {0}; + BVHTreeNearest nearest_e = {0}; + BVHTreeNearest nearest_f = {0}; if (dist_v) { /* Create a bvh-tree of the given target's verts. */ @@ -120,7 +119,7 @@ static void get_vert2geom_distance(int numVerts, float (*v_cos)[3], /* Convert the vertex to tree coordinates. */ copy_v3_v3(tmp_co, v_cos[i]); - space_transform_apply(loc2trgt, tmp_co); + BLI_space_transform_apply(loc2trgt, tmp_co); /* Use local proximity heuristics (to reduce the nearest search). * @@ -484,7 +483,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der float *dists_e = use_trgt_edges ? MEM_mallocN(sizeof(float) * numIdx, "dists_e") : NULL; float *dists_f = use_trgt_faces ? MEM_mallocN(sizeof(float) * numIdx, "dists_f") : NULL; - SPACE_TRANSFORM_SETUP(&loc2trgt, ob, obr); + BLI_SPACE_TRANSFORM_SETUP(&loc2trgt, ob, obr); get_vert2geom_distance(numIdx, v_cos, dists_v, dists_e, dists_f, target_dm, &loc2trgt); for (i = 0; i < numIdx; i++) { |