Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Non-Rectangular Physics Bodies


mikehamil10
 Share

Recommended Posts

I am trying to create a simple air hockey implementation in Phaser and can't figure out how to change the shapes of physics bodies to be circular. It appears in the arcade physics system that ALL bodies are rectangular, but in the source there's an "advanced" physics folder there that appears to allow you to create bodies of varying shapes. Is there an example of how to use these shapes anywhere in the examples or WIP?

 

From reading previous posts on this forum, it looks like there's actually two physics engines currently in the code (arcade and the N+ library?). Perhaps is there a way to swap-out which engine is used so I can have circular bodies? Thanks!!!

Link to comment
Share on other sites

The Advanced physics system isn't ready for prime time yet. We had to release with Arcade only to get started, otherwise we'd still not have released 1.0!

 

I see this as a two-stage process now really:

 

1) All the hard work I did porting over the N+ physics can easily be added into the current Arcade Physics system, so I'll do that. That will provide sloping tile support for the tilemaps, concave/convex shapes and Circles for body objects. It still doesn't support OBB though, even N+ is still AABB.

 

2) Release the Advanced Physics code. You're right that it's all in there, but it needs a LOT of work yet. Also I've been following carefully a brand new physics system in development which, by the time I get to it, may prove to be a much better choice to use (as the current one in the advanced folder hasn't been updated in ages, and I spoke to the developer and he's moved onto bigger and better things now).

 

To be honest now the core library is in JavaScript it should be relatively trivial to merge your own choice of physics library in there. But to wait for us to do it "officially" will take a bit longer yet.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...