lianlab / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Cylinder shape does not correctly support local scaling #178

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
btCollisionShape* groundShape = new
btBoxShape(btVector3(btScalar(50.),btScalar(50.),btScalar(50.)));

2.
btCollisionShape* colShape = new btCylinderShape(btVector3(1.0,1.0,1.0));
colShape->setLocalScaling(btVector3(0.5,2.0,0.5));

3. Place cylinder above groundshape and let it fall with gravity

What is the expected output? What do you see instead?
Cylinder intersect wrongly with groundshape. Maybe local scaling isn't used
at all. 

What version of the product are you using? On what operating system?
2.73sp1

Please provide any additional information below.
When using a plane as groundshape the problem doesn't seem to appear.
Attached modified basic demo shows the problem.

Original issue reported on code.google.com by linz...@gmx.de on 20 Jan 2009 at 11:10

Attachments:

GoogleCodeExporter commented 9 years ago
capsuleShapes show the same defect.

Original comment by linz...@gmx.de on 20 Jan 2009 at 11:28

GoogleCodeExporter commented 9 years ago
It seems like the collision detection happends without the local scaling while 
the
generated contact point is created using local scaling.

Original comment by linz...@gmx.de on 23 Jan 2009 at 11:21

GoogleCodeExporter commented 9 years ago
We will look into the non-uniform scaling issue for 2.75 milestone.

Note that btCapsuleShape has been optimized in a way that is incompatible with 
non-
uniform scaling (the capsule is actually a line segment with collision margin, 
and 
the collision margin isn't scaled). There is a work-around for btCapsuleShape, 
by 
using the btMultiSphereShape with 2 spheres (we need to provide an example how 
to do 
this).

Thanks a lot for the report,
Erwin

Original comment by erwin.coumans on 3 Feb 2009 at 1:16

GoogleCodeExporter commented 9 years ago
Problem doesn't show up in latest trunk (revision 1654), with either 
btCylinderShape 
or btCapsuleShape.

Can you try out the attached file, and see if that works for you?
Or otherwise, modify this example to show the problem?

Thanks,
Erwin

Original comment by erwin.coumans on 15 May 2009 at 6:48

Attachments:

GoogleCodeExporter commented 9 years ago
cannot reproduce problem so waiting for reproduction case (removed from 2.75 
milestone)

Original comment by erwin.coumans on 15 May 2009 at 6:49

GoogleCodeExporter commented 9 years ago
I was finally able to come up with a repro case. The problem only appears for 
static
or kinematic bodies. Dynamic bodies work fine. Took me quite some time to 
figure.

Attached is a modified basic demo. Instead using a box for the ground i use a
cylinder with scale 1,1,1 and localScale of 50,50,50. In fact the local scale 
isn't
applied!
Check out line 107-109. There you can uncomment the 'non local scale' version 
which
works fine.

Original comment by linz...@gmx.de on 1 Dec 2009 at 11:59

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Seems to be fixed with #393

Original comment by linz...@gmx.de on 13 Jul 2010 at 8:04

GoogleCodeExporter commented 9 years ago
I missed the #fixed comment, thanks for your report anyway.

Original comment by erwin.coumans on 11 Sep 2012 at 7:19