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-11-05 21:17:39 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2015-01-20 11:30:06 +0300
commitc37de3871664cc5b3baf48a4b423b7a08f77bbf1 (patch)
tree9a33057dcecf41bb889f791f206c277fbf9935d7 /source/blender/blenkernel
parent7dda1ea396fd584dc532faa0ff30a87c1e1a7629 (diff)
New debug element "circle" for simulations, which is quite useful for
visualizing scalar fields.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_effect.h2
-rw-r--r--source/blender/blenkernel/intern/effect.c21
2 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h
index 04853bbb163..6688cd33e84 100644
--- a/source/blender/blenkernel/BKE_effect.h
+++ b/source/blender/blenkernel/BKE_effect.h
@@ -150,6 +150,7 @@ typedef struct SimDebugElement {
typedef enum eSimDebugElement_Type {
SIM_DEBUG_ELEM_DOT,
+ SIM_DEBUG_ELEM_CIRCLE,
SIM_DEBUG_ELEM_LINE,
SIM_DEBUG_ELEM_VECTOR,
} eSimDebugElement_Type;
@@ -160,6 +161,7 @@ typedef struct 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, const char *category, int hash);
+void BKE_sim_debug_data_add_circle(struct SimDebugData *debug_data, const float p[3], const float radius, float r, float g, float b, const char *category, 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, const char *category, 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, const char *category, int hash);
void BKE_sim_debug_data_remove(struct SimDebugData *debug_data, int hash);
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index c18726e5905..b07d972b770 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -1089,6 +1089,27 @@ void BKE_sim_debug_data_add_dot(struct SimDebugData *debug_data, const float p[3
debug_data_insert(debug_data, elem);
}
+void BKE_sim_debug_data_add_circle(struct SimDebugData *debug_data, const float p[3], float radius, float r, float g, float b, const char *category, int hash)
+{
+ int category_hash = (int)BLI_ghashutil_strhash_p(category);
+ SimDebugElement *elem;
+ if (!debug_data)
+ return;
+
+ elem = MEM_callocN(sizeof(SimDebugElement), "sim debug data element");
+ elem->type = SIM_DEBUG_ELEM_CIRCLE;
+ elem->category_hash = category_hash;
+ elem->hash = hash;
+ elem->color[0] = r;
+ elem->color[1] = g;
+ elem->color[2] = b;
+ copy_v3_v3(elem->v1, p);
+ elem->v2[0] = radius;
+ elem->v2[1] = elem->v2[2] = 0.0f;
+
+ debug_data_insert(debug_data, elem);
+}
+
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, const char *category, int hash)
{
int category_hash = (int)BLI_ghashutil_strhash_p(category);