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:
authorJacques Lucke <jacques@blender.org>2022-07-22 16:39:41 +0300
committerJacques Lucke <jacques@blender.org>2022-07-22 16:39:41 +0300
commit1f94b56d774440d08eb92f2a7a47b9a6a7aa7b84 (patch)
tree06928c94d524852c7031aa310d578691735dc0a8 /source/blender/blenlib
parent98bf714b37c1f1b05a162b6ffdaca367b312de1f (diff)
Curves: support sculpting on deformed curves
Previously, curves sculpt tools only worked on original data. This was very limiting, because one could effectively only sculpt the curves when all procedural effects were turned off. This patch adds support for curves sculpting while looking the result of procedural effects (like deformation based on the surface mesh). This functionality is also known as "crazy space" support in Blender. For more details see D15407. Differential Revision: https://developer.blender.org/D15407
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_kdopbvh.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h
index 8642d728909..17759b6a8ac 100644
--- a/source/blender/blenlib/BLI_kdopbvh.h
+++ b/source/blender/blenlib/BLI_kdopbvh.h
@@ -332,6 +332,29 @@ extern const float bvhtree_kdop_axes[13][3];
namespace blender {
+using BVHTree_RayCastCallback_CPP =
+ FunctionRef<void(int index, const BVHTreeRay &ray, BVHTreeRayHit &hit)>;
+
+inline void BLI_bvhtree_ray_cast_all_cpp(BVHTree &tree,
+ const float3 co,
+ const float3 dir,
+ float radius,
+ float hit_dist,
+ BVHTree_RayCastCallback_CPP fn)
+{
+ BLI_bvhtree_ray_cast_all(
+ &tree,
+ co,
+ dir,
+ radius,
+ hit_dist,
+ [](void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) {
+ BVHTree_RayCastCallback_CPP fn = *static_cast<BVHTree_RayCastCallback_CPP *>(userdata);
+ fn(index, *ray, *hit);
+ },
+ &fn);
+}
+
using BVHTree_RangeQuery_CPP = FunctionRef<void(int index, const float3 &co, float dist_sq)>;
inline void BLI_bvhtree_range_query_cpp(BVHTree &tree,