--- trunk/OOPSE/libmdtools/RigidBody.cpp 2004/04/19 20:54:58 1120 +++ trunk/OOPSE/libmdtools/RigidBody.cpp 2004/06/09 16:16:33 1254 @@ -8,6 +8,7 @@ RigidBody::RigidBody() : StuntDouble() { objType = OT_RIGIDBODY; is_linear = false; linear_axis = -1; + momIntTol = 1e-6; } RigidBody::~RigidBody() { @@ -258,7 +259,19 @@ void RigidBody::body2Lab( double r[3] ){ r[0] = (A[0][0] * rb[0]) + (A[1][0] * rb[1]) + (A[2][0] * rb[2]); r[1] = (A[0][1] * rb[0]) + (A[1][1] * rb[1]) + (A[2][1] * rb[2]); r[2] = (A[0][2] * rb[0]) + (A[1][2] * rb[1]) + (A[2][2] * rb[2]); + +} + +double RigidBody::getZangle( ){ + return zAngle; +} + +void RigidBody::setZangle( double zAng ){ + zAngle = zAng; +} +void RigidBody::addZangle( double zAng ){ + zAngle += zAng; } void RigidBody::calcRefCoords( ) { @@ -632,4 +645,29 @@ void RigidBody::accept(BaseVisitor* v){ //for(atomIter = myAtoms.begin(); atomIter != myAtoms.end(); ++atomIter) // (*atomIter)->accept(v); -} \ No newline at end of file +} + +void RigidBody::getAtomPos(double theP[3], int index){ + vec3 ref; + + if (index >= myAtoms.size()) + cerr << index << " is an invalid index, current rigid body contains " << myAtoms.size() << "atoms" << endl; + + ref = refCoords[index]; + body2Lab(ref.vec); + + theP[0] = pos[0] + ref[0]; + theP[1] = pos[1] + ref[1]; + theP[2] = pos[2] + ref[2]; +} + + +void RigidBody::getAtomRefCoor(double pos[3], int index){ + vec3 ref; + + ref = refCoords[index]; + pos[0] = ref[0]; + pos[1] = ref[1]; + pos[2] = ref[2]; + +}