--- trunk/SHAPES/RigidBody.cpp 2004/06/15 22:36:23 1275 +++ trunk/SHAPES/RigidBody.cpp 2004/06/17 21:27:38 1276 @@ -15,8 +15,6 @@ void RigidBody::addAtom(VDWAtom* at) { void RigidBody::addAtom(VDWAtom* at) { vec3 coords; - vec3 euler; - mat3x3 Atmp; myAtoms.push_back(at); @@ -175,14 +173,13 @@ void RigidBody::calcRefCoords( ) { void RigidBody::calcRefCoords( ) { - int i,j,k, it, n_linear_coords; + int i, j, it, n_linear_coords; double mtmp; vec3 apos; double refCOM[3]; vec3 ptmp; double Itmp[3][3]; double evals[3]; - double evects[3][3]; double r, r2, len; // First, find the center of mass: @@ -284,7 +281,7 @@ void RigidBody::doEulerToRotMat(vec3 &euler, mat3x3 &m } } -void RigidBody::doEulerToRotMat(vec3 &euler, mat3x3 &myA ){ +void RigidBody::doEulerToRotMat(double euler[3], double myA[3][3] ){ double phi, theta, psi; @@ -344,12 +341,9 @@ void RigidBody::getEulerAngles(double myEuler[3]) { double phi,theta,psi,eps; - double pi; - double cphi,ctheta,cpsi; - double sphi,stheta,spsi; - double b[3]; - int flip[3]; - + double ctheta; + double stheta; + // set the tolerance for Euler angles and rotation elements eps = 1.0e-8; @@ -398,6 +392,29 @@ double RigidBody::min(double x, double y) { double RigidBody::min(double x, double y) { return (x > y) ? y : x; +} + +double RigidBody::findMaxExtent(){ + int i; + double refAtomPos[3]; + double maxExtent; + double tempExtent; + + //zero the extent variables + maxExtent = 0.0; + tempExtent = 0.0; + for (i=0; i<3; i++) + refAtomPos[i] = 0.0; + + //loop over all atoms + for (i=0; i maxExtent) + maxExtent = tempExtent; + } + return maxExtent; } void RigidBody::findCOM() { @@ -406,8 +423,7 @@ void RigidBody::findCOM() { int j; double mtmp; double ptmp[3]; - double vtmp[3]; - + for(j = 0; j < 3; j++) { pos[j] = 0.0; }