Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Tönne <lukas.toenne@gmail.com>2014-08-30 19:54:36 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2015-01-20 11:29:56 +0300
commitd8cf12fe5a18309e968ffc3b326d70554013b5a7 (patch)
treec9ec99742901601a9cd5cccf62b4c8d2291813ed /source/blender/blenkernel/BKE_effect.h
parent5a43e8493e3851d076365dc106e0fa18ab21eebe (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.h26
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