Jump to content

One object contains another, how to check ? Phaser or P2


FreeS
 Share

Recommended Posts

I need to check if one object (Sprite/p2 body/shape) contains another object.

In p2 documentation I found only Contact event, but I need to know when body inside sensor or other area.
In Phaser I found Phaser.rectangle.containsRect, this is what I need but Rectangle do not support rotation as I understand. So fail ((

With AS3 and Nape I did it this way:
if(Geom.contains(outShape, inShape)){.....}

How I can do it in Phaser and/or p2 physics ?

Link to comment
Share on other sites

My game uses p2 physics. As I understand, I can not use Arcade and p2 physics at the same time.

Also, Arcade physics do not support rotation, so seems overlap will not work too in my case.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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