--- trunk/SHAPES/GridBuilder.cpp 2004/06/18 19:01:40 1279 +++ trunk/SHAPES/GridBuilder.cpp 2004/06/18 19:40:31 1280 @@ -4,104 +4,105 @@ GridBuilder::GridBuilder(RigidBody* rb, int bandWidth) GridBuilder::GridBuilder(RigidBody* rb, int bandWidth) { - rbMol = rb; - bandwidth = bandWidth; - thetaStep = PI / bandwidth; - thetaMin = thetaStep / 2.0; - phiStep = thetaStep * 2.0; + rbMol = rb; + bandwidth = bandWidth; + thetaStep = PI / bandwidth; + thetaMin = thetaStep / 2.0; + phiStep = thetaStep * 2.0; - //zero out the rot mats - for (i=0; i<3; i++) { - for (j=0; j<3; j++) { - rotX[i][j] = 0.0; - rotZ[i][j] = 0.0; - rbMatrix[i][j] = 0.0; - } - } + //zero out the rot mats + for (i=0; i<3; i++) { + for (j=0; j<3; j++) { + rotX[i][j] = 0.0; + rotZ[i][j] = 0.0; + rbMatrix[i][j] = 0.0; + } + } } GridBuilder::~GridBuilder() { } void GridBuilder::launchProbe(int forceField, vector sigmaGrid, vector sGrid, - vector epsGrid){ - double startDist; - double minDist = 10.0; //minimum start distance + vector epsGrid){ + double startDist; + double minDist = 10.0; //minimum start distance - //first determine the start distance - we always start at least minDist away - startDist = rbMol->findMaxExtent() + minDist; - if (startDist < minDist) - startDist = minDist; + forcefield = forceField; + + //first determine the start distance - we always start at least minDist away + startDist = rbMol->findMaxExtent() + minDist; + if (startDist < minDist) + startDist = minDist; - initBody(); - for (i=0; idoEulerToRotMat(angles, rotX); + //obtain the rotation matrix through the rigid body class + rbMol->doEulerToRotMat(angles, rotX); - //rotate the rigid body - rbMol->getA(rbMatrix); - matMul3(rotX, rbMatrix, rotatedMat); - rbMol->setA(rotatedMat); - + //rotate the rigid body + rbMol->getA(rbMatrix); + matMul3(rotX, rbMatrix, rotatedMat); + rbMol->setA(rotatedMat); } void GridBuilder::stepPhi(double increment){ - //zero out the euler angles - for (i=0; i<3; i++) - angles[i] = 0.0; + //zero out the euler angles + for (i=0; i<3; i++) + angles[i] = 0.0; - //the phi euler angle is for rotation about the z-axis (we use the zxz convention) - angles[0] = increment; + //the phi euler angle is for rotation about the z-axis (we use the zxz convention) + angles[0] = increment; - //obtain the rotation matrix through the rigid body class - rbMol->doEulerToRotMat(angles, rotZ); + //obtain the rotation matrix through the rigid body class + rbMol->doEulerToRotMat(angles, rotZ); - //rotate the rigid body - rbMol->getA(rbMatrix); - matMul3(rotZ, rbMatrix, rotatedMat); - rbMol->setA(rotatedMat); - + //rotate the rigid body + rbMol->getA(rbMatrix); + matMul3(rotZ, rbMatrix, rotatedMat); + rbMol->setA(rotatedMat); }