diff options
author | Sergej Reich <sergej.reich@googlemail.com> | 2013-03-19 00:32:30 +0400 |
---|---|---|
committer | Sergej Reich <sergej.reich@googlemail.com> | 2013-03-19 00:32:30 +0400 |
commit | 95bcb9d2fb5e237c1bf9c1f46784a2241e77954e (patch) | |
tree | 7c57e72e6a60a5ffd3076831745f8f8dc8eb3d88 /source/blender | |
parent | 4285c45424f89ad0a3fcc92932c19cc108025662 (diff) |
Add capluse bounds drawing
Patch [#34566] by Alain Ducharme (phymec).
Diffstat (limited to 'source/blender')
-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} }; |