Example #1
0
 public void SetFilterData(b2Filter filter)
 {
     Box2DPINVOKE.b2Fixture_SetFilterData(swigCPtr, b2Filter.getCPtr(filter));
     if (Box2DPINVOKE.SWIGPendingException.Pending)
     {
         throw Box2DPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Example #2
0
    /// 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);
    }
Example #3
0
 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);
 }
Example #4
0
        public b2Filter GetFilterData()
        {
            b2Filter ret = new b2Filter(Box2DPINVOKE.b2Fixture_GetFilterData(swigCPtr), false);

            return(ret);
        }
Example #5
0
 public b2Filter GetFilterData()
 {
     b2Filter ret = new b2Filter(Box2DPINVOKE.b2Fixture_GetFilterData(swigCPtr), false);
     return ret;
 }
Example #6
0
 public void SetFilterData(b2Filter filter)
 {
     Box2DPINVOKE.b2Fixture_SetFilterData(swigCPtr, b2Filter.getCPtr(filter));
     if (Box2DPINVOKE.SWIGPendingException.Pending) throw Box2DPINVOKE.SWIGPendingException.Retrieve();
 }
Example #7
0
    /// 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();
    }