[Plib-cvs] plib/src/sg sg.h,1.40,1.41
Brought to you by:
sjbaker
From: Steve B. <sj...@us...> - 2002-08-11 17:53:52
|
Update of /cvsroot/plib/plib/src/sg In directory usw-pr-cvs1:/tmp/cvs-serv29899/plib/src/sg Modified Files: sg.h Log Message: Lots of Typo's. Index: sg.h =================================================================== RCS file: /cvsroot/plib/plib/src/sg/sg.h,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- sg.h 11 Aug 2002 16:18:40 -0000 1.40 +++ sg.h 11 Aug 2002 17:53:49 -0000 1.41 @@ -2701,6 +2701,7 @@ void zeroForce () { sgZeroVec3 ( force ) ; } void addForce ( sgVec3 f ) { sgAddVec3 ( force, f ) ; } + void subForce ( sgVec3 f ) { sgSubVec3 ( force, f ) ; } void gravityOnly () { sgScaleVec3 ( force, sgGetGravityVec3 (), ooMass ) ; } void update ( float dt ) @@ -2775,10 +2776,10 @@ float H = ( L - restLength ) * stiffness ; float D = sgScalarProductVec3 ( dV, dP ) * damping / L ; - sgVec3 F ; sgScaleVec3 ( dP, - ( H + D ) / L ) ; + sgVec3 F ; sgScaleVec3 ( F, dP, - ( H + D ) / L ) ; p0 -> addForce ( F ) ; - p1 -> addForce ( F ) ; + p1 -> subForce ( F ) ; } } ; |