diff options
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 9 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 1f41e7e0d34..84124e08443 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -5903,6 +5903,15 @@ static void draw_bb_quadric(BoundBox *bb, char type) glScalef(radius, radius, 2.0f * size[2]); gluCylinder(qobj, 1.0, 0.0, 1.0, 8, 1); } + else if (type == OB_BOUND_CAPSULE) { + float radius = size[0] > size[1] ? size[0] : size[1]; + float length = size[2] > radius ? 2.0f * (size[2] - radius) : 0.0f; + glTranslatef(cent[0], cent[1], cent[2] - length * 0.5f); + gluCylinder(qobj, radius, radius, length, 8, 1); + gluSphere(qobj, radius, 8, 4); + glTranslatef(0.0, 0.0, length); + gluSphere(qobj, radius, 8, 4); + } glPopMatrix(); gluDeleteQuadric(qobj); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 4b32c4a237a..594b86f000c 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -2030,6 +2030,7 @@ static void rna_def_object(BlenderRNA *brna) {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", "Draw bounds as sphere"}, {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", "Draw bounds as cylinder"}, {OB_BOUND_CONE, "CONE", 0, "Cone", "Draw bounds as cone"}, + {OB_BOUND_CAPSULE, "CAPSULE", 0, "Capsule", "Draw bounds as capsule"}, {0, NULL, 0, NULL, NULL} }; |