Module ode :: Class Contact
[show private | hide private]
[frames | no frames]

Type Contact

object --+
         |
        Contact


This class represents a contact between two bodies in one point.

A Contact object stores all the input parameters for a ContactJoint. This class wraps the ODE dContact structure which has 3 components:
struct dContact {
  dSurfaceParameters surface;
  dContactGeom geom;
  dVector3 fdir1;
};    
This wrapper class provides methods to get and set the items of those structures.
Method Summary
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
float getBounce()
Return the restitution parameter.
float getBounceVel()
Return the minimum incoming velocity necessary for bounce.
(pos, normal, depth, geom1, geom2) getContactGeomParams()
Get the ContactGeom structure of the contact.
(x, y, z) getFDir1()
Get the "first friction direction" vector that defines a direction along which frictional force is applied.
flags getMode()
Return the contact flags.
float getMotion1()
Get the surface velocity in friction direction 1.
float getMotion2()
Get the surface velocity in friction direction 2.
float getMu()
Return the Coulomb friction coefficient.
float getMu2()
Return the optional Coulomb friction coefficient for direction 2.
float getSlip1()
Get the coefficient of force-dependent-slip (FDS) for friction direction 1.
float getSlip2()
Get the coefficient of force-dependent-slip (FDS) for friction direction 2.
float getSoftCFM()
Return the contact normal "softness" parameter.
float getSoftERP()
Return the contact normal "softness" parameter.
  setBounce(b)
  setBounceVel(bv)
Set the minimum incoming velocity necessary for bounce.
  setContactGeomParams(pos, normal, depth, geom1, geom2)
Set the ContactGeom structure of the contact.
  setFDir1(fdir)
Set the "first friction direction" vector that defines a direction along which frictional force is applied.
  setMode(flags)
Set the contact flags.
  setMotion1(m)
Set the surface velocity in friction direction 1.
  setMotion2(m)
Set the surface velocity in friction direction 2.
  setMu(mu)
Set the Coulomb friction coefficient.
  setMu2(mu)
Set the optional Coulomb friction coefficient for direction 2.
  setSlip1(s)
Set the coefficient of force-dependent-slip (FDS) for friction direction 1.
  setSlip2(s)
Set the coefficient of force-dependent-slip (FDS) for friction direction 1.
  setSoftCFM(cfm)
Set the contact normal "softness" parameter.
  setSoftERP(erp)
Set the contact normal "softness" parameter.
    Inherited from object
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Method Details

__new__(T, S, ...)

T.__new__(S, ...) -> a new object with type S, a subtype of T
Returns:
a new object with type S, a subtype of T
Overrides:
__builtin__.object.__new__

getBounce()

Return the restitution parameter.
Returns:
float

getBounceVel()

Return the minimum incoming velocity necessary for bounce.
Returns:
float

getContactGeomParams()

Get the ContactGeom structure of the contact.

The return value is a tuple (pos, normal, depth, geom1, geom2) where pos and normal are 3-tuples of floats and depth is a single float. geom1 and geom2 are the Geom objects of the geoms in contact.
Returns:
(pos, normal, depth, geom1, geom2)

getFDir1()

Get the "first friction direction" vector that defines a direction along which frictional force is applied.
Returns:
(x, y, z)

getMode()

Return the contact flags.
Returns:
flags

getMotion1()

Get the surface velocity in friction direction 1.
Returns:
float

getMotion2()

Get the surface velocity in friction direction 2.
Returns:
float

getMu()

Return the Coulomb friction coefficient.
Returns:
float

getMu2()

Return the optional Coulomb friction coefficient for direction 2.
Returns:
float

getSlip1()

Get the coefficient of force-dependent-slip (FDS) for friction direction 1.
Returns:
float

getSlip2()

Get the coefficient of force-dependent-slip (FDS) for friction direction 2.
Returns:
float

getSoftCFM()

Return the contact normal "softness" parameter.
Returns:
float

getSoftERP()

Return the contact normal "softness" parameter.
Returns:
float

setBounce(b)

Parameters:
b - Restitution parameter (0..1)
           (type=float)

setBounceVel(bv)

Set the minimum incoming velocity necessary for bounce. Incoming velocities below this will effectively have a bounce parameter of 0.
Parameters:
bv - Velocity
           (type=float)

setContactGeomParams(pos, normal, depth, geom1=None, geom2=None)

Set the ContactGeom structure of the contact.
Parameters:
pos - Contact position, in global coordinates
           (type=3-sequence of floats)
normal - Unit length normal vector
           (type=3-sequence of floats)
depth - Depth to which the two bodies inter-penetrate
           (type=float)
geom1 - Geometry object 1 that collided
           (type=Geom)
geom2 - Geometry object 2 that collided
           (type=Geom)

setFDir1(fdir)

Set the "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).
Parameters:
fdir - Friction direction
           (type=3-sequence of floats)

setMode(flags)

Set the contact flags. The argument m is a combination of the ContactXyz flags (ContactMu2, ContactBounce, ...).
Parameters:
flags - Contact flags
           (type=int)

setMotion1(m)

Set the surface velocity in friction direction 1.
Parameters:
m - Surface velocity
           (type=float)

setMotion2(m)

Set the surface velocity in friction direction 2.
Parameters:
m - Surface velocity
           (type=float)

setMu(mu)

Set the Coulomb friction coefficient.
Parameters:
mu - Coulomb friction coefficient (0..Infinity)
           (type=float)

setMu2(mu)

Set the optional Coulomb friction coefficient for direction 2.
Parameters:
mu - Coulomb friction coefficient (0..Infinity)
           (type=float)

setSlip1(s)

Set the coefficient of force-dependent-slip (FDS) for friction direction 1.
Parameters:
s - FDS coefficient
           (type=float)

setSlip2(s)

Set the coefficient of force-dependent-slip (FDS) for friction direction 1.
Parameters:
s - FDS coefficient
           (type=float)

setSoftCFM(cfm)

Set the contact normal "softness" parameter.
Parameters:
cfm - Softness parameter
           (type=float)

setSoftERP(erp)

Set the contact normal "softness" parameter.
Parameters:
erp - Softness parameter
           (type=float)

Generated by Epydoc 2.1 on Sun Feb 4 17:54:12 2007 http://epydoc.sf.net