Sorry - I seem to be needing a lot of help lately. What should the default ShouldCollide method be?. I want to implement my own Contact Filter. I wanted to use the standard(default) 'ShouldCollide' method, but add an extra condition to it - of my own. To start with I am just trying to replicate the existing method. I want to get this working before I add anything. I am using this (from the documentation)
However I get an ''unhandled' memory exception error' I tried it with commenting bits out and the first thing that makes this happen is the filter2.GetGroupIndex(). The equivalent with filter1 works fine. Can someone help me with this? Thank you.
Local filter1:b2FilterData = shape1.GetFilterData() Local filter2:b2FilterData = shape2.GetFilterData() If filter1.GetGroupIndex() = filter2.GetGroupIndex() And filter1.GetGroupIndex() <> 0 Return filter1.GetGroupIndex() > 0 End If Local collide:Int = (filter1.GetMaskBits() & filter2.GetCategoryBits()) <> 0 And (filter1.GetCategoryBits() & filter2.GetMaskBits()) <> 0 Return collide
However I get an ''unhandled' memory exception error' I tried it with commenting bits out and the first thing that makes this happen is the filter2.GetGroupIndex(). The equivalent with filter1 works fine. Can someone help me with this? Thank you.