diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-06-10 01:29:20 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-06-10 01:29:20 +0400 |
commit | e70476db4b63f1720f24ff93aa15441de7740fd6 (patch) | |
tree | df040e41b8cd675554f1ab0555425fe8b4c0b7f1 /source | |
parent | a91964e0e2f6758e076b522724bb1bc63933cb91 (diff) |
fix [#35663] Some object types don't draw bounds other than "Box"
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 40 |
1 files changed, 4 insertions, 36 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 7df05cc1692..db10c1c5957 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -260,18 +260,6 @@ static const unsigned int colortab[] = { 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 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, bool depth_write, flo /* ******************** 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_bb_quadric(BoundBox *bb, char type) 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 @@ static void draw_bounding_volume(Scene *scene, Object *ob, char type) 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; |