actionscript 3 - Box2D in Flash runs quicker when drawing debug data than not -


I created a small game with Box2d for AS3 - I have spirits attached that take their position from the underlying box 2D world These spirits are mostly PNG

When the game draws every update with bubbing (buggy), it runs smoothly and smoothly. However, when I comment on this, then it runs chatter and in both cases all my sprites are being sung. It seems that when it depicts debug data additionaly (i mean that my preites are on screen in both cases!)

What's going on? Does debug data have any kind of 'quick render' switch shock? If so, what is the switch! I can not see it in box 2D code

  Function update (e) {m_world.Step (m_timeStep, m_velocityItations, m_positionIterations); // Debug Draw? M_world.DrawDebugData (); // With the above, I get 27 fps, without it, I get 19 fps. // This is the only change that is creating such a huge difference. }  

Interestingly, if I set the debug draw scale to separate from my world level, it slow down to 19 fps. So something like this is happening when it pulls the boxes under my dead bodies so that it has to be run quickly ..

Cheers,

Boy

< P>
  private bait gravity: B2Week 2 = new B2 VC2 (0, 7.8); Private var doSleep: boolean = false; Private var iterations: int = 10; Private time time step: number = 1/30;  

Can you share this setting with us? DoSleep greatly improves performance


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -