Пример #1
0
 public FixtureDef(Shape shape, float density, float restitution, float friction, FilterData filter, bool isSensor = false, object userData = null)
 {
     _realShape = shape;
     UserData   = userData;
     _internalFixture._friction    = friction;
     _internalFixture._restitution = restitution;
     _internalFixture._density     = density;
     Filter = filter;
     _internalFixture._isSensor = isSensor;
 }
Пример #2
0
        public virtual bool ShouldCollide(Fixture fixtureA, Fixture fixtureB)
        {
            FilterData filterA = fixtureA.FilterData;
            FilterData filterB = fixtureB.FilterData;

            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);
        }
Пример #3
0
 public static extern void b2fixture_getfilterdata(IntPtr fixture, [Out][In] FilterData filterData);
Пример #4
0
 public FilterDataInternal(FilterData data)
 {
     _filterData = data;
 }