Module org.dyn4j

Class PersistedContactPoint


  • public class PersistedContactPoint
    extends ContactPoint
    Represents a persisted contact point.

    A persisted contact point is a contact point that was retained from the last iteration and therefore contains the previous point, normal, and depth.

    Since:
    1.0.0
    Version:
    3.3.0
    Author:
    William Bittle
    See Also:
    ContactPoint
    • Field Detail

      • oldPoint

        protected final Vector2 oldPoint
        The previous contact point
      • oldNormal

        protected final Vector2 oldNormal
        The previous contact normal
      • oldDepth

        protected final double oldDepth
        The previous penetration depth
    • Constructor Detail

      • PersistedContactPoint

        public PersistedContactPoint​(ContactPointId id,
                                     Body body1,
                                     BodyFixture fixture1,
                                     Body body2,
                                     BodyFixture fixture2,
                                     Vector2 point,
                                     Vector2 normal,
                                     double depth,
                                     Vector2 oldPoint,
                                     Vector2 oldNormal,
                                     double oldDepth,
                                     boolean sensor)
        Full constructor.
        Parameters:
        id - the contact point id
        body1 - the first Body in contact
        fixture1 - the first Body's BodyFixture
        body2 - the second Body in contact
        fixture2 - the second Body's BodyFixture
        point - the world space contact point
        normal - the world space contact normal
        depth - the penetration depth
        oldPoint - the previous world space contact point
        oldNormal - the previous world space contact normal
        oldDepth - the previous penetration depth
        sensor - true if the contact is a sensor contact
      • PersistedContactPoint

        public PersistedContactPoint​(ContactConstraint newConstraint,
                                     Contact newContact,
                                     ContactConstraint oldConstraint,
                                     Contact oldContact)
        Helper constructor for a contact constraint and contact.
        Parameters:
        newConstraint - the new constraint
        newContact - the new contact
        oldConstraint - the old constraint
        oldContact - the old contact
    • Method Detail

      • getOldPoint

        public Vector2 getOldPoint()
        Returns the old contact point.
        Returns:
        Vector2
      • getOldNormal

        public Vector2 getOldNormal()
        Returns the old contact normal.
        Returns:
        Vector2
      • getOldDepth

        public double getOldDepth()
        Returns the old depth.
        Returns:
        double