Coder Social home page Coder Social logo

jerky player movement about chipmunk-js HOT 7 CLOSED

josephg avatar josephg commented on September 15, 2024
jerky player movement

from chipmunk-js.

Comments (7)

josephg avatar josephg commented on September 15, 2024
  • What are your dt values? Chipmunk works better if dt is actually a constant.
  • Try going through all shapes, not just active ones. I can't remember what the rules are around active / non-active shapes.
  • Are you getting non-smooth values out of the shape? I have no idea what your sprite library does - is it correct?

Failing that, you'd be better off asking on the chipmunk forum. Scott is a better person to ask than me.

from chipmunk-js.

englercj avatar englercj commented on September 15, 2024

@josephg My dt values are not constant (though are very very small floats). The problem is definitely coming form the position changes in chipmunk. The difference between each position is as big as 5-10 units which causes the strange jumping.

I'll try some more things then ask Scott on the forums.

from chipmunk-js.

englercj avatar englercj commented on September 15, 2024

Changing my time-step to be constant yeilded good results, though it still doesn't seem as smooth as it should be.

I posted on the forums here: http://chipmunk-physics.net/forum/viewtopic.php?f=1&t=3169

from chipmunk-js.

josephg avatar josephg commented on September 15, 2024

Oh - is your rendering happening smoothly? How are you rendering?

from chipmunk-js.

englercj avatar englercj commented on September 15, 2024

I'm rendering via WebGL and my fps/rendering is fine. I debugged for days before coming to the conclusion it had to be chipmunk (or my implementation of it). Objects moving around that are not simulated by chipmunk are all smooth, it is only when i try to move something in the method above that I get a strange jumping effect.

from chipmunk-js.

josephg avatar josephg commented on September 15, 2024

Ok, then yeah - see what scott says.

On Fri, Jan 24, 2014 at 3:14 PM, Chad Engler [email protected]:

I'm rendering via WebGL and my fps/rendering works fine. I debugged for
days before coming to the conclusion it had to be chipmunk (or my
implementation of it)


Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-33270982
.

from chipmunk-js.

englercj avatar englercj commented on September 15, 2024

Seems I fixed the issue by completely separating my render loop and physics simulation, plus used a constant step for physics.

from chipmunk-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.