diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-08-30 19:54:36 +0400 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-01-20 11:29:56 +0300 |
commit | d8cf12fe5a18309e968ffc3b326d70554013b5a7 (patch) | |
tree | c9ec99742901601a9cd5cccf62b4c8d2291813ed /source/blender/modifiers/intern/MOD_cloth.c | |
parent | 5a43e8493e3851d076365dc106e0fa18ab21eebe (diff) |
Debug drawing for simulations, to aid in visualizing abstract data such
as forces, velocities, contact points etc.
This uses a hash table to store debug elements (dots, lines, vectors at
this point). The hash table allows continuous display of elements that
are generated only in certain time steps, e.g. contact points, while
avoiding massive memory allocation. In any case, this system is really
a development feature, but very helpful in finding issues with the
internal solver data.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_cloth.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_cloth.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c index 1561fd1a981..15a73c0a34d 100644 --- a/source/blender/modifiers/intern/MOD_cloth.c +++ b/source/blender/modifiers/intern/MOD_cloth.c @@ -46,6 +46,7 @@ #include "BKE_cloth.h" #include "BKE_cdderivedmesh.h" +#include "BKE_effect.h" #include "BKE_global.h" #include "BKE_key.h" #include "BKE_modifier.h" @@ -68,6 +69,8 @@ static void initData(ModifierData *md) return; cloth_init(clmd); + + clmd->debug_data = NULL; } static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], @@ -175,6 +178,7 @@ static void copyData(ModifierData *md, ModifierData *target) tclmd->point_cache = BKE_ptcache_add(&tclmd->ptcaches); tclmd->point_cache->step = 1; tclmd->clothObject = NULL; + tclmd->debug_data = NULL; } static bool dependsOnTime(ModifierData *UNUSED(md)) @@ -202,6 +206,8 @@ static void freeData(ModifierData *md) BKE_ptcache_free_list(&clmd->ptcaches); clmd->point_cache = NULL; + + BKE_sim_debug_data_free(clmd->debug_data); } } |