# Class: djointcontact

The contact joint prevents body 1 and body 2 from inter-penetrating at the contact point. It does this by only allowing the bodies to have an 'outgoing' velocity in the direction of the contact normal. Contact joints typically have a lifetime of one time step. They are created and deleted in response to collision detection. Contact joints can simulate friction at the contact by applying special forces in the two friction directions that are perpendicular to the normal.

## Hierarchy

    o-+ ode
      o-+ djoint
        o-+ djointcontact

## Methods:

### Method overview:

- approx1
- approx2
- bounce
- bouncevel
- depth
- fdir
- motion1
- motion2
- mu
- mu2
- normal
- pos
- slip1
- slip2
- softcfm
- softerp

approx1 (djointcontact,[boolean on],[float])
  returns: ([boolean,float])
  Use the friction pyramid approximation for friction direction 1. If this is not specified then the constant-force-limit approximation is used (and mu is a force limit).
approx2 (djointcontact,[boolean on],[float])
  returns: ([boolean,float])
  Use the friction pyramid approximation for friction direction 2. If this is not specified then the constant-force-limit approximation is used (and mu is a force limit).
bounce (djointcontact,[boolean on],[float])
  returns: ([boolean,float])
  Restitution parameter (0..1). 0 means the surfaces are not bouncy at all, 1 is maximum bouncyness.
bouncevel (djointcontact,[boolean on],[float])
  returns: ([boolean,float])
  The minimum incoming velocity necessary for bounce (in m/s). Incoming velocities below this will effectively have a bounce parameter of 0.
depth (djointcontact)
  returns: (float x,y,z)
  returns depth of contact
fdir (djointcontact,[boolean on],[float x,y,z])
  returns: ([boolean,float x,y,z])
  "first friction direction" vector that defines a direction along which frictional force is applied. It must be of unit length and perpendicular to the contact normal (so it is typically tangential to the contact surface). The "second friction direction" is a vector computed to be perpendicular to both the contact normal and fdir1.
motion1 (djointcontact,[boolean on],[float])
  returns: ([boolean,float])
  Surface velocity in friction directions 1 (in m/s).
motion2 (djointcontact,[boolean on],[float])
  returns: ([boolean,float])
  Surface velocity in friction directions 2 (in m/s).
mu (djointcontact,[float])
  returns: ([boolean,float])
  Coulomb friction coefficient. This must be in the range 0 to dInfinity. 0 results in a frictionless contact, and dInfinity results in a contact that never slips. Note that frictionless contacts are less time consuming to compute than ones with friction, and infinite friction contacts can be cheaper than contacts with finite friction.
mu2 (djointcontact,[boolean on],[float])
  returns: ([boolean,float])
  Coulomb friction coefficient for friction direction 2 (0..dInfinity).
normal (djointcontact)
  returns: (float x,y,z)
  returns normal of contact
pos (djointcontact)
  returns: (float x,y,z)
  returns point of contact
slip1 (djointcontact,[boolean on],[float])
  returns: ([boolean,float])
  The coefficients of force-dependent-slip (FDS) for friction directions 1 (read the ode-doc).
slip2 (djointcontact,[boolean on],[float])
  returns: ([boolean,float])
  The coefficients of force-dependent-slip (FDS) for friction directions 2 (read the ode-doc).
softcfm (djointcontact,[boolean on],[float])
  returns: ([boolean,float])
  Contact normal 'softness' parameter.
softerp (djointcontact,[boolean on],[float])
  returns: ([boolean,float])
  Contact normal 'softness' parameter.

## Inherited Methods:

### From djoint

attach, body1, body2, bounce, bounce2, bounce3, cfm, cfm2, cfm3, delete, feedback, fmax, fmax2, fmax3, fudgefactor, fudgefactor2, fudgefactor3, geom1, geom2, histop, histop2, histop3, lostop, lostop2, lostop3, stopcfm, stopcfm2, stopcfm3, stoperp, stoperp2, stoperp3, velocity, velocity2, velocity3