question about stepSimulation - Printable Version

+- Forums (
+-- Forum: Project (
+--- Forum: Development (
+--- Thread: question about stepSimulation (/showthread.php?tid=1632)

question about stepSimulation - ghiboz - 04-19-2012

Hi all!
i've a question, i'm curious:
in game::Tick function you count how many physics ticks you need to do in a graphics frame, cycle and call for each physTick AdvanceGameLogic, that basically call dynamics.update, that basically do this:
stepSimulation(dt, maxSubSteps, timeStep);
now my question is this:
in this mode, the stepSimulation is called only 1 time to physicsTicks...

why you doesn't allow to stepSimulation to subdivide by phyisics ticks passing dt as graphics frametime??

i've tried but all the loads to the suspensions/wheels are wrong.... is there any thing to understand??

thanks in advance!

- NaN - 04-19-2012

My original intention has been to use bullet fixed step code, put vdrift logic into bullet pre-step, post-step callbacks. But I went for the lazy version and sticked with vdrift time step code. I think I had the (incomplete) callback code somewhere, did some test runs.

If you want to use simulation step with frame time, you'll have to move it out of the vdrift time step loop. Else you will get the funky results you are seeing I guess. If you are interested you could try to modify game class logic to use the callbacks. Patches are very welcome.

- ghiboz - 04-19-2012

I tried, but I get the same results that I had changing only a bullet freq and not vdrift.. the load is very minor instead the correct weight... seems that some bullet code is updated outside the updateAction method... but I didn't find it..


- NaN - 04-19-2012

Hmm, I'd have to dig up the old code. But the car simulation should run within bullet(without vdrift) with some modifications to the loading routine and wheel rays. One could try to modify one of the bullet demos to run with cardynamics(there is a vehicle demo in the bullet sdk).

It is actually something I wanted to do with the new sim code in my fork. Would be a nice little project.