From a0d82b242faf28a669de3ad2edf739f0126ca220 Mon Sep 17 00:00:00 2001 From: Kester Maddock Date: Sun, 16 May 2004 13:23:59 +0000 Subject: [PATCH] Drawing cylinder & cone bounding objects according to how they will act in the physics simulation. --- source/blender/src/drawobject.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index ac941827f87..227f51da011 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -3208,13 +3208,16 @@ static void draw_bb_quadric(BoundBox *bb, short type) gluSphere(qobj, 1.0, 8, 5); } else if(type==OB_BOUND_CYLINDER) { + float radius = size[0] > size[1] ? size[0] : size[1]; glTranslatef(cent[0], cent[1], cent[2]-size[2]); - glScalef(size[0], size[1], 2.0*size[2]); + glScalef(radius, radius, 2.0*size[2]); gluCylinder(qobj, 1.0, 1.0, 1.0, 8, 1); } else if(type==OB_BOUND_CONE) { - glTranslatef(cent[0], cent[1], cent[2]-size[2]); - glScalef(size[0], size[1], 2.0*size[2]); + float radius = size[0] > size[1] ? size[0] : size[1]; + glTranslatef(cent[0], cent[2]-size[2], cent[1]); + glScalef(radius, 2.0*size[2], radius); + glRotatef(-90., 1.0, 0.0, 0.0); gluCylinder(qobj, 1.0, 0.0, 1.0, 8, 1); } glPopMatrix();