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

2D Physics Engine #18

Open
ghost opened this issue Sep 13, 2016 · 6 comments
Open

2D Physics Engine #18

ghost opened this issue Sep 13, 2016 · 6 comments

Comments

@ghost
Copy link

ghost commented Sep 13, 2016

I noticed Bullet doesn't have a 2D version for its objects. Feasibly, this could be fixed in two ways:

  1. Create a 2D version of the Bullet objects, which would assumedly convert between the 2D magnum API's and a 2D version of Bullet shapes (similar to the current way 3D Bullet integration works, but with the Z axis disabled or some such)
  2. Keep the API similar, but use a Box2D backend, giving similar integration but a different and more suitable backend.

I've got experience with Box2D, if that seems more applicable to what we want in a 2D physics engine, and it's widely used and widely regarded.

@mosra mosra added the feature label Sep 13, 2016
@mosra
Copy link
Owner

mosra commented Sep 13, 2016

Box2D would be awesome :) I also don't see Bullet matching to 2D very well.

The use case is probably a bit different, so I don't mind having a completely different API from what's done for Bullet. Makes more room for experiments.

@Squareys
Copy link
Contributor

Bullet does allow for 2D physics (see their example here), you basically register some 2D collision algorithms to the collision dispatcher, but still have to use 3D vectors it seems.

Box2D would indeed be awesome, though :D

@ghost
Copy link
Author

ghost commented Sep 13, 2016

@mosra @Squareys Looks like the proper way forward would be to embed Box2D then; it doesn't look any harder than Bullet, and it is probably more optimized towards 2D physics.

@roig
Copy link

roig commented Jan 24, 2017

Have you checked http://chipmunk-physics.net/ ? I think it's more flexible than Box2D.

@mosra
Copy link
Owner

mosra commented Aug 31, 2018

Just for the record, a very simple Box2D example is now in the examples repository. This was done directly, without creating any integration library. Potential integration lib could be based on what the example does (conversion of math types first, for example).

@Squareys
Copy link
Contributor

Btw, for reference: I remember the way to do 2D in bullet is to add a bunch of contstraints to the Z axis of all the rigid bodies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

3 participants