[Bf-blender-cvs] [e4ceb56] hair_system: Hair debugging: Draw vectors as a point with a direction (as opposed to a line from a to b).

Lukas Tönne noreply at git.blender.org
Fri Aug 22 15:35:31 CEST 2014


Commit: e4ceb564de5ffa7fc143b34dd4856c10aae4fbd8
Author: Lukas Tönne
Date:   Fri Aug 22 12:42:31 2014 +0200
Branches: hair_system
https://developer.blender.org/rBe4ceb564de5ffa7fc143b34dd4856c10aae4fbd8

Hair debugging: Draw vectors as a point with a direction (as opposed to
a line from a to b).

===================================================================

M	source/blender/editors/space_view3d/drawhair.c
M	source/blender/hair/intern/HAIR_debug.h

===================================================================

diff --git a/source/blender/editors/space_view3d/drawhair.c b/source/blender/editors/space_view3d/drawhair.c
index 125c94b..3070c02 100644
--- a/source/blender/editors/space_view3d/drawhair.c
+++ b/source/blender/editors/space_view3d/drawhair.c
@@ -603,12 +603,14 @@ static void draw_hair_debug_elements(HairSystem *UNUSED(hsys), HairDebugData *de
 	glBegin(GL_LINES);
 	for (BLI_ghashIterator_init(&iter, debug_data->gh); !BLI_ghashIterator_done(&iter); BLI_ghashIterator_step(&iter)) {
 		HAIR_SolverDebugElement *elem = BLI_ghashIterator_getValue(&iter);
+		float t[3];
 		if (elem->type != HAIR_DEBUG_ELEM_VECTOR)
 			continue;
 		
 		glColor3f(elem->color[0], elem->color[1], elem->color[2]);
 		glVertex3f(elem->a[0], elem->a[1], elem->a[2]);
-		glVertex3f(elem->b[0], elem->b[1], elem->b[2]);
+		add_v3_v3v3(t, elem->a, elem->b);
+		glVertex3f(t[0], t[1], t[2]);
 	}
 	glEnd();
 }
diff --git a/source/blender/hair/intern/HAIR_debug.h b/source/blender/hair/intern/HAIR_debug.h
index b5dda2d..b668ef9 100644
--- a/source/blender/hair/intern/HAIR_debug.h
+++ b/source/blender/hair/intern/HAIR_debug.h
@@ -98,14 +98,14 @@ struct Debug {
 		BLI_mutex_unlock(&mutex);
 	}
 	
-	static void vector(const float3 &v1, const float3 &v2, float r, float g, float b, int hash)
+	static void vector(const float3 &p, const float3 &d, float r, float g, float b, int hash)
 	{
 		HAIR_SolverDebugElement elem;
 		elem.type = HAIR_DEBUG_ELEM_VECTOR;
 		elem.hash = hash;
 		
-		copy_v3_v3(elem.a, v1.data());
-		copy_v3_v3(elem.b, v2.data());
+		copy_v3_v3(elem.a, p.data());
+		copy_v3_v3(elem.b, d.data());
 		
 		elem.color[0] = r;
 		elem.color[1] = g;




More information about the Bf-blender-cvs mailing list