Jump to content

Collision between game.Circle and game.Rectangle


Recommended Posts

Hi guys,

I'm creating a prototype with Panda 2 but I'm getting issues with physics.

I setup a ground and a ball but when I use game.Circle as shape it doesn't detect the collision.

It does work if I use both game.Circle or both game.Rectangle but it doesn't between game.Rectangle and game.Circle.

Is it a know limitation of Panda 2? Any workaround?


Link to comment
Share on other sites

As far as I can tell, Circle to Rect collision doesn't work yet. It surprised me, too, but wasn't a big issue for what I was doing.

Workaround would be p2.js plugin if you need really advanced physics. If you're making an older arcade style game, then simple rect collisions are fine most of the time even for circle type objects.

Other workaround would be.. Panda is an open-source engine, so we could take a look at finding a fix, and improving the engine.

Link to comment
Share on other sites

Currently in Panda's own physics engine collision is solved (bodies moved) only in Rectangle vs Rectangle and Circle vs Circle collisions. In Rectangle vs Circle the collision is detected, so your body's collide function is called, you could there manually move your bodies the way you want. Or then you could use p2.js physics.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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