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

updated to chipmunk 6.2.2 #10

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

hengchu
Copy link

@hengchu hengchu commented Mar 24, 2015

updated chipmunk source to 6.2.2, tested HipmunkPlayground, it compiles without needing any change.

HipmunkPlayground runs fine except for one thing, when I press the DEL key, a soft assertion in cpBody.c is triggered because the position vector of the body becomes (NaN, NaN). I tracked down the problem to cpBody.c:247. I think the problem comes from the computation done in line 246, the velocity actually becomes NaN during the computation, and it got propagated to the position vector. Not sure what's causing this. I'll keep investigating and submit a pull request if a solution comes up.

Everything else seems fine so far. Some API exported by Hipmunk were changed because of Chipmunk API change, I also exported a few new iterating functions from cpSpace.c that weren't here before.

@meteficha
Copy link
Owner

Thanks for the pull request, @hengchu, and sorry for taking so long to get to it.

It's very worrisome that NaNs are appearing on HipmunkPlayground, especially because it's a very straightforward user of the API. Pressing DEL triggers a freeSpace, so I don't even know why cpBodyUpdatePosition is being a problem at all.

This may an indication that something is amiss with the bindings to Chipmunk 6.2. Chipmunk is tricky to create bindings to, and I suspect there may be some changes between 5.3 and 6.2 that, while not reflected on the API, should change the way that Hipmunk is implemented. In fact, the reason why I didn't update the Chipmunk version anymore is because I didn't want to spend the time reading the changes to Chipmunk's source to know if something would break Hipmunk.

So, I'm reluctant to merging it until it's found out why the assertion is being triggered.

@LukaHorvat
Copy link

Hey, I'm looking into this since it seems to be the only working physics engine for Haskell at the moment. Could you tell me what exact issues you found with this pull request? So far I've ported the playground to SDL to I could actually get it running but it seems to work fine. The only thing I've noticed is that pressing DEL to reset the scene is a bit fiddly and it takes a few attempts to get the car showing.

@orclev
Copy link

orclev commented Nov 24, 2016

I'm also interested in seeing this updated, although it would be best if it was brought up to date with the latest chipmunk release (version 7.0.1 as of right now). I was contemplating writing my own bindings to one of the C physics libraries out of desperation, but it occurs to me my efforts would probably be better spent updating this existing binding (I had been looking at box2d, but it's c++ which is a headache I frankly would rather not deal with). Assuming I get desperate enough and/or find myself with a bunch of unexpected free time I might look into updating the bindings to chipmunk 7.0.

@CthulhuDen
Copy link

Hey, if anyone interested I started a new project chiphunk implementing bindings to 7.0.2. It doesn't have extensive playground yet to showcase the features though.

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

Successfully merging this pull request may close these issues.

5 participants