[SOLVED] setLocalScaling makes box fly

pfanne
Posts: 7
Joined: Fri Dec 02, 2011 10:21 am

[SOLVED] setLocalScaling makes box fly

Post by pfanne »

Hi there,
I have the following issue:
When I shrink a box, via setLocalScaling() it will not drop to the ground, until it is affected by a collision with another object, or a constraint.
I tripplechecked and the object is active.

Help with this would be much apreciated.

http://youtu.be/xnM-dXtFN1s
Last edited by pfanne on Tue Apr 23, 2013 11:15 am, edited 1 time in total.
norbie
Posts: 21
Joined: Mon Feb 11, 2013 1:57 pm

Re: setLocalScaling makes box fly

Post by norbie »

I have found a bullet issue which explains a more or less similar situation, maybe the information there could also help you, please take a look at it:

https://code.google.com/p/bullet/issues ... %20Summary

There Erwin states:
Before you make any change to the collision shape (replace shape, resize etc) you need to

1) remove the rigid body from the world
2) make the change (resize etc)
3) re-insert the body into the world

Alternatively you can flush the contact points manually for the object involved:

dynamicsWorld->getBroadphase()->getOverlappingPairCache()->cleanProxyFromPairs(body->getBroadphaseHandle(), dynamicsWorld->getDispatcher());
Hope that helps.
pfanne
Posts: 7
Joined: Fri Dec 02, 2011 10:21 am

Re: setLocalScaling makes box fly

Post by pfanne »

works nicely.
thanks.