Strange behavior for falling bodies

AlexSilverman
Posts: 141
Joined: Mon Jul 02, 2007 5:12 pm

Strange behavior for falling bodies

Post by AlexSilverman »

Hello,

I'm seeing some very strange behavior in my simulation. I have a body that's been removed from the world, until a certain point. It is then added to the simulation, positioned, and a force is applied in the positive Y direction. This sends the body upwards, at an appropriate rate, but when it reaches the apex of its path, it slowly falls, with the downward velocity being capped at -0.04 roughly. The result is the object falls much slower than it should, in addition to not accelerating.

My only guess is that this is somehow related to the body being removed and added over the course of the game. I haven't been able to reproduce this in any of the demos unfortunately, but I'll keep trying. I was mainly wondering if anyone has seen thsi behavior, or anything like it, in the past.

Thanks for any help.

- Alex
DevO
Posts: 95
Joined: Fri Mar 31, 2006 7:13 pm

Re: Strange behavior for falling bodies

Post by DevO »

HI.

You can try to disable on or both of this define in btRigidBody.cpp

Code: Select all

#define EXPERIMENTAL_JITTER_REMOVAL 1

#define FORCE_VELOCITY_DAMPING 1
AlexSilverman
Posts: 141
Joined: Mon Jul 02, 2007 5:12 pm

Re: Strange behavior for falling bodies

Post by AlexSilverman »

Hi,

I tried both those, and neither had any effect.

Also, I switched to ApplyImpulse and it made no difference, although I noticed that it seems to be capping the velocity at a value somewhat related to the initial velocity. I don't have specific numbers to cite, but the downward velocity (the one being capped) appears to be proportional to the upward velocity (the one I am applying in the form of a force or an impulse).

Hope that flips some switch in someones brain.

Thanks again.

- Alex
AlexSilverman
Posts: 141
Joined: Mon Jul 02, 2007 5:12 pm

Re: Strange behavior for falling bodies

Post by AlexSilverman »

Welll, I just got it to fall properly. Instead of AddForce(0, 40, 0) I call Addforce(1, 40, 1) and it falls properly. I'm not sure why this makes a difference, but it clearly has. Maybe this will point someone towards something, but my path ends here, unless someone can explain what happened :)

- Alex
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Strange behavior for falling bodies

Post by Erwin Coumans »

Thanks for reporting. It is not clear what the problem is. Did you try to disable 'sleeping'/deactivation?

If you can provide any reproducing testcase, that would be very helpful.
thanks,
Erwin
AlexSilverman
Posts: 141
Joined: Mon Jul 02, 2007 5:12 pm

Re: Strange behavior for falling bodies

Post by AlexSilverman »

Hi,

We are actually disabling deactivation for all moving bodies in our simulation. Once things slow down a bit here I'm going to work up a test case on our platform, and see if I can't reproduce this there, or at least work on tracking down what is going on inside our existing simulations, then try to port that into a demo.

I'll try and get to this soon, as it's an odd problem, but thankfully something that seems to be confined to me.

Thanks.

- Alex