8 |
|
objType = OT_RIGIDBODY; |
9 |
|
is_linear = false; |
10 |
|
linear_axis = -1; |
11 |
+ |
momIntTol = 1e-6; |
12 |
|
} |
13 |
|
|
14 |
|
RigidBody::~RigidBody() { |
259 |
|
r[0] = (A[0][0] * rb[0]) + (A[1][0] * rb[1]) + (A[2][0] * rb[2]); |
260 |
|
r[1] = (A[0][1] * rb[0]) + (A[1][1] * rb[1]) + (A[2][1] * rb[2]); |
261 |
|
r[2] = (A[0][2] * rb[0]) + (A[1][2] * rb[1]) + (A[2][2] * rb[2]); |
262 |
+ |
|
263 |
+ |
} |
264 |
+ |
|
265 |
+ |
double RigidBody::getZangle( ){ |
266 |
+ |
return zAngle; |
267 |
+ |
} |
268 |
+ |
|
269 |
+ |
void RigidBody::setZangle( double zAng ){ |
270 |
+ |
zAngle = zAng; |
271 |
+ |
} |
272 |
|
|
273 |
+ |
void RigidBody::addZangle( double zAng ){ |
274 |
+ |
zAngle += zAng; |
275 |
|
} |
276 |
|
|
277 |
|
void RigidBody::calcRefCoords( ) { |
645 |
|
|
646 |
|
//for(atomIter = myAtoms.begin(); atomIter != myAtoms.end(); ++atomIter) |
647 |
|
// (*atomIter)->accept(v); |
648 |
< |
} |
648 |
> |
} |
649 |
> |
|
650 |
> |
void RigidBody::getAtomPos(double theP[3], int index){ |
651 |
> |
vec3 ref; |
652 |
> |
|
653 |
> |
if (index >= myAtoms.size()) |
654 |
> |
cerr << index << " is an invalid index, current rigid body contains " << myAtoms.size() << "atoms" << endl; |
655 |
> |
|
656 |
> |
ref = refCoords[index]; |
657 |
> |
body2Lab(ref.vec); |
658 |
> |
|
659 |
> |
theP[0] = pos[0] + ref[0]; |
660 |
> |
theP[1] = pos[1] + ref[1]; |
661 |
> |
theP[2] = pos[2] + ref[2]; |
662 |
> |
} |
663 |
> |
|
664 |
> |
|
665 |
> |
void RigidBody::getAtomRefCoor(double pos[3], int index){ |
666 |
> |
vec3 ref; |
667 |
> |
|
668 |
> |
ref = refCoords[index]; |
669 |
> |
pos[0] = ref[0]; |
670 |
> |
pos[1] = ref[1]; |
671 |
> |
pos[2] = ref[2]; |
672 |
> |
|
673 |
> |
} |