diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-05-16 17:23:59 +0400 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-05-16 17:23:59 +0400 |
commit | a0d82b242faf28a669de3ad2edf739f0126ca220 (patch) | |
tree | 57c2b33c4e57a5c87cb36257b2e92db9245cb155 /source/blender | |
parent | 15849ce3d2d1d60a4ce194d2ffb05188cfb90aae (diff) |
Drawing cylinder & cone bounding objects according to how they will act in the physics simulation.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/src/drawobject.c | 9 |
1 files 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(); |