diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-07-04 12:22:15 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-07-04 12:33:27 +0300 |
commit | 769c57b38a707397ac7fdda15b1deb561194b66c (patch) | |
tree | c618131eb63627c5a353c8ba1437c359b72ddbad /source/blender/makesdna/DNA_object_force_types.h | |
parent | 9e4d667c2cfd4a81f9a69628b69facd8fd4e0a01 (diff) |
SoftBody: share point cache between CoW copies
This is the same approach as 98a0bcd4252e952fa5438e9d1b69b0204f8a8746
applied to soft body simulation. In short, CoW copies share the point cache,
and treat it as read-only except when the depsgraph is active.
Diffstat (limited to 'source/blender/makesdna/DNA_object_force_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_object_force_types.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_object_force_types.h b/source/blender/makesdna/DNA_object_force_types.h index ac7c969a810..3538abcff1a 100644 --- a/source/blender/makesdna/DNA_object_force_types.h +++ b/source/blender/makesdna/DNA_object_force_types.h @@ -37,6 +37,7 @@ extern "C" { #endif #include "DNA_listBase.h" +#include "DNA_defs.h" /* pd->forcefield: Effector Fields types */ typedef enum ePFieldType { @@ -218,6 +219,15 @@ typedef struct SBVertex { float vec[4]; } SBVertex; +/* Container for data that is shared among CoW copies. + * + * This is placed in a separate struct so that values can be changed + * without having to update all CoW copies. */ +typedef struct SoftBody_Shared { + struct PointCache *pointcache; + struct ListBase ptcaches; +} SoftBody_Shared; + typedef struct SoftBody { /* dynamic data */ int totpoint, totspring; @@ -289,8 +299,9 @@ typedef struct SoftBody { float shearstiff; float inpush; - struct PointCache *pointcache; - struct ListBase ptcaches; + struct SoftBody_Shared *shared; + struct PointCache *pointcache DNA_DEPRECATED; /* Moved to SoftBody_Shared */ + struct ListBase ptcaches DNA_DEPRECATED; /* Moved to SoftBody_Shared */ struct Collection *collision_group; |