Different collision response from Static when scaled

Topher
Posts: 10
Joined: Mon Dec 06, 2010 2:30 pm

Different collision response from Static when scaled

Post by Topher »

If I have a Static rigidBody with a CollisionShape of a 0.23 radius Sphere and I fly a block into it, it collides as I expect. If I use setLocalScaling() on the shape (lets say 10, 10, 10) the response is quite insane. The block will flip out very quickly and get sent very far away, instead of the gentle bounce previously. Also the collision debug lines show the correct scale, while the collision response only occurs at the 0.23 radius, despite being scaled.

1) Is there a bug to do with local scaling and static bodies? This does not occur with Dynamic objects.

2) Why is it if you scale the same shape by the same amount, the debug bounding for the object is different between Static/Kinematic and Dynamic?
Topher
Posts: 10
Joined: Mon Dec 06, 2010 2:30 pm

Re: Different collision response from Static when scaled

Post by Topher »

Topher wrote:2) Why is it if you scale the same shape by the same amount, the debug bounding for the object is different between Static/Kinematic and Dynamic?
Found the issue here, it was partially our end. If you apply setLocalScale on a Sphere, it works correctly and when you call GetRadius it returns the scaled radius. However the oddity is that when calling drawSphere() in debugDrawObject(), the radius AND transform is passed in. We were (foolishly) drawing the sphere using the radius and applying the scale in the worldTransform.

Is it intentional to pass in a transform with scale as well as a scaled radius for drawSphere?
Topher
Posts: 10
Joined: Mon Dec 06, 2010 2:30 pm

Re: Different collision response from Static when scaled

Post by Topher »

I've figured the issue out, it was that we were providing the btRigidBody a transform with our scale, which was why the debug drawing was all wrong and it seems it also caused static collision responses to be entirely incorrect.