ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-1.0/utils/sysbuilder/MoLocator.cpp
(Generate patch)

Comparing trunk/OOPSE-1.0/utils/sysbuilder/MoLocator.cpp (file contents):
Revision 1435 by tim, Thu Jul 29 18:16:16 2004 UTC vs.
Revision 1443 by tim, Fri Jul 30 14:44:10 2004 UTC

# Line 16 | Line 16 | void MoLocator::placeMol( const Vector3d& offset, cons
16   }
17  
18   void MoLocator::placeMol( const Vector3d& offset, const Vector3d& ort, Molecule* mol){
19 <  Vector3d newCoor;
20 <  Vector3d velocity(0.0, 0.0, 0.0);
21 <  Vector3d angMomentum(0.0, 0.0, 0.0);
22 <  double quaternion[4];
19 >  double newCoor[3];
20 >  double curRefCoor[3];
21 >  double zeroVector[3];
22    vector<StuntDouble*> myIntegrableObjects;
23    double rotMat[3][3];
24    
25 <  quaternion[0] = 1.0;
26 <  quaternion[1] = 0.0;
27 <  quaternion[2] = 0.0;
28 <  quaternion[3] = 0.0;
30 <
25 >  zeroVector[0] = 0.0;
26 >  zeroVector[1] = 0.0;
27 >  zeroVector[2] = 0.0;
28 >  
29    latVec2RotMat(ort, rotMat);
30    
31    myIntegrableObjects = mol->getIntegrableObjects();
# Line 44 | Line 42 | void MoLocator::placeMol( const Vector3d& offset, cons
42    for(int i=0; i<nIntegrableObjects; i++) {
43  
44      //calculate the reference coordinate for integrable objects after rotation
45 <    matVecMul3(rotMat, refCoords[i].vec, newCoor.vec);    
46 <    newCoor +=  offset;
45 >    curRefCoor[0] = refCoords[i][0];
46 >    curRefCoor[1] = refCoords[i][1];
47 >    curRefCoor[2] = refCoords[i][2];
48 >    
49 >    matVecMul3(rotMat, curRefCoor, newCoor);    
50  
51 <    myIntegrableObjects[i]->setPos( newCoor.vec);
52 <    myIntegrableObjects[i]->setVel(velocity.vec);
51 >    newCoor[0] +=  offset[0];
52 >    newCoor[1] +=  offset[1];
53 >    newCoor[2] +=  offset[2];
54  
55 +    myIntegrableObjects[i]->setPos( newCoor);
56 +    myIntegrableObjects[i]->setVel(zeroVector);
57 +
58      if(myIntegrableObjects[i]->isDirectional()){
59        myIntegrableObjects[i]->setA(rotMat);
60 <      myIntegrableObjects[i]->setJ(angMomentum.vec);  
60 >      myIntegrableObjects[i]->setJ(zeroVector);  
61      }
62    }
63  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines