UP!
Have you tried updating physics with a fixed interval timer instead of on update?
Yes, instead of this:
world->Step(dt, velocityIterations, positionIterations);
I’ve tried this:
world->Step(1.0/60.0f, velocityIterations, positionIterations);
Similar results. I mean, It improved the fluency in my old Android device, but I still see the car stuttering/flickering when it’s moving in other Android devices, for example: Galaxy A50.
No, I meant like this
bool init()
{
schedule(SEL_SCHEDULE(&MyScene::fixedUpdate), 1.0f / 60.0f);
return true;
}
void fixedUpdate(float dt)
{
world->Step(dt, velocityIterations, positionIterations);
}
I don’t use schedule
. I use scheduleUpdate
.
director->getScheduler()->scheduleUpdate(Game::getInstance(), 1, false);
void Game::update(float dt)
{
.
.
.
}
Also I’ve tried schedule
:
director->getInstance()->getScheduler()->schedule(SEL_SCHEDULE(&Game::update), Game::getInstance(), 1.0f/60.0f, false);
Same results… the problem persists.