Closed englercj closed 10 years ago
dt
values? Chipmunk works better if dt is actually a constant.Failing that, you'd be better off asking on the chipmunk forum. Scott is a better person to ask than me.
@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.
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
Oh - is your rendering happening smoothly? How are you rendering?
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.
Ok, then yeah - see what scott says.
On Fri, Jan 24, 2014 at 3:14 PM, Chad Engler notifications@github.comwrote:
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/josephg/Chipmunk-js/issues/26#issuecomment-33270982 .
Seems I fixed the issue by completely separating my render loop and physics simulation, plus used a constant step for physics.
Hey I am using the "Tank Demo" method of controlling a top down player. That is, a control body is created attached to the player body via pivot and gear constraint, and then when movement controls are pressed I set the velocity of the control body.
Here is how I create and attach my bodies:
Each frame I step the space and update my sprites like so:
What I am seeing is jerky movement. Specifically there are micro teleportations as the player moves. I have tried everything I can think of, but I can't figure out why the movement isn't smooth. Happen to have any ideas?