43 #include "FGFDMExec.h"
44 #include "models/FGMassBalance.h"
45 #include "models/FGAuxiliary.h"
54 : fdmex(FDMExec), MassBalance(fdmex->GetMassBalance()), ttype(tNone)
60 vActingXYZn.InitMatrix();
83 vFb = Transform()*vFn;
98 const FGMatrix33& FGForce::Transform(
void)
const
110 const string s(
"Unrecognized tranform requested from FGForce::Transform()");
112 throw BaseException(s);
119 void FGForce::UpdateCustomTransformMatrix(
void)
121 double cp,sp,cr,sr,cy,sy;
122 double srsp, crcy, crsy;
124 cp=cos(vOrient(ePitch)); sp=sin(vOrient(ePitch));
125 cr=cos(vOrient(eRoll)); sr=sin(vOrient(eRoll));
126 cy=cos(vOrient(eYaw)); sy=sin(vOrient(eYaw));
136 mT(1,2) = srsp*cy - crsy;
137 mT(2,2) = srsp*sy + crcy;
140 mT(1,3) = crcy*sp + sr*sy;
141 mT(2,3) = crsy*sp - sr*cy;
147 void FGForce::SetAnglesToBody(
double broll,
double bpitch,
double byaw)
149 if (ttype == tCustom) {
150 vOrient(ePitch) = bpitch;
151 vOrient(eRoll) = broll;
152 vOrient(eYaw) = byaw;
154 UpdateCustomTransformMatrix();
177 void FGForce::Debug(
int from)
179 if (debug_lvl <= 0)
return;
186 if (debug_lvl & 2 ) {
187 if (from == 0) cout <<
"Instantiated: FGForce" << endl;
188 if (from == 1) cout <<
"Destroyed: FGForce" << endl;
190 if (debug_lvl & 4 ) {
192 if (debug_lvl & 8 ) {
194 if (debug_lvl & 16) {
196 if (debug_lvl & 64) {