From f6cefbef22c8c6583b4927c179dabac3eb57aa22 Mon Sep 17 00:00:00 2001 From: Sebastian Parborg Date: Wed, 27 Nov 2019 14:56:16 +0100 Subject: Fix T30941: Add cloth air pressure simulation This adds some basic simulation of internal air pressure inside of closed cloth mesh objects. Reviewed By: Jacques Lucke Differential Revision: http://developer.blender.org/D5473 --- source/blender/blenkernel/BKE_cloth.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/BKE_cloth.h') diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h index 01f94c39215..0543021afef 100644 --- a/source/blender/blenkernel/BKE_cloth.h +++ b/source/blender/blenkernel/BKE_cloth.h @@ -87,7 +87,8 @@ typedef struct Cloth { struct MVertTri *tri; struct Implicit_Data *implicit; /* our implicit solver connects to this pointer */ struct EdgeSet *edgeset; /* used for selfcollisions */ - int last_frame, pad4; + int last_frame; + float initial_mesh_volume; /* Initial volume of the mesh. Used for pressure */ } Cloth; /** @@ -192,6 +193,10 @@ typedef enum { CLOTH_SIMSETTINGS_FLAG_GOAL = (1 << 3), /** True if tearing is enabled. */ CLOTH_SIMSETTINGS_FLAG_TEARING = (1 << 4), + /** True if pressure sim is enabled. */ + CLOTH_SIMSETTINGS_FLAG_PRESSURE = (1 << 5), + /** Use the user defined target volume. */ + CLOTH_SIMSETTINGS_FLAG_PRESSURE_VOL = (1 << 6), /** DEPRECATED, for versioning only. */ CLOTH_SIMSETTINGS_FLAG_SCALING = (1 << 8), /** Edit cache in edit-mode. */ -- cgit v1.2.3