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>2013-09-07 16:59:16 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-09-07 16:59:16 +0400
commite492fad1308d5072a34abb3a90790a1106eea32b (patch)
tree808a4d3f78ff6051a44ccecfb927d2d6c46c9d60 /source/blender/blenkernel/intern/shrinkwrap.c
parent3da3c366442dce1b80e04fd753ffd50545787859 (diff)
shrink-wrap constraint, improve and remove some limitations.
- ability to change the space the axis is projected in (so you can choose worldspace or -space, was always local-space before). - support projecting on a negative axis, without this some very simple clamping is not possible if the direction happened not to be positive. - add distance limit (same as modifier), without this single meshes surrounding an object would make the constraint impossible to use in some cases (it would snap to the wrong side). note: this removes the ability to project on multiple axes at once but this option only added up directions and didnt project on multiple axes as you might expect.
Diffstat (limited to 'source/blender/blenkernel/intern/shrinkwrap.c')
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index b9843ad0619..9bc7f4b9e2b 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -198,10 +198,10 @@ static void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
* MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (front faces hits are ignored)
* MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (back faces hits are ignored)
*/
-int normal_projection_project_vertex(char options, const float vert[3], const float dir[3],
- const SpaceTransform *transf,
- BVHTree *tree, BVHTreeRayHit *hit,
- BVHTree_RayCastCallback callback, void *userdata)
+int BKE_shrinkwrap_project_normal(char options, const float vert[3],
+ const float dir[3], const SpaceTransform *transf,
+ BVHTree *tree, BVHTreeRayHit *hit,
+ BVHTree_RayCastCallback callback, void *userdata)
{
/* don't use this because this dist value could be incompatible
* this value used by the callback for comparing prev/new dist values.
@@ -368,14 +368,14 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
if (use_normal & MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR) {
if (auxData.tree) {
- normal_projection_project_vertex(0, tmp_co, tmp_no,
- &local2aux, auxData.tree, &hit,
- auxData.raycast_callback, &auxData);
+ BKE_shrinkwrap_project_normal(0, tmp_co, tmp_no,
+ &local2aux, auxData.tree, &hit,
+ auxData.raycast_callback, &auxData);
}
- normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, tmp_no,
- &calc->local2target, treeData.tree, &hit,
- treeData.raycast_callback, &treeData);
+ BKE_shrinkwrap_project_normal(calc->smd->shrinkOpts, tmp_co, tmp_no,
+ &calc->local2target, treeData.tree, &hit,
+ treeData.raycast_callback, &treeData);
}
/* Project over negative direction of axis */
@@ -384,14 +384,14 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
negate_v3_v3(inv_no, tmp_no);
if (auxData.tree) {
- normal_projection_project_vertex(0, tmp_co, inv_no,
- &local2aux, auxData.tree, &hit,
- auxData.raycast_callback, &auxData);
+ BKE_shrinkwrap_project_normal(0, tmp_co, inv_no,
+ &local2aux, auxData.tree, &hit,
+ auxData.raycast_callback, &auxData);
}
- normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, inv_no,
- &calc->local2target, treeData.tree, &hit,
- treeData.raycast_callback, &treeData);
+ BKE_shrinkwrap_project_normal(calc->smd->shrinkOpts, tmp_co, inv_no,
+ &calc->local2target, treeData.tree, &hit,
+ treeData.raycast_callback, &treeData);
}
/* don't set the initial dist (which is more efficient),