public void SetFilterData(b2Filter filter) { Box2DPINVOKE.b2Fixture_SetFilterData(swigCPtr, b2Filter.getCPtr(filter)); if (Box2DPINVOKE.SWIGPendingException.Pending) { throw Box2DPINVOKE.SWIGPendingException.Retrieve(); } }
/// Return true if contact calculations should be performed between these two shapes. /// @warning for performance reasons this is only called when the AABBs begin to overlap. // Return true if contact calculations should be performed between these two shapes. // If you implement your own collision filter you may want to build from this implementation. public virtual bool ShouldCollide(b2Fixture fixtureA, b2Fixture fixtureB) { b2Filter filterA = fixtureA.GetFilterData(); b2Filter filterB = fixtureB.GetFilterData(); if (filterA.groupIndex == filterB.groupIndex && filterA.groupIndex != 0) { return(filterA.groupIndex > 0); } bool collide = (filterA.maskBits & filterB.categoryBits) != 0 && (filterA.categoryBits & filterB.maskBits) != 0; return(collide); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(b2Filter obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }
public b2Filter GetFilterData() { b2Filter ret = new b2Filter(Box2DPINVOKE.b2Fixture_GetFilterData(swigCPtr), false); return(ret); }
public b2Filter GetFilterData() { b2Filter ret = new b2Filter(Box2DPINVOKE.b2Fixture_GetFilterData(swigCPtr), false); return ret; }
public void SetFilterData(b2Filter filter) { Box2DPINVOKE.b2Fixture_SetFilterData(swigCPtr, b2Filter.getCPtr(filter)); if (Box2DPINVOKE.SWIGPendingException.Pending) throw Box2DPINVOKE.SWIGPendingException.Retrieve(); }
/// Set the contact filtering data. This will not update contacts until the next time /// step when either parent body is active and awake. /// This automatically calls Refilter. public void SetFilterData(b2Filter filter) { m_filter = filter; Refilter(); }