Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timing.isFixed #44

Closed
angabriel opened this issue Aug 6, 2014 · 2 comments
Closed

timing.isFixed #44

angabriel opened this issue Aug 6, 2014 · 2 comments

Comments

@angabriel
Copy link

Hi again

I found a little bug when you set the engine's timing.isFixed = true via the options. In this case, no bodies are moving anymore.

Runner.run
......
if (timing.isFixed) {
   // fixed timestep
   delta = timing.delta;
   correction = 1; // possible fix
}

Maybe you can reproduce this behavior and the possible fix helps.

@liabru
Copy link
Owner

liabru commented Aug 10, 2014

Are you setting timing.isFixed = true after engine creation?
Try setting it at creation, unless there's a reason you need to set it after the fact?

@angabriel
Copy link
Author

I am setting the fixed timing via an options object and pass that to the creator:

options = {
            positionIterations: 2,
            velocityIterations: 4,
            enableSleeping: true,
            render: {
              options: {
                height: 1000,
                width: 780
              }
            },
            timing: {
              isFixed: true
            }
        }
_engine = Matter.Engine.create($canvas[0], options)

@liabru liabru closed this as completed in 0933620 Jan 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants