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:
authorAlexander Gavrilov <angavrilov@gmail.com>2018-07-07 18:39:45 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-09-26 16:52:58 +0300
commit3378782eeeb55a6ed64dba479e37f8b98fab63b1 (patch)
tree1ae6e8fd713d4c7b22a05a4024f2f7dbc09efe2b /source/blender/blenkernel/BKE_shrinkwrap.h
parent310f1b057926d6250adf11db6621f2606b61827f (diff)
Implement additional modes for Shrinkwrap to a surface.
In addition to the original map to surface and Keep Above Surface, add modes that only affect vertices that are inside or outside the object. This is inspired by the Limit Distance constraint, and can be useful for crude collision detection in rigs. The inside/outside test works based on face normals and may not be completely reliable near 90 degree or sharper angles in the target. Reviewers: campbellbarton, mont29 Differential Revision: https://developer.blender.org/D3717
Diffstat (limited to 'source/blender/blenkernel/BKE_shrinkwrap.h')
-rw-r--r--source/blender/blenkernel/BKE_shrinkwrap.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h
index d4df12783fa..40f3808b94b 100644
--- a/source/blender/blenkernel/BKE_shrinkwrap.h
+++ b/source/blender/blenkernel/BKE_shrinkwrap.h
@@ -94,6 +94,11 @@ bool BKE_shrinkwrap_project_normal(
const struct SpaceTransform *transf, BVHTree *tree, BVHTreeRayHit *hit,
BVHTree_RayCastCallback callback, void *userdata);
+/* Apply the shrink to surface modes to the given original coordinates and nearest point. */
+void BKE_shrinkwrap_snap_point_to_surface(
+ int mode, const float hit_co[3], const float hit_no[3], float goal_dist,
+ const float point_co[3], float r_point_co[3]);
+
/*
* NULL initializers to local data
*/