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(); |
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 |
|
|