Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6715583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:37:55+00:00 2026-05-26T08:37:55+00:00

I am developing an android game with box2d and use a fixed timestep system

  • 0

I am developing an android game with box2d and use a fixed timestep system for advancing the physics.

However as I use this system it requires the box2d positions to be interpolates. I read this article
and have implemented an interpolation method very much like the one in the article.

The method seems to work nicely on the computer but on my phone the positions of objects are very jumpy. There is of course a big frame rate difference between PC and phone, but I think this algorithm should not mind that.

Here is the just of the code if you don’t feel like looking at the article :

void PhysicsSystem::smoothStates_ ()
{
    const float oneMinusRatio = 1.f - fixedTimestepAccumulatorRatio_;

    for (b2Body * b = world_->GetBodyList (); b != NULL; b = b->GetNext ())
    {
        if (b->GetType () == b2_staticBody)
        {
            continue;
        }

        PhysicsComponent & c = PhysicsComponent::b2BodyToPhysicsComponent (* b);
        c.smoothedPosition_ =
            fixedTimestepAccumulatorRatio_ * b->GetPosition () +
            oneMinusRatio * c.previousPosition_;
        c.smoothedAngle_ =
            fixedTimestepAccumulatorRatio_ * b->GetAngle () +
            oneMinusRatio * c.previousAngle_;
    }
}

Does anyone know why my game is acting like this?

Thanks for the help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:37:56+00:00Added an answer on May 26, 2026 at 8:37 am

    That code in and of itself doesn’t appear to have any issues as compared to the article. You might want to try posting this on https://gamedev.stackexchange.com/ and see if they have any recommendations.

    Alternatively, here is a very well written article about having a semi-fixed time step, and decoupling physics and frame rate, which I imagine could be the problem. It isn’t for Box2D, but reading over it might help you pinpoint the issue with your physics.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently developing an Android game which saves data into a SQLite database. This
I'm developing a cross platform game engine this targets Windows, Linux, Mac, Mobiles(Android, iOS)
I am developing an android game. in this i have two moving images on
I am developing an Android Game. In this game some trains are moving on
I'm unsure if this is possible -- I'm developing an Android game, and I
I am developing a game for Android. This game is Pacman, I have seen
i'm developing a android game which uses libgdx and bullet physics engine. I can
I'm developing a game for android and this is my first experience with OpenGL.
I'm developing chess game for Android ( androidchess.appspot.com ). If I want to add
I'm currently developing a small OpenGL game for the Android platform and I wonder

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.