[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57324] trunk/blender/source/blender/ editors/space_view3d/drawobject.c: fix [#35663] Some object types don' t draw bounds other than "Box"

Campbell Barton ideasman42 at gmail.com
Sun Jun 9 23:29:21 CEST 2013


Revision: 57324
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57324
Author:   campbellbarton
Date:     2013-06-09 21:29:20 +0000 (Sun, 09 Jun 2013)
Log Message:
-----------
fix [#35663] Some object types don't draw bounds other than "Box"

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/drawobject.c

Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c	2013-06-09 21:25:27 UTC (rev 57323)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c	2013-06-09 21:29:20 UTC (rev 57324)
@@ -260,18 +260,6 @@
 	0x0, 0x403000, 0xFFFF88
 };
 
-
-static float cube[8][3] = {
-	{-1.0, -1.0, -1.0},
-	{-1.0, -1.0,  1.0},
-	{-1.0,  1.0,  1.0},
-	{-1.0,  1.0, -1.0},
-	{ 1.0, -1.0, -1.0},
-	{ 1.0, -1.0,  1.0},
-	{ 1.0,  1.0,  1.0},
-	{ 1.0,  1.0, -1.0},
-};
-
 /* ----------------- OpenGL Circle Drawing - Tables for Optimized Drawing Speed ------------------ */
 /* 32 values of sin function (still same result!) */
 #define CIRCLE_RESOL 32
@@ -864,28 +852,6 @@
 
 /* ******************** primitive drawing ******************* */
 
-static void drawcube(void)
-{
-
-	glBegin(GL_LINE_STRIP);
-	glVertex3fv(cube[0]); glVertex3fv(cube[1]); glVertex3fv(cube[2]); glVertex3fv(cube[3]);
-	glVertex3fv(cube[0]); glVertex3fv(cube[4]); glVertex3fv(cube[5]); glVertex3fv(cube[6]);
-	glVertex3fv(cube[7]); glVertex3fv(cube[4]);
-	glEnd();
-
-	glBegin(GL_LINE_STRIP);
-	glVertex3fv(cube[1]); glVertex3fv(cube[5]);
-	glEnd();
-
-	glBegin(GL_LINE_STRIP);
-	glVertex3fv(cube[2]); glVertex3fv(cube[6]);
-	glEnd();
-
-	glBegin(GL_LINE_STRIP);
-	glVertex3fv(cube[3]); glVertex3fv(cube[7]);
-	glEnd();
-}
-
 /* draws a cube on given the scaling of the cube, assuming that
  * all required matrices have been set (used for drawing empties)
  */
@@ -6121,6 +6087,7 @@
 
 static void draw_bounding_volume(Scene *scene, Object *ob, char type)
 {
+	BoundBox  bb_local;
 	BoundBox *bb = NULL;
 	
 	if (ob->type == OB_MESH) {
@@ -6142,8 +6109,9 @@
 		bb = BKE_armature_boundbox_get(ob);
 	}
 	else {
-		drawcube();
-		return;
+		const float min[3] = {-1.0f, -1.0f, -1.0f}, max[3] = {1.0f, 1.0f, 1.0f};
+		bb = &bb_local;
+		BKE_boundbox_init_from_minmax(bb, min, max);
 	}
 	
 	if (bb == NULL) return;




More information about the Bf-blender-cvs mailing list