The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.31 (Linux)
|
question about stepSimulation - Printable Version +- Forums (https://www.vdrift.net/Forum) +-- Forum: Project (https://www.vdrift.net/Forum/forumdisplay.php?fid=4) +--- Forum: Development (https://www.vdrift.net/Forum/forumdisplay.php?fid=9) +--- 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: Code: stepSimulation(dt, maxSubSteps, timeStep); 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.. :cry: - 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. |