FreeS Posted March 1, 2017 Share Posted March 1, 2017 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 More sharing options...
MeMyMo Posted March 1, 2017 Share Posted March 1, 2017 Maybe overlap?http://phaser.io/docs/2.6.2/Phaser.Physics.Arcade.html#overlap Link to comment Share on other sites More sharing options...
FreeS Posted March 2, 2017 Author Share Posted March 2, 2017 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 More sharing options...
MeMyMo Posted March 2, 2017 Share Posted March 2, 2017 Ah, sorry about that. Googled a bit and it looks like it's not as straightforward. Maybe: http://www.html5gamedevs.com/topic/4760-best-way-to-recreate-old-physicsoverlap-using-p2/ ? Link to comment Share on other sites More sharing options...
Recommended Posts