From: Matthias B. <mb...@us...> - 2004-10-28 09:39:26
|
Update of /cvsroot/pyode/pyode/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20906 Modified Files: contact.pyx Log Message: Added doc strings and methods to get/set the fdir1 parameter. Index: contact.pyx =================================================================== RCS file: /cvsroot/pyode/pyode/src/contact.pyx,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** contact.pyx 12 Jul 2004 17:30:08 -0000 1.2 --- contact.pyx 28 Oct 2004 09:39:16 -0000 1.3 *************** *** 25,98 **** self._contact.surface.bounce = 0.1 def getMode(self): return self._contact.surface.mode ! def setMode(self, m): ! self._contact.surface.mode = m def getMu(self): return self._contact.surface.mu ! def setMu(self, mu): self._contact.surface.mu = mu def getMu2(self): return self._contact.surface.mu2 ! def setMu2(self, mu): self._contact.surface.mu2 = mu def getBounce(self): return self._contact.surface.bounce def setBounce(self, b): self._contact.surface.bounce = b def getBounceVel(self): return self._contact.surface.bounce_vel def setBounceVel(self, bv): self._contact.surface.bounce_vel = bv def getSoftERP(self): return self._contact.surface.soft_erp def setSoftERP(self, erp): self._contact.surface.soft_erp = erp def getSoftCFM(self): return self._contact.surface.soft_cfm def setSoftCFM(self, cfm): self._contact.surface.soft_cfm = cfm def getMotion1(self): return self._contact.surface.motion1 def setMotion1(self, m): self._contact.surface.motion1 = m def getMotion2(self): return self._contact.surface.motion2 def setMotion2(self, m): self._contact.surface.motion2 = m def getSlip1(self): return self._contact.surface.slip1 def setSlip1(self, s): self._contact.surface.slip1 = s def getSlip2(self): return self._contact.surface.slip2 def setSlip2(self, s): self._contact.surface.slip2 = s def getContactGeomParams(self): ! """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. --- 25,274 ---- self._contact.surface.bounce = 0.1 + # getMode def getMode(self): + """getMode() -> flags + + Return the contact flags. + """ return self._contact.surface.mode ! # setMode ! def setMode(self, flags): ! """setMode(flags) + Set the contact flags. The argument m is a combination of the + ContactXyz flags (ContactMu2, ContactBounce, ...). + + @param flags: Contact flags + @type flags: int + """ + self._contact.surface.mode = flags + + # getMu def getMu(self): + """getMu() -> float + + Return the Coulomb friction coefficient. + """ return self._contact.surface.mu ! ! # setMu def setMu(self, mu): + """setMu(mu) + + Set the Coulomb friction coefficient. + + @param mu: Coulomb friction coefficient (0..Infinity) + @type mu: float + """ self._contact.surface.mu = mu + # getMu2 def getMu2(self): + """getMu2() -> float + + Return the optional Coulomb friction coefficient for direction 2. + """ return self._contact.surface.mu2 ! ! # setMu2 def setMu2(self, mu): + """setMu2(mu) + + Set the optional Coulomb friction coefficient for direction 2. + + @param mu: Coulomb friction coefficient (0..Infinity) + @type mu: float + """ self._contact.surface.mu2 = mu + # getBounce def getBounce(self): + """getBounce() -> float + + Return the restitution parameter. + """ return self._contact.surface.bounce + # setBounce def setBounce(self, b): + """setBounce(b) + + @param b: Restitution parameter (0..1) + @type b: float + """ self._contact.surface.bounce = b + # getBounceVel def getBounceVel(self): + """getBounceVel() -> float + + Return the minimum incoming velocity necessary for bounce. + """ return self._contact.surface.bounce_vel + # setBounceVel def setBounceVel(self, bv): + """setBounceVel(bv) + + Set the minimum incoming velocity necessary for bounce. Incoming + velocities below this will effectively have a bounce parameter of 0. + + @param bv: Velocity + @type bv: float + """ self._contact.surface.bounce_vel = bv + # getSoftERP def getSoftERP(self): + """getSoftERP() -> float + + Return the contact normal "softness" parameter. + """ return self._contact.surface.soft_erp + # setSoftERP def setSoftERP(self, erp): + """setSoftERP(erp) + + Set the contact normal "softness" parameter. + + @param erp: Softness parameter + @type erp: float + """ self._contact.surface.soft_erp = erp + # getSoftCFM def getSoftCFM(self): + """getSoftCFM() -> float + + Return the contact normal "softness" parameter. + """ return self._contact.surface.soft_cfm + # setSoftCFM def setSoftCFM(self, cfm): + """setSoftCFM(cfm) + + Set the contact normal "softness" parameter. + + @param cfm: Softness parameter + @type cfm: float + """ self._contact.surface.soft_cfm = cfm + # getMotion1 def getMotion1(self): + """getMotion1() -> float + + Get the surface velocity in friction direction 1. + """ return self._contact.surface.motion1 + # setMotion1 def setMotion1(self, m): + """setMotion1(m) + + Set the surface velocity in friction direction 1. + + @param m: Surface velocity + @type m: float + """ self._contact.surface.motion1 = m + # getMotion2 def getMotion2(self): + """getMotion2() -> float + + Get the surface velocity in friction direction 2. + """ return self._contact.surface.motion2 + # setMotion2 def setMotion2(self, m): + """setMotion2(m) + + Set the surface velocity in friction direction 2. + + @param m: Surface velocity + @type m: float + """ self._contact.surface.motion2 = m + # getSlip1 def getSlip1(self): + """getSlip1() -> float + + Get the coefficient of force-dependent-slip (FDS) for friction + direction 1. + """ return self._contact.surface.slip1 + # setSlip1 def setSlip1(self, s): + """setSlip1(s) + + Set the coefficient of force-dependent-slip (FDS) for friction + direction 1. + + @param s: FDS coefficient + @type s: float + """ self._contact.surface.slip1 = s + # getSlip2 def getSlip2(self): + """getSlip2() -> float + + Get the coefficient of force-dependent-slip (FDS) for friction + direction 2. + """ return self._contact.surface.slip2 + # setSlip2 def setSlip2(self, s): + """setSlip2(s) + + Set the coefficient of force-dependent-slip (FDS) for friction + direction 1. + + @param s: FDS coefficient + @type s: float + """ self._contact.surface.slip2 = s + # getFDir1 + def getFDir1(self): + """getFDir1() -> (x, y, z) + + Get the "first friction direction" vector that defines a direction + along which frictional force is applied. + """ + return (self._contact.fdir1[0], self._contact.fdir1[1], self._contact.fdir1[2]) + + # setFDir1 + def setFDir1(self, fdir): + """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). + + @param fdir: Friction direction + @type fdir: 3-sequence of floats + """ + self._contact.fdir1[0] = fdir[0] + self._contact.fdir1[1] = fdir[1] + self._contact.fdir1[2] = fdir[2] + + + # getContactGeomParams def getContactGeomParams(self): ! """getContactGeomParams() -> (pos, normal, depth, geom1, geom2) ! 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. *************** *** 110,122 **** return (pos,normal,depth,g1,g2) ! def setContactGeomParams(self, pos, normal, depth, g1=None, g2=None): ! """Set the ContactGeom structure of the contact. ! pos (3-tuple): Contact position, in global coordinates ! normal (3-tuple): Unit length normal vector ! depth (float): Depth to which the two bodies inter-penetrate. ! g1 (geom object): Geometry objects that collided ! g2 (geom object): '' '' '' """ --- 286,305 ---- return (pos,normal,depth,g1,g2) ! # setContactGeomParams def setContactGeomParams(self, pos, normal, depth, g1=None, g2=None): ! """setContactGeomParams(pos, normal, depth, geom1=None, geom2=None) ! ! Set the ContactGeom structure of the contact. ! @param pos: Contact position, in global coordinates ! @type pos: 3-sequence of floats ! @param normal: Unit length normal vector ! @type normal: 3-sequence of floats ! @param depth: Depth to which the two bodies inter-penetrate ! @type depth: float ! @param geom1: Geometry object 1 that collided ! @type geom1: Geom ! @param geom2: Geometry object 2 that collided ! @type geom2: Geom """ |