--- trunk/OOPSE/libmdtools/StuntDouble.cpp 2004/06/04 21:00:20 1250 +++ trunk/OOPSE/libmdtools/StuntDouble.cpp 2004/08/23 15:11:36 1452 @@ -138,6 +138,7 @@ void StuntDouble::setVel(double vel[3]){ } void StuntDouble::setVel(double vel[3]){ + switch (objType) { case OT_ATOM : @@ -156,6 +157,26 @@ void StuntDouble::setVel(double vel[3]){ } } +void StuntDouble::setFrc(double frc[3]){ + + switch (objType) + { + case OT_ATOM : + case OT_DATOM: + ((Atom*)this)->setFrc(frc); + break; + case OT_RIGIDBODY: + ((RigidBody*)this)->setFrc(frc); + break; + default: + sprintf( painCave.errMsg, + "Unrecognized ObjType (%d) in StuntDouble::setFrc.\n", + objType ); + painCave.isFatal = 1; + simError(); + } +} + void StuntDouble::addFrc(double frc[3]){ switch (objType) { @@ -364,6 +385,31 @@ void StuntDouble::getTrq(double trq[3]){ painCave.isFatal = 1; simError(); } +} + +void StuntDouble::setTrq(double trq[3]){ + switch (objType) + { + case OT_ATOM: + sprintf( painCave.errMsg, + "StuntDouble::setTrq was called for a regular atom.\n" + "\tRegular Atoms don't have torques. Be smarter.\n"); + painCave.isFatal = 1; + simError(); + break; + case OT_DATOM: + ((DirectionalAtom*)this)->setTrq(trq); + break; + case OT_RIGIDBODY: + ((RigidBody*)this)->setTrq(trq); + break; + default: + sprintf( painCave.errMsg, + "Unrecognized ObjType (%d) in StuntDouble::addTrq.\n", + objType ); + painCave.isFatal = 1; + simError(); + } } void StuntDouble::addTrq(double trq[3]){