public Filter getFilterData () { org.jbox2d.dynamics.Filter f = fixture.getFilterData(); filter.categoryBits = (short)f.categoryBits; filter.maskBits = (short)f.maskBits; filter.groupIndex = (short)f.groupIndex; return filter; }
/** * 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. * @param fixtureA * @param fixtureB * @return */ public boolean shouldCollide(Fixture fixtureA, Fixture fixtureB){ Filter filterA = fixtureA.getFilterData(); Filter filterB = fixtureB.getFilterData(); if (filterA.groupIndex == filterB.groupIndex && filterA.groupIndex != 0){ return filterA.groupIndex > 0; } boolean collide = (filterA.maskBits & filterB.categoryBits) != 0 && (filterA.categoryBits & filterB.maskBits) != 0; return collide; } }
/** * 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. * @param fixtureA * @param fixtureB * @return */ public boolean shouldCollide(Fixture fixtureA, Fixture fixtureB){ Filter filterA = fixtureA.getFilterData(); Filter filterB = fixtureB.getFilterData(); if (filterA.groupIndex == filterB.groupIndex && filterA.groupIndex != 0){ return filterA.groupIndex > 0; } boolean collide = (filterA.maskBits & filterB.categoryBits) != 0 && (filterA.categoryBits & filterB.maskBits) != 0; return collide; } }
/** * 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. * @param fixtureA * @param fixtureB * @return */ public boolean shouldCollide(Fixture fixtureA, Fixture fixtureB){ Filter filterA = fixtureA.getFilterData(); Filter filterB = fixtureB.getFilterData(); if (filterA.groupIndex == filterB.groupIndex && filterA.groupIndex != 0){ return filterA.groupIndex > 0; } boolean collide = (filterA.maskBits & filterB.categoryBits) != 0 && (filterA.categoryBits & filterB.maskBits) != 0; return collide; } }
/** * @warning for performance reasons this is only called when the AABBs begin to overlap. * @param fixtureA first fixture * @param fixtureB second fixture * @return true if contact calculations should be performed between these two shapes */ public boolean shouldCollide(Fixture fixtureA, Fixture fixtureB) { Filter filterA = fixtureA.getFilterData(); Filter filterB = fixtureB.getFilterData(); if (filterA.groupIndex == filterB.groupIndex && filterA.groupIndex != 0) { return filterA.groupIndex > 0; } return (filterA.maskBits & filterB.categoryBits) != 0 && (filterA.categoryBits & filterB.maskBits) != 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. * @param fixtureA * @param fixtureB * @return */ public boolean shouldCollide(Fixture fixtureA, Fixture fixtureB){ Filter filterA = fixtureA.getFilterData(); Filter filterB = fixtureB.getFilterData(); if (filterA.groupIndex == filterB.groupIndex && filterA.groupIndex != 0){ return filterA.groupIndex > 0; } boolean collide = (filterA.maskBits & filterB.categoryBits) != 0 && (filterA.categoryBits & filterB.maskBits) != 0; return collide; } }