why Bullet demos feel like happening on the moon?

abaraba
Posts: 56
Joined: Thu Jun 19, 2008 7:54 am

Re: why Bullet demos feel like happening on the moon?

Post by abaraba »

you know whats funny,
when you said "This would result in the type of display you mention." i didnt realise you were referring to "drop framerate" kind of display, but i thought you were referring to ORIGINAL problem in question of moon-like motion ...and it all made sense ..hahahaaa, you can see now by my reply that i was wondering why didnt you say that earlier

but seriously,
it seems very logical this kind of timing to cause that kind of low-gravity and moon-like feeling...

just imagine if my computer was just about powerful enough to run the demo in full speed, then if i run some stuff in background it looks like it could produce just about that much slow down so you couldnt really say its error and because you expect frame rate to drop NOT animation speed, you never realize weired moon gravity is due slow-down of the application

and if new bunny-car demo is the most demanding on CPU/GPU that would explain why i see most of the "effect" in that particular demo

that would also explain why our demos work fine, as we all fix the framerates to suit our application ..and Bullet demos, well thats the thing, im not sure, but i see in vehicleDemo dt = 1.0/420.f


i managed to play with stepSimulation on a few demos, realized they run similar as before... interesting thing is that there seem to be no way to make it work "all right" on slow computers, physics just goes crazy... but effect wasnt that obvious in these demos anyway, so im looking to change bunny-car demo, but can not figure out in what file is stepSimulation that controls it?

is there a way to set up timer loop and stepSimulation to make demos work in real time on slow machines, even if that means to have only fixed 5 or 10 fps? i can achieve that effect on fast machine, but on truly slow machine it doesnt work, it still looks slowed down, but its hard to tell as physics get choppy and crazy

basically, im playing around this:

Code: Select all

//*** fixing fps at 10
while( dTime < 1/10 ) 
  getTime( dTime ) // dTime = time in seconds since last frame was rendered

//then trying something among these lines, one at the time:
stepSimulation(1/10, 1)
stepSimulation(1/10, 1000)
stepSimulation(1/10, 0)

stepSimulation(1/10, 5000, 1/100)
stepSimulation(1/10, 0, 1/5)
stepSimulation(1/10, 1, 1/10)
on slow computer none of the changes seem to lead in right direction or even change anything


anyway,
im almost ready to conclude this and say moon-like effect in Bullet demos is not due to undefined scale and oversized objects, but due to way animation timing is handled
abaraba
Posts: 56
Joined: Thu Jun 19, 2008 7:54 am

Re: why Bullet demos feel like happening on the moon?

Post by abaraba »

and so,
thanks to simple misunderstanding i guessed it right without even knowing what i was talking about really.. how strange

at least right about what i was talking about, still not quite sure if we were all talking about the same thing.. anyway, as i said - just change stepSimulation arguments to (dt, 10, dt), which is kind of wrong, but still works and in effect you would be doing this:

Code: Select all

stepSimulation (dt, 0);
thats it...

now,
if you were reading this forum or chunky's pdf, or Bullet online help you know thats exactly what you are highly encouraged NOT to do and why it took me a while to come around to that answer


so, there is more to it...
"Frame Rate Independence"
http://www.bulletphysics.com/Bullet/php ... f=9&t=2438