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:
authorPablo Dobarro <pablodp606@gmail.com>2020-02-28 16:40:40 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-02-28 19:03:20 +0300
commit4a373afa5fb8f9eab92314fac1b140b7803f30fe (patch)
treeb546d18088f5c61441e770eae4e8c6e12a4d3ed9 /source/blender/blenkernel/BKE_paint.h
parent793135e190c7450d30451617e9b8ae2d5ecec94a (diff)
Sculpt: Cloth brush
This brush has a simple physics solver that helps when sculpting cloth. - The mass and the damping properties of the simulation are properties of the brush. - It has two additional radius control to limit the influence and falloff of the simulation. - Masked vertices are pinned in the simulation, and it applies the sculpt gravity directly in the solver. - The Cloth Brush has 7 deformation modes with 2 falloff types (radial and plane). The brush can create the constraints only on the required PBVH nodes, so the simulation is isolated on high poly meshes. As long as the brush size is not too big it should be possible to keep it real time. Known issues: - The way constraints are created is extremely basic and it creates repeated constraints. Maybe there is another way to create fewer constraints while keeping the simulation quality decent. This part can also be multithreaded. (As it is it works ok, but it could be better) Reviewed By: jbakker Differential Revision: https://developer.blender.org/D6715
Diffstat (limited to 'source/blender/blenkernel/BKE_paint.h')
-rw-r--r--source/blender/blenkernel/BKE_paint.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index 28e564f0fe2..4c274804a07 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -245,6 +245,31 @@ typedef struct SculptPoseIKChain {
int tot_segments;
} SculptPoseIKChain;
+/* Cloth Brush */
+
+typedef struct SculptClothLengthConstraint {
+ int v1;
+ int v2;
+
+ float length;
+} SculptClothLengthConstraint;
+
+typedef struct SculptClothSimulation {
+ SculptClothLengthConstraint *length_constraints;
+ int tot_length_constraints;
+ int capacity_length_constraints;
+ float *length_constraint_tweak;
+
+ float mass;
+ float damping;
+
+ float (*acceleration)[3];
+ float (*pos)[3];
+ float (*init_pos)[3];
+ float (*prev_pos)[3];
+
+} SculptClothSimulation;
+
/* Session data (mode-specific) */
typedef struct SculptSession {
@@ -298,6 +323,7 @@ typedef struct SculptSession {
float cursor_radius;
float cursor_location[3];
float cursor_normal[3];
+ float cursor_sampled_normal[3];
float cursor_view_normal[3];
/* TODO(jbakker): Replace rv3d adn v3d with ViewContext */