Module org.dyn4j

Interface Filter

  • All Known Implementing Classes:
    CategoryFilter, TypeFilter

    public interface Filter
    Interface representing a filter for collision detection.

    Filters allow the collision detection system to skip expensive operations between Fixtures that shouldn't be colliding at all.

    The DEFAULT_FILTER allows all fixture collisions.

    Since:
    1.0.0
    Version:
    3.0.2
    Author:
    William Bittle
    • Field Detail

      • DEFAULT_FILTER

        static final Filter DEFAULT_FILTER
        The default filter which always returns true
    • Method Detail

      • isAllowed

        boolean isAllowed​(Filter filter)
        Returns true if the given Filter and this Filter allow the objects to interact.

        If the given Filter is not the same type as this Filter its up to the implementing class to specify the behavior.

        In addition, if the given Filter is null its up to the implementing class to specify the behavior.

        Parameters:
        filter - the other Filter
        Returns:
        boolean