in box2d (as3) it is supposedly quite simple. please can we have this functionality Ansca!
http://www.emanueleferonato.com/2010/03/02/understanding-box2ds-one-way-...
how about event.contact.SetEnabled(false)
or event.cancel()
etc
1 2 3 4 5 6 7 8 9 10 11 | override public function PreSolve(contact:b2Contact, oldManifold:b2Manifold):void { .. .. // checking distance between bodies var distance = player_y_position-platform_y_position; // if the distance is greater than player radius + half of the platform height... if (distance>-14.5) { // don't manage the contact // THIS ALLOWS THE PLAYER TO PASS THROUGH contact.SetEnabled(false); } |
also it would be good to be able to change the filter (or parameter of the filter) at any point.
1 2 3 4 5 6 7 | function onPreCollision(event) local obj1 = event.target local obj2 = event.other obj1.filter = someOtherCollisionFilter obj2.filter.maskBits = 3 |
I second this request, I would love to be able to actually fully cancel a collision in a preCollision handler.
I vote for this one too.
views:2084 update:2011/9/18 14:43:09