Module org.dyn4j

Class SolvedContactPoint


  • public class SolvedContactPoint
    extends ContactPoint
    Represents a solved contact point.

    A solved contact point is a contact that has been handled by the contact constraint solver and therefore has the normal and tangential impulses computed.

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

      • normalImpulse

        protected final double normalImpulse
        The accumulated normal impulse
      • tangentialImpulse

        protected final double tangentialImpulse
        The accumulated tangential impulse
    • Constructor Detail

      • SolvedContactPoint

        public SolvedContactPoint​(ContactPointId id,
                                  Body body1,
                                  BodyFixture fixture1,
                                  Body body2,
                                  BodyFixture fixture2,
                                  Vector2 point,
                                  Vector2 normal,
                                  double depth,
                                  double normalImpulse,
                                  double tangentialImpulse)
        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
        normalImpulse - the accumulated normal impulse
        tangentialImpulse - the accumulated tangential impulse
      • SolvedContactPoint

        public SolvedContactPoint​(ContactConstraint constraint,
                                  Contact contact)
        Helper constructor for a contact constraint and contact.
        Parameters:
        constraint - the constraint
        contact - the contact
    • Method Detail

      • getNormalImpulse

        public double getNormalImpulse()
        Returns the accumulated normal impulse.
        Returns:
        double
      • getTangentialImpulse

        public double getTangentialImpulse()
        Returns the accumulated tangential impulse.
        Returns:
        double