26 |
|
public: |
27 |
|
|
28 |
|
RigidBody(); |
29 |
+ |
//RigidBody(const RigidBody& rb); |
30 |
+ |
|
31 |
|
virtual ~RigidBody(); |
32 |
|
|
33 |
|
void addAtom(Atom* at, AtomStamp* ats); |
39 |
|
void setVel( double theV[3] ); |
40 |
|
|
41 |
|
void getFrc( double theF[3] ); |
42 |
+ |
void setFrc(double theF[3] ); |
43 |
|
void addFrc( double theF[3] ); |
44 |
|
void zeroForces(); |
45 |
+ |
|
46 |
+ |
virtual bool isLinear() {return is_linear;} |
47 |
+ |
virtual int linearAxis() {return linear_axis;} |
48 |
|
|
49 |
|
double getMass( void ) { return mass; } |
50 |
|
|
51 |
|
void printAmatIndex( void ); |
52 |
< |
void setEulerAngles( double phi, double theta, double psi ); |
52 |
> |
void setEuler( double phi, double theta, double psi ); |
53 |
|
void getQ( double the_q[4] ); // get the quanternions |
54 |
|
void setQ( double the_q[4] ); |
55 |
|
|
59 |
|
void getJ( double theJ[3] ); |
60 |
|
void setJ( double theJ[3] ); |
61 |
|
|
62 |
+ |
virtual void setType(char* type) {strcpy(rbName, type);} |
63 |
+ |
virtual char* getType() { return rbName;} |
64 |
+ |
|
65 |
|
void getTrq( double theT[3] ); |
66 |
+ |
void setTrq(double theT[3]); |
67 |
|
void addTrq( double theT[3] ); |
68 |
|
|
69 |
|
void getI( double the_I[3][3] ); |
70 |
|
void lab2Body( double r[3] ); |
71 |
|
void body2Lab( double r[3] ); |
72 |
|
|
73 |
+ |
double getZangle( ); |
74 |
+ |
void setZangle( double zAng ); |
75 |
+ |
void addZangle( double zAng ); |
76 |
+ |
|
77 |
|
void calcRefCoords( void ); |
78 |
|
void doEulerToRotMat(vec3 &euler, mat3x3 &myA ); |
79 |
|
void calcForcesAndTorques( void ); |
94 |
|
// utility routines |
95 |
|
|
96 |
|
void findCOM( void ); |
97 |
< |
void findOrient( void ); |
98 |
< |
|
97 |
> |
|
98 |
> |
virtual void accept(BaseVisitor* v); |
99 |
> |
|
100 |
> |
vector<Atom*> getAtoms() { return myAtoms;} |
101 |
> |
int getNumAtoms() {return myAtoms.size();} |
102 |
> |
|
103 |
> |
void getAtomPos(double theP[3], int index); |
104 |
> |
void getAtomVel(double theV[3], int index); |
105 |
> |
void getAtomRefCoor(double pos[3], int index); |
106 |
|
protected: |
107 |
|
|
108 |
|
double mass; // the total mass |
114 |
|
double A[3][3]; // the rotation matrix |
115 |
|
double I[3][3]; // the inertial tensor (body fixed) |
116 |
|
double sU[3][3]; // the standard unit vectors (body fixed) |
117 |
+ |
double zAngle; // the rotation about the z-axis (body fixed) |
118 |
|
|
119 |
+ |
bool is_linear; |
120 |
+ |
int linear_axis; |
121 |
+ |
double momIntTol; |
122 |
+ |
|
123 |
|
vector<Atom*> myAtoms; // the vector of atoms |
124 |
|
vector<vec3> refCoords; |
125 |
|
vector<mat3x3> refOrients; |
126 |
|
|
127 |
< |
bool com_good; |
102 |
< |
bool forces_good; |
103 |
< |
bool precalc_done; |
104 |
< |
bool orient_good; |
127 |
> |
char rbName[100]; //it will eventually be converted into string |
128 |
|
}; |
129 |
|
|
130 |
|
#endif |