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/blenkernel/BKE_effect.h | |
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/blenkernel/BKE_effect.h')
-rw-r--r-- | source/blender/blenkernel/BKE_effect.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h index d5e54d849cd..d6991a473b0 100644 --- a/source/blender/blenkernel/BKE_effect.h +++ b/source/blender/blenkernel/BKE_effect.h @@ -136,6 +136,32 @@ int get_effector_data(struct EffectorCache *eff, struct EffectorData *efd, struc /* EffectorData->flag */ #define PE_VELOCITY_TO_IMPULSE 1 +/* ======== Simulation Debugging ======== */ + +typedef struct SimDebugElement { + int type; + int hash; + float color[3]; + + float v1[3], v2[3]; +} SimDebugElement; + +typedef enum eSimDebugElement_Type { + SIM_DEBUG_ELEM_DOT, + SIM_DEBUG_ELEM_LINE, + SIM_DEBUG_ELEM_VECTOR, +} eSimDebugElement_Type; + +typedef struct SimDebugData { + struct GHash *gh; +} SimDebugData; + +struct SimDebugData *BKE_sim_debug_data_new(void); +void BKE_sim_debug_data_add_dot(struct SimDebugData *debug_data, const float p[3], float r, float g, float b, int hash); +void BKE_sim_debug_data_add_line(struct SimDebugData *debug_data, const float p1[3], const float p2[3], float r, float g, float b, int hash); +void BKE_sim_debug_data_add_vector(struct SimDebugData *debug_data, const float p[3], const float d[3], float r, float g, float b, int hash); +void BKE_sim_debug_data_clear(struct SimDebugData *debug_data); +void BKE_sim_debug_data_free(struct SimDebugData *debug_data); #endif |