Module org.dyn4j

Class Contact


  • public final class Contact
    extends java.lang.Object
    Represents a contact point between two Body objects.
    Since:
    1.0.0
    Version:
    3.2.0
    Author:
    William Bittle
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) double depth
      The contact penetration depth
      (package private) ManifoldPointId id
      The manifold point id for warm starting
      (package private) double jn
      The accumulated normal impulse
      (package private) double jp
      The accumulated position impulse
      (package private) double jt
      The accumulated tangent impulse
      (package private) double massN
      The mass normal
      (package private) double massT
      The mass tangent
      (package private) Vector2 p
      The contact point in world space
      (package private) Vector2 p1
      The contact point in Body1 space
      (package private) Vector2 p2
      The contact point in Body2 space
      (package private) Vector2 r1
      The Vector2 from the center of Body1 to the contact point
      (package private) Vector2 r2
      The Vector2 from the center of Body2 to the contact point
      (package private) double vb
      The velocity bias
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getDepth()
      Returns the penetration depth of this point.
      ManifoldPointId getId()
      Returns the manifold point id.
      double getNormalImpulse()
      Returns the accumulated normal impulse applied at this point.
      Vector2 getPoint()
      Returns the world space collision point.
      double getTangentialImpulse()
      Returns the accumulated tangential impulse applied at this point.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • p

        final Vector2 p
        The contact point in world space
      • depth

        final double depth
        The contact penetration depth
      • p1

        final Vector2 p1
        The contact point in Body1 space
      • p2

        final Vector2 p2
        The contact point in Body2 space
      • jn

        double jn
        The accumulated normal impulse
      • jt

        double jt
        The accumulated tangent impulse
      • jp

        double jp
        The accumulated position impulse
      • massN

        double massN
        The mass normal
      • massT

        double massT
        The mass tangent
      • vb

        double vb
        The velocity bias
    • Constructor Detail

      • Contact

        public Contact​(ManifoldPointId id,
                       Vector2 point,
                       double depth,
                       Vector2 p1,
                       Vector2 p2)
        Full constructor.
        Parameters:
        id - the manifold point id used for warm starting
        point - the world space collision point
        depth - the penetration depth of this point
        p1 - the collision point in Body1's local space
        p2 - the collision point in Body2's local space
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getPoint

        public Vector2 getPoint()
        Returns the world space collision point.
        Returns:
        Vector2 the collision point in world space
      • getDepth

        public double getDepth()
        Returns the penetration depth of this point.
        Returns:
        double the penetration depth
      • getNormalImpulse

        public double getNormalImpulse()
        Returns the accumulated normal impulse applied at this point.
        Returns:
        double the accumulated normal impulse
      • getTangentialImpulse

        public double getTangentialImpulse()
        Returns the accumulated tangential impulse applied at this point.
        Returns:
        double the accumulated tangential impulse