Open Meldiron opened 5 years ago
You could probably just add and use your own broadphase class. Extend the broadphase class (just like SAPBroadphase does) and then pass it to the World like this:
var world = new World({
broadphase: new MyCustomBroadphase()
});
You can do whatever you want inside postBroadphase
, including modifying the pairs array. The pairs array is passed into the event handler (in evt.pairs
) so you can just modify it directly.
There is event "postBroadphase " on world which gives collision pairs. Is there a way to change this array of pairs before world does recalculations? postBroadphase is just an event so I cant return something to change it (I think at least).
Let me know please :)