ZoomBox Posted May 15, 2014 Share Posted May 15, 2014 Hello there I have a simple question: Is it possible to enable only one or two faces of a polygon body ?Furthermore, would it make me gain performances ? Is it worth it ? Thank you Edit: In fact I'm talking about the physic properties (will it collides or not), maybe it wasn't clear in my post. Link to comment Share on other sites More sharing options...
ZoomBox Posted May 16, 2014 Author Share Posted May 16, 2014 Anyone ? Link to comment Share on other sites More sharing options...
valueerror Posted May 17, 2014 Share Posted May 17, 2014 well... i guess the answer is no.. unlike in arkade physics (an aabb) system there is no function to disable one side (bottom) of a polygon because bottom could be several lines...i needed such collision handling and used the presolve calculations to find out which bodies are colliding and from where (direction).. so if body a would move upwards and collide with body b i would disable the collision equations for that turn.. (because i wanted the bottomface of body b to not collide) Link to comment Share on other sites More sharing options...
valueerror Posted May 17, 2014 Share Posted May 17, 2014 speaking of performance.. in p2 the calculations are done for every body on every step even when they're not in the camera view.. i think basically it is better to have simple shapes.. use circles wherever it is possible.. but its also important how many shapes there are.. if you have 20 circle shapes that means at least 1200 calculations per second.. this doesnt matter at all... phaser/p2 can easily handle this... but ive seen huge performance drops with way higher numbers...one thing i noticed that is bad for performance is the number of layers (tilemap) Link to comment Share on other sites More sharing options...
ZoomBox Posted May 19, 2014 Author Share Posted May 19, 2014 Yeah, OK.The thing to disable the bottom is there to simplify because in Arcade, things are squares. It could be possible by telling which side with its coordinates for example.And I'm mainly talking about performances, I don't really want "One way collision" (for the moment, but that's a nice feature to know).But I'll maybe manage to do it with "addLine", maybe it'll be more efficient ! (I hope).And I knew for circles, since it's just a point with a distance to check around (the radius), I try to use them as often as possible.Thank you for the answer man, you're nicely accurate. Maybe one day my question will find its answer?Edit: Another question: It seems obvious but is it better to use a line or a rectangular body ? It's only about performances. Link to comment Share on other sites More sharing options...
Recommended Posts