Package jsim.solver

Class ContactConstraint

java.lang.Object
jsim.solver.ContactConstraint

public final class ContactConstraint extends Object
Pre-computed data for a single contact constraint, cached before the solver iterates so that the inner loop contains only arithmetic.

A constraint represents: "prevent relative penetration along the contact normal, and resist sliding via Coulomb friction."

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The contact point this constraint was built for.
    double
    Baumgarte bias velocity for penetration correction (m/s).
    double
    Effective inverse mass along the contact normal (kg⁻¹).
    double
    Vector from body A's CoM to the contact point, world frame (metres).
    double
    Vector from body A's CoM to the contact point, world frame (metres).
    double
    Vector from body A's CoM to the contact point, world frame (metres).
    double
    Vector from body B's CoM to the contact point, world frame (metres).
    double
    Vector from body B's CoM to the contact point, world frame (metres).
    double
    Vector from body B's CoM to the contact point, world frame (metres).
    double
    Restitution target velocity used on the first solver iteration (m/s).
    double
    Effective inverse mass along the tangent direction (kg⁻¹).
    double
    First friction tangent direction, world frame (unit vector).
    double
    First friction tangent direction, world frame (unit vector).
    double
    First friction tangent direction, world frame (unit vector).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a constraint pre-computed from the given contact point.
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • contact

      public final ContactPoint contact
      The contact point this constraint was built for.
    • rAx

      public double rAx
      Vector from body A's CoM to the contact point, world frame (metres).
    • rAy

      public double rAy
      Vector from body A's CoM to the contact point, world frame (metres).
    • rAz

      public double rAz
      Vector from body A's CoM to the contact point, world frame (metres).
    • rBx

      public double rBx
      Vector from body B's CoM to the contact point, world frame (metres).
    • rBy

      public double rBy
      Vector from body B's CoM to the contact point, world frame (metres).
    • rBz

      public double rBz
      Vector from body B's CoM to the contact point, world frame (metres).
    • normalEffMass

      public double normalEffMass
      Effective inverse mass along the contact normal (kg⁻¹).
    • tangX

      public double tangX
      First friction tangent direction, world frame (unit vector).
    • tangY

      public double tangY
      First friction tangent direction, world frame (unit vector).
    • tangZ

      public double tangZ
      First friction tangent direction, world frame (unit vector).
    • tangEffMass

      public double tangEffMass
      Effective inverse mass along the tangent direction (kg⁻¹).
    • normalBias

      public double normalBias
      Baumgarte bias velocity for penetration correction (m/s).
    • restitutionBias

      public double restitutionBias
      Restitution target velocity used on the first solver iteration (m/s).
  • Constructor Details

    • ContactConstraint

      public ContactConstraint(ContactPoint contact)
      Create a constraint pre-computed from the given contact point.
      Parameters:
      contact - the contact point to constrain