Class Contact

    • Constructor Detail

      • Contact

        protected Contact​(IWorldPool argPool)
    • Method Detail

      • init

        public void init​(Fixture fA,
                         int indexA,
                         Fixture fB,
                         int indexB)
        initialization for pooling
      • getManifold

        public Manifold getManifold()
        Get the contact manifold. Do not set the point count to zero. Instead call Disable.
      • getWorldManifold

        public void getWorldManifold​(WorldManifold worldManifold)
        Get the world manifold.
      • isTouching

        public boolean isTouching()
        Is this contact touching
        Returns:
      • setEnabled

        public void setEnabled​(boolean flag)
        Enable/disable this contact. This can be used inside the pre-solve contact listener. The contact is only disabled for the current time step (or sub-step in continuous collisions).
        Parameters:
        flag -
      • isEnabled

        public boolean isEnabled()
        Has this contact been disabled?
        Returns:
      • getNext

        public Contact getNext()
        Get the next contact in the world's contact list.
        Returns:
      • getFixtureA

        public Fixture getFixtureA()
        Get the first fixture in this contact.
        Returns:
      • getChildIndexA

        public int getChildIndexA()
      • getFixtureB

        public Fixture getFixtureB()
        Get the second fixture in this contact.
        Returns:
      • getChildIndexB

        public int getChildIndexB()
      • setFriction

        public void setFriction​(float friction)
      • getFriction

        public float getFriction()
      • resetFriction

        public void resetFriction()
      • setRestitution

        public void setRestitution​(float restitution)
      • getRestitution

        public float getRestitution()
      • resetRestitution

        public void resetRestitution()
      • setTangentSpeed

        public void setTangentSpeed​(float speed)
      • getTangentSpeed

        public float getTangentSpeed()
      • flagForFiltering

        public void flagForFiltering()
        Flag this contact for filtering. Filtering will occur the next time step.
      • mixFriction

        public static final float mixFriction​(float friction1,
                                              float friction2)
        Friction mixing law. The idea is to allow either fixture to drive the restitution to zero. For example, anything slides on ice.
        Parameters:
        friction1 -
        friction2 -
        Returns:
      • mixRestitution

        public static final float mixRestitution​(float restitution1,
                                                 float restitution2)
        Restitution mixing law. The idea is allow for anything to bounce off an inelastic surface. For example, a superball bounces on anything.
        Parameters:
        restitution1 -
        restitution2 -
        Returns: