[cgkit-commits] cgkit2/cgkit odedynamics.py,1.5,1.6
Brought to you by:
mbaas
From: Matthias B. <mb...@us...> - 2005-05-31 16:00:45
|
Update of /cvsroot/cgkit/cgkit2/cgkit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3642/cgkit Modified Files: odedynamics.py Log Message: Removed the numarray/linalg dependency (for now) as it wasn't used anyway Index: odedynamics.py =================================================================== RCS file: /cvsroot/cgkit/cgkit2/cgkit/odedynamics.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** odedynamics.py 19 Apr 2005 08:45:16 -0000 1.5 --- odedynamics.py 31 May 2005 16:00:25 -0000 1.6 *************** *** 50,55 **** has_ode = False ! import numarray ! import numarray.linear_algebra --- 50,55 ---- has_ode = False ! #import numarray ! #import numarray.linear_algebra *************** *** 65,72 **** cfm = None, erp = None, - # contactproperties = [], defaultcontactproperties = None, enabled = True, show_contacts = False, auto_add = False, auto_insert=True): --- 65,73 ---- cfm = None, erp = None, defaultcontactproperties = None, enabled = True, show_contacts = False, + contactmarkersize = 0.1, + contactnormalsize = 1.0, auto_add = False, auto_insert=True): *************** *** 124,127 **** --- 125,130 ---- self.show_contacts = show_contacts + self.contactmarkersize = contactmarkersize + self.contactnormalsize = contactnormalsize # A list of weakrefs to body manipulators *************** *** 186,206 **** # print "Intermediate inertia tensor:" # print obj.inertiatensor ! I = obj.inertiatensor ! a = numarray.array([I.getRow(0), I.getRow(1), I.getRow(2)], type=numarray.Float64) ! vals, vecs = numarray.linear_algebra.eigenvectors(a) # print "Eigenvalues:",vals # Eigenvektoren sind ungenau! (bei cube_base_cog grosse Abweichungen) ! b1 = vec3(vecs[0]).normalize() ! b2 = vec3(vecs[1]).normalize() ! b3 = vec3(vecs[2]).normalize() ! P = obj.getOffsetTransform() ! Pnull = P*vec3(0,0,0) ! b1 = P*b1 - Pnull ! b2 = P*b2 - Pnull ! b3 = P*b3 - Pnull ! I2 = mat3(b1,b2,b3) # print I2 ! if I2.determinant()<0: ! I2.setColumn(0, -I2.getColumn(0)) # print "Det of new basis",I2.determinant() # P = obj.getOffsetTransform() --- 189,209 ---- # print "Intermediate inertia tensor:" # print obj.inertiatensor ! # I = obj.inertiatensor ! # a = numarray.array([I.getRow(0), I.getRow(1), I.getRow(2)], type=numarray.Float64) ! # vals, vecs = numarray.linear_algebra.eigenvectors(a) # print "Eigenvalues:",vals # Eigenvektoren sind ungenau! (bei cube_base_cog grosse Abweichungen) ! # b1 = vec3(vecs[0]).normalize() ! # b2 = vec3(vecs[1]).normalize() ! # b3 = vec3(vecs[2]).normalize() ! # P = obj.getOffsetTransform() ! # Pnull = P*vec3(0,0,0) ! # b1 = P*b1 - Pnull ! # b2 = P*b2 - Pnull ! # b3 = P*b3 - Pnull ! # I2 = mat3(b1,b2,b3) # print I2 ! # if I2.determinant()<0: ! # I2.setColumn(0, -I2.getColumn(0)) # print "Det of new basis",I2.determinant() # P = obj.getOffsetTransform() *************** *** 283,288 **** if self.show_contacts: p,n,d,g1,g2 = c.getContactGeomParams() ! cmds.drawMarker(p, size=0.2, color=(1,0,0)) ! cmds.drawLine(p, vec3(p)+vec3(n), color=(1,0.5,0.5)) # print p,n,d --- 286,291 ---- if self.show_contacts: p,n,d,g1,g2 = c.getContactGeomParams() ! cmds.drawMarker(p, size=self.contactmarkersize, color=(1,0,0)) ! cmds.drawLine(p, vec3(p)+self.contactnormalsize*vec3(n), color=(1,0.5,0.5)) # print p,n,d |