From 675700d94892832b264f8b37d3d907c527a83cf5 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Wed, 29 Jul 2020 17:39:08 +0200 Subject: Sculpt: Cloth Brush/Filter Collisions This implements collisions in the solver of the cloth brush/filter. It uses the scene colliders as a regular physics simulation. There are still some parameters (friction, distance to the surface...) that can be exposed as properties in later patches. Thanks to Sebastian Parborg for helping me with the implementation. Reviewed By: sergey, zeddb Differential Revision: https://developer.blender.org/D8019 --- source/blender/blenkernel/BKE_paint.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/blenkernel/BKE_paint.h') diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index e2b8a4d72e6..d5b09cff293 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -42,6 +42,7 @@ struct EdgeSet; struct GHash; struct GridPaintMask; struct ImagePool; +struct ListBase; struct MLoop; struct MLoopTri; struct MVert; @@ -295,7 +296,9 @@ typedef struct SculptClothSimulation { float (*pos)[3]; float (*init_pos)[3]; float (*prev_pos)[3]; + float (*last_iteration_pos)[3]; + struct ListBase *collider_list; } SculptClothSimulation; typedef struct SculptPersistentBase { @@ -333,6 +336,9 @@ typedef struct SculptSession { int level; } multires; + /* Depsgraph for the Cloth Brush solver to get the colliders. */ + struct Depsgraph *depsgraph; + /* These are always assigned to base mesh data when using PBVH_FACES and PBVH_GRIDS. */ struct MVert *mvert; struct MPoly *mpoly; -- cgit v1.2.3