Render Buffer delayed wrt current position

My main loop does the following (pseudocode):

for (int i = 0;; ++i) {
  scene->fetchResults(true);

  t = scene->getActiveTransforms();
  graphics.update(t);       // Update graphics model matrices

  rb = scene->getRenderBuffer();
  render_buffer.update(rb); // Update debug visualization VBOs

  scene->simulate(time_step);

  graphics.draw();          // Draw models with latest transforms
  render_buffer.draw();     // Draw latest PhysX Render Buffer

  // Update animation of some kinematic actors
  actor->setKinematicTarget(actor_pose[i]);
}

If everything stands still the RB perfectly matches the graphics, but as soon I start some animation the RB shape is a little delayed wrt the graphics.

That is not clear to me, since I retrieve both the new poses and the RB while the simulation is not running, and I expect they should match.

Am I missing something?

Thanks in advance.

Hi,
As far as I know, you’re not missing something. I believe the debug drawing is a frame behind.

Thanks for the clarification.

Paolo